@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,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const cli_1 = require("../cli");
|
|
8
|
-
const safe_1 = require("../../helpers/safe");
|
|
9
|
-
const login_error_1 = require("../config-api/error/login-error");
|
|
10
|
-
class FetchEventHandler {
|
|
1
|
+
import { BROWSER_EVENTS, } from "./onboarding-model.js";
|
|
2
|
+
import { ProtocolError } from "puppeteer-core";
|
|
3
|
+
import { AbortResponse } from "./browser/abort-response.js";
|
|
4
|
+
import { safe } from "../../helpers/safe.js";
|
|
5
|
+
import { LoginError } from "../config-api/error/login-error.js";
|
|
6
|
+
export class FetchEventHandler {
|
|
11
7
|
browserFetchEvents;
|
|
12
8
|
customerConfig;
|
|
13
9
|
cli;
|
|
@@ -20,7 +16,7 @@ class FetchEventHandler {
|
|
|
20
16
|
}
|
|
21
17
|
async handleRequestFetchEvents(target) {
|
|
22
18
|
const cdpSession = await target.createCDPSession();
|
|
23
|
-
await
|
|
19
|
+
await safe(cdpSession.send("Fetch.enable", {
|
|
24
20
|
handleAuthRequests: true,
|
|
25
21
|
//see: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#type-RequestPattern
|
|
26
22
|
patterns: [
|
|
@@ -30,15 +26,15 @@ class FetchEventHandler {
|
|
|
30
26
|
...this.getAuthPattern(),
|
|
31
27
|
],
|
|
32
28
|
}));
|
|
33
|
-
cdpSession.on(
|
|
34
|
-
const response = await
|
|
29
|
+
cdpSession.on(BROWSER_EVENTS.FETCH_AUTH_REQUIRED, async (event) => {
|
|
30
|
+
const response = await safe(this.onFetchAuthRequired(event, cdpSession));
|
|
35
31
|
if (response.success === true) {
|
|
36
32
|
return response.data;
|
|
37
33
|
}
|
|
38
34
|
this.cli.writeError(response.error);
|
|
39
35
|
});
|
|
40
|
-
cdpSession.on(
|
|
41
|
-
const response = await
|
|
36
|
+
cdpSession.on(BROWSER_EVENTS.FETCH_REQUEST_PAUSED, async (event) => {
|
|
37
|
+
const response = await safe(this.onFetchRequestPaused(event, cdpSession));
|
|
42
38
|
if (response.success === true) {
|
|
43
39
|
return;
|
|
44
40
|
}
|
|
@@ -73,7 +69,7 @@ class FetchEventHandler {
|
|
|
73
69
|
if (!response) {
|
|
74
70
|
continue;
|
|
75
71
|
}
|
|
76
|
-
if (response instanceof
|
|
72
|
+
if (response instanceof AbortResponse) {
|
|
77
73
|
return cdpSession.send("Fetch.failRequest", {
|
|
78
74
|
requestId: requestId,
|
|
79
75
|
errorReason: response.errorReason,
|
|
@@ -111,8 +107,8 @@ class FetchEventHandler {
|
|
|
111
107
|
this.cli.writeWarning(`incorrect origin for auth request: -> ${this.customerConfig.origins.join("|")}`);
|
|
112
108
|
return { response: "Default" };
|
|
113
109
|
}
|
|
114
|
-
this.cli.startAction("wait for credentials from server-config");
|
|
115
|
-
const serverConfigResponse = await
|
|
110
|
+
this.cli.startAction("BROWSER:AUTHENTICATE", "wait for credentials from server-config");
|
|
111
|
+
const serverConfigResponse = await safe(this.client.getServerConfig());
|
|
116
112
|
if (serverConfigResponse.success === true) {
|
|
117
113
|
const config = JSON.parse(serverConfigResponse.data);
|
|
118
114
|
const authUrlOrigin = new URL(event.request.url).origin;
|
|
@@ -127,23 +123,22 @@ class FetchEventHandler {
|
|
|
127
123
|
password: auth.password,
|
|
128
124
|
},
|
|
129
125
|
});
|
|
130
|
-
this.cli.
|
|
126
|
+
this.cli.successAction("BROWSER:AUTHENTICATE");
|
|
131
127
|
this.cli.writeSuccess(`auth provided for ${event.request.url}`);
|
|
132
128
|
await this.sendDefaultAuthBehaviour(browserClient, event.requestId);
|
|
133
129
|
return;
|
|
134
130
|
}
|
|
135
131
|
}
|
|
136
|
-
this.cli.
|
|
137
|
-
this.cli.writeError(`error providing auth: no credentials found in runtimeConfig of app ${this.customerConfig.app}`);
|
|
132
|
+
this.cli.failAction("BROWSER:AUTHENTICATE", `error providing auth: no credentials found in runtimeConfig of app ${this.customerConfig.app}`);
|
|
138
133
|
await this.sendDefaultAuthBehaviour(browserClient, event.requestId);
|
|
139
134
|
return;
|
|
140
135
|
}
|
|
141
|
-
this.cli.
|
|
142
|
-
if (serverConfigResponse.errorObj instanceof
|
|
136
|
+
this.cli.failAction("BROWSER:AUTHENTICATE");
|
|
137
|
+
if (serverConfigResponse.errorObj instanceof ProtocolError) {
|
|
143
138
|
// unknown raceCondition where the authResponse is sent to fast
|
|
144
139
|
return;
|
|
145
140
|
}
|
|
146
|
-
if (serverConfigResponse.errorObj instanceof
|
|
141
|
+
if (serverConfigResponse.errorObj instanceof LoginError) {
|
|
147
142
|
this.cli.writeError(`could not login to app ${this.customerConfig.app} to gather credentials. Try run sk login`);
|
|
148
143
|
await this.sendDefaultAuthBehaviour(browserClient, event.requestId);
|
|
149
144
|
return;
|
|
@@ -160,4 +155,3 @@ class FetchEventHandler {
|
|
|
160
155
|
});
|
|
161
156
|
}
|
|
162
157
|
}
|
|
163
|
-
exports.FetchEventHandler = FetchEventHandler;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Protocol from "devtools-protocol";
|
|
2
|
-
import { FetchRequestPausedEventHandler } from "../onboarding-model";
|
|
3
|
-
import { CustomerConfig, ConfigFileInterface } from "../../integration-api";
|
|
1
|
+
import { Protocol } from "devtools-protocol";
|
|
2
|
+
import { FetchRequestPausedEventHandler } from "../onboarding-model.js";
|
|
3
|
+
import { CustomerConfig, ConfigFileInterface } from "../../integration-api/index.js";
|
|
4
4
|
import { CDPSession } from "puppeteer";
|
|
5
5
|
/**
|
|
6
6
|
* Intercepts any request to the customersOrigin and equivalent requests to baqendAssetApi
|
|
@@ -13,7 +13,7 @@ export declare class CustomerDomainDocumentResponse implements FetchRequestPause
|
|
|
13
13
|
private removeContentSecurityPolicy;
|
|
14
14
|
get patterns(): Protocol.Fetch.RequestPattern[];
|
|
15
15
|
constructor(customerConfig: CustomerConfig, configDynamicBlock: ConfigFileInterface, configDynamicStyles: ConfigFileInterface, removeContentSecurityPolicy: boolean);
|
|
16
|
-
handle(event: Protocol.Fetch.RequestPausedEvent, client: CDPSession): Promise<Partial<Protocol.Fetch.FulfillRequestRequest> |
|
|
16
|
+
handle(event: Protocol.Fetch.RequestPausedEvent, client: CDPSession): Promise<Partial<Protocol.Fetch.FulfillRequestRequest> | null>;
|
|
17
17
|
private isValidHtmlContent;
|
|
18
18
|
private isValidResponse;
|
|
19
19
|
private isHtmlContentHeader;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const origin_response_1 = require("../browser/origin-response");
|
|
7
|
-
const iconv_lite_1 = tslib_1.__importDefault(require("iconv-lite"));
|
|
8
|
-
const encoding_japanese_1 = tslib_1.__importDefault(require("encoding-japanese"));
|
|
9
|
-
const unsupported_encoding_error_1 = require("../error/unsupported-encoding-error");
|
|
1
|
+
import { META_CONTENT_TYPE_REGEX, SpeedKitInstallRegex, } from "../onboarding-model.js";
|
|
2
|
+
import { OriginResponse } from "../browser/origin-response.js";
|
|
3
|
+
import iconv from "iconv-lite";
|
|
4
|
+
import Encoding from "encoding-japanese";
|
|
5
|
+
import { UnsupportedEncodingError } from "../error/unsupported-encoding-error.js";
|
|
10
6
|
/**
|
|
11
7
|
* Intercepts any request to the customersOrigin and equivalent requests to baqendAssetApi
|
|
12
8
|
* @implements {FetchRequestPausedEventHandler}
|
|
13
9
|
*/
|
|
14
|
-
class CustomerDomainDocumentResponse {
|
|
10
|
+
export class CustomerDomainDocumentResponse {
|
|
15
11
|
customerConfig;
|
|
16
12
|
configDynamicBlock;
|
|
17
13
|
configDynamicStyles;
|
|
@@ -86,8 +82,8 @@ class CustomerDomainDocumentResponse {
|
|
|
86
82
|
detectedEncoding = header.value;
|
|
87
83
|
}
|
|
88
84
|
}
|
|
89
|
-
const encodedContent =
|
|
90
|
-
return new
|
|
85
|
+
const encodedContent = iconv.encode(content, detectedEncoding);
|
|
86
|
+
return new OriginResponse(encodedContent, headers, event.responseStatusCode);
|
|
91
87
|
}
|
|
92
88
|
isValidHtmlContent(text) {
|
|
93
89
|
return text.includes("<html");
|
|
@@ -118,11 +114,11 @@ class CustomerDomainDocumentResponse {
|
|
|
118
114
|
// create text from base64Encoded
|
|
119
115
|
if (base64Encoded) {
|
|
120
116
|
const buffer = Buffer.from(body, "base64");
|
|
121
|
-
const encodingFromBuffer =
|
|
122
|
-
const encodedBody =
|
|
117
|
+
const encodingFromBuffer = Encoding.detect(buffer);
|
|
118
|
+
const encodedBody = iconv
|
|
123
119
|
.decode(buffer, encodingFromHeader ?? "utf-8")
|
|
124
120
|
.toString();
|
|
125
|
-
const metaSelector =
|
|
121
|
+
const metaSelector = META_CONTENT_TYPE_REGEX;
|
|
126
122
|
const encodingFromBodyMeta = metaSelector.test(encodedBody)
|
|
127
123
|
? metaSelector.exec(encodedBody)[1]
|
|
128
124
|
: "";
|
|
@@ -130,14 +126,14 @@ class CustomerDomainDocumentResponse {
|
|
|
130
126
|
encodingFromBodyMeta ||
|
|
131
127
|
encodingFromBuffer ||
|
|
132
128
|
"utf-8";
|
|
133
|
-
if (!
|
|
134
|
-
throw new
|
|
129
|
+
if (!iconv.encodingExists(detectedEncoding)) {
|
|
130
|
+
throw new UnsupportedEncodingError(`encoding is not supported by cli: "${detectedEncoding}"`);
|
|
135
131
|
}
|
|
136
132
|
event.responseHeaders.push({
|
|
137
133
|
name: "x-sk-detected-encoding",
|
|
138
134
|
value: detectedEncoding,
|
|
139
135
|
});
|
|
140
|
-
return
|
|
136
|
+
return iconv.decode(buffer, detectedEncoding);
|
|
141
137
|
}
|
|
142
138
|
return body;
|
|
143
139
|
}
|
|
@@ -145,7 +141,7 @@ class CustomerDomainDocumentResponse {
|
|
|
145
141
|
return text.includes("speed-kit-dynamic");
|
|
146
142
|
}
|
|
147
143
|
rewriteInstallResource(text) {
|
|
148
|
-
text = text.replace(
|
|
144
|
+
text = text.replace(SpeedKitInstallRegex, "");
|
|
149
145
|
const matchOpeningHead = /<\s*head\b[^>]*>/;
|
|
150
146
|
const matchClosingHead = /<\/\s*head\s*>/;
|
|
151
147
|
if (matchOpeningHead.test(text)) {
|
|
@@ -191,4 +187,3 @@ class CustomerDomainDocumentResponse {
|
|
|
191
187
|
return htmlContent.replace(/<meta[^>]*http-equiv=["']content-security-policy[^>]*>/is, "");
|
|
192
188
|
}
|
|
193
189
|
}
|
|
194
|
-
exports.CustomerDomainDocumentResponse = CustomerDomainDocumentResponse;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Protocol from "devtools-protocol";
|
|
2
|
-
import { FetchRequestPausedEventHandler } from "../onboarding-model";
|
|
3
|
-
import { CustomerConfig } from "../../integration-api";
|
|
1
|
+
import { Protocol } from "devtools-protocol";
|
|
2
|
+
import { FetchRequestPausedEventHandler } from "../onboarding-model.js";
|
|
3
|
+
import { CustomerConfig } from "../../integration-api/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Intercepts request to /wrapper-sw.js
|
|
6
6
|
*
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CustomerServiceWorkerJs = void 0;
|
|
4
|
-
const baqend_response_1 = require("../browser/baqend-response");
|
|
1
|
+
import { BaqendResponse } from "../browser/baqend-response.js";
|
|
5
2
|
/**
|
|
6
3
|
* Intercepts request to /wrapper-sw.js
|
|
7
4
|
*
|
|
8
5
|
* @implements {FetchRequestPausedEventHandler}
|
|
9
6
|
*/
|
|
10
|
-
class CustomerServiceWorkerJs {
|
|
7
|
+
export class CustomerServiceWorkerJs {
|
|
11
8
|
customerConfig;
|
|
12
9
|
get patterns() {
|
|
13
10
|
const result = [];
|
|
@@ -27,10 +24,9 @@ class CustomerServiceWorkerJs {
|
|
|
27
24
|
// service worker on that scope — serve an empty script instead of the
|
|
28
25
|
// skonboarding wrapper that imports Speed Kit's sw.js.
|
|
29
26
|
if (new URL(event.request.url).searchParams.get("empty") === "1") {
|
|
30
|
-
return new
|
|
27
|
+
return new BaqendResponse("// skonboarding empty sw", "text/javascript; charset=utf-8");
|
|
31
28
|
}
|
|
32
29
|
const wrapperSwCode = `importScripts(\`https://${this.customerConfig.appDomain}/v1/speedkit/sw.js\${location.search}\`); // skonboarding`;
|
|
33
|
-
return new
|
|
30
|
+
return new BaqendResponse(wrapperSwCode, "text/javascript; charset=utf-8");
|
|
34
31
|
}
|
|
35
32
|
}
|
|
36
|
-
exports.CustomerServiceWorkerJs = CustomerServiceWorkerJs;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Protocol from "devtools-protocol";
|
|
2
|
-
import { FetchRequestPausedEventHandler } from "../onboarding-model";
|
|
3
|
-
import { Dashboard } from "../dashboard";
|
|
1
|
+
import { Protocol } from "devtools-protocol";
|
|
2
|
+
import { FetchRequestPausedEventHandler } from "../onboarding-model.js";
|
|
3
|
+
import { Dashboard } from "../dashboard/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* The DashboardRequest class represents a request handler for the dashboard.
|
|
6
6
|
* Handle all the requests on the secondTab(http://skonboarding.local)
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DashboardRequest = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* The DashboardRequest class represents a request handler for the dashboard.
|
|
6
3
|
* Handle all the requests on the secondTab(http://skonboarding.local)
|
|
7
4
|
*
|
|
8
5
|
* @implements {FetchRequestPausedEventHandler}
|
|
9
6
|
*/
|
|
10
|
-
class DashboardRequest {
|
|
7
|
+
export class DashboardRequest {
|
|
11
8
|
dashboard;
|
|
12
9
|
patterns = [
|
|
13
10
|
{
|
|
@@ -26,4 +23,3 @@ class DashboardRequest {
|
|
|
26
23
|
return this.dashboard.getResponse(event.request);
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
|
-
exports.DashboardRequest = DashboardRequest;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Protocol from "devtools-protocol";
|
|
2
|
-
import { FetchRequestPausedEventHandler } from "../onboarding-model";
|
|
3
|
-
import { CustomerConfig } from "../../integration-api";
|
|
4
|
-
import { AbortResponse } from "../browser/abort-response";
|
|
5
|
-
import { VirtualOrestesApp } from "../virtual-orestes-app";
|
|
1
|
+
import { Protocol } from "devtools-protocol";
|
|
2
|
+
import { FetchRequestPausedEventHandler } from "../onboarding-model.js";
|
|
3
|
+
import { CustomerConfig } from "../../integration-api/index.js";
|
|
4
|
+
import { AbortResponse } from "../browser/abort-response.js";
|
|
5
|
+
import { VirtualOrestesApp } from "../virtual-orestes-app/index.js";
|
|
6
6
|
/**
|
|
7
7
|
* Handles fetch requests for Speed Kit assets and returns customized responses.
|
|
8
8
|
*/
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SpeedKitAssetRequest = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Handles fetch requests for Speed Kit assets and returns customized responses.
|
|
6
3
|
*/
|
|
7
|
-
class SpeedKitAssetRequest {
|
|
4
|
+
export class SpeedKitAssetRequest {
|
|
8
5
|
customerConfig;
|
|
9
6
|
virtualOrestesApp;
|
|
10
7
|
get patterns() {
|
|
@@ -34,4 +31,3 @@ class SpeedKitAssetRequest {
|
|
|
34
31
|
return this.virtualOrestesApp.fetchAssetResponse(event);
|
|
35
32
|
}
|
|
36
33
|
}
|
|
37
|
-
exports.SpeedKitAssetRequest = SpeedKitAssetRequest;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Protocol from "devtools-protocol";
|
|
2
|
-
import { BrowserContext, FetchRequestPausedEventHandler } from "../onboarding-model";
|
|
3
|
-
import { CustomerConfig } from "../../integration-api";
|
|
4
|
-
import { InstallSpeedKitHtmlTemplate } from "../templates/install-speed-kit-html-template";
|
|
1
|
+
import { Protocol } from "devtools-protocol";
|
|
2
|
+
import { BrowserContext, FetchRequestPausedEventHandler } from "../onboarding-model.js";
|
|
3
|
+
import { CustomerConfig } from "../../integration-api/index.js";
|
|
4
|
+
import { InstallSpeedKitHtmlTemplate } from "../templates/install-speed-kit-html-template.js";
|
|
5
5
|
/**
|
|
6
6
|
* Represents a class that handles the installation of Speed Kit HTML.
|
|
7
7
|
*/
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SpeedKitInstallHtml = void 0;
|
|
4
|
-
const baqend_response_1 = require("../browser/baqend-response");
|
|
1
|
+
import { BaqendResponse } from "../browser/baqend-response.js";
|
|
5
2
|
/**
|
|
6
3
|
* Represents a class that handles the installation of Speed Kit HTML.
|
|
7
4
|
*/
|
|
8
|
-
class SpeedKitInstallHtml {
|
|
5
|
+
export class SpeedKitInstallHtml {
|
|
9
6
|
customerConfig;
|
|
10
7
|
browserContext;
|
|
11
8
|
speedKitInstallHtmlTemplate;
|
|
@@ -39,11 +36,10 @@ class SpeedKitInstallHtml {
|
|
|
39
36
|
this.speedKitInstallHtmlTemplate = speedKitInstallHtmlTemplate;
|
|
40
37
|
}
|
|
41
38
|
async handle() {
|
|
42
|
-
return new
|
|
39
|
+
return new BaqendResponse(this.speedKitInstallHtmlTemplate.render({
|
|
43
40
|
installPath: this.customerConfig.installPath,
|
|
44
41
|
domain: this.browserContext.domain,
|
|
45
42
|
swPath: this.customerConfig.swPath,
|
|
46
43
|
}));
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
|
-
exports.SpeedKitInstallHtml = SpeedKitInstallHtml;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Protocol from "devtools-protocol";
|
|
1
|
+
import { Protocol } from "devtools-protocol";
|
|
2
2
|
import { CDPSession } from "puppeteer";
|
|
3
|
-
import { CustomerConfig, VirtualFile } from "../../integration-api";
|
|
4
|
-
import { AbortResponse } from "../browser/abort-response";
|
|
5
|
-
import { FetchRequestPausedEventHandler } from "../onboarding-model";
|
|
3
|
+
import { CustomerConfig, VirtualFile } from "../../integration-api/index.js";
|
|
4
|
+
import { AbortResponse } from "../browser/abort-response.js";
|
|
5
|
+
import { FetchRequestPausedEventHandler } from "../onboarding-model.js";
|
|
6
6
|
/**
|
|
7
7
|
* Intercepts the response for speedkit-install.js
|
|
8
8
|
* Returns a custom build install.js from local-files
|
|
@@ -14,7 +14,7 @@ export declare class SpeedKitInstallJs implements FetchRequestPausedEventHandler
|
|
|
14
14
|
private installResource;
|
|
15
15
|
readonly patterns: Protocol.Fetch.RequestPattern[];
|
|
16
16
|
constructor(customerConfig: CustomerConfig, installResource: VirtualFile);
|
|
17
|
-
handle(event: Protocol.Fetch.RequestPausedEvent, client: CDPSession): Promise<AbortResponse | Partial<Protocol.Fetch.FulfillRequestRequest> |
|
|
17
|
+
handle(event: Protocol.Fetch.RequestPausedEvent, client: CDPSession): Promise<AbortResponse | Partial<Protocol.Fetch.FulfillRequestRequest> | null>;
|
|
18
18
|
/**
|
|
19
19
|
* fetch remote installResource
|
|
20
20
|
* extract all params from serviceWorkerUrl
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const abort_response_1 = require("../browser/abort-response");
|
|
5
|
-
const baqend_response_1 = require("../browser/baqend-response");
|
|
6
|
-
const safe_1 = require("../../../helpers/safe");
|
|
1
|
+
import { AbortResponse } from "../browser/abort-response.js";
|
|
2
|
+
import { BaqendResponse } from "../browser/baqend-response.js";
|
|
3
|
+
import { safe } from "../../../helpers/safe.js";
|
|
7
4
|
/**
|
|
8
5
|
* Intercepts the response for speedkit-install.js
|
|
9
6
|
* Returns a custom build install.js from local-files
|
|
10
7
|
*
|
|
11
8
|
* @implements FetchRequestPausedEventHandler
|
|
12
9
|
*/
|
|
13
|
-
class SpeedKitInstallJs {
|
|
10
|
+
export class SpeedKitInstallJs {
|
|
14
11
|
customerConfig;
|
|
15
12
|
installResource;
|
|
16
13
|
patterns;
|
|
@@ -27,7 +24,7 @@ class SpeedKitInstallJs {
|
|
|
27
24
|
async handle(event, client) {
|
|
28
25
|
if (!event.request.url.includes(this.customerConfig.appDomain)) {
|
|
29
26
|
console.log("abort:", event.request.url);
|
|
30
|
-
return new
|
|
27
|
+
return new AbortResponse("Aborted");
|
|
31
28
|
}
|
|
32
29
|
if (!this.isValidResponse(event)) {
|
|
33
30
|
return;
|
|
@@ -41,7 +38,7 @@ class SpeedKitInstallJs {
|
|
|
41
38
|
return matched.replace(selected, selected + configVersion);
|
|
42
39
|
});
|
|
43
40
|
}
|
|
44
|
-
return new
|
|
41
|
+
return new BaqendResponse(installJs, "text/javascript; charset=utf-8", event.responseHeaders);
|
|
45
42
|
}
|
|
46
43
|
/**
|
|
47
44
|
* fetch remote installResource
|
|
@@ -49,7 +46,7 @@ class SpeedKitInstallJs {
|
|
|
49
46
|
* exampleEntry: `sw: "/wrapper-sw.js?r=365858ef-fce3-4c28-bdd1-805970d21a60&v=2.17.8"`
|
|
50
47
|
*/
|
|
51
48
|
async extractConfigVersion(client, event) {
|
|
52
|
-
const originBodyResponse = await
|
|
49
|
+
const originBodyResponse = await safe(this.getContent(client, event));
|
|
53
50
|
if (originBodyResponse.success !== true) {
|
|
54
51
|
console.error(`could not fetch install resource: "${event.request.url}"`, originBodyResponse.error);
|
|
55
52
|
return;
|
|
@@ -73,4 +70,3 @@ class SpeedKitInstallJs {
|
|
|
73
70
|
event.responseStatusCode < 300);
|
|
74
71
|
}
|
|
75
72
|
}
|
|
76
|
-
exports.SpeedKitInstallJs = SpeedKitInstallJs;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CDPSession } from "puppeteer";
|
|
2
2
|
import { Protocol } from "puppeteer-core";
|
|
3
|
-
import { CliService } from "../../cli";
|
|
4
|
-
import { CustomerConfig } from "../../integration-api";
|
|
5
|
-
import { AbortResponse } from "../browser/abort-response";
|
|
6
|
-
import { FetchRequestPausedEventHandler } from "../onboarding-model";
|
|
7
|
-
import { Cache } from "../request-cache/cache";
|
|
3
|
+
import { CliService } from "../../cli/index.js";
|
|
4
|
+
import { CustomerConfig } from "../../integration-api/index.js";
|
|
5
|
+
import { AbortResponse } from "../browser/abort-response.js";
|
|
6
|
+
import { FetchRequestPausedEventHandler } from "../onboarding-model.js";
|
|
7
|
+
import { Cache } from "../request-cache/cache.js";
|
|
8
8
|
/**
|
|
9
9
|
* Intercepts v1/rum/pi requests,
|
|
10
10
|
* if request contains changeDetection, clear dh-cache for respective url
|
|
@@ -17,5 +17,5 @@ export declare class SpeedKitRumPiRequest implements FetchRequestPausedEventHand
|
|
|
17
17
|
private cli;
|
|
18
18
|
readonly patterns: Protocol.Fetch.RequestPattern[];
|
|
19
19
|
constructor(customerConfig: CustomerConfig, cache: Cache, cli: CliService);
|
|
20
|
-
handle(event: Protocol.Fetch.RequestPausedEvent, _: CDPSession): Promise<AbortResponse | Partial<Protocol.Fetch.FulfillRequestRequest> |
|
|
20
|
+
handle(event: Protocol.Fetch.RequestPausedEvent, _: CDPSession): Promise<AbortResponse | Partial<Protocol.Fetch.FulfillRequestRequest> | null>;
|
|
21
21
|
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SpeedKitRumPiRequest = void 0;
|
|
4
|
-
const safe_1 = require("../../../helpers/safe");
|
|
1
|
+
import { safe } from "../../../helpers/safe.js";
|
|
5
2
|
/**
|
|
6
3
|
* Intercepts v1/rum/pi requests,
|
|
7
4
|
* if request contains changeDetection, clear dh-cache for respective url
|
|
8
5
|
*
|
|
9
6
|
* @implements FetchRequestPausedEventHandler
|
|
10
7
|
*/
|
|
11
|
-
class SpeedKitRumPiRequest {
|
|
8
|
+
export class SpeedKitRumPiRequest {
|
|
12
9
|
customerConfig;
|
|
13
10
|
cache;
|
|
14
11
|
cli;
|
|
@@ -28,16 +25,15 @@ class SpeedKitRumPiRequest {
|
|
|
28
25
|
if (!event.request.hasPostData) {
|
|
29
26
|
return;
|
|
30
27
|
}
|
|
31
|
-
const result =
|
|
28
|
+
const result = safe(() => JSON.parse(event.request.postData));
|
|
32
29
|
if (result.success === false) {
|
|
33
30
|
return;
|
|
34
31
|
}
|
|
35
32
|
if (!("changeDetection" in result.data)) {
|
|
36
33
|
return;
|
|
37
34
|
}
|
|
38
|
-
const changeDetection =
|
|
35
|
+
const changeDetection = result.data.changeDetection;
|
|
39
36
|
this.cache.removeEntry(changeDetection.url);
|
|
40
37
|
this.cli.write(`changeDetection triggered for url: ${changeDetection.url} - cleared from dh-cache`);
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
|
-
exports.SpeedKitRumPiRequest = SpeedKitRumPiRequest;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Protocol from "devtools-protocol";
|
|
2
|
-
import { CustomerConfig, FileInterface } from "../../integration-api";
|
|
3
|
-
import { FetchRequestPausedEventHandler } from "../onboarding-model";
|
|
1
|
+
import { Protocol } from "devtools-protocol";
|
|
2
|
+
import { CustomerConfig, FileInterface } from "../../integration-api/index.js";
|
|
3
|
+
import { FetchRequestPausedEventHandler } from "../onboarding-model.js";
|
|
4
4
|
/**
|
|
5
5
|
* SpeedKitServiceWorkerJs class is responsible for handling fetch requests for the SpeedKit service worker.
|
|
6
6
|
* Injects serviceWorker from local file, if custom_sw is present.
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SpeedKitServiceWorkerJs = void 0;
|
|
4
|
-
const baqend_response_1 = require("../browser/baqend-response");
|
|
1
|
+
import { BaqendResponse } from "../browser/baqend-response.js";
|
|
5
2
|
/**
|
|
6
3
|
* SpeedKitServiceWorkerJs class is responsible for handling fetch requests for the SpeedKit service worker.
|
|
7
4
|
* Injects serviceWorker from local file, if custom_sw is present.
|
|
8
5
|
*
|
|
9
6
|
* @implements FetchRequestPausedEventHandler
|
|
10
7
|
*/
|
|
11
|
-
class SpeedKitServiceWorkerJs {
|
|
8
|
+
export class SpeedKitServiceWorkerJs {
|
|
12
9
|
customerConfig;
|
|
13
10
|
serviceWorker;
|
|
14
11
|
patterns;
|
|
@@ -23,7 +20,6 @@ class SpeedKitServiceWorkerJs {
|
|
|
23
20
|
];
|
|
24
21
|
}
|
|
25
22
|
async handle() {
|
|
26
|
-
return new
|
|
23
|
+
return new BaqendResponse(this.serviceWorker.getContent(), "text/javascript; charset=utf-8");
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
|
-
exports.SpeedKitServiceWorkerJs = SpeedKitServiceWorkerJs;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CliService } from "../../cli";
|
|
1
|
+
import { CliService } from "../../cli/index.js";
|
|
2
2
|
import { Page } from "puppeteer";
|
|
3
|
-
import { DocumentHandlerServer } from "../../document-handler-runtime/document-handler-server";
|
|
4
|
-
import { Cache } from "../request-cache/cache";
|
|
5
|
-
import { ConfigFileInterface, CustomerConfig, FileListInterface } from "../../integration-api";
|
|
6
|
-
import { BrowserContext } from "../onboarding-model";
|
|
3
|
+
import { DocumentHandlerServer } from "../../document-handler-runtime/document-handler-server.js";
|
|
4
|
+
import { Cache } from "../request-cache/cache.js";
|
|
5
|
+
import { ConfigFileInterface, CustomerConfig, FileListInterface } from "../../integration-api/index.js";
|
|
6
|
+
import { BrowserContext } from "../onboarding-model.js";
|
|
7
7
|
/**
|
|
8
8
|
* Add different callbacks that will be executed if a local file is changed.
|
|
9
9
|
*/
|