@salesforce/packaging 1.4.20 → 1.5.0
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.
|
@@ -31,6 +31,7 @@ export type PackageUpdateOptions = {
|
|
|
31
31
|
Name?: string;
|
|
32
32
|
Description?: string;
|
|
33
33
|
PackageErrorUsername?: string;
|
|
34
|
+
AppAnalyticsEnabled?: boolean;
|
|
34
35
|
};
|
|
35
36
|
export type PackageIdType = 'PackageId' | 'SubscriberPackageVersionId' | 'PackageInstallRequestId' | 'PackageUninstallRequestId';
|
|
36
37
|
export type PackageVersionOptions1GP = Record<string, unknown>;
|
package/lib/package/package.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ export declare class Package {
|
|
|
69
69
|
* @param project
|
|
70
70
|
*/
|
|
71
71
|
static convert(pkgId: string, connection: Connection, options: ConvertPackageOptions, project?: SfProject): Promise<PackageVersionCreateRequestResult>;
|
|
72
|
+
private static getPackage2Fields;
|
|
72
73
|
/**
|
|
73
74
|
* Returns the package ID of the package.
|
|
74
75
|
*
|
package/lib/package/package.js
CHANGED
|
@@ -39,6 +39,7 @@ exports.Package2Fields = [
|
|
|
39
39
|
'IsOrgDependent',
|
|
40
40
|
'ConvertedFromPackageId',
|
|
41
41
|
'PackageErrorUsername',
|
|
42
|
+
'AppAnalyticsEnabled',
|
|
42
43
|
];
|
|
43
44
|
/**
|
|
44
45
|
* Provides the ability to list, create, update, delete, convert, and get version
|
|
@@ -93,7 +94,7 @@ class Package {
|
|
|
93
94
|
* @param connection
|
|
94
95
|
*/
|
|
95
96
|
static async list(connection) {
|
|
96
|
-
return (await connection.tooling.query(`select ${
|
|
97
|
+
return (await connection.tooling.query(`select ${this.getPackage2Fields(connection).toString()} from Package2 ORDER BY NamespacePrefix, Name`, {
|
|
97
98
|
autoFetch: true,
|
|
98
99
|
maxFetch: 10000,
|
|
99
100
|
}))?.records;
|
|
@@ -149,6 +150,10 @@ class Package {
|
|
|
149
150
|
static async convert(pkgId, connection, options, project) {
|
|
150
151
|
return (0, packageConvert_1.convertPackage)(pkgId, connection, options, project);
|
|
151
152
|
}
|
|
153
|
+
static getPackage2Fields(connection) {
|
|
154
|
+
const apiVersion = connection.getApiVersion();
|
|
155
|
+
return exports.Package2Fields.filter((field) => (apiVersion >= '59.0' ? true : field !== 'AppAnalyticsEnabled'));
|
|
156
|
+
}
|
|
152
157
|
/**
|
|
153
158
|
* Returns the package ID of the package.
|
|
154
159
|
*
|
|
@@ -205,6 +210,9 @@ class Package {
|
|
|
205
210
|
try {
|
|
206
211
|
// filter out any undefined values and their keys
|
|
207
212
|
const opts = Object.fromEntries(Object.entries(options).filter(([, value]) => value !== undefined));
|
|
213
|
+
if (opts.AppAnalyticsEnabled !== undefined && this.options.connection.getApiVersion() < '59.0') {
|
|
214
|
+
throw messages.createError('appAnalyticsEnabledApiPriorTo59Error');
|
|
215
|
+
}
|
|
208
216
|
const result = await this.options.connection.tooling.update('Package2', opts);
|
|
209
217
|
if (!result.success) {
|
|
210
218
|
throw new core_1.SfError(result.errors.join(', '));
|
package/messages/package.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/packaging",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Packaging library for the Salesforce packaging platform",
|
|
5
5
|
"main": "lib/exported",
|
|
6
6
|
"types": "lib/exported.d.ts",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@salesforce/cli-plugins-testkit": "^3.3.4",
|
|
62
62
|
"@salesforce/dev-config": "^3.1.0",
|
|
63
|
-
"@salesforce/dev-scripts": "^4.3.
|
|
63
|
+
"@salesforce/dev-scripts": "^4.3.1",
|
|
64
64
|
"@salesforce/prettier-config": "^0.0.2",
|
|
65
65
|
"@salesforce/ts-sinon": "^1.4.6",
|
|
66
66
|
"@types/debug": "4.1.7",
|