@salesforce/packaging 4.12.0 → 4.13.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.
- package/lib/exported.d.ts +3 -0
- package/lib/exported.js +16 -4
- package/lib/interfaces/bundleInterfacesAndType.d.ts +33 -0
- package/lib/interfaces/bundleInterfacesAndType.js +18 -0
- package/lib/interfaces/bundleSObjects.d.ts +146 -0
- package/lib/interfaces/bundleSObjects.js +19 -0
- package/lib/interfaces/index.d.ts +2 -0
- package/lib/interfaces/index.js +15 -4
- package/lib/interfaces/packagingInterfacesAndType.js +13 -4
- package/lib/package/index.d.ts +3 -0
- package/lib/package/index.js +16 -4
- package/lib/package/packageAncestry.js +13 -4
- package/lib/package/packageBundle.d.ts +37 -0
- package/lib/package/packageBundle.js +85 -0
- package/lib/package/packageBundleCreate.d.ts +7 -0
- package/lib/package/packageBundleCreate.js +53 -0
- package/lib/package/packageBundleInstall.d.ts +9 -0
- package/lib/package/packageBundleInstall.js +132 -0
- package/lib/package/packageBundleVersion.d.ts +21 -0
- package/lib/package/packageBundleVersion.js +225 -0
- package/lib/package/packageBundleVersionCreate.d.ts +11 -0
- package/lib/package/packageBundleVersionCreate.js +248 -0
- package/lib/package/packageConvert.js +13 -4
- package/lib/package/packageCreate.js +13 -4
- package/lib/package/packageDelete.js +13 -4
- package/lib/package/packageInstall.js +13 -4
- package/lib/package/packageProfileApi.js +13 -4
- package/lib/package/packagePushUpgrade.js +13 -4
- package/lib/package/packageUninstall.js +13 -4
- package/lib/package/packageVersion.js +13 -4
- package/lib/package/packageVersionCreate.js +13 -4
- package/lib/package/packageVersionCreateRequest.js +13 -4
- package/lib/package/packageVersionCreateRequestReport.js +13 -4
- package/lib/package/packageVersionDependency.js +13 -4
- package/lib/package/packageVersionList.js +13 -4
- package/lib/package/packageVersionReport.js +13 -4
- package/lib/package/packageVersionRetrieve.js +13 -4
- package/lib/package/subscriberPackageVersion.js +13 -4
- package/lib/package/versionNumber.js +13 -4
- package/lib/package1/index.js +13 -4
- package/lib/package1/package1Version.js +13 -4
- package/lib/utils/bundleUtils.d.ts +1 -0
- package/lib/utils/bundleUtils.js +28 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +16 -5
- package/lib/utils/packageUtils.js +13 -4
- package/messages/bundle_create.md +3 -0
- package/messages/bundle_install.md +11 -0
- package/messages/bundle_utils.md +7 -0
- package/messages/bundle_version.md +3 -0
- package/messages/bundle_version_create.md +47 -0
- package/package.json +8 -7
- package/LICENSE +0 -25
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PackageBundleInstall = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* Copyright 2025, Salesforce, Inc.
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
const core_1 = require("@salesforce/core");
|
|
20
|
+
const interfaces_1 = require("../interfaces");
|
|
21
|
+
const bundleUtils_1 = require("../utils/bundleUtils");
|
|
22
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
23
|
+
const messages = core_1.Messages.loadMessages('@salesforce/packaging', 'bundle_install');
|
|
24
|
+
class PackageBundleInstall {
|
|
25
|
+
static async getInstallStatus(installRequestId, connection) {
|
|
26
|
+
try {
|
|
27
|
+
const result = await connection.tooling.sobject('PkgBundleVersionInstallReq').retrieve(installRequestId);
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
const error = err instanceof Error ? err : new Error(messages.getMessage('failedToGetPackageBundleInstallStatus'));
|
|
32
|
+
throw core_1.SfError.wrap((0, bundleUtils_1.massageErrorMessage)(error));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
static async getInstallStatuses(connection, status, createdLastDays) {
|
|
36
|
+
let query = 'SELECT Id, InstallStatus, PackageBundleVersionID, DevelopmentOrganization, ValidationError, ' +
|
|
37
|
+
'CreatedDate, CreatedById ' +
|
|
38
|
+
'FROM PkgBundleVersionInstallReq';
|
|
39
|
+
if (status && createdLastDays) {
|
|
40
|
+
query += ` WHERE InstallStatus = '${status}' AND CreatedDate = LAST_N_DAYS: ${createdLastDays}`;
|
|
41
|
+
}
|
|
42
|
+
else if (status) {
|
|
43
|
+
query += ` WHERE InstallStatus = '${status}'`;
|
|
44
|
+
}
|
|
45
|
+
else if (createdLastDays) {
|
|
46
|
+
query += ` WHERE CreatedDate = LAST_N_DAYS: ${createdLastDays}`;
|
|
47
|
+
}
|
|
48
|
+
const queryResult = await connection.autoFetchQuery(query, {
|
|
49
|
+
tooling: true,
|
|
50
|
+
});
|
|
51
|
+
return queryResult.records.map((record) => ({
|
|
52
|
+
Id: record.Id,
|
|
53
|
+
InstallStatus: record.InstallStatus,
|
|
54
|
+
PackageBundleVersionID: record.PackageBundleVersionID ?? '',
|
|
55
|
+
DevelopmentOrganization: record.DevelopmentOrganization ?? '',
|
|
56
|
+
ValidationError: record.ValidationError ?? '',
|
|
57
|
+
CreatedDate: record.CreatedDate ?? '',
|
|
58
|
+
CreatedById: record.CreatedById ?? '',
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
static async installBundle(connection, project, options) {
|
|
62
|
+
const packageBundleVersionId = PackageBundleInstall.parsePackageBundleVersionId(options.PackageBundleVersion, project);
|
|
63
|
+
const request = {
|
|
64
|
+
PackageBundleVersionID: packageBundleVersionId,
|
|
65
|
+
DevelopmentOrganization: options.DevelopmentOrganization,
|
|
66
|
+
};
|
|
67
|
+
let installResult;
|
|
68
|
+
try {
|
|
69
|
+
installResult = await connection.tooling.sobject('PkgBundleVersionInstallReq').create(request);
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
const error = err instanceof Error
|
|
73
|
+
? err
|
|
74
|
+
: new Error(typeof err === 'string' ? err : messages.getMessage('failedToInstallPackageBundle'));
|
|
75
|
+
throw core_1.SfError.wrap((0, bundleUtils_1.massageErrorMessage)(error));
|
|
76
|
+
}
|
|
77
|
+
if (!installResult?.success) {
|
|
78
|
+
throw core_1.SfError.wrap((0, bundleUtils_1.massageErrorMessage)(new Error(messages.getMessage('failedToInstallPackageBundle'))));
|
|
79
|
+
}
|
|
80
|
+
if (options.polling) {
|
|
81
|
+
return PackageBundleInstall.pollInstallStatus(installResult.id, connection, options.polling);
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
Id: installResult.id,
|
|
85
|
+
PackageBundleVersionID: packageBundleVersionId,
|
|
86
|
+
DevelopmentOrganization: options.DevelopmentOrganization,
|
|
87
|
+
InstallStatus: interfaces_1.BundleSObjects.PkgBundleVersionInstallReqStatus.queued,
|
|
88
|
+
ValidationError: '',
|
|
89
|
+
CreatedDate: new Date().toISOString(),
|
|
90
|
+
CreatedById: connection.getUsername() ?? 'unknown',
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
static parsePackageBundleVersionId(packageBundleVersion, project) {
|
|
94
|
+
// Check if it's already an ID (starts with appropriate prefix)
|
|
95
|
+
if (/^1Q8.{15}$/.test(packageBundleVersion)) {
|
|
96
|
+
return packageBundleVersion;
|
|
97
|
+
}
|
|
98
|
+
// Otherwise, treat it as an alias and resolve it from sfdx-project.json
|
|
99
|
+
const packageBundleVersionId = project.getPackageBundleIdFromAlias(packageBundleVersion);
|
|
100
|
+
if (!packageBundleVersionId) {
|
|
101
|
+
throw new core_1.SfError(messages.getMessage('noPackageBundleVersionFoundWithAlias', [packageBundleVersion]));
|
|
102
|
+
}
|
|
103
|
+
return packageBundleVersionId;
|
|
104
|
+
}
|
|
105
|
+
static async pollInstallStatus(installRequestId, connection, polling) {
|
|
106
|
+
if (polling.timeout?.milliseconds <= 0) {
|
|
107
|
+
return PackageBundleInstall.getInstallStatus(installRequestId, connection);
|
|
108
|
+
}
|
|
109
|
+
const pollingClient = await core_1.PollingClient.create({
|
|
110
|
+
poll: async () => {
|
|
111
|
+
const status = await PackageBundleInstall.getInstallStatus(installRequestId, connection);
|
|
112
|
+
if (status.InstallStatus === interfaces_1.BundleSObjects.PkgBundleVersionInstallReqStatus.success) {
|
|
113
|
+
return { completed: true, payload: status };
|
|
114
|
+
}
|
|
115
|
+
return { completed: false, payload: status };
|
|
116
|
+
},
|
|
117
|
+
frequency: polling.frequency,
|
|
118
|
+
timeout: polling.timeout,
|
|
119
|
+
});
|
|
120
|
+
try {
|
|
121
|
+
return await pollingClient.subscribe();
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
if (err instanceof Error) {
|
|
125
|
+
throw new Error('Install request timed out');
|
|
126
|
+
}
|
|
127
|
+
throw err;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.PackageBundleInstall = PackageBundleInstall;
|
|
132
|
+
//# sourceMappingURL=packageBundleInstall.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Connection } from '@salesforce/core';
|
|
2
|
+
import { SfProject } from '@salesforce/core';
|
|
3
|
+
import { Duration } from '@salesforce/kit';
|
|
4
|
+
import { BundleVersionCreateOptions, BundleSObjects, PackagingSObjects } from '../interfaces';
|
|
5
|
+
export declare class PackageBundleVersion {
|
|
6
|
+
static create(options: BundleVersionCreateOptions, polling?: {
|
|
7
|
+
frequency: Duration;
|
|
8
|
+
timeout: Duration;
|
|
9
|
+
}): Promise<BundleSObjects.PackageBundleVersionCreateRequestResult>;
|
|
10
|
+
static pollCreateStatus(createPackageVersionRequestId: string, connection: Connection, project: SfProject, polling: {
|
|
11
|
+
frequency: Duration;
|
|
12
|
+
timeout: Duration;
|
|
13
|
+
}): Promise<BundleSObjects.PackageBundleVersionCreateRequestResult>;
|
|
14
|
+
static report(connection: Connection, id: string): Promise<BundleSObjects.BundleVersion | null>;
|
|
15
|
+
static list(connection: Connection): Promise<BundleSObjects.BundleVersion[]>;
|
|
16
|
+
static getComponentPackages(connection: Connection, id: string): Promise<PackagingSObjects.SubscriberPackageVersion[]>;
|
|
17
|
+
private static mapRecordToBundleVersion;
|
|
18
|
+
private static mapPackageBundle;
|
|
19
|
+
private static mapAncestor;
|
|
20
|
+
private static mapAncestorPackageBundle;
|
|
21
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2025, Salesforce, Inc.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.PackageBundleVersion = void 0;
|
|
19
|
+
const core_1 = require("@salesforce/core");
|
|
20
|
+
const kit_1 = require("@salesforce/kit");
|
|
21
|
+
const interfaces_1 = require("../interfaces");
|
|
22
|
+
const bundleUtils_1 = require("../utils/bundleUtils");
|
|
23
|
+
const packageUtils_1 = require("../utils/packageUtils");
|
|
24
|
+
const packageBundleVersionCreate_1 = require("./packageBundleVersionCreate");
|
|
25
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
26
|
+
const bundleVersionMessages = core_1.Messages.loadMessages('@salesforce/packaging', 'bundle_version');
|
|
27
|
+
class PackageBundleVersion {
|
|
28
|
+
static async create(options, polling) {
|
|
29
|
+
const createResult = await packageBundleVersionCreate_1.PackageBundleVersionCreate.createBundleVersion(options.connection, options.project, options);
|
|
30
|
+
if (polling) {
|
|
31
|
+
return PackageBundleVersion.pollCreateStatus(createResult.Id, options.connection, options.project, polling).catch((error) => {
|
|
32
|
+
if (error.name === 'PollingClientTimeout') {
|
|
33
|
+
const modifiedError = new core_1.SfError(error.message);
|
|
34
|
+
modifiedError.setData({ VersionCreateRequestId: createResult.Id });
|
|
35
|
+
modifiedError.message += ` Run 'sf package bundle version create report -i ${createResult.Id}' to check the status.`;
|
|
36
|
+
throw (0, packageUtils_1.applyErrorAction)((0, bundleUtils_1.massageErrorMessage)(modifiedError));
|
|
37
|
+
}
|
|
38
|
+
throw (0, packageUtils_1.applyErrorAction)((0, bundleUtils_1.massageErrorMessage)(error));
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return createResult;
|
|
42
|
+
}
|
|
43
|
+
static async pollCreateStatus(createPackageVersionRequestId, connection, project, polling) {
|
|
44
|
+
if (polling.timeout?.milliseconds <= 0) {
|
|
45
|
+
return packageBundleVersionCreate_1.PackageBundleVersionCreate.getCreateStatus(createPackageVersionRequestId, connection);
|
|
46
|
+
}
|
|
47
|
+
let remainingWaitTime = polling.timeout;
|
|
48
|
+
const pollingClient = await core_1.PollingClient.create({
|
|
49
|
+
poll: async () => {
|
|
50
|
+
const report = await packageBundleVersionCreate_1.PackageBundleVersionCreate.getCreateStatus(createPackageVersionRequestId, connection);
|
|
51
|
+
switch (report.RequestStatus) {
|
|
52
|
+
case interfaces_1.BundleSObjects.PkgBundleVersionCreateReqStatus.queued:
|
|
53
|
+
await core_1.Lifecycle.getInstance().emit(interfaces_1.PackageVersionEvents.create.enqueued, { ...report, remainingWaitTime });
|
|
54
|
+
remainingWaitTime = kit_1.Duration.seconds(remainingWaitTime.seconds - polling.frequency.seconds);
|
|
55
|
+
return {
|
|
56
|
+
completed: false,
|
|
57
|
+
payload: report,
|
|
58
|
+
};
|
|
59
|
+
case interfaces_1.BundleSObjects.PkgBundleVersionCreateReqStatus.success: {
|
|
60
|
+
await core_1.Lifecycle.getInstance().emit(interfaces_1.PackageVersionEvents.create.success, report);
|
|
61
|
+
return { completed: true, payload: report };
|
|
62
|
+
}
|
|
63
|
+
case interfaces_1.BundleSObjects.PkgBundleVersionCreateReqStatus.error:
|
|
64
|
+
await core_1.Lifecycle.getInstance().emit(interfaces_1.PackageVersionEvents.create.error, report);
|
|
65
|
+
return { completed: true, payload: report };
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
frequency: polling.frequency,
|
|
69
|
+
timeout: polling.timeout,
|
|
70
|
+
});
|
|
71
|
+
try {
|
|
72
|
+
return await pollingClient.subscribe();
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
const report = await packageBundleVersionCreate_1.PackageBundleVersionCreate.getCreateStatus(createPackageVersionRequestId, connection);
|
|
76
|
+
await core_1.Lifecycle.getInstance().emit(interfaces_1.PackageVersionEvents.create['timed-out'], report);
|
|
77
|
+
if (err instanceof Error) {
|
|
78
|
+
throw (0, packageUtils_1.applyErrorAction)(err);
|
|
79
|
+
}
|
|
80
|
+
throw err;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
static async report(connection, id) {
|
|
84
|
+
const query = `SELECT Id, PackageBundle.Id, PackageBundle.BundleName, VersionName, MajorVersion, MinorVersion, IsReleased, PackageBundle.Description, PackageBundle.IsDeleted, PackageBundle.CreatedDate, PackageBundle.CreatedById, PackageBundle.LastModifiedDate, PackageBundle.LastModifiedById, PackageBundle.SystemModstamp, Ancestor.Id, Ancestor.PackageBundle.Id, Ancestor.PackageBundle.BundleName, Ancestor.VersionName, Ancestor.MajorVersion, Ancestor.MinorVersion, Ancestor.IsReleased, Ancestor.PackageBundle.Description, Ancestor.PackageBundle.IsDeleted, Ancestor.PackageBundle.CreatedDate, Ancestor.PackageBundle.CreatedById, Ancestor.PackageBundle.LastModifiedDate, Ancestor.PackageBundle.LastModifiedById, Ancestor.PackageBundle.SystemModstamp FROM PackageBundleVersion WHERE Id = '${id}'`;
|
|
85
|
+
const queryResult = await connection.autoFetchQuery(query, { tooling: true });
|
|
86
|
+
return queryResult.records.length > 0
|
|
87
|
+
? PackageBundleVersion.mapRecordToBundleVersion(queryResult.records[0])
|
|
88
|
+
: null;
|
|
89
|
+
}
|
|
90
|
+
static async list(connection) {
|
|
91
|
+
const query = 'SELECT Id, PackageBundle.Id, PackageBundle.BundleName, VersionName, MajorVersion, MinorVersion, IsReleased, PackageBundle.Description, PackageBundle.IsDeleted, PackageBundle.CreatedDate, PackageBundle.CreatedById, PackageBundle.LastModifiedDate, PackageBundle.LastModifiedById, PackageBundle.SystemModstamp, Ancestor.Id, Ancestor.PackageBundle.Id, Ancestor.PackageBundle.BundleName, Ancestor.VersionName, Ancestor.MajorVersion, Ancestor.MinorVersion, Ancestor.IsReleased, Ancestor.PackageBundle.Description, Ancestor.PackageBundle.IsDeleted, Ancestor.PackageBundle.CreatedDate, Ancestor.PackageBundle.CreatedById, Ancestor.PackageBundle.LastModifiedDate, Ancestor.PackageBundle.LastModifiedById, Ancestor.PackageBundle.SystemModstamp FROM PackageBundleVersion';
|
|
92
|
+
const queryResult = await connection.autoFetchQuery(query, { tooling: true });
|
|
93
|
+
return queryResult.records.map((record) => PackageBundleVersion.mapRecordToBundleVersion(record));
|
|
94
|
+
}
|
|
95
|
+
static async getComponentPackages(connection, id) {
|
|
96
|
+
const query = `SELECT Component.Id, Component.Description, Component.PublisherName, Component.MajorVersion, Component.MinorVersion, Component.PatchVersion, Component.BuildNumber, Component.ReleaseState, Component.IsManaged, Component.IsDeprecated, Component.IsPasswordProtected, Component.IsBeta, Component.Package2ContainerOptions, Component.IsSecurityReviewed, Component.IsOrgDependent, Component.AppExchangePackageName, Component.AppExchangeDescription, Component.AppExchangePublisherName, Component.AppExchangeLogoUrl, Component.ReleaseNotesUrl, Component.PostInstallUrl, Component.RemoteSiteSettings, Component.CspTrustedSites, Component.Profiles, Component.Dependencies, Component.InstallValidationStatus, Component.SubscriberPackageId FROM PkgBundleVersionComponent WHERE PackageBundleVersion.Id = '${id}' ORDER BY CreatedDate`;
|
|
97
|
+
const queryResult = await connection.autoFetchQuery(query, { tooling: true });
|
|
98
|
+
// Get unique SubscriberPackageIds to query for Names
|
|
99
|
+
const subscriberPackageIds = [
|
|
100
|
+
...new Set(queryResult.records
|
|
101
|
+
.map((record) => record.Component?.SubscriberPackageId)
|
|
102
|
+
.filter((packageId) => !!packageId)),
|
|
103
|
+
];
|
|
104
|
+
// Query SubscriberPackage to get Names (one by one due to implementation restriction)
|
|
105
|
+
const subscriberPackageNames = new Map();
|
|
106
|
+
const packageQueries = subscriberPackageIds.map(async (packageId) => {
|
|
107
|
+
try {
|
|
108
|
+
const packageQuery = `SELECT Id, Name FROM SubscriberPackage WHERE Id='${packageId}'`;
|
|
109
|
+
const packageQueryResult = await connection.autoFetchQuery(packageQuery, { tooling: true });
|
|
110
|
+
return {
|
|
111
|
+
packageId,
|
|
112
|
+
name: packageQueryResult.records.length > 0 ? packageQueryResult.records[0].Name : '',
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
// If individual query fails, return empty name for this package
|
|
117
|
+
return {
|
|
118
|
+
packageId,
|
|
119
|
+
name: '',
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
const packageResults = await Promise.allSettled(packageQueries);
|
|
124
|
+
packageResults.forEach((result) => {
|
|
125
|
+
if (result.status === 'fulfilled') {
|
|
126
|
+
subscriberPackageNames.set(result.value.packageId, result.value.name);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
return queryResult.records.map((record) => {
|
|
130
|
+
const component = record.Component;
|
|
131
|
+
if (!component) {
|
|
132
|
+
throw new core_1.SfError(bundleVersionMessages.getMessage('componentRecordMissing'));
|
|
133
|
+
}
|
|
134
|
+
const packageName = subscriberPackageNames.get(component.SubscriberPackageId) ?? '';
|
|
135
|
+
return {
|
|
136
|
+
Id: component.Id,
|
|
137
|
+
SubscriberPackageId: component.SubscriberPackageId,
|
|
138
|
+
Name: packageName,
|
|
139
|
+
Description: component.Description,
|
|
140
|
+
PublisherName: component.PublisherName,
|
|
141
|
+
MajorVersion: component.MajorVersion,
|
|
142
|
+
MinorVersion: component.MinorVersion,
|
|
143
|
+
PatchVersion: component.PatchVersion,
|
|
144
|
+
BuildNumber: component.BuildNumber,
|
|
145
|
+
ReleaseState: component.ReleaseState,
|
|
146
|
+
IsManaged: component.IsManaged,
|
|
147
|
+
IsDeprecated: component.IsDeprecated,
|
|
148
|
+
IsPasswordProtected: component.IsPasswordProtected,
|
|
149
|
+
IsBeta: component.IsBeta,
|
|
150
|
+
Package2ContainerOptions: component.Package2ContainerOptions,
|
|
151
|
+
IsSecurityReviewed: component.IsSecurityReviewed,
|
|
152
|
+
IsOrgDependent: component.IsOrgDependent,
|
|
153
|
+
AppExchangePackageName: component.AppExchangePackageName,
|
|
154
|
+
AppExchangeDescription: component.AppExchangeDescription,
|
|
155
|
+
AppExchangePublisherName: component.AppExchangePublisherName,
|
|
156
|
+
AppExchangeLogoUrl: component.AppExchangeLogoUrl,
|
|
157
|
+
ReleaseNotesUrl: component.ReleaseNotesUrl,
|
|
158
|
+
PostInstallUrl: component.PostInstallUrl,
|
|
159
|
+
RemoteSiteSettings: component.RemoteSiteSettings,
|
|
160
|
+
CspTrustedSites: component.CspTrustedSites,
|
|
161
|
+
Profiles: component.Profiles,
|
|
162
|
+
Dependencies: component.Dependencies,
|
|
163
|
+
InstallValidationStatus: component.InstallValidationStatus,
|
|
164
|
+
};
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
static mapRecordToBundleVersion(record) {
|
|
168
|
+
return {
|
|
169
|
+
Id: record.Id,
|
|
170
|
+
PackageBundle: PackageBundleVersion.mapPackageBundle(record.PackageBundle),
|
|
171
|
+
VersionName: record.VersionName ?? '',
|
|
172
|
+
MajorVersion: record.MajorVersion ?? '',
|
|
173
|
+
MinorVersion: record.MinorVersion ?? '',
|
|
174
|
+
CreatedDate: record.PackageBundle?.CreatedDate ?? '',
|
|
175
|
+
CreatedById: record.PackageBundle?.CreatedById ?? '',
|
|
176
|
+
LastModifiedDate: record.PackageBundle?.LastModifiedDate ?? '',
|
|
177
|
+
LastModifiedById: record.PackageBundle?.LastModifiedById ?? '',
|
|
178
|
+
Ancestor: record.Ancestor?.Id ? PackageBundleVersion.mapAncestor(record.Ancestor) : null,
|
|
179
|
+
IsReleased: record.IsReleased ?? false,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
static mapPackageBundle(packageBundle) {
|
|
183
|
+
return {
|
|
184
|
+
Id: packageBundle?.Id ?? '',
|
|
185
|
+
BundleName: packageBundle?.BundleName ?? '',
|
|
186
|
+
Description: packageBundle?.Description,
|
|
187
|
+
IsDeleted: packageBundle?.IsDeleted ?? false,
|
|
188
|
+
CreatedDate: packageBundle?.CreatedDate ?? '',
|
|
189
|
+
CreatedById: packageBundle?.CreatedById ?? '',
|
|
190
|
+
LastModifiedDate: packageBundle?.LastModifiedDate ?? '',
|
|
191
|
+
LastModifiedById: packageBundle?.LastModifiedById ?? '',
|
|
192
|
+
SystemModstamp: packageBundle?.SystemModstamp ?? '',
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
static mapAncestor(ancestor) {
|
|
196
|
+
return {
|
|
197
|
+
Id: ancestor.Id,
|
|
198
|
+
PackageBundle: PackageBundleVersion.mapAncestorPackageBundle(ancestor.PackageBundle),
|
|
199
|
+
VersionName: ancestor?.VersionName ?? '',
|
|
200
|
+
MajorVersion: ancestor?.MajorVersion ?? '',
|
|
201
|
+
MinorVersion: ancestor?.MinorVersion ?? '',
|
|
202
|
+
CreatedDate: ancestor.PackageBundle?.CreatedDate ?? '',
|
|
203
|
+
CreatedById: ancestor.PackageBundle?.CreatedById ?? '',
|
|
204
|
+
LastModifiedDate: ancestor.PackageBundle?.LastModifiedDate ?? '',
|
|
205
|
+
LastModifiedById: ancestor.PackageBundle?.LastModifiedById ?? '',
|
|
206
|
+
Ancestor: null,
|
|
207
|
+
IsReleased: ancestor.IsReleased ?? false,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
static mapAncestorPackageBundle(packageBundle) {
|
|
211
|
+
return {
|
|
212
|
+
Id: packageBundle?.Id ?? '',
|
|
213
|
+
BundleName: packageBundle?.BundleName ?? '',
|
|
214
|
+
Description: packageBundle?.Description,
|
|
215
|
+
IsDeleted: packageBundle?.IsDeleted ?? false,
|
|
216
|
+
CreatedDate: packageBundle?.CreatedDate ?? '',
|
|
217
|
+
CreatedById: packageBundle?.CreatedById ?? '',
|
|
218
|
+
LastModifiedDate: packageBundle?.LastModifiedDate ?? '',
|
|
219
|
+
LastModifiedById: packageBundle?.LastModifiedById ?? '',
|
|
220
|
+
SystemModstamp: packageBundle?.SystemModstamp ?? '',
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
exports.PackageBundleVersion = PackageBundleVersion;
|
|
225
|
+
//# sourceMappingURL=packageBundleVersion.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Connection, SfProject } from '@salesforce/core';
|
|
2
|
+
import { BundleSObjects, BundleVersionCreateOptions } from '../interfaces';
|
|
3
|
+
export declare class PackageBundleVersionCreate {
|
|
4
|
+
static getCreateStatus(createPackageVersionRequestId: string, connection: Connection): Promise<BundleSObjects.PackageBundleVersionCreateRequestResult>;
|
|
5
|
+
static getCreateStatuses(connection: Connection, status?: BundleSObjects.PkgBundleVersionCreateReqStatus, createdLastDays?: number): Promise<BundleSObjects.PackageBundleVersionCreateRequestResult[]>;
|
|
6
|
+
static createBundleVersion(connection: Connection, project: SfProject, options: BundleVersionCreateOptions): Promise<BundleSObjects.PackageBundleVersionCreateRequestResult>;
|
|
7
|
+
private static readBundleVersionComponents;
|
|
8
|
+
private static getVersionName;
|
|
9
|
+
private static parsePackageBundleId;
|
|
10
|
+
private static getPackageVersion;
|
|
11
|
+
}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.PackageBundleVersionCreate = void 0;
|
|
37
|
+
/*
|
|
38
|
+
* Copyright 2025, Salesforce, Inc.
|
|
39
|
+
*
|
|
40
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
41
|
+
* you may not use this file except in compliance with the License.
|
|
42
|
+
* You may obtain a copy of the License at
|
|
43
|
+
*
|
|
44
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
45
|
+
*
|
|
46
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
47
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
48
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
49
|
+
* See the License for the specific language governing permissions and
|
|
50
|
+
* limitations under the License.
|
|
51
|
+
*/
|
|
52
|
+
const fs = __importStar(require("node:fs"));
|
|
53
|
+
const core_1 = require("@salesforce/core");
|
|
54
|
+
const interfaces_1 = require("../interfaces");
|
|
55
|
+
const bundleUtils_1 = require("../utils/bundleUtils");
|
|
56
|
+
const packageBundleVersion_1 = require("./packageBundleVersion");
|
|
57
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
58
|
+
const messages = core_1.Messages.loadMessages('@salesforce/packaging', 'bundle_version_create');
|
|
59
|
+
class PackageBundleVersionCreate {
|
|
60
|
+
static async getCreateStatus(createPackageVersionRequestId, connection) {
|
|
61
|
+
try {
|
|
62
|
+
const result = await connection.tooling
|
|
63
|
+
.sobject('PkgBundleVersionCreateReq')
|
|
64
|
+
.retrieve(createPackageVersionRequestId);
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
const error = err instanceof Error ? err : new Error(messages.getMessage('failedToGetPackageBundleVersionCreateStatus'));
|
|
69
|
+
throw core_1.SfError.wrap((0, bundleUtils_1.massageErrorMessage)(error));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
static async getCreateStatuses(connection, status, createdLastDays) {
|
|
73
|
+
let query = 'SELECT Id, RequestStatus, PackageBundle.Id, PackageBundle.BundleName, PackageBundleVersion.Id, ' +
|
|
74
|
+
'VersionName, MajorVersion, MinorVersion, Ancestor.Id, BundleVersionComponents, ' +
|
|
75
|
+
'CreatedDate, CreatedById ' +
|
|
76
|
+
'FROM PkgBundleVersionCreateReq';
|
|
77
|
+
if (status && createdLastDays) {
|
|
78
|
+
query += ` WHERE RequestStatus = '${status}' AND CreatedDate = LAST_N_DAYS: ${createdLastDays}`;
|
|
79
|
+
}
|
|
80
|
+
else if (status) {
|
|
81
|
+
query += ` WHERE RequestStatus = '${status}'`;
|
|
82
|
+
}
|
|
83
|
+
else if (createdLastDays) {
|
|
84
|
+
query += ` WHERE CreatedDate = LAST_N_DAYS: ${createdLastDays}`;
|
|
85
|
+
}
|
|
86
|
+
const queryResult = await connection.autoFetchQuery(query, {
|
|
87
|
+
tooling: true,
|
|
88
|
+
});
|
|
89
|
+
return queryResult.records.map((record) => ({
|
|
90
|
+
Id: record.Id,
|
|
91
|
+
RequestStatus: record.RequestStatus,
|
|
92
|
+
PackageBundleId: record.PackageBundle?.Id ?? '',
|
|
93
|
+
PackageBundleVersionId: record.PackageBundleVersion?.Id ?? '',
|
|
94
|
+
VersionName: record.VersionName ?? '',
|
|
95
|
+
MajorVersion: record.MajorVersion ?? '',
|
|
96
|
+
MinorVersion: record.MinorVersion ?? '',
|
|
97
|
+
Ancestor: record.Ancestor?.Id ?? '',
|
|
98
|
+
BundleVersionComponents: record.BundleVersionComponents ?? '',
|
|
99
|
+
CreatedDate: record.CreatedDate ?? '',
|
|
100
|
+
CreatedById: record.CreatedById ?? '',
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
static async createBundleVersion(connection, project, options) {
|
|
104
|
+
const bundleVersionComponents = PackageBundleVersionCreate.readBundleVersionComponents(options.BundleVersionComponentsPath, project);
|
|
105
|
+
const packageBundleId = PackageBundleVersionCreate.parsePackageBundleId(options.PackageBundle, project);
|
|
106
|
+
// Use provided MajorVersion and MinorVersion if they are not empty strings, otherwise get from bundle configuration
|
|
107
|
+
const version = options.MajorVersion && options.MinorVersion
|
|
108
|
+
? { MajorVersion: options.MajorVersion, MinorVersion: options.MinorVersion }
|
|
109
|
+
: await PackageBundleVersionCreate.getPackageVersion(options, project, connection);
|
|
110
|
+
const request = {
|
|
111
|
+
PackageBundleId: packageBundleId,
|
|
112
|
+
VersionName: PackageBundleVersionCreate.getVersionName(options.PackageBundle, version.MajorVersion, version.MinorVersion),
|
|
113
|
+
MajorVersion: version.MajorVersion,
|
|
114
|
+
MinorVersion: version.MinorVersion,
|
|
115
|
+
BundleVersionComponents: JSON.stringify(bundleVersionComponents),
|
|
116
|
+
...(options.Ancestor ? { Ancestor: options.Ancestor } : {}),
|
|
117
|
+
};
|
|
118
|
+
let createResult;
|
|
119
|
+
try {
|
|
120
|
+
createResult = await connection.tooling.sobject('PkgBundleVersionCreateReq').create(request);
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
const error = err instanceof Error
|
|
124
|
+
? err
|
|
125
|
+
: new Error(typeof err === 'string' ? err : messages.getMessage('failedToCreatePackageBundleVersion'));
|
|
126
|
+
throw core_1.SfError.wrap((0, bundleUtils_1.massageErrorMessage)(error));
|
|
127
|
+
}
|
|
128
|
+
if (!createResult?.success) {
|
|
129
|
+
throw core_1.SfError.wrap((0, bundleUtils_1.massageErrorMessage)(new Error(messages.getMessage('failedToCreatePackageBundleVersion'))));
|
|
130
|
+
}
|
|
131
|
+
if (options.polling) {
|
|
132
|
+
return packageBundleVersion_1.PackageBundleVersion.pollCreateStatus(createResult.id, connection, project, options.polling);
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
Id: createResult.id,
|
|
136
|
+
PackageBundleVersionId: createResult.id,
|
|
137
|
+
PackageBundleId: packageBundleId,
|
|
138
|
+
VersionName: PackageBundleVersionCreate.getVersionName(options.PackageBundle, version.MajorVersion, version.MinorVersion),
|
|
139
|
+
MajorVersion: version.MajorVersion,
|
|
140
|
+
MinorVersion: version.MinorVersion,
|
|
141
|
+
BundleVersionComponents: JSON.stringify(bundleVersionComponents),
|
|
142
|
+
RequestStatus: interfaces_1.BundleSObjects.PkgBundleVersionCreateReqStatus.success,
|
|
143
|
+
CreatedDate: new Date().toISOString(),
|
|
144
|
+
CreatedById: connection.getUsername() ?? 'unknown',
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
static readBundleVersionComponents(filePath, project) {
|
|
148
|
+
try {
|
|
149
|
+
const fileContent = fs.readFileSync(filePath, 'utf8');
|
|
150
|
+
const bundleVersionComponents = JSON.parse(fileContent);
|
|
151
|
+
if (!Array.isArray(bundleVersionComponents)) {
|
|
152
|
+
throw new core_1.SfError(messages.getMessage('bundleVersionComponentsMustBeArray'));
|
|
153
|
+
}
|
|
154
|
+
// Validate that each item has the required packageVersion property
|
|
155
|
+
for (const component of bundleVersionComponents) {
|
|
156
|
+
if (!component || typeof component !== 'object' || !component.packageVersion) {
|
|
157
|
+
throw new core_1.SfError(messages.getMessage('bundleVersionComponentMustBeObject'));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// Process each component to get the package version ID
|
|
161
|
+
return bundleVersionComponents.map((component) => {
|
|
162
|
+
const packageVersion = component.packageVersion;
|
|
163
|
+
// Check if it's already an ID (04t followed by 15 characters)
|
|
164
|
+
if (/^04t[a-zA-Z0-9]{15}$/.test(packageVersion)) {
|
|
165
|
+
return packageVersion;
|
|
166
|
+
}
|
|
167
|
+
// Otherwise, treat it as an alias and resolve it from sfdx-project.json
|
|
168
|
+
const packageVersionId = project.getPackageIdFromAlias(packageVersion);
|
|
169
|
+
if (!packageVersionId) {
|
|
170
|
+
throw new core_1.SfError(messages.getMessage('noPackageVersionFoundWithAlias', [packageVersion]));
|
|
171
|
+
}
|
|
172
|
+
return packageVersionId;
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
catch (err) {
|
|
176
|
+
const error = err instanceof Error ? err : new Error(messages.getMessage('failedToReadBundleVersionComponentsFile'));
|
|
177
|
+
throw core_1.SfError.wrap((0, bundleUtils_1.massageErrorMessage)(error));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
static getVersionName(packageBundle, majorVersion, minorVersion) {
|
|
181
|
+
return `${packageBundle}@${majorVersion}.${minorVersion}`;
|
|
182
|
+
}
|
|
183
|
+
static parsePackageBundleId(packageBundle, project) {
|
|
184
|
+
if (/^1Fl.{15}$/.test(packageBundle)) {
|
|
185
|
+
return packageBundle;
|
|
186
|
+
}
|
|
187
|
+
const bundleId = project.getPackageBundleIdFromAlias(packageBundle);
|
|
188
|
+
if (!bundleId) {
|
|
189
|
+
throw new core_1.SfError(messages.getMessage('noPackageBundleFoundWithAlias', [packageBundle]));
|
|
190
|
+
}
|
|
191
|
+
return bundleId;
|
|
192
|
+
}
|
|
193
|
+
static async getPackageVersion(options, project, connection) {
|
|
194
|
+
const packageBundleId = PackageBundleVersionCreate.parsePackageBundleId(options.PackageBundle, project);
|
|
195
|
+
const query = `SELECT BundleName FROM PackageBundle WHERE Id = '${packageBundleId}'`;
|
|
196
|
+
const result = await connection.tooling.query(query);
|
|
197
|
+
if (!result.records || result.records.length === 0) {
|
|
198
|
+
throw new core_1.SfError(messages.getMessage('noBundleFoundWithId', [packageBundleId]));
|
|
199
|
+
}
|
|
200
|
+
const bundleName = result.records[0].BundleName;
|
|
201
|
+
const bundles = project.getSfProjectJson().getPackageBundles();
|
|
202
|
+
const bundle = bundles.find((b) => b.name === bundleName);
|
|
203
|
+
if (!bundle) {
|
|
204
|
+
throw new core_1.SfError(messages.getMessage('noBundleFoundWithName', [bundleName]));
|
|
205
|
+
}
|
|
206
|
+
const [major, minor] = bundle.versionNumber.split('.');
|
|
207
|
+
if (!major || !minor) {
|
|
208
|
+
throw new core_1.SfError(messages.getMessage('invalidVersionNumberFormat', [bundle.versionNumber]));
|
|
209
|
+
}
|
|
210
|
+
// Check if major is an integer
|
|
211
|
+
const majorInt = parseInt(major, 10);
|
|
212
|
+
if (isNaN(majorInt) || majorInt.toString() !== major) {
|
|
213
|
+
throw new core_1.SfError(messages.getMessage('invalidVersionNumberFormat', [bundle.versionNumber]));
|
|
214
|
+
}
|
|
215
|
+
// Check if minor is either an integer or "next"
|
|
216
|
+
if (minor === 'NEXT') {
|
|
217
|
+
// Query existing bundle versions to find the highest minor version for this major version
|
|
218
|
+
const bundleVersionQuery = 'SELECT Id, PackageBundle.Id, PackageBundle.BundleName, VersionName, MajorVersion, MinorVersion, IsReleased ' +
|
|
219
|
+
'FROM PackageBundleVersion ' +
|
|
220
|
+
`WHERE PackageBundle.BundleName = '${bundleName}' AND MajorVersion = ${major} ` +
|
|
221
|
+
'ORDER BY MinorVersion DESC LIMIT 1';
|
|
222
|
+
const queryResult = await connection.tooling.query(bundleVersionQuery);
|
|
223
|
+
if (queryResult.records && queryResult.records.length > 0) {
|
|
224
|
+
const highestRecord = queryResult.records[0];
|
|
225
|
+
// Get the highest minor version and add 1
|
|
226
|
+
const highestMinorVersion = parseInt(highestRecord.MinorVersion, 10);
|
|
227
|
+
if (isNaN(highestMinorVersion)) {
|
|
228
|
+
throw new core_1.SfError(messages.getMessage('invalidMinorVersionInExisting', [highestRecord.MinorVersion]));
|
|
229
|
+
}
|
|
230
|
+
const nextMinorVersion = (highestMinorVersion + 1).toString();
|
|
231
|
+
return { MajorVersion: major, MinorVersion: nextMinorVersion };
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
// No existing versions found for this major version, start with .0
|
|
235
|
+
return { MajorVersion: major, MinorVersion: '0' };
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
const minorInt = parseInt(minor, 10);
|
|
240
|
+
if (isNaN(minorInt) || minorInt.toString() !== minor) {
|
|
241
|
+
throw new core_1.SfError(messages.getMessage('invalidVersionNumberFormat', [bundle.versionNumber]));
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return { MajorVersion: major, MinorVersion: minor };
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
exports.PackageBundleVersionCreate = PackageBundleVersionCreate;
|
|
248
|
+
//# sourceMappingURL=packageBundleVersionCreate.js.map
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the
|
|
6
|
-
*
|
|
3
|
+
* Copyright 2025, Salesforce, Inc.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
7
16
|
*/
|
|
8
17
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
18
|
if (k2 === undefined) k2 = k;
|