Skip to content

Commit a28143e

Browse files
committed
feat: reflect feat change to use Package2Version instead of MetadataPackageVerison API for retrieve
1 parent c696a47 commit a28143e

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

command-snapshot.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,9 @@
415415
{
416416
"alias": [],
417417
"command": "package:version:retrieve",
418-
"flagAliases": ["apiversion", "targetusername", "u"],
419-
"flagChars": ["d", "o", "p"],
420-
"flags": ["api-version", "flags-dir", "json", "loglevel", "output-dir", "package", "target-org"],
418+
"flagAliases": ["apiversion", "targetdevhubusername"],
419+
"flagChars": ["d", "p", "v"],
420+
"flags": ["api-version", "flags-dir", "json", "loglevel", "output-dir", "package", "target-dev-hub"],
421421
"plugin": "@salesforce/plugin-packaging"
422422
},
423423
{

messages/package_version_retrieve.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Retrieve package metadata for a specified package version.
66

77
Retrieving a package version downloads the metadata into the directory you specify.
88

9-
You can retrieve metadata for a second- or first-generation managed package, or an unlocked package.
9+
You can retrieve metadata for a second-generation managed package or an unlocked package.
1010

1111
Specify the subscriber package version ID (starts with 04t) and the path to an empty directory when you run this command.
1212

src/commands/package/version/retrieve.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
Flags,
1111
loglevel,
1212
orgApiVersionFlagWithDeprecations,
13-
requiredOrgFlagWithDeprecations,
13+
requiredHubFlagWithDeprecations,
1414
SfCommand,
1515
} from '@salesforce/sf-plugins-core';
1616
import { Messages } from '@salesforce/core/messages';
@@ -36,7 +36,7 @@ export class PackageVersionRetrieveCommand extends SfCommand<PackageVersionRetri
3636
public static readonly flags = {
3737
loglevel,
3838
'api-version': orgApiVersionFlagWithDeprecations,
39-
'target-org': requiredOrgFlagWithDeprecations,
39+
'target-dev-hub': requiredHubFlagWithDeprecations,
4040
package: Flags.string({
4141
char: 'p',
4242
summary: messages.getMessage('flags.package.summary'),
@@ -51,7 +51,7 @@ export class PackageVersionRetrieveCommand extends SfCommand<PackageVersionRetri
5151

5252
public async run(): Promise<PackageVersionRetrieveCommandResult> {
5353
const { flags } = await this.parse(PackageVersionRetrieveCommand);
54-
const connection = flags['target-org'].getConnection(flags['api-version']);
54+
const connection = flags['target-dev-hub'].getConnection(flags['api-version']);
5555
const options = {
5656
subscriberPackageVersionId: flags.package ?? '',
5757
destinationFolder: flags['output-dir'],

test/commands/package/packageVersionRetrieve.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('package:version:retrieve - tests', () => {
6767
describe('package:version:retrieve', () => {
6868
it('should display retrieved files', async () => {
6969
downloadStub.resolves(pkgVersionRetrieveSuccessResult);
70-
const cmd = new PackageVersionRetrieveCommand(['-p', myPackageVersion04t, '-o', 'test@dev.org'], config);
70+
const cmd = new PackageVersionRetrieveCommand(['-p', myPackageVersion04t, '-v', 'test@dev.org'], config);
7171
const res = await cmd.run();
7272
expect(res).to.deep.equal(expectedRetrievedComponents);
7373
});

0 commit comments

Comments
 (0)