@speedkit/cli 4.36.0 → 4.36.1
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 +8 -0
- package/README.md +3 -29
- package/dist/commands/auto-prewarm.js +1 -1
- package/dist/commands/browser/clean.js +1 -2
- package/dist/commands/browser/list.js +1 -2
- package/dist/commands/browser/update.js +1 -2
- package/dist/commands/bulk-deploy.js +1 -1
- package/dist/commands/config/setup.js +4 -3
- package/dist/commands/deploy.js +3 -2
- package/dist/commands/diff-url-parameters.d.ts +2 -2
- package/dist/commands/diff-url-parameters.js +12 -5
- package/dist/commands/extension/add.js +1 -1
- package/dist/commands/extension/devtools.js +1 -1
- package/dist/commands/extension/list.js +1 -1
- package/dist/commands/extension/remove.js +1 -1
- package/dist/commands/extension/update.js +1 -1
- package/dist/commands/find-pops.js +3 -2
- package/dist/commands/generate-pop-config.js +9 -13
- package/dist/commands/onboarding.js +1 -1
- package/dist/commands/origin-request.js +1 -1
- package/dist/commands/pull.js +1 -1
- package/dist/commands/revalidate.js +4 -3
- package/dist/commands/wpt-launcher.js +3 -2
- package/dist/helpers/{chrome-flags.spec.js → spec/chrome-flags.spec.js} +1 -1
- package/dist/helpers/{origin-proxy.spec.js → spec/origin-proxy.spec.js} +1 -1
- package/dist/hooks/init/first-run.js +3 -3
- package/dist/hooks/{init → spec/init}/dns-result-order.spec.js +1 -1
- package/dist/hooks/{init → spec/init}/http1-global-dispatcher.spec.js +1 -1
- package/dist/models/cli-parameters.d.ts +0 -2
- package/dist/models/cli-parameters.js +0 -2
- package/dist/models/{cli-parameters.spec.js → spec/cli-parameters.spec.js} +1 -1
- package/dist/services/athena/athena-service-factory.d.ts +3 -1
- package/dist/services/athena/athena-service-factory.js +4 -2
- package/dist/services/athena/{athena-service.spec.js → spec/athena-service.spec.js} +1 -1
- package/dist/services/athena/{baqend-athena-service.spec.js → spec/baqend-athena-service.spec.js} +2 -2
- package/dist/services/browser-fetch/browser-origin-fetch.d.ts +1 -1
- package/dist/services/browser-fetch/browser-origin-fetcher.d.ts +1 -1
- package/dist/services/browser-fetch/{browser-origin-fetch.spec.js → spec/browser-origin-fetch.spec.js} +2 -2
- package/dist/services/browser-fetch/{browser-origin-fetcher.spec.js → spec/browser-origin-fetcher.spec.js} +1 -1
- package/dist/services/browser-fetch/{browser-response.spec.js → spec/browser-response.spec.js} +1 -1
- package/dist/services/browser-fetch/{device-emulation.spec.js → spec/device-emulation.spec.js} +2 -2
- package/dist/services/bundler/{bundle-service.spec.js → spec/bundle-service.spec.js} +1 -1
- package/dist/{helpers → services/cli}/cli-config.js +1 -1
- package/dist/services/cli/cli-service-factory.d.ts +10 -2
- package/dist/services/cli/cli-service-factory.js +11 -9
- package/dist/services/cli/cli-service-model.d.ts +10 -2
- package/dist/services/cli/cli-service.d.ts +37 -0
- package/dist/services/cli/cli-service.js +48 -1
- package/dist/{helpers/clipboard.d.ts → services/cli/clipboard/clipboard-service.d.ts} +3 -1
- package/dist/{helpers/clipboard.js → services/cli/clipboard/clipboard-service.js} +6 -1
- package/dist/services/cli/clipboard/index.d.ts +1 -0
- package/dist/services/cli/clipboard/index.js +1 -0
- package/dist/services/cli/index.d.ts +1 -0
- package/dist/services/cli/index.js +1 -0
- package/dist/{helpers → services/cli/spec}/cli-config.spec.js +1 -1
- package/dist/services/cli/{cli-service.spec.js → spec/cli-service.spec.js} +1 -1
- package/dist/{helpers → services/cli/spec}/environment.spec.js +1 -1
- package/dist/services/customer-config/customer-config-service-factory.d.ts +3 -1
- package/dist/services/customer-config/customer-config-service-factory.js +7 -3
- package/dist/services/customer-config/customer-config-service.d.ts +4 -2
- package/dist/services/customer-config/customer-config-service.js +4 -3
- package/dist/services/customer-config/site-analyzer/index.d.ts +3 -0
- package/dist/services/customer-config/site-analyzer/index.js +3 -0
- package/dist/{helpers/site-analyzer.d.ts → services/customer-config/site-analyzer/site-analyzer-model.d.ts} +0 -1
- package/dist/services/customer-config/site-analyzer/site-analyzer-service-factory.d.ts +7 -0
- package/dist/services/customer-config/site-analyzer/site-analyzer-service-factory.js +11 -0
- package/dist/services/customer-config/site-analyzer/site-analyzer-service.d.ts +16 -0
- package/dist/{helpers/site-analyzer.js → services/customer-config/site-analyzer/site-analyzer-service.js} +20 -5
- package/dist/services/deploy/bulk/bulk-deploy-service-factory.d.ts +1 -1
- package/dist/services/deploy/bulk/config-deploy-factory.d.ts +1 -1
- package/dist/services/deploy/checks/post-deploy/deprecated-deployment-detection-check.d.ts +2 -2
- package/dist/services/deploy/checks/post-deploy/refresh-deployment-job-check.d.ts +2 -2
- package/dist/services/deploy/checks/post-deploy/revalidated-module-check.d.ts +2 -2
- package/dist/services/deploy/checks/post-deploy/save-files-check.d.ts +2 -2
- package/dist/services/deploy/context/deploy-context.js +1 -1
- package/dist/services/deploy/deploy-service-factory.d.ts +3 -2
- package/dist/services/deploy/deploy-service-factory.js +9 -7
- package/dist/services/deploy/deploy-service.d.ts +2 -2
- package/dist/services/deploy/handler/customer-config-handler.d.ts +2 -2
- package/dist/services/deploy/handler/install-resource-handler.d.ts +2 -2
- package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.d.ts +2 -2
- package/dist/services/deploy/handler/module-handler.d.ts +2 -2
- package/dist/services/deploy/handler/server-config-handler.d.ts +2 -2
- package/dist/services/deploy/mr/base-config-reader.d.ts +1 -1
- package/dist/services/deploy/mr/base-config-reader.js +8 -5
- package/dist/services/deploy/mr/merge-request-deploy-service-factory.d.ts +1 -1
- package/dist/services/deploy/{bulk → spec/bulk}/bulk-deploy-service.spec.js +5 -5
- package/dist/services/deploy/{bulk → spec/bulk}/touched-configs.spec.js +2 -2
- package/dist/services/deploy/{checks → spec/checks}/activation/customer-approval-check.spec.js +2 -2
- package/dist/services/deploy/{checks → spec/checks}/post-deploy/refresh-deployment-job-check.spec.js +2 -2
- package/dist/services/deploy/{checks → spec/checks}/pre-deploy/split-change-check.spec.js +3 -3
- package/dist/services/deploy/{handler → spec/handler}/module-handler.spec.js +2 -2
- package/dist/services/deploy/{handler → spec/handler}/testing-installation-links.spec.js +1 -1
- package/dist/services/deploy/{mr → spec/mr}/live-state-check.spec.js +2 -2
- package/dist/services/deploy/{mr → spec/mr}/merge-request-description.spec.js +1 -1
- package/dist/services/deploy/{policy → spec/policy}/auto-deploy-policy.spec.js +2 -2
- package/dist/services/diff/diff-service-factory.d.ts +3 -1
- package/dist/services/diff/diff-service-factory.js +4 -2
- package/dist/services/diff/diff-service.d.ts +10 -2
- package/dist/services/diff/diff-service.js +26 -3
- package/dist/services/diff/index.d.ts +1 -0
- package/dist/services/diff/index.js +1 -0
- package/dist/services/document-handler-runtime/context/document-handler-runtime-context.d.ts +2 -14
- package/dist/services/document-handler-runtime/context/document-handler-runtime-context.js +0 -52
- package/dist/services/document-handler-runtime/document-handler-server.d.ts +2 -2
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +3 -11
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +6 -72
- package/dist/services/document-handler-runtime/{document-handler-abort.spec.js → spec/document-handler-abort.spec.js} +2 -2
- package/dist/services/git/{git-repository.spec.js → spec/git-repository.spec.js} +1 -1
- package/dist/services/integration-api/handler/customer-config-handler.d.ts +2 -2
- package/dist/services/integration-api/integration-api-factory.d.ts +3 -2
- package/dist/services/integration-api/integration-api-factory.js +5 -3
- package/dist/services/integration-api/struct/customer-config-file.js +1 -1
- package/dist/services/integration-api/virtual/virtual-file-handler.d.ts +2 -2
- package/dist/services/onboarding/browser/config/browser-config.d.ts +1 -1
- package/dist/services/onboarding/browser/executable/executable-validator.d.ts +1 -2
- package/dist/services/onboarding/browser/extension/extension-downloader.d.ts +1 -2
- package/dist/services/onboarding/browser/extension/extension-validator.d.ts +1 -2
- package/dist/services/onboarding/dashboard/diff-against-current-page.d.ts +2 -2
- package/dist/services/onboarding/dashboard/diff-against-current-page.js +1 -1
- package/dist/services/onboarding/dashboard/request-diff-service.d.ts +3 -1
- package/dist/services/onboarding/dashboard/request-diff-service.js +5 -3
- package/dist/services/onboarding/fetch-event-handler.d.ts +2 -2
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.d.ts +3 -1
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +5 -3
- package/dist/services/onboarding/file-events/file-watcher.d.ts +2 -2
- package/dist/services/onboarding/file-events/file-watcher.js +2 -2
- package/dist/services/onboarding/onboarding-model.d.ts +1 -1
- package/dist/services/onboarding/onboarding-service-factory.d.ts +3 -2
- package/dist/services/onboarding/onboarding-service-factory.js +17 -17
- package/dist/services/onboarding/onboarding-service.d.ts +2 -2
- package/dist/services/onboarding/request-cache/cache.d.ts +2 -2
- package/dist/services/onboarding/server-config/index.d.ts +2 -2
- package/dist/services/onboarding/{browser → spec/browser}/executable/headed-user-agent.spec.js +1 -1
- package/dist/services/onboarding/{empty-service-worker.spec.js → spec/empty-service-worker.spec.js} +1 -1
- package/dist/services/onboarding/{onboarding-model.spec.js → spec/onboarding-model.spec.js} +2 -2
- package/dist/services/onboarding/{virtual-orestes-app → spec/virtual-orestes-app}/crawler.spec.js +1 -1
- package/dist/services/onboarding/{virtual-orestes-app → spec/virtual-orestes-app}/origin-error-cause.spec.js +1 -1
- package/dist/services/onboarding/virtual-orestes-app/crawler.d.ts +2 -2
- package/dist/services/onboarding/virtual-orestes-app/index.d.ts +2 -2
- package/dist/services/origin-request/asset-variations.js +1 -1
- package/dist/services/origin-request/origin-request-service-factory.d.ts +3 -2
- package/dist/services/origin-request/origin-request-service-factory.js +8 -6
- package/dist/services/origin-request/origin-request-service.d.ts +2 -2
- package/dist/services/origin-request/{asset-variations.spec.js → spec/asset-variations.spec.js} +1 -1
- package/dist/services/prewarm/assets/asset-api-client.d.ts +3 -1
- package/dist/services/prewarm/assets/asset-api-client.js +5 -3
- package/dist/services/prewarm/auto-pre-warm-factory.d.ts +3 -2
- package/dist/services/prewarm/auto-pre-warm-factory.js +8 -5
- package/dist/{helpers → services/prewarm}/normalize.d.ts +0 -6
- package/dist/{helpers → services/prewarm}/normalize.js +0 -8
- package/dist/services/prewarm/pre-warm-factory.d.ts +3 -1
- package/dist/services/prewarm/pre-warm-factory.js +7 -4
- package/dist/services/prewarm/{csv-reader.spec.js → spec/csv-reader.spec.js} +1 -1
- package/dist/services/prewarm/{prewarm-targets.spec.js → spec/prewarm-targets.spec.js} +1 -1
- package/dist/services/pull/pull-service-factory.d.ts +3 -2
- package/dist/services/pull/pull-service-factory.js +8 -6
- package/dist/services/query-builder/query-builder-factory.d.ts +3 -2
- package/dist/services/query-builder/query-builder-factory.js +9 -7
- package/dist/services/query-builder/query-builder-service.js +4 -5
- package/dist/services/query-builder/query-command.js +1 -1
- package/dist/services/query-builder/{queries/spec → spec/queries}/golden.spec.js +3 -3
- package/dist/services/query-builder/{queries/spec → spec/queries}/pops-query.spec.js +2 -2
- package/dist/services/query-builder/{queries/spec → spec/queries}/queries.spec.js +3 -3
- package/dist/services/query-builder/{queries/spec → spec/queries}/reported-bugs.spec.js +2 -2
- package/dist/services/query-builder/{query-builder-service.spec.js → spec/query-builder-service.spec.js} +4 -4
- package/dist/services/query-builder/{rules/spec → spec/rules}/pattern-language.spec.js +1 -1
- package/dist/services/query-builder/{rules/spec → spec/rules}/rule-parser.spec.js +1 -1
- package/dist/services/query-builder/{rules/spec → spec/rules}/rule-reducer.spec.js +2 -2
- package/dist/services/query-builder/{rules/spec → spec/rules}/rule-relevance.spec.js +2 -2
- package/dist/services/query-builder/{rules/spec → spec/rules}/rule-to-sql.spec.js +2 -2
- package/dist/services/query-builder/{rules/spec → spec/rules}/runtime-semantics.spec.js +1 -1
- package/dist/services/query-builder/{rules/spec → spec/rules}/strip-parameters.spec.js +3 -3
- package/dist/services/query-builder/{sql/spec → spec/sql}/expression.spec.js +2 -2
- package/dist/services/query-builder/{sql/spec → spec/sql}/format.spec.js +2 -2
- package/dist/services/query-builder/{sql/spec → spec/sql}/predicate.spec.js +1 -1
- package/dist/services/query-builder/{sql/spec → spec/sql}/regex.spec.js +1 -1
- package/dist/services/revalidate/revalidate-factory.d.ts +3 -1
- package/dist/services/revalidate/revalidate-factory.js +6 -3
- package/dist/services/revalidate/revalidate-service.d.ts +2 -2
- package/dist/services/revalidate/{revalidate-service.spec.js → spec/revalidate-service.spec.js} +1 -1
- package/dist/services/setup/browser/browser-setup-service.d.ts +1 -2
- package/dist/services/setup/difftool/difftool-setup-service.d.ts +1 -2
- package/dist/services/setup/extension/extension-installer.d.ts +1 -1
- package/dist/services/setup/extension/extension-setup-service.d.ts +1 -2
- package/dist/services/setup/setup-service-factory.d.ts +3 -1
- package/dist/services/setup/setup-service-factory.js +5 -4
- package/dist/services/setup/setup-service.d.ts +1 -2
- package/dist/services/setup/{extension → spec/extension}/crx.spec.js +1 -1
- package/dist/services/setup/{extension → spec/extension}/webstore.spec.js +1 -1
- package/dist/services/setup/{os → spec/os}/tool-registry.spec.js +1 -1
- package/oclif.manifest.json +1 -52
- package/package.json +3 -2
- package/dist/commands/document-handler.d.ts +0 -16
- package/dist/commands/document-handler.js +0 -32
- package/dist/helpers/customer-config.d.ts +0 -45
- package/dist/helpers/customer-config.js +0 -136
- package/dist/helpers/file-helper.d.ts +0 -8
- package/dist/helpers/file-helper.js +0 -28
- package/dist/helpers/is-directory.d.ts +0 -5
- package/dist/helpers/is-directory.js +0 -19
- package/dist/helpers/is-file.d.ts +0 -5
- package/dist/helpers/is-file.js +0 -19
- package/dist/helpers/logging-helper.d.ts +0 -15
- package/dist/helpers/logging-helper.js +0 -23
- package/dist/helpers/scrape.d.ts +0 -1
- package/dist/helpers/scrape.js +0 -8
- package/dist/helpers/speed-kit-rule-to-reg-exp.d.ts +0 -1
- package/dist/helpers/speed-kit-rule-to-reg-exp.js +0 -6
- package/dist/models/install.d.ts +0 -24
- package/dist/services/config-api-service.d.ts +0 -21
- package/dist/services/config-api-service.js +0 -107
- package/dist/services/diff-service.d.ts +0 -27
- package/dist/services/diff-service.js +0 -116
- package/dist/services/document-handler-runtime/document-handler-runtime-service.d.ts +0 -31
- package/dist/services/document-handler-runtime/document-handler-runtime-service.js +0 -222
- package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.d.ts +0 -3
- package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.js +0 -3
- package/dist/services/document-handler-runtime/templates/execute-document-handler.d.ts +0 -6
- package/dist/services/document-handler-runtime/templates/execute-document-handler.js +0 -74
- package/dist/services/document-handler-runtime/templates/orestes-mock.d.ts +0 -9
- package/dist/services/document-handler-runtime/templates/orestes-mock.js +0 -166
- package/dist/services/document-handler-runtime/templates/package-json.d.ts +0 -6
- package/dist/services/document-handler-runtime/templates/package-json.js +0 -17
- package/dist/services/document-handler-runtime/templates/test.d.ts +0 -6
- package/dist/services/document-handler-runtime/templates/test.js +0 -64
- /package/dist/helpers/{chrome-flags.spec.d.ts → spec/chrome-flags.spec.d.ts} +0 -0
- /package/dist/helpers/{origin-proxy.spec.d.ts → spec/origin-proxy.spec.d.ts} +0 -0
- /package/dist/hooks/{init → spec/init}/dns-result-order.spec.d.ts +0 -0
- /package/dist/hooks/{init → spec/init}/http1-global-dispatcher.spec.d.ts +0 -0
- /package/dist/models/{cli-parameters.spec.d.ts → spec/cli-parameters.spec.d.ts} +0 -0
- /package/dist/services/athena/{athena-service.spec.d.ts → spec/athena-service.spec.d.ts} +0 -0
- /package/dist/services/athena/{baqend-athena-service.spec.d.ts → spec/baqend-athena-service.spec.d.ts} +0 -0
- /package/dist/services/browser-fetch/{browser-origin-fetch.spec.d.ts → spec/browser-origin-fetch.spec.d.ts} +0 -0
- /package/dist/services/browser-fetch/{browser-origin-fetcher.spec.d.ts → spec/browser-origin-fetcher.spec.d.ts} +0 -0
- /package/dist/services/browser-fetch/{browser-response.spec.d.ts → spec/browser-response.spec.d.ts} +0 -0
- /package/dist/services/browser-fetch/{device-emulation.spec.d.ts → spec/device-emulation.spec.d.ts} +0 -0
- /package/dist/services/bundler/{bundle-service.spec.d.ts → spec/bundle-service.spec.d.ts} +0 -0
- /package/dist/{helpers → services/cli}/cli-config.d.ts +0 -0
- /package/dist/{helpers → services/cli}/environment.d.ts +0 -0
- /package/dist/{helpers → services/cli}/environment.js +0 -0
- /package/dist/{helpers → services/cli/spec}/cli-config.spec.d.ts +0 -0
- /package/dist/services/cli/{cli-service.spec.d.ts → spec/cli-service.spec.d.ts} +0 -0
- /package/dist/{helpers → services/cli/spec}/environment.spec.d.ts +0 -0
- /package/dist/{models/install.js → services/customer-config/site-analyzer/site-analyzer-model.js} +0 -0
- /package/dist/services/deploy/{bulk → spec/bulk}/bulk-deploy-service.spec.d.ts +0 -0
- /package/dist/services/deploy/{bulk → spec/bulk}/touched-configs.spec.d.ts +0 -0
- /package/dist/services/deploy/{checks → spec/checks}/activation/customer-approval-check.spec.d.ts +0 -0
- /package/dist/services/deploy/{checks → spec/checks}/post-deploy/refresh-deployment-job-check.spec.d.ts +0 -0
- /package/dist/services/deploy/{checks → spec/checks}/pre-deploy/split-change-check.spec.d.ts +0 -0
- /package/dist/services/deploy/{handler → spec/handler}/module-handler.spec.d.ts +0 -0
- /package/dist/services/deploy/{handler → spec/handler}/testing-installation-links.spec.d.ts +0 -0
- /package/dist/services/deploy/{mr → spec/mr}/live-state-check.spec.d.ts +0 -0
- /package/dist/services/deploy/{mr → spec/mr}/merge-request-description.spec.d.ts +0 -0
- /package/dist/services/deploy/{policy → spec/policy}/auto-deploy-policy.spec.d.ts +0 -0
- /package/dist/{helpers/html-format-helper.d.ts → services/diff/html-format.d.ts} +0 -0
- /package/dist/{helpers/html-format-helper.js → services/diff/html-format.js} +0 -0
- /package/dist/services/document-handler-runtime/{document-handler-abort.spec.d.ts → spec/document-handler-abort.spec.d.ts} +0 -0
- /package/dist/services/git/{git-repository.spec.d.ts → spec/git-repository.spec.d.ts} +0 -0
- /package/dist/{helpers → services/integration-api}/array-helper.d.ts +0 -0
- /package/dist/{helpers → services/integration-api}/array-helper.js +0 -0
- /package/dist/services/onboarding/{browser → spec/browser}/executable/headed-user-agent.spec.d.ts +0 -0
- /package/dist/services/onboarding/{empty-service-worker.spec.d.ts → spec/empty-service-worker.spec.d.ts} +0 -0
- /package/dist/services/onboarding/{onboarding-model.spec.d.ts → spec/onboarding-model.spec.d.ts} +0 -0
- /package/dist/services/onboarding/{virtual-orestes-app → spec/virtual-orestes-app}/crawler.spec.d.ts +0 -0
- /package/dist/services/onboarding/{virtual-orestes-app → spec/virtual-orestes-app}/origin-error-cause.spec.d.ts +0 -0
- /package/dist/{helpers → services/origin-request}/java-regex.d.ts +0 -0
- /package/dist/{helpers → services/origin-request}/java-regex.js +0 -0
- /package/dist/services/origin-request/{asset-variations.spec.d.ts → spec/asset-variations.spec.d.ts} +0 -0
- /package/dist/services/prewarm/{csv-reader.spec.d.ts → spec/csv-reader.spec.d.ts} +0 -0
- /package/dist/services/prewarm/{prewarm-targets.spec.d.ts → spec/prewarm-targets.spec.d.ts} +0 -0
- /package/dist/services/query-builder/{queries/spec → spec/queries}/golden-configs.d.ts +0 -0
- /package/dist/services/query-builder/{queries/spec → spec/queries}/golden-configs.js +0 -0
- /package/dist/services/query-builder/{queries/spec → spec/queries}/golden.spec.d.ts +0 -0
- /package/dist/services/query-builder/{queries/spec → spec/queries}/pops-query.spec.d.ts +0 -0
- /package/dist/services/query-builder/{queries/spec → spec/queries}/queries.spec.d.ts +0 -0
- /package/dist/services/query-builder/{queries/spec → spec/queries}/reported-bugs.spec.d.ts +0 -0
- /package/dist/services/query-builder/{query-builder-service.spec.d.ts → spec/query-builder-service.spec.d.ts} +0 -0
- /package/dist/services/query-builder/{rules/spec → spec/rules}/pattern-language.spec.d.ts +0 -0
- /package/dist/services/query-builder/{rules/spec → spec/rules}/rule-parser.spec.d.ts +0 -0
- /package/dist/services/query-builder/{rules/spec → spec/rules}/rule-reducer.spec.d.ts +0 -0
- /package/dist/services/query-builder/{rules/spec → spec/rules}/rule-relevance.spec.d.ts +0 -0
- /package/dist/services/query-builder/{rules/spec → spec/rules}/rule-to-sql.spec.d.ts +0 -0
- /package/dist/services/query-builder/{rules/spec → spec/rules}/runtime-semantics.spec.d.ts +0 -0
- /package/dist/services/query-builder/{rules/spec → spec/rules}/strip-parameters.spec.d.ts +0 -0
- /package/dist/services/query-builder/{sql/spec → spec/sql}/expression.spec.d.ts +0 -0
- /package/dist/services/query-builder/{sql/spec → spec/sql}/format.spec.d.ts +0 -0
- /package/dist/services/query-builder/{sql/spec → spec/sql}/predicate.spec.d.ts +0 -0
- /package/dist/services/query-builder/{sql/spec → spec/sql}/regex.spec.d.ts +0 -0
- /package/dist/services/revalidate/{revalidate-service.spec.d.ts → spec/revalidate-service.spec.d.ts} +0 -0
- /package/dist/services/setup/{extension → spec/extension}/crx.spec.d.ts +0 -0
- /package/dist/services/setup/{extension → spec/extension}/webstore.spec.d.ts +0 -0
- /package/dist/services/setup/{os → spec/os}/tool-registry.spec.d.ts +0 -0
package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { IntegrationApiContext, IntegrationApiFactory, } from "../../integration-api/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import DocumentHandlerRuntimeService from "../document-handler-runtime-service.js";
|
|
4
|
-
import { CliServiceFactory } from "../../cli/index.js";
|
|
5
|
-
import RequiredFileNotFoundError from "../error/required-file-not-found-error.js";
|
|
2
|
+
import { CliServiceFactory, } from "../../cli/index.js";
|
|
6
3
|
import { DocumentHandlerServer } from "../document-handler-server.js";
|
|
7
4
|
import { BundleServiceFactory } from "../../bundler/index.js";
|
|
8
5
|
import { EntityManagerFactory } from "../../config-api/entity-manager-factory.js";
|
|
@@ -13,89 +10,26 @@ export default class DocumentHandlerRuntimeServiceFactory {
|
|
|
13
10
|
context;
|
|
14
11
|
cliConfig;
|
|
15
12
|
files;
|
|
16
|
-
|
|
13
|
+
cli;
|
|
14
|
+
constructor(context, cliConfig, files, cli) {
|
|
17
15
|
this.context = context;
|
|
18
16
|
this.cliConfig = cliConfig;
|
|
19
17
|
this.files = files;
|
|
20
|
-
|
|
21
|
-
async buildService() {
|
|
22
|
-
const integrationApi = this.prepareIntegrationApi();
|
|
23
|
-
const files = await this.getIntegrationFiles(integrationApi);
|
|
24
|
-
this.checkRequiredFiles(files);
|
|
25
|
-
const cliService = new CliServiceFactory().getService();
|
|
26
|
-
const customerConfig = this.getCustomerConfig(files);
|
|
27
|
-
this.preparePackageJson(integrationApi, customerConfig);
|
|
28
|
-
return new DocumentHandlerRuntimeService(files, customerConfig, cliService, { testNames: this.context.testNames || [] });
|
|
18
|
+
this.cli = cli;
|
|
29
19
|
}
|
|
30
20
|
async buildDocumentHandlerServer() {
|
|
31
21
|
const integrationApiContext = new IntegrationApiContext(this.context.customerPath, this.context.configName, []);
|
|
32
22
|
const files = this.files ||
|
|
33
|
-
(await new IntegrationApiFactory(integrationApiContext, this.cliConfig)
|
|
23
|
+
(await new IntegrationApiFactory(integrationApiContext, this.cliConfig, this.cli)
|
|
34
24
|
.buildService()
|
|
35
25
|
.run());
|
|
36
26
|
const customerConfig = this.getCustomerConfig(files);
|
|
37
|
-
const cliService = new CliServiceFactory().getService();
|
|
27
|
+
const cliService = this.cli ?? new CliServiceFactory().getService();
|
|
38
28
|
await this.installAdditionalDependencies(customerConfig, cliService);
|
|
39
29
|
const bundler = new BundleServiceFactory(this.context.customerPath).buildService();
|
|
40
30
|
const entityManagerResult = await safe(new EntityManagerFactory().getEntityManager(customerConfig.app));
|
|
41
31
|
return new DocumentHandlerServer(customerConfig, files, bundler, cliService, this.cliConfig.nodeModulesPath, this.context.verboseLevel, entityManagerResult.success ? entityManagerResult.data : null);
|
|
42
32
|
}
|
|
43
|
-
prepareIntegrationApi() {
|
|
44
|
-
const integrationApiContext = new IntegrationApiContext(this.context.customerPath, this.context.configName, this.context.fileDependencies, [".git", ".idea", "node_modules"]);
|
|
45
|
-
return new IntegrationApiFactory(integrationApiContext, this.cliConfig).buildService();
|
|
46
|
-
}
|
|
47
|
-
async getIntegrationFiles(integrationApi) {
|
|
48
|
-
this.createNeededFolderStructure(integrationApi);
|
|
49
|
-
this.prepareLocalDocumentHandler(integrationApi);
|
|
50
|
-
this.prepareTestCases(integrationApi);
|
|
51
|
-
return await integrationApi.run();
|
|
52
|
-
}
|
|
53
|
-
checkRequiredFiles(files) {
|
|
54
|
-
for (const requiredFile of this.context.requiredFiles) {
|
|
55
|
-
if (!files.hasFile(requiredFile)) {
|
|
56
|
-
throw new RequiredFileNotFoundError(`file ${requiredFile} not found`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
createNeededFolderStructure(integrationApi) {
|
|
61
|
-
integrationApi.createFolder(".local");
|
|
62
|
-
integrationApi.createFolder(".local/test");
|
|
63
|
-
integrationApi.createFolder(".local/test/src");
|
|
64
|
-
integrationApi.createFolder(".local/test/tmp");
|
|
65
|
-
integrationApi.createFolder(".local/test/tmp/server");
|
|
66
|
-
}
|
|
67
|
-
prepareLocalDocumentHandler(integrationApi) {
|
|
68
|
-
if (!integrationApi.fileExists(`.local/test/src/${TEST_DOCUMENT_HANDLER_FILE_NAME}`)) {
|
|
69
|
-
integrationApi.writeFile(`.local/test/src/${TEST_DOCUMENT_HANDLER_FILE_NAME}`);
|
|
70
|
-
}
|
|
71
|
-
if (!integrationApi.fileExists(`.local/test/src/${TEST_DATABASE_MOCK_FILE_NAME}`)) {
|
|
72
|
-
integrationApi.writeFile(`.local/test/src/${TEST_DATABASE_MOCK_FILE_NAME}`);
|
|
73
|
-
}
|
|
74
|
-
if (!integrationApi.fileExists(`.local/test/src/${TEST_ORESTES_MOCK_FILE_NAME}`)) {
|
|
75
|
-
integrationApi.writeFile(`.local/test/src/${TEST_ORESTES_MOCK_FILE_NAME}`);
|
|
76
|
-
}
|
|
77
|
-
if (!integrationApi.fileExists(`.local/test/src/${TEST_RUNTIME_FILE_NAME}`)) {
|
|
78
|
-
integrationApi.writeFile(`.local/test/src/${TEST_RUNTIME_FILE_NAME}`);
|
|
79
|
-
}
|
|
80
|
-
if (!integrationApi.fileExists(`.local/test/src/${TEST_PACKAGE_JSON}`, "json")) {
|
|
81
|
-
integrationApi.writeFile(`.local/test/src/${TEST_PACKAGE_JSON}`, "json");
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
preparePackageJson(integrationApi, customerConfig) {
|
|
85
|
-
if (customerConfig.dependencies &&
|
|
86
|
-
!integrationApi.fileExists(`.local/test/${TEST_PACKAGE_JSON}`, "json")) {
|
|
87
|
-
integrationApi.writeFile(`.local/test/${TEST_PACKAGE_JSON}`, "json");
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
prepareTestCases(integrationApi) {
|
|
91
|
-
if (this.context.testNames && this.context.testNames.length > 0) {
|
|
92
|
-
this.context.testNames.map(async (testName) => {
|
|
93
|
-
if (!integrationApi.fileExists(`.local/test/${TEST_FILE_NAME_PREFIX}-${testName}`)) {
|
|
94
|
-
integrationApi.writeFile(`.local/test/${TEST_FILE_NAME_PREFIX}-${testName}`);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
33
|
getCustomerConfig(files) {
|
|
100
34
|
const configFile = files.getByName("config_customer");
|
|
101
35
|
return configFile.config;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { expect } from "chai";
|
|
2
2
|
import { describe, it } from "mocha";
|
|
3
|
-
import { ABORT_ERROR_CODE, ABORT_SERVER_TIMING, ABORT_STATUS_CODE, DocumentHandlerAbort, isDocumentHandlerAbort, } from "
|
|
4
|
-
import { DocumentHandlerTransformError } from "
|
|
3
|
+
import { ABORT_ERROR_CODE, ABORT_SERVER_TIMING, ABORT_STATUS_CODE, DocumentHandlerAbort, isDocumentHandlerAbort, } from "../document-handler-abort.js";
|
|
4
|
+
import { DocumentHandlerTransformError } from "../../onboarding/error/document-handler-transform-error.js";
|
|
5
5
|
/**
|
|
6
6
|
* Mirrors the service worker's `parseServerTimingHeader`, so the header this module
|
|
7
7
|
* emits is asserted against the parser that has to read it.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { expect } from "chai";
|
|
2
2
|
import { describe, it } from "mocha";
|
|
3
|
-
import { GitRepository } from "
|
|
3
|
+
import { GitRepository } from "../git-repository.js";
|
|
4
4
|
const MERGE_SHA = "3aaa523e92e9a8ccba03ded37bf04c8bdecd3b0f";
|
|
5
5
|
const BASE_SHA = "83d9d5805a760f059245030f9282ec7354f382f6";
|
|
6
6
|
/** A git that answers from a table, and records what it was asked. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CliServiceInterface } from "../../cli/index.js";
|
|
2
2
|
import FileReader from "../file-reader.js";
|
|
3
3
|
import { CustomerConfigInterface } from "../integration-api-model.js";
|
|
4
4
|
import CustomerConfigValidator from "../validator/customer-config-validator.js";
|
|
@@ -10,7 +10,7 @@ export default class CustomerConfigHandler extends FileHandler {
|
|
|
10
10
|
private testApp?;
|
|
11
11
|
private useTestConfig;
|
|
12
12
|
allowedFile: string;
|
|
13
|
-
constructor(fileReader: FileReader, cli:
|
|
13
|
+
constructor(fileReader: FileReader, cli: CliServiceInterface, validator: CustomerConfigValidator, configName: string, testApp?: string, useTestConfig?: boolean);
|
|
14
14
|
canHandle(filePath: string): boolean;
|
|
15
15
|
handle(filePath: string): Promise<CustomerConfigInterface>;
|
|
16
16
|
private loadConfig;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { IntegrationApiService } from "./integration-api-service.js";
|
|
2
|
+
import { CliServiceInterface, UserCliConfig } from "../cli/index.js";
|
|
2
3
|
import { IntegrationApiContext } from "./integration-api-model.js";
|
|
3
|
-
import { UserCliConfig } from "../../helpers/cli-config.js";
|
|
4
4
|
export declare class IntegrationApiFactory {
|
|
5
5
|
private context;
|
|
6
6
|
private cliConfig;
|
|
7
|
+
private cli?;
|
|
7
8
|
service?: IntegrationApiService;
|
|
8
9
|
private fileReader?;
|
|
9
|
-
constructor(context: IntegrationApiContext, cliConfig: UserCliConfig);
|
|
10
|
+
constructor(context: IntegrationApiContext, cliConfig: UserCliConfig, cli?: CliServiceInterface);
|
|
10
11
|
buildService(): IntegrationApiService;
|
|
11
12
|
private build;
|
|
12
13
|
private getFileReader;
|
|
@@ -7,17 +7,19 @@ import InstallResourceHandler from "./handler/install-resource-handler.js";
|
|
|
7
7
|
import ModuleHandler from "./handler/module-handler.js";
|
|
8
8
|
import ServerConfigHandler from "./handler/server-config-handler.js";
|
|
9
9
|
import FileWriter from "./file-writer.js";
|
|
10
|
-
import { CliServiceFactory } from "../cli/index.js";
|
|
10
|
+
import { CliServiceFactory, } from "../cli/index.js";
|
|
11
11
|
import { VirtualFileHandler } from "./virtual/virtual-file-handler.js";
|
|
12
12
|
import fs from "node:fs";
|
|
13
13
|
export class IntegrationApiFactory {
|
|
14
14
|
context;
|
|
15
15
|
cliConfig;
|
|
16
|
+
cli;
|
|
16
17
|
service = undefined;
|
|
17
18
|
fileReader;
|
|
18
|
-
constructor(context, cliConfig) {
|
|
19
|
+
constructor(context, cliConfig, cli) {
|
|
19
20
|
this.context = context;
|
|
20
21
|
this.cliConfig = cliConfig;
|
|
22
|
+
this.cli = cli;
|
|
21
23
|
}
|
|
22
24
|
buildService() {
|
|
23
25
|
if (!(this.service instanceof IntegrationApiService)) {
|
|
@@ -27,7 +29,7 @@ export class IntegrationApiFactory {
|
|
|
27
29
|
}
|
|
28
30
|
build() {
|
|
29
31
|
const fileReader = this.getFileReader();
|
|
30
|
-
const cli = new CliServiceFactory().getService();
|
|
32
|
+
const cli = this.cli ?? new CliServiceFactory().getService();
|
|
31
33
|
const virtualFileHandler = new VirtualFileHandler(cli);
|
|
32
34
|
this.service = new IntegrationApiService(fileReader, virtualFileHandler, new MandatoryFilesValidator(), [
|
|
33
35
|
new CustomerConfigHandler(fileReader, cli, new CustomerConfigValidator(), this.context.configName, this.cliConfig.testApp, this.context.useTestConfig),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CustomerConfig, File, FILE_TYPE, } from "../integration-api-model.js";
|
|
2
2
|
import { safe } from "../../../helpers/safe.js";
|
|
3
3
|
import CustomerConfigError from "../error/customer-config-error.js";
|
|
4
|
-
import { isSame } from "
|
|
4
|
+
import { isSame } from "../array-helper.js";
|
|
5
5
|
export class CustomerConfigFile extends File {
|
|
6
6
|
config;
|
|
7
7
|
configName;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FileListInterface, VirtualFileConfig } from "../integration-api-model.js";
|
|
2
|
-
import {
|
|
2
|
+
import { CliServiceInterface } from "../../cli/index.js";
|
|
3
3
|
export declare class VirtualFileHandler {
|
|
4
4
|
private cli;
|
|
5
|
-
constructor(cli:
|
|
5
|
+
constructor(cli: CliServiceInterface);
|
|
6
6
|
processFiles(fileList: FileListInterface, virtualFiles: VirtualFileConfig[]): Promise<void>;
|
|
7
7
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { UserCliConfig } from "
|
|
2
|
-
import { CliServiceInterface } from "../../../cli/index.js";
|
|
1
|
+
import { CliServiceInterface, UserCliConfig } from "../../../cli/index.js";
|
|
3
2
|
export declare class ExecutableValidator {
|
|
4
3
|
readonly userConfig: UserCliConfig;
|
|
5
4
|
private cli;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { UserCliConfig } from "
|
|
2
|
-
import { CliServiceInterface } from "../../../cli/index.js";
|
|
1
|
+
import { CliServiceInterface, UserCliConfig } from "../../../cli/index.js";
|
|
3
2
|
interface DevtoolsInstallOptions {
|
|
4
3
|
/** ask before installing or updating, off for an explicit install command */
|
|
5
4
|
confirm?: boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { UserCliConfig } from "
|
|
2
|
-
import { CliServiceInterface } from "../../../cli/index.js";
|
|
1
|
+
import { CliServiceInterface, UserCliConfig } from "../../../cli/index.js";
|
|
3
2
|
import { ExtensionDownloader } from "./extension-downloader.js";
|
|
4
3
|
export interface BrowserExtensions {
|
|
5
4
|
paths: string[];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DiffService } from "../../diff/index.js";
|
|
2
2
|
import { DocumentHandlerServer } from "../../document-handler-runtime/document-handler-server.js";
|
|
3
3
|
import { Crawler } from "../virtual-orestes-app/crawler.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CliServiceInterface } from "../../cli/index.js";
|
|
5
5
|
export declare class DiffAgainstCurrentPage {
|
|
6
6
|
private diffService;
|
|
7
7
|
private documentHandlerRuntime;
|
|
8
8
|
private crawler;
|
|
9
9
|
private cli;
|
|
10
|
-
constructor(diffService: DiffService, documentHandlerRuntime: DocumentHandlerServer, crawler: Crawler, cli:
|
|
10
|
+
constructor(diffService: DiffService, documentHandlerRuntime: DocumentHandlerServer, crawler: Crawler, cli: CliServiceInterface);
|
|
11
11
|
postDiff(currentHtml: string, currentUrl: string, variant?: string, transform?: boolean): Promise<boolean>;
|
|
12
12
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { DiffService } from "../../diff/index.js";
|
|
2
2
|
import { BaqendResponse } from "../browser/baqend-response.js";
|
|
3
3
|
import { DocumentHandlerServer } from "../../document-handler-runtime/document-handler-server.js";
|
|
4
|
+
import { CliServiceInterface } from "../../cli/index.js";
|
|
4
5
|
export declare class RequestDiffService {
|
|
5
6
|
private diffService;
|
|
6
7
|
private documentHandlerRuntime;
|
|
7
|
-
|
|
8
|
+
private cli;
|
|
9
|
+
constructor(diffService: DiffService, documentHandlerRuntime: DocumentHandlerServer, cli: CliServiceInterface);
|
|
8
10
|
postDiff(requestOrigin: string, url: string, parametersString: string, autoCheck?: boolean): Promise<BaqendResponse>;
|
|
9
11
|
private diffLocal;
|
|
10
12
|
private fetchHtml;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { BaqendResponse } from "../browser/baqend-response.js";
|
|
2
2
|
import { safe } from "../../../helpers/safe.js";
|
|
3
3
|
import { originFetch } from "../../../helpers/origin-proxy.js";
|
|
4
|
-
import { formatHtml } from "
|
|
4
|
+
import { formatHtml } from "../../diff/index.js";
|
|
5
5
|
export class RequestDiffService {
|
|
6
6
|
diffService;
|
|
7
7
|
documentHandlerRuntime;
|
|
8
|
-
|
|
8
|
+
cli;
|
|
9
|
+
constructor(diffService, documentHandlerRuntime, cli) {
|
|
9
10
|
this.diffService = diffService;
|
|
10
11
|
this.documentHandlerRuntime = documentHandlerRuntime;
|
|
12
|
+
this.cli = cli;
|
|
11
13
|
}
|
|
12
14
|
async postDiff(requestOrigin, url, parametersString, autoCheck = false) {
|
|
13
15
|
const parameters = parametersString
|
|
@@ -67,7 +69,7 @@ export class RequestDiffService {
|
|
|
67
69
|
// The dashboard diff has always accepted a broken origin handshake here.
|
|
68
70
|
{ tolerateLegacyTls: true }));
|
|
69
71
|
if (response.success !== true) {
|
|
70
|
-
|
|
72
|
+
this.cli.writeError(`could not fetch "${url}": ${response.error}`);
|
|
71
73
|
throw response.errorObj;
|
|
72
74
|
}
|
|
73
75
|
return response.data.text();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetchRequestPausedEventHandler } from "./onboarding-model.js";
|
|
2
2
|
import { Protocol } from "puppeteer-core";
|
|
3
3
|
import { CDPSession, Target } from "puppeteer";
|
|
4
|
-
import {
|
|
4
|
+
import { CliServiceInterface } from "../cli/index.js";
|
|
5
5
|
import { CustomerConfig } from "../integration-api/index.js";
|
|
6
6
|
import { ConfigApiService } from "../config-api/index.js";
|
|
7
7
|
export declare class FetchEventHandler {
|
|
@@ -9,7 +9,7 @@ export declare class FetchEventHandler {
|
|
|
9
9
|
private customerConfig;
|
|
10
10
|
private cli;
|
|
11
11
|
private client?;
|
|
12
|
-
constructor(browserFetchEvents: FetchRequestPausedEventHandler[], customerConfig: CustomerConfig, cli:
|
|
12
|
+
constructor(browserFetchEvents: FetchRequestPausedEventHandler[], customerConfig: CustomerConfig, cli: CliServiceInterface, client?: ConfigApiService);
|
|
13
13
|
handleRequestFetchEvents(target: Target): Promise<void>;
|
|
14
14
|
private canHandlePattern;
|
|
15
15
|
private onFetchRequestPaused;
|
|
@@ -3,6 +3,7 @@ import { CDPSession } from "puppeteer";
|
|
|
3
3
|
import { CustomerConfig, VirtualFile } from "../../integration-api/index.js";
|
|
4
4
|
import { AbortResponse } from "../browser/abort-response.js";
|
|
5
5
|
import { FetchRequestPausedEventHandler } from "../onboarding-model.js";
|
|
6
|
+
import { CliServiceInterface } from "../../cli/index.js";
|
|
6
7
|
/**
|
|
7
8
|
* Intercepts the response for speedkit-install.js
|
|
8
9
|
* Returns a custom build install.js from local-files
|
|
@@ -12,8 +13,9 @@ import { FetchRequestPausedEventHandler } from "../onboarding-model.js";
|
|
|
12
13
|
export declare class SpeedKitInstallJs implements FetchRequestPausedEventHandler {
|
|
13
14
|
private customerConfig;
|
|
14
15
|
private installResource;
|
|
16
|
+
private cli;
|
|
15
17
|
readonly patterns: Protocol.Fetch.RequestPattern[];
|
|
16
|
-
constructor(customerConfig: CustomerConfig, installResource: VirtualFile);
|
|
18
|
+
constructor(customerConfig: CustomerConfig, installResource: VirtualFile, cli: CliServiceInterface);
|
|
17
19
|
handle(event: Protocol.Fetch.RequestPausedEvent, client: CDPSession): Promise<AbortResponse | Partial<Protocol.Fetch.FulfillRequestRequest> | null>;
|
|
18
20
|
/**
|
|
19
21
|
* fetch remote installResource
|
|
@@ -10,10 +10,12 @@ import { safe } from "../../../helpers/safe.js";
|
|
|
10
10
|
export class SpeedKitInstallJs {
|
|
11
11
|
customerConfig;
|
|
12
12
|
installResource;
|
|
13
|
+
cli;
|
|
13
14
|
patterns;
|
|
14
|
-
constructor(customerConfig, installResource) {
|
|
15
|
+
constructor(customerConfig, installResource, cli) {
|
|
15
16
|
this.customerConfig = customerConfig;
|
|
16
17
|
this.installResource = installResource;
|
|
18
|
+
this.cli = cli;
|
|
17
19
|
this.patterns = [
|
|
18
20
|
{
|
|
19
21
|
requestStage: "Response",
|
|
@@ -23,7 +25,7 @@ export class SpeedKitInstallJs {
|
|
|
23
25
|
}
|
|
24
26
|
async handle(event, client) {
|
|
25
27
|
if (!event.request.url.includes(this.customerConfig.appDomain)) {
|
|
26
|
-
|
|
28
|
+
this.cli.comment(`abort: ${event.request.url}`);
|
|
27
29
|
return new AbortResponse("Aborted");
|
|
28
30
|
}
|
|
29
31
|
if (!this.isValidResponse(event)) {
|
|
@@ -48,7 +50,7 @@ export class SpeedKitInstallJs {
|
|
|
48
50
|
async extractConfigVersion(client, event) {
|
|
49
51
|
const originBodyResponse = await safe(this.getContent(client, event));
|
|
50
52
|
if (originBodyResponse.success !== true) {
|
|
51
|
-
|
|
53
|
+
this.cli.writeError(`could not fetch install resource: "${event.request.url}": ${originBodyResponse.error}`);
|
|
52
54
|
return;
|
|
53
55
|
}
|
|
54
56
|
const [, configVersion] = originBodyResponse.data.match(/sw:[^?]*(\?[^"]*)"/s) || [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CliServiceInterface } from "../../cli/index.js";
|
|
2
2
|
import { Page } from "puppeteer";
|
|
3
3
|
import { DocumentHandlerServer } from "../../document-handler-runtime/document-handler-server.js";
|
|
4
4
|
import { Cache } from "../request-cache/cache.js";
|
|
@@ -16,7 +16,7 @@ export declare class FileWatcher {
|
|
|
16
16
|
private browserContext;
|
|
17
17
|
private cache;
|
|
18
18
|
private cacheRefresher?;
|
|
19
|
-
constructor(cli:
|
|
19
|
+
constructor(cli: CliServiceInterface, customerConfig: CustomerConfig, files: FileListInterface, documentHandler: DocumentHandlerServer, browserContext: BrowserContext, cache: Cache);
|
|
20
20
|
setCacheRefresher(cacheRefresher: VirtualOrestesApp): void;
|
|
21
21
|
/**
|
|
22
22
|
* Drop the dh-cache after a config change. When a cache refresher is wired
|
|
@@ -204,8 +204,8 @@ export class FileWatcher {
|
|
|
204
204
|
]), 200));
|
|
205
205
|
if (evaluateResult.success === false &&
|
|
206
206
|
!evaluateResult.error.includes("timeout")) {
|
|
207
|
-
this.
|
|
208
|
-
|
|
207
|
+
// The stack already starts with the message, so this is not a duplicate.
|
|
208
|
+
this.cli.writeError(evaluateResult.errorObj?.stack ?? evaluateResult.error);
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CDPSession } from "puppeteer";
|
|
2
2
|
import { Protocol } from "puppeteer-core";
|
|
3
|
-
import { UserCliConfig } from "../../helpers/cli-config.js";
|
|
4
3
|
import { AbortResponse } from "./browser/abort-response.js";
|
|
5
4
|
import { task } from "./todo-collector.js";
|
|
6
5
|
import { VanillaPuppeteer } from "puppeteer-extra";
|
|
7
6
|
import { Command } from "@oclif/core/command";
|
|
8
7
|
import { ChromeFeatureFinding, ChromeFlagDuplicate } from "../../helpers/chrome-flags.js";
|
|
8
|
+
import { UserCliConfig } from "../cli/index.js";
|
|
9
9
|
export declare const HEADLESS_PARITY_ARGS: string[];
|
|
10
10
|
declare const HEADLESS_DEFAULT_ARGS_TO_DROP: string[];
|
|
11
11
|
export { HEADLESS_DEFAULT_ARGS_TO_DROP };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { UserCliConfig } from "
|
|
1
|
+
import { CliServiceInterface, UserCliConfig } from "../cli/index.js";
|
|
2
2
|
import { OnboardingContext } from "./onboarding-model.js";
|
|
3
3
|
import { OnboardingService } from "./onboarding-service.js";
|
|
4
4
|
export declare class OnboardingServiceFactory {
|
|
5
5
|
private readonly context;
|
|
6
6
|
private cliConfig;
|
|
7
|
-
|
|
7
|
+
private cli?;
|
|
8
|
+
constructor(context: OnboardingContext, cliConfig: UserCliConfig, cli?: CliServiceInterface);
|
|
8
9
|
getService(): Promise<OnboardingService>;
|
|
9
10
|
private prepareMessagehandler;
|
|
10
11
|
private getAppToken;
|
|
@@ -2,7 +2,7 @@ import { safe } from "../../helpers/safe.js";
|
|
|
2
2
|
import { INTEGRATION_FILES } from "../../models/files.js";
|
|
3
3
|
import { AthenaServiceFactory } from "../athena/index.js";
|
|
4
4
|
import { BundleServiceFactory } from "../bundler/index.js";
|
|
5
|
-
import { CliServiceFactory } from "../cli/index.js";
|
|
5
|
+
import { CliServiceFactory, } from "../cli/index.js";
|
|
6
6
|
import { DiffContext, DiffServiceFactory } from "../diff/index.js";
|
|
7
7
|
import DocumentHandlerRuntimeServiceFactory from "../document-handler-runtime/factory/document-handler-runtime-service-factory.js";
|
|
8
8
|
import { ExternalFileReader, IntegrationApiContext, VirtualFile, ExternalRecipe, IntegrationApiFactory, } from "../integration-api/index.js";
|
|
@@ -47,13 +47,15 @@ import { formatChromeFeatureFinding, formatChromeFlagDuplicate, } from "../../he
|
|
|
47
47
|
export class OnboardingServiceFactory {
|
|
48
48
|
context;
|
|
49
49
|
cliConfig;
|
|
50
|
-
|
|
50
|
+
cli;
|
|
51
|
+
constructor(context, cliConfig, cli) {
|
|
51
52
|
this.context = context;
|
|
52
53
|
this.cliConfig = cliConfig;
|
|
54
|
+
this.cli = cli;
|
|
53
55
|
}
|
|
54
56
|
async getService() {
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
+
const cli = this.cli ?? new CliServiceFactory().getService();
|
|
58
|
+
const files = await this.getIntegrationFiles(cli);
|
|
57
59
|
const customerConfig = files.getCustomerConfig().config;
|
|
58
60
|
// Before any origin request, so Chrome and the CLI agree on the route out.
|
|
59
61
|
applyOriginProxy(customerConfig.chromeFlags, cli);
|
|
@@ -72,11 +74,9 @@ export class OnboardingServiceFactory {
|
|
|
72
74
|
const documentHandlerContext = {
|
|
73
75
|
configName: this.context.configName,
|
|
74
76
|
customerPath: this.context.customerPath,
|
|
75
|
-
fileDependencies: [],
|
|
76
|
-
requiredFiles: [],
|
|
77
77
|
verboseLevel: this.context.verboseLevel,
|
|
78
78
|
};
|
|
79
|
-
const documentHandler = await new DocumentHandlerRuntimeServiceFactory(documentHandlerContext, this.cliConfig, files).buildDocumentHandlerServer();
|
|
79
|
+
const documentHandler = await new DocumentHandlerRuntimeServiceFactory(documentHandlerContext, this.cliConfig, files, cli).buildDocumentHandlerServer();
|
|
80
80
|
const bundler = new BundleServiceFactory(this.context.customerPath).buildService();
|
|
81
81
|
const skTemplate = new InstallSpeedKitJsTemplate();
|
|
82
82
|
const speedKitInstallContext = new SpeedKitInstallContext(customerConfig, this.context.configName, files, bundler, skTemplate, this.context.local);
|
|
@@ -100,7 +100,7 @@ export class OnboardingServiceFactory {
|
|
|
100
100
|
cli.writeWarning("Running in headless mode.");
|
|
101
101
|
}
|
|
102
102
|
const fileWatcher = new FileWatcher(cli, customerConfig, files, documentHandler, browserContext, cache);
|
|
103
|
-
const athenaClient = (await this.getAthenaClient(customerConfig.app)) || null;
|
|
103
|
+
const athenaClient = (await this.getAthenaClient(customerConfig.app, cli)) || null;
|
|
104
104
|
const messageHandler = await this.prepareMessagehandler(athenaClient, files, customerConfig);
|
|
105
105
|
const speedKitServiceWorkerJs = new SpeedKitServiceWorkerJs(customerConfig, files.getByName(INTEGRATION_FILES.CUSTOM.SW));
|
|
106
106
|
const fetchHandler = await this.getFetchEventHandler(files, customerConfig, documentHandler, cache, cli, browserContext, athenaClient, messageHandler, fileWatcher, speedKitServiceWorkerJs);
|
|
@@ -154,8 +154,8 @@ export class OnboardingServiceFactory {
|
|
|
154
154
|
}
|
|
155
155
|
cli.failAction("ONBOARDING:BUILD:INSTALL_RESOURCE", result.error);
|
|
156
156
|
}
|
|
157
|
-
async getAthenaClient(app) {
|
|
158
|
-
const athenaFactory = new AthenaServiceFactory(app);
|
|
157
|
+
async getAthenaClient(app, cli) {
|
|
158
|
+
const athenaFactory = new AthenaServiceFactory(app, undefined, undefined, cli);
|
|
159
159
|
const result = await safe(athenaFactory.getService());
|
|
160
160
|
if (result.success === true) {
|
|
161
161
|
return result.data;
|
|
@@ -173,13 +173,13 @@ export class OnboardingServiceFactory {
|
|
|
173
173
|
configName: this.context.configName,
|
|
174
174
|
customerPath: this.context.customerPath,
|
|
175
175
|
isWindows: this.cliConfig.runtimeConfig.windows,
|
|
176
|
-
}, this.cliConfig).buildService(QueryType.parameter);
|
|
177
|
-
const DiffService = new DiffServiceFactory(new DiffContext(this.cliConfig.diffExec, this.cliConfig.diffExecTemplate)).getService();
|
|
178
|
-
const requestDiffService = new RequestDiffService(DiffService, documentHandler);
|
|
176
|
+
}, this.cliConfig, cli).buildService(QueryType.parameter);
|
|
177
|
+
const DiffService = new DiffServiceFactory(new DiffContext(this.cliConfig.diffExec, this.cliConfig.diffExecTemplate), cli).getService();
|
|
178
|
+
const requestDiffService = new RequestDiffService(DiffService, documentHandler, cli);
|
|
179
179
|
const handlers = [
|
|
180
180
|
new CustomerDomainDocumentResponse(customerConfig, files.getByName(INTEGRATION_FILES.CONFIG.DYNAMIC_BLOCKS), files.getByName(INTEGRATION_FILES.CONFIG.DYNAMIC_STYLES), this.context.ignoreContentSecurityPolicy),
|
|
181
181
|
new SpeedKitInstallHtml(customerConfig, browserContext, new InstallSpeedKitHtmlTemplate()),
|
|
182
|
-
new SpeedKitInstallJs(customerConfig, files.getByName(INTEGRATION_FILES.BUILD.INSTALL)),
|
|
182
|
+
new SpeedKitInstallJs(customerConfig, files.getByName(INTEGRATION_FILES.BUILD.INSTALL), cli),
|
|
183
183
|
new CustomerServiceWorkerJs(customerConfig),
|
|
184
184
|
speedKitServiceWorkerJs,
|
|
185
185
|
new DashboardRequest(new Dashboard(customerConfig, parameterQueryBuilder, athenaClient, requestDiffService, new DiffAgainstCurrentPage(DiffService, documentHandler, crawler, cli), cache)),
|
|
@@ -202,7 +202,7 @@ export class OnboardingServiceFactory {
|
|
|
202
202
|
cli.successAction("ONBOARDING:FETCH:RUNTIME_CONFIG");
|
|
203
203
|
return JSON.parse(serverConfigResult.data);
|
|
204
204
|
}
|
|
205
|
-
async getIntegrationFiles() {
|
|
205
|
+
async getIntegrationFiles(cli) {
|
|
206
206
|
const projectRoot = path.resolve(this.context.customerPath, "../..");
|
|
207
207
|
const speedKitPath = path.resolve(projectRoot, "node_modules", "speed-kit");
|
|
208
208
|
const speedKitBuildPath = path.resolve(speedKitPath, "dist", "speedkit");
|
|
@@ -211,7 +211,7 @@ export class OnboardingServiceFactory {
|
|
|
211
211
|
const dfPath = path.join(speedKitBuildPath, "dynamic-fetcher.js");
|
|
212
212
|
const loaderPath = path.join(speedKitBuildPath, "snippet.js");
|
|
213
213
|
const integrationApiContext = new IntegrationApiContext(this.context.customerPath, this.context.configName, [], [], this.context.useTestConfig);
|
|
214
|
-
const integrationApi = new IntegrationApiFactory(integrationApiContext, this.cliConfig).buildService();
|
|
214
|
+
const integrationApi = new IntegrationApiFactory(integrationApiContext, this.cliConfig, cli).buildService();
|
|
215
215
|
const externalFileReader = new ExternalFileReader();
|
|
216
216
|
const integrationApiArray = [
|
|
217
217
|
{
|
|
@@ -221,7 +221,7 @@ export class OnboardingServiceFactory {
|
|
|
221
221
|
];
|
|
222
222
|
// if speed-kit is npm-linked, use linked local files else fetch latest released sw and df
|
|
223
223
|
if (isSpeedKitLinked) {
|
|
224
|
-
|
|
224
|
+
cli.writeWarning(`Linked Speed-Kit found in node_modules. Using built sw, df and loader.`);
|
|
225
225
|
integrationApiArray.push({
|
|
226
226
|
name: INTEGRATION_FILES.CUSTOM.SW,
|
|
227
227
|
recipe: new StaticRecipe(fs.readFileSync(swPath, "utf-8")),
|
|
@@ -3,7 +3,7 @@ import { BrowserContext } from "./onboarding-model.js";
|
|
|
3
3
|
import { FetchEventHandler } from "./fetch-event-handler.js";
|
|
4
4
|
import { SpeedKitServiceWorkerJs } from "./fetch-events/speed-kit-service-worker-js.js";
|
|
5
5
|
import { FileWatcher } from "./file-events/file-watcher.js";
|
|
6
|
-
import {
|
|
6
|
+
import { CliServiceInterface } from "../cli/index.js";
|
|
7
7
|
import { DevtoolsExtensionApi } from "./browser/extension/devtools-extension-api.js";
|
|
8
8
|
import { ExtensionBridge } from "./browser/extension/extension-bridge.js";
|
|
9
9
|
import { BrowserOriginFetchHandle } from "../browser-fetch/index.js";
|
|
@@ -23,7 +23,7 @@ export declare class OnboardingService {
|
|
|
23
23
|
private reinstallOnNextNavigate;
|
|
24
24
|
private lastForeignSwReinstall;
|
|
25
25
|
private readonly activatedSwVersions;
|
|
26
|
-
constructor(browserContext: BrowserContext, customerConfig: CustomerConfig, fetchEventHandler: FetchEventHandler, fileWatcher: FileWatcher, cli:
|
|
26
|
+
constructor(browserContext: BrowserContext, customerConfig: CustomerConfig, fetchEventHandler: FetchEventHandler, fileWatcher: FileWatcher, cli: CliServiceInterface, developmentToolsMessages: DevtoolsExtensionApi, extensionBridge: ExtensionBridge, speedKitServiceWorkerJs: SpeedKitServiceWorkerJs, browserFetch?: BrowserOriginFetchHandle);
|
|
27
27
|
/**
|
|
28
28
|
* Prepare the puppeteer browser, wire event listeners, navigate to the
|
|
29
29
|
* install page, then block until either the caller aborts the signal
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BaqendResponse } from "../browser/baqend-response.js";
|
|
2
|
-
import {
|
|
2
|
+
import { CliServiceInterface } from "../../cli/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* This class represents a cache for storing responses from the localDocumentHandler.
|
|
5
5
|
*/
|
|
6
6
|
export declare class Cache {
|
|
7
7
|
private cli;
|
|
8
8
|
private inMemoryCache;
|
|
9
|
-
constructor(cli:
|
|
9
|
+
constructor(cli: CliServiceInterface);
|
|
10
10
|
getAll(): IterableIterator<[string, BaqendResponse]>;
|
|
11
11
|
getEntry(requestUri: string): BaqendResponse | null;
|
|
12
12
|
addEntry(requestUri: string, response: BaqendResponse): void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CliServiceInterface } from "../../cli/index.js";
|
|
2
2
|
import { SpeedKitServerConfig } from "../onboarding-model.js";
|
|
3
3
|
import { ConfigApiService } from "../../config-api/index.js";
|
|
4
4
|
export declare class ServerConfig {
|
|
5
5
|
private cli;
|
|
6
6
|
private client?;
|
|
7
|
-
constructor(cli:
|
|
7
|
+
constructor(cli: CliServiceInterface, client?: ConfigApiService);
|
|
8
8
|
getServerSpeedKitConfig(): Promise<SpeedKitServerConfig | null>;
|
|
9
9
|
private getServerConfig;
|
|
10
10
|
}
|
package/dist/services/onboarding/{browser → spec/browser}/executable/headed-user-agent.spec.js
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { expect } from "chai";
|
|
2
2
|
import { describe, it } from "mocha";
|
|
3
|
-
import { buildHeadedUserAgent } from "
|
|
3
|
+
import { buildHeadedUserAgent } from "../../../browser/executable/headed-user-agent.js";
|
|
4
4
|
const CHROME_VERSION = "Google Chrome for Testing 146.0.7680.165";
|
|
5
5
|
describe("buildHeadedUserAgent", () => {
|
|
6
6
|
it("builds the reduced user agent for Linux", () => {
|
package/dist/services/onboarding/{empty-service-worker.spec.js → spec/empty-service-worker.spec.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { expect } from "chai";
|
|
2
2
|
import { describe, it } from "mocha";
|
|
3
|
-
import { isEmptyServiceWorkerUrl } from "
|
|
3
|
+
import { isEmptyServiceWorkerUrl } from "../empty-service-worker.js";
|
|
4
4
|
describe("isEmptyServiceWorkerUrl", () => {
|
|
5
5
|
it("recognizes the r=empty marker", () => {
|
|
6
6
|
expect(isEmptyServiceWorkerUrl("https://www.example.com/wrapper-sw.js?r=empty")).to.equal(true);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { expect } from "chai";
|
|
2
2
|
import { describe, it } from "mocha";
|
|
3
|
-
import { BrowserContext, HEADLESS_DEFAULT_ARGS_TO_DROP, } from "
|
|
4
|
-
import { buildHeadedUserAgent } from "
|
|
3
|
+
import { BrowserContext, HEADLESS_DEFAULT_ARGS_TO_DROP, } from "../onboarding-model.js";
|
|
4
|
+
import { buildHeadedUserAgent } from "../browser/executable/headed-user-agent.js";
|
|
5
5
|
// Providing chromeUserProfilePath keeps BrowserContext off the filesystem
|
|
6
6
|
// (it skips the temp-profile branch in the constructor).
|
|
7
7
|
const userConfig = {
|