@salesforce/packaging 3.2.10 → 3.2.12

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.
@@ -37,7 +37,8 @@ export declare class Package {
37
37
  Id: string;
38
38
  }>;
39
39
  /**
40
- * Returns all the packages that are available in the org.
40
+ * Returns all the packages that are available in the org, up to 10,000. If more records are
41
+ * needed use the `SF_ORG_MAX_QUERY_LIMIT` env var.
41
42
  *
42
43
  * @param connection
43
44
  */
@@ -1,12 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Package = exports.Package2Fields = void 0;
4
- /*
5
- * Copyright (c) 2022, salesforce.com, inc.
6
- * All rights reserved.
7
- * Licensed under the BSD 3-Clause license.
8
- * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
9
- */
10
4
  const core_1 = require("@salesforce/core");
11
5
  const packageUtils_1 = require("../utils/packageUtils");
12
6
  const packageCreate_1 = require("./packageCreate");
@@ -90,15 +84,14 @@ class Package {
90
84
  return (0, packageCreate_1.createPackage)(connection, project, options);
91
85
  }
92
86
  /**
93
- * Returns all the packages that are available in the org.
87
+ * Returns all the packages that are available in the org, up to 10,000. If more records are
88
+ * needed use the `SF_ORG_MAX_QUERY_LIMIT` env var.
94
89
  *
95
90
  * @param connection
96
91
  */
97
92
  static async list(connection) {
98
- return (await connection.tooling.query(`select ${this.getPackage2Fields(connection).toString()} from Package2 ORDER BY NamespacePrefix, Name`, {
99
- autoFetch: true,
100
- maxFetch: 10000,
101
- }))?.records;
93
+ const query = `select ${this.getPackage2Fields(connection).toString()} from Package2 ORDER BY NamespacePrefix, Name`;
94
+ return (await connection.autoFetchQuery(query, { tooling: true }))?.records;
102
95
  }
103
96
  /**
104
97
  * Returns the package versions in the org.
@@ -2,6 +2,13 @@ import { Connection } from '@salesforce/core';
2
2
  import { QueryResult } from 'jsforce';
3
3
  import { PackageVersionListOptions, PackageVersionListResult } from '../interfaces';
4
4
  export declare const DEFAULT_ORDER_BY_FIELDS = "Package2Id, Branch, MajorVersion, MinorVersion, PatchVersion, BuildNumber";
5
+ /**
6
+ * Returns all the package versions that are available in the org, up to 10,000.
7
+ * If more records are needed use the `SF_ORG_MAX_QUERY_LIMIT` env var.
8
+ *
9
+ * @param connection
10
+ * @param options (optional) PackageVersionListOptions
11
+ */
5
12
  export declare function listPackageVersions(connection: Connection, options?: PackageVersionListOptions): Promise<QueryResult<PackageVersionListResult>>;
6
13
  export declare function assembleQueryParts(select: string, where: string[], orderBy?: string): string;
7
14
  export declare function constructWhere(options?: PackageVersionListOptions): string[];
@@ -52,10 +52,16 @@ const getLogger = () => {
52
52
  }
53
53
  return logger;
54
54
  };
55
+ /**
56
+ * Returns all the package versions that are available in the org, up to 10,000.
57
+ * If more records are needed use the `SF_ORG_MAX_QUERY_LIMIT` env var.
58
+ *
59
+ * @param connection
60
+ * @param options (optional) PackageVersionListOptions
61
+ */
55
62
  async function listPackageVersions(connection, options) {
56
- return connection.autoFetchQuery(constructQuery(Number(connection.version), options), {
57
- tooling: true,
58
- });
63
+ const query = constructQuery(Number(connection.version), options);
64
+ return connection.autoFetchQuery(query, { tooling: true });
59
65
  }
60
66
  exports.listPackageVersions = listPackageVersions;
61
67
  function constructQuery(connectionVersion, options) {
@@ -47,7 +47,7 @@ export declare class Package1Version implements IPackageVersion1GP {
47
47
  static getCreateStatus(connection: Connection, id: string): Promise<PackagingSObjects.PackageUploadRequest>;
48
48
  /**
49
49
  * Lists package versions available in the org. If package ID is supplied, only list versions of that package,
50
- * otherwise, list all package versions
50
+ * otherwise, list all package versions, up to 10,000. If more records are needed use the `SF_ORG_MAX_QUERY_LIMIT` env var.
51
51
  *
52
52
  * @param connection Connection to the org
53
53
  * @param id: optional, if present, ID of package to list versions for (starts with 033)
@@ -93,7 +93,7 @@ class Package1Version {
93
93
  }
94
94
  /**
95
95
  * Lists package versions available in the org. If package ID is supplied, only list versions of that package,
96
- * otherwise, list all package versions
96
+ * otherwise, list all package versions, up to 10,000. If more records are needed use the `SF_ORG_MAX_QUERY_LIMIT` env var.
97
97
  *
98
98
  * @param connection Connection to the org
99
99
  * @param id: optional, if present, ID of package to list versions for (starts with 033)
@@ -106,7 +106,9 @@ class Package1Version {
106
106
  throw messages.createError('invalid033Id', [id]);
107
107
  }
108
108
  const query = `SELECT Id,MetadataPackageId,Name,ReleaseState,MajorVersion,MinorVersion,PatchVersion,BuildNumber FROM MetadataPackageVersion ${id ? `WHERE MetadataPackageId = '${id}'` : ''} ORDER BY MetadataPackageId, MajorVersion, MinorVersion, PatchVersion, BuildNumber`;
109
- return (await connection.tooling.query(query)).records;
109
+ return (await connection.autoFetchQuery(query, {
110
+ tooling: true,
111
+ }))?.records;
110
112
  }
111
113
  static async packageUploadPolling(connection, id, timeout, frequency) {
112
114
  const pollingResult = await connection.tooling.sobject('PackageUploadRequest').retrieve(id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/packaging",
3
- "version": "3.2.10",
3
+ "version": "3.2.12",
4
4
  "description": "Packaging library for the Salesforce packaging platform",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",
@@ -45,7 +45,7 @@
45
45
  "@salesforce/core": "^6.5.1",
46
46
  "@salesforce/kit": "^3.0.15",
47
47
  "@salesforce/schemas": "^1.6.1",
48
- "@salesforce/source-deploy-retrieve": "^10.2.13",
48
+ "@salesforce/source-deploy-retrieve": "^10.3.1",
49
49
  "@salesforce/ts-types": "^2.0.9",
50
50
  "fast-xml-parser": "^4.3.4",
51
51
  "globby": "^11",