@speedkit/cli 2.26.0 → 2.27.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.
Files changed (144) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +1 -1
  3. package/dist/models/files.d.ts +4 -0
  4. package/dist/models/files.js +4 -0
  5. package/dist/services/cli/error/cli-type-error.d.ts +1 -2
  6. package/dist/services/cli/error/cli-type-error.js +1 -3
  7. package/dist/services/config-api/context/config-api-context.d.ts +1 -2
  8. package/dist/services/config-api/factory/config-api-service-factory.js +1 -2
  9. package/dist/services/config-api/interface/config-api-context-interface.d.ts +1 -2
  10. package/dist/services/deploy/checks/post-deploy/save-files-check.d.ts +1 -1
  11. package/dist/services/deploy/checks/pre-deploy/split-change-check.d.ts +1 -2
  12. package/dist/services/deploy/deploy-service-factory.js +3 -4
  13. package/dist/services/deploy/deploy-service.d.ts +3 -2
  14. package/dist/services/deploy/deploy-service.js +23 -1
  15. package/dist/services/deploy/handler/customer-config-handler.d.ts +4 -5
  16. package/dist/services/deploy/handler/customer-config-handler.js +2 -2
  17. package/dist/services/deploy/handler/install-resource-handler.d.ts +3 -4
  18. package/dist/services/deploy/handler/install-resource-handler.js +2 -3
  19. package/dist/services/deploy/handler/module-handler.d.ts +8 -5
  20. package/dist/services/deploy/handler/module-handler.js +2 -3
  21. package/dist/services/deploy/handler/server-config-handler.d.ts +9 -6
  22. package/dist/services/deploy/handler/server-config-handler.js +6 -4
  23. package/dist/services/document-handler-runtime/document-handler-runtime-service.d.ts +2 -3
  24. package/dist/services/document-handler-runtime/document-handler-runtime-service.js +2 -6
  25. package/dist/services/document-handler-runtime/document-handler-server.d.ts +1 -2
  26. package/dist/services/document-handler-runtime/document-handler-server.js +2 -5
  27. package/dist/services/document-handler-runtime/error/required-file-not-found-error.d.ts +1 -2
  28. package/dist/services/document-handler-runtime/error/required-file-not-found-error.js +1 -3
  29. package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +3 -6
  30. package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +9 -18
  31. package/dist/services/integration-api/error/customer-config-legacy-error.d.ts +1 -2
  32. package/dist/services/integration-api/error/customer-config-legacy-error.js +1 -3
  33. package/dist/services/integration-api/error/handler/customer-config-legacy-handler.d.ts +1 -2
  34. package/dist/services/integration-api/error/handler/customer-config-legacy-handler.js +1 -1
  35. package/dist/services/integration-api/error/handler/origin-handler.d.ts +1 -2
  36. package/dist/services/integration-api/error/handler/origin-handler.js +1 -1
  37. package/dist/services/integration-api/error/origin-error.d.ts +1 -2
  38. package/dist/services/integration-api/error/origin-error.js +1 -3
  39. package/dist/services/integration-api/file-list.d.ts +3 -5
  40. package/dist/services/integration-api/file-list.js +6 -10
  41. package/dist/services/integration-api/file-reader.d.ts +14 -6
  42. package/dist/services/integration-api/file-reader.js +8 -8
  43. package/dist/services/integration-api/file-writer.d.ts +10 -2
  44. package/dist/services/integration-api/file-writer.js +9 -6
  45. package/dist/services/integration-api/handler/customer-config-handler.js +6 -8
  46. package/dist/services/integration-api/handler/install-resource-handler.js +3 -4
  47. package/dist/services/integration-api/handler/module-handler.js +2 -2
  48. package/dist/services/integration-api/handler/server-config-handler.js +2 -2
  49. package/dist/services/integration-api/index.d.ts +3 -0
  50. package/dist/services/integration-api/index.js +6 -0
  51. package/dist/services/integration-api/integration-api-factory.d.ts +13 -0
  52. package/dist/services/integration-api/integration-api-factory.js +50 -0
  53. package/dist/services/integration-api/integration-api-model.d.ts +33 -14
  54. package/dist/services/integration-api/integration-api-model.js +37 -0
  55. package/dist/services/integration-api/integration-api-service.d.ts +1 -2
  56. package/dist/services/integration-api/integration-api-service.js +3 -23
  57. package/dist/services/integration-api/spec/customer-config-validator.spec.d.ts +1 -0
  58. package/dist/services/integration-api/spec/customer-config-validator.spec.js +50 -0
  59. package/dist/services/integration-api/spec/file-list.spec.d.ts +1 -0
  60. package/dist/services/integration-api/spec/file-list.spec.js +163 -0
  61. package/dist/services/integration-api/spec/file-reader.spec.d.ts +1 -0
  62. package/dist/services/integration-api/spec/file-reader.spec.js +71 -0
  63. package/dist/services/integration-api/spec/file-writer.spec.d.ts +1 -0
  64. package/dist/services/integration-api/spec/file-writer.spec.js +55 -0
  65. package/dist/services/integration-api/spec/integration-api-service.spec.d.ts +1 -0
  66. package/dist/services/integration-api/spec/integration-api-service.spec.js +122 -0
  67. package/dist/services/integration-api/spec/mandatory-files-validator.spec.d.ts +1 -0
  68. package/dist/services/integration-api/spec/mandatory-files-validator.spec.js +105 -0
  69. package/dist/services/integration-api/struct/customer-config-file.d.ts +3 -4
  70. package/dist/services/integration-api/struct/customer-config-file.js +7 -6
  71. package/dist/services/integration-api/struct/customer-config.d.ts +3 -5
  72. package/dist/services/integration-api/struct/customer-config.js +5 -8
  73. package/dist/services/integration-api/struct/file.d.ts +4 -4
  74. package/dist/services/integration-api/struct/file.js +6 -6
  75. package/dist/services/integration-api/struct/install-resource-file.d.ts +4 -3
  76. package/dist/services/integration-api/struct/install-resource-file.js +7 -5
  77. package/dist/services/integration-api/struct/module-file.d.ts +4 -3
  78. package/dist/services/integration-api/struct/module-file.js +7 -5
  79. package/dist/services/integration-api/struct/ro-file.d.ts +2 -2
  80. package/dist/services/integration-api/struct/ro-file.js +1 -1
  81. package/dist/services/integration-api/struct/server-config-file.d.ts +5 -4
  82. package/dist/services/integration-api/struct/server-config-file.js +7 -5
  83. package/dist/services/integration-api/struct/virtual-file.d.ts +2 -2
  84. package/dist/services/integration-api/struct/virtual-file.js +2 -1
  85. package/dist/services/integration-api/validator/customer-config-validator.d.ts +5 -1
  86. package/dist/services/integration-api/validator/customer-config-validator.js +28 -17
  87. package/dist/services/integration-api/virtual/static-recipe.d.ts +6 -0
  88. package/dist/services/integration-api/virtual/static-recipe.js +14 -0
  89. package/dist/services/integration-api/virtual/virtual-file-handler.js +2 -2
  90. package/dist/services/onboarding/config-renderer/speed-kit-install-context.d.ts +1 -2
  91. package/dist/services/onboarding/dashboard/index.d.ts +1 -1
  92. package/dist/services/onboarding/dashboard/parameter-query-builder.d.ts +1 -2
  93. package/dist/services/onboarding/fetch-event-handler.d.ts +1 -1
  94. package/dist/services/onboarding/fetch-events/customer-domain-document-response.d.ts +1 -2
  95. package/dist/services/onboarding/fetch-events/customer-service-worker-js.d.ts +1 -1
  96. package/dist/services/onboarding/fetch-events/speed-kit-asset-request.d.ts +1 -1
  97. package/dist/services/onboarding/fetch-events/speed-kit-install-html.d.ts +1 -1
  98. package/dist/services/onboarding/fetch-events/speed-kit-install-js.d.ts +1 -2
  99. package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +1 -1
  100. package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +1 -2
  101. package/dist/services/onboarding/file-events/file-watcher.d.ts +1 -2
  102. package/dist/services/onboarding/file-events/file-watcher.js +3 -3
  103. package/dist/services/onboarding/onboarding-service-factory.js +9 -13
  104. package/dist/services/onboarding/onboarding-service.d.ts +1 -1
  105. package/dist/services/onboarding/todo-collector.js +2 -2
  106. package/dist/services/pull/pull-service-factory.js +3 -4
  107. package/dist/services/pull/pull-service.d.ts +1 -1
  108. package/dist/services/pull/pull-service.js +2 -3
  109. package/oclif.manifest.json +1 -1
  110. package/package.json +5 -5
  111. package/dist/services/context/error/context-runtime-error.d.ts +0 -3
  112. package/dist/services/context/error/context-runtime-error.js +0 -7
  113. package/dist/services/context/interface/context-interface.d.ts +0 -2
  114. package/dist/services/context/interface/context-interface.js +0 -2
  115. package/dist/services/document-handler-runtime/error/handler/required-file-not-found-handler.d.ts +0 -6
  116. package/dist/services/document-handler-runtime/error/handler/required-file-not-found-handler.js +0 -14
  117. package/dist/services/error-handling/abstract/abstract-async-error-handling-factory.d.ts +0 -6
  118. package/dist/services/error-handling/abstract/abstract-async-error-handling-factory.js +0 -19
  119. package/dist/services/error-handling/abstract/abstract-async-error-handling-service.d.ts +0 -6
  120. package/dist/services/error-handling/abstract/abstract-async-error-handling-service.js +0 -18
  121. package/dist/services/error-handling/abstract/abstract-error-handling-factory.d.ts +0 -6
  122. package/dist/services/error-handling/abstract/abstract-error-handling-factory.js +0 -19
  123. package/dist/services/error-handling/abstract/abstract-error-handling-service.d.ts +0 -6
  124. package/dist/services/error-handling/abstract/abstract-error-handling-service.js +0 -19
  125. package/dist/services/error-handling/error/application-error.d.ts +0 -5
  126. package/dist/services/error-handling/error/application-error.js +0 -11
  127. package/dist/services/error-handling/error-handling-service.d.ts +0 -7
  128. package/dist/services/error-handling/error-handling-service.js +0 -27
  129. package/dist/services/error-handling/factory/error-handling-factory.d.ts +0 -5
  130. package/dist/services/error-handling/factory/error-handling-factory.js +0 -22
  131. package/dist/services/error-handling/interface/error-context-interface.d.ts +0 -6
  132. package/dist/services/error-handling/interface/error-context-interface.js +0 -2
  133. package/dist/services/error-handling/interface/error-handler-interface.d.ts +0 -5
  134. package/dist/services/error-handling/interface/error-handler-interface.js +0 -2
  135. package/dist/services/error-handling/interface/error-handling-factory-interface.d.ts +0 -8
  136. package/dist/services/error-handling/interface/error-handling-factory-interface.js +0 -2
  137. package/dist/services/error-handling/interface/error-handling-service-interface.d.ts +0 -8
  138. package/dist/services/error-handling/interface/error-handling-service-interface.js +0 -2
  139. package/dist/services/integration-api/context/integration-api-context.d.ts +0 -9
  140. package/dist/services/integration-api/context/integration-api-context.js +0 -20
  141. package/dist/services/integration-api/error/handler/customer-config-handler.d.ts +0 -5
  142. package/dist/services/integration-api/error/handler/customer-config-handler.js +0 -19
  143. package/dist/services/integration-api/factory/integration-api-service-factory.d.ts +0 -13
  144. package/dist/services/integration-api/factory/integration-api-service-factory.js +0 -55
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ # [2.27.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.26.0...v2.27.0) (2024-05-03)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **testing:** path to junit.xml ([7e73d70](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/7e73d70668a4cb9ae4f25420556fa846ab1bdb7b))
7
+
8
+
9
+ ### Features
10
+
11
+ * **files_api:** add test for customer_config_validator ([ae3d846](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/ae3d846cfcd9d084fb8fb32d69083c8376e8f728))
12
+ * **files_api:** add test for integrationApiService ([492848d](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/492848d2d58ef8c1e1d2839f9c37777290896f00))
13
+ * **files_api:** add test for mandatoryFiles ([2a9cff7](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/2a9cff7bc6eadf43b136dac6f88b34c67a3ae3b6))
14
+ * **files_api:** refactor and cleanup ([8b926fb](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/8b926fbc4ba969b299386f109a75f6a36c1328c7))
15
+ * **files-api:** add tests ([212f7c9](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/212f7c9205d56e36a1ff6f5a6022ef54ab3b4ccc))
16
+ * **files-api:** update packageJson ([24a789f](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/24a789f8fc05829366a90f875de3ea3c5b6bf75e))
17
+ * **onboarding:** update docs ([69d802a](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/69d802a9655c66f4983d6e0e9cc00c595a6559c0))
18
+
1
19
  # [2.26.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.25.0...v2.26.0) (2024-04-19)
2
20
 
3
21
 
package/README.md CHANGED
@@ -21,7 +21,7 @@ $ npm install -g @speedkit/cli
21
21
  $ sk COMMAND
22
22
  running command...
23
23
  $ sk (--version)
24
- @speedkit/cli/2.26.0 linux-x64 node-v20.12.2
24
+ @speedkit/cli/2.27.0 linux-x64 node-v20.12.2
25
25
  $ sk --help [COMMAND]
26
26
  USAGE
27
27
  $ sk COMMAND
@@ -17,4 +17,8 @@ export declare const INTEGRATION_FILES: {
17
17
  INSTALL: string;
18
18
  DOCUMENT_HANDLER: string;
19
19
  };
20
+ DEPRECATED: {
21
+ ASSET_HANDLER: string;
22
+ DEPLOYMENT_DETECTION: string;
23
+ };
20
24
  };
@@ -20,4 +20,8 @@ exports.INTEGRATION_FILES = {
20
20
  INSTALL: "bundle_install",
21
21
  DOCUMENT_HANDLER: "bundle_documentHandler",
22
22
  },
23
+ DEPRECATED: {
24
+ ASSET_HANDLER: "speedKit.Asset",
25
+ DEPLOYMENT_DETECTION: "deployment_detection",
26
+ },
23
27
  };
@@ -1,3 +1,2 @@
1
- import ApplicationError from "../../error-handling/error/application-error";
2
- export default class CliTypeError extends ApplicationError {
1
+ export default class CliTypeError extends Error {
3
2
  }
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
5
- class CliTypeError extends application_error_1.default {
3
+ class CliTypeError extends Error {
6
4
  }
7
5
  exports.default = CliTypeError;
@@ -1,5 +1,4 @@
1
- import ContextInterface from "../../context/interface/context-interface";
2
- export default class ConfigApiContext implements ContextInterface {
1
+ export default class ConfigApiContext {
3
2
  readonly app: string;
4
3
  constructor(app: string);
5
4
  }
@@ -4,7 +4,6 @@ const tslib_1 = require("tslib");
4
4
  const config_api_service_1 = tslib_1.__importDefault(require("../config-api-service"));
5
5
  const client_1 = tslib_1.__importDefault(require("../client"));
6
6
  const entity_manager_factory_1 = tslib_1.__importDefault(require("./entity-manager-factory"));
7
- const context_runtime_error_1 = tslib_1.__importDefault(require("../../context/error/context-runtime-error"));
8
7
  const node_fs_1 = require("node:fs");
9
8
  const node_os_1 = tslib_1.__importDefault(require("node:os"));
10
9
  const node_path_1 = tslib_1.__importDefault(require("node:path"));
@@ -22,7 +21,7 @@ class ConfigApiServiceFactory {
22
21
  }
23
22
  buildService() {
24
23
  if (!this.context.app) {
25
- throw new context_runtime_error_1.default({ message: "app is undefined" });
24
+ throw new Error("app is undefined");
26
25
  }
27
26
  this.createLoginTokenFileIfNotExists();
28
27
  const entityManagerFactory = new entity_manager_factory_1.default();
@@ -1,4 +1,3 @@
1
- import ContextInterface from "../../context/interface/context-interface";
2
- export default interface ConfigApiContextInterface extends ContextInterface {
1
+ export default interface ConfigApiContextInterface {
3
2
  app: string;
4
3
  }
@@ -1,5 +1,5 @@
1
1
  import { CliService } from "../../../cli";
2
- import { FileListInterface } from "../../../integration-api/integration-api-model";
2
+ import { FileListInterface } from "../../../integration-api";
3
3
  import { PostDeployCheckInterface } from "../../deploy-service-model";
4
4
  export default class SaveFilesCheck implements PostDeployCheckInterface {
5
5
  private fileList;
@@ -1,7 +1,6 @@
1
- import { FileListInterface } from "../../../integration-api/integration-api-model";
1
+ import { FileListInterface, CustomerConfig } from "../../../integration-api";
2
2
  import { CliServiceInterface } from "../../../cli";
3
3
  import ConfigApiService from "../../../config-api/config-api-service";
4
- import CustomerConfig from "../../../integration-api/struct/customer-config";
5
4
  export declare class SplitChangeCheck {
6
5
  private cli;
7
6
  private fileList;
@@ -5,8 +5,6 @@ const cli_1 = require("../cli");
5
5
  const config_api_context_1 = tslib_1.__importDefault(require("../config-api/context/config-api-context"));
6
6
  const config_api_service_factory_1 = tslib_1.__importDefault(require("../config-api/factory/config-api-service-factory"));
7
7
  const diff_1 = require("../diff");
8
- const integration_api_context_1 = tslib_1.__importDefault(require("../integration-api/context/integration-api-context"));
9
- const integration_api_service_factory_1 = tslib_1.__importDefault(require("../integration-api/factory/integration-api-service-factory"));
10
8
  const install_resource_builder_1 = tslib_1.__importDefault(require("./builder/install-resource-builder"));
11
9
  const revalidated_module_check_1 = tslib_1.__importDefault(require("./checks/post-deploy/revalidated-module-check"));
12
10
  const save_files_check_1 = tslib_1.__importDefault(require("./checks/post-deploy/save-files-check"));
@@ -17,6 +15,7 @@ const deleted_file_check_1 = tslib_1.__importDefault(require("./handler/install-
17
15
  const module_handler_1 = tslib_1.__importDefault(require("./handler/module-handler"));
18
16
  const deployment_detection_modifier_1 = tslib_1.__importDefault(require("./handler/module-modifier/deployment-detection-modifier"));
19
17
  const server_config_handler_1 = tslib_1.__importDefault(require("./handler/server-config-handler"));
18
+ const integration_api_1 = require("../integration-api");
20
19
  const split_change_check_1 = require("./checks/pre-deploy/split-change-check");
21
20
  class DeployServiceFactory {
22
21
  context;
@@ -58,8 +57,8 @@ class DeployServiceFactory {
58
57
  return new config_api_service_factory_1.default(configApiContext).getService();
59
58
  }
60
59
  async getIntegrationFiles() {
61
- const integrationApiContext = new integration_api_context_1.default(this.context.customerPath, this.context.configName, this.context.artifacts);
62
- const integrationApi = new integration_api_service_factory_1.default(integrationApiContext, this.cliConfig).buildService();
60
+ const integrationApiContext = new integration_api_1.IntegrationApiContext(this.context.customerPath, this.context.configName, this.context.artifacts);
61
+ const integrationApi = new integration_api_1.IntegrationApiFactory(integrationApiContext, this.cliConfig).buildService();
63
62
  return integrationApi.run();
64
63
  }
65
64
  getPostDeployChecks(files, cliService, configApi, app) {
@@ -1,6 +1,6 @@
1
1
  import DeployHandlerInterface from "./interface/deploy-handler-interface";
2
2
  import { CliService } from "../cli";
3
- import { FileListInterface } from "../integration-api/integration-api-model";
3
+ import { FileListInterface } from "../integration-api/";
4
4
  import { PostDeployCheckInterface, PreDeployCheckInterface } from "./deploy-service-model";
5
5
  export default class DeployService {
6
6
  private readonly fileList;
@@ -9,10 +9,11 @@ export default class DeployService {
9
9
  private readonly preDeployChecks;
10
10
  private readonly postDeployChecks;
11
11
  private readonly dryRun;
12
- constructor(fileList: FileListInterface, deployHandler: DeployHandlerInterface[], cli: CliService, preDeployChecks: PreDeployCheckInterface[], postDeployChecks: PostDeployCheckInterface[], dryRun: boolean);
12
+ constructor(fileList: FileListInterface, deployHandler: DeployHandlerInterface[], cli: CliService, preDeployChecks: PreDeployCheckInterface[], postDeployChecks: PostDeployCheckInterface[], dryRun?: boolean);
13
13
  run(): Promise<void>;
14
14
  private handleType;
15
15
  private uploadType;
16
16
  private runPreDeployChecks;
17
17
  private runPostDeployChecks;
18
+ private filterFilesToProcess;
18
19
  }
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const files_1 = require("../../models/files");
3
4
  class DeployService {
4
5
  fileList;
5
6
  deployHandler;
@@ -7,7 +8,7 @@ class DeployService {
7
8
  preDeployChecks;
8
9
  postDeployChecks;
9
10
  dryRun;
10
- constructor(fileList, deployHandler, cli, preDeployChecks, postDeployChecks, dryRun) {
11
+ constructor(fileList, deployHandler, cli, preDeployChecks, postDeployChecks, dryRun = false) {
11
12
  this.fileList = fileList;
12
13
  this.deployHandler = deployHandler;
13
14
  this.cli = cli;
@@ -16,6 +17,7 @@ class DeployService {
16
17
  this.dryRun = dryRun;
17
18
  }
18
19
  async run() {
20
+ this.filterFilesToProcess();
19
21
  const types = this.fileList.getTypes();
20
22
  this.cli.spacer();
21
23
  this.cli.write(`App: "${this.fileList.getCustomerConfig().config.app}", Install: "${this.fileList.getCustomerConfig().config.name}"`);
@@ -62,5 +64,25 @@ class DeployService {
62
64
  await check.check();
63
65
  }
64
66
  }
67
+ filterFilesToProcess() {
68
+ this.fileList.filter((file) => {
69
+ // if we have a documentHandlerConfig we don't need an assetHandler
70
+ if (file.name === files_1.INTEGRATION_FILES.DEPRECATED.ASSET_HANDLER &&
71
+ this.fileList.hasFile(files_1.INTEGRATION_FILES.CONFIG.DOCUMENT_HANDLER)) {
72
+ return false;
73
+ }
74
+ // if we don't have a documentHandlerConfig we don't need styles
75
+ if (file.name === files_1.INTEGRATION_FILES.CONFIG.DYNAMIC_STYLES &&
76
+ !this.fileList.hasFile(files_1.INTEGRATION_FILES.CONFIG.DOCUMENT_HANDLER)) {
77
+ return false;
78
+ }
79
+ // if we don't have a documentHandlerConfig we don't need dynamicBlocks
80
+ if (file.name === files_1.INTEGRATION_FILES.CONFIG.DYNAMIC_BLOCKS &&
81
+ !this.fileList.hasFile(files_1.INTEGRATION_FILES.CONFIG.DOCUMENT_HANDLER)) {
82
+ return false;
83
+ }
84
+ return true;
85
+ });
86
+ }
65
87
  }
66
88
  exports.default = DeployService;
@@ -1,6 +1,5 @@
1
1
  import DeployHandlerInterface from "../interface/deploy-handler-interface";
2
- import CustomerConfigFile from "../../integration-api/struct/customer-config-file";
3
- import CustomerConfig from "../../integration-api/struct/customer-config";
2
+ import { CustomerConfig, CustomerConfigFile, FILE_TYPE } from "../../integration-api/";
4
3
  import ConfigApi from "../../config-api/config-api-service";
5
4
  import { DiffService } from "../../diff";
6
5
  import { CliService } from "../../cli";
@@ -13,9 +12,9 @@ export default class CustomerConfigHandler implements DeployHandlerInterface {
13
12
  private cli;
14
13
  private builder;
15
14
  constructor(customer: CustomerConfig, configApi: ConfigApi, configName: string, diffService: DiffService, cli: CliService, builder: InstallResourceBuilder);
16
- canHandle(type: any): boolean;
17
- handle(files: CustomerConfigFile[]): Promise<any>;
18
- upload(files: CustomerConfigFile[]): Promise<any>;
15
+ canHandle(type: FILE_TYPE): boolean;
16
+ handle(files: CustomerConfigFile[]): Promise<void>;
17
+ upload(files: CustomerConfigFile[]): Promise<void>;
19
18
  private handleMissingRemoteInstallResource;
20
19
  private prepareOriginDiff;
21
20
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const customer_config_file_1 = tslib_1.__importDefault(require("../../integration-api/struct/customer-config-file"));
4
+ const integration_api_1 = require("../../integration-api/");
5
5
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
6
  class CustomerConfigHandler {
7
7
  customer;
@@ -19,7 +19,7 @@ class CustomerConfigHandler {
19
19
  this.builder = builder;
20
20
  }
21
21
  canHandle(type) {
22
- return type === customer_config_file_1.default;
22
+ return type === integration_api_1.FILE_TYPE.CUSTOMER_FILE;
23
23
  }
24
24
  async handle(files) {
25
25
  const installResource = await this.configApi.getActiveInstall(this.configName);
@@ -1,11 +1,10 @@
1
1
  import DeployHandlerInterface from "../interface/deploy-handler-interface";
2
- import CustomerConfig from "../../integration-api/struct/customer-config";
3
2
  import ConfigApi from "../../config-api/config-api-service";
4
3
  import { DiffService } from "../../diff";
5
4
  import { CliService } from "../../cli";
6
5
  import InstallResourceBuilder from "../builder/install-resource-builder";
7
6
  import DeletedFileCheck from "./install-resource-modifier/deleted-file-check";
8
- import { InstallResourceInterface } from "../../integration-api/integration-api-model";
7
+ import { InstallResourceInterface, CustomerConfig, FILE_TYPE } from "../../integration-api";
9
8
  export default class InstallResourceHandler implements DeployHandlerInterface {
10
9
  private readonly customer;
11
10
  private readonly configApi;
@@ -15,9 +14,9 @@ export default class InstallResourceHandler implements DeployHandlerInterface {
15
14
  private builder;
16
15
  private deletedFilesChecker;
17
16
  constructor(customer: CustomerConfig, configApi: ConfigApi, configName: string, diffService: DiffService, cli: CliService, builder: InstallResourceBuilder, deletedFilesChecker: DeletedFileCheck);
18
- canHandle(type: any): boolean;
17
+ canHandle(type: FILE_TYPE): boolean;
19
18
  handle(files: InstallResourceInterface[]): Promise<void>;
20
- upload(files: InstallResourceInterface[]): Promise<any>;
19
+ upload(files: InstallResourceInterface[]): Promise<void>;
21
20
  private processFile;
22
21
  private confirm;
23
22
  private getInstallResource;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
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"));
3
+ const integration_api_1 = require("../../integration-api");
5
4
  class InstallResourceHandler {
6
5
  customer;
7
6
  configApi;
@@ -20,7 +19,7 @@ class InstallResourceHandler {
20
19
  this.deletedFilesChecker = deletedFilesChecker;
21
20
  }
22
21
  canHandle(type) {
23
- return type === install_resource_file_1.default;
22
+ return type === integration_api_1.FILE_TYPE.INSTALL_FILE;
24
23
  }
25
24
  async handle(files) {
26
25
  const installResource = await this.configApi.getActiveInstall(this.configName);
@@ -1,14 +1,17 @@
1
1
  import DeployHandlerInterface from "../interface/deploy-handler-interface";
2
- import ModuleFile from "../../integration-api/struct/module-file";
2
+ import { FILE_TYPE, ModuleFile } from "../../integration-api";
3
+ import ConfigApi from "../../config-api/config-api-service";
4
+ import { DiffService } from "../../diff";
5
+ import { CliService } from "../../cli";
3
6
  import RuntimeModifier from "../interface/runtime-modifier";
4
7
  export default class ModuleHandler implements DeployHandlerInterface {
5
8
  private readonly configApi;
6
9
  private diffService;
7
10
  private cli;
8
11
  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>;
12
+ constructor(configApi: ConfigApi, diffService: DiffService, cli: CliService, modifiers: RuntimeModifier[]);
13
+ canHandle(type: FILE_TYPE): boolean;
14
+ handle(files: ModuleFile[]): Promise<void>;
15
+ upload(files: ModuleFile[]): Promise<void>;
13
16
  private confirm;
14
17
  }
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
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"));
3
+ const integration_api_1 = require("../../integration-api");
5
4
  class ModuleHandler {
6
5
  configApi;
7
6
  diffService;
@@ -14,7 +13,7 @@ class ModuleHandler {
14
13
  this.modifiers = modifiers;
15
14
  }
16
15
  canHandle(type) {
17
- return type === module_file_1.default;
16
+ return type === integration_api_1.FILE_TYPE.MODULE_FILE;
18
17
  }
19
18
  async handle(files) {
20
19
  for (const file_ of files) {
@@ -1,12 +1,15 @@
1
1
  import DeployHandlerInterface from "../interface/deploy-handler-interface";
2
- import ServerConfigFile from "../../integration-api/struct/server-config-file";
2
+ import ConfigApi from "../../config-api/config-api-service";
3
+ import { DiffService } from "../../diff";
4
+ import { CliService } from "../../cli";
5
+ import { FILE_TYPE, ServerConfigFile } from "../../integration-api";
3
6
  export default class ServerConfigHandler implements DeployHandlerInterface {
4
- private readonly configApi;
7
+ private configApi;
5
8
  private diffService;
6
9
  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>;
10
+ constructor(configApi: ConfigApi, diffService: DiffService, cli: CliService);
11
+ canHandle(type: FILE_TYPE): boolean;
12
+ handle(files: ServerConfigFile[]): Promise<void>;
13
+ upload(files: ServerConfigFile[]): Promise<void>;
11
14
  private confirm;
12
15
  }
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
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"));
3
+ const integration_api_1 = require("../../integration-api");
5
4
  class ServerConfigHandler {
6
5
  configApi;
7
6
  diffService;
@@ -12,7 +11,7 @@ class ServerConfigHandler {
12
11
  this.cli = cli;
13
12
  }
14
13
  canHandle(type) {
15
- return type === server_config_file_1.default;
14
+ return type === integration_api_1.FILE_TYPE.SERVER_FILE;
16
15
  }
17
16
  async handle(files) {
18
17
  const file = files[0];
@@ -23,6 +22,7 @@ class ServerConfigHandler {
23
22
  return;
24
23
  }
25
24
  const remoteConfig = JSON.parse(remote);
25
+ // @ts-expect-error revision is unknown
26
26
  file.config.revision.version = remoteConfig.revision.version;
27
27
  const { changedFile, diff } = await this.diffService.diffContent(file.name, file.getContent(), remote);
28
28
  file.setContent(changedFile);
@@ -42,7 +42,9 @@ class ServerConfigHandler {
42
42
  this.cli.write("Summary");
43
43
  this.cli.writeBuffer();
44
44
  if (await this.cli.confirm(`ServerConfig will be uploaded now. Proceed?`)) {
45
- await this.configApi.setServerConfig(file.getContent(), file.config.revision.version);
45
+ await this.configApi.setServerConfig(file.getContent(),
46
+ // @ts-expect-error revision is unknown
47
+ file.config.revision.version);
46
48
  }
47
49
  }
48
50
  async confirm(file, isNew = false) {
@@ -1,13 +1,12 @@
1
- import CustomerConfig from "../integration-api/struct/customer-config";
2
1
  import DocumentHandlerRuntimeConfigInterface from "./interface/document-handler-runtime-config-interface";
3
2
  import { CliService } from "../cli";
4
- import { FileListInterface } from "../integration-api/integration-api-model";
3
+ import { FileListInterface, CustomerConfig } from "../integration-api";
5
4
  export default class DocumentHandlerRuntimeService {
6
5
  private files;
7
6
  private readonly customerConfig;
8
7
  protected cli: CliService;
9
8
  config?: DocumentHandlerRuntimeConfigInterface;
10
- constructor(files: FileListInterface, customerConfig: CustomerConfig, cli: CliService, config?: DocumentHandlerRuntimeConfigInterface, preHook?: string, postHook?: string);
9
+ constructor(files: FileListInterface, customerConfig: CustomerConfig, cli: CliService, config?: DocumentHandlerRuntimeConfigInterface);
11
10
  run(): Promise<void>;
12
11
  private outputInstructionMessage;
13
12
  private createDocumentHandlerFile;
@@ -14,9 +14,7 @@ class DocumentHandlerRuntimeService {
14
14
  customerConfig;
15
15
  cli;
16
16
  config;
17
- constructor(files, customerConfig, cli, config,
18
- /* eslint-disable @typescript-eslint/no-unused-vars */
19
- preHook, postHook) {
17
+ constructor(files, customerConfig, cli, config) {
20
18
  this.files = files;
21
19
  this.customerConfig = customerConfig;
22
20
  this.cli = cli;
@@ -181,9 +179,7 @@ class DocumentHandlerRuntimeService {
181
179
  getDocumentHandlerConfig() {
182
180
  const documentHandlerFile = this.files.getByName(document_handler_runtime_context_1.LOCAL_DOCUMENT_HANDLER_CONFIG);
183
181
  if (!documentHandlerFile) {
184
- throw new required_file_not_found_error_1.default({
185
- message: `file ${document_handler_runtime_context_1.LOCAL_DOCUMENT_HANDLER_CONFIG} not found`,
186
- });
182
+ throw new required_file_not_found_error_1.default(`file ${document_handler_runtime_context_1.LOCAL_DOCUMENT_HANDLER_CONFIG} not found`);
187
183
  }
188
184
  return documentHandlerFile.getContent();
189
185
  }
@@ -1,7 +1,6 @@
1
- import CustomerConfig from "../integration-api/struct/customer-config";
2
1
  import { BundleService } from "../bundler";
3
2
  import { CliService } from "../cli";
4
- import { FileListInterface } from "../integration-api/integration-api-model";
3
+ import { CustomerConfig, FileListInterface } from "../integration-api";
5
4
  export declare class DocumentHandlerServer {
6
5
  private customerConfig;
7
6
  private files;
@@ -58,9 +58,8 @@ class DocumentHandlerServer {
58
58
  else {
59
59
  vm.runInNewContext(this.documentHandlerCode, vmContext);
60
60
  }
61
- const configDocumentHandlerPath = this.files.getByName("config_documentHandler").path;
62
61
  const script = new vm.Script(this.documentHandlerConfigCode + this.getTransformFunctionWrapper(), {
63
- filename: configDocumentHandlerPath,
62
+ filename: this.files.getByName("config_documentHandler").path,
64
63
  });
65
64
  try {
66
65
  return await (async () => {
@@ -119,9 +118,7 @@ class DocumentHandlerServer {
119
118
  getDocumentHandlerConfig() {
120
119
  const documentHandlerFile = this.files.getByName(document_handler_runtime_context_1.LOCAL_DOCUMENT_HANDLER_CONFIG);
121
120
  if (!documentHandlerFile) {
122
- throw new required_file_not_found_error_1.default({
123
- message: `file ${document_handler_runtime_context_1.LOCAL_DOCUMENT_HANDLER_CONFIG} not found`,
124
- });
121
+ throw new required_file_not_found_error_1.default(`file ${document_handler_runtime_context_1.LOCAL_DOCUMENT_HANDLER_CONFIG} not found`);
125
122
  }
126
123
  return documentHandlerFile.getContent();
127
124
  }
@@ -1,3 +1,2 @@
1
- import ApplicationError from "../../error-handling/error/application-error";
2
- export default class RequiredFileNotFoundError extends ApplicationError {
1
+ export default class RequiredFileNotFoundError extends Error {
3
2
  }
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
5
- class RequiredFileNotFoundError extends application_error_1.default {
3
+ class RequiredFileNotFoundError extends Error {
6
4
  }
7
5
  exports.default = RequiredFileNotFoundError;
@@ -1,16 +1,14 @@
1
+ import { FileListInterface } from "../../integration-api";
1
2
  import DocumentHandlerRuntimeContext from "../context/document-handler-runtime-context";
2
3
  import DocumentHandlerRuntimeService from "../document-handler-runtime-service";
3
- import AbstractAsyncErrorHandlingFactory from "../../error-handling/abstract/abstract-async-error-handling-factory";
4
- import ErrorHandlerInterface from "../../error-handling/interface/error-handler-interface";
5
4
  import { DocumentHandlerServer } from "../document-handler-server";
6
- import { FileListInterface } from "../../integration-api/integration-api-model";
7
5
  import { UserCliConfig } from "../../../helpers/cli-config";
8
- export default class DocumentHandlerRuntimeServiceFactory extends AbstractAsyncErrorHandlingFactory {
6
+ export default class DocumentHandlerRuntimeServiceFactory {
9
7
  private readonly context;
10
8
  private cliConfig;
11
9
  private files?;
12
10
  constructor(context: DocumentHandlerRuntimeContext, cliConfig: UserCliConfig, files?: FileListInterface);
13
- _buildService(): Promise<DocumentHandlerRuntimeService>;
11
+ buildService(): Promise<DocumentHandlerRuntimeService>;
14
12
  buildDocumentHandlerServer(): Promise<DocumentHandlerServer>;
15
13
  private prepareIntegrationApi;
16
14
  private getIntegrationFiles;
@@ -20,5 +18,4 @@ export default class DocumentHandlerRuntimeServiceFactory extends AbstractAsyncE
20
18
  private preparePackageJson;
21
19
  private prepareTestCases;
22
20
  private getCustomerConfig;
23
- static getErrorHandlers(): ErrorHandlerInterface[];
24
21
  }
@@ -1,39 +1,35 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const integration_api_context_1 = tslib_1.__importDefault(require("../../integration-api/context/integration-api-context"));
5
- const integration_api_service_factory_1 = tslib_1.__importDefault(require("../../integration-api/factory/integration-api-service-factory"));
4
+ const integration_api_1 = require("../../integration-api");
6
5
  const document_handler_runtime_context_1 = require("../context/document-handler-runtime-context");
7
6
  const document_handler_runtime_service_1 = tslib_1.__importDefault(require("../document-handler-runtime-service"));
8
- const abstract_async_error_handling_factory_1 = tslib_1.__importDefault(require("../../error-handling/abstract/abstract-async-error-handling-factory"));
9
7
  const cli_1 = require("../../cli");
10
- const required_file_not_found_handler_1 = tslib_1.__importDefault(require("../error/handler/required-file-not-found-handler"));
11
8
  const required_file_not_found_error_1 = tslib_1.__importDefault(require("../error/required-file-not-found-error"));
12
9
  const document_handler_server_1 = require("../document-handler-server");
13
10
  const bundler_1 = require("../../bundler");
14
- class DocumentHandlerRuntimeServiceFactory extends abstract_async_error_handling_factory_1.default {
11
+ class DocumentHandlerRuntimeServiceFactory {
15
12
  context;
16
13
  cliConfig;
17
14
  files;
18
15
  constructor(context, cliConfig, files) {
19
- super();
20
16
  this.context = context;
21
17
  this.cliConfig = cliConfig;
22
18
  this.files = files;
23
19
  }
24
- async _buildService() {
20
+ async buildService() {
25
21
  const integrationApi = this.prepareIntegrationApi();
26
22
  const files = await this.getIntegrationFiles(integrationApi);
27
23
  this.checkRequiredFiles(files);
28
24
  const cliService = new cli_1.CliServiceFactory().getService();
29
25
  const customerConfig = this.getCustomerConfig(files);
30
26
  this.preparePackageJson(integrationApi, customerConfig);
31
- return new document_handler_runtime_service_1.default(files, customerConfig, cliService, { testNames: this.context.testNames || [] }, customerConfig.skCliPre, customerConfig.skCliPost);
27
+ return new document_handler_runtime_service_1.default(files, customerConfig, cliService, { testNames: this.context.testNames || [] });
32
28
  }
33
29
  async buildDocumentHandlerServer() {
34
- const integrationApiContext = new integration_api_context_1.default(this.context.customerPath, this.context.configName, []);
30
+ const integrationApiContext = new integration_api_1.IntegrationApiContext(this.context.customerPath, this.context.configName, []);
35
31
  const files = this.files ||
36
- (await new integration_api_service_factory_1.default(integrationApiContext, this.cliConfig)
32
+ (await new integration_api_1.IntegrationApiFactory(integrationApiContext, this.cliConfig)
37
33
  .buildService()
38
34
  .run());
39
35
  const customerConfig = this.getCustomerConfig(files);
@@ -42,8 +38,8 @@ class DocumentHandlerRuntimeServiceFactory extends abstract_async_error_handling
42
38
  return new document_handler_server_1.DocumentHandlerServer(customerConfig, files, bundler, cliService, this.context.verboseLevel);
43
39
  }
44
40
  prepareIntegrationApi() {
45
- const integrationApiContext = new integration_api_context_1.default(this.context.customerPath, this.context.configName, this.context.fileDependencies, [".git", ".idea", "node_modules"]);
46
- return new integration_api_service_factory_1.default(integrationApiContext, this.cliConfig).buildService();
41
+ const integrationApiContext = new integration_api_1.IntegrationApiContext(this.context.customerPath, this.context.configName, this.context.fileDependencies, [".git", ".idea", "node_modules"]);
42
+ return new integration_api_1.IntegrationApiFactory(integrationApiContext, this.cliConfig).buildService();
47
43
  }
48
44
  async getIntegrationFiles(integrationApi) {
49
45
  this.createNeededFolderStructure(integrationApi);
@@ -54,9 +50,7 @@ class DocumentHandlerRuntimeServiceFactory extends abstract_async_error_handling
54
50
  checkRequiredFiles(files) {
55
51
  for (const requiredFile of this.context.requiredFiles) {
56
52
  if (!files.hasFile(requiredFile)) {
57
- throw new required_file_not_found_error_1.default({
58
- message: `file ${requiredFile} not found`,
59
- });
53
+ throw new required_file_not_found_error_1.default(`file ${requiredFile} not found`);
60
54
  }
61
55
  }
62
56
  }
@@ -103,8 +97,5 @@ class DocumentHandlerRuntimeServiceFactory extends abstract_async_error_handling
103
97
  const configFile = files.getByName("config_customer");
104
98
  return configFile.config;
105
99
  }
106
- static getErrorHandlers() {
107
- return [new required_file_not_found_handler_1.default()];
108
- }
109
100
  }
110
101
  exports.default = DocumentHandlerRuntimeServiceFactory;
@@ -1,3 +1,2 @@
1
- import ApplicationError from "../../error-handling/error/application-error";
2
- export default class CustomerConfigLegacyError extends ApplicationError {
1
+ export default class CustomerConfigLegacyError extends Error {
3
2
  }
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
5
- class CustomerConfigLegacyError extends application_error_1.default {
3
+ class CustomerConfigLegacyError extends Error {
6
4
  }
7
5
  exports.default = CustomerConfigLegacyError;
@@ -1,6 +1,5 @@
1
1
  import CustomerConfigLegacyError from "../customer-config-legacy-error";
2
- import ErrorHandlerInterface from "../../../error-handling/interface/error-handler-interface";
3
- export default class CustomerConfigLegacyHandler implements ErrorHandlerInterface {
2
+ export default class CustomerConfigLegacyHandler {
4
3
  canHandle(error: Error): boolean;
5
4
  handle(error: CustomerConfigLegacyError): void;
6
5
  }