@speedkit/cli 4.36.1 → 4.36.2

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 +7 -0
  2. package/dist/base/sk-command.d.ts +41 -0
  3. package/dist/base/sk-command.js +56 -0
  4. package/dist/commands/auto-prewarm.d.ts +6 -4
  5. package/dist/commands/auto-prewarm.js +13 -66
  6. package/dist/commands/autocomplete/fish.d.ts +2 -2
  7. package/dist/commands/autocomplete/fish.js +3 -2
  8. package/dist/commands/browser/clean.d.ts +2 -2
  9. package/dist/commands/browser/clean.js +6 -6
  10. package/dist/commands/browser/list.d.ts +2 -2
  11. package/dist/commands/browser/list.js +6 -7
  12. package/dist/commands/browser/update.d.ts +2 -2
  13. package/dist/commands/browser/update.js +9 -11
  14. package/dist/commands/bulk-deploy.d.ts +4 -2
  15. package/dist/commands/bulk-deploy.js +7 -37
  16. package/dist/commands/config/edit.d.ts +2 -2
  17. package/dist/commands/config/edit.js +2 -2
  18. package/dist/commands/config/setup.d.ts +5 -2
  19. package/dist/commands/config/setup.js +9 -19
  20. package/dist/commands/deploy.d.ts +12 -3
  21. package/dist/commands/deploy.js +14 -20
  22. package/dist/commands/diff-url-parameters.d.ts +3 -2
  23. package/dist/commands/diff-url-parameters.js +19 -16
  24. package/dist/commands/extension/add.d.ts +2 -2
  25. package/dist/commands/extension/add.js +6 -6
  26. package/dist/commands/extension/devtools.d.ts +2 -2
  27. package/dist/commands/extension/devtools.js +6 -7
  28. package/dist/commands/extension/list.d.ts +2 -2
  29. package/dist/commands/extension/list.js +5 -6
  30. package/dist/commands/extension/remove.d.ts +2 -2
  31. package/dist/commands/extension/remove.js +6 -6
  32. package/dist/commands/extension/update.d.ts +2 -2
  33. package/dist/commands/extension/update.js +5 -6
  34. package/dist/commands/find-pops.d.ts +2 -2
  35. package/dist/commands/find-pops.js +10 -11
  36. package/dist/commands/generate-customer-config.d.ts +5 -2
  37. package/dist/commands/generate-customer-config.js +9 -27
  38. package/dist/commands/generate-pop-config.d.ts +2 -2
  39. package/dist/commands/generate-pop-config.js +19 -15
  40. package/dist/commands/login.d.ts +2 -2
  41. package/dist/commands/login.js +6 -9
  42. package/dist/commands/onboarding.d.ts +18 -3
  43. package/dist/commands/onboarding.js +13 -11
  44. package/dist/commands/origin-request.d.ts +4 -2
  45. package/dist/commands/origin-request.js +10 -42
  46. package/dist/commands/prewarm.d.ts +4 -2
  47. package/dist/commands/prewarm.js +12 -56
  48. package/dist/commands/pull.d.ts +4 -2
  49. package/dist/commands/pull.js +9 -14
  50. package/dist/commands/query/parameter.d.ts +4 -2
  51. package/dist/commands/query/parameter.js +12 -19
  52. package/dist/commands/query/prewarm.d.ts +4 -2
  53. package/dist/commands/query/prewarm.js +16 -23
  54. package/dist/commands/revalidate.d.ts +4 -2
  55. package/dist/commands/revalidate.js +13 -56
  56. package/dist/commands/wpt-launcher.d.ts +2 -2
  57. package/dist/commands/wpt-launcher.js +16 -17
  58. package/dist/hooks/init/first-run.js +9 -10
  59. package/dist/models/context.d.ts +24 -0
  60. package/dist/models/context.js +31 -0
  61. package/dist/services/athena/athena-flags.d.ts +18 -0
  62. package/dist/services/athena/athena-flags.js +29 -0
  63. package/dist/services/athena/athena-service-build-context.d.ts +25 -0
  64. package/dist/services/athena/athena-service-build-context.js +4 -0
  65. package/dist/services/athena/athena-service-factory.d.ts +3 -16
  66. package/dist/services/athena/athena-service-factory.js +11 -27
  67. package/dist/services/athena/baqend-athena-service.d.ts +3 -14
  68. package/dist/services/athena/baqend-athena-service.js +8 -16
  69. package/dist/services/athena/index.d.ts +1 -0
  70. package/dist/services/athena/index.js +1 -0
  71. package/dist/services/athena/spec/baqend-athena-service.spec.js +2 -2
  72. package/dist/services/browser-fetch/browser-origin-fetch.d.ts +2 -2
  73. package/dist/services/browser-fetch/browser-origin-fetch.js +1 -1
  74. package/dist/services/browser-fetch/browser-origin-fetcher.d.ts +3 -3
  75. package/dist/services/browser-fetch/browser-origin-fetcher.js +5 -5
  76. package/dist/services/browser-fetch/spec/browser-origin-fetch.spec.js +10 -10
  77. package/dist/services/cli/cli-environment-factory.d.ts +25 -0
  78. package/dist/services/cli/cli-environment-factory.js +30 -0
  79. package/dist/services/cli/cli-environment.d.ts +73 -0
  80. package/dist/services/cli/cli-environment.js +216 -0
  81. package/dist/services/cli/cli-service-build-context.d.ts +10 -0
  82. package/dist/services/cli/cli-service-build-context.js +4 -0
  83. package/dist/services/cli/cli-service-factory.d.ts +7 -7
  84. package/dist/services/cli/cli-service-factory.js +7 -7
  85. package/dist/services/cli/cli-service-model.d.ts +0 -4
  86. package/dist/services/cli/cli-service-model.js +0 -6
  87. package/dist/services/cli/cli-service.d.ts +16 -2
  88. package/dist/services/cli/cli-service.js +17 -18
  89. package/dist/services/cli/cli-settings.d.ts +37 -0
  90. package/dist/services/cli/cli-settings.js +23 -0
  91. package/dist/services/cli/command-build-context.d.ts +23 -0
  92. package/dist/services/cli/index.d.ts +5 -1
  93. package/dist/services/cli/index.js +5 -1
  94. package/dist/services/cli/spec/cli-environment-detection.spec.js +52 -0
  95. package/dist/services/cli/spec/cli-environment.spec.js +125 -0
  96. package/dist/services/cli/spec/cli-service.spec.js +9 -19
  97. package/dist/services/config-api/client.d.ts +3 -3
  98. package/dist/services/config-api/client.js +4 -4
  99. package/dist/services/config-api/config-api-factory.js +3 -3
  100. package/dist/services/config-api/entity-manager-provider.d.ts +11 -0
  101. package/dist/services/config-api/{entity-manager-factory.js → entity-manager-provider.js} +7 -1
  102. package/dist/services/customer-config/customer-config-service-build-context.d.ts +33 -0
  103. package/dist/services/customer-config/customer-config-service-build-context.js +36 -0
  104. package/dist/services/customer-config/customer-config-service-factory.d.ts +3 -4
  105. package/dist/services/customer-config/customer-config-service-factory.js +5 -8
  106. package/dist/services/customer-config/customer-config-service.d.ts +2 -2
  107. package/dist/services/customer-config/index.d.ts +1 -1
  108. package/dist/services/customer-config/index.js +1 -1
  109. package/dist/services/customer-config/site-analyzer/index.d.ts +1 -0
  110. package/dist/services/customer-config/site-analyzer/index.js +1 -0
  111. package/dist/services/customer-config/site-analyzer/site-analyzer-service-build-context.d.ts +6 -0
  112. package/dist/services/customer-config/site-analyzer/site-analyzer-service-build-context.js +4 -0
  113. package/dist/services/customer-config/site-analyzer/site-analyzer-service-factory.d.ts +3 -3
  114. package/dist/services/customer-config/site-analyzer/site-analyzer-service-factory.js +4 -5
  115. package/dist/services/deploy/bulk/bulk-deploy-model.d.ts +0 -25
  116. package/dist/services/deploy/bulk/bulk-deploy-model.js +1 -27
  117. package/dist/services/deploy/bulk/bulk-deploy-service-build-context.d.ts +51 -0
  118. package/dist/services/deploy/bulk/bulk-deploy-service-build-context.js +50 -0
  119. package/dist/services/deploy/bulk/bulk-deploy-service-factory.d.ts +2 -4
  120. package/dist/services/deploy/bulk/bulk-deploy-service-factory.js +2 -5
  121. package/dist/services/deploy/bulk/bulk-deploy-service.d.ts +3 -2
  122. package/dist/services/deploy/bulk/config-deploy-factory.d.ts +3 -3
  123. package/dist/services/deploy/bulk/config-deploy-factory.js +16 -8
  124. package/dist/services/deploy/bulk/index.d.ts +1 -0
  125. package/dist/services/deploy/bulk/index.js +1 -0
  126. package/dist/services/deploy/checks/activation/customer-approval-check.d.ts +3 -1
  127. package/dist/services/deploy/checks/activation/customer-approval-check.js +4 -2
  128. package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.d.ts +3 -1
  129. package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +4 -2
  130. package/dist/services/deploy/checks/pre-deploy/split-change-check.d.ts +3 -1
  131. package/dist/services/deploy/checks/pre-deploy/split-change-check.js +4 -2
  132. package/dist/services/deploy/deploy-service-build-context.d.ts +63 -0
  133. package/dist/services/deploy/deploy-service-build-context.js +64 -0
  134. package/dist/services/deploy/deploy-service-factory.d.ts +5 -8
  135. package/dist/services/deploy/deploy-service-factory.js +28 -19
  136. package/dist/services/deploy/mr/base-config-reader.d.ts +6 -4
  137. package/dist/services/deploy/mr/base-config-reader.js +6 -8
  138. package/dist/services/deploy/mr/index.d.ts +1 -0
  139. package/dist/services/deploy/mr/index.js +1 -0
  140. package/dist/services/deploy/mr/merge-request-deploy-model.d.ts +0 -35
  141. package/dist/services/deploy/mr/merge-request-deploy-model.js +0 -34
  142. package/dist/services/deploy/mr/merge-request-deploy-service-build-context.d.ts +32 -0
  143. package/dist/services/deploy/mr/merge-request-deploy-service-build-context.js +20 -0
  144. package/dist/services/deploy/mr/merge-request-deploy-service-factory.d.ts +2 -4
  145. package/dist/services/deploy/mr/merge-request-deploy-service-factory.js +31 -10
  146. package/dist/services/deploy/mr/merge-request-deploy-service.d.ts +3 -2
  147. package/dist/services/deploy/spec/bulk/bulk-deploy-service.spec.js +14 -3
  148. package/dist/services/deploy/spec/checks/activation/customer-approval-check.spec.js +7 -5
  149. package/dist/services/deploy/spec/checks/pre-deploy/split-change-check.spec.js +2 -1
  150. package/dist/services/diff/diff-service-build-context.d.ts +14 -0
  151. package/dist/services/diff/diff-service-build-context.js +4 -0
  152. package/dist/services/diff/diff-service-factory.d.ts +4 -5
  153. package/dist/services/diff/diff-service-factory.js +4 -7
  154. package/dist/services/diff/index.d.ts +1 -1
  155. package/dist/services/diff/index.js +1 -1
  156. package/dist/services/document-handler-runtime/{context/document-handler-runtime-context.d.ts → document-handler-runtime-model.d.ts} +0 -5
  157. package/dist/services/document-handler-runtime/document-handler-runtime-service-build-context.d.ts +11 -0
  158. package/dist/services/document-handler-runtime/document-handler-runtime-service-build-context.js +4 -0
  159. package/dist/services/document-handler-runtime/document-handler-server.js +2 -2
  160. package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +3 -6
  161. package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +14 -14
  162. package/dist/services/document-handler-runtime/server/request.js +1 -1
  163. package/dist/services/document-handler-runtime/templates/database-mock.d.ts +1 -1
  164. package/dist/services/document-handler-runtime/templates/database-mock.js +1 -1
  165. package/dist/services/integration-api/customer-config-flags.d.ts +16 -0
  166. package/dist/services/integration-api/customer-config-flags.js +30 -0
  167. package/dist/services/integration-api/handler/install-resource-handler.d.ts +8 -0
  168. package/dist/services/integration-api/handler/install-resource-handler.js +10 -1
  169. package/dist/services/integration-api/index.d.ts +1 -0
  170. package/dist/services/integration-api/index.js +1 -0
  171. package/dist/services/integration-api/integration-api-factory.d.ts +4 -6
  172. package/dist/services/integration-api/integration-api-factory.js +11 -11
  173. package/dist/services/integration-api/integration-api-model.d.ts +0 -9
  174. package/dist/services/integration-api/integration-api-model.js +0 -16
  175. package/dist/services/integration-api/integration-api-service-build-context.d.ts +19 -0
  176. package/dist/services/integration-api/integration-api-service-build-context.js +4 -0
  177. package/dist/services/integration-api/spec/config-plugin.spec.js +1 -1
  178. package/dist/services/integration-api/spec/integration-api-service.spec.js +7 -3
  179. package/dist/services/integration-api/spec/speed-kit-config-file.spec.js +9 -2
  180. package/dist/services/integration-api/struct/config-plugin.d.ts +1 -1
  181. package/dist/services/integration-api/struct/config-plugin.js +12 -7
  182. package/dist/services/integration-api/struct/speed-kit-config-file.d.ts +18 -2
  183. package/dist/services/integration-api/struct/speed-kit-config-file.js +22 -12
  184. package/dist/services/integration-api/struct/speed-kit-config.d.ts +1 -1
  185. package/dist/services/onboarding/browser/config/browser-config.d.ts +3 -3
  186. package/dist/services/onboarding/browser/config/browser-config.js +5 -5
  187. package/dist/services/onboarding/browser/executable/executable-validator.d.ts +3 -3
  188. package/dist/services/onboarding/browser/executable/executable-validator.js +17 -15
  189. package/dist/services/onboarding/browser/extension/extension-downloader.d.ts +3 -3
  190. package/dist/services/onboarding/browser/extension/extension-downloader.js +6 -6
  191. package/dist/services/onboarding/browser/extension/extension-validator.d.ts +3 -3
  192. package/dist/services/onboarding/browser/extension/extension-validator.js +4 -4
  193. package/dist/services/onboarding/file-events/file-watcher.js +1 -0
  194. package/dist/services/onboarding/index.d.ts +1 -1
  195. package/dist/services/onboarding/index.js +1 -1
  196. package/dist/services/onboarding/onboarding-model.d.ts +8 -24
  197. package/dist/services/onboarding/onboarding-model.js +19 -87
  198. package/dist/services/onboarding/onboarding-service-build-context.d.ts +57 -0
  199. package/dist/services/onboarding/onboarding-service-build-context.js +67 -0
  200. package/dist/services/onboarding/onboarding-service-factory.d.ts +2 -5
  201. package/dist/services/onboarding/onboarding-service-factory.js +47 -34
  202. package/dist/services/onboarding/spec/onboarding-model.spec.js +11 -6
  203. package/dist/services/origin-request/index.d.ts +1 -1
  204. package/dist/services/origin-request/index.js +1 -1
  205. package/dist/services/origin-request/origin-request-service-build-context.d.ts +52 -0
  206. package/dist/services/origin-request/origin-request-service-build-context.js +54 -0
  207. package/dist/services/origin-request/origin-request-service-factory.d.ts +2 -5
  208. package/dist/services/origin-request/origin-request-service-factory.js +12 -12
  209. package/dist/services/origin-request/origin-request-service.d.ts +2 -2
  210. package/dist/services/pop-config/index.d.ts +1 -0
  211. package/dist/services/pop-config/index.js +1 -0
  212. package/dist/services/pop-config/pop-config-factory.d.ts +4 -1
  213. package/dist/services/pop-config/pop-config-factory.js +10 -3
  214. package/dist/services/pop-config/pop-config-service-build-context.d.ts +10 -0
  215. package/dist/services/pop-config/pop-config-service-build-context.js +4 -0
  216. package/dist/services/prewarm/auto-pre-warm-factory.d.ts +3 -31
  217. package/dist/services/prewarm/auto-pre-warm-factory.js +6 -11
  218. package/dist/services/prewarm/auto-pre-warm-service-build-context.d.ts +84 -0
  219. package/dist/services/prewarm/auto-pre-warm-service-build-context.js +68 -0
  220. package/dist/services/prewarm/index.d.ts +2 -0
  221. package/dist/services/prewarm/index.js +2 -0
  222. package/dist/services/prewarm/pre-warm-factory.d.ts +4 -5
  223. package/dist/services/prewarm/pre-warm-factory.js +6 -8
  224. package/dist/services/prewarm/pre-warm-model.d.ts +0 -10
  225. package/dist/services/prewarm/pre-warm-model.js +0 -18
  226. package/dist/services/prewarm/pre-warm-service-build-context.d.ts +47 -0
  227. package/dist/services/prewarm/pre-warm-service-build-context.js +64 -0
  228. package/dist/services/pull/index.d.ts +1 -0
  229. package/dist/services/pull/index.js +1 -0
  230. package/dist/services/pull/pull-service-build-context.d.ts +28 -0
  231. package/dist/services/pull/pull-service-build-context.js +17 -0
  232. package/dist/services/pull/pull-service-factory.d.ts +3 -5
  233. package/dist/services/pull/pull-service-factory.js +13 -14
  234. package/dist/services/pull/pull-service-model.d.ts +0 -5
  235. package/dist/services/pull/pull-service-model.js +0 -9
  236. package/dist/services/query-builder/query-builder-factory.d.ts +9 -7
  237. package/dist/services/query-builder/query-builder-factory.js +26 -15
  238. package/dist/{models/cli-parameters.d.ts → services/query-builder/query-builder-flags.d.ts} +1 -120
  239. package/dist/services/query-builder/query-builder-flags.js +150 -0
  240. package/dist/services/query-builder/query-builder-model.d.ts +1 -14
  241. package/dist/services/query-builder/query-builder-service-build-context.d.ts +113 -0
  242. package/dist/services/query-builder/query-builder-service-build-context.js +68 -0
  243. package/dist/services/query-builder/query-builder-service.d.ts +3 -3
  244. package/dist/services/query-builder/spec/query-builder-flags.spec.d.ts +1 -0
  245. package/dist/{models/spec/cli-parameters.spec.js → services/query-builder/spec/query-builder-flags.spec.js} +1 -1
  246. package/dist/services/revalidate/index.d.ts +1 -0
  247. package/dist/services/revalidate/index.js +1 -0
  248. package/dist/services/revalidate/revalidate-factory.d.ts +3 -5
  249. package/dist/services/revalidate/revalidate-factory.js +2 -6
  250. package/dist/services/revalidate/revalidate-model.d.ts +0 -9
  251. package/dist/services/revalidate/revalidate-model.js +0 -8
  252. package/dist/services/revalidate/revalidate-service-build-context.d.ts +38 -0
  253. package/dist/services/revalidate/revalidate-service-build-context.js +59 -0
  254. package/dist/services/setup/browser/browser-setup-service.d.ts +3 -4
  255. package/dist/services/setup/browser/browser-setup-service.js +16 -18
  256. package/dist/services/setup/difftool/difftool-setup-service.d.ts +3 -4
  257. package/dist/services/setup/difftool/difftool-setup-service.js +5 -7
  258. package/dist/services/setup/extension/extension-setup-service.d.ts +3 -4
  259. package/dist/services/setup/extension/extension-setup-service.js +8 -10
  260. package/dist/services/setup/index.d.ts +1 -1
  261. package/dist/services/setup/index.js +1 -1
  262. package/dist/services/setup/setup-service-build-context.d.ts +27 -0
  263. package/dist/services/setup/setup-service-build-context.js +26 -0
  264. package/dist/services/setup/setup-service-factory.d.ts +2 -6
  265. package/dist/services/setup/setup-service-factory.js +10 -18
  266. package/dist/services/setup/setup-service.d.ts +4 -5
  267. package/dist/services/setup/setup-service.js +6 -7
  268. package/oclif.manifest.json +1 -1
  269. package/package.json +4 -2
  270. package/dist/models/cli-parameters.js +0 -297
  271. package/dist/services/cli/cli-config.d.ts +0 -59
  272. package/dist/services/cli/cli-config.js +0 -180
  273. package/dist/services/cli/environment.d.ts +0 -15
  274. package/dist/services/cli/environment.js +0 -40
  275. package/dist/services/cli/spec/cli-config.spec.js +0 -117
  276. package/dist/services/cli/spec/environment.spec.js +0 -28
  277. package/dist/services/config-api/entity-manager-factory.d.ts +0 -5
  278. package/dist/services/customer-config/customer-config-service-context.d.ts +0 -13
  279. package/dist/services/customer-config/customer-config-service-context.js +0 -21
  280. package/dist/services/deploy/context/deploy-context.d.ts +0 -32
  281. package/dist/services/deploy/context/deploy-context.js +0 -72
  282. package/dist/services/diff/diff-model.d.ts +0 -9
  283. package/dist/services/diff/diff-model.js +0 -12
  284. package/dist/services/origin-request/origin-request-context.d.ts +0 -13
  285. package/dist/services/origin-request/origin-request-context.js +0 -23
  286. package/dist/services/query-builder/query-command.d.ts +0 -28
  287. package/dist/services/query-builder/query-command.js +0 -37
  288. package/dist/services/setup/setup-context.d.ts +0 -14
  289. package/dist/services/setup/setup-context.js +0 -15
  290. /package/dist/{models/spec/cli-parameters.spec.d.ts → services/cli/command-build-context.js} +0 -0
  291. /package/dist/services/cli/spec/{cli-config.spec.d.ts → cli-environment-detection.spec.d.ts} +0 -0
  292. /package/dist/services/cli/spec/{environment.spec.d.ts → cli-environment.spec.d.ts} +0 -0
  293. /package/dist/services/document-handler-runtime/{context/document-handler-runtime-context.js → document-handler-runtime-model.js} +0 -0
@@ -0,0 +1,52 @@
1
+ import { Interfaces } from "@oclif/core";
2
+ import { CommandContextValues, CliEnvironment } from "../cli/index.js";
3
+ declare const args: {
4
+ pageUrl: Interfaces.Arg<string, Record<string, unknown>>;
5
+ customerPath: Interfaces.Arg<string, {
6
+ exists?: boolean;
7
+ }>;
8
+ };
9
+ declare const flags: {
10
+ variation: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
11
+ host: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
12
+ body: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
13
+ grep: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
14
+ json: Interfaces.BooleanFlag<boolean>;
15
+ variations: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
16
+ configName: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
17
+ };
18
+ /** What `sk origin-request` asks for, as the service reads it. */
19
+ export interface OriginRequestOptions {
20
+ readonly customerPath: string;
21
+ readonly configName: string;
22
+ readonly pageUrl: string;
23
+ readonly variation?: string;
24
+ readonly host?: string;
25
+ readonly bodyFile?: string;
26
+ readonly grep?: string;
27
+ readonly json?: boolean;
28
+ readonly variationsFile?: string;
29
+ }
30
+ export interface OriginRequestServiceBuildContextValues extends CommandContextValues, OriginRequestOptions {
31
+ }
32
+ declare const OriginRequestServiceBuildContext_base: new (values: OriginRequestServiceBuildContextValues) => Readonly<OriginRequestServiceBuildContextValues>;
33
+ /** What an origin request is built from. */
34
+ export declare class OriginRequestServiceBuildContext extends OriginRequestServiceBuildContext_base {
35
+ static readonly args: {
36
+ pageUrl: Interfaces.Arg<string, Record<string, unknown>>;
37
+ customerPath: Interfaces.Arg<string, {
38
+ exists?: boolean;
39
+ }>;
40
+ };
41
+ static readonly flags: {
42
+ variation: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
43
+ host: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
44
+ body: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
45
+ grep: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
46
+ json: Interfaces.BooleanFlag<boolean>;
47
+ variations: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
48
+ configName: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
49
+ };
50
+ static create(parsedArgs: Interfaces.InferredArgs<typeof args>, parsedFlags: Interfaces.InferredFlags<typeof flags>, environment: CliEnvironment): OriginRequestServiceBuildContext;
51
+ }
52
+ export {};
@@ -0,0 +1,54 @@
1
+ import { Args, Flags } from "@oclif/core";
2
+ import { CLI_CONFIG_NAME, CLI_CUSTOMER_CONFIG, } from "../integration-api/customer-config-flags.js";
3
+ import { Context } from "../../models/context.js";
4
+ const args = {
5
+ ...CLI_CUSTOMER_CONFIG,
6
+ pageUrl: Args.string({
7
+ name: "pageUrl",
8
+ required: true,
9
+ description: "Page to request from origin",
10
+ example: "https://www.decathlon.de/",
11
+ }),
12
+ };
13
+ const flags = {
14
+ ...CLI_CONFIG_NAME,
15
+ variation: Flags.string({
16
+ char: "v",
17
+ description: "Cache variation to simulate, e.g. desktop-fmarkt-variant-e_1907090. Omitted means the default variation",
18
+ }),
19
+ host: Flags.string({
20
+ description: "Send this Host header, emulating an origin-map host override",
21
+ }),
22
+ body: Flags.string({
23
+ description: "Write the response body to this file",
24
+ }),
25
+ grep: Flags.string({
26
+ description: "Print body lines matching this regex, case-insensitive",
27
+ }),
28
+ json: Flags.boolean({
29
+ description: "Machine-readable output",
30
+ }),
31
+ variations: Flags.string({
32
+ description: "Simulate against a runtime config in a local file instead of the app's deployed one",
33
+ }),
34
+ };
35
+ /** What an origin request is built from. */
36
+ export class OriginRequestServiceBuildContext extends Context() {
37
+ static args = args;
38
+ static flags = flags;
39
+ static create(parsedArgs, parsedFlags, environment) {
40
+ return new OriginRequestServiceBuildContext({
41
+ environment,
42
+ customerPath: parsedArgs.customerPath,
43
+ configName: parsedFlags.configName,
44
+ pageUrl: parsedArgs.pageUrl,
45
+ variation: parsedFlags.variation,
46
+ host: parsedFlags.host,
47
+ bodyFile: parsedFlags.body,
48
+ grep: parsedFlags.grep,
49
+ json: parsedFlags.json,
50
+ variationsFile: parsedFlags.variations,
51
+ });
52
+ }
53
+ }
54
+ OriginRequestServiceBuildContext;
@@ -1,12 +1,9 @@
1
- import { CliServiceInterface, UserCliConfig } from "../cli/index.js";
2
- import { OriginRequestContext } from "./origin-request-context.js";
1
+ import { OriginRequestServiceBuildContext } from "./origin-request-service-build-context.js";
3
2
  import { OriginRequestService } from "./origin-request-service.js";
4
3
  export declare class OriginRequestServiceFactory {
5
4
  private readonly context;
6
- private readonly userConfig;
7
- private readonly cli?;
8
5
  private service?;
9
- constructor(context: OriginRequestContext, userConfig: UserCliConfig, cli?: CliServiceInterface);
6
+ constructor(context: OriginRequestServiceBuildContext);
10
7
  buildService(): Promise<OriginRequestService>;
11
8
  private build;
12
9
  private getIntegrationFiles;
@@ -1,17 +1,12 @@
1
- import { CliServiceFactory, } from "../cli/index.js";
2
1
  import { ConfigApiContext, ConfigApiServiceFactory, } from "../config-api/index.js";
3
- import { IntegrationApiContext, IntegrationApiFactory, } from "../integration-api/index.js";
2
+ import { IntegrationApiServiceBuildContext, IntegrationApiFactory, } from "../integration-api/index.js";
4
3
  import { applyOriginProxy } from "../../helpers/origin-proxy.js";
5
4
  import { OriginRequestService } from "./origin-request-service.js";
6
5
  export class OriginRequestServiceFactory {
7
6
  context;
8
- userConfig;
9
- cli;
10
7
  service = undefined;
11
- constructor(context, userConfig, cli) {
8
+ constructor(context) {
12
9
  this.context = context;
13
- this.userConfig = userConfig;
14
- this.cli = cli;
15
10
  }
16
11
  async buildService() {
17
12
  if (!(this.service instanceof OriginRequestService)) {
@@ -20,16 +15,21 @@ export class OriginRequestServiceFactory {
20
15
  return this.service;
21
16
  }
22
17
  async build() {
23
- const cli = this.cli ?? new CliServiceFactory().getService();
24
- const files = await this.getIntegrationFiles(cli);
18
+ const cli = this.context.environment.cli;
19
+ const files = await this.getIntegrationFiles();
25
20
  const customer = files.getCustomerConfig().config;
26
21
  // `--json` owns stdout, so the proxy line stays out of a machine-readable run.
27
22
  applyOriginProxy(customer.chromeFlags, this.context.json ? undefined : cli);
28
23
  this.service = new OriginRequestService(this.context, cli, this.getConfigApi(customer.app));
29
24
  }
30
- async getIntegrationFiles(cli) {
31
- const integrationApiContext = new IntegrationApiContext(this.context.customerPath, this.context.configName, []);
32
- const integrationApi = new IntegrationApiFactory(integrationApiContext, this.userConfig, cli).buildService();
25
+ async getIntegrationFiles() {
26
+ const integrationApiContext = new IntegrationApiServiceBuildContext({
27
+ environment: this.context.environment,
28
+ basePath: this.context.customerPath,
29
+ configName: this.context.configName,
30
+ whitelist: [],
31
+ });
32
+ const integrationApi = new IntegrationApiFactory(integrationApiContext).buildService();
33
33
  return await integrationApi.run();
34
34
  }
35
35
  getConfigApi(app) {
@@ -1,6 +1,6 @@
1
1
  import { CliServiceInterface } from "../cli/index.js";
2
2
  import { ConfigApiService } from "../config-api/index.js";
3
- import { OriginRequestContext } from "./origin-request-context.js";
3
+ import { OriginRequestOptions } from "./origin-request-service-build-context.js";
4
4
  /**
5
5
  * Fetches a page from origin with exactly the headers Speed Kit's server would send for a cache
6
6
  * variation, then reports what the origin answered.
@@ -20,7 +20,7 @@ export declare class OriginRequestService {
20
20
  private readonly context;
21
21
  private readonly cli;
22
22
  private readonly configApi;
23
- constructor(context: OriginRequestContext, cli: CliServiceInterface, configApi: ConfigApiService);
23
+ constructor(context: OriginRequestOptions, cli: CliServiceInterface, configApi: ConfigApiService);
24
24
  run(): Promise<void>;
25
25
  /**
26
26
  * Reads `speedKit.variations` from the app's deployed runtime config, or from a local file when
@@ -1,3 +1,4 @@
1
1
  export * from "./pop-config-service.js";
2
2
  export * from "./pop-config-factory.js";
3
+ export * from "./pop-config-service-build-context.js";
3
4
  export * from "./pop-config-model.js";
@@ -1,3 +1,4 @@
1
1
  export * from "./pop-config-service.js";
2
2
  export * from "./pop-config-factory.js";
3
+ export * from "./pop-config-service-build-context.js";
3
4
  export * from "./pop-config-model.js";
@@ -1,4 +1,7 @@
1
1
  import { PopConfigService } from "./pop-config-service.js";
2
+ import { PopConfigServiceBuildContext } from "./pop-config-service-build-context.js";
2
3
  export declare class PopConfigFactory {
3
- getService(app?: string): Promise<PopConfigService>;
4
+ private readonly context;
5
+ constructor(context: PopConfigServiceBuildContext);
6
+ getService(): Promise<PopConfigService>;
4
7
  }
@@ -1,8 +1,15 @@
1
1
  import { PopConfigService } from "./pop-config-service.js";
2
- import { AthenaServiceFactory } from "../athena/index.js";
2
+ import { AthenaServiceBuildContext, AthenaServiceFactory, } from "../athena/index.js";
3
3
  export class PopConfigFactory {
4
- async getService(app) {
5
- const athenaService = await new AthenaServiceFactory(app).getService();
4
+ context;
5
+ constructor(context) {
6
+ this.context = context;
7
+ }
8
+ async getService() {
9
+ const athenaService = await new AthenaServiceFactory(new AthenaServiceBuildContext({
10
+ environment: this.context.environment,
11
+ app: this.context.app,
12
+ })).getService();
6
13
  return new PopConfigService(athenaService);
7
14
  }
8
15
  }
@@ -0,0 +1,10 @@
1
+ import { CommandContextValues } from "../cli/index.js";
2
+ export interface PopConfigServiceBuildContextValues extends CommandContextValues {
3
+ /** The app whose POPs are read, for the Baqend Athena path. */
4
+ readonly app?: string;
5
+ }
6
+ declare const PopConfigServiceBuildContext_base: new (values: PopConfigServiceBuildContextValues) => Readonly<PopConfigServiceBuildContextValues>;
7
+ /** Which app the POP config is read for. */
8
+ export declare class PopConfigServiceBuildContext extends PopConfigServiceBuildContext_base {
9
+ }
10
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Context } from "../../models/context.js";
2
+ /** Which app the POP config is read for. */
3
+ export class PopConfigServiceBuildContext extends Context() {
4
+ }
@@ -1,31 +1,5 @@
1
- import { CliServiceInterface, UserCliConfig } from "../cli/index.js";
2
- import { QueryFilterOptions } from "../query-builder/query-builder-model.js";
3
1
  import { PreWarmService } from "./pre-warm-service.js";
4
- export interface AutoPreWarmContext extends QueryFilterOptions {
5
- readonly customerPath: string;
6
- readonly configName: string;
7
- /** Device classes to warm each url in the variations it was requested in. */
8
- readonly device?: readonly string[];
9
- /** Drop urls the origin mostly answers with a 404. */
10
- readonly excludeNotFound?: boolean;
11
- /** Keep only the most requested urls. */
12
- readonly limit?: number;
13
- /** Regular expressions the pre-warmed urls have to match. */
14
- readonly match?: readonly string[];
15
- /** Keep only urls requested at least this often in the window. */
16
- readonly minHits?: number;
17
- /** Athena workgroup the query runs in. */
18
- readonly workgroup?: string;
19
- /** Athena data catalog the rum tables live in. */
20
- readonly catalog?: string;
21
- /** Variations to pair every url with, when no traffic can reveal them. */
22
- readonly variation?: readonly string[];
23
- readonly variationPath?: string;
24
- readonly sortParameters?: boolean;
25
- readonly quiet?: boolean;
26
- readonly verbose?: boolean;
27
- readonly isWindows?: boolean;
28
- }
2
+ import { AutoPreWarmServiceBuildContext } from "./auto-pre-warm-service-build-context.js";
29
3
  /**
30
4
  * Wires a {@link PreWarmService} that gets its URLs from a freshly built and
31
5
  * executed prewarm query instead of a CSV file. Reads the app from the customer
@@ -38,9 +12,7 @@ export interface AutoPreWarmContext extends QueryFilterOptions {
38
12
  * list is crossed with `--variationPath` or the default variation, as before.
39
13
  */
40
14
  export declare class AutoPreWarmFactory {
41
- private context;
42
- private userConfig;
43
- private cli?;
44
- constructor(context: AutoPreWarmContext, userConfig: UserCliConfig, cli?: CliServiceInterface);
15
+ private readonly context;
16
+ constructor(context: AutoPreWarmServiceBuildContext);
45
17
  getService(): Promise<PreWarmService>;
46
18
  }
@@ -1,6 +1,5 @@
1
- import { CliContext, CliServiceFactory, } from "../cli/index.js";
2
1
  import { QueryBuilderFactory } from "../query-builder/query-builder-factory.js";
3
- import { QueryType, } from "../query-builder/query-builder-model.js";
2
+ import { PrewarmQueryServiceBuildContext } from "../query-builder/query-builder-service-build-context.js";
4
3
  import { normalizeDevices } from "../query-builder/queries/device.js";
5
4
  import { ConfigApiContext, ConfigApiServiceFactory, } from "../config-api/index.js";
6
5
  import { AssetApiClient } from "./assets/asset-api-client.js";
@@ -21,17 +20,13 @@ import { toPrewarmTargets } from "./prewarm-targets.js";
21
20
  */
22
21
  export class AutoPreWarmFactory {
23
22
  context;
24
- userConfig;
25
- cli;
26
- constructor(context, userConfig, cli) {
23
+ constructor(context) {
27
24
  this.context = context;
28
- this.userConfig = userConfig;
29
- this.cli = cli;
30
25
  }
31
26
  async getService() {
32
- const cli = this.cli ??
33
- new CliServiceFactory(new CliContext(this.context.quiet)).getService();
34
- const queryService = await new QueryBuilderFactory({
27
+ const cli = this.context.environment.cli;
28
+ const queryService = await new QueryBuilderFactory(new PrewarmQueryServiceBuildContext({
29
+ environment: this.context.environment,
35
30
  configName: this.context.configName,
36
31
  customerPath: this.context.customerPath,
37
32
  days: this.context.days,
@@ -49,7 +44,7 @@ export class AutoPreWarmFactory {
49
44
  variations: this.context.variation,
50
45
  workgroup: this.context.workgroup,
51
46
  catalog: this.context.catalog,
52
- }, this.userConfig, cli).buildService(QueryType.prewarm);
47
+ })).buildService();
53
48
  const app = queryService.app;
54
49
  const rows = await queryService.execute();
55
50
  const configApi = new ConfigApiServiceFactory(new ConfigApiContext(app)).getService();
@@ -0,0 +1,84 @@
1
+ import { Interfaces } from "@oclif/core";
2
+ import { CommandContextValues, CliEnvironment } from "../cli/index.js";
3
+ import { QueryFilterOptions } from "../query-builder/query-builder-model.js";
4
+ declare const args: {
5
+ customerPath: Interfaces.Arg<string, {
6
+ exists?: boolean;
7
+ }>;
8
+ };
9
+ declare const flags: {
10
+ variationPath: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
11
+ keepParameterSorting: Interfaces.BooleanFlag<boolean>;
12
+ quiet: Interfaces.BooleanFlag<boolean>;
13
+ verbose: Interfaces.BooleanFlag<boolean>;
14
+ excludeNotFound: Interfaces.BooleanFlag<boolean>;
15
+ limit: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
16
+ match: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
17
+ minHits: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
18
+ device: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
19
+ variation: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
20
+ excludeNoindex: Interfaces.BooleanFlag<boolean>;
21
+ excludeSuspicious: Interfaces.BooleanFlag<boolean>;
22
+ explain: Interfaces.BooleanFlag<boolean>;
23
+ hardNavigationsOnly: Interfaces.BooleanFlag<boolean>;
24
+ days: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
25
+ configName: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
26
+ catalog: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
27
+ workgroup: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
28
+ };
29
+ export interface AutoPreWarmServiceBuildContextValues extends CommandContextValues, QueryFilterOptions {
30
+ readonly customerPath: string;
31
+ readonly configName: string;
32
+ /** Device classes to warm each url in the variations it was requested in. */
33
+ readonly device?: readonly string[];
34
+ /** Drop urls the origin mostly answers with a 404. */
35
+ readonly excludeNotFound?: boolean;
36
+ /** Keep only the most requested urls. */
37
+ readonly limit?: number;
38
+ /** Regular expressions the pre-warmed urls have to match. */
39
+ readonly match?: readonly string[];
40
+ /** Keep only urls requested at least this often in the window. */
41
+ readonly minHits?: number;
42
+ /** Athena workgroup the query runs in. */
43
+ readonly workgroup?: string;
44
+ /** Athena data catalog the rum tables live in. */
45
+ readonly catalog?: string;
46
+ /** Variations to pair every url with, when no traffic can reveal them. */
47
+ readonly variation?: readonly string[];
48
+ readonly variationPath?: string;
49
+ readonly sortParameters?: boolean;
50
+ readonly quiet?: boolean;
51
+ readonly verbose?: boolean;
52
+ readonly isWindows?: boolean;
53
+ }
54
+ declare const AutoPreWarmServiceBuildContext_base: new (values: AutoPreWarmServiceBuildContextValues) => Readonly<AutoPreWarmServiceBuildContextValues>;
55
+ /** What `sk auto-prewarm` queries for and warms. */
56
+ export declare class AutoPreWarmServiceBuildContext extends AutoPreWarmServiceBuildContext_base {
57
+ static readonly args: {
58
+ customerPath: Interfaces.Arg<string, {
59
+ exists?: boolean;
60
+ }>;
61
+ };
62
+ static readonly flags: {
63
+ variationPath: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
64
+ keepParameterSorting: Interfaces.BooleanFlag<boolean>;
65
+ quiet: Interfaces.BooleanFlag<boolean>;
66
+ verbose: Interfaces.BooleanFlag<boolean>;
67
+ excludeNotFound: Interfaces.BooleanFlag<boolean>;
68
+ limit: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
69
+ match: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
70
+ minHits: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
71
+ device: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
72
+ variation: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
73
+ excludeNoindex: Interfaces.BooleanFlag<boolean>;
74
+ excludeSuspicious: Interfaces.BooleanFlag<boolean>;
75
+ explain: Interfaces.BooleanFlag<boolean>;
76
+ hardNavigationsOnly: Interfaces.BooleanFlag<boolean>;
77
+ days: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
78
+ configName: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
79
+ catalog: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
80
+ workgroup: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
81
+ };
82
+ static create(parsedArgs: Interfaces.InferredArgs<typeof args>, parsedFlags: Interfaces.InferredFlags<typeof flags>, environment: CliEnvironment): AutoPreWarmServiceBuildContext;
83
+ }
84
+ export {};
@@ -0,0 +1,68 @@
1
+ import { Flags } from "@oclif/core";
2
+ import { CLI_ATHENA } from "../athena/athena-flags.js";
3
+ import { CLI_CONFIG_NAME, CLI_CUSTOMER_CONFIG, } from "../integration-api/customer-config-flags.js";
4
+ import { CLI_QUERY_DAYS, CLI_QUERY_FILTERS, CLI_QUERY_PREWARM_LIST, } from "../query-builder/query-builder-flags.js";
5
+ import { Context } from "../../models/context.js";
6
+ const args = { ...CLI_CUSTOMER_CONFIG };
7
+ const flags = {
8
+ ...CLI_ATHENA,
9
+ ...CLI_CONFIG_NAME,
10
+ ...CLI_QUERY_DAYS,
11
+ ...CLI_QUERY_FILTERS,
12
+ // Every flag that shapes the pre-warm list, not a subset of them: this
13
+ // command builds the same query `sk query prewarm` does, and a list it
14
+ // could not narrow the same way could not be counted by that command
15
+ // either — the two would describe different runs. `--count` is not among
16
+ // them: this command warms the list rather than reporting its size.
17
+ ...CLI_QUERY_PREWARM_LIST,
18
+ // A variations file says what `--variation` says, read from disk.
19
+ variationPath: Flags.file({
20
+ char: "p",
21
+ description: "path to variations.csv",
22
+ exclusive: ["device", "variation"],
23
+ }),
24
+ keepParameterSorting: Flags.boolean({
25
+ char: "k",
26
+ default: false,
27
+ description: "Prevents alphabetical sorting of the URL parameters",
28
+ }),
29
+ quiet: Flags.boolean({
30
+ char: "q",
31
+ default: false,
32
+ description: "less output non interactive",
33
+ }),
34
+ verbose: Flags.boolean({
35
+ default: false,
36
+ description: "Log information about failed requests",
37
+ }),
38
+ };
39
+ /** What `sk auto-prewarm` queries for and warms. */
40
+ export class AutoPreWarmServiceBuildContext extends Context() {
41
+ static args = args;
42
+ static flags = flags;
43
+ static create(parsedArgs, parsedFlags, environment) {
44
+ return new AutoPreWarmServiceBuildContext({
45
+ environment,
46
+ customerPath: parsedArgs.customerPath,
47
+ configName: parsedFlags.configName,
48
+ days: parsedFlags.days,
49
+ device: parsedFlags.device,
50
+ excludeNoindex: parsedFlags.excludeNoindex,
51
+ excludeNotFound: parsedFlags.excludeNotFound,
52
+ excludeSuspicious: parsedFlags.excludeSuspicious,
53
+ hardNavigationsOnly: parsedFlags.hardNavigationsOnly,
54
+ limit: parsedFlags.limit,
55
+ match: parsedFlags.match,
56
+ minHits: parsedFlags.minHits,
57
+ variation: parsedFlags.variation,
58
+ variationPath: parsedFlags.variationPath,
59
+ sortParameters: !parsedFlags.keepParameterSorting,
60
+ quiet: parsedFlags.quiet,
61
+ verbose: parsedFlags.verbose,
62
+ workgroup: parsedFlags.workgroup,
63
+ catalog: parsedFlags.catalog,
64
+ isWindows: environment.oclif.windows,
65
+ });
66
+ }
67
+ }
68
+ AutoPreWarmServiceBuildContext;
@@ -2,4 +2,6 @@ export * from "./pre-warm-service.js";
2
2
  export * from "./pre-warm-factory.js";
3
3
  export * from "./auto-pre-warm-factory.js";
4
4
  export * from "./pre-warm-model.js";
5
+ export * from "./pre-warm-service-build-context.js";
6
+ export * from "./auto-pre-warm-service-build-context.js";
5
7
  export * from "./prewarm-targets.js";
@@ -2,4 +2,6 @@ export * from "./pre-warm-service.js";
2
2
  export * from "./pre-warm-factory.js";
3
3
  export * from "./auto-pre-warm-factory.js";
4
4
  export * from "./pre-warm-model.js";
5
+ export * from "./pre-warm-service-build-context.js";
6
+ export * from "./auto-pre-warm-service-build-context.js";
5
7
  export * from "./prewarm-targets.js";
@@ -1,10 +1,9 @@
1
- import { CliServiceInterface } from "../cli/index.js";
2
- import { PreWarmContext, PreWarmService } from "./index.js";
1
+ import { PreWarmService } from "./pre-warm-service.js";
2
+ import { PreWarmServiceBuildContext } from "./pre-warm-service-build-context.js";
3
3
  import { CsvReader } from "./csv-reader.js";
4
4
  export declare class PreWarmFactory {
5
- private context;
6
- private cli?;
7
- constructor(context: PreWarmContext, cli?: CliServiceInterface);
5
+ private readonly context;
6
+ constructor(context: PreWarmServiceBuildContext);
8
7
  getService(): Promise<PreWarmService>;
9
8
  }
10
9
  /**
@@ -1,22 +1,20 @@
1
- import { CliContext, CliServiceFactory, } from "../cli/index.js";
2
- import { DEFAULT_VARIATION, PreWarmService, toPrewarmTargets, VARIATION_SEPARATOR, } from "./index.js";
1
+ import { DEFAULT_VARIATION, VARIATION_SEPARATOR } from "./pre-warm-model.js";
2
+ import { PreWarmService } from "./pre-warm-service.js";
3
+ import { toPrewarmTargets } from "./prewarm-targets.js";
3
4
  import { AssetApiClient } from "./assets/asset-api-client.js";
4
5
  import { CsvReader } from "./csv-reader.js";
5
6
  import { ConfigApiContext, ConfigApiServiceFactory, } from "../config-api/index.js";
6
7
  export class PreWarmFactory {
7
8
  context;
8
- cli;
9
- constructor(context, cli) {
9
+ constructor(context) {
10
10
  this.context = context;
11
- this.cli = cli;
12
11
  }
13
12
  async getService() {
14
- const cli = this.cli ??
15
- new CliServiceFactory(new CliContext(this.context.quiet)).getService();
13
+ const cli = this.context.environment.cli;
16
14
  const configApi = new ConfigApiServiceFactory(new ConfigApiContext(this.context.app)).getService();
17
15
  const entityManager = await configApi.client.getEntityManager();
18
16
  const csvReader = new CsvReader();
19
- const assetApiClient = new AssetApiClient(entityManager.token, this.context.app, this.context.keepParameterSorting, cli);
17
+ const assetApiClient = new AssetApiClient(entityManager.token, this.context.app, this.context.sortParameters, cli);
20
18
  const rows = csvReader.readList(this.context.path);
21
19
  const named = this.context.variation ?? this.context.variationPath;
22
20
  if (named && rows.some((row) => row.variation)) {
@@ -1,13 +1,3 @@
1
- export declare class PreWarmContext {
2
- readonly app: string;
3
- readonly path: string;
4
- readonly variation?: string;
5
- readonly variationPath?: string;
6
- readonly keepParameterSorting: boolean;
7
- readonly quiet: boolean;
8
- readonly verbose: boolean;
9
- constructor(app: string, path: string, variation?: string, variationPath?: string, keepParameterSorting?: boolean, quiet?: boolean, verbose?: boolean);
10
- }
11
1
  /**
12
2
  * One url to warm, in one variation. A pre-warm list is a list of these: the
13
3
  * variation is a fact about the url, not a dimension crossed over the whole
@@ -1,21 +1,3 @@
1
- export class PreWarmContext {
2
- app;
3
- path;
4
- variation;
5
- variationPath;
6
- keepParameterSorting;
7
- quiet;
8
- verbose;
9
- constructor(app, path, variation, variationPath, keepParameterSorting = true, quiet = false, verbose = false) {
10
- this.app = app;
11
- this.path = path;
12
- this.variation = variation;
13
- this.variationPath = variationPath;
14
- this.keepParameterSorting = keepParameterSorting;
15
- this.quiet = quiet;
16
- this.verbose = verbose;
17
- }
18
- }
19
1
  export var ItemStatus;
20
2
  (function (ItemStatus) {
21
3
  ItemStatus["DONE"] = "done";
@@ -0,0 +1,47 @@
1
+ import { Interfaces } from "@oclif/core";
2
+ import { CommandContextValues, CliEnvironment } from "../cli/index.js";
3
+ declare const args: {
4
+ app: Interfaces.Arg<string, Record<string, unknown>>;
5
+ path: Interfaces.Arg<string, {
6
+ exists?: boolean;
7
+ }>;
8
+ };
9
+ declare const flags: {
10
+ variation: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
11
+ variationPath: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
12
+ keepParameterSorting: Interfaces.BooleanFlag<boolean>;
13
+ quiet: Interfaces.BooleanFlag<boolean>;
14
+ verbose: Interfaces.BooleanFlag<boolean>;
15
+ delay: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
16
+ };
17
+ export interface PreWarmServiceBuildContextValues extends CommandContextValues {
18
+ readonly app: string;
19
+ /** The CSV list of urls to warm. */
20
+ readonly path: string;
21
+ readonly variation?: string;
22
+ readonly variationPath?: string;
23
+ /** Whether query parameters are sorted before a url is warmed. */
24
+ readonly sortParameters: boolean;
25
+ readonly quiet: boolean;
26
+ readonly verbose: boolean;
27
+ }
28
+ declare const PreWarmServiceBuildContext_base: new (values: PreWarmServiceBuildContextValues) => Readonly<PreWarmServiceBuildContextValues>;
29
+ /** What `sk prewarm` warms: a list of urls of one app. */
30
+ export declare class PreWarmServiceBuildContext extends PreWarmServiceBuildContext_base {
31
+ static readonly args: {
32
+ app: Interfaces.Arg<string, Record<string, unknown>>;
33
+ path: Interfaces.Arg<string, {
34
+ exists?: boolean;
35
+ }>;
36
+ };
37
+ static readonly flags: {
38
+ variation: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
39
+ variationPath: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
40
+ keepParameterSorting: Interfaces.BooleanFlag<boolean>;
41
+ quiet: Interfaces.BooleanFlag<boolean>;
42
+ verbose: Interfaces.BooleanFlag<boolean>;
43
+ delay: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
44
+ };
45
+ static create(parsedArgs: Interfaces.InferredArgs<typeof args>, parsedFlags: Interfaces.InferredFlags<typeof flags>, environment: CliEnvironment): PreWarmServiceBuildContext;
46
+ }
47
+ export {};