@speedkit/cli 2.4.1
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/README.md +775 -0
- package/bin/dev +18 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +4 -0
- package/bin/run.cmd +3 -0
- package/dist/commands/airports_iata.json +1 -0
- package/dist/commands/build-parameter-query.d.ts +15 -0
- package/dist/commands/build-parameter-query.js +95 -0
- package/dist/commands/build-prewarm-query.d.ts +15 -0
- package/dist/commands/build-prewarm-query.js +69 -0
- package/dist/commands/deploy.d.ts +17 -0
- package/dist/commands/deploy.js +39 -0
- package/dist/commands/document-handler.d.ts +16 -0
- package/dist/commands/document-handler.js +36 -0
- package/dist/commands/find-pops.d.ts +17 -0
- package/dist/commands/find-pops.js +84 -0
- package/dist/commands/generate-customer-config.d.ts +10 -0
- package/dist/commands/generate-customer-config.js +29 -0
- package/dist/commands/generate-pop-config.d.ts +27 -0
- package/dist/commands/generate-pop-config.js +231 -0
- package/dist/commands/login.d.ts +10 -0
- package/dist/commands/login.js +35 -0
- package/dist/commands/onboarding.d.ts +16 -0
- package/dist/commands/onboarding.js +25 -0
- package/dist/commands/param-diff.d.ts +16 -0
- package/dist/commands/param-diff.js +111 -0
- package/dist/commands/pop-prewarm.d.ts +17 -0
- package/dist/commands/pop-prewarm.js +80 -0
- package/dist/commands/prewarm.d.ts +40 -0
- package/dist/commands/prewarm.js +127 -0
- package/dist/commands/pull.d.ts +14 -0
- package/dist/commands/pull.js +24 -0
- package/dist/commands/wpt-launcher.d.ts +21 -0
- package/dist/commands/wpt-launcher.js +79 -0
- package/dist/helpers/CustomerConfig.d.ts +51 -0
- package/dist/helpers/CustomerConfig.js +150 -0
- package/dist/helpers/build-query-helper.d.ts +32 -0
- package/dist/helpers/build-query-helper.js +216 -0
- package/dist/helpers/cli-config.d.ts +22 -0
- package/dist/helpers/cli-config.js +85 -0
- package/dist/helpers/file-helper.d.ts +8 -0
- package/dist/helpers/file-helper.js +63 -0
- package/dist/helpers/get-parsed-config.d.ts +11 -0
- package/dist/helpers/get-parsed-config.js +63 -0
- package/dist/helpers/getChromePath.d.ts +7 -0
- package/dist/helpers/getChromePath.js +27 -0
- package/dist/helpers/isDirectory.d.ts +1 -0
- package/dist/helpers/isDirectory.js +17 -0
- package/dist/helpers/isExecutable.d.ts +1 -0
- package/dist/helpers/isExecutable.js +15 -0
- package/dist/helpers/isFile.d.ts +1 -0
- package/dist/helpers/isFile.js +17 -0
- package/dist/helpers/logging-helper.d.ts +12 -0
- package/dist/helpers/logging-helper.js +27 -0
- package/dist/helpers/normalize.d.ts +40 -0
- package/dist/helpers/normalize.js +112 -0
- package/dist/helpers/race.d.ts +1 -0
- package/dist/helpers/race.js +16 -0
- package/dist/helpers/safe.d.ts +10 -0
- package/dist/helpers/safe.js +34 -0
- package/dist/helpers/scrape.d.ts +1 -0
- package/dist/helpers/scrape.js +11 -0
- package/dist/helpers/speedKitRuleToRegExp.d.ts +1 -0
- package/dist/helpers/speedKitRuleToRegExp.js +10 -0
- package/dist/helpers/watchFiles.d.ts +1 -0
- package/dist/helpers/watchFiles.js +20 -0
- package/dist/models/cli-parameters.d.ts +73 -0
- package/dist/models/cli-parameters.js +82 -0
- package/dist/models/files.d.ts +20 -0
- package/dist/models/files.js +23 -0
- package/dist/models/install.d.ts +24 -0
- package/dist/models/install.js +2 -0
- package/dist/services/athena-service.d.ts +30 -0
- package/dist/services/athena-service.js +139 -0
- package/dist/services/bundler/bundle-service-factory.d.ts +4 -0
- package/dist/services/bundler/bundle-service-factory.js +10 -0
- package/dist/services/bundler/bundle-service.d.ts +25 -0
- package/dist/services/bundler/bundle-service.js +84 -0
- package/dist/services/bundler/index.d.ts +2 -0
- package/dist/services/bundler/index.js +5 -0
- package/dist/services/cli/cli-service-factory.d.ts +5 -0
- package/dist/services/cli/cli-service-factory.js +14 -0
- package/dist/services/cli/cli-service-model.d.ts +27 -0
- package/dist/services/cli/cli-service-model.js +9 -0
- package/dist/services/cli/cli-service.d.ts +37 -0
- package/dist/services/cli/cli-service.js +123 -0
- package/dist/services/cli/error/cli-type-error.d.ts +3 -0
- package/dist/services/cli/error/cli-type-error.js +7 -0
- package/dist/services/cli/hooks.d.ts +11 -0
- package/dist/services/cli/hooks.js +33 -0
- package/dist/services/cli/index.d.ts +3 -0
- package/dist/services/cli/index.js +6 -0
- package/dist/services/config-api/client.d.ts +16 -0
- package/dist/services/config-api/client.js +54 -0
- package/dist/services/config-api/config-api-service.d.ts +16 -0
- package/dist/services/config-api/config-api-service.js +56 -0
- package/dist/services/config-api/context/config-api-context.d.ts +5 -0
- package/dist/services/config-api/context/config-api-context.js +9 -0
- package/dist/services/config-api/error/json-response-error.d.ts +2 -0
- package/dist/services/config-api/error/json-response-error.js +5 -0
- package/dist/services/config-api/error/login-error.d.ts +5 -0
- package/dist/services/config-api/error/login-error.js +12 -0
- package/dist/services/config-api/factory/config-api-service-factory.d.ts +10 -0
- package/dist/services/config-api/factory/config-api-service-factory.js +38 -0
- package/dist/services/config-api/factory/entity-manager-factory.d.ts +5 -0
- package/dist/services/config-api/factory/entity-manager-factory.js +21 -0
- package/dist/services/config-api/interface/config-api-context-interface.d.ts +4 -0
- package/dist/services/config-api/interface/config-api-context-interface.js +2 -0
- package/dist/services/config-api/interface/request-extension-interface.d.ts +5 -0
- package/dist/services/config-api/interface/request-extension-interface.js +2 -0
- package/dist/services/config-api-service.d.ts +18 -0
- package/dist/services/config-api-service.js +96 -0
- package/dist/services/context/app-context.d.ts +1 -0
- package/dist/services/context/app-context.js +2 -0
- package/dist/services/context/error/context-runtime-error.d.ts +3 -0
- package/dist/services/context/error/context-runtime-error.js +7 -0
- package/dist/services/context/interface/context-interface.d.ts +2 -0
- package/dist/services/context/interface/context-interface.js +2 -0
- package/dist/services/customer-config/customer-config-service-context.d.ts +5 -0
- package/dist/services/customer-config/customer-config-service-context.js +15 -0
- package/dist/services/customer-config/customer-config-service-factory.d.ts +8 -0
- package/dist/services/customer-config/customer-config-service-factory.js +24 -0
- package/dist/services/customer-config/customer-config-service-model.d.ts +39 -0
- package/dist/services/customer-config/customer-config-service-model.js +23 -0
- package/dist/services/customer-config/customer-config-service.d.ts +27 -0
- package/dist/services/customer-config/customer-config-service.js +263 -0
- package/dist/services/customer-config/index.d.ts +4 -0
- package/dist/services/customer-config/index.js +7 -0
- package/dist/services/customer-config/templates/config_SpeedKit.js.hbs +351 -0
- package/dist/services/customer-config/templates/config_customer.js.hbs +75 -0
- package/dist/services/customer-config/templates/config_documentHandler.js.hbs +162 -0
- package/dist/services/customer-config/templates/config_dynamicBlocks.es6.hbs +263 -0
- package/dist/services/customer-config/templates/config_dynamicStyles.css.hbs +116 -0
- package/dist/services/customer-config/templates/config_loadHandler.js.hbs +394 -0
- package/dist/services/customer-config/templates/deploymentDetection.es6.hbs +262 -0
- package/dist/services/customer-config/templates/downtimeDetection.js.hbs +110 -0
- package/dist/services/deploy/builder/install-resource-builder.d.ts +14 -0
- package/dist/services/deploy/builder/install-resource-builder.js +48 -0
- package/dist/services/deploy/checks/post-deploy/revalidated-module-check.d.ts +11 -0
- package/dist/services/deploy/checks/post-deploy/revalidated-module-check.js +30 -0
- package/dist/services/deploy/checks/post-deploy/save-files-check.d.ts +9 -0
- package/dist/services/deploy/checks/post-deploy/save-files-check.js +25 -0
- package/dist/services/deploy/context/deploy-context.d.ts +12 -0
- package/dist/services/deploy/context/deploy-context.js +26 -0
- package/dist/services/deploy/deploy-service-factory.d.ts +15 -0
- package/dist/services/deploy/deploy-service-factory.js +68 -0
- package/dist/services/deploy/deploy-service.d.ts +17 -0
- package/dist/services/deploy/deploy-service.js +63 -0
- package/dist/services/deploy/error/create-find-temp-directory-error.d.ts +4 -0
- package/dist/services/deploy/error/create-find-temp-directory-error.js +10 -0
- package/dist/services/deploy/error/deploy-app-error.d.ts +2 -0
- package/dist/services/deploy/error/deploy-app-error.js +5 -0
- package/dist/services/deploy/error/no-active-installation-error.d.ts +4 -0
- package/dist/services/deploy/error/no-active-installation-error.js +10 -0
- package/dist/services/deploy/handler/customer-config-handler.d.ts +21 -0
- package/dist/services/deploy/handler/customer-config-handler.js +85 -0
- package/dist/services/deploy/handler/install-resource-handler.d.ts +25 -0
- package/dist/services/deploy/handler/install-resource-handler.js +104 -0
- package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.d.ts +13 -0
- package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.js +51 -0
- package/dist/services/deploy/handler/module-handler.d.ts +14 -0
- package/dist/services/deploy/handler/module-handler.js +81 -0
- package/dist/services/deploy/handler/module-modifier/deployment-detection-modifier.d.ts +9 -0
- package/dist/services/deploy/handler/module-modifier/deployment-detection-modifier.js +24 -0
- package/dist/services/deploy/handler/server-config-handler.d.ts +12 -0
- package/dist/services/deploy/handler/server-config-handler.js +63 -0
- package/dist/services/deploy/interface/deploy-handler-interface.d.ts +6 -0
- package/dist/services/deploy/interface/deploy-handler-interface.js +2 -0
- package/dist/services/deploy/interface/install-configs.d.ts +11 -0
- package/dist/services/deploy/interface/install-configs.js +2 -0
- package/dist/services/deploy/interface/install-resource-processor-interface.d.ts +5 -0
- package/dist/services/deploy/interface/install-resource-processor-interface.js +2 -0
- package/dist/services/deploy/interface/install.d.ts +14 -0
- package/dist/services/deploy/interface/install.js +2 -0
- package/dist/services/deploy/interface/post-deploy-check-interface.d.ts +3 -0
- package/dist/services/deploy/interface/post-deploy-check-interface.js +2 -0
- package/dist/services/deploy/interface/runtime-modifier.d.ts +6 -0
- package/dist/services/deploy/interface/runtime-modifier.js +2 -0
- package/dist/services/deploy/interface/validate-origins-response.d.ts +4 -0
- package/dist/services/deploy/interface/validate-origins-response.js +2 -0
- package/dist/services/diff/diff-model.d.ts +5 -0
- package/dist/services/diff/diff-model.js +12 -0
- package/dist/services/diff/diff-service-factory.d.ts +7 -0
- package/dist/services/diff/diff-service-factory.js +20 -0
- package/dist/services/diff/diff-service.d.ts +34 -0
- package/dist/services/diff/diff-service.js +134 -0
- package/dist/services/diff/index.d.ts +3 -0
- package/dist/services/diff/index.js +6 -0
- package/dist/services/diff-service.d.ts +24 -0
- package/dist/services/diff-service.js +112 -0
- package/dist/services/document-handler-runtime/context/document-handler-runtime-context.d.ts +23 -0
- package/dist/services/document-handler-runtime/context/document-handler-runtime-context.js +41 -0
- package/dist/services/document-handler-runtime/document-handler-runtime-service.d.ts +32 -0
- package/dist/services/document-handler-runtime/document-handler-runtime-service.js +220 -0
- package/dist/services/document-handler-runtime/document-handler-server.d.ts +42 -0
- package/dist/services/document-handler-runtime/document-handler-server.js +225 -0
- package/dist/services/document-handler-runtime/error/handler/required-file-not-found-handler.d.ts +6 -0
- package/dist/services/document-handler-runtime/error/handler/required-file-not-found-handler.js +14 -0
- package/dist/services/document-handler-runtime/error/required-file-not-found-error.d.ts +3 -0
- package/dist/services/document-handler-runtime/error/required-file-not-found-error.js +7 -0
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +24 -0
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +106 -0
- package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.d.ts +3 -0
- package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.js +6 -0
- package/dist/services/document-handler-runtime/interface/template-context-interface.d.ts +3 -0
- package/dist/services/document-handler-runtime/interface/template-context-interface.js +2 -0
- package/dist/services/document-handler-runtime/interface/template-interface.d.ts +6 -0
- package/dist/services/document-handler-runtime/interface/template-interface.js +2 -0
- package/dist/services/document-handler-runtime/interface/template-param-interface.d.ts +4 -0
- package/dist/services/document-handler-runtime/interface/template-param-interface.js +2 -0
- package/dist/services/document-handler-runtime/templates/abstract-template.d.ts +9 -0
- package/dist/services/document-handler-runtime/templates/abstract-template.js +18 -0
- package/dist/services/document-handler-runtime/templates/database-mock.d.ts +6 -0
- package/dist/services/document-handler-runtime/templates/database-mock.js +111 -0
- package/dist/services/document-handler-runtime/templates/execute-document-handler.d.ts +6 -0
- package/dist/services/document-handler-runtime/templates/execute-document-handler.js +76 -0
- package/dist/services/document-handler-runtime/templates/orestes-mock.d.ts +9 -0
- package/dist/services/document-handler-runtime/templates/orestes-mock.js +168 -0
- package/dist/services/document-handler-runtime/templates/package-json.d.ts +8 -0
- package/dist/services/document-handler-runtime/templates/package-json.js +21 -0
- package/dist/services/document-handler-runtime/templates/test.d.ts +6 -0
- package/dist/services/document-handler-runtime/templates/test.js +63 -0
- package/dist/services/error-handling/abstract/abstract-async-error-handling-factory.d.ts +6 -0
- package/dist/services/error-handling/abstract/abstract-async-error-handling-factory.js +19 -0
- package/dist/services/error-handling/abstract/abstract-async-error-handling-service.d.ts +6 -0
- package/dist/services/error-handling/abstract/abstract-async-error-handling-service.js +18 -0
- package/dist/services/error-handling/abstract/abstract-error-handling-factory.d.ts +6 -0
- package/dist/services/error-handling/abstract/abstract-error-handling-factory.js +19 -0
- package/dist/services/error-handling/abstract/abstract-error-handling-service.d.ts +6 -0
- package/dist/services/error-handling/abstract/abstract-error-handling-service.js +19 -0
- package/dist/services/error-handling/error/application-error.d.ts +5 -0
- package/dist/services/error-handling/error/application-error.js +11 -0
- package/dist/services/error-handling/error/handler/default-error-handler.d.ts +5 -0
- package/dist/services/error-handling/error/handler/default-error-handler.js +13 -0
- package/dist/services/error-handling/error-handling-service.d.ts +7 -0
- package/dist/services/error-handling/error-handling-service.js +27 -0
- package/dist/services/error-handling/factory/error-handling-factory.d.ts +8 -0
- package/dist/services/error-handling/factory/error-handling-factory.js +21 -0
- package/dist/services/error-handling/interface/error-context-interface.d.ts +6 -0
- package/dist/services/error-handling/interface/error-context-interface.js +2 -0
- package/dist/services/error-handling/interface/error-handler-interface.d.ts +5 -0
- package/dist/services/error-handling/interface/error-handler-interface.js +2 -0
- package/dist/services/error-handling/interface/error-handling-factory-interface.d.ts +8 -0
- package/dist/services/error-handling/interface/error-handling-factory-interface.js +2 -0
- package/dist/services/error-handling/interface/error-handling-service-interface.d.ts +8 -0
- package/dist/services/error-handling/interface/error-handling-service-interface.js +2 -0
- package/dist/services/integration-api/context/integration-api-context.d.ts +9 -0
- package/dist/services/integration-api/context/integration-api-context.js +20 -0
- package/dist/services/integration-api/error/customer-config-error.d.ts +2 -0
- package/dist/services/integration-api/error/customer-config-error.js +5 -0
- package/dist/services/integration-api/error/customer-config-legacy-error.d.ts +3 -0
- package/dist/services/integration-api/error/customer-config-legacy-error.js +7 -0
- package/dist/services/integration-api/error/handler/customer-config-handler.d.ts +5 -0
- package/dist/services/integration-api/error/handler/customer-config-handler.js +19 -0
- package/dist/services/integration-api/error/handler/customer-config-legacy-handler.d.ts +6 -0
- package/dist/services/integration-api/error/handler/customer-config-legacy-handler.js +24 -0
- package/dist/services/integration-api/error/handler/origin-handler.d.ts +6 -0
- package/dist/services/integration-api/error/handler/origin-handler.js +22 -0
- package/dist/services/integration-api/error/load-customer-error.d.ts +4 -0
- package/dist/services/integration-api/error/load-customer-error.js +10 -0
- package/dist/services/integration-api/error/mandatory-file-missing-error.d.ts +3 -0
- package/dist/services/integration-api/error/mandatory-file-missing-error.js +8 -0
- package/dist/services/integration-api/error/origin-error.d.ts +3 -0
- package/dist/services/integration-api/error/origin-error.js +7 -0
- package/dist/services/integration-api/external/external-file-reader.d.ts +4 -0
- package/dist/services/integration-api/external/external-file-reader.js +17 -0
- package/dist/services/integration-api/factory/integration-api-service-factory.d.ts +13 -0
- package/dist/services/integration-api/factory/integration-api-service-factory.js +55 -0
- package/dist/services/integration-api/file-list.d.ts +18 -0
- package/dist/services/integration-api/file-list.js +79 -0
- package/dist/services/integration-api/file-reader.d.ts +15 -0
- package/dist/services/integration-api/file-reader.js +97 -0
- package/dist/services/integration-api/file-writer.d.ts +9 -0
- package/dist/services/integration-api/file-writer.js +27 -0
- package/dist/services/integration-api/handler/customer-config-handler.d.ts +16 -0
- package/dist/services/integration-api/handler/customer-config-handler.js +55 -0
- package/dist/services/integration-api/handler/file-handler.d.ts +9 -0
- package/dist/services/integration-api/handler/file-handler.js +20 -0
- package/dist/services/integration-api/handler/install-resource-handler.d.ts +33 -0
- package/dist/services/integration-api/handler/install-resource-handler.js +67 -0
- package/dist/services/integration-api/handler/module-handler.d.ts +12 -0
- package/dist/services/integration-api/handler/module-handler.js +20 -0
- package/dist/services/integration-api/handler/server-config-handler.d.ts +8 -0
- package/dist/services/integration-api/handler/server-config-handler.js +21 -0
- package/dist/services/integration-api/integration-api-model.d.ts +89 -0
- package/dist/services/integration-api/integration-api-model.js +2 -0
- package/dist/services/integration-api/integration-api-service.d.ts +21 -0
- package/dist/services/integration-api/integration-api-service.js +76 -0
- package/dist/services/integration-api/struct/customer-config-file.d.ts +10 -0
- package/dist/services/integration-api/struct/customer-config-file.js +32 -0
- package/dist/services/integration-api/struct/customer-config.d.ts +22 -0
- package/dist/services/integration-api/struct/customer-config.js +67 -0
- package/dist/services/integration-api/struct/file.d.ts +19 -0
- package/dist/services/integration-api/struct/file.js +61 -0
- package/dist/services/integration-api/struct/install-resource-file.d.ts +6 -0
- package/dist/services/integration-api/struct/install-resource-file.js +12 -0
- package/dist/services/integration-api/struct/module-file.d.ts +5 -0
- package/dist/services/integration-api/struct/module-file.js +10 -0
- package/dist/services/integration-api/struct/ro-file.d.ts +13 -0
- package/dist/services/integration-api/struct/ro-file.js +26 -0
- package/dist/services/integration-api/struct/server-config-file.d.ts +9 -0
- package/dist/services/integration-api/struct/server-config-file.js +22 -0
- package/dist/services/integration-api/struct/virtual-file.d.ts +14 -0
- package/dist/services/integration-api/struct/virtual-file.js +28 -0
- package/dist/services/integration-api/validator/customer-config-validator.d.ts +5 -0
- package/dist/services/integration-api/validator/customer-config-validator.js +23 -0
- package/dist/services/integration-api/validator/mandatory-files-validator.d.ts +7 -0
- package/dist/services/integration-api/validator/mandatory-files-validator.js +39 -0
- package/dist/services/integration-api/virtual/external-recipe.d.ts +9 -0
- package/dist/services/integration-api/virtual/external-recipe.js +19 -0
- package/dist/services/integration-api/virtual/virtual-file-handler.d.ts +7 -0
- package/dist/services/integration-api/virtual/virtual-file-handler.js +38 -0
- package/dist/services/onboarding/browser/abort-response.d.ts +5 -0
- package/dist/services/onboarding/browser/abort-response.js +10 -0
- package/dist/services/onboarding/browser/baqend-response.d.ts +12 -0
- package/dist/services/onboarding/browser/baqend-response.js +52 -0
- package/dist/services/onboarding/browser/origin-response.d.ts +8 -0
- package/dist/services/onboarding/browser/origin-response.js +20 -0
- package/dist/services/onboarding/config-renderer/install-file-recipe.d.ts +7 -0
- package/dist/services/onboarding/config-renderer/install-file-recipe.js +13 -0
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.d.ts +22 -0
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +78 -0
- package/dist/services/onboarding/dashboard/athena-service.d.ts +11 -0
- package/dist/services/onboarding/dashboard/athena-service.js +70 -0
- package/dist/services/onboarding/dashboard/frontend-dist/assets/index-87b53ed4.css +1 -0
- package/dist/services/onboarding/dashboard/frontend-dist/assets/main-274b5625.js +9 -0
- package/dist/services/onboarding/dashboard/frontend-dist/index.html +18 -0
- package/dist/services/onboarding/dashboard/index.d.ts +16 -0
- package/dist/services/onboarding/dashboard/index.js +78 -0
- package/dist/services/onboarding/dashboard/param-query-builder.d.ts +9 -0
- package/dist/services/onboarding/dashboard/param-query-builder.js +67 -0
- package/dist/services/onboarding/dashboard/request-diff-service.d.ts +11 -0
- package/dist/services/onboarding/dashboard/request-diff-service.js +59 -0
- package/dist/services/onboarding/error/vm-error.d.ts +2 -0
- package/dist/services/onboarding/error/vm-error.js +6 -0
- package/dist/services/onboarding/fetch-event-handler.d.ts +19 -0
- package/dist/services/onboarding/fetch-event-handler.js +155 -0
- package/dist/services/onboarding/fetch-events/customer-domain-document-response.d.ts +24 -0
- package/dist/services/onboarding/fetch-events/customer-domain-document-response.js +118 -0
- package/dist/services/onboarding/fetch-events/customer-service-worker-js.d.ts +14 -0
- package/dist/services/onboarding/fetch-events/customer-service-worker-js.js +30 -0
- package/dist/services/onboarding/fetch-events/dashboard-request.d.ts +15 -0
- package/dist/services/onboarding/fetch-events/dashboard-request.js +29 -0
- package/dist/services/onboarding/fetch-events/speed-kit-asset-request.d.ts +26 -0
- package/dist/services/onboarding/fetch-events/speed-kit-asset-request.js +138 -0
- package/dist/services/onboarding/fetch-events/speed-kit-install-html.d.ts +15 -0
- package/dist/services/onboarding/fetch-events/speed-kit-install-html.js +49 -0
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.d.ts +22 -0
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +62 -0
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +21 -0
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.js +43 -0
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +17 -0
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.js +27 -0
- package/dist/services/onboarding/file-events/fileWatcher.d.ts +28 -0
- package/dist/services/onboarding/file-events/fileWatcher.js +133 -0
- package/dist/services/onboarding/index.d.ts +3 -0
- package/dist/services/onboarding/index.js +8 -0
- package/dist/services/onboarding/onboarding-model.d.ts +30 -0
- package/dist/services/onboarding/onboarding-model.js +53 -0
- package/dist/services/onboarding/onboarding-service-factory.d.ts +16 -0
- package/dist/services/onboarding/onboarding-service-factory.js +163 -0
- package/dist/services/onboarding/onboarding-service.d.ts +31 -0
- package/dist/services/onboarding/onboarding-service.js +130 -0
- package/dist/services/onboarding/request-cache/cache.d.ts +15 -0
- package/dist/services/onboarding/request-cache/cache.js +32 -0
- package/dist/services/onboarding/templates/install-speed-kit-html-template.d.ts +4 -0
- package/dist/services/onboarding/templates/install-speed-kit-html-template.js +264 -0
- package/dist/services/onboarding/templates/install-speed-kit-js-template.d.ts +4 -0
- package/dist/services/onboarding/templates/install-speed-kit-js-template.js +41 -0
- package/dist/services/onboarding/todo-collector.d.ts +18 -0
- package/dist/services/onboarding/todo-collector.js +48 -0
- package/dist/services/prewarm-service.d.ts +5 -0
- package/dist/services/prewarm-service.js +57 -0
- package/dist/services/pull/index.d.ts +3 -0
- package/dist/services/pull/index.js +6 -0
- package/dist/services/pull/pull-service-factory.d.ts +12 -0
- package/dist/services/pull/pull-service-factory.js +44 -0
- package/dist/services/pull/pull-service-model.d.ts +43 -0
- package/dist/services/pull/pull-service-model.js +27 -0
- package/dist/services/pull/pull-service.d.ts +18 -0
- package/dist/services/pull/pull-service.js +106 -0
- package/dist/templates/pops.js +97 -0
- package/dist/templates/speedKit.Revalidated.js +86 -0
- package/oclif.manifest.json +700 -0
- package/package.json +128 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const install_resource_file_1 = tslib_1.__importDefault(require("../../integration-api/struct/install-resource-file"));
|
|
5
|
+
class InstallResourceHandler {
|
|
6
|
+
customer;
|
|
7
|
+
configApi;
|
|
8
|
+
configName;
|
|
9
|
+
diffService;
|
|
10
|
+
cli;
|
|
11
|
+
builder;
|
|
12
|
+
deletedFilesChecker;
|
|
13
|
+
constructor(customer, configApi, configName, diffService, cli, builder, deletedFilesChecker) {
|
|
14
|
+
this.customer = customer;
|
|
15
|
+
this.configApi = configApi;
|
|
16
|
+
this.diffService = diffService;
|
|
17
|
+
this.configName = configName;
|
|
18
|
+
this.cli = cli;
|
|
19
|
+
this.builder = builder;
|
|
20
|
+
this.deletedFilesChecker = deletedFilesChecker;
|
|
21
|
+
}
|
|
22
|
+
canHandle(type) {
|
|
23
|
+
return type === install_resource_file_1.default;
|
|
24
|
+
}
|
|
25
|
+
async handle(files) {
|
|
26
|
+
const installResource = await this.configApi.getActiveInstall(this.configName);
|
|
27
|
+
for (let iterator = 0; iterator < files.length; iterator++) {
|
|
28
|
+
let file = files[iterator];
|
|
29
|
+
await this.processFile(file, installResource);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async upload(files) {
|
|
33
|
+
for (let iterator = 0; iterator < files.length; iterator++) {
|
|
34
|
+
let file = files[iterator];
|
|
35
|
+
if (file.shouldSkipFile()) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
let resource = {};
|
|
39
|
+
resource[file.remoteKey] = file.getContent();
|
|
40
|
+
this.builder.merge(resource);
|
|
41
|
+
}
|
|
42
|
+
await this.deletedFilesChecker.hasDeletedFiles(this.builder, files);
|
|
43
|
+
if (!this.builder.hasChanges()) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
this.cli.write('');
|
|
47
|
+
this.cli.write('Summary');
|
|
48
|
+
this.cli.writeBuffer();
|
|
49
|
+
if (!await this.cli.confirm('InstallResource will be created now. Proceed?')) {
|
|
50
|
+
this.cli.exit();
|
|
51
|
+
}
|
|
52
|
+
let install = await this.getInstallResource();
|
|
53
|
+
await this.deletedFilesChecker.checkForDeletedLocalFiles(install);
|
|
54
|
+
await this.configApi.setInstall(install);
|
|
55
|
+
if (await this.cli.confirm('Activate new installation?')) {
|
|
56
|
+
await this.configApi.activateInstall(install);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async processFile(file, installResource) {
|
|
60
|
+
if (!installResource) {
|
|
61
|
+
await this.confirm(file, true);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const { changedFile, diff } = await this.diffService.diffContent(file.name, file.getContent(), installResource[file.remoteKey]);
|
|
65
|
+
file.setContent(changedFile);
|
|
66
|
+
if (diff) {
|
|
67
|
+
this.cli.writeWarning(`skipped ${file.name} (identical with remote)`);
|
|
68
|
+
file.skipFile();
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
await this.confirm(file);
|
|
72
|
+
}
|
|
73
|
+
async confirm(file, isNew = false) {
|
|
74
|
+
const confirm = await this.cli.confirm(`${isNew ? 'Create' : 'Update'} ${file.name}?`);
|
|
75
|
+
if (!confirm) {
|
|
76
|
+
file.skipFile();
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
if (isNew) {
|
|
80
|
+
this.cli.write(`consider new ${file.name}`, true);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
this.cli.write(`consider changed ${file.name}`, true);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async getInstallResource() {
|
|
88
|
+
let install = await this.builder.init(this.configName);
|
|
89
|
+
const remoteClone = await this.prepareRemoteInstallResource(install);
|
|
90
|
+
install = this.builder.updateFromRemote(remoteClone);
|
|
91
|
+
install.description = await this.cli.prompt('Describe new configuration:', {
|
|
92
|
+
defaultAnswer: install.description ? install.description : this.configName,
|
|
93
|
+
validator: input => input.trim() ? '' : 'Please enter something'
|
|
94
|
+
});
|
|
95
|
+
return install;
|
|
96
|
+
}
|
|
97
|
+
async prepareRemoteInstallResource(resource) {
|
|
98
|
+
if (resource && resource.version && resource.id) {
|
|
99
|
+
return await this.configApi.cloneInstall(resource);
|
|
100
|
+
}
|
|
101
|
+
return await this.configApi.addInstall(this.configName, resource.origins);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.default = InstallResourceHandler;
|
|
@@ -0,0 +1,13 @@
|
|
|
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";
|
|
5
|
+
export default class DeletedFileCheck {
|
|
6
|
+
private cli;
|
|
7
|
+
private readonly hasFileSelection;
|
|
8
|
+
private keysToDelete;
|
|
9
|
+
constructor(cli: CliService, hasFileSelection?: boolean);
|
|
10
|
+
hasDeletedFiles(builder: InstallResourceBuilder, files: InstallResourceInterface[]): Promise<void>;
|
|
11
|
+
checkForDeletedLocalFiles(installResource: Install): Promise<void>;
|
|
12
|
+
private getFileByRemoteKey;
|
|
13
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const INSTALL_RESOURCE_FILE_KEYS = [
|
|
4
|
+
'custom',
|
|
5
|
+
'sw',
|
|
6
|
+
'loader',
|
|
7
|
+
'dynamicFetcher',
|
|
8
|
+
'dynamicFetcherConfig',
|
|
9
|
+
'documentHandler',
|
|
10
|
+
'documentHandlerConfig',
|
|
11
|
+
'customStyle',
|
|
12
|
+
];
|
|
13
|
+
class DeletedFileCheck {
|
|
14
|
+
cli;
|
|
15
|
+
hasFileSelection;
|
|
16
|
+
keysToDelete = [];
|
|
17
|
+
constructor(cli, hasFileSelection = false) {
|
|
18
|
+
this.cli = cli;
|
|
19
|
+
this.hasFileSelection = hasFileSelection;
|
|
20
|
+
}
|
|
21
|
+
async hasDeletedFiles(builder, files) {
|
|
22
|
+
if (this.hasFileSelection) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const installResource = builder.resource;
|
|
26
|
+
for (let key of INSTALL_RESOURCE_FILE_KEYS) {
|
|
27
|
+
const file = this.getFileByRemoteKey(key, files);
|
|
28
|
+
if (!file && installResource[key]?.length > 0) {
|
|
29
|
+
const deleteResource = await this.cli.confirm(`Do you want to delete ${key} on installResource?`);
|
|
30
|
+
if (deleteResource) {
|
|
31
|
+
this.keysToDelete.push(key);
|
|
32
|
+
builder.changed = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async checkForDeletedLocalFiles(installResource) {
|
|
38
|
+
this.keysToDelete.forEach(key => {
|
|
39
|
+
installResource[key] = null;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
getFileByRemoteKey(key, files) {
|
|
43
|
+
const filteredFiles = files.filter((file) => {
|
|
44
|
+
return file.remoteKey === key;
|
|
45
|
+
});
|
|
46
|
+
if (filteredFiles.length > 0) {
|
|
47
|
+
return filteredFiles[0];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.default = DeletedFileCheck;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import DeployHandlerInterface from "../interface/deploy-handler-interface";
|
|
2
|
+
import ModuleFile from "../../integration-api/struct/module-file";
|
|
3
|
+
import RuntimeModifier from "../interface/runtime-modifier";
|
|
4
|
+
export default class ModuleHandler implements DeployHandlerInterface {
|
|
5
|
+
private readonly configApi;
|
|
6
|
+
private diffService;
|
|
7
|
+
private cli;
|
|
8
|
+
private modifiers;
|
|
9
|
+
constructor(configApi: any, diffService: any, cli: any, modifiers: RuntimeModifier[]);
|
|
10
|
+
canHandle(type: any): boolean;
|
|
11
|
+
handle(files: ModuleFile[]): Promise<any>;
|
|
12
|
+
upload(files: ModuleFile[]): Promise<any>;
|
|
13
|
+
private confirm;
|
|
14
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const module_file_1 = tslib_1.__importDefault(require("../../integration-api/struct/module-file"));
|
|
5
|
+
class ModuleHandler {
|
|
6
|
+
configApi;
|
|
7
|
+
diffService;
|
|
8
|
+
cli;
|
|
9
|
+
modifiers;
|
|
10
|
+
constructor(configApi, diffService, cli, modifiers) {
|
|
11
|
+
this.configApi = configApi;
|
|
12
|
+
this.diffService = diffService;
|
|
13
|
+
this.cli = cli;
|
|
14
|
+
this.modifiers = modifiers;
|
|
15
|
+
}
|
|
16
|
+
canHandle(type) {
|
|
17
|
+
return type === module_file_1.default;
|
|
18
|
+
}
|
|
19
|
+
async handle(files) {
|
|
20
|
+
for (let iterator = 0; iterator < files.length; iterator++) {
|
|
21
|
+
let file = files[iterator];
|
|
22
|
+
let remote = await this.configApi.getModule(file.name);
|
|
23
|
+
for (let iterator = 0; iterator < this.modifiers.length; iterator++) {
|
|
24
|
+
let modifier = this.modifiers[iterator];
|
|
25
|
+
if (modifier.canModify(file)) {
|
|
26
|
+
modifier.modify(file);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (!remote) {
|
|
30
|
+
await this.confirm(file, true);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
let { changedFile, diff } = await this.diffService.diffContent(file.name, file.getContent(), remote);
|
|
34
|
+
file.setContent(changedFile);
|
|
35
|
+
if (diff) {
|
|
36
|
+
this.cli.writeWarning(`skipped ${file.name} (identical with remote)`);
|
|
37
|
+
file.skipFile();
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
await this.confirm(file);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async upload(files) {
|
|
44
|
+
const filesToUpload = files.filter((file) => {
|
|
45
|
+
return !file.shouldSkipFile();
|
|
46
|
+
});
|
|
47
|
+
if (filesToUpload.length === 0) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
this.cli.write('');
|
|
51
|
+
this.cli.write('Summary');
|
|
52
|
+
this.cli.writeBuffer();
|
|
53
|
+
if (await this.cli.confirm(`${filesToUpload.length} Module(s) will be uploaded now. Proceed?`)) {
|
|
54
|
+
for (let iterator = 0; iterator < files.length; iterator++) {
|
|
55
|
+
let file = files[iterator];
|
|
56
|
+
await this.configApi.setModule(file.getContent(), file.name);
|
|
57
|
+
for (let iterator = 0; iterator < this.modifiers.length; iterator++) {
|
|
58
|
+
let modifier = this.modifiers[iterator];
|
|
59
|
+
if (modifier.canModify(file)) {
|
|
60
|
+
modifier.revert(file);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async confirm(file, isNew = false) {
|
|
67
|
+
const confirm = await this.cli.confirm(`${isNew ? 'Create' : 'Update'} ${file.name}?`);
|
|
68
|
+
if (!confirm) {
|
|
69
|
+
file.skipFile();
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
if (isNew) {
|
|
73
|
+
this.cli.write(`consider new ${file.name}`, true);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
this.cli.write(`consider changed ${file.name}`, true);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.default = ModuleHandler;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import RuntimeModifier from "../../interface/runtime-modifier";
|
|
2
|
+
import { ModuleInterface } from "../../../integration-api/integration-api-model";
|
|
3
|
+
export default class DeploymentDetectionModifier implements RuntimeModifier {
|
|
4
|
+
private readonly slackToken;
|
|
5
|
+
constructor(slackToken?: string);
|
|
6
|
+
canModify(file: ModuleInterface): boolean;
|
|
7
|
+
modify(file: ModuleInterface): void;
|
|
8
|
+
revert(file: ModuleInterface): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const FILE = 'deploymentDetection';
|
|
4
|
+
const SLACK_TOKEN_PLACEHOLDER = '<1Password deployment token>';
|
|
5
|
+
class DeploymentDetectionModifier {
|
|
6
|
+
slackToken;
|
|
7
|
+
constructor(slackToken) {
|
|
8
|
+
this.slackToken = slackToken;
|
|
9
|
+
}
|
|
10
|
+
canModify(file) {
|
|
11
|
+
return file.name === FILE;
|
|
12
|
+
}
|
|
13
|
+
modify(file) {
|
|
14
|
+
if (this.slackToken) {
|
|
15
|
+
file.setContent(file.getContent().replace(SLACK_TOKEN_PLACEHOLDER, this.slackToken));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
revert(file) {
|
|
19
|
+
if (this.slackToken) {
|
|
20
|
+
file.setContent(file.getContent().replace(this.slackToken, SLACK_TOKEN_PLACEHOLDER));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = DeploymentDetectionModifier;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import DeployHandlerInterface from "../interface/deploy-handler-interface";
|
|
2
|
+
import ServerConfigFile from "../../integration-api/struct/server-config-file";
|
|
3
|
+
export default class ServerConfigHandler implements DeployHandlerInterface {
|
|
4
|
+
private readonly configApi;
|
|
5
|
+
private diffService;
|
|
6
|
+
private cli;
|
|
7
|
+
constructor(configApi: any, diffService: any, cli: any);
|
|
8
|
+
canHandle(type: any): boolean;
|
|
9
|
+
handle(files: ServerConfigFile[]): Promise<any>;
|
|
10
|
+
upload(files: ServerConfigFile[]): Promise<any>;
|
|
11
|
+
private confirm;
|
|
12
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const server_config_file_1 = tslib_1.__importDefault(require("../../integration-api/struct/server-config-file"));
|
|
5
|
+
class ServerConfigHandler {
|
|
6
|
+
configApi;
|
|
7
|
+
diffService;
|
|
8
|
+
cli;
|
|
9
|
+
constructor(configApi, diffService, cli) {
|
|
10
|
+
this.configApi = configApi;
|
|
11
|
+
this.diffService = diffService;
|
|
12
|
+
this.cli = cli;
|
|
13
|
+
}
|
|
14
|
+
canHandle(type) {
|
|
15
|
+
return type === server_config_file_1.default;
|
|
16
|
+
}
|
|
17
|
+
async handle(files) {
|
|
18
|
+
let file = files[0];
|
|
19
|
+
let remote = await this.configApi.getServerConfig();
|
|
20
|
+
if (!remote) {
|
|
21
|
+
this.cli.writeError(`${file.name} could not be found on remote`);
|
|
22
|
+
await this.confirm(file, true);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const remoteConfig = JSON.parse(remote);
|
|
26
|
+
file.config.revision.version = remoteConfig.revision.version;
|
|
27
|
+
const { changedFile, diff } = await this.diffService.diffContent(file.name, file.getContent(), remote);
|
|
28
|
+
file.setContent(changedFile);
|
|
29
|
+
if (diff) {
|
|
30
|
+
this.cli.writeWarning(`skipped ${file.name} (identical with remote)`);
|
|
31
|
+
file.skipFile();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
await this.confirm(file);
|
|
35
|
+
}
|
|
36
|
+
async upload(files) {
|
|
37
|
+
const file = files[0];
|
|
38
|
+
if (file.shouldSkipFile()) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.cli.write('');
|
|
42
|
+
this.cli.write('Summary');
|
|
43
|
+
this.cli.writeBuffer();
|
|
44
|
+
if (await this.cli.confirm(`ServerConfig will be uploaded now. Proceed?`)) {
|
|
45
|
+
await this.configApi.setServerConfig(file.getContent(), file.config.revision.version);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async confirm(file, isNew = false) {
|
|
49
|
+
const confirm = await this.cli.confirm(`Deploy ${file.name}?`, true);
|
|
50
|
+
if (!confirm) {
|
|
51
|
+
file.skipFile();
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
if (isNew) {
|
|
55
|
+
this.cli.writeSuccess(`${file.name} is new`, true);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
this.cli.writeSuccess(`${file.name} has changed`, true);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.default = ServerConfigHandler;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import InstallConfigs from './install-configs';
|
|
2
|
+
export default interface Install extends Partial<InstallConfigs<string>> {
|
|
3
|
+
id?: string;
|
|
4
|
+
version?: number;
|
|
5
|
+
acl?: string;
|
|
6
|
+
createdAt?: Date;
|
|
7
|
+
updatedAt?: Date;
|
|
8
|
+
status?: string;
|
|
9
|
+
swVersion?: string;
|
|
10
|
+
domain: string;
|
|
11
|
+
configVersion?: number;
|
|
12
|
+
description?: string;
|
|
13
|
+
origins?: string[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiffContext = void 0;
|
|
4
|
+
class DiffContext {
|
|
5
|
+
executablePath;
|
|
6
|
+
executableTemplate;
|
|
7
|
+
constructor(executablePath, executableTemplate) {
|
|
8
|
+
this.executablePath = executablePath;
|
|
9
|
+
this.executableTemplate = executableTemplate;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.DiffContext = DiffContext;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiffServiceFactory = void 0;
|
|
4
|
+
const cli_1 = require("../cli");
|
|
5
|
+
const _1 = require(".");
|
|
6
|
+
class DiffServiceFactory {
|
|
7
|
+
context;
|
|
8
|
+
service = undefined;
|
|
9
|
+
constructor(context) {
|
|
10
|
+
this.context = context;
|
|
11
|
+
}
|
|
12
|
+
getService() {
|
|
13
|
+
if (!(this.service instanceof _1.DiffService)) {
|
|
14
|
+
const cliService = new cli_1.CliServiceFactory().getService();
|
|
15
|
+
this.service = new _1.DiffService(cliService, this.context.executablePath, this.context.executableTemplate);
|
|
16
|
+
}
|
|
17
|
+
return this.service;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.DiffServiceFactory = DiffServiceFactory;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CliService } from "../cli";
|
|
2
|
+
export declare class DiffService {
|
|
3
|
+
private cli;
|
|
4
|
+
private diffExecutablePath?;
|
|
5
|
+
private diffExecutableTemplate?;
|
|
6
|
+
private tempPath;
|
|
7
|
+
constructor(cli: CliService, diffExecutablePath?: string, diffExecutableTemplate?: string);
|
|
8
|
+
diff(localPath: string, fileName: string, tmpContent: string): Promise<boolean>;
|
|
9
|
+
diffContent(fileName: string, localContent: string, remoteContent: string): Promise<{
|
|
10
|
+
changedFile: string;
|
|
11
|
+
diff: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* Returns a temporal directory path.
|
|
15
|
+
*/
|
|
16
|
+
getTemporalDirectoryPath(): Promise<string>;
|
|
17
|
+
writeContentToTemporalFile(tempFileName: string, content: string): Promise<string>;
|
|
18
|
+
/**
|
|
19
|
+
* @param localContent local file content.
|
|
20
|
+
* @param remoteContent remote content.
|
|
21
|
+
* @description removes whitespaces, newlines and compares both params content for equality.
|
|
22
|
+
* @return returns true if both localContent and remoteContent are equal otherwise returns false.
|
|
23
|
+
*/
|
|
24
|
+
isContentEqual(localContent?: string, remoteContent?: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* check if content of two files are equal
|
|
28
|
+
*
|
|
29
|
+
* @param localPath
|
|
30
|
+
* @param remotePath
|
|
31
|
+
* @param skipDiffExecution
|
|
32
|
+
*/
|
|
33
|
+
executeDiff(localPath: string, remotePath: string, skipDiffExecution?: boolean): Promise<boolean>;
|
|
34
|
+
}
|