@speedkit/cli 3.43.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/README.md +6 -6
- package/bin/dev +2 -15
- package/bin/run +2 -2
- package/dist/commands/build-parameter-query.d.ts +3 -3
- package/dist/commands/build-parameter-query.js +12 -15
- package/dist/commands/build-prewarm-query.d.ts +4 -4
- package/dist/commands/build-prewarm-query.js +13 -16
- package/dist/commands/config/edit.js +7 -11
- package/dist/commands/deploy.d.ts +3 -5
- package/dist/commands/deploy.js +12 -16
- package/dist/commands/diff-url-parameters.d.ts +3 -3
- package/dist/commands/diff-url-parameters.js +27 -30
- package/dist/commands/document-handler.d.ts +4 -4
- package/dist/commands/document-handler.js +13 -17
- package/dist/commands/find-pops.d.ts +2 -2
- package/dist/commands/find-pops.js +22 -24
- package/dist/commands/generate-customer-config.d.ts +2 -2
- package/dist/commands/generate-customer-config.js +13 -16
- package/dist/commands/generate-pop-config.d.ts +7 -7
- package/dist/commands/generate-pop-config.js +32 -41
- package/dist/commands/login.d.ts +1 -1
- package/dist/commands/login.js +13 -17
- package/dist/commands/onboarding.d.ts +3 -5
- package/dist/commands/onboarding.js +10 -13
- package/dist/commands/prewarm.d.ts +9 -9
- package/dist/commands/prewarm.js +25 -28
- package/dist/commands/pull.d.ts +3 -3
- package/dist/commands/pull.js +11 -14
- package/dist/commands/wpt-launcher.d.ts +7 -7
- package/dist/commands/wpt-launcher.js +21 -26
- package/dist/helpers/array-helper.js +1 -4
- package/dist/helpers/build-query-helper.js +5 -12
- package/dist/helpers/cli-config.d.ts +3 -3
- package/dist/helpers/cli-config.js +11 -16
- package/dist/helpers/customer-config.d.ts +4 -8
- package/dist/helpers/customer-config.js +18 -23
- package/dist/helpers/evaluate-speed-kit-config.d.ts +1 -1
- package/dist/helpers/evaluate-speed-kit-config.js +42 -26
- package/dist/helpers/file-helper.js +8 -13
- package/dist/helpers/get-parsed-config.d.ts +1 -1
- package/dist/helpers/get-parsed-config.js +6 -10
- package/dist/helpers/html-format-helper.js +3 -6
- package/dist/helpers/is-directory.js +3 -6
- package/dist/helpers/is-file.js +3 -6
- package/dist/helpers/logging-helper.js +7 -13
- package/dist/helpers/normalize.js +10 -17
- package/dist/helpers/race.d.ts +1 -1
- package/dist/helpers/race.js +3 -9
- package/dist/helpers/safe.js +1 -4
- package/dist/helpers/scrape.d.ts +1 -1
- package/dist/helpers/scrape.js +3 -7
- package/dist/helpers/site-analyzer.js +5 -9
- package/dist/helpers/speed-kit-rule-to-reg-exp.js +1 -4
- package/dist/models/cli-parameters.d.ts +4 -4
- package/dist/models/cli-parameters.js +13 -16
- package/dist/models/files.js +1 -4
- package/dist/models/install.js +1 -2
- package/dist/models/os.js +1 -4
- package/dist/services/athena/athena-service-factory.d.ts +1 -1
- package/dist/services/athena/athena-service-factory.js +15 -19
- package/dist/services/athena/athena-service-model.js +2 -5
- package/dist/services/athena/athena-service.d.ts +1 -1
- package/dist/services/athena/athena-service.js +18 -23
- package/dist/services/athena/error/athena-query-error.d.ts +1 -1
- package/dist/services/athena/error/athena-query-error.js +2 -7
- package/dist/services/athena/error/fetch-credentials-error.d.ts +1 -1
- package/dist/services/athena/error/fetch-credentials-error.js +2 -7
- package/dist/services/athena/index.d.ts +4 -4
- package/dist/services/athena/index.js +4 -7
- package/dist/services/bundler/bundle-service-factory.d.ts +3 -1
- package/dist/services/bundler/bundle-service-factory.js +7 -7
- package/dist/services/bundler/bundle-service.d.ts +9 -12
- package/dist/services/bundler/bundle-service.js +42 -32
- package/dist/services/bundler/error/bundle-fetch-error.d.ts +1 -1
- package/dist/services/bundler/error/bundle-fetch-error.js +2 -7
- package/dist/services/bundler/error/bundle-resolve-error.d.ts +1 -1
- package/dist/services/bundler/error/bundle-resolve-error.js +2 -7
- package/dist/services/bundler/index.d.ts +2 -2
- package/dist/services/bundler/index.js +2 -5
- package/dist/services/cli/cli-service-factory.d.ts +2 -2
- package/dist/services/cli/cli-service-factory.js +6 -10
- package/dist/services/cli/cli-service-model.d.ts +21 -6
- package/dist/services/cli/cli-service-model.js +3 -7
- package/dist/services/cli/cli-service.d.ts +10 -8
- package/dist/services/cli/cli-service.js +64 -61
- package/dist/services/cli/error/cli-type-error.js +1 -4
- package/dist/services/cli/index.d.ts +3 -3
- package/dist/services/cli/index.js +3 -6
- package/dist/services/config-api/client.d.ts +2 -2
- package/dist/services/config-api/client.js +29 -34
- package/dist/services/config-api/config-api-factory.d.ts +2 -2
- package/dist/services/config-api/config-api-factory.js +15 -20
- package/dist/services/config-api/config-api-model.d.ts +2 -2
- package/dist/services/config-api/config-api-model.js +1 -5
- package/dist/services/config-api/config-api-service.d.ts +2 -2
- package/dist/services/config-api/config-api-service.js +1 -5
- package/dist/services/config-api/entity-manager-factory.js +3 -7
- package/dist/services/config-api/error/json-response-error.d.ts +1 -1
- package/dist/services/config-api/error/json-response-error.js +2 -7
- package/dist/services/config-api/error/login-error.d.ts +1 -1
- package/dist/services/config-api/error/login-error.js +2 -7
- package/dist/services/config-api/error/orestes-api-error.d.ts +1 -1
- package/dist/services/config-api/error/orestes-api-error.js +2 -7
- package/dist/services/config-api/index.d.ts +3 -3
- package/dist/services/config-api/index.js +3 -6
- package/dist/services/config-api-service.d.ts +1 -1
- package/dist/services/config-api-service.js +6 -11
- package/dist/services/customer-config/customer-config-service-context.js +3 -7
- package/dist/services/customer-config/customer-config-service-factory.d.ts +1 -1
- package/dist/services/customer-config/customer-config-service-factory.js +6 -10
- package/dist/services/customer-config/customer-config-service-model.js +6 -9
- package/dist/services/customer-config/customer-config-service.d.ts +3 -3
- package/dist/services/customer-config/customer-config-service.js +55 -55
- package/dist/services/customer-config/index.d.ts +4 -4
- package/dist/services/customer-config/index.js +4 -7
- package/dist/services/deploy/builder/install-resource-builder.d.ts +2 -2
- package/dist/services/deploy/builder/install-resource-builder.js +3 -7
- package/dist/services/deploy/checks/post-deploy/deprecated-deployment-detection-check.d.ts +4 -4
- package/dist/services/deploy/checks/post-deploy/deprecated-deployment-detection-check.js +19 -24
- package/dist/services/deploy/checks/post-deploy/revalidated-module-check.d.ts +3 -3
- package/dist/services/deploy/checks/post-deploy/revalidated-module-check.js +10 -14
- package/dist/services/deploy/checks/post-deploy/save-files-check.d.ts +3 -3
- package/dist/services/deploy/checks/post-deploy/save-files-check.js +8 -12
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.d.ts +3 -3
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +14 -20
- package/dist/services/deploy/checks/pre-deploy/split-change-check.d.ts +3 -3
- package/dist/services/deploy/checks/pre-deploy/split-change-check.js +19 -20
- package/dist/services/deploy/context/deploy-context.d.ts +2 -2
- package/dist/services/deploy/context/deploy-context.js +10 -14
- package/dist/services/deploy/deploy-service-factory.d.ts +3 -3
- package/dist/services/deploy/deploy-service-factory.js +36 -40
- package/dist/services/deploy/deploy-service-model.d.ts +10 -10
- package/dist/services/deploy/deploy-service-model.js +1 -2
- package/dist/services/deploy/deploy-service.d.ts +4 -4
- package/dist/services/deploy/deploy-service.js +10 -15
- package/dist/services/deploy/error/check-module-file-error.d.ts +1 -1
- package/dist/services/deploy/error/check-module-file-error.js +2 -7
- package/dist/services/deploy/error/deploy-install-resource-error.d.ts +1 -1
- package/dist/services/deploy/error/deploy-install-resource-error.js +2 -7
- package/dist/services/deploy/error/deploy-module-file-error.d.ts +1 -1
- package/dist/services/deploy/error/deploy-module-file-error.js +2 -7
- package/dist/services/deploy/error/deploy-server-config-error.d.ts +1 -1
- package/dist/services/deploy/error/deploy-server-config-error.js +2 -7
- package/dist/services/deploy/error/evaluate-sk-config-error.d.ts +1 -1
- package/dist/services/deploy/error/evaluate-sk-config-error.js +2 -7
- package/dist/services/deploy/error/file-handler-error.d.ts +1 -1
- package/dist/services/deploy/error/file-handler-error.js +2 -7
- package/dist/services/deploy/error/post-deploy-deployment-detection-error.d.ts +1 -1
- package/dist/services/deploy/error/post-deploy-deployment-detection-error.js +2 -7
- package/dist/services/deploy/error/safe-file-error.d.ts +1 -1
- package/dist/services/deploy/error/safe-file-error.js +2 -7
- package/dist/services/deploy/handler/customer-config-handler.d.ts +6 -6
- package/dist/services/deploy/handler/customer-config-handler.js +7 -12
- package/dist/services/deploy/handler/install-resource-handler.d.ts +7 -7
- package/dist/services/deploy/handler/install-resource-handler.js +22 -27
- package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.d.ts +4 -4
- package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.js +1 -4
- package/dist/services/deploy/handler/module-handler.d.ts +6 -6
- package/dist/services/deploy/handler/module-handler.js +12 -18
- package/dist/services/deploy/handler/server-config-handler.d.ts +5 -5
- package/dist/services/deploy/handler/server-config-handler.js +10 -14
- package/dist/services/deploy/interface/deploy-handler-interface.d.ts +1 -1
- package/dist/services/deploy/interface/deploy-handler-interface.js +1 -2
- package/dist/services/deploy/interface/install-configs.js +1 -2
- package/dist/services/deploy/interface/install-resource-processor-interface.d.ts +1 -1
- package/dist/services/deploy/interface/install-resource-processor-interface.js +1 -2
- package/dist/services/deploy/interface/install.d.ts +1 -1
- package/dist/services/deploy/interface/install.js +1 -2
- package/dist/services/deploy/interface/runtime-modifier.d.ts +1 -1
- package/dist/services/deploy/interface/runtime-modifier.js +1 -2
- package/dist/services/deploy/interface/validate-origins-response.js +1 -2
- package/dist/services/diff/diff-model.js +1 -5
- package/dist/services/diff/diff-service-factory.d.ts +1 -1
- package/dist/services/diff/diff-service-factory.js +6 -10
- package/dist/services/diff/diff-service.d.ts +1 -1
- package/dist/services/diff/diff-service.js +19 -24
- package/dist/services/diff/index.d.ts +3 -3
- package/dist/services/diff/index.js +3 -6
- package/dist/services/diff-service.d.ts +1 -1
- package/dist/services/diff-service.js +16 -21
- package/dist/services/document-handler-runtime/context/document-handler-runtime-context.js +30 -34
- package/dist/services/document-handler-runtime/document-handler-runtime-service.d.ts +3 -3
- package/dist/services/document-handler-runtime/document-handler-runtime-service.js +38 -42
- package/dist/services/document-handler-runtime/document-handler-server.d.ts +7 -11
- package/dist/services/document-handler-runtime/document-handler-server.js +77 -59
- package/dist/services/document-handler-runtime/error/required-file-not-found-error.js +1 -4
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +5 -5
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +42 -46
- package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.js +1 -4
- package/dist/services/document-handler-runtime/interface/template-context-interface.d.ts +2 -3
- package/dist/services/document-handler-runtime/interface/template-context-interface.js +1 -2
- package/dist/services/document-handler-runtime/interface/template-interface.d.ts +2 -2
- package/dist/services/document-handler-runtime/interface/template-interface.js +1 -2
- package/dist/services/document-handler-runtime/interface/template-parameter-interface.js +1 -2
- package/dist/services/document-handler-runtime/server/document-handler-response.d.ts +1 -3
- package/dist/services/document-handler-runtime/server/document-handler-response.js +1 -5
- package/dist/services/document-handler-runtime/server/request.d.ts +4 -10
- package/dist/services/document-handler-runtime/server/request.js +1 -5
- package/dist/services/document-handler-runtime/templates/abstract-template.d.ts +3 -3
- package/dist/services/document-handler-runtime/templates/abstract-template.js +3 -7
- package/dist/services/document-handler-runtime/templates/database-mock.d.ts +2 -2
- package/dist/services/document-handler-runtime/templates/database-mock.js +2 -6
- package/dist/services/document-handler-runtime/templates/execute-document-handler.d.ts +2 -2
- package/dist/services/document-handler-runtime/templates/execute-document-handler.js +2 -6
- package/dist/services/document-handler-runtime/templates/orestes-mock.d.ts +2 -2
- package/dist/services/document-handler-runtime/templates/orestes-mock.js +2 -6
- package/dist/services/document-handler-runtime/templates/package-json.d.ts +3 -5
- package/dist/services/document-handler-runtime/templates/package-json.js +2 -6
- package/dist/services/document-handler-runtime/templates/test.d.ts +2 -2
- package/dist/services/document-handler-runtime/templates/test.js +2 -6
- package/dist/services/error-handling/error/application-error.d.ts +1 -1
- package/dist/services/error-handling/error/application-error.js +1 -5
- package/dist/services/error-handling/error/config-file-error.d.ts +1 -1
- package/dist/services/error-handling/error/config-file-error.js +2 -7
- package/dist/services/error-handling/error/connection-error.d.ts +1 -1
- package/dist/services/error-handling/error/connection-error.js +2 -7
- package/dist/services/integration-api/error/customer-config-error.d.ts +1 -1
- package/dist/services/integration-api/error/customer-config-error.js +2 -5
- package/dist/services/integration-api/error/customer-config-legacy-error.d.ts +1 -1
- package/dist/services/integration-api/error/customer-config-legacy-error.js +2 -6
- package/dist/services/integration-api/error/invalid-config-format-error.d.ts +1 -1
- package/dist/services/integration-api/error/invalid-config-format-error.js +4 -7
- package/dist/services/integration-api/error/mandatory-file-missing-error.d.ts +1 -1
- package/dist/services/integration-api/error/mandatory-file-missing-error.js +2 -6
- package/dist/services/integration-api/error/origin-error.d.ts +1 -1
- package/dist/services/integration-api/error/origin-error.js +2 -5
- package/dist/services/integration-api/error/read-files-error.d.ts +1 -1
- package/dist/services/integration-api/error/read-files-error.js +2 -7
- package/dist/services/integration-api/external/external-file-reader.d.ts +1 -1
- package/dist/services/integration-api/external/external-file-reader.js +9 -14
- package/dist/services/integration-api/file-list.d.ts +1 -1
- package/dist/services/integration-api/file-list.js +8 -11
- package/dist/services/integration-api/file-reader.js +11 -15
- package/dist/services/integration-api/file-writer.js +4 -8
- package/dist/services/integration-api/handler/customer-config-handler.d.ts +5 -5
- package/dist/services/integration-api/handler/customer-config-handler.js +17 -21
- package/dist/services/integration-api/handler/file-handler.d.ts +2 -2
- package/dist/services/integration-api/handler/file-handler.js +1 -4
- package/dist/services/integration-api/handler/install-resource-handler.d.ts +2 -2
- package/dist/services/integration-api/handler/install-resource-handler.js +6 -10
- package/dist/services/integration-api/handler/module-handler.d.ts +2 -2
- package/dist/services/integration-api/handler/module-handler.js +4 -8
- package/dist/services/integration-api/handler/server-config-handler.d.ts +2 -2
- package/dist/services/integration-api/handler/server-config-handler.js +4 -8
- package/dist/services/integration-api/index.d.ts +3 -3
- package/dist/services/integration-api/index.js +3 -6
- package/dist/services/integration-api/integration-api-factory.d.ts +3 -3
- package/dist/services/integration-api/integration-api-factory.js +23 -28
- package/dist/services/integration-api/integration-api-model.d.ts +17 -19
- package/dist/services/integration-api/integration-api-model.js +16 -21
- package/dist/services/integration-api/integration-api-service.d.ts +5 -5
- package/dist/services/integration-api/integration-api-service.js +6 -12
- package/dist/services/integration-api/spec/customer-config-validator.spec.js +29 -32
- package/dist/services/integration-api/spec/file-list.spec.js +107 -110
- package/dist/services/integration-api/spec/file-reader.spec.js +27 -30
- package/dist/services/integration-api/spec/file-writer.spec.js +34 -37
- package/dist/services/integration-api/spec/integration-api-service.spec.js +42 -45
- package/dist/services/integration-api/spec/mandatory-files-validator.spec.js +48 -51
- package/dist/services/integration-api/struct/customer-config-file.d.ts +1 -1
- package/dist/services/integration-api/struct/customer-config-file.js +10 -15
- package/dist/services/integration-api/struct/customer-config.d.ts +4 -8
- package/dist/services/integration-api/struct/customer-config.js +5 -10
- package/dist/services/integration-api/struct/file.d.ts +1 -1
- package/dist/services/integration-api/struct/file.js +9 -13
- package/dist/services/integration-api/struct/install-resource-file.d.ts +2 -2
- package/dist/services/integration-api/struct/install-resource-file.js +4 -8
- package/dist/services/integration-api/struct/module-file.d.ts +2 -2
- package/dist/services/integration-api/struct/module-file.js +4 -8
- package/dist/services/integration-api/struct/ro-file.d.ts +1 -1
- package/dist/services/integration-api/struct/ro-file.js +1 -5
- package/dist/services/integration-api/struct/server-config-file.d.ts +2 -2
- package/dist/services/integration-api/struct/server-config-file.js +4 -8
- package/dist/services/integration-api/struct/virtual-file.d.ts +1 -1
- package/dist/services/integration-api/struct/virtual-file.js +3 -7
- package/dist/services/integration-api/validator/customer-config-validator.d.ts +1 -1
- package/dist/services/integration-api/validator/customer-config-validator.js +8 -12
- package/dist/services/integration-api/validator/mandatory-files-validator.d.ts +2 -2
- package/dist/services/integration-api/validator/mandatory-files-validator.js +4 -8
- package/dist/services/integration-api/virtual/external-recipe.d.ts +2 -2
- package/dist/services/integration-api/virtual/external-recipe.js +1 -5
- package/dist/services/integration-api/virtual/static-recipe.d.ts +1 -1
- package/dist/services/integration-api/virtual/static-recipe.js +1 -5
- package/dist/services/integration-api/virtual/virtual-file-handler.d.ts +2 -2
- package/dist/services/integration-api/virtual/virtual-file-handler.js +8 -13
- package/dist/services/onboarding/browser/abort-response.js +1 -5
- package/dist/services/onboarding/browser/baqend-response.d.ts +1 -1
- package/dist/services/onboarding/browser/baqend-response.js +1 -5
- package/dist/services/onboarding/browser/config/browser-config.d.ts +1 -1
- package/dist/services/onboarding/browser/config/browser-config.js +15 -20
- package/dist/services/onboarding/browser/executable/executable-validator.d.ts +2 -2
- package/dist/services/onboarding/browser/executable/executable-validator.js +12 -17
- package/dist/services/onboarding/browser/extension/devtools-extension-api.d.ts +1 -1
- package/dist/services/onboarding/browser/extension/devtools-extension-api.js +1 -5
- package/dist/services/onboarding/browser/extension/extension-downloader.d.ts +2 -2
- package/dist/services/onboarding/browser/extension/extension-downloader.js +24 -30
- package/dist/services/onboarding/browser/extension/extension-validator.d.ts +3 -3
- package/dist/services/onboarding/browser/extension/extension-validator.js +18 -23
- package/dist/services/onboarding/browser/origin-response.d.ts +1 -1
- package/dist/services/onboarding/browser/origin-response.js +1 -5
- package/dist/services/onboarding/config-renderer/install-file-recipe.d.ts +2 -2
- package/dist/services/onboarding/config-renderer/install-file-recipe.js +1 -5
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.d.ts +3 -3
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +8 -11
- package/dist/services/onboarding/dashboard/diff-against-current-page.d.ts +4 -4
- package/dist/services/onboarding/dashboard/diff-against-current-page.js +9 -14
- package/dist/services/onboarding/dashboard/index.d.ts +7 -7
- package/dist/services/onboarding/dashboard/index.js +8 -13
- package/dist/services/onboarding/dashboard/parameter-query-builder.d.ts +1 -1
- package/dist/services/onboarding/dashboard/parameter-query-builder.js +9 -13
- package/dist/services/onboarding/dashboard/request-diff-service.d.ts +3 -3
- package/dist/services/onboarding/dashboard/request-diff-service.js +14 -19
- package/dist/services/onboarding/error/browser-extension-error.d.ts +1 -1
- package/dist/services/onboarding/error/browser-extension-error.js +1 -5
- package/dist/services/onboarding/error/document-handler-transform-error.js +1 -5
- package/dist/services/onboarding/error/unsupported-encoding-error.d.ts +1 -1
- package/dist/services/onboarding/error/unsupported-encoding-error.js +2 -7
- package/dist/services/onboarding/error/validate-extension-error.d.ts +1 -1
- package/dist/services/onboarding/error/validate-extension-error.js +2 -7
- package/dist/services/onboarding/error/vm-empty-response-error.d.ts +1 -1
- package/dist/services/onboarding/error/vm-empty-response-error.js +2 -7
- package/dist/services/onboarding/error/vm-error.d.ts +1 -1
- package/dist/services/onboarding/error/vm-error.js +2 -7
- package/dist/services/onboarding/fetch-event-handler.d.ts +4 -4
- package/dist/services/onboarding/fetch-event-handler.js +19 -25
- package/dist/services/onboarding/fetch-events/customer-domain-document-response.d.ts +4 -4
- package/dist/services/onboarding/fetch-events/customer-domain-document-response.js +15 -20
- package/dist/services/onboarding/fetch-events/customer-service-worker-js.d.ts +3 -3
- package/dist/services/onboarding/fetch-events/customer-service-worker-js.js +4 -8
- package/dist/services/onboarding/fetch-events/dashboard-request.d.ts +3 -3
- package/dist/services/onboarding/fetch-events/dashboard-request.js +1 -5
- package/dist/services/onboarding/fetch-events/speed-kit-asset-request.d.ts +5 -5
- package/dist/services/onboarding/fetch-events/speed-kit-asset-request.js +1 -5
- package/dist/services/onboarding/fetch-events/speed-kit-install-html.d.ts +4 -4
- package/dist/services/onboarding/fetch-events/speed-kit-install-html.js +3 -7
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.d.ts +5 -5
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +7 -11
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +6 -6
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.js +4 -8
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +3 -3
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.js +3 -7
- package/dist/services/onboarding/file-events/file-watcher.d.ts +5 -5
- package/dist/services/onboarding/file-events/file-watcher.js +24 -28
- package/dist/services/onboarding/index.d.ts +3 -3
- package/dist/services/onboarding/index.js +3 -8
- package/dist/services/onboarding/onboarding-model.d.ts +21 -23
- package/dist/services/onboarding/onboarding-model.js +22 -27
- package/dist/services/onboarding/onboarding-service-factory.d.ts +3 -3
- package/dist/services/onboarding/onboarding-service-factory.js +102 -108
- package/dist/services/onboarding/onboarding-service.d.ts +6 -6
- package/dist/services/onboarding/onboarding-service.js +12 -18
- package/dist/services/onboarding/request-cache/cache.d.ts +3 -3
- package/dist/services/onboarding/request-cache/cache.js +1 -5
- package/dist/services/onboarding/server-config/index.d.ts +3 -3
- package/dist/services/onboarding/server-config/index.js +6 -11
- package/dist/services/onboarding/templates/install-speed-kit-html-template.d.ts +1 -1
- package/dist/services/onboarding/templates/install-speed-kit-html-template.js +2 -7
- package/dist/services/onboarding/templates/install-speed-kit-js-template.d.ts +1 -1
- package/dist/services/onboarding/templates/install-speed-kit-js-template.js +2 -7
- package/dist/services/onboarding/todo-collector.d.ts +3 -3
- package/dist/services/onboarding/todo-collector.js +3 -7
- package/dist/services/onboarding/virtual-orestes-app/crawler.d.ts +2 -2
- package/dist/services/onboarding/virtual-orestes-app/crawler.js +12 -16
- package/dist/services/onboarding/virtual-orestes-app/index.d.ts +7 -7
- package/dist/services/onboarding/virtual-orestes-app/index.js +25 -32
- package/dist/services/pop-config/index.d.ts +3 -3
- package/dist/services/pop-config/index.js +3 -6
- package/dist/services/pop-config/pop-config-factory.d.ts +1 -1
- package/dist/services/pop-config/pop-config-factory.js +5 -9
- package/dist/services/pop-config/pop-config-model.d.ts +2 -2
- package/dist/services/pop-config/pop-config-model.js +1 -2
- package/dist/services/pop-config/pop-config-service.d.ts +2 -2
- package/dist/services/pop-config/pop-config-service.js +1 -5
- package/dist/services/prewarm/assets/asset-api-client.d.ts +2 -2
- package/dist/services/prewarm/assets/asset-api-client.js +18 -23
- package/dist/services/prewarm/assets/asset-item.d.ts +1 -1
- package/dist/services/prewarm/assets/asset-item.js +6 -10
- package/dist/services/prewarm/assets/asset-list.d.ts +2 -2
- package/dist/services/prewarm/assets/asset-list.js +6 -10
- package/dist/services/prewarm/csv-reader.js +6 -11
- package/dist/services/prewarm/error/invalid-origin-error.d.ts +1 -1
- package/dist/services/prewarm/error/invalid-origin-error.js +2 -7
- package/dist/services/prewarm/error/read-csv-error.d.ts +1 -1
- package/dist/services/prewarm/error/read-csv-error.js +2 -7
- package/dist/services/prewarm/index.d.ts +3 -3
- package/dist/services/prewarm/index.js +3 -6
- package/dist/services/prewarm/pre-warm-factory.d.ts +1 -1
- package/dist/services/prewarm/pre-warm-factory.js +13 -17
- package/dist/services/prewarm/pre-warm-model.js +16 -20
- package/dist/services/prewarm/pre-warm-service.d.ts +3 -3
- package/dist/services/prewarm/pre-warm-service.js +18 -22
- package/dist/services/pull/index.d.ts +3 -3
- package/dist/services/pull/index.js +3 -6
- package/dist/services/pull/pull-service-factory.d.ts +2 -2
- package/dist/services/pull/pull-service-factory.js +12 -16
- package/dist/services/pull/pull-service-model.js +4 -9
- package/dist/services/pull/pull-service.d.ts +3 -3
- package/dist/services/pull/pull-service.js +14 -19
- package/dist/services/query-builder/error/parse-config-speed-kit-error.d.ts +1 -1
- package/dist/services/query-builder/error/parse-config-speed-kit-error.js +2 -6
- package/dist/services/query-builder/query/parameter.js +1 -5
- package/dist/services/query-builder/query/prewarm.js +1 -5
- package/dist/services/query-builder/query-builder-factory.d.ts +3 -3
- package/dist/services/query-builder/query-builder-factory.js +16 -20
- package/dist/services/query-builder/query-builder-model.d.ts +6 -6
- package/dist/services/query-builder/query-builder-model.js +2 -5
- package/dist/services/query-builder/query-builder-service.d.ts +2 -2
- package/dist/services/query-builder/query-builder-service.js +24 -30
- package/oclif.manifest.json +15 -15
- package/package.json +63 -54
- package/dist/dummy.spec.d.ts +0 -1
- package/dist/dummy.spec.js +0 -18
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const cli_1 = require("../../../cli");
|
|
8
|
-
const safe_1 = require("../../../../helpers/safe");
|
|
9
|
-
const node_fs_1 = require("node:fs");
|
|
10
|
-
const browser_extension_error_1 = require("../../error/browser-extension-error");
|
|
11
|
-
class ExtensionValidator {
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { safe } from "../../../../helpers/safe.js";
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
5
|
+
import { BrowserExtensionError } from "../../error/browser-extension-error.js";
|
|
6
|
+
export class ExtensionValidator {
|
|
12
7
|
extensionDownloader;
|
|
13
8
|
cliConfig;
|
|
14
9
|
cli;
|
|
@@ -19,14 +14,14 @@ class ExtensionValidator {
|
|
|
19
14
|
}
|
|
20
15
|
async getValidBrowserExtensionPaths() {
|
|
21
16
|
const validExtensions = [];
|
|
22
|
-
this.cli.startAction("resolve browserExtensions");
|
|
17
|
+
this.cli.startAction("ONBOARDING:RESOLVE:BROWSER_EXTENSION", "resolve browserExtensions");
|
|
23
18
|
const browserExtensions = this.cliConfig.chromeExtensionPaths
|
|
24
19
|
.split(",")
|
|
25
20
|
.filter((entry) => {
|
|
26
21
|
return entry.trim().length > 0;
|
|
27
22
|
});
|
|
28
23
|
for (const extensionPath of browserExtensions) {
|
|
29
|
-
const cleanedExtensionPath =
|
|
24
|
+
const cleanedExtensionPath = path.resolve(extensionPath.trim());
|
|
30
25
|
const manifestConfig = await this.getManifestConfig(cleanedExtensionPath);
|
|
31
26
|
if (!manifestConfig) {
|
|
32
27
|
continue;
|
|
@@ -37,25 +32,26 @@ class ExtensionValidator {
|
|
|
37
32
|
version: manifestConfig.version,
|
|
38
33
|
});
|
|
39
34
|
}
|
|
40
|
-
this.cli.
|
|
35
|
+
this.cli.successAction("ONBOARDING:RESOLVE:BROWSER_EXTENSION");
|
|
41
36
|
this.cli.spacer();
|
|
42
37
|
await this.handleDevtoolsExtension(validExtensions);
|
|
43
38
|
if (validExtensions.length > 0) {
|
|
39
|
+
// @ts-expect-error typeMissMatch
|
|
44
40
|
this.cli.table(validExtensions, { name: {}, version: {}, path: {} });
|
|
45
41
|
}
|
|
46
42
|
return validExtensions.map((config) => config.path);
|
|
47
43
|
}
|
|
48
44
|
async getManifestConfig(cleanedExtensionPath) {
|
|
49
|
-
const manifestPath =
|
|
50
|
-
if (!
|
|
51
|
-
throw new
|
|
45
|
+
const manifestPath = path.resolve(cleanedExtensionPath, "manifest.json");
|
|
46
|
+
if (!existsSync(manifestPath)) {
|
|
47
|
+
throw new BrowserExtensionError(`Could not find browserExtensionPath: "${cleanedExtensionPath}"`);
|
|
52
48
|
}
|
|
53
|
-
const manifestFile = await
|
|
54
|
-
const result =
|
|
49
|
+
const manifestFile = await readFile(manifestPath, "utf8");
|
|
50
|
+
const result = safe(() => {
|
|
55
51
|
return JSON.parse(manifestFile);
|
|
56
52
|
});
|
|
57
53
|
if (result.success !== true) {
|
|
58
|
-
throw new
|
|
54
|
+
throw new BrowserExtensionError(`could not find valid manifestFile in: "${manifestPath}"`);
|
|
59
55
|
}
|
|
60
56
|
return result.data;
|
|
61
57
|
}
|
|
@@ -65,7 +61,7 @@ class ExtensionValidator {
|
|
|
65
61
|
return;
|
|
66
62
|
}
|
|
67
63
|
// download or update extension
|
|
68
|
-
const result = await
|
|
64
|
+
const result = await safe(this.extensionDownloader.downloadExtension());
|
|
69
65
|
if (result.success !== true) {
|
|
70
66
|
this.cli.writeError(result?.error);
|
|
71
67
|
return;
|
|
@@ -75,7 +71,7 @@ class ExtensionValidator {
|
|
|
75
71
|
return;
|
|
76
72
|
}
|
|
77
73
|
// get extensionDetails from manifestFile
|
|
78
|
-
const extensionConfigResult = await
|
|
74
|
+
const extensionConfigResult = await safe(this.getManifestConfig(result.data));
|
|
79
75
|
if (extensionConfigResult.success !== true) {
|
|
80
76
|
this.cli.writeError(extensionConfigResult.error);
|
|
81
77
|
return;
|
|
@@ -87,4 +83,3 @@ class ExtensionValidator {
|
|
|
87
83
|
});
|
|
88
84
|
}
|
|
89
85
|
}
|
|
90
|
-
exports.ExtensionValidator = ExtensionValidator;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Protocol from "devtools-protocol";
|
|
1
|
+
import { Protocol } from "devtools-protocol";
|
|
2
2
|
export declare class OriginResponse implements Partial<Protocol.Fetch.FulfillRequestRequest> {
|
|
3
3
|
readonly responseCode: number;
|
|
4
4
|
readonly responseHeaders: Protocol.Fetch.HeaderEntry[];
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OriginResponse = void 0;
|
|
4
|
-
class OriginResponse {
|
|
1
|
+
export class OriginResponse {
|
|
5
2
|
responseCode;
|
|
6
3
|
responseHeaders;
|
|
7
4
|
body;
|
|
@@ -17,4 +14,3 @@ class OriginResponse {
|
|
|
17
14
|
return headers;
|
|
18
15
|
}
|
|
19
16
|
}
|
|
20
|
-
exports.OriginResponse = OriginResponse;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VirtualFileRecipe } from "../../integration-api/integration-api-model";
|
|
2
|
-
import { SpeedKitInstallContext } from "./speed-kit-install-context";
|
|
1
|
+
import { VirtualFileRecipe } from "../../integration-api/integration-api-model.js";
|
|
2
|
+
import { SpeedKitInstallContext } from "./speed-kit-install-context.js";
|
|
3
3
|
export declare class InstallFileRecipe implements VirtualFileRecipe {
|
|
4
4
|
private installContext;
|
|
5
5
|
constructor(installContext: SpeedKitInstallContext);
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InstallFileRecipe = void 0;
|
|
4
|
-
class InstallFileRecipe {
|
|
1
|
+
export class InstallFileRecipe {
|
|
5
2
|
installContext;
|
|
6
3
|
constructor(installContext) {
|
|
7
4
|
this.installContext = installContext;
|
|
@@ -10,4 +7,3 @@ class InstallFileRecipe {
|
|
|
10
7
|
return this.installContext.getSpeedKitInstallJs();
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.InstallFileRecipe = InstallFileRecipe;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InstallSpeedKitJsTemplate } from "../templates/install-speed-kit-js-template";
|
|
2
|
-
import { BundleService } from "../../bundler";
|
|
3
|
-
import { FileListInterface, CustomerConfig } from "../../integration-api";
|
|
1
|
+
import { InstallSpeedKitJsTemplate } from "../templates/install-speed-kit-js-template.js";
|
|
2
|
+
import { BundleService } from "../../bundler/index.js";
|
|
3
|
+
import { FileListInterface, CustomerConfig } from "../../integration-api/index.js";
|
|
4
4
|
export declare class SpeedKitInstallContext {
|
|
5
5
|
private customerConfig;
|
|
6
6
|
private configName;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SpeedKitInstallContext = void 0;
|
|
4
|
-
const files_1 = require("../../../models/files");
|
|
1
|
+
import { INTEGRATION_FILES } from "../../../models/files.js";
|
|
5
2
|
const IMPORT_PATHS = {
|
|
6
3
|
rum: "https://www.baqend.com/rum/latest/",
|
|
7
4
|
"speed-kit": "https://www.baqend.com/speed-kit/latest/",
|
|
8
5
|
"speed-kit-config": "https://www.baqend.com/speed-kit-config/latest/",
|
|
9
6
|
"predictive-preloading": "https://www.baqend.com/speed-kit-predictive-preloading/latest/",
|
|
10
7
|
};
|
|
11
|
-
class SpeedKitInstallContext {
|
|
8
|
+
export class SpeedKitInstallContext {
|
|
12
9
|
customerConfig;
|
|
13
10
|
configName;
|
|
14
11
|
files;
|
|
@@ -31,7 +28,7 @@ class SpeedKitInstallContext {
|
|
|
31
28
|
installParams: this.customerConfig.installParams,
|
|
32
29
|
domain: this.customerConfig.domain,
|
|
33
30
|
df: this.files
|
|
34
|
-
.getByName(
|
|
31
|
+
.getByName(INTEGRATION_FILES.CUSTOM.DYNAMIC_FETCHER)
|
|
35
32
|
.getContent(),
|
|
36
33
|
});
|
|
37
34
|
return this.bundler.bundle({
|
|
@@ -40,11 +37,12 @@ class SpeedKitInstallContext {
|
|
|
40
37
|
"rum.js": this.prepareConfigLoadHandler(),
|
|
41
38
|
"config.js": configJs,
|
|
42
39
|
"loader.js": this.files
|
|
43
|
-
.getByName(
|
|
40
|
+
.getByName(INTEGRATION_FILES.CUSTOM.LOADER)
|
|
44
41
|
.getContent(),
|
|
45
42
|
},
|
|
46
43
|
logLevel: "error",
|
|
47
44
|
minify: false,
|
|
45
|
+
platform: "browser",
|
|
48
46
|
define: {
|
|
49
47
|
APP: JSON.stringify(this.customerConfig.app),
|
|
50
48
|
},
|
|
@@ -52,7 +50,7 @@ class SpeedKitInstallContext {
|
|
|
52
50
|
}
|
|
53
51
|
prepareConfigLoadHandler() {
|
|
54
52
|
return this.files
|
|
55
|
-
.getByName(
|
|
53
|
+
.getByName(INTEGRATION_FILES.CONFIG.LOAD_HANDLER)
|
|
56
54
|
.getContent();
|
|
57
55
|
// todo reimplement debug package for local use
|
|
58
56
|
// if (
|
|
@@ -68,7 +66,7 @@ class SpeedKitInstallContext {
|
|
|
68
66
|
}
|
|
69
67
|
getConfigSpeedKit() {
|
|
70
68
|
const configString = this.files
|
|
71
|
-
.getByName(
|
|
69
|
+
.getByName(INTEGRATION_FILES.CONFIG.SPEED_KIT)
|
|
72
70
|
.getContent();
|
|
73
71
|
if (!this.isLocalRuntime) {
|
|
74
72
|
return configString;
|
|
@@ -93,7 +91,7 @@ class SpeedKitInstallContext {
|
|
|
93
91
|
basePaths: {},
|
|
94
92
|
entryPoints: {
|
|
95
93
|
"dynamicFetcher.js": this.files
|
|
96
|
-
.getByName(
|
|
94
|
+
.getByName(INTEGRATION_FILES.CUSTOM.DYNAMIC_FETCHER)
|
|
97
95
|
.getContent(),
|
|
98
96
|
},
|
|
99
97
|
target: "es6",
|
|
@@ -103,4 +101,3 @@ class SpeedKitInstallContext {
|
|
|
103
101
|
});
|
|
104
102
|
}
|
|
105
103
|
}
|
|
106
|
-
exports.SpeedKitInstallContext = SpeedKitInstallContext;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DiffService } from "../../diff";
|
|
2
|
-
import { DocumentHandlerServer } from "../../document-handler-runtime/document-handler-server";
|
|
3
|
-
import { Crawler } from "../virtual-orestes-app/crawler";
|
|
4
|
-
import { CliService } from "../../cli";
|
|
1
|
+
import { DiffService } from "../../diff/index.js";
|
|
2
|
+
import { DocumentHandlerServer } from "../../document-handler-runtime/document-handler-server.js";
|
|
3
|
+
import { Crawler } from "../virtual-orestes-app/crawler.js";
|
|
4
|
+
import { CliService } from "../../cli/index.js";
|
|
5
5
|
export declare class DiffAgainstCurrentPage {
|
|
6
6
|
private diffService;
|
|
7
7
|
private documentHandlerRuntime;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.DiffAgainstCurrentPage = void 0;
|
|
4
|
-
const cli_1 = require("../../cli");
|
|
5
|
-
const html_format_helper_1 = require("../../../helpers/html-format-helper");
|
|
6
|
-
class DiffAgainstCurrentPage {
|
|
1
|
+
import { formatHtml } from "../../../helpers/html-format-helper.js";
|
|
2
|
+
export class DiffAgainstCurrentPage {
|
|
7
3
|
diffService;
|
|
8
4
|
documentHandlerRuntime;
|
|
9
5
|
crawler;
|
|
@@ -16,15 +12,15 @@ class DiffAgainstCurrentPage {
|
|
|
16
12
|
}
|
|
17
13
|
async postDiff(currentHtml, currentUrl, variant = "default", transform = false) {
|
|
18
14
|
this.cli.writeWarning(`received diff for url: ${currentUrl}`);
|
|
19
|
-
this.cli.startAction(`fetch remote`);
|
|
15
|
+
this.cli.startAction(`DIFF:FETCH:FILE:${currentUrl}`, `fetch remote`);
|
|
20
16
|
const originResponse = await this.crawler.fetchRemote(currentUrl, variant);
|
|
21
17
|
let originHtml = await originResponse?.text();
|
|
22
18
|
if (!originHtml) {
|
|
23
|
-
this.cli.
|
|
19
|
+
this.cli.failAction(`DIFF:FETCH:FILE:${currentUrl}`);
|
|
24
20
|
throw new Error("Could not fetch remote page");
|
|
25
21
|
}
|
|
26
|
-
this.cli.
|
|
27
|
-
this.cli.startAction(`transform documents`);
|
|
22
|
+
this.cli.successAction(`DIFF:FETCH:FILE:${currentUrl}`);
|
|
23
|
+
this.cli.startAction(`DIFF:TRANSFORM:FILE:${currentUrl}`, `transform documents`);
|
|
28
24
|
if (transform) {
|
|
29
25
|
// todo check if the currentHTML is already transformed
|
|
30
26
|
// TODO: we may need to forward the correct content type from the origin response
|
|
@@ -42,10 +38,9 @@ class DiffAgainstCurrentPage {
|
|
|
42
38
|
}
|
|
43
39
|
originHtml = originResponse;
|
|
44
40
|
}
|
|
45
|
-
this.cli.
|
|
46
|
-
const remoteFilePath = await this.diffService.writeContentToTemporalFile(`remote-${variant}.html`,
|
|
47
|
-
const localFilePath = await this.diffService.writeContentToTemporalFile("current.html",
|
|
41
|
+
this.cli.successAction(`DIFF:TRANSFORM:FILE:${currentUrl}`);
|
|
42
|
+
const remoteFilePath = await this.diffService.writeContentToTemporalFile(`remote-${variant}.html`, formatHtml(originHtml));
|
|
43
|
+
const localFilePath = await this.diffService.writeContentToTemporalFile("current.html", formatHtml(currentHtml));
|
|
48
44
|
return await this.diffService.executeDiff(remoteFilePath, localFilePath);
|
|
49
45
|
}
|
|
50
46
|
}
|
|
51
|
-
exports.DiffAgainstCurrentPage = DiffAgainstCurrentPage;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { BaqendResponse } from "../browser/baqend-response";
|
|
1
|
+
import { BaqendResponse } from "../browser/baqend-response.js";
|
|
2
2
|
import { Protocol } from "devtools-protocol";
|
|
3
|
-
import { ParameterQueryBuilder } from "./parameter-query-builder";
|
|
4
|
-
import { CustomerConfig } from "../../integration-api";
|
|
5
|
-
import { RequestDiffService } from "./request-diff-service";
|
|
6
|
-
import { Cache } from "../request-cache/cache";
|
|
7
|
-
import { AthenaService } from "../../athena";
|
|
8
|
-
import { DiffAgainstCurrentPage } from "./diff-against-current-page";
|
|
3
|
+
import { ParameterQueryBuilder } from "./parameter-query-builder.js";
|
|
4
|
+
import { CustomerConfig } from "../../integration-api/index.js";
|
|
5
|
+
import { RequestDiffService } from "./request-diff-service.js";
|
|
6
|
+
import { Cache } from "../request-cache/cache.js";
|
|
7
|
+
import { AthenaService } from "../../athena/index.js";
|
|
8
|
+
import { DiffAgainstCurrentPage } from "./diff-against-current-page.js";
|
|
9
9
|
export declare class Dashboard {
|
|
10
10
|
private customerConfig;
|
|
11
11
|
private parameterQueryBuilder;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const baqend_response_1 = require("../browser/baqend-response");
|
|
6
|
-
const safe_1 = require("../../../helpers/safe");
|
|
7
|
-
const json2csv_1 = tslib_1.__importDefault(require("json2csv"));
|
|
8
|
-
class Dashboard {
|
|
1
|
+
import { BaqendResponse } from "../browser/baqend-response.js";
|
|
2
|
+
import { safe } from "../../../helpers/safe.js";
|
|
3
|
+
import json2Csv from "json2csv";
|
|
4
|
+
export class Dashboard {
|
|
9
5
|
customerConfig;
|
|
10
6
|
parameterQueryBuilder;
|
|
11
7
|
athenaClient;
|
|
@@ -36,7 +32,7 @@ class Dashboard {
|
|
|
36
32
|
if (url.pathname.startsWith("/query/execute")) {
|
|
37
33
|
const postData = request.postData;
|
|
38
34
|
const data = JSON.parse(postData);
|
|
39
|
-
const response = await
|
|
35
|
+
const response = await safe(this.athenaClient.getResult(data.query, []));
|
|
40
36
|
if (response.success === true) {
|
|
41
37
|
return this.createBaqendResponse(requestOrigin, JSON.stringify(response.data), "application/json; charset=UTF-8");
|
|
42
38
|
}
|
|
@@ -45,7 +41,7 @@ class Dashboard {
|
|
|
45
41
|
// @todo reImplement getLastResult
|
|
46
42
|
if (url.pathname.startsWith("/query/download")) {
|
|
47
43
|
const result = this.athenaLastResult;
|
|
48
|
-
const csv =
|
|
44
|
+
const csv = json2Csv.parse(result, {
|
|
49
45
|
fields: [
|
|
50
46
|
"paramKeys",
|
|
51
47
|
"potentialGain",
|
|
@@ -78,7 +74,7 @@ class Dashboard {
|
|
|
78
74
|
const currentUrl = data.currentUrl;
|
|
79
75
|
const variant = data.variant || "DEFAULT";
|
|
80
76
|
const transform = data.transform || false;
|
|
81
|
-
const diffResult = await
|
|
77
|
+
const diffResult = await safe(this.currentPageDiff.postDiff(currentHtml, currentUrl, variant, transform));
|
|
82
78
|
if (diffResult.success === true) {
|
|
83
79
|
return this.createBaqendResponse(requestOrigin, JSON.stringify({ success: diffResult.data }), "application/json; charset=UTF-8", [], 200);
|
|
84
80
|
}
|
|
@@ -101,7 +97,6 @@ class Dashboard {
|
|
|
101
97
|
name: "Access-Control-Allow-Headers",
|
|
102
98
|
value: "Content-Type,Access-Control-Allow-Origin,origin",
|
|
103
99
|
});
|
|
104
|
-
return new
|
|
100
|
+
return new BaqendResponse(body, contentType, headers, status);
|
|
105
101
|
}
|
|
106
102
|
}
|
|
107
|
-
exports.Dashboard = Dashboard;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const build_query_helper_1 = require("../../../helpers/build-query-helper");
|
|
5
|
-
const get_parsed_config_1 = require("../../../helpers/get-parsed-config");
|
|
6
|
-
class ParameterQueryBuilder {
|
|
1
|
+
import { getBlacklistedFilter, getParameterFilter, getParameterReplaceFilter, getStrippedParameters, getWhitelistedFilter, } from "../../../helpers/build-query-helper.js";
|
|
2
|
+
import { parseSpeedKitConfig } from "../../../helpers/get-parsed-config.js";
|
|
3
|
+
export class ParameterQueryBuilder {
|
|
7
4
|
customerConfig;
|
|
8
5
|
speedKitConfigFile;
|
|
9
6
|
constructor(customerConfig, speedKitConfigFile) {
|
|
@@ -55,13 +52,12 @@ order by case when potentialGain > cachedUrls and potentialGain > PIs then poten
|
|
|
55
52
|
else PIs end desc`;
|
|
56
53
|
}
|
|
57
54
|
getQuery() {
|
|
58
|
-
const parsedConfig =
|
|
59
|
-
const parameters =
|
|
60
|
-
const parameterFilter =
|
|
61
|
-
const whitelistedFilter =
|
|
62
|
-
const blacklistedFilter =
|
|
63
|
-
const parameterReplaceFilter =
|
|
55
|
+
const parsedConfig = parseSpeedKitConfig(this.speedKitConfigFile.getContent());
|
|
56
|
+
const parameters = getStrippedParameters(parsedConfig);
|
|
57
|
+
const parameterFilter = getParameterFilter(parameters);
|
|
58
|
+
const whitelistedFilter = getWhitelistedFilter(parsedConfig);
|
|
59
|
+
const blacklistedFilter = getBlacklistedFilter(parsedConfig);
|
|
60
|
+
const parameterReplaceFilter = getParameterReplaceFilter(parameters);
|
|
64
61
|
return this.buildParameterQuery(this.customerConfig.app, parameterFilter, whitelistedFilter, blacklistedFilter, parameterReplaceFilter);
|
|
65
62
|
}
|
|
66
63
|
}
|
|
67
|
-
exports.ParameterQueryBuilder = ParameterQueryBuilder;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DiffService } from "../../diff";
|
|
2
|
-
import { BaqendResponse } from "../browser/baqend-response";
|
|
3
|
-
import { DocumentHandlerServer } from "../../document-handler-runtime/document-handler-server";
|
|
1
|
+
import { DiffService } from "../../diff/index.js";
|
|
2
|
+
import { BaqendResponse } from "../browser/baqend-response.js";
|
|
3
|
+
import { DocumentHandlerServer } from "../../document-handler-runtime/document-handler-server.js";
|
|
4
4
|
export declare class RequestDiffService {
|
|
5
5
|
private diffService;
|
|
6
6
|
private documentHandlerRuntime;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const node_crypto_1 = tslib_1.__importDefault(require("node:crypto"));
|
|
9
|
-
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
10
|
-
const html_format_helper_1 = require("../../../helpers/html-format-helper");
|
|
11
|
-
class RequestDiffService {
|
|
1
|
+
import { BaqendResponse } from "../browser/baqend-response.js";
|
|
2
|
+
import { safe } from "../../../helpers/safe.js";
|
|
3
|
+
import { Agent } from "node:https";
|
|
4
|
+
import crypto from "node:crypto";
|
|
5
|
+
import fetch from "node-fetch";
|
|
6
|
+
import { formatHtml } from "../../../helpers/html-format-helper.js";
|
|
7
|
+
export class RequestDiffService {
|
|
12
8
|
diffService;
|
|
13
9
|
documentHandlerRuntime;
|
|
14
10
|
constructor(diffService, documentHandlerRuntime) {
|
|
@@ -24,7 +20,7 @@ class RequestDiffService {
|
|
|
24
20
|
return parameter.trim();
|
|
25
21
|
});
|
|
26
22
|
const { urlWithParam, urlWithoutParam } = this.createUrlsForDiff(url, parameters);
|
|
27
|
-
const result = await
|
|
23
|
+
const result = await safe(this.diffLocal(urlWithParam, urlWithoutParam, autoCheck));
|
|
28
24
|
if (result.success === true) {
|
|
29
25
|
return this.createBaqendResponse(requestOrigin, JSON.stringify({
|
|
30
26
|
status: "success",
|
|
@@ -60,17 +56,17 @@ class RequestDiffService {
|
|
|
60
56
|
if (checkIsEqual) {
|
|
61
57
|
return this.diffService.isContentEqual(transformedHtmlWithParameter, transformedHtmlWithoutParameter);
|
|
62
58
|
}
|
|
63
|
-
const parametersFilePath = await this.diffService.writeContentToTemporalFile("params",
|
|
64
|
-
const pureFilePath = await this.diffService.writeContentToTemporalFile("pure",
|
|
59
|
+
const parametersFilePath = await this.diffService.writeContentToTemporalFile("params", formatHtml(transformedHtmlWithParameter));
|
|
60
|
+
const pureFilePath = await this.diffService.writeContentToTemporalFile("pure", formatHtml(transformedHtmlWithoutParameter));
|
|
65
61
|
return await this.diffService.executeDiff(parametersFilePath, pureFilePath);
|
|
66
62
|
}
|
|
67
63
|
async fetchHtml(url) {
|
|
68
|
-
const agent = new
|
|
64
|
+
const agent = new Agent({
|
|
69
65
|
rejectUnauthorized: false,
|
|
70
66
|
keepAlive: true,
|
|
71
|
-
secureOptions:
|
|
67
|
+
secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT,
|
|
72
68
|
});
|
|
73
|
-
const response = await
|
|
69
|
+
const response = await safe(fetch(url, {
|
|
74
70
|
agent: agent,
|
|
75
71
|
headers: {
|
|
76
72
|
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36 SpeedKitCrawler/1.0",
|
|
@@ -103,7 +99,6 @@ class RequestDiffService {
|
|
|
103
99
|
name: "Access-Control-Allow-Headers",
|
|
104
100
|
value: "Content-Type,Access-Control-Allow-Origin,origin",
|
|
105
101
|
});
|
|
106
|
-
return new
|
|
102
|
+
return new BaqendResponse(body, contentType, headers, status);
|
|
107
103
|
}
|
|
108
104
|
}
|
|
109
|
-
exports.RequestDiffService = RequestDiffService;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PrettyPrintableError } from "@oclif/core/
|
|
1
|
+
import { PrettyPrintableError } from "@oclif/core/errors";
|
|
2
2
|
export declare class BrowserExtensionError extends Error implements PrettyPrintableError {
|
|
3
3
|
readonly code = "BROWSER_EXTENSION_ERROR";
|
|
4
4
|
readonly suggestions: string[];
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BrowserExtensionError = void 0;
|
|
4
|
-
class BrowserExtensionError extends Error {
|
|
1
|
+
export class BrowserExtensionError extends Error {
|
|
5
2
|
code = "BROWSER_EXTENSION_ERROR";
|
|
6
3
|
suggestions = [
|
|
7
4
|
"check paths in env $CHROME_EXTENSION_PATHS",
|
|
@@ -9,4 +6,3 @@ class BrowserExtensionError extends Error {
|
|
|
9
6
|
`"chromeExtensionPaths:" in .config/speed-kit-cli/config.js`,
|
|
10
7
|
];
|
|
11
8
|
}
|
|
12
|
-
exports.BrowserExtensionError = BrowserExtensionError;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DocumentHandlerTransformError = void 0;
|
|
4
|
-
class DocumentHandlerTransformError extends Error {
|
|
1
|
+
export class DocumentHandlerTransformError extends Error {
|
|
5
2
|
constructor(error) {
|
|
6
3
|
super(error.message);
|
|
7
4
|
this.stack = error.stack;
|
|
8
5
|
this.cause = error.cause;
|
|
9
6
|
}
|
|
10
7
|
}
|
|
11
|
-
exports.DocumentHandlerTransformError = DocumentHandlerTransformError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ApplicationError from "../../error-handling/error/application-error";
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
2
|
export declare class UnsupportedEncodingError extends ApplicationError {
|
|
3
3
|
readonly code = "REQUEST_ENCODING_UNSUPPORTED";
|
|
4
4
|
readonly suggestions: string[];
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.UnsupportedEncodingError = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
-
class UnsupportedEncodingError extends application_error_1.default {
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
|
+
export class UnsupportedEncodingError extends ApplicationError {
|
|
7
3
|
code = "REQUEST_ENCODING_UNSUPPORTED";
|
|
8
4
|
suggestions = [
|
|
9
5
|
"Needs to be fixed by a developer.",
|
|
@@ -11,4 +7,3 @@ class UnsupportedEncodingError extends application_error_1.default {
|
|
|
11
7
|
"If iconv can't handle it we need a special library",
|
|
12
8
|
];
|
|
13
9
|
}
|
|
14
|
-
exports.UnsupportedEncodingError = UnsupportedEncodingError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ApplicationError from "../../error-handling/error/application-error";
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
2
|
export declare class ValidateExtensionError extends ApplicationError {
|
|
3
3
|
readonly code = "VALIDATE_EXTENSION_ERROR";
|
|
4
4
|
constructor(localVersion: string, remoteVersion: string);
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ValidateExtensionError = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
-
class ValidateExtensionError extends application_error_1.default {
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
|
+
export class ValidateExtensionError extends ApplicationError {
|
|
7
3
|
code = "VALIDATE_EXTENSION_ERROR";
|
|
8
4
|
constructor(localVersion, remoteVersion) {
|
|
9
5
|
super(`Unable to validate Versions: "${localVersion}" - "${remoteVersion}"`);
|
|
10
6
|
}
|
|
11
7
|
}
|
|
12
|
-
exports.ValidateExtensionError = ValidateExtensionError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ApplicationError from "../../error-handling/error/application-error";
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
2
|
export declare class VmEmptyResponseError extends ApplicationError {
|
|
3
3
|
readonly code = "VM_EMPTY_RESPONSE_ERROR";
|
|
4
4
|
readonly suggestions: string[];
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.VmEmptyResponseError = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
-
class VmEmptyResponseError extends application_error_1.default {
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
|
+
export class VmEmptyResponseError extends ApplicationError {
|
|
7
3
|
code = "VM_EMPTY_RESPONSE_ERROR";
|
|
8
4
|
suggestions = [
|
|
9
5
|
"You may forgot to return html somewhere, check config_documentHandler!",
|
|
10
6
|
];
|
|
11
7
|
}
|
|
12
|
-
exports.VmEmptyResponseError = VmEmptyResponseError;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.VmError = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
-
class VmError extends application_error_1.default {
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
|
+
export class VmError extends ApplicationError {
|
|
7
3
|
code = "VM_FILE_ERROR";
|
|
8
4
|
}
|
|
9
|
-
exports.VmError = VmError;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FetchRequestPausedEventHandler } from "./onboarding-model";
|
|
1
|
+
import { FetchRequestPausedEventHandler } from "./onboarding-model.js";
|
|
2
2
|
import { Protocol } from "puppeteer-core";
|
|
3
3
|
import { CDPSession, Target } from "puppeteer";
|
|
4
|
-
import { CliService } from "../cli";
|
|
5
|
-
import { CustomerConfig } from "../integration-api";
|
|
6
|
-
import { ConfigApiService } from "../config-api";
|
|
4
|
+
import { CliService } from "../cli/index.js";
|
|
5
|
+
import { CustomerConfig } from "../integration-api/index.js";
|
|
6
|
+
import { ConfigApiService } from "../config-api/index.js";
|
|
7
7
|
export declare class FetchEventHandler {
|
|
8
8
|
private browserFetchEvents;
|
|
9
9
|
private customerConfig;
|