@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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MergeRequestDeployOptions } from "./merge-request-deploy-service-build-context.js";
|
|
1
2
|
import { ConfigApiService } from "../../config-api/index.js";
|
|
2
3
|
import { GitRepository, MergedRequest } from "../../git/index.js";
|
|
3
4
|
import { FileListInterface } from "../../integration-api/index.js";
|
|
@@ -5,7 +6,7 @@ import { CustomerApprovalCheck } from "../checks/activation/customer-approval-ch
|
|
|
5
6
|
import DeployService from "../deploy-service.js";
|
|
6
7
|
import { BaseConfigReader } from "./base-config-reader.js";
|
|
7
8
|
import { LiveStateCheck } from "./live-state-check.js";
|
|
8
|
-
import {
|
|
9
|
+
import { MergeRequestDeployResult } from "./merge-request-deploy-model.js";
|
|
9
10
|
/**
|
|
10
11
|
* Deploys one customer configuration of a merged merge request.
|
|
11
12
|
*
|
|
@@ -25,7 +26,7 @@ export declare class MergeRequestDeployService {
|
|
|
25
26
|
private readonly files;
|
|
26
27
|
private readonly configName;
|
|
27
28
|
private readonly deployService;
|
|
28
|
-
constructor(context:
|
|
29
|
+
constructor(context: MergeRequestDeployOptions, request: MergedRequest, repository: GitRepository, baseReader: BaseConfigReader, liveStateCheck: LiveStateCheck, approvalCheck: CustomerApprovalCheck, configApi: ConfigApiService, files: FileListInterface, configName: string, deployService: DeployService);
|
|
29
30
|
/** Plans the deploy and runs it while the plan allows it. */
|
|
30
31
|
run(): Promise<MergeRequestDeployResult>;
|
|
31
32
|
/**
|
|
@@ -3,11 +3,10 @@ import { after, before, describe, it } from "mocha";
|
|
|
3
3
|
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
4
4
|
import os from "node:os";
|
|
5
5
|
import path from "node:path";
|
|
6
|
-
import { BulkDeployService } from "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { ApprovalAnswer } from "../policy/auto-deploy-policy.js";
|
|
6
|
+
import { BulkDeployService } from "../../bulk/bulk-deploy-service.js";
|
|
7
|
+
import { GitRepository } from "../../../git/index.js";
|
|
8
|
+
import { DeployOutcome, } from "../../mr/index.js";
|
|
9
|
+
import { ApprovalAnswer } from "../../policy/auto-deploy-policy.js";
|
|
11
10
|
const REQUEST = {
|
|
12
11
|
iid: 8017,
|
|
13
12
|
sha: "3aaa523",
|
|
@@ -80,7 +79,12 @@ function deployFactory(plans, deployed, failing = []) {
|
|
|
80
79
|
function serviceOf(changedPaths, factory, cli, approval) {
|
|
81
80
|
const repository = new GitRepository(root, () => "");
|
|
82
81
|
repository.changedPaths = () => changedPaths;
|
|
83
|
-
return new BulkDeployService(
|
|
82
|
+
return new BulkDeployService({
|
|
83
|
+
repositoryPath: root,
|
|
84
|
+
iid: REQUEST.iid,
|
|
85
|
+
approval,
|
|
86
|
+
description: "a description",
|
|
87
|
+
}, repository, REQUEST, factory, cli);
|
|
84
88
|
}
|
|
85
89
|
describe("BulkDeployService", () => {
|
|
86
90
|
it("deploys every configuration the plan found deployable", async () => {
|
|
@@ -98,7 +102,14 @@ describe("BulkDeployService", () => {
|
|
|
98
102
|
const { cli, questions } = cliAnswering(false);
|
|
99
103
|
const repository = new GitRepository(root, () => "");
|
|
100
104
|
repository.changedPaths = () => ["customers/gohaus/config_SpeedKit.js"];
|
|
101
|
-
await new BulkDeployService(
|
|
105
|
+
await new BulkDeployService({
|
|
106
|
+
repositoryPath: root,
|
|
107
|
+
iid: REQUEST.iid,
|
|
108
|
+
approval: ApprovalAnswer.Approved,
|
|
109
|
+
description: "a description",
|
|
110
|
+
dryRun: false,
|
|
111
|
+
assumeYes: true,
|
|
112
|
+
}, repository, REQUEST, deployFactory({}, deployed), cli).run();
|
|
102
113
|
expect(deployed).to.deep.equal(["customers/gohaus[production]"]);
|
|
103
114
|
expect(questions).to.deep.equal([]);
|
|
104
115
|
});
|
|
@@ -3,8 +3,8 @@ import { after, before, describe, it } from "mocha";
|
|
|
3
3
|
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
4
4
|
import os from "node:os";
|
|
5
5
|
import path from "node:path";
|
|
6
|
-
import { productionConfigOf, touchedCustomers } from "
|
|
7
|
-
import { GitRepository } from "
|
|
6
|
+
import { productionConfigOf, touchedCustomers, } from "../../bulk/touched-configs.js";
|
|
7
|
+
import { GitRepository } from "../../../git/index.js";
|
|
8
8
|
let root;
|
|
9
9
|
/** A repository with two customers, one of them with two environments. */
|
|
10
10
|
before(() => {
|
package/dist/services/deploy/{checks → spec/checks}/activation/customer-approval-check.spec.js
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { expect } from "chai";
|
|
2
2
|
import { describe, it } from "mocha";
|
|
3
|
-
import { CustomerApprovalCheck } from "
|
|
4
|
-
import {
|
|
3
|
+
import { CustomerApprovalCheck } from "../../../checks/activation/customer-approval-check.js";
|
|
4
|
+
import { BundleServiceFactory } from "../../../../bundler/index.js";
|
|
5
|
+
import { CustomerConfig } from "../../../../integration-api/index.js";
|
|
5
6
|
function customer(needsCustomerApproval) {
|
|
6
7
|
return CustomerConfig.createFrom({
|
|
7
8
|
app: "test-app",
|
|
@@ -34,33 +35,34 @@ function cliAsking(answer) {
|
|
|
34
35
|
};
|
|
35
36
|
return { cli, policy, questions };
|
|
36
37
|
}
|
|
38
|
+
const bundler = new BundleServiceFactory("./").buildService();
|
|
37
39
|
describe("CustomerApprovalCheck", () => {
|
|
38
40
|
it("approves without asking when the customer does not need to approve", async () => {
|
|
39
41
|
const { cli, policy, questions } = cliAsking(false);
|
|
40
|
-
const approved = await new CustomerApprovalCheck(cli, customer(false), policy).isActivationApproved(installWithSplit("1"));
|
|
42
|
+
const approved = await new CustomerApprovalCheck(cli, customer(false), policy, bundler).isActivationApproved(installWithSplit("1"));
|
|
41
43
|
expect(approved).to.equal(true);
|
|
42
44
|
expect(questions).to.deep.equal([]);
|
|
43
45
|
});
|
|
44
46
|
it("approves without asking while no origin serves traffic", async () => {
|
|
45
47
|
const { cli, policy, questions } = cliAsking(false);
|
|
46
|
-
const approved = await new CustomerApprovalCheck(cli, customer(true), policy).isActivationApproved(installWithSplit("0"));
|
|
48
|
+
const approved = await new CustomerApprovalCheck(cli, customer(true), policy, bundler).isActivationApproved(installWithSplit("0"));
|
|
47
49
|
expect(approved).to.equal(true);
|
|
48
50
|
expect(questions).to.deep.equal([]);
|
|
49
51
|
});
|
|
50
52
|
it("asks once a single origin has a split greater than 0", async () => {
|
|
51
53
|
const { cli, policy, questions } = cliAsking(true);
|
|
52
|
-
const approved = await new CustomerApprovalCheck(cli, customer(true), policy).isActivationApproved(installWithSplit('window.location.hostname === "www.example.com" ? 0.5 : 0'));
|
|
54
|
+
const approved = await new CustomerApprovalCheck(cli, customer(true), policy, bundler).isActivationApproved(installWithSplit('window.location.hostname === "www.example.com" ? 0.5 : 0'));
|
|
53
55
|
expect(approved).to.equal(true);
|
|
54
56
|
expect(questions).to.deep.equal(["Was this change approved by customer?"]);
|
|
55
57
|
});
|
|
56
58
|
it("withholds the approval when the question is answered with no", async () => {
|
|
57
59
|
const { cli, policy } = cliAsking(false);
|
|
58
|
-
const approved = await new CustomerApprovalCheck(cli, customer(true), policy).isActivationApproved(installWithSplit("0.1"));
|
|
60
|
+
const approved = await new CustomerApprovalCheck(cli, customer(true), policy, bundler).isActivationApproved(installWithSplit("0.1"));
|
|
59
61
|
expect(approved).to.equal(false);
|
|
60
62
|
});
|
|
61
63
|
it("asks when the split cannot be evaluated", async () => {
|
|
62
64
|
const { cli, policy, questions } = cliAsking(false);
|
|
63
|
-
const approved = await new CustomerApprovalCheck(cli, customer(true), policy).isActivationApproved(installWithSplit("({}).missing.split"));
|
|
65
|
+
const approved = await new CustomerApprovalCheck(cli, customer(true), policy, bundler).isActivationApproved(installWithSplit("({}).missing.split"));
|
|
64
66
|
expect(approved).to.equal(false);
|
|
65
67
|
expect(questions).to.deep.equal(["Was this change approved by customer?"]);
|
|
66
68
|
});
|
package/dist/services/deploy/{checks → spec/checks}/post-deploy/refresh-deployment-job-check.spec.js
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { expect } from "chai";
|
|
2
2
|
import { describe, it } from "mocha";
|
|
3
|
-
import { RefreshDeploymentJobCheck } from "
|
|
4
|
-
import ApplicationError from "
|
|
3
|
+
import { RefreshDeploymentJobCheck } from "../../../checks/post-deploy/refresh-deployment-job-check.js";
|
|
4
|
+
import ApplicationError from "../../../../error-handling/error/application-error.js";
|
|
5
5
|
function entityManagerWithJobs(names) {
|
|
6
6
|
const jobs = names.map((name) => ({ data: { name }, type: "Refreshjob" }));
|
|
7
7
|
return {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { BundleServiceFactory } from "../../../../bundler/index.js";
|
|
1
2
|
import { expect } from "chai";
|
|
2
3
|
import { describe, it } from "mocha";
|
|
3
4
|
import { Chalk } from "chalk";
|
|
4
|
-
import { SplitChangeCheck } from "
|
|
5
|
-
import { DeployAbortedError } from "
|
|
6
|
-
import { CustomerConfig, } from "
|
|
5
|
+
import { SplitChangeCheck } from "../../../checks/pre-deploy/split-change-check.js";
|
|
6
|
+
import { DeployAbortedError } from "../../../error/deploy-aborted-error.js";
|
|
7
|
+
import { CustomerConfig, } from "../../../../integration-api/index.js";
|
|
7
8
|
/** A local config that serves half of the traffic. */
|
|
8
9
|
const LOCAL_SPLIT = { split: 0.5, splitTestId: "test-id" };
|
|
9
10
|
/** The active config of the app, which serves none. */
|
|
@@ -39,7 +40,7 @@ function checkAnswering(answer) {
|
|
|
39
40
|
confirm: async () => answer,
|
|
40
41
|
text: async () => "",
|
|
41
42
|
};
|
|
42
|
-
return new SplitChangeCheck(cli, fileList, configApi, customer, "production", true, policy);
|
|
43
|
+
return new SplitChangeCheck(cli, fileList, configApi, customer, "production", true, policy, new BundleServiceFactory("./").buildService());
|
|
43
44
|
}
|
|
44
45
|
describe("SplitChangeCheck", () => {
|
|
45
46
|
it("aborts the deploy when the split change is not confirmed", async () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { expect } from "chai";
|
|
2
2
|
import { describe, it } from "mocha";
|
|
3
|
-
import ModuleHandler from "
|
|
4
|
-
import { ModuleFile } from "
|
|
3
|
+
import ModuleHandler from "../../handler/module-handler.js";
|
|
4
|
+
import { ModuleFile } from "../../../integration-api/index.js";
|
|
5
5
|
function moduleFile(name) {
|
|
6
6
|
return new ModuleFile(name, `/tmp/${name}.js`, `// ${name}`, {});
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { expect } from "chai";
|
|
2
2
|
import { describe, it } from "mocha";
|
|
3
|
-
import { buildTestingInstallationLinks, MAX_LISTED_ORIGINS, } from "
|
|
3
|
+
import { buildTestingInstallationLinks, MAX_LISTED_ORIGINS, } from "../../handler/testing-installation-links.js";
|
|
4
4
|
function origins(count) {
|
|
5
5
|
return Array.from({ length: count }, (_, i) => `https://shop-${i}.example.com`);
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { expect } from "chai";
|
|
2
2
|
import { describe, it } from "mocha";
|
|
3
|
-
import { LiveState, LiveStateCheck } from "
|
|
4
|
-
import { DiffService } from "
|
|
3
|
+
import { LiveState, LiveStateCheck } from "../../mr/live-state-check.js";
|
|
4
|
+
import { DiffService } from "../../../diff/index.js";
|
|
5
5
|
const ORIGINS = ["https://www.example.com"];
|
|
6
6
|
/** A configuration of the install resource files it holds. */
|
|
7
7
|
function configuration(files, origins = ORIGINS) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { expect } from "chai";
|
|
2
2
|
import { describe, it } from "mocha";
|
|
3
|
-
import { defaultDescription, resolveDescription, } from "
|
|
3
|
+
import { defaultDescription, resolveDescription, } from "../../mr/merge-request-description.js";
|
|
4
4
|
function request(title) {
|
|
5
5
|
return { iid: 8009, sha: "3aaa523", baseSha: "83d9d58", title };
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { expect } from "chai";
|
|
2
2
|
import { describe, it } from "mocha";
|
|
3
|
-
import { ApprovalAnswer, AutoDeployPolicy } from "
|
|
4
|
-
import { DeployQuestion } from "
|
|
3
|
+
import { ApprovalAnswer, AutoDeployPolicy, } from "../../policy/auto-deploy-policy.js";
|
|
4
|
+
import { DeployQuestion } from "../../policy/deploy-policy-model.js";
|
|
5
5
|
const REVIEWED = [
|
|
6
6
|
DeployQuestion.UpdateFile,
|
|
7
7
|
DeployQuestion.UpdateOrigins,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CommandContextValues } from "../cli/index.js";
|
|
2
|
+
export interface DiffServiceBuildContextValues extends CommandContextValues {
|
|
3
|
+
/** The diff tool, `diffExec` in the settings; null when none is opened. */
|
|
4
|
+
readonly executablePath: string | null;
|
|
5
|
+
/** How the tool is called, `diffExecTemplate` in the settings. */
|
|
6
|
+
readonly executableTemplate: string | null;
|
|
7
|
+
/** A deploy that nobody drives never opens a diff tool. */
|
|
8
|
+
readonly opensDiffTool?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const DiffServiceBuildContext_base: new (values: DiffServiceBuildContextValues) => Readonly<DiffServiceBuildContextValues>;
|
|
11
|
+
/** How two contents are compared, and whether a person looks at the result. */
|
|
12
|
+
export declare class DiffServiceBuildContext extends DiffServiceBuildContext_base {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DiffServiceBuildContext } from "./diff-service-build-context.js";
|
|
2
|
+
import { DiffService } from "./diff-service.js";
|
|
2
3
|
export declare class DiffServiceFactory {
|
|
3
|
-
private context;
|
|
4
|
+
private readonly context;
|
|
4
5
|
service?: DiffService;
|
|
5
|
-
constructor(context:
|
|
6
|
+
constructor(context: DiffServiceBuildContext);
|
|
6
7
|
getService(): DiffService;
|
|
7
8
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DiffService } from "./index.js";
|
|
1
|
+
import { DiffService } from "./diff-service.js";
|
|
3
2
|
export class DiffServiceFactory {
|
|
4
3
|
context;
|
|
5
4
|
service = undefined;
|
|
@@ -8,8 +7,8 @@ export class DiffServiceFactory {
|
|
|
8
7
|
}
|
|
9
8
|
getService() {
|
|
10
9
|
if (!(this.service instanceof DiffService)) {
|
|
11
|
-
const cliService =
|
|
12
|
-
this.service = new DiffService(cliService, this.context.executablePath, this.context.executableTemplate, this.context.opensDiffTool);
|
|
10
|
+
const cliService = this.context.environment.cli;
|
|
11
|
+
this.service = new DiffService(cliService, this.context.executablePath, this.context.executableTemplate, this.context.opensDiffTool ?? true);
|
|
13
12
|
}
|
|
14
13
|
return this.service;
|
|
15
14
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CliServiceInterface } from "../cli/index.js";
|
|
2
2
|
export declare class DiffService {
|
|
3
3
|
private cli;
|
|
4
4
|
private diffExecutablePath?;
|
|
5
5
|
private diffExecutableTemplate?;
|
|
6
6
|
private opensDiffTool;
|
|
7
7
|
private tempPath;
|
|
8
|
-
constructor(cli:
|
|
8
|
+
constructor(cli: CliServiceInterface, diffExecutablePath?: string, diffExecutableTemplate?: string, opensDiffTool?: boolean);
|
|
9
9
|
diff(localPath: string, fileName: string, temporaryContent: string): Promise<boolean>;
|
|
10
10
|
diffContent(fileName: string, firstContent: string, secondContent: string, diffSuffix?: string[]): Promise<{
|
|
11
11
|
updatedFile: string;
|
|
@@ -15,6 +15,14 @@ export declare class DiffService {
|
|
|
15
15
|
* Returns a temporal directory path.
|
|
16
16
|
*/
|
|
17
17
|
getTemporalDirectoryPath(): Promise<string>;
|
|
18
|
+
/**
|
|
19
|
+
* The temporary directory remote installation files are written to.
|
|
20
|
+
*
|
|
21
|
+
* Returns null instead of throwing, because the one caller turns that into a
|
|
22
|
+
* readable CLI error — an mkdtemp stack trace says less than "unable to
|
|
23
|
+
* create a temporary directory" does.
|
|
24
|
+
*/
|
|
25
|
+
private createTemporalDirectory;
|
|
18
26
|
writeContentToTemporalFile(temporaryFileName: string, content: string): Promise<string>;
|
|
19
27
|
/**
|
|
20
28
|
* @param localContent local file content.
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import pathModule from "node:path";
|
|
2
2
|
import fs, { readFile } from "node:fs/promises";
|
|
3
|
+
import { mkdtempSync } from "node:fs";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
3
5
|
import { execSync } from "node:child_process";
|
|
4
|
-
import { createTemporalDirectory } from "../../helpers/file-helper.js";
|
|
5
|
-
import { unescapeSpaces } from "../../helpers/normalize.js";
|
|
6
6
|
import { DEFAULT_INTELLIJ_IDEA_PATH_MACOS } from "../../models/os.js";
|
|
7
7
|
import ApplicationError from "../error-handling/error/application-error.js";
|
|
8
|
+
/**
|
|
9
|
+
* Remove the backslashes a shell-quoted path carries before its spaces, so the
|
|
10
|
+
* value can be handed to a child process as a single argument again.
|
|
11
|
+
*/
|
|
12
|
+
function unescapeSpaces(string_) {
|
|
13
|
+
return string_.replaceAll("\\ ", " ");
|
|
14
|
+
}
|
|
8
15
|
export class DiffService {
|
|
9
16
|
cli;
|
|
10
17
|
diffExecutablePath;
|
|
@@ -36,13 +43,29 @@ export class DiffService {
|
|
|
36
43
|
async getTemporalDirectoryPath() {
|
|
37
44
|
// create temporal directory for remote installationFiles so the diff can be generated
|
|
38
45
|
if (!this.tempPath) {
|
|
39
|
-
this.tempPath =
|
|
46
|
+
this.tempPath = this.createTemporalDirectory();
|
|
40
47
|
}
|
|
41
48
|
if (!this.tempPath) {
|
|
42
49
|
throw new ApplicationError("No temporary directory found and unable to create a new temporary directory");
|
|
43
50
|
}
|
|
44
51
|
return this.tempPath;
|
|
45
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* The temporary directory remote installation files are written to.
|
|
55
|
+
*
|
|
56
|
+
* Returns null instead of throwing, because the one caller turns that into a
|
|
57
|
+
* readable CLI error — an mkdtemp stack trace says less than "unable to
|
|
58
|
+
* create a temporary directory" does.
|
|
59
|
+
*/
|
|
60
|
+
createTemporalDirectory() {
|
|
61
|
+
try {
|
|
62
|
+
return mkdtempSync(pathModule.join(tmpdir(), "speed-kit-cli-"));
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
this.cli.writeError(`Could not create a temporary directory: ${error}`);
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
46
69
|
async writeContentToTemporalFile(temporaryFileName, content) {
|
|
47
70
|
if (!content) {
|
|
48
71
|
content = "";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const LOCAL_DOCUMENT_HANDLER = "custom_documentHandler";
|
|
2
|
+
export declare const LOCAL_DOCUMENT_HANDLER_CONFIG = "config_documentHandler";
|
|
3
|
+
export declare const LOCAL_DYNAMIC_FETCHER = "custom_dynamicFetcher";
|
|
4
|
+
export declare const LOCAL_DYNAMIC_FETCHER_CONFIG = "config_dynamicBlocks";
|
|
5
|
+
export declare const LOCAL_STYLES = "config_dynamicStyles";
|
|
6
|
+
export declare const LATEST_DYNAMIC_FETCHER_URL = "https://www.baqend.com/speed-kit/latest/dynamic-fetcher.js";
|
|
7
|
+
export declare const LOCAL_TRIGGERED_BY = "STREAM:QA";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const LOCAL_DOCUMENT_HANDLER = "custom_documentHandler";
|
|
2
|
+
export const LOCAL_DOCUMENT_HANDLER_CONFIG = "config_documentHandler";
|
|
3
|
+
export const LOCAL_DYNAMIC_FETCHER = "custom_dynamicFetcher";
|
|
4
|
+
export const LOCAL_DYNAMIC_FETCHER_CONFIG = "config_dynamicBlocks";
|
|
5
|
+
export const LOCAL_STYLES = "config_dynamicStyles";
|
|
6
|
+
export const LATEST_DYNAMIC_FETCHER_URL = "https://www.baqend.com/speed-kit/latest/dynamic-fetcher.js";
|
|
7
|
+
// Local runs have no persistent cache, so an origin HTML is served straight to the developer and may
|
|
8
|
+
// legitimately be older than the default five minutes. STREAM:QA relaxes the document handler's
|
|
9
|
+
// Shopify staleness check to one hour, see ONE_HOUR_STALENESS_TRIGGERS in document-handler.
|
|
10
|
+
export const LOCAL_TRIGGERED_BY = "STREAM:QA";
|
package/dist/services/document-handler-runtime/document-handler-runtime-service-build-context.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CommandContextValues } from "../cli/index.js";
|
|
2
|
+
export interface DocumentHandlerRuntimeServiceBuildContextValues extends CommandContextValues {
|
|
3
|
+
readonly customerPath: string;
|
|
4
|
+
readonly configName: string;
|
|
5
|
+
readonly verboseLevel: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const DocumentHandlerRuntimeServiceBuildContext_base: new (values: DocumentHandlerRuntimeServiceBuildContextValues) => Readonly<DocumentHandlerRuntimeServiceBuildContextValues>;
|
|
8
|
+
/** Which customer's documentHandler runs locally, and how talkative it is. */
|
|
9
|
+
export declare class DocumentHandlerRuntimeServiceBuildContext extends DocumentHandlerRuntimeServiceBuildContext_base {
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BundleService } from "../bundler/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { CliServiceInterface } from "../cli/index.js";
|
|
3
3
|
import { CustomerConfig, FileListInterface } from "../integration-api/index.js";
|
|
4
4
|
import { EntityManager } from "baqend";
|
|
5
5
|
import { DocumentHandlerResponse } from "./server/document-handler-response.js";
|
|
@@ -20,7 +20,7 @@ export declare class DocumentHandlerServer {
|
|
|
20
20
|
/**
|
|
21
21
|
* @param workSpace - Directory the packages a customer config declares are installed into.
|
|
22
22
|
*/
|
|
23
|
-
constructor(customerConfig: CustomerConfig, files: FileListInterface, bundler: BundleService, cli:
|
|
23
|
+
constructor(customerConfig: CustomerConfig, files: FileListInterface, bundler: BundleService, cli: CliServiceInterface, workSpace: string, verboseLevel?: boolean, entityManager?: EntityManager);
|
|
24
24
|
transform(contentType: string, html: string, variation: string, url: string, headers: Record<string, string>): Promise<DocumentHandlerResponse>;
|
|
25
25
|
private getTransformFunctionWrapper;
|
|
26
26
|
buildDocumentHandler(): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LATEST_DYNAMIC_FETCHER_URL, LOCAL_DOCUMENT_HANDLER, LOCAL_DOCUMENT_HANDLER_CONFIG, LOCAL_DYNAMIC_FETCHER, LOCAL_DYNAMIC_FETCHER_CONFIG, LOCAL_STYLES, } from "./
|
|
1
|
+
import { LATEST_DYNAMIC_FETCHER_URL, LOCAL_DOCUMENT_HANDLER, LOCAL_DOCUMENT_HANDLER_CONFIG, LOCAL_DYNAMIC_FETCHER, LOCAL_DYNAMIC_FETCHER_CONFIG, LOCAL_STYLES, } from "./document-handler-runtime-model.js";
|
|
2
2
|
import RequiredFileNotFoundError from "./error/required-file-not-found-error.js";
|
|
3
3
|
import DatabaseMock from "./templates/database-mock.js";
|
|
4
4
|
import * as vm from "node:vm";
|
|
@@ -166,7 +166,7 @@ export class DocumentHandlerServer {
|
|
|
166
166
|
};
|
|
167
167
|
if (!this.database) {
|
|
168
168
|
const dataBaseMock = new DatabaseMock();
|
|
169
|
-
const databaseCode = dataBaseMock.render(dataBaseMock.
|
|
169
|
+
const databaseCode = dataBaseMock.render(dataBaseMock.create(this.customerConfig.origins[0], this.customerConfig.app));
|
|
170
170
|
const vmContext = { console: vmConsole, module: { exports: {} } };
|
|
171
171
|
vm.runInNewContext(databaseCode, vmContext, { displayErrors: true });
|
|
172
172
|
this.database = vmContext.module.exports;
|
package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts
CHANGED
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
import { FileListInterface } from "../../integration-api/index.js";
|
|
2
|
-
import
|
|
3
|
-
import DocumentHandlerRuntimeService from "../document-handler-runtime-service.js";
|
|
2
|
+
import { DocumentHandlerRuntimeServiceBuildContext } from "../document-handler-runtime-service-build-context.js";
|
|
4
3
|
import { DocumentHandlerServer } from "../document-handler-server.js";
|
|
5
|
-
import { UserCliConfig } from "../../../helpers/cli-config.js";
|
|
6
4
|
export default class DocumentHandlerRuntimeServiceFactory {
|
|
7
5
|
private readonly context;
|
|
8
|
-
private
|
|
9
|
-
|
|
10
|
-
constructor(context: DocumentHandlerRuntimeContext, cliConfig: UserCliConfig, files?: FileListInterface);
|
|
11
|
-
buildService(): Promise<DocumentHandlerRuntimeService>;
|
|
6
|
+
private readonly files?;
|
|
7
|
+
constructor(context: DocumentHandlerRuntimeServiceBuildContext, files?: FileListInterface);
|
|
12
8
|
buildDocumentHandlerServer(): Promise<DocumentHandlerServer>;
|
|
13
|
-
private prepareIntegrationApi;
|
|
14
|
-
private getIntegrationFiles;
|
|
15
|
-
private checkRequiredFiles;
|
|
16
|
-
private createNeededFolderStructure;
|
|
17
|
-
private prepareLocalDocumentHandler;
|
|
18
|
-
private preparePackageJson;
|
|
19
|
-
private prepareTestCases;
|
|
20
9
|
private getCustomerConfig;
|
|
21
10
|
/**
|
|
22
11
|
* Gives the workspace its own manifest before anything is installed into it.
|
package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js
CHANGED
|
@@ -1,100 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TEST_DATABASE_MOCK_FILE_NAME, TEST_DOCUMENT_HANDLER_FILE_NAME, TEST_FILE_NAME_PREFIX, TEST_ORESTES_MOCK_FILE_NAME, TEST_PACKAGE_JSON, TEST_RUNTIME_FILE_NAME, } from "../context/document-handler-runtime-context.js";
|
|
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";
|
|
1
|
+
import { IntegrationApiServiceBuildContext, IntegrationApiFactory, } from "../../integration-api/index.js";
|
|
6
2
|
import { DocumentHandlerServer } from "../document-handler-server.js";
|
|
7
3
|
import { BundleServiceFactory } from "../../bundler/index.js";
|
|
8
|
-
import {
|
|
4
|
+
import { EntityManagerProvider } from "../../config-api/entity-manager-provider.js";
|
|
9
5
|
import { safe } from "../../../helpers/safe.js";
|
|
10
6
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
11
7
|
import { resolve } from "node:path";
|
|
12
8
|
export default class DocumentHandlerRuntimeServiceFactory {
|
|
13
9
|
context;
|
|
14
|
-
cliConfig;
|
|
15
10
|
files;
|
|
16
|
-
constructor(context,
|
|
11
|
+
constructor(context, files) {
|
|
17
12
|
this.context = context;
|
|
18
|
-
this.cliConfig = cliConfig;
|
|
19
13
|
this.files = files;
|
|
20
14
|
}
|
|
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 || [] });
|
|
29
|
-
}
|
|
30
15
|
async buildDocumentHandlerServer() {
|
|
31
|
-
const integrationApiContext = new
|
|
16
|
+
const integrationApiContext = new IntegrationApiServiceBuildContext({
|
|
17
|
+
environment: this.context.environment,
|
|
18
|
+
basePath: this.context.customerPath,
|
|
19
|
+
configName: this.context.configName,
|
|
20
|
+
whitelist: [],
|
|
21
|
+
});
|
|
32
22
|
const files = this.files ||
|
|
33
|
-
(await new IntegrationApiFactory(integrationApiContext
|
|
23
|
+
(await new IntegrationApiFactory(integrationApiContext)
|
|
34
24
|
.buildService()
|
|
35
25
|
.run());
|
|
36
26
|
const customerConfig = this.getCustomerConfig(files);
|
|
37
|
-
const cliService =
|
|
27
|
+
const cliService = this.context.environment.cli;
|
|
38
28
|
await this.installAdditionalDependencies(customerConfig, cliService);
|
|
39
29
|
const bundler = new BundleServiceFactory(this.context.customerPath).buildService();
|
|
40
|
-
const entityManagerResult = await safe(new
|
|
41
|
-
return new DocumentHandlerServer(customerConfig, files, bundler, cliService, this.
|
|
42
|
-
}
|
|
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
|
-
}
|
|
30
|
+
const entityManagerResult = await safe(new EntityManagerProvider().getEntityManager(customerConfig.app));
|
|
31
|
+
return new DocumentHandlerServer(customerConfig, files, bundler, cliService, this.context.environment.nodeModulesPath, this.context.verboseLevel, entityManagerResult.success ? entityManagerResult.data : null);
|
|
98
32
|
}
|
|
99
33
|
getCustomerConfig(files) {
|
|
100
34
|
const configFile = files.getByName("config_customer");
|
|
@@ -122,7 +56,7 @@ export default class DocumentHandlerRuntimeServiceFactory {
|
|
|
122
56
|
}, undefined, 2)}\n`);
|
|
123
57
|
}
|
|
124
58
|
async installAdditionalDependencies(customerConfig, cli) {
|
|
125
|
-
const workSpace = this.
|
|
59
|
+
const workSpace = this.context.environment.nodeModulesPath;
|
|
126
60
|
if (!customerConfig.dependencies ||
|
|
127
61
|
Object.keys(customerConfig.dependencies).length === 0) {
|
|
128
62
|
return;
|
|
@@ -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 AbstractTemplate from "./abstract-template.js";
|
|
2
2
|
import TemplateContextInterface from "../interface/template-context-interface.js";
|
|
3
3
|
export default class DatabaseMock extends AbstractTemplate {
|
|
4
|
-
|
|
4
|
+
create(domain: string, app: string): TemplateContextInterface;
|
|
5
5
|
getTemplate(): string;
|
|
6
6
|
}
|