@speedkit/cli 4.36.0 → 4.36.2
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 +15 -0
- package/README.md +3 -29
- package/dist/base/sk-command.d.ts +41 -0
- package/dist/base/sk-command.js +56 -0
- package/dist/commands/auto-prewarm.d.ts +6 -4
- package/dist/commands/auto-prewarm.js +13 -66
- package/dist/commands/autocomplete/fish.d.ts +2 -2
- package/dist/commands/autocomplete/fish.js +3 -2
- package/dist/commands/browser/clean.d.ts +2 -2
- package/dist/commands/browser/clean.js +6 -7
- package/dist/commands/browser/list.d.ts +2 -2
- package/dist/commands/browser/list.js +6 -8
- package/dist/commands/browser/update.d.ts +2 -2
- package/dist/commands/browser/update.js +9 -12
- package/dist/commands/bulk-deploy.d.ts +4 -2
- package/dist/commands/bulk-deploy.js +7 -37
- package/dist/commands/config/edit.d.ts +2 -2
- package/dist/commands/config/edit.js +2 -2
- package/dist/commands/config/setup.d.ts +5 -2
- package/dist/commands/config/setup.js +10 -19
- package/dist/commands/deploy.d.ts +12 -3
- package/dist/commands/deploy.js +14 -19
- package/dist/commands/diff-url-parameters.d.ts +5 -4
- package/dist/commands/diff-url-parameters.js +28 -18
- package/dist/commands/extension/add.d.ts +2 -2
- package/dist/commands/extension/add.js +6 -6
- package/dist/commands/extension/devtools.d.ts +2 -2
- package/dist/commands/extension/devtools.js +6 -7
- package/dist/commands/extension/list.d.ts +2 -2
- package/dist/commands/extension/list.js +5 -6
- package/dist/commands/extension/remove.d.ts +2 -2
- package/dist/commands/extension/remove.js +6 -6
- package/dist/commands/extension/update.d.ts +2 -2
- package/dist/commands/extension/update.js +5 -6
- package/dist/commands/find-pops.d.ts +2 -2
- package/dist/commands/find-pops.js +11 -11
- package/dist/commands/generate-customer-config.d.ts +5 -2
- package/dist/commands/generate-customer-config.js +9 -27
- package/dist/commands/generate-pop-config.d.ts +2 -2
- package/dist/commands/generate-pop-config.js +26 -26
- package/dist/commands/login.d.ts +2 -2
- package/dist/commands/login.js +6 -9
- package/dist/commands/onboarding.d.ts +18 -3
- package/dist/commands/onboarding.js +13 -11
- package/dist/commands/origin-request.d.ts +4 -2
- package/dist/commands/origin-request.js +10 -42
- package/dist/commands/prewarm.d.ts +4 -2
- package/dist/commands/prewarm.js +12 -56
- package/dist/commands/pull.d.ts +4 -2
- package/dist/commands/pull.js +9 -14
- package/dist/commands/query/parameter.d.ts +4 -2
- package/dist/commands/query/parameter.js +12 -19
- package/dist/commands/query/prewarm.d.ts +4 -2
- package/dist/commands/query/prewarm.js +16 -23
- package/dist/commands/revalidate.d.ts +4 -2
- package/dist/commands/revalidate.js +14 -56
- package/dist/commands/wpt-launcher.d.ts +2 -2
- package/dist/commands/wpt-launcher.js +17 -17
- 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 +9 -10
- 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/context.d.ts +24 -0
- package/dist/models/context.js +31 -0
- package/dist/services/athena/athena-flags.d.ts +18 -0
- package/dist/services/athena/athena-flags.js +29 -0
- package/dist/services/athena/athena-service-build-context.d.ts +25 -0
- package/dist/services/athena/athena-service-build-context.js +4 -0
- package/dist/services/athena/athena-service-factory.d.ts +3 -14
- package/dist/services/athena/athena-service-factory.js +11 -25
- package/dist/services/athena/baqend-athena-service.d.ts +3 -14
- package/dist/services/athena/baqend-athena-service.js +8 -16
- package/dist/services/athena/index.d.ts +1 -0
- package/dist/services/athena/index.js +1 -0
- 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} +4 -4
- package/dist/services/browser-fetch/browser-origin-fetch.d.ts +2 -2
- package/dist/services/browser-fetch/browser-origin-fetch.js +1 -1
- package/dist/services/browser-fetch/browser-origin-fetcher.d.ts +3 -3
- package/dist/services/browser-fetch/browser-origin-fetcher.js +5 -5
- package/dist/services/browser-fetch/{browser-origin-fetch.spec.js → spec/browser-origin-fetch.spec.js} +12 -12
- 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/services/cli/cli-environment-factory.d.ts +25 -0
- package/dist/services/cli/cli-environment-factory.js +30 -0
- package/dist/services/cli/cli-environment.d.ts +73 -0
- package/dist/services/cli/cli-environment.js +216 -0
- package/dist/services/cli/cli-service-build-context.d.ts +10 -0
- package/dist/services/cli/cli-service-build-context.js +4 -0
- package/dist/services/cli/cli-service-factory.d.ts +12 -4
- package/dist/services/cli/cli-service-factory.js +11 -9
- package/dist/services/cli/cli-service-model.d.ts +10 -6
- package/dist/services/cli/cli-service-model.js +0 -6
- package/dist/services/cli/cli-service.d.ts +52 -1
- package/dist/services/cli/cli-service.js +60 -14
- package/dist/services/cli/cli-settings.d.ts +37 -0
- package/dist/services/cli/cli-settings.js +23 -0
- 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/command-build-context.d.ts +23 -0
- package/dist/services/cli/index.d.ts +5 -0
- package/dist/services/cli/index.js +5 -0
- package/dist/services/cli/spec/cli-environment-detection.spec.js +52 -0
- package/dist/services/cli/spec/cli-environment.spec.js +125 -0
- package/dist/services/cli/{cli-service.spec.js → spec/cli-service.spec.js} +10 -20
- package/dist/services/config-api/client.d.ts +3 -3
- package/dist/services/config-api/client.js +4 -4
- package/dist/services/config-api/config-api-factory.js +3 -3
- package/dist/services/config-api/entity-manager-provider.d.ts +11 -0
- package/dist/services/config-api/{entity-manager-factory.js → entity-manager-provider.js} +7 -1
- package/dist/services/customer-config/customer-config-service-build-context.d.ts +33 -0
- package/dist/services/customer-config/customer-config-service-build-context.js +36 -0
- package/dist/services/customer-config/customer-config-service-factory.d.ts +3 -2
- package/dist/services/customer-config/customer-config-service-factory.js +5 -4
- package/dist/services/customer-config/customer-config-service.d.ts +5 -3
- package/dist/services/customer-config/customer-config-service.js +4 -3
- package/dist/services/customer-config/index.d.ts +1 -1
- package/dist/services/customer-config/index.js +1 -1
- package/dist/services/customer-config/site-analyzer/index.d.ts +4 -0
- package/dist/services/customer-config/site-analyzer/index.js +4 -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-build-context.d.ts +6 -0
- package/dist/services/customer-config/site-analyzer/site-analyzer-service-build-context.js +4 -0
- 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 +10 -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-model.d.ts +0 -25
- package/dist/services/deploy/bulk/bulk-deploy-model.js +1 -27
- package/dist/services/deploy/bulk/bulk-deploy-service-build-context.d.ts +51 -0
- package/dist/services/deploy/bulk/bulk-deploy-service-build-context.js +50 -0
- package/dist/services/deploy/bulk/bulk-deploy-service-factory.d.ts +2 -4
- package/dist/services/deploy/bulk/bulk-deploy-service-factory.js +2 -5
- package/dist/services/deploy/bulk/bulk-deploy-service.d.ts +3 -2
- package/dist/services/deploy/bulk/config-deploy-factory.d.ts +3 -3
- package/dist/services/deploy/bulk/config-deploy-factory.js +16 -8
- package/dist/services/deploy/bulk/index.d.ts +1 -0
- package/dist/services/deploy/bulk/index.js +1 -0
- package/dist/services/deploy/checks/activation/customer-approval-check.d.ts +3 -1
- package/dist/services/deploy/checks/activation/customer-approval-check.js +4 -2
- 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/checks/pre-deploy/device-detection-changed-check.d.ts +3 -1
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +4 -2
- package/dist/services/deploy/checks/pre-deploy/split-change-check.d.ts +3 -1
- package/dist/services/deploy/checks/pre-deploy/split-change-check.js +4 -2
- package/dist/services/deploy/deploy-service-build-context.d.ts +63 -0
- package/dist/services/deploy/deploy-service-build-context.js +64 -0
- package/dist/services/deploy/deploy-service-factory.d.ts +4 -6
- package/dist/services/deploy/deploy-service-factory.js +25 -14
- 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 +6 -4
- package/dist/services/deploy/mr/base-config-reader.js +14 -13
- package/dist/services/deploy/mr/index.d.ts +1 -0
- package/dist/services/deploy/mr/index.js +1 -0
- package/dist/services/deploy/mr/merge-request-deploy-model.d.ts +0 -35
- package/dist/services/deploy/mr/merge-request-deploy-model.js +0 -34
- package/dist/services/deploy/mr/merge-request-deploy-service-build-context.d.ts +32 -0
- package/dist/services/deploy/mr/merge-request-deploy-service-build-context.js +20 -0
- package/dist/services/deploy/mr/merge-request-deploy-service-factory.d.ts +2 -4
- package/dist/services/deploy/mr/merge-request-deploy-service-factory.js +31 -10
- package/dist/services/deploy/mr/merge-request-deploy-service.d.ts +3 -2
- package/dist/services/deploy/{bulk → spec/bulk}/bulk-deploy-service.spec.js +18 -7
- 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 +9 -7
- 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 +5 -4
- 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-build-context.d.ts +14 -0
- package/dist/services/diff/diff-service-build-context.js +4 -0
- package/dist/services/diff/diff-service-factory.d.ts +4 -3
- package/dist/services/diff/diff-service-factory.js +3 -4
- 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 +2 -1
- package/dist/services/diff/index.js +2 -1
- package/dist/services/document-handler-runtime/document-handler-runtime-model.d.ts +7 -0
- package/dist/services/document-handler-runtime/document-handler-runtime-model.js +10 -0
- package/dist/services/document-handler-runtime/document-handler-runtime-service-build-context.d.ts +11 -0
- package/dist/services/document-handler-runtime/document-handler-runtime-service-build-context.js +4 -0
- package/dist/services/document-handler-runtime/document-handler-server.d.ts +2 -2
- package/dist/services/document-handler-runtime/document-handler-server.js +2 -2
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +3 -14
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +14 -80
- package/dist/services/document-handler-runtime/server/request.js +1 -1
- package/dist/services/document-handler-runtime/{document-handler-abort.spec.js → spec/document-handler-abort.spec.js} +2 -2
- package/dist/services/document-handler-runtime/templates/database-mock.d.ts +1 -1
- package/dist/services/document-handler-runtime/templates/database-mock.js +1 -1
- package/dist/services/git/{git-repository.spec.js → spec/git-repository.spec.js} +1 -1
- package/dist/services/integration-api/customer-config-flags.d.ts +16 -0
- package/dist/services/integration-api/customer-config-flags.js +30 -0
- package/dist/services/integration-api/handler/customer-config-handler.d.ts +2 -2
- package/dist/services/integration-api/handler/install-resource-handler.d.ts +8 -0
- package/dist/services/integration-api/handler/install-resource-handler.js +10 -1
- package/dist/services/integration-api/index.d.ts +1 -0
- package/dist/services/integration-api/index.js +1 -0
- package/dist/services/integration-api/integration-api-factory.d.ts +4 -5
- package/dist/services/integration-api/integration-api-factory.js +11 -9
- package/dist/services/integration-api/integration-api-model.d.ts +0 -9
- package/dist/services/integration-api/integration-api-model.js +0 -16
- package/dist/services/integration-api/integration-api-service-build-context.d.ts +19 -0
- package/dist/services/integration-api/integration-api-service-build-context.js +4 -0
- package/dist/services/integration-api/spec/config-plugin.spec.js +1 -1
- package/dist/services/integration-api/spec/integration-api-service.spec.js +7 -3
- package/dist/services/integration-api/spec/speed-kit-config-file.spec.js +9 -2
- package/dist/services/integration-api/struct/config-plugin.d.ts +1 -1
- package/dist/services/integration-api/struct/config-plugin.js +12 -7
- package/dist/services/integration-api/struct/customer-config-file.js +1 -1
- package/dist/services/integration-api/struct/speed-kit-config-file.d.ts +18 -2
- package/dist/services/integration-api/struct/speed-kit-config-file.js +22 -12
- package/dist/services/integration-api/struct/speed-kit-config.d.ts +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 +3 -3
- package/dist/services/onboarding/browser/config/browser-config.js +5 -5
- package/dist/services/onboarding/browser/executable/executable-validator.d.ts +3 -4
- package/dist/services/onboarding/browser/executable/executable-validator.js +17 -15
- package/dist/services/onboarding/browser/extension/extension-downloader.d.ts +3 -4
- package/dist/services/onboarding/browser/extension/extension-downloader.js +6 -6
- package/dist/services/onboarding/browser/extension/extension-validator.d.ts +3 -4
- package/dist/services/onboarding/browser/extension/extension-validator.js +4 -4
- 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 +3 -2
- package/dist/services/onboarding/index.d.ts +1 -1
- package/dist/services/onboarding/index.js +1 -1
- package/dist/services/onboarding/onboarding-model.d.ts +8 -24
- package/dist/services/onboarding/onboarding-model.js +19 -87
- package/dist/services/onboarding/onboarding-service-build-context.d.ts +57 -0
- package/dist/services/onboarding/onboarding-service-build-context.js +67 -0
- package/dist/services/onboarding/onboarding-service-factory.d.ts +2 -4
- package/dist/services/onboarding/onboarding-service-factory.js +50 -37
- 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} +13 -8
- 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/index.d.ts +1 -1
- package/dist/services/origin-request/index.js +1 -1
- package/dist/services/origin-request/origin-request-service-build-context.d.ts +52 -0
- package/dist/services/origin-request/origin-request-service-build-context.js +54 -0
- package/dist/services/origin-request/origin-request-service-factory.d.ts +2 -4
- package/dist/services/origin-request/origin-request-service-factory.js +10 -8
- package/dist/services/origin-request/origin-request-service.d.ts +3 -3
- package/dist/services/origin-request/{asset-variations.spec.js → spec/asset-variations.spec.js} +1 -1
- package/dist/services/pop-config/index.d.ts +1 -0
- package/dist/services/pop-config/index.js +1 -0
- package/dist/services/pop-config/pop-config-factory.d.ts +4 -1
- package/dist/services/pop-config/pop-config-factory.js +10 -3
- package/dist/services/pop-config/pop-config-service-build-context.d.ts +10 -0
- package/dist/services/pop-config/pop-config-service-build-context.js +4 -0
- 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 -30
- package/dist/services/prewarm/auto-pre-warm-factory.js +7 -9
- package/dist/services/prewarm/auto-pre-warm-service-build-context.d.ts +84 -0
- package/dist/services/prewarm/auto-pre-warm-service-build-context.js +68 -0
- package/dist/services/prewarm/index.d.ts +2 -0
- package/dist/services/prewarm/index.js +2 -0
- 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 +4 -3
- package/dist/services/prewarm/pre-warm-factory.js +5 -4
- package/dist/services/prewarm/pre-warm-model.d.ts +0 -10
- package/dist/services/prewarm/pre-warm-model.js +0 -18
- package/dist/services/prewarm/pre-warm-service-build-context.d.ts +47 -0
- package/dist/services/prewarm/pre-warm-service-build-context.js +64 -0
- 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/index.d.ts +1 -0
- package/dist/services/pull/index.js +1 -0
- package/dist/services/pull/pull-service-build-context.d.ts +28 -0
- package/dist/services/pull/pull-service-build-context.js +17 -0
- package/dist/services/pull/pull-service-factory.d.ts +3 -4
- package/dist/services/pull/pull-service-factory.js +11 -10
- package/dist/services/pull/pull-service-model.d.ts +0 -5
- package/dist/services/pull/pull-service-model.js +0 -9
- package/dist/services/query-builder/query-builder-factory.d.ts +9 -6
- package/dist/services/query-builder/query-builder-factory.js +24 -11
- package/dist/{models/cli-parameters.d.ts → services/query-builder/query-builder-flags.d.ts} +1 -122
- package/dist/services/query-builder/query-builder-flags.js +150 -0
- package/dist/services/query-builder/query-builder-model.d.ts +1 -14
- package/dist/services/query-builder/query-builder-service-build-context.d.ts +113 -0
- package/dist/services/query-builder/query-builder-service-build-context.js +68 -0
- package/dist/services/query-builder/query-builder-service.d.ts +3 -3
- package/dist/services/query-builder/query-builder-service.js +4 -5
- 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/{models/cli-parameters.spec.js → services/query-builder/spec/query-builder-flags.spec.js} +1 -1
- 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/index.d.ts +1 -0
- package/dist/services/revalidate/index.js +1 -0
- package/dist/services/revalidate/revalidate-factory.d.ts +3 -3
- package/dist/services/revalidate/revalidate-factory.js +1 -2
- package/dist/services/revalidate/revalidate-model.d.ts +0 -9
- package/dist/services/revalidate/revalidate-model.js +0 -8
- package/dist/services/revalidate/revalidate-service-build-context.d.ts +38 -0
- package/dist/services/revalidate/revalidate-service-build-context.js +59 -0
- 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 +3 -5
- package/dist/services/setup/browser/browser-setup-service.js +16 -18
- package/dist/services/setup/difftool/difftool-setup-service.d.ts +3 -5
- package/dist/services/setup/difftool/difftool-setup-service.js +5 -7
- package/dist/services/setup/extension/extension-installer.d.ts +1 -1
- package/dist/services/setup/extension/extension-setup-service.d.ts +3 -5
- package/dist/services/setup/extension/extension-setup-service.js +8 -10
- package/dist/services/setup/index.d.ts +1 -1
- package/dist/services/setup/index.js +1 -1
- package/dist/services/setup/setup-service-build-context.d.ts +27 -0
- package/dist/services/setup/setup-service-build-context.js +26 -0
- package/dist/services/setup/setup-service-factory.d.ts +2 -4
- package/dist/services/setup/setup-service-factory.js +10 -17
- package/dist/services/setup/setup-service.d.ts +4 -6
- package/dist/services/setup/setup-service.js +6 -7
- 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/spec/os/tool-registry.spec.d.ts +1 -0
- package/dist/services/setup/{os → spec/os}/tool-registry.spec.js +1 -1
- package/oclif.manifest.json +1 -52
- package/package.json +6 -3
- package/dist/commands/document-handler.d.ts +0 -16
- package/dist/commands/document-handler.js +0 -32
- package/dist/helpers/cli-config.d.ts +0 -59
- package/dist/helpers/cli-config.js +0 -180
- package/dist/helpers/cli-config.spec.js +0 -117
- package/dist/helpers/customer-config.d.ts +0 -45
- package/dist/helpers/customer-config.js +0 -136
- package/dist/helpers/environment.d.ts +0 -15
- package/dist/helpers/environment.js +0 -40
- package/dist/helpers/environment.spec.js +0 -28
- 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/cli-parameters.js +0 -299
- package/dist/models/install.d.ts +0 -24
- package/dist/services/config-api/entity-manager-factory.d.ts +0 -5
- package/dist/services/config-api-service.d.ts +0 -21
- package/dist/services/config-api-service.js +0 -107
- package/dist/services/customer-config/customer-config-service-context.d.ts +0 -13
- package/dist/services/customer-config/customer-config-service-context.js +0 -21
- package/dist/services/deploy/context/deploy-context.d.ts +0 -32
- package/dist/services/deploy/context/deploy-context.js +0 -72
- package/dist/services/diff/diff-model.d.ts +0 -9
- package/dist/services/diff/diff-model.js +0 -12
- package/dist/services/diff-service.d.ts +0 -27
- package/dist/services/diff-service.js +0 -116
- package/dist/services/document-handler-runtime/context/document-handler-runtime-context.d.ts +0 -24
- package/dist/services/document-handler-runtime/context/document-handler-runtime-context.js +0 -62
- 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/services/origin-request/origin-request-context.d.ts +0 -13
- package/dist/services/origin-request/origin-request-context.js +0 -23
- package/dist/services/query-builder/query-command.d.ts +0 -28
- package/dist/services/query-builder/query-command.js +0 -37
- package/dist/services/setup/setup-context.d.ts +0 -14
- package/dist/services/setup/setup-context.js +0 -15
- /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/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/cli-config.spec.d.ts → services/cli/command-build-context.js} +0 -0
- /package/dist/{helpers/environment.spec.d.ts → services/cli/spec/cli-environment-detection.spec.d.ts} +0 -0
- /package/dist/{models/cli-parameters.spec.d.ts → services/cli/spec/cli-environment.spec.d.ts} +0 -0
- /package/dist/services/cli/{cli-service.spec.d.ts → spec/cli-service.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-flags.spec.d.ts} +0 -0
- /package/dist/services/query-builder/{rules/spec/pattern-language.spec.d.ts → spec/query-builder-service.spec.d.ts} +0 -0
- /package/dist/services/query-builder/{rules/spec/rule-parser.spec.d.ts → spec/rules/pattern-language.spec.d.ts} +0 -0
- /package/dist/services/query-builder/{rules/spec/rule-reducer.spec.d.ts → spec/rules/rule-parser.spec.d.ts} +0 -0
- /package/dist/services/query-builder/{rules/spec/rule-relevance.spec.d.ts → spec/rules/rule-reducer.spec.d.ts} +0 -0
- /package/dist/services/query-builder/{rules/spec/rule-to-sql.spec.d.ts → spec/rules/rule-relevance.spec.d.ts} +0 -0
- /package/dist/services/query-builder/{rules/spec/runtime-semantics.spec.d.ts → spec/rules/rule-to-sql.spec.d.ts} +0 -0
- /package/dist/services/query-builder/{rules/spec/strip-parameters.spec.d.ts → spec/rules/runtime-semantics.spec.d.ts} +0 -0
- /package/dist/services/query-builder/{sql/spec/expression.spec.d.ts → spec/rules/strip-parameters.spec.d.ts} +0 -0
- /package/dist/services/query-builder/{sql/spec/format.spec.d.ts → spec/sql/expression.spec.d.ts} +0 -0
- /package/dist/services/query-builder/{sql/spec/predicate.spec.d.ts → spec/sql/format.spec.d.ts} +0 -0
- /package/dist/services/query-builder/{sql/spec/regex.spec.d.ts → spec/sql/predicate.spec.d.ts} +0 -0
- /package/dist/services/{revalidate/revalidate-service.spec.d.ts → query-builder/spec/sql/regex.spec.d.ts} +0 -0
- /package/dist/services/{setup/extension/crx.spec.d.ts → revalidate/spec/revalidate-service.spec.d.ts} +0 -0
- /package/dist/services/setup/{extension/webstore.spec.d.ts → spec/extension/crx.spec.d.ts} +0 -0
- /package/dist/services/setup/{os/tool-registry.spec.d.ts → spec/extension/webstore.spec.d.ts} +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Args, Flags } from "@oclif/core";
|
|
2
|
+
import { Context } from "../../models/context.js";
|
|
3
|
+
const args = {
|
|
4
|
+
app: Args.string({
|
|
5
|
+
name: "app", // name of arg to show in help and reference with args[name]
|
|
6
|
+
required: true, // make the arg required with `required: true`
|
|
7
|
+
description: "The customer app name", // help description
|
|
8
|
+
}),
|
|
9
|
+
path: Args.file({
|
|
10
|
+
name: "path", // name of arg to show in help and reference with args[name]
|
|
11
|
+
required: true, // make the arg required with `required: true`
|
|
12
|
+
description: "path to prewarmFile.csv", // help description
|
|
13
|
+
}),
|
|
14
|
+
};
|
|
15
|
+
const flags = {
|
|
16
|
+
// No default: the list may already name a variation per url, and only a
|
|
17
|
+
// flag the caller really gave should be reported as ignored then.
|
|
18
|
+
variation: Flags.string({
|
|
19
|
+
char: "v",
|
|
20
|
+
description: "Warm every url of the list in each of these variations, e.g. 'desktop,mobile'. Ignored for a list that names a variation itself",
|
|
21
|
+
}),
|
|
22
|
+
variationPath: Flags.file({
|
|
23
|
+
char: "p",
|
|
24
|
+
exclusive: ["variation"],
|
|
25
|
+
description: "path to variations.csv",
|
|
26
|
+
}),
|
|
27
|
+
keepParameterSorting: Flags.boolean({
|
|
28
|
+
char: "k",
|
|
29
|
+
default: false,
|
|
30
|
+
description: "Prevents alphabetical sorting of the URL parameters",
|
|
31
|
+
}),
|
|
32
|
+
quiet: Flags.boolean({
|
|
33
|
+
char: "q",
|
|
34
|
+
default: false,
|
|
35
|
+
description: "less output non interactive",
|
|
36
|
+
}),
|
|
37
|
+
verbose: Flags.boolean({
|
|
38
|
+
default: false,
|
|
39
|
+
description: "Log information about failed requests",
|
|
40
|
+
}),
|
|
41
|
+
["delay"]: Flags.integer({
|
|
42
|
+
char: "d",
|
|
43
|
+
description: "Request delay in ms (deprecated)",
|
|
44
|
+
deprecated: true,
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
/** What `sk prewarm` warms: a list of urls of one app. */
|
|
48
|
+
export class PreWarmServiceBuildContext extends Context() {
|
|
49
|
+
static args = args;
|
|
50
|
+
static flags = flags;
|
|
51
|
+
static create(parsedArgs, parsedFlags, environment) {
|
|
52
|
+
return new PreWarmServiceBuildContext({
|
|
53
|
+
environment,
|
|
54
|
+
app: parsedArgs.app,
|
|
55
|
+
path: parsedArgs.path,
|
|
56
|
+
variation: parsedFlags.variation,
|
|
57
|
+
variationPath: parsedFlags.variationPath,
|
|
58
|
+
sortParameters: !parsedFlags.keepParameterSorting,
|
|
59
|
+
quiet: parsedFlags.quiet ?? false,
|
|
60
|
+
verbose: parsedFlags.verbose ?? false,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
PreWarmServiceBuildContext;
|
|
@@ -3,7 +3,7 @@ import { tmpdir } from "node:os";
|
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { expect } from "chai";
|
|
5
5
|
import { describe, it } from "mocha";
|
|
6
|
-
import { CsvReader } from "
|
|
6
|
+
import { CsvReader } from "../csv-reader.js";
|
|
7
7
|
function write(content) {
|
|
8
8
|
const file = join(mkdtempSync(join(tmpdir(), "sk-csv-")), "urls.csv");
|
|
9
9
|
writeFileSync(file, content, "utf8");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { expect } from "chai";
|
|
2
2
|
import { describe, it } from "mocha";
|
|
3
|
-
import { toPrewarmTargets } from "
|
|
3
|
+
import { toPrewarmTargets } from "../prewarm-targets.js";
|
|
4
4
|
describe("toPrewarmTargets", () => {
|
|
5
5
|
it("should keep a paired list in the order it was given", () => {
|
|
6
6
|
// The order is the query's interleaving of the variations by hit count:
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Interfaces } from "@oclif/core";
|
|
2
|
+
import { CliEnvironment, CommandContextValues } from "../cli/index.js";
|
|
3
|
+
declare const args: {
|
|
4
|
+
customerPath: Interfaces.Arg<string, {
|
|
5
|
+
exists?: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
};
|
|
8
|
+
declare const flags: {
|
|
9
|
+
configName: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
export interface PullServiceBuildContextValues extends CommandContextValues {
|
|
12
|
+
readonly customerPath: string;
|
|
13
|
+
readonly configName: string;
|
|
14
|
+
}
|
|
15
|
+
declare const PullServiceBuildContext_base: new (values: PullServiceBuildContextValues) => Readonly<PullServiceBuildContextValues>;
|
|
16
|
+
/** What `sk pull` pulls: one config of one customer. */
|
|
17
|
+
export declare class PullServiceBuildContext extends PullServiceBuildContext_base {
|
|
18
|
+
static readonly args: {
|
|
19
|
+
customerPath: Interfaces.Arg<string, {
|
|
20
|
+
exists?: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
};
|
|
23
|
+
static readonly flags: {
|
|
24
|
+
configName: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
25
|
+
};
|
|
26
|
+
static create(parsedArgs: Interfaces.InferredArgs<typeof args>, parsedFlags: Interfaces.InferredFlags<typeof flags>, environment: CliEnvironment): PullServiceBuildContext;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CLI_CONFIG_NAME, CLI_CUSTOMER_CONFIG, } from "../integration-api/customer-config-flags.js";
|
|
2
|
+
import { Context } from "../../models/context.js";
|
|
3
|
+
const args = { ...CLI_CUSTOMER_CONFIG };
|
|
4
|
+
const flags = { ...CLI_CONFIG_NAME };
|
|
5
|
+
/** What `sk pull` pulls: one config of one customer. */
|
|
6
|
+
export class PullServiceBuildContext extends Context() {
|
|
7
|
+
static args = args;
|
|
8
|
+
static flags = flags;
|
|
9
|
+
static create(parsedArgs, parsedFlags, environment) {
|
|
10
|
+
return new PullServiceBuildContext({
|
|
11
|
+
environment,
|
|
12
|
+
customerPath: parsedArgs.customerPath,
|
|
13
|
+
configName: parsedFlags.configName,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
PullServiceBuildContext;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { PullService } from "./pull-service.js";
|
|
2
|
+
import { PullServiceBuildContext } from "./pull-service-build-context.js";
|
|
3
3
|
export declare class PullServiceFactory {
|
|
4
4
|
private readonly context;
|
|
5
|
-
private userConfig;
|
|
6
5
|
private service?;
|
|
7
|
-
constructor(context:
|
|
6
|
+
constructor(context: PullServiceBuildContext);
|
|
8
7
|
buildService(): Promise<PullService>;
|
|
9
8
|
private build;
|
|
10
9
|
private getIntegrationFiles;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { PullService } from "./index.js";
|
|
1
|
+
import { IntegrationApiServiceBuildContext, IntegrationApiFactory, } from "../integration-api/index.js";
|
|
2
|
+
import { PullService } from "./pull-service.js";
|
|
4
3
|
import { ConfigApiContext, ConfigApiServiceFactory, } from "../config-api/index.js";
|
|
5
4
|
export class PullServiceFactory {
|
|
6
5
|
context;
|
|
7
|
-
userConfig;
|
|
8
6
|
service = undefined;
|
|
9
|
-
constructor(context
|
|
10
|
-
this.context = context;
|
|
11
|
-
this.userConfig = userConfig;
|
|
7
|
+
constructor(context) {
|
|
12
8
|
this.context = context;
|
|
13
9
|
}
|
|
14
10
|
async buildService() {
|
|
@@ -18,16 +14,21 @@ export class PullServiceFactory {
|
|
|
18
14
|
return this.service;
|
|
19
15
|
}
|
|
20
16
|
async build() {
|
|
17
|
+
const cliService = this.context.environment.cli;
|
|
21
18
|
const files = await this.getIntegrationFiles();
|
|
22
19
|
const customer = files.getCustomerConfig().config;
|
|
23
20
|
const configName = customer.name || this.context.configName;
|
|
24
21
|
const configApi = this.getConfigApi(customer.app);
|
|
25
|
-
const cliService = new CliServiceFactory().getService();
|
|
26
22
|
this.service = new PullService(files, cliService, configApi, configName, this.context.customerPath);
|
|
27
23
|
}
|
|
28
24
|
async getIntegrationFiles() {
|
|
29
|
-
const integrationApiContext = new
|
|
30
|
-
|
|
25
|
+
const integrationApiContext = new IntegrationApiServiceBuildContext({
|
|
26
|
+
environment: this.context.environment,
|
|
27
|
+
basePath: this.context.customerPath,
|
|
28
|
+
configName: this.context.configName,
|
|
29
|
+
whitelist: [],
|
|
30
|
+
});
|
|
31
|
+
const integrationApi = new IntegrationApiFactory(integrationApiContext).buildService();
|
|
31
32
|
return await integrationApi.run();
|
|
32
33
|
}
|
|
33
34
|
getConfigApi(app) {
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import * as dotenv from "dotenv";
|
|
2
2
|
dotenv.config({ quiet: true });
|
|
3
|
-
const DEFAULT_CONFIG_NAME = "production";
|
|
4
|
-
export class PullContext {
|
|
5
|
-
customerPath;
|
|
6
|
-
configName;
|
|
7
|
-
constructor(customerPath, configName = DEFAULT_CONFIG_NAME) {
|
|
8
|
-
this.customerPath = customerPath;
|
|
9
|
-
this.configName = configName;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
3
|
export const InstallResourceToFileMapping = {
|
|
13
4
|
config: { fileName: "config_SpeedKit", extension: "js" },
|
|
14
5
|
documentHandlerConfig: {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { QueryBuilderService } from "./query-builder-service.js";
|
|
2
|
-
import {
|
|
3
|
-
import { UserCliConfig } from "../../helpers/cli-config.js";
|
|
2
|
+
import { QueryServiceBuildContext } from "./query-builder-service-build-context.js";
|
|
4
3
|
export declare class QueryBuilderFactory {
|
|
5
|
-
private context;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
private readonly context;
|
|
5
|
+
/**
|
|
6
|
+
* @param context a {@link PrewarmQueryServiceBuildContext} for the prewarm
|
|
7
|
+
* query, a {@link ParameterQueryServiceBuildContext} for the parameter
|
|
8
|
+
* query; the context says which query is built
|
|
9
|
+
*/
|
|
10
|
+
constructor(context: QueryServiceBuildContext);
|
|
11
|
+
buildService(): Promise<QueryBuilderService>;
|
|
9
12
|
private getIntegrationFiles;
|
|
10
13
|
private getSpeedKitConfig;
|
|
11
14
|
}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { QueryBuilderService } from "./query-builder-service.js";
|
|
2
2
|
import { parseRuleSets } from "./rules/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { IntegrationApiServiceBuildContext, IntegrationApiFactory, } from "../integration-api/index.js";
|
|
4
4
|
import { INTEGRATION_FILES } from "../../models/files.js";
|
|
5
|
-
import {
|
|
6
|
-
import { AthenaServiceFactory } from "../athena/index.js";
|
|
5
|
+
import { AthenaServiceBuildContext, AthenaServiceFactory, } from "../athena/index.js";
|
|
7
6
|
import { safe } from "../../helpers/safe.js";
|
|
8
7
|
import { ParseConfigSpeedKitError } from "./error/parse-config-speed-kit-error.js";
|
|
9
8
|
export class QueryBuilderFactory {
|
|
10
9
|
context;
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @param context a {@link PrewarmQueryServiceBuildContext} for the prewarm
|
|
12
|
+
* query, a {@link ParameterQueryServiceBuildContext} for the parameter
|
|
13
|
+
* query; the context says which query is built
|
|
14
|
+
*/
|
|
15
|
+
constructor(context) {
|
|
13
16
|
this.context = context;
|
|
14
|
-
this.userConfig = userConfig;
|
|
15
17
|
}
|
|
16
|
-
async buildService(
|
|
17
|
-
const
|
|
18
|
+
async buildService() {
|
|
19
|
+
const queryType = this.context.queryType;
|
|
20
|
+
const cli = this.context.environment.cli;
|
|
18
21
|
const files = await this.getIntegrationFiles();
|
|
19
22
|
const customerConfig = files.getCustomerConfig().config;
|
|
20
23
|
const app = customerConfig.app;
|
|
@@ -46,13 +49,23 @@ export class QueryBuilderFactory {
|
|
|
46
49
|
// The Athena service is only needed when the query is executed directly —
|
|
47
50
|
// which `--count` is, a count query being of no use as text.
|
|
48
51
|
const athenaService = this.context.execute || this.context.count
|
|
49
|
-
? await new AthenaServiceFactory(
|
|
52
|
+
? await new AthenaServiceFactory(new AthenaServiceBuildContext({
|
|
53
|
+
environment: this.context.environment,
|
|
54
|
+
app,
|
|
55
|
+
workgroup: this.context.workgroup,
|
|
56
|
+
catalog: this.context.catalog,
|
|
57
|
+
})).getService()
|
|
50
58
|
: undefined;
|
|
51
59
|
return new QueryBuilderService(serviceContext, parseRuleSets(speedKitConfig), cli, athenaService);
|
|
52
60
|
}
|
|
53
61
|
async getIntegrationFiles() {
|
|
54
|
-
const integrationApiContext = new
|
|
55
|
-
|
|
62
|
+
const integrationApiContext = new IntegrationApiServiceBuildContext({
|
|
63
|
+
environment: this.context.environment,
|
|
64
|
+
basePath: this.context.customerPath,
|
|
65
|
+
configName: this.context.configName,
|
|
66
|
+
whitelist: [INTEGRATION_FILES.CONFIG.SPEED_KIT],
|
|
67
|
+
});
|
|
68
|
+
const integrationApi = new IntegrationApiFactory(integrationApiContext).buildService();
|
|
56
69
|
return await integrationApi.run();
|
|
57
70
|
}
|
|
58
71
|
async getSpeedKitConfig(app, origin, speedKitConfigFile) {
|
|
@@ -1,103 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
AppName = "app",
|
|
3
|
-
Artifacts = "artifacts",
|
|
4
|
-
ConfigName = "configName",
|
|
5
|
-
ContentTypes = "contentTypes",
|
|
6
|
-
Catalog = "catalog",
|
|
7
|
-
Cookies = "cookies",
|
|
8
|
-
Count = "count",
|
|
9
|
-
CreateTests = "CreateTests",
|
|
10
|
-
CustomerPath = "customerPath",
|
|
11
|
-
CustomersDirectory = "customersDirectory",
|
|
12
|
-
Days = "days",
|
|
13
|
-
Delay = "delay",
|
|
14
|
-
Device = "device",
|
|
15
|
-
Domain = "domain",
|
|
16
|
-
DryRun = "dryRun",
|
|
17
|
-
Execute = "execute",
|
|
18
|
-
BySet = "bySet",
|
|
19
|
-
ExcludeNoindex = "excludeNoindex",
|
|
20
|
-
ExcludeNotFound = "excludeNotFound",
|
|
21
|
-
ExcludeSuspicious = "excludeSuspicious",
|
|
22
|
-
Explain = "explain",
|
|
23
|
-
Group = "group",
|
|
24
|
-
HardNavigationsOnly = "hardNavigationsOnly",
|
|
25
|
-
HideDiff = "hideDiff",
|
|
26
|
-
Ips = "ips",
|
|
27
|
-
KeepParameterSorting = "keepParameterSorting",
|
|
28
|
-
Limit = "limit",
|
|
29
|
-
Match = "match",
|
|
30
|
-
MinHits = "minHits",
|
|
31
|
-
MinImpressions = "minImpressions",
|
|
32
|
-
Quiet = "quiet",
|
|
33
|
-
Mobile = "mobile",
|
|
34
|
-
PageUrl = "pageUrl",
|
|
35
|
-
Path = "path",
|
|
36
|
-
SlackToken = "slackToken",
|
|
37
|
-
TestId = "testId",
|
|
38
|
-
Urls = "urls",
|
|
39
|
-
Variation = "variation",
|
|
40
|
-
VariationPath = "variationPath",
|
|
41
|
-
Verbose = "verbose",
|
|
42
|
-
Workgroup = "workgroup",
|
|
43
|
-
useTestConfig = "useTestConfig"
|
|
44
|
-
}
|
|
45
|
-
export declare enum CLIParametersChar {
|
|
46
|
-
AppName = "a",
|
|
47
|
-
Artifacts = "a",
|
|
48
|
-
ConfigName = "c",
|
|
49
|
-
ContentTypes = "c",
|
|
50
|
-
Cookies = "c",
|
|
51
|
-
CreateTests = "t",
|
|
52
|
-
CustomerPath = "p",
|
|
53
|
-
CustomersDirectory = "d",
|
|
54
|
-
Days = "d",
|
|
55
|
-
Delay = "d",
|
|
56
|
-
Domain = "d",
|
|
57
|
-
DryRun = "d",
|
|
58
|
-
Execute = "e",
|
|
59
|
-
Group = "g",
|
|
60
|
-
HideDiff = "h",
|
|
61
|
-
Ips = "i",
|
|
62
|
-
KeepParameterSorting = "k",
|
|
63
|
-
Mobile = "m",
|
|
64
|
-
SlackToken = "t",
|
|
65
|
-
Path = "p",
|
|
66
|
-
Variation = "v",
|
|
67
|
-
VariationPath = "p",
|
|
68
|
-
Quiet = "q",
|
|
69
|
-
useTestConfig = "t"
|
|
70
|
-
}
|
|
71
|
-
export declare enum CLIParametersExample {
|
|
72
|
-
AppName = "decathlon",
|
|
73
|
-
Artifacts = "dynamic,SpeedKit",
|
|
74
|
-
ConfigName = "production",
|
|
75
|
-
ContentTypes = "image,style",
|
|
76
|
-
Cookies = "consentCookies",
|
|
77
|
-
CustomerPath = "customers/decathlon.de",
|
|
78
|
-
CustomersDirectory = "customers",
|
|
79
|
-
Delay = "1200",
|
|
80
|
-
Devices = "desktop,mobile",
|
|
81
|
-
Domain = "www.decathlon.de",
|
|
82
|
-
Group = "B",
|
|
83
|
-
Ips = "151.101.120.194",
|
|
84
|
-
Match = "^/p/",
|
|
85
|
-
Mobile = "Y",
|
|
86
|
-
PageUrl = "https://www.decathlon.de/",
|
|
87
|
-
Path = "C:\\Users\\testUser\\file.csv",
|
|
88
|
-
SlackToken = "someSlackToken",
|
|
89
|
-
TestId = "listing-50vs50",
|
|
90
|
-
Urls = "url1,url2,url3",
|
|
91
|
-
Variation = "MOBILE",
|
|
92
|
-
Variations = "MOBILE,DESKTOP",
|
|
93
|
-
VariationPath = "C:\\Users\\testUser\\variations.csv"
|
|
94
|
-
}
|
|
95
|
-
export declare const CLI_CONFIG_NAME: {
|
|
96
|
-
configName: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
97
|
-
};
|
|
98
|
-
export declare const CLI_CONFIG_IS_TEST: {
|
|
99
|
-
useTestConfig: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
100
|
-
};
|
|
1
|
+
/** The flags of the commands that build a query. */
|
|
101
2
|
/** Shared wording, so every query command describes the window the same way. */
|
|
102
3
|
export declare const CLI_QUERY_DAYS_DESCRIPTION = "Number of days the query looks back";
|
|
103
4
|
/**
|
|
@@ -168,30 +69,8 @@ export declare const CLI_QUERY_PREWARM: {
|
|
|
168
69
|
device: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
|
|
169
70
|
variation: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
|
|
170
71
|
};
|
|
171
|
-
/**
|
|
172
|
-
* Where a query that is executed actually runs.
|
|
173
|
-
*
|
|
174
|
-
* The catalog is the account's, not the query's: our own logins reach the rum
|
|
175
|
-
* tables under `live`, while a role scoped to one account reaches the same
|
|
176
|
-
* tables under `AwsDataCatalog`. `SK_ATHENA_CATALOG` lets a CI job say so once.
|
|
177
|
-
*
|
|
178
|
-
* Athena resolves the account's default workgroup when none is named, which is
|
|
179
|
-
* only right where the credentials are allowed to use it — a role scoped to one
|
|
180
|
-
* workgroup is refused on any other, and the result location is a workgroup
|
|
181
|
-
* setting too. `SK_ATHENA_WORKGROUP` lets a CI job set it once for every
|
|
182
|
-
* command in the job.
|
|
183
|
-
*/
|
|
184
|
-
export declare const CLI_ATHENA: {
|
|
185
|
-
catalog: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
186
|
-
workgroup: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
187
|
-
};
|
|
188
72
|
/** How the parameter query presents what it found. */
|
|
189
73
|
export declare const CLI_QUERY_PARAMETER: {
|
|
190
74
|
bySet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
191
75
|
minImpressions: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
192
76
|
};
|
|
193
|
-
export declare const CLI_CUSTOMER_CONFIG: {
|
|
194
|
-
customerPath: import("@oclif/core/interfaces").Arg<string, {
|
|
195
|
-
exists?: boolean;
|
|
196
|
-
}>;
|
|
197
|
-
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { Flags } from "@oclif/core";
|
|
2
|
+
// Imported from the modules rather than from the barrels: a build context that
|
|
3
|
+
// uses these flags is loaded with its command, and the rules barrel pulls in
|
|
4
|
+
// the automata library.
|
|
5
|
+
import { parseMatchPattern } from "./rules/match-pattern.js";
|
|
6
|
+
import { DEVICE_VARIATIONS } from "./queries/device.js";
|
|
7
|
+
/** The flags of the commands that build a query. */
|
|
8
|
+
/** Shared wording, so every query command describes the window the same way. */
|
|
9
|
+
export const CLI_QUERY_DAYS_DESCRIPTION = "Number of days the query looks back";
|
|
10
|
+
/**
|
|
11
|
+
* How far back a query looks. Its own object because `generate-pop-config`
|
|
12
|
+
* takes it without the `-d` shorthand, which `--deploy` holds there.
|
|
13
|
+
*/
|
|
14
|
+
export const CLI_QUERY_DAYS = {
|
|
15
|
+
days: Flags.integer({
|
|
16
|
+
char: "d",
|
|
17
|
+
description: CLI_QUERY_DAYS_DESCRIPTION,
|
|
18
|
+
min: 1,
|
|
19
|
+
required: false,
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* What a query command does with the query it built. Both commands take them,
|
|
24
|
+
* so a query can be piped or run without a detour through the clipboard.
|
|
25
|
+
*/
|
|
26
|
+
export const CLI_QUERY_OUTPUT = {
|
|
27
|
+
execute: Flags.boolean({
|
|
28
|
+
char: "e",
|
|
29
|
+
default: false,
|
|
30
|
+
description: "Execute the query directly and write the result to a <app>-<date>-<query>.csv file",
|
|
31
|
+
}),
|
|
32
|
+
quiet: Flags.boolean({
|
|
33
|
+
char: "q",
|
|
34
|
+
default: false,
|
|
35
|
+
description: "Output only the raw query without clipboard copy or styling",
|
|
36
|
+
}),
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Which page impressions a query leaves out, and whether to account for every
|
|
40
|
+
* rule it does not carry over literally. Bots are always excluded.
|
|
41
|
+
*/
|
|
42
|
+
export const CLI_QUERY_FILTERS = {
|
|
43
|
+
excludeNoindex: Flags.boolean({
|
|
44
|
+
default: false,
|
|
45
|
+
description: "Exclude page impressions of pages marked noindex",
|
|
46
|
+
}),
|
|
47
|
+
excludeSuspicious: Flags.boolean({
|
|
48
|
+
default: false,
|
|
49
|
+
description: "Exclude page impressions Speed Kit classified as suspicious",
|
|
50
|
+
}),
|
|
51
|
+
explain: Flags.boolean({
|
|
52
|
+
default: false,
|
|
53
|
+
description: "Account for every rule the query leaves out, reduces or approximates",
|
|
54
|
+
}),
|
|
55
|
+
hardNavigationsOnly: Flags.boolean({
|
|
56
|
+
default: false,
|
|
57
|
+
description: "Exclude soft (SPA) navigations",
|
|
58
|
+
}),
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Which variation the pre-warm list carries per url, instead of leaving the
|
|
62
|
+
* pre-warmer to request every url in every variation.
|
|
63
|
+
*
|
|
64
|
+
* The two flags answer the same question from two different sources — the
|
|
65
|
+
* traffic, or the operator — so combining them would cross-produce the list
|
|
66
|
+
* again, which is what they are there to stop. A command that also reads a
|
|
67
|
+
* variations file from disk excludes that one on its own side.
|
|
68
|
+
*/
|
|
69
|
+
export const CLI_QUERY_VARIATIONS = {
|
|
70
|
+
device: Flags.string({
|
|
71
|
+
delimiter: ",",
|
|
72
|
+
description: "Split the list by device class, so every url is warmed in the variations it was actually requested in. A class not named is left out",
|
|
73
|
+
exclusive: ["variation"],
|
|
74
|
+
multiple: true,
|
|
75
|
+
options: [...DEVICE_VARIATIONS],
|
|
76
|
+
required: false,
|
|
77
|
+
}),
|
|
78
|
+
variation: Flags.string({
|
|
79
|
+
char: "v",
|
|
80
|
+
delimiter: ",",
|
|
81
|
+
description: "Pair every url of the list with each of these variations. For the custom variations no traffic can reveal, e.g. 'desktop-pdp-a,mobile-pdp-a'",
|
|
82
|
+
exclusive: ["device"],
|
|
83
|
+
multiple: true,
|
|
84
|
+
required: false,
|
|
85
|
+
}),
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* What the pre-warm query keeps of a long tail that is mostly seen once.
|
|
89
|
+
*
|
|
90
|
+
* Every flag here shapes the list itself, so a command that builds that list
|
|
91
|
+
* takes all of them — `sk auto-prewarm` included, or a count could describe a
|
|
92
|
+
* list the pre-warmer would never produce.
|
|
93
|
+
*/
|
|
94
|
+
export const CLI_QUERY_PREWARM_LIST = {
|
|
95
|
+
...CLI_QUERY_VARIATIONS,
|
|
96
|
+
excludeNotFound: Flags.boolean({
|
|
97
|
+
default: false,
|
|
98
|
+
description: "Leave out urls the origin answers with a 404 more often than not",
|
|
99
|
+
}),
|
|
100
|
+
limit: Flags.integer({
|
|
101
|
+
description: "Keep only the most requested urls",
|
|
102
|
+
min: 1,
|
|
103
|
+
required: false,
|
|
104
|
+
}),
|
|
105
|
+
match: Flags.string({
|
|
106
|
+
description: "Keep only urls whose path matches this regular expression, e.g. '^/p/'. The path is matched with its query string, the way a version 1 pathname rule matches it, so '[?&]size=' works too. Repeat the flag to keep the urls matching any of several patterns, and start a pattern with (?i) to match case-insensitively",
|
|
107
|
+
multiple: true,
|
|
108
|
+
parse: async (input) => {
|
|
109
|
+
try {
|
|
110
|
+
parseMatchPattern(input);
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
throw new Error(`--match ${input} is not a regular expression: ${error.message}`, { cause: error });
|
|
114
|
+
}
|
|
115
|
+
return input;
|
|
116
|
+
},
|
|
117
|
+
required: false,
|
|
118
|
+
}),
|
|
119
|
+
minHits: Flags.integer({
|
|
120
|
+
description: "Keep only urls requested at least this often in the window",
|
|
121
|
+
min: 1,
|
|
122
|
+
required: false,
|
|
123
|
+
}),
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* The pre-warm query flags in full: the list-shaping ones plus `--count`, which
|
|
127
|
+
* reports the list's size instead of returning it. Only a command that can
|
|
128
|
+
* answer with a count takes this one — `sk auto-prewarm` warms the list, so it
|
|
129
|
+
* takes {@link CLI_QUERY_PREWARM_LIST} instead.
|
|
130
|
+
*/
|
|
131
|
+
export const CLI_QUERY_PREWARM = {
|
|
132
|
+
...CLI_QUERY_PREWARM_LIST,
|
|
133
|
+
count: Flags.boolean({
|
|
134
|
+
default: false,
|
|
135
|
+
description: "Run the query and report how large the list is instead of what is in it: urls, the impressions they stand for, and a row per variation where the list carries variations. Every other flag still applies, so this counts the list the same command would produce",
|
|
136
|
+
exclusive: ["execute"],
|
|
137
|
+
}),
|
|
138
|
+
};
|
|
139
|
+
/** How the parameter query presents what it found. */
|
|
140
|
+
export const CLI_QUERY_PARAMETER = {
|
|
141
|
+
bySet: Flags.boolean({
|
|
142
|
+
default: false,
|
|
143
|
+
description: "Rank whole sets of parameters instead of single parameters, to see which ones travel together",
|
|
144
|
+
}),
|
|
145
|
+
minImpressions: Flags.integer({
|
|
146
|
+
description: "Leave out parameters seen on fewer page impressions than this",
|
|
147
|
+
min: 1,
|
|
148
|
+
required: false,
|
|
149
|
+
}),
|
|
150
|
+
};
|
|
@@ -14,7 +14,7 @@ export interface QueryFilterOptions {
|
|
|
14
14
|
/** Keep hard navigations only, dropping soft (SPA) navigations. */
|
|
15
15
|
readonly hardNavigationsOnly?: boolean;
|
|
16
16
|
}
|
|
17
|
-
export interface
|
|
17
|
+
export interface QueryBuilderOptions extends ParameterOptions, PrewarmOptions, QueryFilterOptions {
|
|
18
18
|
readonly app: string;
|
|
19
19
|
/** Athena data catalog the rum tables live in. */
|
|
20
20
|
readonly catalog?: string;
|
|
@@ -27,16 +27,3 @@ export interface QueryBuilderContext extends ParameterOptions, PrewarmOptions, Q
|
|
|
27
27
|
readonly queryType: QueryType;
|
|
28
28
|
readonly quiet?: boolean;
|
|
29
29
|
}
|
|
30
|
-
export interface QueryBuilderFactoryContext extends ParameterOptions, PrewarmOptions, QueryFilterOptions {
|
|
31
|
-
/** Athena data catalog the rum tables live in. */
|
|
32
|
-
readonly catalog?: string;
|
|
33
|
-
readonly configName: string;
|
|
34
|
-
readonly customerPath: string;
|
|
35
|
-
readonly execute?: boolean;
|
|
36
|
-
/** Report every rule the query leaves out, reduces or approximates. */
|
|
37
|
-
readonly explain?: boolean;
|
|
38
|
-
readonly isWindows?: boolean;
|
|
39
|
-
readonly quiet?: boolean;
|
|
40
|
-
/** Athena workgroup to execute in, when the query is executed at all. */
|
|
41
|
-
readonly workgroup?: string;
|
|
42
|
-
}
|