@speedkit/cli 4.36.1 → 4.37.0

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 (310) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +12 -5
  3. package/dist/base/sk-command.d.ts +41 -0
  4. package/dist/base/sk-command.js +56 -0
  5. package/dist/commands/auto-prewarm.d.ts +6 -4
  6. package/dist/commands/auto-prewarm.js +13 -66
  7. package/dist/commands/autocomplete/fish.d.ts +2 -2
  8. package/dist/commands/autocomplete/fish.js +3 -2
  9. package/dist/commands/browser/clean.d.ts +2 -2
  10. package/dist/commands/browser/clean.js +6 -6
  11. package/dist/commands/browser/list.d.ts +2 -2
  12. package/dist/commands/browser/list.js +6 -7
  13. package/dist/commands/browser/update.d.ts +2 -2
  14. package/dist/commands/browser/update.js +9 -11
  15. package/dist/commands/bulk-deploy.d.ts +4 -2
  16. package/dist/commands/bulk-deploy.js +7 -37
  17. package/dist/commands/config/edit.d.ts +2 -2
  18. package/dist/commands/config/edit.js +2 -2
  19. package/dist/commands/config/setup.d.ts +5 -2
  20. package/dist/commands/config/setup.js +9 -19
  21. package/dist/commands/deploy.d.ts +12 -3
  22. package/dist/commands/deploy.js +14 -20
  23. package/dist/commands/diff-url-parameters.d.ts +3 -2
  24. package/dist/commands/diff-url-parameters.js +19 -16
  25. package/dist/commands/extension/add.d.ts +2 -2
  26. package/dist/commands/extension/add.js +6 -6
  27. package/dist/commands/extension/devtools.d.ts +2 -2
  28. package/dist/commands/extension/devtools.js +6 -7
  29. package/dist/commands/extension/list.d.ts +2 -2
  30. package/dist/commands/extension/list.js +5 -6
  31. package/dist/commands/extension/remove.d.ts +2 -2
  32. package/dist/commands/extension/remove.js +6 -6
  33. package/dist/commands/extension/update.d.ts +2 -2
  34. package/dist/commands/extension/update.js +5 -6
  35. package/dist/commands/find-pops.d.ts +2 -2
  36. package/dist/commands/find-pops.js +10 -11
  37. package/dist/commands/generate-customer-config.d.ts +5 -2
  38. package/dist/commands/generate-customer-config.js +9 -27
  39. package/dist/commands/generate-pop-config.d.ts +2 -2
  40. package/dist/commands/generate-pop-config.js +19 -15
  41. package/dist/commands/login.d.ts +2 -2
  42. package/dist/commands/login.js +6 -9
  43. package/dist/commands/onboarding.d.ts +19 -3
  44. package/dist/commands/onboarding.js +15 -11
  45. package/dist/commands/origin-request.d.ts +4 -2
  46. package/dist/commands/origin-request.js +10 -42
  47. package/dist/commands/prewarm.d.ts +4 -2
  48. package/dist/commands/prewarm.js +12 -56
  49. package/dist/commands/pull.d.ts +4 -2
  50. package/dist/commands/pull.js +9 -14
  51. package/dist/commands/query/parameter.d.ts +4 -2
  52. package/dist/commands/query/parameter.js +12 -19
  53. package/dist/commands/query/prewarm.d.ts +4 -2
  54. package/dist/commands/query/prewarm.js +16 -23
  55. package/dist/commands/revalidate.d.ts +4 -2
  56. package/dist/commands/revalidate.js +13 -56
  57. package/dist/commands/wpt-launcher.d.ts +2 -2
  58. package/dist/commands/wpt-launcher.js +16 -17
  59. package/dist/hooks/init/first-run.js +9 -10
  60. package/dist/models/context.d.ts +24 -0
  61. package/dist/models/context.js +31 -0
  62. package/dist/services/athena/athena-flags.d.ts +18 -0
  63. package/dist/services/athena/athena-flags.js +29 -0
  64. package/dist/services/athena/athena-service-build-context.d.ts +25 -0
  65. package/dist/services/athena/athena-service-build-context.js +4 -0
  66. package/dist/services/athena/athena-service-factory.d.ts +3 -16
  67. package/dist/services/athena/athena-service-factory.js +11 -27
  68. package/dist/services/athena/baqend-athena-service.d.ts +3 -14
  69. package/dist/services/athena/baqend-athena-service.js +8 -16
  70. package/dist/services/athena/index.d.ts +1 -0
  71. package/dist/services/athena/index.js +1 -0
  72. package/dist/services/athena/spec/baqend-athena-service.spec.js +2 -2
  73. package/dist/services/browser-fetch/browser-origin-fetch.d.ts +2 -2
  74. package/dist/services/browser-fetch/browser-origin-fetch.js +1 -1
  75. package/dist/services/browser-fetch/browser-origin-fetcher.d.ts +3 -3
  76. package/dist/services/browser-fetch/browser-origin-fetcher.js +5 -5
  77. package/dist/services/browser-fetch/spec/browser-origin-fetch.spec.js +10 -10
  78. package/dist/services/cli/cli-environment-factory.d.ts +25 -0
  79. package/dist/services/cli/cli-environment-factory.js +30 -0
  80. package/dist/services/cli/cli-environment.d.ts +73 -0
  81. package/dist/services/cli/cli-environment.js +216 -0
  82. package/dist/services/cli/cli-service-build-context.d.ts +10 -0
  83. package/dist/services/cli/cli-service-build-context.js +4 -0
  84. package/dist/services/cli/cli-service-factory.d.ts +7 -7
  85. package/dist/services/cli/cli-service-factory.js +7 -7
  86. package/dist/services/cli/cli-service-model.d.ts +0 -4
  87. package/dist/services/cli/cli-service-model.js +0 -6
  88. package/dist/services/cli/cli-service.d.ts +16 -2
  89. package/dist/services/cli/cli-service.js +17 -18
  90. package/dist/services/cli/cli-settings.d.ts +37 -0
  91. package/dist/services/cli/cli-settings.js +23 -0
  92. package/dist/services/cli/command-build-context.d.ts +23 -0
  93. package/dist/services/cli/index.d.ts +5 -1
  94. package/dist/services/cli/index.js +5 -1
  95. package/dist/services/cli/spec/cli-environment-detection.spec.js +52 -0
  96. package/dist/services/cli/spec/cli-environment.spec.js +125 -0
  97. package/dist/services/cli/spec/cli-service.spec.js +9 -19
  98. package/dist/services/config-api/client.d.ts +3 -3
  99. package/dist/services/config-api/client.js +4 -4
  100. package/dist/services/config-api/config-api-factory.js +3 -3
  101. package/dist/services/config-api/entity-manager-provider.d.ts +11 -0
  102. package/dist/services/config-api/{entity-manager-factory.js → entity-manager-provider.js} +7 -1
  103. package/dist/services/customer-config/customer-config-service-build-context.d.ts +33 -0
  104. package/dist/services/customer-config/customer-config-service-build-context.js +36 -0
  105. package/dist/services/customer-config/customer-config-service-factory.d.ts +3 -4
  106. package/dist/services/customer-config/customer-config-service-factory.js +5 -8
  107. package/dist/services/customer-config/customer-config-service.d.ts +2 -2
  108. package/dist/services/customer-config/index.d.ts +1 -1
  109. package/dist/services/customer-config/index.js +1 -1
  110. package/dist/services/customer-config/site-analyzer/index.d.ts +1 -0
  111. package/dist/services/customer-config/site-analyzer/index.js +1 -0
  112. package/dist/services/customer-config/site-analyzer/site-analyzer-service-build-context.d.ts +6 -0
  113. package/dist/services/customer-config/site-analyzer/site-analyzer-service-build-context.js +4 -0
  114. package/dist/services/customer-config/site-analyzer/site-analyzer-service-factory.d.ts +3 -3
  115. package/dist/services/customer-config/site-analyzer/site-analyzer-service-factory.js +4 -5
  116. package/dist/services/deploy/bulk/bulk-deploy-model.d.ts +0 -25
  117. package/dist/services/deploy/bulk/bulk-deploy-model.js +1 -27
  118. package/dist/services/deploy/bulk/bulk-deploy-service-build-context.d.ts +51 -0
  119. package/dist/services/deploy/bulk/bulk-deploy-service-build-context.js +50 -0
  120. package/dist/services/deploy/bulk/bulk-deploy-service-factory.d.ts +2 -4
  121. package/dist/services/deploy/bulk/bulk-deploy-service-factory.js +2 -5
  122. package/dist/services/deploy/bulk/bulk-deploy-service.d.ts +3 -2
  123. package/dist/services/deploy/bulk/config-deploy-factory.d.ts +3 -3
  124. package/dist/services/deploy/bulk/config-deploy-factory.js +16 -8
  125. package/dist/services/deploy/bulk/index.d.ts +1 -0
  126. package/dist/services/deploy/bulk/index.js +1 -0
  127. package/dist/services/deploy/checks/activation/customer-approval-check.d.ts +3 -1
  128. package/dist/services/deploy/checks/activation/customer-approval-check.js +4 -2
  129. package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.d.ts +3 -1
  130. package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +4 -2
  131. package/dist/services/deploy/checks/pre-deploy/split-change-check.d.ts +3 -1
  132. package/dist/services/deploy/checks/pre-deploy/split-change-check.js +4 -2
  133. package/dist/services/deploy/deploy-service-build-context.d.ts +63 -0
  134. package/dist/services/deploy/deploy-service-build-context.js +64 -0
  135. package/dist/services/deploy/deploy-service-factory.d.ts +5 -8
  136. package/dist/services/deploy/deploy-service-factory.js +28 -19
  137. package/dist/services/deploy/mr/base-config-reader.d.ts +6 -4
  138. package/dist/services/deploy/mr/base-config-reader.js +6 -8
  139. package/dist/services/deploy/mr/index.d.ts +1 -0
  140. package/dist/services/deploy/mr/index.js +1 -0
  141. package/dist/services/deploy/mr/merge-request-deploy-model.d.ts +0 -35
  142. package/dist/services/deploy/mr/merge-request-deploy-model.js +0 -34
  143. package/dist/services/deploy/mr/merge-request-deploy-service-build-context.d.ts +32 -0
  144. package/dist/services/deploy/mr/merge-request-deploy-service-build-context.js +20 -0
  145. package/dist/services/deploy/mr/merge-request-deploy-service-factory.d.ts +2 -4
  146. package/dist/services/deploy/mr/merge-request-deploy-service-factory.js +31 -10
  147. package/dist/services/deploy/mr/merge-request-deploy-service.d.ts +3 -2
  148. package/dist/services/deploy/spec/bulk/bulk-deploy-service.spec.js +14 -3
  149. package/dist/services/deploy/spec/checks/activation/customer-approval-check.spec.js +7 -5
  150. package/dist/services/deploy/spec/checks/pre-deploy/split-change-check.spec.js +2 -1
  151. package/dist/services/diff/diff-service-build-context.d.ts +14 -0
  152. package/dist/services/diff/diff-service-build-context.js +4 -0
  153. package/dist/services/diff/diff-service-factory.d.ts +4 -5
  154. package/dist/services/diff/diff-service-factory.js +4 -7
  155. package/dist/services/diff/index.d.ts +1 -1
  156. package/dist/services/diff/index.js +1 -1
  157. package/dist/services/document-handler-runtime/{context/document-handler-runtime-context.d.ts → document-handler-runtime-model.d.ts} +0 -5
  158. package/dist/services/document-handler-runtime/document-handler-runtime-service-build-context.d.ts +11 -0
  159. package/dist/services/document-handler-runtime/document-handler-runtime-service-build-context.js +4 -0
  160. package/dist/services/document-handler-runtime/document-handler-server.js +2 -2
  161. package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +3 -6
  162. package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +14 -14
  163. package/dist/services/document-handler-runtime/server/request.js +1 -1
  164. package/dist/services/document-handler-runtime/templates/database-mock.d.ts +1 -1
  165. package/dist/services/document-handler-runtime/templates/database-mock.js +1 -1
  166. package/dist/services/integration-api/customer-config-flags.d.ts +16 -0
  167. package/dist/services/integration-api/customer-config-flags.js +30 -0
  168. package/dist/services/integration-api/handler/install-resource-handler.d.ts +8 -0
  169. package/dist/services/integration-api/handler/install-resource-handler.js +10 -1
  170. package/dist/services/integration-api/index.d.ts +1 -0
  171. package/dist/services/integration-api/index.js +1 -0
  172. package/dist/services/integration-api/integration-api-factory.d.ts +4 -6
  173. package/dist/services/integration-api/integration-api-factory.js +11 -11
  174. package/dist/services/integration-api/integration-api-model.d.ts +0 -9
  175. package/dist/services/integration-api/integration-api-model.js +0 -16
  176. package/dist/services/integration-api/integration-api-service-build-context.d.ts +19 -0
  177. package/dist/services/integration-api/integration-api-service-build-context.js +4 -0
  178. package/dist/services/integration-api/spec/config-plugin.spec.js +1 -1
  179. package/dist/services/integration-api/spec/integration-api-service.spec.js +7 -3
  180. package/dist/services/integration-api/spec/speed-kit-config-file.spec.js +9 -2
  181. package/dist/services/integration-api/struct/config-plugin.d.ts +1 -1
  182. package/dist/services/integration-api/struct/config-plugin.js +12 -7
  183. package/dist/services/integration-api/struct/speed-kit-config-file.d.ts +18 -2
  184. package/dist/services/integration-api/struct/speed-kit-config-file.js +22 -12
  185. package/dist/services/integration-api/struct/speed-kit-config.d.ts +1 -1
  186. package/dist/services/onboarding/browse/browse-service.d.ts +18 -0
  187. package/dist/services/onboarding/browse/browse-service.js +61 -0
  188. package/dist/services/onboarding/browse/browse-url.d.ts +10 -0
  189. package/dist/services/onboarding/browse/browse-url.js +19 -0
  190. package/dist/services/onboarding/browser/config/browser-config.d.ts +3 -3
  191. package/dist/services/onboarding/browser/config/browser-config.js +5 -5
  192. package/dist/services/onboarding/browser/executable/executable-validator.d.ts +3 -3
  193. package/dist/services/onboarding/browser/executable/executable-validator.js +20 -16
  194. package/dist/services/onboarding/browser/extension/extension-downloader.d.ts +3 -3
  195. package/dist/services/onboarding/browser/extension/extension-downloader.js +8 -6
  196. package/dist/services/onboarding/browser/extension/extension-validator.d.ts +3 -3
  197. package/dist/services/onboarding/browser/extension/extension-validator.js +4 -4
  198. package/dist/services/onboarding/browser/launch-browser.d.ts +9 -0
  199. package/dist/services/onboarding/browser/launch-browser.js +20 -0
  200. package/dist/services/onboarding/error/browse-domain-error.d.ts +6 -0
  201. package/dist/services/onboarding/error/browse-domain-error.js +11 -0
  202. package/dist/services/onboarding/error/missing-customer-path-error.d.ts +6 -0
  203. package/dist/services/onboarding/error/missing-customer-path-error.js +11 -0
  204. package/dist/services/onboarding/file-events/file-watcher.js +1 -0
  205. package/dist/services/onboarding/index.d.ts +1 -1
  206. package/dist/services/onboarding/index.js +1 -1
  207. package/dist/services/onboarding/onboarding-model.d.ts +8 -24
  208. package/dist/services/onboarding/onboarding-model.js +19 -87
  209. package/dist/services/onboarding/onboarding-service-build-context.d.ts +61 -0
  210. package/dist/services/onboarding/onboarding-service-build-context.js +79 -0
  211. package/dist/services/onboarding/onboarding-service-factory.d.ts +31 -6
  212. package/dist/services/onboarding/onboarding-service-factory.js +120 -48
  213. package/dist/services/onboarding/onboarding-service.d.ts +2 -0
  214. package/dist/services/onboarding/onboarding-service.js +5 -16
  215. package/dist/services/onboarding/spec/browse/browse-url.spec.d.ts +1 -0
  216. package/dist/services/onboarding/spec/browse/browse-url.spec.js +28 -0
  217. package/dist/services/onboarding/spec/onboarding-model.spec.js +11 -6
  218. package/dist/services/onboarding/spec/onboarding-service-factory.spec.d.ts +1 -0
  219. package/dist/services/onboarding/spec/onboarding-service-factory.spec.js +155 -0
  220. package/dist/services/origin-request/index.d.ts +1 -1
  221. package/dist/services/origin-request/index.js +1 -1
  222. package/dist/services/origin-request/origin-request-service-build-context.d.ts +52 -0
  223. package/dist/services/origin-request/origin-request-service-build-context.js +54 -0
  224. package/dist/services/origin-request/origin-request-service-factory.d.ts +2 -5
  225. package/dist/services/origin-request/origin-request-service-factory.js +12 -12
  226. package/dist/services/origin-request/origin-request-service.d.ts +2 -2
  227. package/dist/services/pop-config/index.d.ts +1 -0
  228. package/dist/services/pop-config/index.js +1 -0
  229. package/dist/services/pop-config/pop-config-factory.d.ts +4 -1
  230. package/dist/services/pop-config/pop-config-factory.js +10 -3
  231. package/dist/services/pop-config/pop-config-service-build-context.d.ts +10 -0
  232. package/dist/services/pop-config/pop-config-service-build-context.js +4 -0
  233. package/dist/services/prewarm/auto-pre-warm-factory.d.ts +3 -31
  234. package/dist/services/prewarm/auto-pre-warm-factory.js +6 -11
  235. package/dist/services/prewarm/auto-pre-warm-service-build-context.d.ts +84 -0
  236. package/dist/services/prewarm/auto-pre-warm-service-build-context.js +68 -0
  237. package/dist/services/prewarm/index.d.ts +2 -0
  238. package/dist/services/prewarm/index.js +2 -0
  239. package/dist/services/prewarm/pre-warm-factory.d.ts +4 -5
  240. package/dist/services/prewarm/pre-warm-factory.js +6 -8
  241. package/dist/services/prewarm/pre-warm-model.d.ts +0 -10
  242. package/dist/services/prewarm/pre-warm-model.js +0 -18
  243. package/dist/services/prewarm/pre-warm-service-build-context.d.ts +47 -0
  244. package/dist/services/prewarm/pre-warm-service-build-context.js +64 -0
  245. package/dist/services/pull/index.d.ts +1 -0
  246. package/dist/services/pull/index.js +1 -0
  247. package/dist/services/pull/pull-service-build-context.d.ts +28 -0
  248. package/dist/services/pull/pull-service-build-context.js +17 -0
  249. package/dist/services/pull/pull-service-factory.d.ts +3 -5
  250. package/dist/services/pull/pull-service-factory.js +13 -14
  251. package/dist/services/pull/pull-service-model.d.ts +0 -5
  252. package/dist/services/pull/pull-service-model.js +0 -9
  253. package/dist/services/query-builder/query-builder-factory.d.ts +9 -7
  254. package/dist/services/query-builder/query-builder-factory.js +26 -15
  255. package/dist/{models/cli-parameters.d.ts → services/query-builder/query-builder-flags.d.ts} +1 -120
  256. package/dist/services/query-builder/query-builder-flags.js +150 -0
  257. package/dist/services/query-builder/query-builder-model.d.ts +1 -14
  258. package/dist/services/query-builder/query-builder-service-build-context.d.ts +113 -0
  259. package/dist/services/query-builder/query-builder-service-build-context.js +68 -0
  260. package/dist/services/query-builder/query-builder-service.d.ts +3 -3
  261. package/dist/services/query-builder/spec/query-builder-flags.spec.d.ts +1 -0
  262. package/dist/{models/spec/cli-parameters.spec.js → services/query-builder/spec/query-builder-flags.spec.js} +1 -1
  263. package/dist/services/revalidate/index.d.ts +1 -0
  264. package/dist/services/revalidate/index.js +1 -0
  265. package/dist/services/revalidate/revalidate-factory.d.ts +3 -5
  266. package/dist/services/revalidate/revalidate-factory.js +2 -6
  267. package/dist/services/revalidate/revalidate-model.d.ts +0 -9
  268. package/dist/services/revalidate/revalidate-model.js +0 -8
  269. package/dist/services/revalidate/revalidate-service-build-context.d.ts +38 -0
  270. package/dist/services/revalidate/revalidate-service-build-context.js +59 -0
  271. package/dist/services/setup/browser/browser-setup-service.d.ts +3 -4
  272. package/dist/services/setup/browser/browser-setup-service.js +16 -18
  273. package/dist/services/setup/difftool/difftool-setup-service.d.ts +3 -4
  274. package/dist/services/setup/difftool/difftool-setup-service.js +5 -7
  275. package/dist/services/setup/extension/extension-setup-service.d.ts +3 -4
  276. package/dist/services/setup/extension/extension-setup-service.js +8 -10
  277. package/dist/services/setup/index.d.ts +1 -1
  278. package/dist/services/setup/index.js +1 -1
  279. package/dist/services/setup/setup-service-build-context.d.ts +27 -0
  280. package/dist/services/setup/setup-service-build-context.js +26 -0
  281. package/dist/services/setup/setup-service-factory.d.ts +2 -6
  282. package/dist/services/setup/setup-service-factory.js +10 -18
  283. package/dist/services/setup/setup-service.d.ts +4 -5
  284. package/dist/services/setup/setup-service.js +6 -7
  285. package/oclif.manifest.json +155 -147
  286. package/package.json +4 -2
  287. package/dist/models/cli-parameters.js +0 -297
  288. package/dist/services/cli/cli-config.d.ts +0 -59
  289. package/dist/services/cli/cli-config.js +0 -180
  290. package/dist/services/cli/environment.d.ts +0 -15
  291. package/dist/services/cli/environment.js +0 -40
  292. package/dist/services/cli/spec/cli-config.spec.js +0 -117
  293. package/dist/services/cli/spec/environment.spec.js +0 -28
  294. package/dist/services/config-api/entity-manager-factory.d.ts +0 -5
  295. package/dist/services/customer-config/customer-config-service-context.d.ts +0 -13
  296. package/dist/services/customer-config/customer-config-service-context.js +0 -21
  297. package/dist/services/deploy/context/deploy-context.d.ts +0 -32
  298. package/dist/services/deploy/context/deploy-context.js +0 -72
  299. package/dist/services/diff/diff-model.d.ts +0 -9
  300. package/dist/services/diff/diff-model.js +0 -12
  301. package/dist/services/origin-request/origin-request-context.d.ts +0 -13
  302. package/dist/services/origin-request/origin-request-context.js +0 -23
  303. package/dist/services/query-builder/query-command.d.ts +0 -28
  304. package/dist/services/query-builder/query-command.js +0 -37
  305. package/dist/services/setup/setup-context.d.ts +0 -14
  306. package/dist/services/setup/setup-context.js +0 -15
  307. /package/dist/{models/spec/cli-parameters.spec.d.ts → services/cli/command-build-context.js} +0 -0
  308. /package/dist/services/cli/spec/{cli-config.spec.d.ts → cli-environment-detection.spec.d.ts} +0 -0
  309. /package/dist/services/cli/spec/{environment.spec.d.ts → cli-environment.spec.d.ts} +0 -0
  310. /package/dist/services/document-handler-runtime/{context/document-handler-runtime-context.js → document-handler-runtime-model.js} +0 -0
@@ -1,11 +1,9 @@
1
- import { UserCliConfig } from "../../cli/index.js";
2
- import { BulkDeployContext } from "./bulk-deploy-model.js";
1
+ import { BulkDeployServiceBuildContext } from "./bulk-deploy-service-build-context.js";
3
2
  import { BulkDeployService } from "./bulk-deploy-service.js";
4
3
  export declare class BulkDeployServiceFactory {
5
4
  private readonly context;
6
- private readonly cliConfig;
7
5
  private service?;
8
- constructor(context: BulkDeployContext, cliConfig: UserCliConfig);
6
+ constructor(context: BulkDeployServiceBuildContext);
9
7
  getService(): BulkDeployService;
10
8
  private build;
11
9
  }
@@ -1,14 +1,11 @@
1
- import { CliServiceFactory } from "../../cli/index.js";
2
1
  import { GitRepository } from "../../git/index.js";
3
2
  import { BulkDeployService } from "./bulk-deploy-service.js";
4
3
  import { ConfigDeployFactory } from "./config-deploy-factory.js";
5
4
  export class BulkDeployServiceFactory {
6
5
  context;
7
- cliConfig;
8
6
  service = undefined;
9
- constructor(context, cliConfig) {
7
+ constructor(context) {
10
8
  this.context = context;
11
- this.cliConfig = cliConfig;
12
9
  }
13
10
  getService() {
14
11
  if (!(this.service instanceof BulkDeployService)) {
@@ -19,6 +16,6 @@ export class BulkDeployServiceFactory {
19
16
  build() {
20
17
  const repository = GitRepository.at(this.context.repositoryPath);
21
18
  const request = repository.mergeRequest(this.context.iid);
22
- this.service = new BulkDeployService(this.context, repository, request, new ConfigDeployFactory(this.cliConfig, repository, request, this.context.dryRun), new CliServiceFactory().getService());
19
+ this.service = new BulkDeployService(this.context, repository, request, new ConfigDeployFactory(this.context.environment, repository, request, this.context.dryRun), this.context.environment.cli);
23
20
  }
24
21
  }
@@ -1,7 +1,8 @@
1
+ import { BulkDeployOptions } from "./bulk-deploy-service-build-context.js";
1
2
  import { CliServiceInterface } from "../../cli/index.js";
2
3
  import { GitRepository, MergedRequest } from "../../git/index.js";
3
4
  import { MergeRequestDeployResult } from "../mr/index.js";
4
- import { BulkDeployContext, ConfigDeployFactoryInterface } from "./bulk-deploy-model.js";
5
+ import { ConfigDeployFactoryInterface } from "./bulk-deploy-model.js";
5
6
  /**
6
7
  * Deploys every customer configuration of a merged merge request.
7
8
  *
@@ -16,7 +17,7 @@ export declare class BulkDeployService {
16
17
  private readonly request;
17
18
  private readonly deployFactory;
18
19
  private readonly cli;
19
- constructor(context: BulkDeployContext, repository: GitRepository, request: MergedRequest, deployFactory: ConfigDeployFactoryInterface, cli: CliServiceInterface);
20
+ constructor(context: BulkDeployOptions, repository: GitRepository, request: MergedRequest, deployFactory: ConfigDeployFactoryInterface, cli: CliServiceInterface);
20
21
  run(): Promise<MergeRequestDeployResult[]>;
21
22
  /**
22
23
  * The production config of every customer the merge request changes.
@@ -1,13 +1,13 @@
1
- import { UserCliConfig } from "../../cli/index.js";
1
+ import { CliEnvironment } from "../../cli/index.js";
2
2
  import { GitRepository, MergedRequest } from "../../git/index.js";
3
3
  import { MergeRequestDeployService } from "../mr/index.js";
4
4
  import { BulkAnswers, ConfigDeployFactoryInterface, TouchedConfig } from "./bulk-deploy-model.js";
5
5
  /** Builds the deploy of one configuration of the bulk run. */
6
6
  export declare class ConfigDeployFactory implements ConfigDeployFactoryInterface {
7
- private readonly cliConfig;
7
+ private readonly environment;
8
8
  private readonly repository;
9
9
  private readonly request;
10
10
  private readonly dryRun;
11
- constructor(cliConfig: UserCliConfig, repository: GitRepository, request: MergedRequest, dryRun: boolean);
11
+ constructor(environment: CliEnvironment, repository: GitRepository, request: MergedRequest, dryRun: boolean);
12
12
  build(config: TouchedConfig, answers: BulkAnswers): Promise<MergeRequestDeployService>;
13
13
  }
@@ -1,20 +1,28 @@
1
- import { MergeRequestDeployContext, MergeRequestDeployServiceFactory, } from "../mr/index.js";
1
+ import { MergeRequestDeployServiceBuildContext, MergeRequestDeployServiceFactory, } from "../mr/index.js";
2
2
  /** Builds the deploy of one configuration of the bulk run. */
3
3
  export class ConfigDeployFactory {
4
- cliConfig;
4
+ environment;
5
5
  repository;
6
6
  request;
7
7
  dryRun;
8
- constructor(cliConfig, repository, request, dryRun) {
9
- this.cliConfig = cliConfig;
8
+ constructor(environment, repository, request, dryRun) {
9
+ this.environment = environment;
10
10
  this.repository = repository;
11
11
  this.request = request;
12
12
  this.dryRun = dryRun;
13
13
  }
14
14
  async build(config, answers) {
15
- return new MergeRequestDeployServiceFactory(new MergeRequestDeployContext(config.customerPath, config.configName, this.request.iid, answers.approval, answers.description, this.dryRun,
16
- // A run over many customers pays for every check once per customer,
17
- // so the checks after the upload are left to sk deploy.
18
- true), this.cliConfig, this.repository, this.request).buildService();
15
+ return new MergeRequestDeployServiceFactory(new MergeRequestDeployServiceBuildContext({
16
+ environment: this.environment,
17
+ customerPath: config.customerPath,
18
+ configName: config.configName,
19
+ iid: this.request.iid,
20
+ approval: answers.approval,
21
+ description: answers.description,
22
+ dryRun: this.dryRun,
23
+ // A run over many customers pays for every check once per customer,
24
+ // so the checks after the upload are left to sk deploy.
25
+ skipPostDeployChecks: true,
26
+ }), this.repository, this.request).buildService();
19
27
  }
20
28
  }
@@ -1,4 +1,5 @@
1
1
  export * from "./bulk-deploy-model.js";
2
+ export * from "./bulk-deploy-service-build-context.js";
2
3
  export * from "./touched-configs.js";
3
4
  export * from "./bulk-deploy-service.js";
4
5
  export * from "./config-deploy-factory.js";
@@ -1,4 +1,5 @@
1
1
  export * from "./bulk-deploy-model.js";
2
+ export * from "./bulk-deploy-service-build-context.js";
2
3
  export * from "./touched-configs.js";
3
4
  export * from "./bulk-deploy-service.js";
4
5
  export * from "./config-deploy-factory.js";
@@ -1,4 +1,5 @@
1
1
  import { CliServiceInterface } from "../../../cli/index.js";
2
+ import type { BundleService } from "../../../bundler/index.js";
2
3
  import { CustomerConfig } from "../../../integration-api/index.js";
3
4
  import Install from "../../interface/install.js";
4
5
  import { DeployPolicyInterface } from "../../policy/index.js";
@@ -13,7 +14,8 @@ export declare class CustomerApprovalCheck {
13
14
  private cli;
14
15
  private customer;
15
16
  private policy;
16
- constructor(cli: CliServiceInterface, customer: CustomerConfig, policy: DeployPolicyInterface);
17
+ private bundler;
18
+ constructor(cli: CliServiceInterface, customer: CustomerConfig, policy: DeployPolicyInterface, bundler: BundleService);
17
19
  /**
18
20
  * Whether the installation may be offered for regular activation. `false`
19
21
  * means the deploy is limited to a testing installation.
@@ -14,10 +14,12 @@ export class CustomerApprovalCheck {
14
14
  cli;
15
15
  customer;
16
16
  policy;
17
- constructor(cli, customer, policy) {
17
+ bundler;
18
+ constructor(cli, customer, policy, bundler) {
18
19
  this.cli = cli;
19
20
  this.customer = customer;
20
21
  this.policy = policy;
22
+ this.bundler = bundler;
21
23
  }
22
24
  /**
23
25
  * Whether the installation may be offered for regular activation. `false`
@@ -45,7 +47,7 @@ export class CustomerApprovalCheck {
45
47
  }
46
48
  // The config to be activated, read the same way the local file is — one
47
49
  // file, evaluated once per origin.
48
- const configFile = await VirtualSpeedKitConfigFile.createRemote(speedKitConfig);
50
+ const configFile = await VirtualSpeedKitConfigFile.createRemote(speedKitConfig, this.bundler);
49
51
  const splits = [];
50
52
  for (const origin of this.customer.origins) {
51
53
  const result = await safe(configFile.evaluate(this.customer.app, origin));
@@ -1,5 +1,6 @@
1
1
  import { FileListInterface, CustomerConfig } from "../../../integration-api/index.js";
2
2
  import { CliServiceInterface } from "../../../cli/index.js";
3
+ import type { BundleService } from "../../../bundler/index.js";
3
4
  import { ConfigApiService } from "../../../config-api/index.js";
4
5
  import { DeployPolicyInterface } from "../../policy/index.js";
5
6
  export declare class DeviceDetectionChangedCheck {
@@ -10,7 +11,8 @@ export declare class DeviceDetectionChangedCheck {
10
11
  private configName;
11
12
  private isProduction;
12
13
  private policy;
13
- constructor(cli: CliServiceInterface, fileList: FileListInterface, configApi: ConfigApiService, customerConfig: CustomerConfig, configName: string, isProduction: boolean, policy: DeployPolicyInterface);
14
+ private bundler;
15
+ constructor(cli: CliServiceInterface, fileList: FileListInterface, configApi: ConfigApiService, customerConfig: CustomerConfig, configName: string, isProduction: boolean, policy: DeployPolicyInterface, bundler: BundleService);
14
16
  check(): Promise<void>;
15
17
  private checkForChangedDeviceDetection;
16
18
  private getActiveInstallResource;
@@ -12,7 +12,8 @@ export class DeviceDetectionChangedCheck {
12
12
  configName;
13
13
  isProduction;
14
14
  policy;
15
- constructor(cli, fileList, configApi, customerConfig, configName, isProduction, policy) {
15
+ bundler;
16
+ constructor(cli, fileList, configApi, customerConfig, configName, isProduction, policy, bundler) {
16
17
  this.cli = cli;
17
18
  this.fileList = fileList;
18
19
  this.configApi = configApi;
@@ -20,6 +21,7 @@ export class DeviceDetectionChangedCheck {
20
21
  this.configName = configName;
21
22
  this.isProduction = isProduction;
22
23
  this.policy = policy;
24
+ this.bundler = bundler;
23
25
  }
24
26
  async check() {
25
27
  if (
@@ -58,7 +60,7 @@ export class DeviceDetectionChangedCheck {
58
60
  }
59
61
  }
60
62
  async checkForChangedDeviceDetection(speedKitConfigFile, activeSpeedKitConfig) {
61
- const remoteConfigFile = await VirtualSpeedKitConfigFile.createRemote(activeSpeedKitConfig);
63
+ const remoteConfigFile = await VirtualSpeedKitConfigFile.createRemote(activeSpeedKitConfig, this.bundler);
62
64
  const app = this.customerConfig.app;
63
65
  const origin = this.customerConfig.origins[0];
64
66
  const changes = [];
@@ -1,5 +1,6 @@
1
1
  import { FileListInterface, CustomerConfig } from "../../../integration-api/index.js";
2
2
  import { CliServiceInterface } from "../../../cli/index.js";
3
+ import type { BundleService } from "../../../bundler/index.js";
3
4
  import { ConfigApiService } from "../../../config-api/index.js";
4
5
  import { DeployPolicyInterface } from "../../policy/index.js";
5
6
  export declare class SplitChangeCheck {
@@ -10,7 +11,8 @@ export declare class SplitChangeCheck {
10
11
  private configName;
11
12
  private isProduction;
12
13
  private policy;
13
- constructor(cli: CliServiceInterface, fileList: FileListInterface, configApi: ConfigApiService, customerConfig: CustomerConfig, configName: string, isProduction: boolean, policy: DeployPolicyInterface);
14
+ private bundler;
15
+ constructor(cli: CliServiceInterface, fileList: FileListInterface, configApi: ConfigApiService, customerConfig: CustomerConfig, configName: string, isProduction: boolean, policy: DeployPolicyInterface, bundler: BundleService);
14
16
  check(): Promise<void>;
15
17
  private checkSplitsForEachOrigin;
16
18
  private getActiveInstallResource;
@@ -12,7 +12,8 @@ export class SplitChangeCheck {
12
12
  configName;
13
13
  isProduction;
14
14
  policy;
15
- constructor(cli, fileList, configApi, customerConfig, configName, isProduction, policy) {
15
+ bundler;
16
+ constructor(cli, fileList, configApi, customerConfig, configName, isProduction, policy, bundler) {
16
17
  this.cli = cli;
17
18
  this.fileList = fileList;
18
19
  this.configApi = configApi;
@@ -20,6 +21,7 @@ export class SplitChangeCheck {
20
21
  this.configName = configName;
21
22
  this.isProduction = isProduction;
22
23
  this.policy = policy;
24
+ this.bundler = bundler;
23
25
  }
24
26
  async check() {
25
27
  if (
@@ -60,7 +62,7 @@ export class SplitChangeCheck {
60
62
  }
61
63
  }
62
64
  async checkSplitsForEachOrigin(speedKitConfigFile, activeSpeedKitConfig) {
63
- const remoteConfigFile = await VirtualSpeedKitConfigFile.createRemote(activeSpeedKitConfig);
65
+ const remoteConfigFile = await VirtualSpeedKitConfigFile.createRemote(activeSpeedKitConfig, this.bundler);
64
66
  const app = this.customerConfig.app;
65
67
  const changes = [];
66
68
  for (const origin of this.customerConfig.origins) {
@@ -0,0 +1,63 @@
1
+ import { Interfaces } from "@oclif/core";
2
+ import { CliEnvironment, CommandContextValues } from "../cli/index.js";
3
+ declare const args: {
4
+ customerPath: Interfaces.Arg<string, {
5
+ exists?: boolean;
6
+ }>;
7
+ };
8
+ /** The flags of `sk deploy`, for a single deploy and for `--mr`. */
9
+ declare const flags: {
10
+ dryRun: Interfaces.BooleanFlag<boolean>;
11
+ verboseLevel: Interfaces.BooleanFlag<boolean>;
12
+ artifacts: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
13
+ mr: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
14
+ description: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
15
+ approval: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
16
+ useTestConfig: Interfaces.BooleanFlag<boolean>;
17
+ configName: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
18
+ };
19
+ /** The parsed args and flags of `sk deploy`. */
20
+ export type DeployCommandArgs = Interfaces.InferredArgs<typeof args>;
21
+ export type DeployCommandFlags = Interfaces.InferredFlags<typeof flags>;
22
+ export interface DeployServiceBuildContextValues extends CommandContextValues {
23
+ readonly customerPath: string;
24
+ readonly configName: string;
25
+ /** The logical names of the files to upload; empty uploads them all. */
26
+ readonly artifacts: string[];
27
+ readonly dryRun: boolean;
28
+ readonly useTestConfig: boolean;
29
+ /** Leave out the modules and the server config, which a bulk never deploys. */
30
+ readonly installFilesOnly?: boolean;
31
+ /**
32
+ * Leave out the checks that run after the upload. Each of them asks the app
33
+ * for its jobs and its modules, which a run over many customers pays for once
34
+ * per customer.
35
+ */
36
+ readonly skipPostDeployChecks?: boolean;
37
+ /** Open the diff tool for a file that differs, as a person expects; the default. */
38
+ readonly opensDiffTool?: boolean;
39
+ }
40
+ declare const DeployServiceBuildContext_base: new (values: DeployServiceBuildContextValues) => Readonly<DeployServiceBuildContextValues>;
41
+ /** What `sk deploy` deploys: one config of one customer. */
42
+ export declare class DeployServiceBuildContext extends DeployServiceBuildContext_base {
43
+ static readonly args: {
44
+ customerPath: Interfaces.Arg<string, {
45
+ exists?: boolean;
46
+ }>;
47
+ };
48
+ static readonly flags: {
49
+ dryRun: Interfaces.BooleanFlag<boolean>;
50
+ verboseLevel: Interfaces.BooleanFlag<boolean>;
51
+ artifacts: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
52
+ mr: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
53
+ description: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
54
+ approval: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
55
+ useTestConfig: Interfaces.BooleanFlag<boolean>;
56
+ configName: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
57
+ };
58
+ static create(parsedArgs: DeployCommandArgs, parsedFlags: DeployCommandFlags, environment: CliEnvironment): DeployServiceBuildContext;
59
+ /** A production config gets the checks a change to live traffic needs. */
60
+ get isProduction(): boolean;
61
+ get hasArtifacts(): boolean;
62
+ }
63
+ export {};
@@ -0,0 +1,64 @@
1
+ import * as dotenv from "dotenv";
2
+ import { Flags } from "@oclif/core";
3
+ import { CLI_CONFIG_IS_TEST, CLI_CONFIG_NAME, CLI_CUSTOMER_CONFIG, } from "../integration-api/customer-config-flags.js";
4
+ import { Context } from "../../models/context.js";
5
+ dotenv.config({ quiet: true });
6
+ const ARTIFACTS_SEPARATOR = ",";
7
+ const args = { ...CLI_CUSTOMER_CONFIG };
8
+ /** The flags of `sk deploy`, for a single deploy and for `--mr`. */
9
+ const flags = {
10
+ ...CLI_CONFIG_NAME,
11
+ ...CLI_CONFIG_IS_TEST,
12
+ dryRun: Flags.boolean({
13
+ char: "d",
14
+ default: false,
15
+ description: "dry run",
16
+ }),
17
+ verboseLevel: Flags.boolean({
18
+ char: "v",
19
+ default: false,
20
+ description: "Show all messages",
21
+ }),
22
+ artifacts: Flags.string({
23
+ char: "a",
24
+ description: "which files to upload",
25
+ }),
26
+ mr: Flags.integer({
27
+ description: "deploy the reviewed change of this merged merge request, without questions",
28
+ }),
29
+ description: Flags.string({
30
+ dependsOn: ["mr"],
31
+ description: "the description every installation of the run gets, asked while it is left out",
32
+ }),
33
+ approval: Flags.string({
34
+ options: ["approved", "testing", "skip"],
35
+ // No default: oclif counts a defaulted flag as given, so dependsOn would fail every deploy.
36
+ dependsOn: ["mr"],
37
+ description: "what to do with a customer that approves every rollout themselves",
38
+ }),
39
+ };
40
+ /** What `sk deploy` deploys: one config of one customer. */
41
+ export class DeployServiceBuildContext extends Context() {
42
+ static args = args;
43
+ static flags = flags;
44
+ static create(parsedArgs, parsedFlags, environment) {
45
+ return new DeployServiceBuildContext({
46
+ environment,
47
+ customerPath: parsedArgs.customerPath,
48
+ configName: parsedFlags.configName,
49
+ artifacts: parsedFlags.artifacts
50
+ ? parsedFlags.artifacts.split(ARTIFACTS_SEPARATOR)
51
+ : [],
52
+ dryRun: parsedFlags.dryRun,
53
+ useTestConfig: parsedFlags.useTestConfig,
54
+ });
55
+ }
56
+ /** A production config gets the checks a change to live traffic needs. */
57
+ get isProduction() {
58
+ return this.configName.toLowerCase().includes("prod");
59
+ }
60
+ get hasArtifacts() {
61
+ return this.artifacts?.length > 0;
62
+ }
63
+ }
64
+ DeployServiceBuildContext;
@@ -1,24 +1,21 @@
1
- import { CliServiceInterface, UserCliConfig } from "../cli/index.js";
2
- import DeployContext from "./context/deploy-context.js";
1
+ import { DeployServiceBuildContext } from "./deploy-service-build-context.js";
3
2
  import DeployService from "./deploy-service.js";
4
3
  import { FileListInterface } from "../integration-api/index.js";
5
4
  import { ConfigApiService } from "../config-api/index.js";
6
5
  import { DeployPolicyInterface } from "./policy/index.js";
7
6
  export default class DeployServiceFactory {
8
- private context;
9
- private cliConfig;
7
+ private readonly context;
10
8
  /** The answers of the deploy. A person answers while this is left out. */
11
- private policyOverride?;
12
- private cli?;
9
+ private readonly policyOverride?;
13
10
  private service?;
14
11
  /** The configuration on disk, as the service it built deploys it. */
15
12
  files?: FileListInterface;
16
13
  /** The name the installation has in the app. */
17
14
  configName?: string;
18
15
  configApi?: ConfigApiService;
19
- constructor(context: DeployContext, cliConfig: UserCliConfig,
16
+ constructor(context: DeployServiceBuildContext,
20
17
  /** The answers of the deploy. A person answers while this is left out. */
21
- policyOverride?: DeployPolicyInterface, cli?: CliServiceInterface);
18
+ policyOverride?: DeployPolicyInterface);
22
19
  buildService(): Promise<DeployService>;
23
20
  private build;
24
21
  private getConfigApi;
@@ -1,5 +1,4 @@
1
- import { CliServiceFactory, } from "../cli/index.js";
2
- import { DiffContext, DiffServiceFactory } from "../diff/index.js";
1
+ import { DiffServiceBuildContext, DiffServiceFactory } from "../diff/index.js";
3
2
  import InstallResourceBuilder from "./builder/install-resource-builder.js";
4
3
  import RevalidatedModuleCheck from "./checks/post-deploy/revalidated-module-check.js";
5
4
  import SaveFilesCheck from "./checks/post-deploy/save-files-check.js";
@@ -9,32 +8,29 @@ import InstallResourceHandler from "./handler/install-resource-handler.js";
9
8
  import DeletedFileCheck from "./handler/install-resource-modifier/deleted-file-check.js";
10
9
  import ModuleHandler from "./handler/module-handler.js";
11
10
  import ServerConfigHandler from "./handler/server-config-handler.js";
12
- import { IntegrationApiFactory, IntegrationApiContext, FILE_TYPE, DEFAULT_BLOCKED_FOLDERS, } from "../integration-api/index.js";
11
+ import { IntegrationApiFactory, IntegrationApiServiceBuildContext, FILE_TYPE, DEFAULT_BLOCKED_FOLDERS, } from "../integration-api/index.js";
13
12
  import { SplitChangeCheck } from "./checks/pre-deploy/split-change-check.js";
14
13
  import { ConfigApiContext, ConfigApiServiceFactory, } from "../config-api/index.js";
15
14
  import { DeprecatedDeploymentDetectionCheck } from "./checks/post-deploy/deprecated-deployment-detection-check.js";
16
15
  import { DeviceDetectionChangedCheck } from "./checks/pre-deploy/device-detection-changed-check.js";
17
16
  import { RefreshDeploymentJobCheck } from "./checks/post-deploy/refresh-deployment-job-check.js";
18
17
  import { CustomerApprovalCheck } from "./checks/activation/customer-approval-check.js";
18
+ import { BundleServiceFactory } from "../bundler/index.js";
19
19
  import { InteractiveDeployPolicy, } from "./policy/index.js";
20
20
  export default class DeployServiceFactory {
21
21
  context;
22
- cliConfig;
23
22
  policyOverride;
24
- cli;
25
23
  service = undefined;
26
24
  /** The configuration on disk, as the service it built deploys it. */
27
25
  files = undefined;
28
26
  /** The name the installation has in the app. */
29
27
  configName = undefined;
30
28
  configApi = undefined;
31
- constructor(context, cliConfig,
29
+ constructor(context,
32
30
  /** The answers of the deploy. A person answers while this is left out. */
33
- policyOverride, cli) {
31
+ policyOverride) {
34
32
  this.context = context;
35
- this.cliConfig = cliConfig;
36
33
  this.policyOverride = policyOverride;
37
- this.cli = cli;
38
34
  }
39
35
  async buildService() {
40
36
  if (!(this.service instanceof DeployService)) {
@@ -43,26 +39,32 @@ export default class DeployServiceFactory {
43
39
  return this.service;
44
40
  }
45
41
  async build() {
46
- const cliService = this.cli ?? new CliServiceFactory().getService();
47
- const files = await this.getIntegrationFiles(cliService);
42
+ const cliService = this.context.environment.cli;
43
+ const files = await this.getIntegrationFiles();
48
44
  const customer = files.getCustomerConfig().config;
49
45
  const configName = customer.name || this.context.configName;
50
46
  const configApi = this.getConfigApi(customer.app);
51
47
  this.files = files;
52
48
  this.configName = configName;
53
49
  this.configApi = configApi;
54
- const diffService = new DiffServiceFactory(new DiffContext(this.cliConfig.diffExec, this.cliConfig.diffExecTemplate, this.context.opensDiffTool), cliService).getService();
50
+ const diffService = new DiffServiceFactory(new DiffServiceBuildContext({
51
+ environment: this.context.environment,
52
+ executablePath: this.context.environment.settings.diffExec,
53
+ executableTemplate: this.context.environment.settings.diffExecTemplate,
54
+ opensDiffTool: this.context.opensDiffTool ?? true,
55
+ })).getService();
55
56
  const policy = this.policyOverride ?? new InteractiveDeployPolicy(cliService);
56
57
  const installResourceBuilder = new InstallResourceBuilder(configApi);
57
- const deletedFilesChecker = new DeletedFileCheck(cliService, policy, this.context.hasArtifacts());
58
+ const bundler = new BundleServiceFactory("./").buildService();
59
+ const deletedFilesChecker = new DeletedFileCheck(cliService, policy, this.context.hasArtifacts);
58
60
  this.service = new DeployService(files, [
59
61
  new CustomerConfigHandler(customer, configApi, configName, diffService, cliService, installResourceBuilder, policy),
60
- new InstallResourceHandler(customer, configApi, configName, diffService, cliService, installResourceBuilder, deletedFilesChecker, new CustomerApprovalCheck(cliService, customer, policy), policy),
62
+ new InstallResourceHandler(customer, configApi, configName, diffService, cliService, installResourceBuilder, deletedFilesChecker, new CustomerApprovalCheck(cliService, customer, policy, bundler), policy),
61
63
  new ModuleHandler(configApi, diffService, cliService, [], policy),
62
64
  new ServerConfigHandler(configApi, diffService, cliService, policy),
63
65
  ], cliService, [
64
- new SplitChangeCheck(cliService, files, configApi, customer, configName, this.context.isProduction, policy),
65
- new DeviceDetectionChangedCheck(cliService, files, configApi, customer, configName, this.context.isProduction, policy),
66
+ new SplitChangeCheck(cliService, files, configApi, customer, configName, this.context.isProduction, policy, bundler),
67
+ new DeviceDetectionChangedCheck(cliService, files, configApi, customer, configName, this.context.isProduction, policy, bundler),
66
68
  ], this.context.skipPostDeployChecks
67
69
  ? []
68
70
  : await this.getPostDeployChecks(files, cliService, configApi, customer.app, policy), this.context.dryRun);
@@ -71,9 +73,16 @@ export default class DeployServiceFactory {
71
73
  const configApiContext = new ConfigApiContext(app);
72
74
  return new ConfigApiServiceFactory(configApiContext).getService();
73
75
  }
74
- async getIntegrationFiles(cli) {
75
- const integrationApiContext = new IntegrationApiContext(this.context.customerPath, this.context.configName, this.context.artifacts, DEFAULT_BLOCKED_FOLDERS, this.context.useTestConfig);
76
- const integrationApi = new IntegrationApiFactory(integrationApiContext, this.cliConfig, cli).buildService();
76
+ async getIntegrationFiles() {
77
+ const integrationApiContext = new IntegrationApiServiceBuildContext({
78
+ environment: this.context.environment,
79
+ basePath: this.context.customerPath,
80
+ configName: this.context.configName,
81
+ whitelist: this.context.artifacts,
82
+ blockedFolders: DEFAULT_BLOCKED_FOLDERS,
83
+ useTestConfig: this.context.useTestConfig,
84
+ });
85
+ const integrationApi = new IntegrationApiFactory(integrationApiContext).buildService();
77
86
  const files = await integrationApi.run();
78
87
  if (this.context.installFilesOnly) {
79
88
  files.filter((file) => file.type === FILE_TYPE.INSTALL_FILE ||
@@ -1,17 +1,19 @@
1
- import { UserCliConfig } from "../../cli/index.js";
2
1
  import { GitRepository } from "../../git/index.js";
3
2
  import { FileListInterface } from "../../integration-api/index.js";
3
+ /** Reads the configuration of one environment from a customer directory. */
4
+ export type ConfigDirectoryReader = (directory: string, configName: string) => Promise<FileListInterface>;
4
5
  /**
5
6
  * Reads a customer configuration as it was before a merge request.
6
7
  *
7
8
  * The files of the commit are written to a temporary directory and read back
8
9
  * through the integration API, so the result is built exactly like the
9
- * configuration on disk, including the files of the environment.
10
+ * configuration on disk, including the files of the environment. The factory
11
+ * hands in that read, so this class never builds an integration API itself.
10
12
  */
11
13
  export declare class BaseConfigReader {
12
14
  private readonly repository;
13
- private readonly cliConfig;
14
- constructor(repository: GitRepository, cliConfig: UserCliConfig);
15
+ private readonly readDirectory;
16
+ constructor(repository: GitRepository, readDirectory: ConfigDirectoryReader);
15
17
  /**
16
18
  * The configuration at the commit, or null while the commit has none.
17
19
  *
@@ -2,20 +2,20 @@ import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
2
2
  import { tmpdir } from "node:os";
3
3
  import path from "node:path";
4
4
  import ApplicationError from "../../error-handling/error/application-error.js";
5
- import { IntegrationApiContext, IntegrationApiFactory, } from "../../integration-api/index.js";
6
5
  /**
7
6
  * Reads a customer configuration as it was before a merge request.
8
7
  *
9
8
  * The files of the commit are written to a temporary directory and read back
10
9
  * through the integration API, so the result is built exactly like the
11
- * configuration on disk, including the files of the environment.
10
+ * configuration on disk, including the files of the environment. The factory
11
+ * hands in that read, so this class never builds an integration API itself.
12
12
  */
13
13
  export class BaseConfigReader {
14
14
  repository;
15
- cliConfig;
16
- constructor(repository, cliConfig) {
15
+ readDirectory;
16
+ constructor(repository, readDirectory) {
17
17
  this.repository = repository;
18
- this.cliConfig = cliConfig;
18
+ this.readDirectory = readDirectory;
19
19
  }
20
20
  /**
21
21
  * The configuration at the commit, or null while the commit has none.
@@ -31,9 +31,7 @@ export class BaseConfigReader {
31
31
  return null;
32
32
  }
33
33
  const target = await this.write(paths, directory, sha);
34
- return new IntegrationApiFactory(new IntegrationApiContext(target, configName, []), this.cliConfig)
35
- .buildService()
36
- .run();
34
+ return this.readDirectory(target, configName);
37
35
  }
38
36
  /** Writes the files of the commit to a temporary copy of the directory. */
39
37
  async write(paths, directory, sha) {
@@ -1,6 +1,7 @@
1
1
  export * from "./base-config-reader.js";
2
2
  export * from "./live-state-check.js";
3
3
  export * from "./merge-request-deploy-model.js";
4
+ export * from "./merge-request-deploy-service-build-context.js";
4
5
  export * from "./merge-request-description.js";
5
6
  export * from "./merge-request-deploy-service.js";
6
7
  export * from "./merge-request-deploy-service-factory.js";
@@ -1,6 +1,7 @@
1
1
  export * from "./base-config-reader.js";
2
2
  export * from "./live-state-check.js";
3
3
  export * from "./merge-request-deploy-model.js";
4
+ export * from "./merge-request-deploy-service-build-context.js";
4
5
  export * from "./merge-request-description.js";
5
6
  export * from "./merge-request-deploy-service.js";
6
7
  export * from "./merge-request-deploy-service-factory.js";
@@ -1,38 +1,3 @@
1
- import { ApprovalAnswer } from "../policy/auto-deploy-policy.js";
2
- /** What `sk deploy --mr` is asked to deploy. */
3
- export declare class MergeRequestDeployContext {
4
- readonly customerPath: string;
5
- readonly configName: string;
6
- /** The number of the merged merge request. */
7
- readonly iid: number;
8
- readonly approval: ApprovalAnswer;
9
- /** The description of the installations. It is asked while it is left out. */
10
- readonly description?: string;
11
- readonly dryRun: boolean;
12
- /** Leave out the checks that run after the upload, as a bulk run does. */
13
- readonly skipPostDeployChecks: boolean;
14
- /**
15
- * Whether a person watches this deploy.
16
- *
17
- * They get the diff of every file the merge request changed, in the diff
18
- * tool they use for every other deploy, and they confirm the upload.
19
- */
20
- readonly interactive: boolean;
21
- constructor(customerPath: string, configName: string,
22
- /** The number of the merged merge request. */
23
- iid: number, approval: ApprovalAnswer,
24
- /** The description of the installations. It is asked while it is left out. */
25
- description?: string, dryRun?: boolean,
26
- /** Leave out the checks that run after the upload, as a bulk run does. */
27
- skipPostDeployChecks?: boolean,
28
- /**
29
- * Whether a person watches this deploy.
30
- *
31
- * They get the diff of every file the merge request changed, in the diff
32
- * tool they use for every other deploy, and they confirm the upload.
33
- */
34
- interactive?: boolean);
35
- }
36
1
  /** What a deploy of one configuration ended with, or would end with. */
37
2
  export declare enum DeployOutcome {
38
3
  /** A plan only: the live installation is the state before the merge request. */