@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.
Files changed (165) hide show
  1. package/CHANGELOG.md +3781 -7
  2. package/README.md +18 -19
  3. package/npm-shrinkwrap.json +2709 -3555
  4. package/out/analytics-client/analytics-client.d.ts +3 -1
  5. package/out/analytics-client/analytics-client.d.ts.map +1 -1
  6. package/out/analytics-client/analytics-client.js +5 -1
  7. package/out/autocomplete/autocomplete-config.json +24 -20
  8. package/out/autocomplete/isSupportedShell.d.ts +2 -0
  9. package/out/autocomplete/isSupportedShell.d.ts.map +1 -0
  10. package/out/autocomplete/isSupportedShell.js +11 -0
  11. package/out/bin/cli.js +0 -2
  12. package/out/bin/postinstall.js +9 -2
  13. package/out/command-line/anon-user-id.js +6 -10
  14. package/out/command-line/command.d.ts +27 -8
  15. package/out/command-line/command.d.ts.map +1 -1
  16. package/out/command-line/command.js +188 -50
  17. package/out/command-line/controller/autocomplete-controller.d.ts +1 -0
  18. package/out/command-line/controller/autocomplete-controller.d.ts.map +1 -1
  19. package/out/command-line/controller/autocomplete-controller.js +11 -1
  20. package/out/command-line/controller/deploy-controller.d.ts +13 -2
  21. package/out/command-line/controller/deploy-controller.d.ts.map +1 -1
  22. package/out/command-line/controller/deploy-controller.js +79 -5
  23. package/out/command-line/controller/getNodeVersion.d.ts +2 -0
  24. package/out/command-line/controller/getNodeVersion.d.ts.map +1 -0
  25. package/out/command-line/controller/getNodeVersion.js +7 -0
  26. package/out/command-line/controller/install-controller.d.ts +5 -4
  27. package/out/command-line/controller/install-controller.d.ts.map +1 -1
  28. package/out/command-line/controller/install-controller.js +31 -56
  29. package/out/command-line/controller/lint-controller.js +1 -1
  30. package/out/command-line/controller/pre-command-controller.d.ts +8 -1
  31. package/out/command-line/controller/pre-command-controller.d.ts.map +1 -1
  32. package/out/command-line/controller/pre-command-controller.js +22 -2
  33. package/out/command-line/controller/prerequisites-controller.d.ts +11 -0
  34. package/out/command-line/controller/prerequisites-controller.d.ts.map +1 -0
  35. package/out/command-line/controller/prerequisites-controller.js +34 -0
  36. package/out/command-line/controller/settings-controller.d.ts +19 -0
  37. package/out/command-line/controller/settings-controller.d.ts.map +1 -0
  38. package/out/command-line/controller/settings-controller.js +48 -0
  39. package/out/command-line/controller/stubController.d.ts +9 -0
  40. package/out/command-line/controller/stubController.d.ts.map +1 -0
  41. package/out/command-line/controller/stubController.js +15 -0
  42. package/out/command-line/dependency-injection.d.ts +13 -3
  43. package/out/command-line/dependency-injection.d.ts.map +1 -1
  44. package/out/command-line/dependency-injection.js +52 -22
  45. package/out/command-line/index.d.ts.map +1 -1
  46. package/out/command-line/index.js +10 -30
  47. package/out/command-line/register-app-commands.d.ts.map +1 -1
  48. package/out/command-line/register-app-commands.js +2 -12
  49. package/out/command-line/register-authentication-command.d.ts.map +1 -1
  50. package/out/command-line/register-authentication-command.js +1 -16
  51. package/out/command-line/register-deployment-commands.d.ts +8 -0
  52. package/out/command-line/register-deployment-commands.d.ts.map +1 -1
  53. package/out/command-line/register-deployment-commands.js +1 -0
  54. package/out/command-line/register-environment-variables-commands.d.ts +1 -1
  55. package/out/command-line/register-environment-variables-commands.d.ts.map +1 -1
  56. package/out/command-line/register-environment-variables-commands.js +22 -7
  57. package/out/command-line/register-installation-commands.d.ts +4 -1
  58. package/out/command-line/register-installation-commands.d.ts.map +1 -1
  59. package/out/command-line/register-installation-commands.js +39 -23
  60. package/out/command-line/register-providers-commands.d.ts +3 -0
  61. package/out/command-line/register-providers-commands.d.ts.map +1 -0
  62. package/out/command-line/register-providers-commands.js +43 -0
  63. package/out/command-line/register-settings-commands.d.ts +3 -0
  64. package/out/command-line/register-settings-commands.d.ts.map +1 -0
  65. package/out/command-line/register-settings-commands.js +37 -0
  66. package/out/command-line/register-webtrigger-commands.d.ts.map +1 -1
  67. package/out/command-line/register-webtrigger-commands.js +9 -11
  68. package/out/command-line/unique-machine-id.d.ts +1 -0
  69. package/out/command-line/unique-machine-id.d.ts.map +1 -1
  70. package/out/command-line/unique-machine-id.js +3 -12
  71. package/out/command-line/version-info.d.ts +1 -0
  72. package/out/command-line/version-info.d.ts.map +1 -1
  73. package/out/command-line/version-info.js +3 -2
  74. package/out/command-line/view/analytics-settings-view.d.ts +7 -0
  75. package/out/command-line/view/analytics-settings-view.d.ts.map +1 -0
  76. package/out/command-line/view/analytics-settings-view.js +18 -0
  77. package/out/command-line/view/deploy-view.d.ts +7 -1
  78. package/out/command-line/view/deploy-view.d.ts.map +1 -1
  79. package/out/command-line/view/deploy-view.js +25 -3
  80. package/out/command-line/view/install-view.d.ts +5 -3
  81. package/out/command-line/view/install-view.d.ts.map +1 -1
  82. package/out/command-line/view/install-view.js +19 -10
  83. package/out/command-line/view/lint-view.d.ts +3 -2
  84. package/out/command-line/view/lint-view.d.ts.map +1 -1
  85. package/out/command-line/view/lint-view.js +3 -0
  86. package/out/command-line/view/lite-lint-view.d.ts +3 -2
  87. package/out/command-line/view/lite-lint-view.d.ts.map +1 -1
  88. package/out/command-line/view/lite-lint-view.js +3 -0
  89. package/out/command-line/view/settings-view.d.ts +8 -0
  90. package/out/command-line/view/settings-view.d.ts.map +1 -0
  91. package/out/command-line/view/settings-view.js +21 -0
  92. package/out/deploy/deployer/deploy-monitor-graphql-client.js +1 -1
  93. package/out/deploy/deployer/deployer.d.ts.map +1 -1
  94. package/out/deploy/deployer/deployer.js +17 -1
  95. package/out/deploy/deployer/trigger-deploy-graphql-client.d.ts.map +1 -1
  96. package/out/deploy/deployer/trigger-deploy-graphql-client.js +9 -6
  97. package/out/deploy/packager/archiver.d.ts +3 -2
  98. package/out/deploy/packager/archiver.d.ts.map +1 -1
  99. package/out/deploy/packager/archiver.js +10 -2
  100. package/out/deploy/packager/packager.d.ts.map +1 -1
  101. package/out/deploy/packager/packager.js +20 -20
  102. package/out/deploy/uploader/artifact-graphql-client.d.ts.map +1 -1
  103. package/out/deploy/uploader/artifact-graphql-client.js +12 -9
  104. package/out/environment-variables/graphql-client.d.ts +1 -1
  105. package/out/environment-variables/graphql-client.d.ts.map +1 -1
  106. package/out/environment-variables/graphql-client.js +19 -13
  107. package/out/installations/graphql-client.d.ts +19 -13
  108. package/out/installations/graphql-client.d.ts.map +1 -1
  109. package/out/installations/graphql-client.js +161 -56
  110. package/out/installations/install-app-site.d.ts +2 -12
  111. package/out/installations/install-app-site.d.ts.map +1 -1
  112. package/out/installations/install-app-site.js +3 -14
  113. package/out/installations/uninstall-app.d.ts +5 -3
  114. package/out/installations/uninstall-app.d.ts.map +1 -1
  115. package/out/installations/uninstall-app.js +7 -7
  116. package/out/migration-keys/graphql-client.d.ts +8 -0
  117. package/out/migration-keys/graphql-client.d.ts.map +1 -0
  118. package/out/migration-keys/graphql-client.js +55 -0
  119. package/out/providers/configure-provider.d.ts +19 -0
  120. package/out/providers/configure-provider.d.ts.map +1 -0
  121. package/out/providers/configure-provider.js +14 -0
  122. package/out/providers/graphql-client.d.ts +12 -0
  123. package/out/providers/graphql-client.d.ts.map +1 -0
  124. package/out/providers/graphql-client.js +47 -0
  125. package/out/service/cached-config-service.d.ts +8 -0
  126. package/out/service/cached-config-service.d.ts.map +1 -0
  127. package/out/service/cached-config-service.js +16 -0
  128. package/out/service/installation-service.d.ts +13 -13
  129. package/out/service/installation-service.d.ts.map +1 -1
  130. package/out/service/installation-service.js +38 -23
  131. package/out/service/lint-service.d.ts +2 -2
  132. package/out/service/lint-service.d.ts.map +1 -1
  133. package/out/service/lint-service.js +3 -3
  134. package/out/service/lite-lint-service.d.ts +3 -3
  135. package/out/service/lite-lint-service.d.ts.map +1 -1
  136. package/out/service/lite-lint-service.js +2 -2
  137. package/out/service/migration-keys-service.d.ts +19 -0
  138. package/out/service/migration-keys-service.d.ts.map +1 -0
  139. package/out/service/migration-keys-service.js +14 -0
  140. package/out/service/port-finding-service.d.ts +12 -0
  141. package/out/service/port-finding-service.d.ts.map +1 -0
  142. package/out/service/port-finding-service.js +34 -0
  143. package/out/service/resource-packaging-service.d.ts +3 -2
  144. package/out/service/resource-packaging-service.d.ts.map +1 -1
  145. package/out/service/resource-packaging-service.js +6 -2
  146. package/out/service/tunnel-service.d.ts +6 -2
  147. package/out/service/tunnel-service.d.ts.map +1 -1
  148. package/out/service/tunnel-service.js +53 -12
  149. package/out/webtrigger/get-webtrigger-url.d.ts +10 -4
  150. package/out/webtrigger/get-webtrigger-url.d.ts.map +1 -1
  151. package/out/webtrigger/get-webtrigger-url.js +11 -18
  152. package/out/webtrigger/graphql-client.d.ts +14 -0
  153. package/out/webtrigger/graphql-client.d.ts.map +1 -0
  154. package/out/webtrigger/graphql-client.js +52 -0
  155. package/out/workers/analytics-message-worker.d.ts +3 -1
  156. package/out/workers/analytics-message-worker.d.ts.map +1 -1
  157. package/out/workers/analytics-message-worker.js +9 -2
  158. package/out/workers/forge-cli-workers.js +6 -1
  159. package/package.json +17 -17
  160. package/out/bin/preinstall.d.ts +0 -3
  161. package/out/bin/preinstall.d.ts.map +0 -1
  162. package/out/bin/preinstall.js +0 -9
  163. package/out/command-line/cli-prerequisites.d.ts +0 -3
  164. package/out/command-line/cli-prerequisites.d.ts.map +0 -1
  165. package/out/command-line/cli-prerequisites.js +0 -37
@@ -0,0 +1,43 @@
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
+ exports.registerCommands = (deps) => {
42
+ registerConfigureProviderCommand(deps);
43
+ };
@@ -0,0 +1,3 @@
1
+ import { Dependencies } from './dependency-injection';
2
+ export declare const registerCommands: ({ cmd, ...deps }: Dependencies) => void;
3
+ //# sourceMappingURL=register-settings-commands.d.ts.map
@@ -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;AA+BtD,eAAO,MAAM,gBAAgB,qBAAsB,YAAY,SAK9D,CAAC"}
@@ -0,0 +1,37 @@
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
+ .action(async () => {
17
+ settingsController.showSettings();
18
+ return { analytics: {} };
19
+ });
20
+ };
21
+ const registerSettingsSet = ({ cmd, controllers: { settingsController } }) => {
22
+ cmd
23
+ .command(SET_COMMAND_NAME)
24
+ .description(cli_shared_1.Text.settings.set.description(settings_controller_1.ALLOWED_SETTINGS))
25
+ .requireNoAuthentication()
26
+ .requireNoAnalyticsConsent()
27
+ .action(async (preference, value) => {
28
+ settingsController.setSettings(preference, value);
29
+ return { analytics: {} };
30
+ });
31
+ };
32
+ exports.registerCommands = (_a) => {
33
+ var { cmd } = _a, deps = tslib_1.__rest(_a, ["cmd"]);
34
+ const preferences = cmd.command(COMMAND_NAME).requireNoAuthentication().description(cli_shared_1.Text.settings.description);
35
+ registerSettingsList(Object.assign({ cmd: preferences }, deps));
36
+ registerSettingsSet(Object.assign({ cmd: preferences }, deps));
37
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"register-webtrigger-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-webtrigger-commands.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AA+BtD,eAAO,MAAM,gBAAgB,mFAM1B,YAAY,SAuCd,CAAC"}
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"}
@@ -4,7 +4,6 @@ exports.registerCommands = void 0;
4
4
  const cli_shared_1 = require("@forge/cli-shared");
5
5
  const cli_shared_2 = require("@forge/cli-shared");
6
6
  const cli_shared_3 = require("@forge/cli-shared");
7
- const cli_shared_4 = require("@forge/cli-shared");
8
7
  const getAvailableWebTriggers = (appConfig) => {
9
8
  const output = new Map();
10
9
  if (appConfig.modules && appConfig.modules.webtrigger) {
@@ -18,7 +17,7 @@ async function getValidWebtriggers(configFile) {
18
17
  const manifest = await configFile.readConfig();
19
18
  const availableWebTriggers = getAvailableWebTriggers(manifest);
20
19
  if (!availableWebTriggers.size) {
21
- throw new cli_shared_4.ValidationError(cli_shared_3.Text.webtrigger.error.noWebtriggers);
20
+ throw new cli_shared_3.ValidationError(cli_shared_2.Text.webtrigger.error.noWebtriggers);
22
21
  }
23
22
  return availableWebTriggers;
24
23
  }
@@ -32,26 +31,25 @@ exports.registerCommands = ({ cmd, ui, graphqlGateway, configFile, commands: { g
32
31
  const availableWebTriggers = await getValidWebtriggers(configFile);
33
32
  if (functionKey) {
34
33
  if (!availableWebTriggers.has(functionKey)) {
35
- throw new cli_shared_4.ValidationError(cli_shared_3.Text.webtrigger.error.funcKey);
34
+ throw new cli_shared_3.ValidationError(cli_shared_2.Text.webtrigger.error.funcKey);
36
35
  }
37
36
  return functionKey;
38
37
  }
39
38
  else {
40
39
  const options = [...availableWebTriggers.keys()];
41
- return await ui.promptForList(cli_shared_3.Text.webtrigger.promptFuncKey, options);
40
+ return await ui.promptForList(cli_shared_2.Text.webtrigger.promptFuncKey, options);
42
41
  }
43
42
  };
44
43
  cmd
45
44
  .command('webtrigger [installationId]')
46
45
  .requireAppId()
47
- .description(cli_shared_3.Text.webtrigger.cmd)
48
- .option('-f, --functionKey [function]', cli_shared_3.Text.webtrigger.optionFuncKey)
46
+ .description(cli_shared_2.Text.webtrigger.cmd)
47
+ .option('-f, --functionKey [function]', cli_shared_2.Text.webtrigger.optionFuncKey)
49
48
  .precondition(manifestDefinesTriggers(configFile))
50
49
  .action(async (installationId, { functionKey }) => {
51
- ui.info(cli_shared_3.Text.webtrigger.overviewFuncKey);
52
- const installId = await cli_shared_2.getInstallationId(ui, installationId);
53
- const isProduction = graphqlGateway === cli_shared_1.DEFAULT_GRAPHQL_GATEWAY;
54
- const url = await getWebTriggerURLCommand.execute(installId, await validateWebtriggerKey(functionKey), isProduction);
55
- ui.info(cli_shared_3.Text.webtrigger.copy(url));
50
+ ui.info(cli_shared_2.Text.webtrigger.overviewFuncKey);
51
+ const installId = await 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));
56
54
  });
57
55
  };
@@ -1,2 +1,3 @@
1
+ export declare const FORGE_CLI_PACKAGE = "@forge/cli";
1
2
  export declare const getMachineId: () => string;
2
3
  //# sourceMappingURL=unique-machine-id.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unique-machine-id.d.ts","sourceRoot":"","sources":["../../src/command-line/unique-machine-id.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,YAAY,QAAO,MAS/B,CAAC"}
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"}
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMachineId = void 0;
3
+ exports.getMachineId = exports.FORGE_CLI_PACKAGE = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const uuid_1 = tslib_1.__importDefault(require("uuid"));
6
6
  const node_machine_id_1 = require("node-machine-id");
7
7
  const cli_shared_1 = require("@forge/cli-shared");
8
- const FORGE_CLI_PACKAGE = '@forge/cli';
8
+ exports.FORGE_CLI_PACKAGE = '@forge/cli';
9
9
  const MACHINE_ID_CACHE_KEY = 'machineId';
10
10
  const generateMachineId = () => {
11
11
  try {
@@ -15,13 +15,4 @@ const generateMachineId = () => {
15
15
  return uuid_1.default();
16
16
  }
17
17
  };
18
- exports.getMachineId = () => {
19
- const cachedConf = cli_shared_1.CachedConf.getCache(FORGE_CLI_PACKAGE);
20
- const storedMachineId = cachedConf.get(MACHINE_ID_CACHE_KEY);
21
- if (storedMachineId) {
22
- return storedMachineId;
23
- }
24
- const newMachineId = generateMachineId();
25
- cachedConf.set(MACHINE_ID_CACHE_KEY, newMachineId);
26
- return newMachineId;
27
- };
18
+ exports.getMachineId = () => cli_shared_1.CachedConf.getCache(exports.FORGE_CLI_PACKAGE).cached(MACHINE_ID_CACHE_KEY, generateMachineId);
@@ -2,6 +2,7 @@ export declare const VERSION_CACHE_KEY = "latest";
2
2
  export declare const VERSION_CACHE_INTERVAL: number;
3
3
  import { CLIDetails } from '@forge/cli-shared';
4
4
  export declare const getCLIDetails: () => CLIDetails | undefined;
5
+ export declare const supportedNodeVersion = "14.x || 16.x";
5
6
  export declare const cacheLatestVersion: (name: string) => Promise<void>;
6
7
  export declare const clearVersionCache: (name: string) => void;
7
8
  //# sourceMappingURL=version-info.d.ts.map
@@ -1 +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;AAEF,eAAO,MAAM,kBAAkB,SAAgB,MAAM,KAAG,OAAO,CAAC,IAAI,CAInE,CAAC;AAEF,eAAO,MAAM,iBAAiB,SAAU,MAAM,SAG7C,CAAC"}
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;AAEF,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD,eAAO,MAAM,kBAAkB,SAAgB,MAAM,KAAG,OAAO,CAAC,IAAI,CAInE,CAAC;AAEF,eAAO,MAAM,iBAAiB,SAAU,MAAM,SAG7C,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.clearVersionCache = exports.cacheLatestVersion = exports.getCLIDetails = exports.VERSION_CACHE_INTERVAL = exports.VERSION_CACHE_KEY = void 0;
3
+ exports.clearVersionCache = exports.cacheLatestVersion = exports.supportedNodeVersion = exports.getCLIDetails = exports.VERSION_CACHE_INTERVAL = exports.VERSION_CACHE_KEY = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const latest_version_1 = tslib_1.__importDefault(require("latest-version"));
6
6
  exports.VERSION_CACHE_KEY = 'latest';
@@ -15,13 +15,14 @@ exports.getCLIDetails = () => {
15
15
  name: packageInfo.name,
16
16
  version: packageInfo.version,
17
17
  latest: latest,
18
- supportedNodeVersion: packageInfo.engines.node
18
+ compatibleNodeVersion: packageInfo.engines.node
19
19
  };
20
20
  }
21
21
  catch (_a) {
22
22
  return undefined;
23
23
  }
24
24
  };
25
+ exports.supportedNodeVersion = '14.x || 16.x';
25
26
  exports.cacheLatestVersion = async (name) => {
26
27
  const latest = await latest_version_1.default(name);
27
28
  const cachedConf = cli_shared_1.CachedConf.getCache(name);
@@ -0,0 +1,7 @@
1
+ import { UI } from '@forge/cli-shared';
2
+ export declare class AnalyticsSettingsView {
3
+ private readonly ui;
4
+ constructor(ui: UI);
5
+ promptForPreference(): Promise<boolean>;
6
+ }
7
+ //# sourceMappingURL=analytics-settings-view.d.ts.map
@@ -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"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AnalyticsSettingsView = void 0;
4
+ const cli_shared_1 = require("@forge/cli-shared");
5
+ const ANALYTICS_TRUE = 'Yes';
6
+ const ANALYTICS_FALSE = 'No';
7
+ class AnalyticsSettingsView {
8
+ constructor(ui) {
9
+ this.ui = ui;
10
+ }
11
+ async promptForPreference() {
12
+ this.ui.info(cli_shared_1.Text.settings.analytics.banner);
13
+ this.ui.emptyLine();
14
+ const value = await this.ui.promptForList(cli_shared_1.Text.settings.analytics.promptMessage, [ANALYTICS_TRUE, ANALYTICS_FALSE]);
15
+ return value === ANALYTICS_TRUE;
16
+ }
17
+ }
18
+ exports.AnalyticsSettingsView = AnalyticsSettingsView;
@@ -4,12 +4,18 @@ import { DeploymentResult } from '../register-deployment-commands';
4
4
  export declare class DeployView {
5
5
  private readonly ui;
6
6
  constructor(ui: UI);
7
+ getLogger(): UI;
7
8
  displayStart(environment: string): void;
8
9
  displayLintRunning(): void;
9
10
  displayOutdatedInstallationsMessage(): void;
10
11
  displayLintErrors(lintResults: LintResult[]): void;
11
12
  displayLintWarnings(warnings: number): void;
12
13
  displayNoLintProblems(): void;
13
- reportDeploymentProgress(name: string, environment: string, deployCallback: () => Promise<DeploymentResult>): Promise<DeploymentResult>;
14
+ displayConnectKeyChangeWarning(environment: string, migrationKey: string, connectKey: string): void;
15
+ displayConnectKeyDeleteWarning(environment: string): void;
16
+ displayMPACAppConnectKeyChangeError(mpacAppKey: string, connectKey: string): void;
17
+ promptToContinueDeletingConnectKey(): Promise<boolean>;
18
+ promptToContinueChangingConnectKey(): Promise<boolean>;
19
+ reportDeploymentProgress(id: string, environment: string, showDistributionPageLink: boolean, deployCallback: () => Promise<DeploymentResult>): Promise<DeploymentResult>;
14
20
  }
15
21
  //# sourceMappingURL=deploy-view.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deploy-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/deploy-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAuC,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAqB,UAAU,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,EAAE;IAE5B,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAIvC,kBAAkB,IAAI,IAAI;IAI1B,mCAAmC,IAAI,IAAI;IAK3C,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,IAAI;IAKlD,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI3C,qBAAqB,IAAI,IAAI;IAIvB,wBAAwB,CACnC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,GAC9C,OAAO,CAAC,gBAAgB,CAAC;CAS7B"}
1
+ {"version":3,"file":"deploy-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/deploy-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAuC,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAqB,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,EAAE;IAE5B,SAAS,IAAI,EAAE;IAIf,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAIvC,kBAAkB,IAAI,IAAI;IAI1B,mCAAmC,IAAI,IAAI;IAK3C,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,IAAI;IAKlD,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI3C,qBAAqB,IAAI,IAAI;IAI7B,8BAA8B,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAInG,8BAA8B,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAIzD,mCAAmC,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAI3E,kCAAkC,IAAI,OAAO,CAAC,OAAO,CAAC;IAItD,kCAAkC,IAAI,OAAO,CAAC,OAAO,CAAC;IAItD,wBAAwB,CACnC,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,MAAM,EACnB,wBAAwB,EAAE,OAAO,EACjC,cAAc,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,GAC9C,OAAO,CAAC,gBAAgB,CAAC;CAY7B"}
@@ -3,10 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DeployView = void 0;
4
4
  const cli_shared_1 = require("@forge/cli-shared");
5
5
  const lint_1 = require("@forge/lint");
6
+ const cs_ari_1 = require("@forge/util/packages/cs-ari");
6
7
  class DeployView {
7
8
  constructor(ui) {
8
9
  this.ui = ui;
9
10
  }
11
+ getLogger() {
12
+ return this.ui;
13
+ }
10
14
  displayStart(environment) {
11
15
  this.ui.info(cli_shared_1.Text.deploy.cmd.start1(environment, cli_shared_1.environmentToOption));
12
16
  }
@@ -27,9 +31,27 @@ class DeployView {
27
31
  displayNoLintProblems() {
28
32
  this.ui.info(cli_shared_1.LogColor.trace(cli_shared_1.Text.lint.noProblems) + '\n');
29
33
  }
30
- async reportDeploymentProgress(name, environment, deployCallback) {
31
- const result = await this.ui.displayProgress(() => deployCallback(), cli_shared_1.Text.deploy.cmd.start2(name, environment, cli_shared_1.environmentToOption), cli_shared_1.Text.deploy.cmd.success);
32
- this.ui.info(cli_shared_1.Text.deploy.cmd.successDetails(name, environment, cli_shared_1.environmentToOption));
34
+ displayConnectKeyChangeWarning(environment, migrationKey, connectKey) {
35
+ this.ui.warn(cli_shared_1.Text.deploy.connectKeyChange.connectKeyChangeWarning(environment, migrationKey, connectKey));
36
+ }
37
+ displayConnectKeyDeleteWarning(environment) {
38
+ this.ui.warn(cli_shared_1.Text.deploy.connectKeyChange.connectKeyDeleteWarning(environment));
39
+ }
40
+ displayMPACAppConnectKeyChangeError(mpacAppKey, connectKey) {
41
+ this.ui.info(cli_shared_1.Text.deploy.connectKeyChange.mpacAppConnectKeyChangeError(mpacAppKey, connectKey));
42
+ }
43
+ async promptToContinueDeletingConnectKey() {
44
+ return await this.ui.confirm(cli_shared_1.Text.deploy.connectKeyChange.continueDelete);
45
+ }
46
+ async promptToContinueChangingConnectKey() {
47
+ return await this.ui.confirm(cli_shared_1.Text.deploy.connectKeyChange.continueChange);
48
+ }
49
+ async reportDeploymentProgress(id, environment, showDistributionPageLink, deployCallback) {
50
+ const result = await this.ui.displayProgress(() => deployCallback(), cli_shared_1.Text.deploy.cmd.start2(environment, cli_shared_1.environmentToOption), cli_shared_1.Text.deploy.cmd.success);
51
+ this.ui.info(cli_shared_1.Text.deploy.cmd.successDetails(environment, cli_shared_1.environmentToOption));
52
+ if (environment === 'production' && showDistributionPageLink) {
53
+ this.ui.info(cli_shared_1.Text.deploy.cmd.distributePageLink(cs_ari_1.parseAppAri(cs_ari_1.parse(id)).appId));
54
+ }
33
55
  return result;
34
56
  }
35
57
  }
@@ -1,15 +1,17 @@
1
- import { Installation } from '../../service/installation-service';
2
1
  import { UI } from '@forge/cli-shared';
2
+ import { AppEnvironmentPermissions, Installation } from '../../service/installation-service';
3
3
  interface InstallOrUpgradeCommandText {
4
4
  listScopes: (scopes: string[]) => string;
5
- scopesDefaultEnvironment: string;
5
+ listEgressAddresses: (egressAddresses: string[]) => string;
6
+ permissionsMismatch: (environment: string) => string;
7
+ promptForPermissionsConfirmation: (permissionsMismatchInDevelopment: boolean) => string;
6
8
  }
7
9
  export declare class NoScopesError extends Error {
8
10
  }
9
11
  export declare class InstallView {
10
12
  private readonly ui;
11
13
  constructor(ui: UI);
12
- promptForScopesConfirmation(scopes: string[], environment: string, confirmScopes: boolean, text: InstallOrUpgradeCommandText): Promise<boolean>;
14
+ promptForPermissionsConfirmation({ scopes, egressAddresses, addedScopes }: AppEnvironmentPermissions, manifestScopes: string[], manifestEgressAddresses: string[], environment: string, confirmScopes: boolean, nonInteractive: boolean, text: InstallOrUpgradeCommandText): Promise<boolean>;
13
15
  promptForUpgrade(installations: Installation[]): Promise<Installation>;
14
16
  }
15
17
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"install-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/install-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAKL,EAAE,EAEH,MAAM,mBAAmB,CAAC;AAE3B,UAAU,2BAA2B;IACnC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC;IACzC,wBAAwB,EAAE,MAAM,CAAC;CAClC;AAED,qBAAa,aAAc,SAAQ,KAAK;CAAG;AAE3C,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,EAAE;IAEtB,2BAA2B,CACtC,MAAM,EAAE,MAAM,EAAE,EAChB,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,OAAO,EACtB,IAAI,EAAE,2BAA2B,GAChC,OAAO,CAAC,OAAO,CAAC;IAsBN,gBAAgB,CAAC,aAAa,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC;CAqBpF"}
1
+ {"version":3,"file":"install-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/install-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,EAAE,EAA8B,MAAM,mBAAmB,CAAC;AAGjH,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAE7F,UAAU,2BAA2B;IACnC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC;IACzC,mBAAmB,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC;IAC3D,mBAAmB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;IACrD,gCAAgC,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,MAAM,CAAC;CACzF;AAED,qBAAa,aAAc,SAAQ,KAAK;CAAG;AAE3C,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,EAAE;IAEtB,gCAAgC,CAC3C,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,EAAE,yBAAyB,EACnE,cAAc,EAAE,MAAM,EAAE,EACxB,uBAAuB,EAAE,MAAM,EAAE,EACjC,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,OAAO,EACtB,cAAc,EAAE,OAAO,EACvB,IAAI,EAAE,2BAA2B,GAChC,OAAO,CAAC,OAAO,CAAC;IAoCN,gBAAgB,CAAC,aAAa,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC;CAqBpF"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InstallView = exports.NoScopesError = void 0;
4
4
  const cli_shared_1 = require("@forge/cli-shared");
5
+ const lodash_1 = require("lodash");
5
6
  class NoScopesError extends Error {
6
7
  }
7
8
  exports.NoScopesError = NoScopesError;
@@ -9,19 +10,27 @@ class InstallView {
9
10
  constructor(ui) {
10
11
  this.ui = ui;
11
12
  }
12
- async promptForScopesConfirmation(scopes, environment, confirmScopes, text) {
13
- const isDefaultEnvironment = (env) => env === cli_shared_1.optionToEnvironment(cli_shared_1.DEFAULT_ENVIRONMENT_OPTION);
13
+ async promptForPermissionsConfirmation({ scopes, egressAddresses, addedScopes }, manifestScopes, manifestEgressAddresses, environment, confirmScopes, nonInteractive, text) {
14
14
  if (scopes.length === 0) {
15
15
  throw new NoScopesError();
16
16
  }
17
- if (isDefaultEnvironment(environment)) {
18
- this.ui.info(text.scopesDefaultEnvironment);
17
+ if (addedScopes.length)
18
+ this.ui.info(text.listScopes(addedScopes));
19
+ if (egressAddresses.length)
20
+ this.ui.info(text.listEgressAddresses(egressAddresses));
21
+ const cleanedManifestScopes = [...new Set(['read:me', ...manifestScopes])];
22
+ const groupedManifestEgressAddresses = [];
23
+ let permissionsMismatchWithManifest = false;
24
+ if (cli_shared_1.environmentToOption(environment) === cli_shared_1.DEFAULT_ENVIRONMENT_OPTION) {
25
+ const scopesMismatch = !lodash_1.isEqual([...cleanedManifestScopes].sort(), [...scopes].sort());
26
+ const egressAddressesMismatch = !lodash_1.isEqual([...groupedManifestEgressAddresses].sort(), [...egressAddresses].sort());
27
+ permissionsMismatchWithManifest = scopesMismatch || egressAddressesMismatch;
28
+ if (permissionsMismatchWithManifest) {
29
+ this.ui.warn(text.permissionsMismatch(cli_shared_1.environmentToOption(environment)));
30
+ }
19
31
  }
20
- else {
21
- this.ui.info(text.listScopes(scopes));
22
- }
23
- if (!confirmScopes) {
24
- const scopesConfirmationResult = await this.ui.confirm(cli_shared_1.Text.install.promptForScopesConfirmation);
32
+ if (!confirmScopes && !nonInteractive) {
33
+ const scopesConfirmationResult = await this.ui.confirm(text.promptForPermissionsConfirmation(permissionsMismatchWithManifest));
25
34
  if (scopesConfirmationResult)
26
35
  this.ui.emptyLine();
27
36
  return scopesConfirmationResult;
@@ -29,7 +38,7 @@ class InstallView {
29
38
  return true;
30
39
  }
31
40
  async promptForUpgrade(installations) {
32
- const installationIndex = await this.ui.promptForSingleChoiceTable(cli_shared_1.Text.upgradeContext.promptInstallation, cli_shared_1.Text.upgradeContext.overview, ['Environment', 'Site', 'Product', 'Scopes'], installations.map(({ id, environmentKey, product, site, version }) => ({
41
+ const installationIndex = await this.ui.promptForSingleChoiceTable(cli_shared_1.Text.upgradeContext.promptInstallation, cli_shared_1.Text.upgradeContext.overview, ['Environment', 'Site', 'Product', 'Version'], installations.map(({ id, environmentKey, product, site, version }) => ({
33
42
  names: [
34
43
  cli_shared_1.environmentToOption(environmentKey),
35
44
  site,
@@ -1,11 +1,12 @@
1
1
  import { UI } from '@forge/cli-shared';
2
- import { LintFixState, LintResult } from '@forge/lint';
2
+ import { LintFixState, LintLogger, LintResult } from '@forge/lint';
3
3
  export declare class LintView {
4
4
  private readonly ui;
5
5
  private lintResultReporter;
6
- constructor(ui: UI, lintResultReporter?: (logger: Pick<import("@forge/cli-shared").Logger, "info">, lintResults: LintResult[], showSummary?: boolean | undefined) => void);
6
+ constructor(ui: UI, lintResultReporter?: (logger: Pick<import("@forge/cli-shared/src").Logger, "info">, lintResults: LintResult[], showSummary?: boolean | undefined) => void);
7
7
  reportLintResult(results: LintResult[]): void;
8
8
  reportFixResult(result: LintFixState): void;
9
+ getLogger(): LintLogger;
9
10
  showBlurb(): void;
10
11
  }
11
12
  //# sourceMappingURL=lint-view.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lint-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/lint-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,EAAE,EAAY,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAqB,MAAM,aAAa,CAAC;AAE1E,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,EAAE;IAAM,OAAO,CAAC,kBAAkB;gBAAlC,EAAE,EAAE,EAAE,EAAU,kBAAkB,mIAAoB;IAE5E,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI;IAI7C,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAU3C,SAAS,IAAI,IAAI;CAGzB"}
1
+ {"version":3,"file":"lint-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/lint-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,EAAE,EAAY,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAqB,MAAM,aAAa,CAAC;AAEtF,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,EAAE;IAAM,OAAO,CAAC,kBAAkB;gBAAlC,EAAE,EAAE,EAAE,EAAU,kBAAkB,uIAAoB;IAE5E,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI;IAI7C,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAU3C,SAAS,IAAI,UAAU;IAIvB,SAAS,IAAI,IAAI;CAGzB"}
@@ -21,6 +21,9 @@ class LintView {
21
21
  this.ui.info(cli_shared_1.Text.lint.fixFollowUp);
22
22
  }
23
23
  }
24
+ getLogger() {
25
+ return this.ui;
26
+ }
24
27
  showBlurb() {
25
28
  this.ui.info(cli_shared_1.Text.lint.blurb);
26
29
  }
@@ -1,9 +1,10 @@
1
1
  import { UI } from '@forge/cli-shared';
2
- import { LintResult } from '@forge/lint';
2
+ import { LintLogger, LintResult } from '@forge/lint';
3
3
  export declare class LiteLintView {
4
4
  private readonly ui;
5
5
  private reporter;
6
- constructor(ui: UI, reporter?: (logger: Pick<import("@forge/cli-shared").Logger, "info">, lintResults: LintResult[], showSummary?: boolean | undefined) => void);
6
+ constructor(ui: UI, reporter?: (logger: Pick<import("@forge/cli-shared/src").Logger, "info">, lintResults: LintResult[], showSummary?: boolean | undefined) => void);
7
7
  reportErrors(report: LintResult[]): void;
8
+ getLogger(): LintLogger;
8
9
  }
9
10
  //# sourceMappingURL=lite-lint-view.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lite-lint-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/lite-lint-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAqB,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5D,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,EAAE;IAAM,OAAO,CAAC,QAAQ;gBAAxB,EAAE,EAAE,EAAE,EAAU,QAAQ,mIAAoB;IAElE,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI;CAIhD"}
1
+ {"version":3,"file":"lite-lint-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/lite-lint-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAqB,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAExE,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,EAAE;IAAM,OAAO,CAAC,QAAQ;gBAAxB,EAAE,EAAE,EAAE,EAAU,QAAQ,uIAAoB;IAElE,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI;IAKxC,SAAS,IAAI,UAAU;CAG/B"}
@@ -11,5 +11,8 @@ class LiteLintView {
11
11
  this.ui.emptyLine();
12
12
  this.reporter(this.ui, report, false);
13
13
  }
14
+ getLogger() {
15
+ return this.ui;
16
+ }
14
17
  }
15
18
  exports.LiteLintView = LiteLintView;
@@ -0,0 +1,8 @@
1
+ import { UI } from '@forge/cli-shared';
2
+ export declare class SettingsView {
3
+ private readonly ui;
4
+ constructor(ui: UI);
5
+ showSettings(preferences: [string, string, boolean | undefined][]): void;
6
+ setSuccess(setting: string, value: string): void;
7
+ }
8
+ //# sourceMappingURL=settings-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/settings-view.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAEvC,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,EAAE;IAE5B,YAAY,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC,EAAE;IAWjE,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAIjD"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SettingsView = 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
+ class SettingsView {
8
+ constructor(ui) {
9
+ this.ui = ui;
10
+ }
11
+ showSettings(preferences) {
12
+ const table = new cli_table3_1.default(Object.assign(Object.assign({}, cli_shared_1.TableStyle.default), { head: ['Setting', 'Description', 'Value'] }));
13
+ preferences.forEach(([preference, desc, value]) => table.push([preference, desc, value !== null && value !== void 0 ? value : 'Not set']));
14
+ this.ui.info(table.toString());
15
+ }
16
+ setSuccess(setting, value) {
17
+ this.ui.info(cli_shared_1.Text.settings.set.success(setting, value));
18
+ this.ui.emptyLine();
19
+ }
20
+ }
21
+ exports.SettingsView = SettingsView;
@@ -14,7 +14,7 @@ class DeployMonitorGraphqlClient {
14
14
  }
15
15
  async getDeployment({ appId, environmentKey, deploymentId }) {
16
16
  const result = await this.graphqlClient.query(`
17
- query appDeployment($appId: ID!, $environmentKey: String!, $id: ID!) {
17
+ query forge_cli_getApplicationDeploymentStatus($appId: ID!, $environmentKey: String!, $id: ID!) {
18
18
  appDeployment(appId: $appId, environmentKey: $environmentKey, id: $id) {
19
19
  status
20
20
  errorDetails {
@@ -1 +1 @@
1
- {"version":3,"file":"deployer.d.ts","sourceRoot":"","sources":["../../../src/deploy/deployer/deployer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAOjB,KAAK,EAEL,EAAE,EAEH,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAsB,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC/G,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAItE,qBAAa,wBAAyB,SAAQ,KAAK;CAAG;AACtD,qBAAa,sBAAuB,SAAQ,KAAK;CAAG;AACpD,qBAAa,mCAAoC,SAAQ,KAAK;CAAG;AAEjE,MAAM,WAAW,QAAQ;IACvB,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,sBAAsB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrG;AAyBD,qBAAa,gBAAiB,YAAW,QAAQ;IAE7C,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAJF,gBAAgB,EAAE,iBAAiB,EACnC,YAAY,EAAE,mBAAmB,EACjC,mBAAmB,EAAE,mBAAmB,EACxC,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,EAAE;IAGZ,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,sBAAsB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAMlG,QAAQ;IAcT,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;;;;YA2BpG,iBAAiB;IAa/B,OAAO,CAAC,gBAAgB;IAsBxB,OAAO,CAAC,0BAA0B;IA6BlC,OAAO,CAAC,gBAAgB;CAkBzB"}
1
+ {"version":3,"file":"deployer.d.ts","sourceRoot":"","sources":["../../../src/deploy/deployer/deployer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAOjB,KAAK,EAEL,EAAE,EAEH,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAsB,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC/G,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAItE,qBAAa,wBAAyB,SAAQ,KAAK;CAAG;AACtD,qBAAa,sBAAuB,SAAQ,KAAK;CAAG;AACpD,qBAAa,mCAAoC,SAAQ,KAAK;CAAG;AAEjE,MAAM,WAAW,QAAQ;IACvB,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,sBAAsB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrG;AAyBD,qBAAa,gBAAiB,YAAW,QAAQ;IAE7C,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAJF,gBAAgB,EAAE,iBAAiB,EACnC,YAAY,EAAE,mBAAmB,EACjC,mBAAmB,EAAE,mBAAmB,EACxC,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,EAAE;IAGZ,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,sBAAsB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAMlG,QAAQ;IAcT,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;;;;YA2BpG,iBAAiB;IAa/B,OAAO,CAAC,gBAAgB;IAsBxB,OAAO,CAAC,0BAA0B;IA6BlC,OAAO,CAAC,gBAAgB;CA+BzB"}
@@ -120,10 +120,26 @@ class ArtifactDeployer {
120
120
  };
121
121
  }
122
122
  handleErrorEvent(errorDetails) {
123
+ var _a;
123
124
  if (errorDetails) {
124
125
  const { code, message } = errorDetails;
125
126
  if (code === 'APP_CODE_SNAPSHOT_FAILED') {
126
- throw new AppSnapshotFailedError(cli_shared_1.Text.snapshot.error('App code error', message));
127
+ throw new AppSnapshotFailedError(cli_shared_1.Text.snapshot.error('App code snapshot error', message));
128
+ }
129
+ if (code === 'APP_CODE_SNAPSHOT_TIMEOUT') {
130
+ throw new AppSnapshotFailedError(cli_shared_1.Text.snapshot.timeout);
131
+ }
132
+ if (code === 'ENVIRONMENT_UPDATE_VALIDATION_FAILED') {
133
+ const causeMessage = (_a = errorDetails === null || errorDetails === void 0 ? void 0 : errorDetails.fields) === null || _a === void 0 ? void 0 : _a.validationResult.message.replace(/Upsert.*Details /, '');
134
+ if ((causeMessage === null || causeMessage === void 0 ? void 0 : causeMessage.startsWith('Invalid URL')) && causeMessage.includes('EGRESS')) {
135
+ throw new AppDeploymentFailedError(cli_shared_1.Text.deploy.egressURL.invalidURLError(causeMessage));
136
+ }
137
+ else if (causeMessage === null || causeMessage === void 0 ? void 0 : causeMessage.startsWith('Egress permission URL')) {
138
+ throw new AppDeploymentFailedError(cli_shared_1.Text.deploy.egressURL.tooManyURLCharactersError(causeMessage));
139
+ }
140
+ else if (causeMessage === null || causeMessage === void 0 ? void 0 : causeMessage.includes('permission URLs provided, exceeding')) {
141
+ throw new AppDeploymentFailedError(cli_shared_1.Text.deploy.egressURL.tooManyUrlsError(causeMessage));
142
+ }
127
143
  }
128
144
  if (code === 'HOSTED_RESOURCE_TOO_MANY_FILES') {
129
145
  throw new HostedResourceDeploymentFailedError(cli_shared_1.Text.hostedResources.error(message));
@@ -1 +1 @@
1
- {"version":3,"file":"trigger-deploy-graphql-client.d.ts","sourceRoot":"","sources":["../../../src/deploy/deployer/trigger-deploy-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA+D,MAAM,mBAAmB,CAAC;AAE/G,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACxD;AAED,qBAAa,iBAAkB,SAAQ,KAAK;;CAI3C;AAED,qBAAa,0BAA2B,YAAW,mBAAmB;IACxD,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,MAAM,CAAC,iBAAiB,EAAE,oBAAoB;CAsC5D"}
1
+ {"version":3,"file":"trigger-deploy-graphql-client.d.ts","sourceRoot":"","sources":["../../../src/deploy/deployer/trigger-deploy-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EAId,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACxD;AAED,qBAAa,iBAAkB,SAAQ,KAAK;;CAI3C;AAED,qBAAa,0BAA2B,YAAW,mBAAmB;IACxD,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,MAAM,CAAC,iBAAiB,EAAE,oBAAoB;CAuC5D"}
@@ -14,12 +14,14 @@ class TriggerDeployGraphQLClient {
14
14
  }
15
15
  async deploy(deploymentDetails) {
16
16
  const deployAppQuery = `
17
- mutation deployApp($input: CreateAppDeploymentInput!) {
17
+ mutation forge_cli_deployApplication($input: CreateAppDeploymentInput!) {
18
18
  createAppDeployment(input: $input) {
19
19
  success
20
- message
21
- errorDetails {
22
- code
20
+ errors {
21
+ message
22
+ extensions {
23
+ errorType
24
+ }
23
25
  }
24
26
  deployment {
25
27
  id
@@ -27,11 +29,12 @@ class TriggerDeployGraphQLClient {
27
29
  }
28
30
  }
29
31
  `;
30
- const { response: { createAppDeployment: { deployment, message, success, errorDetails } }, requestId } = await this.graphqlClient.mutate(deployAppQuery, {
32
+ const { response: { createAppDeployment: { deployment, success, errors } }, requestId } = await this.graphqlClient.mutate(deployAppQuery, {
31
33
  input: deploymentDetails
32
34
  });
35
+ const error = cli_shared_1.getError(errors);
33
36
  if (!success) {
34
- throw new cli_shared_1.GraphQlMutationError(`${message} (requestId: ${requestId || 'unknown'})`, errorDetails ? errorDetails.code : undefined);
37
+ throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code);
35
38
  }
36
39
  if (!deployment) {
37
40
  throw new NoDeploymentError();