@forge/cli 0.0.0-experimental-deeb8f6 → 0.0.0-experimental-c8e9749

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/CHANGELOG.md +1110 -2
  2. package/npm-shrinkwrap.json +13212 -223
  3. package/out/analytics-client/analytics-client.d.ts +36 -0
  4. package/out/analytics-client/analytics-client.d.ts.map +1 -0
  5. package/out/analytics-client/analytics-client.js +140 -0
  6. package/out/analytics-client/analytics-message-handler.d.ts +21 -0
  7. package/out/analytics-client/analytics-message-handler.d.ts.map +1 -0
  8. package/out/analytics-client/analytics-message-handler.js +43 -0
  9. package/out/autocomplete/autocomplete-config.json +243 -0
  10. package/out/autocomplete/index.d.ts +5 -0
  11. package/out/autocomplete/index.d.ts.map +1 -0
  12. package/out/autocomplete/index.js +41 -0
  13. package/out/autocomplete/isSupportedShell.d.ts +2 -0
  14. package/out/autocomplete/isSupportedShell.d.ts.map +1 -0
  15. package/out/autocomplete/isSupportedShell.js +11 -0
  16. package/out/autocomplete/types.d.ts +14 -0
  17. package/out/autocomplete/types.d.ts.map +1 -0
  18. package/out/autocomplete/types.js +2 -0
  19. package/out/autocomplete/util.d.ts +6 -0
  20. package/out/autocomplete/util.d.ts.map +1 -0
  21. package/out/autocomplete/util.js +15 -0
  22. package/out/bin/cli.d.ts +1 -0
  23. package/out/bin/cli.d.ts.map +1 -1
  24. package/out/bin/cli.js +4 -1
  25. package/out/bin/postinstall.d.ts +2 -0
  26. package/out/bin/postinstall.d.ts.map +1 -0
  27. package/out/bin/postinstall.js +23 -0
  28. package/out/command-line/anon-user-id.d.ts +3 -0
  29. package/out/command-line/anon-user-id.d.ts.map +1 -0
  30. package/out/command-line/anon-user-id.js +17 -0
  31. package/out/command-line/command.d.ts +80 -0
  32. package/out/command-line/command.d.ts.map +1 -0
  33. package/out/command-line/command.js +408 -0
  34. package/out/command-line/controller/assertUnreachable.d.ts +2 -0
  35. package/out/command-line/controller/assertUnreachable.d.ts.map +1 -0
  36. package/out/command-line/controller/assertUnreachable.js +7 -0
  37. package/out/command-line/controller/autocomplete-controller.d.ts +12 -0
  38. package/out/command-line/controller/autocomplete-controller.d.ts.map +1 -0
  39. package/out/command-line/controller/autocomplete-controller.js +54 -0
  40. package/out/command-line/controller/deploy-controller.d.ts +42 -0
  41. package/out/command-line/controller/deploy-controller.d.ts.map +1 -0
  42. package/out/command-line/controller/deploy-controller.js +139 -0
  43. package/out/command-line/controller/feedback-controller.d.ts +9 -0
  44. package/out/command-line/controller/feedback-controller.d.ts.map +1 -0
  45. package/out/command-line/controller/feedback-controller.js +19 -0
  46. package/out/command-line/controller/getNodeVersion.d.ts +2 -0
  47. package/out/command-line/controller/getNodeVersion.d.ts.map +1 -0
  48. package/out/command-line/controller/getNodeVersion.js +7 -0
  49. package/out/command-line/controller/install-controller.d.ts +35 -0
  50. package/out/command-line/controller/install-controller.d.ts.map +1 -0
  51. package/out/command-line/controller/install-controller.js +157 -0
  52. package/out/command-line/controller/lint-controller.d.ts +9 -0
  53. package/out/command-line/controller/lint-controller.d.ts.map +1 -0
  54. package/out/command-line/controller/lint-controller.js +20 -0
  55. package/out/command-line/controller/pre-command-controller.d.ts +25 -0
  56. package/out/command-line/controller/pre-command-controller.d.ts.map +1 -0
  57. package/out/command-line/controller/pre-command-controller.js +57 -0
  58. package/out/command-line/controller/prerequisites-controller.d.ts +15 -0
  59. package/out/command-line/controller/prerequisites-controller.d.ts.map +1 -0
  60. package/out/command-line/controller/prerequisites-controller.js +41 -0
  61. package/out/command-line/controller/settings-controller.d.ts +19 -0
  62. package/out/command-line/controller/settings-controller.d.ts.map +1 -0
  63. package/out/command-line/controller/settings-controller.js +48 -0
  64. package/out/command-line/controller/stubController.d.ts +9 -0
  65. package/out/command-line/controller/stubController.d.ts.map +1 -0
  66. package/out/command-line/controller/stubController.js +15 -0
  67. package/out/command-line/controller/tunnel-controller.d.ts +14 -0
  68. package/out/command-line/controller/tunnel-controller.d.ts.map +1 -0
  69. package/out/command-line/controller/tunnel-controller.js +43 -0
  70. package/out/command-line/dependency-injection.d.ts +76 -0
  71. package/out/command-line/dependency-injection.d.ts.map +1 -0
  72. package/out/command-line/dependency-injection.js +211 -0
  73. package/out/command-line/environment.d.ts +2 -0
  74. package/out/command-line/environment.d.ts.map +1 -0
  75. package/out/command-line/environment.js +16 -0
  76. package/out/command-line/errors.d.ts +6 -0
  77. package/out/command-line/errors.d.ts.map +1 -0
  78. package/out/command-line/errors.js +12 -0
  79. package/out/command-line/index.d.ts +5 -0
  80. package/out/command-line/index.d.ts.map +1 -0
  81. package/out/command-line/index.js +73 -0
  82. package/out/command-line/register-app-commands.d.ts +10 -0
  83. package/out/command-line/register-app-commands.d.ts.map +1 -0
  84. package/out/command-line/register-app-commands.js +128 -0
  85. package/out/command-line/register-authentication-command.d.ts +16 -0
  86. package/out/command-line/register-authentication-command.d.ts.map +1 -0
  87. package/out/command-line/register-authentication-command.js +94 -0
  88. package/out/command-line/register-autocomplete-commands.d.ts +3 -0
  89. package/out/command-line/register-autocomplete-commands.d.ts.map +1 -0
  90. package/out/command-line/register-autocomplete-commands.js +14 -0
  91. package/out/command-line/register-contributors-commands.d.ts +3 -0
  92. package/out/command-line/register-contributors-commands.d.ts.map +1 -0
  93. package/out/command-line/register-contributors-commands.js +134 -0
  94. package/out/command-line/register-deployment-commands.d.ts +22 -0
  95. package/out/command-line/register-deployment-commands.d.ts.map +1 -0
  96. package/out/command-line/register-deployment-commands.js +16 -0
  97. package/out/command-line/register-environment-variables-commands.d.ts +3 -0
  98. package/out/command-line/register-environment-variables-commands.d.ts.map +1 -0
  99. package/out/command-line/register-environment-variables-commands.js +103 -0
  100. package/out/command-line/register-feedback-commands.d.ts +3 -0
  101. package/out/command-line/register-feedback-commands.d.ts.map +1 -0
  102. package/out/command-line/register-feedback-commands.js +32 -0
  103. package/out/command-line/register-installation-commands.d.ts +6 -0
  104. package/out/command-line/register-installation-commands.d.ts.map +1 -0
  105. package/out/command-line/register-installation-commands.js +143 -0
  106. package/out/command-line/register-lint-command.d.ts +8 -0
  107. package/out/command-line/register-lint-command.d.ts.map +1 -0
  108. package/out/command-line/register-lint-command.js +16 -0
  109. package/out/command-line/register-log-commands.d.ts +4 -0
  110. package/out/command-line/register-log-commands.d.ts.map +1 -0
  111. package/out/command-line/register-log-commands.js +139 -0
  112. package/out/command-line/register-providers-commands.d.ts +3 -0
  113. package/out/command-line/register-providers-commands.d.ts.map +1 -0
  114. package/out/command-line/register-providers-commands.js +44 -0
  115. package/out/command-line/register-settings-commands.d.ts +3 -0
  116. package/out/command-line/register-settings-commands.d.ts.map +1 -0
  117. package/out/command-line/register-settings-commands.js +39 -0
  118. package/out/command-line/register-tunnel-commands.d.ts +3 -0
  119. package/out/command-line/register-tunnel-commands.d.ts.map +1 -0
  120. package/out/command-line/register-tunnel-commands.js +15 -0
  121. package/out/command-line/register-webtrigger-commands.d.ts +3 -0
  122. package/out/command-line/register-webtrigger-commands.d.ts.map +1 -0
  123. package/out/command-line/register-webtrigger-commands.js +56 -0
  124. package/out/command-line/sentry.d.ts +4 -0
  125. package/out/command-line/sentry.d.ts.map +1 -0
  126. package/out/command-line/sentry.js +16 -0
  127. package/out/command-line/unique-machine-id.d.ts +3 -0
  128. package/out/command-line/unique-machine-id.d.ts.map +1 -0
  129. package/out/command-line/unique-machine-id.js +19 -0
  130. package/out/command-line/version-info.d.ts +9 -0
  131. package/out/command-line/version-info.d.ts.map +1 -0
  132. package/out/command-line/version-info.js +42 -0
  133. package/out/command-line/view/analytics-settings-view.d.ts +7 -0
  134. package/out/command-line/view/analytics-settings-view.d.ts.map +1 -0
  135. package/out/command-line/view/analytics-settings-view.js +18 -0
  136. package/out/command-line/view/deploy-view.d.ts +21 -0
  137. package/out/command-line/view/deploy-view.d.ts.map +1 -0
  138. package/out/command-line/view/deploy-view.js +58 -0
  139. package/out/command-line/view/install-view.d.ts +18 -0
  140. package/out/command-line/view/install-view.d.ts.map +1 -0
  141. package/out/command-line/view/install-view.js +56 -0
  142. package/out/command-line/view/lint-view.d.ts +12 -0
  143. package/out/command-line/view/lint-view.d.ts.map +1 -0
  144. package/out/command-line/view/lint-view.js +31 -0
  145. package/out/command-line/view/lite-lint-view.d.ts +10 -0
  146. package/out/command-line/view/lite-lint-view.d.ts.map +1 -0
  147. package/out/command-line/view/lite-lint-view.js +18 -0
  148. package/out/command-line/view/settings-view.d.ts +10 -0
  149. package/out/command-line/view/settings-view.d.ts.map +1 -0
  150. package/out/command-line/view/settings-view.js +26 -0
  151. package/out/command-line/view/tunnel-view.d.ts +20 -0
  152. package/out/command-line/view/tunnel-view.d.ts.map +1 -0
  153. package/out/command-line/view/tunnel-view.js +92 -0
  154. package/out/contributors/add-contributor.d.ts +17 -0
  155. package/out/contributors/add-contributor.d.ts.map +1 -0
  156. package/out/contributors/add-contributor.js +14 -0
  157. package/out/contributors/graphql-client.d.ts +14 -0
  158. package/out/contributors/graphql-client.d.ts.map +1 -0
  159. package/out/contributors/graphql-client.js +113 -0
  160. package/out/contributors/list-contributors.d.ts +18 -0
  161. package/out/contributors/list-contributors.d.ts.map +1 -0
  162. package/out/contributors/list-contributors.js +14 -0
  163. package/out/contributors/remove-contributors.d.ts +18 -0
  164. package/out/contributors/remove-contributors.d.ts.map +1 -0
  165. package/out/contributors/remove-contributors.js +14 -0
  166. package/out/deploy/deployer/deploy-monitor-graphql-client.d.ts +24 -0
  167. package/out/deploy/deployer/deploy-monitor-graphql-client.d.ts.map +1 -0
  168. package/out/deploy/deployer/deploy-monitor-graphql-client.js +57 -0
  169. package/out/deploy/deployer/deployer.d.ts +40 -0
  170. package/out/deploy/deployer/deployer.d.ts.map +1 -0
  171. package/out/deploy/deployer/deployer.js +187 -0
  172. package/out/deploy/deployer/index.d.ts +4 -0
  173. package/out/deploy/deployer/index.d.ts.map +1 -0
  174. package/out/deploy/deployer/index.js +6 -0
  175. package/out/deploy/deployer/trigger-deploy-graphql-client.d.ts +19 -0
  176. package/out/deploy/deployer/trigger-deploy-graphql-client.d.ts.map +1 -0
  177. package/out/deploy/deployer/trigger-deploy-graphql-client.js +49 -0
  178. package/out/deploy/index.d.ts +5 -0
  179. package/out/deploy/index.d.ts.map +1 -0
  180. package/out/deploy/index.js +7 -0
  181. package/out/deploy/package-upload-deploy.d.ts +20 -0
  182. package/out/deploy/package-upload-deploy.d.ts.map +1 -0
  183. package/out/deploy/package-upload-deploy.js +37 -0
  184. package/out/deploy/packager/archiver.d.ts +27 -0
  185. package/out/deploy/packager/archiver.d.ts.map +1 -0
  186. package/out/deploy/packager/archiver.js +76 -0
  187. package/out/deploy/packager/index.d.ts +3 -0
  188. package/out/deploy/packager/index.d.ts.map +1 -0
  189. package/out/deploy/packager/index.js +5 -0
  190. package/out/deploy/packager/nativeui-bundler.d.ts +12 -0
  191. package/out/deploy/packager/nativeui-bundler.d.ts.map +1 -0
  192. package/out/deploy/packager/nativeui-bundler.js +34 -0
  193. package/out/deploy/packager/packager.d.ts +32 -0
  194. package/out/deploy/packager/packager.d.ts.map +1 -0
  195. package/out/deploy/packager/packager.js +21 -0
  196. package/out/deploy/packager/runtime-bundler.d.ts +15 -0
  197. package/out/deploy/packager/runtime-bundler.d.ts.map +1 -0
  198. package/out/deploy/packager/runtime-bundler.js +53 -0
  199. package/out/deploy/uploader/artifact-graphql-client.d.ts +26 -0
  200. package/out/deploy/uploader/artifact-graphql-client.d.ts.map +1 -0
  201. package/out/deploy/uploader/artifact-graphql-client.js +100 -0
  202. package/out/deploy/uploader/index.d.ts +3 -0
  203. package/out/deploy/uploader/index.d.ts.map +1 -0
  204. package/out/deploy/uploader/index.js +5 -0
  205. package/out/deploy/uploader/uploader.d.ts +19 -0
  206. package/out/deploy/uploader/uploader.d.ts.map +1 -0
  207. package/out/deploy/uploader/uploader.js +43 -0
  208. package/out/environment-variables/delete-environment-variable.d.ts +18 -0
  209. package/out/environment-variables/delete-environment-variable.d.ts.map +1 -0
  210. package/out/environment-variables/delete-environment-variable.js +14 -0
  211. package/out/environment-variables/graphql-client.d.ts +16 -0
  212. package/out/environment-variables/graphql-client.d.ts.map +1 -0
  213. package/out/environment-variables/graphql-client.js +113 -0
  214. package/out/environment-variables/list-environment-variables.d.ts +22 -0
  215. package/out/environment-variables/list-environment-variables.d.ts.map +1 -0
  216. package/out/environment-variables/list-environment-variables.js +14 -0
  217. package/out/environment-variables/set-environment-variable.d.ts +20 -0
  218. package/out/environment-variables/set-environment-variable.d.ts.map +1 -0
  219. package/out/environment-variables/set-environment-variable.js +14 -0
  220. package/out/installations/graphql-client.d.ts +75 -0
  221. package/out/installations/graphql-client.d.ts.map +1 -0
  222. package/out/installations/graphql-client.js +423 -0
  223. package/out/installations/install-app-site.d.ts +21 -0
  224. package/out/installations/install-app-site.d.ts.map +1 -0
  225. package/out/installations/install-app-site.js +19 -0
  226. package/out/installations/shared.d.ts +5 -0
  227. package/out/installations/shared.d.ts.map +1 -0
  228. package/out/installations/shared.js +20 -0
  229. package/out/installations/site-translation/bitbucket.d.ts +24 -0
  230. package/out/installations/site-translation/bitbucket.d.ts.map +1 -0
  231. package/out/installations/site-translation/bitbucket.js +113 -0
  232. package/out/installations/site-translation/cloudid-products.d.ts +17 -0
  233. package/out/installations/site-translation/cloudid-products.d.ts.map +1 -0
  234. package/out/installations/site-translation/cloudid-products.js +89 -0
  235. package/out/installations/site-translation/index.d.ts +4 -0
  236. package/out/installations/site-translation/index.d.ts.map +1 -0
  237. package/out/installations/site-translation/index.js +6 -0
  238. package/out/installations/site-translation/site-translation.d.ts +12 -0
  239. package/out/installations/site-translation/site-translation.d.ts.map +1 -0
  240. package/out/installations/site-translation/site-translation.js +2 -0
  241. package/out/installations/uninstall-app.d.ts +25 -0
  242. package/out/installations/uninstall-app.d.ts.map +1 -0
  243. package/out/installations/uninstall-app.js +43 -0
  244. package/out/migration-keys/graphql-client.d.ts +8 -0
  245. package/out/migration-keys/graphql-client.d.ts.map +1 -0
  246. package/out/migration-keys/graphql-client.js +55 -0
  247. package/out/providers/configure-provider.d.ts +19 -0
  248. package/out/providers/configure-provider.d.ts.map +1 -0
  249. package/out/providers/configure-provider.js +14 -0
  250. package/out/providers/graphql-client.d.ts +8 -0
  251. package/out/providers/graphql-client.d.ts.map +1 -0
  252. package/out/providers/graphql-client.js +45 -0
  253. package/out/service/cached-config-service.d.ts +8 -0
  254. package/out/service/cached-config-service.d.ts.map +1 -0
  255. package/out/service/cached-config-service.js +16 -0
  256. package/out/service/command-suggestion-service.d.ts +4 -0
  257. package/out/service/command-suggestion-service.d.ts.map +1 -0
  258. package/out/service/command-suggestion-service.js +17 -0
  259. package/out/service/docker-service.d.ts +24 -0
  260. package/out/service/docker-service.d.ts.map +1 -0
  261. package/out/service/docker-service.js +71 -0
  262. package/out/service/installation-service.d.ts +51 -0
  263. package/out/service/installation-service.d.ts.map +1 -0
  264. package/out/service/installation-service.js +91 -0
  265. package/out/service/lint-service.d.ts +23 -0
  266. package/out/service/lint-service.d.ts.map +1 -0
  267. package/out/service/lint-service.js +39 -0
  268. package/out/service/lite-lint-service.d.ts +10 -0
  269. package/out/service/lite-lint-service.d.ts.map +1 -0
  270. package/out/service/lite-lint-service.js +27 -0
  271. package/out/service/migration-keys-service.d.ts +19 -0
  272. package/out/service/migration-keys-service.d.ts.map +1 -0
  273. package/out/service/migration-keys-service.js +14 -0
  274. package/out/service/port-finding-service.d.ts +12 -0
  275. package/out/service/port-finding-service.d.ts.map +1 -0
  276. package/out/service/port-finding-service.js +34 -0
  277. package/out/service/resource-packaging-service.d.ts +46 -0
  278. package/out/service/resource-packaging-service.d.ts.map +1 -0
  279. package/out/service/resource-packaging-service.js +132 -0
  280. package/out/service/resources-uploader-service.d.ts +16 -0
  281. package/out/service/resources-uploader-service.d.ts.map +1 -0
  282. package/out/service/resources-uploader-service.js +39 -0
  283. package/out/service/tunnel-analytics-service.d.ts +11 -0
  284. package/out/service/tunnel-analytics-service.d.ts.map +1 -0
  285. package/out/service/tunnel-analytics-service.js +24 -0
  286. package/out/service/tunnel-service.d.ts +41 -0
  287. package/out/service/tunnel-service.d.ts.map +1 -0
  288. package/out/service/tunnel-service.js +196 -0
  289. package/out/storage/local-file-storage.d.ts +17 -0
  290. package/out/storage/local-file-storage.d.ts.map +1 -0
  291. package/out/storage/local-file-storage.js +53 -0
  292. package/out/webtrigger/get-webtrigger-url.d.ts +27 -0
  293. package/out/webtrigger/get-webtrigger-url.d.ts.map +1 -0
  294. package/out/webtrigger/get-webtrigger-url.js +26 -0
  295. package/out/webtrigger/graphql-client.d.ts +14 -0
  296. package/out/webtrigger/graphql-client.d.ts.map +1 -0
  297. package/out/webtrigger/graphql-client.js +52 -0
  298. package/out/workers/analytics-message-worker.d.ts +12 -0
  299. package/out/workers/analytics-message-worker.d.ts.map +1 -0
  300. package/out/workers/analytics-message-worker.js +29 -0
  301. package/out/workers/forge-cli-workers.d.ts +2 -0
  302. package/out/workers/forge-cli-workers.d.ts.map +1 -0
  303. package/out/workers/forge-cli-workers.js +21 -0
  304. package/out/workers/tunnel-clean-up-worker.d.ts +8 -0
  305. package/out/workers/tunnel-clean-up-worker.d.ts.map +1 -0
  306. package/out/workers/tunnel-clean-up-worker.js +31 -0
  307. package/out/workers/version-check-worker.d.ts +8 -0
  308. package/out/workers/version-check-worker.d.ts.map +1 -0
  309. package/out/workers/version-check-worker.js +20 -0
  310. package/out/workers/worker-info.d.ts +8 -0
  311. package/out/workers/worker-info.d.ts.map +1 -0
  312. package/out/workers/worker-info.js +15 -0
  313. package/out/workers/worker.d.ts +6 -0
  314. package/out/workers/worker.d.ts.map +1 -0
  315. package/out/workers/worker.js +9 -0
  316. package/out/workers/workers-starter.d.ts +5 -0
  317. package/out/workers/workers-starter.d.ts.map +1 -0
  318. package/out/workers/workers-starter.js +22 -0
  319. package/package.json +60 -5
@@ -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;
@@ -0,0 +1,21 @@
1
+ import { UI } from '@forge/cli-shared';
2
+ import { LintResult } from '@forge/lint';
3
+ import { DeploymentResult } from '../register-deployment-commands';
4
+ export declare class DeployView {
5
+ private readonly ui;
6
+ constructor(ui: UI);
7
+ getLogger(): UI;
8
+ displayStart(environment: string): void;
9
+ displayLintRunning(): void;
10
+ displayOutdatedInstallationsMessage(): void;
11
+ displayLintErrors(lintResults: LintResult[]): void;
12
+ displayLintWarnings(warnings: number): void;
13
+ displayNoLintProblems(): void;
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>;
20
+ }
21
+ //# sourceMappingURL=deploy-view.d.ts.map
@@ -0,0 +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;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"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeployView = void 0;
4
+ const cli_shared_1 = require("@forge/cli-shared");
5
+ const lint_1 = require("@forge/lint");
6
+ const cs_ari_1 = require("@forge/util/packages/cs-ari");
7
+ class DeployView {
8
+ constructor(ui) {
9
+ this.ui = ui;
10
+ }
11
+ getLogger() {
12
+ return this.ui;
13
+ }
14
+ displayStart(environment) {
15
+ this.ui.info(cli_shared_1.Text.deploy.cmd.start1(environment, cli_shared_1.environmentToOption));
16
+ }
17
+ displayLintRunning() {
18
+ this.ui.info(cli_shared_1.Text.lint.running);
19
+ }
20
+ displayOutdatedInstallationsMessage() {
21
+ this.ui.emptyLine();
22
+ this.ui.warn(cli_shared_1.Text.deploy.outdatedInstallations);
23
+ }
24
+ displayLintErrors(lintResults) {
25
+ this.ui.info(cli_shared_1.Text.deploy.taskLint.lintError);
26
+ (0, lint_1.reportLintResults)(this.ui, lintResults);
27
+ }
28
+ displayLintWarnings(warnings) {
29
+ this.ui.info(cli_shared_1.Text.deploy.taskLint.lintWarning(warnings) + '\n');
30
+ }
31
+ displayNoLintProblems() {
32
+ this.ui.info(cli_shared_1.LogColor.trace(cli_shared_1.Text.lint.noProblems) + '\n');
33
+ }
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((0, cs_ari_1.parseAppAri)((0, cs_ari_1.parse)(id)).appId));
54
+ }
55
+ return result;
56
+ }
57
+ }
58
+ exports.DeployView = DeployView;
@@ -0,0 +1,18 @@
1
+ import { UI } from '@forge/cli-shared';
2
+ import { AppEnvironmentPermissions, Installation } from '../../service/installation-service';
3
+ interface InstallOrUpgradeCommandText {
4
+ listScopes: (scopes: string[]) => string;
5
+ listEgressAddresses: (egressAddresses: string[]) => string;
6
+ permissionsMismatch: (environment: string) => string;
7
+ promptForPermissionsConfirmation: (permissionsMismatchInDevelopment: boolean) => string;
8
+ }
9
+ export declare class NoScopesError extends Error {
10
+ }
11
+ export declare class InstallView {
12
+ private readonly ui;
13
+ constructor(ui: UI);
14
+ promptForPermissionsConfirmation({ scopes, egressAddresses, addedScopes }: AppEnvironmentPermissions, manifestScopes: string[], manifestEgressAddresses: string[], environment: string, confirmScopes: boolean, nonInteractive: boolean, text: InstallOrUpgradeCommandText): Promise<boolean>;
15
+ promptForUpgrade(installations: Installation[]): Promise<Installation>;
16
+ }
17
+ export {};
18
+ //# sourceMappingURL=install-view.d.ts.map
@@ -0,0 +1 @@
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;AAIjH,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"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InstallView = exports.NoScopesError = void 0;
4
+ const cli_shared_1 = require("@forge/cli-shared");
5
+ const egress_1 = require("@forge/egress");
6
+ const lodash_1 = require("lodash");
7
+ class NoScopesError extends Error {
8
+ }
9
+ exports.NoScopesError = NoScopesError;
10
+ class InstallView {
11
+ constructor(ui) {
12
+ this.ui = ui;
13
+ }
14
+ async promptForPermissionsConfirmation({ scopes, egressAddresses, addedScopes }, manifestScopes, manifestEgressAddresses, environment, confirmScopes, nonInteractive, text) {
15
+ if (scopes.length === 0) {
16
+ throw new NoScopesError();
17
+ }
18
+ if (addedScopes.length)
19
+ this.ui.info(text.listScopes(addedScopes));
20
+ if (egressAddresses.length)
21
+ this.ui.info(text.listEgressAddresses(egressAddresses));
22
+ const cleanedManifestScopes = [...new Set(['read:me', ...manifestScopes])];
23
+ const groupedManifestEgressAddresses = (0, egress_1.sortAndGroupEgressPermissionsByDomain)(manifestEgressAddresses);
24
+ let permissionsMismatchWithManifest = false;
25
+ if ((0, cli_shared_1.environmentToOption)(environment) === cli_shared_1.DEFAULT_ENVIRONMENT_OPTION) {
26
+ const scopesMismatch = !(0, lodash_1.isEqual)([...cleanedManifestScopes].sort(), [...scopes].sort());
27
+ const egressAddressesMismatch = !(0, lodash_1.isEqual)([...groupedManifestEgressAddresses].sort(), [...egressAddresses].sort());
28
+ permissionsMismatchWithManifest = scopesMismatch || egressAddressesMismatch;
29
+ if (permissionsMismatchWithManifest) {
30
+ this.ui.warn(text.permissionsMismatch((0, cli_shared_1.environmentToOption)(environment)));
31
+ }
32
+ }
33
+ if (!confirmScopes && !nonInteractive) {
34
+ const scopesConfirmationResult = await this.ui.confirm(text.promptForPermissionsConfirmation(permissionsMismatchWithManifest));
35
+ if (scopesConfirmationResult)
36
+ this.ui.emptyLine();
37
+ return scopesConfirmationResult;
38
+ }
39
+ return true;
40
+ }
41
+ async promptForUpgrade(installations) {
42
+ 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 }) => ({
43
+ names: [
44
+ (0, cli_shared_1.environmentToOption)(environmentKey),
45
+ site,
46
+ (0, cli_shared_1.capitalizeProduct)(product),
47
+ cli_shared_1.Text.install.booleanToScope(version.isLatest)
48
+ ],
49
+ value: id,
50
+ primary: site
51
+ })));
52
+ const installation = installations[installationIndex];
53
+ return installation;
54
+ }
55
+ }
56
+ exports.InstallView = InstallView;
@@ -0,0 +1,12 @@
1
+ import { UI } from '@forge/cli-shared';
2
+ import { LintFixState, LintLogger, LintResult } from '@forge/lint';
3
+ export declare class LintView {
4
+ private readonly ui;
5
+ private lintResultReporter;
6
+ constructor(ui: UI, lintResultReporter?: (logger: LintLogger, lintResults: LintResult[], showSummary?: boolean | undefined) => void);
7
+ reportLintResult(results: LintResult[]): void;
8
+ reportFixResult(result: LintFixState): void;
9
+ getLogger(): LintLogger;
10
+ showBlurb(): void;
11
+ }
12
+ //# sourceMappingURL=lint-view.d.ts.map
@@ -0,0 +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,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,6FAAoB;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"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LintView = void 0;
4
+ const cli_shared_1 = require("@forge/cli-shared");
5
+ const lint_1 = require("@forge/lint");
6
+ class LintView {
7
+ constructor(ui, lintResultReporter = lint_1.reportLintResults) {
8
+ this.ui = ui;
9
+ this.lintResultReporter = lintResultReporter;
10
+ }
11
+ reportLintResult(results) {
12
+ this.lintResultReporter(this.ui, results);
13
+ }
14
+ reportFixResult(result) {
15
+ if (!result.errorsFixed && !result.warningsFixed) {
16
+ this.ui.info(cli_shared_1.LogColor.trace(cli_shared_1.Text.lint.noProblems));
17
+ }
18
+ else {
19
+ this.ui.info(cli_shared_1.Text.lint.fixed(result.errorsFixed, result.warningsFixed));
20
+ this.ui.info('');
21
+ this.ui.info(cli_shared_1.Text.lint.fixFollowUp);
22
+ }
23
+ }
24
+ getLogger() {
25
+ return this.ui;
26
+ }
27
+ showBlurb() {
28
+ this.ui.info(cli_shared_1.Text.lint.blurb);
29
+ }
30
+ }
31
+ exports.LintView = LintView;
@@ -0,0 +1,10 @@
1
+ import { UI } from '@forge/cli-shared';
2
+ import { LintLogger, LintResult } from '@forge/lint';
3
+ export declare class LiteLintView {
4
+ private readonly ui;
5
+ private reporter;
6
+ constructor(ui: UI, reporter?: (logger: LintLogger, lintResults: LintResult[], showSummary?: boolean | undefined) => void);
7
+ reportErrors(report: LintResult[]): void;
8
+ getLogger(): LintLogger;
9
+ }
10
+ //# sourceMappingURL=lite-lint-view.d.ts.map
@@ -0,0 +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,UAAU,EAAE,MAAM,aAAa,CAAC;AAExE,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,EAAE;IAAM,OAAO,CAAC,QAAQ;gBAAxB,EAAE,EAAE,EAAE,EAAU,QAAQ,6FAAoB;IAElE,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI;IAKxC,SAAS,IAAI,UAAU;CAG/B"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LiteLintView = void 0;
4
+ const lint_1 = require("@forge/lint");
5
+ class LiteLintView {
6
+ constructor(ui, reporter = lint_1.reportLintResults) {
7
+ this.ui = ui;
8
+ this.reporter = reporter;
9
+ }
10
+ reportErrors(report) {
11
+ this.ui.emptyLine();
12
+ this.reporter(this.ui, report, false);
13
+ }
14
+ getLogger() {
15
+ return this.ui;
16
+ }
17
+ }
18
+ exports.LiteLintView = LiteLintView;
@@ -0,0 +1,10 @@
1
+ import { UI } from '@forge/cli-shared';
2
+ declare type PreferenceValue = boolean | undefined;
3
+ export declare class SettingsView {
4
+ private readonly ui;
5
+ constructor(ui: UI);
6
+ showSettings(preferences: [string, string, PreferenceValue][], json?: boolean): void;
7
+ setSuccess(setting: string, value: string): void;
8
+ }
9
+ export {};
10
+ //# 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":"AAAA,OAAO,EAAQ,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAE7C,aAAK,eAAe,GAAG,OAAO,GAAG,SAAS,CAAC;AAE3C,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,EAAE;IAE5B,YAAY,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,OAAO;IAiB7E,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAIjD"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SettingsView = void 0;
4
+ const cli_shared_1 = require("@forge/cli-shared");
5
+ class SettingsView {
6
+ constructor(ui) {
7
+ this.ui = ui;
8
+ }
9
+ showSettings(preferences, json) {
10
+ this.ui.table([
11
+ ['setting', 'Setting'],
12
+ ['description', 'Description'],
13
+ ['value', 'Value']
14
+ ], preferences.map(([preference, desc, value]) => ({ setting: preference, description: desc, value })), {
15
+ json,
16
+ format: {
17
+ value: (value) => (value === undefined ? 'Not set' : String(value))
18
+ }
19
+ });
20
+ }
21
+ setSuccess(setting, value) {
22
+ this.ui.info(cli_shared_1.Text.settings.set.success(setting, value));
23
+ this.ui.emptyLine();
24
+ }
25
+ }
26
+ exports.SettingsView = SettingsView;
@@ -0,0 +1,20 @@
1
+ /// <reference types="node" />
2
+ import { CommandLineUI, exitOnError, UserError } from '@forge/cli-shared';
3
+ import { spawn } from 'cross-spawn';
4
+ export interface DownloadProgressCallbacks {
5
+ onStart: () => void;
6
+ onSuccess: () => void;
7
+ onFailure: () => void;
8
+ }
9
+ export declare class TunnelViewError extends UserError {
10
+ }
11
+ export declare class TunnelView {
12
+ private readonly ui;
13
+ constructor(ui: CommandLineUI);
14
+ dockerPreamble(): void;
15
+ getTunnelErrorHandler(exitFn: typeof exitOnError): (err: Error) => Promise<void>;
16
+ updatePullPercent(dataBuffer: Buffer, dockerPullPercent: number): number;
17
+ calculateProgress(progress: string, regex: RegExp, dockerPullPercent: number, clamp: number): number;
18
+ reportDownloadProgress(imageDownloadChildProcess: ReturnType<typeof spawn>, { onStart, onFailure, onSuccess }: DownloadProgressCallbacks): Promise<void>;
19
+ }
20
+ //# sourceMappingURL=tunnel-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tunnel-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/tunnel-view.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAkB,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,qBAAa,eAAgB,SAAQ,SAAS;CAAG;AAEjD,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,aAAa;IAEvC,cAAc,IAAI,IAAI;IAMtB,qBAAqB,CAAC,MAAM,EAAE,OAAO,WAAW,GAAG,CAAC,GAAG,EAAE,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC;IAQhF,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,MAAM;IA+BxE,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAQpG,sBAAsB,CAC3B,yBAAyB,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,EACnD,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,yBAAyB,GAC3D,OAAO,CAAC,IAAI,CAAC;CAyCjB"}
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TunnelView = exports.TunnelViewError = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const cli_shared_1 = require("@forge/cli-shared");
6
+ const ora_1 = tslib_1.__importDefault(require("ora"));
7
+ class TunnelViewError extends cli_shared_1.UserError {
8
+ }
9
+ exports.TunnelViewError = TunnelViewError;
10
+ class TunnelView {
11
+ constructor(ui) {
12
+ this.ui = ui;
13
+ }
14
+ dockerPreamble() {
15
+ this.ui.info(cli_shared_1.Text.tunnel.preamble);
16
+ this.ui.info(cli_shared_1.Text.ctrlC);
17
+ this.ui.emptyLine();
18
+ }
19
+ getTunnelErrorHandler(exitFn) {
20
+ const handler = async (err) => {
21
+ if (this.ui.debugEnabled)
22
+ this.ui.error(err);
23
+ return await exitFn(this.ui, new TunnelViewError(cli_shared_1.Text.tunnel.error.tunnelPackageMissing));
24
+ };
25
+ return handler;
26
+ }
27
+ updatePullPercent(dataBuffer, dockerPullPercent) {
28
+ const regexPullStarted = /(Pulling fs layer)/g;
29
+ const regexWait = /(Waiting)/g;
30
+ const regexVerify = /(Verifying Checksum)/g;
31
+ const regexDownloadComplete = /(Download complete)/g;
32
+ const regexPullComplete = /(Pull complete)/g;
33
+ const regexDigest = /(Digest: )/g;
34
+ const progress = dataBuffer.toString();
35
+ if (dockerPullPercent >= 99) {
36
+ return dockerPullPercent;
37
+ }
38
+ if (progress.match(regexPullComplete) || progress.match(regexDigest)) {
39
+ dockerPullPercent = 99;
40
+ return dockerPullPercent;
41
+ }
42
+ if (progress.match(regexDownloadComplete) && dockerPullPercent < 95) {
43
+ dockerPullPercent = 95;
44
+ return dockerPullPercent;
45
+ }
46
+ dockerPullPercent = this.calculateProgress(progress, regexPullStarted, dockerPullPercent, 33);
47
+ dockerPullPercent = this.calculateProgress(progress, regexWait, dockerPullPercent, 66);
48
+ dockerPullPercent = this.calculateProgress(progress, regexVerify, dockerPullPercent, 92);
49
+ return dockerPullPercent;
50
+ }
51
+ calculateProgress(progress, regex, dockerPullPercent, clamp) {
52
+ if (progress.match(regex) && dockerPullPercent <= clamp) {
53
+ const expectedNewPercent = dockerPullPercent + progress.match(regex).length * 3;
54
+ return Math.min(expectedNewPercent, clamp);
55
+ }
56
+ return dockerPullPercent;
57
+ }
58
+ reportDownloadProgress(imageDownloadChildProcess, { onStart, onFailure, onSuccess }) {
59
+ return new Promise((resolve, reject) => {
60
+ var _a, _b;
61
+ let dockerPullPercent = 0;
62
+ const spinner = (0, ora_1.default)({
63
+ spinner: {
64
+ frames: ['']
65
+ },
66
+ prefixText: cli_shared_1.Text.tunnel.pullDockerProgress(dockerPullPercent)
67
+ }).start();
68
+ onStart();
69
+ (_a = imageDownloadChildProcess.stdout) === null || _a === void 0 ? void 0 : _a.on('data', (data) => {
70
+ dockerPullPercent = this.updatePullPercent(data, dockerPullPercent);
71
+ spinner.prefixText = cli_shared_1.Text.tunnel.pullDockerProgress(dockerPullPercent);
72
+ });
73
+ (_b = imageDownloadChildProcess.stderr) === null || _b === void 0 ? void 0 : _b.on('data', (data) => {
74
+ spinner.prefixText = cli_shared_1.Text.tunnel.error.pullDocker;
75
+ spinner.stopAndPersist();
76
+ this.ui.warn(cli_shared_1.Text.tunnel.error.dockerPullFailed(''));
77
+ this.ui.emptyLine();
78
+ imageDownloadChildProcess.removeAllListeners();
79
+ onFailure();
80
+ reject(data.toString());
81
+ });
82
+ imageDownloadChildProcess.on('exit', () => {
83
+ spinner.prefixText = cli_shared_1.Text.tunnel.pullDockerProgress(100);
84
+ spinner.stopAndPersist();
85
+ this.ui.info(cli_shared_1.LogColor.trace(cli_shared_1.Text.tunnel.pullDockerSuccess));
86
+ onSuccess();
87
+ resolve();
88
+ });
89
+ });
90
+ }
91
+ }
92
+ exports.TunnelView = TunnelView;
@@ -0,0 +1,17 @@
1
+ import { AppConfigProvider } from '@forge/cli-shared';
2
+ export interface ContributorDetails {
3
+ email: string;
4
+ }
5
+ export interface AppContributorDetails extends ContributorDetails {
6
+ appId: string;
7
+ }
8
+ export interface AddContributorClient {
9
+ addContributor(details: AppContributorDetails): Promise<void>;
10
+ }
11
+ export declare class AddContributorCommand {
12
+ private readonly client;
13
+ private readonly getAppConfig;
14
+ constructor(client: AddContributorClient, getAppConfig: AppConfigProvider);
15
+ execute(details: ContributorDetails): Promise<void>;
16
+ }
17
+ //# sourceMappingURL=add-contributor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-contributor.d.ts","sourceRoot":"","sources":["../../src/contributors/add-contributor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC/D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D;AAED,qBAAa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAAwB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAA3D,MAAM,EAAE,oBAAoB,EAAmB,YAAY,EAAE,iBAAiB;IAE9F,OAAO,CAAC,OAAO,EAAE,kBAAkB;CAOjD"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddContributorCommand = void 0;
4
+ class AddContributorCommand {
5
+ constructor(client, getAppConfig) {
6
+ this.client = client;
7
+ this.getAppConfig = getAppConfig;
8
+ }
9
+ async execute(details) {
10
+ const { id: appId } = await this.getAppConfig();
11
+ await this.client.addContributor(Object.assign(Object.assign({}, details), { appId }));
12
+ }
13
+ }
14
+ exports.AddContributorCommand = AddContributorCommand;
@@ -0,0 +1,14 @@
1
+ import { GraphQLClient } from '@forge/cli-shared';
2
+ import { AppContributorDetails, AddContributorClient } from './add-contributor';
3
+ import { Contributor, ListContributorsClient } from './list-contributors';
4
+ import { RemoveContributorsDetails, RemoveContributorsClient } from './remove-contributors';
5
+ export declare class MissingAppContributors extends Error {
6
+ }
7
+ export declare class GraphqlClient implements AddContributorClient, ListContributorsClient, RemoveContributorsClient {
8
+ private readonly graphqlClient;
9
+ constructor(graphqlClient: GraphQLClient);
10
+ addContributor(details: AppContributorDetails): Promise<void>;
11
+ listContributors(appId: string): Promise<Contributor[]>;
12
+ removeContributors(details: RemoveContributorsDetails): Promise<void>;
13
+ }
14
+ //# sourceMappingURL=graphql-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/contributors/graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,aAAa,EAGd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAE5F,qBAAa,sBAAuB,SAAQ,KAAK;CAAG;AACpD,qBAAa,aAAc,YAAW,oBAAoB,EAAE,sBAAsB,EAAE,wBAAwB;IAC9F,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,cAAc,CAAC,OAAO,EAAE,qBAAqB;IAgD7C,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IA8BvD,kBAAkB,CAAC,OAAO,EAAE,yBAAyB;CA+CnE"}
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GraphqlClient = exports.MissingAppContributors = void 0;
4
+ const cli_shared_1 = require("@forge/cli-shared");
5
+ class MissingAppContributors extends Error {
6
+ }
7
+ exports.MissingAppContributors = MissingAppContributors;
8
+ class GraphqlClient {
9
+ constructor(graphqlClient) {
10
+ this.graphqlClient = graphqlClient;
11
+ }
12
+ async addContributor(details) {
13
+ const mutation = `
14
+ mutation forge_cli_addContributor($input: AddAppContributorInput!) {
15
+ ecosystem {
16
+ addAppContributor(input: $input) {
17
+ success
18
+ errors {
19
+ message
20
+ extensions {
21
+ errorType
22
+ statusCode
23
+ }
24
+ }
25
+ }
26
+ }
27
+ }
28
+ `;
29
+ const { response: { ecosystem: { addAppContributor } }, requestId } = await this.graphqlClient.mutate(mutation, {
30
+ input: {
31
+ appId: details.appId,
32
+ newContributorEmail: details.email,
33
+ role: cli_shared_1.AppContributorRole.Admin
34
+ }
35
+ });
36
+ if (!addAppContributor) {
37
+ throw new cli_shared_1.GraphQlMutationError(`Unable to get a response (requestId: ${requestId || 'unknown'})`, { requestId });
38
+ }
39
+ const { success, errors } = addAppContributor;
40
+ const error = (0, cli_shared_1.getError)(errors);
41
+ if (!success) {
42
+ throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
43
+ requestId,
44
+ code: error.code,
45
+ statusCode: error.statusCode
46
+ });
47
+ }
48
+ }
49
+ async listContributors(appId) {
50
+ const query = `
51
+ query forge_cli_listContributors($id: ID!) {
52
+ appContributors(id: $id) {
53
+ accountId
54
+ email
55
+ status
56
+ isOwner
57
+ publicName
58
+ }
59
+ }
60
+ `;
61
+ const { appContributors } = await this.graphqlClient.query(query, {
62
+ id: appId
63
+ });
64
+ if (!appContributors) {
65
+ throw new MissingAppContributors(cli_shared_1.Text.listContributors.missingAppContributors);
66
+ }
67
+ return appContributors.map((contributor) => ({
68
+ accountId: contributor.accountId,
69
+ email: contributor.email,
70
+ isOwner: contributor.isOwner,
71
+ publicName: contributor.publicName,
72
+ accountStatus: contributor.status
73
+ }));
74
+ }
75
+ async removeContributors(details) {
76
+ const mutation = `
77
+ mutation forge_cli_removeContributors($input: RemoveAppContributorsInput!) {
78
+ ecosystem {
79
+ removeAppContributors(input: $input) {
80
+ success
81
+ errors {
82
+ message
83
+ extensions {
84
+ errorType
85
+ statusCode
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
91
+ `;
92
+ const { response: { ecosystem: { removeAppContributors } }, requestId } = await this.graphqlClient.mutate(mutation, {
93
+ input: {
94
+ appId: details.appId,
95
+ emails: details.emails,
96
+ accountIds: details.accountIds
97
+ }
98
+ });
99
+ if (!removeAppContributors) {
100
+ throw new cli_shared_1.GraphQlMutationError(`Unable to get a response (requestId: ${requestId || 'unknown'})`, { requestId });
101
+ }
102
+ const { success, errors } = removeAppContributors;
103
+ const error = (0, cli_shared_1.getError)(errors);
104
+ if (!success) {
105
+ throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
106
+ requestId,
107
+ code: error.code,
108
+ statusCode: error.statusCode
109
+ });
110
+ }
111
+ }
112
+ }
113
+ exports.GraphqlClient = GraphqlClient;
@@ -0,0 +1,18 @@
1
+ import { AppConfigProvider } from '@forge/cli-shared';
2
+ export interface Contributor {
3
+ accountId: string;
4
+ email?: string | null;
5
+ accountStatus: string;
6
+ publicName: string;
7
+ isOwner?: boolean | null;
8
+ }
9
+ export interface ListContributorsClient {
10
+ listContributors(appId: string): Promise<Contributor[]>;
11
+ }
12
+ export declare class ListContributorsCommand {
13
+ private readonly client;
14
+ private readonly getAppConfig;
15
+ constructor(client: ListContributorsClient, getAppConfig: AppConfigProvider);
16
+ execute(): Promise<Contributor[]>;
17
+ }
18
+ //# sourceMappingURL=list-contributors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-contributors.d.ts","sourceRoot":"","sources":["../../src/contributors/list-contributors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;CACzD;AAED,qBAAa,uBAAuB;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAA0B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAA7D,MAAM,EAAE,sBAAsB,EAAmB,YAAY,EAAE,iBAAiB;IAEhG,OAAO,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;CAI/C"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListContributorsCommand = void 0;
4
+ class ListContributorsCommand {
5
+ constructor(client, getAppConfig) {
6
+ this.client = client;
7
+ this.getAppConfig = getAppConfig;
8
+ }
9
+ async execute() {
10
+ const { id: appId } = await this.getAppConfig();
11
+ return await this.client.listContributors(appId);
12
+ }
13
+ }
14
+ exports.ListContributorsCommand = ListContributorsCommand;