@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,51 +1,47 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OnboardingServiceFactory = void 0;
4
- const tslib_1 = require("tslib");
5
- const safe_1 = require("../../helpers/safe");
6
- const files_1 = require("../../models/files");
7
- const athena_1 = require("../athena");
8
- const bundler_1 = require("../bundler");
9
- const cli_1 = require("../cli");
10
- const diff_1 = require("../diff");
11
- const document_handler_runtime_service_factory_1 = tslib_1.__importDefault(require("../document-handler-runtime/factory/document-handler-runtime-service-factory"));
12
- const integration_api_1 = require("../integration-api");
13
- const install_file_recipe_1 = require("./config-renderer/install-file-recipe");
14
- const speed_kit_install_context_1 = require("./config-renderer/speed-kit-install-context");
15
- const dashboard_1 = require("./dashboard");
16
- const parameter_query_builder_1 = require("./dashboard/parameter-query-builder");
17
- const request_diff_service_1 = require("./dashboard/request-diff-service");
18
- const fetch_event_handler_1 = require("./fetch-event-handler");
19
- const customer_domain_document_response_1 = require("./fetch-events/customer-domain-document-response");
20
- const customer_service_worker_js_1 = require("./fetch-events/customer-service-worker-js");
21
- const dashboard_request_1 = require("./fetch-events/dashboard-request");
22
- const speed_kit_asset_request_1 = require("./fetch-events/speed-kit-asset-request");
23
- const speed_kit_install_html_1 = require("./fetch-events/speed-kit-install-html");
24
- const speed_kit_install_js_1 = require("./fetch-events/speed-kit-install-js");
25
- const speed_kit_rum_pi_request_1 = require("./fetch-events/speed-kit-rum-pi-request");
26
- const speed_kit_service_worker_js_1 = require("./fetch-events/speed-kit-service-worker-js");
27
- const file_watcher_1 = require("./file-events/file-watcher");
28
- const onboarding_model_1 = require("./onboarding-model");
29
- const onboarding_service_1 = require("./onboarding-service");
30
- const cache_1 = require("./request-cache/cache");
31
- const install_speed_kit_html_template_1 = require("./templates/install-speed-kit-html-template");
32
- const install_speed_kit_js_template_1 = require("./templates/install-speed-kit-js-template");
1
+ import { safe } from "../../helpers/safe.js";
2
+ import { INTEGRATION_FILES } from "../../models/files.js";
3
+ import { AthenaServiceFactory } from "../athena/index.js";
4
+ import { BundleServiceFactory } from "../bundler/index.js";
5
+ import { CliServiceFactory } from "../cli/index.js";
6
+ import { DiffContext, DiffServiceFactory } from "../diff/index.js";
7
+ import DocumentHandlerRuntimeServiceFactory from "../document-handler-runtime/factory/document-handler-runtime-service-factory.js";
8
+ import { ExternalFileReader, IntegrationApiContext, VirtualFile, ExternalRecipe, IntegrationApiFactory, } from "../integration-api/index.js";
9
+ import { InstallFileRecipe } from "./config-renderer/install-file-recipe.js";
10
+ import { SpeedKitInstallContext } from "./config-renderer/speed-kit-install-context.js";
11
+ import { Dashboard } from "./dashboard/index.js";
12
+ import { ParameterQueryBuilder } from "./dashboard/parameter-query-builder.js";
13
+ import { RequestDiffService } from "./dashboard/request-diff-service.js";
14
+ import { FetchEventHandler } from "./fetch-event-handler.js";
15
+ import { CustomerDomainDocumentResponse } from "./fetch-events/customer-domain-document-response.js";
16
+ import { CustomerServiceWorkerJs } from "./fetch-events/customer-service-worker-js.js";
17
+ import { DashboardRequest } from "./fetch-events/dashboard-request.js";
18
+ import { SpeedKitAssetRequest } from "./fetch-events/speed-kit-asset-request.js";
19
+ import { SpeedKitInstallHtml } from "./fetch-events/speed-kit-install-html.js";
20
+ import { SpeedKitInstallJs } from "./fetch-events/speed-kit-install-js.js";
21
+ import { SpeedKitRumPiRequest } from "./fetch-events/speed-kit-rum-pi-request.js";
22
+ import { SpeedKitServiceWorkerJs } from "./fetch-events/speed-kit-service-worker-js.js";
23
+ import { FileWatcher } from "./file-events/file-watcher.js";
24
+ import { BrowserContext, } from "./onboarding-model.js";
25
+ import { OnboardingService } from "./onboarding-service.js";
26
+ import { Cache } from "./request-cache/cache.js";
27
+ import { InstallSpeedKitHtmlTemplate } from "./templates/install-speed-kit-html-template.js";
28
+ import { InstallSpeedKitJsTemplate } from "./templates/install-speed-kit-js-template.js";
33
29
  // import { TodoCollector } from "./todo-collector";
34
- const extension_validator_1 = require("./browser/extension/extension-validator");
35
- const devtools_extension_api_1 = require("./browser/extension/devtools-extension-api");
36
- const todo_collector_1 = require("./todo-collector");
37
- const crawler_1 = require("./virtual-orestes-app/crawler");
38
- const virtual_orestes_app_1 = require("./virtual-orestes-app");
39
- const config_api_1 = require("../config-api");
40
- const fs = tslib_1.__importStar(require("node:fs"));
41
- const path = tslib_1.__importStar(require("node:path"));
42
- const static_recipe_1 = require("../integration-api/virtual/static-recipe");
43
- const diff_against_current_page_1 = require("./dashboard/diff-against-current-page");
44
- const extension_downloader_1 = require("./browser/extension/extension-downloader");
45
- const executable_validator_1 = require("./browser/executable/executable-validator");
46
- const fetch_socks_1 = require("fetch-socks");
47
- const node_crypto_1 = tslib_1.__importDefault(require("node:crypto"));
48
- class OnboardingServiceFactory {
30
+ import { ExtensionValidator } from "./browser/extension/extension-validator.js";
31
+ import { DevtoolsExtensionApi } from "./browser/extension/devtools-extension-api.js";
32
+ import { TodoCollector } from "./todo-collector.js";
33
+ import { Crawler } from "./virtual-orestes-app/crawler.js";
34
+ import { VirtualOrestesApp } from "./virtual-orestes-app/index.js";
35
+ import { ConfigApiContext, ConfigApiServiceFactory, } from "../config-api/index.js";
36
+ import * as fs from "node:fs";
37
+ import * as path from "node:path";
38
+ import { StaticRecipe } from "../integration-api/virtual/static-recipe.js";
39
+ import { DiffAgainstCurrentPage } from "./dashboard/diff-against-current-page.js";
40
+ import { ExtensionDownloader } from "./browser/extension/extension-downloader.js";
41
+ import { ExecutableValidator } from "./browser/executable/executable-validator.js";
42
+ import { socksDispatcher } from "fetch-socks";
43
+ import crypto from "node:crypto";
44
+ export class OnboardingServiceFactory {
49
45
  context;
50
46
  cliConfig;
51
47
  constructor(context, cliConfig) {
@@ -54,10 +50,10 @@ class OnboardingServiceFactory {
54
50
  }
55
51
  async getService() {
56
52
  const files = await this.getIntegrationFiles();
57
- const cli = new cli_1.CliServiceFactory().getService();
53
+ const cli = new CliServiceFactory().getService();
58
54
  const customerConfig = files.getCustomerConfig().config;
59
55
  const domainToStart = await this.getUrlForTest(customerConfig, cli);
60
- const cache = new cache_1.Cache(cli);
56
+ const cache = new Cache(cli);
61
57
  const documentHandlerContext = {
62
58
  configName: this.context.configName,
63
59
  customerPath: this.context.customerPath,
@@ -65,36 +61,36 @@ class OnboardingServiceFactory {
65
61
  requiredFiles: [],
66
62
  verboseLevel: this.context.verboseLevel,
67
63
  };
68
- const documentHandler = await new document_handler_runtime_service_factory_1.default(documentHandlerContext, this.cliConfig, files).buildDocumentHandlerServer();
69
- const bundler = new bundler_1.BundleServiceFactory().buildService();
70
- const skTemplate = new install_speed_kit_js_template_1.InstallSpeedKitJsTemplate();
71
- const speedKitInstallContext = new speed_kit_install_context_1.SpeedKitInstallContext(customerConfig, this.context.configName, files, bundler, skTemplate, this.context.local);
64
+ const documentHandler = await new DocumentHandlerRuntimeServiceFactory(documentHandlerContext, this.cliConfig, files).buildDocumentHandlerServer();
65
+ const bundler = new BundleServiceFactory(this.context.customerPath).buildService();
66
+ const skTemplate = new InstallSpeedKitJsTemplate();
67
+ const speedKitInstallContext = new SpeedKitInstallContext(customerConfig, this.context.configName, files, bundler, skTemplate, this.context.local);
72
68
  await this.buildInstallResource(speedKitInstallContext, files, cli);
73
- const extensionDownloader = new extension_downloader_1.ExtensionDownloader(this.cliConfig, cli);
74
- const extensionPaths = await new extension_validator_1.ExtensionValidator(extensionDownloader, this.cliConfig, cli).getValidBrowserExtensionPaths();
69
+ const extensionDownloader = new ExtensionDownloader(this.cliConfig, cli);
70
+ const extensionPaths = await new ExtensionValidator(extensionDownloader, this.cliConfig, cli).getValidBrowserExtensionPaths();
75
71
  this.cliConfig.chromeExtensionPaths = extensionPaths.join(",");
76
- const browserValidator = new executable_validator_1.ExecutableValidator(this.cliConfig, cli);
72
+ const browserValidator = new ExecutableValidator(this.cliConfig, cli);
77
73
  const browserVersionString = await browserValidator.validateOrInstall();
78
- const browserContext = new onboarding_model_1.BrowserContext(domainToStart, browserVersionString, customerConfig.chromeFlags || [], this.cliConfig, undefined, this.context.debuggingPort, this.context.headless);
74
+ const browserContext = new BrowserContext(domainToStart, browserVersionString, customerConfig.chromeFlags || [], this.cliConfig, undefined, this.context.debuggingPort, this.context.headless);
79
75
  if (this.context.debuggingPort || this.context.headless) {
80
76
  cli.writeWarning("Chrome remote debugging enabled on port 9222.");
81
77
  }
82
78
  if (this.context.headless) {
83
79
  cli.writeWarning("Running in headless mode.");
84
80
  }
85
- const fileWatcher = new file_watcher_1.FileWatcher(cli, customerConfig, files, documentHandler, browserContext, cache);
81
+ const fileWatcher = new FileWatcher(cli, customerConfig, files, documentHandler, browserContext, cache);
86
82
  const athenaClient = (await this.getAthenaClient()) || null;
87
83
  const fetchHandler = await this.getFetchEventHandler(files, customerConfig, documentHandler, cache, cli, browserContext, athenaClient);
88
84
  const messageHandler = this.prepareMessagehandler(athenaClient, files);
89
- return new onboarding_service_1.OnboardingService(browserContext, customerConfig, fetchHandler, fileWatcher, cli, messageHandler);
85
+ return new OnboardingService(browserContext, customerConfig, fetchHandler, fileWatcher, cli, messageHandler);
90
86
  }
91
87
  prepareMessagehandler(athenaClient, files) {
92
- const messageHandler = new devtools_extension_api_1.DevtoolsExtensionApi();
88
+ const messageHandler = new DevtoolsExtensionApi();
93
89
  messageHandler.addMessage({
94
90
  id: "athena",
95
91
  data: { client: !!athenaClient },
96
92
  });
97
- const fileTodoCollector = new todo_collector_1.TodoCollector(files.getInstallResources());
93
+ const fileTodoCollector = new TodoCollector(files.getInstallResources());
98
94
  messageHandler.addMessage({
99
95
  id: "todo",
100
96
  data: [...fileTodoCollector.getOpenTasks()],
@@ -102,58 +98,57 @@ class OnboardingServiceFactory {
102
98
  return messageHandler;
103
99
  }
104
100
  async buildInstallResource(speedKitInstallContext, files, cli) {
105
- cli.startAction("build file install_resource");
106
- const installResourceFile = new integration_api_1.VirtualFile(files_1.INTEGRATION_FILES.BUILD.INSTALL, new install_file_recipe_1.InstallFileRecipe(speedKitInstallContext));
107
- const result = await (0, safe_1.safe)(installResourceFile.buildContent());
101
+ cli.startAction("ONBOARDING:BUILD:INSTALL_RESOURCE", "build file install_resource");
102
+ const installResourceFile = new VirtualFile(INTEGRATION_FILES.BUILD.INSTALL, new InstallFileRecipe(speedKitInstallContext));
103
+ const result = await safe(installResourceFile.buildContent());
108
104
  if (result.success === true) {
109
105
  files.addFile(installResourceFile);
110
- cli.endAction(cli_1.CliActionStatus.COMPLETED);
106
+ cli.successAction("ONBOARDING:BUILD:INSTALL_RESOURCE");
111
107
  return;
112
108
  }
113
- cli.endAction(cli_1.CliActionStatus.FAILED);
114
- cli.writeError(result.error);
109
+ cli.failAction("ONBOARDING:BUILD:INSTALL_RESOURCE", result.error);
115
110
  }
116
111
  async getAthenaClient() {
117
- const athenaFactory = new athena_1.AthenaServiceFactory();
118
- const result = await (0, safe_1.safe)(athenaFactory.getService());
112
+ const athenaFactory = new AthenaServiceFactory();
113
+ const result = await safe(athenaFactory.getService());
119
114
  if (result.success === true) {
120
115
  return result.data;
121
116
  }
122
117
  }
123
118
  getConfigApi(app) {
124
- const configApiContext = new config_api_1.ConfigApiContext(app);
125
- return new config_api_1.ConfigApiServiceFactory(configApiContext).getService();
119
+ const configApiContext = new ConfigApiContext(app);
120
+ return new ConfigApiServiceFactory(configApiContext).getService();
126
121
  }
127
122
  async getFetchEventHandler(files, customerConfig, documentHandler, cache, cli, browserContext, athenaClient) {
128
123
  const configApi = this.getConfigApi(customerConfig.app);
129
124
  const serverConfig = await this.getSpeedKitServerConfig(configApi, cli);
130
125
  const agent = this.getCrawlerAgent(customerConfig, cli);
131
- const crawler = new crawler_1.Crawler(cli, agent, serverConfig);
132
- const parameterQueryBuilder = new parameter_query_builder_1.ParameterQueryBuilder(customerConfig, files.getByName(files_1.INTEGRATION_FILES.CONFIG.SPEED_KIT));
133
- const DiffService = new diff_1.DiffServiceFactory(new diff_1.DiffContext(this.cliConfig.diffExec, this.cliConfig.diffExecTemplate)).getService();
134
- const requestDiffService = new request_diff_service_1.RequestDiffService(DiffService, documentHandler);
126
+ const crawler = new Crawler(cli, agent, serverConfig);
127
+ const parameterQueryBuilder = new ParameterQueryBuilder(customerConfig, files.getByName(INTEGRATION_FILES.CONFIG.SPEED_KIT));
128
+ const DiffService = new DiffServiceFactory(new DiffContext(this.cliConfig.diffExec, this.cliConfig.diffExecTemplate)).getService();
129
+ const requestDiffService = new RequestDiffService(DiffService, documentHandler);
135
130
  const handlers = [
136
- new customer_domain_document_response_1.CustomerDomainDocumentResponse(customerConfig, files.getByName(files_1.INTEGRATION_FILES.CONFIG.DYNAMIC_BLOCKS), files.getByName(files_1.INTEGRATION_FILES.CONFIG.DYNAMIC_STYLES), this.context.ignoreContentSecurityPolicy),
137
- new speed_kit_install_html_1.SpeedKitInstallHtml(customerConfig, browserContext, new install_speed_kit_html_template_1.InstallSpeedKitHtmlTemplate()),
138
- new speed_kit_install_js_1.SpeedKitInstallJs(customerConfig, files.getByName(files_1.INTEGRATION_FILES.BUILD.INSTALL)),
139
- new customer_service_worker_js_1.CustomerServiceWorkerJs(customerConfig),
140
- new speed_kit_service_worker_js_1.SpeedKitServiceWorkerJs(customerConfig, files.getByName(files_1.INTEGRATION_FILES.CUSTOM.SW)),
141
- new dashboard_request_1.DashboardRequest(new dashboard_1.Dashboard(customerConfig, parameterQueryBuilder, athenaClient, requestDiffService, new diff_against_current_page_1.DiffAgainstCurrentPage(DiffService, documentHandler, crawler, cli), cache)),
131
+ new CustomerDomainDocumentResponse(customerConfig, files.getByName(INTEGRATION_FILES.CONFIG.DYNAMIC_BLOCKS), files.getByName(INTEGRATION_FILES.CONFIG.DYNAMIC_STYLES), this.context.ignoreContentSecurityPolicy),
132
+ new SpeedKitInstallHtml(customerConfig, browserContext, new InstallSpeedKitHtmlTemplate()),
133
+ new SpeedKitInstallJs(customerConfig, files.getByName(INTEGRATION_FILES.BUILD.INSTALL)),
134
+ new CustomerServiceWorkerJs(customerConfig),
135
+ new SpeedKitServiceWorkerJs(customerConfig, files.getByName(INTEGRATION_FILES.CUSTOM.SW)),
136
+ new DashboardRequest(new Dashboard(customerConfig, parameterQueryBuilder, athenaClient, requestDiffService, new DiffAgainstCurrentPage(DiffService, documentHandler, crawler, cli), cache)),
142
137
  ];
143
138
  if (this.context.local) {
144
- const orestesApp = new virtual_orestes_app_1.VirtualOrestesApp(customerConfig, crawler, documentHandler, cache, cli);
145
- handlers.push(new speed_kit_asset_request_1.SpeedKitAssetRequest(customerConfig, orestesApp), new speed_kit_rum_pi_request_1.SpeedKitRumPiRequest(customerConfig, cache, cli));
139
+ const orestesApp = new VirtualOrestesApp(customerConfig, crawler, documentHandler, cache, cli);
140
+ handlers.push(new SpeedKitAssetRequest(customerConfig, orestesApp), new SpeedKitRumPiRequest(customerConfig, cache, cli));
146
141
  }
147
- return new fetch_event_handler_1.FetchEventHandler(handlers, customerConfig, cli, configApi);
142
+ return new FetchEventHandler(handlers, customerConfig, cli, configApi);
148
143
  }
149
144
  async getSpeedKitServerConfig(configApi, cli) {
150
- cli.startAction("get server config from app");
151
- const serverConfigResult = await (0, safe_1.safe)(configApi.getServerConfig());
145
+ cli.startAction("ONBOARDING:FETCH:RUNTIME_CONFIG", "get server config from app");
146
+ const serverConfigResult = await safe(configApi.getServerConfig());
152
147
  if (serverConfigResult.success !== true) {
153
- cli.endAction(cli_1.CliActionStatus.FAILED);
148
+ cli.failAction("ONBOARDING:FETCH:RUNTIME_CONFIG");
154
149
  return;
155
150
  }
156
- cli.endAction(cli_1.CliActionStatus.COMPLETED);
151
+ cli.successAction("ONBOARDING:FETCH:RUNTIME_CONFIG");
157
152
  return JSON.parse(serverConfigResult.data);
158
153
  }
159
154
  async getIntegrationFiles() {
@@ -164,42 +159,42 @@ class OnboardingServiceFactory {
164
159
  const swPath = path.join(speedKitBuildPath, "sw.js");
165
160
  const dfPath = path.join(speedKitBuildPath, "dynamic-fetcher.js");
166
161
  const loaderPath = path.join(speedKitBuildPath, "snippet.js");
167
- const integrationApiContext = new integration_api_1.IntegrationApiContext(this.context.customerPath, this.context.configName, [], [], this.context.useTestConfig);
168
- const integrationApi = new integration_api_1.IntegrationApiFactory(integrationApiContext, this.cliConfig).buildService();
169
- const externalFileReader = new integration_api_1.ExternalFileReader();
162
+ const integrationApiContext = new IntegrationApiContext(this.context.customerPath, this.context.configName, [], [], this.context.useTestConfig);
163
+ const integrationApi = new IntegrationApiFactory(integrationApiContext, this.cliConfig).buildService();
164
+ const externalFileReader = new ExternalFileReader();
170
165
  const integrationApiArray = [
171
166
  {
172
- name: files_1.INTEGRATION_FILES.CUSTOM.DOCUMENT_HANDLER,
173
- recipe: new integration_api_1.ExternalRecipe(this.context.DEFAULT_DOCUMENT_HANDLER_PATH, externalFileReader),
167
+ name: INTEGRATION_FILES.CUSTOM.DOCUMENT_HANDLER,
168
+ recipe: new ExternalRecipe(this.context.DEFAULT_DOCUMENT_HANDLER_PATH, externalFileReader),
174
169
  },
175
170
  ];
176
171
  // if speed-kit is npm-linked, use linked local files else fetch latest released sw and df
177
172
  if (isSpeedKitLinked) {
178
173
  console.log(`Linked Speed-Kit found in node_modules. Using built sw, df and loader.`);
179
174
  integrationApiArray.push({
180
- name: files_1.INTEGRATION_FILES.CUSTOM.SW,
181
- recipe: new static_recipe_1.StaticRecipe(fs.readFileSync(swPath, "utf-8")),
175
+ name: INTEGRATION_FILES.CUSTOM.SW,
176
+ recipe: new StaticRecipe(fs.readFileSync(swPath, "utf-8")),
182
177
  overrideLocalFile: true,
183
178
  }, {
184
- name: files_1.INTEGRATION_FILES.CUSTOM.DYNAMIC_FETCHER,
185
- recipe: new static_recipe_1.StaticRecipe(fs.readFileSync(dfPath, "utf-8")),
179
+ name: INTEGRATION_FILES.CUSTOM.DYNAMIC_FETCHER,
180
+ recipe: new StaticRecipe(fs.readFileSync(dfPath, "utf-8")),
186
181
  overrideLocalFile: true,
187
182
  }, {
188
- name: files_1.INTEGRATION_FILES.CUSTOM.LOADER,
189
- recipe: new static_recipe_1.StaticRecipe(fs.readFileSync(loaderPath, "utf-8")),
183
+ name: INTEGRATION_FILES.CUSTOM.LOADER,
184
+ recipe: new StaticRecipe(fs.readFileSync(loaderPath, "utf-8")),
190
185
  overrideLocalFile: true,
191
186
  });
192
187
  }
193
188
  else {
194
189
  integrationApiArray.push({
195
- name: files_1.INTEGRATION_FILES.CUSTOM.SW,
196
- recipe: new integration_api_1.ExternalRecipe(this.context.DEFAULT_SW_PATH, externalFileReader),
190
+ name: INTEGRATION_FILES.CUSTOM.SW,
191
+ recipe: new ExternalRecipe(this.context.DEFAULT_SW_PATH, externalFileReader),
197
192
  }, {
198
- name: files_1.INTEGRATION_FILES.CUSTOM.DYNAMIC_FETCHER,
199
- recipe: new integration_api_1.ExternalRecipe(this.context.DEFAULT_DF_PATH, externalFileReader),
193
+ name: INTEGRATION_FILES.CUSTOM.DYNAMIC_FETCHER,
194
+ recipe: new ExternalRecipe(this.context.DEFAULT_DF_PATH, externalFileReader),
200
195
  }, {
201
- name: files_1.INTEGRATION_FILES.CUSTOM.LOADER,
202
- recipe: new integration_api_1.ExternalRecipe(this.context.DEFAULT_SNIPPET_PATH, externalFileReader),
196
+ name: INTEGRATION_FILES.CUSTOM.LOADER,
197
+ recipe: new ExternalRecipe(this.context.DEFAULT_SNIPPET_PATH, externalFileReader),
203
198
  });
204
199
  }
205
200
  return integrationApi.run(integrationApiArray);
@@ -230,14 +225,14 @@ class OnboardingServiceFactory {
230
225
  };
231
226
  const agentOptions = {
232
227
  rejectUnauthorized: false,
233
- secureOptions: node_crypto_1.default.constants.SSL_OP_LEGACY_SERVER_CONNECT,
228
+ secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT,
234
229
  };
235
230
  const crawlerProxyConfig = this.getCrawlerProxyConfig(customerConfig);
236
231
  if (crawlerProxyConfig) {
237
232
  cli.writeWarning(`use proxy from chromeFlags for local documenthandler`);
238
233
  proxy.push(crawlerProxyConfig);
239
234
  }
240
- return (0, fetch_socks_1.socksDispatcher)(proxy, { ...agentOptions, connect });
235
+ return socksDispatcher(proxy, { ...agentOptions, connect });
241
236
  }
242
237
  getCrawlerProxyConfig(customerConfig) {
243
238
  if (!customerConfig.chromeFlags ||
@@ -262,4 +257,3 @@ class OnboardingServiceFactory {
262
257
  }
263
258
  }
264
259
  }
265
- exports.OnboardingServiceFactory = OnboardingServiceFactory;
@@ -1,9 +1,9 @@
1
- import { CustomerConfig } from "../integration-api";
2
- import { BrowserContext } from "./onboarding-model";
3
- import { FetchEventHandler } from "./fetch-event-handler";
4
- import { FileWatcher } from "./file-events/file-watcher";
5
- import { CliService } from "../cli";
6
- import { DevtoolsExtensionApi } from "./browser/extension/devtools-extension-api";
1
+ import { CustomerConfig } from "../integration-api/index.js";
2
+ import { BrowserContext } from "./onboarding-model.js";
3
+ import { FetchEventHandler } from "./fetch-event-handler.js";
4
+ import { FileWatcher } from "./file-events/file-watcher.js";
5
+ import { CliService } from "../cli/index.js";
6
+ import { DevtoolsExtensionApi } from "./browser/extension/devtools-extension-api.js";
7
7
  /**
8
8
  * Represents the OnboardingService which is responsible for setting up the browser to test a config using Puppeteer.
9
9
  */
@@ -1,15 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OnboardingService = void 0;
4
- const tslib_1 = require("tslib");
5
- const puppeteer_extra_1 = tslib_1.__importDefault(require("puppeteer-extra"));
6
- const onboarding_model_1 = require("./onboarding-model");
7
- const cli_1 = require("../cli");
8
- const safe_1 = require("../../helpers/safe");
1
+ import puppeteerExtra from "puppeteer-extra";
2
+ import { BROWSER_EVENTS, CDP_SESSION, } from "./onboarding-model.js";
3
+ import { safe } from "../../helpers/safe.js";
9
4
  /**
10
5
  * Represents the OnboardingService which is responsible for setting up the browser to test a config using Puppeteer.
11
6
  */
12
- class OnboardingService {
7
+ export class OnboardingService {
13
8
  browserContext;
14
9
  customerConfig;
15
10
  fetchEventHandler;
@@ -29,20 +24,20 @@ class OnboardingService {
29
24
  * prepare puppeteerBrowser, add eventListeners and start
30
25
  */
31
26
  async run() {
32
- this.cli.startAction(`prepare browser ${this.cli.style.bold(this.browserContext.browserVersionString)}`);
27
+ this.cli.startAction("ONBOARDING:PREPARE:BROWSER", `prepare browser ${this.cli.style.bold(this.browserContext.browserVersionString)}`);
33
28
  const browser = await this.prepareBrowser();
34
29
  const page = await this.preparePage(browser);
35
- this.cli.endAction(cli_1.CliActionStatus.COMPLETED);
30
+ this.cli.successAction("ONBOARDING:PREPARE:BROWSER");
36
31
  await this.navigate(page, `${this.customerConfig.scope}speed-kit-install.html?url=${this.customerConfig.scope}`);
37
32
  }
38
33
  async prepareBrowser() {
39
- const browser = await puppeteer_extra_1.default.launch(this.browserContext.getPuppeteerLaunchOptions());
34
+ const browser = await puppeteerExtra.default.launch(this.browserContext.getPuppeteerLaunchOptions());
40
35
  for (const target of browser.targets()) {
41
36
  if (target.type() === "browser") {
42
37
  await this.fetchEventHandler.handleRequestFetchEvents(target);
43
38
  }
44
39
  }
45
- browser.on(onboarding_model_1.BROWSER_EVENTS.DISCONNECTED, () => {
40
+ browser.on(BROWSER_EVENTS.DISCONNECTED, () => {
46
41
  this.cli.writeError("Browser disconnected, shutting down");
47
42
  process.exit(-1);
48
43
  });
@@ -50,7 +45,7 @@ class OnboardingService {
50
45
  }
51
46
  async preparePage(browser) {
52
47
  const page = await this.findPage(browser);
53
- await (0, safe_1.safe)(this.prepareCleanState(page));
48
+ await safe(this.prepareCleanState(page));
54
49
  this.registerFileWatcher(page);
55
50
  this.registerReinstallSpeedKitOnNavigate(page);
56
51
  this.developmentToolsMessages.addMessage({
@@ -88,8 +83,8 @@ class OnboardingService {
88
83
  });
89
84
  await cdpSession.send("Emulation.clearDeviceMetricsOverride");
90
85
  await cdpSession.send("Emulation.clearGeolocationOverride");
91
- (0, safe_1.safe)(() => {
92
- cdpSession.on(onboarding_model_1.CDP_SESSION.EVENTS.SERVICE_WORKER.REGISTRATION_UPDATED, ({ registrations, }) => {
86
+ safe(() => {
87
+ cdpSession.on(CDP_SESSION.EVENTS.SERVICE_WORKER.REGISTRATION_UPDATED, ({ registrations, }) => {
93
88
  for (const registration of registrations) {
94
89
  if (registration.isDeleted) {
95
90
  this.developmentToolsMessages.addMessage({
@@ -129,7 +124,6 @@ class OnboardingService {
129
124
  }
130
125
  async navigate(page, pathname) {
131
126
  const goto = new URL(pathname, `${this.browserContext.domain}`);
132
- await (0, safe_1.safe)(page.goto(goto.toString()));
127
+ await safe(page.goto(goto.toString()));
133
128
  }
134
129
  }
135
- exports.OnboardingService = OnboardingService;
@@ -1,5 +1,5 @@
1
- import { BaqendResponse } from "../browser/baqend-response";
2
- import { CliService } from "../../cli";
1
+ import { BaqendResponse } from "../browser/baqend-response.js";
2
+ import { CliService } from "../../cli/index.js";
3
3
  /**
4
4
  * This class represents a cache for storing responses from the localDocumentHandler.
5
5
  */
@@ -8,7 +8,7 @@ export declare class Cache {
8
8
  private inMemoryCache;
9
9
  constructor(cli: CliService);
10
10
  getAll(): IterableIterator<[string, BaqendResponse]>;
11
- getEntry(requestUri: string): BaqendResponse | void;
11
+ getEntry(requestUri: string): BaqendResponse | null;
12
12
  addEntry(requestUri: string, response: BaqendResponse): void;
13
13
  removeEntry(requestUri: string): void;
14
14
  clear(): void;
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Cache = void 0;
4
1
  /**
5
2
  * This class represents a cache for storing responses from the localDocumentHandler.
6
3
  */
7
- class Cache {
4
+ export class Cache {
8
5
  cli;
9
6
  inMemoryCache = new Map();
10
7
  constructor(cli) {
@@ -37,4 +34,3 @@ class Cache {
37
34
  this.inMemoryCache.clear();
38
35
  }
39
36
  }
40
- exports.Cache = Cache;
@@ -1,6 +1,6 @@
1
- import { CliService } from "../../cli";
2
- import { SpeedKitServerConfig } from "../onboarding-model";
3
- import { ConfigApiService } from "../../config-api";
1
+ import { CliService } from "../../cli/index.js";
2
+ import { SpeedKitServerConfig } from "../onboarding-model.js";
3
+ import { ConfigApiService } from "../../config-api/index.js";
4
4
  export declare class ServerConfig {
5
5
  private cli;
6
6
  private client?;
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ServerConfig = void 0;
4
- const cli_1 = require("../../cli");
5
- const safe_1 = require("../../../helpers/safe");
6
- class ServerConfig {
1
+ import { safe } from "../../../helpers/safe.js";
2
+ export class ServerConfig {
7
3
  cli;
8
4
  client;
9
5
  constructor(cli, client) {
@@ -18,15 +14,14 @@ class ServerConfig {
18
14
  return JSON.parse(serverConfig);
19
15
  }
20
16
  async getServerConfig() {
21
- this.cli.startAction("wait for credentials from server-config");
22
- const serverConfigResponse = await (0, safe_1.safe)(this.client.getServerConfig());
17
+ this.cli.startAction("ONBOARDING:FETCH:RUNTIME_CONFIG", "wait for credentials from server-config");
18
+ const serverConfigResponse = await safe(this.client.getServerConfig());
23
19
  if (serverConfigResponse.success === false) {
24
- this.cli.endAction(cli_1.CliActionStatus.FAILED);
20
+ this.cli.failAction("ONBOARDING:FETCH:RUNTIME_CONFIG");
25
21
  this.cli.writeError(`unable to load serverConfig: ${serverConfigResponse.error}`);
26
22
  return;
27
23
  }
28
- this.cli.endAction(cli_1.CliActionStatus.COMPLETED);
24
+ this.cli.successAction("ONBOARDING:FETCH:RUNTIME_CONFIG");
29
25
  return serverConfigResponse.data;
30
26
  }
31
27
  }
32
- exports.ServerConfig = ServerConfig;
@@ -1,4 +1,4 @@
1
- import AbstractTemplate from "../../document-handler-runtime/templates/abstract-template";
1
+ import AbstractTemplate from "../../document-handler-runtime/templates/abstract-template.js";
2
2
  export declare class InstallSpeedKitHtmlTemplate extends AbstractTemplate {
3
3
  protected getTemplate(): Handlebars.Template;
4
4
  }
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InstallSpeedKitHtmlTemplate = void 0;
4
- const tslib_1 = require("tslib");
5
- const abstract_template_1 = tslib_1.__importDefault(require("../../document-handler-runtime/templates/abstract-template"));
6
- class InstallSpeedKitHtmlTemplate extends abstract_template_1.default {
1
+ import AbstractTemplate from "../../document-handler-runtime/templates/abstract-template.js";
2
+ export class InstallSpeedKitHtmlTemplate extends AbstractTemplate {
7
3
  getTemplate() {
8
4
  return `
9
5
  <!DOCTYPE html>
@@ -264,4 +260,3 @@ aside.loader:not(.stop)::after {
264
260
  `;
265
261
  }
266
262
  }
267
- exports.InstallSpeedKitHtmlTemplate = InstallSpeedKitHtmlTemplate;
@@ -1,4 +1,4 @@
1
- import AbstractTemplate from "../../document-handler-runtime/templates/abstract-template";
1
+ import AbstractTemplate from "../../document-handler-runtime/templates/abstract-template.js";
2
2
  export declare class InstallSpeedKitJsTemplate extends AbstractTemplate {
3
3
  protected getTemplate(): Handlebars.Template;
4
4
  }
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InstallSpeedKitJsTemplate = void 0;
4
- const tslib_1 = require("tslib");
5
- const abstract_template_1 = tslib_1.__importDefault(require("../../document-handler-runtime/templates/abstract-template"));
6
- class InstallSpeedKitJsTemplate extends abstract_template_1.default {
1
+ import AbstractTemplate from "../../document-handler-runtime/templates/abstract-template.js";
2
+ export class InstallSpeedKitJsTemplate extends AbstractTemplate {
7
3
  getTemplate() {
8
4
  return `
9
5
  // Config
@@ -39,4 +35,3 @@ navigator?.serviceWorker?.controller?.postMessage({ type: 'bypass-deactivation',
39
35
  `;
40
36
  }
41
37
  }
42
- exports.InstallSpeedKitJsTemplate = InstallSpeedKitJsTemplate;
@@ -1,10 +1,10 @@
1
- import { InstallResourceInterface } from "../integration-api/integration-api-model";
2
- export type task = {
1
+ import { InstallResourceInterface } from "../integration-api/integration-api-model.js";
2
+ export interface task {
3
3
  todo: string;
4
4
  context: string;
5
5
  file: string;
6
6
  line: number;
7
- };
7
+ }
8
8
  /**
9
9
  * Represents a TodoCollector class that collects open tasks from files.
10
10
  * This files will then be injected to the current open page, so you or the browser-extension can access and display them
@@ -1,20 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TodoCollector = void 0;
4
- const integration_api_1 = require("../integration-api");
1
+ import { FILE_TYPE } from "../integration-api/index.js";
5
2
  const TODO_MATCH = /(todo[^\n\r()|]*)((?:(?:\r\n|\r|\n)[^\n\r()|]*){3})/i;
6
3
  /**
7
4
  * Represents a TodoCollector class that collects open tasks from files.
8
5
  * This files will then be injected to the current open page, so you or the browser-extension can access and display them
9
6
  */
10
- class TodoCollector {
7
+ export class TodoCollector {
11
8
  files;
12
9
  constructor(files) {
13
10
  this.files = files;
14
11
  }
15
12
  getOpenTasks() {
16
13
  const configFiles = this.files.filter((file) => {
17
- return !(file.type === integration_api_1.FILE_TYPE.VIRTUAL_FILE);
14
+ return !(file.type === FILE_TYPE.VIRTUAL_FILE);
18
15
  });
19
16
  const tasks = [];
20
17
  for (const configFile of configFiles) {
@@ -46,4 +43,3 @@ class TodoCollector {
46
43
  return line;
47
44
  }
48
45
  }
49
- exports.TodoCollector = TodoCollector;
@@ -1,5 +1,5 @@
1
- import { SpeedKitServerConfig } from "../onboarding-model";
2
- import { CliService } from "../../cli";
1
+ import { SpeedKitServerConfig } from "../onboarding-model.js";
2
+ import { CliService } from "../../cli/index.js";
3
3
  import { Agent } from "undici";
4
4
  export declare class Crawler {
5
5
  private cli;