ts-openapi-codegen 2.0.0 → 2.1.0-beta.2

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 (418) hide show
  1. package/README.md +95 -2
  2. package/README.rus.md +95 -2
  3. package/dist/cli/analyzeDiff/__tests__/analyzeDiff.cli.test.d.ts +2 -0
  4. package/dist/cli/analyzeDiff/__tests__/analyzeDiff.cli.test.d.ts.map +1 -0
  5. package/dist/cli/analyzeDiff/__tests__/analyzeDiff.cli.test.js +365 -0
  6. package/dist/cli/analyzeDiff/__tests__/analyzeDiffRenameAndInvalidRegex.test.d.ts +2 -0
  7. package/dist/cli/analyzeDiff/__tests__/analyzeDiffRenameAndInvalidRegex.test.d.ts.map +1 -0
  8. package/dist/cli/analyzeDiff/__tests__/analyzeDiffRenameAndInvalidRegex.test.js +142 -0
  9. package/dist/cli/analyzeDiff/__tests__/analyzeDiffTypeCoercion.test.d.ts +2 -0
  10. package/dist/cli/analyzeDiff/__tests__/analyzeDiffTypeCoercion.test.d.ts.map +1 -0
  11. package/dist/cli/analyzeDiff/__tests__/analyzeDiffTypeCoercion.test.js +137 -0
  12. package/dist/cli/analyzeDiff/analyzeDiff.d.ts +17 -0
  13. package/dist/cli/analyzeDiff/analyzeDiff.d.ts.map +1 -0
  14. package/dist/cli/analyzeDiff/analyzeDiff.js +105 -0
  15. package/dist/cli/analyzeDiff/buildLegacyReport.d.ts +17 -0
  16. package/dist/cli/analyzeDiff/buildLegacyReport.d.ts.map +1 -0
  17. package/dist/cli/analyzeDiff/buildLegacyReport.js +54 -0
  18. package/dist/cli/analyzeDiff/ciSummary.d.ts +6 -0
  19. package/dist/cli/analyzeDiff/ciSummary.d.ts.map +1 -0
  20. package/dist/cli/analyzeDiff/ciSummary.js +20 -0
  21. package/dist/cli/analyzeDiff/diffEngine.d.ts +54 -0
  22. package/dist/cli/analyzeDiff/diffEngine.d.ts.map +1 -0
  23. package/dist/cli/analyzeDiff/diffEngine.js +209 -0
  24. package/dist/cli/analyzeDiff/ignoreRules.d.ts +33 -0
  25. package/dist/cli/analyzeDiff/ignoreRules.d.ts.map +1 -0
  26. package/dist/cli/analyzeDiff/ignoreRules.js +93 -0
  27. package/dist/cli/analyzeDiff/ignoreSemanticChanges.d.ts +10 -0
  28. package/dist/cli/analyzeDiff/ignoreSemanticChanges.d.ts.map +1 -0
  29. package/dist/cli/analyzeDiff/ignoreSemanticChanges.js +84 -0
  30. package/dist/cli/analyzeDiff/logLegacyReport.d.ts +6 -0
  31. package/dist/cli/analyzeDiff/logLegacyReport.d.ts.map +1 -0
  32. package/dist/cli/analyzeDiff/logLegacyReport.js +29 -0
  33. package/dist/cli/analyzeDiff/miracles.d.ts +89 -0
  34. package/dist/cli/analyzeDiff/miracles.d.ts.map +1 -0
  35. package/dist/cli/analyzeDiff/miracles.js +325 -0
  36. package/dist/cli/analyzeDiff/pluginPaths.d.ts +5 -0
  37. package/dist/cli/analyzeDiff/pluginPaths.d.ts.map +1 -0
  38. package/dist/cli/analyzeDiff/pluginPaths.js +13 -0
  39. package/dist/cli/analyzeDiff/report.d.ts +3 -0
  40. package/dist/cli/analyzeDiff/report.d.ts.map +1 -0
  41. package/dist/cli/analyzeDiff/report.js +7 -0
  42. package/dist/cli/analyzeDiff/semanticDiffContext.d.ts +6 -0
  43. package/dist/cli/analyzeDiff/semanticDiffContext.d.ts.map +1 -0
  44. package/dist/cli/analyzeDiff/semanticDiffContext.js +16 -0
  45. package/dist/cli/analyzeDiff/specParser.d.ts +22 -0
  46. package/dist/cli/analyzeDiff/specParser.d.ts.map +1 -0
  47. package/dist/cli/analyzeDiff/specParser.js +80 -0
  48. package/dist/cli/analyzeDiff/types.d.ts +61 -0
  49. package/dist/cli/analyzeDiff/types.d.ts.map +1 -0
  50. package/dist/cli/analyzeDiff/types.js +2 -0
  51. package/dist/cli/analyzeDiff/writeLegacyReport.d.ts +6 -0
  52. package/dist/cli/analyzeDiff/writeLegacyReport.d.ts.map +1 -0
  53. package/dist/cli/analyzeDiff/writeLegacyReport.js +21 -0
  54. package/dist/cli/checkAndUpdateConfig/checkConfig.d.ts.map +1 -1
  55. package/dist/cli/checkAndUpdateConfig/checkConfig.js +13 -8
  56. package/dist/cli/checkAndUpdateConfig/constants.d.ts +0 -9
  57. package/dist/cli/checkAndUpdateConfig/constants.d.ts.map +1 -1
  58. package/dist/cli/checkAndUpdateConfig/constants.js +1 -10
  59. package/dist/cli/checkAndUpdateConfig/updateConfig.d.ts.map +1 -1
  60. package/dist/cli/checkAndUpdateConfig/updateConfig.js +11 -7
  61. package/dist/cli/checkAndUpdateConfig/utils/selectConfigAction.d.ts.map +1 -1
  62. package/dist/cli/checkAndUpdateConfig/utils/selectConfigAction.js +6 -3
  63. package/dist/cli/checkAndUpdateConfig/utils/updateExistingConfigFile.d.ts.map +1 -1
  64. package/dist/cli/checkAndUpdateConfig/utils/updateExistingConfigFile.js +3 -2
  65. package/dist/cli/checkAndUpdateConfig/utils/writeExampleConfigFile.d.ts.map +1 -1
  66. package/dist/cli/checkAndUpdateConfig/utils/writeExampleConfigFile.js +2 -2
  67. package/dist/cli/generateOpenApiClient/__tests__/generateOpenApiClient.strict.test.d.ts +2 -0
  68. package/dist/cli/generateOpenApiClient/__tests__/generateOpenApiClient.strict.test.d.ts.map +1 -0
  69. package/dist/cli/generateOpenApiClient/__tests__/generateOpenApiClient.strict.test.js +152 -0
  70. package/dist/cli/generateOpenApiClient/generateOpenApiClient.d.ts +6 -2
  71. package/dist/cli/generateOpenApiClient/generateOpenApiClient.d.ts.map +1 -1
  72. package/dist/cli/generateOpenApiClient/generateOpenApiClient.js +54 -18
  73. package/dist/cli/index.js +57 -2
  74. package/dist/cli/initOpenApiConfig/init.d.ts.map +1 -1
  75. package/dist/cli/initOpenApiConfig/init.js +19 -6
  76. package/dist/cli/initOpenApiConfig/initConfig.d.ts +1 -0
  77. package/dist/cli/initOpenApiConfig/initConfig.d.ts.map +1 -1
  78. package/dist/cli/initOpenApiConfig/initConfig.js +47 -24
  79. package/dist/cli/initOpenApiConfig/initCustomRequest.d.ts +8 -1
  80. package/dist/cli/initOpenApiConfig/initCustomRequest.d.ts.map +1 -1
  81. package/dist/cli/initOpenApiConfig/initCustomRequest.js +40 -8
  82. package/dist/cli/initOpenApiConfig/utils/buildConfig.d.ts.map +1 -1
  83. package/dist/cli/initOpenApiConfig/utils/buildConfig.js +60 -0
  84. package/dist/cli/initOpenApiConfig/utils/validateSpecFile.d.ts.map +1 -1
  85. package/dist/cli/initOpenApiConfig/utils/validateSpecFile.js +2 -1
  86. package/dist/cli/initOpenApiConfig/utils/writeConfigFile.d.ts.map +1 -1
  87. package/dist/cli/initOpenApiConfig/utils/writeConfigFile.js +2 -1
  88. package/dist/cli/interactive/confirmDialog.d.ts.map +1 -1
  89. package/dist/cli/interactive/confirmDialog.js +3 -2
  90. package/dist/cli/interactive/constants.d.ts +2 -2
  91. package/dist/cli/interactive/constants.js +8 -8
  92. package/dist/cli/interactive/selectDialog.d.ts.map +1 -1
  93. package/dist/cli/interactive/selectDialog.js +11 -6
  94. package/dist/cli/previewChanges/previewChanges.d.ts.map +1 -1
  95. package/dist/cli/previewChanges/previewChanges.js +45 -17
  96. package/dist/cli/schemas/analyzeDiff.d.ts +14 -0
  97. package/dist/cli/schemas/analyzeDiff.d.ts.map +1 -0
  98. package/dist/cli/schemas/analyzeDiff.js +28 -0
  99. package/dist/cli/schemas/generate.d.ts +9 -0
  100. package/dist/cli/schemas/generate.d.ts.map +1 -1
  101. package/dist/cli/schemas/generate.js +9 -0
  102. package/dist/cli/schemas/index.d.ts +3 -1
  103. package/dist/cli/schemas/index.d.ts.map +1 -1
  104. package/dist/cli/schemas/index.js +2 -0
  105. package/dist/common/Consts.d.ts +1 -0
  106. package/dist/common/Consts.d.ts.map +1 -1
  107. package/dist/common/Consts.js +15 -1
  108. package/dist/common/Logger.d.ts +20 -1
  109. package/dist/common/Logger.d.ts.map +1 -1
  110. package/dist/common/Logger.js +70 -9
  111. package/dist/common/LoggerMessages.d.ts +135 -33
  112. package/dist/common/LoggerMessages.d.ts.map +1 -1
  113. package/dist/common/LoggerMessages.js +118 -45
  114. package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.d.ts.map +1 -1
  115. package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.js +7 -1
  116. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.d.ts +4 -0
  117. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.d.ts.map +1 -1
  118. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts +8 -0
  119. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts.map +1 -1
  120. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts +8 -0
  121. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts.map +1 -1
  122. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.d.ts +8 -0
  123. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.d.ts.map +1 -1
  124. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.d.ts +35 -0
  125. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.d.ts.map +1 -1
  126. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.js +4 -1
  127. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV5.d.ts +79 -0
  128. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV5.d.ts.map +1 -0
  129. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV5.js +19 -0
  130. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts +171 -0
  131. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts.map +1 -1
  132. package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.js +2 -0
  133. package/dist/common/VersionedSchema/CommonSchemas.d.ts +40 -0
  134. package/dist/common/VersionedSchema/CommonSchemas.d.ts.map +1 -1
  135. package/dist/common/VersionedSchema/CommonSchemas.js +34 -1
  136. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts +4 -0
  137. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts.map +1 -1
  138. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.d.ts +4 -0
  139. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.d.ts.map +1 -1
  140. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.d.ts +4 -0
  141. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.d.ts.map +1 -1
  142. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts +4 -0
  143. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts.map +1 -1
  144. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts +4 -0
  145. package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts.map +1 -1
  146. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts +4 -0
  147. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts.map +1 -1
  148. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.d.ts +4 -0
  149. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.d.ts.map +1 -1
  150. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.d.ts +4 -0
  151. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.d.ts.map +1 -1
  152. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts +4 -0
  153. package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts.map +1 -1
  154. package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.d.ts.map +1 -1
  155. package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.js +23 -3
  156. package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.js +2 -2
  157. package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts.map +1 -1
  158. package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.js +2 -1
  159. package/dist/common/__tests__/Logger.test.d.ts +2 -0
  160. package/dist/common/__tests__/Logger.test.d.ts.map +1 -0
  161. package/dist/common/__tests__/Logger.test.js +100 -0
  162. package/dist/common/utils/__tests__/convertArrayToObject.test.js +3 -0
  163. package/dist/common/utils/__tests__/eslintFix.test.d.ts +2 -0
  164. package/dist/common/utils/__tests__/eslintFix.test.d.ts.map +1 -0
  165. package/dist/common/utils/__tests__/eslintFix.test.js +134 -0
  166. package/dist/common/utils/__tests__/format.test.d.ts +2 -0
  167. package/dist/common/utils/__tests__/format.test.d.ts.map +1 -0
  168. package/dist/common/utils/__tests__/format.test.js +90 -0
  169. package/dist/common/utils/convertArrayToObject.d.ts.map +1 -1
  170. package/dist/common/utils/convertArrayToObject.js +3 -0
  171. package/dist/common/utils/eslintFix.d.ts +7 -0
  172. package/dist/common/utils/eslintFix.d.ts.map +1 -0
  173. package/dist/common/utils/eslintFix.js +78 -0
  174. package/dist/common/utils/format.d.ts +1 -1
  175. package/dist/common/utils/format.d.ts.map +1 -1
  176. package/dist/common/utils/format.js +39 -15
  177. package/dist/common/utils/jsonPath.d.ts +5 -0
  178. package/dist/common/utils/jsonPath.d.ts.map +1 -0
  179. package/dist/common/utils/jsonPath.js +27 -0
  180. package/dist/common/utils/normalizeObject.d.ts +2 -0
  181. package/dist/common/utils/normalizeObject.d.ts.map +1 -0
  182. package/dist/common/utils/normalizeObject.js +63 -0
  183. package/dist/core/Context.d.ts +8 -1
  184. package/dist/core/Context.d.ts.map +1 -1
  185. package/dist/core/Context.js +23 -4
  186. package/dist/core/OpenApiClient.d.ts +2 -0
  187. package/dist/core/OpenApiClient.d.ts.map +1 -1
  188. package/dist/core/OpenApiClient.js +116 -6
  189. package/dist/core/WriteClient.d.ts +4 -0
  190. package/dist/core/WriteClient.d.ts.map +1 -1
  191. package/dist/core/WriteClient.js +38 -4
  192. package/dist/core/__tests__/WriteClient.test.js +4 -1
  193. package/dist/core/api/v2/parser/__tests__/getModel.test.d.ts +2 -0
  194. package/dist/core/api/v2/parser/__tests__/getModel.test.d.ts.map +1 -0
  195. package/dist/core/api/v2/parser/__tests__/getModel.test.js +34 -0
  196. package/dist/core/api/v2/parser/getModel.d.ts.map +1 -1
  197. package/dist/core/api/v2/parser/getModel.js +6 -1
  198. package/dist/core/api/v2/parser/getOperation.d.ts.map +1 -1
  199. package/dist/core/api/v2/parser/getOperation.js +2 -0
  200. package/dist/core/api/v2/parser/getOperationResponses.d.ts.map +1 -1
  201. package/dist/core/api/v2/parser/getOperationResponses.js +9 -1
  202. package/dist/core/api/v2/types/OpenApiSchema.model.d.ts +2 -0
  203. package/dist/core/api/v2/types/OpenApiSchema.model.d.ts.map +1 -1
  204. package/dist/core/api/v3/parser/__tests__/getContent.test.d.ts +2 -0
  205. package/dist/core/api/v3/parser/__tests__/getContent.test.d.ts.map +1 -0
  206. package/dist/core/api/v3/parser/__tests__/getContent.test.js +65 -0
  207. package/dist/core/api/v3/parser/__tests__/getModel.test.d.ts +2 -0
  208. package/dist/core/api/v3/parser/__tests__/getModel.test.d.ts.map +1 -0
  209. package/dist/core/api/v3/parser/__tests__/getModel.test.js +34 -0
  210. package/dist/core/api/v3/parser/getContent.d.ts.map +1 -1
  211. package/dist/core/api/v3/parser/getContent.js +21 -11
  212. package/dist/core/api/v3/parser/getModel.d.ts.map +1 -1
  213. package/dist/core/api/v3/parser/getModel.js +6 -1
  214. package/dist/core/api/v3/parser/getOperation.d.ts.map +1 -1
  215. package/dist/core/api/v3/parser/getOperation.js +2 -0
  216. package/dist/core/api/v3/parser/getOperationResponses.d.ts.map +1 -1
  217. package/dist/core/api/v3/parser/getOperationResponses.js +9 -1
  218. package/dist/core/api/v3/types/OpenApiSchema.model.d.ts +2 -0
  219. package/dist/core/api/v3/types/OpenApiSchema.model.d.ts.map +1 -1
  220. package/dist/core/governance/__tests__/evaluateGovernanceRules.test.d.ts +2 -0
  221. package/dist/core/governance/__tests__/evaluateGovernanceRules.test.d.ts.map +1 -0
  222. package/dist/core/governance/__tests__/evaluateGovernanceRules.test.js +100 -0
  223. package/dist/core/governance/__tests__/loadGovernanceConfig.test.d.ts +2 -0
  224. package/dist/core/governance/__tests__/loadGovernanceConfig.test.d.ts.map +1 -0
  225. package/dist/core/governance/__tests__/loadGovernanceConfig.test.js +71 -0
  226. package/dist/core/governance/evaluateGovernanceRules.d.ts +42 -0
  227. package/dist/core/governance/evaluateGovernanceRules.d.ts.map +1 -0
  228. package/dist/core/governance/evaluateGovernanceRules.js +134 -0
  229. package/dist/core/governance/governanceConfigSchema.d.ts +4 -0
  230. package/dist/core/governance/governanceConfigSchema.d.ts.map +1 -0
  231. package/dist/core/governance/governanceConfigSchema.js +39 -0
  232. package/dist/core/governance/loadGovernanceConfig.d.ts +7 -0
  233. package/dist/core/governance/loadGovernanceConfig.d.ts.map +1 -0
  234. package/dist/core/governance/loadGovernanceConfig.js +60 -0
  235. package/dist/core/index.d.ts +3 -0
  236. package/dist/core/index.d.ts.map +1 -1
  237. package/dist/core/index.js +4 -2
  238. package/dist/core/plugins/GeneratorPlugin.model.d.ts +42 -0
  239. package/dist/core/plugins/GeneratorPlugin.model.d.ts.map +1 -0
  240. package/dist/core/plugins/GeneratorPlugin.model.js +2 -0
  241. package/dist/core/plugins/__tests__/applySemanticDiffPluginHooks.test.d.ts +2 -0
  242. package/dist/core/plugins/__tests__/applySemanticDiffPluginHooks.test.d.ts.map +1 -0
  243. package/dist/core/plugins/__tests__/applySemanticDiffPluginHooks.test.js +115 -0
  244. package/dist/core/plugins/__tests__/loadGeneratorPlugins.test.d.ts +2 -0
  245. package/dist/core/plugins/__tests__/loadGeneratorPlugins.test.d.ts.map +1 -0
  246. package/dist/core/plugins/__tests__/loadGeneratorPlugins.test.js +62 -0
  247. package/dist/core/plugins/applySemanticDiffPluginHooks.d.ts +28 -0
  248. package/dist/core/plugins/applySemanticDiffPluginHooks.d.ts.map +1 -0
  249. package/dist/core/plugins/applySemanticDiffPluginHooks.js +160 -0
  250. package/dist/core/plugins/builtins/xTypescriptTypePlugin.d.ts +6 -0
  251. package/dist/core/plugins/builtins/xTypescriptTypePlugin.d.ts.map +1 -0
  252. package/dist/core/plugins/builtins/xTypescriptTypePlugin.js +13 -0
  253. package/dist/core/plugins/getBuiltinPlugins.d.ts +6 -0
  254. package/dist/core/plugins/getBuiltinPlugins.d.ts.map +1 -0
  255. package/dist/core/plugins/getBuiltinPlugins.js +10 -0
  256. package/dist/core/plugins/index.d.ts +4 -0
  257. package/dist/core/plugins/index.d.ts.map +1 -0
  258. package/dist/core/plugins/index.js +5 -0
  259. package/dist/core/plugins/loadGeneratorPlugins.d.ts +6 -0
  260. package/dist/core/plugins/loadGeneratorPlugins.d.ts.map +1 -0
  261. package/dist/core/plugins/loadGeneratorPlugins.js +94 -0
  262. package/dist/core/semanticDiff/__tests__/analyzeOpenApiDiff.test.d.ts +2 -0
  263. package/dist/core/semanticDiff/__tests__/analyzeOpenApiDiff.test.d.ts.map +1 -0
  264. package/dist/core/semanticDiff/__tests__/analyzeOpenApiDiff.test.js +537 -0
  265. package/dist/core/semanticDiff/__tests__/semanticDiffReportSchema.test.d.ts +2 -0
  266. package/dist/core/semanticDiff/__tests__/semanticDiffReportSchema.test.d.ts.map +1 -0
  267. package/dist/core/semanticDiff/__tests__/semanticDiffReportSchema.test.js +66 -0
  268. package/dist/core/semanticDiff/analyzeOpenApiDiff.d.ts +45 -0
  269. package/dist/core/semanticDiff/analyzeOpenApiDiff.d.ts.map +1 -0
  270. package/dist/core/semanticDiff/analyzeOpenApiDiff.js +640 -0
  271. package/dist/core/semanticDiff/semanticDiffReportSchema.d.ts +11 -0
  272. package/dist/core/semanticDiff/semanticDiffReportSchema.d.ts.map +1 -0
  273. package/dist/core/semanticDiff/semanticDiffReportSchema.js +132 -0
  274. package/dist/core/strict/__tests__/validateOpenApiStrict.test.d.ts +2 -0
  275. package/dist/core/strict/__tests__/validateOpenApiStrict.test.d.ts.map +1 -0
  276. package/dist/core/strict/__tests__/validateOpenApiStrict.test.js +156 -0
  277. package/dist/core/strict/validateOpenApiStrict.d.ts +43 -0
  278. package/dist/core/strict/validateOpenApiStrict.d.ts.map +1 -0
  279. package/dist/core/strict/validateOpenApiStrict.js +253 -0
  280. package/dist/core/types/base/ClientArtifacts.model.d.ts +2 -0
  281. package/dist/core/types/base/ClientArtifacts.model.d.ts.map +1 -1
  282. package/dist/core/types/base/Templates.model.d.ts +3 -0
  283. package/dist/core/types/base/Templates.model.d.ts.map +1 -1
  284. package/dist/core/types/enums/ModelsMode.enum.d.ts +5 -0
  285. package/dist/core/types/enums/ModelsMode.enum.d.ts.map +1 -0
  286. package/dist/core/types/enums/ModelsMode.enum.js +8 -0
  287. package/dist/core/types/shared/Client.model.d.ts +2 -0
  288. package/dist/core/types/shared/Client.model.d.ts.map +1 -1
  289. package/dist/core/types/shared/DiffInfo.model.d.ts +13 -0
  290. package/dist/core/types/shared/DiffInfo.model.d.ts.map +1 -0
  291. package/dist/core/types/shared/DiffInfo.model.js +2 -0
  292. package/dist/core/types/shared/Miracle.model.d.ts +13 -0
  293. package/dist/core/types/shared/Miracle.model.d.ts.map +1 -0
  294. package/dist/core/types/shared/Miracle.model.js +2 -0
  295. package/dist/core/types/shared/Model.model.d.ts +23 -0
  296. package/dist/core/types/shared/Model.model.d.ts.map +1 -1
  297. package/dist/core/types/shared/Operation.model.d.ts +5 -0
  298. package/dist/core/types/shared/Operation.model.d.ts.map +1 -1
  299. package/dist/core/utils/__mocks__/templates.d.ts.map +1 -1
  300. package/dist/core/utils/__mocks__/templates.js +9 -0
  301. package/dist/core/utils/__tests__/applyDiffReportToClient.test.d.ts +2 -0
  302. package/dist/core/utils/__tests__/applyDiffReportToClient.test.d.ts.map +1 -0
  303. package/dist/core/utils/__tests__/applyDiffReportToClient.test.js +108 -0
  304. package/dist/core/utils/__tests__/getMappedType.test.js +2 -0
  305. package/dist/core/utils/__tests__/getOperationResponseCode.test.js +7 -2
  306. package/dist/core/utils/__tests__/getOperationResults.test.d.ts +2 -0
  307. package/dist/core/utils/__tests__/getOperationResults.test.d.ts.map +1 -0
  308. package/dist/core/utils/__tests__/getOperationResults.test.js +43 -0
  309. package/dist/core/utils/__tests__/prepareDtoModels.test.d.ts +2 -0
  310. package/dist/core/utils/__tests__/prepareDtoModels.test.d.ts.map +1 -0
  311. package/dist/core/utils/__tests__/prepareDtoModels.test.js +116 -0
  312. package/dist/core/utils/__tests__/serviceHelpers.test.js +1 -0
  313. package/dist/core/utils/__tests__/writeClientModels.test.js +50 -0
  314. package/dist/core/utils/applyDiffReportToClient.d.ts +14 -0
  315. package/dist/core/utils/applyDiffReportToClient.d.ts.map +1 -0
  316. package/dist/core/utils/applyDiffReportToClient.js +367 -0
  317. package/dist/core/utils/getMappedType.d.ts.map +1 -1
  318. package/dist/core/utils/getMappedType.js +2 -0
  319. package/dist/core/utils/getOpenApiSpec.d.ts.map +1 -1
  320. package/dist/core/utils/getOpenApiSpec.js +1 -14
  321. package/dist/core/utils/getOperationResponseCode.d.ts.map +1 -1
  322. package/dist/core/utils/getOperationResponseCode.js +10 -8
  323. package/dist/core/utils/loadDiffReport.d.ts +39 -0
  324. package/dist/core/utils/loadDiffReport.d.ts.map +1 -0
  325. package/dist/core/utils/loadDiffReport.js +51 -0
  326. package/dist/core/utils/prepareDtoModels.d.ts +3 -0
  327. package/dist/core/utils/prepareDtoModels.d.ts.map +1 -0
  328. package/dist/core/utils/prepareDtoModels.js +189 -0
  329. package/dist/core/utils/registerHandlebarHelpers.d.ts.map +1 -1
  330. package/dist/core/utils/registerHandlebarHelpers.js +4 -1
  331. package/dist/core/utils/registerHandlebarTemplates.d.ts.map +1 -1
  332. package/dist/core/utils/registerHandlebarTemplates.js +6 -0
  333. package/dist/core/utils/validateRawOptions.d.ts +1 -1
  334. package/dist/core/utils/validateRawOptions.d.ts.map +1 -1
  335. package/dist/core/utils/validateRawOptions.js +4 -2
  336. package/dist/core/utils/writeClientCore.d.ts +2 -0
  337. package/dist/core/utils/writeClientCore.d.ts.map +1 -1
  338. package/dist/core/utils/writeClientCore.js +6 -1
  339. package/dist/core/utils/writeClientCoreIndex.d.ts +1 -0
  340. package/dist/core/utils/writeClientCoreIndex.d.ts.map +1 -1
  341. package/dist/core/utils/writeClientCoreIndex.js +2 -2
  342. package/dist/core/utils/writeClientExecutor.d.ts +2 -0
  343. package/dist/core/utils/writeClientExecutor.d.ts.map +1 -1
  344. package/dist/core/utils/writeClientExecutor.js +6 -2
  345. package/dist/core/utils/writeClientFullIndex.d.ts.map +1 -1
  346. package/dist/core/utils/writeClientFullIndex.js +3 -1
  347. package/dist/core/utils/writeClientModels.d.ts +6 -0
  348. package/dist/core/utils/writeClientModels.d.ts.map +1 -1
  349. package/dist/core/utils/writeClientModels.js +24 -3
  350. package/dist/core/utils/writeClientModelsIndex.d.ts +2 -0
  351. package/dist/core/utils/writeClientModelsIndex.d.ts.map +1 -1
  352. package/dist/core/utils/writeClientModelsIndex.js +2 -2
  353. package/dist/core/utils/writeClientSchemas.d.ts +2 -0
  354. package/dist/core/utils/writeClientSchemas.d.ts.map +1 -1
  355. package/dist/core/utils/writeClientSchemas.js +6 -2
  356. package/dist/core/utils/writeClientServices.d.ts +2 -0
  357. package/dist/core/utils/writeClientServices.d.ts.map +1 -1
  358. package/dist/core/utils/writeClientServices.js +6 -2
  359. package/dist/templatesCompiled/cli/openApiConfig.d.ts +4 -1
  360. package/dist/templatesCompiled/cli/openApiConfig.d.ts.map +1 -1
  361. package/dist/templatesCompiled/cli/openApiConfig.js +88 -37
  362. package/dist/templatesCompiled/client/core/ApiRequestOptions.js +1 -1
  363. package/dist/templatesCompiled/client/core/BaseDto.d.ts +8 -0
  364. package/dist/templatesCompiled/client/core/BaseDto.d.ts.map +1 -0
  365. package/dist/templatesCompiled/client/core/BaseDto.js +18 -0
  366. package/dist/templatesCompiled/client/core/axios/getResponseBody.js +1 -1
  367. package/dist/templatesCompiled/client/core/axios/request.js +2 -2
  368. package/dist/templatesCompiled/client/core/axios/sendRequest.js +4 -4
  369. package/dist/templatesCompiled/client/core/dtoUtils.d.ts +8 -0
  370. package/dist/templatesCompiled/client/core/dtoUtils.d.ts.map +1 -0
  371. package/dist/templatesCompiled/client/core/dtoUtils.js +18 -0
  372. package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.js +2 -2
  373. package/dist/templatesCompiled/client/core/executor/requestExecutor.js +1 -1
  374. package/dist/templatesCompiled/client/core/fetch/getResponseBody.js +1 -1
  375. package/dist/templatesCompiled/client/core/fetch/request.js +2 -2
  376. package/dist/templatesCompiled/client/core/functions/isBinary.js +1 -1
  377. package/dist/templatesCompiled/client/core/node/getResponseBody.js +1 -1
  378. package/dist/templatesCompiled/client/core/node/request.js +2 -2
  379. package/dist/templatesCompiled/client/core/xhr/getResponseBody.js +1 -1
  380. package/dist/templatesCompiled/client/core/xhr/request.js +2 -2
  381. package/dist/templatesCompiled/client/core/xhr/sendRequest.js +4 -4
  382. package/dist/templatesCompiled/client/exportModels.d.ts +34 -0
  383. package/dist/templatesCompiled/client/exportModels.d.ts.map +1 -0
  384. package/dist/templatesCompiled/client/exportModels.js +280 -0
  385. package/dist/templatesCompiled/client/exportService.d.ts +7 -4
  386. package/dist/templatesCompiled/client/exportService.d.ts.map +1 -1
  387. package/dist/templatesCompiled/client/exportService.js +52 -33
  388. package/dist/templatesCompiled/client/indexCore.d.ts +3 -1
  389. package/dist/templatesCompiled/client/indexCore.d.ts.map +1 -1
  390. package/dist/templatesCompiled/client/indexCore.js +13 -2
  391. package/dist/templatesCompiled/client/indexFull.d.ts +9 -7
  392. package/dist/templatesCompiled/client/indexFull.d.ts.map +1 -1
  393. package/dist/templatesCompiled/client/indexFull.js +52 -34
  394. package/dist/templatesCompiled/client/indexModels.d.ts +7 -5
  395. package/dist/templatesCompiled/client/indexModels.d.ts.map +1 -1
  396. package/dist/templatesCompiled/client/indexModels.js +27 -18
  397. package/dist/templatesCompiled/client/joi/partials/joiSchemaGeneric.d.ts +27 -19
  398. package/dist/templatesCompiled/client/joi/partials/joiSchemaGeneric.d.ts.map +1 -1
  399. package/dist/templatesCompiled/client/joi/partials/joiSchemaGeneric.js +144 -63
  400. package/dist/templatesCompiled/client/jsonschema/exportSchema.d.ts +1 -0
  401. package/dist/templatesCompiled/client/jsonschema/exportSchema.d.ts.map +1 -1
  402. package/dist/templatesCompiled/client/jsonschema/exportSchema.js +17 -13
  403. package/dist/templatesCompiled/client/partials/exportInterface.d.ts +13 -5
  404. package/dist/templatesCompiled/client/partials/exportInterface.d.ts.map +1 -1
  405. package/dist/templatesCompiled/client/partials/exportInterface.js +91 -21
  406. package/dist/templatesCompiled/client/partials/result.d.ts +6 -4
  407. package/dist/templatesCompiled/client/partials/result.d.ts.map +1 -1
  408. package/dist/templatesCompiled/client/partials/result.js +16 -6
  409. package/dist/templatesCompiled/client/partials/serviceOption.d.ts +1 -0
  410. package/dist/templatesCompiled/client/partials/serviceOption.d.ts.map +1 -1
  411. package/dist/templatesCompiled/client/partials/serviceOption.js +11 -4
  412. package/dist/templatesCompiled/client/yup/partials/yupSchemaGeneric.d.ts +22 -16
  413. package/dist/templatesCompiled/client/yup/partials/yupSchemaGeneric.d.ts.map +1 -1
  414. package/dist/templatesCompiled/client/yup/partials/yupSchemaGeneric.js +72 -60
  415. package/dist/templatesCompiled/client/zod/partials/zodSchemaGeneric.d.ts +27 -19
  416. package/dist/templatesCompiled/client/zod/partials/zodSchemaGeneric.d.ts.map +1 -1
  417. package/dist/templatesCompiled/client/zod/partials/zodSchemaGeneric.js +77 -61
  418. package/package.json +7 -5
@@ -1 +1 @@
1
- {"version":3,"file":"writeClientServices.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientServices.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,KAAK,mBAAmB,GAAG,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,eAAe,CAAC,CAAC;AAEzE;;;;;;;;GAQG;AACH,UAAU,oBAAoB;IAC1B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,mBAAmB,CAAC;IACjC,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,oBAAoB,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BzG"}
1
+ {"version":3,"file":"writeClientServices.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientServices.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,KAAK,mBAAmB,GAAG,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,eAAe,CAAC,CAAC;AAEzE;;;;;;;;GAQG;AACH,UAAU,oBAAoB;IAC1B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,mBAAmB,CAAC;IACjC,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6BzG"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.writeClientServices = writeClientServices;
4
+ const eslintFix_1 = require("../../common/utils/eslintFix");
4
5
  const fileSystemHelpers_1 = require("../../common/utils/fileSystemHelpers");
5
6
  const format_1 = require("../../common/utils/format");
6
7
  const pathHelpers_1 = require("../../common/utils/pathHelpers");
@@ -14,7 +15,7 @@ const pathHelpers_1 = require("../../common/utils/pathHelpers");
14
15
  * @param useOptions Use options or arguments functions
15
16
  */
16
17
  async function writeClientServices(options) {
17
- const { services, templates, outputPaths, httpClient, useUnionTypes, useOptions, useCancelableRequest } = options;
18
+ const { services, templates, outputPaths, httpClient, useUnionTypes, useOptions, useCancelableRequest, useProjectPrettier, useEslintFix } = options;
18
19
  this.logger.info('Recording of service files begins');
19
20
  for (const service of services) {
20
21
  const file = (0, pathHelpers_1.resolveHelper)(outputPaths.outputServices, `${service.name}.ts`);
@@ -28,8 +29,11 @@ async function writeClientServices(options) {
28
29
  outputModels: outputPaths.outputModels,
29
30
  useCancelableRequest,
30
31
  });
31
- const formattedValue = await (0, format_1.format)(templateResult);
32
+ const formattedValue = await (0, format_1.format)(templateResult, undefined, useProjectPrettier);
32
33
  await fileSystemHelpers_1.fileSystemHelpers.writeFile(file, formattedValue);
34
+ if (useEslintFix) {
35
+ await (0, eslintFix_1.eslintFix)(file);
36
+ }
33
37
  this.logger.info(`File recording completed: ${file}`);
34
38
  }
35
39
  this.logger.info('Service file recording completed successfully');
@@ -1,7 +1,10 @@
1
1
  declare const _default: {
2
2
  "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
3
3
  "2": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
4
- "4": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
4
+ "3": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
5
+ "5": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
6
+ "7": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
7
+ "9": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
5
8
  compiler: (string | number)[];
6
9
  main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
7
10
  useData: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"openApiConfig.d.ts","sourceRoot":"","sources":["../../../src/templatesCompiled/cli/openApiConfig.ts"],"names":[],"mappings":";;;;;;;;AAMA,wBAwFiB"}
1
+ {"version":3,"file":"openApiConfig.d.ts","sourceRoot":"","sources":["../../../src/templatesCompiled/cli/openApiConfig.ts"],"names":[],"mappings":";;;;;;;;;;;AAMA,wBA6IiB"}
@@ -7,81 +7,132 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  /* eslint: disable */
8
8
  // @ts-nocheck
9
9
  exports.default = { "1": function (container, depth0, helpers, partials, data) {
10
- var stack1, alias1 = container.strict, alias2 = container.lambda, lookupProperty = container.lookupProperty || function (parent, propertyName) {
10
+ var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), alias2 = container.strict, alias3 = container.lambda, lookupProperty = container.lookupProperty || function (parent, propertyName) {
11
11
  if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
12
12
  return parent[propertyName];
13
13
  }
14
14
  return undefined;
15
15
  };
16
- return "{\n \"items\": "
17
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "items", { "start": { "line": 3, "column": 15 }, "end": { "line": 3, "column": 26 } }), depth0)) != null ? stack1 : "")
18
- + ",\n \"httpClient\": \""
19
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "httpClient", { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 37 } }), depth0)) != null ? stack1 : "")
16
+ return "{\n \"items\": [\n"
17
+ + ((stack1 = lookupProperty(helpers, "each").call(alias1, lookupProperty(lookupProperty(data, "root"), "items"), { "name": "each", "hash": {}, "fn": container.program(2, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 10, "column": 9 } } })) != null ? stack1 : "")
18
+ + " ],\n \"httpClient\": \""
19
+ + ((stack1 = alias3(alias2(lookupProperty(data, "root"), "httpClient", { "start": { "line": 12, "column": 21 }, "end": { "line": 12, "column": 37 } }), depth0)) != null ? stack1 : "")
20
20
  + "\",\n \"sortByRequired\": "
21
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "sortByRequired", { "start": { "line": 5, "column": 24 }, "end": { "line": 5, "column": 44 } }), depth0)) != null ? stack1 : "")
21
+ + ((stack1 = alias3(alias2(lookupProperty(data, "root"), "sortByRequired", { "start": { "line": 13, "column": 24 }, "end": { "line": 13, "column": 44 } }), depth0)) != null ? stack1 : "")
22
22
  + ",\n \"enumPrefix\": \""
23
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "enumPrefix", { "start": { "line": 6, "column": 21 }, "end": { "line": 6, "column": 37 } }), depth0)) != null ? stack1 : "")
23
+ + ((stack1 = alias3(alias2(lookupProperty(data, "root"), "enumPrefix", { "start": { "line": 14, "column": 21 }, "end": { "line": 14, "column": 37 } }), depth0)) != null ? stack1 : "")
24
24
  + "\",\n \"excludeCoreServiceFiles\": "
25
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "excludeCoreServiceFiles", { "start": { "line": 7, "column": 33 }, "end": { "line": 7, "column": 62 } }), depth0)) != null ? stack1 : "")
25
+ + ((stack1 = alias3(alias2(lookupProperty(data, "root"), "excludeCoreServiceFiles", { "start": { "line": 15, "column": 33 }, "end": { "line": 15, "column": 62 } }), depth0)) != null ? stack1 : "")
26
26
  + ",\n \"interfacePrefix\": \""
27
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "interfacePrefix", { "start": { "line": 8, "column": 26 }, "end": { "line": 8, "column": 47 } }), depth0)) != null ? stack1 : "")
27
+ + ((stack1 = alias3(alias2(lookupProperty(data, "root"), "interfacePrefix", { "start": { "line": 16, "column": 26 }, "end": { "line": 16, "column": 47 } }), depth0)) != null ? stack1 : "")
28
28
  + "\",\n \"typePrefix\": \""
29
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "typePrefix", { "start": { "line": 9, "column": 21 }, "end": { "line": 9, "column": 37 } }), depth0)) != null ? stack1 : "")
29
+ + ((stack1 = alias3(alias2(lookupProperty(data, "root"), "typePrefix", { "start": { "line": 17, "column": 21 }, "end": { "line": 17, "column": 37 } }), depth0)) != null ? stack1 : "")
30
30
  + "\",\n \"useCancelableRequest\": "
31
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useCancelableRequest", { "start": { "line": 10, "column": 30 }, "end": { "line": 10, "column": 56 } }), depth0)) != null ? stack1 : "")
31
+ + ((stack1 = alias3(alias2(lookupProperty(data, "root"), "useCancelableRequest", { "start": { "line": 18, "column": 30 }, "end": { "line": 18, "column": 56 } }), depth0)) != null ? stack1 : "")
32
32
  + ",\n \"useOptions\": "
33
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useOptions", { "start": { "line": 11, "column": 20 }, "end": { "line": 11, "column": 36 } }), depth0)) != null ? stack1 : "")
33
+ + ((stack1 = alias3(alias2(lookupProperty(data, "root"), "useOptions", { "start": { "line": 19, "column": 20 }, "end": { "line": 19, "column": 36 } }), depth0)) != null ? stack1 : "")
34
34
  + ",\n \"useSeparatedIndexes\": "
35
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useSeparatedIndexes", { "start": { "line": 12, "column": 29 }, "end": { "line": 12, "column": 54 } }), depth0)) != null ? stack1 : "")
35
+ + ((stack1 = alias3(alias2(lookupProperty(data, "root"), "useSeparatedIndexes", { "start": { "line": 20, "column": 29 }, "end": { "line": 20, "column": 54 } }), depth0)) != null ? stack1 : "")
36
36
  + ",\n \"useUnionTypes\": "
37
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useUnionTypes", { "start": { "line": 13, "column": 23 }, "end": { "line": 13, "column": 42 } }), depth0)) != null ? stack1 : "")
38
- + ",\n "
39
- + ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(data, "root"), "request"), { "name": "if", "hash": {}, "fn": container.program(2, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 62 } } })) != null ? stack1 : "")
40
- + "\n}\n";
37
+ + ((stack1 = alias3(alias2(lookupProperty(data, "root"), "useUnionTypes", { "start": { "line": 21, "column": 23 }, "end": { "line": 21, "column": 42 } }), depth0)) != null ? stack1 : "")
38
+ + ","
39
+ + ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "request"), { "name": "if", "hash": {}, "fn": container.program(7, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 21, "column": 45 }, "end": { "line": 22, "column": 41 } } })) != null ? stack1 : "")
40
+ + "\n \"modelsMode\": \""
41
+ + ((stack1 = alias3(alias2(lookupProperty(data, "root"), "modelsMode", { "start": { "line": 23, "column": 21 }, "end": { "line": 23, "column": 37 } }), depth0)) != null ? stack1 : "")
42
+ + "\",\n \"useHistory\": "
43
+ + ((stack1 = alias3(alias2(lookupProperty(data, "root"), "useHistory", { "start": { "line": 24, "column": 20 }, "end": { "line": 24, "column": 36 } }), depth0)) != null ? stack1 : "")
44
+ + ",\n \"diffReport\": \""
45
+ + ((stack1 = alias3(alias2(lookupProperty(data, "root"), "diffReport", { "start": { "line": 25, "column": 21 }, "end": { "line": 25, "column": 37 } }), depth0)) != null ? stack1 : "")
46
+ + "\""
47
+ + ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "request"), { "name": "if", "hash": {}, "fn": container.program(7, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 25, "column": 40 }, "end": { "line": 26, "column": 41 } } })) != null ? stack1 : "")
48
+ + ",\n \"models\": {\n \"mode\": \""
49
+ + ((stack1 = alias3(alias2(lookupProperty(data, "root"), "modelsMode", { "start": { "line": 28, "column": 19 }, "end": { "line": 28, "column": 35 } }), depth0)) != null ? stack1 : "")
50
+ + "\"\n },\n \"analyze\": {\n \"useHistory\": "
51
+ + ((stack1 = alias3(alias2(lookupProperty(data, "root"), "useHistory", { "start": { "line": 31, "column": 24 }, "end": { "line": 31, "column": 40 } }), depth0)) != null ? stack1 : "")
52
+ + ",\n \"reportPath\": \""
53
+ + ((stack1 = alias3(alias2(lookupProperty(data, "root"), "diffReport", { "start": { "line": 32, "column": 25 }, "end": { "line": 32, "column": 41 } }), depth0)) != null ? stack1 : "")
54
+ + "\"\n },\n \"miracles\": {\n \"enabled\": true,\n \"confidence\": 1,\n \"types\": [\"RENAME\", \"TYPE_COERCION\"]\n }\n}\n";
41
55
  }, "2": function (container, depth0, helpers, partials, data) {
56
+ var stack1, alias1 = container.strict, alias2 = container.lambda, alias3 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
57
+ if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
58
+ return parent[propertyName];
59
+ }
60
+ return undefined;
61
+ };
62
+ return " {\n \"input\": \""
63
+ + ((stack1 = alias2(alias1(depth0, "input", { "start": { "line": 6, "column": 24 }, "end": { "line": 6, "column": 29 } }), depth0)) != null ? stack1 : "")
64
+ + "\",\n \"output\": \""
65
+ + ((stack1 = alias2(alias1(depth0, "output", { "start": { "line": 7, "column": 25 }, "end": { "line": 7, "column": 31 } }), depth0)) != null ? stack1 : "")
66
+ + "\""
67
+ + ((stack1 = lookupProperty(helpers, "if").call(alias3, lookupProperty(depth0, "request"), { "name": "if", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 7, "column": 34 }, "end": { "line": 8, "column": 43 } } })) != null ? stack1 : "")
68
+ + "\n }"
69
+ + ((stack1 = lookupProperty(helpers, "unless").call(alias3, lookupProperty(data, "last"), { "name": "unless", "hash": {}, "fn": container.program(5, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 9, "column": 9 }, "end": { "line": 9, "column": 38 } } })) != null ? stack1 : "")
70
+ + "\n";
71
+ }, "3": function (container, depth0, helpers, partials, data) {
72
+ var stack1;
73
+ return ",\n \"request\": \""
74
+ + ((stack1 = container.lambda(container.strict(depth0, "request", { "start": { "line": 8, "column": 26 }, "end": { "line": 8, "column": 33 } }), depth0)) != null ? stack1 : "")
75
+ + "\"";
76
+ }, "5": function (container, depth0, helpers, partials, data) {
77
+ return ",";
78
+ }, "7": function (container, depth0, helpers, partials, data) {
42
79
  var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
43
80
  if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
44
81
  return parent[propertyName];
45
82
  }
46
83
  return undefined;
47
84
  };
48
- return "\"request\": \""
49
- + ((stack1 = container.lambda(container.strict(lookupProperty(data, "root"), "request", { "start": { "line": 14, "column": 39 }, "end": { "line": 14, "column": 52 } }), depth0)) != null ? stack1 : "")
85
+ return ",\n \"request\": \""
86
+ + ((stack1 = container.lambda(container.strict(lookupProperty(data, "root"), "request", { "start": { "line": 22, "column": 18 }, "end": { "line": 22, "column": 31 } }), depth0)) != null ? stack1 : "")
50
87
  + "\"";
51
- }, "4": function (container, depth0, helpers, partials, data) {
52
- var stack1, alias1 = container.strict, alias2 = container.lambda, lookupProperty = container.lookupProperty || function (parent, propertyName) {
88
+ }, "9": function (container, depth0, helpers, partials, data) {
89
+ var stack1, alias1 = container.strict, alias2 = container.lambda, alias3 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
53
90
  if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
54
91
  return parent[propertyName];
55
92
  }
56
93
  return undefined;
57
94
  };
58
95
  return "{\n \"input\": \""
59
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "input", { "start": { "line": 18, "column": 16 }, "end": { "line": 18, "column": 27 } }), depth0)) != null ? stack1 : "")
96
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "input", { "start": { "line": 42, "column": 16 }, "end": { "line": 42, "column": 27 } }), depth0)) != null ? stack1 : "")
60
97
  + "\",\n \"output\": \""
61
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "output", { "start": { "line": 19, "column": 17 }, "end": { "line": 19, "column": 29 } }), depth0)) != null ? stack1 : "")
98
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "output", { "start": { "line": 43, "column": 17 }, "end": { "line": 43, "column": 29 } }), depth0)) != null ? stack1 : "")
62
99
  + "\",\n \"httpClient\": \""
63
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "httpClient", { "start": { "line": 20, "column": 21 }, "end": { "line": 20, "column": 37 } }), depth0)) != null ? stack1 : "")
100
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "httpClient", { "start": { "line": 44, "column": 21 }, "end": { "line": 44, "column": 37 } }), depth0)) != null ? stack1 : "")
64
101
  + "\",\n \"sortByRequired\": "
65
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "sortByRequired", { "start": { "line": 21, "column": 24 }, "end": { "line": 21, "column": 44 } }), depth0)) != null ? stack1 : "")
102
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "sortByRequired", { "start": { "line": 45, "column": 24 }, "end": { "line": 45, "column": 44 } }), depth0)) != null ? stack1 : "")
66
103
  + ",\n \"enumPrefix\": \""
67
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "enumPrefix", { "start": { "line": 22, "column": 21 }, "end": { "line": 22, "column": 37 } }), depth0)) != null ? stack1 : "")
104
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "enumPrefix", { "start": { "line": 46, "column": 21 }, "end": { "line": 46, "column": 37 } }), depth0)) != null ? stack1 : "")
68
105
  + "\",\n \"excludeCoreServiceFiles\": "
69
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "excludeCoreServiceFiles", { "start": { "line": 23, "column": 33 }, "end": { "line": 23, "column": 62 } }), depth0)) != null ? stack1 : "")
106
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "excludeCoreServiceFiles", { "start": { "line": 47, "column": 33 }, "end": { "line": 47, "column": 62 } }), depth0)) != null ? stack1 : "")
70
107
  + ",\n \"interfacePrefix\": \""
71
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "interfacePrefix", { "start": { "line": 24, "column": 26 }, "end": { "line": 24, "column": 47 } }), depth0)) != null ? stack1 : "")
108
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "interfacePrefix", { "start": { "line": 48, "column": 26 }, "end": { "line": 48, "column": 47 } }), depth0)) != null ? stack1 : "")
72
109
  + "\",\n \"typePrefix\": \""
73
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "typePrefix", { "start": { "line": 25, "column": 21 }, "end": { "line": 25, "column": 37 } }), depth0)) != null ? stack1 : "")
110
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "typePrefix", { "start": { "line": 49, "column": 21 }, "end": { "line": 49, "column": 37 } }), depth0)) != null ? stack1 : "")
74
111
  + "\",\n \"useCancelableRequest\": "
75
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useCancelableRequest", { "start": { "line": 26, "column": 30 }, "end": { "line": 26, "column": 56 } }), depth0)) != null ? stack1 : "")
112
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useCancelableRequest", { "start": { "line": 50, "column": 30 }, "end": { "line": 50, "column": 56 } }), depth0)) != null ? stack1 : "")
76
113
  + ",\n \"useOptions\": "
77
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useOptions", { "start": { "line": 27, "column": 20 }, "end": { "line": 27, "column": 36 } }), depth0)) != null ? stack1 : "")
114
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useOptions", { "start": { "line": 51, "column": 20 }, "end": { "line": 51, "column": 36 } }), depth0)) != null ? stack1 : "")
78
115
  + ",\n \"useSeparatedIndexes\": "
79
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useSeparatedIndexes", { "start": { "line": 28, "column": 29 }, "end": { "line": 28, "column": 54 } }), depth0)) != null ? stack1 : "")
116
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useSeparatedIndexes", { "start": { "line": 52, "column": 29 }, "end": { "line": 52, "column": 54 } }), depth0)) != null ? stack1 : "")
80
117
  + ",\n \"useUnionTypes\": "
81
- + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useUnionTypes", { "start": { "line": 29, "column": 23 }, "end": { "line": 29, "column": 42 } }), depth0)) != null ? stack1 : "")
82
- + ",\n "
83
- + ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(data, "root"), "request"), { "name": "if", "hash": {}, "fn": container.program(2, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 30, "column": 4 }, "end": { "line": 30, "column": 62 } } })) != null ? stack1 : "")
84
- + "\n}\n";
118
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useUnionTypes", { "start": { "line": 53, "column": 23 }, "end": { "line": 53, "column": 42 } }), depth0)) != null ? stack1 : "")
119
+ + ","
120
+ + ((stack1 = lookupProperty(helpers, "if").call(alias3, lookupProperty(lookupProperty(data, "root"), "request"), { "name": "if", "hash": {}, "fn": container.program(7, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 53, "column": 45 }, "end": { "line": 54, "column": 41 } } })) != null ? stack1 : "")
121
+ + "\n \"modelsMode\": \""
122
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "modelsMode", { "start": { "line": 55, "column": 21 }, "end": { "line": 55, "column": 37 } }), depth0)) != null ? stack1 : "")
123
+ + "\",\n \"useHistory\": "
124
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useHistory", { "start": { "line": 56, "column": 20 }, "end": { "line": 56, "column": 36 } }), depth0)) != null ? stack1 : "")
125
+ + ",\n \"diffReport\": \""
126
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "diffReport", { "start": { "line": 57, "column": 21 }, "end": { "line": 57, "column": 37 } }), depth0)) != null ? stack1 : "")
127
+ + "\""
128
+ + ((stack1 = lookupProperty(helpers, "if").call(alias3, lookupProperty(lookupProperty(data, "root"), "request"), { "name": "if", "hash": {}, "fn": container.program(7, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 57, "column": 40 }, "end": { "line": 58, "column": 41 } } })) != null ? stack1 : "")
129
+ + ",\n \"models\": {\n \"mode\": \""
130
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "modelsMode", { "start": { "line": 60, "column": 19 }, "end": { "line": 60, "column": 35 } }), depth0)) != null ? stack1 : "")
131
+ + "\"\n },\n \"analyze\": {\n \"useHistory\": "
132
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useHistory", { "start": { "line": 63, "column": 24 }, "end": { "line": 63, "column": 40 } }), depth0)) != null ? stack1 : "")
133
+ + ",\n \"reportPath\": \""
134
+ + ((stack1 = alias2(alias1(lookupProperty(data, "root"), "diffReport", { "start": { "line": 64, "column": 25 }, "end": { "line": 64, "column": 41 } }), depth0)) != null ? stack1 : "")
135
+ + "\"\n },\n \"miracles\": {\n \"enabled\": true,\n \"confidence\": 1,\n \"types\": [\"RENAME\", \"TYPE_COERCION\"]\n }\n}\n";
85
136
  }, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
86
137
  var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
87
138
  if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
@@ -89,5 +140,5 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
89
140
  }
90
141
  return undefined;
91
142
  };
92
- return ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(data, "root"), "useMultyOptions"), { "name": "if", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.program(4, data, 0), "data": data, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 32, "column": 7 } } })) != null ? stack1 : "");
143
+ return ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(data, "root"), "items"), { "name": "if", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.program(9, data, 0), "data": data, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 72, "column": 7 } } })) != null ? stack1 : "");
93
144
  }, "useData": true };
@@ -14,5 +14,5 @@ exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, de
14
14
  return undefined;
15
15
  };
16
16
  return ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
17
- + "\nexport type ApiRequestOptions = {\n readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';\n readonly path: string;\n readonly cookies?: Record<string, any>;\n readonly headers?: Record<string, any>;\n readonly query?: Record<string, any>;\n readonly formData?: Record<string, any>;\n readonly body?: any;\n readonly mediaType?: string;\n readonly responseHeader?: string;\n // TODO TS2344: Redesign the logic for generating errors. Use the string value of the error code.\n // @ts-ignore\n readonly errors?: Record<number, string>;\n}\n";
17
+ + "\nexport type ApiRequestOptions = {\n readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';\n readonly path: string;\n readonly cookies?: Record<string, any>;\n readonly headers?: Record<string, any>;\n readonly query?: Record<string, any>;\n readonly formData?: Record<string, any>;\n readonly body?: any;\n readonly mediaType?: string;\n readonly responseHeader?: string;\n readonly responseType?: 'blob';\n // TODO TS2344: Redesign the logic for generating errors. Use the string value of the error code.\n // @ts-ignore\n readonly errors?: Record<number, string>;\n}\n";
18
18
  }, "usePartial": true, "useData": true };
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ compiler: (string | number)[];
3
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
4
+ usePartial: boolean;
5
+ useData: boolean;
6
+ };
7
+ export default _default;
8
+ //# sourceMappingURL=BaseDto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseDto.d.ts","sourceRoot":"","sources":["../../../../src/templatesCompiled/client/core/BaseDto.ts"],"names":[],"mappings":";;;;;;AAMA,wBAUmC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // This is an automatically generated file for the hbs template.
4
+ // You don't need to change it, run npm run build:hbs to update it.
5
+ /* istanbul ignore file */
6
+ /* tslint: disable */
7
+ /* eslint: disable */
8
+ // @ts-nocheck
9
+ exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
10
+ var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
11
+ if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
12
+ return parent[propertyName];
13
+ }
14
+ return undefined;
15
+ };
16
+ return ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
17
+ + "\nexport abstract class BaseDto<Raw> {\n protected readonly _raw: Raw;\n\n protected constructor(data: Raw) {\n this._raw = data;\n }\n\n public abstract toJSON(): Raw;\n\n public clone(): this {\n const ctor = this.constructor as new (data: Raw) => this;\n return new ctor(this.toJSON());\n }\n}\n";
18
+ }, "usePartial": true, "useData": true };
@@ -7,5 +7,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  /* eslint: disable */
8
8
  // @ts-nocheck
9
9
  exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
10
- return "function getResponseBody(response: AxiosResponse): any {\n try {\n const contentType = response.headers['content-type'];\n if (contentType) {\n const isJSON = typeof contentType === 'string' && contentType.toLowerCase().startsWith('application/json');\n\n if (isJSON && isString(response.data)) {\n return JSON.parse(response.data);\n } else {\n return response.data;\n }\n }\n } catch (error) {\n console.error(error);\n }\n return null;\n}\n";
10
+ return "function getResponseBody(response: AxiosResponse, options: ApiRequestOptions): any {\n try {\n if (options.responseType === 'blob') {\n return response.data;\n }\n const contentType = response.headers['content-type'];\n if (contentType) {\n const isJSON = typeof contentType === 'string' && contentType.toLowerCase().startsWith('application/json');\n\n if (isJSON && isString(response.data)) {\n return JSON.parse(response.data);\n } else {\n return response.data;\n }\n }\n } catch (error) {\n console.error(error);\n }\n return null;\n}\n";
11
11
  }, "useData": true };
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.default = { "1": function (container, depth0, helpers, partials, data) {
10
10
  return "import { CancelablePromise } from './CancelablePromise';\n";
11
11
  }, "3": function (container, depth0, helpers, partials, data) {
12
- return " export function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<ApiResult<T>> {\n return new CancelablePromise(async(resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n \n if (!onCancel.isCancelled) {\n const response = await sendRequest<T>(options, url, config, onCancel);\n const responseBody = getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n\nexport function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<T> {\n return new CancelablePromise(async(resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n \n if (!onCancel.isCancelled) {\n const response = await sendRequest<T>(options, url, config, onCancel);\n const responseBody = getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result.body);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n";
12
+ return " export function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<ApiResult<T>> {\n return new CancelablePromise(async(resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n \n if (!onCancel.isCancelled) {\n const response = await sendRequest<T>(options, url, config, onCancel);\n const responseBody = getResponseBody(response, options);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n\nexport function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<T> {\n return new CancelablePromise(async(resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n \n if (!onCancel.isCancelled) {\n const response = await sendRequest<T>(options, url, config, onCancel);\n const responseBody = getResponseBody(response, options);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result.body);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n";
13
13
  }, "5": function (container, depth0, helpers, partials, data) {
14
- return "export async function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<T> {\n const result = await requestRaw<T>(options, config);\n return result.body;\n}\n\nexport async function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<ApiResult<T>> {\n return new Promise(async (resolve, reject) => {\n try {\n const url = getUrl(options, config);\n const response = await sendRequest(options, url, config);\n const responseBody = getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n const result: ApiResult<T> = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n } catch (error) {\n reject(error);\n }\n });\n}\n";
14
+ return "export async function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<T> {\n const result = await requestRaw<T>(options, config);\n return result.body;\n}\n\nexport async function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<ApiResult<T>> {\n return new Promise(async (resolve, reject) => {\n try {\n const url = getUrl(options, config);\n const response = await sendRequest(options, url, config);\n const responseBody = getResponseBody(response, options);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n const result: ApiResult<T> = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n } catch (error) {\n reject(error);\n }\n });\n}\n";
15
15
  }, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
16
16
  var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
17
17
  if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
@@ -22,9 +22,9 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
22
22
  return undefined;
23
23
  };
24
24
  return ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCancelableRequest"), { "name": "if", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.program(3, data, 0), "data": data, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 6, "column": 7 } } })) != null ? stack1 : "")
25
- + " \n const requestConfig: AxiosRequestConfig = {\n method: options.method,\n headers: await getHeaders(options, config),\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n data: getRequestBody(options),\n url,\n"
26
- + ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCancelableRequest"), { "name": "if", "hash": {}, "fn": container.program(5, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 16, "column": 11 } } })) != null ? stack1 : "")
25
+ + " \n const requestConfig: AxiosRequestConfig = {\n method: options.method,\n headers: await getHeaders(options, config),\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n data: getRequestBody(options),\n url,\n responseType: options.responseType === 'blob' ? 'blob' : undefined,\n"
26
+ + ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCancelableRequest"), { "name": "if", "hash": {}, "fn": container.program(5, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 17, "column": 11 } } })) != null ? stack1 : "")
27
27
  + " };\n\n"
28
- + ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCancelableRequest"), { "name": "if", "hash": {}, "fn": container.program(7, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 19, "column": 2 }, "end": { "line": 21, "column": 9 } } })) != null ? stack1 : "")
29
- + "\n try {\n return await axios.request(requestConfig);\n } catch (error) {\n const axiosError = error as AxiosError<T>;\n if (axiosError.response) {\n return axiosError.response;\n }\n throw error;\n }\n}";
28
+ + ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCancelableRequest"), { "name": "if", "hash": {}, "fn": container.program(7, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 20, "column": 2 }, "end": { "line": 22, "column": 9 } } })) != null ? stack1 : "")
29
+ + "\n try {\n return await axios.request(requestConfig);\n } catch (error) {\n const axiosError = error as AxiosError<T>;\n if (axiosError.response) {\n return axiosError.response;\n }\n throw error;\n }\n}\n";
30
30
  }, "useData": true };
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ compiler: (string | number)[];
3
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
4
+ usePartial: boolean;
5
+ useData: boolean;
6
+ };
7
+ export default _default;
8
+ //# sourceMappingURL=dtoUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dtoUtils.d.ts","sourceRoot":"","sources":["../../../../src/templatesCompiled/client/core/dtoUtils.ts"],"names":[],"mappings":";;;;;;AAMA,wBAUmC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // This is an automatically generated file for the hbs template.
4
+ // You don't need to change it, run npm run build:hbs to update it.
5
+ /* istanbul ignore file */
6
+ /* tslint: disable */
7
+ /* eslint: disable */
8
+ // @ts-nocheck
9
+ exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
10
+ var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
11
+ if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
12
+ return parent[propertyName];
13
+ }
14
+ return undefined;
15
+ };
16
+ return ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
17
+ + "\nexport const fromArray = <T, R>(dtoClass: new (data: R) => T, data?: R[]): T[] => {\n if (!data || data.length === 0) {\n return [];\n }\n\n return data.map(item => new dtoClass(item));\n};\n";
18
+ }, "usePartial": true, "useData": true };
@@ -17,7 +17,7 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
17
17
  }, "9": function (container, depth0, helpers, partials, data) {
18
18
  return " requestRaw<TResponse>(config: RequestConfig, options?: TRequestOptions): Promise<ApiResult<TResponse>> {\n return __request(config, options) as Promise<ApiResult<TResponse>>;\n },\n request<TResponse>(config: RequestConfig, options?: TRequestOptions): Promise<TResponse> {\n return __request(config, options) as Promise<TResponse>;\n },\n";
19
19
  }, "11": function (container, depth0, helpers, partials, data) {
20
- return " requestRaw<TResponse>(config: RequestConfig, options?: TRequestOptions): Promise<ApiResult<TResponse>> {\n const baseOptions: ApiRequestOptions = {\n method: config.method as ApiRequestOptions['method'],\n path: config.path,\n headers: config.headers,\n query: config.query,\n body: config.body,\n cookies: config.cookies,\n mediaType: config.requestMediaType,\n };\n\n const mergedOptions: ApiRequestOptions = {\n ...baseOptions,\n ...(mapOptions ? mapOptions(options) : {}),\n };\n\n return __requestRaw<TResponse>(mergedOptions, openApiConfig);\n },\n request<TResponse>(config: RequestConfig, options?: TRequestOptions): Promise<TResponse> {\n const baseOptions: ApiRequestOptions = {\n method: config.method as ApiRequestOptions['method'],\n path: config.path,\n headers: config.headers,\n query: config.query,\n body: config.body,\n cookies: config.cookies,\n mediaType: config.requestMediaType,\n };\n\n const mergedOptions: ApiRequestOptions = {\n ...baseOptions,\n ...(mapOptions ? mapOptions(options) : {}),\n };\n\n return __request<TResponse>(mergedOptions, openApiConfig);\n },\n";
20
+ return " requestRaw<TResponse>(config: RequestConfig, options?: TRequestOptions): Promise<ApiResult<TResponse>> {\n const baseOptions: ApiRequestOptions = {\n method: config.method as ApiRequestOptions['method'],\n path: config.path,\n headers: config.headers,\n query: config.query,\n body: config.body,\n cookies: config.cookies,\n mediaType: config.requestMediaType,\n responseType: config.responseType,\n };\n\n const mergedOptions: ApiRequestOptions = {\n ...baseOptions,\n ...(mapOptions ? mapOptions(options) : {}),\n };\n\n return __requestRaw<TResponse>(mergedOptions, openApiConfig);\n },\n request<TResponse>(config: RequestConfig, options?: TRequestOptions): Promise<TResponse> {\n const baseOptions: ApiRequestOptions = {\n method: config.method as ApiRequestOptions['method'],\n path: config.path,\n headers: config.headers,\n query: config.query,\n body: config.body,\n cookies: config.cookies,\n mediaType: config.requestMediaType,\n responseType: config.responseType,\n };\n\n const mergedOptions: ApiRequestOptions = {\n ...baseOptions,\n ...(mapOptions ? mapOptions(options) : {}),\n };\n\n return __request<TResponse>(mergedOptions, openApiConfig);\n },\n";
21
21
  }, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
22
22
  var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
23
23
  if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
@@ -32,6 +32,6 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
32
32
  + "\nexport function createExecutorAdapter<TRequestOptions extends Record<string, any>>(\n"
33
33
  + ((stack1 = lookupProperty(helpers, "unless").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCustomRequest"), { "name": "unless", "hash": {}, "fn": container.program(7, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 20, "column": 11 } } })) != null ? stack1 : "")
34
34
  + "): RequestExecutor<TRequestOptions> {\n return {\n"
35
- + ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCustomRequest"), { "name": "if", "hash": {}, "fn": container.program(9, data, 0), "inverse": container.program(11, data, 0), "data": data, "loc": { "start": { "line": 23, "column": 8 }, "end": { "line": 67, "column": 15 } } })) != null ? stack1 : "")
35
+ + ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCustomRequest"), { "name": "if", "hash": {}, "fn": container.program(9, data, 0), "inverse": container.program(11, data, 0), "data": data, "loc": { "start": { "line": 23, "column": 8 }, "end": { "line": 69, "column": 15 } } })) != null ? stack1 : "")
36
36
  + " };\n}\n";
37
37
  }, "usePartial": true, "useData": true };
@@ -14,5 +14,5 @@ exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, de
14
14
  return undefined;
15
15
  };
16
16
  return ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
17
- + "\nimport type { ApiResult } from '../ApiResult';\n\nexport interface RequestConfig {\n method: string;\n path: string;\n\n headers?: Record<string, string>;\n query?: Record<string, any>;\n body?: unknown;\n\n requestMediaType?: string;\n cookies?: Record<string, string>;\n}\n\nexport interface RequestExecutor<TOptions = unknown> {\n request<TResponse>(\n config: RequestConfig,\n options?: TOptions\n ): Promise<TResponse>;\n\n requestRaw<TResponse>(\n config: RequestConfig,\n options?: TOptions\n ): Promise<ApiResult<TResponse>>;\n}\n";
17
+ + "\nimport type { ApiResult } from '../ApiResult';\n\nexport interface RequestConfig {\n method: string;\n path: string;\n\n headers?: Record<string, string>;\n query?: Record<string, any>;\n body?: unknown;\n\n requestMediaType?: string;\n responseType?: 'blob';\n cookies?: Record<string, string>;\n}\n\nexport interface RequestExecutor<TOptions = unknown> {\n request<TResponse>(\n config: RequestConfig,\n options?: TOptions\n ): Promise<TResponse>;\n\n requestRaw<TResponse>(\n config: RequestConfig,\n options?: TOptions\n ): Promise<ApiResult<TResponse>>;\n}\n";
18
18
  }, "usePartial": true, "useData": true };
@@ -7,5 +7,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  /* eslint: disable */
8
8
  // @ts-nocheck
9
9
  exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
10
- return "async function getResponseBody(response: Response): Promise<any> {\n try {\n const contentType = response.headers.get('Content-Type');\n if (contentType) {\n const isJSON = contentType.toLowerCase().startsWith('application/json');\n if (isJSON) {\n return await response.json();\n } else {\n return await response.text();\n }\n }\n } catch (error) {\n console.error(error);\n }\n return null;\n}\n";
10
+ return "async function getResponseBody(response: Response, options: ApiRequestOptions): Promise<any> {\n try {\n if (options.responseType === 'blob') {\n return await response.blob();\n }\n const contentType = response.headers.get('Content-Type');\n if (contentType) {\n const isJSON = contentType.toLowerCase().startsWith('application/json');\n if (isJSON) {\n return await response.json();\n } else {\n return await response.text();\n }\n }\n } catch (error) {\n console.error(error);\n }\n return null;\n}\n";
11
11
  }, "useData": true };
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.default = { "1": function (container, depth0, helpers, partials, data) {
10
10
  return "import { CancelablePromise } from './CancelablePromise';\n";
11
11
  }, "3": function (container, depth0, helpers, partials, data) {
12
- return "export function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<ApiResult<T>> {\n return new CancelablePromise(async(resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n catchErrors(options, result);\n resolve(result);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n\nexport function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<T> {\n return new CancelablePromise(async(resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n catchErrors(options, result);\n resolve(result.body);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n";
12
+ return "export function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<ApiResult<T>> {\n return new CancelablePromise(async(resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = await getResponseBody(response, options);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n catchErrors(options, result);\n resolve(result);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n\nexport function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<T> {\n return new CancelablePromise(async(resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = await getResponseBody(response, options);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n catchErrors(options, result);\n resolve(result.body);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n";
13
13
  }, "5": function (container, depth0, helpers, partials, data) {
14
- return "export async function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<T> {\n const result = await requestRaw<T>(options, config);\n return result.body;\n}\n\nexport async function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<ApiResult<T>> {\n return new Promise(async (resolve, reject) => {\n try {\n const url = getUrl(options, config);\n const response = await sendRequest(options, url, config);\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n } catch (error) {\n reject(error);\n }\n });\n}\n";
14
+ return "export async function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<T> {\n const result = await requestRaw<T>(options, config);\n return result.body;\n}\n\nexport async function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<ApiResult<T>> {\n return new Promise(async (resolve, reject) => {\n try {\n const url = getUrl(options, config);\n const response = await sendRequest(options, url, config);\n const responseBody = await getResponseBody(response, options);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n } catch (error) {\n reject(error);\n }\n });\n}\n";
15
15
  }, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
16
16
  var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
17
17
  if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
@@ -7,5 +7,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  /* eslint: disable */
8
8
  // @ts-nocheck
9
9
  exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
10
- return "function isBinary(value: any): value is Buffer | ArrayBuffer | ArrayBufferView {\n const isBuffer = Buffer.isBuffer(value);\n const isArrayBuffer = types.isArrayBuffer(value);\n const isArrayBufferView = types.isArrayBufferView(value);\n return isBuffer || isArrayBuffer || isArrayBufferView;\n}\n";
10
+ return "function isBinary(value: any): value is Buffer | ArrayBuffer | ArrayBufferView | Blob {\n const isBuffer = Buffer.isBuffer(value);\n const isArrayBuffer = types.isArrayBuffer(value);\n const isArrayBufferView = types.isArrayBufferView(value);\n const isBlob = typeof Blob !== 'undefined' && value instanceof Blob;\n return isBuffer || isArrayBuffer || isArrayBufferView || isBlob;\n}\n";
11
11
  }, "useData": true };
@@ -7,5 +7,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  /* eslint: disable */
8
8
  // @ts-nocheck
9
9
  exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
10
- return "async function getResponseBody(response: Response): Promise<any> {\n try {\n const contentType = response.headers.get('Content-Type');\n if (contentType) {\n const isJSON = contentType.toLowerCase().startsWith('application/json');\n if (isJSON) {\n return await response.json();\n } else {\n return await response.text();\n }\n }\n } catch (error) {\n console.error(error);\n }\n return null;\n}\n";
10
+ return "async function getResponseBody(response: Response, options: ApiRequestOptions): Promise<any> {\n try {\n if (options.responseType === 'blob') {\n return await response.blob();\n }\n const contentType = response.headers.get('Content-Type');\n if (contentType) {\n const isJSON = contentType.toLowerCase().startsWith('application/json');\n if (isJSON) {\n return await response.json();\n } else {\n return await response.text();\n }\n }\n } catch (error) {\n console.error(error);\n }\n return null;\n}\n";
11
11
  }, "useData": true };
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.default = { "1": function (container, depth0, helpers, partials, data) {
10
10
  return "import { CancelablePromise } from './CancelablePromise';\n";
11
11
  }, "3": function (container, depth0, helpers, partials, data) {
12
- return "export function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<ApiResult<T>> {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n\nexport function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<T> {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result.body);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n";
12
+ return "export function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<ApiResult<T>> {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = await getResponseBody(response, options);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n\nexport function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<T> {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = await getResponseBody(response, options);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result.body);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n";
13
13
  }, "5": function (container, depth0, helpers, partials, data) {
14
- return "export async function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<T> {\n const result = await requestRaw<T>(options, config);\n return result.body;\n}\n\nexport async function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<ApiResult<T>> {\n return new Promise(async (resolve, reject) => {\n try {\n const url = getUrl(options, config);\n const response = await sendRequest(options, url, config);\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n } catch (error) {\n reject(error);\n }\n });\n}\n";
14
+ return "export async function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<T> {\n const result = await requestRaw<T>(options, config);\n return result.body;\n}\n\nexport async function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<ApiResult<T>> {\n return new Promise(async (resolve, reject) => {\n try {\n const url = getUrl(options, config);\n const response = await sendRequest(options, url, config);\n const responseBody = await getResponseBody(response, options);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n } catch (error) {\n reject(error);\n }\n });\n}\n";
15
15
  }, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
16
16
  var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
17
17
  if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
@@ -7,5 +7,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  /* eslint: disable */
8
8
  // @ts-nocheck
9
9
  exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
10
- return "function getResponseBody(xhr: XMLHttpRequest): any {\n try {\n const contentType = xhr.getResponseHeader('Content-Type');\n if (contentType) {\n const isJSON = contentType.toLowerCase().startsWith('application/json');\n if (isJSON) {\n return JSON.parse(xhr.responseText);\n } else {\n return xhr.responseText;\n }\n }\n } catch (error) {\n console.error(error);\n }\n return null;\n}\n";
10
+ return "function getResponseBody(xhr: XMLHttpRequest, options: ApiRequestOptions): any {\n try {\n if (options.responseType === 'blob') {\n return xhr.response;\n }\n const contentType = xhr.getResponseHeader('Content-Type');\n if (contentType) {\n const isJSON = contentType.toLowerCase().startsWith('application/json');\n if (isJSON) {\n return JSON.parse(xhr.responseText);\n } else {\n return xhr.responseText;\n }\n }\n } catch (error) {\n console.error(error);\n }\n return null;\n}\n";
11
11
  }, "useData": true };
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.default = { "1": function (container, depth0, helpers, partials, data) {
10
10
  return "import { CancelablePromise } from './CancelablePromise';\n";
11
11
  }, "3": function (container, depth0, helpers, partials, data) {
12
- return "export function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<ApiResult<T>> {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n\nexport function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<T> {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result.body);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n";
12
+ return "export function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<ApiResult<T>> {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = getResponseBody(response, options);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n\nexport function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<T> {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = getResponseBody(response, options);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result.body);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n";
13
13
  }, "5": function (container, depth0, helpers, partials, data) {
14
- return "export async function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<T> {\n const result = await requestRaw<T>(options, config);\n return result.body;\n}\n\nexport async function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<ApiResult<T>> {\n return new Promise(async (resolve, reject) => {\n try {\n const url = getUrl(options, config);\n const response = await sendRequest(options, url, config);\n const responseBody = getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n const result: ApiResult<T> = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n } catch (error) {\n reject(error);\n }\n });\n}\n";
14
+ return "export async function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<T> {\n const result = await requestRaw<T>(options, config);\n return result.body;\n}\n\nexport async function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<ApiResult<T>> {\n return new Promise(async (resolve, reject) => {\n try {\n const url = getUrl(options, config);\n const response = await sendRequest(options, url, config);\n const responseBody = getResponseBody(response, options);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n const result: ApiResult<T> = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n } catch (error) {\n reject(error);\n }\n });\n}\n";
15
15
  }, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
16
16
  var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
17
17
  if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {