@salesforce/packaging 4.0.5 → 4.1.1
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.
|
@@ -41,6 +41,8 @@ const defaultFields = [
|
|
|
41
41
|
];
|
|
42
42
|
const verboseFields = ['CodeCoverage', 'HasPassedCodeCoverageCheck'];
|
|
43
43
|
const verbose57Fields = ['Language'];
|
|
44
|
+
// Ensure we only include the async validation property for api version of v60.0 or higher.
|
|
45
|
+
const default61Fields = ['ValidatedAsync'];
|
|
44
46
|
exports.DEFAULT_ORDER_BY_FIELDS = 'Package2Id, Branch, MajorVersion, MinorVersion, PatchVersion, BuildNumber';
|
|
45
47
|
let logger;
|
|
46
48
|
const getLogger = () => {
|
|
@@ -64,7 +66,7 @@ exports.listPackageVersions = listPackageVersions;
|
|
|
64
66
|
function constructQuery(connectionVersion, options) {
|
|
65
67
|
// construct custom WHERE clause, if applicable
|
|
66
68
|
const where = constructWhere(options);
|
|
67
|
-
let queryFields = defaultFields;
|
|
69
|
+
let queryFields = connectionVersion > 60 ? [...defaultFields, ...default61Fields] : defaultFields;
|
|
68
70
|
if (options?.verbose) {
|
|
69
71
|
queryFields = [...queryFields, ...verboseFields];
|
|
70
72
|
if (connectionVersion >= 57) {
|
|
@@ -38,20 +38,35 @@ const node_util_1 = __importDefault(require("node:util"));
|
|
|
38
38
|
// Local
|
|
39
39
|
const core_1 = require("@salesforce/core");
|
|
40
40
|
const pkgUtils = __importStar(require("../utils/packageUtils"));
|
|
41
|
-
const
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
|
|
46
|
-
'
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
'
|
|
53
|
-
|
|
54
|
-
'
|
|
41
|
+
const defaultFields = [
|
|
42
|
+
'Id',
|
|
43
|
+
'Package2Id',
|
|
44
|
+
'SubscriberPackageVersionId',
|
|
45
|
+
'Name',
|
|
46
|
+
'Description',
|
|
47
|
+
'Tag',
|
|
48
|
+
'Branch',
|
|
49
|
+
'AncestorId',
|
|
50
|
+
'ValidationSkipped',
|
|
51
|
+
'MajorVersion',
|
|
52
|
+
'MinorVersion',
|
|
53
|
+
'PatchVersion',
|
|
54
|
+
'BuildNumber',
|
|
55
|
+
'IsReleased',
|
|
56
|
+
'CodeCoverage',
|
|
57
|
+
'HasPassedCodeCoverageCheck',
|
|
58
|
+
'Package2.IsOrgDependent',
|
|
59
|
+
'ReleaseVersion',
|
|
60
|
+
'BuildDurationInSeconds',
|
|
61
|
+
'HasMetadataRemoved',
|
|
62
|
+
'CreatedById',
|
|
63
|
+
'ConvertedFromVersionId',
|
|
64
|
+
];
|
|
65
|
+
let verboseFields = ['SubscriberPackageVersion.Dependencies', 'CodeCoveragePercentages'];
|
|
66
|
+
// Ensure we only include the async validation property for api version of v60.0 or higher.
|
|
67
|
+
const default61Fields = ['ValidatedAsync'];
|
|
68
|
+
const verbose61Fields = ['EndToEndBuildDurationInSeconds'];
|
|
69
|
+
const DEFAULT_ORDER_BY_FIELDS = 'Package2Id, Branch, MajorVersion, MinorVersion, PatchVersion, BuildNumber';
|
|
55
70
|
let logger;
|
|
56
71
|
const getLogger = () => {
|
|
57
72
|
if (!logger) {
|
|
@@ -59,9 +74,23 @@ const getLogger = () => {
|
|
|
59
74
|
}
|
|
60
75
|
return logger;
|
|
61
76
|
};
|
|
77
|
+
function constructQuery(connectionVersion, verbose) {
|
|
78
|
+
// Ensure we only include the async validation property for api version of v60.0 or higher.
|
|
79
|
+
let queryFields = connectionVersion > 60 ? [...defaultFields, ...default61Fields] : defaultFields;
|
|
80
|
+
verboseFields = connectionVersion > 60 ? [...verboseFields, ...verbose61Fields] : verboseFields;
|
|
81
|
+
if (verbose) {
|
|
82
|
+
queryFields = [...queryFields, ...verboseFields];
|
|
83
|
+
}
|
|
84
|
+
const select = `SELECT ${queryFields.toString()} FROM Package2Version`;
|
|
85
|
+
const wherePart = "WHERE Id = '%s' AND IsDeprecated != true";
|
|
86
|
+
const orderByPart = `ORDER BY ${DEFAULT_ORDER_BY_FIELDS}`;
|
|
87
|
+
const query = `${select} ${wherePart} ${orderByPart}`;
|
|
88
|
+
getLogger().debug(query);
|
|
89
|
+
return query;
|
|
90
|
+
}
|
|
62
91
|
async function getPackageVersionReport(options) {
|
|
63
92
|
getLogger().debug(`entering getPackageVersionReport(${node_util_1.default.inspect(options, { depth: null })})`);
|
|
64
|
-
const queryResult = await options.connection.tooling.query(node_util_1.default.format(options.verbose
|
|
93
|
+
const queryResult = await options.connection.tooling.query(node_util_1.default.format(constructQuery(Number(options.connection.version), options.verbose), options.packageVersionId));
|
|
65
94
|
const records = queryResult.records;
|
|
66
95
|
if (records?.length > 0) {
|
|
67
96
|
const record = records[0];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/packaging",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Packaging library for the Salesforce packaging platform",
|
|
5
5
|
"main": "lib/exported",
|
|
6
6
|
"types": "lib/exported.d.ts",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@jsforce/jsforce-node": "^3.2.0",
|
|
45
|
-
"@salesforce/core": "^8.0
|
|
45
|
+
"@salesforce/core": "^8.1.0",
|
|
46
46
|
"@salesforce/kit": "^3.1.6",
|
|
47
47
|
"@salesforce/schemas": "^1.9.0",
|
|
48
48
|
"@salesforce/source-deploy-retrieve": "^12.0.1",
|