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
@@ -6,7 +6,6 @@ const getComment_1 = require("../../../utils/getComment");
6
6
  const getEnum_1 = require("../../../utils/getEnum");
7
7
  const getEnumFromDescription_1 = require("../../../utils/getEnumFromDescription");
8
8
  const getPattern_1 = require("../../../utils/getPattern");
9
- const normalizeRef_1 = require("../../../utils/normalizeRef");
10
9
  const getModelDefault_1 = require("./getModelDefault");
11
10
  function getModel(config) {
12
11
  const { openApi, definition, isDefinition = false, name = '', path = '', parentRef } = config;
@@ -44,8 +43,7 @@ function getModel(config) {
44
43
  properties: [],
45
44
  };
46
45
  if (definition.$ref) {
47
- const normalizedRef = (0, normalizeRef_1.normalizeRef)(definition.$ref, parentRef);
48
- const definitionRef = this.getType(definition.$ref, normalizedRef);
46
+ const definitionRef = this.getType(definition.$ref, parentRef);
49
47
  model.export = 'reference';
50
48
  model.type = definitionRef.type;
51
49
  model.base = definitionRef.base;
@@ -78,8 +76,7 @@ function getModel(config) {
78
76
  }
79
77
  if (definition.type === 'array' && definition.items) {
80
78
  if (definition.items.$ref) {
81
- const normalizedRef = (0, normalizeRef_1.normalizeRef)(definition.items.$ref, parentRef);
82
- const arrayItems = this.getType(definition.items.$ref, normalizedRef);
79
+ const arrayItems = this.getType(definition.items.$ref, parentRef);
83
80
  model.export = 'array';
84
81
  model.type = arrayItems.type;
85
82
  model.base = arrayItems.base;
@@ -1 +1 @@
1
- {"version":3,"file":"getModelProperties.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v3/parser/getModelProperties.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAM/D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,EAAE,CAkFxH"}
1
+ {"version":3,"file":"getModelProperties.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v3/parser/getModelProperties.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAK/D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,EAAE,CAiFxH"}
@@ -6,7 +6,6 @@ const escapeName_1 = require("../../../utils/escapeName");
6
6
  const getClassName_1 = require("../../../utils/getClassName");
7
7
  const getComment_1 = require("../../../utils/getComment");
8
8
  const getPattern_1 = require("../../../utils/getPattern");
9
- const normalizeRef_1 = require("../../../utils/normalizeRef");
10
9
  function getModelProperties(openApi, definition, parentRef) {
11
10
  const models = [];
12
11
  for (const propertyName in definition.properties) {
@@ -14,8 +13,7 @@ function getModelProperties(openApi, definition, parentRef) {
14
13
  const property = definition.properties[propertyName];
15
14
  const propertyRequired = definition.required?.includes(propertyName) || property.default !== undefined;
16
15
  if (property.$ref) {
17
- const normalizedRef = (0, normalizeRef_1.normalizeRef)(property.$ref, parentRef);
18
- const model = this.getType(property.$ref, normalizedRef);
16
+ const model = this.getType(property.$ref, parentRef);
19
17
  models.push({
20
18
  name: (0, escapeName_1.escapeName)(propertyName),
21
19
  alias: '',
@@ -1 +1 @@
1
- {"version":3,"file":"getModels.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v3/parser/getModels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAM/D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,CAsBjE"}
1
+ {"version":3,"file":"getModels.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v3/parser/getModels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAI/D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,CAsBjE"}
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getModels = getModels;
4
- const getModelNameWithPrefix_1 = require("../../../utils/getModelNameWithPrefix");
5
- const getRefFromSchema_1 = require("../../../utils/getRefFromSchema");
6
4
  const modelHelpers_1 = require("../../../utils/modelHelpers");
7
5
  const sortModelsByName_1 = require("../../../utils/sortModelsByName");
8
6
  const unique_1 = require("../../../utils/unique");
9
7
  function getModels(openApi) {
10
8
  let models = [];
11
- const listOfModelsRef = (0, getRefFromSchema_1.getRefFromSchema)(this.context, openApi);
9
+ const listOfModelsRef = this.context.getAllCanonicalRefs();
12
10
  if (listOfModelsRef) {
13
11
  for (const modelRef of listOfModelsRef) {
14
12
  const definition = this.context.get(modelRef);
@@ -17,7 +15,7 @@ function getModels(openApi) {
17
15
  openApi: openApi,
18
16
  definition: definition,
19
17
  isDefinition: true,
20
- name: (0, getModelNameWithPrefix_1.getModelNameWithPrefix)(definitionType.base, definition, this.context.prefix),
18
+ name: definitionType.base,
21
19
  path: definitionType.path,
22
20
  parentRef: modelRef,
23
21
  });
@@ -48,7 +48,7 @@ function getOperation(openApi, url, method, op, pathParams, serviceClassName, pa
48
48
  }
49
49
  if (op.requestBody) {
50
50
  const sortByRequired = this.context.sortByRequired ? sortByRequiredExtended_1.sortByRequiredExtended : sortByRequiredSimple_1.sortByRequiredSimple;
51
- const requestBodyDef = (op.requestBody.$ref ? this.context.get(op.requestBody.$ref) : op.requestBody);
51
+ const requestBodyDef = (op.requestBody.$ref ? this.context.get(op.requestBody.$ref, parentFileRef) : op.requestBody);
52
52
  const requestBody = this.getOperationRequestBody(openApi, requestBodyDef, parentFileRef);
53
53
  operation.imports.push(...requestBody.imports);
54
54
  operation.parameters.push(requestBody);
@@ -1 +1 @@
1
- {"version":3,"file":"getOperationParameter.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v3/parser/getOperationParameter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAKzF,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,GAAG,kBAAkB,CAgFxI"}
1
+ {"version":3,"file":"getOperationParameter.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v3/parser/getOperationParameter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAIzF,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,GAAG,kBAAkB,CA8ExI"}
@@ -4,7 +4,6 @@ exports.getOperationParameter = getOperationParameter;
4
4
  const getComment_1 = require("../../../utils/getComment");
5
5
  const getOperationParameterName_1 = require("../../../utils/getOperationParameterName");
6
6
  const getPattern_1 = require("../../../utils/getPattern");
7
- const normalizeRef_1 = require("../../../utils/normalizeRef");
8
7
  const getModelDefault_1 = require("./getModelDefault");
9
8
  function getOperationParameter(openApi, parameter, parentRef) {
10
9
  const operationParameter = {
@@ -30,8 +29,7 @@ function getOperationParameter(openApi, parameter, parentRef) {
30
29
  mediaType: null,
31
30
  };
32
31
  if (parameter.$ref) {
33
- const normalizedRef = (0, normalizeRef_1.normalizeRef)(parameter.$ref, parentRef);
34
- const definitionRef = this.getType(parameter.$ref, normalizedRef);
32
+ const definitionRef = this.getType(parameter.$ref, parentRef);
35
33
  operationParameter.export = 'reference';
36
34
  operationParameter.type = definitionRef.type;
37
35
  operationParameter.base = definitionRef.base;
@@ -41,8 +39,7 @@ function getOperationParameter(openApi, parameter, parentRef) {
41
39
  }
42
40
  if (parameter.schema) {
43
41
  if (parameter.schema.$ref) {
44
- const normalizedRef = (0, normalizeRef_1.normalizeRef)(parameter.schema.$ref, parentRef);
45
- const model = this.getType(parameter.schema.$ref, normalizedRef);
42
+ const model = this.getType(parameter.schema.$ref, parentRef);
46
43
  operationParameter.export = 'reference';
47
44
  operationParameter.type = model.type;
48
45
  operationParameter.base = model.base;
@@ -16,7 +16,7 @@ function getOperationParameters(openApi, parameters, parentRef) {
16
16
  };
17
17
  // Iterate over the parameters
18
18
  parameters.forEach(parameterOrReference => {
19
- const parameterDef = (parameterOrReference.$ref ? this.context.get(parameterOrReference.$ref) : parameterOrReference);
19
+ const parameterDef = (parameterOrReference.$ref ? this.context.get(parameterOrReference.$ref, parentRef) : parameterOrReference);
20
20
  const parameter = this.getOperationParameter(openApi, parameterDef, parentRef);
21
21
  // We ignore the "api-version" param, since we do not want to add this
22
22
  // as the first / default parameter for each of the service calls.
@@ -1 +1 @@
1
- {"version":3,"file":"getOperationRequestBody.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v3/parser/getOperationRequestBody.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAIzF,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAG5E,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,GAAG,kBAAkB,CA8E5I"}
1
+ {"version":3,"file":"getOperationRequestBody.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v3/parser/getOperationRequestBody.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAGzF,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAG5E,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,GAAG,kBAAkB,CA6E5I"}
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getOperationRequestBody = getOperationRequestBody;
4
4
  const getComment_1 = require("../../../utils/getComment");
5
5
  const getPattern_1 = require("../../../utils/getPattern");
6
- const normalizeRef_1 = require("../../../utils/normalizeRef");
7
6
  const getContent_1 = require("./getContent");
8
7
  function getOperationRequestBody(openApi, parameter, parentRef) {
9
8
  const requestBody = {
@@ -38,8 +37,7 @@ function getOperationRequestBody(openApi, parameter, parentRef) {
38
37
  (requestBody.in = 'formData'), (requestBody.name = 'formData'), (requestBody.prop = 'formData');
39
38
  }
40
39
  if (content?.schema?.$ref) {
41
- const normalizedRef = (0, normalizeRef_1.normalizeRef)(content.schema.$ref, parentRef);
42
- const model = this.getType(content.schema.$ref, normalizedRef);
40
+ const model = this.getType(content.schema.$ref, parentRef);
43
41
  requestBody.export = 'reference';
44
42
  requestBody.type = model.type;
45
43
  requestBody.base = model.base;
@@ -1 +1 @@
1
- {"version":3,"file":"getOperationResponse.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v3/parser/getOperationResponse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAIvF,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGtE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB,CAqF1J"}
1
+ {"version":3,"file":"getOperationResponse.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v3/parser/getOperationResponse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAGvF,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGtE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB,CAoF1J"}
@@ -4,7 +4,6 @@ exports.getOperationResponse = getOperationResponse;
4
4
  const safeHasOwn_1 = require("../../../../common/utils/safeHasOwn");
5
5
  const getComment_1 = require("../../../utils/getComment");
6
6
  const getPattern_1 = require("../../../utils/getPattern");
7
- const normalizeRef_1 = require("../../../utils/normalizeRef");
8
7
  const getContent_1 = require("./getContent");
9
8
  function getOperationResponse(openApi, response, responseCode, parentRef) {
10
9
  const operationResponse = {
@@ -32,8 +31,7 @@ function getOperationResponse(openApi, response, responseCode, parentRef) {
32
31
  const content = (0, getContent_1.getContent)(response.content);
33
32
  if (content) {
34
33
  if (content?.schema?.$ref) {
35
- const normalizedRef = (0, normalizeRef_1.normalizeRef)(content.schema.$ref, parentRef);
36
- const model = this.getType(content.schema.$ref, normalizedRef);
34
+ const model = this.getType(content.schema.$ref, parentRef);
37
35
  operationResponse.export = 'reference';
38
36
  operationResponse.type = model.type;
39
37
  operationResponse.base = model.base;
@@ -10,7 +10,7 @@ function getOperationResponses(openApi, responses, parentRef) {
10
10
  for (const code in responses) {
11
11
  if ((0, safeHasOwn_1.safeHasOwn)(responses, code)) {
12
12
  const responseOrReference = responses[code];
13
- const response = (responseOrReference.$ref ? this.context.get(responseOrReference.$ref) : responseOrReference);
13
+ const response = (responseOrReference.$ref ? this.context.get(responseOrReference.$ref, parentRef) : responseOrReference);
14
14
  const responseCode = (0, getOperationResponseCode_1.getOperationResponseCode)(code);
15
15
  if (responseCode) {
16
16
  const operationResponse = this.getOperationResponse(openApi, response, responseCode, parentRef);
@@ -1 +1 @@
1
- {"version":3,"file":"getServices.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v3/parser/getServices.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAGnE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAKtD;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,CAgCrE"}
1
+ {"version":3,"file":"getServices.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v3/parser/getServices.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAGnE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAKtD;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,CAiCrE"}
@@ -14,9 +14,10 @@ function getServices(openApi) {
14
14
  if ((0, safeHasOwn_1.safeHasOwn)(openApi.paths, url)) {
15
15
  // Grab path and parse any global path parameters
16
16
  const pathByUrl = openApi.paths[url];
17
- const path = (pathByUrl.$ref ? this.context.get(pathByUrl.$ref) : pathByUrl);
18
- const pathParams = this.getOperationParameters(openApi, path.parameters || [], '');
19
- const parentFileRef = pathByUrl.$ref || this.context.root?.path || '';
17
+ const rootPath = this.context.root?.path || '';
18
+ const path = (pathByUrl.$ref ? this.context.get(pathByUrl.$ref, rootPath) : pathByUrl);
19
+ const parentFileRef = pathByUrl.$ref || rootPath;
20
+ const pathParams = this.getOperationParameters(openApi, path.parameters || [], parentFileRef);
20
21
  // Parse all the methods for this path
21
22
  (0, serviceHelpers_1.forEachOperationInPath)(path, (method, op) => {
22
23
  // Each method contains an OpenAPI operation, we parse the operation
@@ -1 +1 @@
1
- {"version":3,"file":"getType.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v3/parser/getType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAM7D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAoC5E"}
1
+ {"version":3,"file":"getType.d.ts","sourceRoot":"","sources":["../../../../../src/core/api/v3/parser/getType.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAM7D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CA6C5E"}
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getType = getType;
4
+ const pathHelpers_1 = require("../../../../common/utils/pathHelpers");
4
5
  const getMappedType_1 = require("../../../utils/getMappedType");
6
+ const getRelativeModelPath_1 = require("../../../utils/getRelativeModelPath");
5
7
  const getTypeName_1 = require("../../../utils/getTypeName");
6
8
  const normalizeString_1 = require("../../../utils/normalizeString");
7
- const resolveRefToImportPath_1 = require("../../../utils/resolveRefToImportPath");
8
9
  const stripNamespace_1 = require("../../../utils/stripNamespace");
9
10
  /**
10
11
  * Parse any string value into a type object.
@@ -30,14 +31,20 @@ function getType(value, parentRef) {
30
31
  }
31
32
  }
32
33
  else if (valueClean) {
33
- // Safely calculate the path that the specification file will have in outputModels folder
34
- const valuePath = (0, resolveRefToImportPath_1.resolveRefToImportPath)({
35
- mainSpecPath: this.context.root?.path || '',
36
- parentFilePath: parentRef,
37
- refValuePath: normalizedValue,
38
- outputModelsPath: this.context.output?.outputModels,
39
- });
40
- const type = this.getTypeNameByRef((0, getTypeName_1.getTypeName)(valueClean), parentRef);
34
+ /**
35
+ * canonicalValue может быть пустой строкой.
36
+ * В этом случае надо брать непосредственно normalizedValue - это относительный путь или фрагмент.
37
+ * Предполагаем, что в таком случае расчитывать нет нужды. Это путь от папки outputModels
38
+ */
39
+ const canonicalValue = this.context.resolveCanonicalRef(normalizedValue, parentRef);
40
+ let valuePath = valueClean;
41
+ if (canonicalValue) {
42
+ const refValuePath = canonicalValue?.fragment ? `${canonicalValue.outputFile}${canonicalValue.fragment}` : canonicalValue?.outputFile || '';
43
+ const cleanedRefValuePath = (0, stripNamespace_1.stripNamespace)(refValuePath);
44
+ valuePath = (0, pathHelpers_1.relativeHelper)(this.context.output?.outputModels, cleanedRefValuePath);
45
+ }
46
+ valuePath = (0, getRelativeModelPath_1.getRelativeModelPath)(this.context.output?.outputModels, valuePath);
47
+ const type = this.getTypeNameByRef((0, getTypeName_1.getTypeName)(valueClean), normalizedValue, parentRef);
41
48
  const valueImportPath = !valuePath.startsWith('./') ? `./${valuePath}` : valuePath;
42
49
  result.path = valuePath;
43
50
  result.type = type;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,wBAAsB,QAAQ,CAAC,UAAU,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAGrE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,wBAAsB,QAAQ,CAAC,UAAU,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAKrE"}
@@ -3,9 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpClient = void 0;
4
4
  exports.generate = generate;
5
5
  const OpenApiClient_1 = require("./OpenApiClient");
6
+ const validateRawOptions_1 = require("./utils/validateRawOptions");
6
7
  var HttpClient_enum_1 = require("./types/enums/HttpClient.enum");
7
8
  Object.defineProperty(exports, "HttpClient", { enumerable: true, get: function () { return HttpClient_enum_1.HttpClient; } });
8
9
  async function generate(rawOptions) {
10
+ (0, validateRawOptions_1.validateRawOptions)(rawOptions);
9
11
  const openApiClient = new OpenApiClient_1.OpenApiClient();
10
12
  await openApiClient.generate(rawOptions);
11
13
  }
@@ -1,4 +1,4 @@
1
- import { Templates } from "../../utils/registerHandlebarTemplates";
1
+ import { Templates } from "../../types/base/Templates.model";
2
2
  import { ExportedModel } from "./ExportedModel.model";
3
3
  import { ExportedService } from "./ExportedService.model";
4
4
  export type ClientArtifacts = {
@@ -1 +1 @@
1
- {"version":3,"file":"ClientArtifacts.model.d.ts","sourceRoot":"","sources":["../../../../src/core/types/base/ClientArtifacts.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC/B,CAAA"}
1
+ {"version":3,"file":"ClientArtifacts.model.d.ts","sourceRoot":"","sources":["../../../../src/core/types/base/ClientArtifacts.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC/B,CAAA"}
@@ -1,4 +1,4 @@
1
- import { Templates } from "../../utils/registerHandlebarTemplates";
1
+ import { Templates } from "../../types/base/Templates.model";
2
2
  export type SimpleClientArtifacts = {
3
3
  templates: Templates;
4
4
  outputPath: string;
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleClientArtifacts.model.d.ts","sourceRoot":"","sources":["../../../../src/core/types/base/SimpleClientArtifacts.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAEnE,MAAM,MAAM,qBAAqB,GAAG;IAChC,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB,CAAA"}
1
+ {"version":3,"file":"SimpleClientArtifacts.model.d.ts","sourceRoot":"","sources":["../../../../src/core/types/base/SimpleClientArtifacts.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D,MAAM,MAAM,qBAAqB,GAAG;IAChC,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB,CAAA"}
@@ -0,0 +1,32 @@
1
+ import * as Handlebars from 'handlebars/runtime';
2
+ export interface Templates {
3
+ indexes: {
4
+ full: Handlebars.TemplateDelegate;
5
+ simple: Handlebars.TemplateDelegate;
6
+ core: Handlebars.TemplateDelegate;
7
+ models: Handlebars.TemplateDelegate;
8
+ schemas: Handlebars.TemplateDelegate;
9
+ services: Handlebars.TemplateDelegate;
10
+ };
11
+ exports: {
12
+ client: Handlebars.TemplateDelegate;
13
+ model: Handlebars.TemplateDelegate;
14
+ schema: Handlebars.TemplateDelegate | undefined;
15
+ service: Handlebars.TemplateDelegate;
16
+ };
17
+ core: {
18
+ settings: Handlebars.TemplateDelegate;
19
+ apiError: Handlebars.TemplateDelegate;
20
+ apiRequestOptions: Handlebars.TemplateDelegate;
21
+ apiResult: Handlebars.TemplateDelegate;
22
+ request: Handlebars.TemplateDelegate;
23
+ cancelablePromise: Handlebars.TemplateDelegate;
24
+ httpStatusCode: Handlebars.TemplateDelegate;
25
+ requestExecutor: Handlebars.TemplateDelegate;
26
+ createExecutorAdapter: Handlebars.TemplateDelegate;
27
+ interceptors: Handlebars.TemplateDelegate;
28
+ apiErrorInterceptor: Handlebars.TemplateDelegate;
29
+ withInterceptors: Handlebars.TemplateDelegate;
30
+ };
31
+ }
32
+ //# sourceMappingURL=Templates.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Templates.model.d.ts","sourceRoot":"","sources":["../../../../src/core/types/base/Templates.model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,SAAS;IACtB,OAAO,EAAE;QACL,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC;QAClC,MAAM,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACpC,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC;QAClC,MAAM,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACpC,OAAO,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACrC,QAAQ,EAAE,UAAU,CAAC,gBAAgB,CAAC;KACzC,CAAC;IACF,OAAO,EAAE;QACL,MAAM,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACpC,KAAK,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACnC,MAAM,EAAE,UAAU,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAChD,OAAO,EAAE,UAAU,CAAC,gBAAgB,CAAC;KACxC,CAAC;IACF,IAAI,EAAE;QACF,QAAQ,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACtC,QAAQ,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACtC,iBAAiB,EAAE,UAAU,CAAC,gBAAgB,CAAC;QAC/C,SAAS,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACvC,OAAO,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACrC,iBAAiB,EAAE,UAAU,CAAC,gBAAgB,CAAC;QAC/C,cAAc,EAAE,UAAU,CAAC,gBAAgB,CAAC;QAC5C,eAAe,EAAE,UAAU,CAAC,gBAAgB,CAAC;QAC7C,qBAAqB,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACnD,YAAY,EAAE,UAAU,CAAC,gBAAgB,CAAC;QAC1C,mBAAmB,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACjD,gBAAgB,EAAE,UAAU,CAAC,gBAAgB,CAAC;KACjD,CAAC;CACL"}
@@ -0,0 +1,6 @@
1
+ export declare enum EmptySchemaStrategy {
2
+ SEMANTIC = "semantic",
3
+ SKIP = "skip",
4
+ KEEP = "keep"
5
+ }
6
+ //# sourceMappingURL=EmptySchemaStrategy.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptySchemaStrategy.enum.d.ts","sourceRoot":"","sources":["../../../../src/core/types/enums/EmptySchemaStrategy.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,mBAAmB;IAC3B,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,IAAI,SAAS;CAChB"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmptySchemaStrategy = void 0;
4
+ var EmptySchemaStrategy;
5
+ (function (EmptySchemaStrategy) {
6
+ EmptySchemaStrategy["SEMANTIC"] = "semantic";
7
+ EmptySchemaStrategy["SKIP"] = "skip";
8
+ EmptySchemaStrategy["KEEP"] = "keep";
9
+ })(EmptySchemaStrategy || (exports.EmptySchemaStrategy = EmptySchemaStrategy = {}));
@@ -0,0 +1,8 @@
1
+ export declare enum ValidationLibrary {
2
+ NONE = "none",
3
+ ZOD = "zod",
4
+ JOI = "joi",
5
+ YUP = "yup",
6
+ JSONSCHEMA = "jsonschema"
7
+ }
8
+ //# sourceMappingURL=ValidationLibrary.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValidationLibrary.enum.d.ts","sourceRoot":"","sources":["../../../../src/core/types/enums/ValidationLibrary.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IACzB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,UAAU,eAAe;CAC5B"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValidationLibrary = void 0;
4
+ var ValidationLibrary;
5
+ (function (ValidationLibrary) {
6
+ ValidationLibrary["NONE"] = "none";
7
+ ValidationLibrary["ZOD"] = "zod";
8
+ ValidationLibrary["JOI"] = "joi";
9
+ ValidationLibrary["YUP"] = "yup";
10
+ ValidationLibrary["JSONSCHEMA"] = "jsonschema";
11
+ })(ValidationLibrary || (exports.ValidationLibrary = ValidationLibrary = {}));
@@ -1,3 +1,3 @@
1
- import { Templates } from '../registerHandlebarTemplates';
1
+ import { Templates } from '../../types/base/Templates.model';
2
2
  export declare const templates: Templates;
3
3
  //# sourceMappingURL=templates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/__mocks__/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D,eAAO,MAAM,SAAS,EAAE,SAyBvB,CAAC"}
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/__mocks__/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D,eAAO,MAAM,SAAS,EAAE,SA6BvB,CAAC"}
@@ -11,6 +11,7 @@ exports.templates = {
11
11
  services: () => 'servicesIndex',
12
12
  },
13
13
  exports: {
14
+ client: () => 'client',
14
15
  model: () => 'model',
15
16
  schema: () => 'schema',
16
17
  service: () => 'service',
@@ -23,7 +24,10 @@ exports.templates = {
23
24
  request: () => 'request',
24
25
  cancelablePromise: () => 'cancelablePromise',
25
26
  httpStatusCode: () => 'httpStatusCode',
26
- legacyRequestAdapter: () => 'legacyRequestAdapter',
27
+ createExecutorAdapter: () => 'createExecutorAdapter',
27
28
  requestExecutor: () => 'requestExecutor',
29
+ apiErrorInterceptor: () => 'apiErrorInterceptor',
30
+ interceptors: () => 'interceptors',
31
+ withInterceptors: () => 'withInterceptors',
28
32
  },
29
33
  };
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const node_assert_1 = __importDefault(require("node:assert"));
7
7
  const node_test_1 = require("node:test");
8
8
  const getRelativeModelPath_1 = require("../getRelativeModelPath");
9
- node_test_1.describe.skip('@unit: getRelativeModelPath', () => {
10
- (0, node_test_1.test)('hould return model relative path', () => {
9
+ (0, node_test_1.describe)('@unit: getRelativeModelPath', () => {
10
+ (0, node_test_1.test)('should return model relative path when root is undefined', () => {
11
11
  const modelRelativePath = '../../../models/truck';
12
12
  const result = (0, getRelativeModelPath_1.getRelativeModelPath)(undefined, modelRelativePath);
13
13
  node_assert_1.default.strictEqual(result, '../../../models/truck');
@@ -16,6 +16,12 @@ node_test_1.describe.skip('@unit: getRelativeModelPath', () => {
16
16
  const rootPath = '/home/generated';
17
17
  const modelRelativePath = '../../../models/truck';
18
18
  const result = (0, getRelativeModelPath_1.getRelativeModelPath)(rootPath, modelRelativePath);
19
- node_assert_1.default.strictEqual(result, 'models/Truck');
19
+ node_assert_1.default.strictEqual(result, 'models/truck');
20
+ });
21
+ (0, node_test_1.test)('should collapse absolute path to type name', () => {
22
+ const rootPath = '/home/generated';
23
+ const modelAbsolutePath = '/home/other/models/truck';
24
+ const result = (0, getRelativeModelPath_1.getRelativeModelPath)(rootPath, modelAbsolutePath);
25
+ node_assert_1.default.strictEqual(result, 'truck');
20
26
  });
21
27
  });
@@ -7,8 +7,8 @@ const node_assert_1 = __importDefault(require("node:assert"));
7
7
  const node_test_1 = require("node:test");
8
8
  const pathHelpers_1 = require("../../../common/utils/pathHelpers");
9
9
  const isSubdirectory_1 = require("../isSubdirectory");
10
- (0, node_test_1.describe)('@unit: isSubDirectory', () => {
11
- node_test_1.test.skip('should return correct result', () => {
10
+ node_test_1.describe.skip('@unit: isSubDirectory', () => {
11
+ (0, node_test_1.test)('should return correct result', () => {
12
12
  node_assert_1.default.strictEqual((0, isSubdirectory_1.isSubDirectory)((0, pathHelpers_1.resolveHelper)('/'), (0, pathHelpers_1.resolveHelper)('/')), false);
13
13
  node_assert_1.default.strictEqual((0, isSubdirectory_1.isSubDirectory)((0, pathHelpers_1.resolveHelper)('.'), (0, pathHelpers_1.resolveHelper)('.')), false);
14
14
  node_assert_1.default.strictEqual((0, isSubdirectory_1.isSubDirectory)((0, pathHelpers_1.resolveHelper)('./project'), (0, pathHelpers_1.resolveHelper)('./project')), false);
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=modelHelpers.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modelHelpers.test.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/__tests__/modelHelpers.test.ts"],"names":[],"mappings":""}