ts-openapi-codegen 2.0.0-beta.8 → 2.0.0-beta.9

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 (239) hide show
  1. package/dist/cli/checkAndUpdateConfig/checkConfig.d.ts +2 -1
  2. package/dist/cli/checkAndUpdateConfig/checkConfig.d.ts.map +1 -1
  3. package/dist/cli/checkAndUpdateConfig/checkConfig.js +14 -6
  4. package/dist/cli/checkAndUpdateConfig/updateConfig.d.ts +2 -1
  5. package/dist/cli/checkAndUpdateConfig/updateConfig.d.ts.map +1 -1
  6. package/dist/cli/checkAndUpdateConfig/updateConfig.js +13 -5
  7. package/dist/cli/generateOpenApiClient/generateOpenApiClient.d.ts.map +1 -1
  8. package/dist/cli/generateOpenApiClient/generateOpenApiClient.js +4 -5
  9. package/dist/cli/index.js +5 -5
  10. package/dist/cli/initOpenApiConfig/init.d.ts.map +1 -1
  11. package/dist/cli/initOpenApiConfig/init.js +5 -13
  12. package/dist/cli/initOpenApiConfig/initConfig.js +3 -3
  13. package/dist/cli/previewChanges/previewChanges.d.ts.map +1 -1
  14. package/dist/cli/previewChanges/previewChanges.js +12 -5
  15. package/dist/cli/schemas/base.d.ts +6 -1
  16. package/dist/cli/schemas/base.d.ts.map +1 -1
  17. package/dist/cli/schemas/base.js +10 -6
  18. package/dist/cli/schemas/checkConfig.d.ts +1 -1
  19. package/dist/cli/schemas/generate.d.ts +1 -25
  20. package/dist/cli/schemas/generate.d.ts.map +1 -1
  21. package/dist/cli/schemas/generate.js +21 -32
  22. package/dist/cli/schemas/index.d.ts +2 -1
  23. package/dist/cli/schemas/index.d.ts.map +1 -1
  24. package/dist/cli/schemas/index.js +1 -0
  25. package/dist/cli/schemas/init.d.ts +5 -5
  26. package/dist/cli/schemas/init.d.ts.map +1 -1
  27. package/dist/cli/schemas/init.js +4 -5
  28. package/dist/cli/schemas/previewChanges.d.ts +9 -0
  29. package/dist/cli/schemas/previewChanges.d.ts.map +1 -0
  30. package/dist/cli/schemas/previewChanges.js +11 -0
  31. package/dist/cli/schemas/updateConfig.d.ts +1 -1
  32. package/dist/common/Consts.d.ts +2 -0
  33. package/dist/common/Consts.d.ts.map +1 -1
  34. package/dist/common/Consts.js +4 -1
  35. package/dist/common/LoggerMessages.js +1 -1
  36. package/dist/common/TRawOptions.d.ts +1 -1
  37. package/dist/common/TRawOptions.d.ts.map +1 -1
  38. package/dist/common/Validation/formatZodError.d.ts +10 -0
  39. package/dist/common/Validation/formatZodError.d.ts.map +1 -0
  40. package/dist/{cli/validation/errorFormatter.js → common/Validation/formatZodError.js} +14 -13
  41. package/dist/common/Validation/index.d.ts +3 -0
  42. package/dist/common/Validation/index.d.ts.map +1 -0
  43. package/dist/{cli/validation → common/Validation}/index.js +2 -2
  44. package/dist/{cli/validation/validateCLIOptions.d.ts → common/Validation/validateZodOptions.d.ts} +4 -4
  45. package/dist/common/Validation/validateZodOptions.d.ts.map +1 -0
  46. package/dist/{cli/validation/validateCLIOptions.js → common/Validation/validateZodOptions.js} +7 -10
  47. package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.d.ts +6 -1
  48. package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.d.ts.map +1 -1
  49. package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.js +8 -14
  50. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.d.ts +28 -0
  51. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.d.ts.map +1 -0
  52. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.js +25 -0
  53. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts +36 -6
  54. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts.map +1 -1
  55. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.js +33 -37
  56. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts +37 -6
  57. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts.map +1 -1
  58. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.js +30 -37
  59. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.d.ts +40 -0
  60. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.d.ts.map +1 -0
  61. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.js +36 -0
  62. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts +65 -0
  63. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts.map +1 -0
  64. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.js +31 -0
  65. package/dist/common/VersionedSchema/CommonSchemas.d.ts +53 -30
  66. package/dist/common/VersionedSchema/CommonSchemas.d.ts.map +1 -1
  67. package/dist/common/VersionedSchema/CommonSchemas.js +47 -72
  68. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts +25 -5
  69. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts.map +1 -1
  70. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.js +34 -17
  71. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.d.ts +25 -5
  72. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.d.ts.map +1 -1
  73. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.js +28 -19
  74. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.d.ts +25 -1
  75. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.d.ts.map +1 -1
  76. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.js +29 -2
  77. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts +25 -5
  78. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts.map +1 -1
  79. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.js +30 -14
  80. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts +23 -5
  81. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts.map +1 -1
  82. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.js +33 -18
  83. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas.d.ts +3 -2
  84. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas.d.ts.map +1 -1
  85. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas.js +18 -11
  86. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts +22 -5
  87. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts.map +1 -1
  88. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.js +30 -12
  89. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.d.ts +22 -5
  90. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.d.ts.map +1 -1
  91. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.js +27 -13
  92. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.d.ts +22 -1
  93. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.d.ts.map +1 -1
  94. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.js +28 -2
  95. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts +22 -5
  96. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts.map +1 -1
  97. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.js +31 -12
  98. package/dist/common/VersionedSchema/OptionsVersioned/OptionsVersionedSchemas.d.ts +3 -2
  99. package/dist/common/VersionedSchema/OptionsVersioned/OptionsVersionedSchemas.d.ts.map +1 -1
  100. package/dist/common/VersionedSchema/OptionsVersioned/OptionsVersionedSchemas.js +15 -9
  101. package/dist/common/VersionedSchema/Types.d.ts +5 -5
  102. package/dist/common/VersionedSchema/Types.d.ts.map +1 -1
  103. package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.d.ts +16 -0
  104. package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.d.ts.map +1 -0
  105. package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.js +85 -0
  106. package/dist/common/VersionedSchema/Utils/__tests__/compareShapes.test.d.ts +2 -0
  107. package/dist/common/VersionedSchema/Utils/__tests__/compareShapes.test.d.ts.map +1 -0
  108. package/dist/common/VersionedSchema/Utils/__tests__/compareShapes.test.js +23 -0
  109. package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.d.ts +2 -0
  110. package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.d.ts.map +1 -0
  111. package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.js +75 -0
  112. package/dist/common/VersionedSchema/Utils/buildVersionedSchema.d.ts +12 -0
  113. package/dist/common/VersionedSchema/Utils/buildVersionedSchema.d.ts.map +1 -0
  114. package/dist/common/VersionedSchema/Utils/buildVersionedSchema.js +13 -0
  115. package/dist/common/VersionedSchema/Utils/compareShapes.d.ts +16 -0
  116. package/dist/common/VersionedSchema/Utils/compareShapes.d.ts.map +1 -0
  117. package/dist/common/VersionedSchema/Utils/compareShapes.js +30 -0
  118. package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts +2 -1
  119. package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts.map +1 -1
  120. package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.js +5 -5
  121. package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.d.ts +2 -2
  122. package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.d.ts.map +1 -1
  123. package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.js +15 -7
  124. package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.d.ts +2 -2
  125. package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.d.ts.map +1 -1
  126. package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.js +16 -3
  127. package/dist/common/VersionedSchema/Utils/getUniqueObjectKeys.d.ts.map +1 -1
  128. package/dist/common/VersionedSchema/Utils/getUniqueObjectKeys.js +19 -2
  129. package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts +2 -1
  130. package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts.map +1 -1
  131. package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.js +10 -9
  132. package/dist/common/VersionedSchema/refinements/dependentOptionsRefinement.d.ts +4 -0
  133. package/dist/common/VersionedSchema/refinements/dependentOptionsRefinement.d.ts.map +1 -0
  134. package/dist/common/VersionedSchema/refinements/dependentOptionsRefinement.js +43 -0
  135. package/dist/common/VersionedSchema/refinements/singleOrMultiRefinement.d.ts +4 -0
  136. package/dist/common/VersionedSchema/refinements/singleOrMultiRefinement.d.ts.map +1 -0
  137. package/dist/common/VersionedSchema/refinements/singleOrMultiRefinement.js +21 -0
  138. package/dist/core/Context.d.ts +6 -5
  139. package/dist/core/Context.d.ts.map +1 -1
  140. package/dist/core/Context.js +69 -26
  141. package/dist/core/OpenApiClient.d.ts.map +1 -1
  142. package/dist/core/OpenApiClient.js +12 -8
  143. package/dist/core/api/v2/Parser.d.ts +1 -1
  144. package/dist/core/api/v2/Parser.d.ts.map +1 -1
  145. package/dist/core/api/v2/Parser.js +2 -2
  146. package/dist/core/api/v2/parser/getModel.d.ts.map +1 -1
  147. package/dist/core/api/v2/parser/getModel.js +2 -5
  148. package/dist/core/api/v2/parser/getModelProperties.d.ts.map +1 -1
  149. package/dist/core/api/v2/parser/getModelProperties.js +1 -3
  150. package/dist/core/api/v2/parser/getModels.d.ts.map +1 -1
  151. package/dist/core/api/v2/parser/getModels.js +1 -2
  152. package/dist/core/api/v2/parser/getOperationParameter.d.ts.map +1 -1
  153. package/dist/core/api/v2/parser/getOperationParameter.js +2 -5
  154. package/dist/core/api/v2/parser/getOperationParameters.js +1 -1
  155. package/dist/core/api/v2/parser/getOperationResponse.d.ts.map +1 -1
  156. package/dist/core/api/v2/parser/getOperationResponse.js +1 -3
  157. package/dist/core/api/v2/parser/getOperationResponses.js +1 -1
  158. package/dist/core/api/v2/parser/getServices.d.ts.map +1 -1
  159. package/dist/core/api/v2/parser/getServices.js +4 -3
  160. package/dist/core/api/v2/parser/getType.d.ts.map +1 -1
  161. package/dist/core/api/v2/parser/getType.js +2 -2
  162. package/dist/core/api/v3/Parser.d.ts +1 -1
  163. package/dist/core/api/v3/Parser.d.ts.map +1 -1
  164. package/dist/core/api/v3/Parser.js +2 -2
  165. package/dist/core/api/v3/parser/getModel.d.ts.map +1 -1
  166. package/dist/core/api/v3/parser/getModel.js +2 -5
  167. package/dist/core/api/v3/parser/getModelProperties.d.ts.map +1 -1
  168. package/dist/core/api/v3/parser/getModelProperties.js +1 -3
  169. package/dist/core/api/v3/parser/getModels.d.ts.map +1 -1
  170. package/dist/core/api/v3/parser/getModels.js +1 -2
  171. package/dist/core/api/v3/parser/getOperation.js +1 -1
  172. package/dist/core/api/v3/parser/getOperationParameter.d.ts.map +1 -1
  173. package/dist/core/api/v3/parser/getOperationParameter.js +2 -5
  174. package/dist/core/api/v3/parser/getOperationParameters.js +1 -1
  175. package/dist/core/api/v3/parser/getOperationRequestBody.d.ts.map +1 -1
  176. package/dist/core/api/v3/parser/getOperationRequestBody.js +1 -3
  177. package/dist/core/api/v3/parser/getOperationResponse.d.ts.map +1 -1
  178. package/dist/core/api/v3/parser/getOperationResponse.js +1 -3
  179. package/dist/core/api/v3/parser/getOperationResponses.js +1 -1
  180. package/dist/core/api/v3/parser/getServices.d.ts.map +1 -1
  181. package/dist/core/api/v3/parser/getServices.js +4 -3
  182. package/dist/core/api/v3/parser/getType.js +2 -2
  183. package/dist/core/index.d.ts.map +1 -1
  184. package/dist/core/index.js +2 -0
  185. package/dist/core/utils/__tests__/isSubdirectory.test.js +2 -2
  186. package/dist/core/utils/serviceHelpers.d.ts.map +1 -1
  187. package/dist/core/utils/serviceHelpers.js +32 -6
  188. package/dist/core/utils/validateRawOptions.d.ts +3 -0
  189. package/dist/core/utils/validateRawOptions.d.ts.map +1 -0
  190. package/dist/core/utils/validateRawOptions.js +15 -0
  191. package/dist/templatesCompiled/client/exportService.js +1 -1
  192. package/dist/templatesCompiled/client/partials/exportComposition.d.ts +2 -0
  193. package/dist/templatesCompiled/client/partials/exportComposition.d.ts.map +1 -1
  194. package/dist/templatesCompiled/client/partials/exportComposition.js +17 -9
  195. package/package.json +1 -1
  196. package/dist/cli/validation/errorFormatter.d.ts +0 -6
  197. package/dist/cli/validation/errorFormatter.d.ts.map +0 -1
  198. package/dist/cli/validation/index.d.ts +0 -3
  199. package/dist/cli/validation/index.d.ts.map +0 -1
  200. package/dist/cli/validation/validateCLIOptions.d.ts.map +0 -1
  201. package/dist/common/VersionedSchema/Utils/getErrorFieldsFromValidation.d.ts +0 -6
  202. package/dist/common/VersionedSchema/Utils/getErrorFieldsFromValidation.d.ts.map +0 -1
  203. package/dist/common/VersionedSchema/Utils/getErrorFieldsFromValidation.js +0 -7
  204. package/dist/common/VersionedSchema/Utils/joiHandlers.d.ts +0 -6
  205. package/dist/common/VersionedSchema/Utils/joiHandlers.d.ts.map +0 -1
  206. package/dist/common/VersionedSchema/Utils/joiHandlers.js +0 -59
  207. package/dist/common/VersionedSchema/Utils/mergeObjectSchemas.d.ts +0 -3
  208. package/dist/common/VersionedSchema/Utils/mergeObjectSchemas.d.ts.map +0 -1
  209. package/dist/common/VersionedSchema/Utils/mergeObjectSchemas.js +0 -12
  210. package/dist/common/VersionedSchema/Utils/traverseObjectStructure.d.ts +0 -3
  211. package/dist/common/VersionedSchema/Utils/traverseObjectStructure.d.ts.map +0 -1
  212. package/dist/common/VersionedSchema/Utils/traverseObjectStructure.js +0 -31
  213. package/dist/common/schemas/configSchemas.d.ts +0 -91
  214. package/dist/common/schemas/configSchemas.d.ts.map +0 -1
  215. package/dist/common/schemas/configSchemas.js +0 -131
  216. package/dist/common/utils/__tests__/__mock__/mockJoiSchema.d.ts +0 -19
  217. package/dist/common/utils/__tests__/__mock__/mockJoiSchema.d.ts.map +0 -1
  218. package/dist/common/utils/__tests__/__mock__/mockJoiSchema.js +0 -14
  219. package/dist/common/utils/__tests__/determineBestMatchingSchemaVersion.test.d.ts +0 -2
  220. package/dist/common/utils/__tests__/determineBestMatchingSchemaVersion.test.d.ts.map +0 -1
  221. package/dist/common/utils/__tests__/determineBestMatchingSchemaVersion.test.js +0 -38
  222. package/dist/common/utils/__tests__/getUniqueKeysFromSchemas.test.d.ts +0 -2
  223. package/dist/common/utils/__tests__/getUniqueKeysFromSchemas.test.d.ts.map +0 -1
  224. package/dist/common/utils/__tests__/getUniqueKeysFromSchemas.test.js +0 -20
  225. package/dist/common/utils/__tests__/mergeObjectSchemas.test.d.ts +0 -2
  226. package/dist/common/utils/__tests__/mergeObjectSchemas.test.d.ts.map +0 -1
  227. package/dist/common/utils/__tests__/mergeObjectSchemas.test.js +0 -35
  228. package/dist/common/utils/__tests__/migrationForMultiOptions.test.d.ts +0 -2
  229. package/dist/common/utils/__tests__/migrationForMultiOptions.test.d.ts.map +0 -1
  230. package/dist/common/utils/__tests__/migrationForMultiOptions.test.js +0 -112
  231. package/dist/common/utils/__tests__/migrationForOptions.test.d.ts +0 -2
  232. package/dist/common/utils/__tests__/migrationForOptions.test.d.ts.map +0 -1
  233. package/dist/common/utils/__tests__/migrationForOptions.test.js +0 -56
  234. package/dist/core/utils/__tests__/getRelativeModelPath.test.d.ts +0 -2
  235. package/dist/core/utils/__tests__/getRelativeModelPath.test.d.ts.map +0 -1
  236. package/dist/core/utils/__tests__/getRelativeModelPath.test.js +0 -21
  237. package/dist/core/utils/getRelativeModelPath.d.ts +0 -9
  238. package/dist/core/utils/getRelativeModelPath.d.ts.map +0 -1
  239. package/dist/core/utils/getRelativeModelPath.js +0 -37
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_OUTPUT_API_DIR = exports.DEFAULT_CUSTOM_REQUEST_PATH = exports.DEFAULT_SPECS_DIR = exports.APP_LOGGER = exports.COMMON_DEFAULT_OPTIONS_VALUES = exports.DEFAULT_OPENAPI_CONFIG_FILENAME = void 0;
3
+ exports.DEFAULT_DIFF_CHANGES_DIR = exports.DEFAULT_PREVIEW_CHANGES_DIR = exports.DEFAULT_OUTPUT_API_DIR = exports.DEFAULT_CUSTOM_REQUEST_PATH = exports.DEFAULT_SPECS_DIR = exports.APP_LOGGER = exports.COMMON_DEFAULT_OPTIONS_VALUES = exports.DEFAULT_OPENAPI_CONFIG_FILENAME = void 0;
4
4
  const HttpClient_enum_1 = require("../core/types/enums/HttpClient.enum");
5
5
  const ValidationLibrary_enum_1 = require("../core/types/enums/ValidationLibrary.enum");
6
6
  const Enums_1 = require("./Enums");
@@ -16,6 +16,7 @@ exports.COMMON_DEFAULT_OPTIONS_VALUES = {
16
16
  httpClient: HttpClient_enum_1.HttpClient.FETCH,
17
17
  useOptions: false,
18
18
  useUnionTypes: false,
19
+ includeSchemasFiles: false,
19
20
  excludeCoreServiceFiles: false,
20
21
  request: '',
21
22
  interfacePrefix: 'I',
@@ -36,3 +37,5 @@ exports.APP_LOGGER = new Logger_1.Logger({
36
37
  exports.DEFAULT_SPECS_DIR = 'openapi/';
37
38
  exports.DEFAULT_CUSTOM_REQUEST_PATH = './src/custom/request.ts';
38
39
  exports.DEFAULT_OUTPUT_API_DIR = './generated';
40
+ exports.DEFAULT_PREVIEW_CHANGES_DIR = './.ts-openapi-codegen-preview-changes';
41
+ exports.DEFAULT_DIFF_CHANGES_DIR = './.ts-openapi-codegen-diff-changes';
@@ -10,7 +10,7 @@ exports.LOGGER_MESSAGES = {
10
10
  GENERATION: {
11
11
  STARTED: (count) => `Generation has begun. Total number of specification files: ${count}`,
12
12
  FINISHED: 'Generation has been finished',
13
- FINISHED_WITH_DURATION: (duration) => `Generation completed in ${duration} ms`,
13
+ FINISHED_WITH_DURATION: (duration) => `Generation completed in ${duration} sec`,
14
14
  DURATION_FOR_FILE: (file, duration) => `Duration for "${file}": ${duration} sec`,
15
15
  NO_OPTIONS: 'No options provided for generation',
16
16
  },
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { flatOptionsSchema, rawOptionsSchema } from "./schemas/configSchemas";
2
+ import { flatOptionsSchema, rawOptionsSchema } from './VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas';
3
3
  export type TRawOptions = z.infer<typeof rawOptionsSchema>;
4
4
  export type TFlatOptions = z.infer<typeof flatOptionsSchema>;
5
5
  export type TStrictFlatOptions = {
@@ -1 +1 @@
1
- {"version":3,"file":"TRawOptions.d.ts","sourceRoot":"","sources":["../../src/common/TRawOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE9E,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE7D,MAAM,MAAM,kBAAkB,GAAG;KAC5B,CAAC,IAAI,MAAM,YAAY,CAAC,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAC5D,CAAC"}
1
+ {"version":3,"file":"TRawOptions.d.ts","sourceRoot":"","sources":["../../src/common/TRawOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAC,gBAAgB,EAAE,MAAM,+DAA+D,CAAC;AAEnH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE7D,MAAM,MAAM,kBAAkB,GAAG;KAC5B,CAAC,IAAI,MAAM,YAAY,CAAC,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAC5D,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { ZodError } from 'zod';
2
+ /**
3
+ * Форматирует Zod ошибку в читаемое сообщение для CLI
4
+ */
5
+ export declare function formatZodError(error: ZodError): string[];
6
+ /**
7
+ * Форматирует путь к полю в читаемый формат
8
+ */
9
+ export declare function formatZodPath(path: (string | number | symbol)[]): string;
10
+ //# sourceMappingURL=formatZodError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatZodError.d.ts","sourceRoot":"","sources":["../../../src/common/Validation/formatZodError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAE/B;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,EAAE,CAYxD;AAkFD;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,MAAM,CA2BxE"}
@@ -1,24 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatZodErrorForCLI = formatZodErrorForCLI;
3
+ exports.formatZodError = formatZodError;
4
+ exports.formatZodPath = formatZodPath;
4
5
  /**
5
6
  * Форматирует Zod ошибку в читаемое сообщение для CLI
6
7
  */
7
- function formatZodErrorForCLI(error) {
8
+ function formatZodError(error) {
8
9
  if (!error || error.issues.length === 0) {
9
- return 'Validation error occurred';
10
+ return [];
10
11
  }
11
12
  const messages = [];
12
13
  for (const issue of error.issues) {
13
- messages.push(formatIssue(issue));
14
+ messages.push(formatZodIssue(issue));
14
15
  }
15
- return messages.join('\n');
16
+ return messages;
16
17
  }
17
18
  /**
18
19
  * Форматирует отдельную Zod issue в читаемое сообщение
19
20
  */
20
- function formatIssue(issue) {
21
- const path = formatPath(issue.path);
21
+ function formatZodIssue(issue) {
22
+ const path = formatZodPath(issue.path);
22
23
  const message = issue.message;
23
24
  // Если issue имеет кастомное сообщение, используем его
24
25
  if (issue.code === 'custom') {
@@ -27,7 +28,7 @@ function formatIssue(issue) {
27
28
  // Форматируем стандартные ошибки с использованием type guards
28
29
  if (issue.code === 'invalid_type') {
29
30
  if ('received' in issue && issue.received === 'undefined') {
30
- const fieldName = formatPath(issue.path).replace(/^--/, '');
31
+ const fieldName = formatZodPath(issue.path).replace(/^--/, '');
31
32
  return `${path}: "${fieldName}" is required`;
32
33
  }
33
34
  if ('expected' in issue && 'received' in issue) {
@@ -35,7 +36,7 @@ function formatIssue(issue) {
35
36
  }
36
37
  }
37
38
  if (issue.code === 'invalid_format' && 'format' in issue) {
38
- const fieldName = formatPath(issue.path).replace(/^--/, '');
39
+ const fieldName = formatZodPath(issue.path).replace(/^--/, '');
39
40
  const format = issue.format;
40
41
  if (format === 'email') {
41
42
  return `${path}: "${fieldName}" must be a valid email`;
@@ -46,7 +47,7 @@ function formatIssue(issue) {
46
47
  return `${path}: "${fieldName}" has invalid format: ${format}`;
47
48
  }
48
49
  if (issue.code === 'too_small' && 'minimum' in issue && 'type' in issue) {
49
- const fieldName = formatPath(issue.path).replace(/^--/, '');
50
+ const fieldName = formatZodPath(issue.path).replace(/^--/, '');
50
51
  const type = issue.type;
51
52
  const minimum = issue.minimum;
52
53
  if (type === 'string') {
@@ -60,7 +61,7 @@ function formatIssue(issue) {
60
61
  }
61
62
  }
62
63
  if (issue.code === 'too_big' && 'maximum' in issue && 'type' in issue) {
63
- const fieldName = formatPath(issue.path).replace(/^--/, '');
64
+ const fieldName = formatZodPath(issue.path).replace(/^--/, '');
64
65
  const type = issue.type;
65
66
  const maximum = issue.maximum;
66
67
  if (type === 'string') {
@@ -74,7 +75,7 @@ function formatIssue(issue) {
74
75
  }
75
76
  }
76
77
  if (issue.code === 'invalid_value') {
77
- const fieldName = formatPath(issue.path).replace(/^--/, '');
78
+ const fieldName = formatZodPath(issue.path).replace(/^--/, '');
78
79
  return `${path}: "${fieldName}" has invalid value`;
79
80
  }
80
81
  if (issue.code === 'unrecognized_keys' && 'keys' in issue) {
@@ -86,7 +87,7 @@ function formatIssue(issue) {
86
87
  /**
87
88
  * Форматирует путь к полю в читаемый формат
88
89
  */
89
- function formatPath(path) {
90
+ function formatZodPath(path) {
90
91
  if (path.length === 0) {
91
92
  return 'root';
92
93
  }
@@ -0,0 +1,3 @@
1
+ export * from './formatZodError';
2
+ export * from './validateZodOptions';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/Validation/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./errorFormatter"), exports);
18
- __exportStar(require("./validateCLIOptions"), exports);
17
+ __exportStar(require("./formatZodError"), exports);
18
+ __exportStar(require("./validateZodOptions"), exports);
@@ -7,21 +7,21 @@ export type ValidationResult<T> = {
7
7
  data: T;
8
8
  } | {
9
9
  success: false;
10
- error: string;
10
+ errors: string[];
11
11
  };
12
12
  /**
13
13
  * Валидирует данные с помощью Zod схемы и возвращает отформатированный результат
14
14
  */
15
- export declare function validateCLIOptions<T>(schema: ZodSchema<T>, data: unknown): ValidationResult<T>;
15
+ export declare function validateZodOptions<T>(schema: ZodSchema<T>, data: unknown): ValidationResult<T>;
16
16
  /**
17
17
  * Валидирует данные с помощью Zod схемы и возвращает raw результат
18
18
  * (полезно когда нужен доступ к ZodError для дополнительной обработки)
19
19
  */
20
- export declare function validateCLIOptionsRaw<T>(schema: ZodSchema<T>, data: unknown): {
20
+ export declare function validateZodOptionsRaw<T>(schema: ZodSchema<T>, data: unknown): {
21
21
  success: true;
22
22
  data: T;
23
23
  } | {
24
24
  success: false;
25
25
  error: ZodError;
26
26
  };
27
- //# sourceMappingURL=validateCLIOptions.d.ts.map
27
+ //# sourceMappingURL=validateZodOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateZodOptions.d.ts","sourceRoot":"","sources":["../../../src/common/Validation/validateZodOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAI1C;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEpG;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAc9F;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,CAQ9I"}
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateCLIOptions = validateCLIOptions;
4
- exports.validateCLIOptionsRaw = validateCLIOptionsRaw;
3
+ exports.validateZodOptions = validateZodOptions;
4
+ exports.validateZodOptionsRaw = validateZodOptionsRaw;
5
5
  const zod_1 = require("zod");
6
- const errorFormatter_1 = require("./errorFormatter");
6
+ const formatZodError_1 = require("./formatZodError");
7
7
  /**
8
8
  * Валидирует данные с помощью Zod схемы и возвращает отформатированный результат
9
9
  */
10
- function validateCLIOptions(schema, data) {
10
+ function validateZodOptions(schema, data) {
11
11
  try {
12
12
  const result = schema.parse(data);
13
13
  return { success: true, data: result };
@@ -16,20 +16,17 @@ function validateCLIOptions(schema, data) {
16
16
  if (error instanceof zod_1.ZodError) {
17
17
  return {
18
18
  success: false,
19
- error: (0, errorFormatter_1.formatZodErrorForCLI)(error),
19
+ errors: (0, formatZodError_1.formatZodError)(error),
20
20
  };
21
21
  }
22
- return {
23
- success: false,
24
- error: error instanceof Error ? error.message : 'Unknown validation error',
25
- };
22
+ throw new Error(error instanceof Error ? error.message : 'Unknown validation error');
26
23
  }
27
24
  }
28
25
  /**
29
26
  * Валидирует данные с помощью Zod схемы и возвращает raw результат
30
27
  * (полезно когда нужен доступ к ZodError для дополнительной обработки)
31
28
  */
32
- function validateCLIOptionsRaw(schema, data) {
29
+ function validateZodOptionsRaw(schema, data) {
33
30
  const result = schema.safeParse(data);
34
31
  if (result.success) {
35
32
  return { success: true, data: result.data };
@@ -1,8 +1,13 @@
1
+ import { z } from 'zod';
1
2
  import { VersionedSchema } from '../Types';
2
3
  /**
3
4
  * Unified array of all versioned schemas with prefixed versions.
4
5
  * This allows migration from any old schema version to the latest unified schema.
5
6
  * Reuses existing schema arrays to avoid code duplication.
7
+ *
8
+ * ВАЖНО!
9
+ * После обновления allVersionedSchemas необходимо обновить файл compatibilityCases
10
+ * src/common/VersionedSchema/Utils/__mocks__/compatibilityCases.ts
6
11
  */
7
- export declare const allVersionedSchemas: VersionedSchema<Record<string, any>>[];
12
+ export declare const allVersionedSchemas: VersionedSchema<z.ZodTypeAny>[];
8
13
  //# sourceMappingURL=AllVersionedSchemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AllVersionedSchemas.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAiB3C;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,eAAe,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAkBrE,CAAC"}
1
+ {"version":3,"file":"AllVersionedSchemas.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAgB3C;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,EAAE,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,EAS9D,CAAC"}
@@ -4,8 +4,7 @@ exports.allVersionedSchemas = void 0;
4
4
  const Enums_1 = require("../Enums");
5
5
  const MultiOptionsVersionedSchemas_1 = require("../MultiOptionsVersioned/MultiOptionsVersionedSchemas");
6
6
  const OptionsVersionedSchemas_1 = require("../OptionsVersioned/OptionsVersionedSchemas");
7
- const UnifiedOptionsSchemaV1_1 = require("./UnifiedOptionsSchemaV1");
8
- const UnifiedOptionsSchemaV2_1 = require("./UnifiedOptionsSchemaV2");
7
+ const UnifiedVersionedSchemas_1 = require("./UnifiedVersionedSchemas");
9
8
  /**
10
9
  * Adds a prefix to all version strings in a versioned schema array.
11
10
  */
@@ -19,21 +18,16 @@ function addVersionPrefix(schemas, prefix) {
19
18
  * Unified array of all versioned schemas with prefixed versions.
20
19
  * This allows migration from any old schema version to the latest unified schema.
21
20
  * Reuses existing schema arrays to avoid code duplication.
21
+ *
22
+ * ВАЖНО!
23
+ * После обновления allVersionedSchemas необходимо обновить файл compatibilityCases
24
+ * src/common/VersionedSchema/Utils/__mocks__/compatibilityCases.ts
22
25
  */
23
26
  exports.allVersionedSchemas = [
24
27
  // OPTIONS schemas with prefix
25
- ...addVersionPrefix(OptionsVersionedSchemas_1.optionsVersionedSchemas, 'OPTIONS'),
28
+ ...addVersionPrefix(OptionsVersionedSchemas_1.optionsVersionedSchemas, Enums_1.EVersionedSchemaType.OPTIONS),
26
29
  // MULTI_OPTIONS schemas with prefix
27
- ...addVersionPrefix(MultiOptionsVersionedSchemas_1.multiOptionsVersionedSchema, 'MULTI_OPTIONS'),
30
+ ...addVersionPrefix(MultiOptionsVersionedSchemas_1.multiOptionsVersionedSchema, Enums_1.EVersionedSchemaType.MULTI_OPTIONS),
28
31
  // UNIFIED_OPTIONS schemas (latest)
29
- {
30
- version: 'UNIFIED_v1',
31
- schema: UnifiedOptionsSchemaV1_1.unifiedOptionsSchemaV1,
32
- type: Enums_1.EVersionedSchemaType.UNIFIED_OPTIONS,
33
- },
34
- {
35
- version: 'UNIFIED_v2',
36
- schema: UnifiedOptionsSchemaV2_1.unifiedOptionsSchemaV2,
37
- type: Enums_1.EVersionedSchemaType.UNIFIED_OPTIONS,
38
- }
32
+ ...addVersionPrefix(UnifiedVersionedSchemas_1.unifiedVersionedSchemas, Enums_1.EVersionedSchemaType.UNIFIED_OPTIONS)
39
33
  ];
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ import { HttpClient } from '../../../core/types/enums/HttpClient.enum';
3
+ import { ELogLevel, ELogOutput } from '../../Enums';
4
+ export declare const unifiedOptionsShape: z.ZodObject<{
5
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
6
+ input: z.ZodString;
7
+ request: z.ZodOptional<z.ZodString>;
8
+ sortByRequired: z.ZodOptional<z.ZodBoolean>;
9
+ useSeparatedIndexes: z.ZodOptional<z.ZodBoolean>;
10
+ useCancelableRequest: z.ZodOptional<z.ZodBoolean>;
11
+ interfacePrefix: z.ZodOptional<z.ZodString>;
12
+ enumPrefix: z.ZodOptional<z.ZodString>;
13
+ typePrefix: z.ZodOptional<z.ZodString>;
14
+ output: z.ZodString;
15
+ outputCore: z.ZodOptional<z.ZodString>;
16
+ outputServices: z.ZodOptional<z.ZodString>;
17
+ outputModels: z.ZodOptional<z.ZodString>;
18
+ outputSchemas: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strip>>>;
20
+ input: z.ZodOptional<z.ZodString>;
21
+ output: z.ZodOptional<z.ZodString>;
22
+ httpClient: z.ZodEnum<typeof HttpClient>;
23
+ }, z.core.$strip>;
24
+ export declare const debugSettingsShape: z.ZodObject<{
25
+ logLevel: z.ZodOptional<z.ZodEnum<typeof ELogLevel>>;
26
+ logTarget: z.ZodOptional<z.ZodEnum<typeof ELogOutput>>;
27
+ }, z.core.$strip>;
28
+ //# sourceMappingURL=UnifiedBase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnifiedBase.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,MAAM,2CAA2C,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAapD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;iBAK9B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.debugSettingsShape = exports.unifiedOptionsShape = void 0;
4
+ const zod_1 = require("zod");
5
+ const HttpClient_enum_1 = require("../../../core/types/enums/HttpClient.enum");
6
+ const Enums_1 = require("../../Enums");
7
+ const CommonSchemas_1 = require("../CommonSchemas");
8
+ const unifiedItemSchema = zod_1.z
9
+ .object({
10
+ ...CommonSchemas_1.outputPathsSchema.shape,
11
+ ...CommonSchemas_1.additionalParametersSchemaV2.shape,
12
+ ...CommonSchemas_1.experimentalParametersSchemaV2.shape,
13
+ input: zod_1.z.string().min(1),
14
+ request: zod_1.z.string().optional(),
15
+ });
16
+ exports.unifiedOptionsShape = zod_1.z.object({
17
+ items: zod_1.z.array(unifiedItemSchema).min(1).optional(),
18
+ input: zod_1.z.string().optional(),
19
+ output: zod_1.z.string().optional(),
20
+ httpClient: zod_1.z.enum(HttpClient_enum_1.HttpClient),
21
+ });
22
+ exports.debugSettingsShape = zod_1.z.object({
23
+ logLevel: zod_1.z.enum(Enums_1.ELogLevel).optional(),
24
+ logTarget: zod_1.z.enum(Enums_1.ELogOutput).optional(),
25
+ });
@@ -1,7 +1,37 @@
1
- import Joi from 'joi';
2
- /**
3
- * Unified options schema that supports both single and multi-item configurations.
4
- * Use either 'items' array for multiple specs OR 'input'/'output' for single spec.
5
- */
6
- export declare const unifiedOptionsSchemaV1: Joi.ObjectSchema<any>;
1
+ import { z } from 'zod';
2
+ export declare const unifiedOptionsSchemaV1: z.ZodObject<{
3
+ sortByRequired: z.ZodOptional<z.ZodBoolean>;
4
+ useSeparatedIndexes: z.ZodOptional<z.ZodBoolean>;
5
+ useCancelableRequest: z.ZodOptional<z.ZodBoolean>;
6
+ request: z.ZodOptional<z.ZodString>;
7
+ interfacePrefix: z.ZodOptional<z.ZodString>;
8
+ enumPrefix: z.ZodOptional<z.ZodString>;
9
+ typePrefix: z.ZodOptional<z.ZodString>;
10
+ useOptions: z.ZodOptional<z.ZodBoolean>;
11
+ useUnionTypes: z.ZodOptional<z.ZodBoolean>;
12
+ excludeCoreServiceFiles: z.ZodOptional<z.ZodBoolean>;
13
+ includeSchemasFiles: z.ZodOptional<z.ZodBoolean>;
14
+ outputCore: z.ZodOptional<z.ZodString>;
15
+ outputServices: z.ZodOptional<z.ZodString>;
16
+ outputModels: z.ZodOptional<z.ZodString>;
17
+ outputSchemas: z.ZodOptional<z.ZodString>;
18
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
19
+ input: z.ZodString;
20
+ request: z.ZodOptional<z.ZodString>;
21
+ sortByRequired: z.ZodOptional<z.ZodBoolean>;
22
+ useSeparatedIndexes: z.ZodOptional<z.ZodBoolean>;
23
+ useCancelableRequest: z.ZodOptional<z.ZodBoolean>;
24
+ interfacePrefix: z.ZodOptional<z.ZodString>;
25
+ enumPrefix: z.ZodOptional<z.ZodString>;
26
+ typePrefix: z.ZodOptional<z.ZodString>;
27
+ output: z.ZodString;
28
+ outputCore: z.ZodOptional<z.ZodString>;
29
+ outputServices: z.ZodOptional<z.ZodString>;
30
+ outputModels: z.ZodOptional<z.ZodString>;
31
+ outputSchemas: z.ZodOptional<z.ZodString>;
32
+ }, z.core.$strip>>>;
33
+ input: z.ZodOptional<z.ZodString>;
34
+ output: z.ZodOptional<z.ZodString>;
35
+ httpClient: z.ZodEnum<typeof import("../../..").HttpClient>;
36
+ }, z.core.$strip>;
7
37
  //# sourceMappingURL=UnifiedOptionsSchemaV1.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UnifiedOptionsSchemaV1.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAgBtB;;;GAGG;AACH,eAAO,MAAM,sBAAsB,uBA4BZ,CAAC"}
1
+ {"version":3,"file":"UnifiedOptionsSchemaV1.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAOtB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMjC,CAAC"}
@@ -1,41 +1,37 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.unifiedOptionsSchemaV1 = void 0;
7
- const joi_1 = __importDefault(require("joi"));
8
- const HttpClient_enum_1 = require("../../../core/types/enums/HttpClient.enum");
4
+ const zod_1 = require("zod");
9
5
  const CommonSchemas_1 = require("../CommonSchemas");
10
- const mergeObjectSchemas_1 = require("../Utils/mergeObjectSchemas");
11
- const itemSchema = (0, mergeObjectSchemas_1.mergeObjectSchemas)(joi_1.default.object({
12
- input: joi_1.default.string().required().description('Путь, URL или строка OpenAPI спецификации'),
13
- request: joi_1.default.string().optional(),
14
- }), CommonSchemas_1.outputPathsSchema, CommonSchemas_1.additionalParametersSchemaV2, CommonSchemas_1.experimentalParametersSchemaV2);
15
- /**
16
- * Unified options schema that supports both single and multi-item configurations.
17
- * Use either 'items' array for multiple specs OR 'input'/'output' for single spec.
18
- */
19
- exports.unifiedOptionsSchemaV1 = (0, mergeObjectSchemas_1.mergeObjectSchemas)(joi_1.default.object({
20
- // Multi-item configuration
21
- items: joi_1.default.array().items(itemSchema).min(1).optional().description('Массив спецификаций для генерации'),
22
- // Single-item configuration (mutually exclusive with items)
23
- input: joi_1.default.string()
24
- .when('items', {
25
- is: joi_1.default.exist(),
26
- then: joi_1.default.forbidden(),
27
- otherwise: joi_1.default.required(),
28
- })
29
- .description('Путь, URL или строка OpenAPI спецификации'),
30
- output: joi_1.default.string()
31
- .when('items', {
32
- is: joi_1.default.exist(),
33
- then: joi_1.default.forbidden(),
34
- otherwise: joi_1.default.required(),
35
- })
36
- .description('Выходная директория'),
37
- httpClient: joi_1.default.string()
38
- .valid(...Object.values(HttpClient_enum_1.HttpClient))
39
- .optional(),
40
- }), CommonSchemas_1.outputPathsSchema, // outputCore, outputServices, etc. for single-item mode
41
- CommonSchemas_1.specialParametersSchemasV2, CommonSchemas_1.additionalParametersSchemaV2, CommonSchemas_1.experimentalParametersSchemaV2).xor('items', 'input');
6
+ const UnifiedBase_1 = require("./UnifiedBase");
7
+ const outputPathsSchemaWithoutOutput = CommonSchemas_1.outputPathsSchema.omit({ output: true });
8
+ exports.unifiedOptionsSchemaV1 = zod_1.z.object({
9
+ ...UnifiedBase_1.unifiedOptionsShape.shape,
10
+ ...outputPathsSchemaWithoutOutput.shape,
11
+ ...CommonSchemas_1.specialParametersSchemasV2.shape,
12
+ ...CommonSchemas_1.additionalParametersSchemaV2.shape,
13
+ ...CommonSchemas_1.experimentalParametersSchemaV2.shape,
14
+ });
15
+ /*
16
+ type TUnified = {
17
+ httpClient: HttpClient.FETCH | HttpClient.XHR | HttpClient.NODE | HttpClient.AXIOS;
18
+ useCancelableRequest: boolean | undefined;
19
+ sortByRequired: boolean | undefined;
20
+ useSeparatedIndexes: boolean | undefined;
21
+ request: string | undefined;
22
+ interfacePrefix: string | undefined;
23
+ enumPrefix: string | undefined;
24
+ typePrefix: string | undefined;
25
+ useOptions: boolean | undefined;
26
+ useUnionTypes: boolean | undefined;
27
+ excludeCoreServiceFiles: boolean | undefined;
28
+ includeSchemasFiles: boolean | undefined;
29
+ outputCore: string | undefined;
30
+ outputServices: string | undefined;
31
+ outputModels: string | undefined;
32
+ outputSchemas: string | undefined;
33
+ items: { ... 13 more }[] | undefined;
34
+ input: string | undefined;
35
+ output: string | undefined;
36
+ }
37
+ */
@@ -1,7 +1,38 @@
1
- import Joi from 'joi';
2
- /**
3
- * Unified options schema that supports both single and multi-item configurations.
4
- * Use either 'items' array for multiple specs OR 'input'/'output' for single spec.
5
- */
6
- export declare const unifiedOptionsSchemaV2: Joi.ObjectSchema<any>;
1
+ import { z } from 'zod';
2
+ export declare const unifiedOptionsSchemaV2: z.ZodObject<{
3
+ useOptions: z.ZodOptional<z.ZodBoolean>;
4
+ useUnionTypes: z.ZodOptional<z.ZodBoolean>;
5
+ excludeCoreServiceFiles: z.ZodOptional<z.ZodBoolean>;
6
+ validationLibrary: z.ZodOptional<z.ZodEnum<typeof import("../../../core/types/enums/ValidationLibrary.enum").ValidationLibrary>>;
7
+ sortByRequired: z.ZodOptional<z.ZodBoolean>;
8
+ useSeparatedIndexes: z.ZodOptional<z.ZodBoolean>;
9
+ useCancelableRequest: z.ZodOptional<z.ZodBoolean>;
10
+ request: z.ZodOptional<z.ZodString>;
11
+ interfacePrefix: z.ZodOptional<z.ZodString>;
12
+ enumPrefix: z.ZodOptional<z.ZodString>;
13
+ typePrefix: z.ZodOptional<z.ZodString>;
14
+ includeSchemasFiles: z.ZodOptional<z.ZodBoolean>;
15
+ outputCore: z.ZodOptional<z.ZodString>;
16
+ outputServices: z.ZodOptional<z.ZodString>;
17
+ outputModels: z.ZodOptional<z.ZodString>;
18
+ outputSchemas: z.ZodOptional<z.ZodString>;
19
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
20
+ input: z.ZodString;
21
+ request: z.ZodOptional<z.ZodString>;
22
+ sortByRequired: z.ZodOptional<z.ZodBoolean>;
23
+ useSeparatedIndexes: z.ZodOptional<z.ZodBoolean>;
24
+ useCancelableRequest: z.ZodOptional<z.ZodBoolean>;
25
+ interfacePrefix: z.ZodOptional<z.ZodString>;
26
+ enumPrefix: z.ZodOptional<z.ZodString>;
27
+ typePrefix: z.ZodOptional<z.ZodString>;
28
+ output: z.ZodString;
29
+ outputCore: z.ZodOptional<z.ZodString>;
30
+ outputServices: z.ZodOptional<z.ZodString>;
31
+ outputModels: z.ZodOptional<z.ZodString>;
32
+ outputSchemas: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strip>>>;
34
+ input: z.ZodOptional<z.ZodString>;
35
+ output: z.ZodOptional<z.ZodString>;
36
+ httpClient: z.ZodEnum<typeof import("../../..").HttpClient>;
37
+ }, z.core.$strip>;
7
38
  //# sourceMappingURL=UnifiedOptionsSchemaV2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UnifiedOptionsSchemaV2.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAgBtB;;;GAGG;AACH,eAAO,MAAM,sBAAsB,uBA4BZ,CAAC"}
1
+ {"version":3,"file":"UnifiedOptionsSchemaV2.d.ts","sourceRoot":"","sources":["../../../../src/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAKtB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGjC,CAAC"}
@@ -1,41 +1,34 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.unifiedOptionsSchemaV2 = void 0;
7
- const joi_1 = __importDefault(require("joi"));
8
- const HttpClient_enum_1 = require("../../../core/types/enums/HttpClient.enum");
4
+ const zod_1 = require("zod");
9
5
  const CommonSchemas_1 = require("../CommonSchemas");
10
- const mergeObjectSchemas_1 = require("../Utils/mergeObjectSchemas");
11
- const itemSchema = (0, mergeObjectSchemas_1.mergeObjectSchemas)(joi_1.default.object({
12
- input: joi_1.default.string().required().description('Путь, URL или строка OpenAPI спецификации'),
13
- request: joi_1.default.string().optional(),
14
- }), CommonSchemas_1.outputPathsSchema, CommonSchemas_1.additionalParametersSchemaV2, CommonSchemas_1.experimentalParametersSchemaV2);
15
- /**
16
- * Unified options schema that supports both single and multi-item configurations.
17
- * Use either 'items' array for multiple specs OR 'input'/'output' for single spec.
18
- */
19
- exports.unifiedOptionsSchemaV2 = (0, mergeObjectSchemas_1.mergeObjectSchemas)(joi_1.default.object({
20
- // Multi-item configuration
21
- items: joi_1.default.array().items(itemSchema).min(1).optional().description('Массив спецификаций для генерации'),
22
- // Single-item configuration (mutually exclusive with items)
23
- input: joi_1.default.string()
24
- .when('items', {
25
- is: joi_1.default.exist(),
26
- then: joi_1.default.forbidden(),
27
- otherwise: joi_1.default.required(),
28
- })
29
- .description('Путь, URL или строка OpenAPI спецификации'),
30
- output: joi_1.default.string()
31
- .when('items', {
32
- is: joi_1.default.exist(),
33
- then: joi_1.default.forbidden(),
34
- otherwise: joi_1.default.required(),
35
- })
36
- .description('Выходная директория'),
37
- httpClient: joi_1.default.string()
38
- .valid(...Object.values(HttpClient_enum_1.HttpClient))
39
- .optional(),
40
- }), CommonSchemas_1.outputPathsSchema, // outputCore, outputServices, etc. for single-item mode
41
- CommonSchemas_1.specialParametersSchemasV3, CommonSchemas_1.additionalParametersSchemaV2, CommonSchemas_1.experimentalParametersSchemaV2).xor('items', 'input');
6
+ const UnifiedOptionsSchemaV1_1 = require("./UnifiedOptionsSchemaV1");
7
+ exports.unifiedOptionsSchemaV2 = zod_1.z.object({
8
+ ...UnifiedOptionsSchemaV1_1.unifiedOptionsSchemaV1.shape,
9
+ ...CommonSchemas_1.specialParametersSchemasV3.shape,
10
+ });
11
+ /*
12
+ type TUnified = {
13
+ output: string;
14
+ useOptions: boolean | undefined;
15
+ useUnionTypes: boolean | undefined;
16
+ excludeCoreServiceFiles: boolean | undefined;
17
+ validationLibrary: ValidationLibrary.NONE | ValidationLibrary.ZOD | ValidationLibrary.JOI | ValidationLibrary.YUP | ValidationLibrary.JSONSCHEMA | undefined;
18
+ useCancelableRequest: boolean | undefined;
19
+ sortByRequired: boolean | undefined;
20
+ useSeparatedIndexes: boolean | undefined;
21
+ request: string | undefined;
22
+ interfacePrefix: string | undefined;
23
+ enumPrefix: string | undefined;
24
+ typePrefix: string | undefined;
25
+ includeSchemasFiles: boolean | undefined;
26
+ outputCore: string | undefined;
27
+ outputServices: string | undefined;
28
+ outputModels: string | undefined;
29
+ outputSchemas: string | undefined;
30
+ items: { ... 13 more }[] | undefined;
31
+ input: string | undefined;
32
+ httpClient: HttpClient.FETCH | HttpClient.XHR | HttpClient.NODE | HttpClient.AXIOS | undefined;
33
+ }
34
+ */