@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,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const cli_1 = require("../cli");
|
|
9
|
-
const site_analyzer_js_1 = require("../../helpers/site-analyzer.js");
|
|
10
|
-
const customer_config_service_model_1 = require("./customer-config-service-model");
|
|
11
|
-
class CustomerConfigService {
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import Handlebars from "handlebars";
|
|
4
|
+
import { analyzeSite, } from "../../helpers/site-analyzer.js";
|
|
5
|
+
import { DirectoryOverwriteOption, EnvironmentType, ShopSystem, } from "./customer-config-service-model.js";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
export class CustomerConfigService {
|
|
12
8
|
context;
|
|
13
9
|
cli;
|
|
14
10
|
_appName;
|
|
@@ -73,17 +69,17 @@ class CustomerConfigService {
|
|
|
73
69
|
// protect output directory if already existing and not empty:
|
|
74
70
|
if (this.isDirNotEmpty(directoryPath)) {
|
|
75
71
|
this.cli.spacer();
|
|
76
|
-
const selectedDirectoryOverwriteOption = await this.cli.select(`Output directory ${directoryPath} is not empty. How to proceed?`, Object.values(
|
|
72
|
+
const selectedDirectoryOverwriteOption = await this.cli.select(`Output directory ${directoryPath} is not empty. How to proceed?`, Object.values(DirectoryOverwriteOption).map((option) => ({
|
|
77
73
|
name: option,
|
|
78
74
|
value: option,
|
|
79
75
|
})));
|
|
80
76
|
switch (selectedDirectoryOverwriteOption) {
|
|
81
|
-
case
|
|
77
|
+
case DirectoryOverwriteOption.OVERWRITE_COMPLETELY: {
|
|
82
78
|
fs.rmSync(directoryPath, { recursive: true, force: true });
|
|
83
79
|
fs.mkdirSync(directoryPath, { recursive: true });
|
|
84
80
|
break;
|
|
85
81
|
}
|
|
86
|
-
case
|
|
82
|
+
case DirectoryOverwriteOption.NEW_NAME: {
|
|
87
83
|
return await this.chooseNewOutputDirectoryName(directoryPath);
|
|
88
84
|
}
|
|
89
85
|
}
|
|
@@ -97,23 +93,27 @@ class CustomerConfigService {
|
|
|
97
93
|
// write files:
|
|
98
94
|
for (const templateFile of this.templates) {
|
|
99
95
|
const outputFileName = this.getHandlebarsOutputFileName(templateFile);
|
|
100
|
-
this.cli.startAction(`Adding ${outputFileName}`);
|
|
96
|
+
this.cli.startAction(`CREATE:CUSTOMER:CONFIG:${outputFileName}`, `Adding ${outputFileName}`);
|
|
101
97
|
try {
|
|
102
98
|
const outputFilePath = path.join(this.outputDirPath, outputFileName);
|
|
103
99
|
if (!(await this.shouldFileBeOverwritten(outputFilePath))) {
|
|
104
|
-
this.cli.endAction(
|
|
100
|
+
this.cli.endAction(`CREATE:CUSTOMER:CONFIG:${outputFileName}`, "skipped!");
|
|
105
101
|
continue;
|
|
106
102
|
}
|
|
107
|
-
const
|
|
103
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
104
|
+
const filePath = path.resolve(__dirname, "templates", templateFile);
|
|
108
105
|
const content = fs.readFileSync(filePath, "utf8");
|
|
109
106
|
const template = Handlebars.compile(content);
|
|
110
107
|
const result = template(configSettings);
|
|
111
108
|
fs.mkdirSync(path.dirname(outputFilePath), { recursive: true });
|
|
112
109
|
fs.writeFileSync(outputFilePath, result);
|
|
113
|
-
this.cli.
|
|
110
|
+
this.cli.successAction(`CREATE:CUSTOMER:CONFIG:${outputFileName}`);
|
|
114
111
|
}
|
|
115
|
-
catch {
|
|
116
|
-
this.cli.
|
|
112
|
+
catch (error) {
|
|
113
|
+
this.cli.failAction(`CREATE:CUSTOMER:CONFIG:${outputFileName}`);
|
|
114
|
+
this.cli.writeError(
|
|
115
|
+
// @ts-expect-error unknown error
|
|
116
|
+
error?.message || "something strange happened here!");
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
this.cli.spacer();
|
|
@@ -138,7 +138,9 @@ class CustomerConfigService {
|
|
|
138
138
|
return true;
|
|
139
139
|
}
|
|
140
140
|
async getConfigSettings() {
|
|
141
|
-
let {
|
|
141
|
+
let {
|
|
142
|
+
// eslint-disable-next-line no-useless-assignment
|
|
143
|
+
production, staging, includeServiceWorker, isShopify, isShopware, isSalesforce, isOxid, isPlentymarkets, } = {};
|
|
142
144
|
this.appName = await this.cli.prompt(`[App] Enter desired Speed Kit app name:`, {
|
|
143
145
|
validator: (input) => /^[\da-z]+(?:-[\da-z]+)*$/.test(input) ? "" : "No valid kebab-case",
|
|
144
146
|
defaultAnswer: this.appName,
|
|
@@ -151,34 +153,33 @@ class CustomerConfigService {
|
|
|
151
153
|
let siteAnalysis = null;
|
|
152
154
|
const shouldAnalyze = await this.cli.confirm("[Analysis] Analyze production site to auto-detect settings?", true);
|
|
153
155
|
if (shouldAnalyze) {
|
|
154
|
-
this.cli.startAction(`Analyzing https://${productionHost}`);
|
|
155
|
-
siteAnalysis = await
|
|
156
|
+
this.cli.startAction("ANALYSE:CUSTOMER:CONFIG", `Analyzing https://${productionHost}`);
|
|
157
|
+
siteAnalysis = await analyzeSite(productionHost, (message) => this.cli.comment(message));
|
|
156
158
|
if (siteAnalysis) {
|
|
157
|
-
this.cli.
|
|
159
|
+
this.cli.successAction("ANALYSE:CUSTOMER:CONFIG");
|
|
158
160
|
}
|
|
159
161
|
else {
|
|
160
|
-
this.cli.endAction(
|
|
161
|
-
this.cli.comment("Could not analyze site — using defaults.");
|
|
162
|
+
this.cli.endAction("ANALYSE:CUSTOMER:CONFIG", "Could not analyze site — using defaults.");
|
|
162
163
|
}
|
|
163
164
|
}
|
|
164
165
|
this.cli.spacer();
|
|
165
166
|
// 3. Shop system
|
|
166
167
|
const detectedShopMap = {
|
|
167
|
-
shopify:
|
|
168
|
-
shopware:
|
|
169
|
-
salesforce:
|
|
170
|
-
oxid:
|
|
171
|
-
plentymarkets:
|
|
172
|
-
magento:
|
|
173
|
-
woocommerce:
|
|
174
|
-
bigcommerce:
|
|
175
|
-
prestashop:
|
|
176
|
-
jtl:
|
|
177
|
-
commercetools:
|
|
178
|
-
spryker:
|
|
179
|
-
shoptet:
|
|
180
|
-
ecforce:
|
|
181
|
-
futureshop:
|
|
168
|
+
shopify: ShopSystem.SHOPIFY,
|
|
169
|
+
shopware: ShopSystem.SHOPWARE,
|
|
170
|
+
salesforce: ShopSystem.SALESFORCE,
|
|
171
|
+
oxid: ShopSystem.OXID,
|
|
172
|
+
plentymarkets: ShopSystem.PLENTYMARKETS,
|
|
173
|
+
magento: ShopSystem.MAGENTO,
|
|
174
|
+
woocommerce: ShopSystem.WOOCOMMERCE,
|
|
175
|
+
bigcommerce: ShopSystem.BIGCOMMERCE,
|
|
176
|
+
prestashop: ShopSystem.PRESTASHOP,
|
|
177
|
+
jtl: ShopSystem.JTL,
|
|
178
|
+
commercetools: ShopSystem.COMMERCETOOLS,
|
|
179
|
+
spryker: ShopSystem.SPRYKER,
|
|
180
|
+
shoptet: ShopSystem.SHOPTET,
|
|
181
|
+
ecforce: ShopSystem.ECFORCE,
|
|
182
|
+
futureshop: ShopSystem.FUTURESHOP,
|
|
182
183
|
};
|
|
183
184
|
const detectedShop = siteAnalysis?.shopSystem
|
|
184
185
|
? detectedShopMap[siteAnalysis.shopSystem]
|
|
@@ -193,33 +194,33 @@ class CustomerConfigService {
|
|
|
193
194
|
this.cli.comment("[Shop System] Could not detect shop system from site.");
|
|
194
195
|
}
|
|
195
196
|
selectedShopSystem = await this.cli.select("[Shop System] Which shop system is in use?", [
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
197
|
+
ShopSystem.SHOPIFY,
|
|
198
|
+
ShopSystem.SHOPWARE,
|
|
199
|
+
ShopSystem.SALESFORCE,
|
|
200
|
+
ShopSystem.OXID,
|
|
201
|
+
ShopSystem.PLENTYMARKETS,
|
|
202
|
+
ShopSystem.OTHER,
|
|
202
203
|
].map((option) => ({ name: option, value: option })));
|
|
203
204
|
}
|
|
204
205
|
this.cli.spacer();
|
|
205
206
|
switch (selectedShopSystem) {
|
|
206
|
-
case
|
|
207
|
+
case ShopSystem.SHOPIFY: {
|
|
207
208
|
isShopify = true;
|
|
208
209
|
break;
|
|
209
210
|
}
|
|
210
|
-
case
|
|
211
|
+
case ShopSystem.SHOPWARE: {
|
|
211
212
|
isShopware = true;
|
|
212
213
|
break;
|
|
213
214
|
}
|
|
214
|
-
case
|
|
215
|
+
case ShopSystem.SALESFORCE: {
|
|
215
216
|
isSalesforce = true;
|
|
216
217
|
break;
|
|
217
218
|
}
|
|
218
|
-
case
|
|
219
|
+
case ShopSystem.OXID: {
|
|
219
220
|
isOxid = true;
|
|
220
221
|
break;
|
|
221
222
|
}
|
|
222
|
-
case
|
|
223
|
+
case ShopSystem.PLENTYMARKETS: {
|
|
223
224
|
isPlentymarkets = true;
|
|
224
225
|
break;
|
|
225
226
|
}
|
|
@@ -233,7 +234,7 @@ class CustomerConfigService {
|
|
|
233
234
|
if (!isShopify) {
|
|
234
235
|
const withStaging = await this.cli.confirm("[Staging] Should a staging config also be added?", false);
|
|
235
236
|
if (withStaging) {
|
|
236
|
-
staging = await this.getEnvironmentConfig(
|
|
237
|
+
staging = await this.getEnvironmentConfig(EnvironmentType.STAGING, productionHost.replace("www", "staging"));
|
|
237
238
|
}
|
|
238
239
|
this.cli.spacer();
|
|
239
240
|
}
|
|
@@ -369,7 +370,7 @@ class CustomerConfigService {
|
|
|
369
370
|
this.cli.spacer();
|
|
370
371
|
}
|
|
371
372
|
// Resolve shop system display name for template
|
|
372
|
-
const shopSystemName = selectedShopSystem ===
|
|
373
|
+
const shopSystemName = selectedShopSystem === ShopSystem.OTHER ? undefined : selectedShopSystem;
|
|
373
374
|
return {
|
|
374
375
|
appName: this.appName,
|
|
375
376
|
production,
|
|
@@ -418,4 +419,3 @@ class CustomerConfigService {
|
|
|
418
419
|
this.cli.writeSuccess("\nConfig generation completed 👏\n");
|
|
419
420
|
}
|
|
420
421
|
}
|
|
421
|
-
exports.CustomerConfigService = CustomerConfigService;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./customer-config-service";
|
|
2
|
-
export * from "./customer-config-service-context";
|
|
3
|
-
export * from "./customer-config-service-model";
|
|
4
|
-
export * from "./customer-config-service-factory";
|
|
1
|
+
export * from "./customer-config-service.js";
|
|
2
|
+
export * from "./customer-config-service-context.js";
|
|
3
|
+
export * from "./customer-config-service-model.js";
|
|
4
|
+
export * from "./customer-config-service-factory.js";
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
tslib_1.__exportStar(require("./customer-config-service-context"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./customer-config-service-model"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./customer-config-service-factory"), exports);
|
|
1
|
+
export * from "./customer-config-service.js";
|
|
2
|
+
export * from "./customer-config-service-context.js";
|
|
3
|
+
export * from "./customer-config-service-model.js";
|
|
4
|
+
export * from "./customer-config-service-factory.js";
|
|
@@ -109,13 +109,22 @@ const config = {
|
|
|
109
109
|
wrapPreRenderedElementsWithCustomRootTags(document);
|
|
110
110
|
addPolyFillAfterMainPreRenderTemplate(document);
|
|
111
111
|
triggerShadowRendering(document);
|
|
112
|
+
{{#if isShopify}}
|
|
113
|
+
// Shopify specific: inject scripts into sk-html which set css variables (normally set to html element)
|
|
114
|
+
injectCSSVariableScripts(document);
|
|
115
|
+
{{/if}}
|
|
112
116
|
{{#if addSSRInnerShadowDomSupport}}
|
|
113
117
|
|
|
114
118
|
overrideCustomElementDefine(document);
|
|
115
119
|
walkPreRenderedElements(document);
|
|
116
120
|
{{/if}}
|
|
117
121
|
{{else}}
|
|
118
|
-
|
|
122
|
+
{{#if isShopify}}
|
|
123
|
+
// Shopify specific: inject script which sets css variables on the html element
|
|
124
|
+
injectCSSVariableScripts(document);
|
|
125
|
+
{{else}}
|
|
126
|
+
// do nothing
|
|
127
|
+
{{/if}}
|
|
119
128
|
{{/if}}
|
|
120
129
|
},
|
|
121
130
|
{{#if isPlentymarkets}}
|
|
@@ -652,3 +661,81 @@ export const post = async (db, req, res) => {
|
|
|
652
661
|
}
|
|
653
662
|
{{/if}}
|
|
654
663
|
{{/if}}
|
|
664
|
+
{{#if isShopify}}
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* Injects scripts into sk-html within each shadow root that set CSS custom
|
|
668
|
+
* properties (e.g. --window-height, --announcement-bar-height, --header-height)
|
|
669
|
+
* on sk-html instead of the document's html element.
|
|
670
|
+
*
|
|
671
|
+
* @param document
|
|
672
|
+
*/
|
|
673
|
+
function injectCSSVariableScripts(document) {
|
|
674
|
+
{{#if addSSR}}
|
|
675
|
+
const customShadowRoots = getCustomShadowElements(document);
|
|
676
|
+
for (const customShadowRoot of customShadowRoots) {
|
|
677
|
+
const skHtml = customShadowRoot.querySelector("sk-html");
|
|
678
|
+
if (!skHtml) continue;
|
|
679
|
+
|
|
680
|
+
const script = document.createElement("script");
|
|
681
|
+
script.textContent = `(${setCSSVariablesOnSkHtml.toString()})();`;
|
|
682
|
+
// insert script before #main so styles are applied earlier
|
|
683
|
+
const main = skHtml.querySelector("#main");
|
|
684
|
+
if (main) {
|
|
685
|
+
main.before(script);
|
|
686
|
+
} else {
|
|
687
|
+
skHtml.appendChild(script);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
{{else}}
|
|
691
|
+
const script = document.createElement("script");
|
|
692
|
+
script.textContent = `(${setCSSVariablesOnHtml.toString()})();`;
|
|
693
|
+
// insert script before #main so styles are applied earlier
|
|
694
|
+
const main = document.querySelector("#main");
|
|
695
|
+
if (!main) return;
|
|
696
|
+
main.before(script);
|
|
697
|
+
{{/if}}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Client-side script that sets CSS custom properties on {{#if addSSR}}sk-html{{else}}the html element{{/if}}
|
|
702
|
+
* (e.g. --window-height, --announcement-bar-height, --header-height).
|
|
703
|
+
* Injected via .toString() into the document.
|
|
704
|
+
*
|
|
705
|
+
* TODO: double check whether the set CSS variables are being used by the theme
|
|
706
|
+
* and that the queried selectors are correct for this Shopify store.
|
|
707
|
+
*/
|
|
708
|
+
/* eslint-disable no-undef -- client-side function serialised via .toString() */
|
|
709
|
+
function {{#if addSSR}}setCSSVariablesOnSkHtml{{else}}setCSSVariablesOnHtml{{/if}}() {
|
|
710
|
+
{{#if addSSR}}
|
|
711
|
+
const host = document.querySelector("sk-shadow-app-root");
|
|
712
|
+
const root = host?.shadowRoot;
|
|
713
|
+
if (!root) return;
|
|
714
|
+
const skHtml = root.querySelector("sk-html");
|
|
715
|
+
if (!skHtml) return;
|
|
716
|
+
{{else}}
|
|
717
|
+
const html = document.querySelector("html");
|
|
718
|
+
if (!html) return;
|
|
719
|
+
{{/if}}
|
|
720
|
+
|
|
721
|
+
requestAnimationFrame(() => {
|
|
722
|
+
const viewportHeight = window.visualViewport ? window.visualViewport.height : document.documentElement.clientHeight;
|
|
723
|
+
{{#if addSSR}}skHtml{{else}}html{{/if}}.style.setProperty("--window-height", viewportHeight + "px");
|
|
724
|
+
});
|
|
725
|
+
|
|
726
|
+
const announcementBar = {{#if addSSR}}root{{else}}document{{/if}}.querySelector('[id^="shopify-section"][id$="announcement-bar"]');
|
|
727
|
+
if (announcementBar) {
|
|
728
|
+
{{#if addSSR}}skHtml{{else}}html{{/if}}.style.setProperty("--announcement-bar-height", announcementBar.clientHeight + "px");
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
const headerElement = {{#if addSSR}}root{{else}}document{{/if}}.querySelector('[id^="shopify-section"][id$="header"]');
|
|
732
|
+
if (headerElement) {
|
|
733
|
+
const headerHeight = headerElement.clientHeight;
|
|
734
|
+
const headerHeightWithoutBottomNav = headerElement.querySelector(".header__wrapper")?.clientHeight;
|
|
735
|
+
{{#if addSSR}}skHtml{{else}}html{{/if}}.style.setProperty("--header-height", headerHeight + "px");
|
|
736
|
+
if (headerHeightWithoutBottomNav != null) {
|
|
737
|
+
{{#if addSSR}}skHtml{{else}}html{{/if}}.style.setProperty("--header-height-without-bottom-nav", headerHeightWithoutBottomNav + "px");
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
{{/if}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Install from "../interface/install";
|
|
2
|
-
import { ConfigApiService } from "../../config-api";
|
|
1
|
+
import Install from "../interface/install.js";
|
|
2
|
+
import { ConfigApiService } from "../../config-api/index.js";
|
|
3
3
|
export default class InstallResourceBuilder {
|
|
4
4
|
changed: boolean;
|
|
5
5
|
resource: Install;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const deepmerge_1 = tslib_1.__importDefault(require("deepmerge"));
|
|
5
|
-
class InstallResourceBuilder {
|
|
1
|
+
import deepmerge from "deepmerge";
|
|
2
|
+
export default class InstallResourceBuilder {
|
|
6
3
|
changed = false;
|
|
7
4
|
resource;
|
|
8
5
|
configApi;
|
|
@@ -42,9 +39,8 @@ class InstallResourceBuilder {
|
|
|
42
39
|
return this.resource;
|
|
43
40
|
}
|
|
44
41
|
deepMerge(object1, object2) {
|
|
45
|
-
return (
|
|
42
|
+
return deepmerge(object1, object2, {
|
|
46
43
|
arrayMerge: (destinationArray, sourceArray, _options) => sourceArray,
|
|
47
44
|
});
|
|
48
45
|
}
|
|
49
46
|
}
|
|
50
|
-
exports.default = InstallResourceBuilder;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PostDeployCheckInterface } from "../../deploy-service-model";
|
|
2
|
-
import { FileListInterface } from "../../../integration-api";
|
|
3
|
-
import { CliService } from "../../../cli";
|
|
4
|
-
import { ConfigApiService } from "../../../config-api";
|
|
1
|
+
import { PostDeployCheckInterface } from "../../deploy-service-model.js";
|
|
2
|
+
import { FileListInterface } from "../../../integration-api/index.js";
|
|
3
|
+
import { CliService } from "../../../cli/index.js";
|
|
4
|
+
import { ConfigApiService } from "../../../config-api/index.js";
|
|
5
5
|
export declare class DeprecatedDeploymentDetectionCheck implements PostDeployCheckInterface {
|
|
6
6
|
private fileList;
|
|
7
7
|
private cli;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const files_1 = require("../../../../models/files");
|
|
6
|
-
const safe_1 = require("../../../../helpers/safe");
|
|
7
|
-
const post_deploy_deployment_detection_error_1 = require("../../error/post-deploy-deployment-detection-error");
|
|
8
|
-
class DeprecatedDeploymentDetectionCheck {
|
|
1
|
+
import { INTEGRATION_FILES } from "../../../../models/files.js";
|
|
2
|
+
import { safe } from "../../../../helpers/safe.js";
|
|
3
|
+
import { PostDeployDeploymentDetectionError } from "../../error/post-deploy-deployment-detection-error.js";
|
|
4
|
+
export class DeprecatedDeploymentDetectionCheck {
|
|
9
5
|
fileList;
|
|
10
6
|
cli;
|
|
11
7
|
configApi;
|
|
@@ -17,18 +13,18 @@ class DeprecatedDeploymentDetectionCheck {
|
|
|
17
13
|
this.app = app;
|
|
18
14
|
}
|
|
19
15
|
async check() {
|
|
20
|
-
this.cli.startAction("[postDeployCheck] deploymentDetection");
|
|
21
|
-
const configFile = this.fileList.getByName(
|
|
22
|
-
const moduleFile = this.fileList.getByName(
|
|
16
|
+
this.cli.startAction("POST:CHECK:DEPLOYMENT_DETECTION", "[postDeployCheck] deploymentDetection");
|
|
17
|
+
const configFile = this.fileList.getByName(INTEGRATION_FILES.CONFIG.DOCUMENT_HANDLER);
|
|
18
|
+
const moduleFile = this.fileList.getByName(INTEGRATION_FILES.DEPRECATED.DEPLOYMENT_DETECTION);
|
|
23
19
|
// no config_documentHandler or module: deploymentDetection found
|
|
24
20
|
if (!configFile || moduleFile) {
|
|
25
|
-
this.cli.
|
|
21
|
+
this.cli.successAction("POST:CHECK:DEPLOYMENT_DETECTION");
|
|
26
22
|
return;
|
|
27
23
|
}
|
|
28
24
|
const content = configFile.getContent();
|
|
29
25
|
if (!content.includes("executeDeploymentDetection: true") &&
|
|
30
26
|
!content.includes("executeDeploymentDetection: {")) {
|
|
31
|
-
this.cli.
|
|
27
|
+
this.cli.successAction("POST:CHECK:DEPLOYMENT_DETECTION");
|
|
32
28
|
return;
|
|
33
29
|
}
|
|
34
30
|
const entityManager = await this.configApi.client.getEntityManager();
|
|
@@ -36,8 +32,8 @@ class DeprecatedDeploymentDetectionCheck {
|
|
|
36
32
|
.find()
|
|
37
33
|
.eq("id", "/db/jobs.Definition/deployment-check")
|
|
38
34
|
.singleResult();
|
|
39
|
-
const moduleResult = await
|
|
40
|
-
this.cli.
|
|
35
|
+
const moduleResult = await safe(this.configApi.getModule(INTEGRATION_FILES.DEPRECATED.DEPLOYMENT_DETECTION));
|
|
36
|
+
this.cli.successAction("POST:CHECK:DEPLOYMENT_DETECTION");
|
|
41
37
|
if (deployCheckJob) {
|
|
42
38
|
this.cli.writeWarning(`Found active Job for ${this.cli.style.bold("deprecated")} deploymentDetection in app: ${this.app}`);
|
|
43
39
|
if (await this.cli.confirm("Delete job for deploymentDetection?")) {
|
|
@@ -49,24 +45,23 @@ class DeprecatedDeploymentDetectionCheck {
|
|
|
49
45
|
moduleResult.data.length > 0) {
|
|
50
46
|
this.cli.writeWarning(`Found ${this.cli.style.bold("deprecated")} module deploymentDetection in app: ${this.app}`);
|
|
51
47
|
if (await this.cli.confirm("Delete module deploymentDetection?")) {
|
|
52
|
-
this.cli.startAction("Delete module deploymentDetection");
|
|
53
|
-
await this.configApi.deleteModule(
|
|
54
|
-
this.cli.
|
|
48
|
+
this.cli.startAction("POST:CHECK:DEPLOYMENT_DETECTION:DELETE", "Delete module deploymentDetection");
|
|
49
|
+
await this.configApi.deleteModule(INTEGRATION_FILES.DEPRECATED.DEPLOYMENT_DETECTION);
|
|
50
|
+
this.cli.successAction("POST:CHECK:DEPLOYMENT_DETECTION:DELETE");
|
|
55
51
|
}
|
|
56
52
|
}
|
|
57
53
|
}
|
|
58
54
|
async deleteDeploymentJobDefinition(deployCheckJob) {
|
|
59
|
-
this.cli.startAction("Delete job deploymentDetection-check");
|
|
60
|
-
const result = await
|
|
55
|
+
this.cli.startAction("POST:CHECK:DEPLOYMENT_DETECTION:DELETE_CRON", "Delete job deploymentDetection-check");
|
|
56
|
+
const result = await safe(deployCheckJob.delete());
|
|
61
57
|
if (result.success === true) {
|
|
62
|
-
this.cli.
|
|
58
|
+
this.cli.successAction("POST:CHECK:DEPLOYMENT_DETECTION:DELETE_CRON");
|
|
63
59
|
return;
|
|
64
60
|
}
|
|
65
|
-
this.cli.
|
|
66
|
-
throw new
|
|
61
|
+
this.cli.failAction("POST:CHECK:DEPLOYMENT_DETECTION:DELETE_CRON");
|
|
62
|
+
throw new PostDeployDeploymentDetectionError(result.error, [
|
|
67
63
|
`check https://dashboard.baqend.com/app/${this.app}/db/jobs.Definition`,
|
|
68
64
|
"delete entry manual",
|
|
69
65
|
]);
|
|
70
66
|
}
|
|
71
67
|
}
|
|
72
|
-
exports.DeprecatedDeploymentDetectionCheck = DeprecatedDeploymentDetectionCheck;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CliService } from "../../../cli";
|
|
2
|
-
import { PostDeployCheckInterface } from "../../deploy-service-model";
|
|
3
|
-
import { ConfigApiService } from "../../../config-api";
|
|
1
|
+
import { CliService } from "../../../cli/index.js";
|
|
2
|
+
import { PostDeployCheckInterface } from "../../deploy-service-model.js";
|
|
3
|
+
import { ConfigApiService } from "../../../config-api/index.js";
|
|
4
4
|
export default class RevalidatedModuleCheck implements PostDeployCheckInterface {
|
|
5
5
|
private readonly configApi;
|
|
6
6
|
private cli;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const safe_1 = require("../../../../helpers/safe");
|
|
5
|
-
const deploy_module_file_error_1 = require("../../error/deploy-module-file-error");
|
|
6
|
-
const check_module_file_error_1 = require("../../error/check-module-file-error");
|
|
1
|
+
import { safe } from "../../../../helpers/safe.js";
|
|
2
|
+
import { DeployModuleFileError } from "../../error/deploy-module-file-error.js";
|
|
3
|
+
import { CheckModuleFileError } from "../../error/check-module-file-error.js";
|
|
7
4
|
const REVALIDATED_MODULE_NAME = "speedKit.Revalidated";
|
|
8
|
-
class RevalidatedModuleCheck {
|
|
5
|
+
export default class RevalidatedModuleCheck {
|
|
9
6
|
configApi;
|
|
10
7
|
cli;
|
|
11
8
|
app;
|
|
@@ -15,17 +12,16 @@ class RevalidatedModuleCheck {
|
|
|
15
12
|
this.app = app;
|
|
16
13
|
}
|
|
17
14
|
async check() {
|
|
18
|
-
this.cli.startAction("[postDeployCheck] check for revalidated module");
|
|
19
|
-
const result = await
|
|
15
|
+
this.cli.startAction("POST:CHECK:REVALIDATED_MODULE", "[postDeployCheck] check for revalidated module");
|
|
16
|
+
const result = await safe(this.configApi.getModule(REVALIDATED_MODULE_NAME));
|
|
20
17
|
if (result.success === true && result.data) {
|
|
21
|
-
this.cli.
|
|
18
|
+
this.cli.successAction("POST:CHECK:REVALIDATED_MODULE");
|
|
22
19
|
return;
|
|
23
20
|
}
|
|
24
|
-
this.cli.
|
|
21
|
+
this.cli.failAction("POST:CHECK:REVALIDATED_MODULE");
|
|
25
22
|
if (result.success === false) {
|
|
26
|
-
throw new
|
|
23
|
+
throw new DeployModuleFileError(result.error);
|
|
27
24
|
}
|
|
28
|
-
throw new
|
|
25
|
+
throw new CheckModuleFileError(`it seems ${REVALIDATED_MODULE_NAME} does not exists in the app ${this.app}`, ["please execute:", `sk generate-pop-config ${this.app}`]);
|
|
29
26
|
}
|
|
30
27
|
}
|
|
31
|
-
exports.default = RevalidatedModuleCheck;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CliService } from "../../../cli";
|
|
2
|
-
import { FileListInterface, InstallResourceFile } from "../../../integration-api";
|
|
3
|
-
import { PostDeployCheckInterface } from "../../deploy-service-model";
|
|
1
|
+
import { CliService } from "../../../cli/index.js";
|
|
2
|
+
import { FileListInterface, InstallResourceFile } from "../../../integration-api/index.js";
|
|
3
|
+
import { PostDeployCheckInterface } from "../../deploy-service-model.js";
|
|
4
4
|
export default class SaveFilesCheck implements PostDeployCheckInterface {
|
|
5
5
|
private fileList;
|
|
6
6
|
private readonly cli;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const safe_1 = require("../../../../helpers/safe");
|
|
5
|
-
const safe_file_error_1 = require("../../error/safe-file-error");
|
|
6
|
-
class SaveFilesCheck {
|
|
1
|
+
import { safe } from "../../../../helpers/safe.js";
|
|
2
|
+
import { SafeFileError } from "../../error/safe-file-error.js";
|
|
3
|
+
export default class SaveFilesCheck {
|
|
7
4
|
fileList;
|
|
8
5
|
cli;
|
|
9
6
|
constructor(fileList, cli) {
|
|
@@ -20,13 +17,13 @@ class SaveFilesCheck {
|
|
|
20
17
|
if (!(await this.cli.confirm(`Changes to localFiles will be saved now. Proceed?`))) {
|
|
21
18
|
return;
|
|
22
19
|
}
|
|
23
|
-
this.cli.startAction("safe changed files");
|
|
24
|
-
const result = await
|
|
20
|
+
this.cli.startAction("POST:DEPLOY:SAVE_FILES", "safe changed files");
|
|
21
|
+
const result = await safe(this.safeFiles(fileList));
|
|
25
22
|
if (result.success === false) {
|
|
26
|
-
this.cli.
|
|
27
|
-
throw new
|
|
23
|
+
this.cli.failAction("POST:DEPLOY:SAVE_FILES");
|
|
24
|
+
throw new SafeFileError(result.error);
|
|
28
25
|
}
|
|
29
|
-
this.cli.
|
|
26
|
+
this.cli.successAction("POST:DEPLOY:SAVE_FILES");
|
|
30
27
|
}
|
|
31
28
|
async safeFiles(fileList) {
|
|
32
29
|
for (const file of fileList) {
|
|
@@ -35,4 +32,3 @@ class SaveFilesCheck {
|
|
|
35
32
|
}
|
|
36
33
|
}
|
|
37
34
|
}
|
|
38
|
-
exports.default = SaveFilesCheck;
|
|
@@ -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 DeviceDetectionChangedCheck {
|
|
5
5
|
private cli;
|
|
6
6
|
private fileList;
|