@salesforce/packaging 4.14.1 → 4.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,6 +36,7 @@ export type PackageUpdateOptions = {
36
36
  Description?: string;
37
37
  PackageErrorUsername?: string;
38
38
  AppAnalyticsEnabled?: boolean;
39
+ RecommendedVersionId?: string;
39
40
  };
40
41
  export type PackageIdType = 'PackageId' | 'SubscriberPackageVersionId' | 'PackageInstallRequestId' | 'PackageUninstallRequestId';
41
42
  export type PackageVersionOptions1GP = Record<string, unknown>;
@@ -19,6 +19,7 @@ export declare namespace PackagingSObjects {
19
19
  ConvertedFromPackageId: string;
20
20
  PackageErrorUsername: string;
21
21
  AppAnalyticsEnabled?: boolean;
22
+ RecommendedVersionId?: string;
22
23
  };
23
24
  type Package2Version = {
24
25
  Id: string;
@@ -36,6 +36,7 @@ exports.Package2Fields = [
36
36
  'ConvertedFromPackageId',
37
37
  'PackageErrorUsername',
38
38
  'AppAnalyticsEnabled',
39
+ 'RecommendedVersionId',
39
40
  ];
40
41
  /**
41
42
  * Provides the ability to list, create, update, delete, convert, and get version
@@ -179,7 +180,7 @@ class Package {
179
180
  }
180
181
  static getPackage2Fields(connection) {
181
182
  const apiVersion = connection.getApiVersion();
182
- return exports.Package2Fields.filter((field) => (apiVersion >= '59.0' ? true : field !== 'AppAnalyticsEnabled'));
183
+ return exports.Package2Fields.filter((field) => (apiVersion >= '59.0' ? true : field !== 'AppAnalyticsEnabled')).filter((field) => (apiVersion >= '66.0' ? true : field !== 'RecommendedVersionId'));
183
184
  }
184
185
  /**
185
186
  * Returns the package ID of the package.
@@ -240,6 +241,9 @@ class Package {
240
241
  if (opts.AppAnalyticsEnabled !== undefined && this.options.connection.getApiVersion() < '59.0') {
241
242
  throw messages.createError('appAnalyticsEnabledApiPriorTo59Error');
242
243
  }
244
+ if (opts.RecommendedVersionId !== undefined && this.options.connection.getApiVersion() < '66.0') {
245
+ throw messages.createError('recommendedVersionIdApiPriorTo66Error');
246
+ }
243
247
  const result = await this.options.connection.tooling.update('Package2', opts);
244
248
  if (!result.success) {
245
249
  throw new core_1.SfError(result.errors.join(', '));
@@ -45,3 +45,7 @@ Can't retrieve package metadata. We're unable to retrieve metadata for the packa
45
45
  # packagingNotEnabledOnOrg
46
46
 
47
47
  Can't retrieve package metadata. The org you specified doesn't have the required second-generation packaging permission enabled. Enable this permission on your Dev Hub org, and try again.
48
+
49
+ # recommendedVersionIdApiPriorTo66Error
50
+
51
+ To enable Recommended Version, use API version 66.0 or higher.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/packaging",
3
- "version": "4.14.1",
3
+ "version": "4.15.0",
4
4
  "description": "Packaging library for the Salesforce packaging platform",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",