Skip to content

Commit 31d12db

Browse files
feat(W-17369132): reflect feat change to use Package2Version instead of MetadataP… (#984)
* feat: reflect feat change to use Package2Version instead of MetadataPackageVerison API for retrieve * feat: update help text to indicate this is currently for only conversion 2GPs * feat: unhide package retrieve and rev vers for saleseforce/core and salesforce/packaging * feat: unhide package retrieve and rev vers for saleseforce/core and salesforce/packaging * feat: update schema iwth DeveloperUsePkgZip * feat: remove DeveloperUsePkgZip from report schema * Revert "feat: remove DeveloperUsePkgZip from report schema" This reverts commit e2c3e61. * chore: bump packaging * feat: remove DeveloperUsePkgZip from report schema --------- Co-authored-by: Willie Ruemmele <willieruemmele@gmail.com>
1 parent af78f79 commit 31d12db

8 files changed

Lines changed: 2720 additions & 2402 deletions

File tree

command-snapshot.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,9 @@
417417
{
418418
"alias": [],
419419
"command": "package:version:retrieve",
420-
"flagAliases": ["apiversion", "targetusername", "u"],
421-
"flagChars": ["d", "o", "p"],
422-
"flags": ["api-version", "flags-dir", "json", "loglevel", "output-dir", "package", "target-org"],
420+
"flagAliases": ["apiversion", "targetdevhubusername"],
421+
"flagChars": ["d", "p", "v"],
422+
"flags": ["api-version", "flags-dir", "json", "loglevel", "output-dir", "package", "target-dev-hub"],
423423
"plugin": "@salesforce/plugin-packaging"
424424
},
425425
{

messages/package_pushupgrade_schedule.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Filename of the CSV file that contains the list of subscriber org IDs that need
4040

4141
# flags.org-file.description
4242

43-
The file must contain one org per line. The org ID must be the only value in each row.
43+
The file must contain one org per line. The org ID must be the only value in each row.
4444
All listed orgs must have a package version installed in their org that is lower than the package version you specified for the --package flag.
4545

4646
# flags.org-list.summary

messages/package_version_retrieve.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
# summary
22

3-
Retrieve package metadata for a specified package version.
3+
Retrieve package metadata for a specified package version. Package metadata can be retrieved for converted second-generation managed package versions only.
44

55
# description
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.
10-
119
Specify the subscriber package version ID (starts with 04t) and the path to an empty directory when you run this command.
1210

1311
# examples
1412

15-
- Retrieve package metadata for a subscriber package version ID (starts with 04t) into my-folder/ within your Salesforce DX project directory:
16-
17-
<%= config.bin %> <%= command.id %> --package 04t... --output-dir my-folder –-target-org my-scratch
13+
- Retrieve package metadata for a converted subscriber package version ID (starts with 04t) into my-folder/ within your Salesforce DX project directory:
1814

19-
If you omit --target-org, this command runs against your default org.
15+
<%= config.bin %> <%= command.id %> --package 04t... --output-dir my-folder –-target-dev-hub my-devhub
2016

2117
# flags.package.summary
2218

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"bugs": "https://github.com/forcedotcom/cli/issues",
77
"dependencies": {
88
"@oclif/core": "^4",
9-
"@salesforce/core": "^8.12.0",
9+
"@salesforce/core": "^8.15.0",
1010
"@salesforce/kit": "^3.2.3",
11-
"@salesforce/packaging": "^4.7.0",
11+
"@salesforce/packaging": "^4.9.0",
1212
"@salesforce/sf-plugins-core": "^12.2.2",
1313
"chalk": "^5.4.1"
1414
},

src/commands/package/version/report.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'package_
2424
const pvlMessages = Messages.loadMessages('@salesforce/plugin-packaging', 'package_version_list');
2525
const plMessages = Messages.loadMessages('@salesforce/plugin-packaging', 'package_list');
2626

27-
const omissions = ['CodeCoverage', 'HasPassedCodeCoverageCheck', 'Package2', 'HasMetadataRemoved'] as const;
27+
const omissions = [
28+
'CodeCoverage',
29+
'HasPassedCodeCoverageCheck',
30+
'Package2',
31+
'HasMetadataRemoved',
32+
'DeveloperUsePkgZip',
33+
] as const;
2834
type Omission = (typeof omissions)[number];
2935

3036
export type PackageVersionReportResultModified = Omit<PackageVersionReportResult, Omission> & {

src/commands/package/version/retrieve.ts

Lines changed: 3 additions & 4 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';
@@ -28,15 +28,14 @@ export type FileDownloadEntry = {
2828
export type PackageVersionRetrieveCommandResult = FileDownloadEntry[];
2929

3030
export class PackageVersionRetrieveCommand extends SfCommand<PackageVersionRetrieveCommandResult> {
31-
public static readonly hidden = true;
3231
public static readonly summary = messages.getMessage('summary');
3332
public static readonly description = messages.getMessage('description');
3433
public static readonly examples = messages.getMessages('examples');
3534
public static readonly requiresProject = true;
3635
public static readonly flags = {
3736
loglevel,
3837
'api-version': orgApiVersionFlagWithDeprecations,
39-
'target-org': requiredOrgFlagWithDeprecations,
38+
'target-dev-hub': requiredHubFlagWithDeprecations,
4039
package: Flags.string({
4140
char: 'p',
4241
summary: messages.getMessage('flags.package.summary'),
@@ -51,7 +50,7 @@ export class PackageVersionRetrieveCommand extends SfCommand<PackageVersionRetri
5150

5251
public async run(): Promise<PackageVersionRetrieveCommandResult> {
5352
const { flags } = await this.parse(PackageVersionRetrieveCommand);
54-
const connection = flags['target-org'].getConnection(flags['api-version']);
53+
const connection = flags['target-dev-hub'].getConnection(flags['api-version']);
5554
const options = {
5655
subscriberPackageVersionId: flags.package ?? '',
5756
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)