@salesforce/packaging 0.0.10 → 0.0.11

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.0.11](https://github.com/forcedotcom/packaging/compare/v0.0.10...v0.0.11) (2022-07-27)
6
+
7
+ ### Bug Fixes
8
+
9
+ - add package1 version list query, UTs ([302653b](https://github.com/forcedotcom/packaging/commit/302653b8bd355d59aa0efbcc2f226ab4dff82baa))
10
+
5
11
  ### [0.0.10](https://github.com/forcedotcom/packaging/compare/v0.0.9...v0.0.10) (2022-07-26)
6
12
 
7
13
  ### Bug Fixes
@@ -1,3 +1,4 @@
1
1
  export * from './packageVersion1GP';
2
2
  export * from './packageDisplay';
3
3
  export * from './package1VersionCreateGet';
4
+ export * from './package1VersionList';
@@ -23,4 +23,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  __exportStar(require("./packageVersion1GP"), exports);
24
24
  __exportStar(require("./packageDisplay"), exports);
25
25
  __exportStar(require("./package1VersionCreateGet"), exports);
26
+ __exportStar(require("./package1VersionList"), exports);
26
27
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,11 @@
1
+ import { Connection } from '@salesforce/core';
2
+ import { Package1Display } from '../interfaces';
3
+ /**
4
+ * Lists package versions available in dev org. If package ID is supplied, only list versions of that package,
5
+ * otherwise, list all package versions
6
+ *
7
+ * @param connection: sfdx-core Connection to the org
8
+ * @param metadataPackageId: optional, if present ID of package to list versions for (starts with 033)
9
+ * @returns Array of package version results
10
+ */
11
+ export declare function package1VersionList(connection: Connection, metadataPackageId?: string): Promise<Package1Display[]>;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2020, salesforce.com, inc.
4
+ * All rights reserved.
5
+ * Licensed under the BSD 3-Clause license.
6
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.package1VersionList = void 0;
10
+ /**
11
+ * Lists package versions available in dev org. If package ID is supplied, only list versions of that package,
12
+ * otherwise, list all package versions
13
+ *
14
+ * @param connection: sfdx-core Connection to the org
15
+ * @param metadataPackageId: optional, if present ID of package to list versions for (starts with 033)
16
+ * @returns Array of package version results
17
+ */
18
+ async function package1VersionList(connection, metadataPackageId) {
19
+ const query = `SELECT Id,MetadataPackageId,Name,ReleaseState,MajorVersion,MinorVersion,PatchVersion,BuildNumber FROM MetadataPackageVersion ${metadataPackageId ? `WHERE MetadataPackageId = '${metadataPackageId}'` : ''} ORDER BY MetadataPackageId, MajorVersion, MinorVersion, PatchVersion, BuildNumber`;
20
+ const queryResult = await connection.tooling.query(query);
21
+ return queryResult.records?.map((record) => ({
22
+ MetadataPackageVersionId: record.Id,
23
+ MetadataPackageId: record.MetadataPackageId,
24
+ Name: record.Name,
25
+ ReleaseState: record.ReleaseState,
26
+ Version: `${record.MajorVersion}.${record.MinorVersion}.${record.PatchVersion}`,
27
+ BuildNumber: record.BuildNumber,
28
+ }));
29
+ }
30
+ exports.package1VersionList = package1VersionList;
31
+ //# sourceMappingURL=package1VersionList.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/packaging",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "packing libraries to Salesforce packaging platform",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",