@@ -8,8 +8,11 @@ import { join, parse } from 'node:path';
8
8
import fs from 'graceful-fs' ;
9
9
import JSZip from 'jszip' ;
10
10
import { 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' ;
12
14
import { ensureArray } from '@salesforce/kit' ;
15
+ import { RegistryAccess } from '../registry/registryAccess' ;
13
16
import { ComponentSet } from '../collections/componentSet' ;
14
17
import { MetadataTransfer } from './metadataTransfer' ;
15
18
import {
@@ -46,9 +49,10 @@ export class RetrieveResult implements MetadataTransferResult {
46
49
public readonly response : MetadataApiRetrieveStatus ,
47
50
public readonly components : ComponentSet ,
48
51
localComponents ?: ComponentSet ,
49
- private partialDeleteFileResponses : FileResponse [ ] = [ ]
52
+ private partialDeleteFileResponses : FileResponse [ ] = [ ] ,
53
+ registry ?: RegistryAccess
50
54
) {
51
- this . localComponents = new ComponentSet ( localComponents ?. getSourceComponents ( ) ) ;
55
+ this . localComponents = new ComponentSet ( localComponents ?. getSourceComponents ( ) , registry ) ;
52
56
}
53
57
54
58
public getFileResponses ( ) : FileResponse [ ] {
@@ -196,10 +200,15 @@ export class MetadataApiRetrieve extends MetadataTransfer<
196
200
} ) ) ;
197
201
}
198
202
}
199
-
200
203
componentSet ??= new ComponentSet ( undefined , this . options . registry ) ;
201
204
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
+ ) ;
203
212
if ( ! isMdapiRetrieve && ! this . options . suppressEvents ) {
204
213
// This should only be done when retrieving source format since retrieving
205
214
// mdapi format has no conversion or events/hooks
@@ -209,7 +218,6 @@ export class MetadataApiRetrieve extends MetadataTransfer<
209
218
orgId : this . orgId ,
210
219
} as ScopedPostRetrieve ) ;
211
220
}
212
-
213
221
return retrieveResult ;
214
222
}
215
223
@@ -245,7 +253,9 @@ export class MetadataApiRetrieve extends MetadataTransfer<
245
253
apiVersion : this . components ?. sourceApiVersion ?? ( await connection . retrieveMaxApiVersion ( ) ) ,
246
254
...( manifestData ? { unpackaged : manifestData } : { } ) ,
247
255
...( 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
+ : { } ) ,
249
259
// if we're retrieving with packageNames add it
250
260
// otherwise don't - it causes errors if undefined or an empty array
251
261
...( packageNames . length ? { packageNames } : { } ) ,
0 commit comments