@forge/cli 0.0.0-experimental-c3effe3 → 0.0.0-experimental-820808c
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 +21 -7
- package/npm-shrinkwrap.json +111 -5108
- 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 +2 -242
- package/out/bin/cli.d.ts +0 -1
- package/out/bin/cli.d.ts.map +1 -1
- package/out/bin/cli.js +1 -4
- package/out/bin/postinstall.d.ts +0 -1
- package/out/bin/postinstall.js +1 -22
- package/out/storage/local-file-storage.d.ts +0 -2
- package/out/storage/local-file-storage.d.ts.map +1 -1
- package/out/storage/local-file-storage.js +1 -9
- package/package.json +3 -44
- package/out/autocomplete/index.d.ts +0 -5
- package/out/autocomplete/index.d.ts.map +0 -1
- package/out/autocomplete/index.js +0 -40
- package/out/autocomplete/types.d.ts +0 -14
- package/out/autocomplete/types.d.ts.map +0 -1
- package/out/autocomplete/types.js +0 -2
- package/out/autocomplete/util.d.ts +0 -6
- package/out/autocomplete/util.d.ts.map +0 -1
- package/out/autocomplete/util.js +0 -13
- package/out/command-line/anon-user-id.d.ts +0 -3
- package/out/command-line/anon-user-id.d.ts.map +0 -1
- package/out/command-line/anon-user-id.js +0 -17
- package/out/command-line/command.d.ts +0 -81
- package/out/command-line/command.d.ts.map +0 -1
- package/out/command-line/command.js +0 -382
- package/out/command-line/controller/assertUnreachable.d.ts +0 -2
- package/out/command-line/controller/assertUnreachable.d.ts.map +0 -1
- package/out/command-line/controller/assertUnreachable.js +0 -7
- package/out/command-line/controller/autocomplete-controller.d.ts +0 -12
- package/out/command-line/controller/autocomplete-controller.d.ts.map +0 -1
- package/out/command-line/controller/autocomplete-controller.js +0 -54
- package/out/command-line/controller/deploy-controller.d.ts +0 -43
- package/out/command-line/controller/deploy-controller.d.ts.map +0 -1
- package/out/command-line/controller/deploy-controller.js +0 -139
- package/out/command-line/controller/feedback-controller.d.ts +0 -9
- package/out/command-line/controller/feedback-controller.d.ts.map +0 -1
- package/out/command-line/controller/feedback-controller.js +0 -19
- package/out/command-line/controller/getNodeVersion.d.ts +0 -2
- package/out/command-line/controller/getNodeVersion.d.ts.map +0 -1
- package/out/command-line/controller/getNodeVersion.js +0 -7
- package/out/command-line/controller/install-controller.d.ts +0 -35
- package/out/command-line/controller/install-controller.d.ts.map +0 -1
- package/out/command-line/controller/install-controller.js +0 -154
- package/out/command-line/controller/lint-controller.d.ts +0 -9
- package/out/command-line/controller/lint-controller.d.ts.map +0 -1
- package/out/command-line/controller/lint-controller.js +0 -20
- package/out/command-line/controller/pre-command-controller.d.ts +0 -25
- package/out/command-line/controller/pre-command-controller.d.ts.map +0 -1
- package/out/command-line/controller/pre-command-controller.js +0 -57
- package/out/command-line/controller/prerequisites-controller.d.ts +0 -11
- package/out/command-line/controller/prerequisites-controller.d.ts.map +0 -1
- package/out/command-line/controller/prerequisites-controller.js +0 -34
- package/out/command-line/controller/settings-controller.d.ts +0 -19
- package/out/command-line/controller/settings-controller.d.ts.map +0 -1
- package/out/command-line/controller/settings-controller.js +0 -48
- package/out/command-line/controller/stubController.d.ts +0 -9
- package/out/command-line/controller/stubController.d.ts.map +0 -1
- package/out/command-line/controller/stubController.js +0 -15
- package/out/command-line/controller/tunnel-controller.d.ts +0 -14
- package/out/command-line/controller/tunnel-controller.d.ts.map +0 -1
- package/out/command-line/controller/tunnel-controller.js +0 -43
- package/out/command-line/dependency-injection.d.ts +0 -69
- package/out/command-line/dependency-injection.d.ts.map +0 -1
- package/out/command-line/dependency-injection.js +0 -188
- package/out/command-line/environment.d.ts +0 -2
- package/out/command-line/environment.d.ts.map +0 -1
- package/out/command-line/environment.js +0 -15
- package/out/command-line/errors.d.ts +0 -6
- package/out/command-line/errors.d.ts.map +0 -1
- package/out/command-line/errors.js +0 -12
- package/out/command-line/index.d.ts +0 -5
- package/out/command-line/index.d.ts.map +0 -1
- package/out/command-line/index.js +0 -66
- package/out/command-line/register-app-commands.d.ts +0 -10
- package/out/command-line/register-app-commands.d.ts.map +0 -1
- package/out/command-line/register-app-commands.js +0 -128
- package/out/command-line/register-authentication-command.d.ts +0 -16
- package/out/command-line/register-authentication-command.d.ts.map +0 -1
- package/out/command-line/register-authentication-command.js +0 -92
- package/out/command-line/register-autocomplete-commands.d.ts +0 -3
- package/out/command-line/register-autocomplete-commands.d.ts.map +0 -1
- package/out/command-line/register-autocomplete-commands.js +0 -13
- package/out/command-line/register-deployment-commands.d.ts +0 -22
- package/out/command-line/register-deployment-commands.d.ts.map +0 -1
- package/out/command-line/register-deployment-commands.js +0 -15
- package/out/command-line/register-environment-variables-commands.d.ts +0 -3
- package/out/command-line/register-environment-variables-commands.d.ts.map +0 -1
- package/out/command-line/register-environment-variables-commands.js +0 -99
- package/out/command-line/register-feedback-commands.d.ts +0 -3
- package/out/command-line/register-feedback-commands.d.ts.map +0 -1
- package/out/command-line/register-feedback-commands.js +0 -31
- package/out/command-line/register-installation-commands.d.ts +0 -6
- package/out/command-line/register-installation-commands.d.ts.map +0 -1
- package/out/command-line/register-installation-commands.js +0 -140
- package/out/command-line/register-lint-command.d.ts +0 -8
- package/out/command-line/register-lint-command.d.ts.map +0 -1
- package/out/command-line/register-lint-command.js +0 -15
- package/out/command-line/register-log-commands.d.ts +0 -4
- package/out/command-line/register-log-commands.d.ts.map +0 -1
- package/out/command-line/register-log-commands.js +0 -138
- package/out/command-line/register-providers-commands.d.ts +0 -3
- package/out/command-line/register-providers-commands.d.ts.map +0 -1
- package/out/command-line/register-providers-commands.js +0 -43
- package/out/command-line/register-settings-commands.d.ts +0 -3
- package/out/command-line/register-settings-commands.d.ts.map +0 -1
- package/out/command-line/register-settings-commands.js +0 -37
- package/out/command-line/register-tunnel-commands.d.ts +0 -3
- package/out/command-line/register-tunnel-commands.d.ts.map +0 -1
- package/out/command-line/register-tunnel-commands.js +0 -14
- package/out/command-line/register-webtrigger-commands.d.ts +0 -3
- package/out/command-line/register-webtrigger-commands.d.ts.map +0 -1
- package/out/command-line/register-webtrigger-commands.js +0 -55
- package/out/command-line/unique-machine-id.d.ts +0 -3
- package/out/command-line/unique-machine-id.d.ts.map +0 -1
- package/out/command-line/unique-machine-id.js +0 -18
- package/out/command-line/version-info.d.ts +0 -8
- package/out/command-line/version-info.d.ts.map +0 -1
- package/out/command-line/version-info.js +0 -34
- package/out/command-line/view/analytics-settings-view.d.ts +0 -7
- package/out/command-line/view/analytics-settings-view.d.ts.map +0 -1
- package/out/command-line/view/analytics-settings-view.js +0 -18
- package/out/command-line/view/deploy-view.d.ts +0 -21
- package/out/command-line/view/deploy-view.d.ts.map +0 -1
- package/out/command-line/view/deploy-view.js +0 -58
- package/out/command-line/view/install-view.d.ts +0 -18
- package/out/command-line/view/install-view.d.ts.map +0 -1
- package/out/command-line/view/install-view.js +0 -55
- package/out/command-line/view/lint-view.d.ts +0 -12
- package/out/command-line/view/lint-view.d.ts.map +0 -1
- package/out/command-line/view/lint-view.js +0 -31
- package/out/command-line/view/lite-lint-view.d.ts +0 -10
- package/out/command-line/view/lite-lint-view.d.ts.map +0 -1
- package/out/command-line/view/lite-lint-view.js +0 -18
- package/out/command-line/view/settings-view.d.ts +0 -8
- package/out/command-line/view/settings-view.d.ts.map +0 -1
- package/out/command-line/view/settings-view.js +0 -21
- package/out/command-line/view/tunnel-view.d.ts +0 -18
- package/out/command-line/view/tunnel-view.d.ts.map +0 -1
- package/out/command-line/view/tunnel-view.js +0 -89
- package/out/deploy/deployer/deploy-monitor-graphql-client.d.ts +0 -24
- package/out/deploy/deployer/deploy-monitor-graphql-client.d.ts.map +0 -1
- package/out/deploy/deployer/deploy-monitor-graphql-client.js +0 -57
- package/out/deploy/deployer/deployer.d.ts +0 -31
- package/out/deploy/deployer/deployer.d.ts.map +0 -1
- package/out/deploy/deployer/deployer.js +0 -154
- package/out/deploy/deployer/index.d.ts +0 -4
- package/out/deploy/deployer/index.d.ts.map +0 -1
- package/out/deploy/deployer/index.js +0 -6
- package/out/deploy/deployer/trigger-deploy-graphql-client.d.ts +0 -19
- package/out/deploy/deployer/trigger-deploy-graphql-client.d.ts.map +0 -1
- package/out/deploy/deployer/trigger-deploy-graphql-client.js +0 -45
- package/out/deploy/index.d.ts +0 -5
- package/out/deploy/index.d.ts.map +0 -1
- package/out/deploy/index.js +0 -7
- package/out/deploy/package-upload-deploy.d.ts +0 -18
- package/out/deploy/package-upload-deploy.d.ts.map +0 -1
- package/out/deploy/package-upload-deploy.js +0 -28
- package/out/deploy/packager/archiver.d.ts +0 -24
- package/out/deploy/packager/archiver.d.ts.map +0 -1
- package/out/deploy/packager/archiver.js +0 -62
- package/out/deploy/packager/index.d.ts +0 -3
- package/out/deploy/packager/index.d.ts.map +0 -1
- package/out/deploy/packager/index.js +0 -5
- package/out/deploy/packager/packager.d.ts +0 -35
- package/out/deploy/packager/packager.d.ts.map +0 -1
- package/out/deploy/packager/packager.js +0 -61
- package/out/deploy/uploader/artifact-graphql-client.d.ts +0 -26
- package/out/deploy/uploader/artifact-graphql-client.d.ts.map +0 -1
- package/out/deploy/uploader/artifact-graphql-client.js +0 -92
- package/out/deploy/uploader/index.d.ts +0 -3
- package/out/deploy/uploader/index.d.ts.map +0 -1
- package/out/deploy/uploader/index.js +0 -5
- package/out/deploy/uploader/uploader.d.ts +0 -19
- package/out/deploy/uploader/uploader.d.ts.map +0 -1
- package/out/deploy/uploader/uploader.js +0 -43
- package/out/environment-variables/delete-environment-variable.d.ts +0 -18
- package/out/environment-variables/delete-environment-variable.d.ts.map +0 -1
- package/out/environment-variables/delete-environment-variable.js +0 -14
- package/out/environment-variables/graphql-client.d.ts +0 -16
- package/out/environment-variables/graphql-client.d.ts.map +0 -1
- package/out/environment-variables/graphql-client.js +0 -105
- package/out/environment-variables/list-environment-variables.d.ts +0 -22
- package/out/environment-variables/list-environment-variables.d.ts.map +0 -1
- package/out/environment-variables/list-environment-variables.js +0 -14
- package/out/environment-variables/set-environment-variable.d.ts +0 -20
- package/out/environment-variables/set-environment-variable.d.ts.map +0 -1
- package/out/environment-variables/set-environment-variable.js +0 -14
- package/out/installations/graphql-client.d.ts +0 -60
- package/out/installations/graphql-client.d.ts.map +0 -1
- package/out/installations/graphql-client.js +0 -408
- package/out/installations/install-app-site.d.ts +0 -21
- package/out/installations/install-app-site.d.ts.map +0 -1
- package/out/installations/install-app-site.js +0 -19
- package/out/installations/shared.d.ts +0 -5
- package/out/installations/shared.d.ts.map +0 -1
- package/out/installations/shared.js +0 -19
- package/out/installations/uninstall-app.d.ts +0 -25
- package/out/installations/uninstall-app.d.ts.map +0 -1
- package/out/installations/uninstall-app.js +0 -43
- package/out/migration-keys/graphql-client.d.ts +0 -8
- package/out/migration-keys/graphql-client.d.ts.map +0 -1
- package/out/migration-keys/graphql-client.js +0 -55
- package/out/providers/configure-provider.d.ts +0 -19
- package/out/providers/configure-provider.d.ts.map +0 -1
- package/out/providers/configure-provider.js +0 -14
- package/out/providers/graphql-client.d.ts +0 -12
- package/out/providers/graphql-client.d.ts.map +0 -1
- package/out/providers/graphql-client.js +0 -47
- package/out/service/cached-config-service.d.ts +0 -8
- package/out/service/cached-config-service.d.ts.map +0 -1
- package/out/service/cached-config-service.js +0 -16
- package/out/service/command-suggestion-service.d.ts +0 -4
- package/out/service/command-suggestion-service.d.ts.map +0 -1
- package/out/service/command-suggestion-service.js +0 -17
- package/out/service/docker-service.d.ts +0 -24
- package/out/service/docker-service.d.ts.map +0 -1
- package/out/service/docker-service.js +0 -71
- package/out/service/installation-service.d.ts +0 -51
- package/out/service/installation-service.d.ts.map +0 -1
- package/out/service/installation-service.js +0 -89
- package/out/service/lint-service.d.ts +0 -23
- package/out/service/lint-service.d.ts.map +0 -1
- package/out/service/lint-service.js +0 -39
- package/out/service/lite-lint-service.d.ts +0 -10
- package/out/service/lite-lint-service.d.ts.map +0 -1
- package/out/service/lite-lint-service.js +0 -27
- package/out/service/migration-keys-service.d.ts +0 -19
- package/out/service/migration-keys-service.d.ts.map +0 -1
- package/out/service/migration-keys-service.js +0 -14
- package/out/service/port-finding-service.d.ts +0 -12
- package/out/service/port-finding-service.d.ts.map +0 -1
- package/out/service/port-finding-service.js +0 -34
- package/out/service/resource-packaging-service.d.ts +0 -46
- package/out/service/resource-packaging-service.d.ts.map +0 -1
- package/out/service/resource-packaging-service.js +0 -128
- package/out/service/resources-uploader-service.d.ts +0 -16
- package/out/service/resources-uploader-service.d.ts.map +0 -1
- package/out/service/resources-uploader-service.js +0 -34
- package/out/service/tunnel-analytics-service.d.ts +0 -11
- package/out/service/tunnel-analytics-service.d.ts.map +0 -1
- package/out/service/tunnel-analytics-service.js +0 -24
- package/out/service/tunnel-service.d.ts +0 -49
- package/out/service/tunnel-service.d.ts.map +0 -1
- package/out/service/tunnel-service.js +0 -190
- package/out/webtrigger/get-webtrigger-url.d.ts +0 -27
- package/out/webtrigger/get-webtrigger-url.d.ts.map +0 -1
- package/out/webtrigger/get-webtrigger-url.js +0 -26
- package/out/webtrigger/graphql-client.d.ts +0 -14
- package/out/webtrigger/graphql-client.d.ts.map +0 -1
- package/out/webtrigger/graphql-client.js +0 -52
- package/out/workers/analytics-message-worker.d.ts +0 -12
- package/out/workers/analytics-message-worker.d.ts.map +0 -1
- package/out/workers/analytics-message-worker.js +0 -29
- package/out/workers/forge-cli-workers.d.ts +0 -2
- package/out/workers/forge-cli-workers.d.ts.map +0 -1
- package/out/workers/forge-cli-workers.js +0 -21
- package/out/workers/tunnel-clean-up-worker.d.ts +0 -8
- package/out/workers/tunnel-clean-up-worker.d.ts.map +0 -1
- package/out/workers/tunnel-clean-up-worker.js +0 -31
- package/out/workers/version-check-worker.d.ts +0 -8
- package/out/workers/version-check-worker.d.ts.map +0 -1
- package/out/workers/version-check-worker.js +0 -20
- package/out/workers/worker-info.d.ts +0 -8
- package/out/workers/worker-info.d.ts.map +0 -1
- package/out/workers/worker-info.js +0 -14
- package/out/workers/worker.d.ts +0 -6
- package/out/workers/worker.d.ts.map +0 -1
- package/out/workers/worker.js +0 -7
- package/out/workers/workers-starter.d.ts +0 -5
- package/out/workers/workers-starter.d.ts.map +0 -1
- package/out/workers/workers-starter.js +0 -22
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerCommands = exports.createCommandHandler = exports.directoryNameFromAppName = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
-
const sanitize_filename_1 = tslib_1.__importDefault(require("sanitize-filename"));
|
|
7
|
-
const cli_shared_1 = require("@forge/cli-shared");
|
|
8
|
-
const cli_shared_2 = require("@forge/cli-shared");
|
|
9
|
-
var TemplateCategory;
|
|
10
|
-
(function (TemplateCategory) {
|
|
11
|
-
TemplateCategory["SHOW_ALL"] = "Show All";
|
|
12
|
-
TemplateCategory["CUSTOM_UI"] = "Custom UI";
|
|
13
|
-
TemplateCategory["BACKEND"] = "Triggers and Validators";
|
|
14
|
-
TemplateCategory["UI_KIT"] = "UI kit";
|
|
15
|
-
})(TemplateCategory || (TemplateCategory = {}));
|
|
16
|
-
function ensureDirectoryDoesntExist(directory) {
|
|
17
|
-
if (fs_1.default.existsSync(directory)) {
|
|
18
|
-
throw new cli_shared_1.ValidationError(cli_shared_1.Text.create.error.directory.exists(directory));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function ensureValidNameLength(name) {
|
|
22
|
-
if (name.length <= 0 || name.length > 50) {
|
|
23
|
-
throw new cli_shared_1.ValidationError(cli_shared_1.Text.create.error.name.tooLong());
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function directoryNameFromAppName(appName) {
|
|
27
|
-
if (appName === undefined) {
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
const normalized = sanitize_filename_1.default(appName.trim()).trim().replace(/ /g, '-');
|
|
31
|
-
const chars = Array.from(normalized);
|
|
32
|
-
const allDashes = chars.every((char) => char === '-');
|
|
33
|
-
return allDashes ? undefined : normalized;
|
|
34
|
-
}
|
|
35
|
-
exports.directoryNameFromAppName = directoryNameFromAppName;
|
|
36
|
-
async function createCommandHandler(ui, createAppCommand, name, { template, directory }) {
|
|
37
|
-
if (directory) {
|
|
38
|
-
ensureDirectoryDoesntExist(directory);
|
|
39
|
-
ui.info(cli_shared_1.Text.create.intro(directory));
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
directory = directoryNameFromAppName(name) || template;
|
|
43
|
-
if (directory) {
|
|
44
|
-
ensureDirectoryDoesntExist(directory);
|
|
45
|
-
}
|
|
46
|
-
const currentDirectory = process.cwd();
|
|
47
|
-
ui.info(cli_shared_1.Text.create.introWithCurrentDirectory(currentDirectory));
|
|
48
|
-
}
|
|
49
|
-
ui.info(cli_shared_1.Text.ctrlC);
|
|
50
|
-
if (!name) {
|
|
51
|
-
ui.info(cli_shared_1.Text.create.overviewAppName);
|
|
52
|
-
name = await ui.promptForText(cli_shared_1.Text.create.promptName);
|
|
53
|
-
if (!directory) {
|
|
54
|
-
directory = directoryNameFromAppName(name) || template;
|
|
55
|
-
if (directory) {
|
|
56
|
-
ensureDirectoryDoesntExist(directory);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
ensureValidNameLength(name);
|
|
61
|
-
if (!template) {
|
|
62
|
-
ui.info(cli_shared_1.Text.create.overviewTemplates);
|
|
63
|
-
const templates = await ui.displayTemporaryMessage(() => createAppCommand.getAvailableTemplates(), cli_shared_1.Text.create.waitTemplates);
|
|
64
|
-
const type = await ui.promptForList(cli_shared_1.Text.create.promptCategory, Object.values(TemplateCategory));
|
|
65
|
-
const filteredTemplates = type === TemplateCategory.SHOW_ALL
|
|
66
|
-
? templates
|
|
67
|
-
: templates
|
|
68
|
-
.filter((name) => {
|
|
69
|
-
switch (type) {
|
|
70
|
-
case TemplateCategory.BACKEND:
|
|
71
|
-
return !name.includes('ui-kit') && !name.includes('custom-ui') && name !== 'blank';
|
|
72
|
-
case TemplateCategory.CUSTOM_UI:
|
|
73
|
-
return name.includes('custom-ui');
|
|
74
|
-
case TemplateCategory.UI_KIT:
|
|
75
|
-
return name.includes('ui-kit');
|
|
76
|
-
}
|
|
77
|
-
})
|
|
78
|
-
.map((name) => name.replace('-ui-kit', '').replace('-custom-ui', ''));
|
|
79
|
-
template = await ui.promptForList(cli_shared_1.Text.create.promptTemplate, filteredTemplates);
|
|
80
|
-
if (type === TemplateCategory.UI_KIT) {
|
|
81
|
-
template = `${template}-ui-kit`;
|
|
82
|
-
}
|
|
83
|
-
if (type === TemplateCategory.CUSTOM_UI) {
|
|
84
|
-
template = `${template}-custom-ui`;
|
|
85
|
-
}
|
|
86
|
-
if (!directory) {
|
|
87
|
-
directory = template;
|
|
88
|
-
ensureDirectoryDoesntExist(directory);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
ui.emptyLine();
|
|
92
|
-
const result = await ui.displayProgress(() => createAppCommand.execute({ name, template, directory }), cli_shared_1.Text.create.cmd.start, cli_shared_1.Text.create.cmd.success(name));
|
|
93
|
-
ui.info(cli_shared_1.Text.create.cmd.successDetails(directory, cli_shared_2.VALID_ENVIRONMENT_OPTIONS));
|
|
94
|
-
return result;
|
|
95
|
-
}
|
|
96
|
-
exports.createCommandHandler = createCommandHandler;
|
|
97
|
-
function registerCreateCommands({ cmd, ui, commands: { createAppCommand } }) {
|
|
98
|
-
cmd
|
|
99
|
-
.command('create [name]')
|
|
100
|
-
.description(cli_shared_1.Text.create.cmd.desc)
|
|
101
|
-
.option('-t, --template <template name>', cli_shared_1.Text.create.optionTemplate)
|
|
102
|
-
.option('-d, --directory <directory name>', cli_shared_1.Text.create.optionDirectory)
|
|
103
|
-
.action((name, options) => createCommandHandler(ui, createAppCommand, name, options));
|
|
104
|
-
}
|
|
105
|
-
function registerRegisterCommand({ cmd, ui, commands: { registerAppCommand } }) {
|
|
106
|
-
cmd
|
|
107
|
-
.command('register [name]')
|
|
108
|
-
.description(cli_shared_1.Text.register.cmd.desc)
|
|
109
|
-
.requireManifestFile()
|
|
110
|
-
.action(async (name) => {
|
|
111
|
-
ui.info(cli_shared_1.Text.register.intro);
|
|
112
|
-
ui.info(cli_shared_1.Text.ctrlC);
|
|
113
|
-
ui.emptyLine();
|
|
114
|
-
if (!name) {
|
|
115
|
-
ui.info(cli_shared_1.Text.create.overviewAppName);
|
|
116
|
-
}
|
|
117
|
-
const appName = await ui.promptForText(cli_shared_1.Text.create.promptName);
|
|
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));
|
|
120
|
-
ui.info(cli_shared_1.Text.register.cmd.successDetails(cli_shared_2.VALID_ENVIRONMENT_OPTIONS));
|
|
121
|
-
return result;
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
function registerCommands(deps) {
|
|
125
|
-
registerCreateCommands(deps);
|
|
126
|
-
registerRegisterCommand(deps);
|
|
127
|
-
}
|
|
128
|
-
exports.registerCommands = registerCommands;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { PersonalApiCredentialsValidated } from '@forge/cli-shared';
|
|
2
|
-
import { CommandLineUI, LoginCommand } from '@forge/cli-shared';
|
|
3
|
-
import { Dependencies } from './dependency-injection';
|
|
4
|
-
export interface LoginCommandOptions {
|
|
5
|
-
email: string;
|
|
6
|
-
token: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function loginCommandHandler(ui: CommandLineUI, instructionsUrl: string, loginCommand: LoginCommand, { email, token }: LoginCommandOptions): Promise<{
|
|
9
|
-
creds: PersonalApiCredentialsValidated;
|
|
10
|
-
analytics: {
|
|
11
|
-
userId: string;
|
|
12
|
-
anonymousId: string | undefined;
|
|
13
|
-
};
|
|
14
|
-
}>;
|
|
15
|
-
export declare function registerCommands(deps: Dependencies): void;
|
|
16
|
-
//# sourceMappingURL=register-authentication-command.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register-authentication-command.d.ts","sourceRoot":"","sources":["../../src/command-line/register-authentication-command.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,+BAA+B,EAKhC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAQ,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAYtD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,mBAAmB,CACvC,EAAE,EAAE,aAAa,EACjB,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,YAAY,EAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,mBAAmB,GACpC,OAAO,CAAC;IAAE,KAAK,EAAE,+BAA+B,CAAC;IAAC,SAAS,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAA;CAAE,CAAC,CAoCrH;AAgDD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,QAIlD"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerCommands = exports.loginCommandHandler = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const child_process_1 = tslib_1.__importDefault(require("child_process"));
|
|
6
|
-
const cli_shared_1 = require("@forge/cli-shared");
|
|
7
|
-
const cli_shared_2 = require("@forge/cli-shared");
|
|
8
|
-
const anon_user_id_1 = require("./anon-user-id");
|
|
9
|
-
function guessEmail() {
|
|
10
|
-
const child = child_process_1.default.spawnSync('git', ['config', '--global', 'user.email'], { encoding: 'utf8', shell: true });
|
|
11
|
-
if (child.status || child.error) {
|
|
12
|
-
return undefined;
|
|
13
|
-
}
|
|
14
|
-
return child.stdout.trim();
|
|
15
|
-
}
|
|
16
|
-
async function loginCommandHandler(ui, instructionsUrl, loginCommand, { email, token }) {
|
|
17
|
-
try {
|
|
18
|
-
ui.info(cli_shared_2.Text.login.introText);
|
|
19
|
-
ui.info(cli_shared_2.Text.ctrlC);
|
|
20
|
-
ui.emptyLine();
|
|
21
|
-
if (!email) {
|
|
22
|
-
const maybeEmail = guessEmail();
|
|
23
|
-
email = await ui.promptForText(cli_shared_2.Text.login.promptEmail, maybeEmail);
|
|
24
|
-
ui.emptyLine();
|
|
25
|
-
}
|
|
26
|
-
if (!token) {
|
|
27
|
-
ui.info(cli_shared_2.Text.login.url(instructionsUrl));
|
|
28
|
-
ui.emptyLine();
|
|
29
|
-
token = await ui.promptForSecret(cli_shared_2.Text.login.promptToken);
|
|
30
|
-
ui.emptyLine();
|
|
31
|
-
}
|
|
32
|
-
const { creds, analytics } = await ui.displayProgress(() => loginCommand.execute({ email, token }), cli_shared_2.Text.login.checking, (data) => cli_shared_2.Text.login.success(data.user.name));
|
|
33
|
-
ui.emptyLine();
|
|
34
|
-
ui.info(cli_shared_2.Text.login.nextStep);
|
|
35
|
-
return {
|
|
36
|
-
creds,
|
|
37
|
-
analytics: Object.assign(Object.assign({}, analytics), { anonymousId: anon_user_id_1.getAnonId(true) })
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
throw error instanceof cli_shared_1.UserNotFoundError ? new Error(cli_shared_2.Text.login.error) : error;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.loginCommandHandler = loginCommandHandler;
|
|
45
|
-
function registerLoginCommand({ cmd, ui, graphqlGateway, commands: { loginCommand } }) {
|
|
46
|
-
const instructionsUrl = cli_shared_1.getInstructionsUrl(graphqlGateway);
|
|
47
|
-
cmd
|
|
48
|
-
.command('login')
|
|
49
|
-
.description(cli_shared_2.Text.login.cmd)
|
|
50
|
-
.option('-u, --email <user email>', cli_shared_2.Text.login.optionEmail)
|
|
51
|
-
.option('-t, --token <api token>', cli_shared_2.Text.login.optionToken)
|
|
52
|
-
.requireNoAuthentication()
|
|
53
|
-
.nonInteractiveOption('--email', '--token')
|
|
54
|
-
.action((options) => loginCommandHandler(ui, instructionsUrl, loginCommand, options));
|
|
55
|
-
}
|
|
56
|
-
function registerLogoutCommand({ cmd, ui, commands: { logoutCommand } }) {
|
|
57
|
-
cmd
|
|
58
|
-
.command('logout')
|
|
59
|
-
.description(cli_shared_2.Text.logout.cmd)
|
|
60
|
-
.requireNoAuthentication()
|
|
61
|
-
.action(async () => {
|
|
62
|
-
await logoutCommand.execute();
|
|
63
|
-
ui.info(cli_shared_2.Text.logout.loggedOut);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
function registerWhoAmICommand({ cmd, ui, commands: { loginCommand } }) {
|
|
67
|
-
cmd
|
|
68
|
-
.command('whoami')
|
|
69
|
-
.description(cli_shared_2.Text.whoami.cmd)
|
|
70
|
-
.action(async () => {
|
|
71
|
-
try {
|
|
72
|
-
const credentials = await cli_shared_1.getCredentialsStoreProvider(ui).getCredentials();
|
|
73
|
-
const { name, accountId } = await loginCommand.getUser(credentials);
|
|
74
|
-
ui.info(cli_shared_2.Text.whoami.success.personalCredentials(credentials.email, name, accountId));
|
|
75
|
-
}
|
|
76
|
-
catch (error) {
|
|
77
|
-
if (error instanceof cli_shared_1.UserNotFoundError) {
|
|
78
|
-
const msg = cli_shared_1.hasKeytar()
|
|
79
|
-
? cli_shared_2.Text.whoami.error.personalCredentialsKeytar
|
|
80
|
-
: cli_shared_2.Text.whoami.error.personalCredentialsEnv(cli_shared_1.EMAIL_KEY, cli_shared_1.API_TOKEN_KEY);
|
|
81
|
-
throw new Error(msg);
|
|
82
|
-
}
|
|
83
|
-
throw error;
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
function registerCommands(deps) {
|
|
88
|
-
registerLoginCommand(deps);
|
|
89
|
-
registerLogoutCommand(deps);
|
|
90
|
-
registerWhoAmICommand(deps);
|
|
91
|
-
}
|
|
92
|
-
exports.registerCommands = registerCommands;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register-autocomplete-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-autocomplete-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAItD,eAAO,MAAM,gBAAgB,qDAAsD,YAAY,KAAG,IAQjG,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerCommands = void 0;
|
|
4
|
-
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
-
exports.registerCommands = ({ cmd, controllers: { autocompleteController } }) => {
|
|
6
|
-
cmd
|
|
7
|
-
.command('autocomplete [install|uninstall]')
|
|
8
|
-
.requireNoAuthentication()
|
|
9
|
-
.description(cli_shared_1.Text.autocomplete.cmd.desc)
|
|
10
|
-
.action(async (arg) => {
|
|
11
|
-
await autocompleteController.run(arg);
|
|
12
|
-
});
|
|
13
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Dependencies } from './dependency-injection';
|
|
2
|
-
export interface DeploymentResult {
|
|
3
|
-
analytics: {
|
|
4
|
-
moduleList?: string[];
|
|
5
|
-
hostedResourceList: {
|
|
6
|
-
rawSize: string;
|
|
7
|
-
zipSize: string;
|
|
8
|
-
extensionList: string[];
|
|
9
|
-
fileCount: number;
|
|
10
|
-
}[];
|
|
11
|
-
egressPermissionList?: {
|
|
12
|
-
type: string;
|
|
13
|
-
domains: string[] | undefined;
|
|
14
|
-
}[];
|
|
15
|
-
connectKey?: {
|
|
16
|
-
action?: string;
|
|
17
|
-
value?: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export declare const registerCommands: ({ cmd, controllers: { deployController } }: Dependencies) => void;
|
|
22
|
-
//# sourceMappingURL=register-deployment-commands.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register-deployment-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-deployment-commands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE;QACT,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,kBAAkB,EAAE;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,OAAO,EAAE,MAAM,CAAC;YAChB,aAAa,EAAE,MAAM,EAAE,CAAC;YACxB,SAAS,EAAE,MAAM,CAAC;SACnB,EAAE,CAAC;QACJ,oBAAoB,CAAC,EAAE;YACrB,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;SAC/B,EAAE,CAAC;QACJ,UAAU,CAAC,EAAE;YACX,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,KAAK,CAAC,EAAE,MAAM,CAAC;SAChB,CAAC;KACH,CAAC;CACH;AAID,eAAO,MAAM,gBAAgB,+CAAgD,YAAY,SASxF,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerCommands = void 0;
|
|
4
|
-
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
-
const DEPLOY_COMMAND_NAME = 'deploy';
|
|
6
|
-
exports.registerCommands = ({ cmd, controllers: { deployController } }) => {
|
|
7
|
-
cmd
|
|
8
|
-
.command(DEPLOY_COMMAND_NAME)
|
|
9
|
-
.requireAppId()
|
|
10
|
-
.description(cli_shared_1.Text.deploy.cmd.desc)
|
|
11
|
-
.option('-f, --no-verify', 'Disable pre-deployment checks')
|
|
12
|
-
.environmentOption()
|
|
13
|
-
.nonInteractiveOption()
|
|
14
|
-
.action(async (opts) => deployController.run(opts));
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register-environment-variables-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-environment-variables-commands.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAwHtD,eAAO,MAAM,gBAAgB,qBAAsB,YAAY,KAAG,IAOjE,CAAC"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerCommands = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const cli_table3_1 = tslib_1.__importDefault(require("cli-table3"));
|
|
6
|
-
const cli_shared_1 = require("@forge/cli-shared");
|
|
7
|
-
const cli_shared_2 = require("@forge/cli-shared");
|
|
8
|
-
const cli_shared_3 = require("@forge/cli-shared");
|
|
9
|
-
const COMMAND_NAME = 'variables';
|
|
10
|
-
const SET_COMMAND_NAME = 'set';
|
|
11
|
-
const registerSetEnvironmentVariableCommand = ({ cmd, ui, commands: { setEnvironmentVariableCommand } }) => {
|
|
12
|
-
cmd
|
|
13
|
-
.command(`${SET_COMMAND_NAME} [key] [value]`)
|
|
14
|
-
.requireAppId()
|
|
15
|
-
.description(cli_shared_2.Text.varsSet.cmd.desc)
|
|
16
|
-
.option('--encrypt', cli_shared_2.Text.varsSet.optionSecret, false)
|
|
17
|
-
.environmentOption()
|
|
18
|
-
.action(async (key, value, { environment, encrypt }) => {
|
|
19
|
-
ui.info(cli_shared_2.Text.varsSet.overview(environment, cli_shared_3.environmentToOption));
|
|
20
|
-
ui.info(cli_shared_2.Text.ctrlC);
|
|
21
|
-
ui.emptyLine();
|
|
22
|
-
if (!value && !encrypt) {
|
|
23
|
-
ui.info(cli_shared_2.Text.varsSet.encryptInfo);
|
|
24
|
-
ui.emptyLine();
|
|
25
|
-
encrypt =
|
|
26
|
-
(await ui.promptForList(cli_shared_2.Text.varsSet.promptEncrypt, [cli_shared_2.Text.varsSet.yes, cli_shared_2.Text.varsSet.no])) ===
|
|
27
|
-
cli_shared_2.Text.varsSet.yes;
|
|
28
|
-
ui.emptyLine();
|
|
29
|
-
}
|
|
30
|
-
if (!key) {
|
|
31
|
-
ui.info(cli_shared_2.Text.varsSet.keyInfo);
|
|
32
|
-
ui.emptyLine();
|
|
33
|
-
key = await ui.promptForText(cli_shared_2.Text.varsSet.promptKey);
|
|
34
|
-
}
|
|
35
|
-
if (!value) {
|
|
36
|
-
value = encrypt
|
|
37
|
-
? await ui.promptForSecret(cli_shared_2.Text.varsSet.promptValue)
|
|
38
|
-
: await ui.promptForText(cli_shared_2.Text.varsSet.promptValue);
|
|
39
|
-
ui.emptyLine();
|
|
40
|
-
}
|
|
41
|
-
await ui.displayProgress(() => setEnvironmentVariableCommand.execute({ environment, encrypt, key, value }), cli_shared_2.Text.varsSet.cmd.start, cli_shared_2.Text.varsSet.cmd.success);
|
|
42
|
-
ui.info(cli_shared_2.Text.varsList.hint);
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
const UNSET_COMMAND_NAME = 'unset';
|
|
46
|
-
const registerDeleteEnvironmentVariableCommand = ({ cmd, ui, commands: { deleteEnvironmentVariableCommand } }) => {
|
|
47
|
-
cmd
|
|
48
|
-
.command(`${UNSET_COMMAND_NAME} <key>`)
|
|
49
|
-
.requireAppId()
|
|
50
|
-
.description(cli_shared_2.Text.varsUnset.cmd.desc)
|
|
51
|
-
.environmentOption()
|
|
52
|
-
.action(async (key, { environment }) => {
|
|
53
|
-
ui.info(cli_shared_2.Text.varsUnset.cmd.start(environment, cli_shared_3.environmentToOption));
|
|
54
|
-
ui.info(cli_shared_2.Text.ctrlC);
|
|
55
|
-
await deleteEnvironmentVariableCommand.execute({ environment, key });
|
|
56
|
-
ui.info(cli_shared_2.Text.varsUnset.cmd.success(key));
|
|
57
|
-
ui.info(cli_shared_2.Text.varsList.hint);
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
const LIST_COMMAND_NAME = 'list';
|
|
61
|
-
const registerListEnvironmentVariableCommand = ({ cmd, ui, commands: { listEnvironmentVariablesCommand } }) => {
|
|
62
|
-
cmd
|
|
63
|
-
.command(LIST_COMMAND_NAME)
|
|
64
|
-
.requireAppId()
|
|
65
|
-
.description(cli_shared_2.Text.varsList.cmd)
|
|
66
|
-
.environmentOption()
|
|
67
|
-
.action(async ({ environment }) => {
|
|
68
|
-
const variables = await listEnvironmentVariablesCommand.execute({ environment });
|
|
69
|
-
if (!variables || !variables.length) {
|
|
70
|
-
ui.info(cli_shared_2.Text.varsList.empty(environment, cli_shared_3.environmentToOption));
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const table = new cli_table3_1.default(Object.assign(Object.assign({}, cli_shared_1.TableStyle.default), { head: ['Encrypted?', 'Key', 'Value'] }));
|
|
74
|
-
if (variables) {
|
|
75
|
-
for (const { encrypt, key, value } of variables) {
|
|
76
|
-
table.push([encrypt ? '✔' : '', key, encrypt ? cli_shared_2.Text.varsList.encryptedValue : value]);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
ui.info(cli_shared_2.Text.varsList.overview(environment, cli_shared_3.environmentToOption));
|
|
80
|
-
ui.info(table.toString());
|
|
81
|
-
ui.info(cli_shared_2.Text.varsList.postfix);
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
const DEPRECATED_SET_COMMAND = 'variables:set';
|
|
85
|
-
const DEPRECATED_UNSET_COMMAND = 'variables:unset';
|
|
86
|
-
const DEPRECATED_LIST_COMMAND = 'variables:list';
|
|
87
|
-
const registerVariablesSubcommandStubs = ({ cmd, controllers: { stubController } }) => {
|
|
88
|
-
cmd.deprecatedCommand(DEPRECATED_SET_COMMAND, `${COMMAND_NAME} ${SET_COMMAND_NAME}`, stubController);
|
|
89
|
-
cmd.deprecatedCommand(DEPRECATED_UNSET_COMMAND, `${COMMAND_NAME} ${UNSET_COMMAND_NAME}`, stubController);
|
|
90
|
-
cmd.deprecatedCommand(DEPRECATED_LIST_COMMAND, `${COMMAND_NAME} ${LIST_COMMAND_NAME}`, stubController);
|
|
91
|
-
};
|
|
92
|
-
exports.registerCommands = (_a) => {
|
|
93
|
-
var { cmd } = _a, deps = tslib_1.__rest(_a, ["cmd"]);
|
|
94
|
-
const variables = cmd.command(COMMAND_NAME).description(cli_shared_2.Text.variables.description);
|
|
95
|
-
registerVariablesSubcommandStubs(Object.assign({ cmd }, deps));
|
|
96
|
-
registerSetEnvironmentVariableCommand(Object.assign({ cmd: variables }, deps));
|
|
97
|
-
registerDeleteEnvironmentVariableCommand(Object.assign({ cmd: variables }, deps));
|
|
98
|
-
registerListEnvironmentVariableCommand(Object.assign({ cmd: variables }, deps));
|
|
99
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register-feedback-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-feedback-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AA+BtD,eAAO,MAAM,gBAAgB,SAAU,YAAY,SAElD,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerCommands = void 0;
|
|
4
|
-
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
-
const registerFeedbackCommands = ({ cmd, ui, controllers: { feedbackController } }) => {
|
|
6
|
-
cmd
|
|
7
|
-
.command(cli_shared_1.Text.feedback.cmd)
|
|
8
|
-
.description(cli_shared_1.Text.feedback.description)
|
|
9
|
-
.action(async () => {
|
|
10
|
-
ui.info(cli_shared_1.Text.feedback.action.start);
|
|
11
|
-
const feedback = await ui.promptForText(cli_shared_1.Text.feedback.action.enterFeedbackPrompt);
|
|
12
|
-
if (!feedback || 0 === feedback.trim().length)
|
|
13
|
-
return;
|
|
14
|
-
ui.emptyLine();
|
|
15
|
-
try {
|
|
16
|
-
await ui.displayProgress(() => feedbackController.sendFeedback(feedback), cli_shared_1.Text.feedback.action.sendingFeedbackProgress, (result) => {
|
|
17
|
-
const successful = result.status == 200;
|
|
18
|
-
return {
|
|
19
|
-
successful,
|
|
20
|
-
message: successful ? cli_shared_1.Text.feedback.action.success : cli_shared_1.Text.feedback.action.error
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
catch (e) {
|
|
25
|
-
throw new Error(cli_shared_1.Text.feedback.action.error);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
exports.registerCommands = (deps) => {
|
|
30
|
-
registerFeedbackCommands(deps);
|
|
31
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Dependencies } from './dependency-injection';
|
|
2
|
-
import { Installation } from '../service/installation-service';
|
|
3
|
-
export declare const performSingleUninstall: (installId: string, { ui, commands: { uninstallAppCommand } }: Dependencies) => Promise<void>;
|
|
4
|
-
export declare const performMultipleUninstalls: (appsToUninstall: Installation[], { ui, commands: { uninstallAppCommand } }: Dependencies) => Promise<void>;
|
|
5
|
-
export declare const registerCommands: ({ cmd, ...deps }: Dependencies) => void;
|
|
6
|
-
//# sourceMappingURL=register-installation-commands.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register-installation-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-installation-commands.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AA2D/D,eAAO,MAAM,sBAAsB,cACtB,MAAM,6CAC0B,YAAY,kBAwBxD,CAAC;AAEF,eAAO,MAAM,yBAAyB,oBACnB,YAAY,EAAE,6CACY,YAAY,kBA+CxD,CAAC;AAgEF,eAAO,MAAM,gBAAgB,qBAAsB,YAAY,KAAG,IAejE,CAAC"}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerCommands = exports.performMultipleUninstalls = exports.performSingleUninstall = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const cli_table3_1 = tslib_1.__importDefault(require("cli-table3"));
|
|
6
|
-
const cli_shared_1 = require("@forge/cli-shared");
|
|
7
|
-
const cli_shared_2 = require("@forge/cli-shared");
|
|
8
|
-
const shared_1 = require("../installations/shared");
|
|
9
|
-
const errors_1 = require("./errors");
|
|
10
|
-
const COMMAND_NAME = 'install';
|
|
11
|
-
const registerInstallAppCommand = ({ cmd, controllers: { installController } }) => {
|
|
12
|
-
cmd
|
|
13
|
-
.requireAppId()
|
|
14
|
-
.environmentOption()
|
|
15
|
-
.siteAndProductOption()
|
|
16
|
-
.option('--upgrade', cli_shared_2.Text.install.optionUpgrade)
|
|
17
|
-
.option('--confirm-scopes', cli_shared_2.Text.install.optionConfirmScopes)
|
|
18
|
-
.nonInteractiveOption('--site', '--product', '--environment')
|
|
19
|
-
.description(cli_shared_2.Text.install.cmd.description)
|
|
20
|
-
.action(async ({ environment, site, product, upgrade, confirmScopes, nonInteractive }) => {
|
|
21
|
-
await installController.run({ environment, site, product, upgrade, confirmScopes, nonInteractive });
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
const LIST_COMMAND_NAME = 'list';
|
|
25
|
-
const registerListInstallationsCommand = ({ cmd, ui, services: { installationsService } }) => {
|
|
26
|
-
cmd
|
|
27
|
-
.command(LIST_COMMAND_NAME)
|
|
28
|
-
.requireAppId()
|
|
29
|
-
.description(cli_shared_2.Text.installList.cmd)
|
|
30
|
-
.action(async () => {
|
|
31
|
-
const { installations } = await installationsService.listAppInstallations();
|
|
32
|
-
if (!installations.length) {
|
|
33
|
-
ui.info(cli_shared_2.Text.installList.noInstallations);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const table = new cli_table3_1.default(Object.assign(Object.assign({}, cli_shared_2.TableStyle.default), { head: ['Installation ID', 'Environment', 'Site', 'Product', 'Version'] }));
|
|
37
|
-
for (const { id, environmentKey, product, site, version: { isLatest } } of installations) {
|
|
38
|
-
table.push([
|
|
39
|
-
id,
|
|
40
|
-
cli_shared_1.environmentToOption(environmentKey),
|
|
41
|
-
site,
|
|
42
|
-
cli_shared_1.capitalizeProduct(product),
|
|
43
|
-
cli_shared_2.Text.install.booleanToScope(isLatest)
|
|
44
|
-
]);
|
|
45
|
-
}
|
|
46
|
-
ui.info(cli_shared_2.Text.installList.banner);
|
|
47
|
-
ui.info(table.toString());
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
exports.performSingleUninstall = async (installId, { ui, commands: { uninstallAppCommand } }) => {
|
|
51
|
-
const installation = await ui.displayProgress(() => uninstallAppCommand.execute(installId), cli_shared_2.Text.uninstall.cmd.start, (result) => ({
|
|
52
|
-
successful: !!result.successful,
|
|
53
|
-
message: cli_shared_2.Text.uninstall.cmd.success(false)
|
|
54
|
-
}));
|
|
55
|
-
const uninstallMessageFormat = installation.successful ? cli_shared_2.Text.uninstall.done : cli_shared_2.Text.uninstall.failed;
|
|
56
|
-
const uninstallMessage = uninstallMessageFormat(cli_shared_1.capitalizeProduct(installation.product), installation.site, installation.environmentKey, cli_shared_1.environmentToOption, false);
|
|
57
|
-
if (installation.successful) {
|
|
58
|
-
ui.info(uninstallMessage);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
ui.error(new shared_1.UninstallAppError(uninstallMessage));
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
exports.performMultipleUninstalls = async (appsToUninstall, { ui, commands: { uninstallAppCommand } }) => {
|
|
65
|
-
const filteredInstallations = appsToUninstall.filter(({ product }) => product !== 'identity');
|
|
66
|
-
const hasMultipleNonIdentityApps = filteredInstallations.length > 1;
|
|
67
|
-
const uninstalledApps = await ui.displayProgress(() => uninstallAppCommand.batchExecute([], appsToUninstall), cli_shared_2.Text.uninstall.cmd.start, (result) => {
|
|
68
|
-
const isSuccessful = !result.some(({ successful }) => successful === false);
|
|
69
|
-
return {
|
|
70
|
-
successful: isSuccessful,
|
|
71
|
-
message: cli_shared_2.Text.uninstall.cmd.success(hasMultipleNonIdentityApps)
|
|
72
|
-
};
|
|
73
|
-
});
|
|
74
|
-
const deferredErrors = [];
|
|
75
|
-
uninstalledApps.forEach((uninstall) => {
|
|
76
|
-
const uninstallMessageFormat = uninstall.successful ? cli_shared_2.Text.uninstall.done : cli_shared_2.Text.uninstall.failed;
|
|
77
|
-
const formattedMessage = uninstallMessageFormat(cli_shared_1.capitalizeProduct(uninstall.product), uninstall.site, uninstall.environmentKey, cli_shared_1.environmentToOption, hasMultipleNonIdentityApps);
|
|
78
|
-
if (uninstall.successful && uninstall.product !== 'identity') {
|
|
79
|
-
ui.info(formattedMessage);
|
|
80
|
-
}
|
|
81
|
-
else if (!uninstall.successful) {
|
|
82
|
-
const uninstallError = new shared_1.UninstallAppError(formattedMessage);
|
|
83
|
-
ui.error(uninstallError);
|
|
84
|
-
deferredErrors.push(uninstallError);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
if (uninstalledApps.some(({ successful }) => successful === false)) {
|
|
88
|
-
throw new errors_1.DeferredErrors(deferredErrors);
|
|
89
|
-
}
|
|
90
|
-
if (hasMultipleNonIdentityApps) {
|
|
91
|
-
ui.info(cli_shared_2.Text.uninstall.interactive.done);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
const registerUninstallCommand = (deps) => {
|
|
95
|
-
const { cmd, ui, services: { installationsService } } = deps;
|
|
96
|
-
cmd
|
|
97
|
-
.command('uninstall [installationId]')
|
|
98
|
-
.requireAppId()
|
|
99
|
-
.description(cli_shared_2.Text.uninstall.cmd.desc)
|
|
100
|
-
.action(async (installationId) => {
|
|
101
|
-
const { installations } = await installationsService.listAppInstallations();
|
|
102
|
-
if (!installations.length) {
|
|
103
|
-
ui.info(cli_shared_2.Text.installList.noInstallations);
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
const installId = installationId === null || installationId === void 0 ? void 0 : installationId.trim();
|
|
107
|
-
if (installId && installId.length > 0) {
|
|
108
|
-
ui.info(cli_shared_2.Text.uninstall.info);
|
|
109
|
-
ui.info(cli_shared_2.Text.ctrlC);
|
|
110
|
-
ui.emptyLine();
|
|
111
|
-
await exports.performSingleUninstall(installId, deps);
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
const filteredInstallations = installations.filter((install) => install.product !== 'identity' && install.product !== 'jira-servicedesk');
|
|
115
|
-
const selectedSitesIndexes = await ui.promptForTable(cli_shared_2.Text.uninstall.interactive.desc, cli_shared_2.Text.uninstall.interactive.progressInfo, ['Environment', 'Site', 'Product'], filteredInstallations.map(({ id, environmentKey, product, site }) => ({
|
|
116
|
-
names: [cli_shared_1.environmentToOption(environmentKey), site, cli_shared_1.capitalizeProduct(product)],
|
|
117
|
-
value: id
|
|
118
|
-
})));
|
|
119
|
-
const appsToUninstall = filteredInstallations.filter((_, index) => selectedSitesIndexes.includes(index));
|
|
120
|
-
const selectedSites = new Set(appsToUninstall.map(({ site }) => site));
|
|
121
|
-
const remainingApps = filteredInstallations.filter((_, index) => !selectedSitesIndexes.includes(index));
|
|
122
|
-
appsToUninstall.push(...shared_1.getHangingIdentityInstallationsFromSite(installations, remainingApps, selectedSites));
|
|
123
|
-
if (appsToUninstall.length > 1) {
|
|
124
|
-
await exports.performMultipleUninstalls(appsToUninstall, deps);
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
await exports.performSingleUninstall(appsToUninstall[0].id, deps);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
const DEPRECATED_LIST_COMMAND = 'install:list';
|
|
133
|
-
exports.registerCommands = (_a) => {
|
|
134
|
-
var { cmd } = _a, deps = tslib_1.__rest(_a, ["cmd"]);
|
|
135
|
-
const install = cmd.command(COMMAND_NAME).description(cli_shared_2.Text.variables.description);
|
|
136
|
-
registerUninstallCommand(Object.assign({ cmd }, deps));
|
|
137
|
-
cmd.deprecatedCommand(DEPRECATED_LIST_COMMAND, `${COMMAND_NAME} ${LIST_COMMAND_NAME}`, deps.controllers.stubController);
|
|
138
|
-
registerInstallAppCommand(Object.assign({ cmd: install }, deps));
|
|
139
|
-
registerListInstallationsCommand(Object.assign({ cmd: install }, deps));
|
|
140
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Dependencies } from './dependency-injection';
|
|
2
|
-
export interface LintActionParams {
|
|
3
|
-
environment: string;
|
|
4
|
-
directory: string;
|
|
5
|
-
fix: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare const registerCommands: ({ cmd, controllers: { lintController } }: Dependencies) => void;
|
|
8
|
-
//# sourceMappingURL=register-lint-command.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register-lint-command.d.ts","sourceRoot":"","sources":["../../src/command-line/register-lint-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAItD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,OAAO,CAAC;CACd;AAED,eAAO,MAAM,gBAAgB,6CAA8C,YAAY,KAAG,IAUzF,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerCommands = void 0;
|
|
4
|
-
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
-
exports.registerCommands = ({ cmd, controllers: { lintController } }) => {
|
|
6
|
-
cmd
|
|
7
|
-
.command('lint')
|
|
8
|
-
.requireManifestFile()
|
|
9
|
-
.description(cli_shared_1.Text.lint.cmd)
|
|
10
|
-
.option('--fix', 'Attempt to automatically fix any issues encountered')
|
|
11
|
-
.environmentOption()
|
|
12
|
-
.action(async ({ environment, fix }) => {
|
|
13
|
-
await lintController.run(environment, fix);
|
|
14
|
-
});
|
|
15
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Dependencies } from './dependency-injection';
|
|
2
|
-
export declare function parseSinceDateTime(dateTime: string | null): string | null;
|
|
3
|
-
export declare const registerCommands: ({ cmd, ui, commands: { viewAppLogsCommand } }: Dependencies) => void;
|
|
4
|
-
//# sourceMappingURL=register-log-commands.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register-log-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-log-commands.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAStD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAczE;AAwFD,eAAO,MAAM,gBAAgB,kDAAmD,YAAY,SAsC3F,CAAC"}
|