ts-openapi-codegen 2.0.0-beta.1 → 2.0.0-beta.11

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 (599) hide show
  1. package/README.md +151 -103
  2. package/README.rus.md +151 -103
  3. package/dist/cli/checkAndUpdateConfig/checkConfig.d.ts +2 -1
  4. package/dist/cli/checkAndUpdateConfig/checkConfig.d.ts.map +1 -1
  5. package/dist/cli/checkAndUpdateConfig/checkConfig.js +14 -6
  6. package/dist/cli/checkAndUpdateConfig/updateConfig.d.ts +2 -1
  7. package/dist/cli/checkAndUpdateConfig/updateConfig.d.ts.map +1 -1
  8. package/dist/cli/checkAndUpdateConfig/updateConfig.js +13 -5
  9. package/dist/cli/{generate/runGenerateOpenApi.d.ts → generateOpenApiClient/generateOpenApiClient.d.ts} +2 -2
  10. package/dist/cli/generateOpenApiClient/generateOpenApiClient.d.ts.map +1 -0
  11. package/dist/cli/{generate/runGenerateOpenApi.js → generateOpenApiClient/generateOpenApiClient.js} +31 -11
  12. package/dist/cli/index.js +31 -8
  13. package/dist/cli/initOpenApiConfig/Types.d.ts +4 -4
  14. package/dist/cli/initOpenApiConfig/Types.d.ts.map +1 -1
  15. package/dist/cli/initOpenApiConfig/init.d.ts +6 -0
  16. package/dist/cli/initOpenApiConfig/init.d.ts.map +1 -0
  17. package/dist/cli/initOpenApiConfig/init.js +53 -0
  18. package/dist/cli/initOpenApiConfig/initConfig.d.ts +11 -0
  19. package/dist/cli/initOpenApiConfig/initConfig.d.ts.map +1 -0
  20. package/dist/cli/initOpenApiConfig/initConfig.js +102 -0
  21. package/dist/cli/initOpenApiConfig/initCustomRequest.d.ts +3 -0
  22. package/dist/cli/initOpenApiConfig/initCustomRequest.d.ts.map +1 -0
  23. package/dist/cli/initOpenApiConfig/initCustomRequest.js +23 -0
  24. package/dist/cli/initOpenApiConfig/utils/buildConfig.d.ts +21 -0
  25. package/dist/cli/initOpenApiConfig/utils/buildConfig.d.ts.map +1 -0
  26. package/dist/cli/initOpenApiConfig/utils/buildConfig.js +107 -0
  27. package/dist/cli/initOpenApiConfig/utils/findSpecFiles.d.ts +8 -0
  28. package/dist/cli/initOpenApiConfig/utils/findSpecFiles.d.ts.map +1 -0
  29. package/dist/cli/initOpenApiConfig/utils/findSpecFiles.js +40 -0
  30. package/dist/cli/initOpenApiConfig/utils/registerHandlebarTemplates.d.ts +3 -0
  31. package/dist/cli/initOpenApiConfig/utils/registerHandlebarTemplates.d.ts.map +1 -0
  32. package/dist/cli/initOpenApiConfig/utils/registerHandlebarTemplates.js +53 -0
  33. package/dist/cli/initOpenApiConfig/utils/validateSpecFile.d.ts +7 -0
  34. package/dist/cli/initOpenApiConfig/utils/validateSpecFile.d.ts.map +1 -0
  35. package/dist/cli/initOpenApiConfig/utils/validateSpecFile.js +23 -0
  36. package/dist/cli/initOpenApiConfig/utils/validateSpecFiles.d.ts +11 -0
  37. package/dist/cli/initOpenApiConfig/utils/validateSpecFiles.d.ts.map +1 -0
  38. package/dist/cli/initOpenApiConfig/utils/validateSpecFiles.js +24 -0
  39. package/dist/cli/initOpenApiConfig/utils/writeConfigFile.d.ts +11 -0
  40. package/dist/cli/initOpenApiConfig/utils/writeConfigFile.d.ts.map +1 -0
  41. package/dist/cli/initOpenApiConfig/utils/writeConfigFile.js +31 -0
  42. package/dist/cli/previewChanges/previewChanges.d.ts +8 -0
  43. package/dist/cli/previewChanges/previewChanges.d.ts.map +1 -0
  44. package/dist/cli/previewChanges/previewChanges.js +189 -0
  45. package/dist/cli/previewChanges/utils/compareFiles.d.ts +6 -0
  46. package/dist/cli/previewChanges/utils/compareFiles.d.ts.map +1 -0
  47. package/dist/cli/previewChanges/utils/compareFiles.js +50 -0
  48. package/dist/cli/previewChanges/utils/formatDiff.d.ts +6 -0
  49. package/dist/cli/previewChanges/utils/formatDiff.d.ts.map +1 -0
  50. package/dist/cli/previewChanges/utils/formatDiff.js +30 -0
  51. package/dist/cli/previewChanges/utils/isDirectoryEmpty.d.ts +5 -0
  52. package/dist/cli/previewChanges/utils/isDirectoryEmpty.d.ts.map +1 -0
  53. package/dist/cli/previewChanges/utils/isDirectoryEmpty.js +17 -0
  54. package/dist/cli/previewChanges/utils/readDirectoryRecursive.d.ts +5 -0
  55. package/dist/cli/previewChanges/utils/readDirectoryRecursive.d.ts.map +1 -0
  56. package/dist/cli/previewChanges/utils/readDirectoryRecursive.js +28 -0
  57. package/dist/cli/previewChanges/utils/updateOutputPaths.d.ts +10 -0
  58. package/dist/cli/previewChanges/utils/updateOutputPaths.d.ts.map +1 -0
  59. package/dist/cli/previewChanges/utils/updateOutputPaths.js +106 -0
  60. package/dist/cli/schemas/base.d.ts +22 -0
  61. package/dist/cli/schemas/base.d.ts.map +1 -0
  62. package/dist/cli/schemas/base.js +23 -0
  63. package/dist/cli/schemas/checkConfig.d.ts +6 -0
  64. package/dist/cli/schemas/checkConfig.d.ts.map +1 -0
  65. package/dist/cli/schemas/checkConfig.js +5 -0
  66. package/dist/cli/schemas/generate.d.ts +8 -0
  67. package/dist/cli/schemas/generate.d.ts.map +1 -0
  68. package/dist/cli/schemas/generate.js +45 -0
  69. package/dist/cli/schemas/index.d.ts +8 -0
  70. package/dist/cli/schemas/index.d.ts.map +1 -0
  71. package/dist/cli/schemas/index.js +22 -0
  72. package/dist/cli/schemas/init.d.ts +10 -0
  73. package/dist/cli/schemas/init.d.ts.map +1 -0
  74. package/dist/cli/schemas/init.js +11 -0
  75. package/dist/cli/schemas/previewChanges.d.ts +9 -0
  76. package/dist/cli/schemas/previewChanges.d.ts.map +1 -0
  77. package/dist/cli/schemas/previewChanges.js +11 -0
  78. package/dist/cli/schemas/updateConfig.d.ts +6 -0
  79. package/dist/cli/schemas/updateConfig.d.ts.map +1 -0
  80. package/dist/cli/schemas/updateConfig.js +5 -0
  81. package/dist/common/Consts.d.ts +5 -0
  82. package/dist/common/Consts.d.ts.map +1 -1
  83. package/dist/common/Consts.js +11 -2
  84. package/dist/common/LoggerMessages.js +1 -1
  85. package/dist/common/TRawOptions.d.ts +4 -36
  86. package/dist/common/TRawOptions.d.ts.map +1 -1
  87. package/dist/common/Validation/formatZodError.d.ts +10 -0
  88. package/dist/common/Validation/formatZodError.d.ts.map +1 -0
  89. package/dist/common/Validation/formatZodError.js +114 -0
  90. package/dist/common/Validation/index.d.ts +3 -0
  91. package/dist/common/Validation/index.d.ts.map +1 -0
  92. package/dist/common/Validation/index.js +18 -0
  93. package/dist/common/Validation/validateZodOptions.d.ts +27 -0
  94. package/dist/common/Validation/validateZodOptions.d.ts.map +1 -0
  95. package/dist/common/Validation/validateZodOptions.js +35 -0
  96. package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.d.ts.map +1 -1
  97. package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.js +20 -4
  98. package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.d.ts +6 -1
  99. package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.d.ts.map +1 -1
  100. package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.js +8 -8
  101. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.d.ts +28 -0
  102. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.d.ts.map +1 -0
  103. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.js +25 -0
  104. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts +37 -0
  105. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts.map +1 -0
  106. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.js +37 -0
  107. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts +38 -0
  108. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts.map +1 -0
  109. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.js +34 -0
  110. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.d.ts +40 -0
  111. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.d.ts.map +1 -0
  112. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.js +36 -0
  113. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.d.ts +42 -0
  114. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.d.ts.map +1 -0
  115. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.js +41 -0
  116. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts +67 -0
  117. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts.map +1 -0
  118. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.js +37 -0
  119. package/dist/common/VersionedSchema/CommonSchemas.d.ts +61 -29
  120. package/dist/common/VersionedSchema/CommonSchemas.d.ts.map +1 -1
  121. package/dist/common/VersionedSchema/CommonSchemas.js +51 -61
  122. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsMigrationPlan.d.ts.map +1 -1
  123. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsMigrationPlan.js +9 -16
  124. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts +25 -5
  125. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts.map +1 -1
  126. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.js +34 -17
  127. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.d.ts +25 -5
  128. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.d.ts.map +1 -1
  129. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.js +28 -19
  130. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.d.ts +25 -1
  131. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.d.ts.map +1 -1
  132. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.js +29 -2
  133. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts +25 -5
  134. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts.map +1 -1
  135. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.js +30 -14
  136. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts +23 -5
  137. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts.map +1 -1
  138. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.js +33 -18
  139. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas.d.ts +3 -2
  140. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas.d.ts.map +1 -1
  141. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas.js +18 -11
  142. package/dist/common/VersionedSchema/OptionsVersioned/OptionsMigrationPlans.d.ts.map +1 -1
  143. package/dist/common/VersionedSchema/OptionsVersioned/OptionsMigrationPlans.js +2 -5
  144. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts +22 -5
  145. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts.map +1 -1
  146. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.js +30 -12
  147. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.d.ts +22 -5
  148. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.d.ts.map +1 -1
  149. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.js +27 -13
  150. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.d.ts +22 -1
  151. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.d.ts.map +1 -1
  152. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.js +28 -2
  153. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts +22 -5
  154. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts.map +1 -1
  155. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.js +31 -12
  156. package/dist/common/VersionedSchema/OptionsVersioned/OptionsVersionedSchemas.d.ts +3 -2
  157. package/dist/common/VersionedSchema/OptionsVersioned/OptionsVersionedSchemas.d.ts.map +1 -1
  158. package/dist/common/VersionedSchema/OptionsVersioned/OptionsVersionedSchemas.js +15 -9
  159. package/dist/common/VersionedSchema/Types.d.ts +5 -5
  160. package/dist/common/VersionedSchema/Types.d.ts.map +1 -1
  161. package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.d.ts +16 -0
  162. package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.d.ts.map +1 -0
  163. package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.js +91 -0
  164. package/dist/common/VersionedSchema/Utils/__tests__/compareShapes.test.d.ts +2 -0
  165. package/dist/common/VersionedSchema/Utils/__tests__/compareShapes.test.d.ts.map +1 -0
  166. package/dist/common/VersionedSchema/Utils/__tests__/compareShapes.test.js +23 -0
  167. package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.d.ts +2 -0
  168. package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.d.ts.map +1 -0
  169. package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.js +75 -0
  170. package/dist/common/VersionedSchema/Utils/buildVersionedSchema.d.ts +12 -0
  171. package/dist/common/VersionedSchema/Utils/buildVersionedSchema.d.ts.map +1 -0
  172. package/dist/common/VersionedSchema/Utils/buildVersionedSchema.js +13 -0
  173. package/dist/common/VersionedSchema/Utils/compareShapes.d.ts +16 -0
  174. package/dist/common/VersionedSchema/Utils/compareShapes.d.ts.map +1 -0
  175. package/dist/common/VersionedSchema/Utils/compareShapes.js +30 -0
  176. package/dist/common/VersionedSchema/Utils/createFieldTransformationMigration.d.ts +32 -0
  177. package/dist/common/VersionedSchema/Utils/createFieldTransformationMigration.d.ts.map +1 -0
  178. package/dist/common/VersionedSchema/Utils/createFieldTransformationMigration.js +40 -0
  179. package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts +2 -1
  180. package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts.map +1 -1
  181. package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.js +5 -5
  182. package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.d.ts +2 -2
  183. package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.d.ts.map +1 -1
  184. package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.js +15 -7
  185. package/dist/common/VersionedSchema/Utils/getLatestVersionFromMigrationPlans.d.ts +16 -0
  186. package/dist/common/VersionedSchema/Utils/getLatestVersionFromMigrationPlans.d.ts.map +1 -0
  187. package/dist/common/VersionedSchema/Utils/getLatestVersionFromMigrationPlans.js +23 -0
  188. package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.d.ts +2 -2
  189. package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.d.ts.map +1 -1
  190. package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.js +16 -3
  191. package/dist/common/VersionedSchema/Utils/getUniqueObjectKeys.d.ts.map +1 -1
  192. package/dist/common/VersionedSchema/Utils/getUniqueObjectKeys.js +19 -2
  193. package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts +2 -1
  194. package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts.map +1 -1
  195. package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.js +10 -9
  196. package/dist/common/VersionedSchema/refinements/dependentOptionsRefinement.d.ts +4 -0
  197. package/dist/common/VersionedSchema/refinements/dependentOptionsRefinement.d.ts.map +1 -0
  198. package/dist/common/VersionedSchema/refinements/dependentOptionsRefinement.js +43 -0
  199. package/dist/common/VersionedSchema/refinements/singleOrMultiRefinement.d.ts +4 -0
  200. package/dist/common/VersionedSchema/refinements/singleOrMultiRefinement.d.ts.map +1 -0
  201. package/dist/common/VersionedSchema/refinements/singleOrMultiRefinement.js +21 -0
  202. package/dist/common/defaultOptions.d.ts.map +1 -1
  203. package/dist/common/defaultOptions.js +4 -1
  204. package/dist/common/utils/__tests__/convertArrayToObject.test.js +10 -6
  205. package/dist/common/utils/convertArrayToObject.js +2 -2
  206. package/dist/common/utils/fileSystemHelpers.d.ts +3 -1
  207. package/dist/common/utils/fileSystemHelpers.d.ts.map +1 -1
  208. package/dist/common/utils/fileSystemHelpers.js +3 -0
  209. package/dist/core/Context.d.ts +25 -2
  210. package/dist/core/Context.d.ts.map +1 -1
  211. package/dist/core/Context.js +144 -4
  212. package/dist/core/OpenApiClient.d.ts.map +1 -1
  213. package/dist/core/OpenApiClient.js +60 -13
  214. package/dist/core/WriteClient.d.ts +13 -14
  215. package/dist/core/WriteClient.d.ts.map +1 -1
  216. package/dist/core/WriteClient.js +71 -24
  217. package/dist/core/__tests__/WriteClient.test.js +9 -2
  218. package/dist/core/api/v2/Parser.d.ts +1 -1
  219. package/dist/core/api/v2/Parser.d.ts.map +1 -1
  220. package/dist/core/api/v2/Parser.js +2 -2
  221. package/dist/core/api/v2/parser/getModel.d.ts.map +1 -1
  222. package/dist/core/api/v2/parser/getModel.js +2 -5
  223. package/dist/core/api/v2/parser/getModelProperties.d.ts.map +1 -1
  224. package/dist/core/api/v2/parser/getModelProperties.js +1 -3
  225. package/dist/core/api/v2/parser/getModels.d.ts.map +1 -1
  226. package/dist/core/api/v2/parser/getModels.js +2 -4
  227. package/dist/core/api/v2/parser/getOperationParameter.d.ts.map +1 -1
  228. package/dist/core/api/v2/parser/getOperationParameter.js +2 -5
  229. package/dist/core/api/v2/parser/getOperationParameters.js +1 -1
  230. package/dist/core/api/v2/parser/getOperationResponse.d.ts.map +1 -1
  231. package/dist/core/api/v2/parser/getOperationResponse.js +1 -3
  232. package/dist/core/api/v2/parser/getOperationResponses.js +1 -1
  233. package/dist/core/api/v2/parser/getServices.d.ts.map +1 -1
  234. package/dist/core/api/v2/parser/getServices.js +4 -3
  235. package/dist/core/api/v2/parser/getType.d.ts.map +1 -1
  236. package/dist/core/api/v2/parser/getType.js +16 -9
  237. package/dist/core/api/v3/Parser.d.ts +1 -1
  238. package/dist/core/api/v3/Parser.d.ts.map +1 -1
  239. package/dist/core/api/v3/Parser.js +2 -2
  240. package/dist/core/api/v3/parser/getModel.d.ts.map +1 -1
  241. package/dist/core/api/v3/parser/getModel.js +2 -5
  242. package/dist/core/api/v3/parser/getModelProperties.d.ts.map +1 -1
  243. package/dist/core/api/v3/parser/getModelProperties.js +1 -3
  244. package/dist/core/api/v3/parser/getModels.d.ts.map +1 -1
  245. package/dist/core/api/v3/parser/getModels.js +2 -4
  246. package/dist/core/api/v3/parser/getOperation.js +1 -1
  247. package/dist/core/api/v3/parser/getOperationParameter.d.ts.map +1 -1
  248. package/dist/core/api/v3/parser/getOperationParameter.js +2 -5
  249. package/dist/core/api/v3/parser/getOperationParameters.js +1 -1
  250. package/dist/core/api/v3/parser/getOperationRequestBody.d.ts.map +1 -1
  251. package/dist/core/api/v3/parser/getOperationRequestBody.js +1 -3
  252. package/dist/core/api/v3/parser/getOperationResponse.d.ts.map +1 -1
  253. package/dist/core/api/v3/parser/getOperationResponse.js +1 -3
  254. package/dist/core/api/v3/parser/getOperationResponses.js +1 -1
  255. package/dist/core/api/v3/parser/getServices.d.ts.map +1 -1
  256. package/dist/core/api/v3/parser/getServices.js +4 -3
  257. package/dist/core/api/v3/parser/getType.d.ts.map +1 -1
  258. package/dist/core/api/v3/parser/getType.js +16 -9
  259. package/dist/core/index.d.ts.map +1 -1
  260. package/dist/core/index.js +2 -0
  261. package/dist/core/types/base/ClientArtifacts.model.d.ts +1 -1
  262. package/dist/core/types/base/ClientArtifacts.model.d.ts.map +1 -1
  263. package/dist/core/types/base/SimpleClientArtifacts.model.d.ts +1 -1
  264. package/dist/core/types/base/SimpleClientArtifacts.model.d.ts.map +1 -1
  265. package/dist/core/types/base/Templates.model.d.ts +32 -0
  266. package/dist/core/types/base/Templates.model.d.ts.map +1 -0
  267. package/dist/core/types/enums/EmptySchemaStrategy.enum.d.ts +6 -0
  268. package/dist/core/types/enums/EmptySchemaStrategy.enum.d.ts.map +1 -0
  269. package/dist/core/types/enums/EmptySchemaStrategy.enum.js +9 -0
  270. package/dist/core/types/enums/ValidationLibrary.enum.d.ts +8 -0
  271. package/dist/core/types/enums/ValidationLibrary.enum.d.ts.map +1 -0
  272. package/dist/core/types/enums/ValidationLibrary.enum.js +11 -0
  273. package/dist/core/utils/__mocks__/templates.d.ts +1 -1
  274. package/dist/core/utils/__mocks__/templates.d.ts.map +1 -1
  275. package/dist/core/utils/__mocks__/templates.js +5 -1
  276. package/dist/core/utils/__tests__/getRelativeModelPath.test.js +9 -3
  277. package/dist/core/utils/__tests__/isSubdirectory.test.js +2 -2
  278. package/dist/core/utils/__tests__/modelHelpers.test.d.ts +2 -0
  279. package/dist/core/utils/__tests__/modelHelpers.test.d.ts.map +1 -0
  280. package/dist/core/utils/__tests__/modelHelpers.test.js +151 -0
  281. package/dist/core/utils/__tests__/postProcessModelImports.test.d.ts +2 -0
  282. package/dist/core/utils/__tests__/postProcessModelImports.test.d.ts.map +1 -0
  283. package/dist/core/utils/__tests__/postProcessModelImports.test.js +67 -0
  284. package/dist/core/utils/__tests__/postProcessServiceImports.test.d.ts +2 -0
  285. package/dist/core/utils/__tests__/postProcessServiceImports.test.d.ts.map +1 -0
  286. package/dist/core/utils/__tests__/postProcessServiceImports.test.js +26 -0
  287. package/dist/core/utils/__tests__/registerHandlebarTemplates.test.js +2 -0
  288. package/dist/core/utils/__tests__/resolveRefPath.test.d.ts +2 -0
  289. package/dist/core/utils/__tests__/resolveRefPath.test.d.ts.map +1 -0
  290. package/dist/core/utils/__tests__/resolveRefPath.test.js +22 -0
  291. package/dist/core/utils/__tests__/serviceHelpers.test.d.ts +2 -0
  292. package/dist/core/utils/__tests__/serviceHelpers.test.d.ts.map +1 -0
  293. package/dist/core/utils/__tests__/serviceHelpers.test.js +121 -0
  294. package/dist/core/utils/__tests__/writeClientExecutor.test.d.ts +2 -0
  295. package/dist/core/utils/__tests__/writeClientExecutor.test.d.ts.map +1 -0
  296. package/dist/core/utils/__tests__/writeClientExecutor.test.js +20 -0
  297. package/dist/core/utils/__tests__/writeClientSchemas.test.js +4 -0
  298. package/dist/core/utils/getOpenApiSpec.d.ts +0 -6
  299. package/dist/core/utils/getOpenApiSpec.d.ts.map +1 -1
  300. package/dist/core/utils/getOpenApiSpec.js +26 -23
  301. package/dist/core/utils/modelHelpers.d.ts.map +1 -1
  302. package/dist/core/utils/modelHelpers.js +37 -3
  303. package/dist/core/utils/postProcessModelImports.d.ts.map +1 -1
  304. package/dist/core/utils/postProcessModelImports.js +14 -1
  305. package/dist/core/utils/postProcessServiceImports.d.ts.map +1 -1
  306. package/dist/core/utils/postProcessServiceImports.js +1 -2
  307. package/dist/core/utils/precompileTemplates.js +8 -0
  308. package/dist/core/utils/registerHandlebarHelpers.d.ts.map +1 -1
  309. package/dist/core/utils/registerHandlebarHelpers.js +110 -0
  310. package/dist/core/utils/registerHandlebarTemplates.d.ts +3 -27
  311. package/dist/core/utils/registerHandlebarTemplates.d.ts.map +1 -1
  312. package/dist/core/utils/registerHandlebarTemplates.js +97 -6
  313. package/dist/core/utils/resolveRefPath.d.ts.map +1 -1
  314. package/dist/core/utils/resolveRefPath.js +1 -4
  315. package/dist/core/utils/serviceHelpers.d.ts.map +1 -1
  316. package/dist/core/utils/serviceHelpers.js +32 -6
  317. package/dist/core/utils/stripNamespace.js +1 -1
  318. package/dist/core/utils/validateRawOptions.d.ts +3 -0
  319. package/dist/core/utils/validateRawOptions.d.ts.map +1 -0
  320. package/dist/core/utils/validateRawOptions.js +15 -0
  321. package/dist/core/utils/writeClientCore.d.ts +1 -1
  322. package/dist/core/utils/writeClientCore.d.ts.map +1 -1
  323. package/dist/core/utils/writeClientCore.js +7 -4
  324. package/dist/core/utils/writeClientCoreIndex.d.ts +1 -1
  325. package/dist/core/utils/writeClientCoreIndex.d.ts.map +1 -1
  326. package/dist/core/utils/writeClientExecutor.d.ts +13 -0
  327. package/dist/core/utils/writeClientExecutor.d.ts.map +1 -0
  328. package/dist/core/utils/writeClientExecutor.js +30 -0
  329. package/dist/core/utils/writeClientFullIndex.d.ts.map +1 -1
  330. package/dist/core/utils/writeClientFullIndex.js +1 -1
  331. package/dist/core/utils/writeClientModels.d.ts +1 -1
  332. package/dist/core/utils/writeClientModels.d.ts.map +1 -1
  333. package/dist/core/utils/writeClientModelsIndex.d.ts +1 -1
  334. package/dist/core/utils/writeClientModelsIndex.d.ts.map +1 -1
  335. package/dist/core/utils/writeClientSchemas.d.ts +7 -2
  336. package/dist/core/utils/writeClientSchemas.d.ts.map +1 -1
  337. package/dist/core/utils/writeClientSchemas.js +32 -20
  338. package/dist/core/utils/writeClientSchemasIndex.d.ts +1 -1
  339. package/dist/core/utils/writeClientSchemasIndex.d.ts.map +1 -1
  340. package/dist/core/utils/writeClientServices.d.ts +1 -1
  341. package/dist/core/utils/writeClientServices.d.ts.map +1 -1
  342. package/dist/core/utils/writeClientServicesIndex.d.ts +1 -1
  343. package/dist/core/utils/writeClientServicesIndex.d.ts.map +1 -1
  344. package/dist/core/utils/writeClientSimpleIndex.d.ts.map +1 -1
  345. package/dist/core/utils/writeClientSimpleIndex.js +1 -1
  346. package/dist/templatesCompiled/cli/customRequest.d.ts +11 -0
  347. package/dist/templatesCompiled/cli/customRequest.d.ts.map +1 -0
  348. package/dist/templatesCompiled/cli/customRequest.js +27 -0
  349. package/dist/templatesCompiled/cli/customRequestExecutor.d.ts +11 -0
  350. package/dist/templatesCompiled/cli/customRequestExecutor.d.ts.map +1 -0
  351. package/dist/templatesCompiled/cli/customRequestExecutor.js +27 -0
  352. package/dist/templatesCompiled/cli/openApiConfig.d.ts +2 -1
  353. package/dist/templatesCompiled/cli/openApiConfig.d.ts.map +1 -1
  354. package/dist/templatesCompiled/cli/openApiConfig.js +76 -4
  355. package/dist/templatesCompiled/client/core/ApiError.js +1 -1
  356. package/dist/templatesCompiled/client/core/CancelablePromise.d.ts +1 -0
  357. package/dist/templatesCompiled/client/core/CancelablePromise.d.ts.map +1 -1
  358. package/dist/templatesCompiled/client/core/CancelablePromise.js +9 -2
  359. package/dist/templatesCompiled/client/core/HttpStatusCode.d.ts +1 -0
  360. package/dist/templatesCompiled/client/core/HttpStatusCode.d.ts.map +1 -1
  361. package/dist/templatesCompiled/client/core/HttpStatusCode.js +9 -2
  362. package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.d.ts +12 -0
  363. package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.d.ts.map +1 -0
  364. package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.js +32 -0
  365. package/dist/templatesCompiled/client/core/{legacy-request-adapter.d.ts → executor/requestExecutor.d.ts} +1 -1
  366. package/dist/templatesCompiled/client/core/executor/requestExecutor.d.ts.map +1 -0
  367. package/dist/templatesCompiled/client/core/executor/requestExecutor.js +18 -0
  368. package/dist/templatesCompiled/client/core/functions/catchErrors.js +1 -1
  369. package/dist/templatesCompiled/client/core/interceptors/apiErrorInterceptor.d.ts +8 -0
  370. package/dist/templatesCompiled/client/core/interceptors/apiErrorInterceptor.d.ts.map +1 -0
  371. package/dist/templatesCompiled/client/core/interceptors/apiErrorInterceptor.js +18 -0
  372. package/dist/templatesCompiled/client/core/{request-executor.d.ts → interceptors/interceptors.d.ts} +2 -1
  373. package/dist/templatesCompiled/client/core/interceptors/interceptors.d.ts.map +1 -0
  374. package/dist/templatesCompiled/client/core/interceptors/interceptors.js +18 -0
  375. package/dist/templatesCompiled/client/core/interceptors/withInterceptors.d.ts +8 -0
  376. package/dist/templatesCompiled/client/core/interceptors/withInterceptors.d.ts.map +1 -0
  377. package/dist/templatesCompiled/client/core/interceptors/withInterceptors.js +18 -0
  378. package/dist/templatesCompiled/client/exportClient.d.ts +10 -0
  379. package/dist/templatesCompiled/client/exportClient.d.ts.map +1 -0
  380. package/dist/templatesCompiled/client/exportClient.js +53 -0
  381. package/dist/templatesCompiled/client/exportService.js +1 -1
  382. package/dist/templatesCompiled/client/indexCore.js +2 -2
  383. package/dist/templatesCompiled/client/indexFull.d.ts +13 -9
  384. package/dist/templatesCompiled/client/indexFull.d.ts.map +1 -1
  385. package/dist/templatesCompiled/client/indexFull.js +72 -46
  386. package/dist/templatesCompiled/client/indexSimple.d.ts +1 -0
  387. package/dist/templatesCompiled/client/indexSimple.d.ts.map +1 -1
  388. package/dist/templatesCompiled/client/indexSimple.js +5 -1
  389. package/dist/templatesCompiled/client/joi/exportSchema.d.ts +11 -0
  390. package/dist/templatesCompiled/client/joi/exportSchema.d.ts.map +1 -0
  391. package/dist/templatesCompiled/client/joi/exportSchema.js +71 -0
  392. package/dist/templatesCompiled/client/joi/partials/joiSchema.d.ts +22 -0
  393. package/dist/templatesCompiled/client/joi/partials/joiSchema.d.ts.map +1 -0
  394. package/dist/templatesCompiled/client/joi/partials/joiSchema.js +129 -0
  395. package/dist/templatesCompiled/client/joi/partials/joiSchemaArray.d.ts +16 -0
  396. package/dist/templatesCompiled/client/joi/partials/joiSchemaArray.d.ts.map +1 -0
  397. package/dist/templatesCompiled/client/joi/partials/joiSchemaArray.js +84 -0
  398. package/dist/templatesCompiled/client/joi/partials/joiSchemaComposition.d.ts +18 -0
  399. package/dist/templatesCompiled/client/joi/partials/joiSchemaComposition.d.ts.map +1 -0
  400. package/dist/templatesCompiled/client/joi/partials/joiSchemaComposition.js +96 -0
  401. package/dist/templatesCompiled/client/joi/partials/joiSchemaDictionary.d.ts +14 -0
  402. package/dist/templatesCompiled/client/joi/partials/joiSchemaDictionary.d.ts.map +1 -0
  403. package/dist/templatesCompiled/client/joi/partials/joiSchemaDictionary.js +72 -0
  404. package/dist/templatesCompiled/client/joi/partials/joiSchemaEnum.d.ts +14 -0
  405. package/dist/templatesCompiled/client/joi/partials/joiSchemaEnum.d.ts.map +1 -0
  406. package/dist/templatesCompiled/client/joi/partials/joiSchemaEnum.js +74 -0
  407. package/dist/templatesCompiled/client/joi/partials/joiSchemaGeneric.d.ts +35 -0
  408. package/dist/templatesCompiled/client/joi/partials/joiSchemaGeneric.d.ts.map +1 -0
  409. package/dist/templatesCompiled/client/joi/partials/joiSchemaGeneric.js +201 -0
  410. package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts +16 -0
  411. package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts.map +1 -0
  412. package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.js +77 -0
  413. package/dist/templatesCompiled/client/joi/partials/joiSchemaReference.d.ts +9 -0
  414. package/dist/templatesCompiled/client/joi/partials/joiSchemaReference.d.ts.map +1 -0
  415. package/dist/templatesCompiled/client/joi/partials/joiSchemaReference.js +25 -0
  416. package/dist/templatesCompiled/client/jsonschema/exportSchema.d.ts +11 -0
  417. package/dist/templatesCompiled/client/jsonschema/exportSchema.d.ts.map +1 -0
  418. package/dist/templatesCompiled/client/jsonschema/exportSchema.js +69 -0
  419. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchema.d.ts +22 -0
  420. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchema.d.ts.map +1 -0
  421. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchema.js +129 -0
  422. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaArray.d.ts +16 -0
  423. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaArray.d.ts.map +1 -0
  424. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaArray.js +74 -0
  425. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaComposition.d.ts +16 -0
  426. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaComposition.d.ts.map +1 -0
  427. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaComposition.js +84 -0
  428. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaDictionary.d.ts +13 -0
  429. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaDictionary.d.ts.map +1 -0
  430. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaDictionary.js +56 -0
  431. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaEnum.d.ts +12 -0
  432. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaEnum.d.ts.map +1 -0
  433. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaEnum.js +49 -0
  434. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaGeneric.d.ts +29 -0
  435. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaGeneric.d.ts.map +1 -0
  436. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaGeneric.js +175 -0
  437. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts +17 -0
  438. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts.map +1 -0
  439. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.js +93 -0
  440. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaReference.d.ts +9 -0
  441. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaReference.d.ts.map +1 -0
  442. package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaReference.js +25 -0
  443. package/dist/templatesCompiled/client/partials/exportComposition.d.ts +2 -0
  444. package/dist/templatesCompiled/client/partials/exportComposition.d.ts.map +1 -1
  445. package/dist/templatesCompiled/client/partials/exportComposition.js +17 -9
  446. package/dist/templatesCompiled/client/partials/parameters.js +1 -1
  447. package/dist/templatesCompiled/client/partials/serviceOption.d.ts +2 -4
  448. package/dist/templatesCompiled/client/partials/serviceOption.d.ts.map +1 -1
  449. package/dist/templatesCompiled/client/partials/serviceOption.js +32 -46
  450. package/dist/templatesCompiled/client/yup/exportSchema.d.ts +11 -0
  451. package/dist/templatesCompiled/client/yup/exportSchema.d.ts.map +1 -0
  452. package/dist/templatesCompiled/client/yup/exportSchema.js +73 -0
  453. package/dist/templatesCompiled/client/yup/partials/yupSchema.d.ts +22 -0
  454. package/dist/templatesCompiled/client/yup/partials/yupSchema.d.ts.map +1 -0
  455. package/dist/templatesCompiled/client/yup/partials/yupSchema.js +129 -0
  456. package/dist/templatesCompiled/client/yup/partials/yupSchemaArray.d.ts +16 -0
  457. package/dist/templatesCompiled/client/yup/partials/yupSchemaArray.d.ts.map +1 -0
  458. package/dist/templatesCompiled/client/yup/partials/yupSchemaArray.js +84 -0
  459. package/dist/templatesCompiled/client/yup/partials/yupSchemaComposition.d.ts +18 -0
  460. package/dist/templatesCompiled/client/yup/partials/yupSchemaComposition.d.ts.map +1 -0
  461. package/dist/templatesCompiled/client/yup/partials/yupSchemaComposition.js +96 -0
  462. package/dist/templatesCompiled/client/yup/partials/yupSchemaDictionary.d.ts +14 -0
  463. package/dist/templatesCompiled/client/yup/partials/yupSchemaDictionary.d.ts.map +1 -0
  464. package/dist/templatesCompiled/client/yup/partials/yupSchemaDictionary.js +72 -0
  465. package/dist/templatesCompiled/client/yup/partials/yupSchemaEnum.d.ts +14 -0
  466. package/dist/templatesCompiled/client/yup/partials/yupSchemaEnum.d.ts.map +1 -0
  467. package/dist/templatesCompiled/client/yup/partials/yupSchemaEnum.js +74 -0
  468. package/dist/templatesCompiled/client/yup/partials/yupSchemaGeneric.d.ts +34 -0
  469. package/dist/templatesCompiled/client/yup/partials/yupSchemaGeneric.d.ts.map +1 -0
  470. package/dist/templatesCompiled/client/yup/partials/yupSchemaGeneric.js +201 -0
  471. package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts +16 -0
  472. package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts.map +1 -0
  473. package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.js +77 -0
  474. package/dist/templatesCompiled/client/yup/partials/yupSchemaReference.d.ts +9 -0
  475. package/dist/templatesCompiled/client/yup/partials/yupSchemaReference.d.ts.map +1 -0
  476. package/dist/templatesCompiled/client/yup/partials/yupSchemaReference.js +25 -0
  477. package/dist/templatesCompiled/client/zod/exportSchema.d.ts +11 -0
  478. package/dist/templatesCompiled/client/zod/exportSchema.d.ts.map +1 -0
  479. package/dist/templatesCompiled/client/zod/exportSchema.js +67 -0
  480. package/dist/templatesCompiled/client/zod/partials/zodSchema.d.ts +22 -0
  481. package/dist/templatesCompiled/client/zod/partials/zodSchema.d.ts.map +1 -0
  482. package/dist/templatesCompiled/client/zod/partials/zodSchema.js +129 -0
  483. package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts +13 -0
  484. package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts.map +1 -0
  485. package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.js +51 -0
  486. package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts +18 -0
  487. package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts.map +1 -0
  488. package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.js +94 -0
  489. package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts +11 -0
  490. package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts.map +1 -0
  491. package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.js +39 -0
  492. package/dist/templatesCompiled/client/zod/partials/zodSchemaEnum.d.ts +15 -0
  493. package/dist/templatesCompiled/client/zod/partials/zodSchemaEnum.d.ts.map +1 -0
  494. package/dist/templatesCompiled/client/zod/partials/zodSchemaEnum.js +86 -0
  495. package/dist/templatesCompiled/client/zod/partials/zodSchemaGeneric.d.ts +34 -0
  496. package/dist/templatesCompiled/client/zod/partials/zodSchemaGeneric.d.ts.map +1 -0
  497. package/dist/templatesCompiled/client/zod/partials/zodSchemaGeneric.js +193 -0
  498. package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts +16 -0
  499. package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts.map +1 -0
  500. package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.js +61 -0
  501. package/dist/templatesCompiled/client/zod/partials/zodSchemaReference.d.ts +9 -0
  502. package/dist/templatesCompiled/client/zod/partials/zodSchemaReference.d.ts.map +1 -0
  503. package/dist/templatesCompiled/client/zod/partials/zodSchemaReference.js +25 -0
  504. package/package.json +9 -4
  505. package/dist/cli/generate/runGenerateOpenApi.d.ts.map +0 -1
  506. package/dist/cli/initOpenApiConfig/Enums.d.ts +0 -5
  507. package/dist/cli/initOpenApiConfig/Enums.d.ts.map +0 -1
  508. package/dist/cli/initOpenApiConfig/Enums.js +0 -8
  509. package/dist/cli/initOpenApiConfig/runInitOpenapiConfig.d.ts +0 -3
  510. package/dist/cli/initOpenApiConfig/runInitOpenapiConfig.d.ts.map +0 -1
  511. package/dist/cli/initOpenApiConfig/runInitOpenapiConfig.js +0 -70
  512. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsMigrationPlan.d.ts +0 -3
  513. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsMigrationPlan.d.ts.map +0 -1
  514. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsMigrationPlan.js +0 -28
  515. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsSchemaV1.d.ts +0 -7
  516. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsSchemaV1.d.ts.map +0 -1
  517. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsSchemaV1.js +0 -42
  518. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsVersionedSchemas.d.ts +0 -3
  519. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsVersionedSchemas.d.ts.map +0 -1
  520. package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsVersionedSchemas.js +0 -10
  521. package/dist/common/VersionedSchema/Utils/getErrorFieldsFromValidation.d.ts +0 -6
  522. package/dist/common/VersionedSchema/Utils/getErrorFieldsFromValidation.d.ts.map +0 -1
  523. package/dist/common/VersionedSchema/Utils/getErrorFieldsFromValidation.js +0 -7
  524. package/dist/common/VersionedSchema/Utils/joiHandlers.d.ts +0 -6
  525. package/dist/common/VersionedSchema/Utils/joiHandlers.d.ts.map +0 -1
  526. package/dist/common/VersionedSchema/Utils/joiHandlers.js +0 -59
  527. package/dist/common/VersionedSchema/Utils/mergeObjectSchemas.d.ts +0 -3
  528. package/dist/common/VersionedSchema/Utils/mergeObjectSchemas.d.ts.map +0 -1
  529. package/dist/common/VersionedSchema/Utils/mergeObjectSchemas.js +0 -12
  530. package/dist/common/VersionedSchema/Utils/traverseObjectStructure.d.ts +0 -3
  531. package/dist/common/VersionedSchema/Utils/traverseObjectStructure.d.ts.map +0 -1
  532. package/dist/common/VersionedSchema/Utils/traverseObjectStructure.js +0 -31
  533. package/dist/common/utils/__tests__/__mock__/mockJoiSchema.d.ts +0 -19
  534. package/dist/common/utils/__tests__/__mock__/mockJoiSchema.d.ts.map +0 -1
  535. package/dist/common/utils/__tests__/__mock__/mockJoiSchema.js +0 -14
  536. package/dist/common/utils/__tests__/determineBestMatchingSchemaVersion.test.d.ts +0 -2
  537. package/dist/common/utils/__tests__/determineBestMatchingSchemaVersion.test.d.ts.map +0 -1
  538. package/dist/common/utils/__tests__/determineBestMatchingSchemaVersion.test.js +0 -38
  539. package/dist/common/utils/__tests__/getUniqueKeysFromSchemas.test.d.ts +0 -2
  540. package/dist/common/utils/__tests__/getUniqueKeysFromSchemas.test.d.ts.map +0 -1
  541. package/dist/common/utils/__tests__/getUniqueKeysFromSchemas.test.js +0 -20
  542. package/dist/common/utils/__tests__/mergeObjectSchemas.test.d.ts +0 -2
  543. package/dist/common/utils/__tests__/mergeObjectSchemas.test.d.ts.map +0 -1
  544. package/dist/common/utils/__tests__/mergeObjectSchemas.test.js +0 -35
  545. package/dist/common/utils/__tests__/migrationForMultiOptions.test.d.ts +0 -2
  546. package/dist/common/utils/__tests__/migrationForMultiOptions.test.d.ts.map +0 -1
  547. package/dist/common/utils/__tests__/migrationForMultiOptions.test.js +0 -112
  548. package/dist/common/utils/__tests__/migrationForOptions.test.d.ts +0 -2
  549. package/dist/common/utils/__tests__/migrationForOptions.test.d.ts.map +0 -1
  550. package/dist/common/utils/__tests__/migrationForOptions.test.js +0 -56
  551. package/dist/core/types/base/RefWithtype.model.d.ts +0 -11
  552. package/dist/core/types/base/RefWithtype.model.d.ts.map +0 -1
  553. package/dist/core/types/enums/TypeRef.enum.d.ts +0 -8
  554. package/dist/core/types/enums/TypeRef.enum.d.ts.map +0 -1
  555. package/dist/core/types/enums/TypeRef.enum.js +0 -11
  556. package/dist/core/utils/__tests__/getGatheringRefs.test.d.ts +0 -2
  557. package/dist/core/utils/__tests__/getGatheringRefs.test.d.ts.map +0 -1
  558. package/dist/core/utils/__tests__/getGatheringRefs.test.js +0 -26
  559. package/dist/core/utils/__tests__/getRefFromSchema.test.d.ts +0 -2
  560. package/dist/core/utils/__tests__/getRefFromSchema.test.d.ts.map +0 -1
  561. package/dist/core/utils/__tests__/getRefFromSchema.test.js +0 -167
  562. package/dist/core/utils/__tests__/refResolver.test.d.ts +0 -2
  563. package/dist/core/utils/__tests__/refResolver.test.d.ts.map +0 -1
  564. package/dist/core/utils/__tests__/refResolver.test.js +0 -55
  565. package/dist/core/utils/__tests__/resolveRefToImportPath.test.d.ts +0 -2
  566. package/dist/core/utils/__tests__/resolveRefToImportPath.test.d.ts.map +0 -1
  567. package/dist/core/utils/__tests__/resolveRefToImportPath.test.js +0 -376
  568. package/dist/core/utils/advancedDeduplicatePath.d.ts +0 -5
  569. package/dist/core/utils/advancedDeduplicatePath.d.ts.map +0 -1
  570. package/dist/core/utils/advancedDeduplicatePath.js +0 -29
  571. package/dist/core/utils/findCommonParent.d.ts +0 -7
  572. package/dist/core/utils/findCommonParent.d.ts.map +0 -1
  573. package/dist/core/utils/findCommonParent.js +0 -20
  574. package/dist/core/utils/getGatheringRefs.d.ts +0 -4
  575. package/dist/core/utils/getGatheringRefs.d.ts.map +0 -1
  576. package/dist/core/utils/getGatheringRefs.js +0 -68
  577. package/dist/core/utils/getRefFromSchema.d.ts +0 -3
  578. package/dist/core/utils/getRefFromSchema.d.ts.map +0 -1
  579. package/dist/core/utils/getRefFromSchema.js +0 -9
  580. package/dist/core/utils/isBoolean.d.ts +0 -2
  581. package/dist/core/utils/isBoolean.d.ts.map +0 -1
  582. package/dist/core/utils/isBoolean.js +0 -12
  583. package/dist/core/utils/isFileName.d.ts +0 -7
  584. package/dist/core/utils/isFileName.d.ts.map +0 -1
  585. package/dist/core/utils/isFileName.js +0 -30
  586. package/dist/core/utils/mapPathToTargetDirSafe.d.ts +0 -10
  587. package/dist/core/utils/mapPathToTargetDirSafe.d.ts.map +0 -1
  588. package/dist/core/utils/mapPathToTargetDirSafe.js +0 -48
  589. package/dist/core/utils/normalizeAllRefs.d.ts +0 -6
  590. package/dist/core/utils/normalizeAllRefs.d.ts.map +0 -1
  591. package/dist/core/utils/normalizeAllRefs.js +0 -35
  592. package/dist/core/utils/resolveRefToImportPath.d.ts +0 -13
  593. package/dist/core/utils/resolveRefToImportPath.d.ts.map +0 -1
  594. package/dist/core/utils/resolveRefToImportPath.js +0 -105
  595. package/dist/templatesCompiled/client/core/legacy-request-adapter.d.ts.map +0 -1
  596. package/dist/templatesCompiled/client/core/legacy-request-adapter.js +0 -18
  597. package/dist/templatesCompiled/client/core/request-executor.d.ts.map +0 -1
  598. package/dist/templatesCompiled/client/core/request-executor.js +0 -11
  599. /package/dist/core/types/base/{RefWithtype.model.js → Templates.model.js} +0 -0
package/README.md CHANGED
@@ -64,7 +64,6 @@ openapi generate --input ./spec.json --output ./dist
64
64
  | `--useOptions` | - | boolean | `false` | Use options instead of arguments |
65
65
  | `--useUnionTypes` | - | boolean | `false` | Use union types instead of enums |
66
66
  | `--excludeCoreServiceFiles` | - | boolean | `false` | Exclude generation of core and service files |
67
- | `--includeSchemasFiles` | - | boolean | `false` | Enable generation of model validation schemas |
68
67
  | `--request` | - | string | - | Path to custom request file |
69
68
  | `--interfacePrefix` | - | string | `I` | Prefix for interface models |
70
69
  | `--enumPrefix` | - | string | `E` | Prefix for enum models |
@@ -74,6 +73,8 @@ openapi generate --input ./spec.json --output ./dist
74
73
  | `--useSeparatedIndexes` | - | boolean | `false` | Use separate index files for core, models, schemas, and services |
75
74
  | `--logLevel` | `-l` | string | `error` | Logging level: `info`, `warn`, or `error` |
76
75
  | `--logTarget` | `-t` | string | `console` | Logging target: `console` or `file` |
76
+ | `--validationLibrary` | - | string | `none` | Validation library for schema generation: `none`, `zod`, `joi`, `yup`, or `jsonschema` |
77
+ | `--emptySchemaStrategy` | - | string | `keep` | Strategy for empty schemas: `keep`, `semantic`, or `skip` |
77
78
 
78
79
  **Examples:**
79
80
  ```bash
@@ -93,7 +94,6 @@ openapi generate \
93
94
  --httpClient fetch \
94
95
  --useOptions \
95
96
  --useUnionTypes \
96
- --includeSchemasFiles \
97
97
  --logLevel info
98
98
  ```
99
99
 
@@ -143,7 +143,6 @@ Instead of passing all options via CLI, you can use a configuration file. Create
143
143
  "useOptions": false,
144
144
  "useUnionTypes": false,
145
145
  "excludeCoreServiceFiles": false,
146
- "includeSchemasFiles": false,
147
146
  "interfacePrefix": "I",
148
147
  "enumPrefix": "E",
149
148
  "typePrefix": "T",
@@ -160,7 +159,6 @@ Instead of passing all options via CLI, you can use a configuration file. Create
160
159
  "output": "./dist",
161
160
  "client": "fetch",
162
161
  "excludeCoreServiceFiles": true,
163
- "includeSchemasFiles": true,
164
162
  "items": [
165
163
  {
166
164
  "input": "./first.yml"
@@ -201,7 +199,6 @@ Instead of passing all options via CLI, you can use a configuration file. Create
201
199
  | `useOptions` | boolean | `false` | Use options instead of arguments |
202
200
  | `useUnionTypes` | boolean | `false` | Use union types instead of enums |
203
201
  | `excludeCoreServiceFiles` | boolean | `false` | Exclude core and service files generation |
204
- | `includeSchemasFiles` | boolean | `false` | Enable model validation schemas generation |
205
202
  | `request` | string | - | Path to custom request file |
206
203
  | `interfacePrefix` | string | `I` | Prefix for interface models |
207
204
  | `enumPrefix` | string | `E` | Prefix for enum models |
@@ -210,6 +207,8 @@ Instead of passing all options via CLI, you can use a configuration file. Create
210
207
  | `sortByRequired` | boolean | `false` | Extended sorting strategy for arguments |
211
208
  | `useSeparatedIndexes` | boolean | `false` | Use separate index files |
212
209
  | `items` | array | - | Array of configurations (for multi-options format) |
210
+ | `validationLibrary` | string | `none` | Validation library for schema generation: `none`, `zod`, `joi`, `yup`, or `jsonschema` |
211
+ | `emptySchemaStrategy` | string | `keep` | Strategy for empty schemas: `keep`, `semantic`, or `skip` |
213
212
 
214
213
  **Note:** You can use the `init-openapi-config` command to generate a template configuration file.
215
214
 
@@ -369,11 +368,19 @@ const order: Order = {
369
368
  }
370
369
  ```
371
370
 
372
- ### Runtime schemas `--includeSchemasFiles`
371
+ ### Validation schemas `--validationLibrary`
373
372
  By default, the OpenAPI generator only exports interfaces for your models. These interfaces will help you during
374
- development, but will not be available in JavaScript during runtime. However, Swagger allows you to define properties
375
- that can be useful during runtime, for instance: `maxLength` of a string or a `pattern` to match, etc. Let's say
376
- we have the following model:
373
+ development, but will not be available in JavaScript during runtime. However, OpenAPI allows you to define properties
374
+ that can be useful during runtime, for instance: `maxLength` of a string or a `pattern` to match, etc.
375
+
376
+ The `--validationLibrary` parameter allows you to generate runtime validation schemas using popular validation libraries:
377
+ - **none** (default) - No validation schemas generated
378
+ - **zod** - Generate Zod validation schemas
379
+ - **joi** - Generate Joi validation schemas
380
+ - **yup** - Generate Yup validation schemas
381
+ - **jsonschema** - Generate JSON Schema validation schemas
382
+
383
+ Let's say we have the following model:
377
384
 
378
385
  ```json
379
386
  {
@@ -407,77 +414,88 @@ we have the following model:
407
414
  }
408
415
  ```
409
416
 
410
- This will generate the following interface:
417
+ **With Zod (`--validationLibrary zod`):**
411
418
 
412
- ```typescript
413
- export interface MyModel {
414
- key: string;
415
- name: string;
416
- readonly enabled?: boolean;
417
- readonly modified?: string;
419
+ ```ts
420
+ import { z } from 'zod';
421
+
422
+ export const MyModelSchema = z.object({
423
+ key: z.string().max(64).regex(/^[a-zA-Z0-9_]*$/),
424
+ name: z.string().max(255),
425
+ enabled: z.boolean().readonly().optional(),
426
+ modified: z.string().datetime().readonly().optional(),
427
+ });
428
+
429
+ export type MyModel = z.infer<typeof MyModelSchema>;
430
+
431
+ export function validateMyModel(data: unknown): MyModel {
432
+ return MyModelSchema.parse(data);
433
+ }
434
+
435
+ export function safeValidateMyModel(data: unknown): { success: true; data: MyModel } | { success: false; error: z.ZodError } {
436
+ const result = MyModelSchema.safeParse(data);
437
+ if (result.success) {
438
+ return { success: true, data: result.data };
439
+ }
440
+ return { success: false, error: result.error };
418
441
  }
419
442
  ```
420
443
 
421
- The interface does not contain any properties like `maxLength` or `pattern`. However, they could be useful
422
- if we wanted to create some form where a user could create such a model. In that form you would iterate
423
- over the properties to render form fields based on their type and validate the input based on the `maxLength`
424
- or `pattern` property. This requires us to have this information somewhere... For this we can use the
425
- flag `--includeSchemasFiles` to generate a runtime model next to the normal interface:
444
+ **With Joi (`--validationLibrary joi`):**
426
445
 
427
- ```typescript
428
- export const $MyModel = {
446
+ ```ts
447
+ import Joi from 'joi';
448
+
449
+ export const MyModelSchema = Joi.object({
450
+ key: Joi.string().max(64).pattern(/^[a-zA-Z0-9_]*$/).required(),
451
+ name: Joi.string().max(255).required(),
452
+ enabled: Joi.boolean().readonly(),
453
+ modified: Joi.string().isoDate().readonly(),
454
+ });
455
+ ```
456
+
457
+ **With Yup (`--validationLibrary yup`):**
458
+
459
+ ```ts
460
+ import * as yup from 'yup';
461
+
462
+ export const MyModelSchema = yup.object({
463
+ key: yup.string().max(64).matches(/^[a-zA-Z0-9_]*$/).required(),
464
+ name: yup.string().max(255).required(),
465
+ enabled: yup.boolean().readonly(),
466
+ modified: yup.string().datetime().readonly(),
467
+ });
468
+ ```
469
+
470
+ **With JSON Schema (`--validationLibrary jsonschema`):**
471
+
472
+ ```ts
473
+ export const MyModelSchema = {
474
+ type: 'object',
475
+ required: ['key', 'name'],
429
476
  properties: {
430
477
  key: {
431
478
  type: 'string',
432
- isRequired: true,
433
479
  maxLength: 64,
434
480
  pattern: '^[a-zA-Z0-9_]*$',
435
481
  },
436
482
  name: {
437
483
  type: 'string',
438
- isRequired: true,
439
484
  maxLength: 255,
440
485
  },
441
486
  enabled: {
442
487
  type: 'boolean',
443
- isReadOnly: true,
488
+ readOnly: true,
444
489
  },
445
490
  modified: {
446
491
  type: 'string',
447
- isReadOnly: true,
448
492
  format: 'date-time',
493
+ readOnly: true,
449
494
  },
450
495
  },
451
496
  };
452
497
  ```
453
-
454
- These runtime object are prefixed with a `$` character and expose all the interesting attributes of a model
455
- and its properties. We can now use this object to generate the form:
456
-
457
- ```typescript jsx
458
- import { $MyModel } from './generated';
459
-
460
- // Some pseudo code to iterate over the properties and return a form field
461
- // the form field could be some abstract component that renders the correct
462
- // field type and validation rules based on the given input.
463
- const formFields = Object.entries($MyModel.properties).map(([key, value]) => (
464
- <FormField
465
- name={key}
466
- type={value.type}
467
- format={value.format}
468
- maxLength={value.maxLength}
469
- pattern={value.pattern}
470
- isReadOnly={value.isReadOnly}
471
- />
472
- ));
473
-
474
- const MyForm = () => (
475
- <form>
476
- {formFields}
477
- </form>
478
- );
479
-
480
- ```
498
+ These validation schemas can be used for form generation, input validation, and runtime type checking in your application.
481
499
 
482
500
  ### Cancelable promise `--useCancelableRequest`
483
501
  By default, the OpenAPI generator generates services for accessing the API that use non-cancellable requests. Therefore, we have added the ability to switch the generator to generate canceled API requests. To do this, use the flag `--useCancelableRequest`.
@@ -510,80 +528,110 @@ export function request<T>(config: TOpenAPIConfig, options: ApiRequestOptions):
510
528
  }
511
529
  ```
512
530
 
513
- ### Custom Request Executor
531
+ ### RequestExecutor
514
532
 
515
- Starting from version 2.0.0-beta.1, generated services use the `RequestExecutor` interface instead of calling the core `request` function directly. This allows you to provide your own request implementation or adapt existing ones.
533
+ Starting from version **2.0.0** the generated services use the `RequestExecutor` interface
534
+ instead of direct calls to the `request` core function.
516
535
 
517
- **Using a custom RequestExecutor:**
536
+ The `RequestExecutor` is a single HTTP logic integration point responsible for executing requests
537
+ and extending client behavior. It allows you to:
538
+ - use any transport (fetch/axios/xhr/custom);
539
+ - Centrally handle requests, responses, and errors;
540
+ - expand the client's behavior without changing the generated services.
518
541
 
519
- You can create your own `RequestExecutor` implementation:
542
+ #### Interceptors
543
+
544
+ `RequestExecutor` supports **interceptors**, which allow you to implement additional
545
+ logic at different stages of the request lifecycle.:
546
+
547
+ - `onRequest` — modification of the request before sending (headers, auth, logging);
548
+ - `onResponse` — processing successful responses;
549
+ - `onError` — centralized error handling.
550
+
551
+ Interceptors are applied at the executor level and are automatically used by all
552
+ generated services.
553
+
554
+ ```ts
555
+ import { createClient } from './generated';
556
+
557
+ const client = createClient({
558
+ interceptors: {
559
+ onRequest: [
560
+ (config) => ({
561
+ ...config,
562
+ headers: {
563
+ ...config.headers,
564
+ Authorization: 'Bearer token',
565
+ },
566
+ }),
567
+ ],
568
+ onError: [
569
+ (error) => {
570
+ console.error(error);
571
+ throw error;
572
+ },
573
+ ],
574
+ },
575
+ });
576
+ ```
577
+
578
+ #### Custom implementation of RequestExecutor with interceptors
579
+
580
+ A custom `RequestExecutor` can be used together with interceptors.
581
+ In this case, the executor is responsible only for the transport and execution of the request,
582
+ while the interceptors are responsible for the extensible business logic (authorization, logging, error handling).
520
583
 
521
584
  ```ts
522
- import type { RequestExecutor, RequestConfig } from './generated/core/request-executor';
585
+ import type { RequestExecutor, RequestConfig } from './generated/core/executor/requestExecutor';
586
+ import { withInterceptors } from './generated/core/interceptors/withInterceptors';
523
587
  import { SimpleService } from './generated/services/SimpleService';
524
588
 
525
- // Define your custom options type (optional)
526
589
  interface MyCustomOptions {
527
590
  timeout?: number;
528
- retries?: number;
529
591
  }
530
592
 
531
- // Create a custom executor
532
- const customExecutor: RequestExecutor<MyCustomOptions> = {
533
- async request<TResponse>(config: RequestConfig, options?: MyCustomOptions): Promise<TResponse> {
534
- // Your custom request logic here
593
+ const baseExecutor: RequestExecutor<MyCustomOptions> = {
594
+ async request<T>(config: RequestConfig, options?: MyCustomOptions): Promise<T> {
535
595
  const response = await fetch(config.url, {
536
596
  method: config.method,
537
597
  headers: config.headers,
538
598
  body: config.body ? JSON.stringify(config.body) : undefined,
539
- signal: options?.timeout ? AbortSignal.timeout(options.timeout) : undefined,
599
+ signal: options?.timeout
600
+ ? AbortSignal.timeout(options.timeout)
601
+ : undefined,
540
602
  });
541
-
603
+
542
604
  if (!response.ok) {
543
- throw new Error(`Request failed: ${response.statusText}`);
605
+ throw new Error(`Request failed: ${response.status}`);
544
606
  }
545
-
607
+
546
608
  return response.json();
547
609
  },
548
610
  };
549
611
 
550
- // Use it with generated services
551
- const simpleService = new SimpleService<MyCustomOptions>(customExecutor);
552
- await simpleService.getCallWithoutParametersAndResponse({ timeout: 5000, retries: 3 });
553
- ```
554
-
555
- **Using legacy request adapter:**
556
-
557
- If you have an existing custom `request` file (specified via `--request` option), you can use the `createLegacyExecutor` helper to adapt it to the new `RequestExecutor` interface:
558
-
559
- ```ts
560
- import { createLegacyExecutor } from './generated/core/legacy-request-adapter';
561
- import { OpenAPI } from './generated/core/OpenAPI';
562
- import { SimpleService } from './generated/services/SimpleService';
563
-
564
- // The legacy adapter wraps your existing request function
565
- const executor = createLegacyExecutor(OpenAPI);
566
-
567
- // Optionally, you can map custom options to ApiRequestOptions
568
- interface XHROptions {
569
- timeout?: number;
570
- }
571
-
572
- const executorWithOptions = createLegacyExecutor<XHROptions>(OpenAPI, (options) => {
573
- // Map your custom options to ApiRequestOptions if needed
574
- return {
575
- // Add any ApiRequestOptions fields based on options
576
- };
612
+ // Wrapping the executor interceptors
613
+ const executor = withInterceptors(baseExecutor, {
614
+ onRequest: [
615
+ (config) => ({
616
+ ...config,
617
+ headers: {
618
+ ...config.headers,
619
+ Authorization: 'Bearer token',
620
+ },
621
+ }),
622
+ ],
623
+ onError: [
624
+ (error) => {
625
+ console.error(error);
626
+ throw error;
627
+ },
628
+ ],
577
629
  });
578
630
 
579
- // Use with services
580
- const simpleService = new SimpleService(executor);
581
- await simpleService.getCallWithoutParametersAndResponse();
631
+ const service = new SimpleService(executor);
632
+ await service.getCallWithoutParametersAndResponse({ timeout: 5000 });
582
633
  ```
583
634
 
584
- **Note:** The `--request` option still works for customizing the core `request` function. The generated
585
- `legacy-request-adapter` will automatically use your custom request implementation when creating the adapter.
586
-
587
635
  ### Sorting strategy for function arguments `--sortByRequired`
588
636
  By default, the OpenAPI generator sorts the parameters of service functions according to a simplified scheme. If you need a more strict sorting option, then you need to use the `--sortByRequired` flag. The simplified sorting option is similar to the one used in version 0.2.3 of the OpenAPI generator. This flag allows you to upgrade to a new version of the generator if you are "stuck" on version 0.2.3.
589
637