@speedkit/cli 3.43.2 → 4.0.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 +31 -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/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,19 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
tslib_1.__exportStar(require("./virtual/virtual-file-handler"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./virtual/external-recipe"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./external/external-file-reader"), exports);
|
|
16
|
-
var FILE_TYPE;
|
|
1
|
+
export * from "./struct/customer-config.js";
|
|
2
|
+
export * from "./struct/file.js";
|
|
3
|
+
export * from "./struct/customer-config-file.js";
|
|
4
|
+
export * from "./struct/module-file.js";
|
|
5
|
+
export * from "./struct/install-resource-file.js";
|
|
6
|
+
export * from "./struct/server-config-file.js";
|
|
7
|
+
export * from "./struct/ro-file.js";
|
|
8
|
+
export * from "./struct/virtual-file.js";
|
|
9
|
+
export * from "./virtual/virtual-file-handler.js";
|
|
10
|
+
export * from "./virtual/external-recipe.js";
|
|
11
|
+
export * from "./external/external-file-reader.js";
|
|
12
|
+
export var FILE_TYPE;
|
|
17
13
|
(function (FILE_TYPE) {
|
|
18
14
|
FILE_TYPE["CONFIG_FILE"] = "config";
|
|
19
15
|
FILE_TYPE["INSTALL_FILE"] = "install";
|
|
@@ -22,15 +18,15 @@ var FILE_TYPE;
|
|
|
22
18
|
FILE_TYPE["VIRTUAL_FILE"] = "virtual";
|
|
23
19
|
FILE_TYPE["READONLY_FILE"] = "readonly";
|
|
24
20
|
FILE_TYPE["CUSTOMER_FILE"] = "customer";
|
|
25
|
-
})(FILE_TYPE || (
|
|
26
|
-
|
|
27
|
-
class IntegrationApiContext {
|
|
21
|
+
})(FILE_TYPE || (FILE_TYPE = {}));
|
|
22
|
+
export const DEFAULT_BLOCKED_FOLDERS = ["test", ".local", ".git", ".idea"];
|
|
23
|
+
export class IntegrationApiContext {
|
|
28
24
|
basePath;
|
|
29
25
|
configName;
|
|
30
26
|
whitelist;
|
|
31
27
|
blockedFolders;
|
|
32
28
|
useTestConfig;
|
|
33
|
-
constructor(basePath, configName, whitelist = [], blockedFolders =
|
|
29
|
+
constructor(basePath, configName, whitelist = [], blockedFolders = DEFAULT_BLOCKED_FOLDERS, useTestConfig = false) {
|
|
34
30
|
this.basePath = basePath;
|
|
35
31
|
this.configName = configName;
|
|
36
32
|
this.whitelist = whitelist;
|
|
@@ -38,4 +34,3 @@ class IntegrationApiContext {
|
|
|
38
34
|
this.useTestConfig = useTestConfig;
|
|
39
35
|
}
|
|
40
36
|
}
|
|
41
|
-
exports.IntegrationApiContext = IntegrationApiContext;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import FileReader from "./file-reader";
|
|
2
|
-
import MandatoryFilesValidator from "./validator/mandatory-files-validator";
|
|
3
|
-
import FileWriter from "./file-writer";
|
|
4
|
-
import { FileListInterface, IntegrationApiHandler, VirtualFileConfig } from "./integration-api-model";
|
|
5
|
-
import { VirtualFileHandler } from "./virtual/virtual-file-handler";
|
|
1
|
+
import FileReader from "./file-reader.js";
|
|
2
|
+
import MandatoryFilesValidator from "./validator/mandatory-files-validator.js";
|
|
3
|
+
import FileWriter from "./file-writer.js";
|
|
4
|
+
import { FileListInterface, IntegrationApiHandler, VirtualFileConfig } from "./integration-api-model.js";
|
|
5
|
+
import { VirtualFileHandler } from "./virtual/virtual-file-handler.js";
|
|
6
6
|
export declare class IntegrationApiService {
|
|
7
7
|
private fileReader;
|
|
8
8
|
private virtualFileHandler;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const file_list_1 = tslib_1.__importDefault(require("./file-list"));
|
|
6
|
-
const file_handler_error_1 = require("../deploy/error/file-handler-error");
|
|
7
|
-
class IntegrationApiService {
|
|
1
|
+
import FileList from "./file-list.js";
|
|
2
|
+
import { FileHandlerError } from "../deploy/error/file-handler-error.js";
|
|
3
|
+
export class IntegrationApiService {
|
|
8
4
|
fileReader;
|
|
9
5
|
virtualFileHandler;
|
|
10
6
|
validator;
|
|
@@ -37,7 +33,7 @@ class IntegrationApiService {
|
|
|
37
33
|
}
|
|
38
34
|
async collectFiles() {
|
|
39
35
|
const files = this.fileReader.getFileList();
|
|
40
|
-
const fileList = new
|
|
36
|
+
const fileList = new FileList();
|
|
41
37
|
for (const file of files) {
|
|
42
38
|
fileList.addFile(await this.processFile(file));
|
|
43
39
|
}
|
|
@@ -47,13 +43,11 @@ class IntegrationApiService {
|
|
|
47
43
|
return fileList;
|
|
48
44
|
}
|
|
49
45
|
async processFile(file) {
|
|
50
|
-
for (
|
|
51
|
-
const handler = this.handlers[iterator];
|
|
46
|
+
for (const handler of this.handlers) {
|
|
52
47
|
if (handler.canHandle(file)) {
|
|
53
48
|
return await handler.handle(file);
|
|
54
49
|
}
|
|
55
50
|
}
|
|
56
|
-
throw new
|
|
51
|
+
throw new FileHandlerError(`No handler found for file: ${file}`);
|
|
57
52
|
}
|
|
58
53
|
}
|
|
59
|
-
exports.IntegrationApiService = IntegrationApiService;
|
|
@@ -1,49 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
(
|
|
9
|
-
(0, mocha_1.it)("should have no errors", () => {
|
|
10
|
-
const validator = new customer_config_validator_1.default();
|
|
11
|
-
const customerConfig = new customer_config_1.CustomerConfig("test", ["https://test.dev"], "test.dev", "/wrapper.sw", "/");
|
|
1
|
+
import { expect } from "chai";
|
|
2
|
+
import { describe, it } from "mocha";
|
|
3
|
+
import CustomerConfigValidator from "../validator/customer-config-validator.js";
|
|
4
|
+
import { CustomerConfig } from "../struct/customer-config.js";
|
|
5
|
+
describe("customer_config_validator validate", () => {
|
|
6
|
+
it("should have no errors", () => {
|
|
7
|
+
const validator = new CustomerConfigValidator();
|
|
8
|
+
const customerConfig = new CustomerConfig("test", ["https://test.dev"], "test.dev", "/wrapper.sw", "/");
|
|
12
9
|
validator.validate(customerConfig);
|
|
13
|
-
|
|
10
|
+
expect(true).to.be.true;
|
|
14
11
|
});
|
|
15
|
-
|
|
16
|
-
const validator = new
|
|
17
|
-
const customerConfig = new
|
|
18
|
-
|
|
12
|
+
it("should throw error hasDuplicates", () => {
|
|
13
|
+
const validator = new CustomerConfigValidator();
|
|
14
|
+
const customerConfig = new CustomerConfig("test", ["https://test.dev", "https://test.dev"], "test.dev", "/wrapper.sw", "/");
|
|
15
|
+
expect(() => {
|
|
19
16
|
validator.validate(customerConfig);
|
|
20
17
|
}).to.throw("Duplicate origins found! Remove duplicates and restart deploy!");
|
|
21
18
|
});
|
|
22
|
-
|
|
23
|
-
const validator = new
|
|
24
|
-
const customerConfig = new
|
|
25
|
-
|
|
19
|
+
it("should throw error no origins", () => {
|
|
20
|
+
const validator = new CustomerConfigValidator();
|
|
21
|
+
const customerConfig = new CustomerConfig("test", [], "test.dev", "/wrapper.sw", "/");
|
|
22
|
+
expect(() => {
|
|
26
23
|
validator.validate(customerConfig);
|
|
27
24
|
}).to.throw("No origins were found in local config_customer.json! Add origins and restart deploy!");
|
|
28
25
|
});
|
|
29
|
-
|
|
30
|
-
const validator = new
|
|
31
|
-
const customerConfig = new
|
|
32
|
-
|
|
26
|
+
it("should throw error not having a protocol", () => {
|
|
27
|
+
const validator = new CustomerConfigValidator();
|
|
28
|
+
const customerConfig = new CustomerConfig("test", ["test.dev", "https://test.dev"], "test.dev", "/wrapper.sw", "/");
|
|
29
|
+
expect(() => {
|
|
33
30
|
validator.validate(customerConfig);
|
|
34
31
|
}).to.throw("There was at least one origin configured in the local customer_config.js not having a protocol.");
|
|
35
32
|
});
|
|
36
|
-
|
|
37
|
-
const validator = new
|
|
38
|
-
const customerConfig = new
|
|
39
|
-
|
|
33
|
+
it("should throw error having a path", () => {
|
|
34
|
+
const validator = new CustomerConfigValidator();
|
|
35
|
+
const customerConfig = new CustomerConfig("test", ["https://test.dev/"], "test.dev", "/wrapper.sw", "/");
|
|
36
|
+
expect(() => {
|
|
40
37
|
validator.validate(customerConfig);
|
|
41
38
|
}).to.throw("There was at least one origin having a path. Origin must have the following format: https://domain.tld");
|
|
42
39
|
});
|
|
43
|
-
|
|
44
|
-
const validator = new
|
|
45
|
-
const customerConfig = new
|
|
46
|
-
|
|
40
|
+
it("should throw error appName not start with number", () => {
|
|
41
|
+
const validator = new CustomerConfigValidator();
|
|
42
|
+
const customerConfig = new CustomerConfig("99_test", ["https://test.dev"], "test.dev", "/wrapper.sw", "/");
|
|
43
|
+
expect(() => {
|
|
47
44
|
validator.validate(customerConfig);
|
|
48
45
|
}).to.throw("appName can't start with a number");
|
|
49
46
|
});
|
|
@@ -1,163 +1,160 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
fileList.
|
|
18
|
-
fileList.addFile(new __1.VirtualFile("test2", {}));
|
|
19
|
-
// Assert that our function returned the correct value
|
|
20
|
-
(0, chai_1.expect)(fileList.files.length).to.equal(2);
|
|
1
|
+
import { expect } from "chai";
|
|
2
|
+
import { describe, it } from "mocha";
|
|
3
|
+
import FileList from "../file-list.js";
|
|
4
|
+
import { CustomerConfigFile, FILE_TYPE, VirtualFile, InstallResourceFile, ModuleFile, ServerConfigFile, } from "../index.js";
|
|
5
|
+
describe("fileList addFile", () => {
|
|
6
|
+
it("should have 1 entry", () => {
|
|
7
|
+
const fileList = new FileList();
|
|
8
|
+
fileList.addFile(new VirtualFile("test", {}));
|
|
9
|
+
// Assert that our function returned the correct value
|
|
10
|
+
expect(fileList.files.length).to.equal(1);
|
|
11
|
+
});
|
|
12
|
+
it("should have 2 entries", () => {
|
|
13
|
+
const fileList = new FileList();
|
|
14
|
+
fileList.addFile(new VirtualFile("test", {}));
|
|
15
|
+
fileList.addFile(new VirtualFile("test2", {}));
|
|
16
|
+
// Assert that our function returned the correct value
|
|
17
|
+
expect(fileList.files.length).to.equal(2);
|
|
21
18
|
});
|
|
22
19
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const fileList = new
|
|
26
|
-
fileList.addFile(new
|
|
20
|
+
describe("fileList hasFile", () => {
|
|
21
|
+
it("should return true", () => {
|
|
22
|
+
const fileList = new FileList();
|
|
23
|
+
fileList.addFile(new VirtualFile("test_abcd", {}));
|
|
27
24
|
// Assert that our function returned the correct value
|
|
28
|
-
|
|
25
|
+
expect(fileList.hasFile("test_abcd")).to.equal(true);
|
|
29
26
|
});
|
|
30
|
-
|
|
31
|
-
const fileList = new
|
|
32
|
-
fileList.addFile(new
|
|
27
|
+
it("should return false", () => {
|
|
28
|
+
const fileList = new FileList();
|
|
29
|
+
fileList.addFile(new VirtualFile("test_abcd", {}));
|
|
33
30
|
// Assert that our function returned the correct value
|
|
34
|
-
|
|
31
|
+
expect(fileList.hasFile("test_xyz")).to.equal(false);
|
|
35
32
|
});
|
|
36
33
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const fileList = new
|
|
40
|
-
fileList.addFile(new
|
|
41
|
-
fileList.addFile(new
|
|
42
|
-
fileList.addFile(new
|
|
34
|
+
describe("fileList getByType", () => {
|
|
35
|
+
it("should have 1 entry", () => {
|
|
36
|
+
const fileList = new FileList();
|
|
37
|
+
fileList.addFile(new VirtualFile("test", {}));
|
|
38
|
+
fileList.addFile(new VirtualFile("test2", {}));
|
|
39
|
+
fileList.addFile(new InstallResourceFile("config_test", "/test/config_test.js", "{}", "test"));
|
|
43
40
|
// Assert that our function returned the correct value
|
|
44
|
-
|
|
41
|
+
expect(fileList.getByType(FILE_TYPE.VIRTUAL_FILE).length).to.equal(2);
|
|
45
42
|
});
|
|
46
43
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const fileList = new
|
|
50
|
-
const fileToFind = new
|
|
44
|
+
describe("fileList getByName", () => {
|
|
45
|
+
it("shouldn't find entry", () => {
|
|
46
|
+
const fileList = new FileList();
|
|
47
|
+
const fileToFind = new VirtualFile("test", {});
|
|
51
48
|
fileList.addFile(fileToFind);
|
|
52
|
-
fileList.addFile(new
|
|
49
|
+
fileList.addFile(new VirtualFile("test2", {}));
|
|
53
50
|
// Assert that our function returned the correct value
|
|
54
|
-
|
|
51
|
+
expect(fileList.getByName("test4")).to.equal(undefined);
|
|
55
52
|
});
|
|
56
|
-
|
|
57
|
-
const fileList = new
|
|
58
|
-
const fileToFind = new
|
|
53
|
+
it("should find entry", () => {
|
|
54
|
+
const fileList = new FileList();
|
|
55
|
+
const fileToFind = new VirtualFile("test", {});
|
|
59
56
|
fileList.addFile(fileToFind);
|
|
60
|
-
fileList.addFile(new
|
|
57
|
+
fileList.addFile(new VirtualFile("test2", {}));
|
|
61
58
|
// Assert that our function returned the correct value
|
|
62
|
-
|
|
59
|
+
expect(fileList.getByName("test")).to.equal(fileToFind);
|
|
63
60
|
});
|
|
64
61
|
});
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const fileList = new
|
|
68
|
-
fileList.addFile(new
|
|
69
|
-
fileList.addFile(new
|
|
62
|
+
describe("fileList getInstallResources", () => {
|
|
63
|
+
it("get all installResourceFiles", () => {
|
|
64
|
+
const fileList = new FileList();
|
|
65
|
+
fileList.addFile(new InstallResourceFile("config_test", "/test/config_test.js", "{}", "test"));
|
|
66
|
+
fileList.addFile(new VirtualFile("custom_sw2.js", {}));
|
|
70
67
|
// Assert that our function returned the correct value
|
|
71
|
-
|
|
68
|
+
expect(fileList.getInstallResources().length).to.equal(1);
|
|
72
69
|
});
|
|
73
70
|
});
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const fileList = new
|
|
77
|
-
fileList.addFile(new
|
|
78
|
-
fileList.addFile(new
|
|
71
|
+
describe("fileList getModules", () => {
|
|
72
|
+
it("get all ModuleFiles", () => {
|
|
73
|
+
const fileList = new FileList();
|
|
74
|
+
fileList.addFile(new ModuleFile("deploymentDetection_test", "/test/deploymentDetection_test.es6", "{}", "{}"));
|
|
75
|
+
fileList.addFile(new VirtualFile("custom_sw2.js", {}));
|
|
79
76
|
// Assert that our function returned the correct value
|
|
80
|
-
|
|
77
|
+
expect(fileList.getModules().length).to.equal(1);
|
|
81
78
|
});
|
|
82
79
|
});
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const fileList = new
|
|
86
|
-
fileList.addFile(new
|
|
87
|
-
fileList.addFile(new
|
|
80
|
+
describe("fileList getServerConfig", () => {
|
|
81
|
+
it("get all ServerConfigFiles", () => {
|
|
82
|
+
const fileList = new FileList();
|
|
83
|
+
fileList.addFile(new ServerConfigFile("config_orestes.json", "/test/config_orestes.json", "{}", "{}"));
|
|
84
|
+
fileList.addFile(new VirtualFile("custom_sw2.js", {}));
|
|
88
85
|
// Assert that our function returned the correct value
|
|
89
|
-
|
|
86
|
+
expect(fileList.getServerConfig().name).to.equal("config_orestes.json");
|
|
90
87
|
});
|
|
91
88
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const fileList = new
|
|
95
|
-
fileList.addFile(new
|
|
96
|
-
fileList.addFile(new
|
|
89
|
+
describe("fileList getCustomerConfig", () => {
|
|
90
|
+
it("get all CustomerConfig files", () => {
|
|
91
|
+
const fileList = new FileList();
|
|
92
|
+
fileList.addFile(new CustomerConfigFile("config_customer", "/test/config_customer.json", "{}", {}, "test"));
|
|
93
|
+
fileList.addFile(new VirtualFile("custom_sw2.js", {}));
|
|
97
94
|
// Assert that our function returned the correct value
|
|
98
|
-
|
|
95
|
+
expect(fileList.getCustomerConfig().configName).to.equal("test");
|
|
99
96
|
});
|
|
100
97
|
});
|
|
101
|
-
|
|
102
|
-
const fileList = new
|
|
103
|
-
fileList.addFile(new
|
|
104
|
-
fileList.addFile(new
|
|
105
|
-
fileList.addFile(new
|
|
106
|
-
fileList.addFile(new
|
|
107
|
-
|
|
98
|
+
describe("fileList getTypes", () => {
|
|
99
|
+
const fileList = new FileList();
|
|
100
|
+
fileList.addFile(new CustomerConfigFile("config_customer", "/test/config_customer.json", "{}", {}, "test"));
|
|
101
|
+
fileList.addFile(new VirtualFile("custom_sw.js", {}));
|
|
102
|
+
fileList.addFile(new VirtualFile("custom_sw2.js", {}));
|
|
103
|
+
fileList.addFile(new ModuleFile("deploymentDetection_test", "/test/deploymentDetection_test.es6", "{}", "{}"));
|
|
104
|
+
it("find 3 types", () => {
|
|
108
105
|
// Assert that our function returned the correct value
|
|
109
|
-
|
|
106
|
+
expect(fileList.getTypes().length).to.equal(3);
|
|
110
107
|
});
|
|
111
|
-
|
|
108
|
+
it("has virtualFile", () => {
|
|
112
109
|
// Assert that our function returned the correct value
|
|
113
|
-
|
|
110
|
+
expect(fileList.getTypes()).to.includes(FILE_TYPE.VIRTUAL_FILE);
|
|
114
111
|
});
|
|
115
|
-
|
|
112
|
+
it("has CustomerConfigFile", () => {
|
|
116
113
|
// Assert that our function returned the correct value
|
|
117
|
-
|
|
114
|
+
expect(fileList.getTypes()).to.includes(FILE_TYPE.CUSTOMER_FILE);
|
|
118
115
|
});
|
|
119
|
-
|
|
116
|
+
it("has ModuleFile", () => {
|
|
120
117
|
// Assert that our function returned the correct value
|
|
121
|
-
|
|
118
|
+
expect(fileList.getTypes()).to.includes(FILE_TYPE.MODULE_FILE);
|
|
122
119
|
});
|
|
123
120
|
});
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const fileList = new
|
|
127
|
-
fileList.addFile(new
|
|
128
|
-
fileList.addFile(new
|
|
129
|
-
fileList.addFile(new
|
|
130
|
-
fileList.addFile(new
|
|
121
|
+
describe("fileList filter", () => {
|
|
122
|
+
it("find all files name start with test", () => {
|
|
123
|
+
const fileList = new FileList();
|
|
124
|
+
fileList.addFile(new VirtualFile("test1", {}));
|
|
125
|
+
fileList.addFile(new VirtualFile("test2", {}));
|
|
126
|
+
fileList.addFile(new VirtualFile("test3", {}));
|
|
127
|
+
fileList.addFile(new VirtualFile("config", {}));
|
|
131
128
|
fileList.filter((file) => {
|
|
132
129
|
return file.name.startsWith("test");
|
|
133
130
|
});
|
|
134
131
|
// Assert that our function returned the correct value
|
|
135
|
-
|
|
132
|
+
expect(fileList.files.length).to.equal(3);
|
|
136
133
|
});
|
|
137
134
|
});
|
|
138
|
-
|
|
139
|
-
const fileList = new
|
|
140
|
-
fileList.addFile(new
|
|
141
|
-
fileList.addFile(new
|
|
142
|
-
const fileList2 = new
|
|
143
|
-
fileList2.addFile(new
|
|
144
|
-
fileList2.addFile(new
|
|
135
|
+
describe("fileList concat", () => {
|
|
136
|
+
const fileList = new FileList();
|
|
137
|
+
fileList.addFile(new VirtualFile("test1", {}));
|
|
138
|
+
fileList.addFile(new VirtualFile("test2", {}));
|
|
139
|
+
const fileList2 = new FileList();
|
|
140
|
+
fileList2.addFile(new VirtualFile("config1", {}));
|
|
141
|
+
fileList2.addFile(new VirtualFile("config2", {}));
|
|
145
142
|
// eslint-disable-next-line unicorn/prefer-spread
|
|
146
143
|
fileList.concat(fileList2);
|
|
147
|
-
|
|
148
|
-
|
|
144
|
+
it("check length of two filelists", () => {
|
|
145
|
+
expect(fileList.files.length).to.equal(4);
|
|
149
146
|
});
|
|
150
|
-
|
|
151
|
-
|
|
147
|
+
it("find file in first fileList", () => {
|
|
148
|
+
expect(fileList.hasFile("config2")).to.equal(true);
|
|
152
149
|
});
|
|
153
150
|
});
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const fileList = new
|
|
157
|
-
const file = new
|
|
151
|
+
describe("fileList replace", () => {
|
|
152
|
+
it("check if file was replaced", () => {
|
|
153
|
+
const fileList = new FileList();
|
|
154
|
+
const file = new VirtualFile("test1", {});
|
|
158
155
|
fileList.addFile(file);
|
|
159
|
-
const replace = new
|
|
156
|
+
const replace = new InstallResourceFile("test1", "/test/config_test.js", "replace", "test");
|
|
160
157
|
fileList.replace(replace);
|
|
161
|
-
|
|
158
|
+
expect(fileList.getByName("test1").path).to.equal("/test/config_test.js");
|
|
162
159
|
});
|
|
163
160
|
});
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const mocha_1 = require("mocha");
|
|
6
|
-
const memfs_1 = require("memfs");
|
|
7
|
-
const file_reader_1 = tslib_1.__importDefault(require("../file-reader"));
|
|
1
|
+
import { expect } from "chai";
|
|
2
|
+
import { describe, before, after, it } from "mocha";
|
|
3
|
+
import { fs, vol } from "memfs";
|
|
4
|
+
import FileReader from "../file-reader.js";
|
|
8
5
|
const afterTest = () => {
|
|
9
|
-
|
|
6
|
+
vol.reset();
|
|
10
7
|
};
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
describe("FileReader getFileList ", () => {
|
|
9
|
+
before(() => {
|
|
13
10
|
const customerJson = {
|
|
14
11
|
$schema: "../../sk-typings/customerConfig.schema.json",
|
|
15
12
|
test: {
|
|
@@ -24,7 +21,7 @@ const afterTest = () => {
|
|
|
24
21
|
forceInstall: true,
|
|
25
22
|
},
|
|
26
23
|
};
|
|
27
|
-
|
|
24
|
+
vol.fromNestedJSON({
|
|
28
25
|
"/test_customer": {
|
|
29
26
|
"config_customer.json": `${JSON.stringify(customerJson)}`,
|
|
30
27
|
"config_SpeedKit.js": "skConfig",
|
|
@@ -33,53 +30,53 @@ const afterTest = () => {
|
|
|
33
30
|
},
|
|
34
31
|
});
|
|
35
32
|
});
|
|
36
|
-
|
|
33
|
+
after(afterTest);
|
|
37
34
|
/**
|
|
38
35
|
* default behaviour
|
|
39
36
|
*/
|
|
40
|
-
|
|
37
|
+
it("fileList should include config_SpeedKit.js", () => {
|
|
41
38
|
// @ts-expect-error fs is not compatible
|
|
42
|
-
const fileReader = new
|
|
39
|
+
const fileReader = new FileReader(fs, "test", "test_customer", [], []);
|
|
43
40
|
const fileList = fileReader.getFileList("/test_customer");
|
|
44
|
-
|
|
41
|
+
expect(fileList).to.include("/test_customer/config_SpeedKit.js");
|
|
45
42
|
});
|
|
46
43
|
/**
|
|
47
44
|
* default behaviour
|
|
48
45
|
*/
|
|
49
|
-
|
|
46
|
+
it("fileList should not include test.js", () => {
|
|
50
47
|
// @ts-expect-error fs is not compatible
|
|
51
|
-
const fileReader = new
|
|
48
|
+
const fileReader = new FileReader(fs, "test", "test_customer", [], []);
|
|
52
49
|
const fileList = fileReader.getFileList("/test_customer");
|
|
53
|
-
|
|
50
|
+
expect(fileList).to.not.include("/.local/test.js");
|
|
54
51
|
});
|
|
55
52
|
/**
|
|
56
53
|
* add magic to blocked folders
|
|
57
54
|
*/
|
|
58
|
-
|
|
59
|
-
const fileReader = new
|
|
55
|
+
it("fileList should not include magic/test3.js", () => {
|
|
56
|
+
const fileReader = new FileReader(
|
|
60
57
|
// @ts-expect-error fs is not compatible
|
|
61
|
-
|
|
58
|
+
fs, "test", "test_customer", [], ["magic"]);
|
|
62
59
|
const fileList = fileReader.getFileList("/test_customer");
|
|
63
|
-
|
|
60
|
+
expect(fileList).to.not.include("/magic/test3.js");
|
|
64
61
|
});
|
|
65
62
|
/**
|
|
66
63
|
* add asdf to whitelist
|
|
67
64
|
*/
|
|
68
|
-
|
|
69
|
-
const fileReader = new
|
|
65
|
+
it("fileList should include config_customer.json", () => {
|
|
66
|
+
const fileReader = new FileReader(
|
|
70
67
|
// @ts-expect-error fs is not compatible
|
|
71
|
-
|
|
68
|
+
fs, "test", "test_customer", ["asdf"], ["magic"]);
|
|
72
69
|
const fileList = fileReader.getFileList("/test_customer");
|
|
73
|
-
|
|
70
|
+
expect(fileList).to.include("/test_customer/config_customer.json");
|
|
74
71
|
});
|
|
75
72
|
/**
|
|
76
73
|
* if whitelist is set, only files from whitelist or config_SpeedKit.js should be returned
|
|
77
74
|
*/
|
|
78
|
-
|
|
79
|
-
const fileReader = new
|
|
75
|
+
it("fileList should not include config_SpeedKit.js", () => {
|
|
76
|
+
const fileReader = new FileReader(
|
|
80
77
|
// @ts-expect-error fs is not compatible
|
|
81
|
-
|
|
78
|
+
fs, "test", "test_customer", ["asdf"], ["magic"]);
|
|
82
79
|
const fileList = fileReader.getFileList("/test_customer");
|
|
83
|
-
|
|
80
|
+
expect(fileList).to.not.include("/test_customer/config_SpeedKit.js");
|
|
84
81
|
});
|
|
85
82
|
});
|