@speedkit/cli 2.4.1

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 (385) hide show
  1. package/README.md +775 -0
  2. package/bin/dev +18 -0
  3. package/bin/dev.cmd +3 -0
  4. package/bin/run +4 -0
  5. package/bin/run.cmd +3 -0
  6. package/dist/commands/airports_iata.json +1 -0
  7. package/dist/commands/build-parameter-query.d.ts +15 -0
  8. package/dist/commands/build-parameter-query.js +95 -0
  9. package/dist/commands/build-prewarm-query.d.ts +15 -0
  10. package/dist/commands/build-prewarm-query.js +69 -0
  11. package/dist/commands/deploy.d.ts +17 -0
  12. package/dist/commands/deploy.js +39 -0
  13. package/dist/commands/document-handler.d.ts +16 -0
  14. package/dist/commands/document-handler.js +36 -0
  15. package/dist/commands/find-pops.d.ts +17 -0
  16. package/dist/commands/find-pops.js +84 -0
  17. package/dist/commands/generate-customer-config.d.ts +10 -0
  18. package/dist/commands/generate-customer-config.js +29 -0
  19. package/dist/commands/generate-pop-config.d.ts +27 -0
  20. package/dist/commands/generate-pop-config.js +231 -0
  21. package/dist/commands/login.d.ts +10 -0
  22. package/dist/commands/login.js +35 -0
  23. package/dist/commands/onboarding.d.ts +16 -0
  24. package/dist/commands/onboarding.js +25 -0
  25. package/dist/commands/param-diff.d.ts +16 -0
  26. package/dist/commands/param-diff.js +111 -0
  27. package/dist/commands/pop-prewarm.d.ts +17 -0
  28. package/dist/commands/pop-prewarm.js +80 -0
  29. package/dist/commands/prewarm.d.ts +40 -0
  30. package/dist/commands/prewarm.js +127 -0
  31. package/dist/commands/pull.d.ts +14 -0
  32. package/dist/commands/pull.js +24 -0
  33. package/dist/commands/wpt-launcher.d.ts +21 -0
  34. package/dist/commands/wpt-launcher.js +79 -0
  35. package/dist/helpers/CustomerConfig.d.ts +51 -0
  36. package/dist/helpers/CustomerConfig.js +150 -0
  37. package/dist/helpers/build-query-helper.d.ts +32 -0
  38. package/dist/helpers/build-query-helper.js +216 -0
  39. package/dist/helpers/cli-config.d.ts +22 -0
  40. package/dist/helpers/cli-config.js +85 -0
  41. package/dist/helpers/file-helper.d.ts +8 -0
  42. package/dist/helpers/file-helper.js +63 -0
  43. package/dist/helpers/get-parsed-config.d.ts +11 -0
  44. package/dist/helpers/get-parsed-config.js +63 -0
  45. package/dist/helpers/getChromePath.d.ts +7 -0
  46. package/dist/helpers/getChromePath.js +27 -0
  47. package/dist/helpers/isDirectory.d.ts +1 -0
  48. package/dist/helpers/isDirectory.js +17 -0
  49. package/dist/helpers/isExecutable.d.ts +1 -0
  50. package/dist/helpers/isExecutable.js +15 -0
  51. package/dist/helpers/isFile.d.ts +1 -0
  52. package/dist/helpers/isFile.js +17 -0
  53. package/dist/helpers/logging-helper.d.ts +12 -0
  54. package/dist/helpers/logging-helper.js +27 -0
  55. package/dist/helpers/normalize.d.ts +40 -0
  56. package/dist/helpers/normalize.js +112 -0
  57. package/dist/helpers/race.d.ts +1 -0
  58. package/dist/helpers/race.js +16 -0
  59. package/dist/helpers/safe.d.ts +10 -0
  60. package/dist/helpers/safe.js +34 -0
  61. package/dist/helpers/scrape.d.ts +1 -0
  62. package/dist/helpers/scrape.js +11 -0
  63. package/dist/helpers/speedKitRuleToRegExp.d.ts +1 -0
  64. package/dist/helpers/speedKitRuleToRegExp.js +10 -0
  65. package/dist/helpers/watchFiles.d.ts +1 -0
  66. package/dist/helpers/watchFiles.js +20 -0
  67. package/dist/models/cli-parameters.d.ts +73 -0
  68. package/dist/models/cli-parameters.js +82 -0
  69. package/dist/models/files.d.ts +20 -0
  70. package/dist/models/files.js +23 -0
  71. package/dist/models/install.d.ts +24 -0
  72. package/dist/models/install.js +2 -0
  73. package/dist/services/athena-service.d.ts +30 -0
  74. package/dist/services/athena-service.js +139 -0
  75. package/dist/services/bundler/bundle-service-factory.d.ts +4 -0
  76. package/dist/services/bundler/bundle-service-factory.js +10 -0
  77. package/dist/services/bundler/bundle-service.d.ts +25 -0
  78. package/dist/services/bundler/bundle-service.js +84 -0
  79. package/dist/services/bundler/index.d.ts +2 -0
  80. package/dist/services/bundler/index.js +5 -0
  81. package/dist/services/cli/cli-service-factory.d.ts +5 -0
  82. package/dist/services/cli/cli-service-factory.js +14 -0
  83. package/dist/services/cli/cli-service-model.d.ts +27 -0
  84. package/dist/services/cli/cli-service-model.js +9 -0
  85. package/dist/services/cli/cli-service.d.ts +37 -0
  86. package/dist/services/cli/cli-service.js +123 -0
  87. package/dist/services/cli/error/cli-type-error.d.ts +3 -0
  88. package/dist/services/cli/error/cli-type-error.js +7 -0
  89. package/dist/services/cli/hooks.d.ts +11 -0
  90. package/dist/services/cli/hooks.js +33 -0
  91. package/dist/services/cli/index.d.ts +3 -0
  92. package/dist/services/cli/index.js +6 -0
  93. package/dist/services/config-api/client.d.ts +16 -0
  94. package/dist/services/config-api/client.js +54 -0
  95. package/dist/services/config-api/config-api-service.d.ts +16 -0
  96. package/dist/services/config-api/config-api-service.js +56 -0
  97. package/dist/services/config-api/context/config-api-context.d.ts +5 -0
  98. package/dist/services/config-api/context/config-api-context.js +9 -0
  99. package/dist/services/config-api/error/json-response-error.d.ts +2 -0
  100. package/dist/services/config-api/error/json-response-error.js +5 -0
  101. package/dist/services/config-api/error/login-error.d.ts +5 -0
  102. package/dist/services/config-api/error/login-error.js +12 -0
  103. package/dist/services/config-api/factory/config-api-service-factory.d.ts +10 -0
  104. package/dist/services/config-api/factory/config-api-service-factory.js +38 -0
  105. package/dist/services/config-api/factory/entity-manager-factory.d.ts +5 -0
  106. package/dist/services/config-api/factory/entity-manager-factory.js +21 -0
  107. package/dist/services/config-api/interface/config-api-context-interface.d.ts +4 -0
  108. package/dist/services/config-api/interface/config-api-context-interface.js +2 -0
  109. package/dist/services/config-api/interface/request-extension-interface.d.ts +5 -0
  110. package/dist/services/config-api/interface/request-extension-interface.js +2 -0
  111. package/dist/services/config-api-service.d.ts +18 -0
  112. package/dist/services/config-api-service.js +96 -0
  113. package/dist/services/context/app-context.d.ts +1 -0
  114. package/dist/services/context/app-context.js +2 -0
  115. package/dist/services/context/error/context-runtime-error.d.ts +3 -0
  116. package/dist/services/context/error/context-runtime-error.js +7 -0
  117. package/dist/services/context/interface/context-interface.d.ts +2 -0
  118. package/dist/services/context/interface/context-interface.js +2 -0
  119. package/dist/services/customer-config/customer-config-service-context.d.ts +5 -0
  120. package/dist/services/customer-config/customer-config-service-context.js +15 -0
  121. package/dist/services/customer-config/customer-config-service-factory.d.ts +8 -0
  122. package/dist/services/customer-config/customer-config-service-factory.js +24 -0
  123. package/dist/services/customer-config/customer-config-service-model.d.ts +39 -0
  124. package/dist/services/customer-config/customer-config-service-model.js +23 -0
  125. package/dist/services/customer-config/customer-config-service.d.ts +27 -0
  126. package/dist/services/customer-config/customer-config-service.js +263 -0
  127. package/dist/services/customer-config/index.d.ts +4 -0
  128. package/dist/services/customer-config/index.js +7 -0
  129. package/dist/services/customer-config/templates/config_SpeedKit.js.hbs +351 -0
  130. package/dist/services/customer-config/templates/config_customer.js.hbs +75 -0
  131. package/dist/services/customer-config/templates/config_documentHandler.js.hbs +162 -0
  132. package/dist/services/customer-config/templates/config_dynamicBlocks.es6.hbs +263 -0
  133. package/dist/services/customer-config/templates/config_dynamicStyles.css.hbs +116 -0
  134. package/dist/services/customer-config/templates/config_loadHandler.js.hbs +394 -0
  135. package/dist/services/customer-config/templates/deploymentDetection.es6.hbs +262 -0
  136. package/dist/services/customer-config/templates/downtimeDetection.js.hbs +110 -0
  137. package/dist/services/deploy/builder/install-resource-builder.d.ts +14 -0
  138. package/dist/services/deploy/builder/install-resource-builder.js +48 -0
  139. package/dist/services/deploy/checks/post-deploy/revalidated-module-check.d.ts +11 -0
  140. package/dist/services/deploy/checks/post-deploy/revalidated-module-check.js +30 -0
  141. package/dist/services/deploy/checks/post-deploy/save-files-check.d.ts +9 -0
  142. package/dist/services/deploy/checks/post-deploy/save-files-check.js +25 -0
  143. package/dist/services/deploy/context/deploy-context.d.ts +12 -0
  144. package/dist/services/deploy/context/deploy-context.js +26 -0
  145. package/dist/services/deploy/deploy-service-factory.d.ts +15 -0
  146. package/dist/services/deploy/deploy-service-factory.js +68 -0
  147. package/dist/services/deploy/deploy-service.d.ts +17 -0
  148. package/dist/services/deploy/deploy-service.js +63 -0
  149. package/dist/services/deploy/error/create-find-temp-directory-error.d.ts +4 -0
  150. package/dist/services/deploy/error/create-find-temp-directory-error.js +10 -0
  151. package/dist/services/deploy/error/deploy-app-error.d.ts +2 -0
  152. package/dist/services/deploy/error/deploy-app-error.js +5 -0
  153. package/dist/services/deploy/error/no-active-installation-error.d.ts +4 -0
  154. package/dist/services/deploy/error/no-active-installation-error.js +10 -0
  155. package/dist/services/deploy/handler/customer-config-handler.d.ts +21 -0
  156. package/dist/services/deploy/handler/customer-config-handler.js +85 -0
  157. package/dist/services/deploy/handler/install-resource-handler.d.ts +25 -0
  158. package/dist/services/deploy/handler/install-resource-handler.js +104 -0
  159. package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.d.ts +13 -0
  160. package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.js +51 -0
  161. package/dist/services/deploy/handler/module-handler.d.ts +14 -0
  162. package/dist/services/deploy/handler/module-handler.js +81 -0
  163. package/dist/services/deploy/handler/module-modifier/deployment-detection-modifier.d.ts +9 -0
  164. package/dist/services/deploy/handler/module-modifier/deployment-detection-modifier.js +24 -0
  165. package/dist/services/deploy/handler/server-config-handler.d.ts +12 -0
  166. package/dist/services/deploy/handler/server-config-handler.js +63 -0
  167. package/dist/services/deploy/interface/deploy-handler-interface.d.ts +6 -0
  168. package/dist/services/deploy/interface/deploy-handler-interface.js +2 -0
  169. package/dist/services/deploy/interface/install-configs.d.ts +11 -0
  170. package/dist/services/deploy/interface/install-configs.js +2 -0
  171. package/dist/services/deploy/interface/install-resource-processor-interface.d.ts +5 -0
  172. package/dist/services/deploy/interface/install-resource-processor-interface.js +2 -0
  173. package/dist/services/deploy/interface/install.d.ts +14 -0
  174. package/dist/services/deploy/interface/install.js +2 -0
  175. package/dist/services/deploy/interface/post-deploy-check-interface.d.ts +3 -0
  176. package/dist/services/deploy/interface/post-deploy-check-interface.js +2 -0
  177. package/dist/services/deploy/interface/runtime-modifier.d.ts +6 -0
  178. package/dist/services/deploy/interface/runtime-modifier.js +2 -0
  179. package/dist/services/deploy/interface/validate-origins-response.d.ts +4 -0
  180. package/dist/services/deploy/interface/validate-origins-response.js +2 -0
  181. package/dist/services/diff/diff-model.d.ts +5 -0
  182. package/dist/services/diff/diff-model.js +12 -0
  183. package/dist/services/diff/diff-service-factory.d.ts +7 -0
  184. package/dist/services/diff/diff-service-factory.js +20 -0
  185. package/dist/services/diff/diff-service.d.ts +34 -0
  186. package/dist/services/diff/diff-service.js +134 -0
  187. package/dist/services/diff/index.d.ts +3 -0
  188. package/dist/services/diff/index.js +6 -0
  189. package/dist/services/diff-service.d.ts +24 -0
  190. package/dist/services/diff-service.js +112 -0
  191. package/dist/services/document-handler-runtime/context/document-handler-runtime-context.d.ts +23 -0
  192. package/dist/services/document-handler-runtime/context/document-handler-runtime-context.js +41 -0
  193. package/dist/services/document-handler-runtime/document-handler-runtime-service.d.ts +32 -0
  194. package/dist/services/document-handler-runtime/document-handler-runtime-service.js +220 -0
  195. package/dist/services/document-handler-runtime/document-handler-server.d.ts +42 -0
  196. package/dist/services/document-handler-runtime/document-handler-server.js +225 -0
  197. package/dist/services/document-handler-runtime/error/handler/required-file-not-found-handler.d.ts +6 -0
  198. package/dist/services/document-handler-runtime/error/handler/required-file-not-found-handler.js +14 -0
  199. package/dist/services/document-handler-runtime/error/required-file-not-found-error.d.ts +3 -0
  200. package/dist/services/document-handler-runtime/error/required-file-not-found-error.js +7 -0
  201. package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +24 -0
  202. package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +106 -0
  203. package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.d.ts +3 -0
  204. package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.js +6 -0
  205. package/dist/services/document-handler-runtime/interface/template-context-interface.d.ts +3 -0
  206. package/dist/services/document-handler-runtime/interface/template-context-interface.js +2 -0
  207. package/dist/services/document-handler-runtime/interface/template-interface.d.ts +6 -0
  208. package/dist/services/document-handler-runtime/interface/template-interface.js +2 -0
  209. package/dist/services/document-handler-runtime/interface/template-param-interface.d.ts +4 -0
  210. package/dist/services/document-handler-runtime/interface/template-param-interface.js +2 -0
  211. package/dist/services/document-handler-runtime/templates/abstract-template.d.ts +9 -0
  212. package/dist/services/document-handler-runtime/templates/abstract-template.js +18 -0
  213. package/dist/services/document-handler-runtime/templates/database-mock.d.ts +6 -0
  214. package/dist/services/document-handler-runtime/templates/database-mock.js +111 -0
  215. package/dist/services/document-handler-runtime/templates/execute-document-handler.d.ts +6 -0
  216. package/dist/services/document-handler-runtime/templates/execute-document-handler.js +76 -0
  217. package/dist/services/document-handler-runtime/templates/orestes-mock.d.ts +9 -0
  218. package/dist/services/document-handler-runtime/templates/orestes-mock.js +168 -0
  219. package/dist/services/document-handler-runtime/templates/package-json.d.ts +8 -0
  220. package/dist/services/document-handler-runtime/templates/package-json.js +21 -0
  221. package/dist/services/document-handler-runtime/templates/test.d.ts +6 -0
  222. package/dist/services/document-handler-runtime/templates/test.js +63 -0
  223. package/dist/services/error-handling/abstract/abstract-async-error-handling-factory.d.ts +6 -0
  224. package/dist/services/error-handling/abstract/abstract-async-error-handling-factory.js +19 -0
  225. package/dist/services/error-handling/abstract/abstract-async-error-handling-service.d.ts +6 -0
  226. package/dist/services/error-handling/abstract/abstract-async-error-handling-service.js +18 -0
  227. package/dist/services/error-handling/abstract/abstract-error-handling-factory.d.ts +6 -0
  228. package/dist/services/error-handling/abstract/abstract-error-handling-factory.js +19 -0
  229. package/dist/services/error-handling/abstract/abstract-error-handling-service.d.ts +6 -0
  230. package/dist/services/error-handling/abstract/abstract-error-handling-service.js +19 -0
  231. package/dist/services/error-handling/error/application-error.d.ts +5 -0
  232. package/dist/services/error-handling/error/application-error.js +11 -0
  233. package/dist/services/error-handling/error/handler/default-error-handler.d.ts +5 -0
  234. package/dist/services/error-handling/error/handler/default-error-handler.js +13 -0
  235. package/dist/services/error-handling/error-handling-service.d.ts +7 -0
  236. package/dist/services/error-handling/error-handling-service.js +27 -0
  237. package/dist/services/error-handling/factory/error-handling-factory.d.ts +8 -0
  238. package/dist/services/error-handling/factory/error-handling-factory.js +21 -0
  239. package/dist/services/error-handling/interface/error-context-interface.d.ts +6 -0
  240. package/dist/services/error-handling/interface/error-context-interface.js +2 -0
  241. package/dist/services/error-handling/interface/error-handler-interface.d.ts +5 -0
  242. package/dist/services/error-handling/interface/error-handler-interface.js +2 -0
  243. package/dist/services/error-handling/interface/error-handling-factory-interface.d.ts +8 -0
  244. package/dist/services/error-handling/interface/error-handling-factory-interface.js +2 -0
  245. package/dist/services/error-handling/interface/error-handling-service-interface.d.ts +8 -0
  246. package/dist/services/error-handling/interface/error-handling-service-interface.js +2 -0
  247. package/dist/services/integration-api/context/integration-api-context.d.ts +9 -0
  248. package/dist/services/integration-api/context/integration-api-context.js +20 -0
  249. package/dist/services/integration-api/error/customer-config-error.d.ts +2 -0
  250. package/dist/services/integration-api/error/customer-config-error.js +5 -0
  251. package/dist/services/integration-api/error/customer-config-legacy-error.d.ts +3 -0
  252. package/dist/services/integration-api/error/customer-config-legacy-error.js +7 -0
  253. package/dist/services/integration-api/error/handler/customer-config-handler.d.ts +5 -0
  254. package/dist/services/integration-api/error/handler/customer-config-handler.js +19 -0
  255. package/dist/services/integration-api/error/handler/customer-config-legacy-handler.d.ts +6 -0
  256. package/dist/services/integration-api/error/handler/customer-config-legacy-handler.js +24 -0
  257. package/dist/services/integration-api/error/handler/origin-handler.d.ts +6 -0
  258. package/dist/services/integration-api/error/handler/origin-handler.js +22 -0
  259. package/dist/services/integration-api/error/load-customer-error.d.ts +4 -0
  260. package/dist/services/integration-api/error/load-customer-error.js +10 -0
  261. package/dist/services/integration-api/error/mandatory-file-missing-error.d.ts +3 -0
  262. package/dist/services/integration-api/error/mandatory-file-missing-error.js +8 -0
  263. package/dist/services/integration-api/error/origin-error.d.ts +3 -0
  264. package/dist/services/integration-api/error/origin-error.js +7 -0
  265. package/dist/services/integration-api/external/external-file-reader.d.ts +4 -0
  266. package/dist/services/integration-api/external/external-file-reader.js +17 -0
  267. package/dist/services/integration-api/factory/integration-api-service-factory.d.ts +13 -0
  268. package/dist/services/integration-api/factory/integration-api-service-factory.js +55 -0
  269. package/dist/services/integration-api/file-list.d.ts +18 -0
  270. package/dist/services/integration-api/file-list.js +79 -0
  271. package/dist/services/integration-api/file-reader.d.ts +15 -0
  272. package/dist/services/integration-api/file-reader.js +97 -0
  273. package/dist/services/integration-api/file-writer.d.ts +9 -0
  274. package/dist/services/integration-api/file-writer.js +27 -0
  275. package/dist/services/integration-api/handler/customer-config-handler.d.ts +16 -0
  276. package/dist/services/integration-api/handler/customer-config-handler.js +55 -0
  277. package/dist/services/integration-api/handler/file-handler.d.ts +9 -0
  278. package/dist/services/integration-api/handler/file-handler.js +20 -0
  279. package/dist/services/integration-api/handler/install-resource-handler.d.ts +33 -0
  280. package/dist/services/integration-api/handler/install-resource-handler.js +67 -0
  281. package/dist/services/integration-api/handler/module-handler.d.ts +12 -0
  282. package/dist/services/integration-api/handler/module-handler.js +20 -0
  283. package/dist/services/integration-api/handler/server-config-handler.d.ts +8 -0
  284. package/dist/services/integration-api/handler/server-config-handler.js +21 -0
  285. package/dist/services/integration-api/integration-api-model.d.ts +89 -0
  286. package/dist/services/integration-api/integration-api-model.js +2 -0
  287. package/dist/services/integration-api/integration-api-service.d.ts +21 -0
  288. package/dist/services/integration-api/integration-api-service.js +76 -0
  289. package/dist/services/integration-api/struct/customer-config-file.d.ts +10 -0
  290. package/dist/services/integration-api/struct/customer-config-file.js +32 -0
  291. package/dist/services/integration-api/struct/customer-config.d.ts +22 -0
  292. package/dist/services/integration-api/struct/customer-config.js +67 -0
  293. package/dist/services/integration-api/struct/file.d.ts +19 -0
  294. package/dist/services/integration-api/struct/file.js +61 -0
  295. package/dist/services/integration-api/struct/install-resource-file.d.ts +6 -0
  296. package/dist/services/integration-api/struct/install-resource-file.js +12 -0
  297. package/dist/services/integration-api/struct/module-file.d.ts +5 -0
  298. package/dist/services/integration-api/struct/module-file.js +10 -0
  299. package/dist/services/integration-api/struct/ro-file.d.ts +13 -0
  300. package/dist/services/integration-api/struct/ro-file.js +26 -0
  301. package/dist/services/integration-api/struct/server-config-file.d.ts +9 -0
  302. package/dist/services/integration-api/struct/server-config-file.js +22 -0
  303. package/dist/services/integration-api/struct/virtual-file.d.ts +14 -0
  304. package/dist/services/integration-api/struct/virtual-file.js +28 -0
  305. package/dist/services/integration-api/validator/customer-config-validator.d.ts +5 -0
  306. package/dist/services/integration-api/validator/customer-config-validator.js +23 -0
  307. package/dist/services/integration-api/validator/mandatory-files-validator.d.ts +7 -0
  308. package/dist/services/integration-api/validator/mandatory-files-validator.js +39 -0
  309. package/dist/services/integration-api/virtual/external-recipe.d.ts +9 -0
  310. package/dist/services/integration-api/virtual/external-recipe.js +19 -0
  311. package/dist/services/integration-api/virtual/virtual-file-handler.d.ts +7 -0
  312. package/dist/services/integration-api/virtual/virtual-file-handler.js +38 -0
  313. package/dist/services/onboarding/browser/abort-response.d.ts +5 -0
  314. package/dist/services/onboarding/browser/abort-response.js +10 -0
  315. package/dist/services/onboarding/browser/baqend-response.d.ts +12 -0
  316. package/dist/services/onboarding/browser/baqend-response.js +52 -0
  317. package/dist/services/onboarding/browser/origin-response.d.ts +8 -0
  318. package/dist/services/onboarding/browser/origin-response.js +20 -0
  319. package/dist/services/onboarding/config-renderer/install-file-recipe.d.ts +7 -0
  320. package/dist/services/onboarding/config-renderer/install-file-recipe.js +13 -0
  321. package/dist/services/onboarding/config-renderer/speed-kit-install-context.d.ts +22 -0
  322. package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +78 -0
  323. package/dist/services/onboarding/dashboard/athena-service.d.ts +11 -0
  324. package/dist/services/onboarding/dashboard/athena-service.js +70 -0
  325. package/dist/services/onboarding/dashboard/frontend-dist/assets/index-87b53ed4.css +1 -0
  326. package/dist/services/onboarding/dashboard/frontend-dist/assets/main-274b5625.js +9 -0
  327. package/dist/services/onboarding/dashboard/frontend-dist/index.html +18 -0
  328. package/dist/services/onboarding/dashboard/index.d.ts +16 -0
  329. package/dist/services/onboarding/dashboard/index.js +78 -0
  330. package/dist/services/onboarding/dashboard/param-query-builder.d.ts +9 -0
  331. package/dist/services/onboarding/dashboard/param-query-builder.js +67 -0
  332. package/dist/services/onboarding/dashboard/request-diff-service.d.ts +11 -0
  333. package/dist/services/onboarding/dashboard/request-diff-service.js +59 -0
  334. package/dist/services/onboarding/error/vm-error.d.ts +2 -0
  335. package/dist/services/onboarding/error/vm-error.js +6 -0
  336. package/dist/services/onboarding/fetch-event-handler.d.ts +19 -0
  337. package/dist/services/onboarding/fetch-event-handler.js +155 -0
  338. package/dist/services/onboarding/fetch-events/customer-domain-document-response.d.ts +24 -0
  339. package/dist/services/onboarding/fetch-events/customer-domain-document-response.js +118 -0
  340. package/dist/services/onboarding/fetch-events/customer-service-worker-js.d.ts +14 -0
  341. package/dist/services/onboarding/fetch-events/customer-service-worker-js.js +30 -0
  342. package/dist/services/onboarding/fetch-events/dashboard-request.d.ts +15 -0
  343. package/dist/services/onboarding/fetch-events/dashboard-request.js +29 -0
  344. package/dist/services/onboarding/fetch-events/speed-kit-asset-request.d.ts +26 -0
  345. package/dist/services/onboarding/fetch-events/speed-kit-asset-request.js +138 -0
  346. package/dist/services/onboarding/fetch-events/speed-kit-install-html.d.ts +15 -0
  347. package/dist/services/onboarding/fetch-events/speed-kit-install-html.js +49 -0
  348. package/dist/services/onboarding/fetch-events/speed-kit-install-js.d.ts +22 -0
  349. package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +62 -0
  350. package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +21 -0
  351. package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.js +43 -0
  352. package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +17 -0
  353. package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.js +27 -0
  354. package/dist/services/onboarding/file-events/fileWatcher.d.ts +28 -0
  355. package/dist/services/onboarding/file-events/fileWatcher.js +133 -0
  356. package/dist/services/onboarding/index.d.ts +3 -0
  357. package/dist/services/onboarding/index.js +8 -0
  358. package/dist/services/onboarding/onboarding-model.d.ts +30 -0
  359. package/dist/services/onboarding/onboarding-model.js +53 -0
  360. package/dist/services/onboarding/onboarding-service-factory.d.ts +16 -0
  361. package/dist/services/onboarding/onboarding-service-factory.js +163 -0
  362. package/dist/services/onboarding/onboarding-service.d.ts +31 -0
  363. package/dist/services/onboarding/onboarding-service.js +130 -0
  364. package/dist/services/onboarding/request-cache/cache.d.ts +15 -0
  365. package/dist/services/onboarding/request-cache/cache.js +32 -0
  366. package/dist/services/onboarding/templates/install-speed-kit-html-template.d.ts +4 -0
  367. package/dist/services/onboarding/templates/install-speed-kit-html-template.js +264 -0
  368. package/dist/services/onboarding/templates/install-speed-kit-js-template.d.ts +4 -0
  369. package/dist/services/onboarding/templates/install-speed-kit-js-template.js +41 -0
  370. package/dist/services/onboarding/todo-collector.d.ts +18 -0
  371. package/dist/services/onboarding/todo-collector.js +48 -0
  372. package/dist/services/prewarm-service.d.ts +5 -0
  373. package/dist/services/prewarm-service.js +57 -0
  374. package/dist/services/pull/index.d.ts +3 -0
  375. package/dist/services/pull/index.js +6 -0
  376. package/dist/services/pull/pull-service-factory.d.ts +12 -0
  377. package/dist/services/pull/pull-service-factory.js +44 -0
  378. package/dist/services/pull/pull-service-model.d.ts +43 -0
  379. package/dist/services/pull/pull-service-model.js +27 -0
  380. package/dist/services/pull/pull-service.d.ts +18 -0
  381. package/dist/services/pull/pull-service.js +106 -0
  382. package/dist/templates/pops.js +97 -0
  383. package/dist/templates/speedKit.Revalidated.js +86 -0
  384. package/oclif.manifest.json +700 -0
  385. package/package.json +128 -0
@@ -0,0 +1,25 @@
1
+ import { PluginBuild, LogLevel } from 'esbuild';
2
+ export type BundleEntryPoints = {
3
+ [entryPoint: string]: string;
4
+ };
5
+ export type BundleBasePaths = {
6
+ [basePath: string]: string;
7
+ };
8
+ export declare class BundleService {
9
+ bundle({ entryPoints, basePaths, define, target, minify, logLevel }: {
10
+ entryPoints: BundleEntryPoints;
11
+ basePaths: BundleBasePaths;
12
+ target?: string | string[];
13
+ minify?: boolean;
14
+ define?: {
15
+ [key: string]: string;
16
+ };
17
+ logLevel?: LogLevel;
18
+ platform?: string;
19
+ }): Promise<string>;
20
+ private entryPointsPlugin;
21
+ baqendPlugin(basePaths: BundleBasePaths): {
22
+ name: string;
23
+ setup(build: PluginBuild): void;
24
+ };
25
+ }
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BundleService = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const esbuild_1 = require("esbuild");
6
+ const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
7
+ const node_url_1 = require("node:url");
8
+ const importCache = {};
9
+ class BundleService {
10
+ async bundle({ entryPoints, basePaths, define, target = 'es5', minify = true, logLevel = 'silent' }) {
11
+ const result = await (0, esbuild_1.build)({
12
+ plugins: [this.baqendPlugin(basePaths), this.entryPointsPlugin(entryPoints)],
13
+ bundle: true,
14
+ target,
15
+ define,
16
+ write: false,
17
+ minify,
18
+ outdir: 'out',
19
+ entryPoints: Object.keys(entryPoints),
20
+ logLevel,
21
+ });
22
+ return result.outputFiles.map(e => e.text).join('').trim();
23
+ }
24
+ entryPointsPlugin(entryPoints) {
25
+ return {
26
+ name: 'entryPoints',
27
+ setup(build) {
28
+ build.onResolve({ filter: /.*/ }, args => {
29
+ if (!entryPoints[args.path]) {
30
+ throw new Error('Could not resolve ' + args.path);
31
+ }
32
+ return ({
33
+ path: args.path,
34
+ namespace: 'entryPoint',
35
+ });
36
+ });
37
+ build.onLoad({ filter: /.*/, namespace: 'entryPoint' }, (args) => {
38
+ return {
39
+ contents: entryPoints[args.path],
40
+ loader: 'js',
41
+ };
42
+ });
43
+ },
44
+ };
45
+ }
46
+ baqendPlugin(basePaths) {
47
+ const filter = new RegExp(`^(${Object.keys(basePaths).join('|')})/`);
48
+ return {
49
+ name: 'baqend',
50
+ setup(build) {
51
+ build.onResolve({ filter }, args => {
52
+ const [base, path] = args.path.split('/', 2);
53
+ const url = new node_url_1.URL(path, basePaths[base]).toString();
54
+ if (!url.startsWith(basePaths[base])) {
55
+ throw new Error(`Importing ${path} failed. Can't resolve the path`);
56
+ }
57
+ return ({
58
+ path: url,
59
+ namespace: 'baqend-url',
60
+ });
61
+ });
62
+ build.onResolve({ filter: /.*/, namespace: 'baqend-url' }, args => ({
63
+ path: new node_url_1.URL(args.path, args.importer).toString(),
64
+ namespace: args.namespace,
65
+ }));
66
+ build.onLoad({ filter: /.*/, namespace: 'baqend-url' }, async (args) => {
67
+ const url = args.path + (!args.path.endsWith('.js') ? '.js' : '');
68
+ if (importCache[url]) {
69
+ return { contents: importCache[url] };
70
+ }
71
+ const fetched = await (0, node_fetch_1.default)(url);
72
+ if (!fetched.ok) {
73
+ throw new Error(`Importing ${url} failed with error ${fetched.status}`);
74
+ }
75
+ let text = await fetched.text();
76
+ text = text.replace('window.SpeedKit=window.SpeedKit||{},window.SpeedKit.plugins=window.SpeedKit.plugins||{},window.SpeedKit.plugins.', 'export var ');
77
+ importCache[url] = text;
78
+ return { contents: text };
79
+ });
80
+ },
81
+ };
82
+ }
83
+ }
84
+ exports.BundleService = BundleService;
@@ -0,0 +1,2 @@
1
+ export * from './bundle-service-factory';
2
+ export * from './bundle-service';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./bundle-service-factory"), exports);
5
+ tslib_1.__exportStar(require("./bundle-service"), exports);
@@ -0,0 +1,5 @@
1
+ import { CliService } from "./cli-service";
2
+ export declare class CliServiceFactory {
3
+ service?: CliService;
4
+ getService(): CliService;
5
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CliServiceFactory = void 0;
4
+ const cli_service_1 = require("./cli-service");
5
+ class CliServiceFactory {
6
+ service = undefined;
7
+ getService() {
8
+ if (!(this.service instanceof cli_service_1.CliService)) {
9
+ this.service = new cli_service_1.CliService();
10
+ }
11
+ return this.service;
12
+ }
13
+ }
14
+ exports.CliServiceFactory = CliServiceFactory;
@@ -0,0 +1,27 @@
1
+ import { table } from "@oclif/core/lib/cli-ux/styled/table";
2
+ export declare enum CliActionStatus {
3
+ COMPLETED = "completed",
4
+ FAILED = "failed",
5
+ SKIPPED = "skipped"
6
+ }
7
+ export interface CliServiceInterface {
8
+ codeStyle(code: string): string;
9
+ write(message: string, buffered?: boolean): void;
10
+ spacer(): void;
11
+ writeSuccess(message: string, buffered?: boolean): void;
12
+ writeWarning(message: string, buffered?: boolean): void;
13
+ writeError(message: string, buffered?: boolean): void;
14
+ comment(message: string, buffered?: boolean): void;
15
+ code(code: string, buffered?: boolean): void;
16
+ prompt(message: string, options?: {
17
+ validator?: any;
18
+ defaultAnswer?: any;
19
+ }): Promise<string>;
20
+ confirm(message: string, defaultAnswer: boolean): Promise<boolean>;
21
+ select(message: string, choices: any): Promise<string>;
22
+ startAction(message: string): void;
23
+ endAction(status?: CliActionStatus): void;
24
+ writeBuffer(): void;
25
+ table<T extends Record<string, unknown>>(data: T[], columns: table.Columns<T>, options?: table.Options): void;
26
+ exit(code: number): void;
27
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CliActionStatus = void 0;
4
+ var CliActionStatus;
5
+ (function (CliActionStatus) {
6
+ CliActionStatus["COMPLETED"] = "completed";
7
+ CliActionStatus["FAILED"] = "failed";
8
+ CliActionStatus["SKIPPED"] = "skipped";
9
+ })(CliActionStatus || (exports.CliActionStatus = CliActionStatus = {}));
@@ -0,0 +1,37 @@
1
+ import chalk from "chalk";
2
+ import { CliActionStatus, CliServiceInterface } from "./cli-service-model";
3
+ import { table } from "@oclif/core/lib/cli-ux/styled/table";
4
+ export declare class CliService implements CliServiceInterface {
5
+ private buffer;
6
+ style: chalk.Chalk & chalk.ChalkFunction & {
7
+ supportsColor: false | chalk.ColorSupport;
8
+ Level: chalk.Level;
9
+ Color: ("black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray" | "grey" | "blackBright" | "redBright" | "greenBright" | "yellowBright" | "blueBright" | "magentaBright" | "cyanBright" | "whiteBright") | ("bgBlack" | "bgRed" | "bgGreen" | "bgYellow" | "bgBlue" | "bgMagenta" | "bgCyan" | "bgWhite" | "bgGray" | "bgGrey" | "bgBlackBright" | "bgRedBright" | "bgGreenBright" | "bgYellowBright" | "bgBlueBright" | "bgMagentaBright" | "bgCyanBright" | "bgWhiteBright");
10
+ ForegroundColor: "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray" | "grey" | "blackBright" | "redBright" | "greenBright" | "yellowBright" | "blueBright" | "magentaBright" | "cyanBright" | "whiteBright";
11
+ BackgroundColor: "bgBlack" | "bgRed" | "bgGreen" | "bgYellow" | "bgBlue" | "bgMagenta" | "bgCyan" | "bgWhite" | "bgGray" | "bgGrey" | "bgBlackBright" | "bgRedBright" | "bgGreenBright" | "bgYellowBright" | "bgBlueBright" | "bgMagentaBright" | "bgCyanBright" | "bgWhiteBright";
12
+ Modifiers: "hidden" | "bold" | "reset" | "dim" | "italic" | "underline" | "inverse" | "strikethrough" | "visible";
13
+ stderr: chalk.Chalk & {
14
+ supportsColor: false | chalk.ColorSupport;
15
+ };
16
+ };
17
+ codeStyle(code: string): string;
18
+ write(message: string, buffered?: boolean): void;
19
+ spacer(): void;
20
+ writeSuccess(message: string, buffered?: boolean): void;
21
+ writeWarning(message: string, buffered?: boolean): void;
22
+ writeError(message: string, buffered?: boolean): void;
23
+ comment(message: string, buffered?: boolean): void;
24
+ code(code: string, buffered?: boolean): void;
25
+ prompt(message: string, options?: {
26
+ validator?: any;
27
+ defaultAnswer?: any;
28
+ }): Promise<string>;
29
+ confirm(message: string, defaultAnswer?: boolean): Promise<boolean>;
30
+ select(message: string, choices: any): Promise<string>;
31
+ startAction(message: string): void;
32
+ endAction(status?: CliActionStatus): void;
33
+ writeBuffer(): void;
34
+ table<T extends Record<string, unknown>>(data: T[], columns: table.Columns<T>, options?: table.Options): void;
35
+ exit(code?: number): void;
36
+ private getFormattedMessage;
37
+ }
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CliService = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ const prompts_1 = require("@inquirer/prompts"); // interactive prompts
7
+ const core_1 = require("@oclif/core");
8
+ const cli_service_model_1 = require("./cli-service-model");
9
+ class CliService {
10
+ buffer = [];
11
+ style = chalk_1.default;
12
+ codeStyle(code) {
13
+ const padding = ' ';
14
+ return this.style.bgGray.rgb(230, 126, 0)(`${padding}${code}${padding}`);
15
+ }
16
+ write(message, buffered = false) {
17
+ if (buffered) {
18
+ this.buffer.push(this.style.white(message));
19
+ return;
20
+ }
21
+ core_1.ux.info(message);
22
+ }
23
+ spacer() {
24
+ core_1.ux.info('');
25
+ }
26
+ writeSuccess(message, buffered = false) {
27
+ if (buffered) {
28
+ this.buffer.push(this.style.green(message));
29
+ return;
30
+ }
31
+ this.write(this.style.green(message));
32
+ }
33
+ writeWarning(message, buffered = false) {
34
+ if (buffered) {
35
+ this.buffer.push(this.style.yellow(message));
36
+ return;
37
+ }
38
+ this.write(this.style.yellow(message));
39
+ }
40
+ writeError(message, buffered = false) {
41
+ if (buffered) {
42
+ this.buffer.push(this.style.red(message));
43
+ return;
44
+ }
45
+ this.write(this.style.red(message));
46
+ }
47
+ comment(message, buffered = false) {
48
+ if (buffered) {
49
+ this.buffer.push(this.style.grey.italic(message));
50
+ return;
51
+ }
52
+ this.write(this.style.grey.italic(message));
53
+ }
54
+ code(code, buffered = false) {
55
+ code = ` ${code} `;
56
+ if (buffered) {
57
+ this.buffer.push(this.style.bgBlack.white(code));
58
+ return;
59
+ }
60
+ core_1.ux.log(this.style.bgBlack.white(code));
61
+ }
62
+ async prompt(message, options) {
63
+ const { validator, defaultAnswer } = options;
64
+ return (0, prompts_1.input)({
65
+ message: this.getFormattedMessage(message),
66
+ default: defaultAnswer,
67
+ validate: input => {
68
+ if (typeof validator !== 'function')
69
+ return true;
70
+ const errorMessage = validator(input);
71
+ if (!errorMessage) {
72
+ return true;
73
+ }
74
+ return this.style.red(`${errorMessage}. Please try again.`);
75
+ },
76
+ });
77
+ }
78
+ async confirm(message, defaultAnswer = true) {
79
+ return (0, prompts_1.confirm)({
80
+ message: this.getFormattedMessage(message),
81
+ default: defaultAnswer,
82
+ });
83
+ }
84
+ async select(message, choices) {
85
+ return (0, prompts_1.select)({
86
+ message: this.getFormattedMessage(message),
87
+ choices
88
+ });
89
+ }
90
+ startAction(message) {
91
+ core_1.ux.action.start(message);
92
+ }
93
+ endAction(status) {
94
+ switch (status) {
95
+ case cli_service_model_1.CliActionStatus.COMPLETED:
96
+ core_1.ux.action.stop(this.style.green(cli_service_model_1.CliActionStatus.COMPLETED));
97
+ break;
98
+ case cli_service_model_1.CliActionStatus.FAILED:
99
+ core_1.ux.action.stop(this.style.red(cli_service_model_1.CliActionStatus.FAILED));
100
+ break;
101
+ case cli_service_model_1.CliActionStatus.SKIPPED:
102
+ core_1.ux.action.stop(this.style.yellow(cli_service_model_1.CliActionStatus.SKIPPED));
103
+ break;
104
+ default:
105
+ core_1.ux.action.stop();
106
+ }
107
+ }
108
+ writeBuffer() {
109
+ core_1.ux.log(this.buffer.join(`\n`));
110
+ core_1.ux.log();
111
+ this.buffer = [];
112
+ }
113
+ table(data, columns, options) {
114
+ core_1.ux.table(data, columns, options);
115
+ }
116
+ exit(code = 0) {
117
+ core_1.ux.exit(code);
118
+ }
119
+ getFormattedMessage(questionText) {
120
+ return `${this.style.bold(questionText)}`;
121
+ }
122
+ }
123
+ exports.CliService = CliService;
@@ -0,0 +1,3 @@
1
+ import ApplicationError from "../../error-handling/error/application-error";
2
+ export default class CliTypeError extends ApplicationError {
3
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
5
+ class CliTypeError extends application_error_1.default {
6
+ }
7
+ exports.default = CliTypeError;
@@ -0,0 +1,11 @@
1
+ import { CliService } from "./cli-service";
2
+ export default abstract class Hooks {
3
+ readonly preHook?: string;
4
+ readonly postHook?: string;
5
+ protected cli: CliService;
6
+ protected constructor(cli: CliService, preHook?: string, postHook?: string);
7
+ run(): Promise<any>;
8
+ runPreHook(): Promise<void>;
9
+ runPostHook(): Promise<void>;
10
+ abstract _run(): Promise<any>;
11
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const child_process_1 = require("child_process");
4
+ class Hooks {
5
+ preHook;
6
+ postHook;
7
+ cli;
8
+ constructor(cli, preHook, postHook) {
9
+ this.cli = cli;
10
+ this.preHook = preHook;
11
+ this.postHook = postHook;
12
+ }
13
+ async run() {
14
+ await this.runPreHook();
15
+ await this._run();
16
+ await this.runPostHook();
17
+ }
18
+ async runPreHook() {
19
+ if (!this.preHook) {
20
+ return;
21
+ }
22
+ this.cli.writeSuccess(this.preHook);
23
+ this.cli.write((0, child_process_1.execSync)(this.preHook) + '');
24
+ }
25
+ async runPostHook() {
26
+ if (!this.postHook) {
27
+ return;
28
+ }
29
+ this.cli.writeSuccess(this.postHook);
30
+ this.cli.write((0, child_process_1.execSync)(this.postHook) + '');
31
+ }
32
+ }
33
+ exports.default = Hooks;
@@ -0,0 +1,3 @@
1
+ export * from './cli-service';
2
+ export * from './cli-service-model';
3
+ export * from './cli-service-factory';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./cli-service"), exports);
5
+ tslib_1.__exportStar(require("./cli-service-model"), exports);
6
+ tslib_1.__exportStar(require("./cli-service-factory"), exports);
@@ -0,0 +1,16 @@
1
+ import RequestExtensionInterface from "./interface/request-extension-interface";
2
+ import EntityManagerFactory from "./factory/entity-manager-factory";
3
+ export default class Client {
4
+ private readonly entityManagerFactory;
5
+ private readonly app;
6
+ private readonly agent;
7
+ constructor(app: string, entityManagerFactory: EntityManagerFactory);
8
+ send(url: string, requestExtension?: RequestExtensionInterface): Promise<any>;
9
+ getModule(moduleName: string): Promise<string>;
10
+ setModule(moduleName: string, moduleCode: string): Promise<string>;
11
+ /**
12
+ * @param requestExtension
13
+ */
14
+ createRequest(requestExtension: RequestExtensionInterface): Promise<{}>;
15
+ private getEntityManager;
16
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const https_1 = require("https");
5
+ const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
6
+ const deepmerge_1 = tslib_1.__importDefault(require("deepmerge"));
7
+ const race_1 = require("../../helpers/race");
8
+ const REQUEST_TIMEOUT = 10000;
9
+ const CONTENT_TYPE = 'application/json;charset=UTF-8';
10
+ class Client {
11
+ entityManagerFactory;
12
+ app;
13
+ agent;
14
+ constructor(app, entityManagerFactory) {
15
+ this.app = app;
16
+ this.entityManagerFactory = entityManagerFactory;
17
+ this.agent = new https_1.Agent({ rejectUnauthorized: false, keepAlive: true });
18
+ }
19
+ async send(url, requestExtension = {}) {
20
+ const res = await (0, node_fetch_1.default)(url, await this.createRequest(requestExtension));
21
+ if (res.status !== 200) {
22
+ throw new Error((await res.json()).message);
23
+ }
24
+ return await res.json();
25
+ }
26
+ async getModule(moduleName) {
27
+ const entityManager = await this.getEntityManager();
28
+ return await entityManager.code.loadCode(moduleName, 'module');
29
+ }
30
+ async setModule(moduleName, moduleCode) {
31
+ const entityManager = await this.getEntityManager();
32
+ return await entityManager.code.saveCode(moduleName, 'module', moduleCode);
33
+ }
34
+ /**
35
+ * @param requestExtension
36
+ */
37
+ async createRequest(requestExtension) {
38
+ const entityManager = await this.getEntityManager();
39
+ let baseRequest = {
40
+ method: 'GET',
41
+ headers: {
42
+ Host: `${this.app}.app.baqend.com`,
43
+ authorization: `BAT ${entityManager.token}`,
44
+ 'Content-Type': CONTENT_TYPE,
45
+ },
46
+ timeout: REQUEST_TIMEOUT,
47
+ };
48
+ return Object.assign({}, (0, deepmerge_1.default)(baseRequest, requestExtension), { agent: this.agent });
49
+ }
50
+ async getEntityManager() {
51
+ return await (0, race_1.race)(this.entityManagerFactory.getEntityManager(this.app));
52
+ }
53
+ }
54
+ exports.default = Client;
@@ -0,0 +1,16 @@
1
+ import Client from "./client";
2
+ import Install from "../deploy/interface/install";
3
+ export default class ConfigApiService {
4
+ client: Client;
5
+ private readonly app;
6
+ constructor(app: string, client: Client);
7
+ getActiveInstall(configName: string): Promise<Install | null>;
8
+ addInstall(configName: string, origins: string[]): Promise<Install>;
9
+ setInstall(install: Install): Promise<Install | null>;
10
+ cloneInstall(install: Install): Promise<Install>;
11
+ activateInstall(install: Install): Promise<Install>;
12
+ getModule(moduleName: string): Promise<string>;
13
+ setModule(moduleCode: string, moduleName: string): Promise<string>;
14
+ getServerConfig(): Promise<string>;
15
+ setServerConfig(localServerConfig: string, configurationVersion: string): Promise<void>;
16
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class ConfigApiService {
4
+ client;
5
+ app;
6
+ constructor(app, client) {
7
+ this.client = client;
8
+ this.app = app;
9
+ }
10
+ async getActiveInstall(configName) {
11
+ const urlPath = `https://${this.app}.app.baqend.com/v1/speedkit/installation?domain=${configName}&status=active`;
12
+ const body = await this.client.send(urlPath);
13
+ return body[0];
14
+ }
15
+ async addInstall(configName, origins) {
16
+ const updateUrl = `https://${this.app}.app.baqend.com/v1/speedkit/installation/${configName}`;
17
+ const body = await this.client.send(updateUrl, { body: `{origins: ${JSON.stringify(origins)}}`, method: 'POST' });
18
+ return body;
19
+ }
20
+ async setInstall(install) {
21
+ const updateUrl = `https://${this.app}.app.baqend.com/v1/speedkit/installation/${install.domain}/${install.configVersion}`;
22
+ return (await this.client.send(updateUrl, { body: JSON.stringify(install), method: 'PUT' }));
23
+ }
24
+ async cloneInstall(install) {
25
+ const cloneUrl = `https://${this.app}.app.baqend.com/v1/speedkit/installation/${install.domain}/${install.configVersion}/clone`;
26
+ const body = await this.client.send(cloneUrl, { body: '{}', method: 'POST' });
27
+ return body;
28
+ }
29
+ async activateInstall(install) {
30
+ const activateUrl = `https://${this.app}.app.baqend.com/v1/speedkit/installation/${install.domain}/${install.configVersion}/activate`;
31
+ return (await this.client.send(activateUrl, { body: '{}', method: 'POST' }));
32
+ }
33
+ async getModule(moduleName) {
34
+ return await this.client.getModule(moduleName);
35
+ }
36
+ async setModule(moduleCode, moduleName) {
37
+ return await this.client.setModule(moduleName, moduleCode);
38
+ }
39
+ async getServerConfig() {
40
+ const urlPath = `https://${this.app}.app.baqend.com/v1/config`;
41
+ const body = await this.client.send(urlPath);
42
+ return JSON.stringify(body, null, '\t');
43
+ }
44
+ async setServerConfig(localServerConfig, configurationVersion) {
45
+ const urlPath = `https://${this.app}.app.baqend.com/v1/config`;
46
+ await this.client.send(urlPath, {
47
+ body: localServerConfig,
48
+ method: 'PUT',
49
+ headers: {
50
+ 'Content-Type': 'application/json',
51
+ 'If-Match': configurationVersion,
52
+ },
53
+ });
54
+ }
55
+ }
56
+ exports.default = ConfigApiService;
@@ -0,0 +1,5 @@
1
+ import ContextInterface from "../../context/interface/context-interface";
2
+ export default class ConfigApiContext implements ContextInterface {
3
+ readonly app: string;
4
+ constructor(app: string);
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class ConfigApiContext {
4
+ app = undefined;
5
+ constructor(app) {
6
+ this.app = app;
7
+ }
8
+ }
9
+ exports.default = ConfigApiContext;
@@ -0,0 +1,2 @@
1
+ export default class JsonResponseError extends Error {
2
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class JsonResponseError extends Error {
4
+ }
5
+ exports.default = JsonResponseError;
@@ -0,0 +1,5 @@
1
+ import DeployAppError from "../../deploy/error/deploy-app-error";
2
+ export default class LoginError extends DeployAppError {
3
+ app: string;
4
+ constructor(app: string);
5
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const deploy_app_error_1 = tslib_1.__importDefault(require("../../deploy/error/deploy-app-error"));
5
+ class LoginError extends deploy_app_error_1.default {
6
+ app;
7
+ constructor(app) {
8
+ super(`Could not login to app ${app}`);
9
+ this.app = app;
10
+ }
11
+ }
12
+ exports.default = LoginError;
@@ -0,0 +1,10 @@
1
+ import ConfigApiService from "../config-api-service";
2
+ import ConfigApiContextInterface from "../interface/config-api-context-interface";
3
+ export default class ConfigApiServiceFactory {
4
+ context: ConfigApiContextInterface;
5
+ service: ConfigApiService;
6
+ constructor(context: ConfigApiContextInterface);
7
+ getService(): ConfigApiService;
8
+ buildService(): void;
9
+ createLoginTokenFileIfNotExists(): void;
10
+ }