@salesforce/packaging 0.0.43 → 0.0.44

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.
@@ -49,6 +49,7 @@ export declare class PackageVersion {
49
49
  frequency: Duration;
50
50
  timeout: Duration;
51
51
  }): Promise<PackageVersionCreateRequestResult>;
52
+ static list(connection: Connection, project: SfProject, options: PackageVersionListOptions): Promise<PackageVersionListResult[]>;
52
53
  /**
53
54
  * Get the package version ID for this PackageVersion.
54
55
  *
@@ -83,7 +84,6 @@ export declare class PackageVersion {
83
84
  */
84
85
  report(verbose?: boolean): Promise<PackageVersionReportResult>;
85
86
  install(): Promise<void>;
86
- list(options: PackageVersionListOptions): Promise<PackageVersionListResult[]>;
87
87
  uninstall(): Promise<void>;
88
88
  promote(): Promise<PackageSaveResult>;
89
89
  update(options: PackageVersionUpdateOptions): Promise<PackageSaveResult>;
@@ -183,6 +183,22 @@ class PackageVersion {
183
183
  throw (0, utils_1.applyErrorAction)(err);
184
184
  }
185
185
  }
186
+ static async list(connection, project, options) {
187
+ // resolve/verify packages
188
+ const packages = options.packages.map((pkg) => {
189
+ const id = (0, utils_1.getPackageIdFromAlias)(pkg, project);
190
+ // validate ID
191
+ if (id.startsWith('0Ho')) {
192
+ (0, utils_1.validateId)(utils_1.BY_LABEL.PACKAGE_ID, id);
193
+ return id;
194
+ }
195
+ else {
196
+ throw messages.createError('errorInvalidPackageVersionId', [id]);
197
+ }
198
+ });
199
+ options.packages = packages;
200
+ return (await (0, packageVersionList_1.listPackageVersions)({ ...options, ...{ connection } })).records;
201
+ }
186
202
  /**
187
203
  * Get the package version ID for this PackageVersion.
188
204
  *
@@ -275,9 +291,6 @@ class PackageVersion {
275
291
  install() {
276
292
  return Promise.resolve(undefined);
277
293
  }
278
- async list(options) {
279
- return (await (0, packageVersionList_1.listPackageVersions)({ ...options, ...{ connection: this.connection } })).records;
280
- }
281
294
  uninstall() {
282
295
  return Promise.resolve(undefined);
283
296
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/packaging",
3
- "version": "0.0.43",
3
+ "version": "0.0.44",
4
4
  "description": "packing libraries to Salesforce packaging platform",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",