@speedkit/cli 3.43.2 → 4.1.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 (413) 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/customer-config/templates/config_documentHandler.js.hbs +88 -1
  118. package/dist/services/deploy/builder/install-resource-builder.d.ts +2 -2
  119. package/dist/services/deploy/builder/install-resource-builder.js +3 -7
  120. package/dist/services/deploy/checks/post-deploy/deprecated-deployment-detection-check.d.ts +4 -4
  121. package/dist/services/deploy/checks/post-deploy/deprecated-deployment-detection-check.js +19 -24
  122. package/dist/services/deploy/checks/post-deploy/revalidated-module-check.d.ts +3 -3
  123. package/dist/services/deploy/checks/post-deploy/revalidated-module-check.js +10 -14
  124. package/dist/services/deploy/checks/post-deploy/save-files-check.d.ts +3 -3
  125. package/dist/services/deploy/checks/post-deploy/save-files-check.js +8 -12
  126. package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.d.ts +3 -3
  127. package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +14 -20
  128. package/dist/services/deploy/checks/pre-deploy/split-change-check.d.ts +3 -3
  129. package/dist/services/deploy/checks/pre-deploy/split-change-check.js +19 -20
  130. package/dist/services/deploy/context/deploy-context.d.ts +2 -2
  131. package/dist/services/deploy/context/deploy-context.js +10 -14
  132. package/dist/services/deploy/deploy-service-factory.d.ts +3 -3
  133. package/dist/services/deploy/deploy-service-factory.js +36 -40
  134. package/dist/services/deploy/deploy-service-model.d.ts +10 -10
  135. package/dist/services/deploy/deploy-service-model.js +1 -2
  136. package/dist/services/deploy/deploy-service.d.ts +4 -4
  137. package/dist/services/deploy/deploy-service.js +10 -15
  138. package/dist/services/deploy/error/check-module-file-error.d.ts +1 -1
  139. package/dist/services/deploy/error/check-module-file-error.js +2 -7
  140. package/dist/services/deploy/error/deploy-install-resource-error.d.ts +1 -1
  141. package/dist/services/deploy/error/deploy-install-resource-error.js +2 -7
  142. package/dist/services/deploy/error/deploy-module-file-error.d.ts +1 -1
  143. package/dist/services/deploy/error/deploy-module-file-error.js +2 -7
  144. package/dist/services/deploy/error/deploy-server-config-error.d.ts +1 -1
  145. package/dist/services/deploy/error/deploy-server-config-error.js +2 -7
  146. package/dist/services/deploy/error/evaluate-sk-config-error.d.ts +1 -1
  147. package/dist/services/deploy/error/evaluate-sk-config-error.js +2 -7
  148. package/dist/services/deploy/error/file-handler-error.d.ts +1 -1
  149. package/dist/services/deploy/error/file-handler-error.js +2 -7
  150. package/dist/services/deploy/error/post-deploy-deployment-detection-error.d.ts +1 -1
  151. package/dist/services/deploy/error/post-deploy-deployment-detection-error.js +2 -7
  152. package/dist/services/deploy/error/safe-file-error.d.ts +1 -1
  153. package/dist/services/deploy/error/safe-file-error.js +2 -7
  154. package/dist/services/deploy/handler/customer-config-handler.d.ts +6 -6
  155. package/dist/services/deploy/handler/customer-config-handler.js +6 -10
  156. package/dist/services/deploy/handler/install-resource-handler.d.ts +7 -7
  157. package/dist/services/deploy/handler/install-resource-handler.js +22 -27
  158. package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.d.ts +4 -4
  159. package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.js +1 -4
  160. package/dist/services/deploy/handler/module-handler.d.ts +6 -6
  161. package/dist/services/deploy/handler/module-handler.js +12 -18
  162. package/dist/services/deploy/handler/server-config-handler.d.ts +5 -5
  163. package/dist/services/deploy/handler/server-config-handler.js +10 -14
  164. package/dist/services/deploy/interface/deploy-handler-interface.d.ts +1 -1
  165. package/dist/services/deploy/interface/deploy-handler-interface.js +1 -2
  166. package/dist/services/deploy/interface/install-configs.js +1 -2
  167. package/dist/services/deploy/interface/install-resource-processor-interface.d.ts +1 -1
  168. package/dist/services/deploy/interface/install-resource-processor-interface.js +1 -2
  169. package/dist/services/deploy/interface/install.d.ts +1 -1
  170. package/dist/services/deploy/interface/install.js +1 -2
  171. package/dist/services/deploy/interface/runtime-modifier.d.ts +1 -1
  172. package/dist/services/deploy/interface/runtime-modifier.js +1 -2
  173. package/dist/services/deploy/interface/validate-origins-response.js +1 -2
  174. package/dist/services/diff/diff-model.js +1 -5
  175. package/dist/services/diff/diff-service-factory.d.ts +1 -1
  176. package/dist/services/diff/diff-service-factory.js +6 -10
  177. package/dist/services/diff/diff-service.d.ts +1 -1
  178. package/dist/services/diff/diff-service.js +19 -24
  179. package/dist/services/diff/index.d.ts +3 -3
  180. package/dist/services/diff/index.js +3 -6
  181. package/dist/services/diff-service.d.ts +1 -1
  182. package/dist/services/diff-service.js +16 -21
  183. package/dist/services/document-handler-runtime/context/document-handler-runtime-context.js +30 -34
  184. package/dist/services/document-handler-runtime/document-handler-runtime-service.d.ts +3 -3
  185. package/dist/services/document-handler-runtime/document-handler-runtime-service.js +38 -42
  186. package/dist/services/document-handler-runtime/document-handler-server.d.ts +7 -11
  187. package/dist/services/document-handler-runtime/document-handler-server.js +77 -59
  188. package/dist/services/document-handler-runtime/error/required-file-not-found-error.js +1 -4
  189. package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +5 -5
  190. package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +42 -46
  191. package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.js +1 -4
  192. package/dist/services/document-handler-runtime/interface/template-context-interface.d.ts +2 -3
  193. package/dist/services/document-handler-runtime/interface/template-context-interface.js +1 -2
  194. package/dist/services/document-handler-runtime/interface/template-interface.d.ts +2 -2
  195. package/dist/services/document-handler-runtime/interface/template-interface.js +1 -2
  196. package/dist/services/document-handler-runtime/interface/template-parameter-interface.js +1 -2
  197. package/dist/services/document-handler-runtime/server/document-handler-response.d.ts +1 -3
  198. package/dist/services/document-handler-runtime/server/document-handler-response.js +1 -5
  199. package/dist/services/document-handler-runtime/server/request.d.ts +4 -10
  200. package/dist/services/document-handler-runtime/server/request.js +1 -5
  201. package/dist/services/document-handler-runtime/templates/abstract-template.d.ts +3 -3
  202. package/dist/services/document-handler-runtime/templates/abstract-template.js +3 -7
  203. package/dist/services/document-handler-runtime/templates/database-mock.d.ts +2 -2
  204. package/dist/services/document-handler-runtime/templates/database-mock.js +2 -6
  205. package/dist/services/document-handler-runtime/templates/execute-document-handler.d.ts +2 -2
  206. package/dist/services/document-handler-runtime/templates/execute-document-handler.js +2 -6
  207. package/dist/services/document-handler-runtime/templates/orestes-mock.d.ts +2 -2
  208. package/dist/services/document-handler-runtime/templates/orestes-mock.js +2 -6
  209. package/dist/services/document-handler-runtime/templates/package-json.d.ts +3 -5
  210. package/dist/services/document-handler-runtime/templates/package-json.js +2 -6
  211. package/dist/services/document-handler-runtime/templates/test.d.ts +2 -2
  212. package/dist/services/document-handler-runtime/templates/test.js +2 -6
  213. package/dist/services/error-handling/error/application-error.d.ts +1 -1
  214. package/dist/services/error-handling/error/application-error.js +1 -5
  215. package/dist/services/error-handling/error/config-file-error.d.ts +1 -1
  216. package/dist/services/error-handling/error/config-file-error.js +2 -7
  217. package/dist/services/error-handling/error/connection-error.d.ts +1 -1
  218. package/dist/services/error-handling/error/connection-error.js +2 -7
  219. package/dist/services/integration-api/error/customer-config-error.d.ts +1 -1
  220. package/dist/services/integration-api/error/customer-config-error.js +2 -5
  221. package/dist/services/integration-api/error/customer-config-legacy-error.d.ts +1 -1
  222. package/dist/services/integration-api/error/customer-config-legacy-error.js +2 -6
  223. package/dist/services/integration-api/error/invalid-config-format-error.d.ts +1 -1
  224. package/dist/services/integration-api/error/invalid-config-format-error.js +4 -7
  225. package/dist/services/integration-api/error/mandatory-file-missing-error.d.ts +1 -1
  226. package/dist/services/integration-api/error/mandatory-file-missing-error.js +2 -6
  227. package/dist/services/integration-api/error/origin-error.d.ts +1 -1
  228. package/dist/services/integration-api/error/origin-error.js +2 -5
  229. package/dist/services/integration-api/error/read-files-error.d.ts +1 -1
  230. package/dist/services/integration-api/error/read-files-error.js +2 -7
  231. package/dist/services/integration-api/external/external-file-reader.d.ts +1 -1
  232. package/dist/services/integration-api/external/external-file-reader.js +9 -14
  233. package/dist/services/integration-api/file-list.d.ts +1 -1
  234. package/dist/services/integration-api/file-list.js +8 -11
  235. package/dist/services/integration-api/file-reader.js +11 -15
  236. package/dist/services/integration-api/file-writer.js +4 -8
  237. package/dist/services/integration-api/handler/customer-config-handler.d.ts +5 -5
  238. package/dist/services/integration-api/handler/customer-config-handler.js +17 -21
  239. package/dist/services/integration-api/handler/file-handler.d.ts +2 -2
  240. package/dist/services/integration-api/handler/file-handler.js +1 -4
  241. package/dist/services/integration-api/handler/install-resource-handler.d.ts +2 -2
  242. package/dist/services/integration-api/handler/install-resource-handler.js +6 -10
  243. package/dist/services/integration-api/handler/module-handler.d.ts +2 -2
  244. package/dist/services/integration-api/handler/module-handler.js +4 -8
  245. package/dist/services/integration-api/handler/server-config-handler.d.ts +2 -2
  246. package/dist/services/integration-api/handler/server-config-handler.js +4 -8
  247. package/dist/services/integration-api/index.d.ts +3 -3
  248. package/dist/services/integration-api/index.js +3 -6
  249. package/dist/services/integration-api/integration-api-factory.d.ts +3 -3
  250. package/dist/services/integration-api/integration-api-factory.js +23 -28
  251. package/dist/services/integration-api/integration-api-model.d.ts +17 -19
  252. package/dist/services/integration-api/integration-api-model.js +16 -21
  253. package/dist/services/integration-api/integration-api-service.d.ts +5 -5
  254. package/dist/services/integration-api/integration-api-service.js +6 -12
  255. package/dist/services/integration-api/spec/customer-config-validator.spec.js +29 -32
  256. package/dist/services/integration-api/spec/file-list.spec.js +107 -110
  257. package/dist/services/integration-api/spec/file-reader.spec.js +27 -30
  258. package/dist/services/integration-api/spec/file-writer.spec.js +34 -37
  259. package/dist/services/integration-api/spec/integration-api-service.spec.js +42 -45
  260. package/dist/services/integration-api/spec/mandatory-files-validator.spec.js +48 -51
  261. package/dist/services/integration-api/struct/customer-config-file.d.ts +1 -1
  262. package/dist/services/integration-api/struct/customer-config-file.js +10 -15
  263. package/dist/services/integration-api/struct/customer-config.d.ts +4 -8
  264. package/dist/services/integration-api/struct/customer-config.js +5 -10
  265. package/dist/services/integration-api/struct/file.d.ts +1 -1
  266. package/dist/services/integration-api/struct/file.js +9 -13
  267. package/dist/services/integration-api/struct/install-resource-file.d.ts +2 -2
  268. package/dist/services/integration-api/struct/install-resource-file.js +4 -8
  269. package/dist/services/integration-api/struct/module-file.d.ts +2 -2
  270. package/dist/services/integration-api/struct/module-file.js +4 -8
  271. package/dist/services/integration-api/struct/ro-file.d.ts +1 -1
  272. package/dist/services/integration-api/struct/ro-file.js +1 -5
  273. package/dist/services/integration-api/struct/server-config-file.d.ts +2 -2
  274. package/dist/services/integration-api/struct/server-config-file.js +4 -8
  275. package/dist/services/integration-api/struct/virtual-file.d.ts +1 -1
  276. package/dist/services/integration-api/struct/virtual-file.js +3 -7
  277. package/dist/services/integration-api/validator/customer-config-validator.d.ts +1 -1
  278. package/dist/services/integration-api/validator/customer-config-validator.js +8 -12
  279. package/dist/services/integration-api/validator/mandatory-files-validator.d.ts +2 -2
  280. package/dist/services/integration-api/validator/mandatory-files-validator.js +4 -8
  281. package/dist/services/integration-api/virtual/external-recipe.d.ts +2 -2
  282. package/dist/services/integration-api/virtual/external-recipe.js +1 -5
  283. package/dist/services/integration-api/virtual/static-recipe.d.ts +1 -1
  284. package/dist/services/integration-api/virtual/static-recipe.js +1 -5
  285. package/dist/services/integration-api/virtual/virtual-file-handler.d.ts +2 -2
  286. package/dist/services/integration-api/virtual/virtual-file-handler.js +8 -13
  287. package/dist/services/onboarding/browser/abort-response.js +1 -5
  288. package/dist/services/onboarding/browser/baqend-response.d.ts +1 -1
  289. package/dist/services/onboarding/browser/baqend-response.js +1 -5
  290. package/dist/services/onboarding/browser/config/browser-config.d.ts +1 -1
  291. package/dist/services/onboarding/browser/config/browser-config.js +15 -20
  292. package/dist/services/onboarding/browser/executable/executable-validator.d.ts +2 -2
  293. package/dist/services/onboarding/browser/executable/executable-validator.js +12 -17
  294. package/dist/services/onboarding/browser/extension/devtools-extension-api.d.ts +1 -1
  295. package/dist/services/onboarding/browser/extension/devtools-extension-api.js +1 -5
  296. package/dist/services/onboarding/browser/extension/extension-downloader.d.ts +2 -2
  297. package/dist/services/onboarding/browser/extension/extension-downloader.js +24 -30
  298. package/dist/services/onboarding/browser/extension/extension-validator.d.ts +3 -3
  299. package/dist/services/onboarding/browser/extension/extension-validator.js +18 -23
  300. package/dist/services/onboarding/browser/origin-response.d.ts +1 -1
  301. package/dist/services/onboarding/browser/origin-response.js +1 -5
  302. package/dist/services/onboarding/config-renderer/install-file-recipe.d.ts +2 -2
  303. package/dist/services/onboarding/config-renderer/install-file-recipe.js +1 -5
  304. package/dist/services/onboarding/config-renderer/speed-kit-install-context.d.ts +3 -3
  305. package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +8 -11
  306. package/dist/services/onboarding/dashboard/diff-against-current-page.d.ts +4 -4
  307. package/dist/services/onboarding/dashboard/diff-against-current-page.js +9 -14
  308. package/dist/services/onboarding/dashboard/index.d.ts +7 -7
  309. package/dist/services/onboarding/dashboard/index.js +8 -13
  310. package/dist/services/onboarding/dashboard/parameter-query-builder.d.ts +1 -1
  311. package/dist/services/onboarding/dashboard/parameter-query-builder.js +9 -13
  312. package/dist/services/onboarding/dashboard/request-diff-service.d.ts +3 -3
  313. package/dist/services/onboarding/dashboard/request-diff-service.js +14 -19
  314. package/dist/services/onboarding/error/browser-extension-error.d.ts +1 -1
  315. package/dist/services/onboarding/error/browser-extension-error.js +1 -5
  316. package/dist/services/onboarding/error/document-handler-transform-error.js +1 -5
  317. package/dist/services/onboarding/error/unsupported-encoding-error.d.ts +1 -1
  318. package/dist/services/onboarding/error/unsupported-encoding-error.js +2 -7
  319. package/dist/services/onboarding/error/validate-extension-error.d.ts +1 -1
  320. package/dist/services/onboarding/error/validate-extension-error.js +2 -7
  321. package/dist/services/onboarding/error/vm-empty-response-error.d.ts +1 -1
  322. package/dist/services/onboarding/error/vm-empty-response-error.js +2 -7
  323. package/dist/services/onboarding/error/vm-error.d.ts +1 -1
  324. package/dist/services/onboarding/error/vm-error.js +2 -7
  325. package/dist/services/onboarding/fetch-event-handler.d.ts +4 -4
  326. package/dist/services/onboarding/fetch-event-handler.js +19 -25
  327. package/dist/services/onboarding/fetch-events/customer-domain-document-response.d.ts +4 -4
  328. package/dist/services/onboarding/fetch-events/customer-domain-document-response.js +15 -20
  329. package/dist/services/onboarding/fetch-events/customer-service-worker-js.d.ts +3 -3
  330. package/dist/services/onboarding/fetch-events/customer-service-worker-js.js +4 -8
  331. package/dist/services/onboarding/fetch-events/dashboard-request.d.ts +3 -3
  332. package/dist/services/onboarding/fetch-events/dashboard-request.js +1 -5
  333. package/dist/services/onboarding/fetch-events/speed-kit-asset-request.d.ts +5 -5
  334. package/dist/services/onboarding/fetch-events/speed-kit-asset-request.js +1 -5
  335. package/dist/services/onboarding/fetch-events/speed-kit-install-html.d.ts +4 -4
  336. package/dist/services/onboarding/fetch-events/speed-kit-install-html.js +3 -7
  337. package/dist/services/onboarding/fetch-events/speed-kit-install-js.d.ts +5 -5
  338. package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +7 -11
  339. package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +6 -6
  340. package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.js +4 -8
  341. package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +3 -3
  342. package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.js +3 -7
  343. package/dist/services/onboarding/file-events/file-watcher.d.ts +5 -5
  344. package/dist/services/onboarding/file-events/file-watcher.js +24 -28
  345. package/dist/services/onboarding/index.d.ts +3 -3
  346. package/dist/services/onboarding/index.js +3 -8
  347. package/dist/services/onboarding/onboarding-model.d.ts +21 -23
  348. package/dist/services/onboarding/onboarding-model.js +22 -27
  349. package/dist/services/onboarding/onboarding-service-factory.d.ts +3 -3
  350. package/dist/services/onboarding/onboarding-service-factory.js +102 -108
  351. package/dist/services/onboarding/onboarding-service.d.ts +6 -6
  352. package/dist/services/onboarding/onboarding-service.js +12 -18
  353. package/dist/services/onboarding/request-cache/cache.d.ts +3 -3
  354. package/dist/services/onboarding/request-cache/cache.js +1 -5
  355. package/dist/services/onboarding/server-config/index.d.ts +3 -3
  356. package/dist/services/onboarding/server-config/index.js +6 -11
  357. package/dist/services/onboarding/templates/install-speed-kit-html-template.d.ts +1 -1
  358. package/dist/services/onboarding/templates/install-speed-kit-html-template.js +2 -7
  359. package/dist/services/onboarding/templates/install-speed-kit-js-template.d.ts +1 -1
  360. package/dist/services/onboarding/templates/install-speed-kit-js-template.js +2 -7
  361. package/dist/services/onboarding/todo-collector.d.ts +3 -3
  362. package/dist/services/onboarding/todo-collector.js +3 -7
  363. package/dist/services/onboarding/virtual-orestes-app/crawler.d.ts +2 -2
  364. package/dist/services/onboarding/virtual-orestes-app/crawler.js +12 -16
  365. package/dist/services/onboarding/virtual-orestes-app/index.d.ts +7 -7
  366. package/dist/services/onboarding/virtual-orestes-app/index.js +25 -32
  367. package/dist/services/pop-config/index.d.ts +3 -3
  368. package/dist/services/pop-config/index.js +3 -6
  369. package/dist/services/pop-config/pop-config-factory.d.ts +1 -1
  370. package/dist/services/pop-config/pop-config-factory.js +5 -9
  371. package/dist/services/pop-config/pop-config-model.d.ts +2 -2
  372. package/dist/services/pop-config/pop-config-model.js +1 -2
  373. package/dist/services/pop-config/pop-config-service.d.ts +2 -2
  374. package/dist/services/pop-config/pop-config-service.js +1 -5
  375. package/dist/services/prewarm/assets/asset-api-client.d.ts +2 -2
  376. package/dist/services/prewarm/assets/asset-api-client.js +18 -23
  377. package/dist/services/prewarm/assets/asset-item.d.ts +1 -1
  378. package/dist/services/prewarm/assets/asset-item.js +6 -10
  379. package/dist/services/prewarm/assets/asset-list.d.ts +2 -2
  380. package/dist/services/prewarm/assets/asset-list.js +6 -10
  381. package/dist/services/prewarm/csv-reader.js +6 -11
  382. package/dist/services/prewarm/error/invalid-origin-error.d.ts +1 -1
  383. package/dist/services/prewarm/error/invalid-origin-error.js +2 -7
  384. package/dist/services/prewarm/error/read-csv-error.d.ts +1 -1
  385. package/dist/services/prewarm/error/read-csv-error.js +2 -7
  386. package/dist/services/prewarm/index.d.ts +3 -3
  387. package/dist/services/prewarm/index.js +3 -6
  388. package/dist/services/prewarm/pre-warm-factory.d.ts +1 -1
  389. package/dist/services/prewarm/pre-warm-factory.js +13 -17
  390. package/dist/services/prewarm/pre-warm-model.js +16 -20
  391. package/dist/services/prewarm/pre-warm-service.d.ts +3 -3
  392. package/dist/services/prewarm/pre-warm-service.js +18 -22
  393. package/dist/services/pull/index.d.ts +3 -3
  394. package/dist/services/pull/index.js +3 -6
  395. package/dist/services/pull/pull-service-factory.d.ts +2 -2
  396. package/dist/services/pull/pull-service-factory.js +12 -16
  397. package/dist/services/pull/pull-service-model.js +4 -9
  398. package/dist/services/pull/pull-service.d.ts +3 -3
  399. package/dist/services/pull/pull-service.js +14 -19
  400. package/dist/services/query-builder/error/parse-config-speed-kit-error.d.ts +1 -1
  401. package/dist/services/query-builder/error/parse-config-speed-kit-error.js +2 -6
  402. package/dist/services/query-builder/query/parameter.js +1 -5
  403. package/dist/services/query-builder/query/prewarm.js +1 -5
  404. package/dist/services/query-builder/query-builder-factory.d.ts +3 -3
  405. package/dist/services/query-builder/query-builder-factory.js +16 -20
  406. package/dist/services/query-builder/query-builder-model.d.ts +6 -6
  407. package/dist/services/query-builder/query-builder-model.js +2 -5
  408. package/dist/services/query-builder/query-builder-service.d.ts +2 -2
  409. package/dist/services/query-builder/query-builder-service.js +24 -30
  410. package/oclif.manifest.json +15 -15
  411. package/package.json +63 -54
  412. package/dist/dummy.spec.d.ts +0 -1
  413. package/dist/dummy.spec.js +0 -18
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isDirectory = isDirectory;
4
- const promises_1 = require("node:fs/promises");
1
+ import { stat } from "node:fs/promises";
5
2
  /**
6
3
  * @deprecated
7
4
  * @param directory
8
5
  */
9
- async function isDirectory(directory) {
6
+ export async function isDirectory(directory) {
10
7
  try {
11
- const stats = await (0, promises_1.stat)(directory);
8
+ const stats = await stat(directory);
12
9
  return stats.isDirectory();
13
10
  }
14
11
  catch (error) {
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isFile = isFile;
4
- const promises_1 = require("node:fs/promises");
1
+ import { stat } from "node:fs/promises";
5
2
  /**
6
3
  * @deprecated
7
4
  * @param filename
8
5
  */
9
- async function isFile(filename) {
6
+ export async function isFile(filename) {
10
7
  try {
11
- const stats = await (0, promises_1.stat)(filename);
8
+ const stats = await stat(filename);
12
9
  return stats.isFile();
13
10
  }
14
11
  catch (error) {
@@ -1,29 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.logInfo = logInfo;
4
- exports.logError = logError;
5
- exports.logWarning = logWarning;
6
- const tslib_1 = require("tslib");
7
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
1
+ import chalk from "chalk";
8
2
  // TODO: use CliService instead
9
3
  /**
10
4
  * Logs the given message 'green' in the console.
11
5
  * @deprecated
12
6
  */
13
- function logInfo(message, ...optionalParameters) {
14
- console.log(chalk_1.default.green(message), ...optionalParameters);
7
+ export function logInfo(message, ...optionalParameters) {
8
+ console.log(chalk.green(message), ...optionalParameters);
15
9
  }
16
10
  /**
17
11
  * Logs the given message 'red' in the console.
18
12
  * @deprecated
19
13
  */
20
- function logError(message, ...optionalParameters) {
21
- console.log(chalk_1.default.red(message), ...optionalParameters);
14
+ export function logError(message, ...optionalParameters) {
15
+ console.log(chalk.red(message), ...optionalParameters);
22
16
  }
23
17
  /**
24
18
  * Logs the given message 'yellow' in the console.
25
19
  * @deprecated
26
20
  */
27
- function logWarning(message, ...optionalParameters) {
28
- console.log(chalk_1.default.yellow(message), ...optionalParameters);
21
+ export function logWarning(message, ...optionalParameters) {
22
+ console.log(chalk.yellow(message), ...optionalParameters);
29
23
  }
@@ -1,17 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sortParameters = sortParameters;
4
- exports.convertNotEncodedParameters = convertNotEncodedParameters;
5
- exports.transformNoValueParameters = transformNoValueParameters;
6
- exports.normalize = normalize;
7
- exports.unescapeSpaces = unescapeSpaces;
8
- const node_url_1 = require("node:url");
1
+ import { URL } from "node:url";
9
2
  /**
10
3
  * Sorts all urls params manually.
11
4
  *
12
5
  * @param searchParameters - Params to sort.
13
6
  */
14
- function sortParameters(searchParameters) {
7
+ export function sortParameters(searchParameters) {
15
8
  const entries = [...searchParameters.entries()].sort((a, b) => {
16
9
  if (a[0] === b[0]) {
17
10
  return a[1] < b[1] ? -1 : 1;
@@ -33,7 +26,7 @@ function sortParameters(searchParameters) {
33
26
  * @return The encoded parameter key and value without ?.
34
27
  */
35
28
  function encodeUrlComponent(parameterKey, parameterValue) {
36
- const url = new node_url_1.URL("https://www.baqend.com/");
29
+ const url = new URL("https://www.baqend.com/");
37
30
  url.searchParams.append(parameterKey, parameterValue);
38
31
  return url.search.replace(/\?/, "");
39
32
  }
@@ -52,7 +45,7 @@ function encodeUrlComponent(parameterKey, parameterValue) {
52
45
  * @param url - The original Url.
53
46
  * @param manipulatedUrl - The computed URL.
54
47
  */
55
- function convertNotEncodedParameters(url, manipulatedUrl) {
48
+ export function convertNotEncodedParameters(url, manipulatedUrl) {
56
49
  if (manipulatedUrl.search.length === 0) {
57
50
  return;
58
51
  }
@@ -85,7 +78,7 @@ function convertNotEncodedParameters(url, manipulatedUrl) {
85
78
  * @param url - The original URL.
86
79
  * @param manipulatedUrl - The manipulated URL to remove the "=" from.
87
80
  */
88
- function transformNoValueParameters(url, manipulatedUrl) {
81
+ export function transformNoValueParameters(url, manipulatedUrl) {
89
82
  const parametersWithoutValue = url.search
90
83
  .split(/[&?]/)
91
84
  .filter((parameter) => parameter && !parameter.includes("="));
@@ -100,8 +93,8 @@ function transformNoValueParameters(url, manipulatedUrl) {
100
93
  * @param withParameterSorting - Activates alphabetical sorting of the URL parameters.
101
94
  * @returns The normalized URL.
102
95
  */
103
- function normalize(urlString, withParameterSorting) {
104
- const url = new node_url_1.URL(urlString);
96
+ export function normalize(urlString, withParameterSorting) {
97
+ const url = new URL(urlString);
105
98
  // Remove the hash part of the URL if exists
106
99
  if (url.hash) {
107
100
  url.hash = "";
@@ -110,8 +103,8 @@ function normalize(urlString, withParameterSorting) {
110
103
  // Sort search params to normalize encoding and order of params
111
104
  sortParameters(url.searchParams);
112
105
  }
113
- convertNotEncodedParameters(new node_url_1.URL(urlString), url);
114
- transformNoValueParameters(new node_url_1.URL(urlString), url);
106
+ convertNotEncodedParameters(new URL(urlString), url);
107
+ transformNoValueParameters(new URL(urlString), url);
115
108
  return url.toString();
116
109
  }
117
110
  /**
@@ -119,6 +112,6 @@ function normalize(urlString, withParameterSorting) {
119
112
  *
120
113
  * @param string_
121
114
  */
122
- function unescapeSpaces(string_) {
115
+ export function unescapeSpaces(string_) {
123
116
  return string_.replaceAll("\\ ", " ");
124
117
  }
@@ -1,4 +1,4 @@
1
- import ApplicationError from "../services/error-handling/error/application-error";
1
+ import ApplicationError from "../services/error-handling/error/application-error.js";
2
2
  export declare class RaceTimeOutError extends ApplicationError {
3
3
  }
4
4
  export declare function race<T>(promise: Promise<T>, timeout?: number): Promise<T>;
@@ -1,14 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RaceTimeOutError = void 0;
4
- exports.race = race;
5
- const tslib_1 = require("tslib");
6
- const application_error_1 = tslib_1.__importDefault(require("../services/error-handling/error/application-error"));
1
+ import ApplicationError from "../services/error-handling/error/application-error.js";
7
2
  const DEFAULT_TIMEOUT = 5000;
8
- class RaceTimeOutError extends application_error_1.default {
3
+ export class RaceTimeOutError extends ApplicationError {
9
4
  }
10
- exports.RaceTimeOutError = RaceTimeOutError;
11
- async function race(promise, timeout = DEFAULT_TIMEOUT) {
5
+ export async function race(promise, timeout = DEFAULT_TIMEOUT) {
12
6
  const timeOut = new Promise((resolve, reject) => {
13
7
  setTimeout(() => {
14
8
  reject(new RaceTimeOutError(`timeout of ${timeout}ms reached`));
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.safe = safe;
4
- function safe(promiseOrFunction) {
1
+ export function safe(promiseOrFunction) {
5
2
  if (promiseOrFunction instanceof Promise) {
6
3
  return safeAsync(promiseOrFunction);
7
4
  }
@@ -1 +1 @@
1
- export default function scrape(url: string): Promise<any>;
1
+ export default function scrape(url: string): Promise<string>;
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = scrape;
4
- const tslib_1 = require("tslib");
5
- const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
6
- async function scrape(url) {
7
- const response = await (0, node_fetch_1.default)(url);
1
+ import fetch from "node-fetch";
2
+ export default async function scrape(url) {
3
+ const response = await fetch(url);
8
4
  if (response.status !== 200) {
9
5
  return null;
10
6
  }
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.analyzeSite = analyzeSite;
4
- const tslib_1 = require("tslib");
5
- const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
6
- const safe_js_1 = require("./safe.js");
1
+ import fetch from "node-fetch";
2
+ import { safe } from "./safe.js";
7
3
  const EMPTY_FLAGS = {
8
4
  useGATracking: false,
9
5
  withGoogleOptimize: false,
@@ -80,7 +76,7 @@ function findUrl(html, host, pattern) {
80
76
  return `https://${host}${path}`;
81
77
  }
82
78
  async function fetchPage(url, signal) {
83
- const result = await (0, safe_js_1.safe)((0, node_fetch_1.default)(url, { signal: signal }));
79
+ const result = await safe(fetch(url, { signal: signal }));
84
80
  if (!result.success)
85
81
  return null;
86
82
  const response = result.data;
@@ -139,7 +135,7 @@ async function fetchAndAnalyze(host, log) {
139
135
  clearTimeout(timeout);
140
136
  }
141
137
  }
142
- async function analyzeSite(host, log = console.log) {
143
- const result = await (0, safe_js_1.safe)(fetchAndAnalyze(host, log));
138
+ export async function analyzeSite(host, log = console.log) {
139
+ const result = await safe(fetchAndAnalyze(host, log));
144
140
  return result.success ? result.data : null;
145
141
  }
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.speedKitRuleToRegExp = speedKitRuleToRegExp;
4
1
  function escapeRegExp(string_) {
5
2
  return string_.replaceAll(/[\s#$()*+,.?[\\\]^{|}-]/g, "\\$&");
6
3
  }
7
- function speedKitRuleToRegExp(url) {
4
+ export function speedKitRuleToRegExp(url) {
8
5
  return new RegExp(`^${escapeRegExp(url).replaceAll("\\*", ".*")}$`);
9
6
  }
@@ -73,13 +73,13 @@ export declare enum CLIParametersExample {
73
73
  VariationPath = "C:\\Users\\testUser\\variations.csv"
74
74
  }
75
75
  export declare const CLI_CONFIG_NAME: {
76
- configName: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
76
+ configName: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
77
77
  };
78
78
  export declare const CLI_CONFIG_IS_TEST: {
79
- useTestConfig: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
79
+ useTestConfig: import("@oclif/core/interfaces").BooleanFlag<boolean>;
80
80
  };
81
81
  export declare const CLI_CUSTOMER_CONFIG: {
82
- customerPath: import("@oclif/core/lib/interfaces").Arg<string, {
83
- exists?: boolean | undefined;
82
+ customerPath: import("@oclif/core/interfaces").Arg<string, {
83
+ exists?: boolean;
84
84
  }>;
85
85
  };
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CLI_CUSTOMER_CONFIG = exports.CLI_CONFIG_IS_TEST = exports.CLI_CONFIG_NAME = exports.CLIParametersExample = exports.CLIParametersChar = exports.CLIParameters = void 0;
4
- const core_1 = require("@oclif/core");
5
- var CLIParameters;
1
+ import { Args, Flags } from "@oclif/core";
2
+ export var CLIParameters;
6
3
  (function (CLIParameters) {
7
4
  CLIParameters["AppName"] = "app";
8
5
  CLIParameters["Artifacts"] = "artifacts";
@@ -30,9 +27,9 @@ var CLIParameters;
30
27
  CLIParameters["VariationPath"] = "variationPath";
31
28
  CLIParameters["Verbose"] = "verbose";
32
29
  CLIParameters["useTestConfig"] = "useTestConfig";
33
- })(CLIParameters || (exports.CLIParameters = CLIParameters = {}));
30
+ })(CLIParameters || (CLIParameters = {}));
34
31
  /* eslint-disable @typescript-eslint/no-duplicate-enum-values */
35
- var CLIParametersChar;
32
+ export var CLIParametersChar;
36
33
  (function (CLIParametersChar) {
37
34
  CLIParametersChar["AppName"] = "a";
38
35
  CLIParametersChar["Artifacts"] = "a";
@@ -56,9 +53,9 @@ var CLIParametersChar;
56
53
  CLIParametersChar["VariationPath"] = "p";
57
54
  CLIParametersChar["Quiet"] = "q";
58
55
  CLIParametersChar["useTestConfig"] = "t";
59
- })(CLIParametersChar || (exports.CLIParametersChar = CLIParametersChar = {}));
56
+ })(CLIParametersChar || (CLIParametersChar = {}));
60
57
  /* eslint-enable @typescript-eslint/no-duplicate-enum-values */
61
- var CLIParametersExample;
58
+ export var CLIParametersExample;
62
59
  (function (CLIParametersExample) {
63
60
  CLIParametersExample["AppName"] = "decathlon";
64
61
  CLIParametersExample["Artifacts"] = "dynamic,SpeedKit";
@@ -80,9 +77,9 @@ var CLIParametersExample;
80
77
  CLIParametersExample["Variation"] = "MOBILE";
81
78
  CLIParametersExample["Variations"] = "MOBILE,DESKTOP";
82
79
  CLIParametersExample["VariationPath"] = "C:\\Users\\testUser\\variations.csv";
83
- })(CLIParametersExample || (exports.CLIParametersExample = CLIParametersExample = {}));
84
- exports.CLI_CONFIG_NAME = {
85
- [CLIParameters.ConfigName]: core_1.Flags.string({
80
+ })(CLIParametersExample || (CLIParametersExample = {}));
81
+ export const CLI_CONFIG_NAME = {
82
+ [CLIParameters.ConfigName]: Flags.string({
86
83
  char: CLIParametersChar.ConfigName,
87
84
  default: "production",
88
85
  description: "The costumer config name",
@@ -92,14 +89,14 @@ exports.CLI_CONFIG_NAME = {
92
89
  // to enable testMode for deploy and onboarding command
93
90
  // it will set the field app to the configured testApp
94
91
  // and name to the original configured app
95
- exports.CLI_CONFIG_IS_TEST = {
96
- [CLIParameters.useTestConfig]: core_1.Flags.boolean({
92
+ export const CLI_CONFIG_IS_TEST = {
93
+ [CLIParameters.useTestConfig]: Flags.boolean({
97
94
  char: CLIParametersChar.useTestConfig,
98
95
  description: "Override app with configured testApp",
99
96
  }),
100
97
  };
101
- exports.CLI_CUSTOMER_CONFIG = {
102
- [CLIParameters.CustomerPath]: core_1.Args.directory({
98
+ export const CLI_CUSTOMER_CONFIG = {
99
+ [CLIParameters.CustomerPath]: Args.directory({
103
100
  name: CLIParameters.CustomerPath,
104
101
  required: true,
105
102
  description: "The customer config path",
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.INTEGRATION_FILES = void 0;
4
- exports.INTEGRATION_FILES = {
1
+ export const INTEGRATION_FILES = {
5
2
  CONFIG: {
6
3
  CUSTOMER: "config_customer",
7
4
  SPEED_KIT: "config_SpeedKit",
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/dist/models/os.js CHANGED
@@ -1,4 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_INTELLIJ_IDEA_PATH_MACOS = void 0;
4
- exports.DEFAULT_INTELLIJ_IDEA_PATH_MACOS = "/Applications/IntelliJ IDEA.app/Contents/MacOS";
1
+ export const DEFAULT_INTELLIJ_IDEA_PATH_MACOS = "/Applications/IntelliJ IDEA.app/Contents/MacOS";
@@ -1,4 +1,4 @@
1
- import { AthenaService } from "./athena-service";
1
+ import { AthenaService } from "./athena-service.js";
2
2
  export declare class AthenaServiceFactory {
3
3
  service?: AthenaService;
4
4
  getService(): Promise<AthenaService>;
@@ -1,23 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AthenaServiceFactory = void 0;
4
- const client_athena_1 = require("@aws-sdk/client-athena");
5
- const safe_1 = require("../../helpers/safe");
6
- const cli_1 = require("../cli");
7
- const _1 = require("./");
8
- const athena_service_1 = require("./athena-service");
9
- class AthenaServiceFactory {
1
+ import { AthenaClient } from "@aws-sdk/client-athena";
2
+ import { safe } from "../../helpers/safe.js";
3
+ import { CliServiceFactory } from "../cli/index.js";
4
+ import { ATHENA_CONFIG, FetchCredentialsError } from "./index.js";
5
+ import { AthenaService } from "./athena-service.js";
6
+ export class AthenaServiceFactory {
10
7
  service;
11
8
  async getService() {
12
- if (!(this.service instanceof athena_service_1.AthenaService)) {
9
+ if (!(this.service instanceof AthenaService)) {
13
10
  this.service = await this.createService();
14
11
  }
15
12
  return this.service;
16
13
  }
17
14
  async createService() {
18
- const cli = new cli_1.CliServiceFactory().getService();
15
+ const cli = new CliServiceFactory().getService();
19
16
  const client = await this.getAthenaClient(cli);
20
- return new athena_service_1.AthenaService(client, cli);
17
+ return new AthenaService(client, cli);
21
18
  }
22
19
  /**
23
20
  * create awsAthenaClient
@@ -26,15 +23,14 @@ class AthenaServiceFactory {
26
23
  * @private
27
24
  */
28
25
  async getAthenaClient(cli) {
29
- const client = new client_athena_1.AthenaClient(_1.ATHENA_CONFIG);
30
- cli.startAction("check for aws credentials");
31
- const credentialsResult = await (0, safe_1.safe)(client.config.credentials());
26
+ const client = new AthenaClient(ATHENA_CONFIG);
27
+ cli.startAction("ATHENA", "check for aws credentials");
28
+ const credentialsResult = await safe(client.config.credentials());
32
29
  if (credentialsResult.success === true) {
33
- cli.endAction(cli_1.CliActionStatus.COMPLETED);
30
+ cli.successAction("ATHENA");
34
31
  return client;
35
32
  }
36
- cli.endAction(cli_1.CliActionStatus.FAILED);
37
- throw new _1.FetchCredentialsError(credentialsResult.error);
33
+ cli.failAction("ATHENA");
34
+ throw new FetchCredentialsError(credentialsResult.error);
38
35
  }
39
36
  }
40
- exports.AthenaServiceFactory = AthenaServiceFactory;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ATHENA_CONFIG = exports.DEFAULT_MAX_AGE_IN_MINUTES = void 0;
4
- exports.DEFAULT_MAX_AGE_IN_MINUTES = 60;
5
- exports.ATHENA_CONFIG = {
1
+ export const DEFAULT_MAX_AGE_IN_MINUTES = 60;
2
+ export const ATHENA_CONFIG = {
6
3
  region: "eu-central-1",
7
4
  };
@@ -1,5 +1,5 @@
1
1
  import { AthenaClient } from "@aws-sdk/client-athena";
2
- import { CliServiceInterface } from "../cli";
2
+ import { CliServiceInterface } from "../cli/index.js";
3
3
  export declare class AthenaService {
4
4
  private client;
5
5
  private cli;
@@ -1,27 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AthenaService = void 0;
4
- const client_athena_1 = require("@aws-sdk/client-athena");
5
- const athena_service_model_1 = require("./athena-service-model");
6
- const athena_query_error_1 = require("./error/athena-query-error");
7
- const cli_1 = require("../cli");
8
- const safe_1 = require("../../helpers/safe");
9
- class AthenaService {
1
+ import { GetQueryExecutionCommand, GetQueryResultsCommand, QueryExecutionState, StartQueryExecutionCommand, } from "@aws-sdk/client-athena";
2
+ import { DEFAULT_MAX_AGE_IN_MINUTES } from "./athena-service-model.js";
3
+ import { AthenaQueryError } from "./error/athena-query-error.js";
4
+ import { safe } from "../../helpers/safe.js";
5
+ export class AthenaService {
10
6
  client;
11
7
  cli;
12
8
  constructor(client, cli) {
13
9
  this.client = client;
14
10
  this.cli = cli;
15
11
  }
16
- async getResult(query, parameters = [], maxAgeInMinutes = athena_service_model_1.DEFAULT_MAX_AGE_IN_MINUTES) {
17
- this.cli.startAction("execute athena query");
12
+ async getResult(query, parameters = [], maxAgeInMinutes = DEFAULT_MAX_AGE_IN_MINUTES) {
13
+ this.cli.startAction("ATHENA:QUERY", "execute athena query");
18
14
  const queryId = await this.runQuery(query, parameters, maxAgeInMinutes);
19
- const result = await (0, safe_1.safe)(this.fetchResult(queryId));
15
+ const result = await safe(this.fetchResult(queryId));
20
16
  if (result.success === true) {
21
- this.cli.endAction(cli_1.CliActionStatus.COMPLETED);
17
+ this.cli.successAction("ATHENA:QUERY");
22
18
  return result.data;
23
19
  }
24
- this.cli.endAction(cli_1.CliActionStatus.FAILED);
20
+ this.cli.failAction("ATHENA:QUERY");
25
21
  this.cli.writeError(result.error);
26
22
  return [];
27
23
  }
@@ -50,7 +46,7 @@ class AthenaService {
50
46
  do {
51
47
  // Max Results can be set but if its not set,
52
48
  // it will choose the maximum page size.
53
- const command = new client_athena_1.GetQueryResultsCommand({
49
+ const command = new GetQueryResultsCommand({
54
50
  NextToken,
55
51
  QueryExecutionId: queryId,
56
52
  });
@@ -83,7 +79,7 @@ class AthenaService {
83
79
  */
84
80
  async runQuery(sql, parameters, maxAgeInMinutes) {
85
81
  const executionParameters = parameters.map((value) => typeof value === "string" ? `'${value}'` : String(value));
86
- const command = new client_athena_1.StartQueryExecutionCommand({
82
+ const command = new StartQueryExecutionCommand({
87
83
  ExecutionParameters: executionParameters.length > 0 ? executionParameters : null,
88
84
  QueryExecutionContext: {
89
85
  Catalog: "live",
@@ -107,18 +103,18 @@ class AthenaService {
107
103
  }
108
104
  async waitOnResponse(QueryExecutionId) {
109
105
  for (;;) {
110
- const command = new client_athena_1.GetQueryExecutionCommand({ QueryExecutionId });
106
+ const command = new GetQueryExecutionCommand({ QueryExecutionId });
111
107
  const result = await this.client.send(command);
112
108
  const status = result.QueryExecution.Status;
113
109
  switch (status.State) {
114
- case client_athena_1.QueryExecutionState.FAILED: {
115
- throw new athena_query_error_1.AthenaQueryError("The Amazon Athena query failed to run with error message: " +
110
+ case QueryExecutionState.FAILED: {
111
+ throw new AthenaQueryError("The Amazon Athena query failed to run with error message: " +
116
112
  status.StateChangeReason);
117
113
  }
118
- case client_athena_1.QueryExecutionState.CANCELLED: {
119
- throw new athena_query_error_1.AthenaQueryError("The Amazon Athena query was cancelled.");
114
+ case QueryExecutionState.CANCELLED: {
115
+ throw new AthenaQueryError("The Amazon Athena query was cancelled.");
120
116
  }
121
- case client_athena_1.QueryExecutionState.SUCCEEDED: {
117
+ case QueryExecutionState.SUCCEEDED: {
122
118
  return;
123
119
  }
124
120
  default: {
@@ -129,4 +125,3 @@ class AthenaService {
129
125
  }
130
126
  }
131
127
  }
132
- exports.AthenaService = AthenaService;
@@ -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 AthenaQueryError extends ApplicationError {
3
3
  readonly code = "ATHENA_QUERY_FAILED";
4
4
  }
@@ -1,9 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AthenaQueryError = void 0;
4
- const tslib_1 = require("tslib");
5
- const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
6
- class AthenaQueryError extends application_error_1.default {
1
+ import ApplicationError from "../../error-handling/error/application-error.js";
2
+ export class AthenaQueryError extends ApplicationError {
7
3
  code = "ATHENA_QUERY_FAILED";
8
4
  }
9
- exports.AthenaQueryError = AthenaQueryError;
@@ -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 FetchCredentialsError extends ApplicationError {
3
3
  readonly suggestions: string[];
4
4
  readonly code = "AWS_ATHENA_NO_CREDENTIALS";
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FetchCredentialsError = void 0;
4
- const tslib_1 = require("tslib");
5
- const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
6
- class FetchCredentialsError extends application_error_1.default {
1
+ import ApplicationError from "../../error-handling/error/application-error.js";
2
+ export class FetchCredentialsError extends ApplicationError {
7
3
  suggestions = [
8
4
  "login to https://bbq.awsapps.com/start/#/ to gather credentials",
9
5
  "or run: aws sso login",
@@ -11,4 +7,3 @@ class FetchCredentialsError extends application_error_1.default {
11
7
  code = "AWS_ATHENA_NO_CREDENTIALS";
12
8
  reference = "https://www.notion.so/baqend/AWS-Cli-SSO-login-f19af359eb514114aa6a36cd9b65e0c1";
13
9
  }
14
- exports.FetchCredentialsError = FetchCredentialsError;
@@ -1,4 +1,4 @@
1
- export * from "./athena-service";
2
- export * from "./athena-service-factory";
3
- export * from "./athena-service-model";
4
- export * from "./error/fetch-credentials-error";
1
+ export * from "./athena-service.js";
2
+ export * from "./athena-service-factory.js";
3
+ export * from "./athena-service-model.js";
4
+ export * from "./error/fetch-credentials-error.js";
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./athena-service"), exports);
5
- tslib_1.__exportStar(require("./athena-service-factory"), exports);
6
- tslib_1.__exportStar(require("./athena-service-model"), exports);
7
- tslib_1.__exportStar(require("./error/fetch-credentials-error"), exports);
1
+ export * from "./athena-service.js";
2
+ export * from "./athena-service-factory.js";
3
+ export * from "./athena-service-model.js";
4
+ export * from "./error/fetch-credentials-error.js";
@@ -1,4 +1,6 @@
1
- import { BundleService } from "./bundle-service";
1
+ import { BundleService } from "./bundle-service.js";
2
2
  export declare class BundleServiceFactory {
3
+ private customerFolder?;
4
+ constructor(customerFolder?: string);
3
5
  buildService(): BundleService;
4
6
  }
@@ -1,10 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BundleServiceFactory = void 0;
4
- const bundle_service_1 = require("./bundle-service");
5
- class BundleServiceFactory {
1
+ import { BundleService } from "./bundle-service.js";
2
+ export class BundleServiceFactory {
3
+ customerFolder;
4
+ constructor(customerFolder) {
5
+ this.customerFolder = customerFolder;
6
+ }
6
7
  buildService() {
7
- return new bundle_service_1.BundleService();
8
+ return new BundleService(this.customerFolder);
8
9
  }
9
10
  }
10
- exports.BundleServiceFactory = BundleServiceFactory;