@speedkit/cli 3.43.1 → 4.0.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/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 +7 -12
- 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
|
-
|
|
3
|
-
exports.VirtualFile = void 0;
|
|
4
|
-
const integration_api_model_1 = require("../integration-api-model");
|
|
5
|
-
class VirtualFile {
|
|
1
|
+
import { FILE_TYPE, } from "../integration-api-model.js";
|
|
2
|
+
export class VirtualFile {
|
|
6
3
|
name;
|
|
7
4
|
recipe;
|
|
8
5
|
skip = false;
|
|
9
6
|
updated = false;
|
|
10
7
|
content;
|
|
11
|
-
type =
|
|
8
|
+
type = FILE_TYPE.VIRTUAL_FILE;
|
|
12
9
|
constructor(name, recipe) {
|
|
13
10
|
this.name = name;
|
|
14
11
|
this.recipe = recipe;
|
|
@@ -26,4 +23,3 @@ class VirtualFile {
|
|
|
26
23
|
this.content = await this.recipe.createContent();
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
|
-
exports.VirtualFile = VirtualFile;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const origin_error_1 = tslib_1.__importDefault(require("../error/origin-error"));
|
|
5
|
-
class CustomerConfigValidator {
|
|
1
|
+
import OriginError from "../error/origin-error.js";
|
|
2
|
+
export default class CustomerConfigValidator {
|
|
6
3
|
validate(config) {
|
|
7
4
|
if (this.checkAppNameStartsWithNumber(config)) {
|
|
8
|
-
throw new
|
|
5
|
+
throw new OriginError("appName can't start with a number");
|
|
9
6
|
}
|
|
10
7
|
this.validateOrigins(config);
|
|
11
8
|
}
|
|
@@ -14,19 +11,19 @@ class CustomerConfigValidator {
|
|
|
14
11
|
}
|
|
15
12
|
validateOrigins(config) {
|
|
16
13
|
if (config.origins.length === 0) {
|
|
17
|
-
throw new
|
|
14
|
+
throw new OriginError("No origins were found in local config_customer.json! Add origins and restart deploy!");
|
|
18
15
|
}
|
|
19
16
|
if (this.hasProtocol(config.origins)) {
|
|
20
|
-
throw new
|
|
17
|
+
throw new OriginError("There was at least one origin configured in the local customer_config.js not having a protocol.");
|
|
21
18
|
}
|
|
22
19
|
if (this.checkIfDuplicateExists(config.origins)) {
|
|
23
|
-
throw new
|
|
20
|
+
throw new OriginError("Duplicate origins found! Remove duplicates and restart deploy!");
|
|
24
21
|
}
|
|
25
22
|
if (this.hasPathCheck(config.origins)) {
|
|
26
|
-
throw new
|
|
23
|
+
throw new OriginError("There was at least one origin having a path. Origin must have the following format: https://domain.tld");
|
|
27
24
|
}
|
|
28
25
|
if (this.containsWhiteSpace(config.origins)) {
|
|
29
|
-
throw new
|
|
26
|
+
throw new OriginError(`There was at least one origin having spaces. Origin must have the following format: "https://domain.tld" without spaces`);
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
29
|
checkIfDuplicateExists(origins) {
|
|
@@ -48,4 +45,3 @@ class CustomerConfigValidator {
|
|
|
48
45
|
});
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
|
-
exports.default = CustomerConfigValidator;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import FileList from "../file-list";
|
|
2
|
-
import { MandatoryFilesConfigInterface } from "../integration-api-model";
|
|
1
|
+
import FileList from "../file-list.js";
|
|
2
|
+
import { MandatoryFilesConfigInterface } from "../integration-api-model.js";
|
|
3
3
|
export default class MandatoryFilesValidator {
|
|
4
4
|
mandatoryFilesConfig: MandatoryFilesConfigInterface;
|
|
5
5
|
validate(files: FileList): void;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const mandatory_file_missing_error_1 = tslib_1.__importDefault(require("../error/mandatory-file-missing-error"));
|
|
5
|
-
class MandatoryFilesValidator {
|
|
1
|
+
import MandatoryFileMissingError from "../error/mandatory-file-missing-error.js";
|
|
2
|
+
export default class MandatoryFilesValidator {
|
|
6
3
|
mandatoryFilesConfig = {
|
|
7
4
|
required: ["config_customer", "config_SpeedKit"],
|
|
8
5
|
conditionallyRequired: {
|
|
@@ -17,7 +14,7 @@ class MandatoryFilesValidator {
|
|
|
17
14
|
validate(files) {
|
|
18
15
|
for (const fileName of this.mandatoryFilesConfig.required) {
|
|
19
16
|
if (!files.hasFile(fileName)) {
|
|
20
|
-
throw new
|
|
17
|
+
throw new MandatoryFileMissingError(`Mandatory file "${fileName}" is missing`, [`Add file ${fileName} to config`]);
|
|
21
18
|
}
|
|
22
19
|
}
|
|
23
20
|
this.validateConditionally(files);
|
|
@@ -37,7 +34,7 @@ class MandatoryFilesValidator {
|
|
|
37
34
|
}
|
|
38
35
|
}
|
|
39
36
|
if (!hasRequiredFiles && !hasConditionallyRequiredFiles) {
|
|
40
|
-
throw new
|
|
37
|
+
throw new MandatoryFileMissingError(`Mandatory files are missing`, [
|
|
41
38
|
`Implement ${this.mandatoryFilesConfig.conditionallyRequired.this.join(", ")}`,
|
|
42
39
|
"or",
|
|
43
40
|
`${this.mandatoryFilesConfig.conditionallyRequired.or.join(", ")}`,
|
|
@@ -45,4 +42,3 @@ class MandatoryFilesValidator {
|
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
44
|
}
|
|
48
|
-
exports.default = MandatoryFilesValidator;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExternalFileReader } from "../external/external-file-reader";
|
|
2
|
-
import { VirtualFileRecipe } from "../integration-api-model";
|
|
1
|
+
import { ExternalFileReader } from "../external/external-file-reader.js";
|
|
2
|
+
import { VirtualFileRecipe } from "../integration-api-model.js";
|
|
3
3
|
export declare class ExternalRecipe implements VirtualFileRecipe {
|
|
4
4
|
private filePath;
|
|
5
5
|
private externalFileReader;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExternalRecipe = void 0;
|
|
4
|
-
class ExternalRecipe {
|
|
1
|
+
export class ExternalRecipe {
|
|
5
2
|
filePath;
|
|
6
3
|
externalFileReader;
|
|
7
4
|
content;
|
|
@@ -17,4 +14,3 @@ class ExternalRecipe {
|
|
|
17
14
|
return this.content;
|
|
18
15
|
}
|
|
19
16
|
}
|
|
20
|
-
exports.ExternalRecipe = ExternalRecipe;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StaticRecipe = void 0;
|
|
4
|
-
class StaticRecipe {
|
|
1
|
+
export class StaticRecipe {
|
|
5
2
|
content;
|
|
6
3
|
constructor(content) {
|
|
7
4
|
this.content = content;
|
|
@@ -11,4 +8,3 @@ class StaticRecipe {
|
|
|
11
8
|
return this.content;
|
|
12
9
|
}
|
|
13
10
|
}
|
|
14
|
-
exports.StaticRecipe = StaticRecipe;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FileListInterface, VirtualFileConfig } from "../integration-api-model";
|
|
2
|
-
import { CliService } from "../../cli";
|
|
1
|
+
import { FileListInterface, VirtualFileConfig } from "../integration-api-model.js";
|
|
2
|
+
import { CliService } from "../../cli/index.js";
|
|
3
3
|
export declare class VirtualFileHandler {
|
|
4
4
|
private cli;
|
|
5
5
|
constructor(cli: CliService);
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const virtual_file_1 = require("../struct/virtual-file");
|
|
5
|
-
const cli_1 = require("../../cli");
|
|
6
|
-
const safe_1 = require("../../../helpers/safe");
|
|
7
|
-
class VirtualFileHandler {
|
|
1
|
+
import { VirtualFile } from "../struct/virtual-file.js";
|
|
2
|
+
import { safe } from "../../../helpers/safe.js";
|
|
3
|
+
export class VirtualFileHandler {
|
|
8
4
|
cli;
|
|
9
5
|
constructor(cli) {
|
|
10
6
|
this.cli = cli;
|
|
@@ -16,9 +12,9 @@ class VirtualFileHandler {
|
|
|
16
12
|
this.cli.write(`use localFile for ${fileName}`);
|
|
17
13
|
continue;
|
|
18
14
|
}
|
|
19
|
-
this.cli.startAction(`get content of virtualFile ${fileName}`);
|
|
20
|
-
const virtualFile = new
|
|
21
|
-
const result = await
|
|
15
|
+
this.cli.startAction(`DOCUMENTHANDLER:FETCH:FILE:${fileName}`, `get content of virtualFile ${fileName}`);
|
|
16
|
+
const virtualFile = new VirtualFile(fileName, fileConfig.recipe);
|
|
17
|
+
const result = await safe(virtualFile.buildContent());
|
|
22
18
|
if (result.success === true) {
|
|
23
19
|
if (fileList.hasFile(fileName) && fileConfig.overrideLocalFile) {
|
|
24
20
|
this.cli.write(`use virtualFile for ${fileName}`);
|
|
@@ -27,12 +23,11 @@ class VirtualFileHandler {
|
|
|
27
23
|
else {
|
|
28
24
|
fileList.addFile(virtualFile);
|
|
29
25
|
}
|
|
30
|
-
this.cli.
|
|
26
|
+
this.cli.successAction(`DOCUMENTHANDLER:FETCH:FILE:${fileName}`);
|
|
31
27
|
continue;
|
|
32
28
|
}
|
|
33
|
-
this.cli.
|
|
29
|
+
this.cli.failAction(`DOCUMENTHANDLER:FETCH:FILE:${fileName}`);
|
|
34
30
|
this.cli.writeError(result.error);
|
|
35
31
|
}
|
|
36
32
|
}
|
|
37
33
|
}
|
|
38
|
-
exports.VirtualFileHandler = VirtualFileHandler;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AbortResponse = void 0;
|
|
4
|
-
class AbortResponse {
|
|
1
|
+
export class AbortResponse {
|
|
5
2
|
errorReason;
|
|
6
3
|
constructor(errorReason = "Aborted") {
|
|
7
4
|
this.errorReason = errorReason;
|
|
8
5
|
}
|
|
9
6
|
}
|
|
10
|
-
exports.AbortResponse = AbortResponse;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaqendResponse = void 0;
|
|
4
1
|
const DEFAULT_HEADERS = [
|
|
5
2
|
{ name: "Date", value: new Date().toUTCString() },
|
|
6
3
|
{ name: "Content-Encoding", value: "identity" },
|
|
7
4
|
];
|
|
8
5
|
const DEFAULT_CONTENT_TYPE = "text/html; charset=utf-8";
|
|
9
6
|
const DEFAULT_STATUS = 200;
|
|
10
|
-
class BaqendResponse {
|
|
7
|
+
export class BaqendResponse {
|
|
11
8
|
requestId;
|
|
12
9
|
responseCode;
|
|
13
10
|
body;
|
|
@@ -68,4 +65,3 @@ class BaqendResponse {
|
|
|
68
65
|
return headers;
|
|
69
66
|
}
|
|
70
67
|
}
|
|
71
|
-
exports.BaqendResponse = BaqendResponse;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.BrowserConfig = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
6
|
-
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import fs from "node:fs";
|
|
7
3
|
const chromeProfilesParentFolder = "chrome_profile";
|
|
8
4
|
const keysToRemove = new Set([
|
|
9
5
|
"sessions",
|
|
@@ -18,7 +14,7 @@ const keysToRemove = new Set([
|
|
|
18
14
|
* this class makes sure you always start skOnboarding with a fresh browser,
|
|
19
15
|
* but still keep your window/devtools-configuration
|
|
20
16
|
*/
|
|
21
|
-
class BrowserConfig {
|
|
17
|
+
export class BrowserConfig {
|
|
22
18
|
userConfig;
|
|
23
19
|
constructor(userConfig) {
|
|
24
20
|
this.userConfig = userConfig;
|
|
@@ -29,14 +25,14 @@ class BrowserConfig {
|
|
|
29
25
|
* delete older profiles
|
|
30
26
|
*/
|
|
31
27
|
loadProfileTempDir() {
|
|
32
|
-
const chromeProfilePath =
|
|
33
|
-
const chromeProfilesParentFolderPath =
|
|
28
|
+
const chromeProfilePath = path.resolve(this.userConfig.tempFolder, chromeProfilesParentFolder, String(Date.now()));
|
|
29
|
+
const chromeProfilesParentFolderPath = path.resolve(this.userConfig.tempFolder, chromeProfilesParentFolder);
|
|
34
30
|
// create parentFolder if not exists
|
|
35
|
-
if (!
|
|
36
|
-
|
|
31
|
+
if (!fs.existsSync(chromeProfilesParentFolderPath)) {
|
|
32
|
+
fs.mkdirSync(chromeProfilesParentFolderPath, { recursive: true });
|
|
37
33
|
}
|
|
38
34
|
// load older profiles
|
|
39
|
-
const chromeProfileFolders =
|
|
35
|
+
const chromeProfileFolders = fs.readdirSync(chromeProfilesParentFolderPath);
|
|
40
36
|
if (!chromeProfileFolders || chromeProfileFolders.length === 0) {
|
|
41
37
|
return chromeProfilePath;
|
|
42
38
|
}
|
|
@@ -50,26 +46,26 @@ class BrowserConfig {
|
|
|
50
46
|
createProfileDirWithLatestConfig(sortedFolders, chromeTemporaryFolderPath, chromeProfilePath) {
|
|
51
47
|
let foundLatestFolder = false;
|
|
52
48
|
for (const folderName of sortedFolders) {
|
|
53
|
-
const preferencesPath =
|
|
49
|
+
const preferencesPath = path.resolve(chromeTemporaryFolderPath, folderName, "Default", "Preferences");
|
|
54
50
|
// look for chrome preferences in latest profileFolder
|
|
55
51
|
// delete folders not containing any profiles
|
|
56
52
|
// delete all older folders after we found latest profile
|
|
57
|
-
if (!
|
|
58
|
-
|
|
53
|
+
if (!fs.existsSync(preferencesPath) || foundLatestFolder) {
|
|
54
|
+
fs.rmSync(path.resolve(chromeTemporaryFolderPath, folderName), {
|
|
59
55
|
recursive: true,
|
|
60
56
|
force: true,
|
|
61
57
|
});
|
|
62
58
|
continue;
|
|
63
59
|
}
|
|
64
60
|
// return latest found config
|
|
65
|
-
const lastConfigString = this.cleanUpLastConfig(
|
|
66
|
-
|
|
61
|
+
const lastConfigString = this.cleanUpLastConfig(fs.readFileSync(preferencesPath, "utf8"));
|
|
62
|
+
fs.mkdirSync(path.resolve(chromeProfilePath, "Default"), {
|
|
67
63
|
recursive: true,
|
|
68
64
|
});
|
|
69
|
-
|
|
65
|
+
fs.writeFileSync(path.resolve(chromeProfilePath, "Default", "Preferences"), lastConfigString, { encoding: "utf-8" });
|
|
70
66
|
// after adding latest profile to new profile
|
|
71
67
|
// delete folder where we got the latest config from
|
|
72
|
-
|
|
68
|
+
fs.rmSync(path.resolve(chromeTemporaryFolderPath, folderName), {
|
|
73
69
|
recursive: true,
|
|
74
70
|
force: true,
|
|
75
71
|
});
|
|
@@ -99,4 +95,3 @@ class BrowserConfig {
|
|
|
99
95
|
return JSON.stringify(newConfig);
|
|
100
96
|
}
|
|
101
97
|
}
|
|
102
|
-
exports.BrowserConfig = BrowserConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UserCliConfig } from "../../../../helpers/cli-config";
|
|
2
|
-
import { CliServiceInterface } from "../../../cli";
|
|
1
|
+
import { UserCliConfig } from "../../../../helpers/cli-config.js";
|
|
2
|
+
import { CliServiceInterface } from "../../../cli/index.js";
|
|
3
3
|
export declare class ExecutableValidator {
|
|
4
4
|
readonly userConfig: UserCliConfig;
|
|
5
5
|
private cli;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExecutableValidator = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
1
|
// import CLI from puppeteer to use function as sames as `npx puppeteer browsers install`
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class ExecutableValidator {
|
|
2
|
+
import { CLI, Browser } from "@puppeteer/browsers";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import ApplicationError from "../../../error-handling/error/application-error.js";
|
|
5
|
+
import { Cache } from "@puppeteer/browsers";
|
|
6
|
+
import { resolve } from "node:path";
|
|
7
|
+
export class ExecutableValidator {
|
|
12
8
|
userConfig;
|
|
13
9
|
cli;
|
|
14
10
|
constructor(userConfig, cli) {
|
|
@@ -26,7 +22,7 @@ class ExecutableValidator {
|
|
|
26
22
|
this.cli.writeError(`Invalid "chromePath" configured: ${userChromePath}`);
|
|
27
23
|
}
|
|
28
24
|
// check if a browser is installed via puppeteer
|
|
29
|
-
const puppeteerCache = new
|
|
25
|
+
const puppeteerCache = new Cache(this.userConfig.tempFolder);
|
|
30
26
|
const installedBrowsers = puppeteerCache.getInstalledBrowsers();
|
|
31
27
|
if (installedBrowsers.length > 0) {
|
|
32
28
|
// found an installed browser, set path to this
|
|
@@ -41,7 +37,7 @@ class ExecutableValidator {
|
|
|
41
37
|
const result = await this.cli.confirm("Do you want to download Chrome@latest via puppeteer?", true);
|
|
42
38
|
// @todo set more detailed error message here.
|
|
43
39
|
if (!result) {
|
|
44
|
-
throw new
|
|
40
|
+
throw new ApplicationError("No Browser found to use", [
|
|
45
41
|
`set path to browser executable (chromePath) in ${this.userConfig.runtimeConfig.configDir}/config.json`,
|
|
46
42
|
`set path to browser executable (CHROME_PATH) in ./.env or as systemwide env`,
|
|
47
43
|
`let the ci download the latest chrome for you`,
|
|
@@ -63,16 +59,16 @@ class ExecutableValidator {
|
|
|
63
59
|
return this.cli.execSync(`"${this.userConfig.chromePath}" --version`);
|
|
64
60
|
}
|
|
65
61
|
getExecutablePathFromPuppeteer() {
|
|
66
|
-
const puppeteerCache = new
|
|
62
|
+
const puppeteerCache = new Cache(this.userConfig.tempFolder);
|
|
67
63
|
const installedBrowsers = puppeteerCache.getInstalledBrowsers();
|
|
68
64
|
return installedBrowsers[0].executablePath;
|
|
69
65
|
}
|
|
70
66
|
isValidBrowserExecutable() {
|
|
71
67
|
return (this.userConfig?.chromePath.length > 0 &&
|
|
72
|
-
|
|
68
|
+
existsSync(resolve(this.userConfig?.chromePath.trim())));
|
|
73
69
|
}
|
|
74
70
|
async installBrowser() {
|
|
75
|
-
const puppeteerCli = new
|
|
71
|
+
const puppeteerCli = new CLI({
|
|
76
72
|
cachePath: this.userConfig.tempFolder,
|
|
77
73
|
scriptName: "@puppeteer/browsers",
|
|
78
74
|
prefixCommand: {
|
|
@@ -81,7 +77,7 @@ class ExecutableValidator {
|
|
|
81
77
|
},
|
|
82
78
|
allowCachePathOverride: false,
|
|
83
79
|
pinnedBrowsers: {
|
|
84
|
-
[
|
|
80
|
+
[Browser.CHROME]: {
|
|
85
81
|
buildId: "stable",
|
|
86
82
|
skipDownload: false,
|
|
87
83
|
},
|
|
@@ -91,5 +87,4 @@ class ExecutableValidator {
|
|
|
91
87
|
await puppeteerCli.run(["", "", "browsers", "install"]);
|
|
92
88
|
}
|
|
93
89
|
}
|
|
94
|
-
exports.ExecutableValidator = ExecutableValidator;
|
|
95
90
|
//
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DevtoolsExtensionApi = void 0;
|
|
4
|
-
class DevtoolsExtensionApi {
|
|
1
|
+
export class DevtoolsExtensionApi {
|
|
5
2
|
messages = [];
|
|
6
3
|
getMessages() {
|
|
7
4
|
return this.messages;
|
|
@@ -13,4 +10,3 @@ class DevtoolsExtensionApi {
|
|
|
13
10
|
this.messages = [];
|
|
14
11
|
}
|
|
15
12
|
}
|
|
16
|
-
exports.DevtoolsExtensionApi = DevtoolsExtensionApi;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UserCliConfig } from "../../../../helpers/cli-config";
|
|
2
|
-
import { CliServiceInterface } from "../../../cli";
|
|
1
|
+
import { UserCliConfig } from "../../../../helpers/cli-config.js";
|
|
2
|
+
import { CliServiceInterface } from "../../../cli/index.js";
|
|
3
3
|
export declare class ExtensionDownloader {
|
|
4
4
|
private userConfig;
|
|
5
5
|
private cli;
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
8
|
-
const extract_zip_1 = tslib_1.__importDefault(require("extract-zip"));
|
|
9
|
-
const cli_1 = require("../../../cli");
|
|
10
|
-
const safe_1 = require("../../../../helpers/safe");
|
|
11
|
-
const validate_extension_error_1 = require("../../error/validate-extension-error");
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import semver from "semver";
|
|
4
|
+
import extract from "extract-zip";
|
|
5
|
+
import { safe } from "../../../../helpers/safe.js";
|
|
6
|
+
import { ValidateExtensionError } from "../../error/validate-extension-error.js";
|
|
12
7
|
const devtools = "integration-devtools";
|
|
13
|
-
class ExtensionDownloader {
|
|
8
|
+
export class ExtensionDownloader {
|
|
14
9
|
userConfig;
|
|
15
10
|
cli;
|
|
16
11
|
constructor(userConfig, cli) {
|
|
@@ -24,10 +19,10 @@ class ExtensionDownloader {
|
|
|
24
19
|
// check for updates
|
|
25
20
|
const remoteVersion = await this.getRemoteVersion();
|
|
26
21
|
const localVersion = await this.checkInstalledVersion();
|
|
27
|
-
if (
|
|
22
|
+
if (semver.compare(remoteVersion, localVersion) > 0) {
|
|
28
23
|
const response = await this.cli.confirm(`integration-devtools update available from ${localVersion} to ${remoteVersion} Install?`, true);
|
|
29
24
|
if (!response) {
|
|
30
|
-
throw new
|
|
25
|
+
throw new ValidateExtensionError(localVersion, remoteVersion);
|
|
31
26
|
}
|
|
32
27
|
}
|
|
33
28
|
}
|
|
@@ -37,14 +32,14 @@ class ExtensionDownloader {
|
|
|
37
32
|
return;
|
|
38
33
|
}
|
|
39
34
|
}
|
|
40
|
-
this.cli.startAction("update integration-devtools");
|
|
41
|
-
const response = await
|
|
35
|
+
this.cli.startAction("ONBOARDING:UPDATE:DEVTOOLS", "update integration-devtools");
|
|
36
|
+
const response = await safe(this.updateLocalDevtools());
|
|
42
37
|
if (response.success === false) {
|
|
43
|
-
this.cli.
|
|
38
|
+
this.cli.failAction("ONBOARDING:UPDATE:DEVTOOLS");
|
|
44
39
|
this.cli.writeError(response.error);
|
|
45
40
|
return;
|
|
46
41
|
}
|
|
47
|
-
this.cli.
|
|
42
|
+
this.cli.successAction("ONBOARDING:UPDATE:DEVTOOLS");
|
|
48
43
|
return response.data;
|
|
49
44
|
}
|
|
50
45
|
async updateLocalDevtools() {
|
|
@@ -53,28 +48,28 @@ class ExtensionDownloader {
|
|
|
53
48
|
// get fileName from header
|
|
54
49
|
const fileName = extensionResponse.headers.get("filename");
|
|
55
50
|
// resolve path for unpacked extension
|
|
56
|
-
const extensionUnpacked =
|
|
51
|
+
const extensionUnpacked = path.resolve(this.userConfig.tempFolder, devtools);
|
|
57
52
|
// resolve path for zipFile
|
|
58
|
-
const archivePath =
|
|
53
|
+
const archivePath = path.resolve(this.userConfig.tempFolder, fileName);
|
|
59
54
|
// getFileBlob
|
|
60
|
-
const extensionBlob = await extensionResponse.
|
|
55
|
+
const extensionBlob = await extensionResponse.bytes();
|
|
61
56
|
// write zipFile
|
|
62
|
-
|
|
57
|
+
fs.writeFileSync(archivePath, extensionBlob);
|
|
63
58
|
// cleanUp older versions
|
|
64
|
-
|
|
59
|
+
fs.rmSync(extensionUnpacked, { recursive: true, force: true });
|
|
65
60
|
// extract zipArchive
|
|
66
|
-
await (
|
|
61
|
+
await extract(archivePath, { dir: extensionUnpacked });
|
|
67
62
|
// remove zipArchive
|
|
68
|
-
|
|
63
|
+
fs.rmSync(archivePath);
|
|
69
64
|
return extensionUnpacked;
|
|
70
65
|
}
|
|
71
66
|
isInstalled() {
|
|
72
|
-
const extensionPath =
|
|
73
|
-
return
|
|
67
|
+
const extensionPath = path.resolve(this.userConfig.tempFolder, devtools, "manifest.json");
|
|
68
|
+
return fs.existsSync(extensionPath);
|
|
74
69
|
}
|
|
75
70
|
checkInstalledVersion() {
|
|
76
|
-
const extensionPath =
|
|
77
|
-
const manifestFile =
|
|
71
|
+
const extensionPath = path.resolve(this.userConfig.tempFolder, devtools, "manifest.json");
|
|
72
|
+
const manifestFile = fs.readFileSync(extensionPath, "utf-8");
|
|
78
73
|
const manifestConfig = JSON.parse(manifestFile);
|
|
79
74
|
return manifestConfig.version;
|
|
80
75
|
}
|
|
@@ -87,4 +82,3 @@ class ExtensionDownloader {
|
|
|
87
82
|
return response.version;
|
|
88
83
|
}
|
|
89
84
|
}
|
|
90
|
-
exports.ExtensionDownloader = ExtensionDownloader;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UserCliConfig } from "../../../../helpers/cli-config";
|
|
2
|
-
import { CliServiceInterface } from "../../../cli";
|
|
3
|
-
import { ExtensionDownloader } from "./extension-downloader";
|
|
1
|
+
import { UserCliConfig } from "../../../../helpers/cli-config.js";
|
|
2
|
+
import { CliServiceInterface } from "../../../cli/index.js";
|
|
3
|
+
import { ExtensionDownloader } from "./extension-downloader.js";
|
|
4
4
|
export declare class ExtensionValidator {
|
|
5
5
|
private extensionDownloader;
|
|
6
6
|
private cliConfig;
|