@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,21 +1,18 @@
|
|
|
1
1
|
import { PluginBuild, LogLevel } from "esbuild";
|
|
2
|
-
export type BundleEntryPoints =
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
export type BundleBasePaths = {
|
|
6
|
-
[basePath: string]: string;
|
|
7
|
-
};
|
|
2
|
+
export type BundleEntryPoints = Record<string, string>;
|
|
3
|
+
export type BundleBasePaths = Record<string, string>;
|
|
8
4
|
export declare class BundleService {
|
|
9
|
-
|
|
5
|
+
private moduleDiscoveryDir;
|
|
6
|
+
constructor(moduleDiscoveryDir: string);
|
|
7
|
+
bundle({ entryPoints, basePaths, define, target, minify, logLevel, alias, platform, }: {
|
|
10
8
|
entryPoints: BundleEntryPoints;
|
|
11
|
-
basePaths
|
|
9
|
+
basePaths?: BundleBasePaths;
|
|
12
10
|
target?: string | string[];
|
|
13
11
|
minify?: boolean;
|
|
14
|
-
define?:
|
|
15
|
-
|
|
16
|
-
};
|
|
12
|
+
define?: Record<string, string>;
|
|
13
|
+
alias?: Record<string, string>;
|
|
17
14
|
logLevel?: LogLevel;
|
|
18
|
-
platform?:
|
|
15
|
+
platform?: "browser" | "node" | "neutral";
|
|
19
16
|
}): Promise<string>;
|
|
20
17
|
private entryPointsPlugin;
|
|
21
18
|
baqendPlugin(basePaths: BundleBasePaths): {
|
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const node_url_1 = require("node:url");
|
|
8
|
-
const bundle_resolve_error_1 = require("./error/bundle-resolve-error");
|
|
9
|
-
const bundle_fetch_error_1 = require("./error/bundle-fetch-error");
|
|
1
|
+
import { build } from "esbuild";
|
|
2
|
+
import fetch from "node-fetch";
|
|
3
|
+
import { URL } from "node:url";
|
|
4
|
+
import { BundleResolveError } from "./error/bundle-resolve-error.js";
|
|
5
|
+
import { BundleFetchError } from "./error/bundle-fetch-error.js";
|
|
6
|
+
import { resolve } from "node:path";
|
|
10
7
|
const importCache = {};
|
|
11
|
-
class BundleService {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
export class BundleService {
|
|
9
|
+
moduleDiscoveryDir;
|
|
10
|
+
constructor(moduleDiscoveryDir) {
|
|
11
|
+
this.moduleDiscoveryDir = moduleDiscoveryDir;
|
|
12
|
+
}
|
|
13
|
+
async bundle({ entryPoints, basePaths, define, target = "es5", minify = true, logLevel = "silent", alias = {}, platform, }) {
|
|
14
|
+
const plugins = [];
|
|
15
|
+
if (basePaths && Object.keys(basePaths).length > 0) {
|
|
16
|
+
plugins.push(this.baqendPlugin(basePaths));
|
|
17
|
+
}
|
|
18
|
+
if (entryPoints) {
|
|
19
|
+
plugins.push(this.entryPointsPlugin(entryPoints));
|
|
20
|
+
}
|
|
21
|
+
const result = await build({
|
|
22
|
+
plugins: plugins,
|
|
18
23
|
bundle: true,
|
|
19
24
|
target,
|
|
20
25
|
define,
|
|
@@ -22,7 +27,9 @@ class BundleService {
|
|
|
22
27
|
minify,
|
|
23
28
|
outdir: "out",
|
|
24
29
|
entryPoints: Object.keys(entryPoints),
|
|
30
|
+
platform: platform || "neutral",
|
|
25
31
|
logLevel,
|
|
32
|
+
alias,
|
|
26
33
|
});
|
|
27
34
|
return result.outputFiles
|
|
28
35
|
.map((outputFile) => outputFile.text)
|
|
@@ -30,23 +37,27 @@ class BundleService {
|
|
|
30
37
|
.trim();
|
|
31
38
|
}
|
|
32
39
|
entryPointsPlugin(entryPoints) {
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
41
|
+
const me = this;
|
|
33
42
|
return {
|
|
34
43
|
name: "entryPoints",
|
|
35
44
|
setup(build) {
|
|
36
45
|
build.onResolve({ filter: /.*/ }, (arguments_) => {
|
|
37
|
-
if (
|
|
38
|
-
|
|
46
|
+
if (entryPoints[arguments_.path]) {
|
|
47
|
+
return {
|
|
48
|
+
path: arguments_.path,
|
|
49
|
+
namespace: "entryPoint",
|
|
50
|
+
};
|
|
39
51
|
}
|
|
40
|
-
return {
|
|
41
|
-
path: arguments_.path,
|
|
42
|
-
namespace: "entryPoint",
|
|
43
|
-
};
|
|
44
52
|
});
|
|
45
53
|
build.onLoad({ filter: /.*/, namespace: "entryPoint" }, (arguments_) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
54
|
+
if (entryPoints[arguments_.path]) {
|
|
55
|
+
return {
|
|
56
|
+
contents: entryPoints[arguments_.path],
|
|
57
|
+
loader: "js",
|
|
58
|
+
resolveDir: resolve(me?.moduleDiscoveryDir),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
50
61
|
});
|
|
51
62
|
},
|
|
52
63
|
};
|
|
@@ -58,9 +69,9 @@ class BundleService {
|
|
|
58
69
|
setup(build) {
|
|
59
70
|
build.onResolve({ filter }, (arguments_) => {
|
|
60
71
|
const [base, path] = arguments_.path.split("/", 2);
|
|
61
|
-
const url = new
|
|
72
|
+
const url = new URL(path, basePaths[base]).toString();
|
|
62
73
|
if (!url.startsWith(basePaths[base])) {
|
|
63
|
-
throw new
|
|
74
|
+
throw new BundleResolveError(`Importing ${path} failed. Can't resolve the path`);
|
|
64
75
|
}
|
|
65
76
|
return {
|
|
66
77
|
path: url,
|
|
@@ -68,7 +79,7 @@ class BundleService {
|
|
|
68
79
|
};
|
|
69
80
|
});
|
|
70
81
|
build.onResolve({ filter: /.*/, namespace: "baqend-url" }, (arguments_) => ({
|
|
71
|
-
path: new
|
|
82
|
+
path: new URL(arguments_.path, arguments_.importer).toString(),
|
|
72
83
|
namespace: arguments_.namespace,
|
|
73
84
|
}));
|
|
74
85
|
build.onLoad({ filter: /.*/, namespace: "baqend-url" }, async (arguments_) => {
|
|
@@ -76,9 +87,9 @@ class BundleService {
|
|
|
76
87
|
if (importCache[url]) {
|
|
77
88
|
return { contents: importCache[url] };
|
|
78
89
|
}
|
|
79
|
-
const fetched = await (
|
|
90
|
+
const fetched = await fetch(url);
|
|
80
91
|
if (!fetched.ok) {
|
|
81
|
-
throw new
|
|
92
|
+
throw new BundleFetchError(`Importing ${url} failed with error ${fetched.status}`);
|
|
82
93
|
}
|
|
83
94
|
let text = await fetched.text();
|
|
84
95
|
text = text.replace("window.SpeedKit=window.SpeedKit||{},window.SpeedKit.plugins=window.SpeedKit.plugins||{},window.SpeedKit.plugins.", "export var ");
|
|
@@ -89,4 +100,3 @@ class BundleService {
|
|
|
89
100
|
};
|
|
90
101
|
}
|
|
91
102
|
}
|
|
92
|
-
exports.BundleService = BundleService;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.BundleFetchError = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
-
class BundleFetchError extends application_error_1.default {
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
|
+
export class BundleFetchError extends ApplicationError {
|
|
7
3
|
}
|
|
8
|
-
exports.BundleFetchError = BundleFetchError;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.BundleResolveError = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
-
class BundleResolveError extends application_error_1.default {
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
2
|
+
export class BundleResolveError extends ApplicationError {
|
|
7
3
|
}
|
|
8
|
-
exports.BundleResolveError = BundleResolveError;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./bundle-service-factory";
|
|
2
|
-
export * from "./bundle-service";
|
|
1
|
+
export * from "./bundle-service-factory.js";
|
|
2
|
+
export * from "./bundle-service.js";
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./bundle-service-factory"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./bundle-service"), exports);
|
|
1
|
+
export * from "./bundle-service-factory.js";
|
|
2
|
+
export * from "./bundle-service.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CliService } from "./cli-service";
|
|
2
|
-
import { CliContext } from "./cli-service-model";
|
|
1
|
+
import { CliService } from "./cli-service.js";
|
|
2
|
+
import { CliContext } from "./cli-service-model.js";
|
|
3
3
|
export declare class CliServiceFactory {
|
|
4
4
|
private context?;
|
|
5
5
|
service?: CliService;
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const cli_service_1 = require("./cli-service");
|
|
5
|
-
const cli_service_model_1 = require("./cli-service-model");
|
|
6
|
-
class CliServiceFactory {
|
|
1
|
+
import { CliService } from "./cli-service.js";
|
|
2
|
+
import { CliContext } from "./cli-service-model.js";
|
|
3
|
+
export class CliServiceFactory {
|
|
7
4
|
context;
|
|
8
5
|
service = undefined;
|
|
9
6
|
constructor(context) {
|
|
10
7
|
this.context = context;
|
|
11
8
|
if (!context) {
|
|
12
|
-
this.context = new
|
|
9
|
+
this.context = new CliContext(false);
|
|
13
10
|
}
|
|
14
11
|
}
|
|
15
12
|
getService() {
|
|
16
|
-
if (!(this.service instanceof
|
|
17
|
-
this.service = new
|
|
13
|
+
if (!(this.service instanceof CliService)) {
|
|
14
|
+
this.service = new CliService(this.context.quiet);
|
|
18
15
|
}
|
|
19
16
|
return this.service;
|
|
20
17
|
}
|
|
21
18
|
}
|
|
22
|
-
exports.CliServiceFactory = CliServiceFactory;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { table } from "@oclif/core/lib/cli-ux/styled/table";
|
|
2
1
|
import { Options } from "cli-progress";
|
|
3
|
-
import chalk from "chalk";
|
|
4
2
|
import { ExecSyncOptions } from "node:child_process";
|
|
3
|
+
import { ChalkInstance } from "chalk";
|
|
5
4
|
export declare class CliContext {
|
|
6
5
|
readonly quiet: boolean;
|
|
7
6
|
constructor(quiet?: boolean);
|
|
@@ -11,14 +10,27 @@ export declare enum CliActionStatus {
|
|
|
11
10
|
FAILED = "failed",
|
|
12
11
|
SKIPPED = "skipped"
|
|
13
12
|
}
|
|
13
|
+
export interface CliTableColumn<T> {
|
|
14
|
+
header?: string;
|
|
15
|
+
extended?: boolean;
|
|
16
|
+
minWidth?: number;
|
|
17
|
+
get?(row: T): unknown;
|
|
18
|
+
}
|
|
19
|
+
export type CliTableColumns<T extends Record<string, unknown>> = Record<string, Partial<CliTableColumn<T>>>;
|
|
20
|
+
export interface CliTableOptions {
|
|
21
|
+
sort?: string;
|
|
22
|
+
filter?: string;
|
|
23
|
+
extended?: boolean;
|
|
24
|
+
"no-header"?: boolean;
|
|
25
|
+
"no-truncate"?: boolean;
|
|
26
|
+
}
|
|
14
27
|
export interface CliServiceInterface {
|
|
15
|
-
style:
|
|
28
|
+
style: ChalkInstance;
|
|
16
29
|
readonly quiet: boolean;
|
|
17
30
|
code(code: string, buffered?: boolean): void;
|
|
18
31
|
codeStyle(code: string): string;
|
|
19
32
|
comment(message: string, buffered?: boolean): void;
|
|
20
33
|
confirm(message: string, defaultAnswer: boolean): Promise<boolean>;
|
|
21
|
-
endAction(status?: CliActionStatus): void;
|
|
22
34
|
exit(code: number): void;
|
|
23
35
|
prompt(message: string, options?: {
|
|
24
36
|
defaultAnswer?: any;
|
|
@@ -32,10 +44,13 @@ export interface CliServiceInterface {
|
|
|
32
44
|
description?: string;
|
|
33
45
|
}[]): Promise<T[]>;
|
|
34
46
|
spacer(): void;
|
|
35
|
-
startAction(message: string): void;
|
|
47
|
+
startAction(name: string, message: string): void;
|
|
48
|
+
endAction(name: string, message?: string): void;
|
|
49
|
+
successAction(name: string, message?: string): void;
|
|
50
|
+
failAction(name: string, message?: string): void;
|
|
36
51
|
startProgress(total: number, start?: number, payload?: object, config?: Options): void;
|
|
37
52
|
stopProgress(): void;
|
|
38
|
-
table<T extends Record<string, unknown>>(data: T[], columns:
|
|
53
|
+
table<T extends Record<string, unknown>>(data: T[], columns: CliTableColumns<T>, options?: CliTableOptions): void;
|
|
39
54
|
updateProgress(current: number, payload?: object): void;
|
|
40
55
|
write(message: string, buffered?: boolean): void;
|
|
41
56
|
writeBuffer(): void;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CliActionStatus = exports.CliContext = void 0;
|
|
4
|
-
class CliContext {
|
|
1
|
+
export class CliContext {
|
|
5
2
|
quiet;
|
|
6
3
|
constructor(quiet = false) {
|
|
7
4
|
this.quiet = quiet;
|
|
8
5
|
}
|
|
9
6
|
}
|
|
10
|
-
|
|
11
|
-
var CliActionStatus;
|
|
7
|
+
export var CliActionStatus;
|
|
12
8
|
(function (CliActionStatus) {
|
|
13
9
|
CliActionStatus["COMPLETED"] = "completed";
|
|
14
10
|
CliActionStatus["FAILED"] = "failed";
|
|
15
11
|
CliActionStatus["SKIPPED"] = "skipped";
|
|
16
|
-
})(CliActionStatus || (
|
|
12
|
+
})(CliActionStatus || (CliActionStatus = {}));
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { table } from "@oclif/core/lib/cli-ux/styled/table";
|
|
1
|
+
import { ChalkInstance } from "chalk";
|
|
3
2
|
import { Options } from "cli-progress";
|
|
4
|
-
import {
|
|
3
|
+
import { CliServiceInterface, CliTableColumns } from "./cli-service-model.js";
|
|
5
4
|
import { ExecSyncOptions } from "node:child_process";
|
|
6
5
|
export declare class CliService implements CliServiceInterface {
|
|
7
6
|
readonly quiet: boolean;
|
|
8
|
-
style:
|
|
7
|
+
style: ChalkInstance;
|
|
9
8
|
private buffer;
|
|
10
9
|
private progressBar?;
|
|
10
|
+
private spinners;
|
|
11
11
|
constructor(quiet?: boolean);
|
|
12
12
|
code(code: string, buffered?: boolean): void;
|
|
13
13
|
codeStyle(code: string): string;
|
|
14
14
|
comment(message: string, buffered?: boolean): void;
|
|
15
15
|
confirm(message: string, defaultAnswer?: boolean): Promise<boolean>;
|
|
16
|
-
endAction(status?: CliActionStatus): void;
|
|
17
16
|
exit(code?: number): void;
|
|
18
17
|
prompt(message: string, options?: {
|
|
19
18
|
defaultAnswer?: any;
|
|
@@ -27,11 +26,14 @@ export declare class CliService implements CliServiceInterface {
|
|
|
27
26
|
description?: string;
|
|
28
27
|
}[]): Promise<T[]>;
|
|
29
28
|
spacer(): void;
|
|
30
|
-
startAction(message: string): void;
|
|
29
|
+
startAction(name: string, message: string): void;
|
|
30
|
+
endAction(name: string, message?: string): void;
|
|
31
|
+
failAction(name: string, message?: string): void;
|
|
32
|
+
successAction(name: string, message?: string): void;
|
|
31
33
|
startProgress(total: number, start?: number, payload?: object, config?: Options): void;
|
|
32
|
-
stopProgress(): void;
|
|
33
|
-
table<T extends Record<string, unknown>>(data: T[], columns: table.Columns<T>, options?: table.Options): void;
|
|
34
34
|
updateProgress(current: number, payload?: object): void;
|
|
35
|
+
stopProgress(): void;
|
|
36
|
+
table<T extends Record<string, unknown>>(data: T[], columns: CliTableColumns<T>): void;
|
|
35
37
|
write(message: string, buffered?: boolean): void;
|
|
36
38
|
writeBuffer(): void;
|
|
37
39
|
writeError(message: string, buffered?: boolean): void;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const node_child_process_1 = require("node:child_process");
|
|
11
|
-
const application_error_1 = tslib_1.__importDefault(require("../error-handling/error/application-error"));
|
|
12
|
-
class CliService {
|
|
1
|
+
import { checkbox, confirm, input, select } from "@inquirer/prompts";
|
|
2
|
+
import { Chalk } from "chalk";
|
|
3
|
+
import Table from "tty-table";
|
|
4
|
+
import { Presets, SingleBar } from "cli-progress";
|
|
5
|
+
import Spinnies from "spinnies";
|
|
6
|
+
import { safe } from "../../helpers/safe.js";
|
|
7
|
+
import { execSync } from "node:child_process";
|
|
8
|
+
import ApplicationError from "../error-handling/error/application-error.js";
|
|
9
|
+
export class CliService {
|
|
13
10
|
quiet;
|
|
14
|
-
style
|
|
11
|
+
style;
|
|
15
12
|
buffer = [];
|
|
16
13
|
progressBar;
|
|
14
|
+
spinners;
|
|
17
15
|
constructor(quiet = false) {
|
|
18
16
|
this.quiet = quiet;
|
|
17
|
+
this.spinners = new Spinnies();
|
|
18
|
+
this.style = new Chalk();
|
|
19
19
|
}
|
|
20
20
|
code(code, buffered = false) {
|
|
21
21
|
code = ` ${code} `;
|
|
@@ -23,7 +23,7 @@ class CliService {
|
|
|
23
23
|
this.buffer.push(this.style.bgBlack.white(code));
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
console.log(this.style.bgBlack.white(code));
|
|
27
27
|
}
|
|
28
28
|
codeStyle(code) {
|
|
29
29
|
const padding = " ";
|
|
@@ -40,42 +40,20 @@ class CliService {
|
|
|
40
40
|
if (this.quiet) {
|
|
41
41
|
return defaultAnswer;
|
|
42
42
|
}
|
|
43
|
-
return
|
|
43
|
+
return confirm({
|
|
44
44
|
default: defaultAnswer,
|
|
45
45
|
message: this.getFormattedMessage(message),
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
endAction(status) {
|
|
49
|
-
if (this.quiet) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
switch (status) {
|
|
53
|
-
case cli_service_model_1.CliActionStatus.COMPLETED: {
|
|
54
|
-
core_1.ux.action.stop(this.style.green(cli_service_model_1.CliActionStatus.COMPLETED));
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
case cli_service_model_1.CliActionStatus.FAILED: {
|
|
58
|
-
core_1.ux.action.stop(this.style.red(cli_service_model_1.CliActionStatus.FAILED));
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
case cli_service_model_1.CliActionStatus.SKIPPED: {
|
|
62
|
-
core_1.ux.action.stop(this.style.yellow(cli_service_model_1.CliActionStatus.SKIPPED));
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
default: {
|
|
66
|
-
core_1.ux.action.stop();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
48
|
exit(code = 0) {
|
|
71
|
-
|
|
49
|
+
process.exit(code);
|
|
72
50
|
}
|
|
73
51
|
async prompt(message, options) {
|
|
74
52
|
if (this.quiet) {
|
|
75
53
|
return options?.defaultAnswer || "";
|
|
76
54
|
}
|
|
77
55
|
const { defaultAnswer, validator } = options;
|
|
78
|
-
return
|
|
56
|
+
return input({
|
|
79
57
|
default: defaultAnswer,
|
|
80
58
|
message: this.getFormattedMessage(message),
|
|
81
59
|
validate: (input) => {
|
|
@@ -90,7 +68,7 @@ class CliService {
|
|
|
90
68
|
});
|
|
91
69
|
}
|
|
92
70
|
async select(message, choices, defaultValue) {
|
|
93
|
-
return
|
|
71
|
+
return select({
|
|
94
72
|
choices,
|
|
95
73
|
default: defaultValue,
|
|
96
74
|
message: this.getFormattedMessage(message),
|
|
@@ -100,54 +78,80 @@ class CliService {
|
|
|
100
78
|
if (this.quiet) {
|
|
101
79
|
return choices.filter((c) => c.checked).map((c) => c.value);
|
|
102
80
|
}
|
|
103
|
-
return
|
|
81
|
+
return checkbox({
|
|
104
82
|
choices,
|
|
105
83
|
message: this.getFormattedMessage(message),
|
|
106
84
|
});
|
|
107
85
|
}
|
|
108
86
|
spacer() {
|
|
109
|
-
|
|
87
|
+
console.log("");
|
|
110
88
|
}
|
|
111
|
-
startAction(message) {
|
|
89
|
+
startAction(name, message) {
|
|
112
90
|
if (this.quiet) {
|
|
113
91
|
return;
|
|
114
92
|
}
|
|
115
|
-
|
|
93
|
+
this.spinners.add(name, { text: message });
|
|
94
|
+
}
|
|
95
|
+
endAction(name, message) {
|
|
96
|
+
if (this.quiet || !this.spinners.pick(name)) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
this.spinners.update(name, { status: "stopped", text: message });
|
|
100
|
+
}
|
|
101
|
+
failAction(name, message) {
|
|
102
|
+
if (this.quiet || !this.spinners.pick(name)) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
this.spinners.fail(name, { text: message });
|
|
106
|
+
}
|
|
107
|
+
successAction(name, message) {
|
|
108
|
+
if (this.quiet || !this.spinners.pick(name)) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
this.spinners.succeed(name, { text: message, succeedColor: "white" });
|
|
116
112
|
}
|
|
117
113
|
startProgress(total, start = 0, payload, config) {
|
|
118
114
|
if (this.quiet) {
|
|
119
115
|
return;
|
|
120
116
|
}
|
|
121
|
-
this.progressBar =
|
|
117
|
+
this.progressBar = new SingleBar(config ?? {}, Presets.shades_classic);
|
|
122
118
|
this.progressBar.start(total, start, payload);
|
|
123
119
|
}
|
|
120
|
+
updateProgress(current, payload) {
|
|
121
|
+
if (this.quiet || !this.progressBar) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
this.progressBar.update(current, payload);
|
|
125
|
+
}
|
|
124
126
|
stopProgress() {
|
|
125
|
-
if (this.quiet) {
|
|
127
|
+
if (this.quiet || !this.progressBar || !this.progressBar.isActive) {
|
|
126
128
|
return;
|
|
127
129
|
}
|
|
128
130
|
this.progressBar.stop();
|
|
129
131
|
}
|
|
130
|
-
table(data, columns
|
|
132
|
+
table(data, columns) {
|
|
131
133
|
this.spacer();
|
|
132
|
-
|
|
134
|
+
const header = Object.entries(columns).map(([key, col]) => ({
|
|
135
|
+
value: key,
|
|
136
|
+
alias: col?.header,
|
|
137
|
+
align: "left",
|
|
138
|
+
headerAlign: "left",
|
|
139
|
+
}));
|
|
140
|
+
const rows = data.map((row) => Object.entries(columns).map(([key, col]) => String(col?.get ? col.get(row) : (row[key] ?? ""))));
|
|
141
|
+
const t = Table(header, rows, { compact: true });
|
|
142
|
+
console.log(t.render());
|
|
133
143
|
this.spacer();
|
|
134
144
|
}
|
|
135
|
-
updateProgress(current, payload) {
|
|
136
|
-
if (this.quiet) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
this.progressBar.update(current, payload);
|
|
140
|
-
}
|
|
141
145
|
write(message, buffered = false) {
|
|
142
146
|
if (buffered) {
|
|
143
147
|
this.buffer.push(this.style.white(message));
|
|
144
148
|
return;
|
|
145
149
|
}
|
|
146
|
-
|
|
150
|
+
console.log(message);
|
|
147
151
|
}
|
|
148
152
|
writeBuffer() {
|
|
149
|
-
|
|
150
|
-
|
|
153
|
+
console.log(this.buffer.join(`\n`));
|
|
154
|
+
console.log();
|
|
151
155
|
this.buffer = [];
|
|
152
156
|
}
|
|
153
157
|
writeError(message, buffered = false) {
|
|
@@ -172,11 +176,11 @@ class CliService {
|
|
|
172
176
|
this.write(this.style.yellow(message));
|
|
173
177
|
}
|
|
174
178
|
execSync(command, options) {
|
|
175
|
-
const result =
|
|
176
|
-
return
|
|
179
|
+
const result = safe(() => {
|
|
180
|
+
return execSync(`${command}`, options).toString();
|
|
177
181
|
});
|
|
178
182
|
if (result.success !== true) {
|
|
179
|
-
throw new
|
|
183
|
+
throw new ApplicationError(result.error, [`running ${command}`]);
|
|
180
184
|
}
|
|
181
185
|
return result.data;
|
|
182
186
|
}
|
|
@@ -184,4 +188,3 @@ class CliService {
|
|
|
184
188
|
return `${this.style.bold(questionText)}`;
|
|
185
189
|
}
|
|
186
190
|
}
|
|
187
|
-
exports.CliService = CliService;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./cli-service";
|
|
2
|
-
export * from "./cli-service-model";
|
|
3
|
-
export * from "./cli-service-factory";
|
|
1
|
+
export * from "./cli-service.js";
|
|
2
|
+
export * from "./cli-service-model.js";
|
|
3
|
+
export * from "./cli-service-factory.js";
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
tslib_1.__exportStar(require("./cli-service"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./cli-service-model"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./cli-service-factory"), exports);
|
|
1
|
+
export * from "./cli-service.js";
|
|
2
|
+
export * from "./cli-service-model.js";
|
|
3
|
+
export * from "./cli-service-factory.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EntityManager } from "baqend";
|
|
2
|
-
import { EntityManagerFactory } from "./entity-manager-factory";
|
|
3
|
-
import { RequestExtensionInterface } from "./";
|
|
2
|
+
import { EntityManagerFactory } from "./entity-manager-factory.js";
|
|
3
|
+
import { RequestExtensionInterface } from "./index.js";
|
|
4
4
|
export declare class Client {
|
|
5
5
|
private readonly agent;
|
|
6
6
|
private readonly app;
|