@speedkit/cli 4.36.0 → 4.36.1

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 (293) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +3 -29
  3. package/dist/commands/auto-prewarm.js +1 -1
  4. package/dist/commands/browser/clean.js +1 -2
  5. package/dist/commands/browser/list.js +1 -2
  6. package/dist/commands/browser/update.js +1 -2
  7. package/dist/commands/bulk-deploy.js +1 -1
  8. package/dist/commands/config/setup.js +4 -3
  9. package/dist/commands/deploy.js +3 -2
  10. package/dist/commands/diff-url-parameters.d.ts +2 -2
  11. package/dist/commands/diff-url-parameters.js +12 -5
  12. package/dist/commands/extension/add.js +1 -1
  13. package/dist/commands/extension/devtools.js +1 -1
  14. package/dist/commands/extension/list.js +1 -1
  15. package/dist/commands/extension/remove.js +1 -1
  16. package/dist/commands/extension/update.js +1 -1
  17. package/dist/commands/find-pops.js +3 -2
  18. package/dist/commands/generate-pop-config.js +9 -13
  19. package/dist/commands/onboarding.js +1 -1
  20. package/dist/commands/origin-request.js +1 -1
  21. package/dist/commands/pull.js +1 -1
  22. package/dist/commands/revalidate.js +4 -3
  23. package/dist/commands/wpt-launcher.js +3 -2
  24. package/dist/helpers/{chrome-flags.spec.js → spec/chrome-flags.spec.js} +1 -1
  25. package/dist/helpers/{origin-proxy.spec.js → spec/origin-proxy.spec.js} +1 -1
  26. package/dist/hooks/init/first-run.js +3 -3
  27. package/dist/hooks/{init → spec/init}/dns-result-order.spec.js +1 -1
  28. package/dist/hooks/{init → spec/init}/http1-global-dispatcher.spec.js +1 -1
  29. package/dist/models/cli-parameters.d.ts +0 -2
  30. package/dist/models/cli-parameters.js +0 -2
  31. package/dist/models/{cli-parameters.spec.js → spec/cli-parameters.spec.js} +1 -1
  32. package/dist/services/athena/athena-service-factory.d.ts +3 -1
  33. package/dist/services/athena/athena-service-factory.js +4 -2
  34. package/dist/services/athena/{athena-service.spec.js → spec/athena-service.spec.js} +1 -1
  35. package/dist/services/athena/{baqend-athena-service.spec.js → spec/baqend-athena-service.spec.js} +2 -2
  36. package/dist/services/browser-fetch/browser-origin-fetch.d.ts +1 -1
  37. package/dist/services/browser-fetch/browser-origin-fetcher.d.ts +1 -1
  38. package/dist/services/browser-fetch/{browser-origin-fetch.spec.js → spec/browser-origin-fetch.spec.js} +2 -2
  39. package/dist/services/browser-fetch/{browser-origin-fetcher.spec.js → spec/browser-origin-fetcher.spec.js} +1 -1
  40. package/dist/services/browser-fetch/{browser-response.spec.js → spec/browser-response.spec.js} +1 -1
  41. package/dist/services/browser-fetch/{device-emulation.spec.js → spec/device-emulation.spec.js} +2 -2
  42. package/dist/services/bundler/{bundle-service.spec.js → spec/bundle-service.spec.js} +1 -1
  43. package/dist/{helpers → services/cli}/cli-config.js +1 -1
  44. package/dist/services/cli/cli-service-factory.d.ts +10 -2
  45. package/dist/services/cli/cli-service-factory.js +11 -9
  46. package/dist/services/cli/cli-service-model.d.ts +10 -2
  47. package/dist/services/cli/cli-service.d.ts +37 -0
  48. package/dist/services/cli/cli-service.js +48 -1
  49. package/dist/{helpers/clipboard.d.ts → services/cli/clipboard/clipboard-service.d.ts} +3 -1
  50. package/dist/{helpers/clipboard.js → services/cli/clipboard/clipboard-service.js} +6 -1
  51. package/dist/services/cli/clipboard/index.d.ts +1 -0
  52. package/dist/services/cli/clipboard/index.js +1 -0
  53. package/dist/services/cli/index.d.ts +1 -0
  54. package/dist/services/cli/index.js +1 -0
  55. package/dist/{helpers → services/cli/spec}/cli-config.spec.js +1 -1
  56. package/dist/services/cli/{cli-service.spec.js → spec/cli-service.spec.js} +1 -1
  57. package/dist/{helpers → services/cli/spec}/environment.spec.js +1 -1
  58. package/dist/services/customer-config/customer-config-service-factory.d.ts +3 -1
  59. package/dist/services/customer-config/customer-config-service-factory.js +7 -3
  60. package/dist/services/customer-config/customer-config-service.d.ts +4 -2
  61. package/dist/services/customer-config/customer-config-service.js +4 -3
  62. package/dist/services/customer-config/site-analyzer/index.d.ts +3 -0
  63. package/dist/services/customer-config/site-analyzer/index.js +3 -0
  64. package/dist/{helpers/site-analyzer.d.ts → services/customer-config/site-analyzer/site-analyzer-model.d.ts} +0 -1
  65. package/dist/services/customer-config/site-analyzer/site-analyzer-service-factory.d.ts +7 -0
  66. package/dist/services/customer-config/site-analyzer/site-analyzer-service-factory.js +11 -0
  67. package/dist/services/customer-config/site-analyzer/site-analyzer-service.d.ts +16 -0
  68. package/dist/{helpers/site-analyzer.js → services/customer-config/site-analyzer/site-analyzer-service.js} +20 -5
  69. package/dist/services/deploy/bulk/bulk-deploy-service-factory.d.ts +1 -1
  70. package/dist/services/deploy/bulk/config-deploy-factory.d.ts +1 -1
  71. package/dist/services/deploy/checks/post-deploy/deprecated-deployment-detection-check.d.ts +2 -2
  72. package/dist/services/deploy/checks/post-deploy/refresh-deployment-job-check.d.ts +2 -2
  73. package/dist/services/deploy/checks/post-deploy/revalidated-module-check.d.ts +2 -2
  74. package/dist/services/deploy/checks/post-deploy/save-files-check.d.ts +2 -2
  75. package/dist/services/deploy/context/deploy-context.js +1 -1
  76. package/dist/services/deploy/deploy-service-factory.d.ts +3 -2
  77. package/dist/services/deploy/deploy-service-factory.js +9 -7
  78. package/dist/services/deploy/deploy-service.d.ts +2 -2
  79. package/dist/services/deploy/handler/customer-config-handler.d.ts +2 -2
  80. package/dist/services/deploy/handler/install-resource-handler.d.ts +2 -2
  81. package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.d.ts +2 -2
  82. package/dist/services/deploy/handler/module-handler.d.ts +2 -2
  83. package/dist/services/deploy/handler/server-config-handler.d.ts +2 -2
  84. package/dist/services/deploy/mr/base-config-reader.d.ts +1 -1
  85. package/dist/services/deploy/mr/base-config-reader.js +8 -5
  86. package/dist/services/deploy/mr/merge-request-deploy-service-factory.d.ts +1 -1
  87. package/dist/services/deploy/{bulk → spec/bulk}/bulk-deploy-service.spec.js +5 -5
  88. package/dist/services/deploy/{bulk → spec/bulk}/touched-configs.spec.js +2 -2
  89. package/dist/services/deploy/{checks → spec/checks}/activation/customer-approval-check.spec.js +2 -2
  90. package/dist/services/deploy/{checks → spec/checks}/post-deploy/refresh-deployment-job-check.spec.js +2 -2
  91. package/dist/services/deploy/{checks → spec/checks}/pre-deploy/split-change-check.spec.js +3 -3
  92. package/dist/services/deploy/{handler → spec/handler}/module-handler.spec.js +2 -2
  93. package/dist/services/deploy/{handler → spec/handler}/testing-installation-links.spec.js +1 -1
  94. package/dist/services/deploy/{mr → spec/mr}/live-state-check.spec.js +2 -2
  95. package/dist/services/deploy/{mr → spec/mr}/merge-request-description.spec.js +1 -1
  96. package/dist/services/deploy/{policy → spec/policy}/auto-deploy-policy.spec.js +2 -2
  97. package/dist/services/diff/diff-service-factory.d.ts +3 -1
  98. package/dist/services/diff/diff-service-factory.js +4 -2
  99. package/dist/services/diff/diff-service.d.ts +10 -2
  100. package/dist/services/diff/diff-service.js +26 -3
  101. package/dist/services/diff/index.d.ts +1 -0
  102. package/dist/services/diff/index.js +1 -0
  103. package/dist/services/document-handler-runtime/context/document-handler-runtime-context.d.ts +2 -14
  104. package/dist/services/document-handler-runtime/context/document-handler-runtime-context.js +0 -52
  105. package/dist/services/document-handler-runtime/document-handler-server.d.ts +2 -2
  106. package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +3 -11
  107. package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +6 -72
  108. package/dist/services/document-handler-runtime/{document-handler-abort.spec.js → spec/document-handler-abort.spec.js} +2 -2
  109. package/dist/services/git/{git-repository.spec.js → spec/git-repository.spec.js} +1 -1
  110. package/dist/services/integration-api/handler/customer-config-handler.d.ts +2 -2
  111. package/dist/services/integration-api/integration-api-factory.d.ts +3 -2
  112. package/dist/services/integration-api/integration-api-factory.js +5 -3
  113. package/dist/services/integration-api/struct/customer-config-file.js +1 -1
  114. package/dist/services/integration-api/virtual/virtual-file-handler.d.ts +2 -2
  115. package/dist/services/onboarding/browser/config/browser-config.d.ts +1 -1
  116. package/dist/services/onboarding/browser/executable/executable-validator.d.ts +1 -2
  117. package/dist/services/onboarding/browser/extension/extension-downloader.d.ts +1 -2
  118. package/dist/services/onboarding/browser/extension/extension-validator.d.ts +1 -2
  119. package/dist/services/onboarding/dashboard/diff-against-current-page.d.ts +2 -2
  120. package/dist/services/onboarding/dashboard/diff-against-current-page.js +1 -1
  121. package/dist/services/onboarding/dashboard/request-diff-service.d.ts +3 -1
  122. package/dist/services/onboarding/dashboard/request-diff-service.js +5 -3
  123. package/dist/services/onboarding/fetch-event-handler.d.ts +2 -2
  124. package/dist/services/onboarding/fetch-events/speed-kit-install-js.d.ts +3 -1
  125. package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +5 -3
  126. package/dist/services/onboarding/file-events/file-watcher.d.ts +2 -2
  127. package/dist/services/onboarding/file-events/file-watcher.js +2 -2
  128. package/dist/services/onboarding/onboarding-model.d.ts +1 -1
  129. package/dist/services/onboarding/onboarding-service-factory.d.ts +3 -2
  130. package/dist/services/onboarding/onboarding-service-factory.js +17 -17
  131. package/dist/services/onboarding/onboarding-service.d.ts +2 -2
  132. package/dist/services/onboarding/request-cache/cache.d.ts +2 -2
  133. package/dist/services/onboarding/server-config/index.d.ts +2 -2
  134. package/dist/services/onboarding/{browser → spec/browser}/executable/headed-user-agent.spec.js +1 -1
  135. package/dist/services/onboarding/{empty-service-worker.spec.js → spec/empty-service-worker.spec.js} +1 -1
  136. package/dist/services/onboarding/{onboarding-model.spec.js → spec/onboarding-model.spec.js} +2 -2
  137. package/dist/services/onboarding/{virtual-orestes-app → spec/virtual-orestes-app}/crawler.spec.js +1 -1
  138. package/dist/services/onboarding/{virtual-orestes-app → spec/virtual-orestes-app}/origin-error-cause.spec.js +1 -1
  139. package/dist/services/onboarding/virtual-orestes-app/crawler.d.ts +2 -2
  140. package/dist/services/onboarding/virtual-orestes-app/index.d.ts +2 -2
  141. package/dist/services/origin-request/asset-variations.js +1 -1
  142. package/dist/services/origin-request/origin-request-service-factory.d.ts +3 -2
  143. package/dist/services/origin-request/origin-request-service-factory.js +8 -6
  144. package/dist/services/origin-request/origin-request-service.d.ts +2 -2
  145. package/dist/services/origin-request/{asset-variations.spec.js → spec/asset-variations.spec.js} +1 -1
  146. package/dist/services/prewarm/assets/asset-api-client.d.ts +3 -1
  147. package/dist/services/prewarm/assets/asset-api-client.js +5 -3
  148. package/dist/services/prewarm/auto-pre-warm-factory.d.ts +3 -2
  149. package/dist/services/prewarm/auto-pre-warm-factory.js +8 -5
  150. package/dist/{helpers → services/prewarm}/normalize.d.ts +0 -6
  151. package/dist/{helpers → services/prewarm}/normalize.js +0 -8
  152. package/dist/services/prewarm/pre-warm-factory.d.ts +3 -1
  153. package/dist/services/prewarm/pre-warm-factory.js +7 -4
  154. package/dist/services/prewarm/{csv-reader.spec.js → spec/csv-reader.spec.js} +1 -1
  155. package/dist/services/prewarm/{prewarm-targets.spec.js → spec/prewarm-targets.spec.js} +1 -1
  156. package/dist/services/pull/pull-service-factory.d.ts +3 -2
  157. package/dist/services/pull/pull-service-factory.js +8 -6
  158. package/dist/services/query-builder/query-builder-factory.d.ts +3 -2
  159. package/dist/services/query-builder/query-builder-factory.js +9 -7
  160. package/dist/services/query-builder/query-builder-service.js +4 -5
  161. package/dist/services/query-builder/query-command.js +1 -1
  162. package/dist/services/query-builder/{queries/spec → spec/queries}/golden.spec.js +3 -3
  163. package/dist/services/query-builder/{queries/spec → spec/queries}/pops-query.spec.js +2 -2
  164. package/dist/services/query-builder/{queries/spec → spec/queries}/queries.spec.js +3 -3
  165. package/dist/services/query-builder/{queries/spec → spec/queries}/reported-bugs.spec.js +2 -2
  166. package/dist/services/query-builder/{query-builder-service.spec.js → spec/query-builder-service.spec.js} +4 -4
  167. package/dist/services/query-builder/{rules/spec → spec/rules}/pattern-language.spec.js +1 -1
  168. package/dist/services/query-builder/{rules/spec → spec/rules}/rule-parser.spec.js +1 -1
  169. package/dist/services/query-builder/{rules/spec → spec/rules}/rule-reducer.spec.js +2 -2
  170. package/dist/services/query-builder/{rules/spec → spec/rules}/rule-relevance.spec.js +2 -2
  171. package/dist/services/query-builder/{rules/spec → spec/rules}/rule-to-sql.spec.js +2 -2
  172. package/dist/services/query-builder/{rules/spec → spec/rules}/runtime-semantics.spec.js +1 -1
  173. package/dist/services/query-builder/{rules/spec → spec/rules}/strip-parameters.spec.js +3 -3
  174. package/dist/services/query-builder/{sql/spec → spec/sql}/expression.spec.js +2 -2
  175. package/dist/services/query-builder/{sql/spec → spec/sql}/format.spec.js +2 -2
  176. package/dist/services/query-builder/{sql/spec → spec/sql}/predicate.spec.js +1 -1
  177. package/dist/services/query-builder/{sql/spec → spec/sql}/regex.spec.js +1 -1
  178. package/dist/services/revalidate/revalidate-factory.d.ts +3 -1
  179. package/dist/services/revalidate/revalidate-factory.js +6 -3
  180. package/dist/services/revalidate/revalidate-service.d.ts +2 -2
  181. package/dist/services/revalidate/{revalidate-service.spec.js → spec/revalidate-service.spec.js} +1 -1
  182. package/dist/services/setup/browser/browser-setup-service.d.ts +1 -2
  183. package/dist/services/setup/difftool/difftool-setup-service.d.ts +1 -2
  184. package/dist/services/setup/extension/extension-installer.d.ts +1 -1
  185. package/dist/services/setup/extension/extension-setup-service.d.ts +1 -2
  186. package/dist/services/setup/setup-service-factory.d.ts +3 -1
  187. package/dist/services/setup/setup-service-factory.js +5 -4
  188. package/dist/services/setup/setup-service.d.ts +1 -2
  189. package/dist/services/setup/{extension → spec/extension}/crx.spec.js +1 -1
  190. package/dist/services/setup/{extension → spec/extension}/webstore.spec.js +1 -1
  191. package/dist/services/setup/{os → spec/os}/tool-registry.spec.js +1 -1
  192. package/oclif.manifest.json +1 -52
  193. package/package.json +3 -2
  194. package/dist/commands/document-handler.d.ts +0 -16
  195. package/dist/commands/document-handler.js +0 -32
  196. package/dist/helpers/customer-config.d.ts +0 -45
  197. package/dist/helpers/customer-config.js +0 -136
  198. package/dist/helpers/file-helper.d.ts +0 -8
  199. package/dist/helpers/file-helper.js +0 -28
  200. package/dist/helpers/is-directory.d.ts +0 -5
  201. package/dist/helpers/is-directory.js +0 -19
  202. package/dist/helpers/is-file.d.ts +0 -5
  203. package/dist/helpers/is-file.js +0 -19
  204. package/dist/helpers/logging-helper.d.ts +0 -15
  205. package/dist/helpers/logging-helper.js +0 -23
  206. package/dist/helpers/scrape.d.ts +0 -1
  207. package/dist/helpers/scrape.js +0 -8
  208. package/dist/helpers/speed-kit-rule-to-reg-exp.d.ts +0 -1
  209. package/dist/helpers/speed-kit-rule-to-reg-exp.js +0 -6
  210. package/dist/models/install.d.ts +0 -24
  211. package/dist/services/config-api-service.d.ts +0 -21
  212. package/dist/services/config-api-service.js +0 -107
  213. package/dist/services/diff-service.d.ts +0 -27
  214. package/dist/services/diff-service.js +0 -116
  215. package/dist/services/document-handler-runtime/document-handler-runtime-service.d.ts +0 -31
  216. package/dist/services/document-handler-runtime/document-handler-runtime-service.js +0 -222
  217. package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.d.ts +0 -3
  218. package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.js +0 -3
  219. package/dist/services/document-handler-runtime/templates/execute-document-handler.d.ts +0 -6
  220. package/dist/services/document-handler-runtime/templates/execute-document-handler.js +0 -74
  221. package/dist/services/document-handler-runtime/templates/orestes-mock.d.ts +0 -9
  222. package/dist/services/document-handler-runtime/templates/orestes-mock.js +0 -166
  223. package/dist/services/document-handler-runtime/templates/package-json.d.ts +0 -6
  224. package/dist/services/document-handler-runtime/templates/package-json.js +0 -17
  225. package/dist/services/document-handler-runtime/templates/test.d.ts +0 -6
  226. package/dist/services/document-handler-runtime/templates/test.js +0 -64
  227. /package/dist/helpers/{chrome-flags.spec.d.ts → spec/chrome-flags.spec.d.ts} +0 -0
  228. /package/dist/helpers/{origin-proxy.spec.d.ts → spec/origin-proxy.spec.d.ts} +0 -0
  229. /package/dist/hooks/{init → spec/init}/dns-result-order.spec.d.ts +0 -0
  230. /package/dist/hooks/{init → spec/init}/http1-global-dispatcher.spec.d.ts +0 -0
  231. /package/dist/models/{cli-parameters.spec.d.ts → spec/cli-parameters.spec.d.ts} +0 -0
  232. /package/dist/services/athena/{athena-service.spec.d.ts → spec/athena-service.spec.d.ts} +0 -0
  233. /package/dist/services/athena/{baqend-athena-service.spec.d.ts → spec/baqend-athena-service.spec.d.ts} +0 -0
  234. /package/dist/services/browser-fetch/{browser-origin-fetch.spec.d.ts → spec/browser-origin-fetch.spec.d.ts} +0 -0
  235. /package/dist/services/browser-fetch/{browser-origin-fetcher.spec.d.ts → spec/browser-origin-fetcher.spec.d.ts} +0 -0
  236. /package/dist/services/browser-fetch/{browser-response.spec.d.ts → spec/browser-response.spec.d.ts} +0 -0
  237. /package/dist/services/browser-fetch/{device-emulation.spec.d.ts → spec/device-emulation.spec.d.ts} +0 -0
  238. /package/dist/services/bundler/{bundle-service.spec.d.ts → spec/bundle-service.spec.d.ts} +0 -0
  239. /package/dist/{helpers → services/cli}/cli-config.d.ts +0 -0
  240. /package/dist/{helpers → services/cli}/environment.d.ts +0 -0
  241. /package/dist/{helpers → services/cli}/environment.js +0 -0
  242. /package/dist/{helpers → services/cli/spec}/cli-config.spec.d.ts +0 -0
  243. /package/dist/services/cli/{cli-service.spec.d.ts → spec/cli-service.spec.d.ts} +0 -0
  244. /package/dist/{helpers → services/cli/spec}/environment.spec.d.ts +0 -0
  245. /package/dist/{models/install.js → services/customer-config/site-analyzer/site-analyzer-model.js} +0 -0
  246. /package/dist/services/deploy/{bulk → spec/bulk}/bulk-deploy-service.spec.d.ts +0 -0
  247. /package/dist/services/deploy/{bulk → spec/bulk}/touched-configs.spec.d.ts +0 -0
  248. /package/dist/services/deploy/{checks → spec/checks}/activation/customer-approval-check.spec.d.ts +0 -0
  249. /package/dist/services/deploy/{checks → spec/checks}/post-deploy/refresh-deployment-job-check.spec.d.ts +0 -0
  250. /package/dist/services/deploy/{checks → spec/checks}/pre-deploy/split-change-check.spec.d.ts +0 -0
  251. /package/dist/services/deploy/{handler → spec/handler}/module-handler.spec.d.ts +0 -0
  252. /package/dist/services/deploy/{handler → spec/handler}/testing-installation-links.spec.d.ts +0 -0
  253. /package/dist/services/deploy/{mr → spec/mr}/live-state-check.spec.d.ts +0 -0
  254. /package/dist/services/deploy/{mr → spec/mr}/merge-request-description.spec.d.ts +0 -0
  255. /package/dist/services/deploy/{policy → spec/policy}/auto-deploy-policy.spec.d.ts +0 -0
  256. /package/dist/{helpers/html-format-helper.d.ts → services/diff/html-format.d.ts} +0 -0
  257. /package/dist/{helpers/html-format-helper.js → services/diff/html-format.js} +0 -0
  258. /package/dist/services/document-handler-runtime/{document-handler-abort.spec.d.ts → spec/document-handler-abort.spec.d.ts} +0 -0
  259. /package/dist/services/git/{git-repository.spec.d.ts → spec/git-repository.spec.d.ts} +0 -0
  260. /package/dist/{helpers → services/integration-api}/array-helper.d.ts +0 -0
  261. /package/dist/{helpers → services/integration-api}/array-helper.js +0 -0
  262. /package/dist/services/onboarding/{browser → spec/browser}/executable/headed-user-agent.spec.d.ts +0 -0
  263. /package/dist/services/onboarding/{empty-service-worker.spec.d.ts → spec/empty-service-worker.spec.d.ts} +0 -0
  264. /package/dist/services/onboarding/{onboarding-model.spec.d.ts → spec/onboarding-model.spec.d.ts} +0 -0
  265. /package/dist/services/onboarding/{virtual-orestes-app → spec/virtual-orestes-app}/crawler.spec.d.ts +0 -0
  266. /package/dist/services/onboarding/{virtual-orestes-app → spec/virtual-orestes-app}/origin-error-cause.spec.d.ts +0 -0
  267. /package/dist/{helpers → services/origin-request}/java-regex.d.ts +0 -0
  268. /package/dist/{helpers → services/origin-request}/java-regex.js +0 -0
  269. /package/dist/services/origin-request/{asset-variations.spec.d.ts → spec/asset-variations.spec.d.ts} +0 -0
  270. /package/dist/services/prewarm/{csv-reader.spec.d.ts → spec/csv-reader.spec.d.ts} +0 -0
  271. /package/dist/services/prewarm/{prewarm-targets.spec.d.ts → spec/prewarm-targets.spec.d.ts} +0 -0
  272. /package/dist/services/query-builder/{queries/spec → spec/queries}/golden-configs.d.ts +0 -0
  273. /package/dist/services/query-builder/{queries/spec → spec/queries}/golden-configs.js +0 -0
  274. /package/dist/services/query-builder/{queries/spec → spec/queries}/golden.spec.d.ts +0 -0
  275. /package/dist/services/query-builder/{queries/spec → spec/queries}/pops-query.spec.d.ts +0 -0
  276. /package/dist/services/query-builder/{queries/spec → spec/queries}/queries.spec.d.ts +0 -0
  277. /package/dist/services/query-builder/{queries/spec → spec/queries}/reported-bugs.spec.d.ts +0 -0
  278. /package/dist/services/query-builder/{query-builder-service.spec.d.ts → spec/query-builder-service.spec.d.ts} +0 -0
  279. /package/dist/services/query-builder/{rules/spec → spec/rules}/pattern-language.spec.d.ts +0 -0
  280. /package/dist/services/query-builder/{rules/spec → spec/rules}/rule-parser.spec.d.ts +0 -0
  281. /package/dist/services/query-builder/{rules/spec → spec/rules}/rule-reducer.spec.d.ts +0 -0
  282. /package/dist/services/query-builder/{rules/spec → spec/rules}/rule-relevance.spec.d.ts +0 -0
  283. /package/dist/services/query-builder/{rules/spec → spec/rules}/rule-to-sql.spec.d.ts +0 -0
  284. /package/dist/services/query-builder/{rules/spec → spec/rules}/runtime-semantics.spec.d.ts +0 -0
  285. /package/dist/services/query-builder/{rules/spec → spec/rules}/strip-parameters.spec.d.ts +0 -0
  286. /package/dist/services/query-builder/{sql/spec → spec/sql}/expression.spec.d.ts +0 -0
  287. /package/dist/services/query-builder/{sql/spec → spec/sql}/format.spec.d.ts +0 -0
  288. /package/dist/services/query-builder/{sql/spec → spec/sql}/predicate.spec.d.ts +0 -0
  289. /package/dist/services/query-builder/{sql/spec → spec/sql}/regex.spec.d.ts +0 -0
  290. /package/dist/services/revalidate/{revalidate-service.spec.d.ts → spec/revalidate-service.spec.d.ts} +0 -0
  291. /package/dist/services/setup/{extension → spec/extension}/crx.spec.d.ts +0 -0
  292. /package/dist/services/setup/{extension → spec/extension}/webstore.spec.d.ts +0 -0
  293. /package/dist/services/setup/{os → spec/os}/tool-registry.spec.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { UserCliConfig } from "../../helpers/cli-config.js";
1
+ import { CliServiceInterface, UserCliConfig } from "../cli/index.js";
2
2
  import DeployContext from "./context/deploy-context.js";
3
3
  import DeployService from "./deploy-service.js";
4
4
  import { FileListInterface } from "../integration-api/index.js";
@@ -9,6 +9,7 @@ export default class DeployServiceFactory {
9
9
  private cliConfig;
10
10
  /** The answers of the deploy. A person answers while this is left out. */
11
11
  private policyOverride?;
12
+ private cli?;
12
13
  private service?;
13
14
  /** The configuration on disk, as the service it built deploys it. */
14
15
  files?: FileListInterface;
@@ -17,7 +18,7 @@ export default class DeployServiceFactory {
17
18
  configApi?: ConfigApiService;
18
19
  constructor(context: DeployContext, cliConfig: UserCliConfig,
19
20
  /** The answers of the deploy. A person answers while this is left out. */
20
- policyOverride?: DeployPolicyInterface);
21
+ policyOverride?: DeployPolicyInterface, cli?: CliServiceInterface);
21
22
  buildService(): Promise<DeployService>;
22
23
  private build;
23
24
  private getConfigApi;
@@ -1,4 +1,4 @@
1
- import { CliServiceFactory } from "../cli/index.js";
1
+ import { CliServiceFactory, } from "../cli/index.js";
2
2
  import { DiffContext, DiffServiceFactory } from "../diff/index.js";
3
3
  import InstallResourceBuilder from "./builder/install-resource-builder.js";
4
4
  import RevalidatedModuleCheck from "./checks/post-deploy/revalidated-module-check.js";
@@ -21,6 +21,7 @@ export default class DeployServiceFactory {
21
21
  context;
22
22
  cliConfig;
23
23
  policyOverride;
24
+ cli;
24
25
  service = undefined;
25
26
  /** The configuration on disk, as the service it built deploys it. */
26
27
  files = undefined;
@@ -29,10 +30,11 @@ export default class DeployServiceFactory {
29
30
  configApi = undefined;
30
31
  constructor(context, cliConfig,
31
32
  /** The answers of the deploy. A person answers while this is left out. */
32
- policyOverride) {
33
+ policyOverride, cli) {
33
34
  this.context = context;
34
35
  this.cliConfig = cliConfig;
35
36
  this.policyOverride = policyOverride;
37
+ this.cli = cli;
36
38
  }
37
39
  async buildService() {
38
40
  if (!(this.service instanceof DeployService)) {
@@ -41,15 +43,15 @@ export default class DeployServiceFactory {
41
43
  return this.service;
42
44
  }
43
45
  async build() {
44
- const files = await this.getIntegrationFiles();
46
+ const cliService = this.cli ?? new CliServiceFactory().getService();
47
+ const files = await this.getIntegrationFiles(cliService);
45
48
  const customer = files.getCustomerConfig().config;
46
49
  const configName = customer.name || this.context.configName;
47
50
  const configApi = this.getConfigApi(customer.app);
48
51
  this.files = files;
49
52
  this.configName = configName;
50
53
  this.configApi = configApi;
51
- const diffService = new DiffServiceFactory(new DiffContext(this.cliConfig.diffExec, this.cliConfig.diffExecTemplate, this.context.opensDiffTool)).getService();
52
- const cliService = new CliServiceFactory().getService();
54
+ const diffService = new DiffServiceFactory(new DiffContext(this.cliConfig.diffExec, this.cliConfig.diffExecTemplate, this.context.opensDiffTool), cliService).getService();
53
55
  const policy = this.policyOverride ?? new InteractiveDeployPolicy(cliService);
54
56
  const installResourceBuilder = new InstallResourceBuilder(configApi);
55
57
  const deletedFilesChecker = new DeletedFileCheck(cliService, policy, this.context.hasArtifacts());
@@ -69,9 +71,9 @@ export default class DeployServiceFactory {
69
71
  const configApiContext = new ConfigApiContext(app);
70
72
  return new ConfigApiServiceFactory(configApiContext).getService();
71
73
  }
72
- async getIntegrationFiles() {
74
+ async getIntegrationFiles(cli) {
73
75
  const integrationApiContext = new IntegrationApiContext(this.context.customerPath, this.context.configName, this.context.artifacts, DEFAULT_BLOCKED_FOLDERS, this.context.useTestConfig);
74
- const integrationApi = new IntegrationApiFactory(integrationApiContext, this.cliConfig).buildService();
76
+ const integrationApi = new IntegrationApiFactory(integrationApiContext, this.cliConfig, cli).buildService();
75
77
  const files = await integrationApi.run();
76
78
  if (this.context.installFilesOnly) {
77
79
  files.filter((file) => file.type === FILE_TYPE.INSTALL_FILE ||
@@ -1,5 +1,5 @@
1
1
  import DeployHandlerInterface from "./interface/deploy-handler-interface.js";
2
- import { CliService } from "../cli/index.js";
2
+ import { CliServiceInterface } from "../cli/index.js";
3
3
  import { FileListInterface } from "../integration-api/index.js";
4
4
  import { PostDeployCheckInterface, PreDeployCheckInterface } from "./deploy-service-model.js";
5
5
  export default class DeployService {
@@ -9,7 +9,7 @@ export default class DeployService {
9
9
  private readonly preDeployChecks;
10
10
  private readonly postDeployChecks;
11
11
  private readonly dryRun;
12
- constructor(fileList: FileListInterface, deployHandler: DeployHandlerInterface[], cli: CliService, preDeployChecks: PreDeployCheckInterface[], postDeployChecks: PostDeployCheckInterface[], dryRun?: boolean);
12
+ constructor(fileList: FileListInterface, deployHandler: DeployHandlerInterface[], cli: CliServiceInterface, preDeployChecks: PreDeployCheckInterface[], postDeployChecks: PostDeployCheckInterface[], dryRun?: boolean);
13
13
  run(): Promise<void>;
14
14
  private handleType;
15
15
  private uploadType;
@@ -1,7 +1,7 @@
1
1
  import DeployHandlerInterface from "../interface/deploy-handler-interface.js";
2
2
  import { CustomerConfig, CustomerConfigFile, FILE_TYPE } from "../../integration-api/index.js";
3
3
  import { DiffService } from "../../diff/index.js";
4
- import { CliService } from "../../cli/index.js";
4
+ import { CliServiceInterface } from "../../cli/index.js";
5
5
  import InstallResourceBuilder from "../builder/install-resource-builder.js";
6
6
  import { ConfigApiService } from "../../config-api/index.js";
7
7
  import { DeployPolicyInterface } from "../policy/index.js";
@@ -13,7 +13,7 @@ export default class CustomerConfigHandler implements DeployHandlerInterface {
13
13
  private cli;
14
14
  private builder;
15
15
  private policy;
16
- constructor(customer: CustomerConfig, configApi: ConfigApiService, configName: string, diffService: DiffService, cli: CliService, builder: InstallResourceBuilder, policy: DeployPolicyInterface);
16
+ constructor(customer: CustomerConfig, configApi: ConfigApiService, configName: string, diffService: DiffService, cli: CliServiceInterface, builder: InstallResourceBuilder, policy: DeployPolicyInterface);
17
17
  canHandle(type: FILE_TYPE): boolean;
18
18
  handle(files: CustomerConfigFile[]): Promise<void>;
19
19
  upload(files: CustomerConfigFile[]): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import DeployHandlerInterface from "../interface/deploy-handler-interface.js";
2
2
  import { DiffService } from "../../diff/index.js";
3
- import { CliService } from "../../cli/index.js";
3
+ import { CliServiceInterface } from "../../cli/index.js";
4
4
  import InstallResourceBuilder from "../builder/install-resource-builder.js";
5
5
  import DeletedFileCheck from "./install-resource-modifier/deleted-file-check.js";
6
6
  import { CustomerConfig, FILE_TYPE, InstallResourceInterface } from "../../integration-api/index.js";
@@ -17,7 +17,7 @@ export default class InstallResourceHandler implements DeployHandlerInterface {
17
17
  private deletedFilesChecker;
18
18
  private customerApprovalCheck;
19
19
  private policy;
20
- constructor(customer: CustomerConfig, configApi: ConfigApiService, configName: string, diffService: DiffService, cli: CliService, builder: InstallResourceBuilder, deletedFilesChecker: DeletedFileCheck, customerApprovalCheck: CustomerApprovalCheck, policy: DeployPolicyInterface);
20
+ constructor(customer: CustomerConfig, configApi: ConfigApiService, configName: string, diffService: DiffService, cli: CliServiceInterface, builder: InstallResourceBuilder, deletedFilesChecker: DeletedFileCheck, customerApprovalCheck: CustomerApprovalCheck, policy: DeployPolicyInterface);
21
21
  canHandle(type: FILE_TYPE): boolean;
22
22
  handle(files: InstallResourceInterface[]): Promise<void>;
23
23
  upload(files: InstallResourceInterface[]): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import Install from "../../interface/install.js";
2
- import { CliService } from "../../../cli/index.js";
2
+ import { CliServiceInterface } from "../../../cli/index.js";
3
3
  import InstallResourceBuilder from "../../builder/install-resource-builder.js";
4
4
  import { InstallResourceInterface } from "../../../integration-api/integration-api-model.js";
5
5
  import { DeployPolicyInterface } from "../../policy/index.js";
@@ -8,7 +8,7 @@ export default class DeletedFileCheck {
8
8
  private cli;
9
9
  private readonly hasFileSelection;
10
10
  private keysToDelete;
11
- constructor(cli: CliService, policy: DeployPolicyInterface, hasFileSelection?: boolean);
11
+ constructor(cli: CliServiceInterface, policy: DeployPolicyInterface, hasFileSelection?: boolean);
12
12
  hasDeletedFiles(builder: InstallResourceBuilder, files: InstallResourceInterface[]): Promise<void>;
13
13
  checkForDeletedLocalFiles(installResource: Install): Promise<void>;
14
14
  private getFileByRemoteKey;
@@ -1,7 +1,7 @@
1
1
  import DeployHandlerInterface from "../interface/deploy-handler-interface.js";
2
2
  import { FILE_TYPE, ModuleFile } from "../../integration-api/index.js";
3
3
  import { DiffService } from "../../diff/index.js";
4
- import { CliService } from "../../cli/index.js";
4
+ import { CliServiceInterface } from "../../cli/index.js";
5
5
  import RuntimeModifier from "../interface/runtime-modifier.js";
6
6
  import { ConfigApiService } from "../../config-api/index.js";
7
7
  import { DeployPolicyInterface } from "../policy/index.js";
@@ -11,7 +11,7 @@ export default class ModuleHandler implements DeployHandlerInterface {
11
11
  private cli;
12
12
  private modifiers;
13
13
  private policy;
14
- constructor(configApi: ConfigApiService, diffService: DiffService, cli: CliService, modifiers: RuntimeModifier[], policy: DeployPolicyInterface);
14
+ constructor(configApi: ConfigApiService, diffService: DiffService, cli: CliServiceInterface, modifiers: RuntimeModifier[], policy: DeployPolicyInterface);
15
15
  canHandle(type: FILE_TYPE): boolean;
16
16
  handle(files: ModuleFile[]): Promise<void>;
17
17
  upload(files: ModuleFile[]): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import DeployHandlerInterface from "../interface/deploy-handler-interface.js";
2
2
  import { DiffService } from "../../diff/index.js";
3
- import { CliService } from "../../cli/index.js";
3
+ import { CliServiceInterface } from "../../cli/index.js";
4
4
  import { FILE_TYPE, ServerConfigFile } from "../../integration-api/index.js";
5
5
  import { ConfigApiService } from "../../config-api/index.js";
6
6
  import { DeployPolicyInterface } from "../policy/index.js";
@@ -9,7 +9,7 @@ export default class ServerConfigHandler implements DeployHandlerInterface {
9
9
  private diffService;
10
10
  private cli;
11
11
  private policy;
12
- constructor(configApi: ConfigApiService, diffService: DiffService, cli: CliService, policy: DeployPolicyInterface);
12
+ constructor(configApi: ConfigApiService, diffService: DiffService, cli: CliServiceInterface, policy: DeployPolicyInterface);
13
13
  canHandle(type: FILE_TYPE): boolean;
14
14
  handle(files: ServerConfigFile[]): Promise<void>;
15
15
  upload(files: ServerConfigFile[]): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { UserCliConfig } from "../../../helpers/cli-config.js";
1
+ import { UserCliConfig } from "../../cli/index.js";
2
2
  import { GitRepository } from "../../git/index.js";
3
3
  import { FileListInterface } from "../../integration-api/index.js";
4
4
  /**
@@ -1,6 +1,6 @@
1
- import { mkdirSync, writeFileSync } from "node:fs";
1
+ import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
2
+ import { tmpdir } from "node:os";
2
3
  import path from "node:path";
3
- import { createTemporalDirectory } from "../../../helpers/file-helper.js";
4
4
  import ApplicationError from "../../error-handling/error/application-error.js";
5
5
  import { IntegrationApiContext, IntegrationApiFactory, } from "../../integration-api/index.js";
6
6
  /**
@@ -37,9 +37,12 @@ export class BaseConfigReader {
37
37
  }
38
38
  /** Writes the files of the commit to a temporary copy of the directory. */
39
39
  async write(paths, directory, sha) {
40
- const temporalDirectory = await createTemporalDirectory();
41
- if (!temporalDirectory) {
42
- throw new ApplicationError("Unable to create a temporary directory for the configuration to compare with");
40
+ let temporalDirectory;
41
+ try {
42
+ temporalDirectory = mkdtempSync(path.join(tmpdir(), "speed-kit-cli-"));
43
+ }
44
+ catch (error) {
45
+ throw new ApplicationError(`Unable to create a temporary directory for the configuration to compare with: ${error}`);
43
46
  }
44
47
  const target = path.join(temporalDirectory, path.basename(directory));
45
48
  for (const filePath of paths) {
@@ -1,4 +1,4 @@
1
- import { UserCliConfig } from "../../../helpers/cli-config.js";
1
+ import { UserCliConfig } from "../../cli/index.js";
2
2
  import { GitRepository, MergedRequest } from "../../git/index.js";
3
3
  import { MergeRequestDeployContext } from "./merge-request-deploy-model.js";
4
4
  import { MergeRequestDeployService } from "./merge-request-deploy-service.js";
@@ -3,11 +3,11 @@ import { after, before, describe, it } from "mocha";
3
3
  import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
4
4
  import os from "node:os";
5
5
  import path from "node:path";
6
- import { BulkDeployService } from "./bulk-deploy-service.js";
7
- import { BulkDeployContext, } from "./bulk-deploy-model.js";
8
- import { GitRepository } from "../../git/index.js";
9
- import { DeployOutcome, } from "../mr/index.js";
10
- import { ApprovalAnswer } from "../policy/auto-deploy-policy.js";
6
+ import { BulkDeployService } from "../../bulk/bulk-deploy-service.js";
7
+ import { BulkDeployContext, } from "../../bulk/bulk-deploy-model.js";
8
+ import { GitRepository } from "../../../git/index.js";
9
+ import { DeployOutcome, } from "../../mr/index.js";
10
+ import { ApprovalAnswer } from "../../policy/auto-deploy-policy.js";
11
11
  const REQUEST = {
12
12
  iid: 8017,
13
13
  sha: "3aaa523",
@@ -3,8 +3,8 @@ import { after, before, describe, it } from "mocha";
3
3
  import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
4
4
  import os from "node:os";
5
5
  import path from "node:path";
6
- import { productionConfigOf, touchedCustomers } from "./touched-configs.js";
7
- import { GitRepository } from "../../git/index.js";
6
+ import { productionConfigOf, touchedCustomers, } from "../../bulk/touched-configs.js";
7
+ import { GitRepository } from "../../../git/index.js";
8
8
  let root;
9
9
  /** A repository with two customers, one of them with two environments. */
10
10
  before(() => {
@@ -1,7 +1,7 @@
1
1
  import { expect } from "chai";
2
2
  import { describe, it } from "mocha";
3
- import { CustomerApprovalCheck } from "./customer-approval-check.js";
4
- import { CustomerConfig } from "../../../integration-api/index.js";
3
+ import { CustomerApprovalCheck } from "../../../checks/activation/customer-approval-check.js";
4
+ import { CustomerConfig } from "../../../../integration-api/index.js";
5
5
  function customer(needsCustomerApproval) {
6
6
  return CustomerConfig.createFrom({
7
7
  app: "test-app",
@@ -1,7 +1,7 @@
1
1
  import { expect } from "chai";
2
2
  import { describe, it } from "mocha";
3
- import { RefreshDeploymentJobCheck } from "./refresh-deployment-job-check.js";
4
- import ApplicationError from "../../../error-handling/error/application-error.js";
3
+ import { RefreshDeploymentJobCheck } from "../../../checks/post-deploy/refresh-deployment-job-check.js";
4
+ import ApplicationError from "../../../../error-handling/error/application-error.js";
5
5
  function entityManagerWithJobs(names) {
6
6
  const jobs = names.map((name) => ({ data: { name }, type: "Refreshjob" }));
7
7
  return {
@@ -1,9 +1,9 @@
1
1
  import { expect } from "chai";
2
2
  import { describe, it } from "mocha";
3
3
  import { Chalk } from "chalk";
4
- import { SplitChangeCheck } from "./split-change-check.js";
5
- import { DeployAbortedError } from "../../error/deploy-aborted-error.js";
6
- import { CustomerConfig, } from "../../../integration-api/index.js";
4
+ import { SplitChangeCheck } from "../../../checks/pre-deploy/split-change-check.js";
5
+ import { DeployAbortedError } from "../../../error/deploy-aborted-error.js";
6
+ import { CustomerConfig, } from "../../../../integration-api/index.js";
7
7
  /** A local config that serves half of the traffic. */
8
8
  const LOCAL_SPLIT = { split: 0.5, splitTestId: "test-id" };
9
9
  /** The active config of the app, which serves none. */
@@ -1,7 +1,7 @@
1
1
  import { expect } from "chai";
2
2
  import { describe, it } from "mocha";
3
- import ModuleHandler from "./module-handler.js";
4
- import { ModuleFile } from "../../integration-api/index.js";
3
+ import ModuleHandler from "../../handler/module-handler.js";
4
+ import { ModuleFile } from "../../../integration-api/index.js";
5
5
  function moduleFile(name) {
6
6
  return new ModuleFile(name, `/tmp/${name}.js`, `// ${name}`, {});
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import { expect } from "chai";
2
2
  import { describe, it } from "mocha";
3
- import { buildTestingInstallationLinks, MAX_LISTED_ORIGINS, } from "./testing-installation-links.js";
3
+ import { buildTestingInstallationLinks, MAX_LISTED_ORIGINS, } from "../../handler/testing-installation-links.js";
4
4
  function origins(count) {
5
5
  return Array.from({ length: count }, (_, i) => `https://shop-${i}.example.com`);
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { expect } from "chai";
2
2
  import { describe, it } from "mocha";
3
- import { LiveState, LiveStateCheck } from "./live-state-check.js";
4
- import { DiffService } from "../../diff/index.js";
3
+ import { LiveState, LiveStateCheck } from "../../mr/live-state-check.js";
4
+ import { DiffService } from "../../../diff/index.js";
5
5
  const ORIGINS = ["https://www.example.com"];
6
6
  /** A configuration of the install resource files it holds. */
7
7
  function configuration(files, origins = ORIGINS) {
@@ -1,6 +1,6 @@
1
1
  import { expect } from "chai";
2
2
  import { describe, it } from "mocha";
3
- import { defaultDescription, resolveDescription, } from "./merge-request-description.js";
3
+ import { defaultDescription, resolveDescription, } from "../../mr/merge-request-description.js";
4
4
  function request(title) {
5
5
  return { iid: 8009, sha: "3aaa523", baseSha: "83d9d58", title };
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { expect } from "chai";
2
2
  import { describe, it } from "mocha";
3
- import { ApprovalAnswer, AutoDeployPolicy } from "./auto-deploy-policy.js";
4
- import { DeployQuestion } from "./deploy-policy-model.js";
3
+ import { ApprovalAnswer, AutoDeployPolicy, } from "../../policy/auto-deploy-policy.js";
4
+ import { DeployQuestion } from "../../policy/deploy-policy-model.js";
5
5
  const REVIEWED = [
6
6
  DeployQuestion.UpdateFile,
7
7
  DeployQuestion.UpdateOrigins,
@@ -1,7 +1,9 @@
1
+ import { CliServiceInterface } from "../cli/index.js";
1
2
  import { DiffContext, DiffService } from "./index.js";
2
3
  export declare class DiffServiceFactory {
3
4
  private context;
5
+ private cli?;
4
6
  service?: DiffService;
5
- constructor(context: DiffContext);
7
+ constructor(context: DiffContext, cli?: CliServiceInterface);
6
8
  getService(): DiffService;
7
9
  }
@@ -2,13 +2,15 @@ import { CliServiceFactory } from "../cli/index.js";
2
2
  import { DiffService } from "./index.js";
3
3
  export class DiffServiceFactory {
4
4
  context;
5
+ cli;
5
6
  service = undefined;
6
- constructor(context) {
7
+ constructor(context, cli) {
7
8
  this.context = context;
9
+ this.cli = cli;
8
10
  }
9
11
  getService() {
10
12
  if (!(this.service instanceof DiffService)) {
11
- const cliService = new CliServiceFactory().getService();
13
+ const cliService = this.cli ?? new CliServiceFactory().getService();
12
14
  this.service = new DiffService(cliService, this.context.executablePath, this.context.executableTemplate, this.context.opensDiffTool);
13
15
  }
14
16
  return this.service;
@@ -1,11 +1,11 @@
1
- import { CliService } from "../cli/index.js";
1
+ import { CliServiceInterface } from "../cli/index.js";
2
2
  export declare class DiffService {
3
3
  private cli;
4
4
  private diffExecutablePath?;
5
5
  private diffExecutableTemplate?;
6
6
  private opensDiffTool;
7
7
  private tempPath;
8
- constructor(cli: CliService, diffExecutablePath?: string, diffExecutableTemplate?: string, opensDiffTool?: boolean);
8
+ constructor(cli: CliServiceInterface, diffExecutablePath?: string, diffExecutableTemplate?: string, opensDiffTool?: boolean);
9
9
  diff(localPath: string, fileName: string, temporaryContent: string): Promise<boolean>;
10
10
  diffContent(fileName: string, firstContent: string, secondContent: string, diffSuffix?: string[]): Promise<{
11
11
  updatedFile: string;
@@ -15,6 +15,14 @@ export declare class DiffService {
15
15
  * Returns a temporal directory path.
16
16
  */
17
17
  getTemporalDirectoryPath(): Promise<string>;
18
+ /**
19
+ * The temporary directory remote installation files are written to.
20
+ *
21
+ * Returns null instead of throwing, because the one caller turns that into a
22
+ * readable CLI error — an mkdtemp stack trace says less than "unable to
23
+ * create a temporary directory" does.
24
+ */
25
+ private createTemporalDirectory;
18
26
  writeContentToTemporalFile(temporaryFileName: string, content: string): Promise<string>;
19
27
  /**
20
28
  * @param localContent local file content.
@@ -1,10 +1,17 @@
1
1
  import pathModule from "node:path";
2
2
  import fs, { readFile } from "node:fs/promises";
3
+ import { mkdtempSync } from "node:fs";
4
+ import { tmpdir } from "node:os";
3
5
  import { execSync } from "node:child_process";
4
- import { createTemporalDirectory } from "../../helpers/file-helper.js";
5
- import { unescapeSpaces } from "../../helpers/normalize.js";
6
6
  import { DEFAULT_INTELLIJ_IDEA_PATH_MACOS } from "../../models/os.js";
7
7
  import ApplicationError from "../error-handling/error/application-error.js";
8
+ /**
9
+ * Remove the backslashes a shell-quoted path carries before its spaces, so the
10
+ * value can be handed to a child process as a single argument again.
11
+ */
12
+ function unescapeSpaces(string_) {
13
+ return string_.replaceAll("\\ ", " ");
14
+ }
8
15
  export class DiffService {
9
16
  cli;
10
17
  diffExecutablePath;
@@ -36,13 +43,29 @@ export class DiffService {
36
43
  async getTemporalDirectoryPath() {
37
44
  // create temporal directory for remote installationFiles so the diff can be generated
38
45
  if (!this.tempPath) {
39
- this.tempPath = await createTemporalDirectory();
46
+ this.tempPath = this.createTemporalDirectory();
40
47
  }
41
48
  if (!this.tempPath) {
42
49
  throw new ApplicationError("No temporary directory found and unable to create a new temporary directory");
43
50
  }
44
51
  return this.tempPath;
45
52
  }
53
+ /**
54
+ * The temporary directory remote installation files are written to.
55
+ *
56
+ * Returns null instead of throwing, because the one caller turns that into a
57
+ * readable CLI error — an mkdtemp stack trace says less than "unable to
58
+ * create a temporary directory" does.
59
+ */
60
+ createTemporalDirectory() {
61
+ try {
62
+ return mkdtempSync(pathModule.join(tmpdir(), "speed-kit-cli-"));
63
+ }
64
+ catch (error) {
65
+ this.cli.writeError(`Could not create a temporary directory: ${error}`);
66
+ return null;
67
+ }
68
+ }
46
69
  async writeContentToTemporalFile(temporaryFileName, content) {
47
70
  if (!content) {
48
71
  content = "";
@@ -1,3 +1,4 @@
1
1
  export * from "./diff-service.js";
2
+ export * from "./html-format.js";
2
3
  export * from "./diff-service-factory.js";
3
4
  export * from "./diff-model.js";
@@ -1,3 +1,4 @@
1
1
  export * from "./diff-service.js";
2
+ export * from "./html-format.js";
2
3
  export * from "./diff-service-factory.js";
3
4
  export * from "./diff-model.js";
@@ -1,24 +1,12 @@
1
- export declare const CUSTOMER_CONFIG = "config_customer";
2
1
  export declare const LOCAL_DOCUMENT_HANDLER = "custom_documentHandler";
3
2
  export declare const LOCAL_DOCUMENT_HANDLER_CONFIG = "config_documentHandler";
4
3
  export declare const LOCAL_DYNAMIC_FETCHER = "custom_dynamicFetcher";
5
4
  export declare const LOCAL_DYNAMIC_FETCHER_CONFIG = "config_dynamicBlocks";
6
5
  export declare const LOCAL_STYLES = "config_dynamicStyles";
7
- export declare const LATEST_DOCUMENT_HANDLER_URL = "https://www.baqend.com/speed-kit-handler/latest/DocumentHandler.js";
8
6
  export declare const LATEST_DYNAMIC_FETCHER_URL = "https://www.baqend.com/speed-kit/latest/dynamic-fetcher.js";
9
7
  export declare const LOCAL_TRIGGERED_BY = "STREAM:QA";
10
- export declare const TEST_DOCUMENT_HANDLER_FILE_NAME = "testDocumentHandler";
11
- export declare const TEST_DATABASE_MOCK_FILE_NAME = "database-mock";
12
- export declare const TEST_ORESTES_MOCK_FILE_NAME = "orestes-mock";
13
- export declare const TEST_FILE_NAME_PREFIX = "document";
14
- export declare const TEST_RUNTIME_FILE_NAME = "runtime";
15
- export declare const TEST_PACKAGE_JSON = "package";
16
- export default class DocumentHandlerRuntimeContext {
17
- readonly verboseLevel: boolean;
18
- readonly fileDependencies: string[];
8
+ export default interface DocumentHandlerRuntimeContext {
19
9
  readonly customerPath: string;
20
10
  readonly configName: string;
21
- readonly testNames: string[] | [];
22
- readonly requiredFiles: string[];
23
- constructor(customerPath: string, configName: string, testNames?: string[], verboseLevel?: boolean);
11
+ readonly verboseLevel: boolean;
24
12
  }
@@ -1,62 +1,10 @@
1
- export const CUSTOMER_CONFIG = "config_customer";
2
1
  export const LOCAL_DOCUMENT_HANDLER = "custom_documentHandler";
3
2
  export const LOCAL_DOCUMENT_HANDLER_CONFIG = "config_documentHandler";
4
3
  export const LOCAL_DYNAMIC_FETCHER = "custom_dynamicFetcher";
5
4
  export const LOCAL_DYNAMIC_FETCHER_CONFIG = "config_dynamicBlocks";
6
5
  export const LOCAL_STYLES = "config_dynamicStyles";
7
- export const LATEST_DOCUMENT_HANDLER_URL = "https://www.baqend.com/speed-kit-handler/latest/DocumentHandler.js";
8
6
  export const LATEST_DYNAMIC_FETCHER_URL = "https://www.baqend.com/speed-kit/latest/dynamic-fetcher.js";
9
7
  // Local runs have no persistent cache, so an origin HTML is served straight to the developer and may
10
8
  // legitimately be older than the default five minutes. STREAM:QA relaxes the document handler's
11
9
  // Shopify staleness check to one hour, see ONE_HOUR_STALENESS_TRIGGERS in document-handler.
12
10
  export const LOCAL_TRIGGERED_BY = "STREAM:QA";
13
- export const TEST_DOCUMENT_HANDLER_FILE_NAME = "testDocumentHandler";
14
- export const TEST_DATABASE_MOCK_FILE_NAME = "database-mock";
15
- export const TEST_ORESTES_MOCK_FILE_NAME = "orestes-mock";
16
- export const TEST_FILE_NAME_PREFIX = "document";
17
- export const TEST_RUNTIME_FILE_NAME = "runtime";
18
- export const TEST_PACKAGE_JSON = "package";
19
- const FILE_DEPENDENCIES = [
20
- LOCAL_DOCUMENT_HANDLER_CONFIG,
21
- LOCAL_DYNAMIC_FETCHER_CONFIG,
22
- LOCAL_STYLES,
23
- TEST_DATABASE_MOCK_FILE_NAME,
24
- TEST_ORESTES_MOCK_FILE_NAME,
25
- TEST_DOCUMENT_HANDLER_FILE_NAME,
26
- TEST_PACKAGE_JSON,
27
- TEST_RUNTIME_FILE_NAME,
28
- ];
29
- export default class DocumentHandlerRuntimeContext {
30
- verboseLevel;
31
- fileDependencies = [
32
- ...FILE_DEPENDENCIES,
33
- LOCAL_DOCUMENT_HANDLER,
34
- LOCAL_DYNAMIC_FETCHER,
35
- ];
36
- customerPath;
37
- configName;
38
- testNames;
39
- requiredFiles;
40
- constructor(customerPath, configName, testNames, verboseLevel = false) {
41
- this.verboseLevel = verboseLevel;
42
- this.configName = configName;
43
- this.customerPath = customerPath;
44
- this.testNames = testNames;
45
- let dependencies = [];
46
- if (this.testNames && this.testNames.length > 0) {
47
- for (const testName of this.testNames) {
48
- dependencies = [
49
- ...dependencies,
50
- `${TEST_FILE_NAME_PREFIX}-${testName}`,
51
- ];
52
- }
53
- this.fileDependencies = [...this.fileDependencies, ...dependencies];
54
- }
55
- this.requiredFiles = [
56
- CUSTOMER_CONFIG,
57
- LOCAL_DOCUMENT_HANDLER_CONFIG,
58
- LOCAL_DYNAMIC_FETCHER_CONFIG,
59
- LOCAL_STYLES,
60
- ];
61
- }
62
- }
@@ -1,5 +1,5 @@
1
1
  import { BundleService } from "../bundler/index.js";
2
- import { CliService } from "../cli/index.js";
2
+ import { CliServiceInterface } from "../cli/index.js";
3
3
  import { CustomerConfig, FileListInterface } from "../integration-api/index.js";
4
4
  import { EntityManager } from "baqend";
5
5
  import { DocumentHandlerResponse } from "./server/document-handler-response.js";
@@ -20,7 +20,7 @@ export declare class DocumentHandlerServer {
20
20
  /**
21
21
  * @param workSpace - Directory the packages a customer config declares are installed into.
22
22
  */
23
- constructor(customerConfig: CustomerConfig, files: FileListInterface, bundler: BundleService, cli: CliService, workSpace: string, verboseLevel?: boolean, entityManager?: EntityManager);
23
+ constructor(customerConfig: CustomerConfig, files: FileListInterface, bundler: BundleService, cli: CliServiceInterface, workSpace: string, verboseLevel?: boolean, entityManager?: EntityManager);
24
24
  transform(contentType: string, html: string, variation: string, url: string, headers: Record<string, string>): Promise<DocumentHandlerResponse>;
25
25
  private getTransformFunctionWrapper;
26
26
  buildDocumentHandler(): Promise<void>;
@@ -1,22 +1,14 @@
1
1
  import { FileListInterface } from "../../integration-api/index.js";
2
2
  import DocumentHandlerRuntimeContext from "../context/document-handler-runtime-context.js";
3
- import DocumentHandlerRuntimeService from "../document-handler-runtime-service.js";
3
+ import { CliServiceInterface, UserCliConfig } from "../../cli/index.js";
4
4
  import { DocumentHandlerServer } from "../document-handler-server.js";
5
- import { UserCliConfig } from "../../../helpers/cli-config.js";
6
5
  export default class DocumentHandlerRuntimeServiceFactory {
7
6
  private readonly context;
8
7
  private cliConfig;
9
8
  private files?;
10
- constructor(context: DocumentHandlerRuntimeContext, cliConfig: UserCliConfig, files?: FileListInterface);
11
- buildService(): Promise<DocumentHandlerRuntimeService>;
9
+ private cli?;
10
+ constructor(context: DocumentHandlerRuntimeContext, cliConfig: UserCliConfig, files?: FileListInterface, cli?: CliServiceInterface);
12
11
  buildDocumentHandlerServer(): Promise<DocumentHandlerServer>;
13
- private prepareIntegrationApi;
14
- private getIntegrationFiles;
15
- private checkRequiredFiles;
16
- private createNeededFolderStructure;
17
- private prepareLocalDocumentHandler;
18
- private preparePackageJson;
19
- private prepareTestCases;
20
12
  private getCustomerConfig;
21
13
  /**
22
14
  * Gives the workspace its own manifest before anything is installed into it.