@speedkit/cli 3.43.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (412) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +6 -6
  3. package/bin/dev +2 -15
  4. package/bin/run +2 -2
  5. package/dist/commands/build-parameter-query.d.ts +3 -3
  6. package/dist/commands/build-parameter-query.js +12 -15
  7. package/dist/commands/build-prewarm-query.d.ts +4 -4
  8. package/dist/commands/build-prewarm-query.js +13 -16
  9. package/dist/commands/config/edit.js +7 -11
  10. package/dist/commands/deploy.d.ts +3 -5
  11. package/dist/commands/deploy.js +12 -16
  12. package/dist/commands/diff-url-parameters.d.ts +3 -3
  13. package/dist/commands/diff-url-parameters.js +27 -30
  14. package/dist/commands/document-handler.d.ts +4 -4
  15. package/dist/commands/document-handler.js +13 -17
  16. package/dist/commands/find-pops.d.ts +2 -2
  17. package/dist/commands/find-pops.js +22 -24
  18. package/dist/commands/generate-customer-config.d.ts +2 -2
  19. package/dist/commands/generate-customer-config.js +13 -16
  20. package/dist/commands/generate-pop-config.d.ts +7 -7
  21. package/dist/commands/generate-pop-config.js +32 -41
  22. package/dist/commands/login.d.ts +1 -1
  23. package/dist/commands/login.js +13 -17
  24. package/dist/commands/onboarding.d.ts +3 -5
  25. package/dist/commands/onboarding.js +10 -13
  26. package/dist/commands/prewarm.d.ts +9 -9
  27. package/dist/commands/prewarm.js +25 -28
  28. package/dist/commands/pull.d.ts +3 -3
  29. package/dist/commands/pull.js +11 -14
  30. package/dist/commands/wpt-launcher.d.ts +7 -7
  31. package/dist/commands/wpt-launcher.js +21 -26
  32. package/dist/helpers/array-helper.js +1 -4
  33. package/dist/helpers/build-query-helper.js +5 -12
  34. package/dist/helpers/cli-config.d.ts +3 -3
  35. package/dist/helpers/cli-config.js +11 -16
  36. package/dist/helpers/customer-config.d.ts +4 -8
  37. package/dist/helpers/customer-config.js +18 -23
  38. package/dist/helpers/evaluate-speed-kit-config.d.ts +1 -1
  39. package/dist/helpers/evaluate-speed-kit-config.js +42 -26
  40. package/dist/helpers/file-helper.js +8 -13
  41. package/dist/helpers/get-parsed-config.d.ts +1 -1
  42. package/dist/helpers/get-parsed-config.js +6 -10
  43. package/dist/helpers/html-format-helper.js +3 -6
  44. package/dist/helpers/is-directory.js +3 -6
  45. package/dist/helpers/is-file.js +3 -6
  46. package/dist/helpers/logging-helper.js +7 -13
  47. package/dist/helpers/normalize.js +10 -17
  48. package/dist/helpers/race.d.ts +1 -1
  49. package/dist/helpers/race.js +3 -9
  50. package/dist/helpers/safe.js +1 -4
  51. package/dist/helpers/scrape.d.ts +1 -1
  52. package/dist/helpers/scrape.js +3 -7
  53. package/dist/helpers/site-analyzer.js +5 -9
  54. package/dist/helpers/speed-kit-rule-to-reg-exp.js +1 -4
  55. package/dist/models/cli-parameters.d.ts +4 -4
  56. package/dist/models/cli-parameters.js +13 -16
  57. package/dist/models/files.js +1 -4
  58. package/dist/models/install.js +1 -2
  59. package/dist/models/os.js +1 -4
  60. package/dist/services/athena/athena-service-factory.d.ts +1 -1
  61. package/dist/services/athena/athena-service-factory.js +15 -19
  62. package/dist/services/athena/athena-service-model.js +2 -5
  63. package/dist/services/athena/athena-service.d.ts +1 -1
  64. package/dist/services/athena/athena-service.js +18 -23
  65. package/dist/services/athena/error/athena-query-error.d.ts +1 -1
  66. package/dist/services/athena/error/athena-query-error.js +2 -7
  67. package/dist/services/athena/error/fetch-credentials-error.d.ts +1 -1
  68. package/dist/services/athena/error/fetch-credentials-error.js +2 -7
  69. package/dist/services/athena/index.d.ts +4 -4
  70. package/dist/services/athena/index.js +4 -7
  71. package/dist/services/bundler/bundle-service-factory.d.ts +3 -1
  72. package/dist/services/bundler/bundle-service-factory.js +7 -7
  73. package/dist/services/bundler/bundle-service.d.ts +9 -12
  74. package/dist/services/bundler/bundle-service.js +42 -32
  75. package/dist/services/bundler/error/bundle-fetch-error.d.ts +1 -1
  76. package/dist/services/bundler/error/bundle-fetch-error.js +2 -7
  77. package/dist/services/bundler/error/bundle-resolve-error.d.ts +1 -1
  78. package/dist/services/bundler/error/bundle-resolve-error.js +2 -7
  79. package/dist/services/bundler/index.d.ts +2 -2
  80. package/dist/services/bundler/index.js +2 -5
  81. package/dist/services/cli/cli-service-factory.d.ts +2 -2
  82. package/dist/services/cli/cli-service-factory.js +6 -10
  83. package/dist/services/cli/cli-service-model.d.ts +21 -6
  84. package/dist/services/cli/cli-service-model.js +3 -7
  85. package/dist/services/cli/cli-service.d.ts +10 -8
  86. package/dist/services/cli/cli-service.js +64 -61
  87. package/dist/services/cli/error/cli-type-error.js +1 -4
  88. package/dist/services/cli/index.d.ts +3 -3
  89. package/dist/services/cli/index.js +3 -6
  90. package/dist/services/config-api/client.d.ts +2 -2
  91. package/dist/services/config-api/client.js +29 -34
  92. package/dist/services/config-api/config-api-factory.d.ts +2 -2
  93. package/dist/services/config-api/config-api-factory.js +15 -20
  94. package/dist/services/config-api/config-api-model.d.ts +2 -2
  95. package/dist/services/config-api/config-api-model.js +1 -5
  96. package/dist/services/config-api/config-api-service.d.ts +2 -2
  97. package/dist/services/config-api/config-api-service.js +1 -5
  98. package/dist/services/config-api/entity-manager-factory.js +3 -7
  99. package/dist/services/config-api/error/json-response-error.d.ts +1 -1
  100. package/dist/services/config-api/error/json-response-error.js +2 -7
  101. package/dist/services/config-api/error/login-error.d.ts +1 -1
  102. package/dist/services/config-api/error/login-error.js +2 -7
  103. package/dist/services/config-api/error/orestes-api-error.d.ts +1 -1
  104. package/dist/services/config-api/error/orestes-api-error.js +2 -7
  105. package/dist/services/config-api/index.d.ts +3 -3
  106. package/dist/services/config-api/index.js +3 -6
  107. package/dist/services/config-api-service.d.ts +1 -1
  108. package/dist/services/config-api-service.js +6 -11
  109. package/dist/services/customer-config/customer-config-service-context.js +3 -7
  110. package/dist/services/customer-config/customer-config-service-factory.d.ts +1 -1
  111. package/dist/services/customer-config/customer-config-service-factory.js +6 -10
  112. package/dist/services/customer-config/customer-config-service-model.js +6 -9
  113. package/dist/services/customer-config/customer-config-service.d.ts +3 -3
  114. package/dist/services/customer-config/customer-config-service.js +55 -55
  115. package/dist/services/customer-config/index.d.ts +4 -4
  116. package/dist/services/customer-config/index.js +4 -7
  117. package/dist/services/deploy/builder/install-resource-builder.d.ts +2 -2
  118. package/dist/services/deploy/builder/install-resource-builder.js +3 -7
  119. package/dist/services/deploy/checks/post-deploy/deprecated-deployment-detection-check.d.ts +4 -4
  120. package/dist/services/deploy/checks/post-deploy/deprecated-deployment-detection-check.js +19 -24
  121. package/dist/services/deploy/checks/post-deploy/revalidated-module-check.d.ts +3 -3
  122. package/dist/services/deploy/checks/post-deploy/revalidated-module-check.js +10 -14
  123. package/dist/services/deploy/checks/post-deploy/save-files-check.d.ts +3 -3
  124. package/dist/services/deploy/checks/post-deploy/save-files-check.js +8 -12
  125. package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.d.ts +3 -3
  126. package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +14 -20
  127. package/dist/services/deploy/checks/pre-deploy/split-change-check.d.ts +3 -3
  128. package/dist/services/deploy/checks/pre-deploy/split-change-check.js +19 -20
  129. package/dist/services/deploy/context/deploy-context.d.ts +2 -2
  130. package/dist/services/deploy/context/deploy-context.js +10 -14
  131. package/dist/services/deploy/deploy-service-factory.d.ts +3 -3
  132. package/dist/services/deploy/deploy-service-factory.js +36 -40
  133. package/dist/services/deploy/deploy-service-model.d.ts +10 -10
  134. package/dist/services/deploy/deploy-service-model.js +1 -2
  135. package/dist/services/deploy/deploy-service.d.ts +4 -4
  136. package/dist/services/deploy/deploy-service.js +10 -15
  137. package/dist/services/deploy/error/check-module-file-error.d.ts +1 -1
  138. package/dist/services/deploy/error/check-module-file-error.js +2 -7
  139. package/dist/services/deploy/error/deploy-install-resource-error.d.ts +1 -1
  140. package/dist/services/deploy/error/deploy-install-resource-error.js +2 -7
  141. package/dist/services/deploy/error/deploy-module-file-error.d.ts +1 -1
  142. package/dist/services/deploy/error/deploy-module-file-error.js +2 -7
  143. package/dist/services/deploy/error/deploy-server-config-error.d.ts +1 -1
  144. package/dist/services/deploy/error/deploy-server-config-error.js +2 -7
  145. package/dist/services/deploy/error/evaluate-sk-config-error.d.ts +1 -1
  146. package/dist/services/deploy/error/evaluate-sk-config-error.js +2 -7
  147. package/dist/services/deploy/error/file-handler-error.d.ts +1 -1
  148. package/dist/services/deploy/error/file-handler-error.js +2 -7
  149. package/dist/services/deploy/error/post-deploy-deployment-detection-error.d.ts +1 -1
  150. package/dist/services/deploy/error/post-deploy-deployment-detection-error.js +2 -7
  151. package/dist/services/deploy/error/safe-file-error.d.ts +1 -1
  152. package/dist/services/deploy/error/safe-file-error.js +2 -7
  153. package/dist/services/deploy/handler/customer-config-handler.d.ts +6 -6
  154. package/dist/services/deploy/handler/customer-config-handler.js +7 -12
  155. package/dist/services/deploy/handler/install-resource-handler.d.ts +7 -7
  156. package/dist/services/deploy/handler/install-resource-handler.js +22 -27
  157. package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.d.ts +4 -4
  158. package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.js +1 -4
  159. package/dist/services/deploy/handler/module-handler.d.ts +6 -6
  160. package/dist/services/deploy/handler/module-handler.js +12 -18
  161. package/dist/services/deploy/handler/server-config-handler.d.ts +5 -5
  162. package/dist/services/deploy/handler/server-config-handler.js +10 -14
  163. package/dist/services/deploy/interface/deploy-handler-interface.d.ts +1 -1
  164. package/dist/services/deploy/interface/deploy-handler-interface.js +1 -2
  165. package/dist/services/deploy/interface/install-configs.js +1 -2
  166. package/dist/services/deploy/interface/install-resource-processor-interface.d.ts +1 -1
  167. package/dist/services/deploy/interface/install-resource-processor-interface.js +1 -2
  168. package/dist/services/deploy/interface/install.d.ts +1 -1
  169. package/dist/services/deploy/interface/install.js +1 -2
  170. package/dist/services/deploy/interface/runtime-modifier.d.ts +1 -1
  171. package/dist/services/deploy/interface/runtime-modifier.js +1 -2
  172. package/dist/services/deploy/interface/validate-origins-response.js +1 -2
  173. package/dist/services/diff/diff-model.js +1 -5
  174. package/dist/services/diff/diff-service-factory.d.ts +1 -1
  175. package/dist/services/diff/diff-service-factory.js +6 -10
  176. package/dist/services/diff/diff-service.d.ts +1 -1
  177. package/dist/services/diff/diff-service.js +19 -24
  178. package/dist/services/diff/index.d.ts +3 -3
  179. package/dist/services/diff/index.js +3 -6
  180. package/dist/services/diff-service.d.ts +1 -1
  181. package/dist/services/diff-service.js +16 -21
  182. package/dist/services/document-handler-runtime/context/document-handler-runtime-context.js +30 -34
  183. package/dist/services/document-handler-runtime/document-handler-runtime-service.d.ts +3 -3
  184. package/dist/services/document-handler-runtime/document-handler-runtime-service.js +38 -42
  185. package/dist/services/document-handler-runtime/document-handler-server.d.ts +7 -11
  186. package/dist/services/document-handler-runtime/document-handler-server.js +77 -59
  187. package/dist/services/document-handler-runtime/error/required-file-not-found-error.js +1 -4
  188. package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +5 -5
  189. package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +42 -46
  190. package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.js +1 -4
  191. package/dist/services/document-handler-runtime/interface/template-context-interface.d.ts +2 -3
  192. package/dist/services/document-handler-runtime/interface/template-context-interface.js +1 -2
  193. package/dist/services/document-handler-runtime/interface/template-interface.d.ts +2 -2
  194. package/dist/services/document-handler-runtime/interface/template-interface.js +1 -2
  195. package/dist/services/document-handler-runtime/interface/template-parameter-interface.js +1 -2
  196. package/dist/services/document-handler-runtime/server/document-handler-response.d.ts +1 -3
  197. package/dist/services/document-handler-runtime/server/document-handler-response.js +1 -5
  198. package/dist/services/document-handler-runtime/server/request.d.ts +4 -10
  199. package/dist/services/document-handler-runtime/server/request.js +1 -5
  200. package/dist/services/document-handler-runtime/templates/abstract-template.d.ts +3 -3
  201. package/dist/services/document-handler-runtime/templates/abstract-template.js +3 -7
  202. package/dist/services/document-handler-runtime/templates/database-mock.d.ts +2 -2
  203. package/dist/services/document-handler-runtime/templates/database-mock.js +2 -6
  204. package/dist/services/document-handler-runtime/templates/execute-document-handler.d.ts +2 -2
  205. package/dist/services/document-handler-runtime/templates/execute-document-handler.js +2 -6
  206. package/dist/services/document-handler-runtime/templates/orestes-mock.d.ts +2 -2
  207. package/dist/services/document-handler-runtime/templates/orestes-mock.js +2 -6
  208. package/dist/services/document-handler-runtime/templates/package-json.d.ts +3 -5
  209. package/dist/services/document-handler-runtime/templates/package-json.js +2 -6
  210. package/dist/services/document-handler-runtime/templates/test.d.ts +2 -2
  211. package/dist/services/document-handler-runtime/templates/test.js +2 -6
  212. package/dist/services/error-handling/error/application-error.d.ts +1 -1
  213. package/dist/services/error-handling/error/application-error.js +1 -5
  214. package/dist/services/error-handling/error/config-file-error.d.ts +1 -1
  215. package/dist/services/error-handling/error/config-file-error.js +2 -7
  216. package/dist/services/error-handling/error/connection-error.d.ts +1 -1
  217. package/dist/services/error-handling/error/connection-error.js +2 -7
  218. package/dist/services/integration-api/error/customer-config-error.d.ts +1 -1
  219. package/dist/services/integration-api/error/customer-config-error.js +2 -5
  220. package/dist/services/integration-api/error/customer-config-legacy-error.d.ts +1 -1
  221. package/dist/services/integration-api/error/customer-config-legacy-error.js +2 -6
  222. package/dist/services/integration-api/error/invalid-config-format-error.d.ts +1 -1
  223. package/dist/services/integration-api/error/invalid-config-format-error.js +4 -7
  224. package/dist/services/integration-api/error/mandatory-file-missing-error.d.ts +1 -1
  225. package/dist/services/integration-api/error/mandatory-file-missing-error.js +2 -6
  226. package/dist/services/integration-api/error/origin-error.d.ts +1 -1
  227. package/dist/services/integration-api/error/origin-error.js +2 -5
  228. package/dist/services/integration-api/error/read-files-error.d.ts +1 -1
  229. package/dist/services/integration-api/error/read-files-error.js +2 -7
  230. package/dist/services/integration-api/external/external-file-reader.d.ts +1 -1
  231. package/dist/services/integration-api/external/external-file-reader.js +9 -14
  232. package/dist/services/integration-api/file-list.d.ts +1 -1
  233. package/dist/services/integration-api/file-list.js +8 -11
  234. package/dist/services/integration-api/file-reader.js +11 -15
  235. package/dist/services/integration-api/file-writer.js +4 -8
  236. package/dist/services/integration-api/handler/customer-config-handler.d.ts +5 -5
  237. package/dist/services/integration-api/handler/customer-config-handler.js +17 -21
  238. package/dist/services/integration-api/handler/file-handler.d.ts +2 -2
  239. package/dist/services/integration-api/handler/file-handler.js +1 -4
  240. package/dist/services/integration-api/handler/install-resource-handler.d.ts +2 -2
  241. package/dist/services/integration-api/handler/install-resource-handler.js +6 -10
  242. package/dist/services/integration-api/handler/module-handler.d.ts +2 -2
  243. package/dist/services/integration-api/handler/module-handler.js +4 -8
  244. package/dist/services/integration-api/handler/server-config-handler.d.ts +2 -2
  245. package/dist/services/integration-api/handler/server-config-handler.js +4 -8
  246. package/dist/services/integration-api/index.d.ts +3 -3
  247. package/dist/services/integration-api/index.js +3 -6
  248. package/dist/services/integration-api/integration-api-factory.d.ts +3 -3
  249. package/dist/services/integration-api/integration-api-factory.js +23 -28
  250. package/dist/services/integration-api/integration-api-model.d.ts +17 -19
  251. package/dist/services/integration-api/integration-api-model.js +16 -21
  252. package/dist/services/integration-api/integration-api-service.d.ts +5 -5
  253. package/dist/services/integration-api/integration-api-service.js +6 -12
  254. package/dist/services/integration-api/spec/customer-config-validator.spec.js +29 -32
  255. package/dist/services/integration-api/spec/file-list.spec.js +107 -110
  256. package/dist/services/integration-api/spec/file-reader.spec.js +27 -30
  257. package/dist/services/integration-api/spec/file-writer.spec.js +34 -37
  258. package/dist/services/integration-api/spec/integration-api-service.spec.js +42 -45
  259. package/dist/services/integration-api/spec/mandatory-files-validator.spec.js +48 -51
  260. package/dist/services/integration-api/struct/customer-config-file.d.ts +1 -1
  261. package/dist/services/integration-api/struct/customer-config-file.js +10 -15
  262. package/dist/services/integration-api/struct/customer-config.d.ts +4 -8
  263. package/dist/services/integration-api/struct/customer-config.js +5 -10
  264. package/dist/services/integration-api/struct/file.d.ts +1 -1
  265. package/dist/services/integration-api/struct/file.js +9 -13
  266. package/dist/services/integration-api/struct/install-resource-file.d.ts +2 -2
  267. package/dist/services/integration-api/struct/install-resource-file.js +4 -8
  268. package/dist/services/integration-api/struct/module-file.d.ts +2 -2
  269. package/dist/services/integration-api/struct/module-file.js +4 -8
  270. package/dist/services/integration-api/struct/ro-file.d.ts +1 -1
  271. package/dist/services/integration-api/struct/ro-file.js +1 -5
  272. package/dist/services/integration-api/struct/server-config-file.d.ts +2 -2
  273. package/dist/services/integration-api/struct/server-config-file.js +4 -8
  274. package/dist/services/integration-api/struct/virtual-file.d.ts +1 -1
  275. package/dist/services/integration-api/struct/virtual-file.js +3 -7
  276. package/dist/services/integration-api/validator/customer-config-validator.d.ts +1 -1
  277. package/dist/services/integration-api/validator/customer-config-validator.js +8 -12
  278. package/dist/services/integration-api/validator/mandatory-files-validator.d.ts +2 -2
  279. package/dist/services/integration-api/validator/mandatory-files-validator.js +4 -8
  280. package/dist/services/integration-api/virtual/external-recipe.d.ts +2 -2
  281. package/dist/services/integration-api/virtual/external-recipe.js +1 -5
  282. package/dist/services/integration-api/virtual/static-recipe.d.ts +1 -1
  283. package/dist/services/integration-api/virtual/static-recipe.js +1 -5
  284. package/dist/services/integration-api/virtual/virtual-file-handler.d.ts +2 -2
  285. package/dist/services/integration-api/virtual/virtual-file-handler.js +8 -13
  286. package/dist/services/onboarding/browser/abort-response.js +1 -5
  287. package/dist/services/onboarding/browser/baqend-response.d.ts +1 -1
  288. package/dist/services/onboarding/browser/baqend-response.js +1 -5
  289. package/dist/services/onboarding/browser/config/browser-config.d.ts +1 -1
  290. package/dist/services/onboarding/browser/config/browser-config.js +15 -20
  291. package/dist/services/onboarding/browser/executable/executable-validator.d.ts +2 -2
  292. package/dist/services/onboarding/browser/executable/executable-validator.js +12 -17
  293. package/dist/services/onboarding/browser/extension/devtools-extension-api.d.ts +1 -1
  294. package/dist/services/onboarding/browser/extension/devtools-extension-api.js +1 -5
  295. package/dist/services/onboarding/browser/extension/extension-downloader.d.ts +2 -2
  296. package/dist/services/onboarding/browser/extension/extension-downloader.js +24 -30
  297. package/dist/services/onboarding/browser/extension/extension-validator.d.ts +3 -3
  298. package/dist/services/onboarding/browser/extension/extension-validator.js +18 -23
  299. package/dist/services/onboarding/browser/origin-response.d.ts +1 -1
  300. package/dist/services/onboarding/browser/origin-response.js +1 -5
  301. package/dist/services/onboarding/config-renderer/install-file-recipe.d.ts +2 -2
  302. package/dist/services/onboarding/config-renderer/install-file-recipe.js +1 -5
  303. package/dist/services/onboarding/config-renderer/speed-kit-install-context.d.ts +3 -3
  304. package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +8 -11
  305. package/dist/services/onboarding/dashboard/diff-against-current-page.d.ts +4 -4
  306. package/dist/services/onboarding/dashboard/diff-against-current-page.js +9 -14
  307. package/dist/services/onboarding/dashboard/index.d.ts +7 -7
  308. package/dist/services/onboarding/dashboard/index.js +8 -13
  309. package/dist/services/onboarding/dashboard/parameter-query-builder.d.ts +1 -1
  310. package/dist/services/onboarding/dashboard/parameter-query-builder.js +9 -13
  311. package/dist/services/onboarding/dashboard/request-diff-service.d.ts +3 -3
  312. package/dist/services/onboarding/dashboard/request-diff-service.js +14 -19
  313. package/dist/services/onboarding/error/browser-extension-error.d.ts +1 -1
  314. package/dist/services/onboarding/error/browser-extension-error.js +1 -5
  315. package/dist/services/onboarding/error/document-handler-transform-error.js +1 -5
  316. package/dist/services/onboarding/error/unsupported-encoding-error.d.ts +1 -1
  317. package/dist/services/onboarding/error/unsupported-encoding-error.js +2 -7
  318. package/dist/services/onboarding/error/validate-extension-error.d.ts +1 -1
  319. package/dist/services/onboarding/error/validate-extension-error.js +2 -7
  320. package/dist/services/onboarding/error/vm-empty-response-error.d.ts +1 -1
  321. package/dist/services/onboarding/error/vm-empty-response-error.js +2 -7
  322. package/dist/services/onboarding/error/vm-error.d.ts +1 -1
  323. package/dist/services/onboarding/error/vm-error.js +2 -7
  324. package/dist/services/onboarding/fetch-event-handler.d.ts +4 -4
  325. package/dist/services/onboarding/fetch-event-handler.js +19 -25
  326. package/dist/services/onboarding/fetch-events/customer-domain-document-response.d.ts +4 -4
  327. package/dist/services/onboarding/fetch-events/customer-domain-document-response.js +15 -20
  328. package/dist/services/onboarding/fetch-events/customer-service-worker-js.d.ts +3 -3
  329. package/dist/services/onboarding/fetch-events/customer-service-worker-js.js +4 -8
  330. package/dist/services/onboarding/fetch-events/dashboard-request.d.ts +3 -3
  331. package/dist/services/onboarding/fetch-events/dashboard-request.js +1 -5
  332. package/dist/services/onboarding/fetch-events/speed-kit-asset-request.d.ts +5 -5
  333. package/dist/services/onboarding/fetch-events/speed-kit-asset-request.js +1 -5
  334. package/dist/services/onboarding/fetch-events/speed-kit-install-html.d.ts +4 -4
  335. package/dist/services/onboarding/fetch-events/speed-kit-install-html.js +3 -7
  336. package/dist/services/onboarding/fetch-events/speed-kit-install-js.d.ts +5 -5
  337. package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +7 -11
  338. package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +6 -6
  339. package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.js +4 -8
  340. package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +3 -3
  341. package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.js +3 -7
  342. package/dist/services/onboarding/file-events/file-watcher.d.ts +5 -5
  343. package/dist/services/onboarding/file-events/file-watcher.js +24 -28
  344. package/dist/services/onboarding/index.d.ts +3 -3
  345. package/dist/services/onboarding/index.js +3 -8
  346. package/dist/services/onboarding/onboarding-model.d.ts +21 -23
  347. package/dist/services/onboarding/onboarding-model.js +22 -27
  348. package/dist/services/onboarding/onboarding-service-factory.d.ts +3 -3
  349. package/dist/services/onboarding/onboarding-service-factory.js +102 -108
  350. package/dist/services/onboarding/onboarding-service.d.ts +6 -6
  351. package/dist/services/onboarding/onboarding-service.js +12 -18
  352. package/dist/services/onboarding/request-cache/cache.d.ts +3 -3
  353. package/dist/services/onboarding/request-cache/cache.js +1 -5
  354. package/dist/services/onboarding/server-config/index.d.ts +3 -3
  355. package/dist/services/onboarding/server-config/index.js +6 -11
  356. package/dist/services/onboarding/templates/install-speed-kit-html-template.d.ts +1 -1
  357. package/dist/services/onboarding/templates/install-speed-kit-html-template.js +2 -7
  358. package/dist/services/onboarding/templates/install-speed-kit-js-template.d.ts +1 -1
  359. package/dist/services/onboarding/templates/install-speed-kit-js-template.js +2 -7
  360. package/dist/services/onboarding/todo-collector.d.ts +3 -3
  361. package/dist/services/onboarding/todo-collector.js +3 -7
  362. package/dist/services/onboarding/virtual-orestes-app/crawler.d.ts +2 -2
  363. package/dist/services/onboarding/virtual-orestes-app/crawler.js +12 -16
  364. package/dist/services/onboarding/virtual-orestes-app/index.d.ts +7 -7
  365. package/dist/services/onboarding/virtual-orestes-app/index.js +25 -32
  366. package/dist/services/pop-config/index.d.ts +3 -3
  367. package/dist/services/pop-config/index.js +3 -6
  368. package/dist/services/pop-config/pop-config-factory.d.ts +1 -1
  369. package/dist/services/pop-config/pop-config-factory.js +5 -9
  370. package/dist/services/pop-config/pop-config-model.d.ts +2 -2
  371. package/dist/services/pop-config/pop-config-model.js +1 -2
  372. package/dist/services/pop-config/pop-config-service.d.ts +2 -2
  373. package/dist/services/pop-config/pop-config-service.js +1 -5
  374. package/dist/services/prewarm/assets/asset-api-client.d.ts +2 -2
  375. package/dist/services/prewarm/assets/asset-api-client.js +18 -23
  376. package/dist/services/prewarm/assets/asset-item.d.ts +1 -1
  377. package/dist/services/prewarm/assets/asset-item.js +6 -10
  378. package/dist/services/prewarm/assets/asset-list.d.ts +2 -2
  379. package/dist/services/prewarm/assets/asset-list.js +6 -10
  380. package/dist/services/prewarm/csv-reader.js +6 -11
  381. package/dist/services/prewarm/error/invalid-origin-error.d.ts +1 -1
  382. package/dist/services/prewarm/error/invalid-origin-error.js +2 -7
  383. package/dist/services/prewarm/error/read-csv-error.d.ts +1 -1
  384. package/dist/services/prewarm/error/read-csv-error.js +2 -7
  385. package/dist/services/prewarm/index.d.ts +3 -3
  386. package/dist/services/prewarm/index.js +3 -6
  387. package/dist/services/prewarm/pre-warm-factory.d.ts +1 -1
  388. package/dist/services/prewarm/pre-warm-factory.js +13 -17
  389. package/dist/services/prewarm/pre-warm-model.js +16 -20
  390. package/dist/services/prewarm/pre-warm-service.d.ts +3 -3
  391. package/dist/services/prewarm/pre-warm-service.js +18 -22
  392. package/dist/services/pull/index.d.ts +3 -3
  393. package/dist/services/pull/index.js +3 -6
  394. package/dist/services/pull/pull-service-factory.d.ts +2 -2
  395. package/dist/services/pull/pull-service-factory.js +12 -16
  396. package/dist/services/pull/pull-service-model.js +4 -9
  397. package/dist/services/pull/pull-service.d.ts +3 -3
  398. package/dist/services/pull/pull-service.js +14 -19
  399. package/dist/services/query-builder/error/parse-config-speed-kit-error.d.ts +1 -1
  400. package/dist/services/query-builder/error/parse-config-speed-kit-error.js +2 -6
  401. package/dist/services/query-builder/query/parameter.js +1 -5
  402. package/dist/services/query-builder/query/prewarm.js +1 -5
  403. package/dist/services/query-builder/query-builder-factory.d.ts +3 -3
  404. package/dist/services/query-builder/query-builder-factory.js +16 -20
  405. package/dist/services/query-builder/query-builder-model.d.ts +6 -6
  406. package/dist/services/query-builder/query-builder-model.js +2 -5
  407. package/dist/services/query-builder/query-builder-service.d.ts +2 -2
  408. package/dist/services/query-builder/query-builder-service.js +24 -30
  409. package/oclif.manifest.json +15 -15
  410. package/package.json +63 -54
  411. package/dist/dummy.spec.d.ts +0 -1
  412. package/dist/dummy.spec.js +0 -18
@@ -1,33 +1,30 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PreWarmFactory = void 0;
4
- const cli_1 = require("../cli");
5
- const _1 = require("./");
6
- const asset_api_client_1 = require("./assets/asset-api-client");
7
- const csv_reader_1 = require("./csv-reader");
8
- const config_api_1 = require("../config-api");
9
- class PreWarmFactory {
1
+ import { CliContext, CliServiceFactory } from "../cli/index.js";
2
+ import { DEFAULT_VARIATION, PreWarmService, VARIATION_SEPARATOR, } from "./index.js";
3
+ import { AssetApiClient } from "./assets/asset-api-client.js";
4
+ import { CsvReader } from "./csv-reader.js";
5
+ import { ConfigApiContext, ConfigApiServiceFactory, } from "../config-api/index.js";
6
+ export class PreWarmFactory {
10
7
  context;
11
8
  constructor(context) {
12
9
  this.context = context;
13
10
  }
14
11
  async getService() {
15
- const cli = new cli_1.CliServiceFactory(new cli_1.CliContext(this.context.quiet)).getService();
16
- const configApi = new config_api_1.ConfigApiServiceFactory(new config_api_1.ConfigApiContext(this.context.app)).getService();
12
+ const cli = new CliServiceFactory(new CliContext(this.context.quiet)).getService();
13
+ const configApi = new ConfigApiServiceFactory(new ConfigApiContext(this.context.app)).getService();
17
14
  const entityManager = await configApi.client.getEntityManager();
18
- const csvReader = new csv_reader_1.CsvReader();
19
- const assetApiClient = new asset_api_client_1.AssetApiClient(entityManager.token, this.context.app, this.context.keepParameterSorting);
15
+ const csvReader = new CsvReader();
16
+ const assetApiClient = new AssetApiClient(entityManager.token, this.context.app, this.context.keepParameterSorting);
20
17
  const urls = this.getUrls(csvReader);
21
18
  const variations = this.getVariations(csvReader);
22
- return new _1.PreWarmService(assetApiClient, cli, urls, variations, this.context.verbose);
19
+ return new PreWarmService(assetApiClient, cli, urls, variations, this.context.verbose);
23
20
  }
24
21
  getUrls(csvReader) {
25
22
  return csvReader.readPath(this.context.path);
26
23
  }
27
24
  getVariations(csvReader) {
28
- let variations = _1.DEFAULT_VARIATION;
25
+ let variations = DEFAULT_VARIATION;
29
26
  if (this.context.variation) {
30
- variations = this.context.variation.split(_1.VARIATION_SEPARATOR);
27
+ variations = this.context.variation.split(VARIATION_SEPARATOR);
31
28
  }
32
29
  if (this.context.variationPath) {
33
30
  variations = csvReader.readPath(this.context.variationPath);
@@ -35,4 +32,3 @@ class PreWarmFactory {
35
32
  return variations;
36
33
  }
37
34
  }
38
- exports.PreWarmFactory = PreWarmFactory;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_VARIATIONS = exports.DEFAULT_VARIATION = exports.VARIATION_SEPARATOR = exports.PROGRESS_BAR_FORMAT = exports.TIMING_HEADER_KEY = exports.TIMING_HEADER_ERROR_CODE_SELECTOR = exports.RATE_LIMIT_CODES = exports.RATE_LIMIT_MULTIPLICATOR = exports.MAX_REQUESTS_PER_SECOND = exports.DEFAULT_REQUESTS_PER_SECOND = exports.TIMOUT_AFTER_DETECTED_RATE_LIMIT = exports.FETCH_TIMEOUT = exports.MIN_TIME_TO_FETCH_BATCH = exports.ItemStatus = exports.PreWarmContext = void 0;
4
- class PreWarmContext {
1
+ export class PreWarmContext {
5
2
  app;
6
3
  path;
7
4
  variation;
@@ -19,25 +16,24 @@ class PreWarmContext {
19
16
  this.verbose = verbose;
20
17
  }
21
18
  }
22
- exports.PreWarmContext = PreWarmContext;
23
- var ItemStatus;
19
+ export var ItemStatus;
24
20
  (function (ItemStatus) {
25
21
  ItemStatus["DONE"] = "done";
26
22
  ItemStatus["ERROR"] = "error";
27
23
  ItemStatus["NEW"] = "new";
28
24
  ItemStatus["RETRY"] = "retry";
29
- })(ItemStatus || (exports.ItemStatus = ItemStatus = {}));
30
- exports.MIN_TIME_TO_FETCH_BATCH = 1000;
31
- exports.FETCH_TIMEOUT = 10_000;
32
- exports.TIMOUT_AFTER_DETECTED_RATE_LIMIT = 5000;
33
- exports.DEFAULT_REQUESTS_PER_SECOND = 10;
34
- exports.MAX_REQUESTS_PER_SECOND = 20;
35
- exports.RATE_LIMIT_MULTIPLICATOR = 0.8;
25
+ })(ItemStatus || (ItemStatus = {}));
26
+ export const MIN_TIME_TO_FETCH_BATCH = 1000;
27
+ export const FETCH_TIMEOUT = 10_000;
28
+ export const TIMOUT_AFTER_DETECTED_RATE_LIMIT = 5000;
29
+ export const DEFAULT_REQUESTS_PER_SECOND = 10;
30
+ export const MAX_REQUESTS_PER_SECOND = 20;
31
+ export const RATE_LIMIT_MULTIPLICATOR = 0.8;
36
32
  // we also use some codes that indicate some server overloads
37
- exports.RATE_LIMIT_CODES = ["306", "308", "310", "311", "314", "316"];
38
- exports.TIMING_HEADER_ERROR_CODE_SELECTOR = /errorcode;desc=([^,]*),/;
39
- exports.TIMING_HEADER_KEY = "server-timing";
40
- exports.PROGRESS_BAR_FORMAT = "[{bar}] {percentage}% | ETA: {eta_formatted}s | {value}/{total} | error:{errors} | rate: {rate} | retry: {retry} | batchDur: {batchDuration}";
41
- exports.VARIATION_SEPARATOR = ",";
42
- exports.DEFAULT_VARIATION = ["default"];
43
- exports.DEFAULT_VARIATIONS = ["mobile", "tablet", "tv"];
33
+ export const RATE_LIMIT_CODES = ["306", "308", "310", "311", "314", "316"];
34
+ export const TIMING_HEADER_ERROR_CODE_SELECTOR = /errorcode;desc=([^,]*),/;
35
+ export const TIMING_HEADER_KEY = "server-timing";
36
+ export const PROGRESS_BAR_FORMAT = "[{bar}] {percentage}% | ETA: {eta_formatted}s | {value}/{total} | error:{errors} | rate: {rate} | retry: {retry} | batchDur: {batchDuration}";
37
+ export const VARIATION_SEPARATOR = ",";
38
+ export const DEFAULT_VARIATION = ["default"];
39
+ export const DEFAULT_VARIATIONS = ["mobile", "tablet", "tv"];
@@ -1,6 +1,6 @@
1
- import { CliServiceInterface } from "../cli";
2
- import { AssetItemInterface } from "./";
3
- import { AssetApiClient } from "./assets/asset-api-client";
1
+ import { CliServiceInterface } from "../cli/index.js";
2
+ import { AssetItemInterface } from "./index.js";
3
+ import { AssetApiClient } from "./assets/asset-api-client.js";
4
4
  export declare class PreWarmService {
5
5
  private assetClient;
6
6
  private cli;
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PreWarmService = void 0;
4
- const safe_1 = require("../../helpers/safe");
5
- const _1 = require("./");
6
- const asset_item_1 = require("./assets/asset-item");
7
- const asset_list_1 = require("./assets/asset-list");
8
- class PreWarmService {
1
+ import { safe } from "../../helpers/safe.js";
2
+ import { ItemStatus, PROGRESS_BAR_FORMAT, RATE_LIMIT_CODES, TIMING_HEADER_ERROR_CODE_SELECTOR, TIMING_HEADER_KEY, } from "./index.js";
3
+ import { AssetItem } from "./assets/asset-item.js";
4
+ import { AssetList } from "./assets/asset-list.js";
5
+ export class PreWarmService {
9
6
  assetClient;
10
7
  cli;
11
8
  urls;
@@ -20,7 +17,7 @@ class PreWarmService {
20
17
  this.verbose = verbose;
21
18
  }
22
19
  async handleAsset(assetClient, entry) {
23
- const fetchUrlResponse = await (0, safe_1.safe)(assetClient.fetchURL(entry.url, entry.variation, this.verbose));
20
+ const fetchUrlResponse = await safe(assetClient.fetchURL(entry.url, entry.variation, this.verbose));
24
21
  // a generic error occurred
25
22
  if (fetchUrlResponse.success === false) {
26
23
  entry.failed();
@@ -34,16 +31,16 @@ class PreWarmService {
34
31
  return;
35
32
  }
36
33
  // got undefined errorCode
37
- if (!response.headers.has(_1.TIMING_HEADER_KEY) ||
38
- !response.headers.get(_1.TIMING_HEADER_KEY)?.includes("error")) {
34
+ if (!response.headers.has(TIMING_HEADER_KEY) ||
35
+ !response.headers.get(TIMING_HEADER_KEY)?.includes("error")) {
39
36
  entry.failed();
40
37
  entry.setError(new Error(`status: ${response.status}`));
41
38
  }
42
39
  // get errorCode from server-timing-header
43
- const serverTiming = response.headers.get(_1.TIMING_HEADER_KEY);
44
- const [, serverTimingErrorCode] = serverTiming.match(_1.TIMING_HEADER_ERROR_CODE_SELECTOR) || ["", "-"];
40
+ const serverTiming = response.headers.get(TIMING_HEADER_KEY);
41
+ const [, serverTimingErrorCode] = serverTiming.match(TIMING_HEADER_ERROR_CODE_SELECTOR) || ["", "-"];
45
42
  // rateLimiter detected, retry
46
- if (_1.RATE_LIMIT_CODES.some((code) => serverTimingErrorCode.includes(code))) {
43
+ if (RATE_LIMIT_CODES.some((code) => serverTimingErrorCode.includes(code))) {
47
44
  entry.retry();
48
45
  return;
49
46
  }
@@ -62,7 +59,7 @@ class PreWarmService {
62
59
  // reset for minimal output
63
60
  this.requestsSend = 0;
64
61
  const urlsToRetry = assetList
65
- .getByStatus(_1.ItemStatus.RETRY)
62
+ .getByStatus(ItemStatus.RETRY)
66
63
  .map((entry) => entry.url);
67
64
  const retryList = this.generateAssetRequestList(urlsToRetry);
68
65
  this.assetClient.setIsRetry();
@@ -82,7 +79,7 @@ class PreWarmService {
82
79
  break;
83
80
  }
84
81
  await this.handleAsset(this.assetClient, value);
85
- if (this.verbose && value.status !== _1.ItemStatus.DONE) {
82
+ if (this.verbose && value.status !== ItemStatus.DONE) {
86
83
  this.cli.write(`${value.toString()}\n`);
87
84
  }
88
85
  completed++;
@@ -113,10 +110,10 @@ class PreWarmService {
113
110
  this.stopProgressBar();
114
111
  }
115
112
  generateAssetRequestList(urls) {
116
- const assetList = new asset_list_1.AssetList();
113
+ const assetList = new AssetList();
117
114
  for (const variation of this.variations) {
118
115
  for (const url of urls) {
119
- assetList.addItem(new asset_item_1.AssetItem(url, variation));
116
+ assetList.addItem(new AssetItem(url, variation));
120
117
  }
121
118
  }
122
119
  return assetList;
@@ -131,7 +128,7 @@ class PreWarmService {
131
128
  succeed: {},
132
129
  });
133
130
  if (await this.cli.confirm("show errors?", true)) {
134
- const elements = assetList.getByStatus(_1.ItemStatus.ERROR);
131
+ const elements = assetList.getByStatus(ItemStatus.ERROR);
135
132
  this.cli.table(elements.map((element) => {
136
133
  return { ...element };
137
134
  }), {
@@ -150,7 +147,7 @@ class PreWarmService {
150
147
  rate: this.assetClient.getRateLimit(),
151
148
  retry: 0,
152
149
  batchDuration: "-",
153
- }, { format: _1.PROGRESS_BAR_FORMAT, linewrap: !!this.verbose });
150
+ }, { format: PROGRESS_BAR_FORMAT, linewrap: !!this.verbose });
154
151
  }
155
152
  stopProgressBar() {
156
153
  this.cli.stopProgress();
@@ -164,7 +161,7 @@ class PreWarmService {
164
161
  });
165
162
  }
166
163
  updateRateLimit(batch) {
167
- const retryCount = batch.filter((entry) => entry.status === _1.ItemStatus.RETRY).length;
164
+ const retryCount = batch.filter((entry) => entry.status === ItemStatus.RETRY).length;
168
165
  // found rateLimiterResponse wait and reduce rateLimit
169
166
  if (retryCount > 0) {
170
167
  this.assetClient.reduceMaxRequestsPerSecond();
@@ -185,4 +182,3 @@ class PreWarmService {
185
182
  this.cli.write(this.cli.style.gray(`${this.requestsSend}/${assetLength} | rate: ${currentRate} | success: ${success} | retry: ${retry} | errors: ${errors}`));
186
183
  }
187
184
  }
188
- exports.PreWarmService = PreWarmService;
@@ -1,3 +1,3 @@
1
- export * from "./pull-service-model";
2
- export * from "./pull-service-factory";
3
- export * from "./pull-service";
1
+ export * from "./pull-service-model.js";
2
+ export * from "./pull-service-factory.js";
3
+ export * from "./pull-service.js";
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./pull-service-model"), exports);
5
- tslib_1.__exportStar(require("./pull-service-factory"), exports);
6
- tslib_1.__exportStar(require("./pull-service"), exports);
1
+ export * from "./pull-service-model.js";
2
+ export * from "./pull-service-factory.js";
3
+ export * from "./pull-service.js";
@@ -1,5 +1,5 @@
1
- import { PullContext, PullService } from "./";
2
- import { UserCliConfig } from "../../helpers/cli-config";
1
+ import { PullContext, PullService } from "./index.js";
2
+ import { UserCliConfig } from "../../helpers/cli-config.js";
3
3
  export declare class PullServiceFactory {
4
4
  private readonly context;
5
5
  private userConfig;
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PullServiceFactory = void 0;
4
- const integration_api_1 = require("../integration-api");
5
- const cli_1 = require("../cli");
6
- const _1 = require("./");
7
- const config_api_1 = require("../config-api");
8
- class PullServiceFactory {
1
+ import { IntegrationApiContext, IntegrationApiFactory, } from "../integration-api/index.js";
2
+ import { CliServiceFactory } from "../cli/index.js";
3
+ import { PullService } from "./index.js";
4
+ import { ConfigApiContext, ConfigApiServiceFactory, } from "../config-api/index.js";
5
+ export class PullServiceFactory {
9
6
  context;
10
7
  userConfig;
11
8
  service = undefined;
@@ -15,7 +12,7 @@ class PullServiceFactory {
15
12
  this.context = context;
16
13
  }
17
14
  async buildService() {
18
- if (!(this.service instanceof _1.PullService)) {
15
+ if (!(this.service instanceof PullService)) {
19
16
  await this.build();
20
17
  }
21
18
  return this.service;
@@ -25,17 +22,16 @@ class PullServiceFactory {
25
22
  const customer = files.getCustomerConfig().config;
26
23
  const configName = customer.name || this.context.configName;
27
24
  const configApi = this.getConfigApi(customer.app);
28
- const cliService = new cli_1.CliServiceFactory().getService();
29
- this.service = new _1.PullService(files, cliService, configApi, configName, this.context.customerPath);
25
+ const cliService = new CliServiceFactory().getService();
26
+ this.service = new PullService(files, cliService, configApi, configName, this.context.customerPath);
30
27
  }
31
28
  async getIntegrationFiles() {
32
- const integrationApiContext = new integration_api_1.IntegrationApiContext(this.context.customerPath, this.context.configName, []);
33
- const integrationApi = new integration_api_1.IntegrationApiFactory(integrationApiContext, this.userConfig).buildService();
29
+ const integrationApiContext = new IntegrationApiContext(this.context.customerPath, this.context.configName, []);
30
+ const integrationApi = new IntegrationApiFactory(integrationApiContext, this.userConfig).buildService();
34
31
  return await integrationApi.run();
35
32
  }
36
33
  getConfigApi(app) {
37
- const configApiContext = new config_api_1.ConfigApiContext(app);
38
- return new config_api_1.ConfigApiServiceFactory(configApiContext).getService();
34
+ const configApiContext = new ConfigApiContext(app);
35
+ return new ConfigApiServiceFactory(configApiContext).getService();
39
36
  }
40
37
  }
41
- exports.PullServiceFactory = PullServiceFactory;
@@ -1,11 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InstallResourceToFileMapping = exports.PullContext = void 0;
4
- const tslib_1 = require("tslib");
5
- const dotenv = tslib_1.__importStar(require("dotenv"));
6
- dotenv.config();
1
+ import * as dotenv from "dotenv";
2
+ dotenv.config({ quiet: true });
7
3
  const DEFAULT_CONFIG_NAME = "production";
8
- class PullContext {
4
+ export class PullContext {
9
5
  customerPath;
10
6
  configName;
11
7
  constructor(customerPath, configName = DEFAULT_CONFIG_NAME) {
@@ -13,8 +9,7 @@ class PullContext {
13
9
  this.configName = configName;
14
10
  }
15
11
  }
16
- exports.PullContext = PullContext;
17
- exports.InstallResourceToFileMapping = {
12
+ export const InstallResourceToFileMapping = {
18
13
  config: { fileName: "config_SpeedKit", extension: "js" },
19
14
  documentHandlerConfig: {
20
15
  fileName: "config_documentHandler",
@@ -1,6 +1,6 @@
1
- import { CliServiceInterface } from "../cli";
2
- import { FileListInterface } from "../integration-api";
3
- import { ConfigApiService } from "../config-api";
1
+ import { CliServiceInterface } from "../cli/index.js";
2
+ import { FileListInterface } from "../integration-api/index.js";
3
+ import { ConfigApiService } from "../config-api/index.js";
4
4
  export declare class PullService {
5
5
  private fileList;
6
6
  private cli;
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PullService = void 0;
4
- const cli_1 = require("../cli");
5
- const integration_api_1 = require("../integration-api");
6
- const _1 = require("./");
7
- const safe_1 = require("../../helpers/safe");
8
- const node_child_process_1 = require("node:child_process");
9
- class PullService {
1
+ import { InstallResourceFile, } from "../integration-api/index.js";
2
+ import { InstallResourceToFileMapping } from "./index.js";
3
+ import { safe } from "../../helpers/safe.js";
4
+ import { execSync } from "node:child_process";
5
+ export class PullService {
10
6
  fileList;
11
7
  cli;
12
8
  configApi;
@@ -28,24 +24,24 @@ class PullService {
28
24
  return;
29
25
  }
30
26
  }
31
- this.cli.startAction("fetch active installResource");
32
- const installResourceResult = await (0, safe_1.safe)(this.configApi.getActiveInstall(this.configName));
27
+ this.cli.startAction("PULL:INSTALL_RESOURCE", "fetch active installResource");
28
+ const installResourceResult = await safe(this.configApi.getActiveInstall(this.configName));
33
29
  if (installResourceResult.success === false) {
34
- this.cli.endAction(cli_1.CliActionStatus.FAILED);
30
+ this.cli.failAction("PULL:INSTALL_RESOURCE");
35
31
  this.cli.writeError(`An error happened try fetching the installResource ${installResourceResult.error}`);
36
32
  return;
37
33
  }
38
- this.cli.endAction(cli_1.CliActionStatus.COMPLETED);
34
+ this.cli.successAction("PULL:INSTALL_RESOURCE");
39
35
  const installResource = installResourceResult.data;
40
36
  await this.handleConfigCustomer(installResource);
41
- for (const key in _1.InstallResourceToFileMapping) {
37
+ for (const key in InstallResourceToFileMapping) {
42
38
  await this.updateLocalFileByInstallResource(installResource, key);
43
39
  }
44
40
  }
45
41
  async updateLocalFileByInstallResource(installResource, key) {
46
42
  const installResourceContent = installResource[key];
47
- const fileName = _1.InstallResourceToFileMapping[key]["fileName"];
48
- const extension = _1.InstallResourceToFileMapping[key]["extension"];
43
+ const fileName = InstallResourceToFileMapping[key]["fileName"];
44
+ const extension = InstallResourceToFileMapping[key]["extension"];
49
45
  // local and remote are empty. skip
50
46
  if (this.isEmpty(installResourceContent) &&
51
47
  !this.fileList.hasFile(fileName)) {
@@ -87,7 +83,7 @@ class PullService {
87
83
  return this.fileList.getByName(fileName);
88
84
  }
89
85
  async createFile(fileName, extension, content, key) {
90
- const resourceFile = new integration_api_1.InstallResourceFile(fileName, `${this.basePath}/${fileName}.${extension}`, content, key);
86
+ const resourceFile = new InstallResourceFile(fileName, `${this.basePath}/${fileName}.${extension}`, content, key);
91
87
  this.fileList.addFile(resourceFile);
92
88
  await resourceFile.updateFile();
93
89
  }
@@ -97,7 +93,7 @@ class PullService {
97
93
  .filter((value) => value.length > 0)
98
94
  .pop();
99
95
  try {
100
- const stdoutBuffer = (0, node_child_process_1.execSync)("git diff --name-status");
96
+ const stdoutBuffer = execSync("git diff --name-status");
101
97
  const stdout = stdoutBuffer.toString("utf8");
102
98
  {
103
99
  return stdout.includes(customerName);
@@ -121,4 +117,3 @@ class PullService {
121
117
  this.cli.writeSuccess("equal, skip: config_customer(origins)");
122
118
  }
123
119
  }
124
- exports.PullService = PullService;
@@ -1,4 +1,4 @@
1
- import { ConfigFileError } from "../../error-handling/error/config-file-error";
1
+ import { ConfigFileError } from "../../error-handling/error/config-file-error.js";
2
2
  export declare class ParseConfigSpeedKitError extends ConfigFileError {
3
3
  constructor(message: string);
4
4
  }
@@ -1,11 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ParseConfigSpeedKitError = void 0;
4
- const config_file_error_1 = require("../../error-handling/error/config-file-error");
5
- class ParseConfigSpeedKitError extends config_file_error_1.ConfigFileError {
1
+ import { ConfigFileError } from "../../error-handling/error/config-file-error.js";
2
+ export class ParseConfigSpeedKitError extends ConfigFileError {
6
3
  constructor(message) {
7
4
  super(message);
8
5
  this.suggestions = ["please check file config_SpeedKit"];
9
6
  }
10
7
  }
11
- exports.ParseConfigSpeedKitError = ParseConfigSpeedKitError;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Parameter = void 0;
4
- class Parameter {
1
+ export class Parameter {
5
2
  query;
6
3
  constructor(app, parameterFilter, whitelistedFilter, blacklistedFilter, parameterReplaceFilter) {
7
4
  const nowMinusOneMonth = new Date(new Date().setMonth(new Date().getMonth() - 1, new Date().getDate()));
@@ -46,4 +43,3 @@ where cardinality(paramKeys) > 0
46
43
  order by potentialGain desc, cachedUrls desc, PIs desc`;
47
44
  }
48
45
  }
49
- exports.Parameter = Parameter;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Prewarm = void 0;
4
- class Prewarm {
1
+ export class Prewarm {
5
2
  query;
6
3
  constructor(app, whitelistedFilter, blacklistedFilter, parameterReplaceFilter) {
7
4
  const now = new Date();
@@ -20,4 +17,3 @@ group by url
20
17
  order by count(*) desc`;
21
18
  }
22
19
  }
23
- exports.Prewarm = Prewarm;
@@ -1,6 +1,6 @@
1
- import { QueryBuilderService } from "./query-builder-service";
2
- import { QueryBuilderFactoryContext, QueryTpe } from "./query-builder-model";
3
- import { UserCliConfig } from "../../helpers/cli-config";
1
+ import { QueryBuilderService } from "./query-builder-service.js";
2
+ import { QueryBuilderFactoryContext, QueryTpe } from "./query-builder-model.js";
3
+ import { UserCliConfig } from "../../helpers/cli-config.js";
4
4
  export declare class QueryBuilderFactory {
5
5
  private context;
6
6
  private userConfig;
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QueryBuilderFactory = void 0;
4
- const query_builder_service_1 = require("./query-builder-service");
5
- const integration_api_1 = require("../integration-api");
6
- const files_1 = require("../../models/files");
7
- const cli_1 = require("../cli");
8
- const safe_1 = require("../../helpers/safe");
9
- const parse_config_speed_kit_error_1 = require("./error/parse-config-speed-kit-error");
10
- const evaluate_speed_kit_config_1 = require("../../helpers/evaluate-speed-kit-config");
11
- class QueryBuilderFactory {
1
+ import { QueryBuilderService } from "./query-builder-service.js";
2
+ import { IntegrationApiContext, IntegrationApiFactory, } from "../integration-api/index.js";
3
+ import { INTEGRATION_FILES } from "../../models/files.js";
4
+ import { CliServiceFactory } from "../cli/index.js";
5
+ import { safe } from "../../helpers/safe.js";
6
+ import { ParseConfigSpeedKitError } from "./error/parse-config-speed-kit-error.js";
7
+ import { evaluateLocalSpeedKitConfig } from "../../helpers/evaluate-speed-kit-config.js";
8
+ export class QueryBuilderFactory {
12
9
  context;
13
10
  userConfig;
14
11
  constructor(context, userConfig) {
@@ -16,12 +13,12 @@ class QueryBuilderFactory {
16
13
  this.userConfig = userConfig;
17
14
  }
18
15
  async buildService(queryType) {
19
- const cli = new cli_1.CliServiceFactory().getService();
16
+ const cli = new CliServiceFactory().getService();
20
17
  const files = await this.getIntegrationFiles();
21
18
  const customerConfig = files.getCustomerConfig().config;
22
19
  const app = customerConfig.app;
23
20
  const origin = customerConfig.origins[0];
24
- const speedKitConfigFile = files.getByName(files_1.INTEGRATION_FILES.CONFIG.SPEED_KIT);
21
+ const speedKitConfigFile = files.getByName(INTEGRATION_FILES.CONFIG.SPEED_KIT);
25
22
  const speedKitConfig = await this.getSpeedKitConfig(app, origin, speedKitConfigFile);
26
23
  const serviceContext = {
27
24
  app,
@@ -29,21 +26,20 @@ class QueryBuilderFactory {
29
26
  isWindows: this.context.isWindows,
30
27
  quiet: this.context.quiet,
31
28
  };
32
- return new query_builder_service_1.QueryBuilderService(serviceContext, speedKitConfig, cli);
29
+ return new QueryBuilderService(serviceContext, speedKitConfig, cli);
33
30
  }
34
31
  async getIntegrationFiles() {
35
- const integrationApiContext = new integration_api_1.IntegrationApiContext(this.context.customerPath, this.context.configName, ["config_SpeedKit"]);
36
- const integrationApi = new integration_api_1.IntegrationApiFactory(integrationApiContext, this.userConfig).buildService();
32
+ const integrationApiContext = new IntegrationApiContext(this.context.customerPath, this.context.configName, ["config_SpeedKit"]);
33
+ const integrationApi = new IntegrationApiFactory(integrationApiContext, this.userConfig).buildService();
37
34
  return await integrationApi.run();
38
35
  }
39
36
  getSpeedKitConfig(app, origin, speedKitConfigFile) {
40
- const result = (0, safe_1.safe)(() => {
41
- return (0, evaluate_speed_kit_config_1.evaluateLocalSpeedKitConfig)(app, origin, speedKitConfigFile);
37
+ const result = safe(() => {
38
+ return evaluateLocalSpeedKitConfig(app, origin, speedKitConfigFile);
42
39
  });
43
40
  if (result.success !== true) {
44
- throw new parse_config_speed_kit_error_1.ParseConfigSpeedKitError(result.error);
41
+ throw new ParseConfigSpeedKitError(result.error);
45
42
  }
46
43
  return result.data;
47
44
  }
48
45
  }
49
- exports.QueryBuilderFactory = QueryBuilderFactory;
@@ -1,22 +1,22 @@
1
- export type QueryBuilderContext = {
1
+ export interface QueryBuilderContext {
2
2
  isWindows?: boolean;
3
3
  quiet?: boolean;
4
4
  queryType: QueryTpe;
5
5
  app: string;
6
- };
7
- export type QueryBuilderFactoryContext = {
6
+ }
7
+ export interface QueryBuilderFactoryContext {
8
8
  readonly customerPath: string;
9
9
  readonly configName: string;
10
10
  readonly isWindows?: boolean;
11
11
  readonly quiet?: boolean;
12
- };
12
+ }
13
13
  export declare enum QueryTpe {
14
14
  prewarm = "prewarm",
15
15
  parameter = "parameter"
16
16
  }
17
- export type SpeedKitConfig = {
17
+ export interface SpeedKitConfig {
18
18
  ruleSetConfig?: {
19
19
  version?: string;
20
20
  };
21
21
  [key: string]: any;
22
- };
22
+ }
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QueryTpe = void 0;
4
- var QueryTpe;
1
+ export var QueryTpe;
5
2
  (function (QueryTpe) {
6
3
  QueryTpe["prewarm"] = "prewarm";
7
4
  QueryTpe["parameter"] = "parameter";
8
- })(QueryTpe || (exports.QueryTpe = QueryTpe = {}));
5
+ })(QueryTpe || (QueryTpe = {}));
@@ -1,5 +1,5 @@
1
- import { QueryBuilderContext, SpeedKitConfig } from "./query-builder-model";
2
- import { CliServiceInterface } from "../cli";
1
+ import { QueryBuilderContext, SpeedKitConfig } from "./query-builder-model.js";
2
+ import { CliServiceInterface } from "../cli/index.js";
3
3
  export declare class QueryBuilderService {
4
4
  private context;
5
5
  private speedKitConfig;