@salesforce/packaging 4.1.2 → 4.1.4
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/lib/package/packageConvert.js +3 -4
- package/lib/package/packageCreate.js +3 -4
- package/lib/package/packageDelete.js +1 -2
- package/lib/package/packageInstall.js +7 -8
- package/lib/package/packageUninstall.js +3 -4
- package/lib/package/packageVersionCreateRequest.js +3 -4
- package/lib/package/packageVersionCreateRequestReport.js +1 -2
- package/lib/package/packageVersionList.js +6 -6
- package/lib/package/packageVersionReport.js +1 -2
- package/lib/package/packageVersionRetrieve.js +1 -2
- package/lib/package/profileRewriter.d.ts +1 -1
- package/lib/utils/packageUtils.js +19 -19
- package/package.json +6 -6
|
@@ -32,7 +32,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
32
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.
|
|
35
|
+
exports.findOrCreatePackage2 = findOrCreatePackage2;
|
|
36
|
+
exports.convertPackage = convertPackage;
|
|
37
|
+
exports.createPackageVersionCreateRequest = createPackageVersionCreateRequest;
|
|
36
38
|
const node_path_1 = __importDefault(require("node:path"));
|
|
37
39
|
const node_os_1 = __importDefault(require("node:os"));
|
|
38
40
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
@@ -89,7 +91,6 @@ async function findOrCreatePackage2(seedPackage, connection, project) {
|
|
|
89
91
|
}
|
|
90
92
|
return createResult.id;
|
|
91
93
|
}
|
|
92
|
-
exports.findOrCreatePackage2 = findOrCreatePackage2;
|
|
93
94
|
async function convertPackage(pkg, connection, options, project) {
|
|
94
95
|
const maxRetries = options.wait ? (60 / POLL_INTERVAL_SECONDS) * options.wait.minutes : 0;
|
|
95
96
|
const branch = 'main';
|
|
@@ -120,7 +121,6 @@ async function convertPackage(pkg, connection, options, project) {
|
|
|
120
121
|
}
|
|
121
122
|
return Array.isArray(results) ? results[0] : results;
|
|
122
123
|
}
|
|
123
|
-
exports.convertPackage = convertPackage;
|
|
124
124
|
/**
|
|
125
125
|
* Convert the list of command line options to a JSON object that can be used to create an Package2VersionCreateRequest entity.
|
|
126
126
|
*
|
|
@@ -181,7 +181,6 @@ async function createPackageVersionCreateRequest(context, packageId, apiVersion)
|
|
|
181
181
|
await pkgUtils.zipDir(packageVersBlobDirectory, packageVersBlobZipFile);
|
|
182
182
|
return createRequestObject(packageId, context, packageVersTmpRoot, packageVersBlobZipFile);
|
|
183
183
|
}
|
|
184
|
-
exports.createPackageVersionCreateRequest = createPackageVersionCreateRequest;
|
|
185
184
|
async function createRequestObject(packageId, options, packageVersTmpRoot, packageVersBlobZipFile) {
|
|
186
185
|
const zipFileBase64 = (await node_fs_1.default.promises.readFile(packageVersBlobZipFile)).toString('base64');
|
|
187
186
|
const requestObject = {
|
|
@@ -29,7 +29,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
29
29
|
return result;
|
|
30
30
|
};
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.
|
|
32
|
+
exports.createPackageRequestFromContext = createPackageRequestFromContext;
|
|
33
|
+
exports.createPackageDirEntry = createPackageDirEntry;
|
|
34
|
+
exports.createPackage = createPackage;
|
|
33
35
|
const core_1 = require("@salesforce/core");
|
|
34
36
|
const kit_1 = require("@salesforce/kit");
|
|
35
37
|
const project_1 = require("@salesforce/core/project");
|
|
@@ -46,7 +48,6 @@ function createPackageRequestFromContext(project, options) {
|
|
|
46
48
|
PackageErrorUsername: options.errorNotificationUsername,
|
|
47
49
|
};
|
|
48
50
|
}
|
|
49
|
-
exports.createPackageRequestFromContext = createPackageRequestFromContext;
|
|
50
51
|
/**
|
|
51
52
|
* Create packageDirectory json entry for this package that can be written to sfdx-project.json
|
|
52
53
|
*
|
|
@@ -70,7 +71,6 @@ function createPackageDirEntry(project, options) {
|
|
|
70
71
|
versionDescription: options.description,
|
|
71
72
|
};
|
|
72
73
|
}
|
|
73
|
-
exports.createPackageDirEntry = createPackageDirEntry;
|
|
74
74
|
async function createPackage(connection, project, options) {
|
|
75
75
|
const cleanOptions = sanitizePackageCreateOptions(options);
|
|
76
76
|
const request = createPackageRequestFromContext(project, cleanOptions);
|
|
@@ -92,7 +92,6 @@ async function createPackage(connection, project, options) {
|
|
|
92
92
|
}
|
|
93
93
|
return { Id: createResult.id };
|
|
94
94
|
}
|
|
95
|
-
exports.createPackage = createPackage;
|
|
96
95
|
/** strip trailing slash from path param */
|
|
97
96
|
const sanitizePackageCreateOptions = (options) => ({
|
|
98
97
|
...options,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.deletePackage =
|
|
9
|
+
exports.deletePackage = deletePackage;
|
|
10
10
|
const packageUtils_1 = require("../utils/packageUtils");
|
|
11
11
|
async function deletePackage(idOrAlias, project, connection, undelete) {
|
|
12
12
|
const packageId = project.getPackageIdFromAlias(idOrAlias) ?? idOrAlias;
|
|
@@ -23,5 +23,4 @@ async function deletePackage(idOrAlias, project, connection, undelete) {
|
|
|
23
23
|
}
|
|
24
24
|
return updateResult;
|
|
25
25
|
}
|
|
26
|
-
exports.deletePackage = deletePackage;
|
|
27
26
|
//# sourceMappingURL=packageDelete.js.map
|
|
@@ -6,7 +6,13 @@
|
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.createPackageInstallRequest = createPackageInstallRequest;
|
|
10
|
+
exports.getStatus = getStatus;
|
|
11
|
+
exports.isErrorFromSPVQueryRestriction = isErrorFromSPVQueryRestriction;
|
|
12
|
+
exports.isErrorPackageNotAvailable = isErrorPackageNotAvailable;
|
|
13
|
+
exports.getInstallationStatus = getInstallationStatus;
|
|
14
|
+
exports.waitForPublish = waitForPublish;
|
|
15
|
+
exports.pollStatus = pollStatus;
|
|
10
16
|
const core_1 = require("@salesforce/core");
|
|
11
17
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
12
18
|
const packageUtils_1 = require("../utils/packageUtils");
|
|
@@ -58,12 +64,10 @@ async function createPackageInstallRequest(connection, pkgInstallCreateRequest,
|
|
|
58
64
|
}
|
|
59
65
|
return getStatus(connection, packageInstallRequestId);
|
|
60
66
|
}
|
|
61
|
-
exports.createPackageInstallRequest = createPackageInstallRequest;
|
|
62
67
|
async function getStatus(connection, packageInstallRequestId) {
|
|
63
68
|
const results = (await connection.tooling.retrieve('PackageInstallRequest', packageInstallRequestId));
|
|
64
69
|
return results;
|
|
65
70
|
}
|
|
66
|
-
exports.getStatus = getStatus;
|
|
67
71
|
// determines if error is from malformed SubscriberPackageVersion query
|
|
68
72
|
// this is in place to allow cli to run against app version 214, where SPV queries
|
|
69
73
|
// do not require installation key
|
|
@@ -71,11 +75,9 @@ function isErrorFromSPVQueryRestriction(err) {
|
|
|
71
75
|
return (err.name === 'MALFORMED_QUERY' &&
|
|
72
76
|
err.message.includes('Implementation restriction: You can only perform queries of the form Id'));
|
|
73
77
|
}
|
|
74
|
-
exports.isErrorFromSPVQueryRestriction = isErrorFromSPVQueryRestriction;
|
|
75
78
|
function isErrorPackageNotAvailable(err) {
|
|
76
79
|
return ['UNKNOWN_EXCEPTION', 'PACKAGE_UNAVAILABLE', 'PACKAGE_UNAVAILABLE_CRC', 'PACKAGE_UNAVAILABLE_ZIP'].includes(err.name);
|
|
77
80
|
}
|
|
78
|
-
exports.isErrorPackageNotAvailable = isErrorPackageNotAvailable;
|
|
79
81
|
async function getInstallationStatus(subscriberPackageVersionId, installationKey, connection) {
|
|
80
82
|
let query = `SELECT Id, SubscriberPackageId, InstallValidationStatus FROM SubscriberPackageVersion WHERE Id ='${subscriberPackageVersionId}'`;
|
|
81
83
|
if (installationKey) {
|
|
@@ -93,7 +95,6 @@ async function getInstallationStatus(subscriberPackageVersionId, installationKey
|
|
|
93
95
|
}
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
|
-
exports.getInstallationStatus = getInstallationStatus;
|
|
97
98
|
async function waitForPublish(connection, subscriberPackageVersionId, frequency, timeout, installationKey) {
|
|
98
99
|
const pollingTimeout = (0, packageUtils_1.numberToDuration)(timeout);
|
|
99
100
|
if (pollingTimeout.milliseconds <= 0) {
|
|
@@ -158,7 +159,6 @@ async function waitForPublish(connection, subscriberPackageVersionId, frequency,
|
|
|
158
159
|
throw error;
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
|
-
exports.waitForPublish = waitForPublish;
|
|
162
162
|
async function pollStatus(connection, installRequestId, options = { pollingFrequency: 5000, pollingTimeout: 300_000 }) {
|
|
163
163
|
let packageInstallRequest = await getStatus(connection, installRequestId);
|
|
164
164
|
const { pollingFrequency, pollingTimeout } = options;
|
|
@@ -199,5 +199,4 @@ async function pollStatus(connection, installRequestId, options = { pollingFrequ
|
|
|
199
199
|
throw error;
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
exports.pollStatus = pollStatus;
|
|
203
202
|
//# sourceMappingURL=packageInstall.js.map
|
|
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getUninstallErrors = getUninstallErrors;
|
|
7
|
+
exports.pollUninstall = pollUninstall;
|
|
8
|
+
exports.uninstallPackage = uninstallPackage;
|
|
7
9
|
/*
|
|
8
10
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
9
11
|
* All rights reserved.
|
|
@@ -22,7 +24,6 @@ async function getUninstallErrors(conn, id) {
|
|
|
22
24
|
const errorQueryResult = await conn.tooling.query(`"SELECT Message FROM PackageVersionUninstallRequestError WHERE ParentRequest.Id = '${id}' ORDER BY Message"`);
|
|
23
25
|
return errorQueryResult?.records ?? [];
|
|
24
26
|
}
|
|
25
|
-
exports.getUninstallErrors = getUninstallErrors;
|
|
26
27
|
async function pollUninstall(uninstallRequestId, conn, frequency, wait) {
|
|
27
28
|
const poll = async (id) => {
|
|
28
29
|
const uninstallRequest = (await conn.tooling
|
|
@@ -55,7 +56,6 @@ async function pollUninstall(uninstallRequestId, conn, frequency, wait) {
|
|
|
55
56
|
});
|
|
56
57
|
return pollingClient.subscribe();
|
|
57
58
|
}
|
|
58
|
-
exports.pollUninstall = pollUninstall;
|
|
59
59
|
async function uninstallPackage(id, conn, frequency = kit_1.Duration.seconds(0), wait = kit_1.Duration.seconds(0)) {
|
|
60
60
|
try {
|
|
61
61
|
const uninstallRequest = await conn.tooling.sobject('SubscriberPackageVersionUninstallRequest').create({
|
|
@@ -80,5 +80,4 @@ async function uninstallPackage(id, conn, frequency = kit_1.Duration.seconds(0),
|
|
|
80
80
|
throw err;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
exports.uninstallPackage = uninstallPackage;
|
|
84
83
|
//# sourceMappingURL=packageUninstall.js.map
|
|
@@ -9,7 +9,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.getQuery = getQuery;
|
|
13
|
+
exports.list = list;
|
|
14
|
+
exports.byId = byId;
|
|
13
15
|
const node_util_1 = __importDefault(require("node:util"));
|
|
14
16
|
const core_1 = require("@salesforce/core");
|
|
15
17
|
const interfaces_1 = require("../interfaces");
|
|
@@ -26,7 +28,6 @@ function getQuery(connection) {
|
|
|
26
28
|
'ORDER BY CreatedDate desc';
|
|
27
29
|
return QUERY;
|
|
28
30
|
}
|
|
29
|
-
exports.getQuery = getQuery;
|
|
30
31
|
function formatDate(date) {
|
|
31
32
|
const pad = (num) => (num < 10 ? `0${num}` : `${num}`);
|
|
32
33
|
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
@@ -43,7 +44,6 @@ async function list(connection, options) {
|
|
|
43
44
|
throw err;
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
|
-
exports.list = list;
|
|
47
47
|
async function byId(packageVersionCreateRequestId, connection) {
|
|
48
48
|
const results = await query(node_util_1.default.format(getQuery(connection), `WHERE Id = '${packageVersionCreateRequestId}' `), connection);
|
|
49
49
|
if (results && results.length === 1 && results[0].Status === interfaces_1.PackagingSObjects.Package2VersionStatus.error) {
|
|
@@ -51,7 +51,6 @@ async function byId(packageVersionCreateRequestId, connection) {
|
|
|
51
51
|
}
|
|
52
52
|
return results;
|
|
53
53
|
}
|
|
54
|
-
exports.byId = byId;
|
|
55
54
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
56
55
|
async function query(query, connection) {
|
|
57
56
|
const queryResult = await connection.autoFetchQuery(query, { tooling: true });
|
|
@@ -29,7 +29,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
29
29
|
return result;
|
|
30
30
|
};
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.getCreatePackageVersionCreateRequestReport =
|
|
32
|
+
exports.getCreatePackageVersionCreateRequestReport = getCreatePackageVersionCreateRequestReport;
|
|
33
33
|
const pkgUtils = __importStar(require("../utils/packageUtils"));
|
|
34
34
|
const packageUtils_1 = require("../utils/packageUtils");
|
|
35
35
|
const packageVersionCreateRequest_1 = require("./packageVersionCreateRequest");
|
|
@@ -46,5 +46,4 @@ async function getCreatePackageVersionCreateRequestReport(options) {
|
|
|
46
46
|
throw err;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
exports.getCreatePackageVersionCreateRequestReport = getCreatePackageVersionCreateRequestReport;
|
|
50
49
|
//# sourceMappingURL=packageVersionCreateRequestReport.js.map
|
|
@@ -6,7 +6,12 @@
|
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.DEFAULT_ORDER_BY_FIELDS = void 0;
|
|
10
|
+
exports.listPackageVersions = listPackageVersions;
|
|
11
|
+
exports.constructQuery = constructQuery;
|
|
12
|
+
exports.assembleQueryParts = assembleQueryParts;
|
|
13
|
+
exports.constructWhere = constructWhere;
|
|
14
|
+
exports.validateDays = validateDays;
|
|
10
15
|
const core_1 = require("@salesforce/core");
|
|
11
16
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
12
17
|
const packageUtils_1 = require("../utils/packageUtils");
|
|
@@ -62,7 +67,6 @@ async function listPackageVersions(connection, options) {
|
|
|
62
67
|
const query = constructQuery(Number(connection.version), options);
|
|
63
68
|
return connection.autoFetchQuery(query, { tooling: true });
|
|
64
69
|
}
|
|
65
|
-
exports.listPackageVersions = listPackageVersions;
|
|
66
70
|
function constructQuery(connectionVersion, options) {
|
|
67
71
|
// construct custom WHERE clause, if applicable
|
|
68
72
|
const where = constructWhere(options);
|
|
@@ -76,7 +80,6 @@ function constructQuery(connectionVersion, options) {
|
|
|
76
80
|
const query = `SELECT ${queryFields.toString()} FROM Package2Version`;
|
|
77
81
|
return assembleQueryParts(query, where, options?.orderBy);
|
|
78
82
|
}
|
|
79
|
-
exports.constructQuery = constructQuery;
|
|
80
83
|
function assembleQueryParts(select, where, orderBy) {
|
|
81
84
|
// construct ORDER BY clause
|
|
82
85
|
const orderByPart = `ORDER BY ${orderBy ? orderBy : exports.DEFAULT_ORDER_BY_FIELDS}`;
|
|
@@ -85,7 +88,6 @@ function assembleQueryParts(select, where, orderBy) {
|
|
|
85
88
|
getLogger().debug(query);
|
|
86
89
|
return query;
|
|
87
90
|
}
|
|
88
|
-
exports.assembleQueryParts = assembleQueryParts;
|
|
89
91
|
// construct custom WHERE clause parts
|
|
90
92
|
function constructWhere(options) {
|
|
91
93
|
const where = [];
|
|
@@ -123,12 +125,10 @@ function constructWhere(options) {
|
|
|
123
125
|
where.push('IsDeprecated = false');
|
|
124
126
|
return where;
|
|
125
127
|
}
|
|
126
|
-
exports.constructWhere = constructWhere;
|
|
127
128
|
function validateDays(paramName, lastDays = -1) {
|
|
128
129
|
if (lastDays < 0) {
|
|
129
130
|
throw messages.createError('invalidDaysNumber', [paramName, lastDays]);
|
|
130
131
|
}
|
|
131
132
|
return lastDays;
|
|
132
133
|
}
|
|
133
|
-
exports.validateDays = validateDays;
|
|
134
134
|
//# sourceMappingURL=packageVersionList.js.map
|
|
@@ -32,7 +32,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
32
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.getPackageVersionReport =
|
|
35
|
+
exports.getPackageVersionReport = getPackageVersionReport;
|
|
36
36
|
// Node
|
|
37
37
|
const node_util_1 = __importDefault(require("node:util"));
|
|
38
38
|
// Local
|
|
@@ -120,5 +120,4 @@ async function getPackageVersionReport(options) {
|
|
|
120
120
|
}
|
|
121
121
|
return [];
|
|
122
122
|
}
|
|
123
|
-
exports.getPackageVersionReport = getPackageVersionReport;
|
|
124
123
|
//# sourceMappingURL=packageVersionReport.js.map
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.retrievePackageVersionMetadata =
|
|
6
|
+
exports.retrievePackageVersionMetadata = retrievePackageVersionMetadata;
|
|
7
7
|
/*
|
|
8
8
|
* Copyright (c) 2023, salesforce.com, inc.
|
|
9
9
|
* All rights reserved.
|
|
@@ -82,7 +82,6 @@ async function retrievePackageVersionMetadata(project, options, connection) {
|
|
|
82
82
|
await attemptToUpdateProjectJson(project, connection, versionInfo.MetadataPackageId, subscriberPackageVersionId, dependencies, destinationFolder);
|
|
83
83
|
return result;
|
|
84
84
|
}
|
|
85
|
-
exports.retrievePackageVersionMetadata = retrievePackageVersionMetadata;
|
|
86
85
|
/**
|
|
87
86
|
* Attempt to update the sfdx-project.json file to add information about the retrieved sources. If this fails for some reason we
|
|
88
87
|
* print out an error message and return so the user will still see a list of retrieved metadata.
|
|
@@ -26,6 +26,6 @@ export declare const profileStringToProfile: (profileString: string) => Correcte
|
|
|
26
26
|
* */
|
|
27
27
|
export declare const profileObjectToString: (profileObject: Partial<CorrectedProfile>) => string;
|
|
28
28
|
/** it's easier to do lookups by Metadata Type on a Map */
|
|
29
|
-
export declare const manifestTypesToMap: (original: PackageXml[
|
|
29
|
+
export declare const manifestTypesToMap: (original: PackageXml["types"]) => PackageMap;
|
|
30
30
|
type PackageMap = Map<string, string[]>;
|
|
31
31
|
export {};
|
|
@@ -26,7 +26,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.BY_LABEL = exports.INSTALL_URL_BASE = exports.VERSION_NUMBER_SEP = void 0;
|
|
30
|
+
exports.uniqid = uniqid;
|
|
31
|
+
exports.validateId = validateId;
|
|
32
|
+
exports.validateIdNoThrow = validateIdNoThrow;
|
|
33
|
+
exports.applyErrorAction = applyErrorAction;
|
|
34
|
+
exports.massageErrorMessage = massageErrorMessage;
|
|
35
|
+
exports.getPackageVersionId = getPackageVersionId;
|
|
36
|
+
exports.escapeInstallationKey = escapeInstallationKey;
|
|
37
|
+
exports.getContainerOptions = getContainerOptions;
|
|
38
|
+
exports.getPackageVersionStrings = getPackageVersionStrings;
|
|
39
|
+
exports.queryWithInConditionChunking = queryWithInConditionChunking;
|
|
40
|
+
exports.getPackageVersionNumber = getPackageVersionNumber;
|
|
41
|
+
exports.generatePackageAliasEntry = generatePackageAliasEntry;
|
|
42
|
+
exports.combineSaveErrors = combineSaveErrors;
|
|
43
|
+
exports.numberToDuration = numberToDuration;
|
|
44
|
+
exports.zipDir = zipDir;
|
|
45
|
+
exports.copyDir = copyDir;
|
|
46
|
+
exports.copyDescriptorProperties = copyDescriptorProperties;
|
|
47
|
+
exports.isPackageDirectoryEffectivelyEmpty = isPackageDirectoryEffectivelyEmpty;
|
|
30
48
|
/*
|
|
31
49
|
* Copyright (c) 2022, salesforce.com, inc.
|
|
32
50
|
* All rights reserved.
|
|
@@ -91,7 +109,6 @@ function uniqid(options) {
|
|
|
91
109
|
? node_util_1.default.format(options.template, uniqueString)
|
|
92
110
|
: `${options.template}${uniqueString}`;
|
|
93
111
|
}
|
|
94
|
-
exports.uniqid = uniqid;
|
|
95
112
|
function validateId(idObj, value) {
|
|
96
113
|
if (!value || !validateIdNoThrow(idObj, value)) {
|
|
97
114
|
throw messages.createError('invalidIdOrAlias', [
|
|
@@ -101,14 +118,12 @@ function validateId(idObj, value) {
|
|
|
101
118
|
]);
|
|
102
119
|
}
|
|
103
120
|
}
|
|
104
|
-
exports.validateId = validateId;
|
|
105
121
|
function validateIdNoThrow(idObj, value) {
|
|
106
122
|
if (!value || (value.length !== 15 && value.length !== 18)) {
|
|
107
123
|
return false;
|
|
108
124
|
}
|
|
109
125
|
return Array.isArray(idObj) ? idObj.some((e) => value.startsWith(e.prefix)) : value.startsWith(idObj.prefix);
|
|
110
126
|
}
|
|
111
|
-
exports.validateIdNoThrow = validateIdNoThrow;
|
|
112
127
|
// applies actions to common package errors
|
|
113
128
|
// eslint-disable-next-line complexity
|
|
114
129
|
function applyErrorAction(err) {
|
|
@@ -152,7 +167,6 @@ function applyErrorAction(err) {
|
|
|
152
167
|
}
|
|
153
168
|
return err;
|
|
154
169
|
}
|
|
155
|
-
exports.applyErrorAction = applyErrorAction;
|
|
156
170
|
function massageErrorMessage(err) {
|
|
157
171
|
if (err.name === 'INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST') {
|
|
158
172
|
err['message'] = messages.getMessage('invalidPackageTypeMessage');
|
|
@@ -170,7 +184,6 @@ function massageErrorMessage(err) {
|
|
|
170
184
|
}
|
|
171
185
|
return err;
|
|
172
186
|
}
|
|
173
|
-
exports.massageErrorMessage = massageErrorMessage;
|
|
174
187
|
/**
|
|
175
188
|
* Given a subscriber package version ID (04t) or package version ID (05i), return the package version ID (05i)
|
|
176
189
|
*
|
|
@@ -194,11 +207,9 @@ async function getPackageVersionId(versionId, connection) {
|
|
|
194
207
|
return queryResult.records[0].Id;
|
|
195
208
|
});
|
|
196
209
|
}
|
|
197
|
-
exports.getPackageVersionId = getPackageVersionId;
|
|
198
210
|
function escapeInstallationKey(key) {
|
|
199
211
|
return key ? key.replace(/\\/g, '\\\\').replace(/'/g, "\\'") : null;
|
|
200
212
|
}
|
|
201
|
-
exports.escapeInstallationKey = escapeInstallationKey;
|
|
202
213
|
/**
|
|
203
214
|
* Get the ContainerOptions for the specified Package2 (0Ho) IDs.
|
|
204
215
|
*
|
|
@@ -219,7 +230,6 @@ async function getContainerOptions(packageIds, connection) {
|
|
|
219
230
|
}
|
|
220
231
|
return new Map();
|
|
221
232
|
}
|
|
222
|
-
exports.getContainerOptions = getContainerOptions;
|
|
223
233
|
/**
|
|
224
234
|
* Given a list of subscriber package version IDs (04t), return the associated version strings (e.g., Major.Minor.Patch.Build)
|
|
225
235
|
*
|
|
@@ -245,7 +255,6 @@ async function getPackageVersionStrings(subscriberPackageVersionIds, connection)
|
|
|
245
255
|
}
|
|
246
256
|
return results;
|
|
247
257
|
}
|
|
248
|
-
exports.getPackageVersionStrings = getPackageVersionStrings;
|
|
249
258
|
/**
|
|
250
259
|
* For queries with an IN condition, determine if the WHERE clause will exceed
|
|
251
260
|
* SOQL's 4000 character limit. Perform multiple queries as needed to stay below the limit.
|
|
@@ -285,7 +294,6 @@ async function queryWithInConditionChunking(query, items, replaceToken, connecti
|
|
|
285
294
|
}
|
|
286
295
|
return records;
|
|
287
296
|
}
|
|
288
|
-
exports.queryWithInConditionChunking = queryWithInConditionChunking;
|
|
289
297
|
/**
|
|
290
298
|
* Returns the number of items that can be included in a quoted comma-separated string (e.g., "'item1','item2'") not exceeding maxLength
|
|
291
299
|
*/
|
|
@@ -317,7 +325,6 @@ function getPackageVersionNumber(package2VersionObj, includeBuild = false) {
|
|
|
317
325
|
const version = concatVersion(package2VersionObj.MajorVersion, package2VersionObj.MinorVersion, package2VersionObj.PatchVersion, includeBuild ? package2VersionObj.BuildNumber : undefined);
|
|
318
326
|
return includeBuild ? version : version.slice(0, version.lastIndexOf('.'));
|
|
319
327
|
}
|
|
320
|
-
exports.getPackageVersionNumber = getPackageVersionNumber;
|
|
321
328
|
/**
|
|
322
329
|
* Generate package alias json entry for this package version that can be written to sfdx-project.json
|
|
323
330
|
*
|
|
@@ -346,7 +353,6 @@ async function generatePackageAliasEntry(connection, project, packageVersionId,
|
|
|
346
353
|
: `${packageName}@${packageVersionNumber}`;
|
|
347
354
|
return [packageAlias, packageVersionId];
|
|
348
355
|
}
|
|
349
|
-
exports.generatePackageAliasEntry = generatePackageAliasEntry;
|
|
350
356
|
function combineSaveErrors(sObject, crudOperation, errors) {
|
|
351
357
|
const errorMessages = errors.map((error) => {
|
|
352
358
|
const fieldsString = error.fields?.length ? `Fields: [${error.fields?.join(', ')}]` : '';
|
|
@@ -354,7 +360,6 @@ function combineSaveErrors(sObject, crudOperation, errors) {
|
|
|
354
360
|
});
|
|
355
361
|
return messages.createError('errorDuringSObjectCRUDOperation', [crudOperation, sObject, errorMessages.join(node_os_1.default.EOL)]);
|
|
356
362
|
}
|
|
357
|
-
exports.combineSaveErrors = combineSaveErrors;
|
|
358
363
|
/**
|
|
359
364
|
* Returns a Duration object from param duration when it is a number, otherwise return itself
|
|
360
365
|
*
|
|
@@ -367,7 +372,6 @@ function numberToDuration(duration, unit = kit_1.Duration.Unit.MILLISECONDS) {
|
|
|
367
372
|
}
|
|
368
373
|
return (0, ts_types_1.isNumber)(duration) ? new kit_1.Duration(duration, unit) : duration;
|
|
369
374
|
}
|
|
370
|
-
exports.numberToDuration = numberToDuration;
|
|
371
375
|
const pipeline = (0, node_util_1.promisify)(node_stream_1.pipeline);
|
|
372
376
|
/**
|
|
373
377
|
* Zips directory to given zipfile.
|
|
@@ -398,7 +402,6 @@ async function zipDir(dir, zipfile) {
|
|
|
398
402
|
logger.debug(`${stat.size} bytes written to ${zipfile} in ${getElapsedTime(timer)}ms`);
|
|
399
403
|
return;
|
|
400
404
|
}
|
|
401
|
-
exports.zipDir = zipDir;
|
|
402
405
|
function getElapsedTime(timer) {
|
|
403
406
|
const elapsed = process.hrtime(timer);
|
|
404
407
|
return (elapsed[0] * 1000 + elapsed[1] / 1_000_000).toFixed(3);
|
|
@@ -412,7 +415,6 @@ function copyDir(src, dest) {
|
|
|
412
415
|
return entry.isDirectory() ? copyDir(srcPath, destPath) : node_fs_1.default.copyFileSync(srcPath, destPath);
|
|
413
416
|
});
|
|
414
417
|
}
|
|
415
|
-
exports.copyDir = copyDir;
|
|
416
418
|
/**
|
|
417
419
|
* Parse and copy properties from both of these arguments into a new object
|
|
418
420
|
*
|
|
@@ -429,7 +431,6 @@ function copyDescriptorProperties(packageDescriptorJson, definitionFileJson) {
|
|
|
429
431
|
return [[prop], matchCase ? definitionFileJsonCopy[matchCase] : undefined];
|
|
430
432
|
})));
|
|
431
433
|
}
|
|
432
|
-
exports.copyDescriptorProperties = copyDescriptorProperties;
|
|
433
434
|
/**
|
|
434
435
|
* Brand new SFDX projects contain a force-app directory tree containing empty folders
|
|
435
436
|
* and a few .eslintrc.json files. We still want to consider such a directory tree
|
|
@@ -448,5 +449,4 @@ function isPackageDirectoryEffectivelyEmpty(directory) {
|
|
|
448
449
|
? isPackageDirectoryEffectivelyEmpty((0, node_path_1.join)(directory, entry.name))
|
|
449
450
|
: entry.name === '.eslintrc.json');
|
|
450
451
|
}
|
|
451
|
-
exports.isPackageDirectoryEffectivelyEmpty = isPackageDirectoryEffectivelyEmpty;
|
|
452
452
|
//# sourceMappingURL=packageUtils.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/packaging",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.4",
|
|
4
4
|
"description": "Packaging library for the Salesforce packaging platform",
|
|
5
5
|
"main": "lib/exported",
|
|
6
6
|
"types": "lib/exported.d.ts",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@jsforce/jsforce-node": "^3.2.0",
|
|
45
|
-
"@salesforce/core": "^8.1
|
|
45
|
+
"@salesforce/core": "^8.2.1",
|
|
46
46
|
"@salesforce/kit": "^3.1.6",
|
|
47
47
|
"@salesforce/schemas": "^1.9.0",
|
|
48
|
-
"@salesforce/source-deploy-retrieve": "^12.1.
|
|
48
|
+
"@salesforce/source-deploy-retrieve": "^12.1.8",
|
|
49
49
|
"@salesforce/ts-types": "^2.0.10",
|
|
50
50
|
"@salesforce/types": "^1.2.0",
|
|
51
51
|
"fast-xml-parser": "^4.4.0",
|
|
@@ -57,14 +57,14 @@
|
|
|
57
57
|
"object-treeify": "^2"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@salesforce/cli-plugins-testkit": "^5.3.
|
|
60
|
+
"@salesforce/cli-plugins-testkit": "^5.3.18",
|
|
61
61
|
"@salesforce/dev-scripts": "^10.2.2",
|
|
62
62
|
"@types/globby": "^9.1.0",
|
|
63
63
|
"@types/jszip": "^3.4.1",
|
|
64
|
-
"eslint-plugin-sf-plugin": "^1.18.
|
|
64
|
+
"eslint-plugin-sf-plugin": "^1.18.11",
|
|
65
65
|
"shelljs": "0.8.5",
|
|
66
66
|
"ts-node": "^10.9.2",
|
|
67
|
-
"typescript": "^5.
|
|
67
|
+
"typescript": "^5.5.3"
|
|
68
68
|
},
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|