@speedkit/cli 3.43.1 → 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 +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/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 +7 -12
- 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,10 +1,10 @@
|
|
|
1
|
-
import DeployHandlerInterface from "../interface/deploy-handler-interface";
|
|
2
|
-
import { DiffService } from "../../diff";
|
|
3
|
-
import { CliService } from "../../cli";
|
|
4
|
-
import InstallResourceBuilder from "../builder/install-resource-builder";
|
|
5
|
-
import DeletedFileCheck from "./install-resource-modifier/deleted-file-check";
|
|
6
|
-
import { CustomerConfig, FILE_TYPE, InstallResourceInterface } from "../../integration-api";
|
|
7
|
-
import { ConfigApiService } from "../../config-api";
|
|
1
|
+
import DeployHandlerInterface from "../interface/deploy-handler-interface.js";
|
|
2
|
+
import { DiffService } from "../../diff/index.js";
|
|
3
|
+
import { CliService } from "../../cli/index.js";
|
|
4
|
+
import InstallResourceBuilder from "../builder/install-resource-builder.js";
|
|
5
|
+
import DeletedFileCheck from "./install-resource-modifier/deleted-file-check.js";
|
|
6
|
+
import { CustomerConfig, FILE_TYPE, InstallResourceInterface } from "../../integration-api/index.js";
|
|
7
|
+
import { ConfigApiService } from "../../config-api/index.js";
|
|
8
8
|
export default class InstallResourceHandler implements DeployHandlerInterface {
|
|
9
9
|
private readonly customer;
|
|
10
10
|
private readonly configApi;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const integration_api_1 = require("../../integration-api");
|
|
6
|
-
const safe_1 = require("../../../helpers/safe");
|
|
7
|
-
const clipboardy_cjs_1 = tslib_1.__importDefault(require("clipboardy-cjs"));
|
|
8
|
-
class InstallResourceHandler {
|
|
1
|
+
import { FILE_TYPE, } from "../../integration-api/index.js";
|
|
2
|
+
import { safe } from "../../../helpers/safe.js";
|
|
3
|
+
import clipboardy from "clipboardy";
|
|
4
|
+
export default class InstallResourceHandler {
|
|
9
5
|
customer;
|
|
10
6
|
configApi;
|
|
11
7
|
configName;
|
|
@@ -23,7 +19,7 @@ class InstallResourceHandler {
|
|
|
23
19
|
this.deletedFilesChecker = deletedFilesChecker;
|
|
24
20
|
}
|
|
25
21
|
canHandle(type) {
|
|
26
|
-
return type ===
|
|
22
|
+
return type === FILE_TYPE.INSTALL_FILE;
|
|
27
23
|
}
|
|
28
24
|
async handle(files) {
|
|
29
25
|
const installResource = await this.configApi.getActiveInstall(this.configName);
|
|
@@ -54,25 +50,25 @@ class InstallResourceHandler {
|
|
|
54
50
|
}
|
|
55
51
|
const install = await this.getInstallResource();
|
|
56
52
|
await this.deletedFilesChecker.checkForDeletedLocalFiles(install);
|
|
57
|
-
this.cli.startAction("update installResource");
|
|
58
|
-
const updateResult = await
|
|
53
|
+
this.cli.startAction("DEPLOY:UPDATE:INSTALL_RESOURCE", "update installResource");
|
|
54
|
+
const updateResult = await safe(this.configApi.setInstall(install));
|
|
59
55
|
if (updateResult.success === false) {
|
|
60
|
-
this.cli.
|
|
56
|
+
this.cli.failAction("DEPLOY:UPDATE:INSTALL_RESOURCE");
|
|
61
57
|
throw updateResult.errorObj;
|
|
62
58
|
}
|
|
63
|
-
this.cli.
|
|
59
|
+
this.cli.successAction("DEPLOY:UPDATE:INSTALL_RESOURCE");
|
|
64
60
|
if (!(await this.cli.confirm("Activate new installation?"))) {
|
|
65
61
|
if (await this.cli.confirm("Activate as testing installation instead?")) {
|
|
66
|
-
this.cli.startAction("activate testing installResource");
|
|
67
|
-
const activateTestingResult = await
|
|
62
|
+
this.cli.startAction("DEPLOY:ACTIVATE:INSTALL_RESOURCE_TEST", "activate testing installResource");
|
|
63
|
+
const activateTestingResult = await safe(this.configApi.activateInstallTesting(install));
|
|
68
64
|
if (activateTestingResult.success === false) {
|
|
69
|
-
this.cli.
|
|
65
|
+
this.cli.failAction("DEPLOY:ACTIVATE:INSTALL_RESOURCE_TEST", activateTestingResult.error);
|
|
70
66
|
throw activateTestingResult.errorObj;
|
|
71
67
|
}
|
|
72
|
-
this.cli.
|
|
68
|
+
this.cli.successAction("DEPLOY:ACTIVATE:INSTALL_RESOURCE_TEST");
|
|
73
69
|
const debugParameter = `?debugSpeedKit=${install.id.split("/").pop()}`;
|
|
74
70
|
try {
|
|
75
|
-
|
|
71
|
+
clipboardy.writeSync(debugParameter);
|
|
76
72
|
this.cli.writeSuccess("Query parameter to activate the testing installation has been copied to the clipboard 📋");
|
|
77
73
|
}
|
|
78
74
|
catch {
|
|
@@ -81,13 +77,13 @@ class InstallResourceHandler {
|
|
|
81
77
|
}
|
|
82
78
|
return;
|
|
83
79
|
}
|
|
84
|
-
this.cli.startAction("activate installResource");
|
|
85
|
-
const activateResult = await
|
|
80
|
+
this.cli.startAction("DEPLOY:ACTIVATE:INSTALL_RESOURCE", "activate installResource");
|
|
81
|
+
const activateResult = await safe(this.configApi.activateInstall(install));
|
|
86
82
|
if (activateResult.success === false) {
|
|
87
|
-
this.cli.
|
|
83
|
+
this.cli.failAction("DEPLOY:ACTIVATE:INSTALL_RESOURCE");
|
|
88
84
|
throw activateResult.errorObj;
|
|
89
85
|
}
|
|
90
|
-
this.cli.
|
|
86
|
+
this.cli.successAction("DEPLOY:ACTIVATE:INSTALL_RESOURCE");
|
|
91
87
|
}
|
|
92
88
|
async processFile(file, installResource) {
|
|
93
89
|
if (!installResource) {
|
|
@@ -121,13 +117,13 @@ class InstallResourceHandler {
|
|
|
121
117
|
}
|
|
122
118
|
async getInstallResource() {
|
|
123
119
|
let install = await this.builder.init(this.configName);
|
|
124
|
-
this.cli.startAction("create installResource");
|
|
125
|
-
const result = await
|
|
120
|
+
this.cli.startAction("DEPLOY:CREATE:INSTALL_RESOURCE", "create installResource");
|
|
121
|
+
const result = await safe(this.prepareRemoteInstallResource(install));
|
|
126
122
|
if (result.success === false) {
|
|
127
|
-
this.cli.
|
|
123
|
+
this.cli.failAction("DEPLOY:CREATE:INSTALL_RESOURCE");
|
|
128
124
|
throw result.errorObj;
|
|
129
125
|
}
|
|
130
|
-
this.cli.
|
|
126
|
+
this.cli.successAction("DEPLOY:CREATE:INSTALL_RESOURCE");
|
|
131
127
|
const remoteClone = result.data;
|
|
132
128
|
install = this.builder.updateFromRemote(remoteClone);
|
|
133
129
|
install.description = await this.cli.prompt("Describe new configuration:", {
|
|
@@ -143,4 +139,3 @@ class InstallResourceHandler {
|
|
|
143
139
|
return await this.configApi.addInstall(this.configName, resource.origins);
|
|
144
140
|
}
|
|
145
141
|
}
|
|
146
|
-
exports.default = InstallResourceHandler;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Install from "../../interface/install";
|
|
2
|
-
import { CliService } from "../../../cli";
|
|
3
|
-
import InstallResourceBuilder from "../../builder/install-resource-builder";
|
|
4
|
-
import { InstallResourceInterface } from "../../../integration-api/integration-api-model";
|
|
1
|
+
import Install from "../../interface/install.js";
|
|
2
|
+
import { CliService } from "../../../cli/index.js";
|
|
3
|
+
import InstallResourceBuilder from "../../builder/install-resource-builder.js";
|
|
4
|
+
import { InstallResourceInterface } from "../../../integration-api/integration-api-model.js";
|
|
5
5
|
export default class DeletedFileCheck {
|
|
6
6
|
private cli;
|
|
7
7
|
private readonly hasFileSelection;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
const INSTALL_RESOURCE_FILE_KEYS = [
|
|
4
2
|
"custom",
|
|
5
3
|
"sw",
|
|
@@ -10,7 +8,7 @@ const INSTALL_RESOURCE_FILE_KEYS = [
|
|
|
10
8
|
"documentHandlerConfig",
|
|
11
9
|
"customStyle",
|
|
12
10
|
];
|
|
13
|
-
class DeletedFileCheck {
|
|
11
|
+
export default class DeletedFileCheck {
|
|
14
12
|
cli;
|
|
15
13
|
hasFileSelection;
|
|
16
14
|
keysToDelete = [];
|
|
@@ -48,4 +46,3 @@ class DeletedFileCheck {
|
|
|
48
46
|
}
|
|
49
47
|
}
|
|
50
48
|
}
|
|
51
|
-
exports.default = DeletedFileCheck;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import DeployHandlerInterface from "../interface/deploy-handler-interface";
|
|
2
|
-
import { FILE_TYPE, ModuleFile } from "../../integration-api";
|
|
3
|
-
import { DiffService } from "../../diff";
|
|
4
|
-
import { CliService } from "../../cli";
|
|
5
|
-
import RuntimeModifier from "../interface/runtime-modifier";
|
|
6
|
-
import { ConfigApiService } from "../../config-api";
|
|
1
|
+
import DeployHandlerInterface from "../interface/deploy-handler-interface.js";
|
|
2
|
+
import { FILE_TYPE, ModuleFile } from "../../integration-api/index.js";
|
|
3
|
+
import { DiffService } from "../../diff/index.js";
|
|
4
|
+
import { CliService } from "../../cli/index.js";
|
|
5
|
+
import RuntimeModifier from "../interface/runtime-modifier.js";
|
|
6
|
+
import { ConfigApiService } from "../../config-api/index.js";
|
|
7
7
|
export default class ModuleHandler implements DeployHandlerInterface {
|
|
8
8
|
private readonly configApi;
|
|
9
9
|
private diffService;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const safe_1 = require("../../../helpers/safe");
|
|
6
|
-
const deploy_module_file_error_1 = require("../error/deploy-module-file-error");
|
|
7
|
-
class ModuleHandler {
|
|
1
|
+
import { FILE_TYPE } from "../../integration-api/index.js";
|
|
2
|
+
import { safe } from "../../../helpers/safe.js";
|
|
3
|
+
import { DeployModuleFileError } from "../error/deploy-module-file-error.js";
|
|
4
|
+
export default class ModuleHandler {
|
|
8
5
|
configApi;
|
|
9
6
|
diffService;
|
|
10
7
|
cli;
|
|
@@ -16,14 +13,13 @@ class ModuleHandler {
|
|
|
16
13
|
this.modifiers = modifiers;
|
|
17
14
|
}
|
|
18
15
|
canHandle(type) {
|
|
19
|
-
return type ===
|
|
16
|
+
return type === FILE_TYPE.MODULE_FILE;
|
|
20
17
|
}
|
|
21
18
|
async handle(files) {
|
|
22
19
|
for (const file_ of files) {
|
|
23
20
|
const file = file_;
|
|
24
21
|
const remote = await this.configApi.getModule(file.name);
|
|
25
|
-
for (
|
|
26
|
-
const modifier = this.modifiers[iterator];
|
|
22
|
+
for (const modifier of this.modifiers) {
|
|
27
23
|
if (modifier.canModify(file)) {
|
|
28
24
|
modifier.modify(file);
|
|
29
25
|
}
|
|
@@ -55,15 +51,14 @@ class ModuleHandler {
|
|
|
55
51
|
if (await this.cli.confirm(`${filesToUpload.length} Module(s) will be uploaded now. Proceed?`)) {
|
|
56
52
|
for (const file_ of files) {
|
|
57
53
|
const file = file_;
|
|
58
|
-
this.cli.startAction(`update module ${file.name}`);
|
|
59
|
-
const result = await
|
|
54
|
+
this.cli.startAction("DEPLOY:UPDATE:MODULE", `update module ${file.name}`);
|
|
55
|
+
const result = await safe(this.configApi.setModule(file.getContent(), file.name));
|
|
60
56
|
if (result.success === false) {
|
|
61
|
-
this.cli.
|
|
62
|
-
throw new
|
|
57
|
+
this.cli.failAction("DEPLOY:UPDATE:MODULE");
|
|
58
|
+
throw new DeployModuleFileError(result.error);
|
|
63
59
|
}
|
|
64
|
-
this.cli.
|
|
65
|
-
for (
|
|
66
|
-
const modifier = this.modifiers[iterator];
|
|
60
|
+
this.cli.successAction("DEPLOY:UPDATE:MODULE");
|
|
61
|
+
for (const modifier of this.modifiers) {
|
|
67
62
|
if (modifier.canModify(file)) {
|
|
68
63
|
modifier.revert(file);
|
|
69
64
|
}
|
|
@@ -86,4 +81,3 @@ class ModuleHandler {
|
|
|
86
81
|
}
|
|
87
82
|
}
|
|
88
83
|
}
|
|
89
|
-
exports.default = ModuleHandler;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import DeployHandlerInterface from "../interface/deploy-handler-interface";
|
|
2
|
-
import { DiffService } from "../../diff";
|
|
3
|
-
import { CliService } from "../../cli";
|
|
4
|
-
import { FILE_TYPE, ServerConfigFile } from "../../integration-api";
|
|
5
|
-
import { ConfigApiService } from "../../config-api";
|
|
1
|
+
import DeployHandlerInterface from "../interface/deploy-handler-interface.js";
|
|
2
|
+
import { DiffService } from "../../diff/index.js";
|
|
3
|
+
import { CliService } from "../../cli/index.js";
|
|
4
|
+
import { FILE_TYPE, ServerConfigFile } from "../../integration-api/index.js";
|
|
5
|
+
import { ConfigApiService } from "../../config-api/index.js";
|
|
6
6
|
export default class ServerConfigHandler implements DeployHandlerInterface {
|
|
7
7
|
private configApi;
|
|
8
8
|
private diffService;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const safe_1 = require("../../../helpers/safe");
|
|
6
|
-
const deploy_server_config_error_1 = require("../error/deploy-server-config-error");
|
|
7
|
-
class ServerConfigHandler {
|
|
1
|
+
import { FILE_TYPE } from "../../integration-api/index.js";
|
|
2
|
+
import { safe } from "../../../helpers/safe.js";
|
|
3
|
+
import { DeployServerConfigError } from "../error/deploy-server-config-error.js";
|
|
4
|
+
export default class ServerConfigHandler {
|
|
8
5
|
configApi;
|
|
9
6
|
diffService;
|
|
10
7
|
cli;
|
|
@@ -14,7 +11,7 @@ class ServerConfigHandler {
|
|
|
14
11
|
this.cli = cli;
|
|
15
12
|
}
|
|
16
13
|
canHandle(type) {
|
|
17
|
-
return type ===
|
|
14
|
+
return type === FILE_TYPE.SERVER_FILE;
|
|
18
15
|
}
|
|
19
16
|
async handle(files) {
|
|
20
17
|
const file = files[0];
|
|
@@ -47,15 +44,15 @@ class ServerConfigHandler {
|
|
|
47
44
|
if (!(await this.cli.confirm(`ServerConfig will be uploaded now. Proceed?`))) {
|
|
48
45
|
return;
|
|
49
46
|
}
|
|
50
|
-
this.cli.startAction("upload serverconfig");
|
|
51
|
-
const result = await
|
|
47
|
+
this.cli.startAction("DEPLOY:UPDATE:RUNTIME_CONFIG", "upload serverconfig");
|
|
48
|
+
const result = await safe(this.configApi.setServerConfig(file.getContent(),
|
|
52
49
|
// @ts-expect-error revision is unknown
|
|
53
50
|
file.config.revision.version));
|
|
54
51
|
if (result.success === false) {
|
|
55
|
-
this.cli.
|
|
56
|
-
throw new
|
|
52
|
+
this.cli.failAction("DEPLOY:UPDATE:RUNTIME_CONFIG");
|
|
53
|
+
throw new DeployServerConfigError(result.error);
|
|
57
54
|
}
|
|
58
|
-
this.cli.
|
|
55
|
+
this.cli.successAction("DEPLOY:UPDATE:RUNTIME_CONFIG");
|
|
59
56
|
}
|
|
60
57
|
async confirm(file, isNew = false) {
|
|
61
58
|
const confirm = await this.cli.confirm(`Deploy ${file.name}?`, true);
|
|
@@ -72,4 +69,3 @@ class ServerConfigHandler {
|
|
|
72
69
|
}
|
|
73
70
|
}
|
|
74
71
|
}
|
|
75
|
-
exports.default = ServerConfigHandler;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FILE_TYPE, FileInterface } from "../../integration-api";
|
|
1
|
+
import { FILE_TYPE, FileInterface } from "../../integration-api/index.js";
|
|
2
2
|
export default interface DeployHandlerInterface {
|
|
3
3
|
canHandle(type: FILE_TYPE): boolean;
|
|
4
4
|
handle(files: FileInterface[]): Promise<void>;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InstallResourceInterface } from "../../integration-api/integration-api-model";
|
|
1
|
+
import { InstallResourceInterface } from "../../integration-api/integration-api-model.js";
|
|
2
2
|
export default interface InstallResourceProcessorInterface {
|
|
3
3
|
canProcess(file: InstallResourceInterface): boolean;
|
|
4
4
|
process(file: InstallResourceInterface): Promise<void>;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileInterface } from "../../integration-api/integration-api-model";
|
|
1
|
+
import { FileInterface } from "../../integration-api/integration-api-model.js";
|
|
2
2
|
export default interface RuntimeModifier {
|
|
3
3
|
canModify(file: FileInterface): boolean;
|
|
4
4
|
modify(file: FileInterface): void;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DiffContext = void 0;
|
|
4
|
-
class DiffContext {
|
|
1
|
+
export class DiffContext {
|
|
5
2
|
executablePath;
|
|
6
3
|
executableTemplate;
|
|
7
4
|
constructor(executablePath, executableTemplate) {
|
|
@@ -9,4 +6,3 @@ class DiffContext {
|
|
|
9
6
|
this.executableTemplate = executableTemplate;
|
|
10
7
|
}
|
|
11
8
|
}
|
|
12
|
-
exports.DiffContext = DiffContext;
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const cli_1 = require("../cli");
|
|
5
|
-
const _1 = require(".");
|
|
6
|
-
class DiffServiceFactory {
|
|
1
|
+
import { CliServiceFactory } from "../cli/index.js";
|
|
2
|
+
import { DiffService } from "./index.js";
|
|
3
|
+
export class DiffServiceFactory {
|
|
7
4
|
context;
|
|
8
5
|
service = undefined;
|
|
9
6
|
constructor(context) {
|
|
10
7
|
this.context = context;
|
|
11
8
|
}
|
|
12
9
|
getService() {
|
|
13
|
-
if (!(this.service instanceof
|
|
14
|
-
const cliService = new
|
|
15
|
-
this.service = new
|
|
10
|
+
if (!(this.service instanceof DiffService)) {
|
|
11
|
+
const cliService = new CliServiceFactory().getService();
|
|
12
|
+
this.service = new DiffService(cliService, this.context.executablePath, this.context.executableTemplate);
|
|
16
13
|
}
|
|
17
14
|
return this.service;
|
|
18
15
|
}
|
|
19
16
|
}
|
|
20
|
-
exports.DiffServiceFactory = DiffServiceFactory;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const file_helper_1 = require("../../helpers/file-helper");
|
|
9
|
-
const normalize_1 = require("../../helpers/normalize");
|
|
10
|
-
const os_1 = require("../../models/os");
|
|
11
|
-
class DiffService {
|
|
1
|
+
import pathModule from "node:path";
|
|
2
|
+
import fs, { readFile } from "node:fs/promises";
|
|
3
|
+
import { execSync } from "node:child_process";
|
|
4
|
+
import { createTemporalDirectory } from "../../helpers/file-helper.js";
|
|
5
|
+
import { unescapeSpaces } from "../../helpers/normalize.js";
|
|
6
|
+
import { DEFAULT_INTELLIJ_IDEA_PATH_MACOS } from "../../models/os.js";
|
|
7
|
+
export class DiffService {
|
|
12
8
|
cli;
|
|
13
9
|
diffExecutablePath;
|
|
14
10
|
diffExecutableTemplate;
|
|
@@ -28,7 +24,7 @@ class DiffService {
|
|
|
28
24
|
const diff = await this.executeDiff(temporaryFirstFilePath, temporarySecondFilePath);
|
|
29
25
|
// return changes made in diffView
|
|
30
26
|
// eg adding changes from remote to safe locally
|
|
31
|
-
const changedFile = await
|
|
27
|
+
const changedFile = await readFile(temporarySecondFilePath, "utf-8");
|
|
32
28
|
return { updatedFile: changedFile, diff };
|
|
33
29
|
}
|
|
34
30
|
/**
|
|
@@ -37,7 +33,7 @@ class DiffService {
|
|
|
37
33
|
async getTemporalDirectoryPath() {
|
|
38
34
|
// create temporal directory for remote installationFiles so the diff can be generated
|
|
39
35
|
if (!this.tempPath) {
|
|
40
|
-
this.tempPath = await
|
|
36
|
+
this.tempPath = await createTemporalDirectory();
|
|
41
37
|
}
|
|
42
38
|
if (!this.tempPath) {
|
|
43
39
|
this.cli.writeError("No temporary Directory found and unable to create a new temporary Directory");
|
|
@@ -49,8 +45,8 @@ class DiffService {
|
|
|
49
45
|
if (!content) {
|
|
50
46
|
content = "";
|
|
51
47
|
}
|
|
52
|
-
const resolveFilePath =
|
|
53
|
-
await
|
|
48
|
+
const resolveFilePath = pathModule.join((await this.getTemporalDirectoryPath()) + `/${temporaryFileName}`);
|
|
49
|
+
await fs.writeFile(resolveFilePath, content.replaceAll(/\r?\n/gm, "\n"));
|
|
54
50
|
return resolveFilePath;
|
|
55
51
|
}
|
|
56
52
|
/**
|
|
@@ -76,7 +72,7 @@ class DiffService {
|
|
|
76
72
|
let firstContent;
|
|
77
73
|
let secondContent;
|
|
78
74
|
try {
|
|
79
|
-
firstContent = await
|
|
75
|
+
firstContent = await fs.readFile(firstPath, {
|
|
80
76
|
encoding: "utf8",
|
|
81
77
|
flag: "r",
|
|
82
78
|
});
|
|
@@ -85,7 +81,7 @@ class DiffService {
|
|
|
85
81
|
return false;
|
|
86
82
|
}
|
|
87
83
|
try {
|
|
88
|
-
secondContent = await
|
|
84
|
+
secondContent = await fs.readFile(secondPath, {
|
|
89
85
|
encoding: "utf8",
|
|
90
86
|
flag: "r",
|
|
91
87
|
});
|
|
@@ -110,7 +106,7 @@ class DiffService {
|
|
|
110
106
|
.replace("$exec", this.diffExecutablePath)
|
|
111
107
|
.replace("$file1", firstPath)
|
|
112
108
|
.replace("$file2", secondPath);
|
|
113
|
-
|
|
109
|
+
execSync(command, { stdio: "pipe" });
|
|
114
110
|
}
|
|
115
111
|
catch (error) {
|
|
116
112
|
this.cli.code(error.stdout.toString());
|
|
@@ -119,7 +115,7 @@ class DiffService {
|
|
|
119
115
|
}
|
|
120
116
|
let ideaCommandAvailable;
|
|
121
117
|
try {
|
|
122
|
-
|
|
118
|
+
execSync(`idea diff "${firstPath}" "${secondPath}"`, {
|
|
123
119
|
stdio: ["pipe", "ignore", "pipe"], // prevent output of "/bin/sh: idea: command not found"
|
|
124
120
|
});
|
|
125
121
|
ideaCommandAvailable = true;
|
|
@@ -131,12 +127,12 @@ class DiffService {
|
|
|
131
127
|
if (!ideaCommandAvailable) {
|
|
132
128
|
const isWindows = process.platform.startsWith("win");
|
|
133
129
|
if (isWindows) {
|
|
134
|
-
|
|
130
|
+
execSync(`"%IDEA_INITIAL_DIRECTORY%\\idea" diff ${firstPath} ${secondPath}`, { stdio: "pipe" });
|
|
135
131
|
}
|
|
136
132
|
else {
|
|
137
|
-
const ideaInitialDirectory =
|
|
138
|
-
|
|
139
|
-
|
|
133
|
+
const ideaInitialDirectory = unescapeSpaces(process.env.IDEA_INITIAL_DIRECTORY ||
|
|
134
|
+
DEFAULT_INTELLIJ_IDEA_PATH_MACOS);
|
|
135
|
+
execSync(`"${ideaInitialDirectory}/idea" diff ${firstPath} ${secondPath}`, { stdio: "pipe" });
|
|
140
136
|
}
|
|
141
137
|
}
|
|
142
138
|
return false;
|
|
@@ -147,4 +143,3 @@ class DiffService {
|
|
|
147
143
|
}
|
|
148
144
|
}
|
|
149
145
|
}
|
|
150
|
-
exports.DiffService = DiffService;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./diff-service";
|
|
2
|
-
export * from "./diff-service-factory";
|
|
3
|
-
export * from "./diff-model";
|
|
1
|
+
export * from "./diff-service.js";
|
|
2
|
+
export * from "./diff-service-factory.js";
|
|
3
|
+
export * from "./diff-model.js";
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
tslib_1.__exportStar(require("./diff-service"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./diff-service-factory"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./diff-model"), exports);
|
|
1
|
+
export * from "./diff-service.js";
|
|
2
|
+
export * from "./diff-service-factory.js";
|
|
3
|
+
export * from "./diff-model.js";
|