@salesforce/packaging 0.0.29 → 0.0.30
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.30](https://github.com/forcedotcom/packaging/compare/v0.0.29...v0.0.30) (2022-08-29)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- add Package.update method, NUT ([dd77095](https://github.com/forcedotcom/packaging/commit/dd77095f77d2224c347d146810f8d0f883bbd9a3))
|
|
10
|
+
|
|
5
11
|
### [0.0.29](https://github.com/forcedotcom/packaging/compare/v0.0.28...v0.0.29) (2022-08-26)
|
|
6
12
|
|
|
7
13
|
### Bug Fixes
|
|
@@ -14,7 +14,7 @@ export interface IPackage {
|
|
|
14
14
|
getInstallStatus(installRequestId: string): Promise<PackageInstallRequest>;
|
|
15
15
|
list(): Promise<QueryResult<PackagingSObjects.Package2>>;
|
|
16
16
|
uninstall(): Promise<void>;
|
|
17
|
-
update(): Promise<
|
|
17
|
+
update(options: PackageUpdateOptions): Promise<PackageSaveResult>;
|
|
18
18
|
waitForPublish(subscriberPackageVersionKey: string, timeout: number | Duration, installationKey?: string): any;
|
|
19
19
|
getExternalSites(subscriberPackageVersionKey: string, installationKey?: string): any;
|
|
20
20
|
}
|
|
@@ -39,6 +39,12 @@ export interface IPackageVersion2GP {
|
|
|
39
39
|
export declare type PackageOptions = {
|
|
40
40
|
connection: Connection;
|
|
41
41
|
};
|
|
42
|
+
export declare type PackageUpdateOptions = {
|
|
43
|
+
Id: string;
|
|
44
|
+
Name?: string;
|
|
45
|
+
Description?: string;
|
|
46
|
+
PackageErrorUsername?: string;
|
|
47
|
+
};
|
|
42
48
|
export declare type PackageIdType = 'PackageId' | 'SubscriberPackageVersionId' | 'PackageInstallRequestId' | 'PackageUninstallRequestId';
|
|
43
49
|
export declare type PackageVersionOptions1GP = Record<string, unknown>;
|
|
44
50
|
export declare type PackageVersionCreateRequestResult = {
|
package/lib/package/package.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AsyncCreatable, Duration } from '@salesforce/kit';
|
|
2
2
|
import { QueryResult } from 'jsforce';
|
|
3
3
|
import { Optional } from '@salesforce/ts-types';
|
|
4
|
-
import { IPackage, PackageOptions, PackagingSObjects, PackageInstallOptions, PackageInstallCreateRequest, PackageIdType } from '../interfaces';
|
|
4
|
+
import { IPackage, PackageOptions, PackagingSObjects, PackageInstallOptions, PackageInstallCreateRequest, PackageIdType, PackageSaveResult, PackageUpdateOptions } from '../interfaces';
|
|
5
5
|
declare type PackageInstallRequest = PackagingSObjects.PackageInstallRequest;
|
|
6
6
|
/**
|
|
7
7
|
* Package class.
|
|
@@ -32,7 +32,7 @@ export declare class Package extends AsyncCreatable<PackageOptions> implements I
|
|
|
32
32
|
getInstallStatus(installRequestId: string): Promise<PackageInstallRequest>;
|
|
33
33
|
list(): Promise<QueryResult<PackagingSObjects.Package2>>;
|
|
34
34
|
uninstall(): Promise<void>;
|
|
35
|
-
update(): Promise<
|
|
35
|
+
update(options: PackageUpdateOptions): Promise<PackageSaveResult>;
|
|
36
36
|
getPackage(packageId: string): Promise<PackagingSObjects.Package2>;
|
|
37
37
|
getExternalSites(subscriberPackageVersionId: string, installationKey?: string): Promise<Optional<string[]>>;
|
|
38
38
|
waitForPublish(subscriberPackageVersionId: string, timeout: number | Duration, installationKey?: string): Promise<void>;
|
package/lib/package/package.js
CHANGED
|
@@ -72,8 +72,14 @@ class Package extends kit_1.AsyncCreatable {
|
|
|
72
72
|
uninstall() {
|
|
73
73
|
return Promise.resolve(undefined);
|
|
74
74
|
}
|
|
75
|
-
update() {
|
|
76
|
-
|
|
75
|
+
async update(options) {
|
|
76
|
+
// filter out any undefined values and their keys
|
|
77
|
+
Object.keys(options).forEach((key) => options[key] === undefined && delete options[key]);
|
|
78
|
+
const result = await this.options.connection.tooling.update('Package2', options);
|
|
79
|
+
if (!result.success) {
|
|
80
|
+
throw new core_1.SfError(result.errors.join(', '));
|
|
81
|
+
}
|
|
82
|
+
return result;
|
|
77
83
|
}
|
|
78
84
|
async getPackage(packageId) {
|
|
79
85
|
const package2 = await this.options.connection.tooling.sobject('Package2').retrieve(packageId);
|