@@ -8,8 +8,11 @@ import { join, parse } from 'node:path';
88import fs from 'graceful-fs' ;
99import JSZip from 'jszip' ;
1010import { asBoolean , isString } from '@salesforce/ts-types' ;
11- import { Messages , SfError , Lifecycle } from '@salesforce/core' ;
11+ import { Messages } from '@salesforce/core/messages' ;
12+ import { SfError } from '@salesforce/core/sfError' ;
13+ import { Lifecycle } from '@salesforce/core/lifecycle' ;
1214import { ensureArray } from '@salesforce/kit' ;
15+ import { RegistryAccess } from '../registry/registryAccess' ;
1316import { ComponentSet } from '../collections/componentSet' ;
1417import { MetadataTransfer } from './metadataTransfer' ;
1518import {
@@ -46,9 +49,10 @@ export class RetrieveResult implements MetadataTransferResult {
4649 public readonly response : MetadataApiRetrieveStatus ,
4750 public readonly components : ComponentSet ,
4851 localComponents ?: ComponentSet ,
49- private partialDeleteFileResponses : FileResponse [ ] = [ ]
52+ private partialDeleteFileResponses : FileResponse [ ] = [ ] ,
53+ registry ?: RegistryAccess
5054 ) {
51- this . localComponents = new ComponentSet ( localComponents ?. getSourceComponents ( ) ) ;
55+ this . localComponents = new ComponentSet ( localComponents ?. getSourceComponents ( ) , registry ) ;
5256 }
5357
5458 public getFileResponses ( ) : FileResponse [ ] {
@@ -196,10 +200,15 @@ export class MetadataApiRetrieve extends MetadataTransfer<
196200 } ) ) ;
197201 }
198202 }
199-
200203 componentSet ??= new ComponentSet ( undefined , this . options . registry ) ;
201204
202- const retrieveResult = new RetrieveResult ( result , componentSet , this . components , partialDeleteFileResponses ) ;
205+ const retrieveResult = new RetrieveResult (
206+ result ,
207+ componentSet ,
208+ this . components ,
209+ partialDeleteFileResponses ,
210+ this . options . registry
211+ ) ;
203212 if ( ! isMdapiRetrieve && ! this . options . suppressEvents ) {
204213 // This should only be done when retrieving source format since retrieving
205214 // mdapi format has no conversion or events/hooks
@@ -209,7 +218,6 @@ export class MetadataApiRetrieve extends MetadataTransfer<
209218 orgId : this . orgId ,
210219 } as ScopedPostRetrieve ) ;
211220 }
212-
213221 return retrieveResult ;
214222 }
215223
@@ -245,7 +253,9 @@ export class MetadataApiRetrieve extends MetadataTransfer<
245253 apiVersion : this . components ?. sourceApiVersion ?? ( await connection . retrieveMaxApiVersion ( ) ) ,
246254 ...( manifestData ? { unpackaged : manifestData } : { } ) ,
247255 ...( this . options . singlePackage ? { singlePackage : this . options . singlePackage } : { } ) ,
248- ...( this . options . rootTypesWithDependencies ? { rootTypesWithDependencies : this . options . rootTypesWithDependencies } : { } ) ,
256+ ...( this . options . rootTypesWithDependencies
257+ ? { rootTypesWithDependencies : this . options . rootTypesWithDependencies }
258+ : { } ) ,
249259 // if we're retrieving with packageNames add it
250260 // otherwise don't - it causes errors if undefined or an empty array
251261 ...( packageNames . length ? { packageNames } : { } ) ,
0 commit comments