@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,32 +1,29 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const chai_1 = require("chai");
5
- const mocha_1 = require("mocha");
6
- const integration_api_model_1 = require("../integration-api-model");
7
- const integration_api_service_1 = require("../integration-api-service");
8
- const file_reader_1 = tslib_1.__importDefault(require("../file-reader"));
9
- const memfs_1 = require("memfs");
10
- const cli_1 = require("../../cli");
11
- const file_writer_1 = tslib_1.__importDefault(require("../file-writer"));
12
- const mandatory_files_validator_1 = tslib_1.__importDefault(require("../validator/mandatory-files-validator"));
13
- const customer_config_handler_1 = tslib_1.__importDefault(require("../handler/customer-config-handler"));
14
- const customer_config_validator_1 = tslib_1.__importDefault(require("../validator/customer-config-validator"));
15
- const install_resource_handler_1 = tslib_1.__importDefault(require("../handler/install-resource-handler"));
16
- const static_recipe_1 = require("../virtual/static-recipe");
1
+ import { expect } from "chai";
2
+ import { after, before, describe, it } from "mocha";
3
+ import { VirtualFileHandler, } from "../integration-api-model.js";
4
+ import { IntegrationApiService } from "../integration-api-service.js";
5
+ import FileReader from "../file-reader.js";
6
+ import { fs, vol } from "memfs";
7
+ import { CliServiceFactory } from "../../cli/index.js";
8
+ import FileWriter from "../file-writer.js";
9
+ import MandatoryFilesValidator from "../validator/mandatory-files-validator.js";
10
+ import CustomerConfigHandler from "../handler/customer-config-handler.js";
11
+ import CustomerConfigValidator from "../validator/customer-config-validator.js";
12
+ import InstallResourceHandler from "../handler/install-resource-handler.js";
13
+ import { StaticRecipe } from "../virtual/static-recipe.js";
17
14
  const afterTest = () => {
18
- memfs_1.vol.reset();
15
+ vol.reset();
19
16
  };
20
17
  function prepareDependencies() {
21
- const cli = new cli_1.CliServiceFactory().getService();
22
- const virtualFileHandler = new integration_api_model_1.VirtualFileHandler(cli);
18
+ const cli = new CliServiceFactory().getService();
19
+ const virtualFileHandler = new VirtualFileHandler(cli);
23
20
  // @ts-expect-error fs is not compatible
24
- const fileReader = new file_reader_1.default(memfs_1.fs, "test", "/test_customer", [], []);
25
- const fileWriter = new file_writer_1.default(memfs_1.fs, "/test_customer/");
26
- const validator = new mandatory_files_validator_1.default();
27
- const customerConfigValidator = new customer_config_validator_1.default();
28
- const customerConfigHandler = new customer_config_handler_1.default(fileReader, cli, customerConfigValidator, "test", "test");
29
- const installResourceHandler = new install_resource_handler_1.default(fileReader);
21
+ const fileReader = new FileReader(fs, "test", "/test_customer", [], []);
22
+ const fileWriter = new FileWriter(fs, "/test_customer/");
23
+ const validator = new MandatoryFilesValidator();
24
+ const customerConfigValidator = new CustomerConfigValidator();
25
+ const customerConfigHandler = new CustomerConfigHandler(fileReader, cli, customerConfigValidator, "test", "test");
26
+ const installResourceHandler = new InstallResourceHandler(fileReader);
30
27
  return {
31
28
  virtualFileHandler,
32
29
  fileReader,
@@ -36,8 +33,8 @@ function prepareDependencies() {
36
33
  installResourceHandler,
37
34
  };
38
35
  }
39
- (0, mocha_1.describe)("integration service run", () => {
40
- (0, mocha_1.before)(() => {
36
+ describe("integration service run", () => {
37
+ before(() => {
41
38
  const customerJson = {
42
39
  $schema: "../../sk-typings/customerConfig.schema.json",
43
40
  test: {
@@ -52,7 +49,7 @@ function prepareDependencies() {
52
49
  forceInstall: true,
53
50
  },
54
51
  };
55
- memfs_1.vol.fromNestedJSON({
52
+ vol.fromNestedJSON({
56
53
  "/test_customer": {
57
54
  "config_customer.json": `${JSON.stringify(customerJson)}`,
58
55
  "config_SpeedKit.js": "",
@@ -63,70 +60,70 @@ function prepareDependencies() {
63
60
  },
64
61
  });
65
62
  });
66
- (0, mocha_1.after)(afterTest);
67
- (0, mocha_1.it)("no handler found for file", (done) => {
63
+ after(afterTest);
64
+ it("no handler found for file", (done) => {
68
65
  const { virtualFileHandler, fileReader, fileWriter, validator } = prepareDependencies();
69
- const integrationApiService = new integration_api_service_1.IntegrationApiService(fileReader, virtualFileHandler, validator, [], fileWriter, true);
66
+ const integrationApiService = new IntegrationApiService(fileReader, virtualFileHandler, validator, [], fileWriter, true);
70
67
  integrationApiService
71
68
  .run()
72
69
  .then((fileList) => {
73
70
  // Assert that our function returned the correct value
74
- (0, chai_1.expect)(fileList.files.length).to.equal(0);
71
+ expect(fileList.files.length).to.equal(0);
75
72
  done();
76
73
  })
77
74
  .catch((error) => {
78
- (0, chai_1.expect)(error.message).to.include("No handler found");
75
+ expect(error.message).to.include("No handler found");
79
76
  done();
80
77
  });
81
78
  });
82
- (0, mocha_1.it)("find 6 files", (done) => {
79
+ it("find 6 files", (done) => {
83
80
  const { virtualFileHandler, fileReader, fileWriter, validator, customerConfigHandler, installResourceHandler, } = prepareDependencies();
84
- const integrationApiService = new integration_api_service_1.IntegrationApiService(fileReader, virtualFileHandler, validator, [customerConfigHandler, installResourceHandler], fileWriter, true);
81
+ const integrationApiService = new IntegrationApiService(fileReader, virtualFileHandler, validator, [customerConfigHandler, installResourceHandler], fileWriter, true);
85
82
  integrationApiService
86
83
  .run()
87
84
  .then((fileList) => {
88
85
  // Assert that our function returned the correct value
89
- (0, chai_1.expect)(fileList.files.length).to.equal(6);
86
+ expect(fileList.files.length).to.equal(6);
90
87
  done();
91
88
  })
92
89
  .catch((error) => {
93
90
  done(error);
94
91
  });
95
92
  });
96
- (0, mocha_1.it)("find virtual file", (done) => {
93
+ it("find virtual file", (done) => {
97
94
  const { virtualFileHandler, fileReader, fileWriter, validator, customerConfigHandler, installResourceHandler, } = prepareDependencies();
98
- const integrationApiService = new integration_api_service_1.IntegrationApiService(fileReader, virtualFileHandler, validator, [customerConfigHandler, installResourceHandler], fileWriter, true);
95
+ const integrationApiService = new IntegrationApiService(fileReader, virtualFileHandler, validator, [customerConfigHandler, installResourceHandler], fileWriter, true);
99
96
  integrationApiService
100
97
  .run([
101
98
  {
102
99
  name: "my_virtual_file",
103
- recipe: new static_recipe_1.StaticRecipe("my_virtual_file_content"),
100
+ recipe: new StaticRecipe("my_virtual_file_content"),
104
101
  },
105
102
  ])
106
103
  .then((fileList) => {
107
104
  // Assert that our function returned the correct value
108
- (0, chai_1.expect)(fileList.getByName("my_virtual_file").getContent()).to.equal("my_virtual_file_content");
105
+ expect(fileList.getByName("my_virtual_file").getContent()).to.equal("my_virtual_file_content");
109
106
  done();
110
107
  })
111
108
  .catch((error) => {
112
109
  done(error);
113
110
  });
114
111
  });
115
- (0, mocha_1.it)("override local file with virtual file", (done) => {
112
+ it("override local file with virtual file", (done) => {
116
113
  const { virtualFileHandler, fileReader, fileWriter, validator, customerConfigHandler, installResourceHandler, } = prepareDependencies();
117
- const integrationApiService = new integration_api_service_1.IntegrationApiService(fileReader, virtualFileHandler, validator, [customerConfigHandler, installResourceHandler], fileWriter, true);
114
+ const integrationApiService = new IntegrationApiService(fileReader, virtualFileHandler, validator, [customerConfigHandler, installResourceHandler], fileWriter, true);
118
115
  integrationApiService
119
116
  .run([
120
117
  {
121
118
  name: "custom_sw",
122
- recipe: new static_recipe_1.StaticRecipe("my_virtual_file_content"),
119
+ recipe: new StaticRecipe("my_virtual_file_content"),
123
120
  overrideLocalFile: true,
124
121
  },
125
122
  ])
126
123
  .then((fileList) => {
127
124
  // Assert that our function returned the correct value
128
- (0, chai_1.expect)(fileList.getByName("custom_sw").getContent()).to.equal("my_virtual_file_content");
129
- (0, chai_1.expect)(fileList.files.length).to.equal(6);
125
+ expect(fileList.getByName("custom_sw").getContent()).to.equal("my_virtual_file_content");
126
+ expect(fileList.files.length).to.equal(6);
130
127
  done();
131
128
  })
132
129
  .catch((error) => {
@@ -1,106 +1,103 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const chai_1 = require("chai");
5
- const mocha_1 = require("mocha");
6
- const mandatory_files_validator_1 = tslib_1.__importDefault(require("../validator/mandatory-files-validator"));
7
- const file_list_1 = tslib_1.__importDefault(require("../file-list"));
8
- const customer_config_file_1 = require("../struct/customer-config-file");
9
- const install_resource_file_1 = require("../struct/install-resource-file");
10
- const files_1 = require("../../../models/files");
11
- const mandatory_file_missing_error_1 = tslib_1.__importDefault(require("../error/mandatory-file-missing-error"));
1
+ import { expect } from "chai";
2
+ import { describe, it } from "mocha";
3
+ import MandatoryFilesValidator from "../validator/mandatory-files-validator.js";
4
+ import FileList from "../file-list.js";
5
+ import { CustomerConfigFile } from "../struct/customer-config-file.js";
6
+ import { InstallResourceFile } from "../struct/install-resource-file.js";
7
+ import { INTEGRATION_FILES } from "../../../models/files.js";
8
+ import MandatoryFileMissingError from "../error/mandatory-file-missing-error.js";
12
9
  function addFileCustomerConfig(fileList) {
13
- fileList.addFile(new customer_config_file_1.CustomerConfigFile(files_1.INTEGRATION_FILES.CONFIG.CUSTOMER, "", "", {}, "test"));
10
+ fileList.addFile(new CustomerConfigFile(INTEGRATION_FILES.CONFIG.CUSTOMER, "", "", {}, "test"));
14
11
  }
15
12
  function addFileDynamicStyles(fileList) {
16
- fileList.addFile(new install_resource_file_1.InstallResourceFile(files_1.INTEGRATION_FILES.CONFIG.DYNAMIC_STYLES, "", "", ""));
13
+ fileList.addFile(new InstallResourceFile(INTEGRATION_FILES.CONFIG.DYNAMIC_STYLES, "", "", ""));
17
14
  }
18
15
  function addFileAssetHandler(fileList) {
19
- fileList.addFile(new install_resource_file_1.InstallResourceFile(files_1.INTEGRATION_FILES.DEPRECATED.ASSET_HANDLER, "", "", ""));
16
+ fileList.addFile(new InstallResourceFile(INTEGRATION_FILES.DEPRECATED.ASSET_HANDLER, "", "", ""));
20
17
  }
21
18
  function addFileDynamicBlocks(fileList) {
22
- fileList.addFile(new install_resource_file_1.InstallResourceFile(files_1.INTEGRATION_FILES.CONFIG.DYNAMIC_BLOCKS, "", "", ""));
19
+ fileList.addFile(new InstallResourceFile(INTEGRATION_FILES.CONFIG.DYNAMIC_BLOCKS, "", "", ""));
23
20
  }
24
21
  function addFileSpeedKit(fileList) {
25
- fileList.addFile(new install_resource_file_1.InstallResourceFile(files_1.INTEGRATION_FILES.CONFIG.SPEED_KIT, "", "", ""));
22
+ fileList.addFile(new InstallResourceFile(INTEGRATION_FILES.CONFIG.SPEED_KIT, "", "", ""));
26
23
  }
27
24
  function addFileDocumentHandler(fileList) {
28
- fileList.addFile(new install_resource_file_1.InstallResourceFile(files_1.INTEGRATION_FILES.CONFIG.DOCUMENT_HANDLER, "", "", ""));
25
+ fileList.addFile(new InstallResourceFile(INTEGRATION_FILES.CONFIG.DOCUMENT_HANDLER, "", "", ""));
29
26
  }
30
- (0, mocha_1.describe)("mandatory_files_validator validate", () => {
31
- (0, mocha_1.it)("documentHandler -> should have no errors", () => {
32
- const validator = new mandatory_files_validator_1.default();
33
- const fileList = new file_list_1.default();
27
+ describe("mandatory_files_validator validate", () => {
28
+ it("documentHandler -> should have no errors", () => {
29
+ const validator = new MandatoryFilesValidator();
30
+ const fileList = new FileList();
34
31
  addFileCustomerConfig(fileList);
35
32
  addFileDynamicStyles(fileList);
36
33
  addFileDynamicBlocks(fileList);
37
34
  addFileSpeedKit(fileList);
38
35
  addFileDocumentHandler(fileList);
39
36
  validator.validate(fileList);
40
- (0, chai_1.expect)(true).to.be.true;
37
+ expect(true).to.be.true;
41
38
  });
42
- (0, mocha_1.it)("assetHandler -> should have no errors", () => {
43
- const validator = new mandatory_files_validator_1.default();
44
- const fileList = new file_list_1.default();
39
+ it("assetHandler -> should have no errors", () => {
40
+ const validator = new MandatoryFilesValidator();
41
+ const fileList = new FileList();
45
42
  addFileCustomerConfig(fileList);
46
43
  addFileSpeedKit(fileList);
47
44
  addFileAssetHandler(fileList);
48
45
  validator.validate(fileList);
49
- (0, chai_1.expect)(true).to.be.true;
46
+ expect(true).to.be.true;
50
47
  });
51
- (0, mocha_1.it)("throw error -> customerConfigMissing", () => {
52
- const validator = new mandatory_files_validator_1.default();
53
- const fileList = new file_list_1.default();
48
+ it("throw error -> customerConfigMissing", () => {
49
+ const validator = new MandatoryFilesValidator();
50
+ const fileList = new FileList();
54
51
  addFileDynamicStyles(fileList);
55
52
  addFileAssetHandler(fileList);
56
53
  addFileDynamicBlocks(fileList);
57
54
  addFileSpeedKit(fileList);
58
- (0, chai_1.expect)(() => {
55
+ expect(() => {
59
56
  validator.validate(fileList);
60
- }).to.throw(`Mandatory file "${files_1.INTEGRATION_FILES.CONFIG.CUSTOMER}" is missing`);
57
+ }).to.throw(`Mandatory file "${INTEGRATION_FILES.CONFIG.CUSTOMER}" is missing`);
61
58
  });
62
- (0, mocha_1.it)("throw error -> skConfigMissing", () => {
63
- const validator = new mandatory_files_validator_1.default();
64
- const fileList = new file_list_1.default();
59
+ it("throw error -> skConfigMissing", () => {
60
+ const validator = new MandatoryFilesValidator();
61
+ const fileList = new FileList();
65
62
  addFileCustomerConfig(fileList);
66
63
  addFileDynamicStyles(fileList);
67
64
  addFileAssetHandler(fileList);
68
65
  addFileDynamicBlocks(fileList);
69
- (0, chai_1.expect)(() => {
66
+ expect(() => {
70
67
  validator.validate(fileList);
71
- }).to.throw(`Mandatory file "${files_1.INTEGRATION_FILES.CONFIG.SPEED_KIT}" is missing`);
68
+ }).to.throw(`Mandatory file "${INTEGRATION_FILES.CONFIG.SPEED_KIT}" is missing`);
72
69
  });
73
- (0, mocha_1.it)("throw error -> skStyles are missing", () => {
74
- const validator = new mandatory_files_validator_1.default();
75
- const fileList = new file_list_1.default();
70
+ it("throw error -> skStyles are missing", () => {
71
+ const validator = new MandatoryFilesValidator();
72
+ const fileList = new FileList();
76
73
  addFileCustomerConfig(fileList);
77
74
  addFileDocumentHandler(fileList);
78
75
  addFileDynamicBlocks(fileList);
79
76
  addFileSpeedKit(fileList);
80
- (0, chai_1.expect)(() => {
77
+ expect(() => {
81
78
  validator.validate(fileList);
82
- }).to.throw(mandatory_file_missing_error_1.default);
79
+ }).to.throw(MandatoryFileMissingError);
83
80
  });
84
- (0, mocha_1.it)("throw error -> dynamicBlocks are missing", () => {
85
- const validator = new mandatory_files_validator_1.default();
86
- const fileList = new file_list_1.default();
81
+ it("throw error -> dynamicBlocks are missing", () => {
82
+ const validator = new MandatoryFilesValidator();
83
+ const fileList = new FileList();
87
84
  addFileCustomerConfig(fileList);
88
85
  addFileDocumentHandler(fileList);
89
86
  addFileDynamicStyles(fileList);
90
87
  addFileSpeedKit(fileList);
91
- (0, chai_1.expect)(() => {
88
+ expect(() => {
92
89
  validator.validate(fileList);
93
- }).to.throw(mandatory_file_missing_error_1.default);
90
+ }).to.throw(MandatoryFileMissingError);
94
91
  });
95
- (0, mocha_1.it)("throw error -> documentHandler is missing", () => {
96
- const validator = new mandatory_files_validator_1.default();
97
- const fileList = new file_list_1.default();
92
+ it("throw error -> documentHandler is missing", () => {
93
+ const validator = new MandatoryFilesValidator();
94
+ const fileList = new FileList();
98
95
  addFileCustomerConfig(fileList);
99
96
  addFileDynamicBlocks(fileList);
100
97
  addFileDynamicStyles(fileList);
101
98
  addFileSpeedKit(fileList);
102
- (0, chai_1.expect)(() => {
99
+ expect(() => {
103
100
  validator.validate(fileList);
104
- }).to.throw(mandatory_file_missing_error_1.default);
101
+ }).to.throw(MandatoryFileMissingError);
105
102
  });
106
103
  });
@@ -1,4 +1,4 @@
1
- import { CustomerConfig, File, CustomerConfigInterface, FILE_TYPE } from "../integration-api-model";
1
+ import { CustomerConfig, File, CustomerConfigInterface, FILE_TYPE } from "../integration-api-model.js";
2
2
  export declare class CustomerConfigFile extends File implements CustomerConfigInterface {
3
3
  config: CustomerConfig;
4
4
  readonly configName: string;
@@ -1,16 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CustomerConfigFile = void 0;
4
- const tslib_1 = require("tslib");
5
- const integration_api_model_1 = require("../integration-api-model");
6
- const safe_1 = require("../../../helpers/safe");
7
- const customer_config_error_1 = tslib_1.__importDefault(require("../error/customer-config-error"));
8
- const array_helper_1 = require("../../../helpers/array-helper");
9
- class CustomerConfigFile extends integration_api_model_1.File {
1
+ import { CustomerConfig, File, FILE_TYPE, } from "../integration-api-model.js";
2
+ import { safe } from "../../../helpers/safe.js";
3
+ import CustomerConfigError from "../error/customer-config-error.js";
4
+ import { isSame } from "../../../helpers/array-helper.js";
5
+ export class CustomerConfigFile extends File {
10
6
  config;
11
7
  configName;
12
8
  testApp;
13
- type = integration_api_model_1.FILE_TYPE.CUSTOMER_FILE;
9
+ type = FILE_TYPE.CUSTOMER_FILE;
14
10
  constructor(name, path, content, config, configName, testApp) {
15
11
  super(name, path, content);
16
12
  this.config = config;
@@ -23,7 +19,7 @@ class CustomerConfigFile extends integration_api_model_1.File {
23
19
  }
24
20
  updateOrigins(origins) {
25
21
  // if the origins are the same, do nothing
26
- if ((0, array_helper_1.isSame)(this.config.origins, origins)) {
22
+ if (isSame(this.config.origins, origins)) {
27
23
  return;
28
24
  }
29
25
  // if the origins differ, update the config and save its content
@@ -33,18 +29,17 @@ class CustomerConfigFile extends integration_api_model_1.File {
33
29
  this.setContent(JSON.stringify(configContent, null, 2));
34
30
  }
35
31
  updateConfigByContent() {
36
- const configsResult = (0, safe_1.safe)(() => {
32
+ const configsResult = safe(() => {
37
33
  return JSON.parse(this.getContent());
38
34
  });
39
35
  if (configsResult.success !== true) {
40
- throw new customer_config_error_1.default(configsResult.error, [
36
+ throw new CustomerConfigError(configsResult.error, [
41
37
  `error parsing file config_customer.json`,
42
38
  ]);
43
39
  }
44
40
  const configs = configsResult.data;
45
41
  if (this.configName in configs) {
46
- this.config = integration_api_model_1.CustomerConfig.createFrom({ ...configs["production"], ...configs[this.configName] }, this.configName);
42
+ this.config = CustomerConfig.createFrom({ ...configs["production"], ...configs[this.configName] }, this.configName);
47
43
  }
48
44
  }
49
45
  }
50
- exports.CustomerConfigFile = CustomerConfigFile;
@@ -1,7 +1,7 @@
1
- export type CustomerConfigs = {
1
+ export interface CustomerConfigs {
2
2
  production: CustomerConfig;
3
3
  [configName: string]: CustomerConfig;
4
- };
4
+ }
5
5
  export declare class CustomerConfig {
6
6
  readonly app: string;
7
7
  origins: string[];
@@ -14,11 +14,7 @@ export declare class CustomerConfig {
14
14
  readonly name?: string;
15
15
  readonly forceInstall?: boolean;
16
16
  readonly chromeFlags?: string[];
17
- readonly dependencies?: {
18
- [dependency: string]: string;
19
- };
20
- constructor(app: string, origins: string[], domain: string, swPath: string, scope: string, appDomain?: string, installPath?: string, installParameters?: string, name?: string, forceInstall?: boolean, chromeFlags?: string[], dependencies?: {
21
- [dependency: string]: string;
22
- });
17
+ readonly dependencies?: Record<string, string>;
18
+ constructor(app: string, origins: string[], domain: string, swPath: string, scope: string, appDomain?: string, installPath?: string, installParameters?: string, name?: string, forceInstall?: boolean, chromeFlags?: string[], dependencies?: Record<string, string>);
23
19
  static createFrom(configFile: Partial<CustomerConfig>, configName?: string): CustomerConfig;
24
20
  }
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CustomerConfig = void 0;
4
- const tslib_1 = require("tslib");
5
- const customer_config_error_1 = tslib_1.__importDefault(require("../error/customer-config-error"));
6
- class CustomerConfig {
1
+ import CustomerConfigError from "../error/customer-config-error.js";
2
+ export class CustomerConfig {
7
3
  app;
8
4
  origins;
9
5
  domain;
@@ -36,7 +32,6 @@ class CustomerConfig {
36
32
  `https://${app}.app.baqend.com/v1/speedkit/install.js?d=${name || configName}`, installParams || 'async="" crossorigin="anonymous"', name, forceInstall || false, chromeFlags, dependencies || {});
37
33
  }
38
34
  }
39
- exports.CustomerConfig = CustomerConfig;
40
35
  class RequiredParameter {
41
36
  key;
42
37
  value;
@@ -44,18 +39,18 @@ class RequiredParameter {
44
39
  this.key = key;
45
40
  this.value = value;
46
41
  if (!this.value) {
47
- throw new customer_config_error_1.default(`param: "${this.key}" is mandatory in config_customer`);
42
+ throw new CustomerConfigError(`param: "${this.key}" is mandatory in config_customer`);
48
43
  }
49
44
  }
50
45
  isString() {
51
46
  if (typeof this.value !== "string") {
52
- throw new customer_config_error_1.default(`param: "${this.key}" must be a string`);
47
+ throw new CustomerConfigError(`param: "${this.key}" must be a string`);
53
48
  }
54
49
  return this;
55
50
  }
56
51
  isArray() {
57
52
  if (!Array.isArray(this.value)) {
58
- throw new customer_config_error_1.default(`param: "${this.key}" must be an array`);
53
+ throw new CustomerConfigError(`param: "${this.key}" must be an array`);
59
54
  }
60
55
  return this;
61
56
  }
@@ -1,4 +1,4 @@
1
- import { ConfigFileInterface, FILE_TYPE, FileInterface } from "../integration-api-model";
1
+ import { ConfigFileInterface, FILE_TYPE, FileInterface } from "../integration-api-model.js";
2
2
  export declare class File implements ConfigFileInterface, FileInterface {
3
3
  readonly name: string;
4
4
  readonly path: string;
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.File = void 0;
4
- const promises_1 = require("node:fs/promises");
5
- const integration_api_model_1 = require("../integration-api-model");
6
- class File {
1
+ import { readFile, unlink, watch, writeFile } from "node:fs/promises";
2
+ import { FILE_TYPE, } from "../integration-api-model.js";
3
+ export class File {
7
4
  name;
8
5
  path;
9
6
  content;
10
7
  skip = false;
11
8
  updated = false;
12
- type = integration_api_model_1.FILE_TYPE.CONFIG_FILE;
9
+ type = FILE_TYPE.CONFIG_FILE;
13
10
  constructor(name, path, content) {
14
11
  this.name = name;
15
12
  this.path = path;
@@ -35,27 +32,26 @@ class File {
35
32
  return this.updated;
36
33
  }
37
34
  async updateFile() {
38
- await (0, promises_1.writeFile)(this.path, this.content);
35
+ await writeFile(this.path, this.content);
39
36
  this.updated = false;
40
37
  }
41
38
  async updateIfChanged() {
42
- const content = await (0, promises_1.readFile)(this.path, "utf-8");
39
+ const content = await readFile(this.path, "utf-8");
43
40
  if (content !== this.content) {
44
41
  await this.updateFile();
45
42
  }
46
43
  }
47
44
  async onChange(callback) {
48
- const watcher = (0, promises_1.watch)(this.path, { encoding: "utf-8" });
45
+ const watcher = watch(this.path, { encoding: "utf-8" });
49
46
  for await (const info of watcher) {
50
47
  if (info.eventType !== "change") {
51
48
  continue;
52
49
  }
53
- this.setContent(await (0, promises_1.readFile)(this.path, "utf-8"));
50
+ this.setContent(await readFile(this.path, "utf-8"));
54
51
  await callback(this);
55
52
  }
56
53
  }
57
54
  async delete() {
58
- await (0, promises_1.unlink)(this.path);
55
+ await unlink(this.path);
59
56
  }
60
57
  }
61
- exports.File = File;
@@ -1,5 +1,5 @@
1
- import { File } from "./file";
2
- import { FILE_TYPE, InstallResourceInterface } from "../integration-api-model";
1
+ import { File } from "./file.js";
2
+ import { FILE_TYPE, InstallResourceInterface } from "../integration-api-model.js";
3
3
  export declare class InstallResourceFile extends File implements InstallResourceInterface {
4
4
  readonly remoteKey: string;
5
5
  readonly type = FILE_TYPE.INSTALL_FILE;
@@ -1,14 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InstallResourceFile = void 0;
4
- const file_1 = require("./file");
5
- const integration_api_model_1 = require("../integration-api-model");
6
- class InstallResourceFile extends file_1.File {
1
+ import { File } from "./file.js";
2
+ import { FILE_TYPE, } from "../integration-api-model.js";
3
+ export class InstallResourceFile extends File {
7
4
  remoteKey;
8
- type = integration_api_model_1.FILE_TYPE.INSTALL_FILE;
5
+ type = FILE_TYPE.INSTALL_FILE;
9
6
  constructor(name, path, content, remoteKey) {
10
7
  super(name, path, content);
11
8
  this.remoteKey = remoteKey;
12
9
  }
13
10
  }
14
- exports.InstallResourceFile = InstallResourceFile;
@@ -1,5 +1,5 @@
1
- import { File } from "./file";
2
- import { FILE_TYPE, ModuleInterface } from "../integration-api-model";
1
+ import { File } from "./file.js";
2
+ import { FILE_TYPE, ModuleInterface } from "../integration-api-model.js";
3
3
  export declare class ModuleFile extends File implements ModuleInterface {
4
4
  readonly type = FILE_TYPE.MODULE_FILE;
5
5
  constructor(name: string, path: string, content: string, config: NonNullable<unknown>);
@@ -1,14 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ModuleFile = void 0;
4
- const file_1 = require("./file");
5
- const integration_api_model_1 = require("../integration-api-model");
6
- class ModuleFile extends file_1.File {
7
- type = integration_api_model_1.FILE_TYPE.MODULE_FILE;
1
+ import { File } from "./file.js";
2
+ import { FILE_TYPE } from "../integration-api-model.js";
3
+ export class ModuleFile extends File {
4
+ type = FILE_TYPE.MODULE_FILE;
8
5
  constructor(name, path, content,
9
6
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
7
  config) {
11
8
  super(name, path, content);
12
9
  }
13
10
  }
14
- exports.ModuleFile = ModuleFile;
@@ -1,4 +1,4 @@
1
- import { FILE_TYPE, FileInterface } from "../integration-api-model";
1
+ import { FILE_TYPE, FileInterface } from "../integration-api-model.js";
2
2
  export declare class RoFile implements FileInterface {
3
3
  readonly name: string;
4
4
  readonly path: string;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RoFile = void 0;
4
- class RoFile {
1
+ export class RoFile {
5
2
  name;
6
3
  path;
7
4
  content;
@@ -23,4 +20,3 @@ class RoFile {
23
20
  return this.content;
24
21
  }
25
22
  }
26
- exports.RoFile = RoFile;
@@ -1,5 +1,5 @@
1
- import { File } from "./file";
2
- import { FILE_TYPE, ServerConfigInterface } from "../integration-api-model";
1
+ import { File } from "./file.js";
2
+ import { FILE_TYPE, ServerConfigInterface } from "../integration-api-model.js";
3
3
  export declare class ServerConfigFile extends File implements ServerConfigInterface {
4
4
  config: NonNullable<unknown>;
5
5
  readonly type = FILE_TYPE.SERVER_FILE;
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ServerConfigFile = void 0;
4
- const file_1 = require("./file");
5
- const integration_api_model_1 = require("../integration-api-model");
6
- class ServerConfigFile extends file_1.File {
1
+ import { File } from "./file.js";
2
+ import { FILE_TYPE } from "../integration-api-model.js";
3
+ export class ServerConfigFile extends File {
7
4
  config;
8
- type = integration_api_model_1.FILE_TYPE.SERVER_FILE;
5
+ type = FILE_TYPE.SERVER_FILE;
9
6
  constructor(name, path, content, config) {
10
7
  super(name, path, content);
11
8
  this.config = config;
@@ -21,4 +18,3 @@ class ServerConfigFile extends file_1.File {
21
18
  return JSON.stringify(this.config);
22
19
  }
23
20
  }
24
- exports.ServerConfigFile = ServerConfigFile;
@@ -1,4 +1,4 @@
1
- import { FILE_TYPE, FileInterface, VirtualFileInterface, VirtualFileRecipe } from "../integration-api-model";
1
+ import { FILE_TYPE, FileInterface, VirtualFileInterface, VirtualFileRecipe } from "../integration-api-model.js";
2
2
  export declare class VirtualFile implements VirtualFileInterface, FileInterface {
3
3
  readonly name: string;
4
4
  private recipe;