@forge/cli 0.0.0-experimental-3b4aabe → 0.0.0-experimental-2b3dfe1

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 (267) hide show
  1. package/CHANGELOG.md +11 -7
  2. package/npm-shrinkwrap.json +196 -4237
  3. package/out/analytics-client/analytics-client.d.ts +0 -24
  4. package/out/analytics-client/analytics-client.d.ts.map +1 -1
  5. package/out/analytics-client/analytics-client.js +0 -115
  6. package/out/analytics-client/analytics-message-handler.d.ts +1 -5
  7. package/out/analytics-client/analytics-message-handler.d.ts.map +1 -1
  8. package/out/analytics-client/analytics-message-handler.js +2 -30
  9. package/out/autocomplete/autocomplete-config.json +2 -242
  10. package/out/bin/cli.d.ts +0 -1
  11. package/out/bin/cli.d.ts.map +1 -1
  12. package/out/bin/cli.js +1 -4
  13. package/out/bin/postinstall.d.ts +0 -1
  14. package/out/bin/postinstall.js +1 -22
  15. package/package.json +2 -7
  16. package/out/command-line/anon-user-id.d.ts +0 -3
  17. package/out/command-line/anon-user-id.d.ts.map +0 -1
  18. package/out/command-line/anon-user-id.js +0 -17
  19. package/out/command-line/command.d.ts +0 -81
  20. package/out/command-line/command.d.ts.map +0 -1
  21. package/out/command-line/command.js +0 -382
  22. package/out/command-line/controller/assertUnreachable.d.ts +0 -2
  23. package/out/command-line/controller/assertUnreachable.d.ts.map +0 -1
  24. package/out/command-line/controller/assertUnreachable.js +0 -7
  25. package/out/command-line/controller/autocomplete-controller.d.ts +0 -12
  26. package/out/command-line/controller/autocomplete-controller.d.ts.map +0 -1
  27. package/out/command-line/controller/autocomplete-controller.js +0 -54
  28. package/out/command-line/controller/deploy-controller.d.ts +0 -43
  29. package/out/command-line/controller/deploy-controller.d.ts.map +0 -1
  30. package/out/command-line/controller/deploy-controller.js +0 -139
  31. package/out/command-line/controller/feedback-controller.d.ts +0 -9
  32. package/out/command-line/controller/feedback-controller.d.ts.map +0 -1
  33. package/out/command-line/controller/feedback-controller.js +0 -19
  34. package/out/command-line/controller/getNodeVersion.d.ts +0 -2
  35. package/out/command-line/controller/getNodeVersion.d.ts.map +0 -1
  36. package/out/command-line/controller/getNodeVersion.js +0 -7
  37. package/out/command-line/controller/install-controller.d.ts +0 -35
  38. package/out/command-line/controller/install-controller.d.ts.map +0 -1
  39. package/out/command-line/controller/install-controller.js +0 -154
  40. package/out/command-line/controller/lint-controller.d.ts +0 -9
  41. package/out/command-line/controller/lint-controller.d.ts.map +0 -1
  42. package/out/command-line/controller/lint-controller.js +0 -20
  43. package/out/command-line/controller/pre-command-controller.d.ts +0 -25
  44. package/out/command-line/controller/pre-command-controller.d.ts.map +0 -1
  45. package/out/command-line/controller/pre-command-controller.js +0 -57
  46. package/out/command-line/controller/prerequisites-controller.d.ts +0 -11
  47. package/out/command-line/controller/prerequisites-controller.d.ts.map +0 -1
  48. package/out/command-line/controller/prerequisites-controller.js +0 -34
  49. package/out/command-line/controller/settings-controller.d.ts +0 -19
  50. package/out/command-line/controller/settings-controller.d.ts.map +0 -1
  51. package/out/command-line/controller/settings-controller.js +0 -48
  52. package/out/command-line/controller/stubController.d.ts +0 -9
  53. package/out/command-line/controller/stubController.d.ts.map +0 -1
  54. package/out/command-line/controller/stubController.js +0 -15
  55. package/out/command-line/controller/tunnel-controller.d.ts +0 -14
  56. package/out/command-line/controller/tunnel-controller.d.ts.map +0 -1
  57. package/out/command-line/controller/tunnel-controller.js +0 -43
  58. package/out/command-line/dependency-injection.d.ts +0 -69
  59. package/out/command-line/dependency-injection.d.ts.map +0 -1
  60. package/out/command-line/dependency-injection.js +0 -188
  61. package/out/command-line/environment.d.ts +0 -2
  62. package/out/command-line/environment.d.ts.map +0 -1
  63. package/out/command-line/environment.js +0 -15
  64. package/out/command-line/errors.d.ts +0 -6
  65. package/out/command-line/errors.d.ts.map +0 -1
  66. package/out/command-line/errors.js +0 -12
  67. package/out/command-line/index.d.ts +0 -5
  68. package/out/command-line/index.d.ts.map +0 -1
  69. package/out/command-line/index.js +0 -66
  70. package/out/command-line/register-app-commands.d.ts +0 -10
  71. package/out/command-line/register-app-commands.d.ts.map +0 -1
  72. package/out/command-line/register-app-commands.js +0 -128
  73. package/out/command-line/register-authentication-command.d.ts +0 -16
  74. package/out/command-line/register-authentication-command.d.ts.map +0 -1
  75. package/out/command-line/register-authentication-command.js +0 -92
  76. package/out/command-line/register-autocomplete-commands.d.ts +0 -3
  77. package/out/command-line/register-autocomplete-commands.d.ts.map +0 -1
  78. package/out/command-line/register-autocomplete-commands.js +0 -13
  79. package/out/command-line/register-deployment-commands.d.ts +0 -22
  80. package/out/command-line/register-deployment-commands.d.ts.map +0 -1
  81. package/out/command-line/register-deployment-commands.js +0 -15
  82. package/out/command-line/register-environment-variables-commands.d.ts +0 -3
  83. package/out/command-line/register-environment-variables-commands.d.ts.map +0 -1
  84. package/out/command-line/register-environment-variables-commands.js +0 -99
  85. package/out/command-line/register-feedback-commands.d.ts +0 -3
  86. package/out/command-line/register-feedback-commands.d.ts.map +0 -1
  87. package/out/command-line/register-feedback-commands.js +0 -31
  88. package/out/command-line/register-installation-commands.d.ts +0 -6
  89. package/out/command-line/register-installation-commands.d.ts.map +0 -1
  90. package/out/command-line/register-installation-commands.js +0 -140
  91. package/out/command-line/register-lint-command.d.ts +0 -8
  92. package/out/command-line/register-lint-command.d.ts.map +0 -1
  93. package/out/command-line/register-lint-command.js +0 -15
  94. package/out/command-line/register-log-commands.d.ts +0 -4
  95. package/out/command-line/register-log-commands.d.ts.map +0 -1
  96. package/out/command-line/register-log-commands.js +0 -138
  97. package/out/command-line/register-providers-commands.d.ts +0 -3
  98. package/out/command-line/register-providers-commands.d.ts.map +0 -1
  99. package/out/command-line/register-providers-commands.js +0 -43
  100. package/out/command-line/register-settings-commands.d.ts +0 -3
  101. package/out/command-line/register-settings-commands.d.ts.map +0 -1
  102. package/out/command-line/register-settings-commands.js +0 -37
  103. package/out/command-line/register-tunnel-commands.d.ts +0 -3
  104. package/out/command-line/register-tunnel-commands.d.ts.map +0 -1
  105. package/out/command-line/register-tunnel-commands.js +0 -14
  106. package/out/command-line/register-webtrigger-commands.d.ts +0 -3
  107. package/out/command-line/register-webtrigger-commands.d.ts.map +0 -1
  108. package/out/command-line/register-webtrigger-commands.js +0 -55
  109. package/out/command-line/unique-machine-id.d.ts +0 -3
  110. package/out/command-line/unique-machine-id.d.ts.map +0 -1
  111. package/out/command-line/unique-machine-id.js +0 -18
  112. package/out/command-line/version-info.d.ts +0 -8
  113. package/out/command-line/version-info.d.ts.map +0 -1
  114. package/out/command-line/version-info.js +0 -34
  115. package/out/command-line/view/analytics-settings-view.d.ts +0 -7
  116. package/out/command-line/view/analytics-settings-view.d.ts.map +0 -1
  117. package/out/command-line/view/analytics-settings-view.js +0 -18
  118. package/out/command-line/view/deploy-view.d.ts +0 -21
  119. package/out/command-line/view/deploy-view.d.ts.map +0 -1
  120. package/out/command-line/view/deploy-view.js +0 -58
  121. package/out/command-line/view/install-view.d.ts +0 -18
  122. package/out/command-line/view/install-view.d.ts.map +0 -1
  123. package/out/command-line/view/install-view.js +0 -55
  124. package/out/command-line/view/lint-view.d.ts +0 -12
  125. package/out/command-line/view/lint-view.d.ts.map +0 -1
  126. package/out/command-line/view/lint-view.js +0 -31
  127. package/out/command-line/view/lite-lint-view.d.ts +0 -10
  128. package/out/command-line/view/lite-lint-view.d.ts.map +0 -1
  129. package/out/command-line/view/lite-lint-view.js +0 -18
  130. package/out/command-line/view/settings-view.d.ts +0 -8
  131. package/out/command-line/view/settings-view.d.ts.map +0 -1
  132. package/out/command-line/view/settings-view.js +0 -21
  133. package/out/command-line/view/tunnel-view.d.ts +0 -18
  134. package/out/command-line/view/tunnel-view.d.ts.map +0 -1
  135. package/out/command-line/view/tunnel-view.js +0 -89
  136. package/out/deploy/deployer/deploy-monitor-graphql-client.d.ts +0 -24
  137. package/out/deploy/deployer/deploy-monitor-graphql-client.d.ts.map +0 -1
  138. package/out/deploy/deployer/deploy-monitor-graphql-client.js +0 -57
  139. package/out/deploy/deployer/deployer.d.ts +0 -31
  140. package/out/deploy/deployer/deployer.d.ts.map +0 -1
  141. package/out/deploy/deployer/deployer.js +0 -154
  142. package/out/deploy/deployer/index.d.ts +0 -4
  143. package/out/deploy/deployer/index.d.ts.map +0 -1
  144. package/out/deploy/deployer/index.js +0 -6
  145. package/out/deploy/deployer/trigger-deploy-graphql-client.d.ts +0 -19
  146. package/out/deploy/deployer/trigger-deploy-graphql-client.d.ts.map +0 -1
  147. package/out/deploy/deployer/trigger-deploy-graphql-client.js +0 -45
  148. package/out/deploy/index.d.ts +0 -5
  149. package/out/deploy/index.d.ts.map +0 -1
  150. package/out/deploy/index.js +0 -7
  151. package/out/deploy/package-upload-deploy.d.ts +0 -18
  152. package/out/deploy/package-upload-deploy.d.ts.map +0 -1
  153. package/out/deploy/package-upload-deploy.js +0 -28
  154. package/out/deploy/packager/archiver.d.ts +0 -24
  155. package/out/deploy/packager/archiver.d.ts.map +0 -1
  156. package/out/deploy/packager/archiver.js +0 -62
  157. package/out/deploy/packager/index.d.ts +0 -3
  158. package/out/deploy/packager/index.d.ts.map +0 -1
  159. package/out/deploy/packager/index.js +0 -5
  160. package/out/deploy/packager/packager.d.ts +0 -35
  161. package/out/deploy/packager/packager.d.ts.map +0 -1
  162. package/out/deploy/packager/packager.js +0 -61
  163. package/out/deploy/uploader/artifact-graphql-client.d.ts +0 -26
  164. package/out/deploy/uploader/artifact-graphql-client.d.ts.map +0 -1
  165. package/out/deploy/uploader/artifact-graphql-client.js +0 -92
  166. package/out/deploy/uploader/index.d.ts +0 -3
  167. package/out/deploy/uploader/index.d.ts.map +0 -1
  168. package/out/deploy/uploader/index.js +0 -5
  169. package/out/deploy/uploader/uploader.d.ts +0 -19
  170. package/out/deploy/uploader/uploader.d.ts.map +0 -1
  171. package/out/deploy/uploader/uploader.js +0 -43
  172. package/out/environment-variables/delete-environment-variable.d.ts +0 -18
  173. package/out/environment-variables/delete-environment-variable.d.ts.map +0 -1
  174. package/out/environment-variables/delete-environment-variable.js +0 -14
  175. package/out/environment-variables/graphql-client.d.ts +0 -16
  176. package/out/environment-variables/graphql-client.d.ts.map +0 -1
  177. package/out/environment-variables/graphql-client.js +0 -105
  178. package/out/environment-variables/list-environment-variables.d.ts +0 -22
  179. package/out/environment-variables/list-environment-variables.d.ts.map +0 -1
  180. package/out/environment-variables/list-environment-variables.js +0 -14
  181. package/out/environment-variables/set-environment-variable.d.ts +0 -20
  182. package/out/environment-variables/set-environment-variable.d.ts.map +0 -1
  183. package/out/environment-variables/set-environment-variable.js +0 -14
  184. package/out/installations/graphql-client.d.ts +0 -60
  185. package/out/installations/graphql-client.d.ts.map +0 -1
  186. package/out/installations/graphql-client.js +0 -408
  187. package/out/installations/install-app-site.d.ts +0 -21
  188. package/out/installations/install-app-site.d.ts.map +0 -1
  189. package/out/installations/install-app-site.js +0 -19
  190. package/out/installations/shared.d.ts +0 -5
  191. package/out/installations/shared.d.ts.map +0 -1
  192. package/out/installations/shared.js +0 -19
  193. package/out/installations/uninstall-app.d.ts +0 -25
  194. package/out/installations/uninstall-app.d.ts.map +0 -1
  195. package/out/installations/uninstall-app.js +0 -43
  196. package/out/migration-keys/graphql-client.d.ts +0 -8
  197. package/out/migration-keys/graphql-client.d.ts.map +0 -1
  198. package/out/migration-keys/graphql-client.js +0 -55
  199. package/out/providers/configure-provider.d.ts +0 -19
  200. package/out/providers/configure-provider.d.ts.map +0 -1
  201. package/out/providers/configure-provider.js +0 -14
  202. package/out/providers/graphql-client.d.ts +0 -12
  203. package/out/providers/graphql-client.d.ts.map +0 -1
  204. package/out/providers/graphql-client.js +0 -47
  205. package/out/service/cached-config-service.d.ts +0 -8
  206. package/out/service/cached-config-service.d.ts.map +0 -1
  207. package/out/service/cached-config-service.js +0 -16
  208. package/out/service/command-suggestion-service.d.ts +0 -4
  209. package/out/service/command-suggestion-service.d.ts.map +0 -1
  210. package/out/service/command-suggestion-service.js +0 -17
  211. package/out/service/docker-service.d.ts +0 -24
  212. package/out/service/docker-service.d.ts.map +0 -1
  213. package/out/service/docker-service.js +0 -71
  214. package/out/service/installation-service.d.ts +0 -51
  215. package/out/service/installation-service.d.ts.map +0 -1
  216. package/out/service/installation-service.js +0 -89
  217. package/out/service/lint-service.d.ts +0 -23
  218. package/out/service/lint-service.d.ts.map +0 -1
  219. package/out/service/lint-service.js +0 -39
  220. package/out/service/lite-lint-service.d.ts +0 -10
  221. package/out/service/lite-lint-service.d.ts.map +0 -1
  222. package/out/service/lite-lint-service.js +0 -27
  223. package/out/service/migration-keys-service.d.ts +0 -19
  224. package/out/service/migration-keys-service.d.ts.map +0 -1
  225. package/out/service/migration-keys-service.js +0 -14
  226. package/out/service/port-finding-service.d.ts +0 -12
  227. package/out/service/port-finding-service.d.ts.map +0 -1
  228. package/out/service/port-finding-service.js +0 -34
  229. package/out/service/resource-packaging-service.d.ts +0 -46
  230. package/out/service/resource-packaging-service.d.ts.map +0 -1
  231. package/out/service/resource-packaging-service.js +0 -128
  232. package/out/service/resources-uploader-service.d.ts +0 -16
  233. package/out/service/resources-uploader-service.d.ts.map +0 -1
  234. package/out/service/resources-uploader-service.js +0 -34
  235. package/out/service/tunnel-analytics-service.d.ts +0 -11
  236. package/out/service/tunnel-analytics-service.d.ts.map +0 -1
  237. package/out/service/tunnel-analytics-service.js +0 -24
  238. package/out/service/tunnel-service.d.ts +0 -49
  239. package/out/service/tunnel-service.d.ts.map +0 -1
  240. package/out/service/tunnel-service.js +0 -190
  241. package/out/webtrigger/get-webtrigger-url.d.ts +0 -27
  242. package/out/webtrigger/get-webtrigger-url.d.ts.map +0 -1
  243. package/out/webtrigger/get-webtrigger-url.js +0 -26
  244. package/out/webtrigger/graphql-client.d.ts +0 -14
  245. package/out/webtrigger/graphql-client.d.ts.map +0 -1
  246. package/out/webtrigger/graphql-client.js +0 -52
  247. package/out/workers/analytics-message-worker.d.ts +0 -12
  248. package/out/workers/analytics-message-worker.d.ts.map +0 -1
  249. package/out/workers/analytics-message-worker.js +0 -29
  250. package/out/workers/forge-cli-workers.d.ts +0 -2
  251. package/out/workers/forge-cli-workers.d.ts.map +0 -1
  252. package/out/workers/forge-cli-workers.js +0 -21
  253. package/out/workers/tunnel-clean-up-worker.d.ts +0 -8
  254. package/out/workers/tunnel-clean-up-worker.d.ts.map +0 -1
  255. package/out/workers/tunnel-clean-up-worker.js +0 -31
  256. package/out/workers/version-check-worker.d.ts +0 -8
  257. package/out/workers/version-check-worker.d.ts.map +0 -1
  258. package/out/workers/version-check-worker.js +0 -20
  259. package/out/workers/worker-info.d.ts +0 -8
  260. package/out/workers/worker-info.d.ts.map +0 -1
  261. package/out/workers/worker-info.js +0 -14
  262. package/out/workers/worker.d.ts +0 -6
  263. package/out/workers/worker.d.ts.map +0 -1
  264. package/out/workers/worker.js +0 -7
  265. package/out/workers/workers-starter.d.ts +0 -5
  266. package/out/workers/workers-starter.d.ts.map +0 -1
  267. package/out/workers/workers-starter.js +0 -22
@@ -1,382 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Command = exports.WrapperError = void 0;
4
- const tslib_1 = require("tslib");
5
- const commander_1 = tslib_1.__importStar(require("commander"));
6
- const semver_1 = tslib_1.__importDefault(require("semver"));
7
- const cli_shared_1 = require("@forge/cli-shared");
8
- const cli_shared_2 = require("@forge/cli-shared");
9
- const cli_shared_3 = require("@forge/cli-shared");
10
- const environment_1 = require("./environment");
11
- const cli_shared_4 = require("@forge/cli-shared");
12
- const version_info_1 = require("./version-info");
13
- const anon_user_id_1 = require("./anon-user-id");
14
- const errors_1 = require("./errors");
15
- const command_suggestion_service_1 = tslib_1.__importDefault(require("../service/command-suggestion-service"));
16
- class WrapperError extends commander_1.CommanderError {
17
- constructor(error, commandName) {
18
- super(error.exitCode, error.code, error.message);
19
- this.getCommandName = () => this.commandName;
20
- this.commandName = commandName;
21
- }
22
- }
23
- exports.WrapperError = WrapperError;
24
- const isErrorWithAnalytics = (e) => {
25
- return e.getAttributes !== undefined;
26
- };
27
- class Command {
28
- constructor(ui, analyticsClient, preCommandController, cliDetails, cmd, expectsArguments = false, analyticsName) {
29
- this.ui = ui;
30
- this.analyticsClient = analyticsClient;
31
- this.preCommandController = preCommandController;
32
- this.cliDetails = cliDetails;
33
- this.expectsArguments = expectsArguments;
34
- this.analyticsName = analyticsName;
35
- this.requiresAuthentication = true;
36
- this.requiresAnalyticsConsent = true;
37
- this.requiredOptionFlags = [];
38
- this.preconditionFn = [];
39
- this.options = [];
40
- this.commands = [];
41
- this.exitOverride = (listener) => {
42
- this.cmd.exitOverride((err) => listener(err));
43
- return this;
44
- };
45
- this.actionProcessor = async (cb, ...args) => {
46
- var _a, _b, _c;
47
- if (this.newCommand) {
48
- this.ui.error(new Error(cli_shared_3.Text.deprecate(this.newCommand)));
49
- }
50
- const cmdName = this.cmd.name();
51
- let cred = anon_user_id_1.getAnonId(true);
52
- let attributes = {};
53
- try {
54
- if (!this.expectsArguments && args.length > 2) {
55
- throw new cli_shared_3.ValidationError(cli_shared_3.Text.extraArguments(cmdName));
56
- }
57
- const [options] = args;
58
- if (options === null || options === void 0 ? void 0 : options.nonInteractive) {
59
- if (!this.satisfiesNonInteractiveOptions(options)) {
60
- throw new cli_shared_3.ValidationError(cli_shared_3.Text.nonInteractive.error.missingRequiredOption(cmdName, this.requiredOptionFlags));
61
- }
62
- }
63
- if (this.requiresAnalyticsConsent) {
64
- await this.preCommandController.verifyAnalyticsPreferences((_a = options === null || options === void 0 ? void 0 : options.nonInteractive) !== null && _a !== void 0 ? _a : false)();
65
- }
66
- this.checkVersion();
67
- if (this.cliDetails) {
68
- attributes = { version: this.cliDetails.version, latest: this.cliDetails.latest };
69
- }
70
- const preconditionCheckAttributes = await this.checkPreconditions(...args);
71
- attributes = Object.assign(Object.assign({}, attributes), preconditionCheckAttributes);
72
- const actualCred = await this.checkAuthentication();
73
- if (actualCred) {
74
- cred = actualCred;
75
- }
76
- const result = await cb(...args);
77
- if (result) {
78
- attributes = Object.assign(Object.assign({}, attributes), result.analytics);
79
- if (result.creds) {
80
- cred = result.creds;
81
- }
82
- }
83
- this.analyticsClient.reportSuccess((_b = this.analyticsName) !== null && _b !== void 0 ? _b : cmdName, cred, attributes);
84
- }
85
- catch (e) {
86
- if (isErrorWithAnalytics(e)) {
87
- attributes = Object.assign(Object.assign({}, e.getAttributes()), attributes);
88
- }
89
- if (e instanceof errors_1.DeferredErrors) {
90
- e.getErrors().forEach((error) => { var _a; return this.analyticsClient.reportFailure((_a = this.analyticsName) !== null && _a !== void 0 ? _a : cmdName, cred, attributes, error); });
91
- process.exit(1);
92
- }
93
- else {
94
- this.analyticsClient.reportFailure((_c = this.analyticsName) !== null && _c !== void 0 ? _c : cmdName, cred, attributes, e);
95
- cli_shared_4.exitOnError(this.ui)(e);
96
- }
97
- }
98
- };
99
- this.outputRelevantHelp = (argv) => {
100
- this.findLastValidCommand(argv).command.outputHelp();
101
- };
102
- this.cmd = cmd || new commander_1.default.Command();
103
- }
104
- get verbose() {
105
- return this.cmd.opts().verbose;
106
- }
107
- version(str, flags) {
108
- this.cmd.version(str, flags);
109
- flags = flags || '-V, --version';
110
- const versionOption = new commander_1.Option(flags, 'output the version number');
111
- this.options.push(versionOption);
112
- return this;
113
- }
114
- command(name, opts) {
115
- const cmd = this.cmd
116
- .command(name, opts)
117
- .allowUnknownOption(false)
118
- .allowExcessArguments(false);
119
- const trimmedName = name.trim();
120
- const expectsArguments = trimmedName.endsWith(']') || trimmedName.endsWith('>');
121
- const subCommand = new Command(this.ui, this.analyticsClient, this.preCommandController, this.cliDetails, cmd, expectsArguments, Command.concatenateNames(this.analyticsName, cmd.name()));
122
- subCommand.option('--verbose', cli_shared_3.Text.optionVerbose);
123
- subCommand.exitOverride((err) => {
124
- throw new WrapperError(err, subCommand.cmd.name());
125
- });
126
- this.commands.push(subCommand);
127
- return subCommand;
128
- }
129
- deprecatedCommand(oldName, newName, stubController) {
130
- this.command(oldName, { hidden: true })
131
- .requireNoAuthentication()
132
- .requireNoAnalyticsConsent()
133
- .action(() => stubController.run({ oldName, newName }));
134
- }
135
- getAnalyticsName() {
136
- return this.analyticsName;
137
- }
138
- deprecate(newCommand) {
139
- this.newCommand = newCommand;
140
- return this;
141
- }
142
- description(desc) {
143
- this.cmd.description(desc);
144
- return this;
145
- }
146
- option(flags, description, fn, defaultValue) {
147
- this.cmd.option(flags, description, fn, defaultValue);
148
- const option = new commander_1.Option(flags, description);
149
- if (typeof fn === 'function') {
150
- option.default(defaultValue).argParser(fn);
151
- }
152
- else {
153
- option.default(fn);
154
- }
155
- this.options.push(option);
156
- return this;
157
- }
158
- precondition(fn) {
159
- this.preconditionFn.push(fn);
160
- return this;
161
- }
162
- requireManifestFile() {
163
- this.precondition(this.preCommandController.verifyManifestExists());
164
- return this;
165
- }
166
- requireAppId() {
167
- this.precondition(this.preCommandController.verifyManifestExistsWithAppConfig());
168
- return this;
169
- }
170
- nonInteractiveOption(...args) {
171
- this.requiredOptionFlags = args;
172
- this.cmd.option('--non-interactive', cli_shared_3.Text.nonInteractive.description);
173
- return this;
174
- }
175
- action(fn) {
176
- this.cmd.action((...args) => this.actionProcessor(fn, ...args));
177
- return this;
178
- }
179
- async parse(argv) {
180
- try {
181
- this.assertValidArgs(argv);
182
- this.cmd.parse(argv);
183
- }
184
- catch (err) {
185
- if (Command.isHelpTriggered(err)) {
186
- if (Command.isError(err)) {
187
- this.outputRelevantHelp(argv);
188
- }
189
- return Command.reportHelp(this, err);
190
- }
191
- if (Command.isVersionTriggered(err)) {
192
- return;
193
- }
194
- if (Command.isUnknownCommand(err) || Command.isExcessCommands(err)) {
195
- this.unknownCommand(argv);
196
- return;
197
- }
198
- return cli_shared_4.exitOnError(this.ui)(err);
199
- }
200
- }
201
- getDefinedCommands() {
202
- return this.cmd.commands;
203
- }
204
- getDefinedOptions() {
205
- return this.options;
206
- }
207
- getCmdName() {
208
- return this.cmd.name();
209
- }
210
- getCommands() {
211
- return this.commands;
212
- }
213
- environmentOption() {
214
- this.option('-e, --environment [environment]', cli_shared_3.Text.env.option(cli_shared_2.DEFAULT_ENVIRONMENT_OPTION, cli_shared_2.VALID_ENVIRONMENT_OPTIONS));
215
- this.precondition(() => {
216
- this.cmd.opts().environment = environment_1.checkEnvironmentOption(this.cmd.opts().environment || cli_shared_2.DEFAULT_ENVIRONMENT_OPTION);
217
- return { appEnv: this.cmd.opts().environment };
218
- });
219
- return this;
220
- }
221
- siteAndProductOption() {
222
- this.option('-s, --site [site]', cli_shared_3.Text.optionSite);
223
- this.option('-p, --product [product]', cli_shared_3.Text.optionProduct(cli_shared_2.SUPPORTED_PRODUCTS));
224
- this.precondition(() => {
225
- return this.validateContext();
226
- });
227
- return this;
228
- }
229
- requireNoAuthentication() {
230
- this.requiresAuthentication = false;
231
- return this;
232
- }
233
- requireNoAnalyticsConsent() {
234
- this.requiresAnalyticsConsent = false;
235
- return this;
236
- }
237
- satisfiesNonInteractiveOptions(options) {
238
- const optionKeys = Object.keys(options);
239
- const requiredOptionKeys = [...this.requiredOptionFlags.map((arg) => new commander_1.Option(arg).attributeName())];
240
- return requiredOptionKeys.every((requiredOption) => optionKeys.includes(requiredOption));
241
- }
242
- configureOutput(obj) {
243
- this.cmd.configureOutput(obj);
244
- return this;
245
- }
246
- async checkPreconditions(...args) {
247
- let attributes = {};
248
- for (const precondition of this.preconditionFn) {
249
- const extra = await precondition(...args);
250
- attributes = Object.assign(Object.assign({}, attributes), extra);
251
- }
252
- return attributes;
253
- }
254
- async checkAuthentication() {
255
- if (this.requiresAuthentication) {
256
- const credentialsGetter = cli_shared_1.getCredentialsStoreProvider(this.ui);
257
- return credentialsGetter.getCredentials();
258
- }
259
- return undefined;
260
- }
261
- checkVersion() {
262
- if (!this.cliDetails ||
263
- !this.cliDetails.latest ||
264
- !semver_1.default.valid(this.cliDetails.version) ||
265
- !semver_1.default.valid(this.cliDetails.latest)) {
266
- return;
267
- }
268
- if (semver_1.default.gt(this.cliDetails.latest, this.cliDetails.version)) {
269
- this.ui.warn(cli_shared_3.Text.error.outdatedCLIVersion(this.cliDetails.version, this.cliDetails.latest));
270
- }
271
- else if (semver_1.default.gt(this.cliDetails.version, this.cliDetails.latest)) {
272
- version_info_1.clearVersionCache(this.cliDetails.name);
273
- }
274
- }
275
- async validateContext() {
276
- if (this.cmd.opts().product) {
277
- const capitalizedProduct = cli_shared_2.capitalizeProduct(this.cmd.opts().product);
278
- if (!cli_shared_2.isSuppportedProduct(capitalizedProduct)) {
279
- throw new cli_shared_3.ValidationError(cli_shared_3.Text.error.invalidProduct);
280
- }
281
- this.cmd.opts().product = capitalizedProduct;
282
- }
283
- let trySite;
284
- if (this.cmd.opts().site) {
285
- trySite = this.cmd.opts().site;
286
- }
287
- this.cmd.opts().site = trySite ? cli_shared_2.validateSite(trySite) : undefined;
288
- return { product: this.cmd.opts().product };
289
- }
290
- findLastValidCommand(argv) {
291
- let command = this.cmd;
292
- for (const [index, arg] of argv.slice(2).entries()) {
293
- const commandMatch = command.commands.find((cmd) => cmd.name() === arg);
294
- if (!commandMatch) {
295
- return {
296
- command,
297
- index: index + 1
298
- };
299
- }
300
- command = commandMatch;
301
- }
302
- return {
303
- command,
304
- index: 1
305
- };
306
- }
307
- unknownCommand(argv) {
308
- const errorMessage = [];
309
- const { command: lastCommand, index: lastCommandIndex } = this.findLastValidCommand(argv);
310
- const badLastArg = argv[lastCommandIndex + 1];
311
- const suggestionService = new command_suggestion_service_1.default();
312
- const suggestions = suggestionService.getSuggestions(badLastArg, lastCommand.commands
313
- .filter((cmd) => {
314
- return cmd._hidden !== true;
315
- })
316
- .map((cmd) => cmd.name()));
317
- errorMessage.push(cli_shared_3.Text.invalidCmd(argv.slice(2, lastCommandIndex + 2).join(' ')));
318
- if (suggestions.length) {
319
- errorMessage.push(`Did you mean:`);
320
- const suggestionsPrefixed = suggestions.map((suggestion) => [...argv.slice(2, lastCommandIndex + 1), suggestion].join(' '));
321
- errorMessage.push(suggestionsPrefixed.join('\n'));
322
- errorMessage.push(cli_shared_3.Text.invalidCmdHelp);
323
- this.ui.info(errorMessage.join('\n\n'));
324
- }
325
- else {
326
- errorMessage.push(cli_shared_3.Text.invalidCmdHelp);
327
- this.ui.error(new Error(errorMessage.join(' ')));
328
- }
329
- }
330
- assertValidArgs(argv) {
331
- const args = argv.slice(2);
332
- let commands = this.cmd.commands;
333
- while (args[0] && !args[0].startsWith('-')) {
334
- if (args[0] === 'help') {
335
- return;
336
- }
337
- const commandMatch = commands.find((cmd) => cmd.name() === args[0]);
338
- if (!commandMatch) {
339
- throw new commander_1.default.CommanderError(1, 'commander.unknownCommand', `error: unknown command '${args[0]}'.`);
340
- }
341
- commands = commandMatch.commands;
342
- args.shift();
343
- if (commands.length === 0) {
344
- break;
345
- }
346
- }
347
- }
348
- }
349
- exports.Command = Command;
350
- Command.reportHelp = async (cmd, cmdError) => {
351
- try {
352
- let cred = anon_user_id_1.getAnonId(true);
353
- try {
354
- const credentialsGetter = cli_shared_1.getCredentialsStoreProvider(cmd.ui);
355
- cred = await credentialsGetter.getCredentials();
356
- }
357
- catch (noTokenError) {
358
- }
359
- cmd.analyticsClient.reportSuccess('help', cred, { command: cmdError.getCommandName() });
360
- }
361
- catch (err) {
362
- }
363
- return;
364
- };
365
- Command.isError = (cmdError) => {
366
- return cmdError.exitCode === 1;
367
- };
368
- Command.isHelpTriggered = (cmdError) => {
369
- return ['commander.helpDisplayed', 'commander.help'].includes(cmdError.code);
370
- };
371
- Command.isVersionTriggered = (cmdError) => {
372
- return 'commander.version' === cmdError.code;
373
- };
374
- Command.isUnknownCommand = (cmdError) => {
375
- return cmdError.code === 'commander.unknownCommand';
376
- };
377
- Command.isExcessCommands = (cmdError) => {
378
- return cmdError.code === 'commander.excessArguments';
379
- };
380
- Command.concatenateNames = (parent, subcommand) => {
381
- return parent ? `${parent}:${subcommand}` : subcommand;
382
- };
@@ -1,2 +0,0 @@
1
- export declare function assertUnreachable(x: never): never;
2
- //# sourceMappingURL=assertUnreachable.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assertUnreachable.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/assertUnreachable.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,CAEjD"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.assertUnreachable = void 0;
4
- function assertUnreachable(x) {
5
- throw new Error("Didn't expect to get here");
6
- }
7
- exports.assertUnreachable = assertUnreachable;
@@ -1,12 +0,0 @@
1
- import { UI } from '@forge/cli-shared';
2
- export declare enum Argument {
3
- install = "install",
4
- uninstall = "uninstall"
5
- }
6
- export declare function assertNodeVersionSupported(version?: string): void;
7
- export declare class AutocompleteController {
8
- private readonly ui;
9
- constructor(ui: UI);
10
- run(arg: string): Promise<void>;
11
- }
12
- //# sourceMappingURL=autocomplete-controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"autocomplete-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/autocomplete-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,EAAE,EAAmB,MAAM,mBAAmB,CAAC;AAK9D,oBAAY,QAAQ;IAClB,OAAO,YAAY;IACnB,SAAS,cAAc;CACxB;AAQD,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,MAAyB,GAAG,IAAI,CAInF;AAED,qBAAa,sBAAsB;IACrB,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,EAAE;IAEtB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAwB7C"}
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AutocompleteController = exports.assertNodeVersionSupported = exports.Argument = void 0;
4
- const tslib_1 = require("tslib");
5
- const semver_1 = tslib_1.__importDefault(require("semver"));
6
- const cli_shared_1 = require("@forge/cli-shared");
7
- const autocomplete_1 = require("../../autocomplete");
8
- const assertUnreachable_1 = require("./assertUnreachable");
9
- const getNodeVersion_1 = require("./getNodeVersion");
10
- var Argument;
11
- (function (Argument) {
12
- Argument["install"] = "install";
13
- Argument["uninstall"] = "uninstall";
14
- })(Argument = exports.Argument || (exports.Argument = {}));
15
- function assertIsValidArgument(arg) {
16
- if (!(arg in Argument)) {
17
- throw new cli_shared_1.ValidationError(cli_shared_1.Text.autocomplete.error.badArg(arg));
18
- }
19
- }
20
- function assertNodeVersionSupported(version = getNodeVersion_1.getNodeVersion()) {
21
- if (semver_1.default.eq(version, '12.5.0') || semver_1.default.eq(version, '12.6.0')) {
22
- throw new Error(cli_shared_1.Text.autocomplete.error.unsupportedNodeVersion);
23
- }
24
- }
25
- exports.assertNodeVersionSupported = assertNodeVersionSupported;
26
- class AutocompleteController {
27
- constructor(ui) {
28
- this.ui = ui;
29
- }
30
- async run(arg) {
31
- assertIsValidArgument(arg);
32
- if (arg === Argument.install) {
33
- assertNodeVersionSupported();
34
- if (!(await this.ui.confirm(cli_shared_1.Text.autocomplete.confirmInstalling))) {
35
- return;
36
- }
37
- this.ui.info(cli_shared_1.Text.autocomplete.installing);
38
- try {
39
- autocomplete_1.autocomplete.setupShellInitFile();
40
- }
41
- catch (e) {
42
- throw new Error(cli_shared_1.Text.autocomplete.error.unsupportedShell);
43
- }
44
- }
45
- else if (arg === Argument.uninstall) {
46
- this.ui.info(cli_shared_1.Text.autocomplete.uninstalling);
47
- autocomplete_1.autocomplete.cleanupShellInitFile();
48
- }
49
- else {
50
- assertUnreachable_1.assertUnreachable(arg);
51
- }
52
- }
53
- }
54
- exports.AutocompleteController = AutocompleteController;
@@ -1,43 +0,0 @@
1
- import { AppConfigProvider, ConfigFile, HiddenError } from '@forge/cli-shared';
2
- import { LintService } from '../../service/lint-service';
3
- import { DeployView } from '../view/deploy-view';
4
- import { InstallationService } from '../../service/installation-service';
5
- import { MigrationKeysService } from '../../service/migration-keys-service';
6
- import { ResourcePackagingService } from '../../service/resource-packaging-service';
7
- import { ErrorWithAnalytics } from '../command';
8
- import { PackageUploadDeployCommand } from '../../deploy';
9
- import { DeploymentResult } from '../register-deployment-commands';
10
- interface DeployOptions {
11
- environment: string;
12
- verify: boolean;
13
- }
14
- export declare class DeployLintFailureError extends HiddenError implements ErrorWithAnalytics {
15
- private readonly scopes;
16
- constructor(scopes: string[]);
17
- getAttributes(): Record<string, string[]>;
18
- }
19
- export declare class InvalidConnectKeyError extends HiddenError implements ErrorWithAnalytics {
20
- private readonly reason;
21
- constructor(reason: string);
22
- getAttributes(): Record<string, string>;
23
- }
24
- export declare class DeployController {
25
- private readonly appConfigProvider;
26
- private readonly configFile;
27
- private readonly lintService;
28
- private readonly installationsService;
29
- private readonly migrationKeysService;
30
- private readonly deployView;
31
- private readonly packageUploadDeployCommand;
32
- private readonly resourcePackagingService;
33
- constructor(appConfigProvider: AppConfigProvider, configFile: ConfigFile, lintService: LintService, installationsService: InstallationService, migrationKeysService: MigrationKeysService, deployView: DeployView, packageUploadDeployCommand: PackageUploadDeployCommand, resourcePackagingService: ResourcePackagingService);
34
- private isMpacProductionApp;
35
- private connectKeyDeleted;
36
- private connectKeyChanged;
37
- private validateConnectKeyChange;
38
- private verifyPreDeployment;
39
- private verifyPostDeployment;
40
- run({ environment, verify }: DeployOptions): Promise<DeploymentResult | void>;
41
- }
42
- export {};
43
- //# sourceMappingURL=deploy-controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deploy-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/deploy-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAQ,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAA+B,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AACzG,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,UAAU,aAAa;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,sBAAuB,SAAQ,WAAY,YAAW,kBAAkB;IACvE,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM,EAAE;IAItC,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;CAKjD;AAED,qBAAa,sBAAuB,SAAQ,WAAY,YAAW,kBAAkB;IACvE,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAGpC,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAK/C;AAED,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,0BAA0B;IAC3C,OAAO,CAAC,QAAQ,CAAC,wBAAwB;gBAPxB,iBAAiB,EAAE,iBAAiB,EACpC,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,oBAAoB,EAAE,mBAAmB,EACzC,oBAAoB,EAAE,oBAAoB,EAC1C,UAAU,EAAE,UAAU,EACtB,0BAA0B,EAAE,0BAA0B,EACtD,wBAAwB,EAAE,wBAAwB;IAGrE,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,iBAAiB;YAGX,wBAAwB;YAwBxB,mBAAmB;YAiBnB,oBAAoB;IAOrB,GAAG,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;CAsD3F"}
@@ -1,139 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeployController = exports.InvalidConnectKeyError = exports.DeployLintFailureError = void 0;
4
- const cli_shared_1 = require("@forge/cli-shared");
5
- class DeployLintFailureError extends cli_shared_1.HiddenError {
6
- constructor(scopes) {
7
- super();
8
- this.scopes = scopes;
9
- }
10
- getAttributes() {
11
- return {
12
- scopes: this.scopes
13
- };
14
- }
15
- }
16
- exports.DeployLintFailureError = DeployLintFailureError;
17
- class InvalidConnectKeyError extends cli_shared_1.HiddenError {
18
- constructor(reason) {
19
- super();
20
- this.reason = reason;
21
- }
22
- getAttributes() {
23
- return {
24
- reason: this.reason
25
- };
26
- }
27
- }
28
- exports.InvalidConnectKeyError = InvalidConnectKeyError;
29
- class DeployController {
30
- constructor(appConfigProvider, configFile, lintService, installationsService, migrationKeysService, deployView, packageUploadDeployCommand, resourcePackagingService) {
31
- this.appConfigProvider = appConfigProvider;
32
- this.configFile = configFile;
33
- this.lintService = lintService;
34
- this.installationsService = installationsService;
35
- this.migrationKeysService = migrationKeysService;
36
- this.deployView = deployView;
37
- this.packageUploadDeployCommand = packageUploadDeployCommand;
38
- this.resourcePackagingService = resourcePackagingService;
39
- }
40
- isMpacProductionApp(mpacAppKey, environment) {
41
- return !!(mpacAppKey && environment === 'production');
42
- }
43
- connectKeyDeleted(connectKey, comparisonKey) {
44
- return !!(!connectKey && comparisonKey);
45
- }
46
- connectKeyChanged(connectKey, comparisonKey) {
47
- return !!(comparisonKey && connectKey && connectKey !== comparisonKey);
48
- }
49
- async validateConnectKeyChange(environment, keys) {
50
- const { migrationKeys, mpacAppKey } = keys;
51
- const connectKey = await this.configFile.getConnectKey();
52
- const migrationKey = (migrationKeys === null || migrationKeys === void 0 ? void 0 : migrationKeys.confluence) || (migrationKeys === null || migrationKeys === void 0 ? void 0 : migrationKeys.jira);
53
- const isMpacApp = this.isMpacProductionApp(mpacAppKey, environment);
54
- if (this.connectKeyDeleted(connectKey, migrationKey)) {
55
- this.deployView.displayConnectKeyDeleteWarning(environment);
56
- const proceed = await this.deployView.promptToContinueDeletingConnectKey();
57
- return { proceed, connectKeyDeleted: proceed, connectKeyChanged: false };
58
- }
59
- else if (isMpacApp && this.connectKeyChanged(connectKey, mpacAppKey)) {
60
- this.deployView.displayMPACAppConnectKeyChangeError(mpacAppKey, connectKey);
61
- throw new InvalidConnectKeyError(cli_shared_1.Text.deploy.connectKeyChange.mpacAppConnectKeyChangeAnalyticsError);
62
- }
63
- else if (!isMpacApp && this.connectKeyChanged(connectKey, migrationKey)) {
64
- this.deployView.displayConnectKeyChangeWarning(environment, migrationKey, connectKey);
65
- const proceed = await this.deployView.promptToContinueChangingConnectKey();
66
- return { proceed, connectKeyChanged: proceed, connectKeyDeleted: false };
67
- }
68
- return { proceed: true, connectKeyChanged: false, connectKeyDeleted: false };
69
- }
70
- async verifyPreDeployment(environment) {
71
- this.deployView.displayLintRunning();
72
- const { lintResults } = await this.lintService.run(environment, { fix: false }, this.deployView.getLogger());
73
- const problemCount = this.lintService.problemCount(lintResults);
74
- if (problemCount.errors) {
75
- this.deployView.displayLintErrors(lintResults);
76
- const failures = this.lintService.failedScopes(lintResults);
77
- throw new DeployLintFailureError(failures);
78
- }
79
- else if (problemCount.warnings) {
80
- this.deployView.displayLintWarnings(problemCount.warnings);
81
- }
82
- else {
83
- this.deployView.displayNoLintProblems();
84
- }
85
- }
86
- async verifyPostDeployment(environment) {
87
- const needsVersionUpdate = await this.installationsService.hasOutdatedProductInstallation(environment);
88
- if (needsVersionUpdate) {
89
- this.deployView.displayOutdatedInstallationsMessage();
90
- }
91
- }
92
- async run({ environment, verify }) {
93
- this.deployView.displayStart(environment);
94
- let hasConnectKeyChanged = false;
95
- let hasConnectKeyDeleted = false;
96
- if (verify) {
97
- await this.verifyPreDeployment(environment);
98
- const keys = await this.migrationKeysService.getMigrationKeysForAppEnvironment(environment);
99
- const { proceed, connectKeyChanged, connectKeyDeleted } = await this.validateConnectKeyChange(environment, keys);
100
- if (!proceed) {
101
- return;
102
- }
103
- hasConnectKeyChanged = connectKeyChanged;
104
- hasConnectKeyDeleted = connectKeyDeleted;
105
- }
106
- const { id } = await this.appConfigProvider();
107
- const handlers = await this.configFile.getAppHandlers();
108
- const resources = await this.configFile.getResources();
109
- const archives = await this.resourcePackagingService.zipResources(resources);
110
- let hasProdInstallations = false;
111
- try {
112
- const prodInstallations = await this.installationsService.listAppInstallations({
113
- environment: 'production'
114
- });
115
- hasProdInstallations = !prodInstallations.installations.length;
116
- }
117
- catch (err) {
118
- if (verify) {
119
- throw err;
120
- }
121
- }
122
- const analytics = await this.deployView.reportDeploymentProgress(id, environment, hasProdInstallations, () => this.packageUploadDeployCommand.execute({ handlers, environmentKey: environment, archives }));
123
- if (verify) {
124
- await this.verifyPostDeployment(environment);
125
- }
126
- try {
127
- analytics.analytics.egressPermissionList = await this.configFile.getEgressPermissions();
128
- analytics.analytics.connectKey = hasConnectKeyChanged
129
- ? { action: 'changed', value: await this.configFile.getConnectKey() }
130
- : hasConnectKeyDeleted
131
- ? { action: 'deleted' }
132
- : {};
133
- }
134
- catch (e) {
135
- }
136
- return analytics;
137
- }
138
- }
139
- exports.DeployController = DeployController;
@@ -1,9 +0,0 @@
1
- import { UI, FeedbackPostClient } from '@forge/cli-shared';
2
- import { Response } from 'node-fetch';
3
- export declare class FeedbackController {
4
- private readonly ui;
5
- private readonly feedbackPostClient;
6
- constructor(ui: UI, feedbackPostClient: FeedbackPostClient);
7
- sendFeedback(feedback: string): Promise<Response>;
8
- }
9
- //# sourceMappingURL=feedback-controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"feedback-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/feedback-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA+B,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,qBAAa,kBAAkB;IACjB,OAAO,CAAC,QAAQ,CAAC,EAAE;IAAM,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAA3C,EAAE,EAAE,EAAE,EAAmB,kBAAkB,EAAE,kBAAkB;IAE/E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;CAQ/D"}