@speedkit/cli 3.43.2 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/README.md +6 -6
- package/bin/dev +2 -15
- package/bin/run +2 -2
- package/dist/commands/build-parameter-query.d.ts +3 -3
- package/dist/commands/build-parameter-query.js +12 -15
- package/dist/commands/build-prewarm-query.d.ts +4 -4
- package/dist/commands/build-prewarm-query.js +13 -16
- package/dist/commands/config/edit.js +7 -11
- package/dist/commands/deploy.d.ts +3 -5
- package/dist/commands/deploy.js +12 -16
- package/dist/commands/diff-url-parameters.d.ts +3 -3
- package/dist/commands/diff-url-parameters.js +27 -30
- package/dist/commands/document-handler.d.ts +4 -4
- package/dist/commands/document-handler.js +13 -17
- package/dist/commands/find-pops.d.ts +2 -2
- package/dist/commands/find-pops.js +22 -24
- package/dist/commands/generate-customer-config.d.ts +2 -2
- package/dist/commands/generate-customer-config.js +13 -16
- package/dist/commands/generate-pop-config.d.ts +7 -7
- package/dist/commands/generate-pop-config.js +32 -41
- package/dist/commands/login.d.ts +1 -1
- package/dist/commands/login.js +13 -17
- package/dist/commands/onboarding.d.ts +3 -5
- package/dist/commands/onboarding.js +10 -13
- package/dist/commands/prewarm.d.ts +9 -9
- package/dist/commands/prewarm.js +25 -28
- package/dist/commands/pull.d.ts +3 -3
- package/dist/commands/pull.js +11 -14
- package/dist/commands/wpt-launcher.d.ts +7 -7
- package/dist/commands/wpt-launcher.js +21 -26
- package/dist/helpers/array-helper.js +1 -4
- package/dist/helpers/build-query-helper.js +5 -12
- package/dist/helpers/cli-config.d.ts +3 -3
- package/dist/helpers/cli-config.js +11 -16
- package/dist/helpers/customer-config.d.ts +4 -8
- package/dist/helpers/customer-config.js +18 -23
- package/dist/helpers/evaluate-speed-kit-config.d.ts +1 -1
- package/dist/helpers/evaluate-speed-kit-config.js +42 -26
- package/dist/helpers/file-helper.js +8 -13
- package/dist/helpers/get-parsed-config.d.ts +1 -1
- package/dist/helpers/get-parsed-config.js +6 -10
- package/dist/helpers/html-format-helper.js +3 -6
- package/dist/helpers/is-directory.js +3 -6
- package/dist/helpers/is-file.js +3 -6
- package/dist/helpers/logging-helper.js +7 -13
- package/dist/helpers/normalize.js +10 -17
- package/dist/helpers/race.d.ts +1 -1
- package/dist/helpers/race.js +3 -9
- package/dist/helpers/safe.js +1 -4
- package/dist/helpers/scrape.d.ts +1 -1
- package/dist/helpers/scrape.js +3 -7
- package/dist/helpers/site-analyzer.js +5 -9
- package/dist/helpers/speed-kit-rule-to-reg-exp.js +1 -4
- package/dist/models/cli-parameters.d.ts +4 -4
- package/dist/models/cli-parameters.js +13 -16
- package/dist/models/files.js +1 -4
- package/dist/models/install.js +1 -2
- package/dist/models/os.js +1 -4
- package/dist/services/athena/athena-service-factory.d.ts +1 -1
- package/dist/services/athena/athena-service-factory.js +15 -19
- package/dist/services/athena/athena-service-model.js +2 -5
- package/dist/services/athena/athena-service.d.ts +1 -1
- package/dist/services/athena/athena-service.js +18 -23
- package/dist/services/athena/error/athena-query-error.d.ts +1 -1
- package/dist/services/athena/error/athena-query-error.js +2 -7
- package/dist/services/athena/error/fetch-credentials-error.d.ts +1 -1
- package/dist/services/athena/error/fetch-credentials-error.js +2 -7
- package/dist/services/athena/index.d.ts +4 -4
- package/dist/services/athena/index.js +4 -7
- package/dist/services/bundler/bundle-service-factory.d.ts +3 -1
- package/dist/services/bundler/bundle-service-factory.js +7 -7
- package/dist/services/bundler/bundle-service.d.ts +9 -12
- package/dist/services/bundler/bundle-service.js +42 -32
- package/dist/services/bundler/error/bundle-fetch-error.d.ts +1 -1
- package/dist/services/bundler/error/bundle-fetch-error.js +2 -7
- package/dist/services/bundler/error/bundle-resolve-error.d.ts +1 -1
- package/dist/services/bundler/error/bundle-resolve-error.js +2 -7
- package/dist/services/bundler/index.d.ts +2 -2
- package/dist/services/bundler/index.js +2 -5
- package/dist/services/cli/cli-service-factory.d.ts +2 -2
- package/dist/services/cli/cli-service-factory.js +6 -10
- package/dist/services/cli/cli-service-model.d.ts +21 -6
- package/dist/services/cli/cli-service-model.js +3 -7
- package/dist/services/cli/cli-service.d.ts +10 -8
- package/dist/services/cli/cli-service.js +64 -61
- package/dist/services/cli/error/cli-type-error.js +1 -4
- package/dist/services/cli/index.d.ts +3 -3
- package/dist/services/cli/index.js +3 -6
- package/dist/services/config-api/client.d.ts +2 -2
- package/dist/services/config-api/client.js +29 -34
- package/dist/services/config-api/config-api-factory.d.ts +2 -2
- package/dist/services/config-api/config-api-factory.js +15 -20
- package/dist/services/config-api/config-api-model.d.ts +2 -2
- package/dist/services/config-api/config-api-model.js +1 -5
- package/dist/services/config-api/config-api-service.d.ts +2 -2
- package/dist/services/config-api/config-api-service.js +1 -5
- package/dist/services/config-api/entity-manager-factory.js +3 -7
- package/dist/services/config-api/error/json-response-error.d.ts +1 -1
- package/dist/services/config-api/error/json-response-error.js +2 -7
- package/dist/services/config-api/error/login-error.d.ts +1 -1
- package/dist/services/config-api/error/login-error.js +2 -7
- package/dist/services/config-api/error/orestes-api-error.d.ts +1 -1
- package/dist/services/config-api/error/orestes-api-error.js +2 -7
- package/dist/services/config-api/index.d.ts +3 -3
- package/dist/services/config-api/index.js +3 -6
- package/dist/services/config-api-service.d.ts +1 -1
- package/dist/services/config-api-service.js +6 -11
- package/dist/services/customer-config/customer-config-service-context.js +3 -7
- package/dist/services/customer-config/customer-config-service-factory.d.ts +1 -1
- package/dist/services/customer-config/customer-config-service-factory.js +6 -10
- package/dist/services/customer-config/customer-config-service-model.js +6 -9
- package/dist/services/customer-config/customer-config-service.d.ts +3 -3
- package/dist/services/customer-config/customer-config-service.js +55 -55
- package/dist/services/customer-config/index.d.ts +4 -4
- package/dist/services/customer-config/index.js +4 -7
- package/dist/services/customer-config/templates/config_documentHandler.js.hbs +88 -1
- package/dist/services/deploy/builder/install-resource-builder.d.ts +2 -2
- package/dist/services/deploy/builder/install-resource-builder.js +3 -7
- package/dist/services/deploy/checks/post-deploy/deprecated-deployment-detection-check.d.ts +4 -4
- package/dist/services/deploy/checks/post-deploy/deprecated-deployment-detection-check.js +19 -24
- package/dist/services/deploy/checks/post-deploy/revalidated-module-check.d.ts +3 -3
- package/dist/services/deploy/checks/post-deploy/revalidated-module-check.js +10 -14
- package/dist/services/deploy/checks/post-deploy/save-files-check.d.ts +3 -3
- package/dist/services/deploy/checks/post-deploy/save-files-check.js +8 -12
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.d.ts +3 -3
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +14 -20
- package/dist/services/deploy/checks/pre-deploy/split-change-check.d.ts +3 -3
- package/dist/services/deploy/checks/pre-deploy/split-change-check.js +19 -20
- package/dist/services/deploy/context/deploy-context.d.ts +2 -2
- package/dist/services/deploy/context/deploy-context.js +10 -14
- package/dist/services/deploy/deploy-service-factory.d.ts +3 -3
- package/dist/services/deploy/deploy-service-factory.js +36 -40
- package/dist/services/deploy/deploy-service-model.d.ts +10 -10
- package/dist/services/deploy/deploy-service-model.js +1 -2
- package/dist/services/deploy/deploy-service.d.ts +4 -4
- package/dist/services/deploy/deploy-service.js +10 -15
- package/dist/services/deploy/error/check-module-file-error.d.ts +1 -1
- package/dist/services/deploy/error/check-module-file-error.js +2 -7
- package/dist/services/deploy/error/deploy-install-resource-error.d.ts +1 -1
- package/dist/services/deploy/error/deploy-install-resource-error.js +2 -7
- package/dist/services/deploy/error/deploy-module-file-error.d.ts +1 -1
- package/dist/services/deploy/error/deploy-module-file-error.js +2 -7
- package/dist/services/deploy/error/deploy-server-config-error.d.ts +1 -1
- package/dist/services/deploy/error/deploy-server-config-error.js +2 -7
- package/dist/services/deploy/error/evaluate-sk-config-error.d.ts +1 -1
- package/dist/services/deploy/error/evaluate-sk-config-error.js +2 -7
- package/dist/services/deploy/error/file-handler-error.d.ts +1 -1
- package/dist/services/deploy/error/file-handler-error.js +2 -7
- package/dist/services/deploy/error/post-deploy-deployment-detection-error.d.ts +1 -1
- package/dist/services/deploy/error/post-deploy-deployment-detection-error.js +2 -7
- package/dist/services/deploy/error/safe-file-error.d.ts +1 -1
- package/dist/services/deploy/error/safe-file-error.js +2 -7
- package/dist/services/deploy/handler/customer-config-handler.d.ts +6 -6
- package/dist/services/deploy/handler/customer-config-handler.js +6 -10
- package/dist/services/deploy/handler/install-resource-handler.d.ts +7 -7
- package/dist/services/deploy/handler/install-resource-handler.js +22 -27
- package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.d.ts +4 -4
- package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.js +1 -4
- package/dist/services/deploy/handler/module-handler.d.ts +6 -6
- package/dist/services/deploy/handler/module-handler.js +12 -18
- package/dist/services/deploy/handler/server-config-handler.d.ts +5 -5
- package/dist/services/deploy/handler/server-config-handler.js +10 -14
- package/dist/services/deploy/interface/deploy-handler-interface.d.ts +1 -1
- package/dist/services/deploy/interface/deploy-handler-interface.js +1 -2
- package/dist/services/deploy/interface/install-configs.js +1 -2
- package/dist/services/deploy/interface/install-resource-processor-interface.d.ts +1 -1
- package/dist/services/deploy/interface/install-resource-processor-interface.js +1 -2
- package/dist/services/deploy/interface/install.d.ts +1 -1
- package/dist/services/deploy/interface/install.js +1 -2
- package/dist/services/deploy/interface/runtime-modifier.d.ts +1 -1
- package/dist/services/deploy/interface/runtime-modifier.js +1 -2
- package/dist/services/deploy/interface/validate-origins-response.js +1 -2
- package/dist/services/diff/diff-model.js +1 -5
- package/dist/services/diff/diff-service-factory.d.ts +1 -1
- package/dist/services/diff/diff-service-factory.js +6 -10
- package/dist/services/diff/diff-service.d.ts +1 -1
- package/dist/services/diff/diff-service.js +19 -24
- package/dist/services/diff/index.d.ts +3 -3
- package/dist/services/diff/index.js +3 -6
- package/dist/services/diff-service.d.ts +1 -1
- package/dist/services/diff-service.js +16 -21
- package/dist/services/document-handler-runtime/context/document-handler-runtime-context.js +30 -34
- package/dist/services/document-handler-runtime/document-handler-runtime-service.d.ts +3 -3
- package/dist/services/document-handler-runtime/document-handler-runtime-service.js +38 -42
- package/dist/services/document-handler-runtime/document-handler-server.d.ts +7 -11
- package/dist/services/document-handler-runtime/document-handler-server.js +77 -59
- package/dist/services/document-handler-runtime/error/required-file-not-found-error.js +1 -4
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +5 -5
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +42 -46
- package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.js +1 -4
- package/dist/services/document-handler-runtime/interface/template-context-interface.d.ts +2 -3
- package/dist/services/document-handler-runtime/interface/template-context-interface.js +1 -2
- package/dist/services/document-handler-runtime/interface/template-interface.d.ts +2 -2
- package/dist/services/document-handler-runtime/interface/template-interface.js +1 -2
- package/dist/services/document-handler-runtime/interface/template-parameter-interface.js +1 -2
- package/dist/services/document-handler-runtime/server/document-handler-response.d.ts +1 -3
- package/dist/services/document-handler-runtime/server/document-handler-response.js +1 -5
- package/dist/services/document-handler-runtime/server/request.d.ts +4 -10
- package/dist/services/document-handler-runtime/server/request.js +1 -5
- package/dist/services/document-handler-runtime/templates/abstract-template.d.ts +3 -3
- package/dist/services/document-handler-runtime/templates/abstract-template.js +3 -7
- package/dist/services/document-handler-runtime/templates/database-mock.d.ts +2 -2
- package/dist/services/document-handler-runtime/templates/database-mock.js +2 -6
- package/dist/services/document-handler-runtime/templates/execute-document-handler.d.ts +2 -2
- package/dist/services/document-handler-runtime/templates/execute-document-handler.js +2 -6
- package/dist/services/document-handler-runtime/templates/orestes-mock.d.ts +2 -2
- package/dist/services/document-handler-runtime/templates/orestes-mock.js +2 -6
- package/dist/services/document-handler-runtime/templates/package-json.d.ts +3 -5
- package/dist/services/document-handler-runtime/templates/package-json.js +2 -6
- package/dist/services/document-handler-runtime/templates/test.d.ts +2 -2
- package/dist/services/document-handler-runtime/templates/test.js +2 -6
- package/dist/services/error-handling/error/application-error.d.ts +1 -1
- package/dist/services/error-handling/error/application-error.js +1 -5
- package/dist/services/error-handling/error/config-file-error.d.ts +1 -1
- package/dist/services/error-handling/error/config-file-error.js +2 -7
- package/dist/services/error-handling/error/connection-error.d.ts +1 -1
- package/dist/services/error-handling/error/connection-error.js +2 -7
- package/dist/services/integration-api/error/customer-config-error.d.ts +1 -1
- package/dist/services/integration-api/error/customer-config-error.js +2 -5
- package/dist/services/integration-api/error/customer-config-legacy-error.d.ts +1 -1
- package/dist/services/integration-api/error/customer-config-legacy-error.js +2 -6
- package/dist/services/integration-api/error/invalid-config-format-error.d.ts +1 -1
- package/dist/services/integration-api/error/invalid-config-format-error.js +4 -7
- package/dist/services/integration-api/error/mandatory-file-missing-error.d.ts +1 -1
- package/dist/services/integration-api/error/mandatory-file-missing-error.js +2 -6
- package/dist/services/integration-api/error/origin-error.d.ts +1 -1
- package/dist/services/integration-api/error/origin-error.js +2 -5
- package/dist/services/integration-api/error/read-files-error.d.ts +1 -1
- package/dist/services/integration-api/error/read-files-error.js +2 -7
- package/dist/services/integration-api/external/external-file-reader.d.ts +1 -1
- package/dist/services/integration-api/external/external-file-reader.js +9 -14
- package/dist/services/integration-api/file-list.d.ts +1 -1
- package/dist/services/integration-api/file-list.js +8 -11
- package/dist/services/integration-api/file-reader.js +11 -15
- package/dist/services/integration-api/file-writer.js +4 -8
- package/dist/services/integration-api/handler/customer-config-handler.d.ts +5 -5
- package/dist/services/integration-api/handler/customer-config-handler.js +17 -21
- package/dist/services/integration-api/handler/file-handler.d.ts +2 -2
- package/dist/services/integration-api/handler/file-handler.js +1 -4
- package/dist/services/integration-api/handler/install-resource-handler.d.ts +2 -2
- package/dist/services/integration-api/handler/install-resource-handler.js +6 -10
- package/dist/services/integration-api/handler/module-handler.d.ts +2 -2
- package/dist/services/integration-api/handler/module-handler.js +4 -8
- package/dist/services/integration-api/handler/server-config-handler.d.ts +2 -2
- package/dist/services/integration-api/handler/server-config-handler.js +4 -8
- package/dist/services/integration-api/index.d.ts +3 -3
- package/dist/services/integration-api/index.js +3 -6
- package/dist/services/integration-api/integration-api-factory.d.ts +3 -3
- package/dist/services/integration-api/integration-api-factory.js +23 -28
- package/dist/services/integration-api/integration-api-model.d.ts +17 -19
- package/dist/services/integration-api/integration-api-model.js +16 -21
- package/dist/services/integration-api/integration-api-service.d.ts +5 -5
- package/dist/services/integration-api/integration-api-service.js +6 -12
- package/dist/services/integration-api/spec/customer-config-validator.spec.js +29 -32
- package/dist/services/integration-api/spec/file-list.spec.js +107 -110
- package/dist/services/integration-api/spec/file-reader.spec.js +27 -30
- package/dist/services/integration-api/spec/file-writer.spec.js +34 -37
- package/dist/services/integration-api/spec/integration-api-service.spec.js +42 -45
- package/dist/services/integration-api/spec/mandatory-files-validator.spec.js +48 -51
- package/dist/services/integration-api/struct/customer-config-file.d.ts +1 -1
- package/dist/services/integration-api/struct/customer-config-file.js +10 -15
- package/dist/services/integration-api/struct/customer-config.d.ts +4 -8
- package/dist/services/integration-api/struct/customer-config.js +5 -10
- package/dist/services/integration-api/struct/file.d.ts +1 -1
- package/dist/services/integration-api/struct/file.js +9 -13
- package/dist/services/integration-api/struct/install-resource-file.d.ts +2 -2
- package/dist/services/integration-api/struct/install-resource-file.js +4 -8
- package/dist/services/integration-api/struct/module-file.d.ts +2 -2
- package/dist/services/integration-api/struct/module-file.js +4 -8
- package/dist/services/integration-api/struct/ro-file.d.ts +1 -1
- package/dist/services/integration-api/struct/ro-file.js +1 -5
- package/dist/services/integration-api/struct/server-config-file.d.ts +2 -2
- package/dist/services/integration-api/struct/server-config-file.js +4 -8
- package/dist/services/integration-api/struct/virtual-file.d.ts +1 -1
- package/dist/services/integration-api/struct/virtual-file.js +3 -7
- package/dist/services/integration-api/validator/customer-config-validator.d.ts +1 -1
- package/dist/services/integration-api/validator/customer-config-validator.js +8 -12
- package/dist/services/integration-api/validator/mandatory-files-validator.d.ts +2 -2
- package/dist/services/integration-api/validator/mandatory-files-validator.js +4 -8
- package/dist/services/integration-api/virtual/external-recipe.d.ts +2 -2
- package/dist/services/integration-api/virtual/external-recipe.js +1 -5
- package/dist/services/integration-api/virtual/static-recipe.d.ts +1 -1
- package/dist/services/integration-api/virtual/static-recipe.js +1 -5
- package/dist/services/integration-api/virtual/virtual-file-handler.d.ts +2 -2
- package/dist/services/integration-api/virtual/virtual-file-handler.js +8 -13
- package/dist/services/onboarding/browser/abort-response.js +1 -5
- package/dist/services/onboarding/browser/baqend-response.d.ts +1 -1
- package/dist/services/onboarding/browser/baqend-response.js +1 -5
- package/dist/services/onboarding/browser/config/browser-config.d.ts +1 -1
- package/dist/services/onboarding/browser/config/browser-config.js +15 -20
- package/dist/services/onboarding/browser/executable/executable-validator.d.ts +2 -2
- package/dist/services/onboarding/browser/executable/executable-validator.js +12 -17
- package/dist/services/onboarding/browser/extension/devtools-extension-api.d.ts +1 -1
- package/dist/services/onboarding/browser/extension/devtools-extension-api.js +1 -5
- package/dist/services/onboarding/browser/extension/extension-downloader.d.ts +2 -2
- package/dist/services/onboarding/browser/extension/extension-downloader.js +24 -30
- package/dist/services/onboarding/browser/extension/extension-validator.d.ts +3 -3
- package/dist/services/onboarding/browser/extension/extension-validator.js +18 -23
- package/dist/services/onboarding/browser/origin-response.d.ts +1 -1
- package/dist/services/onboarding/browser/origin-response.js +1 -5
- package/dist/services/onboarding/config-renderer/install-file-recipe.d.ts +2 -2
- package/dist/services/onboarding/config-renderer/install-file-recipe.js +1 -5
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.d.ts +3 -3
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +8 -11
- package/dist/services/onboarding/dashboard/diff-against-current-page.d.ts +4 -4
- package/dist/services/onboarding/dashboard/diff-against-current-page.js +9 -14
- package/dist/services/onboarding/dashboard/index.d.ts +7 -7
- package/dist/services/onboarding/dashboard/index.js +8 -13
- package/dist/services/onboarding/dashboard/parameter-query-builder.d.ts +1 -1
- package/dist/services/onboarding/dashboard/parameter-query-builder.js +9 -13
- package/dist/services/onboarding/dashboard/request-diff-service.d.ts +3 -3
- package/dist/services/onboarding/dashboard/request-diff-service.js +14 -19
- package/dist/services/onboarding/error/browser-extension-error.d.ts +1 -1
- package/dist/services/onboarding/error/browser-extension-error.js +1 -5
- package/dist/services/onboarding/error/document-handler-transform-error.js +1 -5
- package/dist/services/onboarding/error/unsupported-encoding-error.d.ts +1 -1
- package/dist/services/onboarding/error/unsupported-encoding-error.js +2 -7
- package/dist/services/onboarding/error/validate-extension-error.d.ts +1 -1
- package/dist/services/onboarding/error/validate-extension-error.js +2 -7
- package/dist/services/onboarding/error/vm-empty-response-error.d.ts +1 -1
- package/dist/services/onboarding/error/vm-empty-response-error.js +2 -7
- package/dist/services/onboarding/error/vm-error.d.ts +1 -1
- package/dist/services/onboarding/error/vm-error.js +2 -7
- package/dist/services/onboarding/fetch-event-handler.d.ts +4 -4
- package/dist/services/onboarding/fetch-event-handler.js +19 -25
- package/dist/services/onboarding/fetch-events/customer-domain-document-response.d.ts +4 -4
- package/dist/services/onboarding/fetch-events/customer-domain-document-response.js +15 -20
- package/dist/services/onboarding/fetch-events/customer-service-worker-js.d.ts +3 -3
- package/dist/services/onboarding/fetch-events/customer-service-worker-js.js +4 -8
- package/dist/services/onboarding/fetch-events/dashboard-request.d.ts +3 -3
- package/dist/services/onboarding/fetch-events/dashboard-request.js +1 -5
- package/dist/services/onboarding/fetch-events/speed-kit-asset-request.d.ts +5 -5
- package/dist/services/onboarding/fetch-events/speed-kit-asset-request.js +1 -5
- package/dist/services/onboarding/fetch-events/speed-kit-install-html.d.ts +4 -4
- package/dist/services/onboarding/fetch-events/speed-kit-install-html.js +3 -7
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.d.ts +5 -5
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +7 -11
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +6 -6
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.js +4 -8
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +3 -3
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.js +3 -7
- package/dist/services/onboarding/file-events/file-watcher.d.ts +5 -5
- package/dist/services/onboarding/file-events/file-watcher.js +24 -28
- package/dist/services/onboarding/index.d.ts +3 -3
- package/dist/services/onboarding/index.js +3 -8
- package/dist/services/onboarding/onboarding-model.d.ts +21 -23
- package/dist/services/onboarding/onboarding-model.js +22 -27
- package/dist/services/onboarding/onboarding-service-factory.d.ts +3 -3
- package/dist/services/onboarding/onboarding-service-factory.js +102 -108
- package/dist/services/onboarding/onboarding-service.d.ts +6 -6
- package/dist/services/onboarding/onboarding-service.js +12 -18
- package/dist/services/onboarding/request-cache/cache.d.ts +3 -3
- package/dist/services/onboarding/request-cache/cache.js +1 -5
- package/dist/services/onboarding/server-config/index.d.ts +3 -3
- package/dist/services/onboarding/server-config/index.js +6 -11
- package/dist/services/onboarding/templates/install-speed-kit-html-template.d.ts +1 -1
- package/dist/services/onboarding/templates/install-speed-kit-html-template.js +2 -7
- package/dist/services/onboarding/templates/install-speed-kit-js-template.d.ts +1 -1
- package/dist/services/onboarding/templates/install-speed-kit-js-template.js +2 -7
- package/dist/services/onboarding/todo-collector.d.ts +3 -3
- package/dist/services/onboarding/todo-collector.js +3 -7
- package/dist/services/onboarding/virtual-orestes-app/crawler.d.ts +2 -2
- package/dist/services/onboarding/virtual-orestes-app/crawler.js +12 -16
- package/dist/services/onboarding/virtual-orestes-app/index.d.ts +7 -7
- package/dist/services/onboarding/virtual-orestes-app/index.js +25 -32
- package/dist/services/pop-config/index.d.ts +3 -3
- package/dist/services/pop-config/index.js +3 -6
- package/dist/services/pop-config/pop-config-factory.d.ts +1 -1
- package/dist/services/pop-config/pop-config-factory.js +5 -9
- package/dist/services/pop-config/pop-config-model.d.ts +2 -2
- package/dist/services/pop-config/pop-config-model.js +1 -2
- package/dist/services/pop-config/pop-config-service.d.ts +2 -2
- package/dist/services/pop-config/pop-config-service.js +1 -5
- package/dist/services/prewarm/assets/asset-api-client.d.ts +2 -2
- package/dist/services/prewarm/assets/asset-api-client.js +18 -23
- package/dist/services/prewarm/assets/asset-item.d.ts +1 -1
- package/dist/services/prewarm/assets/asset-item.js +6 -10
- package/dist/services/prewarm/assets/asset-list.d.ts +2 -2
- package/dist/services/prewarm/assets/asset-list.js +6 -10
- package/dist/services/prewarm/csv-reader.js +6 -11
- package/dist/services/prewarm/error/invalid-origin-error.d.ts +1 -1
- package/dist/services/prewarm/error/invalid-origin-error.js +2 -7
- package/dist/services/prewarm/error/read-csv-error.d.ts +1 -1
- package/dist/services/prewarm/error/read-csv-error.js +2 -7
- package/dist/services/prewarm/index.d.ts +3 -3
- package/dist/services/prewarm/index.js +3 -6
- package/dist/services/prewarm/pre-warm-factory.d.ts +1 -1
- package/dist/services/prewarm/pre-warm-factory.js +13 -17
- package/dist/services/prewarm/pre-warm-model.js +16 -20
- package/dist/services/prewarm/pre-warm-service.d.ts +3 -3
- package/dist/services/prewarm/pre-warm-service.js +18 -22
- package/dist/services/pull/index.d.ts +3 -3
- package/dist/services/pull/index.js +3 -6
- package/dist/services/pull/pull-service-factory.d.ts +2 -2
- package/dist/services/pull/pull-service-factory.js +12 -16
- package/dist/services/pull/pull-service-model.js +4 -9
- package/dist/services/pull/pull-service.d.ts +3 -3
- package/dist/services/pull/pull-service.js +14 -19
- package/dist/services/query-builder/error/parse-config-speed-kit-error.d.ts +1 -1
- package/dist/services/query-builder/error/parse-config-speed-kit-error.js +2 -6
- package/dist/services/query-builder/query/parameter.js +1 -5
- package/dist/services/query-builder/query/prewarm.js +1 -5
- package/dist/services/query-builder/query-builder-factory.d.ts +3 -3
- package/dist/services/query-builder/query-builder-factory.js +16 -20
- package/dist/services/query-builder/query-builder-model.d.ts +6 -6
- package/dist/services/query-builder/query-builder-model.js +2 -5
- package/dist/services/query-builder/query-builder-service.d.ts +2 -2
- package/dist/services/query-builder/query-builder-service.js +24 -30
- package/oclif.manifest.json +15 -15
- package/package.json +63 -54
- package/dist/dummy.spec.d.ts +0 -1
- package/dist/dummy.spec.js +0 -18
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const files_1 = require("../../../../models/files");
|
|
6
|
-
const safe_1 = require("../../../../helpers/safe");
|
|
7
|
-
const evaluate_speed_kit_config_1 = require("../../../../helpers/evaluate-speed-kit-config");
|
|
8
|
-
class DeviceDetectionChangedCheck {
|
|
1
|
+
import { INTEGRATION_FILES } from "../../../../models/files.js";
|
|
2
|
+
import { safe } from "../../../../helpers/safe.js";
|
|
3
|
+
import { evaluateLocalAndRemoteSpeedKit } from "../../../../helpers/evaluate-speed-kit-config.js";
|
|
4
|
+
export class DeviceDetectionChangedCheck {
|
|
9
5
|
cli;
|
|
10
6
|
fileList;
|
|
11
7
|
configApi;
|
|
@@ -25,9 +21,9 @@ class DeviceDetectionChangedCheck {
|
|
|
25
21
|
// do not check for environments other than production
|
|
26
22
|
!this.isProduction ||
|
|
27
23
|
// do not check if speedKitConfigFile is not to be deployed
|
|
28
|
-
!this.fileList.hasFile(
|
|
24
|
+
!this.fileList.hasFile(INTEGRATION_FILES.CONFIG.SPEED_KIT) ||
|
|
29
25
|
this.fileList
|
|
30
|
-
.getByName(
|
|
26
|
+
.getByName(INTEGRATION_FILES.CONFIG.SPEED_KIT)
|
|
31
27
|
.shouldSkipFile()) {
|
|
32
28
|
return;
|
|
33
29
|
}
|
|
@@ -36,19 +32,19 @@ class DeviceDetectionChangedCheck {
|
|
|
36
32
|
if (!activeInstallResource) {
|
|
37
33
|
return;
|
|
38
34
|
}
|
|
39
|
-
this.cli.startAction("Checking for customDeviceDetection");
|
|
40
|
-
const speedKitConfigFile = this.fileList.getByName(
|
|
35
|
+
this.cli.startAction("PRE:CHECK:DEVICE_DETECTION", "Checking for customDeviceDetection");
|
|
36
|
+
const speedKitConfigFile = this.fileList.getByName(INTEGRATION_FILES.CONFIG.SPEED_KIT);
|
|
41
37
|
const activeSpeedKitConfig = activeInstallResource[speedKitConfigFile.remoteKey];
|
|
42
|
-
const changesResponse = await
|
|
38
|
+
const changesResponse = await safe(this.checkForChangedDeviceDetection(speedKitConfigFile, activeSpeedKitConfig));
|
|
43
39
|
if (changesResponse.success === false) {
|
|
44
|
-
this.cli.
|
|
40
|
+
this.cli.failAction("PRE:CHECK:DEVICE_DETECTION");
|
|
45
41
|
this.cli.writeError(`Unable to evaluate changes: ${changesResponse.error}`);
|
|
46
42
|
return;
|
|
47
43
|
}
|
|
48
44
|
const changes = changesResponse.data.map((value) => {
|
|
49
45
|
return "config_SpeedKit." + value;
|
|
50
46
|
});
|
|
51
|
-
this.cli.
|
|
47
|
+
this.cli.successAction("PRE:CHECK:DEVICE_DETECTION");
|
|
52
48
|
if (changes.length === 0) {
|
|
53
49
|
return;
|
|
54
50
|
}
|
|
@@ -60,7 +56,7 @@ class DeviceDetectionChangedCheck {
|
|
|
60
56
|
}
|
|
61
57
|
async checkForChangedDeviceDetection(speedKitConfigFile, activeSpeedKitConfig) {
|
|
62
58
|
const changes = [];
|
|
63
|
-
const { localSpeedKit, remoteSpeedKit } = await
|
|
59
|
+
const { localSpeedKit, remoteSpeedKit } = await evaluateLocalAndRemoteSpeedKit(this.customerConfig.app, this.customerConfig.origins[0], speedKitConfigFile, activeSpeedKitConfig);
|
|
64
60
|
if ((localSpeedKit.detectDevice && !remoteSpeedKit.detectDevice) ||
|
|
65
61
|
(!localSpeedKit.detectDevice && remoteSpeedKit.detectDevice)) {
|
|
66
62
|
changes.push("detectDevice");
|
|
@@ -93,14 +89,12 @@ class DeviceDetectionChangedCheck {
|
|
|
93
89
|
return changes;
|
|
94
90
|
}
|
|
95
91
|
async getActiveInstallResource() {
|
|
96
|
-
const activeInstallResourceResponse = await
|
|
92
|
+
const activeInstallResourceResponse = await safe(this.configApi.getActiveInstall(this.configName));
|
|
97
93
|
if (activeInstallResourceResponse.success !== true) {
|
|
98
|
-
this.cli.
|
|
99
|
-
this.cli.writeError("Could not load active install resource");
|
|
94
|
+
this.cli.failAction("PRE:CHECK:DEVICE_DETECTION", "Could not load active install resource");
|
|
100
95
|
this.cli.exit(1);
|
|
101
96
|
return;
|
|
102
97
|
}
|
|
103
98
|
return activeInstallResourceResponse.data;
|
|
104
99
|
}
|
|
105
100
|
}
|
|
106
|
-
exports.DeviceDetectionChangedCheck = DeviceDetectionChangedCheck;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FileListInterface, CustomerConfig } from "../../../integration-api";
|
|
2
|
-
import { CliServiceInterface } from "../../../cli";
|
|
3
|
-
import { ConfigApiService } from "../../../config-api";
|
|
1
|
+
import { FileListInterface, CustomerConfig } from "../../../integration-api/index.js";
|
|
2
|
+
import { CliServiceInterface } from "../../../cli/index.js";
|
|
3
|
+
import { ConfigApiService } from "../../../config-api/index.js";
|
|
4
4
|
export declare class SplitChangeCheck {
|
|
5
5
|
private cli;
|
|
6
6
|
private fileList;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const safe_1 = require("../../../../helpers/safe");
|
|
7
|
-
const evaluate_speed_kit_config_1 = require("../../../../helpers/evaluate-speed-kit-config");
|
|
8
|
-
class SplitChangeCheck {
|
|
1
|
+
import { INTEGRATION_FILES } from "../../../../models/files.js";
|
|
2
|
+
import { safe } from "../../../../helpers/safe.js";
|
|
3
|
+
import { evaluateLocalAndRemoteSpeedKit } from "../../../../helpers/evaluate-speed-kit-config.js";
|
|
4
|
+
import ApplicationError from "../../../error-handling/error/application-error.js";
|
|
5
|
+
export class SplitChangeCheck {
|
|
9
6
|
cli;
|
|
10
7
|
fileList;
|
|
11
8
|
configApi;
|
|
@@ -25,9 +22,9 @@ class SplitChangeCheck {
|
|
|
25
22
|
// do not check for environments other than production
|
|
26
23
|
!this.isProduction ||
|
|
27
24
|
// do not check if speedKitConfigFile is not to be deployed
|
|
28
|
-
!this.fileList.hasFile(
|
|
25
|
+
!this.fileList.hasFile(INTEGRATION_FILES.CONFIG.SPEED_KIT) ||
|
|
29
26
|
this.fileList
|
|
30
|
-
.getByName(
|
|
27
|
+
.getByName(INTEGRATION_FILES.CONFIG.SPEED_KIT)
|
|
31
28
|
.shouldSkipFile()) {
|
|
32
29
|
return;
|
|
33
30
|
}
|
|
@@ -36,20 +33,24 @@ class SplitChangeCheck {
|
|
|
36
33
|
if (!activeInstallResource) {
|
|
37
34
|
return;
|
|
38
35
|
}
|
|
39
|
-
this.cli.startAction("Checking Split Test ID");
|
|
40
|
-
const speedKitConfigFile = this.fileList.getByName(
|
|
36
|
+
this.cli.startAction("PRE:CHECK:SPLIT_CHANGE", "Checking Split Test ID");
|
|
37
|
+
const speedKitConfigFile = this.fileList.getByName(INTEGRATION_FILES.CONFIG.SPEED_KIT);
|
|
41
38
|
const activeSpeedKitConfig = activeInstallResource[speedKitConfigFile.remoteKey];
|
|
42
|
-
|
|
39
|
+
if (!activeSpeedKitConfig) {
|
|
40
|
+
throw new ApplicationError("RemoteSpeedKitConfig is empty");
|
|
41
|
+
}
|
|
42
|
+
const changesResponse = await safe(this.checkSplitsForEachOrigin(speedKitConfigFile, activeSpeedKitConfig));
|
|
43
43
|
if (changesResponse.success === false) {
|
|
44
|
-
this.cli.
|
|
44
|
+
this.cli.failAction("PRE:CHECK:SPLIT_CHANGE");
|
|
45
45
|
this.cli.writeError(`Unable to evaluate changes: ${changesResponse.error}`);
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
const changes = changesResponse.data;
|
|
49
|
-
this.cli.
|
|
49
|
+
this.cli.successAction("PRE:CHECK:SPLIT_CHANGE");
|
|
50
50
|
if (changes.length === 0) {
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
+
// @ts-expect-error incompatible type
|
|
53
54
|
this.cli.table(changes, { origin: {}, type: {}, old: {}, new: {} });
|
|
54
55
|
const result = await this.cli.confirm("Split change detected. Do you want to continue?", false);
|
|
55
56
|
if (!result) {
|
|
@@ -59,7 +60,7 @@ class SplitChangeCheck {
|
|
|
59
60
|
async checkSplitsForEachOrigin(speedKitConfigFile, activeSpeedKitConfig) {
|
|
60
61
|
const changes = [];
|
|
61
62
|
for (const origin of this.customerConfig.origins) {
|
|
62
|
-
const { localSpeedKit, remoteSpeedKit } = await
|
|
63
|
+
const { localSpeedKit, remoteSpeedKit } = await evaluateLocalAndRemoteSpeedKit(this.customerConfig.app, origin, speedKitConfigFile, activeSpeedKitConfig);
|
|
63
64
|
// check for split change
|
|
64
65
|
if (localSpeedKit.split !== remoteSpeedKit.split) {
|
|
65
66
|
changes.push({
|
|
@@ -111,14 +112,12 @@ class SplitChangeCheck {
|
|
|
111
112
|
return changes;
|
|
112
113
|
}
|
|
113
114
|
async getActiveInstallResource() {
|
|
114
|
-
const activeInstallResourceResponse = await
|
|
115
|
+
const activeInstallResourceResponse = await safe(this.configApi.getActiveInstall(this.configName));
|
|
115
116
|
if (activeInstallResourceResponse.success !== true) {
|
|
116
|
-
this.cli.
|
|
117
|
-
this.cli.writeError("Could not load active install resource");
|
|
117
|
+
this.cli.failAction("PRE:CHECK:SPLIT_CHANGE", "Could not load active install resource");
|
|
118
118
|
this.cli.exit(1);
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
121
121
|
return activeInstallResourceResponse.data;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
exports.SplitChangeCheck = SplitChangeCheck;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Command } from "@oclif/core/command";
|
|
2
2
|
export default class DeployContext {
|
|
3
3
|
readonly customerPath: string;
|
|
4
4
|
readonly configName: string;
|
|
5
5
|
readonly dryRun: boolean;
|
|
6
6
|
readonly useTestConfig: boolean;
|
|
7
|
-
static flags:
|
|
7
|
+
static flags: Record<string, Command.Flag>;
|
|
8
8
|
readonly artifacts?: string[];
|
|
9
9
|
readonly isProduction: boolean;
|
|
10
10
|
constructor(customerPath: string, configName?: string, artifacts?: string, dryRun?: boolean, useTestConfig?: boolean);
|
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const cli_parameters_1 = require("../../../models/cli-parameters");
|
|
6
|
-
const core_1 = require("@oclif/core");
|
|
7
|
-
dotenv.config();
|
|
1
|
+
import * as dotenv from "dotenv";
|
|
2
|
+
import { CLI_CONFIG_IS_TEST, CLI_CONFIG_NAME, } from "../../../models/cli-parameters.js";
|
|
3
|
+
import { Flags } from "@oclif/core";
|
|
4
|
+
dotenv.config({ quiet: true });
|
|
8
5
|
const DEFAULT_CONFIG_NAME = "production";
|
|
9
6
|
const ARTIFACTS_SEPARATOR = ",";
|
|
10
|
-
class DeployContext {
|
|
7
|
+
export default class DeployContext {
|
|
11
8
|
customerPath;
|
|
12
9
|
configName;
|
|
13
10
|
dryRun;
|
|
14
11
|
useTestConfig;
|
|
15
12
|
static flags = {
|
|
16
|
-
...
|
|
17
|
-
...
|
|
18
|
-
dryRun:
|
|
13
|
+
...CLI_CONFIG_NAME,
|
|
14
|
+
...CLI_CONFIG_IS_TEST,
|
|
15
|
+
dryRun: Flags.boolean({
|
|
19
16
|
char: "d",
|
|
20
17
|
default: false,
|
|
21
18
|
description: "dry run",
|
|
22
19
|
}),
|
|
23
|
-
verboseLevel:
|
|
20
|
+
verboseLevel: Flags.boolean({
|
|
24
21
|
char: "v",
|
|
25
22
|
default: false,
|
|
26
23
|
description: "Show all messages",
|
|
27
24
|
}),
|
|
28
|
-
artifacts:
|
|
25
|
+
artifacts: Flags.string({
|
|
29
26
|
char: "a",
|
|
30
27
|
description: "which files to upload",
|
|
31
28
|
}),
|
|
@@ -44,4 +41,3 @@ class DeployContext {
|
|
|
44
41
|
return this.artifacts?.length > 0;
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
|
-
exports.default = DeployContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UserCliConfig } from "../../helpers/cli-config";
|
|
2
|
-
import DeployContext from "./context/deploy-context";
|
|
3
|
-
import DeployService from "./deploy-service";
|
|
1
|
+
import { UserCliConfig } from "../../helpers/cli-config.js";
|
|
2
|
+
import DeployContext from "./context/deploy-context.js";
|
|
3
|
+
import DeployService from "./deploy-service.js";
|
|
4
4
|
export default class DeployServiceFactory {
|
|
5
5
|
private context;
|
|
6
6
|
private cliConfig;
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const deprecated_deployment_detection_check_1 = require("./checks/post-deploy/deprecated-deployment-detection-check");
|
|
19
|
-
const device_detection_changed_check_1 = require("./checks/pre-deploy/device-detection-changed-check");
|
|
20
|
-
class DeployServiceFactory {
|
|
1
|
+
import { CliServiceFactory } from "../cli/index.js";
|
|
2
|
+
import { DiffContext, DiffServiceFactory } from "../diff/index.js";
|
|
3
|
+
import InstallResourceBuilder from "./builder/install-resource-builder.js";
|
|
4
|
+
import RevalidatedModuleCheck from "./checks/post-deploy/revalidated-module-check.js";
|
|
5
|
+
import SaveFilesCheck from "./checks/post-deploy/save-files-check.js";
|
|
6
|
+
import DeployService from "./deploy-service.js";
|
|
7
|
+
import CustomerConfigHandler from "./handler/customer-config-handler.js";
|
|
8
|
+
import InstallResourceHandler from "./handler/install-resource-handler.js";
|
|
9
|
+
import DeletedFileCheck from "./handler/install-resource-modifier/deleted-file-check.js";
|
|
10
|
+
import ModuleHandler from "./handler/module-handler.js";
|
|
11
|
+
import ServerConfigHandler from "./handler/server-config-handler.js";
|
|
12
|
+
import { IntegrationApiFactory, IntegrationApiContext, DEFAULT_BLOCKED_FOLDERS, } from "../integration-api/index.js";
|
|
13
|
+
import { SplitChangeCheck } from "./checks/pre-deploy/split-change-check.js";
|
|
14
|
+
import { ConfigApiContext, ConfigApiServiceFactory, } from "../config-api/index.js";
|
|
15
|
+
import { DeprecatedDeploymentDetectionCheck } from "./checks/post-deploy/deprecated-deployment-detection-check.js";
|
|
16
|
+
import { DeviceDetectionChangedCheck } from "./checks/pre-deploy/device-detection-changed-check.js";
|
|
17
|
+
export default class DeployServiceFactory {
|
|
21
18
|
context;
|
|
22
19
|
cliConfig;
|
|
23
20
|
service = undefined;
|
|
@@ -26,7 +23,7 @@ class DeployServiceFactory {
|
|
|
26
23
|
this.cliConfig = cliConfig;
|
|
27
24
|
}
|
|
28
25
|
async buildService() {
|
|
29
|
-
if (!(this.service instanceof
|
|
26
|
+
if (!(this.service instanceof DeployService)) {
|
|
30
27
|
await this.build();
|
|
31
28
|
}
|
|
32
29
|
return this.service;
|
|
@@ -36,35 +33,34 @@ class DeployServiceFactory {
|
|
|
36
33
|
const customer = files.getCustomerConfig().config;
|
|
37
34
|
const configName = customer.name || this.context.configName;
|
|
38
35
|
const configApi = this.getConfigApi(customer.app);
|
|
39
|
-
const diffService = new
|
|
40
|
-
const cliService = new
|
|
41
|
-
const installResourceBuilder = new
|
|
42
|
-
const deletedFilesChecker = new
|
|
43
|
-
this.service = new
|
|
44
|
-
new
|
|
45
|
-
new
|
|
46
|
-
new
|
|
47
|
-
new
|
|
36
|
+
const diffService = new DiffServiceFactory(new DiffContext(this.cliConfig.diffExec, this.cliConfig.diffExecTemplate)).getService();
|
|
37
|
+
const cliService = new CliServiceFactory().getService();
|
|
38
|
+
const installResourceBuilder = new InstallResourceBuilder(configApi);
|
|
39
|
+
const deletedFilesChecker = new DeletedFileCheck(cliService, this.context.hasArtifacts());
|
|
40
|
+
this.service = new DeployService(files, [
|
|
41
|
+
new CustomerConfigHandler(customer, configApi, configName, diffService, cliService, installResourceBuilder),
|
|
42
|
+
new InstallResourceHandler(customer, configApi, configName, diffService, cliService, installResourceBuilder, deletedFilesChecker),
|
|
43
|
+
new ModuleHandler(configApi, diffService, cliService, []),
|
|
44
|
+
new ServerConfigHandler(configApi, diffService, cliService),
|
|
48
45
|
], cliService, [
|
|
49
|
-
new
|
|
50
|
-
new
|
|
46
|
+
new SplitChangeCheck(cliService, files, configApi, customer, configName, this.context.isProduction),
|
|
47
|
+
new DeviceDetectionChangedCheck(cliService, files, configApi, customer, configName, this.context.isProduction),
|
|
51
48
|
], this.getPostDeployChecks(files, cliService, configApi, customer.app), this.context.dryRun);
|
|
52
49
|
}
|
|
53
50
|
getConfigApi(app) {
|
|
54
|
-
const configApiContext = new
|
|
55
|
-
return new
|
|
51
|
+
const configApiContext = new ConfigApiContext(app);
|
|
52
|
+
return new ConfigApiServiceFactory(configApiContext).getService();
|
|
56
53
|
}
|
|
57
54
|
async getIntegrationFiles() {
|
|
58
|
-
const integrationApiContext = new
|
|
59
|
-
const integrationApi = new
|
|
55
|
+
const integrationApiContext = new IntegrationApiContext(this.context.customerPath, this.context.configName, this.context.artifacts, DEFAULT_BLOCKED_FOLDERS, this.context.useTestConfig);
|
|
56
|
+
const integrationApi = new IntegrationApiFactory(integrationApiContext, this.cliConfig).buildService();
|
|
60
57
|
return integrationApi.run();
|
|
61
58
|
}
|
|
62
59
|
getPostDeployChecks(files, cliService, configApi, app) {
|
|
63
60
|
return [
|
|
64
|
-
new
|
|
65
|
-
new
|
|
66
|
-
new
|
|
61
|
+
new SaveFilesCheck(files, cliService),
|
|
62
|
+
new RevalidatedModuleCheck(configApi, cliService, app),
|
|
63
|
+
new DeprecatedDeploymentDetectionCheck(files, cliService, configApi, app),
|
|
67
64
|
];
|
|
68
65
|
}
|
|
69
66
|
}
|
|
70
|
-
exports.default = DeployServiceFactory;
|
|
@@ -4,26 +4,26 @@ export interface PostDeployCheckInterface {
|
|
|
4
4
|
export interface PreDeployCheckInterface {
|
|
5
5
|
check(): Promise<void>;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export interface Change {
|
|
8
8
|
origin: string;
|
|
9
9
|
type: string;
|
|
10
10
|
old: string;
|
|
11
11
|
new: string;
|
|
12
|
-
}
|
|
13
|
-
export
|
|
12
|
+
}
|
|
13
|
+
export interface speedKitVariationRule {
|
|
14
14
|
contentType?: string[];
|
|
15
15
|
host?: string[];
|
|
16
|
-
pathname?:
|
|
17
|
-
url?:
|
|
18
|
-
}
|
|
19
|
-
export
|
|
16
|
+
pathname?: (string | RegExp)[];
|
|
17
|
+
url?: (string | RegExp)[];
|
|
18
|
+
}
|
|
19
|
+
export interface speedKitVariationRules {
|
|
20
20
|
rules?: speedKitVariationRule;
|
|
21
21
|
variationFunction: (request: Request, device: string, cookies: Map<string, string>) => string;
|
|
22
|
-
}
|
|
23
|
-
export
|
|
22
|
+
}
|
|
23
|
+
export interface speedKit {
|
|
24
24
|
split: number;
|
|
25
25
|
splitTestId: string;
|
|
26
26
|
userAgentDetection?: boolean;
|
|
27
27
|
detectDevice?: (doc: Document) => string | null;
|
|
28
28
|
customVariation?: speedKitVariationRules[];
|
|
29
|
-
}
|
|
29
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import DeployHandlerInterface from "./interface/deploy-handler-interface";
|
|
2
|
-
import { CliService } from "../cli";
|
|
3
|
-
import { FileListInterface } from "../integration-api/";
|
|
4
|
-
import { PostDeployCheckInterface, PreDeployCheckInterface } from "./deploy-service-model";
|
|
1
|
+
import DeployHandlerInterface from "./interface/deploy-handler-interface.js";
|
|
2
|
+
import { CliService } from "../cli/index.js";
|
|
3
|
+
import { FileListInterface } from "../integration-api/index.js";
|
|
4
|
+
import { PostDeployCheckInterface, PreDeployCheckInterface } from "./deploy-service-model.js";
|
|
5
5
|
export default class DeployService {
|
|
6
6
|
private readonly fileList;
|
|
7
7
|
private readonly deployHandler;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const files_1 = require("../../models/files");
|
|
4
|
-
class DeployService {
|
|
1
|
+
import { INTEGRATION_FILES } from "../../models/files.js";
|
|
2
|
+
export default class DeployService {
|
|
5
3
|
fileList;
|
|
6
4
|
deployHandler;
|
|
7
5
|
cli;
|
|
@@ -38,16 +36,14 @@ class DeployService {
|
|
|
38
36
|
await this.runPostDeployChecks();
|
|
39
37
|
}
|
|
40
38
|
async handleType(type) {
|
|
41
|
-
for (
|
|
42
|
-
const handler = this.deployHandler[iterator];
|
|
39
|
+
for (const handler of this.deployHandler) {
|
|
43
40
|
if (handler.canHandle(type)) {
|
|
44
41
|
await handler.handle(this.fileList.getByType(type));
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
44
|
}
|
|
48
45
|
async uploadType(type) {
|
|
49
|
-
for (
|
|
50
|
-
const handler = this.deployHandler[iterator];
|
|
46
|
+
for (const handler of this.deployHandler) {
|
|
51
47
|
if (handler.canHandle(type)) {
|
|
52
48
|
await handler.upload(this.fileList.getByType(type));
|
|
53
49
|
}
|
|
@@ -66,22 +62,21 @@ class DeployService {
|
|
|
66
62
|
filterFilesToProcess() {
|
|
67
63
|
this.fileList.filter((file) => {
|
|
68
64
|
// if we have a documentHandlerConfig we don't need an assetHandler
|
|
69
|
-
if (file.name ===
|
|
70
|
-
this.fileList.hasFile(
|
|
65
|
+
if (file.name === INTEGRATION_FILES.DEPRECATED.ASSET_HANDLER &&
|
|
66
|
+
this.fileList.hasFile(INTEGRATION_FILES.CONFIG.DOCUMENT_HANDLER)) {
|
|
71
67
|
return false;
|
|
72
68
|
}
|
|
73
69
|
// if we don't have a documentHandlerConfig we don't need styles
|
|
74
|
-
if (file.name ===
|
|
75
|
-
!this.fileList.hasFile(
|
|
70
|
+
if (file.name === INTEGRATION_FILES.CONFIG.DYNAMIC_STYLES &&
|
|
71
|
+
!this.fileList.hasFile(INTEGRATION_FILES.CONFIG.DOCUMENT_HANDLER)) {
|
|
76
72
|
return false;
|
|
77
73
|
}
|
|
78
74
|
// if we don't have a documentHandlerConfig we don't need dynamicBlocks
|
|
79
|
-
if (file.name ===
|
|
80
|
-
!this.fileList.hasFile(
|
|
75
|
+
if (file.name === INTEGRATION_FILES.CONFIG.DYNAMIC_BLOCKS &&
|
|
76
|
+
!this.fileList.hasFile(INTEGRATION_FILES.CONFIG.DOCUMENT_HANDLER)) {
|
|
81
77
|
return false;
|
|
82
78
|
}
|
|
83
79
|
return true;
|
|
84
80
|
});
|
|
85
81
|
}
|
|
86
82
|
}
|
|
87
|
-
exports.default = DeployService;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ApplicationError from "../../error-handling/error/application-error";
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
2
|
export declare class CheckModuleFileError extends ApplicationError {
|
|
3
3
|
readonly code = "CHECK_MODULE_ERROR";
|
|
4
4
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.CheckModuleFileError = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
-
class CheckModuleFileError extends application_error_1.default {
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
|
+
export class CheckModuleFileError extends ApplicationError {
|
|
7
3
|
code = "CHECK_MODULE_ERROR";
|
|
8
4
|
}
|
|
9
|
-
exports.CheckModuleFileError = CheckModuleFileError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ApplicationError from "../../error-handling/error/application-error";
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
2
|
export declare class DeployInstallResourceError extends ApplicationError {
|
|
3
3
|
readonly code = "INSTALL_RESOURCE_API_ERROR";
|
|
4
4
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.DeployInstallResourceError = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
-
class DeployInstallResourceError extends application_error_1.default {
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
|
+
export class DeployInstallResourceError extends ApplicationError {
|
|
7
3
|
code = "INSTALL_RESOURCE_API_ERROR";
|
|
8
4
|
}
|
|
9
|
-
exports.DeployInstallResourceError = DeployInstallResourceError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ApplicationError from "../../error-handling/error/application-error";
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
2
|
export declare class DeployModuleFileError extends ApplicationError {
|
|
3
3
|
readonly code = "MODULE_API_ERROR";
|
|
4
4
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.DeployModuleFileError = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
-
class DeployModuleFileError extends application_error_1.default {
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
|
+
export class DeployModuleFileError extends ApplicationError {
|
|
7
3
|
code = "MODULE_API_ERROR";
|
|
8
4
|
}
|
|
9
|
-
exports.DeployModuleFileError = DeployModuleFileError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ApplicationError from "../../error-handling/error/application-error";
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
2
|
export declare class DeployServerConfigError extends ApplicationError {
|
|
3
3
|
readonly code = "SERVER_MODULE_API_ERROR";
|
|
4
4
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.DeployServerConfigError = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
-
class DeployServerConfigError extends application_error_1.default {
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
|
+
export class DeployServerConfigError extends ApplicationError {
|
|
7
3
|
code = "SERVER_MODULE_API_ERROR";
|
|
8
4
|
}
|
|
9
|
-
exports.DeployServerConfigError = DeployServerConfigError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ApplicationError from "../../error-handling/error/application-error";
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
2
|
export declare class EvaluateSkConfigError extends ApplicationError {
|
|
3
3
|
readonly code = "CONFIG_SPEEDKIT_PARSE_ERROR";
|
|
4
4
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.EvaluateSkConfigError = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
-
class EvaluateSkConfigError extends application_error_1.default {
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
|
+
export class EvaluateSkConfigError extends ApplicationError {
|
|
7
3
|
code = "CONFIG_SPEEDKIT_PARSE_ERROR";
|
|
8
4
|
}
|
|
9
|
-
exports.EvaluateSkConfigError = EvaluateSkConfigError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ApplicationError from "../../error-handling/error/application-error";
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
2
|
export declare class FileHandlerError extends ApplicationError {
|
|
3
3
|
readonly code = "NO_HANDLER_FOR_FILE_TYPE";
|
|
4
4
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.FileHandlerError = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
-
class FileHandlerError extends application_error_1.default {
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
|
+
export class FileHandlerError extends ApplicationError {
|
|
7
3
|
code = "NO_HANDLER_FOR_FILE_TYPE";
|
|
8
4
|
}
|
|
9
|
-
exports.FileHandlerError = FileHandlerError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ApplicationError from "../../error-handling/error/application-error";
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
2
|
export declare class PostDeployDeploymentDetectionError extends ApplicationError {
|
|
3
3
|
readonly code = "POST_DEPLOY";
|
|
4
4
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.PostDeployDeploymentDetectionError = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
-
class PostDeployDeploymentDetectionError extends application_error_1.default {
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
|
+
export class PostDeployDeploymentDetectionError extends ApplicationError {
|
|
7
3
|
code = "POST_DEPLOY";
|
|
8
4
|
}
|
|
9
|
-
exports.PostDeployDeploymentDetectionError = PostDeployDeploymentDetectionError;
|