@forge/cli 5.2.1-next.0 → 6.0.0-next.3
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 +46 -0
- package/npm-shrinkwrap.json +1068 -795
- package/out/analytics-client/analytics-client.js +2 -2
- package/out/analytics-client/analytics-message-handler.d.ts.map +1 -1
- package/out/analytics-client/analytics-message-handler.js +1 -1
- package/out/autocomplete/index.js +6 -5
- package/out/autocomplete/util.js +4 -2
- package/out/bin/cli.js +1 -1
- package/out/bin/postinstall.js +3 -3
- package/out/command-line/anon-user-id.js +1 -1
- package/out/command-line/command.d.ts.map +1 -1
- package/out/command-line/command.js +19 -17
- package/out/command-line/controller/autocomplete-controller.js +2 -2
- package/out/command-line/controller/feedback-controller.js +1 -1
- package/out/command-line/controller/install-controller.js +8 -8
- package/out/command-line/controller/prerequisites-controller.js +4 -4
- package/out/command-line/controller/tunnel-controller.js +1 -1
- package/out/command-line/dependency-injection.d.ts +2 -2
- package/out/command-line/dependency-injection.js +8 -7
- package/out/command-line/environment.js +3 -2
- package/out/command-line/index.d.ts +1 -1
- package/out/command-line/index.d.ts.map +1 -1
- package/out/command-line/index.js +21 -19
- package/out/command-line/register-app-commands.js +4 -4
- package/out/command-line/register-authentication-command.js +2 -2
- package/out/command-line/register-autocomplete-commands.js +2 -1
- package/out/command-line/register-deployment-commands.js +2 -1
- package/out/command-line/register-environment-variables-commands.js +2 -1
- package/out/command-line/register-feedback-commands.js +2 -1
- package/out/command-line/register-installation-commands.js +15 -12
- package/out/command-line/register-lint-command.js +2 -1
- package/out/command-line/register-log-commands.js +9 -8
- package/out/command-line/register-providers-commands.js +2 -1
- package/out/command-line/register-settings-commands.js +2 -1
- package/out/command-line/register-tunnel-commands.js +2 -1
- package/out/command-line/register-webtrigger-commands.js +3 -2
- package/out/command-line/unique-machine-id.js +4 -3
- package/out/command-line/version-info.d.ts.map +1 -1
- package/out/command-line/version-info.js +7 -4
- package/out/command-line/view/deploy-view.js +2 -2
- package/out/command-line/view/install-view.js +7 -7
- package/out/command-line/view/lint-view.d.ts +1 -1
- package/out/command-line/view/lint-view.d.ts.map +1 -1
- package/out/command-line/view/lite-lint-view.d.ts +1 -1
- package/out/command-line/view/lite-lint-view.d.ts.map +1 -1
- package/out/command-line/view/tunnel-view.js +1 -1
- package/out/deploy/deployer/deployer.js +1 -1
- package/out/deploy/deployer/trigger-deploy-graphql-client.js +1 -1
- package/out/deploy/package-upload-deploy.js +1 -1
- package/out/deploy/packager/archiver.js +4 -4
- package/out/deploy/packager/runtime-bundler.js +1 -1
- package/out/deploy/uploader/artifact-graphql-client.js +2 -2
- package/out/environment-variables/graphql-client.d.ts +2 -2
- package/out/environment-variables/graphql-client.d.ts.map +1 -1
- package/out/environment-variables/graphql-client.js +2 -2
- package/out/installations/graphql-client.js +6 -6
- package/out/installations/shared.d.ts.map +1 -1
- package/out/installations/shared.js +2 -1
- package/out/installations/site-translation/bitbucket.js +5 -4
- package/out/providers/graphql-client.js +1 -1
- package/out/service/command-suggestion-service.js +1 -1
- package/out/service/docker-service.js +4 -4
- package/out/service/installation-service.js +6 -6
- package/out/service/lint-service.d.ts +1 -1
- package/out/service/lint-service.d.ts.map +1 -1
- package/out/service/lint-service.js +3 -3
- package/out/service/lite-lint-service.d.ts +1 -1
- package/out/service/lite-lint-service.d.ts.map +1 -1
- package/out/service/migration-keys-service.d.ts +1 -1
- package/out/service/migration-keys-service.d.ts.map +1 -1
- package/out/service/port-finding-service.js +1 -1
- package/out/service/resource-packaging-service.js +4 -4
- package/out/service/resources-uploader-service.js +1 -1
- package/out/service/tunnel-service.js +8 -8
- package/out/storage/local-file-storage.js +1 -1
- package/out/webtrigger/get-webtrigger-url.js +2 -2
- package/out/workers/forge-cli-workers.js +1 -1
- package/out/workers/tunnel-clean-up-worker.js +1 -1
- package/out/workers/version-check-worker.js +1 -1
- package/out/workers/worker-info.js +3 -2
- package/out/workers/worker.d.ts.map +1 -1
- package/out/workers/worker.js +5 -3
- package/out/workers/workers-starter.js +1 -1
- package/package.json +8 -7
|
@@ -12,7 +12,7 @@ const unique_machine_id_1 = require("../command-line/unique-machine-id");
|
|
|
12
12
|
const Identity = (value) => value;
|
|
13
13
|
function appAidOrUndefined(appAri) {
|
|
14
14
|
try {
|
|
15
|
-
return cs_ari_1.parseAppAri(cs_ari_1.parse(appAri)).appId;
|
|
15
|
+
return (0, cs_ari_1.parseAppAri)((0, cs_ari_1.parse)(appAri)).appId;
|
|
16
16
|
}
|
|
17
17
|
catch (e) {
|
|
18
18
|
return undefined;
|
|
@@ -90,7 +90,7 @@ class AnalyticsClientReporter {
|
|
|
90
90
|
return { node: process.version };
|
|
91
91
|
}
|
|
92
92
|
_machineId() {
|
|
93
|
-
return { machineId: unique_machine_id_1.getMachineId() };
|
|
93
|
+
return { machineId: (0, unique_machine_id_1.getMachineId)() };
|
|
94
94
|
}
|
|
95
95
|
_asAttribute(attrValue, name, mapper = Identity) {
|
|
96
96
|
const mappedValue = mapper(attrValue);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics-message-handler.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-message-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,EAChB,UAAU,EACV,OAAO,EACR,MAAM,4CAA4C,CAAC;AAEpD,oBAAY,SAAS;IACnB,KAAK,UAAU;IACf,WAAW,gBAAgB;IAC3B,EAAE,OAAO;CACV;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,gBAAgB,CAAC;CAChD;AAED,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,aAAa,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C;AAED,qBAAa,uBAAwB,YAAW,cAAc,CAAC,gBAAgB,CAAC;IAClE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;gBAAZ,WAAW,CAAC,oBAAQ;IAEjD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAMrB;IAOI,aAAa,YAAmB,gBAAgB,GAAG,SAAS,KAAG,
|
|
1
|
+
{"version":3,"file":"analytics-message-handler.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-message-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,EAChB,UAAU,EACV,OAAO,EACR,MAAM,4CAA4C,CAAC;AAEpD,oBAAY,SAAS;IACnB,KAAK,UAAU;IACf,WAAW,gBAAgB;IAC3B,EAAE,OAAO;CACV;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,gBAAgB,CAAC;CAChD;AAED,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,aAAa,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C;AAED,qBAAa,uBAAwB,YAAW,cAAc,CAAC,gBAAgB,CAAC;IAClE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;gBAAZ,WAAW,CAAC,oBAAQ;IAEjD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAMrB;IAOI,aAAa,YAAmB,gBAAgB,GAAG,SAAS,KAAG,QAAQ,IAAI,CAAC,CAmBjF;CACH"}
|
|
@@ -11,7 +11,7 @@ var EventType;
|
|
|
11
11
|
class AnalyticsMessageHandler {
|
|
12
12
|
constructor(environment) {
|
|
13
13
|
this.environment = environment;
|
|
14
|
-
this.aClient = analytics_node_client_1.analyticsClient({
|
|
14
|
+
this.aClient = (0, analytics_node_client_1.analyticsClient)({
|
|
15
15
|
env: this.environment || 'prod',
|
|
16
16
|
product: 'forge',
|
|
17
17
|
subproduct: 'cli',
|
|
@@ -6,7 +6,7 @@ const omelette_1 = tslib_1.__importDefault(require("omelette"));
|
|
|
6
6
|
const autocomplete_config_json_1 = tslib_1.__importDefault(require("./autocomplete-config.json"));
|
|
7
7
|
const util_1 = require("./util");
|
|
8
8
|
const autocompleteConfig = autocomplete_config_json_1.default;
|
|
9
|
-
|
|
9
|
+
const processAutocompleteFactory = (autocompleteConfig) => {
|
|
10
10
|
const processAutocomplete = (_, { line, reply }) => {
|
|
11
11
|
var _a;
|
|
12
12
|
const splitLine = line.split(' ');
|
|
@@ -28,13 +28,14 @@ exports.processAutocompleteFactory = (autocompleteConfig) => {
|
|
|
28
28
|
if ((_a = commandOptions[lastArg]) === null || _a === void 0 ? void 0 : _a.requireUserArg) {
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
const userOptionsSelected = util_1.getUserOptionsSelectedFromSplitLine(splitLine);
|
|
32
|
-
const remainingOptions = util_1.getRemainingOptions(commandOptions, userOptionsSelected);
|
|
31
|
+
const userOptionsSelected = (0, util_1.getUserOptionsSelectedFromSplitLine)(splitLine);
|
|
32
|
+
const remainingOptions = (0, util_1.getRemainingOptions)(commandOptions, userOptionsSelected);
|
|
33
33
|
reply(Object.keys(remainingOptions));
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
return processAutocomplete;
|
|
37
37
|
};
|
|
38
|
-
exports.
|
|
39
|
-
exports.autocomplete
|
|
38
|
+
exports.processAutocompleteFactory = processAutocompleteFactory;
|
|
39
|
+
exports.autocomplete = (0, omelette_1.default)(process.env.AUTOCOMPLETE_ALIAS || 'forge');
|
|
40
|
+
exports.autocomplete.on('complete', (0, exports.processAutocompleteFactory)(autocompleteConfig));
|
|
40
41
|
exports.autocomplete.init();
|
package/out/autocomplete/util.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRemainingOptions = exports.getUserOptionsSelectedFromSplitLine = void 0;
|
|
4
|
-
|
|
4
|
+
const getUserOptionsSelectedFromSplitLine = (splitLine) => {
|
|
5
5
|
return splitLine.slice(2).filter((o) => o.startsWith('--'));
|
|
6
6
|
};
|
|
7
|
-
exports.
|
|
7
|
+
exports.getUserOptionsSelectedFromSplitLine = getUserOptionsSelectedFromSplitLine;
|
|
8
|
+
const getRemainingOptions = (commandOptions, userSelectedOptions) => {
|
|
8
9
|
const commandOptionsClone = Object.assign({}, commandOptions);
|
|
9
10
|
for (const option of userSelectedOptions) {
|
|
10
11
|
delete commandOptionsClone[option];
|
|
11
12
|
}
|
|
12
13
|
return commandOptionsClone;
|
|
13
14
|
};
|
|
15
|
+
exports.getRemainingOptions = getRemainingOptions;
|
package/out/bin/cli.js
CHANGED
package/out/bin/postinstall.js
CHANGED
|
@@ -13,11 +13,11 @@ const ui = new cli_shared_1.CommandLineUI(() => true);
|
|
|
13
13
|
const cachedConf = cli_shared_1.CachedConf.getCache(unique_machine_id_1.FORGE_CLI_PACKAGE);
|
|
14
14
|
const configService = new cached_config_service_1.CachedConfigService(cachedConf);
|
|
15
15
|
const analyticsClientReporter = new analytics_client_1.AnalyticsClientReporter(new local_file_storage_1.LocalFileStorage(), ui, configService);
|
|
16
|
-
const cliDetails = version_info_1.getCLIDetails();
|
|
16
|
+
const cliDetails = (0, version_info_1.getCLIDetails)();
|
|
17
17
|
const attributes = { version: cliDetails === null || cliDetails === void 0 ? void 0 : cliDetails.version };
|
|
18
|
-
const anonId = anon_user_id_1.getAnonId(true);
|
|
18
|
+
const anonId = (0, anon_user_id_1.getAnonId)(true);
|
|
19
19
|
analyticsClientReporter.reportSuccess('postinstall', anonId, attributes);
|
|
20
|
-
if (isSupportedShell_1.isSupportedShell()) {
|
|
20
|
+
if ((0, isSupportedShell_1.isSupportedShell)()) {
|
|
21
21
|
ui.info(cli_shared_1.Text.autocomplete.postinstall);
|
|
22
22
|
}
|
|
23
23
|
new workers_starter_1.WorkersStarter(undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.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mB;IASjC,OAAO,CAAC,YAAY;YAgBN,eAAe;IAoB7B,OAAO,CAAC,oBAAoB;IAyB5B,OAAO,CAAC,kBAAkB,CAExB;IAEF,OAAO,CAAC,cAAc;IAqCtB,OAAO,CAAC,eAAe;CAyBxB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.Command = exports.WrapperError = void 0;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
@@ -43,12 +44,12 @@ class Command {
|
|
|
43
44
|
return this;
|
|
44
45
|
};
|
|
45
46
|
this.actionProcessor = async (cb, ...args) => {
|
|
46
|
-
var
|
|
47
|
+
var _b, _c, _d;
|
|
47
48
|
if (this.newCommand) {
|
|
48
49
|
this.ui.error(new Error(cli_shared_3.Text.deprecate(this.newCommand)));
|
|
49
50
|
}
|
|
50
51
|
const cmdName = this.cmd.name();
|
|
51
|
-
let cred = anon_user_id_1.getAnonId(true);
|
|
52
|
+
let cred = (0, anon_user_id_1.getAnonId)(true);
|
|
52
53
|
let attributes = {};
|
|
53
54
|
try {
|
|
54
55
|
if (!this.expectsArguments && args.length > 2) {
|
|
@@ -61,7 +62,7 @@ class Command {
|
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
if (this.requiresAnalyticsConsent) {
|
|
64
|
-
await this.preCommandController.verifyAnalyticsPreferences((
|
|
65
|
+
await this.preCommandController.verifyAnalyticsPreferences((_b = options === null || options === void 0 ? void 0 : options.nonInteractive) !== null && _b !== void 0 ? _b : false)();
|
|
65
66
|
}
|
|
66
67
|
if (!(options === null || options === void 0 ? void 0 : options.json)) {
|
|
67
68
|
this.checkVersion();
|
|
@@ -82,19 +83,19 @@ class Command {
|
|
|
82
83
|
cred = result.creds;
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
|
-
this.analyticsClient.reportSuccess((
|
|
86
|
+
this.analyticsClient.reportSuccess((_c = this.analyticsName) !== null && _c !== void 0 ? _c : cmdName, cred, attributes);
|
|
86
87
|
}
|
|
87
88
|
catch (e) {
|
|
88
89
|
if (isErrorWithAnalytics(e)) {
|
|
89
90
|
attributes = Object.assign(Object.assign({}, e.getAttributes()), attributes);
|
|
90
91
|
}
|
|
91
92
|
if (e instanceof errors_1.DeferredErrors) {
|
|
92
|
-
e.getErrors().forEach((error) => { var
|
|
93
|
+
e.getErrors().forEach((error) => { var _b; return this.analyticsClient.reportFailure((_b = this.analyticsName) !== null && _b !== void 0 ? _b : cmdName, cred, attributes, error); });
|
|
93
94
|
process.exit(1);
|
|
94
95
|
}
|
|
95
96
|
else {
|
|
96
|
-
this.analyticsClient.reportFailure((
|
|
97
|
-
cli_shared_4.exitOnError(this.ui, e);
|
|
97
|
+
this.analyticsClient.reportFailure((_d = this.analyticsName) !== null && _d !== void 0 ? _d : cmdName, cred, attributes, e);
|
|
98
|
+
(0, cli_shared_4.exitOnError)(this.ui, e);
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
};
|
|
@@ -196,7 +197,7 @@ class Command {
|
|
|
196
197
|
if (Command.isUnknownCommand(err) || Command.isExcessCommands(err)) {
|
|
197
198
|
return this.unknownCommand(argv);
|
|
198
199
|
}
|
|
199
|
-
return cli_shared_4.exitOnError(this.ui, err);
|
|
200
|
+
return (0, cli_shared_4.exitOnError)(this.ui, err);
|
|
200
201
|
}
|
|
201
202
|
}
|
|
202
203
|
getDefinedCommands() {
|
|
@@ -214,7 +215,7 @@ class Command {
|
|
|
214
215
|
environmentOption() {
|
|
215
216
|
this.option('-e, --environment [environment]', cli_shared_3.Text.env.option(cli_shared_2.DEFAULT_ENVIRONMENT_OPTION, cli_shared_2.VALID_ENVIRONMENT_OPTIONS));
|
|
216
217
|
this.precondition(() => {
|
|
217
|
-
this.cmd.opts().environment = environment_1.checkEnvironmentOption(this.cmd.opts().environment || cli_shared_2.DEFAULT_ENVIRONMENT_OPTION);
|
|
218
|
+
this.cmd.opts().environment = (0, environment_1.checkEnvironmentOption)(this.cmd.opts().environment || cli_shared_2.DEFAULT_ENVIRONMENT_OPTION);
|
|
218
219
|
return { appEnv: this.cmd.opts().environment };
|
|
219
220
|
});
|
|
220
221
|
return this;
|
|
@@ -258,7 +259,7 @@ class Command {
|
|
|
258
259
|
}
|
|
259
260
|
async checkAuthentication() {
|
|
260
261
|
if (this.requiresAuthentication) {
|
|
261
|
-
const credentialsGetter = cli_shared_1.getCredentialStore(this.ui);
|
|
262
|
+
const credentialsGetter = (0, cli_shared_1.getCredentialStore)(this.ui);
|
|
262
263
|
return credentialsGetter.getCredentials();
|
|
263
264
|
}
|
|
264
265
|
return undefined;
|
|
@@ -274,14 +275,14 @@ class Command {
|
|
|
274
275
|
this.ui.warn(cli_shared_3.Text.error.outdatedCLIVersion(this.cliDetails.version, this.cliDetails.latest));
|
|
275
276
|
}
|
|
276
277
|
else if (semver_1.default.gt(this.cliDetails.version, this.cliDetails.latest)) {
|
|
277
|
-
version_info_1.clearVersionCache(this.cliDetails.name);
|
|
278
|
+
(0, version_info_1.clearVersionCache)(this.cliDetails.name);
|
|
278
279
|
}
|
|
279
280
|
}
|
|
280
281
|
async validateContext() {
|
|
281
282
|
let capitalizedProduct;
|
|
282
283
|
if (this.cmd.opts().product) {
|
|
283
|
-
const capitalizedProduct = cli_shared_2.capitalizeProduct(this.cmd.opts().product);
|
|
284
|
-
if (!cli_shared_2.isSupportedProduct(capitalizedProduct)) {
|
|
284
|
+
const capitalizedProduct = (0, cli_shared_2.capitalizeProduct)(this.cmd.opts().product);
|
|
285
|
+
if (!(0, cli_shared_2.isSupportedProduct)(capitalizedProduct)) {
|
|
285
286
|
throw new cli_shared_3.ValidationError(cli_shared_3.Text.error.invalidProduct);
|
|
286
287
|
}
|
|
287
288
|
this.cmd.opts().product = capitalizedProduct;
|
|
@@ -290,7 +291,7 @@ class Command {
|
|
|
290
291
|
if (this.cmd.opts().site) {
|
|
291
292
|
trySite = this.cmd.opts().site;
|
|
292
293
|
}
|
|
293
|
-
this.cmd.opts().site = trySite ? cli_shared_2.validateSite(trySite, capitalizedProduct) : undefined;
|
|
294
|
+
this.cmd.opts().site = trySite ? (0, cli_shared_2.validateSite)(trySite, capitalizedProduct) : undefined;
|
|
294
295
|
return { product: this.cmd.opts().product };
|
|
295
296
|
}
|
|
296
297
|
findLastValidCommand(argv) {
|
|
@@ -327,7 +328,7 @@ class Command {
|
|
|
327
328
|
errorMessage.push(suggestionsPrefixed.join('\n'));
|
|
328
329
|
}
|
|
329
330
|
errorMessage.push(cli_shared_3.Text.invalidCmdHelp);
|
|
330
|
-
return cli_shared_4.exitOnError(this.ui, new Error(errorText), errorMessage.join('\n\n'));
|
|
331
|
+
return (0, cli_shared_4.exitOnError)(this.ui, new Error(errorText), errorMessage.join('\n\n'));
|
|
331
332
|
}
|
|
332
333
|
assertValidArgs(argv) {
|
|
333
334
|
const args = argv.slice(2);
|
|
@@ -349,11 +350,12 @@ class Command {
|
|
|
349
350
|
}
|
|
350
351
|
}
|
|
351
352
|
exports.Command = Command;
|
|
353
|
+
_a = Command;
|
|
352
354
|
Command.reportHelp = async (cmd, cmdError) => {
|
|
353
355
|
try {
|
|
354
|
-
let cred = anon_user_id_1.getAnonId(true);
|
|
356
|
+
let cred = (0, anon_user_id_1.getAnonId)(true);
|
|
355
357
|
try {
|
|
356
|
-
const credentialsGetter = cli_shared_1.getCredentialStore(cmd.ui);
|
|
358
|
+
const credentialsGetter = (0, cli_shared_1.getCredentialStore)(cmd.ui);
|
|
357
359
|
cred = await credentialsGetter.getCredentials();
|
|
358
360
|
}
|
|
359
361
|
catch (noTokenError) {
|
|
@@ -17,7 +17,7 @@ function assertIsValidArgument(arg) {
|
|
|
17
17
|
throw new cli_shared_1.ValidationError(cli_shared_1.Text.autocomplete.error.badArg(arg));
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
function assertNodeVersionSupported(version = getNodeVersion_1.getNodeVersion()) {
|
|
20
|
+
function assertNodeVersionSupported(version = (0, getNodeVersion_1.getNodeVersion)()) {
|
|
21
21
|
if (semver_1.default.eq(version, '12.5.0') || semver_1.default.eq(version, '12.6.0')) {
|
|
22
22
|
throw new Error(cli_shared_1.Text.autocomplete.error.unsupportedNodeVersion);
|
|
23
23
|
}
|
|
@@ -47,7 +47,7 @@ class AutocompleteController {
|
|
|
47
47
|
autocomplete_1.autocomplete.cleanupShellInitFile();
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
|
-
assertUnreachable_1.assertUnreachable(arg);
|
|
50
|
+
(0, assertUnreachable_1.assertUnreachable)(arg);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -8,7 +8,7 @@ class FeedbackController {
|
|
|
8
8
|
this.feedbackPostClient = feedbackPostClient;
|
|
9
9
|
}
|
|
10
10
|
async sendFeedback(feedback) {
|
|
11
|
-
const { email } = await cli_shared_1.getCredentialStore(this.ui).getCredentials();
|
|
11
|
+
const { email } = await (0, cli_shared_1.getCredentialStore)(this.ui).getCredentials();
|
|
12
12
|
return this.feedbackPostClient.sendFeedback({
|
|
13
13
|
summary: feedback.length <= 50 ? feedback : feedback.slice(0, 50) + '...',
|
|
14
14
|
description: feedback,
|
|
@@ -4,7 +4,7 @@ exports.InstallController = exports.NoDeploymentError = void 0;
|
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
5
|
class NoDeploymentError extends Error {
|
|
6
6
|
constructor(environment) {
|
|
7
|
-
super(cli_shared_1.Text.install.error.noDeploymentFound(cli_shared_1.environmentToOption(environment)));
|
|
7
|
+
super(cli_shared_1.Text.install.error.noDeploymentFound((0, cli_shared_1.environmentToOption)(environment)));
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.NoDeploymentError = NoDeploymentError;
|
|
@@ -47,7 +47,7 @@ class InstallController {
|
|
|
47
47
|
});
|
|
48
48
|
return false;
|
|
49
49
|
}
|
|
50
|
-
}, text.cmd.start(cli_shared_1.environmentToOption(environment)), (alreadyUpdated) => {
|
|
50
|
+
}, text.cmd.start((0, cli_shared_1.environmentToOption)(environment)), (alreadyUpdated) => {
|
|
51
51
|
if (alreadyUpdated) {
|
|
52
52
|
return cli_shared_1.Text.upgrade.alreadyUpdated.spinner;
|
|
53
53
|
}
|
|
@@ -62,14 +62,14 @@ class InstallController {
|
|
|
62
62
|
}
|
|
63
63
|
async promptForSite(product) {
|
|
64
64
|
this.ui.info(cli_shared_1.Text.installationContext.overviewSite);
|
|
65
|
-
const promptText = product && cli_shared_1.isWorkspaceProduct(product)
|
|
65
|
+
const promptText = product && (0, cli_shared_1.isWorkspaceProduct)(product)
|
|
66
66
|
? cli_shared_1.Text.installationContext.promptWorkspace
|
|
67
67
|
: cli_shared_1.Text.installationContext.promptSite;
|
|
68
68
|
const trySite = await this.ui.promptForText(promptText);
|
|
69
69
|
if (!trySite) {
|
|
70
70
|
throw new cli_shared_1.ValidationError(cli_shared_1.Text.error.invalidSite);
|
|
71
71
|
}
|
|
72
|
-
return cli_shared_1.validateSite(trySite, product);
|
|
72
|
+
return (0, cli_shared_1.validateSite)(trySite, product);
|
|
73
73
|
}
|
|
74
74
|
async promptForUpgrade(siteOption, productOption, environmentOption) {
|
|
75
75
|
const { installations } = await this.installationService.listNonTechnicalAppInstallations({
|
|
@@ -79,8 +79,8 @@ class InstallController {
|
|
|
79
79
|
});
|
|
80
80
|
const { site, product, environmentKey } = await this.installView.promptForUpgrade(installations);
|
|
81
81
|
return {
|
|
82
|
-
site: cli_shared_1.validateSite(site, product),
|
|
83
|
-
product: cli_shared_1.capitalizeProduct(product),
|
|
82
|
+
site: (0, cli_shared_1.validateSite)(site, product),
|
|
83
|
+
product: (0, cli_shared_1.capitalizeProduct)(product),
|
|
84
84
|
environment: environmentKey
|
|
85
85
|
};
|
|
86
86
|
}
|
|
@@ -111,7 +111,7 @@ class InstallController {
|
|
|
111
111
|
product = product ? product : await this.promptForProduct();
|
|
112
112
|
site = site ? site : await this.promptForSite(product);
|
|
113
113
|
this.ui.info(text.banner);
|
|
114
|
-
if (cli_shared_1.isSecureSite(site)) {
|
|
114
|
+
if ((0, cli_shared_1.isSecureSite)(site)) {
|
|
115
115
|
await this.securityPrompt(site);
|
|
116
116
|
}
|
|
117
117
|
const environmentPermissions = await this.installationService.getAppEnvironmentPermissions(id, environment);
|
|
@@ -124,7 +124,7 @@ class InstallController {
|
|
|
124
124
|
this.configFile.readConfig(),
|
|
125
125
|
this.configFile.getEgressPermissions()
|
|
126
126
|
]);
|
|
127
|
-
const manifestEgressAddresses = cli_shared_1.flatMap(manifestEgressEntries, ({ domains }) => domains !== null && domains !== void 0 ? domains : []);
|
|
127
|
+
const manifestEgressAddresses = (0, cli_shared_1.flatMap)(manifestEgressEntries, ({ domains }) => domains !== null && domains !== void 0 ? domains : []);
|
|
128
128
|
const manifestScopes = (_a = permissions === null || permissions === void 0 ? void 0 : permissions.scopes) !== null && _a !== void 0 ? _a : [];
|
|
129
129
|
const scopesConfirmationResult = await this.installView.promptForPermissionsConfirmation(environmentPermissions, manifestScopes, manifestEgressAddresses, environment, confirmScopes, !!nonInteractive, text);
|
|
130
130
|
if (!scopesConfirmationResult)
|
|
@@ -16,11 +16,11 @@ class PrerequisitesController {
|
|
|
16
16
|
await this.checkCustomWarning();
|
|
17
17
|
}
|
|
18
18
|
checkNodeVersion() {
|
|
19
|
-
const userNodeVersion = getNodeVersion_1.getNodeVersion();
|
|
20
|
-
if (this.cliDetails && !semver_1.satisfies(userNodeVersion, this.cliDetails.compatibleNodeVersion)) {
|
|
21
|
-
cli_shared_1.exitOnError(this.logger, new Error(cli_shared_1.Text.error.outdatedNodeVersion(this.cliDetails.compatibleNodeVersion, userNodeVersion)), null);
|
|
19
|
+
const userNodeVersion = (0, getNodeVersion_1.getNodeVersion)();
|
|
20
|
+
if (this.cliDetails && !(0, semver_1.satisfies)(userNodeVersion, this.cliDetails.compatibleNodeVersion)) {
|
|
21
|
+
(0, cli_shared_1.exitOnError)(this.logger, new Error(cli_shared_1.Text.error.outdatedNodeVersion(this.cliDetails.compatibleNodeVersion, userNodeVersion)), null);
|
|
22
22
|
}
|
|
23
|
-
if (!semver_1.satisfies(userNodeVersion, version_info_1.supportedNodeVersion)) {
|
|
23
|
+
if (!(0, semver_1.satisfies)(userNodeVersion, version_info_1.supportedNodeVersion)) {
|
|
24
24
|
this.logger.warn(cli_shared_1.Text.warning.unsupportedNodeVersion(userNodeVersion));
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -11,7 +11,7 @@ class TunnelController {
|
|
|
11
11
|
this.tunnelView = tunnelView;
|
|
12
12
|
}
|
|
13
13
|
async run(tunnelOptions, ui) {
|
|
14
|
-
const creds = await cli_shared_1.getCredentialStore(ui).getCredentials();
|
|
14
|
+
const creds = await (0, cli_shared_1.getCredentialStore)(ui).getCredentials();
|
|
15
15
|
const errorCallback = this.tunnelView.getTunnelErrorHandler(cli_shared_1.exitOnError);
|
|
16
16
|
if (process.env.FORGE_DEV_TUNNEL) {
|
|
17
17
|
return await this.localTunnelService.run(tunnelOptions, creds, ui.debugEnabled, errorCallback);
|
|
@@ -26,7 +26,7 @@ export declare const getDependencies: (cliDetails: CLIDetails | undefined) => Pr
|
|
|
26
26
|
ui: CommandLineUI;
|
|
27
27
|
cmd: Command;
|
|
28
28
|
configFile: ConfigFile;
|
|
29
|
-
appConfigProvider: import("@forge/cli-shared
|
|
29
|
+
appConfigProvider: import("@forge/cli-shared").AppConfigProvider;
|
|
30
30
|
graphqlGateway: string;
|
|
31
31
|
analyticsClientReporter: AnalyticsClientReporter;
|
|
32
32
|
workersStarter: WorkersStarter;
|
|
@@ -49,7 +49,7 @@ export declare const getDependencies: (cliDetails: CLIDetails | undefined) => Pr
|
|
|
49
49
|
featureFlagService: FeatureFlagService;
|
|
50
50
|
installationsService: InstallationService;
|
|
51
51
|
migrationKeysService: MigrationKeysService;
|
|
52
|
-
credentialStore: import("@forge/cli-shared
|
|
52
|
+
credentialStore: import("@forge/cli-shared").CredentialStore;
|
|
53
53
|
};
|
|
54
54
|
controllers: {
|
|
55
55
|
autocompleteController: AutocompleteController;
|
|
@@ -55,20 +55,20 @@ const stubController_1 = require("./controller/stubController");
|
|
|
55
55
|
const prerequisites_controller_1 = require("./controller/prerequisites-controller");
|
|
56
56
|
const runtime_bundler_1 = require("../deploy/packager/runtime-bundler");
|
|
57
57
|
const nativeui_bundler_1 = require("../deploy/packager/nativeui-bundler");
|
|
58
|
-
|
|
58
|
+
const getDependencies = async (cliDetails) => {
|
|
59
59
|
let cmd;
|
|
60
60
|
const ui = new cli_shared_1.CommandLineUI(() => cmd.verbose);
|
|
61
61
|
const cachedConf = cli_shared_1.CachedConf.getCache(unique_machine_id_1.FORGE_CLI_PACKAGE);
|
|
62
62
|
const cachedConfigService = new cached_config_service_1.CachedConfigService(cachedConf);
|
|
63
63
|
const analyticsClientReporter = new analytics_client_1.AnalyticsClientReporter(new local_file_storage_1.LocalFileStorage(), ui, cachedConfigService);
|
|
64
|
-
const workerInfo = worker_info_1.getWorkerInfo(cliDetails);
|
|
64
|
+
const workerInfo = (0, worker_info_1.getWorkerInfo)(cliDetails);
|
|
65
65
|
const workersStarter = new workers_starter_1.WorkersStarter(workerInfo);
|
|
66
66
|
const fileReader = new cli_shared_1.FileSystemReader();
|
|
67
67
|
const fileWriter = new cli_shared_1.FileSystemWriter();
|
|
68
68
|
const configFile = new cli_shared_1.ConfigFile(fileReader, fileWriter);
|
|
69
|
-
const appConfigReader = cli_shared_1.configFileReaderForSection(cli_shared_1.appConfigKey, cli_shared_1.appConfigShape, configFile);
|
|
70
|
-
const assertiveAppConfigReader = cli_shared_1.assertiveAppConfigProvider(appConfigReader);
|
|
71
|
-
const appConfigWriter = cli_shared_1.configFileWriterForSection(cli_shared_1.appConfigKey, cli_shared_1.appConfigShape, configFile);
|
|
69
|
+
const appConfigReader = (0, cli_shared_1.configFileReaderForSection)(cli_shared_1.appConfigKey, cli_shared_1.appConfigShape, configFile);
|
|
70
|
+
const assertiveAppConfigReader = (0, cli_shared_1.assertiveAppConfigProvider)(appConfigReader);
|
|
71
|
+
const appConfigWriter = (0, cli_shared_1.configFileWriterForSection)(cli_shared_1.appConfigKey, cli_shared_1.appConfigShape, configFile);
|
|
72
72
|
const settingsView = new settings_view_1.SettingsView(ui);
|
|
73
73
|
const settingsController = new settings_controller_1.SettingsController(settingsView, cachedConfigService);
|
|
74
74
|
const liteLintView = new lite_lint_view_1.LiteLintView(ui);
|
|
@@ -76,8 +76,8 @@ exports.getDependencies = async (cliDetails) => {
|
|
|
76
76
|
const analyticsSettingsView = new analytics_settings_view_1.AnalyticsSettingsView(ui);
|
|
77
77
|
const preCommandController = new pre_command_controller_1.PreCommandController(liteLintService, liteLintView, configFile, cachedConfigService, analyticsSettingsView, settingsView);
|
|
78
78
|
cmd = new command_1.Command(ui, analyticsClientReporter, preCommandController, cliDetails);
|
|
79
|
-
const graphqlGateway = cli_shared_1.getGraphqlGateway();
|
|
80
|
-
const credentialStore = cli_shared_1.getCredentialStore(ui);
|
|
79
|
+
const graphqlGateway = (0, cli_shared_1.getGraphqlGateway)();
|
|
80
|
+
const credentialStore = (0, cli_shared_1.getCredentialStore)(ui);
|
|
81
81
|
const authenticator = new cli_shared_1.PersonalTokenAuthenticator(credentialStore);
|
|
82
82
|
const featureFlagService = new cli_shared_1.FeatureFlagService(ui, cliDetails, credentialStore, appConfigReader);
|
|
83
83
|
const createGraphQLClient = (auth) => {
|
|
@@ -195,3 +195,4 @@ exports.getDependencies = async (cliDetails) => {
|
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
197
|
};
|
|
198
|
+
exports.getDependencies = getDependencies;
|
|
@@ -10,6 +10,7 @@ function validateEnvironmentOption(userValue) {
|
|
|
10
10
|
}
|
|
11
11
|
return userValue;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
return cli_shared_1.optionToEnvironment(validateEnvironmentOption(userValue));
|
|
13
|
+
const checkEnvironmentOption = (userValue) => {
|
|
14
|
+
return (0, cli_shared_1.optionToEnvironment)(validateEnvironmentOption(userValue));
|
|
15
15
|
};
|
|
16
|
+
exports.checkEnvironmentOption = checkEnvironmentOption;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CLIDetails } from '@forge/cli-shared';
|
|
2
2
|
import { Dependencies } from './dependency-injection';
|
|
3
|
-
export declare const registerCommands: (deps: Dependencies, cliDetails?: CLIDetails
|
|
3
|
+
export declare const registerCommands: (deps: Dependencies, cliDetails?: CLIDetails) => void;
|
|
4
4
|
export declare const main: () => Promise<void>;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command-line/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAmB,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAuBvE,eAAO,MAAM,gBAAgB,SAAU,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command-line/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAmB,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAuBvE,eAAO,MAAM,gBAAgB,SAAU,YAAY,eAAe,UAAU,KAAG,IAyB9E,CAAC;AAiBF,eAAO,MAAM,IAAI,QAAa,QAAQ,IAAI,CAUzC,CAAC"}
|
|
@@ -22,7 +22,7 @@ const sortCommands = (cmd) => {
|
|
|
22
22
|
cmd.getDefinedCommands().sort((a, b) => a.name().localeCompare(b.name()));
|
|
23
23
|
cmd.getCommands().sort((a, b) => a.getCmdName().localeCompare(b.getCmdName()));
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
const registerCommands = (deps, cliDetails) => {
|
|
26
26
|
if (cliDetails) {
|
|
27
27
|
deps.cmd.version(cliDetails.version, '--version');
|
|
28
28
|
}
|
|
@@ -30,21 +30,22 @@ exports.registerCommands = (deps, cliDetails) => {
|
|
|
30
30
|
deps.cmd.version('unknown');
|
|
31
31
|
}
|
|
32
32
|
deps.cmd.option('--verbose', cli_shared_1.Text.optionVerbose);
|
|
33
|
-
register_autocomplete_commands_1.registerCommands(deps);
|
|
34
|
-
register_authentication_command_1.registerCommands(deps);
|
|
35
|
-
register_app_commands_1.registerCommands(deps);
|
|
36
|
-
register_deployment_commands_1.registerCommands(deps);
|
|
37
|
-
register_installation_commands_1.registerCommands(deps);
|
|
38
|
-
register_environment_variables_commands_1.registerCommands(deps);
|
|
39
|
-
register_lint_command_1.registerCommands(deps);
|
|
40
|
-
register_log_commands_1.registerCommands(deps);
|
|
41
|
-
register_tunnel_commands_1.registerCommands(deps);
|
|
42
|
-
register_webtrigger_commands_1.registerCommands(deps);
|
|
43
|
-
register_feedback_commands_1.registerCommands(deps);
|
|
44
|
-
register_settings_commands_1.registerCommands(deps);
|
|
45
|
-
register_providers_commands_1.registerCommands(deps);
|
|
33
|
+
(0, register_autocomplete_commands_1.registerCommands)(deps);
|
|
34
|
+
(0, register_authentication_command_1.registerCommands)(deps);
|
|
35
|
+
(0, register_app_commands_1.registerCommands)(deps);
|
|
36
|
+
(0, register_deployment_commands_1.registerCommands)(deps);
|
|
37
|
+
(0, register_installation_commands_1.registerCommands)(deps);
|
|
38
|
+
(0, register_environment_variables_commands_1.registerCommands)(deps);
|
|
39
|
+
(0, register_lint_command_1.registerCommands)(deps);
|
|
40
|
+
(0, register_log_commands_1.registerCommands)(deps);
|
|
41
|
+
(0, register_tunnel_commands_1.registerCommands)(deps);
|
|
42
|
+
(0, register_webtrigger_commands_1.registerCommands)(deps);
|
|
43
|
+
(0, register_feedback_commands_1.registerCommands)(deps);
|
|
44
|
+
(0, register_settings_commands_1.registerCommands)(deps);
|
|
45
|
+
(0, register_providers_commands_1.registerCommands)(deps);
|
|
46
46
|
sortCommands(deps.cmd);
|
|
47
47
|
};
|
|
48
|
+
exports.registerCommands = registerCommands;
|
|
48
49
|
const registerEvents = ({ cmd, ui }) => {
|
|
49
50
|
cmd.configureOutput({
|
|
50
51
|
writeErr: () => { }
|
|
@@ -53,14 +54,15 @@ const registerEvents = ({ cmd, ui }) => {
|
|
|
53
54
|
throw new command_1.WrapperError(err, 'cli');
|
|
54
55
|
});
|
|
55
56
|
process.on('unhandledRejection', (reason, promise) => {
|
|
56
|
-
cli_shared_1.exitOnError(ui, new Error(cli_shared_1.Text.error.unhandledRejection(reason, promise)));
|
|
57
|
+
(0, cli_shared_1.exitOnError)(ui, new Error(cli_shared_1.Text.error.unhandledRejection(reason, promise)));
|
|
57
58
|
});
|
|
58
59
|
};
|
|
59
|
-
|
|
60
|
-
const cliDetails = version_info_1.getCLIDetails();
|
|
61
|
-
const deps = await dependency_injection_1.getDependencies(cliDetails);
|
|
62
|
-
exports.registerCommands(deps, cliDetails);
|
|
60
|
+
const main = async () => {
|
|
61
|
+
const cliDetails = (0, version_info_1.getCLIDetails)();
|
|
62
|
+
const deps = await (0, dependency_injection_1.getDependencies)(cliDetails);
|
|
63
|
+
(0, exports.registerCommands)(deps, cliDetails);
|
|
63
64
|
registerEvents(deps);
|
|
64
65
|
await deps.controllers.prerequisitesController.check();
|
|
65
66
|
await deps.cmd.parse(process.argv);
|
|
66
67
|
};
|
|
68
|
+
exports.main = main;
|
|
@@ -27,7 +27,7 @@ function directoryNameFromAppName(appName) {
|
|
|
27
27
|
if (appName === undefined) {
|
|
28
28
|
return undefined;
|
|
29
29
|
}
|
|
30
|
-
const normalized = sanitize_filename_1.default(appName.trim()).trim().replace(/ /g, '-');
|
|
30
|
+
const normalized = (0, sanitize_filename_1.default)(appName.trim()).trim().replace(/ /g, '-');
|
|
31
31
|
const chars = Array.from(normalized);
|
|
32
32
|
const allDashes = chars.every((char) => char === '-');
|
|
33
33
|
return allDashes ? undefined : normalized;
|
|
@@ -113,10 +113,10 @@ function registerRegisterCommand({ cmd, ui, commands: { registerAppCommand } })
|
|
|
113
113
|
ui.emptyLine();
|
|
114
114
|
if (!name) {
|
|
115
115
|
ui.info(cli_shared_1.Text.create.overviewAppName);
|
|
116
|
+
name = await ui.promptForText(cli_shared_1.Text.create.promptName);
|
|
117
|
+
ui.emptyLine();
|
|
116
118
|
}
|
|
117
|
-
const
|
|
118
|
-
ui.emptyLine();
|
|
119
|
-
const result = await ui.displayProgress(() => registerAppCommand.execute({ name: appName }), cli_shared_1.Text.register.cmd.start, cli_shared_1.Text.register.cmd.success(appName));
|
|
119
|
+
const result = await ui.displayProgress(() => registerAppCommand.execute({ name }), cli_shared_1.Text.register.cmd.start, cli_shared_1.Text.register.cmd.success(name));
|
|
120
120
|
ui.info(cli_shared_1.Text.register.cmd.successDetails(cli_shared_2.VALID_ENVIRONMENT_OPTIONS));
|
|
121
121
|
return result;
|
|
122
122
|
});
|
|
@@ -34,7 +34,7 @@ async function loginCommandHandler(ui, instructionsUrl, loginCommand, { email, t
|
|
|
34
34
|
ui.info(cli_shared_2.Text.login.nextStep);
|
|
35
35
|
return {
|
|
36
36
|
creds,
|
|
37
|
-
analytics: Object.assign(Object.assign({}, analytics), { anonymousId: anon_user_id_1.getAnonId(true) })
|
|
37
|
+
analytics: Object.assign(Object.assign({}, analytics), { anonymousId: (0, anon_user_id_1.getAnonId)(true) })
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
catch (error) {
|
|
@@ -43,7 +43,7 @@ async function loginCommandHandler(ui, instructionsUrl, loginCommand, { email, t
|
|
|
43
43
|
}
|
|
44
44
|
exports.loginCommandHandler = loginCommandHandler;
|
|
45
45
|
function registerLoginCommand({ cmd, ui, graphqlGateway, commands: { loginCommand } }) {
|
|
46
|
-
const instructionsUrl = cli_shared_1.getInstructionsUrl(graphqlGateway);
|
|
46
|
+
const instructionsUrl = (0, cli_shared_1.getInstructionsUrl)(graphqlGateway);
|
|
47
47
|
cmd
|
|
48
48
|
.command('login')
|
|
49
49
|
.description(cli_shared_2.Text.login.cmd)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.registerCommands = void 0;
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
-
|
|
5
|
+
const registerCommands = ({ cmd, controllers: { autocompleteController } }) => {
|
|
6
6
|
cmd
|
|
7
7
|
.command('autocomplete [install|uninstall]')
|
|
8
8
|
.requireNoAuthentication()
|
|
@@ -11,3 +11,4 @@ exports.registerCommands = ({ cmd, controllers: { autocompleteController } }) =>
|
|
|
11
11
|
await autocompleteController.run(arg);
|
|
12
12
|
});
|
|
13
13
|
};
|
|
14
|
+
exports.registerCommands = registerCommands;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.registerCommands = void 0;
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
5
|
const DEPLOY_COMMAND_NAME = 'deploy';
|
|
6
|
-
|
|
6
|
+
const registerCommands = ({ cmd, controllers: { deployController } }) => {
|
|
7
7
|
cmd
|
|
8
8
|
.command(DEPLOY_COMMAND_NAME)
|
|
9
9
|
.requireAppId()
|
|
@@ -13,3 +13,4 @@ exports.registerCommands = ({ cmd, controllers: { deployController } }) => {
|
|
|
13
13
|
.nonInteractiveOption()
|
|
14
14
|
.action(async (opts) => deployController.run(opts));
|
|
15
15
|
};
|
|
16
|
+
exports.registerCommands = registerCommands;
|
|
@@ -92,7 +92,7 @@ const registerVariablesSubcommandStubs = ({ cmd, controllers: { stubController }
|
|
|
92
92
|
cmd.deprecatedCommand(DEPRECATED_UNSET_COMMAND, `${COMMAND_NAME} ${UNSET_COMMAND_NAME}`, stubController);
|
|
93
93
|
cmd.deprecatedCommand(DEPRECATED_LIST_COMMAND, `${COMMAND_NAME} ${LIST_COMMAND_NAME}`, stubController);
|
|
94
94
|
};
|
|
95
|
-
|
|
95
|
+
const registerCommands = (_a) => {
|
|
96
96
|
var { cmd } = _a, deps = tslib_1.__rest(_a, ["cmd"]);
|
|
97
97
|
const variables = cmd.command(COMMAND_NAME).description(cli_shared_1.Text.variables.description);
|
|
98
98
|
registerVariablesSubcommandStubs(Object.assign({ cmd }, deps));
|
|
@@ -100,3 +100,4 @@ exports.registerCommands = (_a) => {
|
|
|
100
100
|
registerDeleteEnvironmentVariableCommand(Object.assign({ cmd: variables }, deps));
|
|
101
101
|
registerListEnvironmentVariableCommand(Object.assign({ cmd: variables }, deps));
|
|
102
102
|
};
|
|
103
|
+
exports.registerCommands = registerCommands;
|