@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,14 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExtensionValidator = void 0;
4
- const tslib_1 = require("tslib");
5
- const node_path_1 = tslib_1.__importDefault(require("node:path"));
6
- const promises_1 = require("node:fs/promises");
7
- const cli_1 = require("../../../cli");
8
- const safe_1 = require("../../../../helpers/safe");
9
- const node_fs_1 = require("node:fs");
10
- const browser_extension_error_1 = require("../../error/browser-extension-error");
11
- class ExtensionValidator {
1
+ import path from "node:path";
2
+ import { readFile } from "node:fs/promises";
3
+ import { safe } from "../../../../helpers/safe.js";
4
+ import { existsSync } from "node:fs";
5
+ import { BrowserExtensionError } from "../../error/browser-extension-error.js";
6
+ export class ExtensionValidator {
12
7
  extensionDownloader;
13
8
  cliConfig;
14
9
  cli;
@@ -19,14 +14,14 @@ class ExtensionValidator {
19
14
  }
20
15
  async getValidBrowserExtensionPaths() {
21
16
  const validExtensions = [];
22
- this.cli.startAction("resolve browserExtensions");
17
+ this.cli.startAction("ONBOARDING:RESOLVE:BROWSER_EXTENSION", "resolve browserExtensions");
23
18
  const browserExtensions = this.cliConfig.chromeExtensionPaths
24
19
  .split(",")
25
20
  .filter((entry) => {
26
21
  return entry.trim().length > 0;
27
22
  });
28
23
  for (const extensionPath of browserExtensions) {
29
- const cleanedExtensionPath = node_path_1.default.resolve(extensionPath.trim());
24
+ const cleanedExtensionPath = path.resolve(extensionPath.trim());
30
25
  const manifestConfig = await this.getManifestConfig(cleanedExtensionPath);
31
26
  if (!manifestConfig) {
32
27
  continue;
@@ -37,25 +32,26 @@ class ExtensionValidator {
37
32
  version: manifestConfig.version,
38
33
  });
39
34
  }
40
- this.cli.endAction(cli_1.CliActionStatus.COMPLETED);
35
+ this.cli.successAction("ONBOARDING:RESOLVE:BROWSER_EXTENSION");
41
36
  this.cli.spacer();
42
37
  await this.handleDevtoolsExtension(validExtensions);
43
38
  if (validExtensions.length > 0) {
39
+ // @ts-expect-error typeMissMatch
44
40
  this.cli.table(validExtensions, { name: {}, version: {}, path: {} });
45
41
  }
46
42
  return validExtensions.map((config) => config.path);
47
43
  }
48
44
  async getManifestConfig(cleanedExtensionPath) {
49
- const manifestPath = node_path_1.default.resolve(cleanedExtensionPath, "manifest.json");
50
- if (!(0, node_fs_1.existsSync)(manifestPath)) {
51
- throw new browser_extension_error_1.BrowserExtensionError(`Could not find browserExtensionPath: "${cleanedExtensionPath}"`);
45
+ const manifestPath = path.resolve(cleanedExtensionPath, "manifest.json");
46
+ if (!existsSync(manifestPath)) {
47
+ throw new BrowserExtensionError(`Could not find browserExtensionPath: "${cleanedExtensionPath}"`);
52
48
  }
53
- const manifestFile = await (0, promises_1.readFile)(manifestPath, "utf8");
54
- const result = (0, safe_1.safe)(() => {
49
+ const manifestFile = await readFile(manifestPath, "utf8");
50
+ const result = safe(() => {
55
51
  return JSON.parse(manifestFile);
56
52
  });
57
53
  if (result.success !== true) {
58
- throw new browser_extension_error_1.BrowserExtensionError(`could not find valid manifestFile in: "${manifestPath}"`);
54
+ throw new BrowserExtensionError(`could not find valid manifestFile in: "${manifestPath}"`);
59
55
  }
60
56
  return result.data;
61
57
  }
@@ -65,7 +61,7 @@ class ExtensionValidator {
65
61
  return;
66
62
  }
67
63
  // download or update extension
68
- const result = await (0, safe_1.safe)(this.extensionDownloader.downloadExtension());
64
+ const result = await safe(this.extensionDownloader.downloadExtension());
69
65
  if (result.success !== true) {
70
66
  this.cli.writeError(result?.error);
71
67
  return;
@@ -75,7 +71,7 @@ class ExtensionValidator {
75
71
  return;
76
72
  }
77
73
  // get extensionDetails from manifestFile
78
- const extensionConfigResult = await (0, safe_1.safe)(this.getManifestConfig(result.data));
74
+ const extensionConfigResult = await safe(this.getManifestConfig(result.data));
79
75
  if (extensionConfigResult.success !== true) {
80
76
  this.cli.writeError(extensionConfigResult.error);
81
77
  return;
@@ -87,4 +83,3 @@ class ExtensionValidator {
87
83
  });
88
84
  }
89
85
  }
90
- exports.ExtensionValidator = ExtensionValidator;
@@ -1,4 +1,4 @@
1
- import Protocol from "devtools-protocol";
1
+ import { Protocol } from "devtools-protocol";
2
2
  export declare class OriginResponse implements Partial<Protocol.Fetch.FulfillRequestRequest> {
3
3
  readonly responseCode: number;
4
4
  readonly responseHeaders: Protocol.Fetch.HeaderEntry[];
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OriginResponse = void 0;
4
- class OriginResponse {
1
+ export class OriginResponse {
5
2
  responseCode;
6
3
  responseHeaders;
7
4
  body;
@@ -17,4 +14,3 @@ class OriginResponse {
17
14
  return headers;
18
15
  }
19
16
  }
20
- exports.OriginResponse = OriginResponse;
@@ -1,5 +1,5 @@
1
- import { VirtualFileRecipe } from "../../integration-api/integration-api-model";
2
- import { SpeedKitInstallContext } from "./speed-kit-install-context";
1
+ import { VirtualFileRecipe } from "../../integration-api/integration-api-model.js";
2
+ import { SpeedKitInstallContext } from "./speed-kit-install-context.js";
3
3
  export declare class InstallFileRecipe implements VirtualFileRecipe {
4
4
  private installContext;
5
5
  constructor(installContext: SpeedKitInstallContext);
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InstallFileRecipe = void 0;
4
- class InstallFileRecipe {
1
+ export class InstallFileRecipe {
5
2
  installContext;
6
3
  constructor(installContext) {
7
4
  this.installContext = installContext;
@@ -10,4 +7,3 @@ class InstallFileRecipe {
10
7
  return this.installContext.getSpeedKitInstallJs();
11
8
  }
12
9
  }
13
- exports.InstallFileRecipe = InstallFileRecipe;
@@ -1,6 +1,6 @@
1
- import { InstallSpeedKitJsTemplate } from "../templates/install-speed-kit-js-template";
2
- import { BundleService } from "../../bundler";
3
- import { FileListInterface, CustomerConfig } from "../../integration-api";
1
+ import { InstallSpeedKitJsTemplate } from "../templates/install-speed-kit-js-template.js";
2
+ import { BundleService } from "../../bundler/index.js";
3
+ import { FileListInterface, CustomerConfig } from "../../integration-api/index.js";
4
4
  export declare class SpeedKitInstallContext {
5
5
  private customerConfig;
6
6
  private configName;
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SpeedKitInstallContext = void 0;
4
- const files_1 = require("../../../models/files");
1
+ import { INTEGRATION_FILES } from "../../../models/files.js";
5
2
  const IMPORT_PATHS = {
6
3
  rum: "https://www.baqend.com/rum/latest/",
7
4
  "speed-kit": "https://www.baqend.com/speed-kit/latest/",
8
5
  "speed-kit-config": "https://www.baqend.com/speed-kit-config/latest/",
9
6
  "predictive-preloading": "https://www.baqend.com/speed-kit-predictive-preloading/latest/",
10
7
  };
11
- class SpeedKitInstallContext {
8
+ export class SpeedKitInstallContext {
12
9
  customerConfig;
13
10
  configName;
14
11
  files;
@@ -31,7 +28,7 @@ class SpeedKitInstallContext {
31
28
  installParams: this.customerConfig.installParams,
32
29
  domain: this.customerConfig.domain,
33
30
  df: this.files
34
- .getByName(files_1.INTEGRATION_FILES.CUSTOM.DYNAMIC_FETCHER)
31
+ .getByName(INTEGRATION_FILES.CUSTOM.DYNAMIC_FETCHER)
35
32
  .getContent(),
36
33
  });
37
34
  return this.bundler.bundle({
@@ -40,11 +37,12 @@ class SpeedKitInstallContext {
40
37
  "rum.js": this.prepareConfigLoadHandler(),
41
38
  "config.js": configJs,
42
39
  "loader.js": this.files
43
- .getByName(files_1.INTEGRATION_FILES.CUSTOM.LOADER)
40
+ .getByName(INTEGRATION_FILES.CUSTOM.LOADER)
44
41
  .getContent(),
45
42
  },
46
43
  logLevel: "error",
47
44
  minify: false,
45
+ platform: "browser",
48
46
  define: {
49
47
  APP: JSON.stringify(this.customerConfig.app),
50
48
  },
@@ -52,7 +50,7 @@ class SpeedKitInstallContext {
52
50
  }
53
51
  prepareConfigLoadHandler() {
54
52
  return this.files
55
- .getByName(files_1.INTEGRATION_FILES.CONFIG.LOAD_HANDLER)
53
+ .getByName(INTEGRATION_FILES.CONFIG.LOAD_HANDLER)
56
54
  .getContent();
57
55
  // todo reimplement debug package for local use
58
56
  // if (
@@ -68,7 +66,7 @@ class SpeedKitInstallContext {
68
66
  }
69
67
  getConfigSpeedKit() {
70
68
  const configString = this.files
71
- .getByName(files_1.INTEGRATION_FILES.CONFIG.SPEED_KIT)
69
+ .getByName(INTEGRATION_FILES.CONFIG.SPEED_KIT)
72
70
  .getContent();
73
71
  if (!this.isLocalRuntime) {
74
72
  return configString;
@@ -93,7 +91,7 @@ class SpeedKitInstallContext {
93
91
  basePaths: {},
94
92
  entryPoints: {
95
93
  "dynamicFetcher.js": this.files
96
- .getByName(files_1.INTEGRATION_FILES.CUSTOM.DYNAMIC_FETCHER)
94
+ .getByName(INTEGRATION_FILES.CUSTOM.DYNAMIC_FETCHER)
97
95
  .getContent(),
98
96
  },
99
97
  target: "es6",
@@ -103,4 +101,3 @@ class SpeedKitInstallContext {
103
101
  });
104
102
  }
105
103
  }
106
- exports.SpeedKitInstallContext = SpeedKitInstallContext;
@@ -1,7 +1,7 @@
1
- import { DiffService } from "../../diff";
2
- import { DocumentHandlerServer } from "../../document-handler-runtime/document-handler-server";
3
- import { Crawler } from "../virtual-orestes-app/crawler";
4
- import { CliService } from "../../cli";
1
+ import { DiffService } from "../../diff/index.js";
2
+ import { DocumentHandlerServer } from "../../document-handler-runtime/document-handler-server.js";
3
+ import { Crawler } from "../virtual-orestes-app/crawler.js";
4
+ import { CliService } from "../../cli/index.js";
5
5
  export declare class DiffAgainstCurrentPage {
6
6
  private diffService;
7
7
  private documentHandlerRuntime;
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DiffAgainstCurrentPage = void 0;
4
- const cli_1 = require("../../cli");
5
- const html_format_helper_1 = require("../../../helpers/html-format-helper");
6
- class DiffAgainstCurrentPage {
1
+ import { formatHtml } from "../../../helpers/html-format-helper.js";
2
+ export class DiffAgainstCurrentPage {
7
3
  diffService;
8
4
  documentHandlerRuntime;
9
5
  crawler;
@@ -16,15 +12,15 @@ class DiffAgainstCurrentPage {
16
12
  }
17
13
  async postDiff(currentHtml, currentUrl, variant = "default", transform = false) {
18
14
  this.cli.writeWarning(`received diff for url: ${currentUrl}`);
19
- this.cli.startAction(`fetch remote`);
15
+ this.cli.startAction(`DIFF:FETCH:FILE:${currentUrl}`, `fetch remote`);
20
16
  const originResponse = await this.crawler.fetchRemote(currentUrl, variant);
21
17
  let originHtml = await originResponse?.text();
22
18
  if (!originHtml) {
23
- this.cli.endAction(cli_1.CliActionStatus.FAILED);
19
+ this.cli.failAction(`DIFF:FETCH:FILE:${currentUrl}`);
24
20
  throw new Error("Could not fetch remote page");
25
21
  }
26
- this.cli.endAction(cli_1.CliActionStatus.COMPLETED);
27
- this.cli.startAction(`transform documents`);
22
+ this.cli.successAction(`DIFF:FETCH:FILE:${currentUrl}`);
23
+ this.cli.startAction(`DIFF:TRANSFORM:FILE:${currentUrl}`, `transform documents`);
28
24
  if (transform) {
29
25
  // todo check if the currentHTML is already transformed
30
26
  // TODO: we may need to forward the correct content type from the origin response
@@ -42,10 +38,9 @@ class DiffAgainstCurrentPage {
42
38
  }
43
39
  originHtml = originResponse;
44
40
  }
45
- this.cli.endAction(cli_1.CliActionStatus.COMPLETED);
46
- const remoteFilePath = await this.diffService.writeContentToTemporalFile(`remote-${variant}.html`, (0, html_format_helper_1.formatHtml)(originHtml));
47
- const localFilePath = await this.diffService.writeContentToTemporalFile("current.html", (0, html_format_helper_1.formatHtml)(currentHtml));
41
+ this.cli.successAction(`DIFF:TRANSFORM:FILE:${currentUrl}`);
42
+ const remoteFilePath = await this.diffService.writeContentToTemporalFile(`remote-${variant}.html`, formatHtml(originHtml));
43
+ const localFilePath = await this.diffService.writeContentToTemporalFile("current.html", formatHtml(currentHtml));
48
44
  return await this.diffService.executeDiff(remoteFilePath, localFilePath);
49
45
  }
50
46
  }
51
- exports.DiffAgainstCurrentPage = DiffAgainstCurrentPage;
@@ -1,11 +1,11 @@
1
- import { BaqendResponse } from "../browser/baqend-response";
1
+ import { BaqendResponse } from "../browser/baqend-response.js";
2
2
  import { Protocol } from "devtools-protocol";
3
- import { ParameterQueryBuilder } from "./parameter-query-builder";
4
- import { CustomerConfig } from "../../integration-api";
5
- import { RequestDiffService } from "./request-diff-service";
6
- import { Cache } from "../request-cache/cache";
7
- import { AthenaService } from "../../athena";
8
- import { DiffAgainstCurrentPage } from "./diff-against-current-page";
3
+ import { ParameterQueryBuilder } from "./parameter-query-builder.js";
4
+ import { CustomerConfig } from "../../integration-api/index.js";
5
+ import { RequestDiffService } from "./request-diff-service.js";
6
+ import { Cache } from "../request-cache/cache.js";
7
+ import { AthenaService } from "../../athena/index.js";
8
+ import { DiffAgainstCurrentPage } from "./diff-against-current-page.js";
9
9
  export declare class Dashboard {
10
10
  private customerConfig;
11
11
  private parameterQueryBuilder;
@@ -1,11 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Dashboard = void 0;
4
- const tslib_1 = require("tslib");
5
- const baqend_response_1 = require("../browser/baqend-response");
6
- const safe_1 = require("../../../helpers/safe");
7
- const json2csv_1 = tslib_1.__importDefault(require("json2csv"));
8
- class Dashboard {
1
+ import { BaqendResponse } from "../browser/baqend-response.js";
2
+ import { safe } from "../../../helpers/safe.js";
3
+ import json2Csv from "json2csv";
4
+ export class Dashboard {
9
5
  customerConfig;
10
6
  parameterQueryBuilder;
11
7
  athenaClient;
@@ -36,7 +32,7 @@ class Dashboard {
36
32
  if (url.pathname.startsWith("/query/execute")) {
37
33
  const postData = request.postData;
38
34
  const data = JSON.parse(postData);
39
- const response = await (0, safe_1.safe)(this.athenaClient.getResult(data.query, []));
35
+ const response = await safe(this.athenaClient.getResult(data.query, []));
40
36
  if (response.success === true) {
41
37
  return this.createBaqendResponse(requestOrigin, JSON.stringify(response.data), "application/json; charset=UTF-8");
42
38
  }
@@ -45,7 +41,7 @@ class Dashboard {
45
41
  // @todo reImplement getLastResult
46
42
  if (url.pathname.startsWith("/query/download")) {
47
43
  const result = this.athenaLastResult;
48
- const csv = json2csv_1.default.parse(result, {
44
+ const csv = json2Csv.parse(result, {
49
45
  fields: [
50
46
  "paramKeys",
51
47
  "potentialGain",
@@ -78,7 +74,7 @@ class Dashboard {
78
74
  const currentUrl = data.currentUrl;
79
75
  const variant = data.variant || "DEFAULT";
80
76
  const transform = data.transform || false;
81
- const diffResult = await (0, safe_1.safe)(this.currentPageDiff.postDiff(currentHtml, currentUrl, variant, transform));
77
+ const diffResult = await safe(this.currentPageDiff.postDiff(currentHtml, currentUrl, variant, transform));
82
78
  if (diffResult.success === true) {
83
79
  return this.createBaqendResponse(requestOrigin, JSON.stringify({ success: diffResult.data }), "application/json; charset=UTF-8", [], 200);
84
80
  }
@@ -101,7 +97,6 @@ class Dashboard {
101
97
  name: "Access-Control-Allow-Headers",
102
98
  value: "Content-Type,Access-Control-Allow-Origin,origin",
103
99
  });
104
- return new baqend_response_1.BaqendResponse(body, contentType, headers, status);
100
+ return new BaqendResponse(body, contentType, headers, status);
105
101
  }
106
102
  }
107
- exports.Dashboard = Dashboard;
@@ -1,4 +1,4 @@
1
- import { CustomerConfig, ConfigFileInterface } from "../../integration-api";
1
+ import { CustomerConfig, ConfigFileInterface } from "../../integration-api/index.js";
2
2
  export declare class ParameterQueryBuilder {
3
3
  private customerConfig;
4
4
  private speedKitConfigFile;
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ParameterQueryBuilder = void 0;
4
- const build_query_helper_1 = require("../../../helpers/build-query-helper");
5
- const get_parsed_config_1 = require("../../../helpers/get-parsed-config");
6
- class ParameterQueryBuilder {
1
+ import { getBlacklistedFilter, getParameterFilter, getParameterReplaceFilter, getStrippedParameters, getWhitelistedFilter, } from "../../../helpers/build-query-helper.js";
2
+ import { parseSpeedKitConfig } from "../../../helpers/get-parsed-config.js";
3
+ export class ParameterQueryBuilder {
7
4
  customerConfig;
8
5
  speedKitConfigFile;
9
6
  constructor(customerConfig, speedKitConfigFile) {
@@ -55,13 +52,12 @@ order by case when potentialGain > cachedUrls and potentialGain > PIs then poten
55
52
  else PIs end desc`;
56
53
  }
57
54
  getQuery() {
58
- const parsedConfig = (0, get_parsed_config_1.parseSpeedKitConfig)(this.speedKitConfigFile.getContent());
59
- const parameters = (0, build_query_helper_1.getStrippedParameters)(parsedConfig);
60
- const parameterFilter = (0, build_query_helper_1.getParameterFilter)(parameters);
61
- const whitelistedFilter = (0, build_query_helper_1.getWhitelistedFilter)(parsedConfig);
62
- const blacklistedFilter = (0, build_query_helper_1.getBlacklistedFilter)(parsedConfig);
63
- const parameterReplaceFilter = (0, build_query_helper_1.getParameterReplaceFilter)(parameters);
55
+ const parsedConfig = parseSpeedKitConfig(this.speedKitConfigFile.getContent());
56
+ const parameters = getStrippedParameters(parsedConfig);
57
+ const parameterFilter = getParameterFilter(parameters);
58
+ const whitelistedFilter = getWhitelistedFilter(parsedConfig);
59
+ const blacklistedFilter = getBlacklistedFilter(parsedConfig);
60
+ const parameterReplaceFilter = getParameterReplaceFilter(parameters);
64
61
  return this.buildParameterQuery(this.customerConfig.app, parameterFilter, whitelistedFilter, blacklistedFilter, parameterReplaceFilter);
65
62
  }
66
63
  }
67
- exports.ParameterQueryBuilder = ParameterQueryBuilder;
@@ -1,6 +1,6 @@
1
- import { DiffService } from "../../diff";
2
- import { BaqendResponse } from "../browser/baqend-response";
3
- import { DocumentHandlerServer } from "../../document-handler-runtime/document-handler-server";
1
+ import { DiffService } from "../../diff/index.js";
2
+ import { BaqendResponse } from "../browser/baqend-response.js";
3
+ import { DocumentHandlerServer } from "../../document-handler-runtime/document-handler-server.js";
4
4
  export declare class RequestDiffService {
5
5
  private diffService;
6
6
  private documentHandlerRuntime;
@@ -1,14 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RequestDiffService = void 0;
4
- const tslib_1 = require("tslib");
5
- const baqend_response_1 = require("../browser/baqend-response");
6
- const safe_1 = require("../../../helpers/safe");
7
- const node_https_1 = require("node:https");
8
- const node_crypto_1 = tslib_1.__importDefault(require("node:crypto"));
9
- const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
10
- const html_format_helper_1 = require("../../../helpers/html-format-helper");
11
- class RequestDiffService {
1
+ import { BaqendResponse } from "../browser/baqend-response.js";
2
+ import { safe } from "../../../helpers/safe.js";
3
+ import { Agent } from "node:https";
4
+ import crypto from "node:crypto";
5
+ import fetch from "node-fetch";
6
+ import { formatHtml } from "../../../helpers/html-format-helper.js";
7
+ export class RequestDiffService {
12
8
  diffService;
13
9
  documentHandlerRuntime;
14
10
  constructor(diffService, documentHandlerRuntime) {
@@ -24,7 +20,7 @@ class RequestDiffService {
24
20
  return parameter.trim();
25
21
  });
26
22
  const { urlWithParam, urlWithoutParam } = this.createUrlsForDiff(url, parameters);
27
- const result = await (0, safe_1.safe)(this.diffLocal(urlWithParam, urlWithoutParam, autoCheck));
23
+ const result = await safe(this.diffLocal(urlWithParam, urlWithoutParam, autoCheck));
28
24
  if (result.success === true) {
29
25
  return this.createBaqendResponse(requestOrigin, JSON.stringify({
30
26
  status: "success",
@@ -60,17 +56,17 @@ class RequestDiffService {
60
56
  if (checkIsEqual) {
61
57
  return this.diffService.isContentEqual(transformedHtmlWithParameter, transformedHtmlWithoutParameter);
62
58
  }
63
- const parametersFilePath = await this.diffService.writeContentToTemporalFile("params", (0, html_format_helper_1.formatHtml)(transformedHtmlWithParameter));
64
- const pureFilePath = await this.diffService.writeContentToTemporalFile("pure", (0, html_format_helper_1.formatHtml)(transformedHtmlWithoutParameter));
59
+ const parametersFilePath = await this.diffService.writeContentToTemporalFile("params", formatHtml(transformedHtmlWithParameter));
60
+ const pureFilePath = await this.diffService.writeContentToTemporalFile("pure", formatHtml(transformedHtmlWithoutParameter));
65
61
  return await this.diffService.executeDiff(parametersFilePath, pureFilePath);
66
62
  }
67
63
  async fetchHtml(url) {
68
- const agent = new node_https_1.Agent({
64
+ const agent = new Agent({
69
65
  rejectUnauthorized: false,
70
66
  keepAlive: true,
71
- secureOptions: node_crypto_1.default.constants.SSL_OP_LEGACY_SERVER_CONNECT,
67
+ secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT,
72
68
  });
73
- const response = await (0, safe_1.safe)((0, node_fetch_1.default)(url, {
69
+ const response = await safe(fetch(url, {
74
70
  agent: agent,
75
71
  headers: {
76
72
  "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36 SpeedKitCrawler/1.0",
@@ -103,7 +99,6 @@ class RequestDiffService {
103
99
  name: "Access-Control-Allow-Headers",
104
100
  value: "Content-Type,Access-Control-Allow-Origin,origin",
105
101
  });
106
- return new baqend_response_1.BaqendResponse(body, contentType, headers, status);
102
+ return new BaqendResponse(body, contentType, headers, status);
107
103
  }
108
104
  }
109
- exports.RequestDiffService = RequestDiffService;
@@ -1,4 +1,4 @@
1
- import { PrettyPrintableError } from "@oclif/core/lib/errors";
1
+ import { PrettyPrintableError } from "@oclif/core/errors";
2
2
  export declare class BrowserExtensionError extends Error implements PrettyPrintableError {
3
3
  readonly code = "BROWSER_EXTENSION_ERROR";
4
4
  readonly suggestions: string[];
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BrowserExtensionError = void 0;
4
- class BrowserExtensionError extends Error {
1
+ export class BrowserExtensionError extends Error {
5
2
  code = "BROWSER_EXTENSION_ERROR";
6
3
  suggestions = [
7
4
  "check paths in env $CHROME_EXTENSION_PATHS",
@@ -9,4 +6,3 @@ class BrowserExtensionError extends Error {
9
6
  `"chromeExtensionPaths:" in .config/speed-kit-cli/config.js`,
10
7
  ];
11
8
  }
12
- exports.BrowserExtensionError = BrowserExtensionError;
@@ -1,11 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DocumentHandlerTransformError = void 0;
4
- class DocumentHandlerTransformError extends Error {
1
+ export class DocumentHandlerTransformError extends Error {
5
2
  constructor(error) {
6
3
  super(error.message);
7
4
  this.stack = error.stack;
8
5
  this.cause = error.cause;
9
6
  }
10
7
  }
11
- exports.DocumentHandlerTransformError = DocumentHandlerTransformError;
@@ -1,4 +1,4 @@
1
- import ApplicationError from "../../error-handling/error/application-error";
1
+ import ApplicationError from "../../error-handling/error/application-error.js";
2
2
  export declare class UnsupportedEncodingError extends ApplicationError {
3
3
  readonly code = "REQUEST_ENCODING_UNSUPPORTED";
4
4
  readonly suggestions: string[];
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnsupportedEncodingError = void 0;
4
- const tslib_1 = require("tslib");
5
- const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
6
- class UnsupportedEncodingError extends application_error_1.default {
1
+ import ApplicationError from "../../error-handling/error/application-error.js";
2
+ export class UnsupportedEncodingError extends ApplicationError {
7
3
  code = "REQUEST_ENCODING_UNSUPPORTED";
8
4
  suggestions = [
9
5
  "Needs to be fixed by a developer.",
@@ -11,4 +7,3 @@ class UnsupportedEncodingError extends application_error_1.default {
11
7
  "If iconv can't handle it we need a special library",
12
8
  ];
13
9
  }
14
- exports.UnsupportedEncodingError = UnsupportedEncodingError;
@@ -1,4 +1,4 @@
1
- import ApplicationError from "../../error-handling/error/application-error";
1
+ import ApplicationError from "../../error-handling/error/application-error.js";
2
2
  export declare class ValidateExtensionError extends ApplicationError {
3
3
  readonly code = "VALIDATE_EXTENSION_ERROR";
4
4
  constructor(localVersion: string, remoteVersion: string);
@@ -1,12 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ValidateExtensionError = void 0;
4
- const tslib_1 = require("tslib");
5
- const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
6
- class ValidateExtensionError extends application_error_1.default {
1
+ import ApplicationError from "../../error-handling/error/application-error.js";
2
+ export class ValidateExtensionError extends ApplicationError {
7
3
  code = "VALIDATE_EXTENSION_ERROR";
8
4
  constructor(localVersion, remoteVersion) {
9
5
  super(`Unable to validate Versions: "${localVersion}" - "${remoteVersion}"`);
10
6
  }
11
7
  }
12
- exports.ValidateExtensionError = ValidateExtensionError;
@@ -1,4 +1,4 @@
1
- import ApplicationError from "../../error-handling/error/application-error";
1
+ import ApplicationError from "../../error-handling/error/application-error.js";
2
2
  export declare class VmEmptyResponseError extends ApplicationError {
3
3
  readonly code = "VM_EMPTY_RESPONSE_ERROR";
4
4
  readonly suggestions: string[];
@@ -1,12 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VmEmptyResponseError = void 0;
4
- const tslib_1 = require("tslib");
5
- const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
6
- class VmEmptyResponseError extends application_error_1.default {
1
+ import ApplicationError from "../../error-handling/error/application-error.js";
2
+ export class VmEmptyResponseError extends ApplicationError {
7
3
  code = "VM_EMPTY_RESPONSE_ERROR";
8
4
  suggestions = [
9
5
  "You may forgot to return html somewhere, check config_documentHandler!",
10
6
  ];
11
7
  }
12
- exports.VmEmptyResponseError = VmEmptyResponseError;
@@ -1,4 +1,4 @@
1
- import ApplicationError from "../../error-handling/error/application-error";
1
+ import ApplicationError from "../../error-handling/error/application-error.js";
2
2
  export declare class VmError extends ApplicationError {
3
3
  readonly code = "VM_FILE_ERROR";
4
4
  }
@@ -1,9 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VmError = void 0;
4
- const tslib_1 = require("tslib");
5
- const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
6
- class VmError extends application_error_1.default {
1
+ import ApplicationError from "../../error-handling/error/application-error.js";
2
+ export class VmError extends ApplicationError {
7
3
  code = "VM_FILE_ERROR";
8
4
  }
9
- exports.VmError = VmError;
@@ -1,9 +1,9 @@
1
- import { FetchRequestPausedEventHandler } from "./onboarding-model";
1
+ import { FetchRequestPausedEventHandler } from "./onboarding-model.js";
2
2
  import { Protocol } from "puppeteer-core";
3
3
  import { CDPSession, Target } from "puppeteer";
4
- import { CliService } from "../cli";
5
- import { CustomerConfig } from "../integration-api";
6
- import { ConfigApiService } from "../config-api";
4
+ import { CliService } from "../cli/index.js";
5
+ import { CustomerConfig } from "../integration-api/index.js";
6
+ import { ConfigApiService } from "../config-api/index.js";
7
7
  export declare class FetchEventHandler {
8
8
  private browserFetchEvents;
9
9
  private customerConfig;