@simplysf/simply-package 1.0.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.
- package/CHANGELOG.md +0 -0
- package/LICENSE.txt +12 -0
- package/README.md +195 -0
- package/lib/commands/simply/package/dependencies/install.d.ts +29 -0
- package/lib/commands/simply/package/dependencies/install.js +335 -0
- package/lib/commands/simply/package/dependencies/install.js.map +1 -0
- package/lib/commands/simply/package/version/cleanup.d.ts +20 -0
- package/lib/commands/simply/package/version/cleanup.js +113 -0
- package/lib/commands/simply/package/version/cleanup.js.map +1 -0
- package/lib/common/packageUtils.d.ts +11 -0
- package/lib/common/packageUtils.js +71 -0
- package/lib/common/packageUtils.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/messages/simply.package.dependencies.install.md +151 -0
- package/messages/simply.package.version.cleanup.md +39 -0
- package/npm-shrinkwrap.json +17752 -0
- package/oclif.lock +9601 -0
- package/oclif.manifest.json +317 -0
- package/package.json +226 -0
package/CHANGELOG.md
ADDED
|
File without changes
|
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Copyright (c) 2024, Clay Chipps; Copyright (c) 2024, Salesforce.com, Inc.
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
+
|
|
8
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
+
|
|
10
|
+
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
+
|
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# @simplysf/simply-package
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@simplysf/simply-package) [](https://npmjs.org/package/@simplysf/simply-package) [](https://raw.githubusercontent.com/@simplysf/simply-package/main/LICENSE.txt)
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
sf plugins install @simplysf/simply-package
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Issues
|
|
12
|
+
|
|
13
|
+
Please report any issues at https://github.com/SimplySF/simply-package/issues
|
|
14
|
+
|
|
15
|
+
## Contributing
|
|
16
|
+
|
|
17
|
+
1. Please read our [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
18
|
+
2. Create a new issue before starting your project so that we can keep track of
|
|
19
|
+
what you are trying to add/fix. That way, we can also offer suggestions or
|
|
20
|
+
let you know if there is already an effort in progress.
|
|
21
|
+
3. Fork this repository.
|
|
22
|
+
4. [Build the plugin locally](#build)
|
|
23
|
+
5. Create a _topic_ branch in your fork. Note, this step is recommended but technically not required if contributing using a fork.
|
|
24
|
+
6. Edit the code in your fork.
|
|
25
|
+
7. Write appropriate tests for your changes. Try to achieve at least 95% code coverage on any new code. No pull request will be accepted without unit tests.
|
|
26
|
+
8. Send us a pull request when you are done. We'll review your code, suggest any needed changes, and merge it in.
|
|
27
|
+
|
|
28
|
+
### Build
|
|
29
|
+
|
|
30
|
+
To build the plugin locally, make sure to have yarn installed and run the following commands:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Clone the repository
|
|
34
|
+
git clone git@github.com:SimplySF/simply-package
|
|
35
|
+
|
|
36
|
+
# Install the dependencies and compile
|
|
37
|
+
yarn && yarn build
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
To use your plugin, run using the local `./bin/dev` or `./bin/dev.cmd` file.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Run using local run file.
|
|
44
|
+
./bin/dev.cmd simply package
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
There should be no differences when running via the Salesforce CLI or using the local run file. However, it can be useful to link the plugin to do some additional testing or run your commands from anywhere on your machine.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Link your plugin to the sf cli
|
|
51
|
+
sf plugins link .
|
|
52
|
+
# To verify
|
|
53
|
+
sf plugins
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Commands
|
|
57
|
+
|
|
58
|
+
<!-- commands -->
|
|
59
|
+
* [`sf simply package dependencies install`](#sf-simply-package-dependencies-install)
|
|
60
|
+
* [`sf simply package version cleanup`](#sf-simply-package-version-cleanup)
|
|
61
|
+
|
|
62
|
+
## `sf simply package dependencies install`
|
|
63
|
+
|
|
64
|
+
Install package dependencies for a Salesforce project.
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
USAGE
|
|
68
|
+
$ sf simply package dependencies install -o <value> [--json] [-a all|package] [--api-version <value>] [-z <value>] [-i All|Delta] [-k
|
|
69
|
+
<value>] [-r] [-b <value>] [-s AllUsers|AdminsOnly] [-v <value>] [-t DeprecateOnly|Mixed|Delete] [-w <value>]
|
|
70
|
+
|
|
71
|
+
FLAGS
|
|
72
|
+
-a, --apex-compile=<option> Compile all Apex in the org and package, or only Apex in the package; unlocked
|
|
73
|
+
packages only.
|
|
74
|
+
<options: all|package>
|
|
75
|
+
-b, --publish-wait=<value> [default: 0 minutes] Maximum number of minutes to wait for the Subscriber Package
|
|
76
|
+
Version ID to become available in the target org before canceling the install
|
|
77
|
+
request.
|
|
78
|
+
-i, --install-type=<option> [default: Delta] Install all packages or only deltas.
|
|
79
|
+
<options: All|Delta>
|
|
80
|
+
-k, --installation-key=<value>... Installation key for key-protected packages
|
|
81
|
+
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
82
|
+
configuration variable is already set.
|
|
83
|
+
-r, --no-prompt Don't prompt for confirmation.
|
|
84
|
+
-s, --security-type=<option> [default: AdminsOnly] Security access type for the installed package. (deprecation
|
|
85
|
+
notice: The default --security-type value will change from AllUsers to AdminsOnly
|
|
86
|
+
in v47.0 or later.)
|
|
87
|
+
<options: AllUsers|AdminsOnly>
|
|
88
|
+
-t, --upgrade-type=<option> [default: Mixed] Upgrade type for the package installation; available only for
|
|
89
|
+
unlocked packages.
|
|
90
|
+
<options: DeprecateOnly|Mixed|Delete>
|
|
91
|
+
-v, --target-dev-hub=<value> Username or alias of the Dev Hub org.
|
|
92
|
+
-w, --wait=<value> [default: 30 minutes] Number of minutes to wait for installation status.
|
|
93
|
+
-z, --branch=<value> Package branch to consider when specifiying a Package/VersionNumber combination
|
|
94
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
95
|
+
|
|
96
|
+
GLOBAL FLAGS
|
|
97
|
+
--json Format output as json.
|
|
98
|
+
|
|
99
|
+
DESCRIPTION
|
|
100
|
+
Install package dependencies for a Salesforce project.
|
|
101
|
+
|
|
102
|
+
Installs all specified package dependencies in a Salesforce DX project using the sfdx-project.json definition.
|
|
103
|
+
|
|
104
|
+
EXAMPLES
|
|
105
|
+
$ sf simply package dependencies install --target-org myTargetOrg --target-dev-hub myTargetDevHub
|
|
106
|
+
|
|
107
|
+
$ sf simply package dependencies install --target-org myTargetOrg --target-dev-hub myTargetDevHub --installation-key "MyPackage1Alias:MyPackage1Key"
|
|
108
|
+
|
|
109
|
+
$ sf simply package dependencies install --target-org myTargetOrg --target-dev-hub myTargetDevHub --installation-key "MyPackage1Alias:MyPackage1Key" --installation-key "MyPackage2Alias:MyPackage2Key"
|
|
110
|
+
|
|
111
|
+
FLAG DESCRIPTIONS
|
|
112
|
+
-a, --apex-compile=all|package
|
|
113
|
+
|
|
114
|
+
Compile all Apex in the org and package, or only Apex in the package; unlocked packages only.
|
|
115
|
+
|
|
116
|
+
Applies to unlocked packages only. Specifies whether to compile all Apex in the org and package, or only the Apex in
|
|
117
|
+
the package.
|
|
118
|
+
|
|
119
|
+
For package installs into production orgs, or any org that has Apex Compile on Deploy enabled, the platform compiles
|
|
120
|
+
all Apex in the org after the package install or upgrade operation completes.
|
|
121
|
+
|
|
122
|
+
This approach assures that package installs and upgrades don’t impact the performance of an org, and is done even if
|
|
123
|
+
--apex-compile package is specified.
|
|
124
|
+
|
|
125
|
+
-i, --install-type=All|Delta Install all packages or only deltas.
|
|
126
|
+
|
|
127
|
+
If 'All' is specified, then all packages specified in package dependencies are installed, regardless of if the
|
|
128
|
+
version already is installed in the org. If 'Delta' is specified, then only packages that differ from what is
|
|
129
|
+
installed in the org will be installed.
|
|
130
|
+
|
|
131
|
+
-k, --installation-key=<value>... Installation key for key-protected packages
|
|
132
|
+
|
|
133
|
+
Installation key for key-protected packages in the key:value format of SubscriberPackageVersionId:Key
|
|
134
|
+
|
|
135
|
+
-r, --no-prompt Don't prompt for confirmation.
|
|
136
|
+
|
|
137
|
+
Allows the following without an explicit confirmation response: 1) Remote Site Settings and Content Security Policy
|
|
138
|
+
websites to send or receive data, and 2) --upgrade-type Delete to proceed.
|
|
139
|
+
|
|
140
|
+
-t, --upgrade-type=DeprecateOnly|Mixed|Delete
|
|
141
|
+
|
|
142
|
+
Upgrade type for the package installation; available only for unlocked packages.
|
|
143
|
+
|
|
144
|
+
For package upgrades, specifies whether to mark all removed components as deprecated (DeprecateOnly), to delete
|
|
145
|
+
removed components that can be safely deleted and deprecate the others (Mixed), or to delete all removed components,
|
|
146
|
+
except for custom objects and custom fields, that don't have dependencies (Delete). The default is Mixed. Can
|
|
147
|
+
specify DeprecateOnly or Delete only for unlocked package upgrades.
|
|
148
|
+
|
|
149
|
+
-z, --branch=<value> Package branch to consider when specifiying a Package/VersionNumber combination
|
|
150
|
+
|
|
151
|
+
For dependencies specified by Package/VersionNumber combination, you can specify the branch group of builds to work
|
|
152
|
+
from by entering the branch build name. If not specified, the builds from NULL branch will be considered.
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
_See code: [src/commands/simply/package/dependencies/install.ts](https://github.com/SimplySF/simply-package/blob/1.0.0/src/commands/simply/package/dependencies/install.ts)_
|
|
156
|
+
|
|
157
|
+
## `sf simply package version cleanup`
|
|
158
|
+
|
|
159
|
+
Cleanup package versions.
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
USAGE
|
|
163
|
+
$ sf simply package version cleanup -s <value> -p <value> -v <value> [--json] [--api-version <value>]
|
|
164
|
+
|
|
165
|
+
FLAGS
|
|
166
|
+
-p, --package=<value> (required) Package Id
|
|
167
|
+
-s, --matcher=<value> (required) MAJOR.MINOR.PATCH
|
|
168
|
+
-v, --target-dev-hub=<value> (required) Username or alias of the Dev Hub org. Not required if the `target-dev-hub`
|
|
169
|
+
configuration variable is already set.
|
|
170
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
171
|
+
|
|
172
|
+
GLOBAL FLAGS
|
|
173
|
+
--json Format output as json.
|
|
174
|
+
|
|
175
|
+
DESCRIPTION
|
|
176
|
+
Cleanup package versions.
|
|
177
|
+
|
|
178
|
+
Delete package versions for a given package provided a MAJOR.MINOR.PATCH matcher. Does not delete released pacakge
|
|
179
|
+
versions.
|
|
180
|
+
|
|
181
|
+
EXAMPLES
|
|
182
|
+
$ sf simply package version cleanup --package 0Hoxx00000000CqCAI --matcher 2.10.0 --target-dev-hub myDevHub
|
|
183
|
+
|
|
184
|
+
FLAG DESCRIPTIONS
|
|
185
|
+
-p, --package=<value> Package Id
|
|
186
|
+
|
|
187
|
+
The 0Ht Package Id that you wish to cleanup versions for.
|
|
188
|
+
|
|
189
|
+
-s, --matcher=<value> MAJOR.MINOR.PATCH
|
|
190
|
+
|
|
191
|
+
The MAJOR.MINOR.PATCH matcher that should be used to find package versions to delete.
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
_See code: [src/commands/simply/package/version/cleanup.ts](https://github.com/SimplySF/simply-package/blob/1.0.0/src/commands/simply/package/version/cleanup.ts)_
|
|
195
|
+
<!-- commandsstop -->
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { Duration } from '@salesforce/kit';
|
|
3
|
+
export type PackageToInstall = {
|
|
4
|
+
Status: string;
|
|
5
|
+
PackageName: string;
|
|
6
|
+
SubscriberPackageVersionId: string;
|
|
7
|
+
};
|
|
8
|
+
export default class PackageDependenciesInstall extends SfCommand<PackageToInstall[]> {
|
|
9
|
+
static readonly summary: string;
|
|
10
|
+
static readonly description: string;
|
|
11
|
+
static readonly examples: string[];
|
|
12
|
+
static readonly requiresProject = true;
|
|
13
|
+
static readonly flags: {
|
|
14
|
+
'apex-compile': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<import("@salesforce/ts-types").Nullable<"all" | "package">, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
15
|
+
'api-version': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
16
|
+
branch: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
17
|
+
'install-type': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<"All" | "Delta", import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
18
|
+
'installation-key': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
19
|
+
'no-prompt': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
20
|
+
'publish-wait': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<Duration, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
21
|
+
'security-type': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<"AllUsers" | "AdminsOnly", import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
22
|
+
'skip-handlers': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
23
|
+
'target-dev-hub': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
24
|
+
'target-org': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
25
|
+
'upgrade-type': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<"DeprecateOnly" | "Mixed" | "Delete", import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
26
|
+
wait: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<Duration, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
27
|
+
};
|
|
28
|
+
run(): Promise<PackageToInstall[]>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024, Clay Chipps; Copyright (c) 2024, Salesforce.com, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
/* eslint-disable complexity */
|
|
8
|
+
/* eslint-disable no-await-in-loop */
|
|
9
|
+
/* eslint-disable no-unsafe-finally */
|
|
10
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
11
|
+
import { AuthInfo, Connection, Messages, Lifecycle, SfError } from '@salesforce/core';
|
|
12
|
+
import { Duration } from '@salesforce/kit';
|
|
13
|
+
import { PackageEvents, SubscriberPackageVersion, } from '@salesforce/packaging';
|
|
14
|
+
import { isPackageId, isPackageVersionId, isPackageVersionInstalled, reducePackageInstallRequestErrors, resolvePackageVersionId, } from '../../../../common/packageUtils.js';
|
|
15
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
16
|
+
const messages = Messages.loadMessages('@simplysf/simply-package', 'simply.package.dependencies.install');
|
|
17
|
+
const installType = { All: 'all', Delta: 'delta' };
|
|
18
|
+
const securityType = { AllUsers: 'full', AdminsOnly: 'none' };
|
|
19
|
+
const upgradeType = { Delete: 'delete-only', DeprecateOnly: 'deprecate-only', Mixed: 'mixed-mode' };
|
|
20
|
+
const installationKeyRegex = new RegExp(/^(\w+:\w+)(,\s*\w+:\w+)*/);
|
|
21
|
+
export default class PackageDependenciesInstall extends SfCommand {
|
|
22
|
+
static summary = messages.getMessage('summary');
|
|
23
|
+
static description = messages.getMessage('description');
|
|
24
|
+
static examples = messages.getMessages('examples');
|
|
25
|
+
static requiresProject = true;
|
|
26
|
+
static flags = {
|
|
27
|
+
'apex-compile': Flags.custom({
|
|
28
|
+
options: ['all', 'package'],
|
|
29
|
+
})({
|
|
30
|
+
summary: messages.getMessage('flags.apex-compile.summary'),
|
|
31
|
+
description: messages.getMessage('flags.apex-compile.description'),
|
|
32
|
+
char: 'a',
|
|
33
|
+
}),
|
|
34
|
+
'api-version': Flags.orgApiVersion(),
|
|
35
|
+
branch: Flags.string({
|
|
36
|
+
summary: messages.getMessage('flags.branch.summary'),
|
|
37
|
+
description: messages.getMessage('flags.branch.description'),
|
|
38
|
+
char: 'z',
|
|
39
|
+
default: '',
|
|
40
|
+
}),
|
|
41
|
+
'install-type': Flags.custom({
|
|
42
|
+
options: ['All', 'Delta'],
|
|
43
|
+
})({
|
|
44
|
+
char: 'i',
|
|
45
|
+
summary: messages.getMessage('flags.install-type.summary'),
|
|
46
|
+
description: messages.getMessage('flags.install-type.description'),
|
|
47
|
+
default: 'Delta',
|
|
48
|
+
}),
|
|
49
|
+
'installation-key': Flags.string({
|
|
50
|
+
summary: messages.getMessage('flags.installation-key.summary'),
|
|
51
|
+
description: messages.getMessage('flags.installation-key.description'),
|
|
52
|
+
char: 'k',
|
|
53
|
+
multiple: true,
|
|
54
|
+
}),
|
|
55
|
+
'no-prompt': Flags.boolean({
|
|
56
|
+
summary: messages.getMessage('flags.no-prompt.summary'),
|
|
57
|
+
description: messages.getMessage('flags.no-prompt.description'),
|
|
58
|
+
char: 'r',
|
|
59
|
+
default: false,
|
|
60
|
+
required: false,
|
|
61
|
+
}),
|
|
62
|
+
'publish-wait': Flags.duration({
|
|
63
|
+
unit: 'minutes',
|
|
64
|
+
summary: messages.getMessage('flags.publish-wait.summary'),
|
|
65
|
+
char: 'b',
|
|
66
|
+
default: Duration.minutes(0),
|
|
67
|
+
}),
|
|
68
|
+
'security-type': Flags.custom({
|
|
69
|
+
options: ['AllUsers', 'AdminsOnly'],
|
|
70
|
+
})({
|
|
71
|
+
char: 's',
|
|
72
|
+
summary: messages.getMessage('flags.security-type.summary'),
|
|
73
|
+
default: 'AdminsOnly',
|
|
74
|
+
}),
|
|
75
|
+
'skip-handlers': Flags.string({
|
|
76
|
+
multiple: true,
|
|
77
|
+
options: ['FeatureEnforcement'],
|
|
78
|
+
char: 'l',
|
|
79
|
+
summary: messages.getMessage('flags.skip-handlers.summary'),
|
|
80
|
+
description: messages.getMessage('flags.skip-handlers.description'),
|
|
81
|
+
hidden: true,
|
|
82
|
+
}),
|
|
83
|
+
'target-dev-hub': Flags.string({
|
|
84
|
+
summary: messages.getMessage('flags.target-dev-hub.summary'),
|
|
85
|
+
char: 'v',
|
|
86
|
+
}),
|
|
87
|
+
'target-org': Flags.requiredOrg(),
|
|
88
|
+
'upgrade-type': Flags.custom({
|
|
89
|
+
options: ['DeprecateOnly', 'Mixed', 'Delete'],
|
|
90
|
+
})({
|
|
91
|
+
char: 't',
|
|
92
|
+
summary: messages.getMessage('flags.upgrade-type.summary'),
|
|
93
|
+
description: messages.getMessage('flags.upgrade-type.description'),
|
|
94
|
+
default: 'Mixed',
|
|
95
|
+
}),
|
|
96
|
+
wait: Flags.duration({
|
|
97
|
+
unit: 'minutes',
|
|
98
|
+
char: 'w',
|
|
99
|
+
summary: messages.getMessage('flags.wait.summary'),
|
|
100
|
+
default: Duration.minutes(30),
|
|
101
|
+
}),
|
|
102
|
+
};
|
|
103
|
+
async run() {
|
|
104
|
+
const { flags } = await this.parse(PackageDependenciesInstall);
|
|
105
|
+
// Authorize to the target org
|
|
106
|
+
const targetOrgConnection = flags['target-org']?.getConnection(flags['api-version']);
|
|
107
|
+
if (!targetOrgConnection) {
|
|
108
|
+
throw messages.createError('error.targetOrgConnectionFailed');
|
|
109
|
+
}
|
|
110
|
+
// Validate minimum api version
|
|
111
|
+
const apiVersion = parseInt(targetOrgConnection.getApiVersion(), 10);
|
|
112
|
+
if (apiVersion < 36) {
|
|
113
|
+
throw messages.createError('error.apiVersionTooLow');
|
|
114
|
+
}
|
|
115
|
+
let packagesToInstall = [];
|
|
116
|
+
const packageInstallRequests = [];
|
|
117
|
+
const devHubDependencies = [];
|
|
118
|
+
this.spinner.start('Analyzing project to determine packages to install', '\n', { stdout: true });
|
|
119
|
+
for (const packageDirectory of this.project?.getPackageDirectories() ?? []) {
|
|
120
|
+
for (const dependency of packageDirectory?.dependencies ?? []) {
|
|
121
|
+
if (dependency.package && dependency.versionNumber) {
|
|
122
|
+
// This must be resolved by a dev hub
|
|
123
|
+
devHubDependencies.push(dependency);
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
const packageVersionId = this.project.getPackageIdFromAlias(dependency.package) ?? dependency.package;
|
|
127
|
+
if (!isPackageVersionId(packageVersionId)) {
|
|
128
|
+
throw messages.createError('error.invalidSubscriberPackageVersionId', [dependency.package]);
|
|
129
|
+
}
|
|
130
|
+
packagesToInstall.push({
|
|
131
|
+
Status: '',
|
|
132
|
+
PackageName: dependency.package,
|
|
133
|
+
SubscriberPackageVersionId: packageVersionId,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
this.spinner.stop();
|
|
138
|
+
if (devHubDependencies.length > 0) {
|
|
139
|
+
this.spinner.start('Resolving package versions from dev hub', '\n', { stdout: true });
|
|
140
|
+
if (!flags['target-dev-hub']) {
|
|
141
|
+
throw messages.createError('error.targetDevHubMissing');
|
|
142
|
+
}
|
|
143
|
+
// Initialize the authorization for the provided dev hub
|
|
144
|
+
const targetDevHubAuthInfo = await AuthInfo.create({ username: flags['target-dev-hub'] });
|
|
145
|
+
// Create a connection to the dev hub
|
|
146
|
+
const targetDevHubConnection = await Connection.create({ authInfo: targetDevHubAuthInfo });
|
|
147
|
+
if (!targetDevHubConnection) {
|
|
148
|
+
throw messages.createError('error.targetDevHubConnectionFailed');
|
|
149
|
+
}
|
|
150
|
+
for (const devHubDependency of devHubDependencies) {
|
|
151
|
+
if (!devHubDependency.package || !devHubDependency.versionNumber) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const packageId = this.project.getPackageIdFromAlias(devHubDependency.package) ?? devHubDependency.package;
|
|
155
|
+
if (!isPackageId(packageId)) {
|
|
156
|
+
throw messages.createError('error.invalidPackage2Id', [devHubDependency.package]);
|
|
157
|
+
}
|
|
158
|
+
const packageVersionId = await resolvePackageVersionId(packageId, devHubDependency.versionNumber, flags.branch, targetDevHubConnection);
|
|
159
|
+
if (!isPackageVersionId(packageVersionId)) {
|
|
160
|
+
throw messages.createError('error.invalidSubscriberPackageVersionId', [devHubDependency.package]);
|
|
161
|
+
}
|
|
162
|
+
packagesToInstall.push({
|
|
163
|
+
PackageName: devHubDependency.package,
|
|
164
|
+
Status: '',
|
|
165
|
+
SubscriberPackageVersionId: packageVersionId,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
this.spinner.stop();
|
|
169
|
+
}
|
|
170
|
+
// Filter out duplicate packages before we start the install process
|
|
171
|
+
this.spinner.start('Checking for duplicate package dependencies', '\n', { stdout: true });
|
|
172
|
+
packagesToInstall = packagesToInstall.filter((packageToInstall, index, self) => index === self.findIndex((t) => t.SubscriberPackageVersionId === packageToInstall?.SubscriberPackageVersionId));
|
|
173
|
+
this.spinner.stop();
|
|
174
|
+
if (packagesToInstall?.length === 0) {
|
|
175
|
+
this.log('No packages were found to install');
|
|
176
|
+
return packagesToInstall;
|
|
177
|
+
}
|
|
178
|
+
// Process any installation keys for the packages
|
|
179
|
+
const installationKeyMap = new Map();
|
|
180
|
+
if (flags['installation-key']) {
|
|
181
|
+
this.spinner.start('Processing package installation keys', '\n', { stdout: true });
|
|
182
|
+
for (let installationKey of flags['installation-key']) {
|
|
183
|
+
installationKey = installationKey.trim();
|
|
184
|
+
const isKeyValid = installationKeyRegex.test(installationKey);
|
|
185
|
+
if (!isKeyValid) {
|
|
186
|
+
throw messages.createError('error.installationKeyFormat');
|
|
187
|
+
}
|
|
188
|
+
const installationKeyPair = installationKey.split(':');
|
|
189
|
+
const packageVersionId = this.project.getPackageIdFromAlias(installationKeyPair[0]) ?? installationKeyPair[0];
|
|
190
|
+
const packageInstallationKey = installationKeyPair[1];
|
|
191
|
+
if (!isPackageVersionId(packageVersionId)) {
|
|
192
|
+
throw messages.createError('error.invalidSubscriberPackageVersionId', [packageVersionId]);
|
|
193
|
+
}
|
|
194
|
+
installationKeyMap.set(packageVersionId, packageInstallationKey);
|
|
195
|
+
}
|
|
196
|
+
this.spinner.stop();
|
|
197
|
+
}
|
|
198
|
+
let installedPackages = [];
|
|
199
|
+
// If precheck is enabled, get the currently installed packages
|
|
200
|
+
if (installType[flags['install-type']] === installType.Delta) {
|
|
201
|
+
this.spinner.start('Analyzing which packages to install', '\n', { stdout: true });
|
|
202
|
+
installedPackages = await SubscriberPackageVersion.installedList(targetOrgConnection);
|
|
203
|
+
this.spinner.stop();
|
|
204
|
+
}
|
|
205
|
+
this.spinner.start('Installing dependent packages', '\n', { stdout: true });
|
|
206
|
+
for (const packageToInstall of packagesToInstall) {
|
|
207
|
+
if (installType[flags['install-type']] === installType.Delta) {
|
|
208
|
+
if (isPackageVersionInstalled(installedPackages, packageToInstall?.SubscriberPackageVersionId)) {
|
|
209
|
+
packageToInstall.Status = 'Skipped';
|
|
210
|
+
this.log(`Package ${packageToInstall?.PackageName} (${packageToInstall?.SubscriberPackageVersionId}) is already installed and will be skipped`);
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
let installationKey = '';
|
|
215
|
+
// Check if we have an installation key for this package
|
|
216
|
+
if (installationKeyMap.has(packageToInstall?.SubscriberPackageVersionId)) {
|
|
217
|
+
// If we do, set the installation key value
|
|
218
|
+
installationKey = installationKeyMap.get(packageToInstall?.SubscriberPackageVersionId) ?? '';
|
|
219
|
+
}
|
|
220
|
+
this.spinner.start(`Preparing package ${packageToInstall.PackageName}`, '\n', { stdout: true });
|
|
221
|
+
const subscriberPackageVersion = new SubscriberPackageVersion({
|
|
222
|
+
aliasOrId: packageToInstall?.SubscriberPackageVersionId,
|
|
223
|
+
connection: targetOrgConnection,
|
|
224
|
+
password: installationKey,
|
|
225
|
+
});
|
|
226
|
+
const request = {
|
|
227
|
+
ApexCompileType: flags['apex-compile'],
|
|
228
|
+
EnableRss: true,
|
|
229
|
+
Password: installationKey,
|
|
230
|
+
SecurityType: securityType[flags['security-type']],
|
|
231
|
+
SkipHandlers: flags['skip-handlers']?.join(','),
|
|
232
|
+
SubscriberPackageVersionKey: await subscriberPackageVersion.getId(),
|
|
233
|
+
UpgradeType: upgradeType[flags['upgrade-type']],
|
|
234
|
+
};
|
|
235
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
236
|
+
Lifecycle.getInstance().on(PackageEvents.install.warning, async (warningMsg) => {
|
|
237
|
+
this.warn(warningMsg);
|
|
238
|
+
});
|
|
239
|
+
this.spinner.stop();
|
|
240
|
+
if (flags['publish-wait']?.milliseconds > 0) {
|
|
241
|
+
let timeThen = Date.now();
|
|
242
|
+
// waiting for publish to finish
|
|
243
|
+
let remainingTime = flags['publish-wait'];
|
|
244
|
+
Lifecycle.getInstance().on(PackageEvents.install['subscriber-status'],
|
|
245
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
246
|
+
async (publishStatus) => {
|
|
247
|
+
const elapsedTime = Duration.milliseconds(Date.now() - timeThen);
|
|
248
|
+
timeThen = Date.now();
|
|
249
|
+
remainingTime = Duration.milliseconds(remainingTime.milliseconds - elapsedTime.milliseconds);
|
|
250
|
+
const status = publishStatus === 'NO_ERRORS_DETECTED' ? 'Available for installation' : 'Unavailable for installation';
|
|
251
|
+
this.spinner.status = `${remainingTime.minutes} minutes remaining until timeout. Publish status: ${status}\n`;
|
|
252
|
+
});
|
|
253
|
+
this.spinner.start(`${remainingTime.minutes} minutes remaining until timeout. Publish status: 'Querying Status'`, '\n', { stdout: true });
|
|
254
|
+
await subscriberPackageVersion.waitForPublish({
|
|
255
|
+
publishTimeout: flags['publish-wait'],
|
|
256
|
+
publishFrequency: Duration.seconds(10),
|
|
257
|
+
installationKey,
|
|
258
|
+
});
|
|
259
|
+
// need to stop the spinner to avoid weird behavior with the prompts below
|
|
260
|
+
this.spinner.stop();
|
|
261
|
+
}
|
|
262
|
+
// If the user has not specified --no-prompt, process prompts
|
|
263
|
+
if (!flags['no-prompt']) {
|
|
264
|
+
// If the user has specified --upgradetype Delete, then prompt for confirmation for Unlocked Packages
|
|
265
|
+
if (flags['upgrade-type'] === 'Delete' && (await subscriberPackageVersion.getPackageType()) === 'Unlocked') {
|
|
266
|
+
const promptMsg = messages.getMessage('prompt.upgradeType');
|
|
267
|
+
if (!(await this.confirm(promptMsg))) {
|
|
268
|
+
throw messages.createError('info.canceledPackageInstall');
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
// If the package has external sites, ask the user for permission to enable them
|
|
272
|
+
const externalSites = await subscriberPackageVersion.getExternalSites();
|
|
273
|
+
if (externalSites) {
|
|
274
|
+
const promptMsg = messages.getMessage('prompt.enableRss', [externalSites.join('\n')]);
|
|
275
|
+
request.EnableRss = await this.confirm(promptMsg);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
let installOptions;
|
|
279
|
+
if (flags.wait) {
|
|
280
|
+
installOptions = {
|
|
281
|
+
pollingTimeout: flags.wait,
|
|
282
|
+
pollingFrequency: Duration.seconds(2),
|
|
283
|
+
};
|
|
284
|
+
let remainingTime = flags.wait;
|
|
285
|
+
let timeThen = Date.now();
|
|
286
|
+
// waiting for package install to finish
|
|
287
|
+
Lifecycle.getInstance().on(PackageEvents.install.status,
|
|
288
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
289
|
+
async (piRequest) => {
|
|
290
|
+
const elapsedTime = Duration.milliseconds(Date.now() - timeThen);
|
|
291
|
+
timeThen = Date.now();
|
|
292
|
+
remainingTime = Duration.milliseconds(remainingTime.milliseconds - elapsedTime.milliseconds);
|
|
293
|
+
this.spinner.status = `${remainingTime.minutes} minutes remaining until timeout. Install status: ${piRequest.Status}\n`;
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
let pkgInstallRequest;
|
|
297
|
+
try {
|
|
298
|
+
this.spinner.start(`Installing package ${packageToInstall.PackageName}`, '\n', { stdout: true });
|
|
299
|
+
pkgInstallRequest = await subscriberPackageVersion.install(request, installOptions);
|
|
300
|
+
this.spinner.stop();
|
|
301
|
+
}
|
|
302
|
+
catch (error) {
|
|
303
|
+
if (error instanceof SfError && error.data) {
|
|
304
|
+
pkgInstallRequest = error.data;
|
|
305
|
+
this.spinner.stop(messages.getMessage('error.packageInstallPollingTimeout'));
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
throw error;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
finally {
|
|
312
|
+
if (pkgInstallRequest) {
|
|
313
|
+
if (pkgInstallRequest.Status === 'SUCCESS') {
|
|
314
|
+
packageToInstall.Status = 'Installed';
|
|
315
|
+
packageInstallRequests.push(pkgInstallRequest);
|
|
316
|
+
}
|
|
317
|
+
else if (['IN_PROGRESS', 'UNKNOWN'].includes(pkgInstallRequest.Status)) {
|
|
318
|
+
packageToInstall.Status = 'Installing';
|
|
319
|
+
throw messages.createError('error.packageInstallInProgress', [
|
|
320
|
+
this.config.bin,
|
|
321
|
+
pkgInstallRequest.Id,
|
|
322
|
+
targetOrgConnection.getUsername(),
|
|
323
|
+
]);
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
packageToInstall.Status = 'Failed';
|
|
327
|
+
throw messages.createError('error.packageInstall', [reducePackageInstallRequestErrors(pkgInstallRequest)]);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
return packagesToInstall;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../../../src/commands/simply/package/dependencies/install.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,+BAA+B;AAC/B,qCAAqC;AACrC,sCAAsC;AACtC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAwB,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC5G,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAEL,aAAa,EA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;wBACN,gBAAgB,CAAC,MAAM,GAAG,QAAQ,CAAC;wBACnC,MAAM,QAAQ,CAAC,WAAW,CAAC,sBAAsB,EAAE,CAAC,iCAAiC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;oBAC7G,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,iBAAiB,CAAC;IAC3B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export type PackageVersionCleanupResult = {
|
|
3
|
+
Error?: string;
|
|
4
|
+
Success: boolean;
|
|
5
|
+
SubscriberPackageVersionId: string;
|
|
6
|
+
};
|
|
7
|
+
export default class PackageVersionCleanup extends SfCommand<PackageVersionCleanupResult[]> {
|
|
8
|
+
static readonly summary: string;
|
|
9
|
+
static readonly description: string;
|
|
10
|
+
static readonly examples: string[];
|
|
11
|
+
static readonly requiresProject = true;
|
|
12
|
+
static readonly flags: {
|
|
13
|
+
'api-version': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
14
|
+
matcher: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
15
|
+
package: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
16
|
+
'target-dev-hub': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<PackageVersionCleanupResult[]>;
|
|
19
|
+
private displayDeletionResults;
|
|
20
|
+
}
|