@speedkit/cli 3.43.2 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/README.md +6 -6
- package/bin/dev +2 -15
- package/bin/run +2 -2
- package/dist/commands/build-parameter-query.d.ts +3 -3
- package/dist/commands/build-parameter-query.js +12 -15
- package/dist/commands/build-prewarm-query.d.ts +4 -4
- package/dist/commands/build-prewarm-query.js +13 -16
- package/dist/commands/config/edit.js +7 -11
- package/dist/commands/deploy.d.ts +3 -5
- package/dist/commands/deploy.js +12 -16
- package/dist/commands/diff-url-parameters.d.ts +3 -3
- package/dist/commands/diff-url-parameters.js +27 -30
- package/dist/commands/document-handler.d.ts +4 -4
- package/dist/commands/document-handler.js +13 -17
- package/dist/commands/find-pops.d.ts +2 -2
- package/dist/commands/find-pops.js +22 -24
- package/dist/commands/generate-customer-config.d.ts +2 -2
- package/dist/commands/generate-customer-config.js +13 -16
- package/dist/commands/generate-pop-config.d.ts +7 -7
- package/dist/commands/generate-pop-config.js +32 -41
- package/dist/commands/login.d.ts +1 -1
- package/dist/commands/login.js +13 -17
- package/dist/commands/onboarding.d.ts +3 -5
- package/dist/commands/onboarding.js +10 -13
- package/dist/commands/prewarm.d.ts +9 -9
- package/dist/commands/prewarm.js +25 -28
- package/dist/commands/pull.d.ts +3 -3
- package/dist/commands/pull.js +11 -14
- package/dist/commands/wpt-launcher.d.ts +7 -7
- package/dist/commands/wpt-launcher.js +21 -26
- package/dist/helpers/array-helper.js +1 -4
- package/dist/helpers/build-query-helper.js +5 -12
- package/dist/helpers/cli-config.d.ts +3 -3
- package/dist/helpers/cli-config.js +11 -16
- package/dist/helpers/customer-config.d.ts +4 -8
- package/dist/helpers/customer-config.js +18 -23
- package/dist/helpers/evaluate-speed-kit-config.d.ts +1 -1
- package/dist/helpers/evaluate-speed-kit-config.js +42 -26
- package/dist/helpers/file-helper.js +8 -13
- package/dist/helpers/get-parsed-config.d.ts +1 -1
- package/dist/helpers/get-parsed-config.js +6 -10
- package/dist/helpers/html-format-helper.js +3 -6
- package/dist/helpers/is-directory.js +3 -6
- package/dist/helpers/is-file.js +3 -6
- package/dist/helpers/logging-helper.js +7 -13
- package/dist/helpers/normalize.js +10 -17
- package/dist/helpers/race.d.ts +1 -1
- package/dist/helpers/race.js +3 -9
- package/dist/helpers/safe.js +1 -4
- package/dist/helpers/scrape.d.ts +1 -1
- package/dist/helpers/scrape.js +3 -7
- package/dist/helpers/site-analyzer.js +5 -9
- package/dist/helpers/speed-kit-rule-to-reg-exp.js +1 -4
- package/dist/models/cli-parameters.d.ts +4 -4
- package/dist/models/cli-parameters.js +13 -16
- package/dist/models/files.js +1 -4
- package/dist/models/install.js +1 -2
- package/dist/models/os.js +1 -4
- package/dist/services/athena/athena-service-factory.d.ts +1 -1
- package/dist/services/athena/athena-service-factory.js +15 -19
- package/dist/services/athena/athena-service-model.js +2 -5
- package/dist/services/athena/athena-service.d.ts +1 -1
- package/dist/services/athena/athena-service.js +18 -23
- package/dist/services/athena/error/athena-query-error.d.ts +1 -1
- package/dist/services/athena/error/athena-query-error.js +2 -7
- package/dist/services/athena/error/fetch-credentials-error.d.ts +1 -1
- package/dist/services/athena/error/fetch-credentials-error.js +2 -7
- package/dist/services/athena/index.d.ts +4 -4
- package/dist/services/athena/index.js +4 -7
- package/dist/services/bundler/bundle-service-factory.d.ts +3 -1
- package/dist/services/bundler/bundle-service-factory.js +7 -7
- package/dist/services/bundler/bundle-service.d.ts +9 -12
- package/dist/services/bundler/bundle-service.js +42 -32
- package/dist/services/bundler/error/bundle-fetch-error.d.ts +1 -1
- package/dist/services/bundler/error/bundle-fetch-error.js +2 -7
- package/dist/services/bundler/error/bundle-resolve-error.d.ts +1 -1
- package/dist/services/bundler/error/bundle-resolve-error.js +2 -7
- package/dist/services/bundler/index.d.ts +2 -2
- package/dist/services/bundler/index.js +2 -5
- package/dist/services/cli/cli-service-factory.d.ts +2 -2
- package/dist/services/cli/cli-service-factory.js +6 -10
- package/dist/services/cli/cli-service-model.d.ts +21 -6
- package/dist/services/cli/cli-service-model.js +3 -7
- package/dist/services/cli/cli-service.d.ts +10 -8
- package/dist/services/cli/cli-service.js +64 -61
- package/dist/services/cli/error/cli-type-error.js +1 -4
- package/dist/services/cli/index.d.ts +3 -3
- package/dist/services/cli/index.js +3 -6
- package/dist/services/config-api/client.d.ts +2 -2
- package/dist/services/config-api/client.js +29 -34
- package/dist/services/config-api/config-api-factory.d.ts +2 -2
- package/dist/services/config-api/config-api-factory.js +15 -20
- package/dist/services/config-api/config-api-model.d.ts +2 -2
- package/dist/services/config-api/config-api-model.js +1 -5
- package/dist/services/config-api/config-api-service.d.ts +2 -2
- package/dist/services/config-api/config-api-service.js +1 -5
- package/dist/services/config-api/entity-manager-factory.js +3 -7
- package/dist/services/config-api/error/json-response-error.d.ts +1 -1
- package/dist/services/config-api/error/json-response-error.js +2 -7
- package/dist/services/config-api/error/login-error.d.ts +1 -1
- package/dist/services/config-api/error/login-error.js +2 -7
- package/dist/services/config-api/error/orestes-api-error.d.ts +1 -1
- package/dist/services/config-api/error/orestes-api-error.js +2 -7
- package/dist/services/config-api/index.d.ts +3 -3
- package/dist/services/config-api/index.js +3 -6
- package/dist/services/config-api-service.d.ts +1 -1
- package/dist/services/config-api-service.js +6 -11
- package/dist/services/customer-config/customer-config-service-context.js +3 -7
- package/dist/services/customer-config/customer-config-service-factory.d.ts +1 -1
- package/dist/services/customer-config/customer-config-service-factory.js +6 -10
- package/dist/services/customer-config/customer-config-service-model.js +6 -9
- package/dist/services/customer-config/customer-config-service.d.ts +3 -3
- package/dist/services/customer-config/customer-config-service.js +55 -55
- package/dist/services/customer-config/index.d.ts +4 -4
- package/dist/services/customer-config/index.js +4 -7
- package/dist/services/customer-config/templates/config_documentHandler.js.hbs +88 -1
- package/dist/services/deploy/builder/install-resource-builder.d.ts +2 -2
- package/dist/services/deploy/builder/install-resource-builder.js +3 -7
- package/dist/services/deploy/checks/post-deploy/deprecated-deployment-detection-check.d.ts +4 -4
- package/dist/services/deploy/checks/post-deploy/deprecated-deployment-detection-check.js +19 -24
- package/dist/services/deploy/checks/post-deploy/revalidated-module-check.d.ts +3 -3
- package/dist/services/deploy/checks/post-deploy/revalidated-module-check.js +10 -14
- package/dist/services/deploy/checks/post-deploy/save-files-check.d.ts +3 -3
- package/dist/services/deploy/checks/post-deploy/save-files-check.js +8 -12
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.d.ts +3 -3
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +14 -20
- package/dist/services/deploy/checks/pre-deploy/split-change-check.d.ts +3 -3
- package/dist/services/deploy/checks/pre-deploy/split-change-check.js +19 -20
- package/dist/services/deploy/context/deploy-context.d.ts +2 -2
- package/dist/services/deploy/context/deploy-context.js +10 -14
- package/dist/services/deploy/deploy-service-factory.d.ts +3 -3
- package/dist/services/deploy/deploy-service-factory.js +36 -40
- package/dist/services/deploy/deploy-service-model.d.ts +10 -10
- package/dist/services/deploy/deploy-service-model.js +1 -2
- package/dist/services/deploy/deploy-service.d.ts +4 -4
- package/dist/services/deploy/deploy-service.js +10 -15
- package/dist/services/deploy/error/check-module-file-error.d.ts +1 -1
- package/dist/services/deploy/error/check-module-file-error.js +2 -7
- package/dist/services/deploy/error/deploy-install-resource-error.d.ts +1 -1
- package/dist/services/deploy/error/deploy-install-resource-error.js +2 -7
- package/dist/services/deploy/error/deploy-module-file-error.d.ts +1 -1
- package/dist/services/deploy/error/deploy-module-file-error.js +2 -7
- package/dist/services/deploy/error/deploy-server-config-error.d.ts +1 -1
- package/dist/services/deploy/error/deploy-server-config-error.js +2 -7
- package/dist/services/deploy/error/evaluate-sk-config-error.d.ts +1 -1
- package/dist/services/deploy/error/evaluate-sk-config-error.js +2 -7
- package/dist/services/deploy/error/file-handler-error.d.ts +1 -1
- package/dist/services/deploy/error/file-handler-error.js +2 -7
- package/dist/services/deploy/error/post-deploy-deployment-detection-error.d.ts +1 -1
- package/dist/services/deploy/error/post-deploy-deployment-detection-error.js +2 -7
- package/dist/services/deploy/error/safe-file-error.d.ts +1 -1
- package/dist/services/deploy/error/safe-file-error.js +2 -7
- package/dist/services/deploy/handler/customer-config-handler.d.ts +6 -6
- package/dist/services/deploy/handler/customer-config-handler.js +6 -10
- package/dist/services/deploy/handler/install-resource-handler.d.ts +7 -7
- package/dist/services/deploy/handler/install-resource-handler.js +22 -27
- package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.d.ts +4 -4
- package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.js +1 -4
- package/dist/services/deploy/handler/module-handler.d.ts +6 -6
- package/dist/services/deploy/handler/module-handler.js +12 -18
- package/dist/services/deploy/handler/server-config-handler.d.ts +5 -5
- package/dist/services/deploy/handler/server-config-handler.js +10 -14
- package/dist/services/deploy/interface/deploy-handler-interface.d.ts +1 -1
- package/dist/services/deploy/interface/deploy-handler-interface.js +1 -2
- package/dist/services/deploy/interface/install-configs.js +1 -2
- package/dist/services/deploy/interface/install-resource-processor-interface.d.ts +1 -1
- package/dist/services/deploy/interface/install-resource-processor-interface.js +1 -2
- package/dist/services/deploy/interface/install.d.ts +1 -1
- package/dist/services/deploy/interface/install.js +1 -2
- package/dist/services/deploy/interface/runtime-modifier.d.ts +1 -1
- package/dist/services/deploy/interface/runtime-modifier.js +1 -2
- package/dist/services/deploy/interface/validate-origins-response.js +1 -2
- package/dist/services/diff/diff-model.js +1 -5
- package/dist/services/diff/diff-service-factory.d.ts +1 -1
- package/dist/services/diff/diff-service-factory.js +6 -10
- package/dist/services/diff/diff-service.d.ts +1 -1
- package/dist/services/diff/diff-service.js +19 -24
- package/dist/services/diff/index.d.ts +3 -3
- package/dist/services/diff/index.js +3 -6
- package/dist/services/diff-service.d.ts +1 -1
- package/dist/services/diff-service.js +16 -21
- package/dist/services/document-handler-runtime/context/document-handler-runtime-context.js +30 -34
- package/dist/services/document-handler-runtime/document-handler-runtime-service.d.ts +3 -3
- package/dist/services/document-handler-runtime/document-handler-runtime-service.js +38 -42
- package/dist/services/document-handler-runtime/document-handler-server.d.ts +7 -11
- package/dist/services/document-handler-runtime/document-handler-server.js +77 -59
- package/dist/services/document-handler-runtime/error/required-file-not-found-error.js +1 -4
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +5 -5
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +42 -46
- package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.js +1 -4
- package/dist/services/document-handler-runtime/interface/template-context-interface.d.ts +2 -3
- package/dist/services/document-handler-runtime/interface/template-context-interface.js +1 -2
- package/dist/services/document-handler-runtime/interface/template-interface.d.ts +2 -2
- package/dist/services/document-handler-runtime/interface/template-interface.js +1 -2
- package/dist/services/document-handler-runtime/interface/template-parameter-interface.js +1 -2
- package/dist/services/document-handler-runtime/server/document-handler-response.d.ts +1 -3
- package/dist/services/document-handler-runtime/server/document-handler-response.js +1 -5
- package/dist/services/document-handler-runtime/server/request.d.ts +4 -10
- package/dist/services/document-handler-runtime/server/request.js +1 -5
- package/dist/services/document-handler-runtime/templates/abstract-template.d.ts +3 -3
- package/dist/services/document-handler-runtime/templates/abstract-template.js +3 -7
- package/dist/services/document-handler-runtime/templates/database-mock.d.ts +2 -2
- package/dist/services/document-handler-runtime/templates/database-mock.js +2 -6
- package/dist/services/document-handler-runtime/templates/execute-document-handler.d.ts +2 -2
- package/dist/services/document-handler-runtime/templates/execute-document-handler.js +2 -6
- package/dist/services/document-handler-runtime/templates/orestes-mock.d.ts +2 -2
- package/dist/services/document-handler-runtime/templates/orestes-mock.js +2 -6
- package/dist/services/document-handler-runtime/templates/package-json.d.ts +3 -5
- package/dist/services/document-handler-runtime/templates/package-json.js +2 -6
- package/dist/services/document-handler-runtime/templates/test.d.ts +2 -2
- package/dist/services/document-handler-runtime/templates/test.js +2 -6
- package/dist/services/error-handling/error/application-error.d.ts +1 -1
- package/dist/services/error-handling/error/application-error.js +1 -5
- package/dist/services/error-handling/error/config-file-error.d.ts +1 -1
- package/dist/services/error-handling/error/config-file-error.js +2 -7
- package/dist/services/error-handling/error/connection-error.d.ts +1 -1
- package/dist/services/error-handling/error/connection-error.js +2 -7
- package/dist/services/integration-api/error/customer-config-error.d.ts +1 -1
- package/dist/services/integration-api/error/customer-config-error.js +2 -5
- package/dist/services/integration-api/error/customer-config-legacy-error.d.ts +1 -1
- package/dist/services/integration-api/error/customer-config-legacy-error.js +2 -6
- package/dist/services/integration-api/error/invalid-config-format-error.d.ts +1 -1
- package/dist/services/integration-api/error/invalid-config-format-error.js +4 -7
- package/dist/services/integration-api/error/mandatory-file-missing-error.d.ts +1 -1
- package/dist/services/integration-api/error/mandatory-file-missing-error.js +2 -6
- package/dist/services/integration-api/error/origin-error.d.ts +1 -1
- package/dist/services/integration-api/error/origin-error.js +2 -5
- package/dist/services/integration-api/error/read-files-error.d.ts +1 -1
- package/dist/services/integration-api/error/read-files-error.js +2 -7
- package/dist/services/integration-api/external/external-file-reader.d.ts +1 -1
- package/dist/services/integration-api/external/external-file-reader.js +9 -14
- package/dist/services/integration-api/file-list.d.ts +1 -1
- package/dist/services/integration-api/file-list.js +8 -11
- package/dist/services/integration-api/file-reader.js +11 -15
- package/dist/services/integration-api/file-writer.js +4 -8
- package/dist/services/integration-api/handler/customer-config-handler.d.ts +5 -5
- package/dist/services/integration-api/handler/customer-config-handler.js +17 -21
- package/dist/services/integration-api/handler/file-handler.d.ts +2 -2
- package/dist/services/integration-api/handler/file-handler.js +1 -4
- package/dist/services/integration-api/handler/install-resource-handler.d.ts +2 -2
- package/dist/services/integration-api/handler/install-resource-handler.js +6 -10
- package/dist/services/integration-api/handler/module-handler.d.ts +2 -2
- package/dist/services/integration-api/handler/module-handler.js +4 -8
- package/dist/services/integration-api/handler/server-config-handler.d.ts +2 -2
- package/dist/services/integration-api/handler/server-config-handler.js +4 -8
- package/dist/services/integration-api/index.d.ts +3 -3
- package/dist/services/integration-api/index.js +3 -6
- package/dist/services/integration-api/integration-api-factory.d.ts +3 -3
- package/dist/services/integration-api/integration-api-factory.js +23 -28
- package/dist/services/integration-api/integration-api-model.d.ts +17 -19
- package/dist/services/integration-api/integration-api-model.js +16 -21
- package/dist/services/integration-api/integration-api-service.d.ts +5 -5
- package/dist/services/integration-api/integration-api-service.js +6 -12
- package/dist/services/integration-api/spec/customer-config-validator.spec.js +29 -32
- package/dist/services/integration-api/spec/file-list.spec.js +107 -110
- package/dist/services/integration-api/spec/file-reader.spec.js +27 -30
- package/dist/services/integration-api/spec/file-writer.spec.js +34 -37
- package/dist/services/integration-api/spec/integration-api-service.spec.js +42 -45
- package/dist/services/integration-api/spec/mandatory-files-validator.spec.js +48 -51
- package/dist/services/integration-api/struct/customer-config-file.d.ts +1 -1
- package/dist/services/integration-api/struct/customer-config-file.js +10 -15
- package/dist/services/integration-api/struct/customer-config.d.ts +4 -8
- package/dist/services/integration-api/struct/customer-config.js +5 -10
- package/dist/services/integration-api/struct/file.d.ts +1 -1
- package/dist/services/integration-api/struct/file.js +9 -13
- package/dist/services/integration-api/struct/install-resource-file.d.ts +2 -2
- package/dist/services/integration-api/struct/install-resource-file.js +4 -8
- package/dist/services/integration-api/struct/module-file.d.ts +2 -2
- package/dist/services/integration-api/struct/module-file.js +4 -8
- package/dist/services/integration-api/struct/ro-file.d.ts +1 -1
- package/dist/services/integration-api/struct/ro-file.js +1 -5
- package/dist/services/integration-api/struct/server-config-file.d.ts +2 -2
- package/dist/services/integration-api/struct/server-config-file.js +4 -8
- package/dist/services/integration-api/struct/virtual-file.d.ts +1 -1
- package/dist/services/integration-api/struct/virtual-file.js +3 -7
- package/dist/services/integration-api/validator/customer-config-validator.d.ts +1 -1
- package/dist/services/integration-api/validator/customer-config-validator.js +8 -12
- package/dist/services/integration-api/validator/mandatory-files-validator.d.ts +2 -2
- package/dist/services/integration-api/validator/mandatory-files-validator.js +4 -8
- package/dist/services/integration-api/virtual/external-recipe.d.ts +2 -2
- package/dist/services/integration-api/virtual/external-recipe.js +1 -5
- package/dist/services/integration-api/virtual/static-recipe.d.ts +1 -1
- package/dist/services/integration-api/virtual/static-recipe.js +1 -5
- package/dist/services/integration-api/virtual/virtual-file-handler.d.ts +2 -2
- package/dist/services/integration-api/virtual/virtual-file-handler.js +8 -13
- package/dist/services/onboarding/browser/abort-response.js +1 -5
- package/dist/services/onboarding/browser/baqend-response.d.ts +1 -1
- package/dist/services/onboarding/browser/baqend-response.js +1 -5
- package/dist/services/onboarding/browser/config/browser-config.d.ts +1 -1
- package/dist/services/onboarding/browser/config/browser-config.js +15 -20
- package/dist/services/onboarding/browser/executable/executable-validator.d.ts +2 -2
- package/dist/services/onboarding/browser/executable/executable-validator.js +12 -17
- package/dist/services/onboarding/browser/extension/devtools-extension-api.d.ts +1 -1
- package/dist/services/onboarding/browser/extension/devtools-extension-api.js +1 -5
- package/dist/services/onboarding/browser/extension/extension-downloader.d.ts +2 -2
- package/dist/services/onboarding/browser/extension/extension-downloader.js +24 -30
- package/dist/services/onboarding/browser/extension/extension-validator.d.ts +3 -3
- package/dist/services/onboarding/browser/extension/extension-validator.js +18 -23
- package/dist/services/onboarding/browser/origin-response.d.ts +1 -1
- package/dist/services/onboarding/browser/origin-response.js +1 -5
- package/dist/services/onboarding/config-renderer/install-file-recipe.d.ts +2 -2
- package/dist/services/onboarding/config-renderer/install-file-recipe.js +1 -5
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.d.ts +3 -3
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +8 -11
- package/dist/services/onboarding/dashboard/diff-against-current-page.d.ts +4 -4
- package/dist/services/onboarding/dashboard/diff-against-current-page.js +9 -14
- package/dist/services/onboarding/dashboard/index.d.ts +7 -7
- package/dist/services/onboarding/dashboard/index.js +8 -13
- package/dist/services/onboarding/dashboard/parameter-query-builder.d.ts +1 -1
- package/dist/services/onboarding/dashboard/parameter-query-builder.js +9 -13
- package/dist/services/onboarding/dashboard/request-diff-service.d.ts +3 -3
- package/dist/services/onboarding/dashboard/request-diff-service.js +14 -19
- package/dist/services/onboarding/error/browser-extension-error.d.ts +1 -1
- package/dist/services/onboarding/error/browser-extension-error.js +1 -5
- package/dist/services/onboarding/error/document-handler-transform-error.js +1 -5
- package/dist/services/onboarding/error/unsupported-encoding-error.d.ts +1 -1
- package/dist/services/onboarding/error/unsupported-encoding-error.js +2 -7
- package/dist/services/onboarding/error/validate-extension-error.d.ts +1 -1
- package/dist/services/onboarding/error/validate-extension-error.js +2 -7
- package/dist/services/onboarding/error/vm-empty-response-error.d.ts +1 -1
- package/dist/services/onboarding/error/vm-empty-response-error.js +2 -7
- package/dist/services/onboarding/error/vm-error.d.ts +1 -1
- package/dist/services/onboarding/error/vm-error.js +2 -7
- package/dist/services/onboarding/fetch-event-handler.d.ts +4 -4
- package/dist/services/onboarding/fetch-event-handler.js +19 -25
- package/dist/services/onboarding/fetch-events/customer-domain-document-response.d.ts +4 -4
- package/dist/services/onboarding/fetch-events/customer-domain-document-response.js +15 -20
- package/dist/services/onboarding/fetch-events/customer-service-worker-js.d.ts +3 -3
- package/dist/services/onboarding/fetch-events/customer-service-worker-js.js +4 -8
- package/dist/services/onboarding/fetch-events/dashboard-request.d.ts +3 -3
- package/dist/services/onboarding/fetch-events/dashboard-request.js +1 -5
- package/dist/services/onboarding/fetch-events/speed-kit-asset-request.d.ts +5 -5
- package/dist/services/onboarding/fetch-events/speed-kit-asset-request.js +1 -5
- package/dist/services/onboarding/fetch-events/speed-kit-install-html.d.ts +4 -4
- package/dist/services/onboarding/fetch-events/speed-kit-install-html.js +3 -7
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.d.ts +5 -5
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +7 -11
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +6 -6
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.js +4 -8
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +3 -3
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.js +3 -7
- package/dist/services/onboarding/file-events/file-watcher.d.ts +5 -5
- package/dist/services/onboarding/file-events/file-watcher.js +24 -28
- package/dist/services/onboarding/index.d.ts +3 -3
- package/dist/services/onboarding/index.js +3 -8
- package/dist/services/onboarding/onboarding-model.d.ts +21 -23
- package/dist/services/onboarding/onboarding-model.js +22 -27
- package/dist/services/onboarding/onboarding-service-factory.d.ts +3 -3
- package/dist/services/onboarding/onboarding-service-factory.js +102 -108
- package/dist/services/onboarding/onboarding-service.d.ts +6 -6
- package/dist/services/onboarding/onboarding-service.js +12 -18
- package/dist/services/onboarding/request-cache/cache.d.ts +3 -3
- package/dist/services/onboarding/request-cache/cache.js +1 -5
- package/dist/services/onboarding/server-config/index.d.ts +3 -3
- package/dist/services/onboarding/server-config/index.js +6 -11
- package/dist/services/onboarding/templates/install-speed-kit-html-template.d.ts +1 -1
- package/dist/services/onboarding/templates/install-speed-kit-html-template.js +2 -7
- package/dist/services/onboarding/templates/install-speed-kit-js-template.d.ts +1 -1
- package/dist/services/onboarding/templates/install-speed-kit-js-template.js +2 -7
- package/dist/services/onboarding/todo-collector.d.ts +3 -3
- package/dist/services/onboarding/todo-collector.js +3 -7
- package/dist/services/onboarding/virtual-orestes-app/crawler.d.ts +2 -2
- package/dist/services/onboarding/virtual-orestes-app/crawler.js +12 -16
- package/dist/services/onboarding/virtual-orestes-app/index.d.ts +7 -7
- package/dist/services/onboarding/virtual-orestes-app/index.js +25 -32
- package/dist/services/pop-config/index.d.ts +3 -3
- package/dist/services/pop-config/index.js +3 -6
- package/dist/services/pop-config/pop-config-factory.d.ts +1 -1
- package/dist/services/pop-config/pop-config-factory.js +5 -9
- package/dist/services/pop-config/pop-config-model.d.ts +2 -2
- package/dist/services/pop-config/pop-config-model.js +1 -2
- package/dist/services/pop-config/pop-config-service.d.ts +2 -2
- package/dist/services/pop-config/pop-config-service.js +1 -5
- package/dist/services/prewarm/assets/asset-api-client.d.ts +2 -2
- package/dist/services/prewarm/assets/asset-api-client.js +18 -23
- package/dist/services/prewarm/assets/asset-item.d.ts +1 -1
- package/dist/services/prewarm/assets/asset-item.js +6 -10
- package/dist/services/prewarm/assets/asset-list.d.ts +2 -2
- package/dist/services/prewarm/assets/asset-list.js +6 -10
- package/dist/services/prewarm/csv-reader.js +6 -11
- package/dist/services/prewarm/error/invalid-origin-error.d.ts +1 -1
- package/dist/services/prewarm/error/invalid-origin-error.js +2 -7
- package/dist/services/prewarm/error/read-csv-error.d.ts +1 -1
- package/dist/services/prewarm/error/read-csv-error.js +2 -7
- package/dist/services/prewarm/index.d.ts +3 -3
- package/dist/services/prewarm/index.js +3 -6
- package/dist/services/prewarm/pre-warm-factory.d.ts +1 -1
- package/dist/services/prewarm/pre-warm-factory.js +13 -17
- package/dist/services/prewarm/pre-warm-model.js +16 -20
- package/dist/services/prewarm/pre-warm-service.d.ts +3 -3
- package/dist/services/prewarm/pre-warm-service.js +18 -22
- package/dist/services/pull/index.d.ts +3 -3
- package/dist/services/pull/index.js +3 -6
- package/dist/services/pull/pull-service-factory.d.ts +2 -2
- package/dist/services/pull/pull-service-factory.js +12 -16
- package/dist/services/pull/pull-service-model.js +4 -9
- package/dist/services/pull/pull-service.d.ts +3 -3
- package/dist/services/pull/pull-service.js +14 -19
- package/dist/services/query-builder/error/parse-config-speed-kit-error.d.ts +1 -1
- package/dist/services/query-builder/error/parse-config-speed-kit-error.js +2 -6
- package/dist/services/query-builder/query/parameter.js +1 -5
- package/dist/services/query-builder/query/prewarm.js +1 -5
- package/dist/services/query-builder/query-builder-factory.d.ts +3 -3
- package/dist/services/query-builder/query-builder-factory.js +16 -20
- package/dist/services/query-builder/query-builder-model.d.ts +6 -6
- package/dist/services/query-builder/query-builder-model.js +2 -5
- package/dist/services/query-builder/query-builder-service.d.ts +2 -2
- package/dist/services/query-builder/query-builder-service.js +24 -30
- package/oclif.manifest.json +15 -15
- package/package.json +63 -54
- package/dist/dummy.spec.d.ts +0 -1
- package/dist/dummy.spec.js +0 -18
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDirectory = isDirectory;
|
|
4
|
-
const promises_1 = require("node:fs/promises");
|
|
1
|
+
import { stat } from "node:fs/promises";
|
|
5
2
|
/**
|
|
6
3
|
* @deprecated
|
|
7
4
|
* @param directory
|
|
8
5
|
*/
|
|
9
|
-
async function isDirectory(directory) {
|
|
6
|
+
export async function isDirectory(directory) {
|
|
10
7
|
try {
|
|
11
|
-
const stats = await
|
|
8
|
+
const stats = await stat(directory);
|
|
12
9
|
return stats.isDirectory();
|
|
13
10
|
}
|
|
14
11
|
catch (error) {
|
package/dist/helpers/is-file.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isFile = isFile;
|
|
4
|
-
const promises_1 = require("node:fs/promises");
|
|
1
|
+
import { stat } from "node:fs/promises";
|
|
5
2
|
/**
|
|
6
3
|
* @deprecated
|
|
7
4
|
* @param filename
|
|
8
5
|
*/
|
|
9
|
-
async function isFile(filename) {
|
|
6
|
+
export async function isFile(filename) {
|
|
10
7
|
try {
|
|
11
|
-
const stats = await
|
|
8
|
+
const stats = await stat(filename);
|
|
12
9
|
return stats.isFile();
|
|
13
10
|
}
|
|
14
11
|
catch (error) {
|
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logInfo = logInfo;
|
|
4
|
-
exports.logError = logError;
|
|
5
|
-
exports.logWarning = logWarning;
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
|
-
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
1
|
+
import chalk from "chalk";
|
|
8
2
|
// TODO: use CliService instead
|
|
9
3
|
/**
|
|
10
4
|
* Logs the given message 'green' in the console.
|
|
11
5
|
* @deprecated
|
|
12
6
|
*/
|
|
13
|
-
function logInfo(message, ...optionalParameters) {
|
|
14
|
-
console.log(
|
|
7
|
+
export function logInfo(message, ...optionalParameters) {
|
|
8
|
+
console.log(chalk.green(message), ...optionalParameters);
|
|
15
9
|
}
|
|
16
10
|
/**
|
|
17
11
|
* Logs the given message 'red' in the console.
|
|
18
12
|
* @deprecated
|
|
19
13
|
*/
|
|
20
|
-
function logError(message, ...optionalParameters) {
|
|
21
|
-
console.log(
|
|
14
|
+
export function logError(message, ...optionalParameters) {
|
|
15
|
+
console.log(chalk.red(message), ...optionalParameters);
|
|
22
16
|
}
|
|
23
17
|
/**
|
|
24
18
|
* Logs the given message 'yellow' in the console.
|
|
25
19
|
* @deprecated
|
|
26
20
|
*/
|
|
27
|
-
function logWarning(message, ...optionalParameters) {
|
|
28
|
-
console.log(
|
|
21
|
+
export function logWarning(message, ...optionalParameters) {
|
|
22
|
+
console.log(chalk.yellow(message), ...optionalParameters);
|
|
29
23
|
}
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sortParameters = sortParameters;
|
|
4
|
-
exports.convertNotEncodedParameters = convertNotEncodedParameters;
|
|
5
|
-
exports.transformNoValueParameters = transformNoValueParameters;
|
|
6
|
-
exports.normalize = normalize;
|
|
7
|
-
exports.unescapeSpaces = unescapeSpaces;
|
|
8
|
-
const node_url_1 = require("node:url");
|
|
1
|
+
import { URL } from "node:url";
|
|
9
2
|
/**
|
|
10
3
|
* Sorts all urls params manually.
|
|
11
4
|
*
|
|
12
5
|
* @param searchParameters - Params to sort.
|
|
13
6
|
*/
|
|
14
|
-
function sortParameters(searchParameters) {
|
|
7
|
+
export function sortParameters(searchParameters) {
|
|
15
8
|
const entries = [...searchParameters.entries()].sort((a, b) => {
|
|
16
9
|
if (a[0] === b[0]) {
|
|
17
10
|
return a[1] < b[1] ? -1 : 1;
|
|
@@ -33,7 +26,7 @@ function sortParameters(searchParameters) {
|
|
|
33
26
|
* @return The encoded parameter key and value without ?.
|
|
34
27
|
*/
|
|
35
28
|
function encodeUrlComponent(parameterKey, parameterValue) {
|
|
36
|
-
const url = new
|
|
29
|
+
const url = new URL("https://www.baqend.com/");
|
|
37
30
|
url.searchParams.append(parameterKey, parameterValue);
|
|
38
31
|
return url.search.replace(/\?/, "");
|
|
39
32
|
}
|
|
@@ -52,7 +45,7 @@ function encodeUrlComponent(parameterKey, parameterValue) {
|
|
|
52
45
|
* @param url - The original Url.
|
|
53
46
|
* @param manipulatedUrl - The computed URL.
|
|
54
47
|
*/
|
|
55
|
-
function convertNotEncodedParameters(url, manipulatedUrl) {
|
|
48
|
+
export function convertNotEncodedParameters(url, manipulatedUrl) {
|
|
56
49
|
if (manipulatedUrl.search.length === 0) {
|
|
57
50
|
return;
|
|
58
51
|
}
|
|
@@ -85,7 +78,7 @@ function convertNotEncodedParameters(url, manipulatedUrl) {
|
|
|
85
78
|
* @param url - The original URL.
|
|
86
79
|
* @param manipulatedUrl - The manipulated URL to remove the "=" from.
|
|
87
80
|
*/
|
|
88
|
-
function transformNoValueParameters(url, manipulatedUrl) {
|
|
81
|
+
export function transformNoValueParameters(url, manipulatedUrl) {
|
|
89
82
|
const parametersWithoutValue = url.search
|
|
90
83
|
.split(/[&?]/)
|
|
91
84
|
.filter((parameter) => parameter && !parameter.includes("="));
|
|
@@ -100,8 +93,8 @@ function transformNoValueParameters(url, manipulatedUrl) {
|
|
|
100
93
|
* @param withParameterSorting - Activates alphabetical sorting of the URL parameters.
|
|
101
94
|
* @returns The normalized URL.
|
|
102
95
|
*/
|
|
103
|
-
function normalize(urlString, withParameterSorting) {
|
|
104
|
-
const url = new
|
|
96
|
+
export function normalize(urlString, withParameterSorting) {
|
|
97
|
+
const url = new URL(urlString);
|
|
105
98
|
// Remove the hash part of the URL if exists
|
|
106
99
|
if (url.hash) {
|
|
107
100
|
url.hash = "";
|
|
@@ -110,8 +103,8 @@ function normalize(urlString, withParameterSorting) {
|
|
|
110
103
|
// Sort search params to normalize encoding and order of params
|
|
111
104
|
sortParameters(url.searchParams);
|
|
112
105
|
}
|
|
113
|
-
convertNotEncodedParameters(new
|
|
114
|
-
transformNoValueParameters(new
|
|
106
|
+
convertNotEncodedParameters(new URL(urlString), url);
|
|
107
|
+
transformNoValueParameters(new URL(urlString), url);
|
|
115
108
|
return url.toString();
|
|
116
109
|
}
|
|
117
110
|
/**
|
|
@@ -119,6 +112,6 @@ function normalize(urlString, withParameterSorting) {
|
|
|
119
112
|
*
|
|
120
113
|
* @param string_
|
|
121
114
|
*/
|
|
122
|
-
function unescapeSpaces(string_) {
|
|
115
|
+
export function unescapeSpaces(string_) {
|
|
123
116
|
return string_.replaceAll("\\ ", " ");
|
|
124
117
|
}
|
package/dist/helpers/race.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ApplicationError from "../services/error-handling/error/application-error";
|
|
1
|
+
import ApplicationError from "../services/error-handling/error/application-error.js";
|
|
2
2
|
export declare class RaceTimeOutError extends ApplicationError {
|
|
3
3
|
}
|
|
4
4
|
export declare function race<T>(promise: Promise<T>, timeout?: number): Promise<T>;
|
package/dist/helpers/race.js
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RaceTimeOutError = void 0;
|
|
4
|
-
exports.race = race;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const application_error_1 = tslib_1.__importDefault(require("../services/error-handling/error/application-error"));
|
|
1
|
+
import ApplicationError from "../services/error-handling/error/application-error.js";
|
|
7
2
|
const DEFAULT_TIMEOUT = 5000;
|
|
8
|
-
class RaceTimeOutError extends
|
|
3
|
+
export class RaceTimeOutError extends ApplicationError {
|
|
9
4
|
}
|
|
10
|
-
|
|
11
|
-
async function race(promise, timeout = DEFAULT_TIMEOUT) {
|
|
5
|
+
export async function race(promise, timeout = DEFAULT_TIMEOUT) {
|
|
12
6
|
const timeOut = new Promise((resolve, reject) => {
|
|
13
7
|
setTimeout(() => {
|
|
14
8
|
reject(new RaceTimeOutError(`timeout of ${timeout}ms reached`));
|
package/dist/helpers/safe.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.safe = safe;
|
|
4
|
-
function safe(promiseOrFunction) {
|
|
1
|
+
export function safe(promiseOrFunction) {
|
|
5
2
|
if (promiseOrFunction instanceof Promise) {
|
|
6
3
|
return safeAsync(promiseOrFunction);
|
|
7
4
|
}
|
package/dist/helpers/scrape.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function scrape(url: string): Promise<
|
|
1
|
+
export default function scrape(url: string): Promise<string>;
|
package/dist/helpers/scrape.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
6
|
-
async function scrape(url) {
|
|
7
|
-
const response = await (0, node_fetch_1.default)(url);
|
|
1
|
+
import fetch from "node-fetch";
|
|
2
|
+
export default async function scrape(url) {
|
|
3
|
+
const response = await fetch(url);
|
|
8
4
|
if (response.status !== 200) {
|
|
9
5
|
return null;
|
|
10
6
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.analyzeSite = analyzeSite;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
6
|
-
const safe_js_1 = require("./safe.js");
|
|
1
|
+
import fetch from "node-fetch";
|
|
2
|
+
import { safe } from "./safe.js";
|
|
7
3
|
const EMPTY_FLAGS = {
|
|
8
4
|
useGATracking: false,
|
|
9
5
|
withGoogleOptimize: false,
|
|
@@ -80,7 +76,7 @@ function findUrl(html, host, pattern) {
|
|
|
80
76
|
return `https://${host}${path}`;
|
|
81
77
|
}
|
|
82
78
|
async function fetchPage(url, signal) {
|
|
83
|
-
const result = await
|
|
79
|
+
const result = await safe(fetch(url, { signal: signal }));
|
|
84
80
|
if (!result.success)
|
|
85
81
|
return null;
|
|
86
82
|
const response = result.data;
|
|
@@ -139,7 +135,7 @@ async function fetchAndAnalyze(host, log) {
|
|
|
139
135
|
clearTimeout(timeout);
|
|
140
136
|
}
|
|
141
137
|
}
|
|
142
|
-
async function analyzeSite(host, log = console.log) {
|
|
143
|
-
const result = await
|
|
138
|
+
export async function analyzeSite(host, log = console.log) {
|
|
139
|
+
const result = await safe(fetchAndAnalyze(host, log));
|
|
144
140
|
return result.success ? result.data : null;
|
|
145
141
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.speedKitRuleToRegExp = speedKitRuleToRegExp;
|
|
4
1
|
function escapeRegExp(string_) {
|
|
5
2
|
return string_.replaceAll(/[\s#$()*+,.?[\\\]^{|}-]/g, "\\$&");
|
|
6
3
|
}
|
|
7
|
-
function speedKitRuleToRegExp(url) {
|
|
4
|
+
export function speedKitRuleToRegExp(url) {
|
|
8
5
|
return new RegExp(`^${escapeRegExp(url).replaceAll("\\*", ".*")}$`);
|
|
9
6
|
}
|
|
@@ -73,13 +73,13 @@ export declare enum CLIParametersExample {
|
|
|
73
73
|
VariationPath = "C:\\Users\\testUser\\variations.csv"
|
|
74
74
|
}
|
|
75
75
|
export declare const CLI_CONFIG_NAME: {
|
|
76
|
-
configName: import("@oclif/core/
|
|
76
|
+
configName: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
77
77
|
};
|
|
78
78
|
export declare const CLI_CONFIG_IS_TEST: {
|
|
79
|
-
useTestConfig: import("@oclif/core/
|
|
79
|
+
useTestConfig: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
80
80
|
};
|
|
81
81
|
export declare const CLI_CUSTOMER_CONFIG: {
|
|
82
|
-
customerPath: import("@oclif/core/
|
|
83
|
-
exists?: boolean
|
|
82
|
+
customerPath: import("@oclif/core/interfaces").Arg<string, {
|
|
83
|
+
exists?: boolean;
|
|
84
84
|
}>;
|
|
85
85
|
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.CLI_CUSTOMER_CONFIG = exports.CLI_CONFIG_IS_TEST = exports.CLI_CONFIG_NAME = exports.CLIParametersExample = exports.CLIParametersChar = exports.CLIParameters = void 0;
|
|
4
|
-
const core_1 = require("@oclif/core");
|
|
5
|
-
var CLIParameters;
|
|
1
|
+
import { Args, Flags } from "@oclif/core";
|
|
2
|
+
export var CLIParameters;
|
|
6
3
|
(function (CLIParameters) {
|
|
7
4
|
CLIParameters["AppName"] = "app";
|
|
8
5
|
CLIParameters["Artifacts"] = "artifacts";
|
|
@@ -30,9 +27,9 @@ var CLIParameters;
|
|
|
30
27
|
CLIParameters["VariationPath"] = "variationPath";
|
|
31
28
|
CLIParameters["Verbose"] = "verbose";
|
|
32
29
|
CLIParameters["useTestConfig"] = "useTestConfig";
|
|
33
|
-
})(CLIParameters || (
|
|
30
|
+
})(CLIParameters || (CLIParameters = {}));
|
|
34
31
|
/* eslint-disable @typescript-eslint/no-duplicate-enum-values */
|
|
35
|
-
var CLIParametersChar;
|
|
32
|
+
export var CLIParametersChar;
|
|
36
33
|
(function (CLIParametersChar) {
|
|
37
34
|
CLIParametersChar["AppName"] = "a";
|
|
38
35
|
CLIParametersChar["Artifacts"] = "a";
|
|
@@ -56,9 +53,9 @@ var CLIParametersChar;
|
|
|
56
53
|
CLIParametersChar["VariationPath"] = "p";
|
|
57
54
|
CLIParametersChar["Quiet"] = "q";
|
|
58
55
|
CLIParametersChar["useTestConfig"] = "t";
|
|
59
|
-
})(CLIParametersChar || (
|
|
56
|
+
})(CLIParametersChar || (CLIParametersChar = {}));
|
|
60
57
|
/* eslint-enable @typescript-eslint/no-duplicate-enum-values */
|
|
61
|
-
var CLIParametersExample;
|
|
58
|
+
export var CLIParametersExample;
|
|
62
59
|
(function (CLIParametersExample) {
|
|
63
60
|
CLIParametersExample["AppName"] = "decathlon";
|
|
64
61
|
CLIParametersExample["Artifacts"] = "dynamic,SpeedKit";
|
|
@@ -80,9 +77,9 @@ var CLIParametersExample;
|
|
|
80
77
|
CLIParametersExample["Variation"] = "MOBILE";
|
|
81
78
|
CLIParametersExample["Variations"] = "MOBILE,DESKTOP";
|
|
82
79
|
CLIParametersExample["VariationPath"] = "C:\\Users\\testUser\\variations.csv";
|
|
83
|
-
})(CLIParametersExample || (
|
|
84
|
-
|
|
85
|
-
[CLIParameters.ConfigName]:
|
|
80
|
+
})(CLIParametersExample || (CLIParametersExample = {}));
|
|
81
|
+
export const CLI_CONFIG_NAME = {
|
|
82
|
+
[CLIParameters.ConfigName]: Flags.string({
|
|
86
83
|
char: CLIParametersChar.ConfigName,
|
|
87
84
|
default: "production",
|
|
88
85
|
description: "The costumer config name",
|
|
@@ -92,14 +89,14 @@ exports.CLI_CONFIG_NAME = {
|
|
|
92
89
|
// to enable testMode for deploy and onboarding command
|
|
93
90
|
// it will set the field app to the configured testApp
|
|
94
91
|
// and name to the original configured app
|
|
95
|
-
|
|
96
|
-
[CLIParameters.useTestConfig]:
|
|
92
|
+
export const CLI_CONFIG_IS_TEST = {
|
|
93
|
+
[CLIParameters.useTestConfig]: Flags.boolean({
|
|
97
94
|
char: CLIParametersChar.useTestConfig,
|
|
98
95
|
description: "Override app with configured testApp",
|
|
99
96
|
}),
|
|
100
97
|
};
|
|
101
|
-
|
|
102
|
-
[CLIParameters.CustomerPath]:
|
|
98
|
+
export const CLI_CUSTOMER_CONFIG = {
|
|
99
|
+
[CLIParameters.CustomerPath]: Args.directory({
|
|
103
100
|
name: CLIParameters.CustomerPath,
|
|
104
101
|
required: true,
|
|
105
102
|
description: "The customer config path",
|
package/dist/models/files.js
CHANGED
package/dist/models/install.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/dist/models/os.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_INTELLIJ_IDEA_PATH_MACOS = void 0;
|
|
4
|
-
exports.DEFAULT_INTELLIJ_IDEA_PATH_MACOS = "/Applications/IntelliJ IDEA.app/Contents/MacOS";
|
|
1
|
+
export const DEFAULT_INTELLIJ_IDEA_PATH_MACOS = "/Applications/IntelliJ IDEA.app/Contents/MacOS";
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const _1 = require("./");
|
|
8
|
-
const athena_service_1 = require("./athena-service");
|
|
9
|
-
class AthenaServiceFactory {
|
|
1
|
+
import { AthenaClient } from "@aws-sdk/client-athena";
|
|
2
|
+
import { safe } from "../../helpers/safe.js";
|
|
3
|
+
import { CliServiceFactory } from "../cli/index.js";
|
|
4
|
+
import { ATHENA_CONFIG, FetchCredentialsError } from "./index.js";
|
|
5
|
+
import { AthenaService } from "./athena-service.js";
|
|
6
|
+
export class AthenaServiceFactory {
|
|
10
7
|
service;
|
|
11
8
|
async getService() {
|
|
12
|
-
if (!(this.service instanceof
|
|
9
|
+
if (!(this.service instanceof AthenaService)) {
|
|
13
10
|
this.service = await this.createService();
|
|
14
11
|
}
|
|
15
12
|
return this.service;
|
|
16
13
|
}
|
|
17
14
|
async createService() {
|
|
18
|
-
const cli = new
|
|
15
|
+
const cli = new CliServiceFactory().getService();
|
|
19
16
|
const client = await this.getAthenaClient(cli);
|
|
20
|
-
return new
|
|
17
|
+
return new AthenaService(client, cli);
|
|
21
18
|
}
|
|
22
19
|
/**
|
|
23
20
|
* create awsAthenaClient
|
|
@@ -26,15 +23,14 @@ class AthenaServiceFactory {
|
|
|
26
23
|
* @private
|
|
27
24
|
*/
|
|
28
25
|
async getAthenaClient(cli) {
|
|
29
|
-
const client = new
|
|
30
|
-
cli.startAction("check for aws credentials");
|
|
31
|
-
const credentialsResult = await
|
|
26
|
+
const client = new AthenaClient(ATHENA_CONFIG);
|
|
27
|
+
cli.startAction("ATHENA", "check for aws credentials");
|
|
28
|
+
const credentialsResult = await safe(client.config.credentials());
|
|
32
29
|
if (credentialsResult.success === true) {
|
|
33
|
-
cli.
|
|
30
|
+
cli.successAction("ATHENA");
|
|
34
31
|
return client;
|
|
35
32
|
}
|
|
36
|
-
cli.
|
|
37
|
-
throw new
|
|
33
|
+
cli.failAction("ATHENA");
|
|
34
|
+
throw new FetchCredentialsError(credentialsResult.error);
|
|
38
35
|
}
|
|
39
36
|
}
|
|
40
|
-
exports.AthenaServiceFactory = AthenaServiceFactory;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ATHENA_CONFIG = exports.DEFAULT_MAX_AGE_IN_MINUTES = void 0;
|
|
4
|
-
exports.DEFAULT_MAX_AGE_IN_MINUTES = 60;
|
|
5
|
-
exports.ATHENA_CONFIG = {
|
|
1
|
+
export const DEFAULT_MAX_AGE_IN_MINUTES = 60;
|
|
2
|
+
export const ATHENA_CONFIG = {
|
|
6
3
|
region: "eu-central-1",
|
|
7
4
|
};
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const athena_query_error_1 = require("./error/athena-query-error");
|
|
7
|
-
const cli_1 = require("../cli");
|
|
8
|
-
const safe_1 = require("../../helpers/safe");
|
|
9
|
-
class AthenaService {
|
|
1
|
+
import { GetQueryExecutionCommand, GetQueryResultsCommand, QueryExecutionState, StartQueryExecutionCommand, } from "@aws-sdk/client-athena";
|
|
2
|
+
import { DEFAULT_MAX_AGE_IN_MINUTES } from "./athena-service-model.js";
|
|
3
|
+
import { AthenaQueryError } from "./error/athena-query-error.js";
|
|
4
|
+
import { safe } from "../../helpers/safe.js";
|
|
5
|
+
export class AthenaService {
|
|
10
6
|
client;
|
|
11
7
|
cli;
|
|
12
8
|
constructor(client, cli) {
|
|
13
9
|
this.client = client;
|
|
14
10
|
this.cli = cli;
|
|
15
11
|
}
|
|
16
|
-
async getResult(query, parameters = [], maxAgeInMinutes =
|
|
17
|
-
this.cli.startAction("execute athena query");
|
|
12
|
+
async getResult(query, parameters = [], maxAgeInMinutes = DEFAULT_MAX_AGE_IN_MINUTES) {
|
|
13
|
+
this.cli.startAction("ATHENA:QUERY", "execute athena query");
|
|
18
14
|
const queryId = await this.runQuery(query, parameters, maxAgeInMinutes);
|
|
19
|
-
const result = await
|
|
15
|
+
const result = await safe(this.fetchResult(queryId));
|
|
20
16
|
if (result.success === true) {
|
|
21
|
-
this.cli.
|
|
17
|
+
this.cli.successAction("ATHENA:QUERY");
|
|
22
18
|
return result.data;
|
|
23
19
|
}
|
|
24
|
-
this.cli.
|
|
20
|
+
this.cli.failAction("ATHENA:QUERY");
|
|
25
21
|
this.cli.writeError(result.error);
|
|
26
22
|
return [];
|
|
27
23
|
}
|
|
@@ -50,7 +46,7 @@ class AthenaService {
|
|
|
50
46
|
do {
|
|
51
47
|
// Max Results can be set but if its not set,
|
|
52
48
|
// it will choose the maximum page size.
|
|
53
|
-
const command = new
|
|
49
|
+
const command = new GetQueryResultsCommand({
|
|
54
50
|
NextToken,
|
|
55
51
|
QueryExecutionId: queryId,
|
|
56
52
|
});
|
|
@@ -83,7 +79,7 @@ class AthenaService {
|
|
|
83
79
|
*/
|
|
84
80
|
async runQuery(sql, parameters, maxAgeInMinutes) {
|
|
85
81
|
const executionParameters = parameters.map((value) => typeof value === "string" ? `'${value}'` : String(value));
|
|
86
|
-
const command = new
|
|
82
|
+
const command = new StartQueryExecutionCommand({
|
|
87
83
|
ExecutionParameters: executionParameters.length > 0 ? executionParameters : null,
|
|
88
84
|
QueryExecutionContext: {
|
|
89
85
|
Catalog: "live",
|
|
@@ -107,18 +103,18 @@ class AthenaService {
|
|
|
107
103
|
}
|
|
108
104
|
async waitOnResponse(QueryExecutionId) {
|
|
109
105
|
for (;;) {
|
|
110
|
-
const command = new
|
|
106
|
+
const command = new GetQueryExecutionCommand({ QueryExecutionId });
|
|
111
107
|
const result = await this.client.send(command);
|
|
112
108
|
const status = result.QueryExecution.Status;
|
|
113
109
|
switch (status.State) {
|
|
114
|
-
case
|
|
115
|
-
throw new
|
|
110
|
+
case QueryExecutionState.FAILED: {
|
|
111
|
+
throw new AthenaQueryError("The Amazon Athena query failed to run with error message: " +
|
|
116
112
|
status.StateChangeReason);
|
|
117
113
|
}
|
|
118
|
-
case
|
|
119
|
-
throw new
|
|
114
|
+
case QueryExecutionState.CANCELLED: {
|
|
115
|
+
throw new AthenaQueryError("The Amazon Athena query was cancelled.");
|
|
120
116
|
}
|
|
121
|
-
case
|
|
117
|
+
case QueryExecutionState.SUCCEEDED: {
|
|
122
118
|
return;
|
|
123
119
|
}
|
|
124
120
|
default: {
|
|
@@ -129,4 +125,3 @@ class AthenaService {
|
|
|
129
125
|
}
|
|
130
126
|
}
|
|
131
127
|
}
|
|
132
|
-
exports.AthenaService = AthenaService;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.AthenaQueryError = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
-
class AthenaQueryError extends application_error_1.default {
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
|
+
export class AthenaQueryError extends ApplicationError {
|
|
7
3
|
code = "ATHENA_QUERY_FAILED";
|
|
8
4
|
}
|
|
9
|
-
exports.AthenaQueryError = AthenaQueryError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ApplicationError from "../../error-handling/error/application-error";
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
2
|
export declare class FetchCredentialsError extends ApplicationError {
|
|
3
3
|
readonly suggestions: string[];
|
|
4
4
|
readonly code = "AWS_ATHENA_NO_CREDENTIALS";
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.FetchCredentialsError = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
-
class FetchCredentialsError extends application_error_1.default {
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
|
+
export class FetchCredentialsError extends ApplicationError {
|
|
7
3
|
suggestions = [
|
|
8
4
|
"login to https://bbq.awsapps.com/start/#/ to gather credentials",
|
|
9
5
|
"or run: aws sso login",
|
|
@@ -11,4 +7,3 @@ class FetchCredentialsError extends application_error_1.default {
|
|
|
11
7
|
code = "AWS_ATHENA_NO_CREDENTIALS";
|
|
12
8
|
reference = "https://www.notion.so/baqend/AWS-Cli-SSO-login-f19af359eb514114aa6a36cd9b65e0c1";
|
|
13
9
|
}
|
|
14
|
-
exports.FetchCredentialsError = FetchCredentialsError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./athena-service";
|
|
2
|
-
export * from "./athena-service-factory";
|
|
3
|
-
export * from "./athena-service-model";
|
|
4
|
-
export * from "./error/fetch-credentials-error";
|
|
1
|
+
export * from "./athena-service.js";
|
|
2
|
+
export * from "./athena-service-factory.js";
|
|
3
|
+
export * from "./athena-service-model.js";
|
|
4
|
+
export * from "./error/fetch-credentials-error.js";
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
tslib_1.__exportStar(require("./athena-service-factory"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./athena-service-model"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./error/fetch-credentials-error"), exports);
|
|
1
|
+
export * from "./athena-service.js";
|
|
2
|
+
export * from "./athena-service-factory.js";
|
|
3
|
+
export * from "./athena-service-model.js";
|
|
4
|
+
export * from "./error/fetch-credentials-error.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { BundleService } from "./bundle-service.js";
|
|
2
|
+
export class BundleServiceFactory {
|
|
3
|
+
customerFolder;
|
|
4
|
+
constructor(customerFolder) {
|
|
5
|
+
this.customerFolder = customerFolder;
|
|
6
|
+
}
|
|
6
7
|
buildService() {
|
|
7
|
-
return new
|
|
8
|
+
return new BundleService(this.customerFolder);
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
|
-
exports.BundleServiceFactory = BundleServiceFactory;
|