@forge/cli 0.0.0-experimental-deeb8f6 → 0.0.0-experimental-c8e9749
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 +1110 -2
- package/npm-shrinkwrap.json +13212 -223
- package/out/analytics-client/analytics-client.d.ts +36 -0
- package/out/analytics-client/analytics-client.d.ts.map +1 -0
- package/out/analytics-client/analytics-client.js +140 -0
- package/out/analytics-client/analytics-message-handler.d.ts +21 -0
- package/out/analytics-client/analytics-message-handler.d.ts.map +1 -0
- package/out/analytics-client/analytics-message-handler.js +43 -0
- package/out/autocomplete/autocomplete-config.json +243 -0
- package/out/autocomplete/index.d.ts +5 -0
- package/out/autocomplete/index.d.ts.map +1 -0
- package/out/autocomplete/index.js +41 -0
- package/out/autocomplete/isSupportedShell.d.ts +2 -0
- package/out/autocomplete/isSupportedShell.d.ts.map +1 -0
- package/out/autocomplete/isSupportedShell.js +11 -0
- package/out/autocomplete/types.d.ts +14 -0
- package/out/autocomplete/types.d.ts.map +1 -0
- package/out/autocomplete/types.js +2 -0
- package/out/autocomplete/util.d.ts +6 -0
- package/out/autocomplete/util.d.ts.map +1 -0
- package/out/autocomplete/util.js +15 -0
- package/out/bin/cli.d.ts +1 -0
- package/out/bin/cli.d.ts.map +1 -1
- package/out/bin/cli.js +4 -1
- package/out/bin/postinstall.d.ts +2 -0
- package/out/bin/postinstall.d.ts.map +1 -0
- package/out/bin/postinstall.js +23 -0
- package/out/command-line/anon-user-id.d.ts +3 -0
- package/out/command-line/anon-user-id.d.ts.map +1 -0
- package/out/command-line/anon-user-id.js +17 -0
- package/out/command-line/command.d.ts +80 -0
- package/out/command-line/command.d.ts.map +1 -0
- package/out/command-line/command.js +408 -0
- package/out/command-line/controller/assertUnreachable.d.ts +2 -0
- package/out/command-line/controller/assertUnreachable.d.ts.map +1 -0
- package/out/command-line/controller/assertUnreachable.js +7 -0
- package/out/command-line/controller/autocomplete-controller.d.ts +12 -0
- package/out/command-line/controller/autocomplete-controller.d.ts.map +1 -0
- package/out/command-line/controller/autocomplete-controller.js +54 -0
- package/out/command-line/controller/deploy-controller.d.ts +42 -0
- package/out/command-line/controller/deploy-controller.d.ts.map +1 -0
- package/out/command-line/controller/deploy-controller.js +139 -0
- package/out/command-line/controller/feedback-controller.d.ts +9 -0
- package/out/command-line/controller/feedback-controller.d.ts.map +1 -0
- package/out/command-line/controller/feedback-controller.js +19 -0
- package/out/command-line/controller/getNodeVersion.d.ts +2 -0
- package/out/command-line/controller/getNodeVersion.d.ts.map +1 -0
- package/out/command-line/controller/getNodeVersion.js +7 -0
- package/out/command-line/controller/install-controller.d.ts +35 -0
- package/out/command-line/controller/install-controller.d.ts.map +1 -0
- package/out/command-line/controller/install-controller.js +157 -0
- package/out/command-line/controller/lint-controller.d.ts +9 -0
- package/out/command-line/controller/lint-controller.d.ts.map +1 -0
- package/out/command-line/controller/lint-controller.js +20 -0
- package/out/command-line/controller/pre-command-controller.d.ts +25 -0
- package/out/command-line/controller/pre-command-controller.d.ts.map +1 -0
- package/out/command-line/controller/pre-command-controller.js +57 -0
- package/out/command-line/controller/prerequisites-controller.d.ts +15 -0
- package/out/command-line/controller/prerequisites-controller.d.ts.map +1 -0
- package/out/command-line/controller/prerequisites-controller.js +41 -0
- package/out/command-line/controller/settings-controller.d.ts +19 -0
- package/out/command-line/controller/settings-controller.d.ts.map +1 -0
- package/out/command-line/controller/settings-controller.js +48 -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 +14 -0
- package/out/command-line/controller/tunnel-controller.d.ts.map +1 -0
- package/out/command-line/controller/tunnel-controller.js +43 -0
- package/out/command-line/dependency-injection.d.ts +76 -0
- package/out/command-line/dependency-injection.d.ts.map +1 -0
- package/out/command-line/dependency-injection.js +211 -0
- package/out/command-line/environment.d.ts +2 -0
- package/out/command-line/environment.d.ts.map +1 -0
- package/out/command-line/environment.js +16 -0
- package/out/command-line/errors.d.ts +6 -0
- package/out/command-line/errors.d.ts.map +1 -0
- package/out/command-line/errors.js +12 -0
- package/out/command-line/index.d.ts +5 -0
- package/out/command-line/index.d.ts.map +1 -0
- package/out/command-line/index.js +73 -0
- package/out/command-line/register-app-commands.d.ts +10 -0
- package/out/command-line/register-app-commands.d.ts.map +1 -0
- package/out/command-line/register-app-commands.js +128 -0
- package/out/command-line/register-authentication-command.d.ts +16 -0
- package/out/command-line/register-authentication-command.d.ts.map +1 -0
- package/out/command-line/register-authentication-command.js +94 -0
- package/out/command-line/register-autocomplete-commands.d.ts +3 -0
- package/out/command-line/register-autocomplete-commands.d.ts.map +1 -0
- package/out/command-line/register-autocomplete-commands.js +14 -0
- package/out/command-line/register-contributors-commands.d.ts +3 -0
- package/out/command-line/register-contributors-commands.d.ts.map +1 -0
- package/out/command-line/register-contributors-commands.js +134 -0
- package/out/command-line/register-deployment-commands.d.ts +22 -0
- package/out/command-line/register-deployment-commands.d.ts.map +1 -0
- package/out/command-line/register-deployment-commands.js +16 -0
- package/out/command-line/register-environment-variables-commands.d.ts +3 -0
- package/out/command-line/register-environment-variables-commands.d.ts.map +1 -0
- package/out/command-line/register-environment-variables-commands.js +103 -0
- package/out/command-line/register-feedback-commands.d.ts +3 -0
- package/out/command-line/register-feedback-commands.d.ts.map +1 -0
- package/out/command-line/register-feedback-commands.js +32 -0
- package/out/command-line/register-installation-commands.d.ts +6 -0
- package/out/command-line/register-installation-commands.d.ts.map +1 -0
- package/out/command-line/register-installation-commands.js +143 -0
- package/out/command-line/register-lint-command.d.ts +8 -0
- package/out/command-line/register-lint-command.d.ts.map +1 -0
- package/out/command-line/register-lint-command.js +16 -0
- package/out/command-line/register-log-commands.d.ts +4 -0
- package/out/command-line/register-log-commands.d.ts.map +1 -0
- package/out/command-line/register-log-commands.js +139 -0
- 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 +44 -0
- package/out/command-line/register-settings-commands.d.ts +3 -0
- package/out/command-line/register-settings-commands.d.ts.map +1 -0
- package/out/command-line/register-settings-commands.js +39 -0
- package/out/command-line/register-tunnel-commands.d.ts +3 -0
- package/out/command-line/register-tunnel-commands.d.ts.map +1 -0
- package/out/command-line/register-tunnel-commands.js +15 -0
- package/out/command-line/register-webtrigger-commands.d.ts +3 -0
- package/out/command-line/register-webtrigger-commands.d.ts.map +1 -0
- package/out/command-line/register-webtrigger-commands.js +56 -0
- package/out/command-line/sentry.d.ts +4 -0
- package/out/command-line/sentry.d.ts.map +1 -0
- package/out/command-line/sentry.js +16 -0
- package/out/command-line/unique-machine-id.d.ts +3 -0
- package/out/command-line/unique-machine-id.d.ts.map +1 -0
- package/out/command-line/unique-machine-id.js +19 -0
- package/out/command-line/version-info.d.ts +9 -0
- package/out/command-line/version-info.d.ts.map +1 -0
- package/out/command-line/version-info.js +42 -0
- package/out/command-line/view/analytics-settings-view.d.ts +7 -0
- package/out/command-line/view/analytics-settings-view.d.ts.map +1 -0
- package/out/command-line/view/analytics-settings-view.js +18 -0
- package/out/command-line/view/deploy-view.d.ts +21 -0
- package/out/command-line/view/deploy-view.d.ts.map +1 -0
- package/out/command-line/view/deploy-view.js +58 -0
- package/out/command-line/view/install-view.d.ts +18 -0
- package/out/command-line/view/install-view.d.ts.map +1 -0
- package/out/command-line/view/install-view.js +56 -0
- package/out/command-line/view/lint-view.d.ts +12 -0
- package/out/command-line/view/lint-view.d.ts.map +1 -0
- package/out/command-line/view/lint-view.js +31 -0
- package/out/command-line/view/lite-lint-view.d.ts +10 -0
- package/out/command-line/view/lite-lint-view.d.ts.map +1 -0
- package/out/command-line/view/lite-lint-view.js +18 -0
- package/out/command-line/view/settings-view.d.ts +10 -0
- package/out/command-line/view/settings-view.d.ts.map +1 -0
- package/out/command-line/view/settings-view.js +26 -0
- package/out/command-line/view/tunnel-view.d.ts +20 -0
- package/out/command-line/view/tunnel-view.d.ts.map +1 -0
- package/out/command-line/view/tunnel-view.js +92 -0
- package/out/contributors/add-contributor.d.ts +17 -0
- package/out/contributors/add-contributor.d.ts.map +1 -0
- package/out/contributors/add-contributor.js +14 -0
- package/out/contributors/graphql-client.d.ts +14 -0
- package/out/contributors/graphql-client.d.ts.map +1 -0
- package/out/contributors/graphql-client.js +113 -0
- package/out/contributors/list-contributors.d.ts +18 -0
- package/out/contributors/list-contributors.d.ts.map +1 -0
- package/out/contributors/list-contributors.js +14 -0
- package/out/contributors/remove-contributors.d.ts +18 -0
- package/out/contributors/remove-contributors.d.ts.map +1 -0
- package/out/contributors/remove-contributors.js +14 -0
- package/out/deploy/deployer/deploy-monitor-graphql-client.d.ts +24 -0
- package/out/deploy/deployer/deploy-monitor-graphql-client.d.ts.map +1 -0
- package/out/deploy/deployer/deploy-monitor-graphql-client.js +57 -0
- package/out/deploy/deployer/deployer.d.ts +40 -0
- package/out/deploy/deployer/deployer.d.ts.map +1 -0
- package/out/deploy/deployer/deployer.js +187 -0
- package/out/deploy/deployer/index.d.ts +4 -0
- package/out/deploy/deployer/index.d.ts.map +1 -0
- package/out/deploy/deployer/index.js +6 -0
- package/out/deploy/deployer/trigger-deploy-graphql-client.d.ts +19 -0
- package/out/deploy/deployer/trigger-deploy-graphql-client.d.ts.map +1 -0
- package/out/deploy/deployer/trigger-deploy-graphql-client.js +49 -0
- package/out/deploy/index.d.ts +5 -0
- package/out/deploy/index.d.ts.map +1 -0
- package/out/deploy/index.js +7 -0
- package/out/deploy/package-upload-deploy.d.ts +20 -0
- package/out/deploy/package-upload-deploy.d.ts.map +1 -0
- package/out/deploy/package-upload-deploy.js +37 -0
- package/out/deploy/packager/archiver.d.ts +27 -0
- package/out/deploy/packager/archiver.d.ts.map +1 -0
- package/out/deploy/packager/archiver.js +76 -0
- package/out/deploy/packager/index.d.ts +3 -0
- package/out/deploy/packager/index.d.ts.map +1 -0
- package/out/deploy/packager/index.js +5 -0
- package/out/deploy/packager/nativeui-bundler.d.ts +12 -0
- package/out/deploy/packager/nativeui-bundler.d.ts.map +1 -0
- package/out/deploy/packager/nativeui-bundler.js +34 -0
- package/out/deploy/packager/packager.d.ts +32 -0
- package/out/deploy/packager/packager.d.ts.map +1 -0
- package/out/deploy/packager/packager.js +21 -0
- package/out/deploy/packager/runtime-bundler.d.ts +15 -0
- package/out/deploy/packager/runtime-bundler.d.ts.map +1 -0
- package/out/deploy/packager/runtime-bundler.js +53 -0
- package/out/deploy/uploader/artifact-graphql-client.d.ts +26 -0
- package/out/deploy/uploader/artifact-graphql-client.d.ts.map +1 -0
- package/out/deploy/uploader/artifact-graphql-client.js +100 -0
- package/out/deploy/uploader/index.d.ts +3 -0
- package/out/deploy/uploader/index.d.ts.map +1 -0
- package/out/deploy/uploader/index.js +5 -0
- package/out/deploy/uploader/uploader.d.ts +19 -0
- package/out/deploy/uploader/uploader.d.ts.map +1 -0
- package/out/deploy/uploader/uploader.js +43 -0
- package/out/environment-variables/delete-environment-variable.d.ts +18 -0
- package/out/environment-variables/delete-environment-variable.d.ts.map +1 -0
- package/out/environment-variables/delete-environment-variable.js +14 -0
- package/out/environment-variables/graphql-client.d.ts +16 -0
- package/out/environment-variables/graphql-client.d.ts.map +1 -0
- package/out/environment-variables/graphql-client.js +113 -0
- package/out/environment-variables/list-environment-variables.d.ts +22 -0
- package/out/environment-variables/list-environment-variables.d.ts.map +1 -0
- package/out/environment-variables/list-environment-variables.js +14 -0
- package/out/environment-variables/set-environment-variable.d.ts +20 -0
- package/out/environment-variables/set-environment-variable.d.ts.map +1 -0
- package/out/environment-variables/set-environment-variable.js +14 -0
- package/out/installations/graphql-client.d.ts +75 -0
- package/out/installations/graphql-client.d.ts.map +1 -0
- package/out/installations/graphql-client.js +423 -0
- package/out/installations/install-app-site.d.ts +21 -0
- package/out/installations/install-app-site.d.ts.map +1 -0
- package/out/installations/install-app-site.js +19 -0
- package/out/installations/shared.d.ts +5 -0
- package/out/installations/shared.d.ts.map +1 -0
- package/out/installations/shared.js +20 -0
- package/out/installations/site-translation/bitbucket.d.ts +24 -0
- package/out/installations/site-translation/bitbucket.d.ts.map +1 -0
- package/out/installations/site-translation/bitbucket.js +113 -0
- package/out/installations/site-translation/cloudid-products.d.ts +17 -0
- package/out/installations/site-translation/cloudid-products.d.ts.map +1 -0
- package/out/installations/site-translation/cloudid-products.js +89 -0
- package/out/installations/site-translation/index.d.ts +4 -0
- package/out/installations/site-translation/index.d.ts.map +1 -0
- package/out/installations/site-translation/index.js +6 -0
- package/out/installations/site-translation/site-translation.d.ts +12 -0
- package/out/installations/site-translation/site-translation.d.ts.map +1 -0
- package/out/installations/site-translation/site-translation.js +2 -0
- package/out/installations/uninstall-app.d.ts +25 -0
- package/out/installations/uninstall-app.d.ts.map +1 -0
- package/out/installations/uninstall-app.js +43 -0
- 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 +8 -0
- package/out/providers/graphql-client.d.ts.map +1 -0
- package/out/providers/graphql-client.js +45 -0
- package/out/service/cached-config-service.d.ts +8 -0
- package/out/service/cached-config-service.d.ts.map +1 -0
- package/out/service/cached-config-service.js +16 -0
- package/out/service/command-suggestion-service.d.ts +4 -0
- package/out/service/command-suggestion-service.d.ts.map +1 -0
- package/out/service/command-suggestion-service.js +17 -0
- package/out/service/docker-service.d.ts +24 -0
- package/out/service/docker-service.d.ts.map +1 -0
- package/out/service/docker-service.js +71 -0
- package/out/service/installation-service.d.ts +51 -0
- package/out/service/installation-service.d.ts.map +1 -0
- package/out/service/installation-service.js +91 -0
- package/out/service/lint-service.d.ts +23 -0
- package/out/service/lint-service.d.ts.map +1 -0
- package/out/service/lint-service.js +39 -0
- package/out/service/lite-lint-service.d.ts +10 -0
- package/out/service/lite-lint-service.d.ts.map +1 -0
- package/out/service/lite-lint-service.js +27 -0
- 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/port-finding-service.d.ts +12 -0
- package/out/service/port-finding-service.d.ts.map +1 -0
- package/out/service/port-finding-service.js +34 -0
- package/out/service/resource-packaging-service.d.ts +46 -0
- package/out/service/resource-packaging-service.d.ts.map +1 -0
- package/out/service/resource-packaging-service.js +132 -0
- package/out/service/resources-uploader-service.d.ts +16 -0
- package/out/service/resources-uploader-service.d.ts.map +1 -0
- package/out/service/resources-uploader-service.js +39 -0
- package/out/service/tunnel-analytics-service.d.ts +11 -0
- package/out/service/tunnel-analytics-service.d.ts.map +1 -0
- package/out/service/tunnel-analytics-service.js +24 -0
- package/out/service/tunnel-service.d.ts +41 -0
- package/out/service/tunnel-service.d.ts.map +1 -0
- package/out/service/tunnel-service.js +196 -0
- package/out/storage/local-file-storage.d.ts +17 -0
- package/out/storage/local-file-storage.d.ts.map +1 -0
- package/out/storage/local-file-storage.js +53 -0
- package/out/webtrigger/get-webtrigger-url.d.ts +27 -0
- package/out/webtrigger/get-webtrigger-url.d.ts.map +1 -0
- package/out/webtrigger/get-webtrigger-url.js +26 -0
- 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/analytics-message-worker.d.ts +12 -0
- package/out/workers/analytics-message-worker.d.ts.map +1 -0
- package/out/workers/analytics-message-worker.js +29 -0
- package/out/workers/forge-cli-workers.d.ts +2 -0
- package/out/workers/forge-cli-workers.d.ts.map +1 -0
- package/out/workers/forge-cli-workers.js +21 -0
- package/out/workers/tunnel-clean-up-worker.d.ts +8 -0
- package/out/workers/tunnel-clean-up-worker.d.ts.map +1 -0
- package/out/workers/tunnel-clean-up-worker.js +31 -0
- package/out/workers/version-check-worker.d.ts +8 -0
- package/out/workers/version-check-worker.d.ts.map +1 -0
- package/out/workers/version-check-worker.js +20 -0
- package/out/workers/worker-info.d.ts +8 -0
- package/out/workers/worker-info.d.ts.map +1 -0
- package/out/workers/worker-info.js +15 -0
- package/out/workers/worker.d.ts +6 -0
- package/out/workers/worker.d.ts.map +1 -0
- package/out/workers/worker.js +9 -0
- package/out/workers/workers-starter.d.ts +5 -0
- package/out/workers/workers-starter.d.ts.map +1 -0
- package/out/workers/workers-starter.js +22 -0
- package/package.json +60 -5
|
@@ -0,0 +1,143 @@
|
|
|
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_shared_1 = require("@forge/cli-shared");
|
|
6
|
+
const shared_1 = require("../installations/shared");
|
|
7
|
+
const errors_1 = require("./errors");
|
|
8
|
+
const COMMAND_NAME = 'install';
|
|
9
|
+
const registerInstallAppCommand = ({ cmd, controllers: { installController } }) => {
|
|
10
|
+
cmd
|
|
11
|
+
.requireAppId()
|
|
12
|
+
.environmentOption()
|
|
13
|
+
.siteAndProductOption()
|
|
14
|
+
.option('--upgrade', cli_shared_1.Text.install.optionUpgrade)
|
|
15
|
+
.option('--confirm-scopes', cli_shared_1.Text.install.optionConfirmScopes)
|
|
16
|
+
.nonInteractiveOption('--site', '--product', '--environment')
|
|
17
|
+
.description(cli_shared_1.Text.install.cmd.description)
|
|
18
|
+
.action(async ({ environment, site, product, upgrade, confirmScopes, nonInteractive }) => {
|
|
19
|
+
await installController.run({ environment, site, product, upgrade, confirmScopes, nonInteractive });
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
const LIST_COMMAND_NAME = 'list';
|
|
23
|
+
const registerListInstallationsCommand = ({ cmd, ui, services: { installationsService } }) => {
|
|
24
|
+
cmd
|
|
25
|
+
.command(LIST_COMMAND_NAME)
|
|
26
|
+
.requireAppId()
|
|
27
|
+
.jsonOption()
|
|
28
|
+
.description(cli_shared_1.Text.installList.cmd)
|
|
29
|
+
.action(async ({ json }) => {
|
|
30
|
+
const { installations } = await installationsService.listAppInstallations();
|
|
31
|
+
ui.table([
|
|
32
|
+
['id', 'Installation ID'],
|
|
33
|
+
['environment', 'Environment'],
|
|
34
|
+
['site', 'Site'],
|
|
35
|
+
['product', 'Product'],
|
|
36
|
+
['version', 'Version']
|
|
37
|
+
], installations.map(({ id, environmentKey, product, site, version: { isLatest } }) => ({
|
|
38
|
+
id,
|
|
39
|
+
environment: (0, cli_shared_1.environmentToOption)(environmentKey),
|
|
40
|
+
site,
|
|
41
|
+
product: (0, cli_shared_1.capitalizeProduct)(product),
|
|
42
|
+
version: cli_shared_1.Text.install.booleanToScope(isLatest)
|
|
43
|
+
})), {
|
|
44
|
+
json,
|
|
45
|
+
emptyMessage: cli_shared_1.Text.installList.noInstallations,
|
|
46
|
+
preMessage: cli_shared_1.Text.installList.banner
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
const performSingleUninstall = async (installId, { ui, commands: { uninstallAppCommand } }) => {
|
|
51
|
+
const installation = await ui.displayProgress(() => uninstallAppCommand.execute(installId), cli_shared_1.Text.uninstall.cmd.start, (result) => ({
|
|
52
|
+
successful: !!result.successful,
|
|
53
|
+
message: cli_shared_1.Text.uninstall.cmd.success(false)
|
|
54
|
+
}));
|
|
55
|
+
const uninstallMessageFormat = installation.successful ? cli_shared_1.Text.uninstall.done : cli_shared_1.Text.uninstall.failed;
|
|
56
|
+
const uninstallMessage = uninstallMessageFormat((0, 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.performSingleUninstall = performSingleUninstall;
|
|
65
|
+
const performMultipleUninstalls = async (appsToUninstall, { ui, commands: { uninstallAppCommand } }) => {
|
|
66
|
+
const filteredInstallations = appsToUninstall.filter(({ product }) => product !== 'identity');
|
|
67
|
+
const hasMultipleNonIdentityApps = filteredInstallations.length > 1;
|
|
68
|
+
const uninstalledApps = await ui.displayProgress(() => uninstallAppCommand.batchExecute([], appsToUninstall), cli_shared_1.Text.uninstall.cmd.start, (result) => {
|
|
69
|
+
const isSuccessful = !result.some(({ successful }) => successful === false);
|
|
70
|
+
return {
|
|
71
|
+
successful: isSuccessful,
|
|
72
|
+
message: cli_shared_1.Text.uninstall.cmd.success(hasMultipleNonIdentityApps)
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
const deferredErrors = [];
|
|
76
|
+
uninstalledApps.forEach((uninstall) => {
|
|
77
|
+
const uninstallMessageFormat = uninstall.successful ? cli_shared_1.Text.uninstall.done : cli_shared_1.Text.uninstall.failed;
|
|
78
|
+
const formattedMessage = uninstallMessageFormat((0, cli_shared_1.capitalizeProduct)(uninstall.product), uninstall.site, uninstall.environmentKey, cli_shared_1.environmentToOption, hasMultipleNonIdentityApps);
|
|
79
|
+
if (uninstall.successful && uninstall.product !== 'identity') {
|
|
80
|
+
ui.info(formattedMessage);
|
|
81
|
+
}
|
|
82
|
+
else if (!uninstall.successful) {
|
|
83
|
+
const uninstallError = new shared_1.UninstallAppError(formattedMessage);
|
|
84
|
+
ui.error(uninstallError);
|
|
85
|
+
deferredErrors.push(uninstallError);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
if (uninstalledApps.some(({ successful }) => successful === false)) {
|
|
89
|
+
throw new errors_1.DeferredErrors(deferredErrors);
|
|
90
|
+
}
|
|
91
|
+
if (hasMultipleNonIdentityApps) {
|
|
92
|
+
ui.info(cli_shared_1.Text.uninstall.interactive.done);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
exports.performMultipleUninstalls = performMultipleUninstalls;
|
|
96
|
+
const registerUninstallCommand = (deps) => {
|
|
97
|
+
const { cmd, ui, services: { installationsService } } = deps;
|
|
98
|
+
cmd
|
|
99
|
+
.command('uninstall [installationId]')
|
|
100
|
+
.requireAppId()
|
|
101
|
+
.description(cli_shared_1.Text.uninstall.cmd.desc)
|
|
102
|
+
.action(async (installationId) => {
|
|
103
|
+
const { installations } = await installationsService.listAppInstallations();
|
|
104
|
+
if (!installations.length) {
|
|
105
|
+
ui.info(cli_shared_1.Text.installList.noInstallations);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const installId = installationId === null || installationId === void 0 ? void 0 : installationId.trim();
|
|
109
|
+
if (installId && installId.length > 0) {
|
|
110
|
+
ui.info(cli_shared_1.Text.uninstall.info);
|
|
111
|
+
ui.info(cli_shared_1.Text.ctrlC);
|
|
112
|
+
ui.emptyLine();
|
|
113
|
+
await (0, exports.performSingleUninstall)(installId, deps);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
const filteredInstallations = installations.filter((install) => install.product !== 'identity' && install.product !== 'jira-servicedesk');
|
|
117
|
+
const selectedSitesIndexes = await ui.promptForTable(cli_shared_1.Text.uninstall.interactive.desc, cli_shared_1.Text.uninstall.interactive.progressInfo, ['Environment', 'Site', 'Product'], filteredInstallations.map(({ id, environmentKey, product, site }) => ({
|
|
118
|
+
names: [(0, cli_shared_1.environmentToOption)(environmentKey), site, (0, cli_shared_1.capitalizeProduct)(product)],
|
|
119
|
+
value: id
|
|
120
|
+
})));
|
|
121
|
+
const appsToUninstall = filteredInstallations.filter((_, index) => selectedSitesIndexes.includes(index));
|
|
122
|
+
const selectedSites = new Set(appsToUninstall.map(({ site }) => site));
|
|
123
|
+
const remainingApps = filteredInstallations.filter((_, index) => !selectedSitesIndexes.includes(index));
|
|
124
|
+
appsToUninstall.push(...(0, shared_1.getHangingIdentityInstallationsFromSite)(installations, remainingApps, selectedSites));
|
|
125
|
+
if (appsToUninstall.length > 1) {
|
|
126
|
+
await (0, exports.performMultipleUninstalls)(appsToUninstall, deps);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
await (0, exports.performSingleUninstall)(appsToUninstall[0].id, deps);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
const DEPRECATED_LIST_COMMAND = 'install:list';
|
|
135
|
+
const registerCommands = (_a) => {
|
|
136
|
+
var { cmd } = _a, deps = tslib_1.__rest(_a, ["cmd"]);
|
|
137
|
+
const install = cmd.command(COMMAND_NAME).description(cli_shared_1.Text.variables.description);
|
|
138
|
+
registerUninstallCommand(Object.assign({ cmd }, deps));
|
|
139
|
+
cmd.deprecatedCommand(DEPRECATED_LIST_COMMAND, `${COMMAND_NAME} ${LIST_COMMAND_NAME}`, deps.controllers.stubController);
|
|
140
|
+
registerInstallAppCommand(Object.assign({ cmd: install }, deps));
|
|
141
|
+
registerListInstallationsCommand(Object.assign({ cmd: install }, deps));
|
|
142
|
+
};
|
|
143
|
+
exports.registerCommands = registerCommands;
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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 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
|
+
};
|
|
16
|
+
exports.registerCommands = registerCommands;
|
|
@@ -0,0 +1,4 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerCommands = exports.parseSinceDateTime = 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 dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
10
|
+
const utc_1 = tslib_1.__importDefault(require("dayjs/plugin/utc"));
|
|
11
|
+
dayjs_1.default.extend(utc_1.default);
|
|
12
|
+
const DEFAULT_LIMIT = 20;
|
|
13
|
+
function parseLimit(limit) {
|
|
14
|
+
const limitNumber = parseInt(limit, 10) || DEFAULT_LIMIT;
|
|
15
|
+
return limitNumber > 0 ? limitNumber : DEFAULT_LIMIT;
|
|
16
|
+
}
|
|
17
|
+
function parseSinceDateTime(dateTime) {
|
|
18
|
+
let parsed;
|
|
19
|
+
if (dateTime) {
|
|
20
|
+
const since = ['m', 'h', 'd'].includes(dateTime[dateTime.length - 1]);
|
|
21
|
+
if (since) {
|
|
22
|
+
parsed = (0, dayjs_1.default)().subtract(parseInt(dateTime.replace(/\D/g, ''), 10), dateTime.replace(/\d/g, ''));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
parsed = dayjs_1.default.utc(dateTime);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return (parsed === null || parsed === void 0 ? void 0 : parsed.isValid()) ? parsed.toISOString() : null;
|
|
29
|
+
}
|
|
30
|
+
exports.parseSinceDateTime = parseSinceDateTime;
|
|
31
|
+
function combineLogParts(message, other) {
|
|
32
|
+
if (other) {
|
|
33
|
+
return message ? [message, ...other] : other;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return [message];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function logFlat(logger, { id, appVersion, function: fn, trigger, logs }) {
|
|
40
|
+
logs.forEach(({ timestamp, level, message, other }) => {
|
|
41
|
+
logger.info((0, cli_shared_2.formatRuntimeLogLevel)(level) +
|
|
42
|
+
' ' +
|
|
43
|
+
timestamp +
|
|
44
|
+
' ' +
|
|
45
|
+
id +
|
|
46
|
+
' ' +
|
|
47
|
+
(0, cli_shared_2.formatRuntimeLogArgs)(combineLogParts(message, other)));
|
|
48
|
+
logger.debug(` App version: ${appVersion}`);
|
|
49
|
+
if (fn) {
|
|
50
|
+
logger.debug(` Function name: ${fn}`);
|
|
51
|
+
}
|
|
52
|
+
if (trigger) {
|
|
53
|
+
logger.debug(` Function trigger: ${trigger}`);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function logGrouped(logger, { id, appVersion, function: fn, trigger, logs }) {
|
|
58
|
+
if (logger.debugEnabled) {
|
|
59
|
+
const table = new cli_table3_1.default(cli_shared_1.TableStyle.runtimeLog);
|
|
60
|
+
table.push({ 'App version': appVersion });
|
|
61
|
+
table.push({ 'Invocation ID': id });
|
|
62
|
+
if (fn) {
|
|
63
|
+
table.push({ 'Function name': fn });
|
|
64
|
+
}
|
|
65
|
+
if (trigger) {
|
|
66
|
+
table.push({ 'Function trigger': trigger });
|
|
67
|
+
}
|
|
68
|
+
logger.debug(table.toString());
|
|
69
|
+
logger.debug('');
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
logger.info(cli_shared_1.LogColor.debug(`invocation: ${id}`));
|
|
73
|
+
}
|
|
74
|
+
logs.forEach(({ timestamp, level, message, other }) => {
|
|
75
|
+
if (logger.debugEnabled) {
|
|
76
|
+
logger.info((0, cli_shared_2.formatRuntimeLogLevel)(level) +
|
|
77
|
+
' ' +
|
|
78
|
+
timestamp +
|
|
79
|
+
' ' +
|
|
80
|
+
id +
|
|
81
|
+
' ' +
|
|
82
|
+
(0, cli_shared_2.formatRuntimeLogArgs)(combineLogParts(message, other)));
|
|
83
|
+
logger.debug(` App version: ${appVersion}`);
|
|
84
|
+
if (fn) {
|
|
85
|
+
logger.debug(` Function name: ${fn}`);
|
|
86
|
+
}
|
|
87
|
+
if (trigger) {
|
|
88
|
+
logger.debug(` Function trigger: ${trigger}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
logger.info((0, cli_shared_2.formatRuntimeLogLevel)(level) +
|
|
93
|
+
' ' +
|
|
94
|
+
timestamp.split('T')[1] +
|
|
95
|
+
' ' +
|
|
96
|
+
(0, cli_shared_2.formatRuntimeLogArgs)(combineLogParts(message, other)));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
logger.info('');
|
|
100
|
+
}
|
|
101
|
+
function logInvocation(logger, invocation, grouped) {
|
|
102
|
+
grouped ? logGrouped(logger, invocation) : logFlat(logger, invocation);
|
|
103
|
+
}
|
|
104
|
+
const registerCommands = ({ cmd, ui, commands: { viewAppLogsCommand } }) => {
|
|
105
|
+
cmd
|
|
106
|
+
.command('logs')
|
|
107
|
+
.requireAppId()
|
|
108
|
+
.description(cli_shared_3.Text.logs.cmd)
|
|
109
|
+
.environmentOption()
|
|
110
|
+
.option('-i, --invocation <invocation>', cli_shared_3.Text.logs.optionInvocation)
|
|
111
|
+
.option('-n, --limit <limit>', cli_shared_3.Text.logs.optionLimit, parseLimit, DEFAULT_LIMIT)
|
|
112
|
+
.option('-s, --since <since>', cli_shared_3.Text.logs.optionSince)
|
|
113
|
+
.option('-g, --grouped', cli_shared_3.Text.logs.optionGroup)
|
|
114
|
+
.action(async ({ environment, site, product, invocation, limit, grouped, since }) => {
|
|
115
|
+
const context = site && product ? { site, product } : undefined;
|
|
116
|
+
if (invocation) {
|
|
117
|
+
const log = await viewAppLogsCommand.getOne({
|
|
118
|
+
environmentKey: environment,
|
|
119
|
+
context,
|
|
120
|
+
invocationId: invocation
|
|
121
|
+
});
|
|
122
|
+
logInvocation(ui, log, grouped);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
const startTime = parseSinceDateTime(since);
|
|
126
|
+
if (since && !startTime) {
|
|
127
|
+
ui.warn(cli_shared_3.Text.logs.invalidSinceOption(since));
|
|
128
|
+
}
|
|
129
|
+
const logs = await viewAppLogsCommand.getAll({
|
|
130
|
+
environmentKey: environment,
|
|
131
|
+
context,
|
|
132
|
+
limit,
|
|
133
|
+
startTime
|
|
134
|
+
});
|
|
135
|
+
[...logs].reverse().forEach((log) => logInvocation(ui, log, grouped));
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
exports.registerCommands = registerCommands;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-providers-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-providers-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AA8DtD,eAAO,MAAM,gBAAgB,SAAU,YAAY,KAAG,IAErD,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 cli_shared_2 = require("@forge/cli-shared");
|
|
6
|
+
const registerConfigureProviderCommand = ({ cmd, ui, commands: { configureProviderCommand }, configFile }) => {
|
|
7
|
+
cmd
|
|
8
|
+
.command('providers')
|
|
9
|
+
.description(cli_shared_1.Text.providers.desc)
|
|
10
|
+
.command('configure [providerKey]')
|
|
11
|
+
.requireAppId()
|
|
12
|
+
.description(cli_shared_1.Text.configureProvider.cmd.desc)
|
|
13
|
+
.option('-s, --oauth-client-secret [oauthClientSecret]', cli_shared_1.Text.configureProvider.optionClientSecret)
|
|
14
|
+
.environmentOption()
|
|
15
|
+
.action(async (providerKey, { environment, oauthClientSecret }) => {
|
|
16
|
+
ui.info(cli_shared_1.Text.configureProvider.overview(environment, cli_shared_2.environmentToOption));
|
|
17
|
+
ui.info(cli_shared_1.Text.ctrlC);
|
|
18
|
+
ui.emptyLine();
|
|
19
|
+
const availableProviders = await configFile.getAuthProviders();
|
|
20
|
+
if (!providerKey || !availableProviders[providerKey]) {
|
|
21
|
+
const providersList = Object.values(availableProviders);
|
|
22
|
+
if (providersList.length === 0) {
|
|
23
|
+
ui.info(cli_shared_1.Text.configureProvider.noProviders);
|
|
24
|
+
ui.emptyLine();
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const providerIndex = await ui.promptForSingleChoiceTable(cli_shared_1.Text.configureProvider.promptProviderKey, cli_shared_1.Text.configureProvider.providerKeyInfo, ['Provider Key', 'Provider Name'], providersList.map(({ key, name }) => ({
|
|
28
|
+
names: [key, name],
|
|
29
|
+
value: key,
|
|
30
|
+
primary: name
|
|
31
|
+
})));
|
|
32
|
+
providerKey = providersList[providerIndex].key;
|
|
33
|
+
}
|
|
34
|
+
if (!oauthClientSecret) {
|
|
35
|
+
oauthClientSecret = await ui.promptForSecret(cli_shared_1.Text.configureProvider.promptClientSecret);
|
|
36
|
+
ui.emptyLine();
|
|
37
|
+
}
|
|
38
|
+
await ui.displayProgress(() => configureProviderCommand.execute({ environment, providerKey, clientSecret: oauthClientSecret }), cli_shared_1.Text.configureProvider.cmd.start, cli_shared_1.Text.configureProvider.cmd.success);
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
const registerCommands = (deps) => {
|
|
42
|
+
registerConfigureProviderCommand(deps);
|
|
43
|
+
};
|
|
44
|
+
exports.registerCommands = registerCommands;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-settings-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-settings-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAgCtD,eAAO,MAAM,gBAAgB,qBAAsB,YAAY,SAK9D,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerCommands = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const cli_shared_1 = require("@forge/cli-shared");
|
|
6
|
+
const settings_controller_1 = require("./controller/settings-controller");
|
|
7
|
+
const COMMAND_NAME = 'settings';
|
|
8
|
+
const SHOW_COMMAND_NAME = 'list';
|
|
9
|
+
const SET_COMMAND_NAME = 'set <setting> <boolean>';
|
|
10
|
+
const registerSettingsList = ({ cmd, controllers: { settingsController } }) => {
|
|
11
|
+
cmd
|
|
12
|
+
.command(SHOW_COMMAND_NAME)
|
|
13
|
+
.description(cli_shared_1.Text.settings.list.description)
|
|
14
|
+
.requireNoAuthentication()
|
|
15
|
+
.requireNoAnalyticsConsent()
|
|
16
|
+
.jsonOption()
|
|
17
|
+
.action(async ({ json }) => {
|
|
18
|
+
settingsController.showSettings(json);
|
|
19
|
+
return { analytics: {} };
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
const registerSettingsSet = ({ cmd, controllers: { settingsController } }) => {
|
|
23
|
+
cmd
|
|
24
|
+
.command(SET_COMMAND_NAME)
|
|
25
|
+
.description(cli_shared_1.Text.settings.set.description(settings_controller_1.ALLOWED_SETTINGS))
|
|
26
|
+
.requireNoAuthentication()
|
|
27
|
+
.requireNoAnalyticsConsent()
|
|
28
|
+
.action(async (preference, value) => {
|
|
29
|
+
settingsController.setSettings(preference, value);
|
|
30
|
+
return { analytics: {} };
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
const registerCommands = (_a) => {
|
|
34
|
+
var { cmd } = _a, deps = tslib_1.__rest(_a, ["cmd"]);
|
|
35
|
+
const preferences = cmd.command(COMMAND_NAME).requireNoAuthentication().description(cli_shared_1.Text.settings.description);
|
|
36
|
+
registerSettingsList(Object.assign({ cmd: preferences }, deps));
|
|
37
|
+
registerSettingsSet(Object.assign({ cmd: preferences }, deps));
|
|
38
|
+
};
|
|
39
|
+
exports.registerCommands = registerCommands;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-tunnel-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-tunnel-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,eAAO,MAAM,gBAAgB,mDAAoD,YAAY,KAAG,IAS/F,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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 registerCommands = ({ cmd, ui, controllers: { tunnelController } }) => {
|
|
6
|
+
cmd
|
|
7
|
+
.command('tunnel')
|
|
8
|
+
.requireAppId()
|
|
9
|
+
.description(cli_shared_1.Text.tunnel.cmd)
|
|
10
|
+
.option('-d, --debug', cli_shared_1.Text.tunnel.optionDebugger)
|
|
11
|
+
.action(async (options) => {
|
|
12
|
+
await tunnelController.run(options, ui);
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
exports.registerCommands = registerCommands;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-webtrigger-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-webtrigger-commands.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AA+BtD,eAAO,MAAM,gBAAgB,mFAM1B,YAAY,SA8Bd,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
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 cli_shared_2 = require("@forge/cli-shared");
|
|
6
|
+
const cli_shared_3 = require("@forge/cli-shared");
|
|
7
|
+
const getAvailableWebTriggers = (appConfig) => {
|
|
8
|
+
const output = new Map();
|
|
9
|
+
if (appConfig.modules && appConfig.modules.webtrigger) {
|
|
10
|
+
for (const webtrigger of appConfig.modules.webtrigger) {
|
|
11
|
+
output.set(webtrigger.key, webtrigger.function);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return output;
|
|
15
|
+
};
|
|
16
|
+
async function getValidWebtriggers(configFile) {
|
|
17
|
+
const manifest = await configFile.readConfig();
|
|
18
|
+
const availableWebTriggers = getAvailableWebTriggers(manifest);
|
|
19
|
+
if (!availableWebTriggers.size) {
|
|
20
|
+
throw new cli_shared_3.ValidationError(cli_shared_2.Text.webtrigger.error.noWebtriggers);
|
|
21
|
+
}
|
|
22
|
+
return availableWebTriggers;
|
|
23
|
+
}
|
|
24
|
+
function manifestDefinesTriggers(configFile) {
|
|
25
|
+
return async () => {
|
|
26
|
+
await getValidWebtriggers(configFile);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const registerCommands = ({ cmd, ui, graphqlGateway, configFile, commands: { getWebTriggerURLCommand } }) => {
|
|
30
|
+
const validateWebtriggerKey = async (functionKey) => {
|
|
31
|
+
const availableWebTriggers = await getValidWebtriggers(configFile);
|
|
32
|
+
if (functionKey) {
|
|
33
|
+
if (!availableWebTriggers.has(functionKey)) {
|
|
34
|
+
throw new cli_shared_3.ValidationError(cli_shared_2.Text.webtrigger.error.funcKey);
|
|
35
|
+
}
|
|
36
|
+
return functionKey;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
const options = [...availableWebTriggers.keys()];
|
|
40
|
+
return await ui.promptForList(cli_shared_2.Text.webtrigger.promptFuncKey, options);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
cmd
|
|
44
|
+
.command('webtrigger [installationId]')
|
|
45
|
+
.requireAppId()
|
|
46
|
+
.description(cli_shared_2.Text.webtrigger.cmd)
|
|
47
|
+
.option('-f, --functionKey [function]', cli_shared_2.Text.webtrigger.optionFuncKey)
|
|
48
|
+
.precondition(manifestDefinesTriggers(configFile))
|
|
49
|
+
.action(async (installationId, { functionKey }) => {
|
|
50
|
+
ui.info(cli_shared_2.Text.webtrigger.overviewFuncKey);
|
|
51
|
+
const installId = await (0, cli_shared_1.getInstallationId)(ui, installationId);
|
|
52
|
+
const url = await getWebTriggerURLCommand.execute(installId, await validateWebtriggerKey(functionKey));
|
|
53
|
+
ui.info(cli_shared_2.Text.webtrigger.copy(url));
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
exports.registerCommands = registerCommands;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FeatureFlagService } from '@forge/cli-shared';
|
|
2
|
+
import { CachedConfigService } from 'src/service/cached-config-service';
|
|
3
|
+
export declare function initialiseSentry(featureFlagSerive: FeatureFlagService, cachedConfigService: CachedConfigService): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=sentry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry.d.ts","sourceRoot":"","sources":["../../src/command-line/sentry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAKxE,wBAAsB,gBAAgB,CACpC,iBAAiB,EAAE,kBAAkB,EACrC,mBAAmB,EAAE,mBAAmB,iBASzC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initialiseSentry = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const Sentry = tslib_1.__importStar(require("@sentry/node"));
|
|
6
|
+
const SENTRY_DSN = 'https://9829489b1be84a728351c238c6107a33@api.atlassian.com/sentry-cloud/4504449550843904';
|
|
7
|
+
async function initialiseSentry(featureFlagSerive, cachedConfigService) {
|
|
8
|
+
const enabledSentryFF = await featureFlagSerive.readFlag('forge-cli-enable-sentry');
|
|
9
|
+
if (!enabledSentryFF || !cachedConfigService.getAnalyticsPreferences()) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
Sentry.init({
|
|
13
|
+
dsn: SENTRY_DSN
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
exports.initialiseSentry = initialiseSentry;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unique-machine-id.d.ts","sourceRoot":"","sources":["../../src/command-line/unique-machine-id.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAW9C,eAAO,MAAM,YAAY,QAAO,MACgE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMachineId = exports.FORGE_CLI_PACKAGE = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const uuid_1 = tslib_1.__importDefault(require("uuid"));
|
|
6
|
+
const node_machine_id_1 = require("node-machine-id");
|
|
7
|
+
const cli_shared_1 = require("@forge/cli-shared");
|
|
8
|
+
exports.FORGE_CLI_PACKAGE = '@forge/cli';
|
|
9
|
+
const MACHINE_ID_CACHE_KEY = 'machineId';
|
|
10
|
+
const generateMachineId = () => {
|
|
11
|
+
try {
|
|
12
|
+
return (0, node_machine_id_1.machineIdSync)();
|
|
13
|
+
}
|
|
14
|
+
catch (e) {
|
|
15
|
+
return (0, uuid_1.default)();
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const getMachineId = () => cli_shared_1.CachedConf.getCache(exports.FORGE_CLI_PACKAGE).cached(MACHINE_ID_CACHE_KEY, generateMachineId);
|
|
19
|
+
exports.getMachineId = getMachineId;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const VERSION_CACHE_KEY = "latest";
|
|
2
|
+
export declare const VERSION_CACHE_INTERVAL: number;
|
|
3
|
+
import { CLIDetails } from '@forge/cli-shared';
|
|
4
|
+
export declare const getCLIDetails: () => CLIDetails | undefined;
|
|
5
|
+
export declare const semverSupportedNodeVersion: string;
|
|
6
|
+
export declare const humanReadableSupportedNodeVersion: string;
|
|
7
|
+
export declare const cacheLatestVersion: (name: string) => Promise<void>;
|
|
8
|
+
export declare const clearVersionCache: (name: string) => void;
|
|
9
|
+
//# sourceMappingURL=version-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-info.d.ts","sourceRoot":"","sources":["../../src/command-line/version-info.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAC1C,eAAO,MAAM,sBAAsB,QAAsB,CAAC;AAE1D,OAAO,EAAc,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE3D,eAAO,MAAM,aAAa,QAAO,UAAU,GAAG,SAgB7C,CAAC;AAGF,eAAO,MAAM,0BAA0B,QAA+D,CAAC;AACvG,eAAO,MAAM,iCAAiC,QAGL,CAAC;AAE1C,eAAO,MAAM,kBAAkB,SAAgB,MAAM,KAAG,QAAQ,IAAI,CAInE,CAAC;AAEF,eAAO,MAAM,iBAAiB,SAAU,MAAM,SAG7C,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clearVersionCache = exports.cacheLatestVersion = exports.humanReadableSupportedNodeVersion = exports.semverSupportedNodeVersion = exports.getCLIDetails = exports.VERSION_CACHE_INTERVAL = exports.VERSION_CACHE_KEY = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const latest_version_1 = tslib_1.__importDefault(require("latest-version"));
|
|
6
|
+
exports.VERSION_CACHE_KEY = 'latest';
|
|
7
|
+
exports.VERSION_CACHE_INTERVAL = 1000 * 60 * 60 * 24;
|
|
8
|
+
const cli_shared_1 = require("@forge/cli-shared");
|
|
9
|
+
const getCLIDetails = () => {
|
|
10
|
+
try {
|
|
11
|
+
const packageInfo = require('../../package.json');
|
|
12
|
+
const cachedConf = cli_shared_1.CachedConf.getCache(packageInfo.name);
|
|
13
|
+
const latest = cachedConf.get(exports.VERSION_CACHE_KEY);
|
|
14
|
+
return {
|
|
15
|
+
name: packageInfo.name,
|
|
16
|
+
version: packageInfo.version,
|
|
17
|
+
latest: latest,
|
|
18
|
+
compatibleNodeVersion: packageInfo.engines.node
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
catch (_a) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.getCLIDetails = getCLIDetails;
|
|
26
|
+
const supportedNodeMajorVersions = [14, 16, 18];
|
|
27
|
+
exports.semverSupportedNodeVersion = supportedNodeMajorVersions.map((v) => `${v}.x`).join(' || ');
|
|
28
|
+
exports.humanReadableSupportedNodeVersion = supportedNodeMajorVersions
|
|
29
|
+
.map((v) => `${v}.x`)
|
|
30
|
+
.join(', ')
|
|
31
|
+
.replace(/^(.*)?,\s(.*)$/g, '$1 or $2');
|
|
32
|
+
const cacheLatestVersion = async (name) => {
|
|
33
|
+
const latest = await (0, latest_version_1.default)(name);
|
|
34
|
+
const cachedConf = cli_shared_1.CachedConf.getCache(name);
|
|
35
|
+
cachedConf.set(exports.VERSION_CACHE_KEY, latest, exports.VERSION_CACHE_INTERVAL);
|
|
36
|
+
};
|
|
37
|
+
exports.cacheLatestVersion = cacheLatestVersion;
|
|
38
|
+
const clearVersionCache = (name) => {
|
|
39
|
+
const cachedConf = cli_shared_1.CachedConf.getCache(name);
|
|
40
|
+
cachedConf.delete(exports.VERSION_CACHE_KEY);
|
|
41
|
+
};
|
|
42
|
+
exports.clearVersionCache = clearVersionCache;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics-settings-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/analytics-settings-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAK7C,qBAAa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,EAAE;IAEtB,mBAAmB,IAAI,OAAO,CAAC,OAAO,CAAC;CAOrD"}
|