@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.
- package/README.md +775 -0
- package/bin/dev +18 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +4 -0
- package/bin/run.cmd +3 -0
- package/dist/commands/airports_iata.json +1 -0
- package/dist/commands/build-parameter-query.d.ts +15 -0
- package/dist/commands/build-parameter-query.js +95 -0
- package/dist/commands/build-prewarm-query.d.ts +15 -0
- package/dist/commands/build-prewarm-query.js +69 -0
- package/dist/commands/deploy.d.ts +17 -0
- package/dist/commands/deploy.js +39 -0
- package/dist/commands/document-handler.d.ts +16 -0
- package/dist/commands/document-handler.js +36 -0
- package/dist/commands/find-pops.d.ts +17 -0
- package/dist/commands/find-pops.js +84 -0
- package/dist/commands/generate-customer-config.d.ts +10 -0
- package/dist/commands/generate-customer-config.js +29 -0
- package/dist/commands/generate-pop-config.d.ts +27 -0
- package/dist/commands/generate-pop-config.js +231 -0
- package/dist/commands/login.d.ts +10 -0
- package/dist/commands/login.js +35 -0
- package/dist/commands/onboarding.d.ts +16 -0
- package/dist/commands/onboarding.js +25 -0
- package/dist/commands/param-diff.d.ts +16 -0
- package/dist/commands/param-diff.js +111 -0
- package/dist/commands/pop-prewarm.d.ts +17 -0
- package/dist/commands/pop-prewarm.js +80 -0
- package/dist/commands/prewarm.d.ts +40 -0
- package/dist/commands/prewarm.js +127 -0
- package/dist/commands/pull.d.ts +14 -0
- package/dist/commands/pull.js +24 -0
- package/dist/commands/wpt-launcher.d.ts +21 -0
- package/dist/commands/wpt-launcher.js +79 -0
- package/dist/helpers/CustomerConfig.d.ts +51 -0
- package/dist/helpers/CustomerConfig.js +150 -0
- package/dist/helpers/build-query-helper.d.ts +32 -0
- package/dist/helpers/build-query-helper.js +216 -0
- package/dist/helpers/cli-config.d.ts +22 -0
- package/dist/helpers/cli-config.js +85 -0
- package/dist/helpers/file-helper.d.ts +8 -0
- package/dist/helpers/file-helper.js +63 -0
- package/dist/helpers/get-parsed-config.d.ts +11 -0
- package/dist/helpers/get-parsed-config.js +63 -0
- package/dist/helpers/getChromePath.d.ts +7 -0
- package/dist/helpers/getChromePath.js +27 -0
- package/dist/helpers/isDirectory.d.ts +1 -0
- package/dist/helpers/isDirectory.js +17 -0
- package/dist/helpers/isExecutable.d.ts +1 -0
- package/dist/helpers/isExecutable.js +15 -0
- package/dist/helpers/isFile.d.ts +1 -0
- package/dist/helpers/isFile.js +17 -0
- package/dist/helpers/logging-helper.d.ts +12 -0
- package/dist/helpers/logging-helper.js +27 -0
- package/dist/helpers/normalize.d.ts +40 -0
- package/dist/helpers/normalize.js +112 -0
- package/dist/helpers/race.d.ts +1 -0
- package/dist/helpers/race.js +16 -0
- package/dist/helpers/safe.d.ts +10 -0
- package/dist/helpers/safe.js +34 -0
- package/dist/helpers/scrape.d.ts +1 -0
- package/dist/helpers/scrape.js +11 -0
- package/dist/helpers/speedKitRuleToRegExp.d.ts +1 -0
- package/dist/helpers/speedKitRuleToRegExp.js +10 -0
- package/dist/helpers/watchFiles.d.ts +1 -0
- package/dist/helpers/watchFiles.js +20 -0
- package/dist/models/cli-parameters.d.ts +73 -0
- package/dist/models/cli-parameters.js +82 -0
- package/dist/models/files.d.ts +20 -0
- package/dist/models/files.js +23 -0
- package/dist/models/install.d.ts +24 -0
- package/dist/models/install.js +2 -0
- package/dist/services/athena-service.d.ts +30 -0
- package/dist/services/athena-service.js +139 -0
- package/dist/services/bundler/bundle-service-factory.d.ts +4 -0
- package/dist/services/bundler/bundle-service-factory.js +10 -0
- package/dist/services/bundler/bundle-service.d.ts +25 -0
- package/dist/services/bundler/bundle-service.js +84 -0
- package/dist/services/bundler/index.d.ts +2 -0
- package/dist/services/bundler/index.js +5 -0
- package/dist/services/cli/cli-service-factory.d.ts +5 -0
- package/dist/services/cli/cli-service-factory.js +14 -0
- package/dist/services/cli/cli-service-model.d.ts +27 -0
- package/dist/services/cli/cli-service-model.js +9 -0
- package/dist/services/cli/cli-service.d.ts +37 -0
- package/dist/services/cli/cli-service.js +123 -0
- package/dist/services/cli/error/cli-type-error.d.ts +3 -0
- package/dist/services/cli/error/cli-type-error.js +7 -0
- package/dist/services/cli/hooks.d.ts +11 -0
- package/dist/services/cli/hooks.js +33 -0
- package/dist/services/cli/index.d.ts +3 -0
- package/dist/services/cli/index.js +6 -0
- package/dist/services/config-api/client.d.ts +16 -0
- package/dist/services/config-api/client.js +54 -0
- package/dist/services/config-api/config-api-service.d.ts +16 -0
- package/dist/services/config-api/config-api-service.js +56 -0
- package/dist/services/config-api/context/config-api-context.d.ts +5 -0
- package/dist/services/config-api/context/config-api-context.js +9 -0
- package/dist/services/config-api/error/json-response-error.d.ts +2 -0
- package/dist/services/config-api/error/json-response-error.js +5 -0
- package/dist/services/config-api/error/login-error.d.ts +5 -0
- package/dist/services/config-api/error/login-error.js +12 -0
- package/dist/services/config-api/factory/config-api-service-factory.d.ts +10 -0
- package/dist/services/config-api/factory/config-api-service-factory.js +38 -0
- package/dist/services/config-api/factory/entity-manager-factory.d.ts +5 -0
- package/dist/services/config-api/factory/entity-manager-factory.js +21 -0
- package/dist/services/config-api/interface/config-api-context-interface.d.ts +4 -0
- package/dist/services/config-api/interface/config-api-context-interface.js +2 -0
- package/dist/services/config-api/interface/request-extension-interface.d.ts +5 -0
- package/dist/services/config-api/interface/request-extension-interface.js +2 -0
- package/dist/services/config-api-service.d.ts +18 -0
- package/dist/services/config-api-service.js +96 -0
- package/dist/services/context/app-context.d.ts +1 -0
- package/dist/services/context/app-context.js +2 -0
- package/dist/services/context/error/context-runtime-error.d.ts +3 -0
- package/dist/services/context/error/context-runtime-error.js +7 -0
- package/dist/services/context/interface/context-interface.d.ts +2 -0
- package/dist/services/context/interface/context-interface.js +2 -0
- package/dist/services/customer-config/customer-config-service-context.d.ts +5 -0
- package/dist/services/customer-config/customer-config-service-context.js +15 -0
- package/dist/services/customer-config/customer-config-service-factory.d.ts +8 -0
- package/dist/services/customer-config/customer-config-service-factory.js +24 -0
- package/dist/services/customer-config/customer-config-service-model.d.ts +39 -0
- package/dist/services/customer-config/customer-config-service-model.js +23 -0
- package/dist/services/customer-config/customer-config-service.d.ts +27 -0
- package/dist/services/customer-config/customer-config-service.js +263 -0
- package/dist/services/customer-config/index.d.ts +4 -0
- package/dist/services/customer-config/index.js +7 -0
- package/dist/services/customer-config/templates/config_SpeedKit.js.hbs +351 -0
- package/dist/services/customer-config/templates/config_customer.js.hbs +75 -0
- package/dist/services/customer-config/templates/config_documentHandler.js.hbs +162 -0
- package/dist/services/customer-config/templates/config_dynamicBlocks.es6.hbs +263 -0
- package/dist/services/customer-config/templates/config_dynamicStyles.css.hbs +116 -0
- package/dist/services/customer-config/templates/config_loadHandler.js.hbs +394 -0
- package/dist/services/customer-config/templates/deploymentDetection.es6.hbs +262 -0
- package/dist/services/customer-config/templates/downtimeDetection.js.hbs +110 -0
- package/dist/services/deploy/builder/install-resource-builder.d.ts +14 -0
- package/dist/services/deploy/builder/install-resource-builder.js +48 -0
- package/dist/services/deploy/checks/post-deploy/revalidated-module-check.d.ts +11 -0
- package/dist/services/deploy/checks/post-deploy/revalidated-module-check.js +30 -0
- package/dist/services/deploy/checks/post-deploy/save-files-check.d.ts +9 -0
- package/dist/services/deploy/checks/post-deploy/save-files-check.js +25 -0
- package/dist/services/deploy/context/deploy-context.d.ts +12 -0
- package/dist/services/deploy/context/deploy-context.js +26 -0
- package/dist/services/deploy/deploy-service-factory.d.ts +15 -0
- package/dist/services/deploy/deploy-service-factory.js +68 -0
- package/dist/services/deploy/deploy-service.d.ts +17 -0
- package/dist/services/deploy/deploy-service.js +63 -0
- package/dist/services/deploy/error/create-find-temp-directory-error.d.ts +4 -0
- package/dist/services/deploy/error/create-find-temp-directory-error.js +10 -0
- package/dist/services/deploy/error/deploy-app-error.d.ts +2 -0
- package/dist/services/deploy/error/deploy-app-error.js +5 -0
- package/dist/services/deploy/error/no-active-installation-error.d.ts +4 -0
- package/dist/services/deploy/error/no-active-installation-error.js +10 -0
- package/dist/services/deploy/handler/customer-config-handler.d.ts +21 -0
- package/dist/services/deploy/handler/customer-config-handler.js +85 -0
- package/dist/services/deploy/handler/install-resource-handler.d.ts +25 -0
- package/dist/services/deploy/handler/install-resource-handler.js +104 -0
- package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.d.ts +13 -0
- package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.js +51 -0
- package/dist/services/deploy/handler/module-handler.d.ts +14 -0
- package/dist/services/deploy/handler/module-handler.js +81 -0
- package/dist/services/deploy/handler/module-modifier/deployment-detection-modifier.d.ts +9 -0
- package/dist/services/deploy/handler/module-modifier/deployment-detection-modifier.js +24 -0
- package/dist/services/deploy/handler/server-config-handler.d.ts +12 -0
- package/dist/services/deploy/handler/server-config-handler.js +63 -0
- package/dist/services/deploy/interface/deploy-handler-interface.d.ts +6 -0
- package/dist/services/deploy/interface/deploy-handler-interface.js +2 -0
- package/dist/services/deploy/interface/install-configs.d.ts +11 -0
- package/dist/services/deploy/interface/install-configs.js +2 -0
- package/dist/services/deploy/interface/install-resource-processor-interface.d.ts +5 -0
- package/dist/services/deploy/interface/install-resource-processor-interface.js +2 -0
- package/dist/services/deploy/interface/install.d.ts +14 -0
- package/dist/services/deploy/interface/install.js +2 -0
- package/dist/services/deploy/interface/post-deploy-check-interface.d.ts +3 -0
- package/dist/services/deploy/interface/post-deploy-check-interface.js +2 -0
- package/dist/services/deploy/interface/runtime-modifier.d.ts +6 -0
- package/dist/services/deploy/interface/runtime-modifier.js +2 -0
- package/dist/services/deploy/interface/validate-origins-response.d.ts +4 -0
- package/dist/services/deploy/interface/validate-origins-response.js +2 -0
- package/dist/services/diff/diff-model.d.ts +5 -0
- package/dist/services/diff/diff-model.js +12 -0
- package/dist/services/diff/diff-service-factory.d.ts +7 -0
- package/dist/services/diff/diff-service-factory.js +20 -0
- package/dist/services/diff/diff-service.d.ts +34 -0
- package/dist/services/diff/diff-service.js +134 -0
- package/dist/services/diff/index.d.ts +3 -0
- package/dist/services/diff/index.js +6 -0
- package/dist/services/diff-service.d.ts +24 -0
- package/dist/services/diff-service.js +112 -0
- package/dist/services/document-handler-runtime/context/document-handler-runtime-context.d.ts +23 -0
- package/dist/services/document-handler-runtime/context/document-handler-runtime-context.js +41 -0
- package/dist/services/document-handler-runtime/document-handler-runtime-service.d.ts +32 -0
- package/dist/services/document-handler-runtime/document-handler-runtime-service.js +220 -0
- package/dist/services/document-handler-runtime/document-handler-server.d.ts +42 -0
- package/dist/services/document-handler-runtime/document-handler-server.js +225 -0
- package/dist/services/document-handler-runtime/error/handler/required-file-not-found-handler.d.ts +6 -0
- package/dist/services/document-handler-runtime/error/handler/required-file-not-found-handler.js +14 -0
- package/dist/services/document-handler-runtime/error/required-file-not-found-error.d.ts +3 -0
- package/dist/services/document-handler-runtime/error/required-file-not-found-error.js +7 -0
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +24 -0
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +106 -0
- package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.d.ts +3 -0
- package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.js +6 -0
- package/dist/services/document-handler-runtime/interface/template-context-interface.d.ts +3 -0
- package/dist/services/document-handler-runtime/interface/template-context-interface.js +2 -0
- package/dist/services/document-handler-runtime/interface/template-interface.d.ts +6 -0
- package/dist/services/document-handler-runtime/interface/template-interface.js +2 -0
- package/dist/services/document-handler-runtime/interface/template-param-interface.d.ts +4 -0
- package/dist/services/document-handler-runtime/interface/template-param-interface.js +2 -0
- package/dist/services/document-handler-runtime/templates/abstract-template.d.ts +9 -0
- package/dist/services/document-handler-runtime/templates/abstract-template.js +18 -0
- package/dist/services/document-handler-runtime/templates/database-mock.d.ts +6 -0
- package/dist/services/document-handler-runtime/templates/database-mock.js +111 -0
- package/dist/services/document-handler-runtime/templates/execute-document-handler.d.ts +6 -0
- package/dist/services/document-handler-runtime/templates/execute-document-handler.js +76 -0
- package/dist/services/document-handler-runtime/templates/orestes-mock.d.ts +9 -0
- package/dist/services/document-handler-runtime/templates/orestes-mock.js +168 -0
- package/dist/services/document-handler-runtime/templates/package-json.d.ts +8 -0
- package/dist/services/document-handler-runtime/templates/package-json.js +21 -0
- package/dist/services/document-handler-runtime/templates/test.d.ts +6 -0
- package/dist/services/document-handler-runtime/templates/test.js +63 -0
- package/dist/services/error-handling/abstract/abstract-async-error-handling-factory.d.ts +6 -0
- package/dist/services/error-handling/abstract/abstract-async-error-handling-factory.js +19 -0
- package/dist/services/error-handling/abstract/abstract-async-error-handling-service.d.ts +6 -0
- package/dist/services/error-handling/abstract/abstract-async-error-handling-service.js +18 -0
- package/dist/services/error-handling/abstract/abstract-error-handling-factory.d.ts +6 -0
- package/dist/services/error-handling/abstract/abstract-error-handling-factory.js +19 -0
- package/dist/services/error-handling/abstract/abstract-error-handling-service.d.ts +6 -0
- package/dist/services/error-handling/abstract/abstract-error-handling-service.js +19 -0
- package/dist/services/error-handling/error/application-error.d.ts +5 -0
- package/dist/services/error-handling/error/application-error.js +11 -0
- package/dist/services/error-handling/error/handler/default-error-handler.d.ts +5 -0
- package/dist/services/error-handling/error/handler/default-error-handler.js +13 -0
- package/dist/services/error-handling/error-handling-service.d.ts +7 -0
- package/dist/services/error-handling/error-handling-service.js +27 -0
- package/dist/services/error-handling/factory/error-handling-factory.d.ts +8 -0
- package/dist/services/error-handling/factory/error-handling-factory.js +21 -0
- package/dist/services/error-handling/interface/error-context-interface.d.ts +6 -0
- package/dist/services/error-handling/interface/error-context-interface.js +2 -0
- package/dist/services/error-handling/interface/error-handler-interface.d.ts +5 -0
- package/dist/services/error-handling/interface/error-handler-interface.js +2 -0
- package/dist/services/error-handling/interface/error-handling-factory-interface.d.ts +8 -0
- package/dist/services/error-handling/interface/error-handling-factory-interface.js +2 -0
- package/dist/services/error-handling/interface/error-handling-service-interface.d.ts +8 -0
- package/dist/services/error-handling/interface/error-handling-service-interface.js +2 -0
- package/dist/services/integration-api/context/integration-api-context.d.ts +9 -0
- package/dist/services/integration-api/context/integration-api-context.js +20 -0
- package/dist/services/integration-api/error/customer-config-error.d.ts +2 -0
- package/dist/services/integration-api/error/customer-config-error.js +5 -0
- package/dist/services/integration-api/error/customer-config-legacy-error.d.ts +3 -0
- package/dist/services/integration-api/error/customer-config-legacy-error.js +7 -0
- package/dist/services/integration-api/error/handler/customer-config-handler.d.ts +5 -0
- package/dist/services/integration-api/error/handler/customer-config-handler.js +19 -0
- package/dist/services/integration-api/error/handler/customer-config-legacy-handler.d.ts +6 -0
- package/dist/services/integration-api/error/handler/customer-config-legacy-handler.js +24 -0
- package/dist/services/integration-api/error/handler/origin-handler.d.ts +6 -0
- package/dist/services/integration-api/error/handler/origin-handler.js +22 -0
- package/dist/services/integration-api/error/load-customer-error.d.ts +4 -0
- package/dist/services/integration-api/error/load-customer-error.js +10 -0
- package/dist/services/integration-api/error/mandatory-file-missing-error.d.ts +3 -0
- package/dist/services/integration-api/error/mandatory-file-missing-error.js +8 -0
- package/dist/services/integration-api/error/origin-error.d.ts +3 -0
- package/dist/services/integration-api/error/origin-error.js +7 -0
- package/dist/services/integration-api/external/external-file-reader.d.ts +4 -0
- package/dist/services/integration-api/external/external-file-reader.js +17 -0
- package/dist/services/integration-api/factory/integration-api-service-factory.d.ts +13 -0
- package/dist/services/integration-api/factory/integration-api-service-factory.js +55 -0
- package/dist/services/integration-api/file-list.d.ts +18 -0
- package/dist/services/integration-api/file-list.js +79 -0
- package/dist/services/integration-api/file-reader.d.ts +15 -0
- package/dist/services/integration-api/file-reader.js +97 -0
- package/dist/services/integration-api/file-writer.d.ts +9 -0
- package/dist/services/integration-api/file-writer.js +27 -0
- package/dist/services/integration-api/handler/customer-config-handler.d.ts +16 -0
- package/dist/services/integration-api/handler/customer-config-handler.js +55 -0
- package/dist/services/integration-api/handler/file-handler.d.ts +9 -0
- package/dist/services/integration-api/handler/file-handler.js +20 -0
- package/dist/services/integration-api/handler/install-resource-handler.d.ts +33 -0
- package/dist/services/integration-api/handler/install-resource-handler.js +67 -0
- package/dist/services/integration-api/handler/module-handler.d.ts +12 -0
- package/dist/services/integration-api/handler/module-handler.js +20 -0
- package/dist/services/integration-api/handler/server-config-handler.d.ts +8 -0
- package/dist/services/integration-api/handler/server-config-handler.js +21 -0
- package/dist/services/integration-api/integration-api-model.d.ts +89 -0
- package/dist/services/integration-api/integration-api-model.js +2 -0
- package/dist/services/integration-api/integration-api-service.d.ts +21 -0
- package/dist/services/integration-api/integration-api-service.js +76 -0
- package/dist/services/integration-api/struct/customer-config-file.d.ts +10 -0
- package/dist/services/integration-api/struct/customer-config-file.js +32 -0
- package/dist/services/integration-api/struct/customer-config.d.ts +22 -0
- package/dist/services/integration-api/struct/customer-config.js +67 -0
- package/dist/services/integration-api/struct/file.d.ts +19 -0
- package/dist/services/integration-api/struct/file.js +61 -0
- package/dist/services/integration-api/struct/install-resource-file.d.ts +6 -0
- package/dist/services/integration-api/struct/install-resource-file.js +12 -0
- package/dist/services/integration-api/struct/module-file.d.ts +5 -0
- package/dist/services/integration-api/struct/module-file.js +10 -0
- package/dist/services/integration-api/struct/ro-file.d.ts +13 -0
- package/dist/services/integration-api/struct/ro-file.js +26 -0
- package/dist/services/integration-api/struct/server-config-file.d.ts +9 -0
- package/dist/services/integration-api/struct/server-config-file.js +22 -0
- package/dist/services/integration-api/struct/virtual-file.d.ts +14 -0
- package/dist/services/integration-api/struct/virtual-file.js +28 -0
- package/dist/services/integration-api/validator/customer-config-validator.d.ts +5 -0
- package/dist/services/integration-api/validator/customer-config-validator.js +23 -0
- package/dist/services/integration-api/validator/mandatory-files-validator.d.ts +7 -0
- package/dist/services/integration-api/validator/mandatory-files-validator.js +39 -0
- package/dist/services/integration-api/virtual/external-recipe.d.ts +9 -0
- package/dist/services/integration-api/virtual/external-recipe.js +19 -0
- package/dist/services/integration-api/virtual/virtual-file-handler.d.ts +7 -0
- package/dist/services/integration-api/virtual/virtual-file-handler.js +38 -0
- package/dist/services/onboarding/browser/abort-response.d.ts +5 -0
- package/dist/services/onboarding/browser/abort-response.js +10 -0
- package/dist/services/onboarding/browser/baqend-response.d.ts +12 -0
- package/dist/services/onboarding/browser/baqend-response.js +52 -0
- package/dist/services/onboarding/browser/origin-response.d.ts +8 -0
- package/dist/services/onboarding/browser/origin-response.js +20 -0
- package/dist/services/onboarding/config-renderer/install-file-recipe.d.ts +7 -0
- package/dist/services/onboarding/config-renderer/install-file-recipe.js +13 -0
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.d.ts +22 -0
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +78 -0
- package/dist/services/onboarding/dashboard/athena-service.d.ts +11 -0
- package/dist/services/onboarding/dashboard/athena-service.js +70 -0
- package/dist/services/onboarding/dashboard/frontend-dist/assets/index-87b53ed4.css +1 -0
- package/dist/services/onboarding/dashboard/frontend-dist/assets/main-274b5625.js +9 -0
- package/dist/services/onboarding/dashboard/frontend-dist/index.html +18 -0
- package/dist/services/onboarding/dashboard/index.d.ts +16 -0
- package/dist/services/onboarding/dashboard/index.js +78 -0
- package/dist/services/onboarding/dashboard/param-query-builder.d.ts +9 -0
- package/dist/services/onboarding/dashboard/param-query-builder.js +67 -0
- package/dist/services/onboarding/dashboard/request-diff-service.d.ts +11 -0
- package/dist/services/onboarding/dashboard/request-diff-service.js +59 -0
- package/dist/services/onboarding/error/vm-error.d.ts +2 -0
- package/dist/services/onboarding/error/vm-error.js +6 -0
- package/dist/services/onboarding/fetch-event-handler.d.ts +19 -0
- package/dist/services/onboarding/fetch-event-handler.js +155 -0
- package/dist/services/onboarding/fetch-events/customer-domain-document-response.d.ts +24 -0
- package/dist/services/onboarding/fetch-events/customer-domain-document-response.js +118 -0
- package/dist/services/onboarding/fetch-events/customer-service-worker-js.d.ts +14 -0
- package/dist/services/onboarding/fetch-events/customer-service-worker-js.js +30 -0
- package/dist/services/onboarding/fetch-events/dashboard-request.d.ts +15 -0
- package/dist/services/onboarding/fetch-events/dashboard-request.js +29 -0
- package/dist/services/onboarding/fetch-events/speed-kit-asset-request.d.ts +26 -0
- package/dist/services/onboarding/fetch-events/speed-kit-asset-request.js +138 -0
- package/dist/services/onboarding/fetch-events/speed-kit-install-html.d.ts +15 -0
- package/dist/services/onboarding/fetch-events/speed-kit-install-html.js +49 -0
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.d.ts +22 -0
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +62 -0
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +21 -0
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.js +43 -0
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +17 -0
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.js +27 -0
- package/dist/services/onboarding/file-events/fileWatcher.d.ts +28 -0
- package/dist/services/onboarding/file-events/fileWatcher.js +133 -0
- package/dist/services/onboarding/index.d.ts +3 -0
- package/dist/services/onboarding/index.js +8 -0
- package/dist/services/onboarding/onboarding-model.d.ts +30 -0
- package/dist/services/onboarding/onboarding-model.js +53 -0
- package/dist/services/onboarding/onboarding-service-factory.d.ts +16 -0
- package/dist/services/onboarding/onboarding-service-factory.js +163 -0
- package/dist/services/onboarding/onboarding-service.d.ts +31 -0
- package/dist/services/onboarding/onboarding-service.js +130 -0
- package/dist/services/onboarding/request-cache/cache.d.ts +15 -0
- package/dist/services/onboarding/request-cache/cache.js +32 -0
- package/dist/services/onboarding/templates/install-speed-kit-html-template.d.ts +4 -0
- package/dist/services/onboarding/templates/install-speed-kit-html-template.js +264 -0
- package/dist/services/onboarding/templates/install-speed-kit-js-template.d.ts +4 -0
- package/dist/services/onboarding/templates/install-speed-kit-js-template.js +41 -0
- package/dist/services/onboarding/todo-collector.d.ts +18 -0
- package/dist/services/onboarding/todo-collector.js +48 -0
- package/dist/services/prewarm-service.d.ts +5 -0
- package/dist/services/prewarm-service.js +57 -0
- package/dist/services/pull/index.d.ts +3 -0
- package/dist/services/pull/index.js +6 -0
- package/dist/services/pull/pull-service-factory.d.ts +12 -0
- package/dist/services/pull/pull-service-factory.js +44 -0
- package/dist/services/pull/pull-service-model.d.ts +43 -0
- package/dist/services/pull/pull-service-model.js +27 -0
- package/dist/services/pull/pull-service.d.ts +18 -0
- package/dist/services/pull/pull-service.js +106 -0
- package/dist/templates/pops.js +97 -0
- package/dist/templates/speedKit.Revalidated.js +86 -0
- package/oclif.manifest.json +700 -0
- package/package.json +128 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalize = exports.transformNoValueParams = exports.convertNotEncodedParameters = exports.sortParams = void 0;
|
|
4
|
+
const { URL } = require('url');
|
|
5
|
+
/**
|
|
6
|
+
* Sorts all urls params manually.
|
|
7
|
+
*
|
|
8
|
+
* @param searchParams - Params to sort.
|
|
9
|
+
*/
|
|
10
|
+
function sortParams(searchParams) {
|
|
11
|
+
const entries = [...searchParams.entries()].sort((a, b) => {
|
|
12
|
+
if (a[0] === b[0]) {
|
|
13
|
+
return a[1] < b[1] ? -1 : 1;
|
|
14
|
+
}
|
|
15
|
+
return a[0] < b[0] ? -1 : 1;
|
|
16
|
+
});
|
|
17
|
+
// Clear search params before appending sorted params
|
|
18
|
+
entries.forEach(key => searchParams.delete(key[0]));
|
|
19
|
+
// Append sorted params without overwriting keys
|
|
20
|
+
entries.forEach(key => searchParams.append(key[0], key[1]));
|
|
21
|
+
}
|
|
22
|
+
exports.sortParams = sortParams;
|
|
23
|
+
/**
|
|
24
|
+
* Encodes the parameter key as URL object would encode query params.
|
|
25
|
+
*
|
|
26
|
+
* @param parameterKey - The key to encode.
|
|
27
|
+
* @param parameterValue - The value to encode.
|
|
28
|
+
* @return The encoded parameter key and value without ?.
|
|
29
|
+
*/
|
|
30
|
+
function encodeUrlComponent(parameterKey, parameterValue) {
|
|
31
|
+
const url = new URL('https://www.baqend.com/');
|
|
32
|
+
url.searchParams.append(parameterKey, parameterValue);
|
|
33
|
+
return url.search.replace(/\?/, '');
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Converts parameters back to origin form.
|
|
37
|
+
*
|
|
38
|
+
* When adding parameters to the original URL the encoding of the parameters can change.
|
|
39
|
+
* This is because adding parameters to an URL object triggers a decode before adding
|
|
40
|
+
* and an encode after adding. Therefore the encoding of parameters can differ from the origin
|
|
41
|
+
* (e.g. if a whitespace is encoded like '%20' in the original URL, adding a parameter by calling
|
|
42
|
+
* searchParams.append() encodes the whitespace to '+').
|
|
43
|
+
*
|
|
44
|
+
* The root cause for this is because the encoding when appending search params to an URL object
|
|
45
|
+
* is different than the encoding of encodeURIComponent().
|
|
46
|
+
*
|
|
47
|
+
* @param url - The original Url.
|
|
48
|
+
* @param manipulatedUrl - The computed URL.
|
|
49
|
+
*/
|
|
50
|
+
function convertNotEncodedParameters(url, manipulatedUrl) {
|
|
51
|
+
if (manipulatedUrl.search.length === 0) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const originalParamsMap = new Map();
|
|
55
|
+
const originalParams = url.search.substring(1).split('&');
|
|
56
|
+
let index = 0;
|
|
57
|
+
url.searchParams.forEach((value, param) => {
|
|
58
|
+
const paramWithValue = originalParams[index];
|
|
59
|
+
if (paramWithValue) {
|
|
60
|
+
originalParamsMap.set(encodeUrlComponent(param, value), paramWithValue);
|
|
61
|
+
}
|
|
62
|
+
index += 1;
|
|
63
|
+
});
|
|
64
|
+
const search = [...manipulatedUrl.searchParams].map((entry) => {
|
|
65
|
+
const [key, value] = entry;
|
|
66
|
+
const originalParamWithValue = originalParamsMap.get(encodeUrlComponent(key, value));
|
|
67
|
+
if (originalParamWithValue) {
|
|
68
|
+
return `${originalParamWithValue}`;
|
|
69
|
+
}
|
|
70
|
+
return `${key}=${value}`;
|
|
71
|
+
});
|
|
72
|
+
manipulatedUrl.search = `?${search.join('&')}`;
|
|
73
|
+
}
|
|
74
|
+
exports.convertNotEncodedParameters = convertNotEncodedParameters;
|
|
75
|
+
/**
|
|
76
|
+
* Removes the "=" char of query parameters that do not have a value.
|
|
77
|
+
*
|
|
78
|
+
* Hint: This is needed because calling the append or delete method of {@link URL}
|
|
79
|
+
* adds a "=" to all parameter without value. This results in different resource URLs.
|
|
80
|
+
*
|
|
81
|
+
* @param url - The original URL.
|
|
82
|
+
* @param manipulatedUrl - The manipulated URL to remove the "=" from.
|
|
83
|
+
*/
|
|
84
|
+
function transformNoValueParams(url, manipulatedUrl) {
|
|
85
|
+
const paramsWithoutValue = url.search.split(/[?&]/).filter(e => e && !e.includes('='));
|
|
86
|
+
for (const param of paramsWithoutValue) {
|
|
87
|
+
manipulatedUrl.search = manipulatedUrl.search.replace(`${param}=`, param);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.transformNoValueParams = transformNoValueParams;
|
|
91
|
+
/**
|
|
92
|
+
* Normalizes a given URL.
|
|
93
|
+
*
|
|
94
|
+
* @param urlString - The URL to be normalized.
|
|
95
|
+
* @param sortParameters - Activates alphabetical sorting of the URL parameters.
|
|
96
|
+
* @returns The normalized URL.
|
|
97
|
+
*/
|
|
98
|
+
function normalize(urlString, sortParameters) {
|
|
99
|
+
const url = new URL(urlString);
|
|
100
|
+
// Remove the hash part of the URL if exists
|
|
101
|
+
if (url.hash) {
|
|
102
|
+
url.hash = '';
|
|
103
|
+
}
|
|
104
|
+
if (!sortParameters) {
|
|
105
|
+
// Sort search params to normalize encoding and order of params
|
|
106
|
+
sortParams(url.searchParams);
|
|
107
|
+
}
|
|
108
|
+
convertNotEncodedParameters(new URL(urlString), url);
|
|
109
|
+
transformNoValueParams(new URL(urlString), url);
|
|
110
|
+
return url.toString();
|
|
111
|
+
}
|
|
112
|
+
exports.normalize = normalize;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function race<T>(promise: Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.race = void 0;
|
|
4
|
+
const safe_1 = require("./safe");
|
|
5
|
+
const DEFAULT_TIMEOUT = 5000;
|
|
6
|
+
async function race(promise) {
|
|
7
|
+
const timeOut = new Promise((resolve, reject) => {
|
|
8
|
+
setTimeout(() => { reject('timeout'); }, DEFAULT_TIMEOUT);
|
|
9
|
+
});
|
|
10
|
+
const result = await (0, safe_1.safe)(Promise.race([promise, timeOut]));
|
|
11
|
+
if (result.success === true) {
|
|
12
|
+
return result.data;
|
|
13
|
+
}
|
|
14
|
+
throw new Error(result.error);
|
|
15
|
+
}
|
|
16
|
+
exports.race = race;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.safe = void 0;
|
|
4
|
+
function safe(promiseOrFunc) {
|
|
5
|
+
if (promiseOrFunc instanceof Promise) {
|
|
6
|
+
return safeAsync(promiseOrFunc);
|
|
7
|
+
}
|
|
8
|
+
return safeSync(promiseOrFunc);
|
|
9
|
+
}
|
|
10
|
+
exports.safe = safe;
|
|
11
|
+
async function safeAsync(promise) {
|
|
12
|
+
try {
|
|
13
|
+
const data = await promise;
|
|
14
|
+
return { data, success: true };
|
|
15
|
+
}
|
|
16
|
+
catch (e) {
|
|
17
|
+
if (e instanceof Error) {
|
|
18
|
+
return { success: false, error: e.message, errorObj: e };
|
|
19
|
+
}
|
|
20
|
+
return { success: false, error: "Something went wrong" };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function safeSync(func) {
|
|
24
|
+
try {
|
|
25
|
+
const data = func();
|
|
26
|
+
return { data, success: true };
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
if (e instanceof Error) {
|
|
30
|
+
return { success: false, error: e.message, errorObj: e };
|
|
31
|
+
}
|
|
32
|
+
return { success: false, error: "Something went wrong" };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function scrape(url: string): Promise<any>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const fetch = require('node-fetch');
|
|
4
|
+
async function scrape(url) {
|
|
5
|
+
const response = await fetch(url);
|
|
6
|
+
if (response.status !== 200) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
return response.text();
|
|
10
|
+
}
|
|
11
|
+
exports.default = scrape;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function speedKitRuleToRegExp(url: string): RegExp;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.speedKitRuleToRegExp = void 0;
|
|
4
|
+
function escapeRegExp(str) {
|
|
5
|
+
return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
|
6
|
+
}
|
|
7
|
+
function speedKitRuleToRegExp(url) {
|
|
8
|
+
return new RegExp(`^${escapeRegExp(url).replace(/\\\*/g, '.*')}$`);
|
|
9
|
+
}
|
|
10
|
+
exports.speedKitRuleToRegExp = speedKitRuleToRegExp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function watchFiles(filenames: (string | undefined)[], listener: () => Promise<void>): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.watchFiles = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
7
|
+
function watchFiles(filenames, listener) {
|
|
8
|
+
for (const filename of filenames) {
|
|
9
|
+
if (!filename) {
|
|
10
|
+
// asset comes not from the local filesystem
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
fs_1.default.watchFile(filename, async () => {
|
|
14
|
+
console.info((0, chalk_1.default) `Updated {bold ${filename}}`);
|
|
15
|
+
await listener();
|
|
16
|
+
});
|
|
17
|
+
console.info((0, chalk_1.default) `Listening for changes on {bold ${filename}}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.watchFiles = watchFiles;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export declare enum CLIParameters {
|
|
2
|
+
AppName = "app",
|
|
3
|
+
Artifacts = "artifacts",
|
|
4
|
+
ConfigName = "configName",
|
|
5
|
+
ContentTypes = "contentTypes",
|
|
6
|
+
Cookies = "cookies",
|
|
7
|
+
CreateTests = "CreateTests",
|
|
8
|
+
CustomerPath = "customerPath",
|
|
9
|
+
CustomersDir = "customersDir",
|
|
10
|
+
Delay = "delay",
|
|
11
|
+
DryRun = "dryRun",
|
|
12
|
+
Group = "group",
|
|
13
|
+
HideDiff = "hideDiff",
|
|
14
|
+
Ips = "ips",
|
|
15
|
+
KeepParameterSorting = "keepParameterSorting",
|
|
16
|
+
Mobile = "mobile",
|
|
17
|
+
PageUrl = "pageUrl",
|
|
18
|
+
Path = "path",
|
|
19
|
+
SlackToken = "slackToken",
|
|
20
|
+
TestId = "testId",
|
|
21
|
+
Urls = "urls",
|
|
22
|
+
Variation = "variation",
|
|
23
|
+
VariationPath = "variationPath"
|
|
24
|
+
}
|
|
25
|
+
export declare enum CLIParametersChar {
|
|
26
|
+
AppName = "a",
|
|
27
|
+
Artifacts = "a",
|
|
28
|
+
ConfigName = "c",
|
|
29
|
+
ContentTypes = "c",
|
|
30
|
+
Cookies = "c",
|
|
31
|
+
CreateTests = "t",
|
|
32
|
+
CustomerPath = "p",
|
|
33
|
+
CustomersDir = "d",
|
|
34
|
+
Delay = "d",
|
|
35
|
+
DryRun = "d",
|
|
36
|
+
Group = "g",
|
|
37
|
+
HideDiff = "h",
|
|
38
|
+
Ips = "i",
|
|
39
|
+
KeepParameterSorting = "k",
|
|
40
|
+
Mobile = "m",
|
|
41
|
+
SlackToken = "t",
|
|
42
|
+
Path = "p",
|
|
43
|
+
Variation = "v",
|
|
44
|
+
VariationPath = "p"
|
|
45
|
+
}
|
|
46
|
+
export declare enum CLIParametersExample {
|
|
47
|
+
AppName = "decathlon",
|
|
48
|
+
Artifacts = "dynamic,SpeedKit",
|
|
49
|
+
ConfigName = "production",
|
|
50
|
+
ContentTypes = "image,style",
|
|
51
|
+
Cookies = "consentCookies",
|
|
52
|
+
CustomerPath = "customer/decathlon.de",
|
|
53
|
+
CustomersDir = "customers",
|
|
54
|
+
Delay = "1200",
|
|
55
|
+
Group = "B",
|
|
56
|
+
Ips = "151.101.120.194",
|
|
57
|
+
Mobile = "Y",
|
|
58
|
+
PageUrl = "https://www.decathlon.de/",
|
|
59
|
+
Path = "C:\\Users\\testUser\\file.csv",
|
|
60
|
+
SlackToken = "someSlackToken",
|
|
61
|
+
TestId = "listing-50vs50",
|
|
62
|
+
Urls = "url1,url2,url3",
|
|
63
|
+
Variation = "MOBILE",
|
|
64
|
+
VariationPath = "C:\\Users\\testUser\\variations.csv"
|
|
65
|
+
}
|
|
66
|
+
export declare const CLI_CONFIG_NAME: {
|
|
67
|
+
configName: import("@oclif/core/lib/interfaces/parser").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
68
|
+
};
|
|
69
|
+
export declare const CLI_CUSTOMER_CONFIG: {
|
|
70
|
+
customerPath: import("@oclif/core/lib/interfaces/parser").Arg<string, {
|
|
71
|
+
exists?: boolean;
|
|
72
|
+
}>;
|
|
73
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CLI_CUSTOMER_CONFIG = exports.CLI_CONFIG_NAME = exports.CLIParametersExample = exports.CLIParametersChar = exports.CLIParameters = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
var CLIParameters;
|
|
6
|
+
(function (CLIParameters) {
|
|
7
|
+
CLIParameters["AppName"] = "app";
|
|
8
|
+
CLIParameters["Artifacts"] = "artifacts";
|
|
9
|
+
CLIParameters["ConfigName"] = "configName";
|
|
10
|
+
CLIParameters["ContentTypes"] = "contentTypes";
|
|
11
|
+
CLIParameters["Cookies"] = "cookies";
|
|
12
|
+
CLIParameters["CreateTests"] = "CreateTests";
|
|
13
|
+
CLIParameters["CustomerPath"] = "customerPath";
|
|
14
|
+
CLIParameters["CustomersDir"] = "customersDir";
|
|
15
|
+
CLIParameters["Delay"] = "delay";
|
|
16
|
+
CLIParameters["DryRun"] = "dryRun";
|
|
17
|
+
CLIParameters["Group"] = "group";
|
|
18
|
+
CLIParameters["HideDiff"] = "hideDiff";
|
|
19
|
+
CLIParameters["Ips"] = "ips";
|
|
20
|
+
CLIParameters["KeepParameterSorting"] = "keepParameterSorting";
|
|
21
|
+
CLIParameters["Mobile"] = "mobile";
|
|
22
|
+
CLIParameters["PageUrl"] = "pageUrl";
|
|
23
|
+
CLIParameters["Path"] = "path";
|
|
24
|
+
CLIParameters["SlackToken"] = "slackToken";
|
|
25
|
+
CLIParameters["TestId"] = "testId";
|
|
26
|
+
CLIParameters["Urls"] = "urls";
|
|
27
|
+
CLIParameters["Variation"] = "variation";
|
|
28
|
+
CLIParameters["VariationPath"] = "variationPath";
|
|
29
|
+
})(CLIParameters || (exports.CLIParameters = CLIParameters = {}));
|
|
30
|
+
var CLIParametersChar;
|
|
31
|
+
(function (CLIParametersChar) {
|
|
32
|
+
CLIParametersChar["AppName"] = "a";
|
|
33
|
+
CLIParametersChar["Artifacts"] = "a";
|
|
34
|
+
CLIParametersChar["ConfigName"] = "c";
|
|
35
|
+
CLIParametersChar["ContentTypes"] = "c";
|
|
36
|
+
CLIParametersChar["Cookies"] = "c";
|
|
37
|
+
CLIParametersChar["CreateTests"] = "t";
|
|
38
|
+
CLIParametersChar["CustomerPath"] = "p";
|
|
39
|
+
CLIParametersChar["CustomersDir"] = "d";
|
|
40
|
+
CLIParametersChar["Delay"] = "d";
|
|
41
|
+
CLIParametersChar["DryRun"] = "d";
|
|
42
|
+
CLIParametersChar["Group"] = "g";
|
|
43
|
+
CLIParametersChar["HideDiff"] = "h";
|
|
44
|
+
CLIParametersChar["Ips"] = "i";
|
|
45
|
+
CLIParametersChar["KeepParameterSorting"] = "k";
|
|
46
|
+
CLIParametersChar["Mobile"] = "m";
|
|
47
|
+
CLIParametersChar["SlackToken"] = "t";
|
|
48
|
+
CLIParametersChar["Path"] = "p";
|
|
49
|
+
CLIParametersChar["Variation"] = "v";
|
|
50
|
+
CLIParametersChar["VariationPath"] = "p";
|
|
51
|
+
})(CLIParametersChar || (exports.CLIParametersChar = CLIParametersChar = {}));
|
|
52
|
+
var CLIParametersExample;
|
|
53
|
+
(function (CLIParametersExample) {
|
|
54
|
+
CLIParametersExample["AppName"] = "decathlon";
|
|
55
|
+
CLIParametersExample["Artifacts"] = "dynamic,SpeedKit";
|
|
56
|
+
CLIParametersExample["ConfigName"] = "production";
|
|
57
|
+
CLIParametersExample["ContentTypes"] = "image,style";
|
|
58
|
+
CLIParametersExample["Cookies"] = "consentCookies";
|
|
59
|
+
CLIParametersExample["CustomerPath"] = "customer/decathlon.de";
|
|
60
|
+
CLIParametersExample["CustomersDir"] = "customers";
|
|
61
|
+
CLIParametersExample["Delay"] = "1200";
|
|
62
|
+
CLIParametersExample["Group"] = "B";
|
|
63
|
+
CLIParametersExample["Ips"] = "151.101.120.194";
|
|
64
|
+
CLIParametersExample["Mobile"] = "Y";
|
|
65
|
+
CLIParametersExample["PageUrl"] = "https://www.decathlon.de/";
|
|
66
|
+
CLIParametersExample["Path"] = "C:\\Users\\testUser\\file.csv";
|
|
67
|
+
CLIParametersExample["SlackToken"] = "someSlackToken";
|
|
68
|
+
CLIParametersExample["TestId"] = "listing-50vs50";
|
|
69
|
+
CLIParametersExample["Urls"] = "url1,url2,url3";
|
|
70
|
+
CLIParametersExample["Variation"] = "MOBILE";
|
|
71
|
+
CLIParametersExample["VariationPath"] = "C:\\Users\\testUser\\variations.csv";
|
|
72
|
+
})(CLIParametersExample || (exports.CLIParametersExample = CLIParametersExample = {}));
|
|
73
|
+
exports.CLI_CONFIG_NAME = {
|
|
74
|
+
[CLIParameters.ConfigName]: core_1.Flags.string({ char: CLIParametersChar.ConfigName, default: 'production', description: 'The costumer config name' }),
|
|
75
|
+
};
|
|
76
|
+
exports.CLI_CUSTOMER_CONFIG = {
|
|
77
|
+
[CLIParameters.CustomerPath]: core_1.Args.directory({
|
|
78
|
+
name: CLIParameters.CustomerPath,
|
|
79
|
+
required: true,
|
|
80
|
+
description: 'The customer config path', // help description
|
|
81
|
+
}),
|
|
82
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const INTEGRATION_FILES: {
|
|
2
|
+
CONFIG: {
|
|
3
|
+
CUSTOMER: string;
|
|
4
|
+
SPEED_KIT: string;
|
|
5
|
+
DOCUMENT_HANDLER: string;
|
|
6
|
+
DYNAMIC_BLOCKS: string;
|
|
7
|
+
LOAD_HANDLER: string;
|
|
8
|
+
DYNAMIC_STYLES: string;
|
|
9
|
+
};
|
|
10
|
+
CUSTOM: {
|
|
11
|
+
LOADER: string;
|
|
12
|
+
SW: string;
|
|
13
|
+
DOCUMENT_HANDLER: string;
|
|
14
|
+
DYNAMIC_FETCHER: string;
|
|
15
|
+
};
|
|
16
|
+
BUILD: {
|
|
17
|
+
INSTALL: string;
|
|
18
|
+
DOCUMENT_HANDLER: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.INTEGRATION_FILES = void 0;
|
|
4
|
+
exports.INTEGRATION_FILES = {
|
|
5
|
+
CONFIG: {
|
|
6
|
+
CUSTOMER: 'config_customer',
|
|
7
|
+
SPEED_KIT: 'config_SpeedKit',
|
|
8
|
+
DOCUMENT_HANDLER: 'config_documentHandler',
|
|
9
|
+
DYNAMIC_BLOCKS: 'config_dynamicBlocks',
|
|
10
|
+
LOAD_HANDLER: 'config_loadHandler',
|
|
11
|
+
DYNAMIC_STYLES: 'config_dynamicStyles'
|
|
12
|
+
},
|
|
13
|
+
CUSTOM: {
|
|
14
|
+
LOADER: 'custom_loader',
|
|
15
|
+
SW: 'custom_sw',
|
|
16
|
+
DOCUMENT_HANDLER: 'custom_documentHandler',
|
|
17
|
+
DYNAMIC_FETCHER: 'custom_dynamicFetcher',
|
|
18
|
+
},
|
|
19
|
+
BUILD: {
|
|
20
|
+
INSTALL: 'bundle_install',
|
|
21
|
+
DOCUMENT_HANDLER: 'bundle_documentHandler',
|
|
22
|
+
}
|
|
23
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface InstallConfigs<T> {
|
|
2
|
+
config: T;
|
|
3
|
+
custom: T;
|
|
4
|
+
sw: T;
|
|
5
|
+
loader: T;
|
|
6
|
+
dynamicFetcher: T;
|
|
7
|
+
dynamicFetcherConfig: T;
|
|
8
|
+
documentHandler: T;
|
|
9
|
+
documentHandlerConfig: T;
|
|
10
|
+
customStyle: T;
|
|
11
|
+
}
|
|
12
|
+
export default interface Install extends Partial<InstallConfigs<string>> {
|
|
13
|
+
id?: string;
|
|
14
|
+
version?: number;
|
|
15
|
+
acl?: string;
|
|
16
|
+
createdAt?: Date;
|
|
17
|
+
updatedAt?: Date;
|
|
18
|
+
status?: string;
|
|
19
|
+
swVersion?: string;
|
|
20
|
+
domain: string;
|
|
21
|
+
configVersion?: number;
|
|
22
|
+
description?: string;
|
|
23
|
+
origins?: string[];
|
|
24
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type UsedPopsPerOrigin = {
|
|
2
|
+
hits: number;
|
|
3
|
+
origin: string;
|
|
4
|
+
pop: string;
|
|
5
|
+
region: string;
|
|
6
|
+
};
|
|
7
|
+
export declare class AthenaService {
|
|
8
|
+
private client;
|
|
9
|
+
getUsedPopsPerOrigin(app: string, useRum: any): Promise<UsedPopsPerOrigin[]>;
|
|
10
|
+
private castValueToType;
|
|
11
|
+
/**
|
|
12
|
+
* Fetch the query result of the given query id, if the result is still available
|
|
13
|
+
* @param queryId - The query of which the results should be fetched
|
|
14
|
+
* @return The query result as an array of objects. The object keys are the selected column names and the object
|
|
15
|
+
* values the column values
|
|
16
|
+
*/
|
|
17
|
+
private fetchResult;
|
|
18
|
+
/**
|
|
19
|
+
* Runs the given SQL query against Athena and returns the query id when the query has successfully been executed.
|
|
20
|
+
* @param sql - The query to execute
|
|
21
|
+
* @param parameters - the parameters ? which should be passed to the query. In the order they are occurring in the query
|
|
22
|
+
* @param useCacheTTLMinutes - enable query caching to the given amount of minutes, if the same query is
|
|
23
|
+
* issued within the cached time causes that the results from the previous execution will be returned without any
|
|
24
|
+
* additional costs
|
|
25
|
+
* @return The query id which can be used to fetch the query results
|
|
26
|
+
*/
|
|
27
|
+
private runQuery;
|
|
28
|
+
private sleep;
|
|
29
|
+
private waitOnResponse;
|
|
30
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
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
|
+
class AthenaService {
|
|
6
|
+
client = new client_athena_1.AthenaClient({ region: 'eu-central-1' });
|
|
7
|
+
async getUsedPopsPerOrigin(app, useRum) {
|
|
8
|
+
const query = `
|
|
9
|
+
with data as (
|
|
10
|
+
select
|
|
11
|
+
*,
|
|
12
|
+
coalesce('https://' || url_extract_host(assetUrl) || regexp_extract(url_extract_path(assetUrl), '(?i)/([a-z]{2}([-/_][a-z]{2})*/)', 0), 'Unknown') as originWithPrefix
|
|
13
|
+
from fastly.logs
|
|
14
|
+
where date between ? and ?
|
|
15
|
+
and app = ?
|
|
16
|
+
and ${useRum ? 'ispibeacon' : 'isassetrequest and isnavigaterequest'}
|
|
17
|
+
and client.bot is null
|
|
18
|
+
and origin not in('Unknown', '')
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
select
|
|
22
|
+
region,
|
|
23
|
+
pop,
|
|
24
|
+
coalesce(originWithPrefix, origin) as origin,
|
|
25
|
+
count() as hits
|
|
26
|
+
from data
|
|
27
|
+
group by grouping sets (
|
|
28
|
+
(region, pop, origin),
|
|
29
|
+
(region, pop, origin, originWithPrefix)
|
|
30
|
+
)
|
|
31
|
+
having originWithPrefix is null or originWithPrefix <> 'Unknown'`;
|
|
32
|
+
const endDate = new Date();
|
|
33
|
+
const startDate = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate() - 7);
|
|
34
|
+
const start = startDate.toISOString().slice(0, 10);
|
|
35
|
+
const end = endDate.toISOString().slice(0, 10);
|
|
36
|
+
const queryId = await this.runQuery(query, [start, end, app], 12 * 60);
|
|
37
|
+
return await this.fetchResult(queryId);
|
|
38
|
+
}
|
|
39
|
+
castValueToType(value, type) {
|
|
40
|
+
if (value === null)
|
|
41
|
+
return null;
|
|
42
|
+
switch (type) {
|
|
43
|
+
case 'bigint': {
|
|
44
|
+
return Number(value);
|
|
45
|
+
}
|
|
46
|
+
default: {
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Fetch the query result of the given query id, if the result is still available
|
|
53
|
+
* @param queryId - The query of which the results should be fetched
|
|
54
|
+
* @return The query result as an array of objects. The object keys are the selected column names and the object
|
|
55
|
+
* values the column values
|
|
56
|
+
*/
|
|
57
|
+
async fetchResult(queryId) {
|
|
58
|
+
const rows = [];
|
|
59
|
+
let NextToken;
|
|
60
|
+
let first = true;
|
|
61
|
+
do {
|
|
62
|
+
// Max Results can be set but if its not set,
|
|
63
|
+
// it will choose the maximum page size.
|
|
64
|
+
const command = new client_athena_1.GetQueryResultsCommand({ NextToken, QueryExecutionId: queryId });
|
|
65
|
+
const result = await this.client.send(command);
|
|
66
|
+
const columns = result.ResultSet.ResultSetMetadata.ColumnInfo.map(info => info.Name);
|
|
67
|
+
const types = result.ResultSet.ResultSetMetadata.ColumnInfo.map(info => info.Type);
|
|
68
|
+
for (const rowRaw of result.ResultSet.Rows) {
|
|
69
|
+
if (first) {
|
|
70
|
+
first = false;
|
|
71
|
+
continue; // the first row contains the column names
|
|
72
|
+
}
|
|
73
|
+
const row = {};
|
|
74
|
+
for (let i = 0; i < rowRaw.Data.length; i++) {
|
|
75
|
+
row[columns[i]] = this.castValueToType(rowRaw.Data[i].VarCharValue, types[i]);
|
|
76
|
+
}
|
|
77
|
+
rows.push(row);
|
|
78
|
+
}
|
|
79
|
+
NextToken = result.NextToken;
|
|
80
|
+
} while (NextToken);
|
|
81
|
+
return rows;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Runs the given SQL query against Athena and returns the query id when the query has successfully been executed.
|
|
85
|
+
* @param sql - The query to execute
|
|
86
|
+
* @param parameters - the parameters ? which should be passed to the query. In the order they are occurring in the query
|
|
87
|
+
* @param useCacheTTLMinutes - enable query caching to the given amount of minutes, if the same query is
|
|
88
|
+
* issued within the cached time causes that the results from the previous execution will be returned without any
|
|
89
|
+
* additional costs
|
|
90
|
+
* @return The query id which can be used to fetch the query results
|
|
91
|
+
*/
|
|
92
|
+
async runQuery(sql, parameters, useCacheTTLMinutes = 60) {
|
|
93
|
+
const ExecutionParameters = parameters.map(value => typeof value === 'string' ? `'${value}'` : String(value));
|
|
94
|
+
const command = new client_athena_1.StartQueryExecutionCommand({
|
|
95
|
+
ExecutionParameters,
|
|
96
|
+
QueryExecutionContext: {
|
|
97
|
+
Catalog: 'live',
|
|
98
|
+
},
|
|
99
|
+
QueryString: sql,
|
|
100
|
+
ResultReuseConfiguration: {
|
|
101
|
+
ResultReuseByAgeConfiguration: {
|
|
102
|
+
Enabled: true,
|
|
103
|
+
MaxAgeInMinutes: useCacheTTLMinutes,
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
const response = await this.client.send(command);
|
|
108
|
+
await this.waitOnResponse(response.QueryExecutionId);
|
|
109
|
+
return response.QueryExecutionId;
|
|
110
|
+
}
|
|
111
|
+
async sleep(sleep) {
|
|
112
|
+
return new Promise(resolve => {
|
|
113
|
+
setTimeout(resolve, sleep);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
async waitOnResponse(QueryExecutionId) {
|
|
117
|
+
for (;;) {
|
|
118
|
+
const command = new client_athena_1.GetQueryExecutionCommand({ QueryExecutionId });
|
|
119
|
+
const result = await this.client.send(command);
|
|
120
|
+
const status = result.QueryExecution.Status;
|
|
121
|
+
switch (status.State) {
|
|
122
|
+
case client_athena_1.QueryExecutionState.FAILED: {
|
|
123
|
+
throw new Error('The Amazon Athena query failed to run with error message: ' + status.StateChangeReason);
|
|
124
|
+
}
|
|
125
|
+
case client_athena_1.QueryExecutionState.CANCELLED: {
|
|
126
|
+
throw new Error('The Amazon Athena query was cancelled.');
|
|
127
|
+
}
|
|
128
|
+
case client_athena_1.QueryExecutionState.SUCCEEDED: {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
default: {
|
|
132
|
+
await this.sleep(1000);
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
exports.AthenaService = AthenaService;
|
|
@@ -0,0 +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 {
|
|
6
|
+
buildService() {
|
|
7
|
+
return new bundle_service_1.BundleService();
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.BundleServiceFactory = BundleServiceFactory;
|