@forge/cli 0.0.0-experimental-819498d → 0.0.0-experimental-a9f00a0
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 +2901 -7
- package/README.md +18 -19
- package/npm-shrinkwrap.json +1957 -4159
- package/out/analytics-client/analytics-client.d.ts +0 -24
- package/out/analytics-client/analytics-client.d.ts.map +1 -1
- package/out/analytics-client/analytics-client.js +0 -115
- package/out/analytics-client/analytics-message-handler.d.ts +1 -5
- package/out/analytics-client/analytics-message-handler.d.ts.map +1 -1
- package/out/analytics-client/analytics-message-handler.js +2 -30
- package/out/autocomplete/autocomplete-config.json +16 -26
- package/out/bin/cli.js +0 -2
- package/out/bin/postinstall.js +0 -13
- package/out/command-line/anon-user-id.js +6 -10
- package/out/command-line/command.d.ts +7 -3
- package/out/command-line/command.d.ts.map +1 -1
- package/out/command-line/command.js +56 -60
- package/out/command-line/controller/deploy-controller.d.ts +13 -2
- package/out/command-line/controller/deploy-controller.d.ts.map +1 -1
- package/out/command-line/controller/deploy-controller.js +67 -5
- package/out/command-line/controller/install-controller.d.ts +2 -1
- package/out/command-line/controller/install-controller.d.ts.map +1 -1
- package/out/command-line/controller/install-controller.js +28 -32
- package/out/command-line/controller/lint-controller.js +1 -1
- package/out/command-line/controller/pre-command-controller.js +1 -1
- package/out/command-line/controller/prerequisites-controller.d.ts +11 -0
- package/out/command-line/controller/prerequisites-controller.d.ts.map +1 -0
- package/out/command-line/controller/prerequisites-controller.js +34 -0
- package/out/command-line/controller/stubController.d.ts +9 -0
- package/out/command-line/controller/stubController.d.ts.map +1 -0
- package/out/command-line/controller/stubController.js +15 -0
- package/out/command-line/controller/tunnel-controller.d.ts.map +1 -1
- package/out/command-line/controller/tunnel-controller.js +0 -1
- package/out/command-line/dependency-injection.d.ts +11 -3
- package/out/command-line/dependency-injection.d.ts.map +1 -1
- package/out/command-line/dependency-injection.js +38 -23
- package/out/command-line/index.d.ts.map +1 -1
- package/out/command-line/index.js +4 -0
- package/out/command-line/register-app-commands.d.ts.map +1 -1
- package/out/command-line/register-app-commands.js +1 -9
- package/out/command-line/register-authentication-command.d.ts.map +1 -1
- package/out/command-line/register-authentication-command.js +0 -16
- package/out/command-line/register-deployment-commands.d.ts +8 -0
- package/out/command-line/register-deployment-commands.d.ts.map +1 -1
- package/out/command-line/register-environment-variables-commands.d.ts +1 -1
- package/out/command-line/register-environment-variables-commands.d.ts.map +1 -1
- package/out/command-line/register-environment-variables-commands.js +22 -7
- package/out/command-line/register-installation-commands.d.ts +1 -1
- package/out/command-line/register-installation-commands.d.ts.map +1 -1
- package/out/command-line/register-installation-commands.js +19 -13
- package/out/command-line/register-providers-commands.d.ts +3 -0
- package/out/command-line/register-providers-commands.d.ts.map +1 -0
- package/out/command-line/register-providers-commands.js +43 -0
- package/out/command-line/register-webtrigger-commands.d.ts.map +1 -1
- package/out/command-line/register-webtrigger-commands.js +9 -11
- package/out/command-line/unique-machine-id.d.ts.map +1 -1
- package/out/command-line/unique-machine-id.js +1 -10
- package/out/command-line/version-info.d.ts +1 -0
- package/out/command-line/version-info.d.ts.map +1 -1
- package/out/command-line/version-info.js +3 -2
- package/out/command-line/view/deploy-view.d.ts +7 -1
- package/out/command-line/view/deploy-view.d.ts.map +1 -1
- package/out/command-line/view/deploy-view.js +22 -5
- package/out/command-line/view/install-view.d.ts +5 -5
- package/out/command-line/view/install-view.d.ts.map +1 -1
- package/out/command-line/view/install-view.js +20 -15
- package/out/command-line/view/lint-view.d.ts +3 -2
- package/out/command-line/view/lint-view.d.ts.map +1 -1
- package/out/command-line/view/lint-view.js +3 -0
- package/out/command-line/view/lite-lint-view.d.ts +3 -2
- package/out/command-line/view/lite-lint-view.d.ts.map +1 -1
- package/out/command-line/view/lite-lint-view.js +3 -0
- package/out/deploy/deployer/deploy-monitor-graphql-client.js +1 -1
- package/out/deploy/deployer/trigger-deploy-graphql-client.js +1 -1
- package/out/deploy/packager/archiver.d.ts +3 -2
- package/out/deploy/packager/archiver.d.ts.map +1 -1
- package/out/deploy/packager/archiver.js +10 -2
- package/out/deploy/packager/packager.d.ts +1 -3
- package/out/deploy/packager/packager.d.ts.map +1 -1
- package/out/deploy/packager/packager.js +2 -25
- package/out/deploy/uploader/artifact-graphql-client.js +2 -2
- package/out/environment-variables/graphql-client.d.ts +1 -1
- package/out/environment-variables/graphql-client.js +3 -3
- package/out/installations/graphql-client.d.ts +7 -9
- package/out/installations/graphql-client.d.ts.map +1 -1
- package/out/installations/graphql-client.js +61 -85
- package/out/installations/install-app-site.d.ts +2 -8
- package/out/installations/install-app-site.d.ts.map +1 -1
- package/out/installations/install-app-site.js +2 -3
- package/out/installations/uninstall-app.d.ts +0 -1
- package/out/installations/uninstall-app.d.ts.map +1 -1
- package/out/installations/uninstall-app.js +2 -4
- package/out/migration-keys/graphql-client.d.ts +8 -0
- package/out/migration-keys/graphql-client.d.ts.map +1 -0
- package/out/migration-keys/graphql-client.js +55 -0
- package/out/providers/configure-provider.d.ts +19 -0
- package/out/providers/configure-provider.d.ts.map +1 -0
- package/out/providers/configure-provider.js +14 -0
- package/out/providers/graphql-client.d.ts +12 -0
- package/out/providers/graphql-client.d.ts.map +1 -0
- package/out/providers/graphql-client.js +47 -0
- package/out/service/installation-service.d.ts +13 -11
- package/out/service/installation-service.d.ts.map +1 -1
- package/out/service/installation-service.js +38 -13
- package/out/service/lint-service.d.ts +2 -2
- package/out/service/lint-service.d.ts.map +1 -1
- package/out/service/lint-service.js +2 -2
- package/out/service/lite-lint-service.d.ts +3 -3
- package/out/service/lite-lint-service.d.ts.map +1 -1
- package/out/service/lite-lint-service.js +2 -2
- package/out/service/migration-keys-service.d.ts +19 -0
- package/out/service/migration-keys-service.d.ts.map +1 -0
- package/out/service/migration-keys-service.js +14 -0
- package/out/service/resource-packaging-service.d.ts +3 -2
- package/out/service/resource-packaging-service.d.ts.map +1 -1
- package/out/service/resource-packaging-service.js +6 -2
- package/out/service/tunnel-analytics-service.d.ts +0 -5
- package/out/service/tunnel-analytics-service.d.ts.map +1 -1
- package/out/service/tunnel-analytics-service.js +3 -14
- package/out/service/tunnel-service.d.ts +1 -3
- package/out/service/tunnel-service.d.ts.map +1 -1
- package/out/service/tunnel-service.js +8 -9
- package/out/webtrigger/get-webtrigger-url.d.ts +10 -4
- package/out/webtrigger/get-webtrigger-url.d.ts.map +1 -1
- package/out/webtrigger/get-webtrigger-url.js +11 -21
- package/out/webtrigger/graphql-client.d.ts +14 -0
- package/out/webtrigger/graphql-client.d.ts.map +1 -0
- package/out/webtrigger/graphql-client.js +52 -0
- package/out/workers/forge-cli-workers.js +2 -2
- package/package.json +12 -13
- package/out/bin/preinstall.d.ts +0 -3
- package/out/bin/preinstall.d.ts.map +0 -1
- package/out/bin/preinstall.js +0 -9
- package/out/command-line/cli-prerequisites.d.ts +0 -3
- package/out/command-line/cli-prerequisites.d.ts.map +0 -1
- package/out/command-line/cli-prerequisites.js +0 -37
|
@@ -6,11 +6,9 @@ const commander_1 = tslib_1.__importStar(require("commander"));
|
|
|
6
6
|
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
7
7
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
8
8
|
const cli_shared_2 = require("@forge/cli-shared");
|
|
9
|
-
const cli_shared_3 = require("@forge/cli-shared");
|
|
10
9
|
const environment_1 = require("./environment");
|
|
11
|
-
const
|
|
10
|
+
const cli_shared_3 = require("@forge/cli-shared");
|
|
12
11
|
const version_info_1 = require("./version-info");
|
|
13
|
-
const anon_user_id_1 = require("./anon-user-id");
|
|
14
12
|
const errors_1 = require("./errors");
|
|
15
13
|
const command_suggestion_service_1 = tslib_1.__importDefault(require("../service/command-suggestion-service"));
|
|
16
14
|
class WrapperError extends commander_1.CommanderError {
|
|
@@ -32,30 +30,30 @@ class Command {
|
|
|
32
30
|
this.cliDetails = cliDetails;
|
|
33
31
|
this.expectsArguments = expectsArguments;
|
|
34
32
|
this.analyticsName = analyticsName;
|
|
35
|
-
this.requiresAuthentication = true;
|
|
36
33
|
this.requiresAnalyticsConsent = true;
|
|
37
34
|
this.requiredOptionFlags = [];
|
|
38
35
|
this.preconditionFn = [];
|
|
36
|
+
this.options = [];
|
|
37
|
+
this.commands = [];
|
|
39
38
|
this.exitOverride = (listener) => {
|
|
40
39
|
this.cmd.exitOverride((err) => listener(err));
|
|
41
40
|
return this;
|
|
42
41
|
};
|
|
43
42
|
this.actionProcessor = async (cb, ...args) => {
|
|
44
|
-
var _a
|
|
43
|
+
var _a;
|
|
45
44
|
if (this.newCommand) {
|
|
46
|
-
this.ui.error(new Error(
|
|
45
|
+
this.ui.error(new Error(cli_shared_2.Text.deprecate(this.newCommand)));
|
|
47
46
|
}
|
|
48
47
|
const cmdName = this.cmd.name();
|
|
49
|
-
let cred = anon_user_id_1.getAnonId(true);
|
|
50
48
|
let attributes = {};
|
|
51
49
|
try {
|
|
52
50
|
if (!this.expectsArguments && args.length > 2) {
|
|
53
|
-
throw new
|
|
51
|
+
throw new cli_shared_2.ValidationError(cli_shared_2.Text.extraArguments(cmdName));
|
|
54
52
|
}
|
|
55
53
|
const [options] = args;
|
|
56
54
|
if (options === null || options === void 0 ? void 0 : options.nonInteractive) {
|
|
57
55
|
if (!this.satisfiesNonInteractiveOptions(options)) {
|
|
58
|
-
throw new
|
|
56
|
+
throw new cli_shared_2.ValidationError(cli_shared_2.Text.nonInteractive.error.missingRequiredOption(cmdName, this.requiredOptionFlags));
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
59
|
if (this.requiresAnalyticsConsent) {
|
|
@@ -67,30 +65,20 @@ class Command {
|
|
|
67
65
|
}
|
|
68
66
|
const preconditionCheckAttributes = await this.checkPreconditions(...args);
|
|
69
67
|
attributes = Object.assign(Object.assign({}, attributes), preconditionCheckAttributes);
|
|
70
|
-
const actualCred = await this.checkAuthentication();
|
|
71
|
-
if (actualCred) {
|
|
72
|
-
cred = actualCred;
|
|
73
|
-
}
|
|
74
68
|
const result = await cb(...args);
|
|
75
69
|
if (result) {
|
|
76
70
|
attributes = Object.assign(Object.assign({}, attributes), result.analytics);
|
|
77
|
-
if (result.creds) {
|
|
78
|
-
cred = result.creds;
|
|
79
|
-
}
|
|
80
71
|
}
|
|
81
|
-
this.analyticsClient.reportSuccess((_b = this.analyticsName) !== null && _b !== void 0 ? _b : cmdName, cred, attributes);
|
|
82
72
|
}
|
|
83
73
|
catch (e) {
|
|
84
74
|
if (isErrorWithAnalytics(e)) {
|
|
85
75
|
attributes = Object.assign(Object.assign({}, e.getAttributes()), attributes);
|
|
86
76
|
}
|
|
87
77
|
if (e instanceof errors_1.DeferredErrors) {
|
|
88
|
-
e.getErrors().forEach((error) => { var _a; return this.analyticsClient.reportFailure((_a = this.analyticsName) !== null && _a !== void 0 ? _a : cmdName, cred, attributes, error); });
|
|
89
78
|
process.exit(1);
|
|
90
79
|
}
|
|
91
80
|
else {
|
|
92
|
-
|
|
93
|
-
cli_shared_4.exitOnError(this.ui)(e);
|
|
81
|
+
cli_shared_3.exitOnError(this.ui)(e);
|
|
94
82
|
}
|
|
95
83
|
}
|
|
96
84
|
};
|
|
@@ -104,22 +92,32 @@ class Command {
|
|
|
104
92
|
}
|
|
105
93
|
version(str, flags) {
|
|
106
94
|
this.cmd.version(str, flags);
|
|
95
|
+
flags = flags || '-V, --version';
|
|
96
|
+
const versionOption = new commander_1.Option(flags, 'output the version number');
|
|
97
|
+
this.options.push(versionOption);
|
|
107
98
|
return this;
|
|
108
99
|
}
|
|
109
|
-
command(name) {
|
|
100
|
+
command(name, opts) {
|
|
110
101
|
const cmd = this.cmd
|
|
111
|
-
.command(name)
|
|
102
|
+
.command(name, opts)
|
|
112
103
|
.allowUnknownOption(false)
|
|
113
|
-
.allowExcessArguments(false)
|
|
114
|
-
.option('--verbose', cli_shared_3.Text.optionVerbose);
|
|
104
|
+
.allowExcessArguments(false);
|
|
115
105
|
const trimmedName = name.trim();
|
|
116
106
|
const expectsArguments = trimmedName.endsWith(']') || trimmedName.endsWith('>');
|
|
117
107
|
const subCommand = new Command(this.ui, this.analyticsClient, this.preCommandController, this.cliDetails, cmd, expectsArguments, Command.concatenateNames(this.analyticsName, cmd.name()));
|
|
108
|
+
subCommand.option('--verbose', cli_shared_2.Text.optionVerbose);
|
|
118
109
|
subCommand.exitOverride((err) => {
|
|
119
110
|
throw new WrapperError(err, subCommand.cmd.name());
|
|
120
111
|
});
|
|
112
|
+
this.commands.push(subCommand);
|
|
121
113
|
return subCommand;
|
|
122
114
|
}
|
|
115
|
+
deprecatedCommand(oldName, newName, stubController) {
|
|
116
|
+
this.command(oldName, { hidden: true })
|
|
117
|
+
.requireNoAuthentication()
|
|
118
|
+
.requireNoAnalyticsConsent()
|
|
119
|
+
.action(() => stubController.run({ oldName, newName }));
|
|
120
|
+
}
|
|
123
121
|
getAnalyticsName() {
|
|
124
122
|
return this.analyticsName;
|
|
125
123
|
}
|
|
@@ -133,6 +131,14 @@ class Command {
|
|
|
133
131
|
}
|
|
134
132
|
option(flags, description, fn, defaultValue) {
|
|
135
133
|
this.cmd.option(flags, description, fn, defaultValue);
|
|
134
|
+
const option = new commander_1.Option(flags, description);
|
|
135
|
+
if (typeof fn === 'function') {
|
|
136
|
+
option.default(defaultValue).argParser(fn);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
option.default(fn);
|
|
140
|
+
}
|
|
141
|
+
this.options.push(option);
|
|
136
142
|
return this;
|
|
137
143
|
}
|
|
138
144
|
precondition(fn) {
|
|
@@ -149,7 +155,7 @@ class Command {
|
|
|
149
155
|
}
|
|
150
156
|
nonInteractiveOption(...args) {
|
|
151
157
|
this.requiredOptionFlags = args;
|
|
152
|
-
this.cmd.option('--non-interactive',
|
|
158
|
+
this.cmd.option('--non-interactive', cli_shared_2.Text.nonInteractive.description);
|
|
153
159
|
return this;
|
|
154
160
|
}
|
|
155
161
|
action(fn) {
|
|
@@ -175,33 +181,38 @@ class Command {
|
|
|
175
181
|
this.unknownCommand(argv);
|
|
176
182
|
return;
|
|
177
183
|
}
|
|
178
|
-
return
|
|
184
|
+
return cli_shared_3.exitOnError(this.ui)(err);
|
|
179
185
|
}
|
|
180
186
|
}
|
|
181
187
|
getDefinedCommands() {
|
|
182
188
|
return this.cmd.commands;
|
|
183
189
|
}
|
|
184
190
|
getDefinedOptions() {
|
|
185
|
-
return this.
|
|
191
|
+
return this.options;
|
|
192
|
+
}
|
|
193
|
+
getCmdName() {
|
|
194
|
+
return this.cmd.name();
|
|
195
|
+
}
|
|
196
|
+
getCommands() {
|
|
197
|
+
return this.commands;
|
|
186
198
|
}
|
|
187
199
|
environmentOption() {
|
|
188
|
-
this.
|
|
200
|
+
this.option('-e, --environment [environment]', cli_shared_2.Text.env.option(cli_shared_1.DEFAULT_ENVIRONMENT_OPTION, cli_shared_1.VALID_ENVIRONMENT_OPTIONS));
|
|
189
201
|
this.precondition(() => {
|
|
190
|
-
this.cmd.opts().environment = environment_1.checkEnvironmentOption(this.cmd.opts().environment ||
|
|
202
|
+
this.cmd.opts().environment = environment_1.checkEnvironmentOption(this.cmd.opts().environment || cli_shared_1.DEFAULT_ENVIRONMENT_OPTION);
|
|
191
203
|
return { appEnv: this.cmd.opts().environment };
|
|
192
204
|
});
|
|
193
205
|
return this;
|
|
194
206
|
}
|
|
195
207
|
siteAndProductOption() {
|
|
196
|
-
this.
|
|
197
|
-
this.
|
|
208
|
+
this.option('-s, --site [site]', cli_shared_2.Text.optionSite);
|
|
209
|
+
this.option('-p, --product [product]', cli_shared_2.Text.optionProduct(cli_shared_1.SUPPORTED_PRODUCTS));
|
|
198
210
|
this.precondition(() => {
|
|
199
211
|
return this.validateContext();
|
|
200
212
|
});
|
|
201
213
|
return this;
|
|
202
214
|
}
|
|
203
215
|
requireNoAuthentication() {
|
|
204
|
-
this.requiresAuthentication = false;
|
|
205
216
|
return this;
|
|
206
217
|
}
|
|
207
218
|
requireNoAnalyticsConsent() {
|
|
@@ -225,13 +236,6 @@ class Command {
|
|
|
225
236
|
}
|
|
226
237
|
return attributes;
|
|
227
238
|
}
|
|
228
|
-
async checkAuthentication() {
|
|
229
|
-
if (this.requiresAuthentication) {
|
|
230
|
-
const credentialsGetter = cli_shared_1.getCredentialsStoreProvider(this.ui);
|
|
231
|
-
return credentialsGetter.getCredentials();
|
|
232
|
-
}
|
|
233
|
-
return undefined;
|
|
234
|
-
}
|
|
235
239
|
checkVersion() {
|
|
236
240
|
if (!this.cliDetails ||
|
|
237
241
|
!this.cliDetails.latest ||
|
|
@@ -240,7 +244,7 @@ class Command {
|
|
|
240
244
|
return;
|
|
241
245
|
}
|
|
242
246
|
if (semver_1.default.gt(this.cliDetails.latest, this.cliDetails.version)) {
|
|
243
|
-
this.ui.warn(
|
|
247
|
+
this.ui.warn(cli_shared_2.Text.error.outdatedCLIVersion(this.cliDetails.version, this.cliDetails.latest));
|
|
244
248
|
}
|
|
245
249
|
else if (semver_1.default.gt(this.cliDetails.version, this.cliDetails.latest)) {
|
|
246
250
|
version_info_1.clearVersionCache(this.cliDetails.name);
|
|
@@ -248,9 +252,9 @@ class Command {
|
|
|
248
252
|
}
|
|
249
253
|
async validateContext() {
|
|
250
254
|
if (this.cmd.opts().product) {
|
|
251
|
-
const capitalizedProduct =
|
|
252
|
-
if (!
|
|
253
|
-
throw new
|
|
255
|
+
const capitalizedProduct = cli_shared_1.capitalizeProduct(this.cmd.opts().product);
|
|
256
|
+
if (!cli_shared_1.isSuppportedProduct(capitalizedProduct)) {
|
|
257
|
+
throw new cli_shared_2.ValidationError(cli_shared_2.Text.error.invalidProduct);
|
|
254
258
|
}
|
|
255
259
|
this.cmd.opts().product = capitalizedProduct;
|
|
256
260
|
}
|
|
@@ -258,7 +262,7 @@ class Command {
|
|
|
258
262
|
if (this.cmd.opts().site) {
|
|
259
263
|
trySite = this.cmd.opts().site;
|
|
260
264
|
}
|
|
261
|
-
this.cmd.opts().site = trySite ?
|
|
265
|
+
this.cmd.opts().site = trySite ? cli_shared_1.validateSite(trySite) : undefined;
|
|
262
266
|
return { product: this.cmd.opts().product };
|
|
263
267
|
}
|
|
264
268
|
findLastValidCommand(argv) {
|
|
@@ -283,17 +287,21 @@ class Command {
|
|
|
283
287
|
const { command: lastCommand, index: lastCommandIndex } = this.findLastValidCommand(argv);
|
|
284
288
|
const badLastArg = argv[lastCommandIndex + 1];
|
|
285
289
|
const suggestionService = new command_suggestion_service_1.default();
|
|
286
|
-
const suggestions = suggestionService.getSuggestions(badLastArg, lastCommand.commands
|
|
287
|
-
|
|
290
|
+
const suggestions = suggestionService.getSuggestions(badLastArg, lastCommand.commands
|
|
291
|
+
.filter((cmd) => {
|
|
292
|
+
return cmd._hidden !== true;
|
|
293
|
+
})
|
|
294
|
+
.map((cmd) => cmd.name()));
|
|
295
|
+
errorMessage.push(cli_shared_2.Text.invalidCmd(argv.slice(2, lastCommandIndex + 2).join(' ')));
|
|
288
296
|
if (suggestions.length) {
|
|
289
297
|
errorMessage.push(`Did you mean:`);
|
|
290
298
|
const suggestionsPrefixed = suggestions.map((suggestion) => [...argv.slice(2, lastCommandIndex + 1), suggestion].join(' '));
|
|
291
299
|
errorMessage.push(suggestionsPrefixed.join('\n'));
|
|
292
|
-
errorMessage.push(
|
|
300
|
+
errorMessage.push(cli_shared_2.Text.invalidCmdHelp);
|
|
293
301
|
this.ui.info(errorMessage.join('\n\n'));
|
|
294
302
|
}
|
|
295
303
|
else {
|
|
296
|
-
errorMessage.push(
|
|
304
|
+
errorMessage.push(cli_shared_2.Text.invalidCmdHelp);
|
|
297
305
|
this.ui.error(new Error(errorMessage.join(' ')));
|
|
298
306
|
}
|
|
299
307
|
}
|
|
@@ -318,18 +326,6 @@ class Command {
|
|
|
318
326
|
}
|
|
319
327
|
exports.Command = Command;
|
|
320
328
|
Command.reportHelp = async (cmd, cmdError) => {
|
|
321
|
-
try {
|
|
322
|
-
let cred = anon_user_id_1.getAnonId(true);
|
|
323
|
-
try {
|
|
324
|
-
const credentialsGetter = cli_shared_1.getCredentialsStoreProvider(cmd.ui);
|
|
325
|
-
cred = await credentialsGetter.getCredentials();
|
|
326
|
-
}
|
|
327
|
-
catch (noTokenError) {
|
|
328
|
-
}
|
|
329
|
-
cmd.analyticsClient.reportSuccess('help', cred, { command: cmdError.getCommandName() });
|
|
330
|
-
}
|
|
331
|
-
catch (err) {
|
|
332
|
-
}
|
|
333
329
|
return;
|
|
334
330
|
};
|
|
335
331
|
Command.isError = (cmdError) => {
|
|
@@ -2,6 +2,7 @@ import { AppConfigProvider, ConfigFile, HiddenError } from '@forge/cli-shared';
|
|
|
2
2
|
import { LintService } from '../../service/lint-service';
|
|
3
3
|
import { DeployView } from '../view/deploy-view';
|
|
4
4
|
import { InstallationService } from '../../service/installation-service';
|
|
5
|
+
import { MigrationKeysService } from '../../service/migration-keys-service';
|
|
5
6
|
import { ResourcePackagingService } from '../../service/resource-packaging-service';
|
|
6
7
|
import { ErrorWithAnalytics } from '../command';
|
|
7
8
|
import { PackageUploadDeployCommand } from '../../deploy';
|
|
@@ -15,18 +16,28 @@ export declare class DeployLintFailureError extends HiddenError implements Error
|
|
|
15
16
|
constructor(scopes: string[]);
|
|
16
17
|
getAttributes(): Record<string, string[]>;
|
|
17
18
|
}
|
|
19
|
+
export declare class InvalidConnectKeyError extends HiddenError implements ErrorWithAnalytics {
|
|
20
|
+
private readonly reason;
|
|
21
|
+
constructor(reason: string);
|
|
22
|
+
getAttributes(): Record<string, string>;
|
|
23
|
+
}
|
|
18
24
|
export declare class DeployController {
|
|
19
25
|
private readonly appConfigProvider;
|
|
20
26
|
private readonly configFile;
|
|
21
27
|
private readonly lintService;
|
|
22
28
|
private readonly installationsService;
|
|
29
|
+
private readonly migrationKeysService;
|
|
23
30
|
private readonly deployView;
|
|
24
31
|
private readonly packageUploadDeployCommand;
|
|
25
32
|
private readonly resourcePackagingService;
|
|
26
|
-
constructor(appConfigProvider: AppConfigProvider, configFile: ConfigFile, lintService: LintService, installationsService: InstallationService, deployView: DeployView, packageUploadDeployCommand: PackageUploadDeployCommand, resourcePackagingService: ResourcePackagingService);
|
|
33
|
+
constructor(appConfigProvider: AppConfigProvider, configFile: ConfigFile, lintService: LintService, installationsService: InstallationService, migrationKeysService: MigrationKeysService, deployView: DeployView, packageUploadDeployCommand: PackageUploadDeployCommand, resourcePackagingService: ResourcePackagingService);
|
|
34
|
+
private isMpacProductionApp;
|
|
35
|
+
private connectKeyDeleted;
|
|
36
|
+
private connectKeyChanged;
|
|
37
|
+
private validateConnectKeyChange;
|
|
27
38
|
private verifyPreDeployment;
|
|
28
39
|
private verifyPostDeployment;
|
|
29
|
-
run({ environment, verify }: DeployOptions): Promise<DeploymentResult>;
|
|
40
|
+
run({ environment, verify }: DeployOptions): Promise<DeploymentResult | void>;
|
|
30
41
|
}
|
|
31
42
|
export {};
|
|
32
43
|
//# sourceMappingURL=deploy-controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/deploy-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"deploy-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/deploy-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAQ,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAA+B,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AACzG,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,UAAU,aAAa;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,sBAAuB,SAAQ,WAAY,YAAW,kBAAkB;IACvE,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM,EAAE;IAItC,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;CAKjD;AAED,qBAAa,sBAAuB,SAAQ,WAAY,YAAW,kBAAkB;IACvE,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAGpC,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAK/C;AAED,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,0BAA0B;IAC3C,OAAO,CAAC,QAAQ,CAAC,wBAAwB;gBAPxB,iBAAiB,EAAE,iBAAiB,EACpC,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,oBAAoB,EAAE,mBAAmB,EACzC,oBAAoB,EAAE,oBAAoB,EAC1C,UAAU,EAAE,UAAU,EACtB,0BAA0B,EAAE,0BAA0B,EACtD,wBAAwB,EAAE,wBAAwB;IAGrE,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,iBAAiB;YAGX,wBAAwB;YAwBxB,mBAAmB;YAiBnB,oBAAoB;IAOrB,GAAG,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;CAsD3F"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DeployController = exports.DeployLintFailureError = void 0;
|
|
3
|
+
exports.DeployController = exports.InvalidConnectKeyError = exports.DeployLintFailureError = void 0;
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
5
|
class DeployLintFailureError extends cli_shared_1.HiddenError {
|
|
6
6
|
constructor(scopes) {
|
|
@@ -14,19 +14,62 @@ class DeployLintFailureError extends cli_shared_1.HiddenError {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
exports.DeployLintFailureError = DeployLintFailureError;
|
|
17
|
+
class InvalidConnectKeyError extends cli_shared_1.HiddenError {
|
|
18
|
+
constructor(reason) {
|
|
19
|
+
super();
|
|
20
|
+
this.reason = reason;
|
|
21
|
+
}
|
|
22
|
+
getAttributes() {
|
|
23
|
+
return {
|
|
24
|
+
reason: this.reason
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.InvalidConnectKeyError = InvalidConnectKeyError;
|
|
17
29
|
class DeployController {
|
|
18
|
-
constructor(appConfigProvider, configFile, lintService, installationsService, deployView, packageUploadDeployCommand, resourcePackagingService) {
|
|
30
|
+
constructor(appConfigProvider, configFile, lintService, installationsService, migrationKeysService, deployView, packageUploadDeployCommand, resourcePackagingService) {
|
|
19
31
|
this.appConfigProvider = appConfigProvider;
|
|
20
32
|
this.configFile = configFile;
|
|
21
33
|
this.lintService = lintService;
|
|
22
34
|
this.installationsService = installationsService;
|
|
35
|
+
this.migrationKeysService = migrationKeysService;
|
|
23
36
|
this.deployView = deployView;
|
|
24
37
|
this.packageUploadDeployCommand = packageUploadDeployCommand;
|
|
25
38
|
this.resourcePackagingService = resourcePackagingService;
|
|
26
39
|
}
|
|
40
|
+
isMpacProductionApp(mpacAppKey, environment) {
|
|
41
|
+
return !!(mpacAppKey && environment === 'production');
|
|
42
|
+
}
|
|
43
|
+
connectKeyDeleted(connectKey, comparisonKey) {
|
|
44
|
+
return !!(!connectKey && comparisonKey);
|
|
45
|
+
}
|
|
46
|
+
connectKeyChanged(connectKey, comparisonKey) {
|
|
47
|
+
return !!(comparisonKey && connectKey && connectKey !== comparisonKey);
|
|
48
|
+
}
|
|
49
|
+
async validateConnectKeyChange(environment, keys) {
|
|
50
|
+
const { migrationKeys, mpacAppKey } = keys;
|
|
51
|
+
const connectKey = await this.configFile.getConnectKey();
|
|
52
|
+
const migrationKey = (migrationKeys === null || migrationKeys === void 0 ? void 0 : migrationKeys.confluence) || (migrationKeys === null || migrationKeys === void 0 ? void 0 : migrationKeys.jira);
|
|
53
|
+
const isMpacApp = this.isMpacProductionApp(mpacAppKey, environment);
|
|
54
|
+
if (this.connectKeyDeleted(connectKey, migrationKey)) {
|
|
55
|
+
this.deployView.displayConnectKeyDeleteWarning(environment);
|
|
56
|
+
const proceed = await this.deployView.promptToContinueDeletingConnectKey();
|
|
57
|
+
return { proceed, connectKeyDeleted: proceed, connectKeyChanged: false };
|
|
58
|
+
}
|
|
59
|
+
else if (isMpacApp && this.connectKeyChanged(connectKey, mpacAppKey)) {
|
|
60
|
+
this.deployView.displayMPACAppConnectKeyChangeError(mpacAppKey, connectKey);
|
|
61
|
+
throw new InvalidConnectKeyError(cli_shared_1.Text.deploy.connectKeyChange.mpacAppConnectKeyChangeAnalyticsError);
|
|
62
|
+
}
|
|
63
|
+
else if (!isMpacApp && this.connectKeyChanged(connectKey, migrationKey)) {
|
|
64
|
+
this.deployView.displayConnectKeyChangeWarning(environment, migrationKey, connectKey);
|
|
65
|
+
const proceed = await this.deployView.promptToContinueChangingConnectKey();
|
|
66
|
+
return { proceed, connectKeyChanged: proceed, connectKeyDeleted: false };
|
|
67
|
+
}
|
|
68
|
+
return { proceed: true, connectKeyChanged: false, connectKeyDeleted: false };
|
|
69
|
+
}
|
|
27
70
|
async verifyPreDeployment(environment) {
|
|
28
71
|
this.deployView.displayLintRunning();
|
|
29
|
-
const { lintResults } = await this.lintService.run(environment, { fix: false });
|
|
72
|
+
const { lintResults } = await this.lintService.run(environment, { fix: false }, this.deployView.getLogger());
|
|
30
73
|
const problemCount = this.lintService.problemCount(lintResults);
|
|
31
74
|
if (problemCount.errors) {
|
|
32
75
|
this.deployView.displayLintErrors(lintResults);
|
|
@@ -48,10 +91,19 @@ class DeployController {
|
|
|
48
91
|
}
|
|
49
92
|
async run({ environment, verify }) {
|
|
50
93
|
this.deployView.displayStart(environment);
|
|
94
|
+
let hasConnectKeyChanged = false;
|
|
95
|
+
let hasConnectKeyDeleted = false;
|
|
51
96
|
if (verify) {
|
|
52
97
|
await this.verifyPreDeployment(environment);
|
|
98
|
+
const keys = await this.migrationKeysService.getMigrationKeysForAppEnvironment(environment);
|
|
99
|
+
const { proceed, connectKeyChanged, connectKeyDeleted } = await this.validateConnectKeyChange(environment, keys);
|
|
100
|
+
if (!proceed) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
hasConnectKeyChanged = connectKeyChanged;
|
|
104
|
+
hasConnectKeyDeleted = connectKeyDeleted;
|
|
53
105
|
}
|
|
54
|
-
const {
|
|
106
|
+
const { id } = await this.appConfigProvider();
|
|
55
107
|
const handlers = await this.configFile.getAppHandlers();
|
|
56
108
|
const resources = await this.configFile.getResources();
|
|
57
109
|
const archives = await this.resourcePackagingService.zipResources(resources);
|
|
@@ -67,10 +119,20 @@ class DeployController {
|
|
|
67
119
|
throw err;
|
|
68
120
|
}
|
|
69
121
|
}
|
|
70
|
-
const analytics = await this.deployView.reportDeploymentProgress(id,
|
|
122
|
+
const analytics = await this.deployView.reportDeploymentProgress(id, environment, hasProdInstallations, () => this.packageUploadDeployCommand.execute({ handlers, environmentKey: environment, archives }));
|
|
71
123
|
if (verify) {
|
|
72
124
|
await this.verifyPostDeployment(environment);
|
|
73
125
|
}
|
|
126
|
+
try {
|
|
127
|
+
analytics.analytics.egressPermissionList = await this.configFile.getEgressPermissions();
|
|
128
|
+
analytics.analytics.connectKey = hasConnectKeyChanged
|
|
129
|
+
? { action: 'changed', value: await this.configFile.getConnectKey() }
|
|
130
|
+
: hasConnectKeyDeleted
|
|
131
|
+
? { action: 'deleted' }
|
|
132
|
+
: {};
|
|
133
|
+
}
|
|
134
|
+
catch (e) {
|
|
135
|
+
}
|
|
74
136
|
return analytics;
|
|
75
137
|
}
|
|
76
138
|
}
|
|
@@ -9,6 +9,7 @@ interface InstallViewProps {
|
|
|
9
9
|
site?: URL;
|
|
10
10
|
product?: string;
|
|
11
11
|
upgrade: boolean;
|
|
12
|
+
nonInteractive?: boolean;
|
|
12
13
|
confirmScopes: boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare class NoDeploymentError extends Error {
|
|
@@ -28,7 +29,7 @@ export declare class InstallController {
|
|
|
28
29
|
private promptForSite;
|
|
29
30
|
private promptForUpgrade;
|
|
30
31
|
private getUniqueInstallationProductsFromScopes;
|
|
31
|
-
run({ environment, site, product, upgrade, confirmScopes }: InstallViewProps): Promise<void>;
|
|
32
|
+
run({ environment, site, product, upgrade, confirmScopes, nonInteractive }: InstallViewProps): Promise<void>;
|
|
32
33
|
}
|
|
33
34
|
export {};
|
|
34
35
|
//# sourceMappingURL=install-controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/install-controller.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,iBAAiB,EACjB,UAAU,EAEV,EAAE,
|
|
1
|
+
{"version":3,"file":"install-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/install-controller.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,iBAAiB,EACjB,UAAU,EAEV,EAAE,EASH,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,UAAU,gBAAgB;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,OAAO,CAAC;CACxB;AAiBD,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,WAAW,EAAE,MAAM;CAGhC;AAQD,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,EAAE;IACnB,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,WAAW;gBALX,iBAAiB,EAAE,iBAAiB,EACpC,UAAU,EAAE,UAAU,EACtB,EAAE,EAAE,EAAE,EACN,qBAAqB,EAAE,qBAAqB,EAC5C,mBAAmB,EAAE,mBAAmB,EACxC,WAAW,EAAE,WAAW;YAG7B,cAAc;YAmBd,gBAAgB;YAsChB,gBAAgB;YAKhB,aAAa;YAWb,gBAAgB;IAoB9B,OAAO,CAAC,uCAAuC;IAalC,GAAG,CAAC,EACf,WAAW,EACX,IAAI,EACJ,OAAO,EACP,OAAO,EACP,aAAa,EACb,cAAc,EACf,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAuFpC"}
|
|
@@ -8,12 +8,6 @@ class NoDeploymentError extends Error {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.NoDeploymentError = NoDeploymentError;
|
|
11
|
-
const isInstallationResult = (result) => {
|
|
12
|
-
return !!result.installationId;
|
|
13
|
-
};
|
|
14
|
-
const isAlreadyUpgradedResult = (result) => {
|
|
15
|
-
return result.alreadyUpdated === true;
|
|
16
|
-
};
|
|
17
11
|
class InstallController {
|
|
18
12
|
constructor(appConfigProvider, configFile, ui, installAppSiteCommand, installationService, installView) {
|
|
19
13
|
this.appConfigProvider = appConfigProvider;
|
|
@@ -39,30 +33,26 @@ class InstallController {
|
|
|
39
33
|
}
|
|
40
34
|
}
|
|
41
35
|
}
|
|
42
|
-
async installOrUpgrade(upgrade, environment, site, product,
|
|
36
|
+
async installOrUpgrade(upgrade, environment, site, product, appId, text) {
|
|
43
37
|
return this.ui.displayProgress(async () => {
|
|
44
38
|
if (upgrade) {
|
|
45
|
-
|
|
39
|
+
const isAlreadyUpdated = await this.installationService.upgradeInstallation(site, product, environment, appId);
|
|
40
|
+
return isAlreadyUpdated;
|
|
46
41
|
}
|
|
47
42
|
else {
|
|
48
|
-
|
|
43
|
+
await this.installAppSiteCommand.execute({
|
|
49
44
|
environmentKey: environment,
|
|
50
45
|
site,
|
|
51
46
|
product
|
|
52
47
|
});
|
|
48
|
+
return false;
|
|
53
49
|
}
|
|
54
|
-
}, text.cmd.start(
|
|
55
|
-
if (
|
|
50
|
+
}, text.cmd.start(cli_shared_1.environmentToOption(environment)), (alreadyUpdated) => {
|
|
51
|
+
if (alreadyUpdated) {
|
|
56
52
|
return cli_shared_1.Text.upgrade.alreadyUpdated.spinner;
|
|
57
53
|
}
|
|
58
|
-
else if (isInstallationResult(result)) {
|
|
59
|
-
return text.cmd.end(false);
|
|
60
|
-
}
|
|
61
54
|
else {
|
|
62
|
-
return
|
|
63
|
-
successful: false,
|
|
64
|
-
message: cli_shared_1.Text.upgrade.cmd.error
|
|
65
|
-
};
|
|
55
|
+
return text.cmd.end(false);
|
|
66
56
|
}
|
|
67
57
|
});
|
|
68
58
|
}
|
|
@@ -79,7 +69,7 @@ class InstallController {
|
|
|
79
69
|
return cli_shared_1.validateSite(trySite);
|
|
80
70
|
}
|
|
81
71
|
async promptForUpgrade(siteOption, productOption, environmentOption) {
|
|
82
|
-
const { installations } = await this.installationService.
|
|
72
|
+
const { installations } = await this.installationService.listNonTechnicalAppInstallations({
|
|
83
73
|
site: siteOption === null || siteOption === void 0 ? void 0 : siteOption.host,
|
|
84
74
|
product: productOption,
|
|
85
75
|
environment: environmentOption
|
|
@@ -105,10 +95,11 @@ class InstallController {
|
|
|
105
95
|
});
|
|
106
96
|
return products.size > 0 ? Array.from(products) : undefined;
|
|
107
97
|
}
|
|
108
|
-
async run({ environment, site, product, upgrade, confirmScopes }) {
|
|
109
|
-
|
|
98
|
+
async run({ environment, site, product, upgrade, confirmScopes, nonInteractive }) {
|
|
99
|
+
var _a;
|
|
100
|
+
const { id } = await this.appConfigProvider();
|
|
110
101
|
const text = upgrade ? cli_shared_1.Text.upgrade : cli_shared_1.Text.install;
|
|
111
|
-
if (upgrade) {
|
|
102
|
+
if (upgrade && (!site || !product)) {
|
|
112
103
|
const upgradeResult = await this.promptForUpgrade(site, product, environment);
|
|
113
104
|
environment = upgradeResult.environment;
|
|
114
105
|
site = upgradeResult.site;
|
|
@@ -120,27 +111,32 @@ class InstallController {
|
|
|
120
111
|
if (cli_shared_1.isSecureSite(site)) {
|
|
121
112
|
await this.securityPrompt(site);
|
|
122
113
|
}
|
|
123
|
-
const
|
|
124
|
-
if (!
|
|
114
|
+
const environmentPermissions = await this.installationService.getAppEnvironmentPermissions(id, environment);
|
|
115
|
+
if (!(environmentPermissions === null || environmentPermissions === void 0 ? void 0 : environmentPermissions.scopes) || environmentPermissions.scopes.length === 0) {
|
|
125
116
|
this.ui.error(new NoDeploymentError(environment), { pad: false });
|
|
126
117
|
return;
|
|
127
118
|
}
|
|
128
|
-
const {
|
|
129
|
-
const
|
|
130
|
-
|
|
119
|
+
const { scopes: environmentScopes } = environmentPermissions;
|
|
120
|
+
const [{ permissions }, manifestEgressEntries] = await Promise.all([
|
|
121
|
+
this.configFile.readConfig(),
|
|
122
|
+
this.configFile.getEgressPermissions()
|
|
123
|
+
]);
|
|
124
|
+
const manifestEgressAddresses = cli_shared_1.flatMap(manifestEgressEntries, ({ domains }) => domains !== null && domains !== void 0 ? domains : []);
|
|
125
|
+
const manifestScopes = (_a = permissions === null || permissions === void 0 ? void 0 : permissions.scopes) !== null && _a !== void 0 ? _a : [];
|
|
126
|
+
const scopesConfirmationResult = await this.installView.promptForPermissionsConfirmation(environmentPermissions, manifestScopes, manifestEgressAddresses, environment, confirmScopes, !!nonInteractive, text);
|
|
131
127
|
if (!scopesConfirmationResult)
|
|
132
128
|
return;
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
135
|
-
this.ui.info(cli_shared_1.Text.upgrade.alreadyUpdated.banner(
|
|
129
|
+
const isAlreadyUpdated = await this.installOrUpgrade(upgrade, environment, site, product, id, text);
|
|
130
|
+
if (isAlreadyUpdated) {
|
|
131
|
+
this.ui.info(cli_shared_1.Text.upgrade.alreadyUpdated.banner(environment, cli_shared_1.environmentToOption, product, site.host));
|
|
136
132
|
}
|
|
137
133
|
else {
|
|
138
134
|
this.ui.emptyLine();
|
|
139
|
-
this.ui.info(text.success.banner(
|
|
135
|
+
this.ui.info(text.success.banner(environment, cli_shared_1.environmentToOption, product, site.host));
|
|
140
136
|
const uniqueProductsFromScopes = this.getUniqueInstallationProductsFromScopes(environmentScopes);
|
|
141
137
|
if (!uniqueProductsFromScopes || uniqueProductsFromScopes.length <= 1)
|
|
142
138
|
return;
|
|
143
|
-
const { installations } = await this.installationService.
|
|
139
|
+
const { installations } = await this.installationService.listNonTechnicalAppInstallations({
|
|
144
140
|
site: site.host,
|
|
145
141
|
environment
|
|
146
142
|
});
|
|
@@ -8,7 +8,7 @@ class LintController {
|
|
|
8
8
|
}
|
|
9
9
|
async run(environment, fix) {
|
|
10
10
|
!fix && this.lintView.showBlurb();
|
|
11
|
-
const runResult = await this.lintService.run(environment, { fix });
|
|
11
|
+
const runResult = await this.lintService.run(environment, { fix }, this.lintView.getLogger());
|
|
12
12
|
if (runResult === null || runResult === void 0 ? void 0 : runResult.fixResults) {
|
|
13
13
|
this.lintView.reportFixResult(runResult.fixResults);
|
|
14
14
|
}
|
|
@@ -18,7 +18,7 @@ class PreCommandController {
|
|
|
18
18
|
this.settingsView = settingsView;
|
|
19
19
|
}
|
|
20
20
|
async runChecks(strict) {
|
|
21
|
-
const report = await this.service.run(strict);
|
|
21
|
+
const report = await this.service.run(strict, this.view.getLogger());
|
|
22
22
|
if (this.service.hasErrors(report)) {
|
|
23
23
|
this.view.reportErrors(report);
|
|
24
24
|
throw new PreCommandValidationError();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CLIDetails, FeatureFlagReader, Logger } from '@forge/cli-shared';
|
|
2
|
+
export declare class PrerequisitesController {
|
|
3
|
+
private readonly logger;
|
|
4
|
+
private readonly featureFlags;
|
|
5
|
+
private readonly cliDetails;
|
|
6
|
+
constructor(logger: Logger, featureFlags: FeatureFlagReader, cliDetails: CLIDetails | undefined);
|
|
7
|
+
check(): Promise<void>;
|
|
8
|
+
private checkNodeVersion;
|
|
9
|
+
private checkCustomWarning;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=prerequisites-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prerequisites-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/prerequisites-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAe,iBAAiB,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAI7F,qBAAa,uBAAuB;IAEhC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAFV,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,iBAAiB,EAC/B,UAAU,EAAE,UAAU,GAAG,SAAS;IAG/C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAK5B,OAAO,CAAC,gBAAgB;YAcV,kBAAkB;CAMjC"}
|