@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,15 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class BuildParameterQuery extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
customerPath: import("@oclif/core/lib/interfaces").Arg<string, {
|
|
6
|
+
exists?: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
configName: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
static examples: string[];
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
buildParameterQuery(app: string, parameterFilter: string, whitelistedFilter: string, blacklistedFilter: string, parameterReplaceFilter: string): string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const clipboardy_cjs_1 = tslib_1.__importDefault(require("clipboardy-cjs"));
|
|
7
|
+
const cli_parameters_1 = require("../models/cli-parameters");
|
|
8
|
+
const build_query_helper_1 = require("../helpers/build-query-helper");
|
|
9
|
+
const get_parsed_config_1 = require("../helpers/get-parsed-config");
|
|
10
|
+
const CustomerConfig_1 = require("../helpers/CustomerConfig");
|
|
11
|
+
const logging_helper_1 = require("../helpers/logging-helper");
|
|
12
|
+
class BuildParameterQuery extends core_1.Command {
|
|
13
|
+
static description = 'Build a parameter query that can be executed in Athena';
|
|
14
|
+
static args = cli_parameters_1.CLI_CUSTOMER_CONFIG;
|
|
15
|
+
static flags = {
|
|
16
|
+
...cli_parameters_1.CLI_CONFIG_NAME
|
|
17
|
+
};
|
|
18
|
+
static examples = [
|
|
19
|
+
`$ sk build-parameter-query <${cli_parameters_1.CLIParameters.CustomerPath}> -${cli_parameters_1.CLIParametersChar.ConfigName} <${cli_parameters_1.CLIParameters.ConfigName}>`,
|
|
20
|
+
`$ sk build-parameter-query ${cli_parameters_1.CLIParametersExample.CustomerPath} -${cli_parameters_1.CLIParametersChar.ConfigName} ${cli_parameters_1.CLIParametersExample.ConfigName}`,
|
|
21
|
+
];
|
|
22
|
+
async run() {
|
|
23
|
+
const { args: { customerPath }, flags: { configName } } = await this.parse(BuildParameterQuery);
|
|
24
|
+
core_1.ux.action.start('Building parameter query');
|
|
25
|
+
try {
|
|
26
|
+
const { app, config } = await CustomerConfig_1.CustomerConfig.loadCustomer(customerPath, configName);
|
|
27
|
+
const parsedConfig = await (0, get_parsed_config_1.getParsedConfig)(config);
|
|
28
|
+
const params = (0, build_query_helper_1.getStrippedParams)(parsedConfig);
|
|
29
|
+
const skConfigVersion = (0, get_parsed_config_1.getSpeedKitConfigVersion)(parsedConfig);
|
|
30
|
+
const parameterFilter = (0, build_query_helper_1.getParameterFilter)(params, skConfigVersion);
|
|
31
|
+
const parameterReplaceFilter = (0, build_query_helper_1.getParameterReplaceFilter)(params, skConfigVersion);
|
|
32
|
+
const whitelistedFilter = (0, build_query_helper_1.getWhitelistedFilter)(parsedConfig);
|
|
33
|
+
const blacklistedFilter = (0, build_query_helper_1.getBlacklistedFilter)(parsedConfig);
|
|
34
|
+
const result = this.buildParameterQuery(app || parsedConfig.appName, parameterFilter, whitelistedFilter, blacklistedFilter, parameterReplaceFilter);
|
|
35
|
+
if (!this.config.windows) {
|
|
36
|
+
clipboardy_cjs_1.default.writeSync(result);
|
|
37
|
+
}
|
|
38
|
+
console.log(chalk_1.default.dim.italic(result));
|
|
39
|
+
console.log('');
|
|
40
|
+
core_1.ux.action.stop();
|
|
41
|
+
console.log('');
|
|
42
|
+
if (!this.config.windows) {
|
|
43
|
+
(0, logging_helper_1.logInfo)('Result has been copied to the clipboard 📋');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
console.log('');
|
|
48
|
+
(0, logging_helper_1.logError)(e.stack);
|
|
49
|
+
}
|
|
50
|
+
console.log('');
|
|
51
|
+
}
|
|
52
|
+
buildParameterQuery(app, parameterFilter, whitelistedFilter, blacklistedFilter, parameterReplaceFilter) {
|
|
53
|
+
const nowMinusOneMonth = new Date(new Date().setMonth(new Date().getMonth() - 1, new Date().getDate()));
|
|
54
|
+
const monthString = `${nowMinusOneMonth.getMonth() + 1 < 10 ? '0' : ''}${nowMinusOneMonth.getMonth() + 1}`;
|
|
55
|
+
const dateString = `${nowMinusOneMonth.getDate() < 10 ? '0' : ''}${nowMinusOneMonth.getDate()}`;
|
|
56
|
+
const date = `${nowMinusOneMonth.getFullYear()}-${monthString}-${dateString}`;
|
|
57
|
+
return `
|
|
58
|
+
with urlWithParams as (
|
|
59
|
+
select
|
|
60
|
+
url,
|
|
61
|
+
createdat,
|
|
62
|
+
split(url, '?')[1] as urlWithoutParams,
|
|
63
|
+
filter (
|
|
64
|
+
transform(
|
|
65
|
+
split(split(url, '?')[2], '&'),
|
|
66
|
+
(pair) -> split(pair, '=')[1]
|
|
67
|
+
),
|
|
68
|
+
(key) -> ${parameterFilter}
|
|
69
|
+
) as paramKeys
|
|
70
|
+
from live.rum.pi
|
|
71
|
+
where app = '${app}'
|
|
72
|
+
and date >= '${date}'
|
|
73
|
+
and cardinality(split(url, '?')) > 1
|
|
74
|
+
and (${whitelistedFilter})
|
|
75
|
+
and ${blacklistedFilter}
|
|
76
|
+
), prepared as (
|
|
77
|
+
select count(*) as PIs,
|
|
78
|
+
count(distinct url) as urls,
|
|
79
|
+
count(distinct ${parameterReplaceFilter}) as cachedUrls,
|
|
80
|
+
count(distinct urlWithoutParams) as uniqueWithoutParam,
|
|
81
|
+
paramKeys,
|
|
82
|
+
element_at(array_distinct(max_by(url, MD5(to_utf8(to_iso8601(createdat))), 500)), 1) as example1,
|
|
83
|
+
element_at(array_distinct(max_by(url, MD5(to_utf8(to_iso8601(createdat))), 500)), 2) as example2,
|
|
84
|
+
element_at(array_distinct(max_by(url, MD5(to_utf8(to_iso8601(createdat))), 500)), 3) as example3
|
|
85
|
+
from urlWithParams
|
|
86
|
+
group by paramKeys
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
select paramKeys, cachedUrls - uniqueWithoutParam as potentialGain, cachedUrls, PIs, example1, example2, example3
|
|
90
|
+
from prepared
|
|
91
|
+
where cardinality(paramKeys) > 0
|
|
92
|
+
order by potentialGain desc, cachedUrls desc, PIs desc`;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.default = BuildParameterQuery;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class BuildPrewarmQuery extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
customerPath: import("@oclif/core/lib/interfaces").Arg<string, {
|
|
6
|
+
exists?: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
configName: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
static examples: string[];
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
buildPrewarmQuery(app: string, whitelistedFilter: string, blacklistedFilter: string, parameterReplaceFilter: string): string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const core_2 = require("@oclif/core");
|
|
6
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
+
const clipboardy_cjs_1 = tslib_1.__importDefault(require("clipboardy-cjs"));
|
|
8
|
+
const cli_parameters_1 = require("../models/cli-parameters");
|
|
9
|
+
const build_query_helper_1 = require("../helpers/build-query-helper");
|
|
10
|
+
const get_parsed_config_1 = require("../helpers/get-parsed-config");
|
|
11
|
+
const logging_helper_1 = require("../helpers/logging-helper");
|
|
12
|
+
const CustomerConfig_1 = require("../helpers/CustomerConfig");
|
|
13
|
+
class BuildPrewarmQuery extends core_1.Command {
|
|
14
|
+
static description = 'Build a prewarm query that can be executed in Athena';
|
|
15
|
+
static args = cli_parameters_1.CLI_CUSTOMER_CONFIG;
|
|
16
|
+
static flags = {
|
|
17
|
+
...cli_parameters_1.CLI_CONFIG_NAME
|
|
18
|
+
};
|
|
19
|
+
static examples = [
|
|
20
|
+
`$ sk build-prewarm-query <${cli_parameters_1.CLIParameters.CustomerPath}> -${cli_parameters_1.CLIParametersChar.ConfigName} <${cli_parameters_1.CLIParameters.ConfigName}>`,
|
|
21
|
+
`$ sk build-prewarm-query ${cli_parameters_1.CLIParametersExample.CustomerPath} -${cli_parameters_1.CLIParametersChar.ConfigName} ${cli_parameters_1.CLIParametersExample.ConfigName}`,
|
|
22
|
+
];
|
|
23
|
+
async run() {
|
|
24
|
+
const { args: { customerPath }, flags: { configName } } = await this.parse(BuildPrewarmQuery);
|
|
25
|
+
core_2.ux.action.start('Building pre-warm query');
|
|
26
|
+
try {
|
|
27
|
+
const { app, config } = await CustomerConfig_1.CustomerConfig.loadCustomer(customerPath, configName);
|
|
28
|
+
const parsedConfig = await (0, get_parsed_config_1.getParsedConfig)(config);
|
|
29
|
+
const params = (0, build_query_helper_1.getStrippedParams)(parsedConfig);
|
|
30
|
+
const parameterReplaceFilter = (0, build_query_helper_1.getParameterReplaceFilter)(params, (0, get_parsed_config_1.getSpeedKitConfigVersion)(parsedConfig));
|
|
31
|
+
const whitelistedFilter = (0, build_query_helper_1.getWhitelistedFilter)(parsedConfig);
|
|
32
|
+
const blacklistedFilter = (0, build_query_helper_1.getBlacklistedFilter)(parsedConfig);
|
|
33
|
+
const result = this.buildPrewarmQuery(app || parsedConfig.appName, whitelistedFilter, blacklistedFilter, parameterReplaceFilter);
|
|
34
|
+
if (!this.config.windows) {
|
|
35
|
+
clipboardy_cjs_1.default.writeSync(result);
|
|
36
|
+
}
|
|
37
|
+
console.log(chalk_1.default.dim.italic(result));
|
|
38
|
+
console.log('');
|
|
39
|
+
core_2.ux.action.stop();
|
|
40
|
+
console.log('');
|
|
41
|
+
if (!this.config.windows) {
|
|
42
|
+
(0, logging_helper_1.logInfo)('Result has been copied to the clipboard 📋');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
console.log('');
|
|
47
|
+
(0, logging_helper_1.logError)(e.stack);
|
|
48
|
+
}
|
|
49
|
+
console.log('');
|
|
50
|
+
}
|
|
51
|
+
buildPrewarmQuery(app, whitelistedFilter, blacklistedFilter, parameterReplaceFilter) {
|
|
52
|
+
const now = new Date();
|
|
53
|
+
now.setDate(now.getDate() - 10);
|
|
54
|
+
const date = now.toISOString().split('T')[0];
|
|
55
|
+
return `
|
|
56
|
+
select url
|
|
57
|
+
from (
|
|
58
|
+
select regexp_replace(regexp_replace(${parameterReplaceFilter}, '(^[^&?]*)&','$1?'), '\\?$','') as url,
|
|
59
|
+
uadevice
|
|
60
|
+
from live.rum.pi
|
|
61
|
+
where app = '${app}'
|
|
62
|
+
and date >= '${date}'
|
|
63
|
+
and ${whitelistedFilter}
|
|
64
|
+
and ${blacklistedFilter})
|
|
65
|
+
group by url
|
|
66
|
+
order by count(*) desc`;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.default = BuildPrewarmQuery;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class Deploy extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
customerPath: import("@oclif/core/lib/interfaces").Arg<string, {
|
|
6
|
+
exists?: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
slackToken: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
artifacts: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
dryRun: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
configName: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
static examples: string[];
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
/* eslint-disable valid-jsdoc, no-await-in-loop */
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const cli_parameters_1 = require("../models/cli-parameters");
|
|
7
|
+
const deploy_context_1 = tslib_1.__importDefault(require("../services/deploy/context/deploy-context"));
|
|
8
|
+
const deploy_service_factory_1 = tslib_1.__importDefault(require("../services/deploy/deploy-service-factory"));
|
|
9
|
+
const cli_config_1 = require("../helpers/cli-config");
|
|
10
|
+
class Deploy extends core_1.Command {
|
|
11
|
+
static description = 'Deploys the specified customer config while comparing to the live version before';
|
|
12
|
+
static args = cli_parameters_1.CLI_CUSTOMER_CONFIG;
|
|
13
|
+
static flags = {
|
|
14
|
+
...cli_parameters_1.CLI_CONFIG_NAME,
|
|
15
|
+
[cli_parameters_1.CLIParameters.SlackToken]: core_1.Flags.string({
|
|
16
|
+
description: 'Slack hook found on 1Pass',
|
|
17
|
+
char: cli_parameters_1.CLIParametersChar.SlackToken
|
|
18
|
+
}),
|
|
19
|
+
[cli_parameters_1.CLIParameters.Artifacts]: core_1.Flags.string({
|
|
20
|
+
description: 'Whitelist of files to deploy',
|
|
21
|
+
char: cli_parameters_1.CLIParametersChar.Artifacts
|
|
22
|
+
}),
|
|
23
|
+
[cli_parameters_1.CLIParameters.DryRun]: core_1.Flags.boolean({
|
|
24
|
+
description: 'Do not deploy changes',
|
|
25
|
+
char: cli_parameters_1.CLIParametersChar.DryRun,
|
|
26
|
+
}),
|
|
27
|
+
};
|
|
28
|
+
static examples = [
|
|
29
|
+
`$ sk deploy <${cli_parameters_1.CLIParameters.CustomerPath}> -${cli_parameters_1.CLIParametersChar.ConfigName} <${cli_parameters_1.CLIParameters.ConfigName}> -${cli_parameters_1.CLIParametersChar.SlackToken} <${cli_parameters_1.CLIParameters.SlackToken}> -${cli_parameters_1.CLIParametersChar.Artifacts} <${cli_parameters_1.CLIParameters.Artifacts}> -${cli_parameters_1.CLIParametersChar.DryRun} <${cli_parameters_1.CLIParameters.DryRun}>`,
|
|
30
|
+
`$ sk deploy ${cli_parameters_1.CLIParametersExample.CustomerPath} -${cli_parameters_1.CLIParametersChar.ConfigName} ${cli_parameters_1.CLIParametersExample.ConfigName} -${cli_parameters_1.CLIParametersChar.SlackToken} ${cli_parameters_1.CLIParametersExample.SlackToken} -${cli_parameters_1.CLIParametersChar.Artifacts} ${cli_parameters_1.CLIParametersExample.Artifacts} -${cli_parameters_1.CLIParametersChar.DryRun}`,
|
|
31
|
+
];
|
|
32
|
+
async run() {
|
|
33
|
+
const { args: { customerPath }, flags: { configName, slackToken, artifacts, dryRun } } = await this.parse(Deploy);
|
|
34
|
+
const deployContext = new deploy_context_1.default(customerPath, configName, slackToken, artifacts, dryRun);
|
|
35
|
+
const deployService = await new deploy_service_factory_1.default(deployContext, new cli_config_1.CliConfig(this.config).load()).buildService();
|
|
36
|
+
await deployService.run();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.default = Deploy;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class DocumentHandler extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
customerPath: import("@oclif/core/lib/interfaces").Arg<string, {
|
|
6
|
+
exists?: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
CreateTests: import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
configName: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
static examples: string[];
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
finally(error: any): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const cli_parameters_1 = require("../models/cli-parameters");
|
|
6
|
+
const document_handler_runtime_service_factory_1 = tslib_1.__importDefault(require("../services/document-handler-runtime/factory/document-handler-runtime-service-factory"));
|
|
7
|
+
const document_handler_runtime_context_1 = tslib_1.__importDefault(require("../services/document-handler-runtime/context/document-handler-runtime-context"));
|
|
8
|
+
const cli_config_1 = require("../helpers/cli-config");
|
|
9
|
+
class DocumentHandler extends core_1.Command {
|
|
10
|
+
static description = 'Creates testable documentHandler in folder {CUSTOMER_PATH}/test/src/';
|
|
11
|
+
static args = cli_parameters_1.CLI_CUSTOMER_CONFIG;
|
|
12
|
+
static flags = {
|
|
13
|
+
...cli_parameters_1.CLI_CONFIG_NAME,
|
|
14
|
+
[cli_parameters_1.CLIParameters.CreateTests]: core_1.Flags.string({
|
|
15
|
+
char: cli_parameters_1.CLIParametersChar.CreateTests,
|
|
16
|
+
multiple: true,
|
|
17
|
+
required: false,
|
|
18
|
+
description: 'name of the test to create'
|
|
19
|
+
}),
|
|
20
|
+
};
|
|
21
|
+
static examples = [
|
|
22
|
+
`$ sk documentHandler <${cli_parameters_1.CLIParameters.CustomerPath}> -${cli_parameters_1.CLIParametersChar.ConfigName} <${cli_parameters_1.CLIParameters.ConfigName}>`,
|
|
23
|
+
`$ sk deploy ${cli_parameters_1.CLIParametersExample.CustomerPath} -${cli_parameters_1.CLIParametersChar.ConfigName} ${cli_parameters_1.CLIParametersExample.ConfigName}`,
|
|
24
|
+
];
|
|
25
|
+
async run() {
|
|
26
|
+
const { args: { customerPath }, flags: { configName, CreateTests } } = await this.parse(DocumentHandler);
|
|
27
|
+
const runtime = await (new document_handler_runtime_service_factory_1.default(new document_handler_runtime_context_1.default(customerPath, configName, CreateTests), new cli_config_1.CliConfig(this.config).load())).buildService();
|
|
28
|
+
await runtime.run();
|
|
29
|
+
}
|
|
30
|
+
async finally(error) {
|
|
31
|
+
if (error) {
|
|
32
|
+
console.log(error);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = DocumentHandler;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class FindPops extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
app: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
ips: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
static examples: string[];
|
|
11
|
+
private pops;
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
getPop(ip: string, app: string, token: string): Promise<{
|
|
14
|
+
pop: string;
|
|
15
|
+
ip: string;
|
|
16
|
+
} | null>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const logging_helper_1 = require("../helpers/logging-helper");
|
|
6
|
+
const airports = tslib_1.__importStar(require("./airports_iata.json"));
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const fetch = require('node-fetch');
|
|
9
|
+
const cli_1 = require("baqend/cli");
|
|
10
|
+
const https = tslib_1.__importStar(require("https"));
|
|
11
|
+
const cli_parameters_1 = require("../models/cli-parameters");
|
|
12
|
+
const agent = new https.Agent({
|
|
13
|
+
rejectUnauthorized: false,
|
|
14
|
+
keepAlive: true,
|
|
15
|
+
});
|
|
16
|
+
class FindPops extends core_1.Command {
|
|
17
|
+
static description = 'Get IPs for all fastly PoPs';
|
|
18
|
+
static args = {
|
|
19
|
+
[cli_parameters_1.CLIParameters.AppName]: core_1.Args.string({
|
|
20
|
+
name: cli_parameters_1.CLIParameters.AppName,
|
|
21
|
+
required: true,
|
|
22
|
+
description: 'The customers appName',
|
|
23
|
+
hidden: false, // hide this arg from help
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
26
|
+
static flags = {
|
|
27
|
+
[cli_parameters_1.CLIParameters.Ips]: core_1.Flags.string({ default: '151.101.x.194', char: cli_parameters_1.CLIParametersChar.Ips }),
|
|
28
|
+
};
|
|
29
|
+
static examples = [
|
|
30
|
+
`$ sk find-pops <${cli_parameters_1.CLIParameters.AppName}> -${cli_parameters_1.CLIParametersChar.Ips} <${cli_parameters_1.CLIParameters.Ips}>`,
|
|
31
|
+
`$ sk find-pops appName -${cli_parameters_1.CLIParametersChar.Ips} ips`,
|
|
32
|
+
];
|
|
33
|
+
pops = {};
|
|
34
|
+
async run() {
|
|
35
|
+
const { args: { app }, flags: { ips } } = await this.parse(FindPops);
|
|
36
|
+
const db = await cli_1.account.login({ app });
|
|
37
|
+
const ranges = ips.split(',');
|
|
38
|
+
const fetches = [];
|
|
39
|
+
for (const range of ranges) {
|
|
40
|
+
for (let i = 0; i < 255; i++) {
|
|
41
|
+
fetches.push(this.getPop(range.replace('x', String(i)), app, db.token));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const results = await Promise.all(fetches);
|
|
45
|
+
results.forEach(r => {
|
|
46
|
+
if (r) {
|
|
47
|
+
const airport = airports[r.pop];
|
|
48
|
+
let id = r.pop;
|
|
49
|
+
if (airport) {
|
|
50
|
+
id = `${r.pop} (${airport.city}, ${airport.state}, ${airport.country})`;
|
|
51
|
+
}
|
|
52
|
+
this.pops[id] = this.pops[id] || [];
|
|
53
|
+
this.pops[id].push(r.ip);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
fs.writeFileSync('pops.json', JSON.stringify(this.pops));
|
|
57
|
+
(0, logging_helper_1.logInfo)('List of POPs was successfully created in pops.json');
|
|
58
|
+
}
|
|
59
|
+
async getPop(ip, app, token) {
|
|
60
|
+
try {
|
|
61
|
+
const resp = await fetch(`https://${ip}/`, {
|
|
62
|
+
agent,
|
|
63
|
+
method: 'HEAD',
|
|
64
|
+
headers: {
|
|
65
|
+
Host: `${app}.app.baqend.com`,
|
|
66
|
+
authorization: `BAT ${token}`,
|
|
67
|
+
},
|
|
68
|
+
timeout: 10000,
|
|
69
|
+
});
|
|
70
|
+
const servedBy = resp.headers.get('x-served-by');
|
|
71
|
+
if (resp.status !== 200 || !servedBy) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
ip,
|
|
76
|
+
pop: servedBy.split('-')[2],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.default = FindPops;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class GenerateCustomerConfig extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
+
customersDir: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
};
|
|
8
|
+
static examples: string[];
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const cli_parameters_1 = require("../models/cli-parameters");
|
|
5
|
+
const customer_config_1 = require("../services/customer-config");
|
|
6
|
+
class GenerateCustomerConfig extends core_1.Command {
|
|
7
|
+
static description = 'Generates a customer config guided by a wizard 🧙';
|
|
8
|
+
static flags = {
|
|
9
|
+
[cli_parameters_1.CLIParameters.AppName]: core_1.Flags.string({
|
|
10
|
+
description: `The SK app name which is also being used the config output directory name (kebab-case)`,
|
|
11
|
+
char: cli_parameters_1.CLIParametersChar.AppName,
|
|
12
|
+
}),
|
|
13
|
+
[cli_parameters_1.CLIParameters.CustomersDir]: core_1.Flags.string({
|
|
14
|
+
description: `Name of the sk-onboarding directory where all customer configs are being stored (default: "${cli_parameters_1.CLIParametersExample.CustomersDir}")`,
|
|
15
|
+
char: cli_parameters_1.CLIParametersChar.CustomersDir
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
18
|
+
static examples = [
|
|
19
|
+
`$ sk generate-customer-config -${cli_parameters_1.CLIParametersChar.AppName} <${cli_parameters_1.CLIParameters.AppName}> -${cli_parameters_1.CLIParametersChar.CustomersDir} <${cli_parameters_1.CLIParameters.CustomersDir}>`,
|
|
20
|
+
`$ sk generate-customer-config -${cli_parameters_1.CLIParametersChar.AppName} ${cli_parameters_1.CLIParametersExample.AppName} -${cli_parameters_1.CLIParametersChar.CustomersDir} ${cli_parameters_1.CLIParametersExample.CustomersDir}`,
|
|
21
|
+
];
|
|
22
|
+
async run() {
|
|
23
|
+
const { flags: { app, customersDir } } = await this.parse(GenerateCustomerConfig);
|
|
24
|
+
const context = new customer_config_1.CustomerConfigServiceContext(app, customersDir);
|
|
25
|
+
const customerConfigService = await new customer_config_1.CustomerConfigServiceFactory(context).buildService();
|
|
26
|
+
await customerConfigService.generateConfig();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = GenerateCustomerConfig;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class GeneratePopConfig extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
app: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
coverage: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
deploy: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'pop-limit': import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
'traffic-share': import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
'use-rum': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
createPopPrewarmingCode(popConfig: string): Promise<string>;
|
|
16
|
+
deployPrewarmingConfig(app: string, config: string, deploy: boolean | undefined): Promise<void>;
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
private byHitsDesc;
|
|
19
|
+
private computeCoverageAndShare;
|
|
20
|
+
private generateOriginStats;
|
|
21
|
+
private generatePopConfig;
|
|
22
|
+
private generatePopListByPops;
|
|
23
|
+
private generatePopListByShields;
|
|
24
|
+
private generatePrewarmingConfig;
|
|
25
|
+
private getShieldInfo;
|
|
26
|
+
private printStats;
|
|
27
|
+
}
|