@forge/cli 0.0.0-experimental-e8bfa83 → 0.0.0-experimental-c3effe3
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 +3781 -7
- package/README.md +18 -19
- package/npm-shrinkwrap.json +2709 -3555
- package/out/analytics-client/analytics-client.d.ts +3 -1
- package/out/analytics-client/analytics-client.d.ts.map +1 -1
- package/out/analytics-client/analytics-client.js +5 -1
- package/out/autocomplete/autocomplete-config.json +24 -20
- 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/bin/cli.js +0 -2
- package/out/bin/postinstall.js +9 -2
- package/out/command-line/anon-user-id.js +6 -10
- package/out/command-line/command.d.ts +27 -8
- package/out/command-line/command.d.ts.map +1 -1
- package/out/command-line/command.js +188 -50
- package/out/command-line/controller/autocomplete-controller.d.ts +1 -0
- package/out/command-line/controller/autocomplete-controller.d.ts.map +1 -1
- package/out/command-line/controller/autocomplete-controller.js +11 -1
- package/out/command-line/controller/deploy-controller.d.ts +13 -2
- package/out/command-line/controller/deploy-controller.d.ts.map +1 -1
- package/out/command-line/controller/deploy-controller.js +79 -5
- 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 +5 -4
- package/out/command-line/controller/install-controller.d.ts.map +1 -1
- package/out/command-line/controller/install-controller.js +31 -56
- package/out/command-line/controller/lint-controller.js +1 -1
- package/out/command-line/controller/pre-command-controller.d.ts +8 -1
- package/out/command-line/controller/pre-command-controller.d.ts.map +1 -1
- package/out/command-line/controller/pre-command-controller.js +22 -2
- package/out/command-line/controller/prerequisites-controller.d.ts +11 -0
- package/out/command-line/controller/prerequisites-controller.d.ts.map +1 -0
- package/out/command-line/controller/prerequisites-controller.js +34 -0
- package/out/command-line/controller/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/dependency-injection.d.ts +13 -3
- package/out/command-line/dependency-injection.d.ts.map +1 -1
- package/out/command-line/dependency-injection.js +52 -22
- package/out/command-line/index.d.ts.map +1 -1
- package/out/command-line/index.js +10 -30
- package/out/command-line/register-app-commands.d.ts.map +1 -1
- package/out/command-line/register-app-commands.js +2 -12
- package/out/command-line/register-authentication-command.d.ts.map +1 -1
- package/out/command-line/register-authentication-command.js +1 -16
- package/out/command-line/register-deployment-commands.d.ts +8 -0
- package/out/command-line/register-deployment-commands.d.ts.map +1 -1
- package/out/command-line/register-deployment-commands.js +1 -0
- package/out/command-line/register-environment-variables-commands.d.ts +1 -1
- package/out/command-line/register-environment-variables-commands.d.ts.map +1 -1
- package/out/command-line/register-environment-variables-commands.js +22 -7
- package/out/command-line/register-installation-commands.d.ts +4 -1
- package/out/command-line/register-installation-commands.d.ts.map +1 -1
- package/out/command-line/register-installation-commands.js +39 -23
- package/out/command-line/register-providers-commands.d.ts +3 -0
- package/out/command-line/register-providers-commands.d.ts.map +1 -0
- package/out/command-line/register-providers-commands.js +43 -0
- package/out/command-line/register-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 +37 -0
- package/out/command-line/register-webtrigger-commands.d.ts.map +1 -1
- package/out/command-line/register-webtrigger-commands.js +9 -11
- package/out/command-line/unique-machine-id.d.ts +1 -0
- package/out/command-line/unique-machine-id.d.ts.map +1 -1
- package/out/command-line/unique-machine-id.js +3 -12
- package/out/command-line/version-info.d.ts +1 -0
- package/out/command-line/version-info.d.ts.map +1 -1
- package/out/command-line/version-info.js +3 -2
- package/out/command-line/view/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 +7 -1
- package/out/command-line/view/deploy-view.d.ts.map +1 -1
- package/out/command-line/view/deploy-view.js +25 -3
- package/out/command-line/view/install-view.d.ts +5 -3
- package/out/command-line/view/install-view.d.ts.map +1 -1
- package/out/command-line/view/install-view.js +19 -10
- package/out/command-line/view/lint-view.d.ts +3 -2
- package/out/command-line/view/lint-view.d.ts.map +1 -1
- package/out/command-line/view/lint-view.js +3 -0
- package/out/command-line/view/lite-lint-view.d.ts +3 -2
- package/out/command-line/view/lite-lint-view.d.ts.map +1 -1
- package/out/command-line/view/lite-lint-view.js +3 -0
- package/out/command-line/view/settings-view.d.ts +8 -0
- package/out/command-line/view/settings-view.d.ts.map +1 -0
- package/out/command-line/view/settings-view.js +21 -0
- package/out/deploy/deployer/deploy-monitor-graphql-client.js +1 -1
- package/out/deploy/deployer/deployer.d.ts.map +1 -1
- package/out/deploy/deployer/deployer.js +17 -1
- package/out/deploy/deployer/trigger-deploy-graphql-client.d.ts.map +1 -1
- package/out/deploy/deployer/trigger-deploy-graphql-client.js +9 -6
- package/out/deploy/packager/archiver.d.ts +3 -2
- package/out/deploy/packager/archiver.d.ts.map +1 -1
- package/out/deploy/packager/archiver.js +10 -2
- package/out/deploy/packager/packager.d.ts.map +1 -1
- package/out/deploy/packager/packager.js +20 -20
- package/out/deploy/uploader/artifact-graphql-client.d.ts.map +1 -1
- package/out/deploy/uploader/artifact-graphql-client.js +12 -9
- package/out/environment-variables/graphql-client.d.ts +1 -1
- package/out/environment-variables/graphql-client.d.ts.map +1 -1
- package/out/environment-variables/graphql-client.js +19 -13
- package/out/installations/graphql-client.d.ts +19 -13
- package/out/installations/graphql-client.d.ts.map +1 -1
- package/out/installations/graphql-client.js +161 -56
- package/out/installations/install-app-site.d.ts +2 -12
- package/out/installations/install-app-site.d.ts.map +1 -1
- package/out/installations/install-app-site.js +3 -14
- package/out/installations/uninstall-app.d.ts +5 -3
- package/out/installations/uninstall-app.d.ts.map +1 -1
- package/out/installations/uninstall-app.js +7 -7
- package/out/migration-keys/graphql-client.d.ts +8 -0
- package/out/migration-keys/graphql-client.d.ts.map +1 -0
- package/out/migration-keys/graphql-client.js +55 -0
- package/out/providers/configure-provider.d.ts +19 -0
- package/out/providers/configure-provider.d.ts.map +1 -0
- package/out/providers/configure-provider.js +14 -0
- package/out/providers/graphql-client.d.ts +12 -0
- package/out/providers/graphql-client.d.ts.map +1 -0
- package/out/providers/graphql-client.js +47 -0
- package/out/service/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/installation-service.d.ts +13 -13
- package/out/service/installation-service.d.ts.map +1 -1
- package/out/service/installation-service.js +38 -23
- package/out/service/lint-service.d.ts +2 -2
- package/out/service/lint-service.d.ts.map +1 -1
- package/out/service/lint-service.js +3 -3
- package/out/service/lite-lint-service.d.ts +3 -3
- package/out/service/lite-lint-service.d.ts.map +1 -1
- package/out/service/lite-lint-service.js +2 -2
- package/out/service/migration-keys-service.d.ts +19 -0
- package/out/service/migration-keys-service.d.ts.map +1 -0
- package/out/service/migration-keys-service.js +14 -0
- package/out/service/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 +3 -2
- package/out/service/resource-packaging-service.d.ts.map +1 -1
- package/out/service/resource-packaging-service.js +6 -2
- package/out/service/tunnel-service.d.ts +6 -2
- package/out/service/tunnel-service.d.ts.map +1 -1
- package/out/service/tunnel-service.js +53 -12
- package/out/webtrigger/get-webtrigger-url.d.ts +10 -4
- package/out/webtrigger/get-webtrigger-url.d.ts.map +1 -1
- package/out/webtrigger/get-webtrigger-url.js +11 -18
- 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 +3 -1
- package/out/workers/analytics-message-worker.d.ts.map +1 -1
- package/out/workers/analytics-message-worker.js +9 -2
- package/out/workers/forge-cli-workers.js +6 -1
- package/package.json +17 -17
- package/out/bin/preinstall.d.ts +0 -3
- package/out/bin/preinstall.d.ts.map +0 -1
- package/out/bin/preinstall.js +0 -9
- package/out/command-line/cli-prerequisites.d.ts +0 -3
- package/out/command-line/cli-prerequisites.d.ts.map +0 -1
- package/out/command-line/cli-prerequisites.js +0 -37
|
@@ -11,17 +11,23 @@ const delete_environment_variable_1 = require("../environment-variables/delete-e
|
|
|
11
11
|
const graphql_client_1 = require("../environment-variables/graphql-client");
|
|
12
12
|
const list_environment_variables_1 = require("../environment-variables/list-environment-variables");
|
|
13
13
|
const set_environment_variable_1 = require("../environment-variables/set-environment-variable");
|
|
14
|
-
const graphql_client_2 = require("../
|
|
14
|
+
const graphql_client_2 = require("../migration-keys/graphql-client");
|
|
15
|
+
const configure_provider_1 = require("../providers/configure-provider");
|
|
16
|
+
const graphql_client_3 = require("../providers/graphql-client");
|
|
17
|
+
const graphql_client_4 = require("../installations/graphql-client");
|
|
15
18
|
const install_app_site_1 = require("../installations/install-app-site");
|
|
16
19
|
const uninstall_app_1 = require("../installations/uninstall-app");
|
|
20
|
+
const cached_config_service_1 = require("../service/cached-config-service");
|
|
17
21
|
const docker_service_1 = require("../service/docker-service");
|
|
18
22
|
const installation_service_1 = require("../service/installation-service");
|
|
19
23
|
const lint_service_1 = require("../service/lint-service");
|
|
20
24
|
const lite_lint_service_1 = require("../service/lite-lint-service");
|
|
25
|
+
const port_finding_service_1 = require("../service/port-finding-service");
|
|
21
26
|
const resource_packaging_service_1 = require("../service/resource-packaging-service");
|
|
22
27
|
const resources_uploader_service_1 = require("../service/resources-uploader-service");
|
|
23
28
|
const tunnel_analytics_service_1 = require("../service/tunnel-analytics-service");
|
|
24
29
|
const tunnel_service_1 = require("../service/tunnel-service");
|
|
30
|
+
const migration_keys_service_1 = require("../service/migration-keys-service");
|
|
25
31
|
const local_file_storage_1 = require("../storage/local-file-storage");
|
|
26
32
|
const get_webtrigger_url_1 = require("../webtrigger/get-webtrigger-url");
|
|
27
33
|
const worker_info_1 = require("../workers/worker-info");
|
|
@@ -33,16 +39,25 @@ const feedback_controller_1 = require("./controller/feedback-controller");
|
|
|
33
39
|
const install_controller_1 = require("./controller/install-controller");
|
|
34
40
|
const lint_controller_1 = require("./controller/lint-controller");
|
|
35
41
|
const pre_command_controller_1 = require("./controller/pre-command-controller");
|
|
42
|
+
const settings_controller_1 = require("./controller/settings-controller");
|
|
36
43
|
const tunnel_controller_1 = require("./controller/tunnel-controller");
|
|
44
|
+
const unique_machine_id_1 = require("./unique-machine-id");
|
|
45
|
+
const analytics_settings_view_1 = require("./view/analytics-settings-view");
|
|
37
46
|
const deploy_view_1 = require("./view/deploy-view");
|
|
38
47
|
const install_view_1 = require("./view/install-view");
|
|
39
48
|
const lint_view_1 = require("./view/lint-view");
|
|
40
49
|
const lite_lint_view_1 = require("./view/lite-lint-view");
|
|
50
|
+
const settings_view_1 = require("./view/settings-view");
|
|
41
51
|
const tunnel_view_1 = require("./view/tunnel-view");
|
|
52
|
+
const graphql_client_5 = require("../webtrigger/graphql-client");
|
|
53
|
+
const stubController_1 = require("./controller/stubController");
|
|
54
|
+
const prerequisites_controller_1 = require("./controller/prerequisites-controller");
|
|
42
55
|
exports.getDependencies = async (cliDetails) => {
|
|
43
56
|
let cmd;
|
|
44
57
|
const ui = new cli_shared_1.CommandLineUI(() => cmd.verbose);
|
|
45
|
-
const
|
|
58
|
+
const cachedConf = cli_shared_1.CachedConf.getCache(unique_machine_id_1.FORGE_CLI_PACKAGE);
|
|
59
|
+
const cachedConfigService = new cached_config_service_1.CachedConfigService(cachedConf);
|
|
60
|
+
const analyticsClientReporter = new analytics_client_1.AnalyticsClientReporter(new local_file_storage_1.LocalFileStorage(), ui, cachedConfigService);
|
|
46
61
|
const workerInfo = worker_info_1.getWorkerInfo(cliDetails);
|
|
47
62
|
const workersStarter = new workers_starter_1.WorkersStarter(workerInfo);
|
|
48
63
|
const fileReader = new cli_shared_1.FileSystemReader();
|
|
@@ -51,15 +66,17 @@ exports.getDependencies = async (cliDetails) => {
|
|
|
51
66
|
const appConfigReader = cli_shared_1.configFileReaderForSection(cli_shared_1.appConfigKey, cli_shared_1.appConfigShape, configFile);
|
|
52
67
|
const assertiveAppConfigReader = cli_shared_1.assertiveAppConfigProvider(appConfigReader);
|
|
53
68
|
const appConfigWriter = cli_shared_1.configFileWriterForSection(cli_shared_1.appConfigKey, cli_shared_1.appConfigShape, configFile);
|
|
69
|
+
const settingsView = new settings_view_1.SettingsView(ui);
|
|
70
|
+
const settingsController = new settings_controller_1.SettingsController(settingsView, cachedConfigService);
|
|
54
71
|
const liteLintView = new lite_lint_view_1.LiteLintView(ui);
|
|
55
72
|
const liteLintService = new lite_lint_service_1.LiteLintService();
|
|
56
|
-
const
|
|
73
|
+
const analyticsSettingsView = new analytics_settings_view_1.AnalyticsSettingsView(ui);
|
|
74
|
+
const preCommandController = new pre_command_controller_1.PreCommandController(liteLintService, liteLintView, configFile, cachedConfigService, analyticsSettingsView, settingsView);
|
|
57
75
|
cmd = new command_1.Command(ui, analyticsClientReporter, preCommandController, cliDetails);
|
|
58
76
|
const graphqlGateway = cli_shared_1.getGraphqlGateway();
|
|
59
77
|
const tokenStore = cli_shared_1.getCredentialsStoreProvider(ui);
|
|
60
|
-
const authenticator = cli_shared_1.
|
|
61
|
-
|
|
62
|
-
: new cli_shared_1.PersonalTokenAuthenticator(tokenStore);
|
|
78
|
+
const authenticator = new cli_shared_1.PersonalTokenAuthenticator(tokenStore);
|
|
79
|
+
const featureFlagService = new cli_shared_1.FeatureFlagService(ui, cliDetails, tokenStore, appConfigReader);
|
|
63
80
|
const createGraphQLClient = (auth) => {
|
|
64
81
|
const minimalGraphQLRunner = new cli_shared_1.MinimalGraphQLRunner(auth, graphqlGateway, cliDetails);
|
|
65
82
|
const graphQLRunner = new cli_shared_1.DebuggingGraphqlRunner(minimalGraphQLRunner, graphqlGateway, ui);
|
|
@@ -71,28 +88,32 @@ exports.getDependencies = async (cliDetails) => {
|
|
|
71
88
|
const zipAccessor = new cli_shared_1.UnzipperZipAccessor();
|
|
72
89
|
const loginCommand = new cli_shared_1.LoginCommand(createGraphQLClient, tokenStore, ui);
|
|
73
90
|
const logoutCommand = new cli_shared_1.LogoutCommand(tokenStore);
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
const extractor = new cli_shared_1.BitbucketTemplateExtractor(zipAccessor);
|
|
91
|
+
const downloader = new cli_shared_1.TemplateServiceDownloader();
|
|
92
|
+
const extractor = new cli_shared_1.ZipTemplateExtractor(zipAccessor);
|
|
93
|
+
const lister = new cli_shared_1.TemplateServiceLister();
|
|
78
94
|
const createAppGraphQLClient = new cli_shared_1.CreateAppGraphQLClient(graphQLClient);
|
|
79
|
-
const registerAppCommand = new cli_shared_1.RegisterAppCommand(createAppGraphQLClient,
|
|
80
|
-
const templater = new cli_shared_1.
|
|
95
|
+
const registerAppCommand = new cli_shared_1.RegisterAppCommand(createAppGraphQLClient, appConfigWriter, ui);
|
|
96
|
+
const templater = new cli_shared_1.ComposableTemplater(downloader, extractor, lister, ui);
|
|
81
97
|
const npmInstaller = new cli_shared_1.NpmInstaller(ui);
|
|
82
98
|
const createAppCommand = new cli_shared_1.CreateAppCommand(templater, registerAppCommand, npmInstaller);
|
|
83
99
|
const environmentVariablesClient = new graphql_client_1.GraphqlClient(graphQLClient);
|
|
84
100
|
const setEnvironmentVariableCommand = new set_environment_variable_1.SetEnvironmentVariableCommand(environmentVariablesClient, assertiveAppConfigReader);
|
|
85
101
|
const deleteEnvironmentVariableCommand = new delete_environment_variable_1.DeleteEnvironmentVariableCommand(environmentVariablesClient, assertiveAppConfigReader);
|
|
86
102
|
const listEnvironmentVariablesCommand = new list_environment_variables_1.ListEnvironmentVariablesCommand(environmentVariablesClient, assertiveAppConfigReader);
|
|
103
|
+
const providerClient = new graphql_client_3.GraphqlClient(graphQLClient);
|
|
104
|
+
const configureProviderCommand = new configure_provider_1.ConfigureProviderCommand(providerClient, assertiveAppConfigReader);
|
|
105
|
+
const migrationKeysClient = new graphql_client_2.GraphqlClient(graphQLClient);
|
|
106
|
+
const migrationKeysService = new migration_keys_service_1.MigrationKeysService(migrationKeysClient, assertiveAppConfigReader);
|
|
87
107
|
const appEnvironmentClient = new cli_shared_1.AppEnvironmentsGraphqlClient(graphQLClient);
|
|
88
108
|
const globalEdgeFetchClient = { fetch: node_fetch_1.default };
|
|
89
109
|
const globalEdgeClient = new cli_shared_1.GlobalEdgeHttpClient(globalEdgeFetchClient);
|
|
90
110
|
const logsClient = new cli_shared_1.LogsGraphQLClient(graphQLClient);
|
|
91
111
|
const viewAppLogsCommand = new cli_shared_1.ViewAppLogsCommand(assertiveAppConfigReader, appEnvironmentClient, globalEdgeClient, logsClient);
|
|
92
|
-
const installationsClient = new
|
|
112
|
+
const installationsClient = new graphql_client_4.InstallationsGraphqlClient(graphQLClient, cli_shared_1.pause);
|
|
93
113
|
const installAppSiteCommand = new install_app_site_1.InstallAppSiteCommand(assertiveAppConfigReader, installationsClient);
|
|
94
114
|
const uninstallAppCommand = new uninstall_app_1.UninstallAppCommand(assertiveAppConfigReader, installationsClient);
|
|
95
115
|
const deployMonitorClient = new deploy_1.DeployMonitorGraphqlClient(graphQLClient);
|
|
116
|
+
const webTriggerGraphqlClient = new graphql_client_5.WebTriggerGraphQLClient(graphQLClient);
|
|
96
117
|
const archiverFactory = () => new deploy_1.ZipArchiver();
|
|
97
118
|
const uploaderArtifactClient = new deploy_1.ArtifactGraphQLClient(graphQLClient);
|
|
98
119
|
const triggerDeployClient = new deploy_1.TriggerDeployGraphQLClient(graphQLClient);
|
|
@@ -100,25 +121,29 @@ exports.getDependencies = async (cliDetails) => {
|
|
|
100
121
|
const archiveUploader = new deploy_1.AppArchiveUploader(assertiveAppConfigReader, uploaderArtifactClient, fileUploader, ui, new resources_uploader_service_1.ResourcesUploaderService(fileReader));
|
|
101
122
|
const deployer = new deploy_1.ArtifactDeployer(assertiveAppConfigReader, triggerDeployClient, deployMonitorClient, cli_shared_1.pause, ui);
|
|
102
123
|
const packageUploadDeployCommand = new deploy_1.PackageUploadDeployCommand(appPackager, archiveUploader, deployer);
|
|
103
|
-
const getWebTriggerURLCommand = new get_webtrigger_url_1.GetWebTriggerURLCommand(assertiveAppConfigReader, installationsClient, appEnvironmentClient,
|
|
124
|
+
const getWebTriggerURLCommand = new get_webtrigger_url_1.GetWebTriggerURLCommand(assertiveAppConfigReader, installationsClient, appEnvironmentClient, webTriggerGraphqlClient);
|
|
104
125
|
const autocompleteController = new autocomplete_controller_1.AutocompleteController(ui);
|
|
105
126
|
const installationsService = new installation_service_1.InstallationService(assertiveAppConfigReader, installationsClient, installationsClient);
|
|
106
127
|
const installView = new install_view_1.InstallView(ui);
|
|
107
|
-
const installController = new install_controller_1.InstallController(assertiveAppConfigReader, ui, installAppSiteCommand, installationsService, installView);
|
|
128
|
+
const installController = new install_controller_1.InstallController(assertiveAppConfigReader, configFile, ui, installAppSiteCommand, installationsService, installView);
|
|
108
129
|
const feedbackController = new feedback_controller_1.FeedbackController(ui, feedbackPostClient);
|
|
109
130
|
const lintService = new lint_service_1.LintService(configFile, fileReader);
|
|
110
131
|
const lintView = new lint_view_1.LintView(ui);
|
|
111
132
|
const lintController = new lint_controller_1.LintController(lintService, lintView);
|
|
112
133
|
const deployView = new deploy_view_1.DeployView(ui);
|
|
113
134
|
const bridgeScriptService = new cli_shared_1.BridgeScriptService();
|
|
114
|
-
const
|
|
115
|
-
const
|
|
135
|
+
const iframeResizerScriptService = new cli_shared_1.IframeResizerScriptService();
|
|
136
|
+
const resourcePackagingService = new resource_packaging_service_1.ResourcePackagingService(archiverFactory, fileReader, process.cwd(), bridgeScriptService, iframeResizerScriptService);
|
|
137
|
+
const deployController = new deploy_controller_1.DeployController(assertiveAppConfigReader, configFile, lintService, installationsService, migrationKeysService, deployView, packageUploadDeployCommand, resourcePackagingService);
|
|
116
138
|
const tunnelView = new tunnel_view_1.TunnelView(ui);
|
|
117
|
-
const
|
|
139
|
+
const configFilePortFindingService = new port_finding_service_1.ConfigFilePortFindingService(configFile);
|
|
140
|
+
const localTunnelService = new tunnel_service_1.LocalTunnelService(configFilePortFindingService);
|
|
118
141
|
const dockerService = new docker_service_1.DockerService();
|
|
119
142
|
const tunnelAnalyticsService = new tunnel_analytics_service_1.TunnelAnalyticsService(analyticsClientReporter);
|
|
120
|
-
const dockerTunnelService = new tunnel_service_1.DockerTunnelService(dockerService, tunnelAnalyticsService);
|
|
143
|
+
const dockerTunnelService = new tunnel_service_1.DockerTunnelService(configFilePortFindingService, dockerService, tunnelAnalyticsService);
|
|
121
144
|
const tunnelController = new tunnel_controller_1.TunnelController(tunnelAnalyticsService, localTunnelService, dockerTunnelService, tunnelView);
|
|
145
|
+
const stubController = new stubController_1.StubController();
|
|
146
|
+
const prerequisitesController = new prerequisites_controller_1.PrerequisitesController(ui, featureFlagService, cliDetails);
|
|
122
147
|
return {
|
|
123
148
|
ui,
|
|
124
149
|
cmd,
|
|
@@ -130,7 +155,6 @@ exports.getDependencies = async (cliDetails) => {
|
|
|
130
155
|
commands: {
|
|
131
156
|
loginCommand,
|
|
132
157
|
logoutCommand,
|
|
133
|
-
createContainerTokenCommand,
|
|
134
158
|
createAppCommand,
|
|
135
159
|
registerAppCommand,
|
|
136
160
|
installAppSiteCommand,
|
|
@@ -139,11 +163,14 @@ exports.getDependencies = async (cliDetails) => {
|
|
|
139
163
|
setEnvironmentVariableCommand,
|
|
140
164
|
deleteEnvironmentVariableCommand,
|
|
141
165
|
listEnvironmentVariablesCommand,
|
|
166
|
+
configureProviderCommand,
|
|
142
167
|
viewAppLogsCommand,
|
|
143
168
|
getWebTriggerURLCommand
|
|
144
169
|
},
|
|
145
170
|
services: {
|
|
146
|
-
|
|
171
|
+
featureFlagService,
|
|
172
|
+
installationsService,
|
|
173
|
+
migrationKeysService
|
|
147
174
|
},
|
|
148
175
|
controllers: {
|
|
149
176
|
autocompleteController,
|
|
@@ -152,7 +179,10 @@ exports.getDependencies = async (cliDetails) => {
|
|
|
152
179
|
installController,
|
|
153
180
|
lintController,
|
|
154
181
|
preCommandController,
|
|
155
|
-
tunnelController
|
|
182
|
+
tunnelController,
|
|
183
|
+
settingsController,
|
|
184
|
+
stubController,
|
|
185
|
+
prerequisitesController
|
|
156
186
|
}
|
|
157
187
|
};
|
|
158
188
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command-line/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAmB,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command-line/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAmB,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAuBvE,eAAO,MAAM,gBAAgB,SAAU,YAAY,0CAA4B,IAyB9E,CAAC;AAiBF,eAAO,MAAM,IAAI,QAAa,OAAO,CAAC,IAAI,CAUzC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.main = exports.registerCommands = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
6
5
|
const dependency_injection_1 = require("./dependency-injection");
|
|
7
6
|
const version_info_1 = require("./version-info");
|
|
@@ -17,9 +16,11 @@ const register_log_commands_1 = require("./register-log-commands");
|
|
|
17
16
|
const register_tunnel_commands_1 = require("./register-tunnel-commands");
|
|
18
17
|
const register_webtrigger_commands_1 = require("./register-webtrigger-commands");
|
|
19
18
|
const register_feedback_commands_1 = require("./register-feedback-commands");
|
|
20
|
-
const
|
|
19
|
+
const register_settings_commands_1 = require("./register-settings-commands");
|
|
20
|
+
const register_providers_commands_1 = require("./register-providers-commands");
|
|
21
21
|
const sortCommands = (cmd) => {
|
|
22
22
|
cmd.getDefinedCommands().sort((a, b) => a.name().localeCompare(b.name()));
|
|
23
|
+
cmd.getCommands().sort((a, b) => a.getCmdName().localeCompare(b.getCmdName()));
|
|
23
24
|
};
|
|
24
25
|
exports.registerCommands = (deps, cliDetails) => {
|
|
25
26
|
if (cliDetails) {
|
|
@@ -40,47 +41,26 @@ exports.registerCommands = (deps, cliDetails) => {
|
|
|
40
41
|
register_tunnel_commands_1.registerCommands(deps);
|
|
41
42
|
register_webtrigger_commands_1.registerCommands(deps);
|
|
42
43
|
register_feedback_commands_1.registerCommands(deps);
|
|
44
|
+
register_settings_commands_1.registerCommands(deps);
|
|
45
|
+
register_providers_commands_1.registerCommands(deps);
|
|
43
46
|
sortCommands(deps.cmd);
|
|
44
47
|
};
|
|
45
48
|
const registerEvents = ({ cmd, ui }) => {
|
|
49
|
+
cmd.configureOutput({
|
|
50
|
+
writeErr: () => { }
|
|
51
|
+
});
|
|
46
52
|
cmd.exitOverride((err) => {
|
|
47
53
|
throw new command_1.WrapperError(err, 'cli');
|
|
48
54
|
});
|
|
49
|
-
cmd.onUnknownCommand(([command]) => {
|
|
50
|
-
const errorMessage = [];
|
|
51
|
-
const suggestionService = new command_suggestion_service_1.default();
|
|
52
|
-
const suggestions = suggestionService.getSuggestions(command, cmd.getDefinedCommands().map((cmd) => cmd.name()));
|
|
53
|
-
errorMessage.push(cli_shared_1.Text.invalidCmd(command));
|
|
54
|
-
if (suggestions.length) {
|
|
55
|
-
errorMessage.push(`Did you mean:`);
|
|
56
|
-
errorMessage.push(suggestions.join('\n'));
|
|
57
|
-
errorMessage.push(cli_shared_1.Text.invalidCmdHelp);
|
|
58
|
-
ui.info(errorMessage.join('\n\n'));
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
errorMessage.push(cli_shared_1.Text.invalidCmdHelp);
|
|
62
|
-
ui.error(new Error(errorMessage.join(' ')));
|
|
63
|
-
}
|
|
64
|
-
process.exit(0);
|
|
65
|
-
});
|
|
66
55
|
process.on('unhandledRejection', (reason, promise) => {
|
|
67
56
|
cli_shared_1.exitOnError(ui)(new Error(cli_shared_1.Text.error.unhandledRejection(reason, promise)));
|
|
68
57
|
});
|
|
69
58
|
};
|
|
70
|
-
const runCLI = ({ cmd, ui }) => {
|
|
71
|
-
try {
|
|
72
|
-
if (!cmd.parse(process.argv)) {
|
|
73
|
-
cmd.help();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
catch (err) {
|
|
77
|
-
return command_1.Command.reportHelp(cmd, err).then((e) => cli_shared_1.exitOnError(ui)(e));
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
59
|
exports.main = async () => {
|
|
81
60
|
const cliDetails = version_info_1.getCLIDetails();
|
|
82
61
|
const deps = await dependency_injection_1.getDependencies(cliDetails);
|
|
83
62
|
exports.registerCommands(deps, cliDetails);
|
|
84
63
|
registerEvents(deps);
|
|
85
|
-
await
|
|
64
|
+
await deps.controllers.prerequisitesController.check();
|
|
65
|
+
await deps.cmd.parse(process.argv);
|
|
86
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-app-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-app-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAqB,aAAa,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG/G,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAsBtD,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"register-app-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-app-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAqB,aAAa,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG/G,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAsBtD,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAY7E;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,oBAAoB,CACxC,EAAE,EAAE,aAAa,EACjB,gBAAgB,EAAE,gBAAgB,EAClC,IAAI,EAAE,MAAM,EACZ,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,2BAA2B,GACnD,OAAO,CAAC,sBAAsB,CAAC,CAoFjC;AA0CD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,QAGlD"}
|
|
@@ -27,9 +27,7 @@ function directoryNameFromAppName(appName) {
|
|
|
27
27
|
if (appName === undefined) {
|
|
28
28
|
return undefined;
|
|
29
29
|
}
|
|
30
|
-
const normalized = sanitize_filename_1.default(appName.trim())
|
|
31
|
-
.trim()
|
|
32
|
-
.replace(/ /g, '-');
|
|
30
|
+
const normalized = sanitize_filename_1.default(appName.trim()).trim().replace(/ /g, '-');
|
|
33
31
|
const chars = Array.from(normalized);
|
|
34
32
|
const allDashes = chars.every((char) => char === '-');
|
|
35
33
|
return allDashes ? undefined : normalized;
|
|
@@ -113,18 +111,10 @@ function registerRegisterCommand({ cmd, ui, commands: { registerAppCommand } })
|
|
|
113
111
|
ui.info(cli_shared_1.Text.register.intro);
|
|
114
112
|
ui.info(cli_shared_1.Text.ctrlC);
|
|
115
113
|
ui.emptyLine();
|
|
116
|
-
const oldAppName = await registerAppCommand.isAppAlreadyConfigured();
|
|
117
|
-
if (oldAppName !== 'missing') {
|
|
118
|
-
const force = await ui.confirm(cli_shared_1.Text.register.confirmQuestion);
|
|
119
|
-
ui.emptyLine();
|
|
120
|
-
if (!force) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
114
|
if (!name) {
|
|
125
115
|
ui.info(cli_shared_1.Text.create.overviewAppName);
|
|
126
116
|
}
|
|
127
|
-
const appName =
|
|
117
|
+
const appName = await ui.promptForText(cli_shared_1.Text.create.promptName);
|
|
128
118
|
ui.emptyLine();
|
|
129
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));
|
|
130
120
|
ui.info(cli_shared_1.Text.register.cmd.successDetails(cli_shared_2.VALID_ENVIRONMENT_OPTIONS));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-authentication-command.d.ts","sourceRoot":"","sources":["../../src/command-line/register-authentication-command.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
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"}
|
|
@@ -50,6 +50,7 @@ function registerLoginCommand({ cmd, ui, graphqlGateway, commands: { loginComman
|
|
|
50
50
|
.option('-u, --email <user email>', cli_shared_2.Text.login.optionEmail)
|
|
51
51
|
.option('-t, --token <api token>', cli_shared_2.Text.login.optionToken)
|
|
52
52
|
.requireNoAuthentication()
|
|
53
|
+
.nonInteractiveOption('--email', '--token')
|
|
53
54
|
.action((options) => loginCommandHandler(ui, instructionsUrl, loginCommand, options));
|
|
54
55
|
}
|
|
55
56
|
function registerLogoutCommand({ cmd, ui, commands: { logoutCommand } }) {
|
|
@@ -62,26 +63,11 @@ function registerLogoutCommand({ cmd, ui, commands: { logoutCommand } }) {
|
|
|
62
63
|
ui.info(cli_shared_2.Text.logout.loggedOut);
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
|
-
function registerLoginCICommand({ cmd, ui, commands: { createContainerTokenCommand } }) {
|
|
66
|
-
cmd
|
|
67
|
-
.command('login:ci')
|
|
68
|
-
.description(cli_shared_2.Text.loginci.cmd)
|
|
69
|
-
.requireAppId()
|
|
70
|
-
.requireNoAuthentication()
|
|
71
|
-
.action(async () => {
|
|
72
|
-
const token = await createContainerTokenCommand.execute();
|
|
73
|
-
ui.info(cli_shared_2.Text.loginci.success(cli_shared_1.KEY, token));
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
66
|
function registerWhoAmICommand({ cmd, ui, commands: { loginCommand } }) {
|
|
77
67
|
cmd
|
|
78
68
|
.command('whoami')
|
|
79
69
|
.description(cli_shared_2.Text.whoami.cmd)
|
|
80
70
|
.action(async () => {
|
|
81
|
-
if (cli_shared_1.ContainerTokenAuthenticator.isAvailable()) {
|
|
82
|
-
ui.info(cli_shared_2.Text.whoami.success.containerToken(cli_shared_1.KEY));
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
71
|
try {
|
|
86
72
|
const credentials = await cli_shared_1.getCredentialsStoreProvider(ui).getCredentials();
|
|
87
73
|
const { name, accountId } = await loginCommand.getUser(credentials);
|
|
@@ -101,7 +87,6 @@ function registerWhoAmICommand({ cmd, ui, commands: { loginCommand } }) {
|
|
|
101
87
|
function registerCommands(deps) {
|
|
102
88
|
registerLoginCommand(deps);
|
|
103
89
|
registerLogoutCommand(deps);
|
|
104
|
-
registerLoginCICommand(deps);
|
|
105
90
|
registerWhoAmICommand(deps);
|
|
106
91
|
}
|
|
107
92
|
exports.registerCommands = registerCommands;
|
|
@@ -8,6 +8,14 @@ export interface DeploymentResult {
|
|
|
8
8
|
extensionList: string[];
|
|
9
9
|
fileCount: number;
|
|
10
10
|
}[];
|
|
11
|
+
egressPermissionList?: {
|
|
12
|
+
type: string;
|
|
13
|
+
domains: string[] | undefined;
|
|
14
|
+
}[];
|
|
15
|
+
connectKey?: {
|
|
16
|
+
action?: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
};
|
|
11
19
|
};
|
|
12
20
|
}
|
|
13
21
|
export declare const registerCommands: ({ cmd, controllers: { deployController } }: Dependencies) => void;
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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"}
|
|
@@ -10,5 +10,6 @@ exports.registerCommands = ({ cmd, controllers: { deployController } }) => {
|
|
|
10
10
|
.description(cli_shared_1.Text.deploy.cmd.desc)
|
|
11
11
|
.option('-f, --no-verify', 'Disable pre-deployment checks')
|
|
12
12
|
.environmentOption()
|
|
13
|
+
.nonInteractiveOption()
|
|
13
14
|
.action(async (opts) => deployController.run(opts));
|
|
14
15
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Dependencies } from './dependency-injection';
|
|
2
|
-
export declare const registerCommands: (deps: Dependencies) => void;
|
|
2
|
+
export declare const registerCommands: ({ cmd, ...deps }: Dependencies) => void;
|
|
3
3
|
//# sourceMappingURL=register-environment-variables-commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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"}
|
|
@@ -6,9 +6,11 @@ const cli_table3_1 = tslib_1.__importDefault(require("cli-table3"));
|
|
|
6
6
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
7
7
|
const cli_shared_2 = require("@forge/cli-shared");
|
|
8
8
|
const cli_shared_3 = require("@forge/cli-shared");
|
|
9
|
+
const COMMAND_NAME = 'variables';
|
|
10
|
+
const SET_COMMAND_NAME = 'set';
|
|
9
11
|
const registerSetEnvironmentVariableCommand = ({ cmd, ui, commands: { setEnvironmentVariableCommand } }) => {
|
|
10
12
|
cmd
|
|
11
|
-
.command(
|
|
13
|
+
.command(`${SET_COMMAND_NAME} [key] [value]`)
|
|
12
14
|
.requireAppId()
|
|
13
15
|
.description(cli_shared_2.Text.varsSet.cmd.desc)
|
|
14
16
|
.option('--encrypt', cli_shared_2.Text.varsSet.optionSecret, false)
|
|
@@ -40,9 +42,10 @@ const registerSetEnvironmentVariableCommand = ({ cmd, ui, commands: { setEnviron
|
|
|
40
42
|
ui.info(cli_shared_2.Text.varsList.hint);
|
|
41
43
|
});
|
|
42
44
|
};
|
|
45
|
+
const UNSET_COMMAND_NAME = 'unset';
|
|
43
46
|
const registerDeleteEnvironmentVariableCommand = ({ cmd, ui, commands: { deleteEnvironmentVariableCommand } }) => {
|
|
44
47
|
cmd
|
|
45
|
-
.command(
|
|
48
|
+
.command(`${UNSET_COMMAND_NAME} <key>`)
|
|
46
49
|
.requireAppId()
|
|
47
50
|
.description(cli_shared_2.Text.varsUnset.cmd.desc)
|
|
48
51
|
.environmentOption()
|
|
@@ -54,9 +57,10 @@ const registerDeleteEnvironmentVariableCommand = ({ cmd, ui, commands: { deleteE
|
|
|
54
57
|
ui.info(cli_shared_2.Text.varsList.hint);
|
|
55
58
|
});
|
|
56
59
|
};
|
|
60
|
+
const LIST_COMMAND_NAME = 'list';
|
|
57
61
|
const registerListEnvironmentVariableCommand = ({ cmd, ui, commands: { listEnvironmentVariablesCommand } }) => {
|
|
58
62
|
cmd
|
|
59
|
-
.command(
|
|
63
|
+
.command(LIST_COMMAND_NAME)
|
|
60
64
|
.requireAppId()
|
|
61
65
|
.description(cli_shared_2.Text.varsList.cmd)
|
|
62
66
|
.environmentOption()
|
|
@@ -77,8 +81,19 @@ const registerListEnvironmentVariableCommand = ({ cmd, ui, commands: { listEnvir
|
|
|
77
81
|
ui.info(cli_shared_2.Text.varsList.postfix);
|
|
78
82
|
});
|
|
79
83
|
};
|
|
80
|
-
|
|
81
|
-
|
|
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));
|
|
84
99
|
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { Dependencies } from './dependency-injection';
|
|
2
|
-
|
|
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;
|
|
3
6
|
//# sourceMappingURL=register-installation-commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,32 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerCommands = void 0;
|
|
3
|
+
exports.registerCommands = exports.performMultipleUninstalls = exports.performSingleUninstall = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const cli_table3_1 = tslib_1.__importDefault(require("cli-table3"));
|
|
6
6
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
7
7
|
const cli_shared_2 = require("@forge/cli-shared");
|
|
8
8
|
const shared_1 = require("../installations/shared");
|
|
9
9
|
const errors_1 = require("./errors");
|
|
10
|
+
const COMMAND_NAME = 'install';
|
|
10
11
|
const registerInstallAppCommand = ({ cmd, controllers: { installController } }) => {
|
|
11
12
|
cmd
|
|
12
|
-
.command('install')
|
|
13
13
|
.requireAppId()
|
|
14
14
|
.environmentOption()
|
|
15
15
|
.siteAndProductOption()
|
|
16
16
|
.option('--upgrade', cli_shared_2.Text.install.optionUpgrade)
|
|
17
17
|
.option('--confirm-scopes', cli_shared_2.Text.install.optionConfirmScopes)
|
|
18
|
+
.nonInteractiveOption('--site', '--product', '--environment')
|
|
18
19
|
.description(cli_shared_2.Text.install.cmd.description)
|
|
19
|
-
.action(async ({ environment, site, product, upgrade, confirmScopes }) => {
|
|
20
|
-
await installController.run({ environment, site, product, upgrade, confirmScopes });
|
|
20
|
+
.action(async ({ environment, site, product, upgrade, confirmScopes, nonInteractive }) => {
|
|
21
|
+
await installController.run({ environment, site, product, upgrade, confirmScopes, nonInteractive });
|
|
21
22
|
});
|
|
22
23
|
};
|
|
24
|
+
const LIST_COMMAND_NAME = 'list';
|
|
23
25
|
const registerListInstallationsCommand = ({ cmd, ui, services: { installationsService } }) => {
|
|
24
26
|
cmd
|
|
25
|
-
.command(
|
|
27
|
+
.command(LIST_COMMAND_NAME)
|
|
26
28
|
.requireAppId()
|
|
27
29
|
.description(cli_shared_2.Text.installList.cmd)
|
|
28
30
|
.action(async () => {
|
|
29
|
-
const { installations
|
|
31
|
+
const { installations } = await installationsService.listAppInstallations();
|
|
30
32
|
if (!installations.length) {
|
|
31
33
|
ui.info(cli_shared_2.Text.installList.noInstallations);
|
|
32
34
|
return;
|
|
@@ -41,17 +43,27 @@ const registerListInstallationsCommand = ({ cmd, ui, services: { installationsSe
|
|
|
41
43
|
cli_shared_2.Text.install.booleanToScope(isLatest)
|
|
42
44
|
]);
|
|
43
45
|
}
|
|
44
|
-
ui.info(cli_shared_2.Text.installList.banner
|
|
46
|
+
ui.info(cli_shared_2.Text.installList.banner);
|
|
45
47
|
ui.info(table.toString());
|
|
46
48
|
});
|
|
47
49
|
};
|
|
48
|
-
|
|
49
|
-
const installation = await ui.displayProgress(() => uninstallAppCommand.execute(installId), cli_shared_2.Text.uninstall.cmd.start,
|
|
50
|
-
|
|
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
|
+
}
|
|
51
63
|
};
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
const hasMultipleNonIdentityApps =
|
|
64
|
+
exports.performMultipleUninstalls = async (appsToUninstall, { ui, commands: { uninstallAppCommand } }) => {
|
|
65
|
+
const filteredInstallations = appsToUninstall.filter(({ product }) => product !== 'identity');
|
|
66
|
+
const hasMultipleNonIdentityApps = filteredInstallations.length > 1;
|
|
55
67
|
const uninstalledApps = await ui.displayProgress(() => uninstallAppCommand.batchExecute([], appsToUninstall), cli_shared_2.Text.uninstall.cmd.start, (result) => {
|
|
56
68
|
const isSuccessful = !result.some(({ successful }) => successful === false);
|
|
57
69
|
return {
|
|
@@ -86,7 +98,7 @@ const registerUninstallCommand = (deps) => {
|
|
|
86
98
|
.requireAppId()
|
|
87
99
|
.description(cli_shared_2.Text.uninstall.cmd.desc)
|
|
88
100
|
.action(async (installationId) => {
|
|
89
|
-
const { installations
|
|
101
|
+
const { installations } = await installationsService.listAppInstallations();
|
|
90
102
|
if (!installations.length) {
|
|
91
103
|
ui.info(cli_shared_2.Text.installList.noInstallations);
|
|
92
104
|
return;
|
|
@@ -96,11 +108,11 @@ const registerUninstallCommand = (deps) => {
|
|
|
96
108
|
ui.info(cli_shared_2.Text.uninstall.info);
|
|
97
109
|
ui.info(cli_shared_2.Text.ctrlC);
|
|
98
110
|
ui.emptyLine();
|
|
99
|
-
await performSingleUninstall(installId, deps);
|
|
111
|
+
await exports.performSingleUninstall(installId, deps);
|
|
100
112
|
}
|
|
101
113
|
else {
|
|
102
|
-
const filteredInstallations = installations.filter((install) => install.product !== 'identity');
|
|
103
|
-
const selectedSitesIndexes = await ui.promptForTable(cli_shared_2.Text.uninstall.interactive.desc, cli_shared_2.Text.uninstall.interactive.progressInfo
|
|
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 }) => ({
|
|
104
116
|
names: [cli_shared_1.environmentToOption(environmentKey), site, cli_shared_1.capitalizeProduct(product)],
|
|
105
117
|
value: id
|
|
106
118
|
})));
|
|
@@ -109,16 +121,20 @@ const registerUninstallCommand = (deps) => {
|
|
|
109
121
|
const remainingApps = filteredInstallations.filter((_, index) => !selectedSitesIndexes.includes(index));
|
|
110
122
|
appsToUninstall.push(...shared_1.getHangingIdentityInstallationsFromSite(installations, remainingApps, selectedSites));
|
|
111
123
|
if (appsToUninstall.length > 1) {
|
|
112
|
-
await performMultipleUninstalls(appsToUninstall, deps);
|
|
124
|
+
await exports.performMultipleUninstalls(appsToUninstall, deps);
|
|
113
125
|
}
|
|
114
126
|
else {
|
|
115
|
-
await performSingleUninstall(appsToUninstall[0].id, deps);
|
|
127
|
+
await exports.performSingleUninstall(appsToUninstall[0].id, deps);
|
|
116
128
|
}
|
|
117
129
|
}
|
|
118
130
|
});
|
|
119
131
|
};
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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));
|
|
124
140
|
};
|
|
@@ -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"}
|