@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,51 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const onboarding_service_1 = require("./onboarding-service");
|
|
30
|
-
const cache_1 = require("./request-cache/cache");
|
|
31
|
-
const install_speed_kit_html_template_1 = require("./templates/install-speed-kit-html-template");
|
|
32
|
-
const install_speed_kit_js_template_1 = require("./templates/install-speed-kit-js-template");
|
|
1
|
+
import { safe } from "../../helpers/safe.js";
|
|
2
|
+
import { INTEGRATION_FILES } from "../../models/files.js";
|
|
3
|
+
import { AthenaServiceFactory } from "../athena/index.js";
|
|
4
|
+
import { BundleServiceFactory } from "../bundler/index.js";
|
|
5
|
+
import { CliServiceFactory } from "../cli/index.js";
|
|
6
|
+
import { DiffContext, DiffServiceFactory } from "../diff/index.js";
|
|
7
|
+
import DocumentHandlerRuntimeServiceFactory from "../document-handler-runtime/factory/document-handler-runtime-service-factory.js";
|
|
8
|
+
import { ExternalFileReader, IntegrationApiContext, VirtualFile, ExternalRecipe, IntegrationApiFactory, } from "../integration-api/index.js";
|
|
9
|
+
import { InstallFileRecipe } from "./config-renderer/install-file-recipe.js";
|
|
10
|
+
import { SpeedKitInstallContext } from "./config-renderer/speed-kit-install-context.js";
|
|
11
|
+
import { Dashboard } from "./dashboard/index.js";
|
|
12
|
+
import { ParameterQueryBuilder } from "./dashboard/parameter-query-builder.js";
|
|
13
|
+
import { RequestDiffService } from "./dashboard/request-diff-service.js";
|
|
14
|
+
import { FetchEventHandler } from "./fetch-event-handler.js";
|
|
15
|
+
import { CustomerDomainDocumentResponse } from "./fetch-events/customer-domain-document-response.js";
|
|
16
|
+
import { CustomerServiceWorkerJs } from "./fetch-events/customer-service-worker-js.js";
|
|
17
|
+
import { DashboardRequest } from "./fetch-events/dashboard-request.js";
|
|
18
|
+
import { SpeedKitAssetRequest } from "./fetch-events/speed-kit-asset-request.js";
|
|
19
|
+
import { SpeedKitInstallHtml } from "./fetch-events/speed-kit-install-html.js";
|
|
20
|
+
import { SpeedKitInstallJs } from "./fetch-events/speed-kit-install-js.js";
|
|
21
|
+
import { SpeedKitRumPiRequest } from "./fetch-events/speed-kit-rum-pi-request.js";
|
|
22
|
+
import { SpeedKitServiceWorkerJs } from "./fetch-events/speed-kit-service-worker-js.js";
|
|
23
|
+
import { FileWatcher } from "./file-events/file-watcher.js";
|
|
24
|
+
import { BrowserContext, } from "./onboarding-model.js";
|
|
25
|
+
import { OnboardingService } from "./onboarding-service.js";
|
|
26
|
+
import { Cache } from "./request-cache/cache.js";
|
|
27
|
+
import { InstallSpeedKitHtmlTemplate } from "./templates/install-speed-kit-html-template.js";
|
|
28
|
+
import { InstallSpeedKitJsTemplate } from "./templates/install-speed-kit-js-template.js";
|
|
33
29
|
// import { TodoCollector } from "./todo-collector";
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
class OnboardingServiceFactory {
|
|
30
|
+
import { ExtensionValidator } from "./browser/extension/extension-validator.js";
|
|
31
|
+
import { DevtoolsExtensionApi } from "./browser/extension/devtools-extension-api.js";
|
|
32
|
+
import { TodoCollector } from "./todo-collector.js";
|
|
33
|
+
import { Crawler } from "./virtual-orestes-app/crawler.js";
|
|
34
|
+
import { VirtualOrestesApp } from "./virtual-orestes-app/index.js";
|
|
35
|
+
import { ConfigApiContext, ConfigApiServiceFactory, } from "../config-api/index.js";
|
|
36
|
+
import * as fs from "node:fs";
|
|
37
|
+
import * as path from "node:path";
|
|
38
|
+
import { StaticRecipe } from "../integration-api/virtual/static-recipe.js";
|
|
39
|
+
import { DiffAgainstCurrentPage } from "./dashboard/diff-against-current-page.js";
|
|
40
|
+
import { ExtensionDownloader } from "./browser/extension/extension-downloader.js";
|
|
41
|
+
import { ExecutableValidator } from "./browser/executable/executable-validator.js";
|
|
42
|
+
import { socksDispatcher } from "fetch-socks";
|
|
43
|
+
import crypto from "node:crypto";
|
|
44
|
+
export class OnboardingServiceFactory {
|
|
49
45
|
context;
|
|
50
46
|
cliConfig;
|
|
51
47
|
constructor(context, cliConfig) {
|
|
@@ -54,10 +50,10 @@ class OnboardingServiceFactory {
|
|
|
54
50
|
}
|
|
55
51
|
async getService() {
|
|
56
52
|
const files = await this.getIntegrationFiles();
|
|
57
|
-
const cli = new
|
|
53
|
+
const cli = new CliServiceFactory().getService();
|
|
58
54
|
const customerConfig = files.getCustomerConfig().config;
|
|
59
55
|
const domainToStart = await this.getUrlForTest(customerConfig, cli);
|
|
60
|
-
const cache = new
|
|
56
|
+
const cache = new Cache(cli);
|
|
61
57
|
const documentHandlerContext = {
|
|
62
58
|
configName: this.context.configName,
|
|
63
59
|
customerPath: this.context.customerPath,
|
|
@@ -65,36 +61,36 @@ class OnboardingServiceFactory {
|
|
|
65
61
|
requiredFiles: [],
|
|
66
62
|
verboseLevel: this.context.verboseLevel,
|
|
67
63
|
};
|
|
68
|
-
const documentHandler = await new
|
|
69
|
-
const bundler = new
|
|
70
|
-
const skTemplate = new
|
|
71
|
-
const speedKitInstallContext = new
|
|
64
|
+
const documentHandler = await new DocumentHandlerRuntimeServiceFactory(documentHandlerContext, this.cliConfig, files).buildDocumentHandlerServer();
|
|
65
|
+
const bundler = new BundleServiceFactory(this.context.customerPath).buildService();
|
|
66
|
+
const skTemplate = new InstallSpeedKitJsTemplate();
|
|
67
|
+
const speedKitInstallContext = new SpeedKitInstallContext(customerConfig, this.context.configName, files, bundler, skTemplate, this.context.local);
|
|
72
68
|
await this.buildInstallResource(speedKitInstallContext, files, cli);
|
|
73
|
-
const extensionDownloader = new
|
|
74
|
-
const extensionPaths = await new
|
|
69
|
+
const extensionDownloader = new ExtensionDownloader(this.cliConfig, cli);
|
|
70
|
+
const extensionPaths = await new ExtensionValidator(extensionDownloader, this.cliConfig, cli).getValidBrowserExtensionPaths();
|
|
75
71
|
this.cliConfig.chromeExtensionPaths = extensionPaths.join(",");
|
|
76
|
-
const browserValidator = new
|
|
72
|
+
const browserValidator = new ExecutableValidator(this.cliConfig, cli);
|
|
77
73
|
const browserVersionString = await browserValidator.validateOrInstall();
|
|
78
|
-
const browserContext = new
|
|
74
|
+
const browserContext = new BrowserContext(domainToStart, browserVersionString, customerConfig.chromeFlags || [], this.cliConfig, undefined, this.context.debuggingPort, this.context.headless);
|
|
79
75
|
if (this.context.debuggingPort || this.context.headless) {
|
|
80
76
|
cli.writeWarning("Chrome remote debugging enabled on port 9222.");
|
|
81
77
|
}
|
|
82
78
|
if (this.context.headless) {
|
|
83
79
|
cli.writeWarning("Running in headless mode.");
|
|
84
80
|
}
|
|
85
|
-
const fileWatcher = new
|
|
81
|
+
const fileWatcher = new FileWatcher(cli, customerConfig, files, documentHandler, browserContext, cache);
|
|
86
82
|
const athenaClient = (await this.getAthenaClient()) || null;
|
|
87
83
|
const fetchHandler = await this.getFetchEventHandler(files, customerConfig, documentHandler, cache, cli, browserContext, athenaClient);
|
|
88
84
|
const messageHandler = this.prepareMessagehandler(athenaClient, files);
|
|
89
|
-
return new
|
|
85
|
+
return new OnboardingService(browserContext, customerConfig, fetchHandler, fileWatcher, cli, messageHandler);
|
|
90
86
|
}
|
|
91
87
|
prepareMessagehandler(athenaClient, files) {
|
|
92
|
-
const messageHandler = new
|
|
88
|
+
const messageHandler = new DevtoolsExtensionApi();
|
|
93
89
|
messageHandler.addMessage({
|
|
94
90
|
id: "athena",
|
|
95
91
|
data: { client: !!athenaClient },
|
|
96
92
|
});
|
|
97
|
-
const fileTodoCollector = new
|
|
93
|
+
const fileTodoCollector = new TodoCollector(files.getInstallResources());
|
|
98
94
|
messageHandler.addMessage({
|
|
99
95
|
id: "todo",
|
|
100
96
|
data: [...fileTodoCollector.getOpenTasks()],
|
|
@@ -102,58 +98,57 @@ class OnboardingServiceFactory {
|
|
|
102
98
|
return messageHandler;
|
|
103
99
|
}
|
|
104
100
|
async buildInstallResource(speedKitInstallContext, files, cli) {
|
|
105
|
-
cli.startAction("build file install_resource");
|
|
106
|
-
const installResourceFile = new
|
|
107
|
-
const result = await
|
|
101
|
+
cli.startAction("ONBOARDING:BUILD:INSTALL_RESOURCE", "build file install_resource");
|
|
102
|
+
const installResourceFile = new VirtualFile(INTEGRATION_FILES.BUILD.INSTALL, new InstallFileRecipe(speedKitInstallContext));
|
|
103
|
+
const result = await safe(installResourceFile.buildContent());
|
|
108
104
|
if (result.success === true) {
|
|
109
105
|
files.addFile(installResourceFile);
|
|
110
|
-
cli.
|
|
106
|
+
cli.successAction("ONBOARDING:BUILD:INSTALL_RESOURCE");
|
|
111
107
|
return;
|
|
112
108
|
}
|
|
113
|
-
cli.
|
|
114
|
-
cli.writeError(result.error);
|
|
109
|
+
cli.failAction("ONBOARDING:BUILD:INSTALL_RESOURCE", result.error);
|
|
115
110
|
}
|
|
116
111
|
async getAthenaClient() {
|
|
117
|
-
const athenaFactory = new
|
|
118
|
-
const result = await
|
|
112
|
+
const athenaFactory = new AthenaServiceFactory();
|
|
113
|
+
const result = await safe(athenaFactory.getService());
|
|
119
114
|
if (result.success === true) {
|
|
120
115
|
return result.data;
|
|
121
116
|
}
|
|
122
117
|
}
|
|
123
118
|
getConfigApi(app) {
|
|
124
|
-
const configApiContext = new
|
|
125
|
-
return new
|
|
119
|
+
const configApiContext = new ConfigApiContext(app);
|
|
120
|
+
return new ConfigApiServiceFactory(configApiContext).getService();
|
|
126
121
|
}
|
|
127
122
|
async getFetchEventHandler(files, customerConfig, documentHandler, cache, cli, browserContext, athenaClient) {
|
|
128
123
|
const configApi = this.getConfigApi(customerConfig.app);
|
|
129
124
|
const serverConfig = await this.getSpeedKitServerConfig(configApi, cli);
|
|
130
125
|
const agent = this.getCrawlerAgent(customerConfig, cli);
|
|
131
|
-
const crawler = new
|
|
132
|
-
const parameterQueryBuilder = new
|
|
133
|
-
const DiffService = new
|
|
134
|
-
const requestDiffService = new
|
|
126
|
+
const crawler = new Crawler(cli, agent, serverConfig);
|
|
127
|
+
const parameterQueryBuilder = new ParameterQueryBuilder(customerConfig, files.getByName(INTEGRATION_FILES.CONFIG.SPEED_KIT));
|
|
128
|
+
const DiffService = new DiffServiceFactory(new DiffContext(this.cliConfig.diffExec, this.cliConfig.diffExecTemplate)).getService();
|
|
129
|
+
const requestDiffService = new RequestDiffService(DiffService, documentHandler);
|
|
135
130
|
const handlers = [
|
|
136
|
-
new
|
|
137
|
-
new
|
|
138
|
-
new
|
|
139
|
-
new
|
|
140
|
-
new
|
|
141
|
-
new
|
|
131
|
+
new CustomerDomainDocumentResponse(customerConfig, files.getByName(INTEGRATION_FILES.CONFIG.DYNAMIC_BLOCKS), files.getByName(INTEGRATION_FILES.CONFIG.DYNAMIC_STYLES), this.context.ignoreContentSecurityPolicy),
|
|
132
|
+
new SpeedKitInstallHtml(customerConfig, browserContext, new InstallSpeedKitHtmlTemplate()),
|
|
133
|
+
new SpeedKitInstallJs(customerConfig, files.getByName(INTEGRATION_FILES.BUILD.INSTALL)),
|
|
134
|
+
new CustomerServiceWorkerJs(customerConfig),
|
|
135
|
+
new SpeedKitServiceWorkerJs(customerConfig, files.getByName(INTEGRATION_FILES.CUSTOM.SW)),
|
|
136
|
+
new DashboardRequest(new Dashboard(customerConfig, parameterQueryBuilder, athenaClient, requestDiffService, new DiffAgainstCurrentPage(DiffService, documentHandler, crawler, cli), cache)),
|
|
142
137
|
];
|
|
143
138
|
if (this.context.local) {
|
|
144
|
-
const orestesApp = new
|
|
145
|
-
handlers.push(new
|
|
139
|
+
const orestesApp = new VirtualOrestesApp(customerConfig, crawler, documentHandler, cache, cli);
|
|
140
|
+
handlers.push(new SpeedKitAssetRequest(customerConfig, orestesApp), new SpeedKitRumPiRequest(customerConfig, cache, cli));
|
|
146
141
|
}
|
|
147
|
-
return new
|
|
142
|
+
return new FetchEventHandler(handlers, customerConfig, cli, configApi);
|
|
148
143
|
}
|
|
149
144
|
async getSpeedKitServerConfig(configApi, cli) {
|
|
150
|
-
cli.startAction("get server config from app");
|
|
151
|
-
const serverConfigResult = await
|
|
145
|
+
cli.startAction("ONBOARDING:FETCH:RUNTIME_CONFIG", "get server config from app");
|
|
146
|
+
const serverConfigResult = await safe(configApi.getServerConfig());
|
|
152
147
|
if (serverConfigResult.success !== true) {
|
|
153
|
-
cli.
|
|
148
|
+
cli.failAction("ONBOARDING:FETCH:RUNTIME_CONFIG");
|
|
154
149
|
return;
|
|
155
150
|
}
|
|
156
|
-
cli.
|
|
151
|
+
cli.successAction("ONBOARDING:FETCH:RUNTIME_CONFIG");
|
|
157
152
|
return JSON.parse(serverConfigResult.data);
|
|
158
153
|
}
|
|
159
154
|
async getIntegrationFiles() {
|
|
@@ -164,42 +159,42 @@ class OnboardingServiceFactory {
|
|
|
164
159
|
const swPath = path.join(speedKitBuildPath, "sw.js");
|
|
165
160
|
const dfPath = path.join(speedKitBuildPath, "dynamic-fetcher.js");
|
|
166
161
|
const loaderPath = path.join(speedKitBuildPath, "snippet.js");
|
|
167
|
-
const integrationApiContext = new
|
|
168
|
-
const integrationApi = new
|
|
169
|
-
const externalFileReader = new
|
|
162
|
+
const integrationApiContext = new IntegrationApiContext(this.context.customerPath, this.context.configName, [], [], this.context.useTestConfig);
|
|
163
|
+
const integrationApi = new IntegrationApiFactory(integrationApiContext, this.cliConfig).buildService();
|
|
164
|
+
const externalFileReader = new ExternalFileReader();
|
|
170
165
|
const integrationApiArray = [
|
|
171
166
|
{
|
|
172
|
-
name:
|
|
173
|
-
recipe: new
|
|
167
|
+
name: INTEGRATION_FILES.CUSTOM.DOCUMENT_HANDLER,
|
|
168
|
+
recipe: new ExternalRecipe(this.context.DEFAULT_DOCUMENT_HANDLER_PATH, externalFileReader),
|
|
174
169
|
},
|
|
175
170
|
];
|
|
176
171
|
// if speed-kit is npm-linked, use linked local files else fetch latest released sw and df
|
|
177
172
|
if (isSpeedKitLinked) {
|
|
178
173
|
console.log(`Linked Speed-Kit found in node_modules. Using built sw, df and loader.`);
|
|
179
174
|
integrationApiArray.push({
|
|
180
|
-
name:
|
|
181
|
-
recipe: new
|
|
175
|
+
name: INTEGRATION_FILES.CUSTOM.SW,
|
|
176
|
+
recipe: new StaticRecipe(fs.readFileSync(swPath, "utf-8")),
|
|
182
177
|
overrideLocalFile: true,
|
|
183
178
|
}, {
|
|
184
|
-
name:
|
|
185
|
-
recipe: new
|
|
179
|
+
name: INTEGRATION_FILES.CUSTOM.DYNAMIC_FETCHER,
|
|
180
|
+
recipe: new StaticRecipe(fs.readFileSync(dfPath, "utf-8")),
|
|
186
181
|
overrideLocalFile: true,
|
|
187
182
|
}, {
|
|
188
|
-
name:
|
|
189
|
-
recipe: new
|
|
183
|
+
name: INTEGRATION_FILES.CUSTOM.LOADER,
|
|
184
|
+
recipe: new StaticRecipe(fs.readFileSync(loaderPath, "utf-8")),
|
|
190
185
|
overrideLocalFile: true,
|
|
191
186
|
});
|
|
192
187
|
}
|
|
193
188
|
else {
|
|
194
189
|
integrationApiArray.push({
|
|
195
|
-
name:
|
|
196
|
-
recipe: new
|
|
190
|
+
name: INTEGRATION_FILES.CUSTOM.SW,
|
|
191
|
+
recipe: new ExternalRecipe(this.context.DEFAULT_SW_PATH, externalFileReader),
|
|
197
192
|
}, {
|
|
198
|
-
name:
|
|
199
|
-
recipe: new
|
|
193
|
+
name: INTEGRATION_FILES.CUSTOM.DYNAMIC_FETCHER,
|
|
194
|
+
recipe: new ExternalRecipe(this.context.DEFAULT_DF_PATH, externalFileReader),
|
|
200
195
|
}, {
|
|
201
|
-
name:
|
|
202
|
-
recipe: new
|
|
196
|
+
name: INTEGRATION_FILES.CUSTOM.LOADER,
|
|
197
|
+
recipe: new ExternalRecipe(this.context.DEFAULT_SNIPPET_PATH, externalFileReader),
|
|
203
198
|
});
|
|
204
199
|
}
|
|
205
200
|
return integrationApi.run(integrationApiArray);
|
|
@@ -230,14 +225,14 @@ class OnboardingServiceFactory {
|
|
|
230
225
|
};
|
|
231
226
|
const agentOptions = {
|
|
232
227
|
rejectUnauthorized: false,
|
|
233
|
-
secureOptions:
|
|
228
|
+
secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT,
|
|
234
229
|
};
|
|
235
230
|
const crawlerProxyConfig = this.getCrawlerProxyConfig(customerConfig);
|
|
236
231
|
if (crawlerProxyConfig) {
|
|
237
232
|
cli.writeWarning(`use proxy from chromeFlags for local documenthandler`);
|
|
238
233
|
proxy.push(crawlerProxyConfig);
|
|
239
234
|
}
|
|
240
|
-
return
|
|
235
|
+
return socksDispatcher(proxy, { ...agentOptions, connect });
|
|
241
236
|
}
|
|
242
237
|
getCrawlerProxyConfig(customerConfig) {
|
|
243
238
|
if (!customerConfig.chromeFlags ||
|
|
@@ -262,4 +257,3 @@ class OnboardingServiceFactory {
|
|
|
262
257
|
}
|
|
263
258
|
}
|
|
264
259
|
}
|
|
265
|
-
exports.OnboardingServiceFactory = OnboardingServiceFactory;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CustomerConfig } from "../integration-api";
|
|
2
|
-
import { BrowserContext } from "./onboarding-model";
|
|
3
|
-
import { FetchEventHandler } from "./fetch-event-handler";
|
|
4
|
-
import { FileWatcher } from "./file-events/file-watcher";
|
|
5
|
-
import { CliService } from "../cli";
|
|
6
|
-
import { DevtoolsExtensionApi } from "./browser/extension/devtools-extension-api";
|
|
1
|
+
import { CustomerConfig } from "../integration-api/index.js";
|
|
2
|
+
import { BrowserContext } from "./onboarding-model.js";
|
|
3
|
+
import { FetchEventHandler } from "./fetch-event-handler.js";
|
|
4
|
+
import { FileWatcher } from "./file-events/file-watcher.js";
|
|
5
|
+
import { CliService } from "../cli/index.js";
|
|
6
|
+
import { DevtoolsExtensionApi } from "./browser/extension/devtools-extension-api.js";
|
|
7
7
|
/**
|
|
8
8
|
* Represents the OnboardingService which is responsible for setting up the browser to test a config using Puppeteer.
|
|
9
9
|
*/
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const puppeteer_extra_1 = tslib_1.__importDefault(require("puppeteer-extra"));
|
|
6
|
-
const onboarding_model_1 = require("./onboarding-model");
|
|
7
|
-
const cli_1 = require("../cli");
|
|
8
|
-
const safe_1 = require("../../helpers/safe");
|
|
1
|
+
import puppeteerExtra from "puppeteer-extra";
|
|
2
|
+
import { BROWSER_EVENTS, CDP_SESSION, } from "./onboarding-model.js";
|
|
3
|
+
import { safe } from "../../helpers/safe.js";
|
|
9
4
|
/**
|
|
10
5
|
* Represents the OnboardingService which is responsible for setting up the browser to test a config using Puppeteer.
|
|
11
6
|
*/
|
|
12
|
-
class OnboardingService {
|
|
7
|
+
export class OnboardingService {
|
|
13
8
|
browserContext;
|
|
14
9
|
customerConfig;
|
|
15
10
|
fetchEventHandler;
|
|
@@ -29,20 +24,20 @@ class OnboardingService {
|
|
|
29
24
|
* prepare puppeteerBrowser, add eventListeners and start
|
|
30
25
|
*/
|
|
31
26
|
async run() {
|
|
32
|
-
this.cli.startAction(`prepare browser ${this.cli.style.bold(this.browserContext.browserVersionString)}`);
|
|
27
|
+
this.cli.startAction("ONBOARDING:PREPARE:BROWSER", `prepare browser ${this.cli.style.bold(this.browserContext.browserVersionString)}`);
|
|
33
28
|
const browser = await this.prepareBrowser();
|
|
34
29
|
const page = await this.preparePage(browser);
|
|
35
|
-
this.cli.
|
|
30
|
+
this.cli.successAction("ONBOARDING:PREPARE:BROWSER");
|
|
36
31
|
await this.navigate(page, `${this.customerConfig.scope}speed-kit-install.html?url=${this.customerConfig.scope}`);
|
|
37
32
|
}
|
|
38
33
|
async prepareBrowser() {
|
|
39
|
-
const browser = await
|
|
34
|
+
const browser = await puppeteerExtra.default.launch(this.browserContext.getPuppeteerLaunchOptions());
|
|
40
35
|
for (const target of browser.targets()) {
|
|
41
36
|
if (target.type() === "browser") {
|
|
42
37
|
await this.fetchEventHandler.handleRequestFetchEvents(target);
|
|
43
38
|
}
|
|
44
39
|
}
|
|
45
|
-
browser.on(
|
|
40
|
+
browser.on(BROWSER_EVENTS.DISCONNECTED, () => {
|
|
46
41
|
this.cli.writeError("Browser disconnected, shutting down");
|
|
47
42
|
process.exit(-1);
|
|
48
43
|
});
|
|
@@ -50,7 +45,7 @@ class OnboardingService {
|
|
|
50
45
|
}
|
|
51
46
|
async preparePage(browser) {
|
|
52
47
|
const page = await this.findPage(browser);
|
|
53
|
-
await
|
|
48
|
+
await safe(this.prepareCleanState(page));
|
|
54
49
|
this.registerFileWatcher(page);
|
|
55
50
|
this.registerReinstallSpeedKitOnNavigate(page);
|
|
56
51
|
this.developmentToolsMessages.addMessage({
|
|
@@ -88,8 +83,8 @@ class OnboardingService {
|
|
|
88
83
|
});
|
|
89
84
|
await cdpSession.send("Emulation.clearDeviceMetricsOverride");
|
|
90
85
|
await cdpSession.send("Emulation.clearGeolocationOverride");
|
|
91
|
-
|
|
92
|
-
cdpSession.on(
|
|
86
|
+
safe(() => {
|
|
87
|
+
cdpSession.on(CDP_SESSION.EVENTS.SERVICE_WORKER.REGISTRATION_UPDATED, ({ registrations, }) => {
|
|
93
88
|
for (const registration of registrations) {
|
|
94
89
|
if (registration.isDeleted) {
|
|
95
90
|
this.developmentToolsMessages.addMessage({
|
|
@@ -129,7 +124,6 @@ class OnboardingService {
|
|
|
129
124
|
}
|
|
130
125
|
async navigate(page, pathname) {
|
|
131
126
|
const goto = new URL(pathname, `${this.browserContext.domain}`);
|
|
132
|
-
await
|
|
127
|
+
await safe(page.goto(goto.toString()));
|
|
133
128
|
}
|
|
134
129
|
}
|
|
135
|
-
exports.OnboardingService = OnboardingService;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaqendResponse } from "../browser/baqend-response";
|
|
2
|
-
import { CliService } from "../../cli";
|
|
1
|
+
import { BaqendResponse } from "../browser/baqend-response.js";
|
|
2
|
+
import { CliService } from "../../cli/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* This class represents a cache for storing responses from the localDocumentHandler.
|
|
5
5
|
*/
|
|
@@ -8,7 +8,7 @@ export declare class Cache {
|
|
|
8
8
|
private inMemoryCache;
|
|
9
9
|
constructor(cli: CliService);
|
|
10
10
|
getAll(): IterableIterator<[string, BaqendResponse]>;
|
|
11
|
-
getEntry(requestUri: string): BaqendResponse |
|
|
11
|
+
getEntry(requestUri: string): BaqendResponse | null;
|
|
12
12
|
addEntry(requestUri: string, response: BaqendResponse): void;
|
|
13
13
|
removeEntry(requestUri: string): void;
|
|
14
14
|
clear(): void;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Cache = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* This class represents a cache for storing responses from the localDocumentHandler.
|
|
6
3
|
*/
|
|
7
|
-
class Cache {
|
|
4
|
+
export class Cache {
|
|
8
5
|
cli;
|
|
9
6
|
inMemoryCache = new Map();
|
|
10
7
|
constructor(cli) {
|
|
@@ -37,4 +34,3 @@ class Cache {
|
|
|
37
34
|
this.inMemoryCache.clear();
|
|
38
35
|
}
|
|
39
36
|
}
|
|
40
|
-
exports.Cache = Cache;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CliService } from "../../cli";
|
|
2
|
-
import { SpeedKitServerConfig } from "../onboarding-model";
|
|
3
|
-
import { ConfigApiService } from "../../config-api";
|
|
1
|
+
import { CliService } from "../../cli/index.js";
|
|
2
|
+
import { SpeedKitServerConfig } from "../onboarding-model.js";
|
|
3
|
+
import { ConfigApiService } from "../../config-api/index.js";
|
|
4
4
|
export declare class ServerConfig {
|
|
5
5
|
private cli;
|
|
6
6
|
private client?;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ServerConfig = void 0;
|
|
4
|
-
const cli_1 = require("../../cli");
|
|
5
|
-
const safe_1 = require("../../../helpers/safe");
|
|
6
|
-
class ServerConfig {
|
|
1
|
+
import { safe } from "../../../helpers/safe.js";
|
|
2
|
+
export class ServerConfig {
|
|
7
3
|
cli;
|
|
8
4
|
client;
|
|
9
5
|
constructor(cli, client) {
|
|
@@ -18,15 +14,14 @@ class ServerConfig {
|
|
|
18
14
|
return JSON.parse(serverConfig);
|
|
19
15
|
}
|
|
20
16
|
async getServerConfig() {
|
|
21
|
-
this.cli.startAction("wait for credentials from server-config");
|
|
22
|
-
const serverConfigResponse = await
|
|
17
|
+
this.cli.startAction("ONBOARDING:FETCH:RUNTIME_CONFIG", "wait for credentials from server-config");
|
|
18
|
+
const serverConfigResponse = await safe(this.client.getServerConfig());
|
|
23
19
|
if (serverConfigResponse.success === false) {
|
|
24
|
-
this.cli.
|
|
20
|
+
this.cli.failAction("ONBOARDING:FETCH:RUNTIME_CONFIG");
|
|
25
21
|
this.cli.writeError(`unable to load serverConfig: ${serverConfigResponse.error}`);
|
|
26
22
|
return;
|
|
27
23
|
}
|
|
28
|
-
this.cli.
|
|
24
|
+
this.cli.successAction("ONBOARDING:FETCH:RUNTIME_CONFIG");
|
|
29
25
|
return serverConfigResponse.data;
|
|
30
26
|
}
|
|
31
27
|
}
|
|
32
|
-
exports.ServerConfig = ServerConfig;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import AbstractTemplate from "../../document-handler-runtime/templates/abstract-template";
|
|
1
|
+
import AbstractTemplate from "../../document-handler-runtime/templates/abstract-template.js";
|
|
2
2
|
export declare class InstallSpeedKitHtmlTemplate extends AbstractTemplate {
|
|
3
3
|
protected getTemplate(): Handlebars.Template;
|
|
4
4
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.InstallSpeedKitHtmlTemplate = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const abstract_template_1 = tslib_1.__importDefault(require("../../document-handler-runtime/templates/abstract-template"));
|
|
6
|
-
class InstallSpeedKitHtmlTemplate extends abstract_template_1.default {
|
|
1
|
+
import AbstractTemplate from "../../document-handler-runtime/templates/abstract-template.js";
|
|
2
|
+
export class InstallSpeedKitHtmlTemplate extends AbstractTemplate {
|
|
7
3
|
getTemplate() {
|
|
8
4
|
return `
|
|
9
5
|
<!DOCTYPE html>
|
|
@@ -264,4 +260,3 @@ aside.loader:not(.stop)::after {
|
|
|
264
260
|
`;
|
|
265
261
|
}
|
|
266
262
|
}
|
|
267
|
-
exports.InstallSpeedKitHtmlTemplate = InstallSpeedKitHtmlTemplate;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import AbstractTemplate from "../../document-handler-runtime/templates/abstract-template";
|
|
1
|
+
import AbstractTemplate from "../../document-handler-runtime/templates/abstract-template.js";
|
|
2
2
|
export declare class InstallSpeedKitJsTemplate extends AbstractTemplate {
|
|
3
3
|
protected getTemplate(): Handlebars.Template;
|
|
4
4
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.InstallSpeedKitJsTemplate = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const abstract_template_1 = tslib_1.__importDefault(require("../../document-handler-runtime/templates/abstract-template"));
|
|
6
|
-
class InstallSpeedKitJsTemplate extends abstract_template_1.default {
|
|
1
|
+
import AbstractTemplate from "../../document-handler-runtime/templates/abstract-template.js";
|
|
2
|
+
export class InstallSpeedKitJsTemplate extends AbstractTemplate {
|
|
7
3
|
getTemplate() {
|
|
8
4
|
return `
|
|
9
5
|
// Config
|
|
@@ -39,4 +35,3 @@ navigator?.serviceWorker?.controller?.postMessage({ type: 'bypass-deactivation',
|
|
|
39
35
|
`;
|
|
40
36
|
}
|
|
41
37
|
}
|
|
42
|
-
exports.InstallSpeedKitJsTemplate = InstallSpeedKitJsTemplate;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { InstallResourceInterface } from "../integration-api/integration-api-model";
|
|
2
|
-
export
|
|
1
|
+
import { InstallResourceInterface } from "../integration-api/integration-api-model.js";
|
|
2
|
+
export interface task {
|
|
3
3
|
todo: string;
|
|
4
4
|
context: string;
|
|
5
5
|
file: string;
|
|
6
6
|
line: number;
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
8
|
/**
|
|
9
9
|
* Represents a TodoCollector class that collects open tasks from files.
|
|
10
10
|
* This files will then be injected to the current open page, so you or the browser-extension can access and display them
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TodoCollector = void 0;
|
|
4
|
-
const integration_api_1 = require("../integration-api");
|
|
1
|
+
import { FILE_TYPE } from "../integration-api/index.js";
|
|
5
2
|
const TODO_MATCH = /(todo[^\n\r()|]*)((?:(?:\r\n|\r|\n)[^\n\r()|]*){3})/i;
|
|
6
3
|
/**
|
|
7
4
|
* Represents a TodoCollector class that collects open tasks from files.
|
|
8
5
|
* This files will then be injected to the current open page, so you or the browser-extension can access and display them
|
|
9
6
|
*/
|
|
10
|
-
class TodoCollector {
|
|
7
|
+
export class TodoCollector {
|
|
11
8
|
files;
|
|
12
9
|
constructor(files) {
|
|
13
10
|
this.files = files;
|
|
14
11
|
}
|
|
15
12
|
getOpenTasks() {
|
|
16
13
|
const configFiles = this.files.filter((file) => {
|
|
17
|
-
return !(file.type ===
|
|
14
|
+
return !(file.type === FILE_TYPE.VIRTUAL_FILE);
|
|
18
15
|
});
|
|
19
16
|
const tasks = [];
|
|
20
17
|
for (const configFile of configFiles) {
|
|
@@ -46,4 +43,3 @@ class TodoCollector {
|
|
|
46
43
|
return line;
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
|
-
exports.TodoCollector = TodoCollector;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SpeedKitServerConfig } from "../onboarding-model";
|
|
2
|
-
import { CliService } from "../../cli";
|
|
1
|
+
import { SpeedKitServerConfig } from "../onboarding-model.js";
|
|
2
|
+
import { CliService } from "../../cli/index.js";
|
|
3
3
|
import { Agent } from "undici";
|
|
4
4
|
export declare class Crawler {
|
|
5
5
|
private cli;
|