Skip to content

Commit 3830c7b

Browse files
Merge pull request #1062 from salesforcecli/hc/support-recommendedversionid-field
W-19743455 - feat: add recommended-version-id to package update
2 parents 1c3631b + b9c0604 commit 3830c7b

5 files changed

Lines changed: 22 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ Update package details.
794794
```
795795
USAGE
796796
$ sf package update -v <value> -p <value> [--json] [--flags-dir <value>] [--api-version <value>] [-n <value>] [-d
797-
<value>] [-o <value>] [--enable-app-analytics]
797+
<value>] [-o <value>] [-r <value>] [--enable-app-analytics]
798798
799799
FLAGS
800800
-d, --description=<value> New description of the package.
@@ -804,6 +804,7 @@ FLAGS
804804
-p, --package=<value> (required) ID (starts with 0Ho) or alias of the package to update.
805805
-v, --target-dev-hub=<value> (required) Username or alias of the Dev Hub org. Not required if the
806806
`target-dev-hub` configuration variable is already set.
807+
-r, --recommended-version-id Package version ID (starts with 04t) that subscribers are notified to install or upgrade to
807808
--api-version=<value> Override the api version used for api requests made by this command
808809
--[no-]enable-app-analytics Enable AppExchange App Analytics usage data collection on this managed
809810
package and its components.

command-snapshot.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@
363363
"alias": ["force:package:update"],
364364
"command": "package:update",
365365
"flagAliases": ["apiversion", "errornotificationusername", "target-hub-org", "targetdevhubusername"],
366-
"flagChars": ["d", "n", "o", "p", "v"],
366+
"flagChars": ["d", "n", "o", "p", "v", "r"],
367367
"flags": [
368368
"api-version",
369369
"description",
@@ -374,7 +374,8 @@
374374
"loglevel",
375375
"name",
376376
"package",
377-
"target-dev-hub"
377+
"target-dev-hub",
378+
"recommended-version-id"
378379
],
379380
"plugin": "@salesforce/plugin-packaging"
380381
},

messages/package_update.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,11 @@ Enable AppExchange App Analytics usage data collection on this managed package a
3737
# success
3838

3939
Successfully updated the package. %s
40+
41+
# flags.recommended-version-id.summary
42+
43+
Package version ID that subscribers are notified to install or upgrade to.
44+
45+
# flags.recommended-version-id.description
46+
47+
Specify the recommended package version for subscribers to install. Subscribers are notified to install the package version ID that you specify. If the subscribers have a different version of the same package installed, they're notified to upgrade to the recommended version.

schemas/package-version-report.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@
7878
},
7979
"IsOrgDependent": {
8080
"type": "string"
81+
},
82+
"RecommendedVersionId": {
83+
"type": "string"
8184
}
8285
},
8386
"additionalProperties": false

src/commands/package/update.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ export class PackageUpdateCommand extends SfCommand<PackageSaveResult> {
5959
summary: messages.getMessage('flags.enable-app-analytics.summary'),
6060
allowNo: true,
6161
}),
62+
'recommended-version-id': Flags.string({
63+
char: 'r',
64+
summary: messages.getMessage('flags.recommended-version-id.summary'),
65+
description: messages.getMessage('flags.recommended-version-id.description'),
66+
}),
6267
};
6368

6469
public async run(): Promise<PackageSaveResult> {
@@ -76,6 +81,7 @@ export class PackageUpdateCommand extends SfCommand<PackageSaveResult> {
7681
Description: flags.description,
7782
PackageErrorUsername: flags['error-notification-username'],
7883
AppAnalyticsEnabled: flags['enable-app-analytics'],
84+
RecommendedVersionId: flags['recommended-version-id'],
7985
});
8086

8187
this.logSuccess(messages.getMessage('success', [pkg.getId()]));

0 commit comments

Comments
 (0)