@typia/utils 12.0.0-dev.20260225

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 (471) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +79 -0
  3. package/lib/converters/LlmSchemaConverter.d.ts +102 -0
  4. package/lib/converters/LlmSchemaConverter.js +652 -0
  5. package/lib/converters/LlmSchemaConverter.js.map +1 -0
  6. package/lib/converters/LlmSchemaConverter.mjs +771 -0
  7. package/lib/converters/LlmSchemaConverter.mjs.map +1 -0
  8. package/lib/converters/OpenApiConverter.d.ts +135 -0
  9. package/lib/converters/OpenApiConverter.js +130 -0
  10. package/lib/converters/OpenApiConverter.js.map +1 -0
  11. package/lib/converters/OpenApiConverter.mjs +128 -0
  12. package/lib/converters/OpenApiConverter.mjs.map +1 -0
  13. package/lib/converters/index.d.ts +2 -0
  14. package/lib/converters/index.js +21 -0
  15. package/lib/converters/index.js.map +1 -0
  16. package/lib/converters/index.mjs +4 -0
  17. package/lib/converters/index.mjs.map +1 -0
  18. package/lib/converters/internal/LlmDescriptionInverter.d.ts +6 -0
  19. package/lib/converters/internal/LlmDescriptionInverter.js +141 -0
  20. package/lib/converters/internal/LlmDescriptionInverter.js.map +1 -0
  21. package/lib/converters/internal/LlmDescriptionInverter.mjs +141 -0
  22. package/lib/converters/internal/LlmDescriptionInverter.mjs.map +1 -0
  23. package/lib/converters/internal/LlmParametersComposer.d.ts +1 -0
  24. package/lib/converters/internal/LlmParametersComposer.js +39 -0
  25. package/lib/converters/internal/LlmParametersComposer.js.map +1 -0
  26. package/lib/converters/internal/LlmParametersComposer.mjs +42 -0
  27. package/lib/converters/internal/LlmParametersComposer.mjs.map +1 -0
  28. package/lib/converters/internal/OpenApiConstraintShifter.d.ts +6 -0
  29. package/lib/converters/internal/OpenApiConstraintShifter.js +103 -0
  30. package/lib/converters/internal/OpenApiConstraintShifter.js.map +1 -0
  31. package/lib/converters/internal/OpenApiConstraintShifter.mjs +102 -0
  32. package/lib/converters/internal/OpenApiConstraintShifter.mjs.map +1 -0
  33. package/lib/converters/internal/OpenApiExclusiveEmender.d.ts +4 -0
  34. package/lib/converters/internal/OpenApiExclusiveEmender.js +32 -0
  35. package/lib/converters/internal/OpenApiExclusiveEmender.js.map +1 -0
  36. package/lib/converters/internal/OpenApiExclusiveEmender.mjs +35 -0
  37. package/lib/converters/internal/OpenApiExclusiveEmender.mjs.map +1 -0
  38. package/lib/converters/internal/OpenApiV3Downgrader.d.ts +10 -0
  39. package/lib/converters/internal/OpenApiV3Downgrader.js +214 -0
  40. package/lib/converters/internal/OpenApiV3Downgrader.js.map +1 -0
  41. package/lib/converters/internal/OpenApiV3Downgrader.mjs +279 -0
  42. package/lib/converters/internal/OpenApiV3Downgrader.mjs.map +1 -0
  43. package/lib/converters/internal/OpenApiV3Upgrader.d.ts +6 -0
  44. package/lib/converters/internal/OpenApiV3Upgrader.js +285 -0
  45. package/lib/converters/internal/OpenApiV3Upgrader.js.map +1 -0
  46. package/lib/converters/internal/OpenApiV3Upgrader.mjs +349 -0
  47. package/lib/converters/internal/OpenApiV3Upgrader.mjs.map +1 -0
  48. package/lib/converters/internal/OpenApiV3_1Upgrader.d.ts +6 -0
  49. package/lib/converters/internal/OpenApiV3_1Upgrader.js +405 -0
  50. package/lib/converters/internal/OpenApiV3_1Upgrader.js.map +1 -0
  51. package/lib/converters/internal/OpenApiV3_1Upgrader.mjs +545 -0
  52. package/lib/converters/internal/OpenApiV3_1Upgrader.mjs.map +1 -0
  53. package/lib/converters/internal/SwaggerV2Downgrader.d.ts +10 -0
  54. package/lib/converters/internal/SwaggerV2Downgrader.js +294 -0
  55. package/lib/converters/internal/SwaggerV2Downgrader.js.map +1 -0
  56. package/lib/converters/internal/SwaggerV2Downgrader.mjs +332 -0
  57. package/lib/converters/internal/SwaggerV2Downgrader.mjs.map +1 -0
  58. package/lib/converters/internal/SwaggerV2Upgrader.d.ts +6 -0
  59. package/lib/converters/internal/SwaggerV2Upgrader.js +357 -0
  60. package/lib/converters/internal/SwaggerV2Upgrader.js.map +1 -0
  61. package/lib/converters/internal/SwaggerV2Upgrader.mjs +403 -0
  62. package/lib/converters/internal/SwaggerV2Upgrader.mjs.map +1 -0
  63. package/lib/http/HttpError.d.ts +61 -0
  64. package/lib/http/HttpError.js +70 -0
  65. package/lib/http/HttpError.js.map +1 -0
  66. package/lib/http/HttpError.mjs +76 -0
  67. package/lib/http/HttpError.mjs.map +1 -0
  68. package/lib/http/HttpLlm.d.ts +130 -0
  69. package/lib/http/HttpLlm.js +124 -0
  70. package/lib/http/HttpLlm.js.map +1 -0
  71. package/lib/http/HttpLlm.mjs +123 -0
  72. package/lib/http/HttpLlm.mjs.map +1 -0
  73. package/lib/http/HttpMigration.d.ts +58 -0
  74. package/lib/http/HttpMigration.js +52 -0
  75. package/lib/http/HttpMigration.js.map +1 -0
  76. package/lib/http/HttpMigration.mjs +52 -0
  77. package/lib/http/HttpMigration.mjs.map +1 -0
  78. package/lib/http/index.d.ts +3 -0
  79. package/lib/http/index.js +20 -0
  80. package/lib/http/index.js.map +1 -0
  81. package/lib/http/index.mjs +4 -0
  82. package/lib/http/index.mjs.map +1 -0
  83. package/lib/http/internal/HttpLlmApplicationComposer.d.ts +8 -0
  84. package/lib/http/internal/HttpLlmApplicationComposer.js +254 -0
  85. package/lib/http/internal/HttpLlmApplicationComposer.js.map +1 -0
  86. package/lib/http/internal/HttpLlmApplicationComposer.mjs +256 -0
  87. package/lib/http/internal/HttpLlmApplicationComposer.mjs.map +1 -0
  88. package/lib/http/internal/HttpLlmFunctionFetcher.d.ts +6 -0
  89. package/lib/http/internal/HttpLlmFunctionFetcher.js +24 -0
  90. package/lib/http/internal/HttpLlmFunctionFetcher.js.map +1 -0
  91. package/lib/http/internal/HttpLlmFunctionFetcher.mjs +24 -0
  92. package/lib/http/internal/HttpLlmFunctionFetcher.mjs.map +1 -0
  93. package/lib/http/internal/HttpMigrateApplicationComposer.d.ts +4 -0
  94. package/lib/http/internal/HttpMigrateApplicationComposer.js +45 -0
  95. package/lib/http/internal/HttpMigrateApplicationComposer.js.map +1 -0
  96. package/lib/http/internal/HttpMigrateApplicationComposer.mjs +47 -0
  97. package/lib/http/internal/HttpMigrateApplicationComposer.mjs.map +1 -0
  98. package/lib/http/internal/HttpMigrateRouteAccessor.d.ts +4 -0
  99. package/lib/http/internal/HttpMigrateRouteAccessor.js +107 -0
  100. package/lib/http/internal/HttpMigrateRouteAccessor.js.map +1 -0
  101. package/lib/http/internal/HttpMigrateRouteAccessor.mjs +106 -0
  102. package/lib/http/internal/HttpMigrateRouteAccessor.mjs.map +1 -0
  103. package/lib/http/internal/HttpMigrateRouteComposer.d.ts +11 -0
  104. package/lib/http/internal/HttpMigrateRouteComposer.js +398 -0
  105. package/lib/http/internal/HttpMigrateRouteComposer.js.map +1 -0
  106. package/lib/http/internal/HttpMigrateRouteComposer.mjs +392 -0
  107. package/lib/http/internal/HttpMigrateRouteComposer.mjs.map +1 -0
  108. package/lib/http/internal/HttpMigrateRouteFetcher.d.ts +6 -0
  109. package/lib/http/internal/HttpMigrateRouteFetcher.js +179 -0
  110. package/lib/http/internal/HttpMigrateRouteFetcher.js.map +1 -0
  111. package/lib/http/internal/HttpMigrateRouteFetcher.mjs +174 -0
  112. package/lib/http/internal/HttpMigrateRouteFetcher.mjs.map +1 -0
  113. package/lib/http/internal/LlmDataMerger.d.ts +48 -0
  114. package/lib/http/internal/LlmDataMerger.js +60 -0
  115. package/lib/http/internal/LlmDataMerger.js.map +1 -0
  116. package/lib/http/internal/LlmDataMerger.mjs +59 -0
  117. package/lib/http/internal/LlmDataMerger.mjs.map +1 -0
  118. package/lib/index.d.ts +4 -0
  119. package/lib/index.js +21 -0
  120. package/lib/index.js.map +1 -0
  121. package/lib/index.mjs +20 -0
  122. package/lib/index.mjs.map +1 -0
  123. package/lib/utils/ArrayUtil.d.ts +1 -0
  124. package/lib/utils/ArrayUtil.js +29 -0
  125. package/lib/utils/ArrayUtil.js.map +1 -0
  126. package/lib/utils/ArrayUtil.mjs +28 -0
  127. package/lib/utils/ArrayUtil.mjs.map +1 -0
  128. package/lib/utils/MapUtil.d.ts +1 -0
  129. package/lib/utils/MapUtil.js +16 -0
  130. package/lib/utils/MapUtil.js.map +1 -0
  131. package/lib/utils/MapUtil.mjs +15 -0
  132. package/lib/utils/MapUtil.mjs.map +1 -0
  133. package/lib/utils/NamingConvention.d.ts +68 -0
  134. package/lib/utils/NamingConvention.js +199 -0
  135. package/lib/utils/NamingConvention.js.map +1 -0
  136. package/lib/utils/NamingConvention.mjs +198 -0
  137. package/lib/utils/NamingConvention.mjs.map +1 -0
  138. package/lib/utils/Singleton.d.ts +1 -0
  139. package/lib/utils/Singleton.js +18 -0
  140. package/lib/utils/Singleton.js.map +1 -0
  141. package/lib/utils/Singleton.mjs +18 -0
  142. package/lib/utils/Singleton.mjs.map +1 -0
  143. package/lib/utils/StringUtil.d.ts +1 -0
  144. package/lib/utils/StringUtil.js +17 -0
  145. package/lib/utils/StringUtil.js.map +1 -0
  146. package/lib/utils/StringUtil.mjs +13 -0
  147. package/lib/utils/StringUtil.mjs.map +1 -0
  148. package/lib/utils/dedent.d.ts +12 -0
  149. package/lib/utils/dedent.js +51 -0
  150. package/lib/utils/dedent.js.map +1 -0
  151. package/lib/utils/dedent.mjs +50 -0
  152. package/lib/utils/dedent.mjs.map +1 -0
  153. package/lib/utils/index.d.ts +7 -0
  154. package/lib/utils/index.js +24 -0
  155. package/lib/utils/index.js.map +1 -0
  156. package/lib/utils/index.mjs +8 -0
  157. package/lib/utils/index.mjs.map +1 -0
  158. package/lib/utils/internal/EndpointUtil.d.ts +8 -0
  159. package/lib/utils/internal/EndpointUtil.js +37 -0
  160. package/lib/utils/internal/EndpointUtil.js.map +1 -0
  161. package/lib/utils/internal/EndpointUtil.mjs +37 -0
  162. package/lib/utils/internal/EndpointUtil.mjs.map +1 -0
  163. package/lib/utils/internal/JsonDescriptor.d.ts +10 -0
  164. package/lib/utils/internal/JsonDescriptor.js +58 -0
  165. package/lib/utils/internal/JsonDescriptor.js.map +1 -0
  166. package/lib/utils/internal/JsonDescriptor.mjs +48 -0
  167. package/lib/utils/internal/JsonDescriptor.mjs.map +1 -0
  168. package/lib/utils/internal/OpenApiTypeCheckerBase.d.ts +1 -0
  169. package/lib/utils/internal/OpenApiTypeCheckerBase.js +520 -0
  170. package/lib/utils/internal/OpenApiTypeCheckerBase.js.map +1 -0
  171. package/lib/utils/internal/OpenApiTypeCheckerBase.mjs +584 -0
  172. package/lib/utils/internal/OpenApiTypeCheckerBase.mjs.map +1 -0
  173. package/lib/utils/stringifyValidationFailure.d.ts +25 -0
  174. package/lib/utils/stringifyValidationFailure.js +326 -0
  175. package/lib/utils/stringifyValidationFailure.js.map +1 -0
  176. package/lib/utils/stringifyValidationFailure.mjs +325 -0
  177. package/lib/utils/stringifyValidationFailure.mjs.map +1 -0
  178. package/lib/validators/LlmTypeChecker.d.ts +117 -0
  179. package/lib/validators/LlmTypeChecker.js +309 -0
  180. package/lib/validators/LlmTypeChecker.js.map +1 -0
  181. package/lib/validators/LlmTypeChecker.mjs +300 -0
  182. package/lib/validators/LlmTypeChecker.mjs.map +1 -0
  183. package/lib/validators/OpenApiTypeChecker.d.ts +211 -0
  184. package/lib/validators/OpenApiTypeChecker.js +207 -0
  185. package/lib/validators/OpenApiTypeChecker.js.map +1 -0
  186. package/lib/validators/OpenApiTypeChecker.mjs +218 -0
  187. package/lib/validators/OpenApiTypeChecker.mjs.map +1 -0
  188. package/lib/validators/OpenApiV3TypeChecker.d.ts +26 -0
  189. package/lib/validators/OpenApiV3TypeChecker.js +30 -0
  190. package/lib/validators/OpenApiV3TypeChecker.js.map +1 -0
  191. package/lib/validators/OpenApiV3TypeChecker.mjs +29 -0
  192. package/lib/validators/OpenApiV3TypeChecker.mjs.map +1 -0
  193. package/lib/validators/OpenApiV3_1TypeChecker.d.ts +29 -0
  194. package/lib/validators/OpenApiV3_1TypeChecker.js +34 -0
  195. package/lib/validators/OpenApiV3_1TypeChecker.js.map +1 -0
  196. package/lib/validators/OpenApiV3_1TypeChecker.mjs +33 -0
  197. package/lib/validators/OpenApiV3_1TypeChecker.mjs.map +1 -0
  198. package/lib/validators/OpenApiValidator.d.ts +36 -0
  199. package/lib/validators/OpenApiValidator.js +71 -0
  200. package/lib/validators/OpenApiValidator.js.map +1 -0
  201. package/lib/validators/OpenApiValidator.mjs +75 -0
  202. package/lib/validators/OpenApiValidator.mjs.map +1 -0
  203. package/lib/validators/SwaggerV2TypeChecker.d.ts +27 -0
  204. package/lib/validators/SwaggerV2TypeChecker.js +31 -0
  205. package/lib/validators/SwaggerV2TypeChecker.js.map +1 -0
  206. package/lib/validators/SwaggerV2TypeChecker.mjs +30 -0
  207. package/lib/validators/SwaggerV2TypeChecker.mjs.map +1 -0
  208. package/lib/validators/functional/_isBigintString.d.ts +1 -0
  209. package/lib/validators/functional/_isBigintString.js +14 -0
  210. package/lib/validators/functional/_isBigintString.js.map +1 -0
  211. package/lib/validators/functional/_isBigintString.mjs +12 -0
  212. package/lib/validators/functional/_isBigintString.mjs.map +1 -0
  213. package/lib/validators/functional/_isFormatByte.d.ts +1 -0
  214. package/lib/validators/functional/_isFormatByte.js +10 -0
  215. package/lib/validators/functional/_isFormatByte.js.map +1 -0
  216. package/lib/validators/functional/_isFormatByte.mjs +8 -0
  217. package/lib/validators/functional/_isFormatByte.mjs.map +1 -0
  218. package/lib/validators/functional/_isFormatDate.d.ts +1 -0
  219. package/lib/validators/functional/_isFormatDate.js +7 -0
  220. package/lib/validators/functional/_isFormatDate.js.map +1 -0
  221. package/lib/validators/functional/_isFormatDate.mjs +5 -0
  222. package/lib/validators/functional/_isFormatDate.mjs.map +1 -0
  223. package/lib/validators/functional/_isFormatDateTime.d.ts +1 -0
  224. package/lib/validators/functional/_isFormatDateTime.js +7 -0
  225. package/lib/validators/functional/_isFormatDateTime.js.map +1 -0
  226. package/lib/validators/functional/_isFormatDateTime.mjs +5 -0
  227. package/lib/validators/functional/_isFormatDateTime.mjs.map +1 -0
  228. package/lib/validators/functional/_isFormatDuration.d.ts +1 -0
  229. package/lib/validators/functional/_isFormatDuration.js +7 -0
  230. package/lib/validators/functional/_isFormatDuration.js.map +1 -0
  231. package/lib/validators/functional/_isFormatDuration.mjs +5 -0
  232. package/lib/validators/functional/_isFormatDuration.mjs.map +1 -0
  233. package/lib/validators/functional/_isFormatEmail.d.ts +1 -0
  234. package/lib/validators/functional/_isFormatEmail.js +7 -0
  235. package/lib/validators/functional/_isFormatEmail.js.map +1 -0
  236. package/lib/validators/functional/_isFormatEmail.mjs +5 -0
  237. package/lib/validators/functional/_isFormatEmail.mjs.map +1 -0
  238. package/lib/validators/functional/_isFormatHostname.d.ts +1 -0
  239. package/lib/validators/functional/_isFormatHostname.js +7 -0
  240. package/lib/validators/functional/_isFormatHostname.js.map +1 -0
  241. package/lib/validators/functional/_isFormatHostname.mjs +5 -0
  242. package/lib/validators/functional/_isFormatHostname.mjs.map +1 -0
  243. package/lib/validators/functional/_isFormatIdnEmail.d.ts +1 -0
  244. package/lib/validators/functional/_isFormatIdnEmail.js +7 -0
  245. package/lib/validators/functional/_isFormatIdnEmail.js.map +1 -0
  246. package/lib/validators/functional/_isFormatIdnEmail.mjs +5 -0
  247. package/lib/validators/functional/_isFormatIdnEmail.mjs.map +1 -0
  248. package/lib/validators/functional/_isFormatIdnHostname.d.ts +1 -0
  249. package/lib/validators/functional/_isFormatIdnHostname.js +7 -0
  250. package/lib/validators/functional/_isFormatIdnHostname.js.map +1 -0
  251. package/lib/validators/functional/_isFormatIdnHostname.mjs +5 -0
  252. package/lib/validators/functional/_isFormatIdnHostname.mjs.map +1 -0
  253. package/lib/validators/functional/_isFormatIpv4.d.ts +1 -0
  254. package/lib/validators/functional/_isFormatIpv4.js +7 -0
  255. package/lib/validators/functional/_isFormatIpv4.js.map +1 -0
  256. package/lib/validators/functional/_isFormatIpv4.mjs +5 -0
  257. package/lib/validators/functional/_isFormatIpv4.mjs.map +1 -0
  258. package/lib/validators/functional/_isFormatIpv6.d.ts +1 -0
  259. package/lib/validators/functional/_isFormatIpv6.js +7 -0
  260. package/lib/validators/functional/_isFormatIpv6.js.map +1 -0
  261. package/lib/validators/functional/_isFormatIpv6.mjs +5 -0
  262. package/lib/validators/functional/_isFormatIpv6.mjs.map +1 -0
  263. package/lib/validators/functional/_isFormatIri.d.ts +1 -0
  264. package/lib/validators/functional/_isFormatIri.js +7 -0
  265. package/lib/validators/functional/_isFormatIri.js.map +1 -0
  266. package/lib/validators/functional/_isFormatIri.mjs +5 -0
  267. package/lib/validators/functional/_isFormatIri.mjs.map +1 -0
  268. package/lib/validators/functional/_isFormatIriReference.d.ts +1 -0
  269. package/lib/validators/functional/_isFormatIriReference.js +7 -0
  270. package/lib/validators/functional/_isFormatIriReference.js.map +1 -0
  271. package/lib/validators/functional/_isFormatIriReference.mjs +5 -0
  272. package/lib/validators/functional/_isFormatIriReference.mjs.map +1 -0
  273. package/lib/validators/functional/_isFormatJsonPointer.d.ts +1 -0
  274. package/lib/validators/functional/_isFormatJsonPointer.js +7 -0
  275. package/lib/validators/functional/_isFormatJsonPointer.js.map +1 -0
  276. package/lib/validators/functional/_isFormatJsonPointer.mjs +5 -0
  277. package/lib/validators/functional/_isFormatJsonPointer.mjs.map +1 -0
  278. package/lib/validators/functional/_isFormatPassword.d.ts +1 -0
  279. package/lib/validators/functional/_isFormatPassword.js +6 -0
  280. package/lib/validators/functional/_isFormatPassword.js.map +1 -0
  281. package/lib/validators/functional/_isFormatPassword.mjs +4 -0
  282. package/lib/validators/functional/_isFormatPassword.mjs.map +1 -0
  283. package/lib/validators/functional/_isFormatRegex.d.ts +1 -0
  284. package/lib/validators/functional/_isFormatRegex.js +14 -0
  285. package/lib/validators/functional/_isFormatRegex.js.map +1 -0
  286. package/lib/validators/functional/_isFormatRegex.mjs +12 -0
  287. package/lib/validators/functional/_isFormatRegex.mjs.map +1 -0
  288. package/lib/validators/functional/_isFormatRelativeJsonPointer.d.ts +1 -0
  289. package/lib/validators/functional/_isFormatRelativeJsonPointer.js +7 -0
  290. package/lib/validators/functional/_isFormatRelativeJsonPointer.js.map +1 -0
  291. package/lib/validators/functional/_isFormatRelativeJsonPointer.mjs +5 -0
  292. package/lib/validators/functional/_isFormatRelativeJsonPointer.mjs.map +1 -0
  293. package/lib/validators/functional/_isFormatTime.d.ts +1 -0
  294. package/lib/validators/functional/_isFormatTime.js +7 -0
  295. package/lib/validators/functional/_isFormatTime.js.map +1 -0
  296. package/lib/validators/functional/_isFormatTime.mjs +5 -0
  297. package/lib/validators/functional/_isFormatTime.mjs.map +1 -0
  298. package/lib/validators/functional/_isFormatUri.d.ts +1 -0
  299. package/lib/validators/functional/_isFormatUri.js +8 -0
  300. package/lib/validators/functional/_isFormatUri.js.map +1 -0
  301. package/lib/validators/functional/_isFormatUri.mjs +6 -0
  302. package/lib/validators/functional/_isFormatUri.mjs.map +1 -0
  303. package/lib/validators/functional/_isFormatUriReference.d.ts +1 -0
  304. package/lib/validators/functional/_isFormatUriReference.js +7 -0
  305. package/lib/validators/functional/_isFormatUriReference.js.map +1 -0
  306. package/lib/validators/functional/_isFormatUriReference.mjs +5 -0
  307. package/lib/validators/functional/_isFormatUriReference.mjs.map +1 -0
  308. package/lib/validators/functional/_isFormatUriTemplate.d.ts +1 -0
  309. package/lib/validators/functional/_isFormatUriTemplate.js +7 -0
  310. package/lib/validators/functional/_isFormatUriTemplate.js.map +1 -0
  311. package/lib/validators/functional/_isFormatUriTemplate.mjs +5 -0
  312. package/lib/validators/functional/_isFormatUriTemplate.mjs.map +1 -0
  313. package/lib/validators/functional/_isFormatUrl.d.ts +1 -0
  314. package/lib/validators/functional/_isFormatUrl.js +7 -0
  315. package/lib/validators/functional/_isFormatUrl.js.map +1 -0
  316. package/lib/validators/functional/_isFormatUrl.mjs +5 -0
  317. package/lib/validators/functional/_isFormatUrl.mjs.map +1 -0
  318. package/lib/validators/functional/_isFormatUuid.d.ts +1 -0
  319. package/lib/validators/functional/_isFormatUuid.js +7 -0
  320. package/lib/validators/functional/_isFormatUuid.js.map +1 -0
  321. package/lib/validators/functional/_isFormatUuid.mjs +5 -0
  322. package/lib/validators/functional/_isFormatUuid.mjs.map +1 -0
  323. package/lib/validators/functional/_isUniqueItems.d.ts +1 -0
  324. package/lib/validators/functional/_isUniqueItems.js +140 -0
  325. package/lib/validators/functional/_isUniqueItems.js.map +1 -0
  326. package/lib/validators/functional/_isUniqueItems.mjs +138 -0
  327. package/lib/validators/functional/_isUniqueItems.mjs.map +1 -0
  328. package/lib/validators/index.d.ts +2 -0
  329. package/lib/validators/index.js +27 -0
  330. package/lib/validators/index.js.map +1 -0
  331. package/lib/validators/index.mjs +7 -0
  332. package/lib/validators/index.mjs.map +1 -0
  333. package/lib/validators/internal/IOpenApiValidatorContext.d.ts +14 -0
  334. package/lib/validators/internal/IOpenApiValidatorContext.js +3 -0
  335. package/lib/validators/internal/IOpenApiValidatorContext.js.map +1 -0
  336. package/lib/validators/internal/IOpenApiValidatorContext.mjs +2 -0
  337. package/lib/validators/internal/IOpenApiValidatorContext.mjs.map +1 -0
  338. package/lib/validators/internal/OpenApiArrayValidator.d.ts +5 -0
  339. package/lib/validators/internal/OpenApiArrayValidator.js +32 -0
  340. package/lib/validators/internal/OpenApiArrayValidator.js.map +1 -0
  341. package/lib/validators/internal/OpenApiArrayValidator.mjs +47 -0
  342. package/lib/validators/internal/OpenApiArrayValidator.mjs.map +1 -0
  343. package/lib/validators/internal/OpenApiBooleanValidator.d.ts +5 -0
  344. package/lib/validators/internal/OpenApiBooleanValidator.js +10 -0
  345. package/lib/validators/internal/OpenApiBooleanValidator.js.map +1 -0
  346. package/lib/validators/internal/OpenApiBooleanValidator.mjs +9 -0
  347. package/lib/validators/internal/OpenApiBooleanValidator.mjs.map +1 -0
  348. package/lib/validators/internal/OpenApiConstantValidator.d.ts +5 -0
  349. package/lib/validators/internal/OpenApiConstantValidator.js +10 -0
  350. package/lib/validators/internal/OpenApiConstantValidator.js.map +1 -0
  351. package/lib/validators/internal/OpenApiConstantValidator.mjs +9 -0
  352. package/lib/validators/internal/OpenApiConstantValidator.mjs.map +1 -0
  353. package/lib/validators/internal/OpenApiIntegerValidator.d.ts +5 -0
  354. package/lib/validators/internal/OpenApiIntegerValidator.js +33 -0
  355. package/lib/validators/internal/OpenApiIntegerValidator.js.map +1 -0
  356. package/lib/validators/internal/OpenApiIntegerValidator.mjs +47 -0
  357. package/lib/validators/internal/OpenApiIntegerValidator.mjs.map +1 -0
  358. package/lib/validators/internal/OpenApiNumberValidator.d.ts +5 -0
  359. package/lib/validators/internal/OpenApiNumberValidator.js +33 -0
  360. package/lib/validators/internal/OpenApiNumberValidator.js.map +1 -0
  361. package/lib/validators/internal/OpenApiNumberValidator.mjs +47 -0
  362. package/lib/validators/internal/OpenApiNumberValidator.mjs.map +1 -0
  363. package/lib/validators/internal/OpenApiObjectValidator.d.ts +5 -0
  364. package/lib/validators/internal/OpenApiObjectValidator.js +58 -0
  365. package/lib/validators/internal/OpenApiObjectValidator.js.map +1 -0
  366. package/lib/validators/internal/OpenApiObjectValidator.mjs +68 -0
  367. package/lib/validators/internal/OpenApiObjectValidator.mjs.map +1 -0
  368. package/lib/validators/internal/OpenApiOneOfValidator.d.ts +5 -0
  369. package/lib/validators/internal/OpenApiOneOfValidator.js +182 -0
  370. package/lib/validators/internal/OpenApiOneOfValidator.js.map +1 -0
  371. package/lib/validators/internal/OpenApiOneOfValidator.mjs +206 -0
  372. package/lib/validators/internal/OpenApiOneOfValidator.mjs.map +1 -0
  373. package/lib/validators/internal/OpenApiSchemaNamingRule.d.ts +4 -0
  374. package/lib/validators/internal/OpenApiSchemaNamingRule.js +122 -0
  375. package/lib/validators/internal/OpenApiSchemaNamingRule.js.map +1 -0
  376. package/lib/validators/internal/OpenApiSchemaNamingRule.mjs +121 -0
  377. package/lib/validators/internal/OpenApiSchemaNamingRule.mjs.map +1 -0
  378. package/lib/validators/internal/OpenApiStationValidator.d.ts +5 -0
  379. package/lib/validators/internal/OpenApiStationValidator.js +63 -0
  380. package/lib/validators/internal/OpenApiStationValidator.js.map +1 -0
  381. package/lib/validators/internal/OpenApiStationValidator.mjs +107 -0
  382. package/lib/validators/internal/OpenApiStationValidator.mjs.map +1 -0
  383. package/lib/validators/internal/OpenApiStringValidator.d.ts +5 -0
  384. package/lib/validators/internal/OpenApiStringValidator.js +73 -0
  385. package/lib/validators/internal/OpenApiStringValidator.js.map +1 -0
  386. package/lib/validators/internal/OpenApiStringValidator.mjs +85 -0
  387. package/lib/validators/internal/OpenApiStringValidator.mjs.map +1 -0
  388. package/lib/validators/internal/OpenApiTupleValidator.d.ts +5 -0
  389. package/lib/validators/internal/OpenApiTupleValidator.js +31 -0
  390. package/lib/validators/internal/OpenApiTupleValidator.js.map +1 -0
  391. package/lib/validators/internal/OpenApiTupleValidator.mjs +46 -0
  392. package/lib/validators/internal/OpenApiTupleValidator.mjs.map +1 -0
  393. package/package.json +91 -0
  394. package/src/converters/LlmSchemaConverter.ts +924 -0
  395. package/src/converters/OpenApiConverter.ts +285 -0
  396. package/src/converters/index.ts +5 -0
  397. package/src/converters/internal/LlmDescriptionInverter.ts +178 -0
  398. package/src/converters/internal/LlmParametersComposer.ts +52 -0
  399. package/src/converters/internal/OpenApiConstraintShifter.ts +154 -0
  400. package/src/converters/internal/OpenApiExclusiveEmender.ts +46 -0
  401. package/src/converters/internal/OpenApiV3Downgrader.ts +355 -0
  402. package/src/converters/internal/OpenApiV3Upgrader.ts +470 -0
  403. package/src/converters/internal/OpenApiV3_1Upgrader.ts +685 -0
  404. package/src/converters/internal/SwaggerV2Downgrader.ts +424 -0
  405. package/src/converters/internal/SwaggerV2Upgrader.ts +523 -0
  406. package/src/http/HttpError.ts +107 -0
  407. package/src/http/HttpLlm.ts +210 -0
  408. package/src/http/HttpMigration.ts +92 -0
  409. package/src/http/index.ts +3 -0
  410. package/src/http/internal/HttpLlmApplicationComposer.ts +308 -0
  411. package/src/http/internal/HttpLlmFunctionFetcher.ts +37 -0
  412. package/src/http/internal/HttpMigrateApplicationComposer.ts +56 -0
  413. package/src/http/internal/HttpMigrateRouteAccessor.ts +135 -0
  414. package/src/http/internal/HttpMigrateRouteComposer.ts +513 -0
  415. package/src/http/internal/HttpMigrateRouteFetcher.ts +203 -0
  416. package/src/http/internal/LlmDataMerger.ts +73 -0
  417. package/src/index.ts +4 -0
  418. package/src/utils/ArrayUtil.ts +42 -0
  419. package/src/utils/MapUtil.ts +15 -0
  420. package/src/utils/NamingConvention.ts +205 -0
  421. package/src/utils/Singleton.ts +17 -0
  422. package/src/utils/StringUtil.ts +14 -0
  423. package/src/utils/dedent.ts +57 -0
  424. package/src/utils/index.ts +8 -0
  425. package/src/utils/internal/EndpointUtil.ts +44 -0
  426. package/src/utils/internal/JsonDescriptor.ts +70 -0
  427. package/src/utils/internal/OpenApiTypeCheckerBase.ts +822 -0
  428. package/src/utils/stringifyValidationFailure.ts +415 -0
  429. package/src/validators/LlmTypeChecker.ts +402 -0
  430. package/src/validators/OpenApiTypeChecker.ts +297 -0
  431. package/src/validators/OpenApiV3TypeChecker.ts +70 -0
  432. package/src/validators/OpenApiV3_1TypeChecker.ts +86 -0
  433. package/src/validators/OpenApiValidator.ts +94 -0
  434. package/src/validators/SwaggerV2TypeChecker.ts +71 -0
  435. package/src/validators/functional/_isBigintString.ts +8 -0
  436. package/src/validators/functional/_isFormatByte.ts +7 -0
  437. package/src/validators/functional/_isFormatDate.ts +3 -0
  438. package/src/validators/functional/_isFormatDateTime.ts +4 -0
  439. package/src/validators/functional/_isFormatDuration.ts +4 -0
  440. package/src/validators/functional/_isFormatEmail.ts +4 -0
  441. package/src/validators/functional/_isFormatHostname.ts +4 -0
  442. package/src/validators/functional/_isFormatIdnEmail.ts +4 -0
  443. package/src/validators/functional/_isFormatIdnHostname.ts +4 -0
  444. package/src/validators/functional/_isFormatIpv4.ts +4 -0
  445. package/src/validators/functional/_isFormatIpv6.ts +4 -0
  446. package/src/validators/functional/_isFormatIri.ts +3 -0
  447. package/src/validators/functional/_isFormatIriReference.ts +4 -0
  448. package/src/validators/functional/_isFormatJsonPointer.ts +3 -0
  449. package/src/validators/functional/_isFormatPassword.ts +1 -0
  450. package/src/validators/functional/_isFormatRegex.ts +8 -0
  451. package/src/validators/functional/_isFormatRelativeJsonPointer.ts +4 -0
  452. package/src/validators/functional/_isFormatTime.ts +4 -0
  453. package/src/validators/functional/_isFormatUri.ts +6 -0
  454. package/src/validators/functional/_isFormatUriReference.ts +5 -0
  455. package/src/validators/functional/_isFormatUriTemplate.ts +4 -0
  456. package/src/validators/functional/_isFormatUrl.ts +4 -0
  457. package/src/validators/functional/_isFormatUuid.ts +3 -0
  458. package/src/validators/functional/_isUniqueItems.ts +159 -0
  459. package/src/validators/index.ts +14 -0
  460. package/src/validators/internal/IOpenApiValidatorContext.ts +17 -0
  461. package/src/validators/internal/OpenApiArrayValidator.ts +49 -0
  462. package/src/validators/internal/OpenApiBooleanValidator.ts +11 -0
  463. package/src/validators/internal/OpenApiConstantValidator.ts +11 -0
  464. package/src/validators/internal/OpenApiIntegerValidator.ts +49 -0
  465. package/src/validators/internal/OpenApiNumberValidator.ts +48 -0
  466. package/src/validators/internal/OpenApiObjectValidator.ts +83 -0
  467. package/src/validators/internal/OpenApiOneOfValidator.ts +309 -0
  468. package/src/validators/internal/OpenApiSchemaNamingRule.ts +124 -0
  469. package/src/validators/internal/OpenApiStationValidator.ts +115 -0
  470. package/src/validators/internal/OpenApiStringValidator.ts +88 -0
  471. package/src/validators/internal/OpenApiTupleValidator.ts +55 -0
@@ -0,0 +1,207 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenApiTypeChecker = void 0;
4
+ const OpenApiTypeCheckerBase_1 = require("../utils/internal/OpenApiTypeCheckerBase");
5
+ /**
6
+ * Type checker for emended OpenAPI v3.1 JSON schemas.
7
+ *
8
+ * `OpenApiTypeChecker` provides type guard functions for
9
+ * {@link OpenApi.IJsonSchema} (typia's normalized OpenAPI format). Use these to
10
+ * narrow schema types before accessing type-specific properties.
11
+ *
12
+ * Type checkers:
13
+ *
14
+ * - Primitives: {@link isNull}, {@link isBoolean}, {@link isInteger},
15
+ * {@link isNumber}, {@link isString}
16
+ * - Constants: {@link isConstant}
17
+ * - Collections: {@link isArray}, {@link isTuple}, {@link isObject}
18
+ * - Composition: {@link isOneOf}, {@link isReference}
19
+ * - Special: {@link isUnknown}
20
+ *
21
+ * Also provides schema operations:
22
+ *
23
+ * - {@link visit}: Traverse and transform schemas recursively
24
+ * - {@link covers}: Check if one schema subsumes another
25
+ * - {@link escape}: Unwrap reference schemas
26
+ *
27
+ * For other OpenAPI versions, use {@link OpenApiV3TypeChecker},
28
+ * {@link OpenApiV3_1TypeChecker}, or {@link SwaggerV2TypeChecker}.
29
+ *
30
+ * @author Jeongho Nam - https://github.com/samchon
31
+ */
32
+ var OpenApiTypeChecker;
33
+ (function (OpenApiTypeChecker) {
34
+ /* -----------------------------------------------------------
35
+ TYPE CHECKERS
36
+ ----------------------------------------------------------- */
37
+ /**
38
+ * Test whether the schema is a nul type.
39
+ *
40
+ * @param schema Target schema
41
+ * @returns Whether null type or not
42
+ */
43
+ OpenApiTypeChecker.isNull = (schema) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.isNull(schema);
44
+ /**
45
+ * Test whether the schema is an unknown type.
46
+ *
47
+ * @param schema Target schema
48
+ * @returns Whether unknown type or not
49
+ */
50
+ OpenApiTypeChecker.isUnknown = (schema) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.isUnknown(schema);
51
+ /**
52
+ * Test whether the schema is a constant type.
53
+ *
54
+ * @param schema Target schema
55
+ * @returns Whether constant type or not
56
+ */
57
+ OpenApiTypeChecker.isConstant = (schema) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.isConstant(schema);
58
+ /**
59
+ * Test whether the schema is a boolean type.
60
+ *
61
+ * @param schema Target schema
62
+ * @returns Whether boolean type or not
63
+ */
64
+ OpenApiTypeChecker.isBoolean = (schema) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.isBoolean(schema);
65
+ /**
66
+ * Test whether the schema is an integer type.
67
+ *
68
+ * @param schema Target schema
69
+ * @returns Whether integer type or not
70
+ */
71
+ OpenApiTypeChecker.isInteger = (schema) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.isInteger(schema);
72
+ /**
73
+ * Test whether the schema is a number type.
74
+ *
75
+ * @param schema Target schema
76
+ * @returns Whether number type or not
77
+ */
78
+ OpenApiTypeChecker.isNumber = (schema) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.isNumber(schema);
79
+ /**
80
+ * Test whether the schema is a string type.
81
+ *
82
+ * @param schema Target schema
83
+ * @returns Whether string type or not
84
+ */
85
+ OpenApiTypeChecker.isString = (schema) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.isString(schema);
86
+ /**
87
+ * Test whether the schema is an array type.
88
+ *
89
+ * @param schema Target schema
90
+ * @returns Whether array type or not
91
+ */
92
+ OpenApiTypeChecker.isArray = (schema) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.isArray(schema);
93
+ /**
94
+ * Test whether the schema is a tuple type.
95
+ *
96
+ * @param schema Target schema
97
+ * @returns Whether tuple type or not
98
+ */
99
+ OpenApiTypeChecker.isTuple = (schema) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.isTuple(schema);
100
+ /**
101
+ * Test whether the schema is an object type.
102
+ *
103
+ * @param schema Target schema
104
+ * @returns Whether object type or not
105
+ */
106
+ OpenApiTypeChecker.isObject = (schema) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.isObject(schema);
107
+ /**
108
+ * Test whether the schema is a reference type.
109
+ *
110
+ * @param schema Target schema
111
+ * @returns Whether reference type or not
112
+ */
113
+ OpenApiTypeChecker.isReference = (schema) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.isReference(schema);
114
+ /**
115
+ * Test whether the schema is an union type.
116
+ *
117
+ * @param schema Target schema
118
+ * @returns Whether union type or not
119
+ */
120
+ OpenApiTypeChecker.isOneOf = (schema) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.isOneOf(schema);
121
+ /**
122
+ * Test whether the schema is recursive reference type.
123
+ *
124
+ * Test whether the target schema is a reference type, and test one thing more
125
+ * that the reference is self-recursive or not.
126
+ *
127
+ * @param props Properties for recursive reference test
128
+ * @returns Whether the schema is recursive reference type or not
129
+ */
130
+ OpenApiTypeChecker.isRecursiveReference = (props) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.isRecursiveReference({
131
+ prefix: "#/components/schemas/",
132
+ components: props.components,
133
+ schema: props.schema,
134
+ });
135
+ /* -----------------------------------------------------------
136
+ OPERATORS
137
+ ----------------------------------------------------------- */
138
+ /**
139
+ * Escape from the {@link OpenApi.IJsonSchema.IReference} type.
140
+ *
141
+ * Escape from the {@link OpenApi.IJsonSchema.IReference} type, replacing the
142
+ * every references to the actual schemas. If the escape is successful, the
143
+ * returned schema never contains any {@link OpenApi.IJsonSchema.IReference}
144
+ * type in its structure.
145
+ *
146
+ * If the schema has a recursive reference, the recursive reference would be
147
+ * repeated as much as the `props.recursive` depth. If you've configured the
148
+ * `props.recursive` as `false` or `0`, it would be failed and return an
149
+ * {@link IJsonSchemaTransformError}. Also, if there's a
150
+ * {@link OpenApi.IJsonSchema.IReference} type which cannot find the matched
151
+ * type in the {@link OpenApi.IComponents.schemas}, it would also be failed and
152
+ * return an {@link IJsonSchemaTransformError} either.
153
+ *
154
+ * @param props Properties for escaping
155
+ * @returns Escaped schema, or error with reason
156
+ */
157
+ OpenApiTypeChecker.escape = (props) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.escape(Object.assign(Object.assign({}, props), { prefix: "#/components/schemas/", method: "OpenApiTypeChecker.method" }));
158
+ /**
159
+ * Unreference the schema.
160
+ *
161
+ * Unreference the schema, replacing the {@link OpenApi.IJsonSchema.IReference}
162
+ * type to the actual schema. Different with {@link escape} is, the
163
+ * `unreference` function does not resolve every references in the schema, but
164
+ * resolve only one time.
165
+ *
166
+ * If there's a {@link OpenApi.IJsonSchema.IReference} type which cannot find
167
+ * the matched type in the {@link OpenApi.IComponents.schemas}, and you've
168
+ * called this `unreference()` function with the reference, it would also be
169
+ * failed and return an {@link IJsonSchemaTransformError} value.
170
+ *
171
+ * @param props Properties of unreference
172
+ * @returns Unreferenced schema
173
+ */
174
+ OpenApiTypeChecker.unreference = (props) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.unreference(Object.assign(Object.assign({}, props), { prefix: "#/components/schemas/", method: "OpenApiTypeChecker.unreference" }));
175
+ /**
176
+ * Visit every nested schemas.
177
+ *
178
+ * Visit every nested schemas of the target, and apply the `props.closure`
179
+ * function.
180
+ *
181
+ * Here is the list of occurring nested visitings:
182
+ *
183
+ * - {@link OpenApi.IJsonSchema.IOneOf.oneOf}
184
+ * - {@link OpenApi.IJsonSchema.IReference}
185
+ * - {@link OpenApi.IJsonSchema.IObject.properties}
186
+ * - {@link OpenApi.IJsonSchema.IObject.additionalProperties}
187
+ * - {@link OpenApi.IJsonSchema.IArray.items}
188
+ * - {@link OpenApi.IJsonSchema.ITuple.prefixItems}
189
+ * - {@link OpenApi.IJsonSchema.ITuple.additionalItems}
190
+ *
191
+ * @param props Properties for visiting
192
+ */
193
+ OpenApiTypeChecker.visit = (props) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.visit(Object.assign(Object.assign({}, props), { prefix: "#/components/schemas/" }));
194
+ /**
195
+ * Test whether the `x` schema covers the `y` schema.
196
+ *
197
+ * @param props Properties for testing
198
+ * @returns Whether the `x` schema covers the `y` schema
199
+ */
200
+ OpenApiTypeChecker.covers = (props) => OpenApiTypeCheckerBase_1.OpenApiTypeCheckerBase.covers({
201
+ prefix: "#/components/schemas/",
202
+ components: props.components,
203
+ x: props.x,
204
+ y: props.y,
205
+ });
206
+ })(OpenApiTypeChecker || (exports.OpenApiTypeChecker = OpenApiTypeChecker = {}));
207
+ //# sourceMappingURL=OpenApiTypeChecker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenApiTypeChecker.js","sourceRoot":"","sources":["../../src/validators/OpenApiTypeChecker.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,218 @@
1
+ import { OpenApiTypeCheckerBase } from '../utils/internal/OpenApiTypeCheckerBase.mjs';
2
+
3
+ /**
4
+ * Type checker for emended OpenAPI v3.1 JSON schemas.
5
+ *
6
+ * `OpenApiTypeChecker` provides type guard functions for
7
+ * {@link OpenApi.IJsonSchema} (typia's normalized OpenAPI format). Use these to
8
+ * narrow schema types before accessing type-specific properties.
9
+ *
10
+ * Type checkers:
11
+ *
12
+ * - Primitives: {@link isNull}, {@link isBoolean}, {@link isInteger},
13
+ * {@link isNumber}, {@link isString}
14
+ * - Constants: {@link isConstant}
15
+ * - Collections: {@link isArray}, {@link isTuple}, {@link isObject}
16
+ * - Composition: {@link isOneOf}, {@link isReference}
17
+ * - Special: {@link isUnknown}
18
+ *
19
+ * Also provides schema operations:
20
+ *
21
+ * - {@link visit}: Traverse and transform schemas recursively
22
+ * - {@link covers}: Check if one schema subsumes another
23
+ * - {@link escape}: Unwrap reference schemas
24
+ *
25
+ * For other OpenAPI versions, use {@link OpenApiV3TypeChecker},
26
+ * {@link OpenApiV3_1TypeChecker}, or {@link SwaggerV2TypeChecker}.
27
+ *
28
+ * @author Jeongho Nam - https://github.com/samchon
29
+ */
30
+ var OpenApiTypeChecker;
31
+ (function (OpenApiTypeChecker) {
32
+ /* -----------------------------------------------------------
33
+ TYPE CHECKERS
34
+ ----------------------------------------------------------- */
35
+ /**
36
+ * Test whether the schema is a nul type.
37
+ *
38
+ * @param schema Target schema
39
+ * @returns Whether null type or not
40
+ */
41
+ OpenApiTypeChecker.isNull = (schema) => OpenApiTypeCheckerBase.isNull(schema);
42
+ /**
43
+ * Test whether the schema is an unknown type.
44
+ *
45
+ * @param schema Target schema
46
+ * @returns Whether unknown type or not
47
+ */
48
+ OpenApiTypeChecker.isUnknown = (schema) => OpenApiTypeCheckerBase.isUnknown(schema);
49
+ /**
50
+ * Test whether the schema is a constant type.
51
+ *
52
+ * @param schema Target schema
53
+ * @returns Whether constant type or not
54
+ */
55
+ OpenApiTypeChecker.isConstant = (schema) => OpenApiTypeCheckerBase.isConstant(schema);
56
+ /**
57
+ * Test whether the schema is a boolean type.
58
+ *
59
+ * @param schema Target schema
60
+ * @returns Whether boolean type or not
61
+ */
62
+ OpenApiTypeChecker.isBoolean = (schema) => OpenApiTypeCheckerBase.isBoolean(schema);
63
+ /**
64
+ * Test whether the schema is an integer type.
65
+ *
66
+ * @param schema Target schema
67
+ * @returns Whether integer type or not
68
+ */
69
+ OpenApiTypeChecker.isInteger = (schema) => OpenApiTypeCheckerBase.isInteger(schema);
70
+ /**
71
+ * Test whether the schema is a number type.
72
+ *
73
+ * @param schema Target schema
74
+ * @returns Whether number type or not
75
+ */
76
+ OpenApiTypeChecker.isNumber = (schema) => OpenApiTypeCheckerBase.isNumber(schema);
77
+ /**
78
+ * Test whether the schema is a string type.
79
+ *
80
+ * @param schema Target schema
81
+ * @returns Whether string type or not
82
+ */
83
+ OpenApiTypeChecker.isString = (schema) => OpenApiTypeCheckerBase.isString(schema);
84
+ /**
85
+ * Test whether the schema is an array type.
86
+ *
87
+ * @param schema Target schema
88
+ * @returns Whether array type or not
89
+ */
90
+ OpenApiTypeChecker.isArray = (schema) => OpenApiTypeCheckerBase.isArray(schema);
91
+ /**
92
+ * Test whether the schema is a tuple type.
93
+ *
94
+ * @param schema Target schema
95
+ * @returns Whether tuple type or not
96
+ */
97
+ OpenApiTypeChecker.isTuple = (schema) => OpenApiTypeCheckerBase.isTuple(schema);
98
+ /**
99
+ * Test whether the schema is an object type.
100
+ *
101
+ * @param schema Target schema
102
+ * @returns Whether object type or not
103
+ */
104
+ OpenApiTypeChecker.isObject = (schema) => OpenApiTypeCheckerBase.isObject(schema);
105
+ /**
106
+ * Test whether the schema is a reference type.
107
+ *
108
+ * @param schema Target schema
109
+ * @returns Whether reference type or not
110
+ */
111
+ OpenApiTypeChecker.isReference = (schema) => OpenApiTypeCheckerBase.isReference(schema);
112
+ /**
113
+ * Test whether the schema is an union type.
114
+ *
115
+ * @param schema Target schema
116
+ * @returns Whether union type or not
117
+ */
118
+ OpenApiTypeChecker.isOneOf = (schema) => OpenApiTypeCheckerBase.isOneOf(schema);
119
+ /**
120
+ * Test whether the schema is recursive reference type.
121
+ *
122
+ * Test whether the target schema is a reference type, and test one thing more
123
+ * that the reference is self-recursive or not.
124
+ *
125
+ * @param props Properties for recursive reference test
126
+ * @returns Whether the schema is recursive reference type or not
127
+ */
128
+ OpenApiTypeChecker.isRecursiveReference = (props) => OpenApiTypeCheckerBase.isRecursiveReference({
129
+ prefix: "#/components/schemas/",
130
+ components: props.components,
131
+ schema: props.schema,
132
+ });
133
+ /* -----------------------------------------------------------
134
+ OPERATORS
135
+ ----------------------------------------------------------- */
136
+ /**
137
+ * Escape from the {@link OpenApi.IJsonSchema.IReference} type.
138
+ *
139
+ * Escape from the {@link OpenApi.IJsonSchema.IReference} type, replacing the
140
+ * every references to the actual schemas. If the escape is successful, the
141
+ * returned schema never contains any {@link OpenApi.IJsonSchema.IReference}
142
+ * type in its structure.
143
+ *
144
+ * If the schema has a recursive reference, the recursive reference would be
145
+ * repeated as much as the `props.recursive` depth. If you've configured the
146
+ * `props.recursive` as `false` or `0`, it would be failed and return an
147
+ * {@link IJsonSchemaTransformError}. Also, if there's a
148
+ * {@link OpenApi.IJsonSchema.IReference} type which cannot find the matched
149
+ * type in the {@link OpenApi.IComponents.schemas}, it would also be failed and
150
+ * return an {@link IJsonSchemaTransformError} either.
151
+ *
152
+ * @param props Properties for escaping
153
+ * @returns Escaped schema, or error with reason
154
+ */
155
+ OpenApiTypeChecker.escape = (props) => OpenApiTypeCheckerBase.escape({
156
+ ...props,
157
+ prefix: "#/components/schemas/",
158
+ method: "OpenApiTypeChecker.method",
159
+ });
160
+ /**
161
+ * Unreference the schema.
162
+ *
163
+ * Unreference the schema, replacing the {@link OpenApi.IJsonSchema.IReference}
164
+ * type to the actual schema. Different with {@link escape} is, the
165
+ * `unreference` function does not resolve every references in the schema, but
166
+ * resolve only one time.
167
+ *
168
+ * If there's a {@link OpenApi.IJsonSchema.IReference} type which cannot find
169
+ * the matched type in the {@link OpenApi.IComponents.schemas}, and you've
170
+ * called this `unreference()` function with the reference, it would also be
171
+ * failed and return an {@link IJsonSchemaTransformError} value.
172
+ *
173
+ * @param props Properties of unreference
174
+ * @returns Unreferenced schema
175
+ */
176
+ OpenApiTypeChecker.unreference = (props) => OpenApiTypeCheckerBase.unreference({
177
+ ...props,
178
+ prefix: "#/components/schemas/",
179
+ method: "OpenApiTypeChecker.unreference",
180
+ });
181
+ /**
182
+ * Visit every nested schemas.
183
+ *
184
+ * Visit every nested schemas of the target, and apply the `props.closure`
185
+ * function.
186
+ *
187
+ * Here is the list of occurring nested visitings:
188
+ *
189
+ * - {@link OpenApi.IJsonSchema.IOneOf.oneOf}
190
+ * - {@link OpenApi.IJsonSchema.IReference}
191
+ * - {@link OpenApi.IJsonSchema.IObject.properties}
192
+ * - {@link OpenApi.IJsonSchema.IObject.additionalProperties}
193
+ * - {@link OpenApi.IJsonSchema.IArray.items}
194
+ * - {@link OpenApi.IJsonSchema.ITuple.prefixItems}
195
+ * - {@link OpenApi.IJsonSchema.ITuple.additionalItems}
196
+ *
197
+ * @param props Properties for visiting
198
+ */
199
+ OpenApiTypeChecker.visit = (props) => OpenApiTypeCheckerBase.visit({
200
+ ...props,
201
+ prefix: "#/components/schemas/",
202
+ });
203
+ /**
204
+ * Test whether the `x` schema covers the `y` schema.
205
+ *
206
+ * @param props Properties for testing
207
+ * @returns Whether the `x` schema covers the `y` schema
208
+ */
209
+ OpenApiTypeChecker.covers = (props) => OpenApiTypeCheckerBase.covers({
210
+ prefix: "#/components/schemas/",
211
+ components: props.components,
212
+ x: props.x,
213
+ y: props.y,
214
+ });
215
+ })(OpenApiTypeChecker || (OpenApiTypeChecker = {}));
216
+
217
+ export { OpenApiTypeChecker };
218
+ //# sourceMappingURL=OpenApiTypeChecker.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenApiTypeChecker.mjs","sources":["../../src/validators/OpenApiTypeChecker.ts"],"sourcesContent":[null],"names":[],"mappings":"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"}
@@ -0,0 +1,26 @@
1
+ import { OpenApiV3 } from "@typia/interface";
2
+ /**
3
+ * Type checker for raw OpenAPI v3.0 JSON schemas.
4
+ *
5
+ * `OpenApiV3TypeChecker` provides type guard functions for
6
+ * {@link OpenApiV3.IJsonSchema} (raw, unemended format). For typia's normalized
7
+ * format, use {@link OpenApiTypeChecker} instead.
8
+ *
9
+ * Key differences from v3.1: v3.0 uses `nullable: true` property instead of
10
+ * union types, and has no `const` or tuple support.
11
+ *
12
+ * @author Jeongho Nam - https://github.com/samchon
13
+ */
14
+ export declare namespace OpenApiV3TypeChecker {
15
+ const isBoolean: (schema: OpenApiV3.IJsonSchema) => schema is OpenApiV3.IJsonSchema.IBoolean;
16
+ const isInteger: (schema: OpenApiV3.IJsonSchema) => schema is OpenApiV3.IJsonSchema.IInteger;
17
+ const isNumber: (schema: OpenApiV3.IJsonSchema) => schema is OpenApiV3.IJsonSchema.INumber;
18
+ const isString: (schema: OpenApiV3.IJsonSchema) => schema is OpenApiV3.IJsonSchema.IString;
19
+ const isArray: (schema: OpenApiV3.IJsonSchema) => schema is OpenApiV3.IJsonSchema.IArray;
20
+ const isObject: (schema: OpenApiV3.IJsonSchema) => schema is OpenApiV3.IJsonSchema.IObject;
21
+ const isReference: (schema: OpenApiV3.IJsonSchema) => schema is OpenApiV3.IJsonSchema.IReference;
22
+ const isAllOf: (schema: OpenApiV3.IJsonSchema) => schema is OpenApiV3.IJsonSchema.IAllOf;
23
+ const isAnyOf: (schema: OpenApiV3.IJsonSchema) => schema is OpenApiV3.IJsonSchema.IAnyOf;
24
+ const isOneOf: (schema: OpenApiV3.IJsonSchema) => schema is OpenApiV3.IJsonSchema.IOneOf;
25
+ const isNullOnly: (schema: OpenApiV3.IJsonSchema) => schema is OpenApiV3.IJsonSchema.INullOnly;
26
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenApiV3TypeChecker = void 0;
4
+ /**
5
+ * Type checker for raw OpenAPI v3.0 JSON schemas.
6
+ *
7
+ * `OpenApiV3TypeChecker` provides type guard functions for
8
+ * {@link OpenApiV3.IJsonSchema} (raw, unemended format). For typia's normalized
9
+ * format, use {@link OpenApiTypeChecker} instead.
10
+ *
11
+ * Key differences from v3.1: v3.0 uses `nullable: true` property instead of
12
+ * union types, and has no `const` or tuple support.
13
+ *
14
+ * @author Jeongho Nam - https://github.com/samchon
15
+ */
16
+ var OpenApiV3TypeChecker;
17
+ (function (OpenApiV3TypeChecker) {
18
+ OpenApiV3TypeChecker.isBoolean = (schema) => schema.type === "boolean";
19
+ OpenApiV3TypeChecker.isInteger = (schema) => schema.type === "integer";
20
+ OpenApiV3TypeChecker.isNumber = (schema) => schema.type === "number";
21
+ OpenApiV3TypeChecker.isString = (schema) => schema.type === "string";
22
+ OpenApiV3TypeChecker.isArray = (schema) => schema.type === "array";
23
+ OpenApiV3TypeChecker.isObject = (schema) => schema.type === "object";
24
+ OpenApiV3TypeChecker.isReference = (schema) => schema.$ref !== undefined;
25
+ OpenApiV3TypeChecker.isAllOf = (schema) => schema.allOf !== undefined;
26
+ OpenApiV3TypeChecker.isAnyOf = (schema) => schema.anyOf !== undefined;
27
+ OpenApiV3TypeChecker.isOneOf = (schema) => schema.oneOf !== undefined;
28
+ OpenApiV3TypeChecker.isNullOnly = (schema) => schema.type === "null";
29
+ })(OpenApiV3TypeChecker || (exports.OpenApiV3TypeChecker = OpenApiV3TypeChecker = {}));
30
+ //# sourceMappingURL=OpenApiV3TypeChecker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenApiV3TypeChecker.js","sourceRoot":"","sources":["../../src/validators/OpenApiV3TypeChecker.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AACH,IAAiB,oBAAoB,CAuDpC;AAvDD,WAAiB,oBAAoB;IACtB,8BAAS,GAAG,CACvB,MAA6B,EACa,EAAE,CAC3C,MAAyC,CAAC,IAAI,KAAK,SAAS,CAAC;IAEnD,8BAAS,GAAG,CACvB,MAA6B,EACa,EAAE,CAC3C,MAAyC,CAAC,IAAI,KAAK,SAAS,CAAC;IAEnD,6BAAQ,GAAG,CACtB,MAA6B,EACY,EAAE,CAC1C,MAAwC,CAAC,IAAI,KAAK,QAAQ,CAAC;IAEjD,6BAAQ,GAAG,CACtB,MAA6B,EACY,EAAE,CAC1C,MAAwC,CAAC,IAAI,KAAK,QAAQ,CAAC;IAEjD,4BAAO,GAAG,CACrB,MAA6B,EACW,EAAE,CACzC,MAAuC,CAAC,IAAI,KAAK,OAAO,CAAC;IAE/C,6BAAQ,GAAG,CACtB,MAA6B,EACY,EAAE,CAC1C,MAAwC,CAAC,IAAI,KAAK,QAAQ,CAAC;IAEjD,gCAAW,GAAG,CACzB,MAA6B,EACe,EAAE,CAC7C,MAA2C,CAAC,IAAI,KAAK,SAAS,CAAC;IAErD,4BAAO,GAAG,CACrB,MAA6B,EACW,EAAE,CACzC,MAAuC,CAAC,KAAK,KAAK,SAAS,CAAC;IAElD,4BAAO,GAAG,CACrB,MAA6B,EACW,EAAE,CACzC,MAAuC,CAAC,KAAK,KAAK,SAAS,CAAC;IAElD,4BAAO,GAAG,CACrB,MAA6B,EACW,EAAE,CACzC,MAAuC,CAAC,KAAK,KAAK,SAAS,CAAC;IAElD,+BAAU,GAAG,CACxB,MAA6B,EACc,EAAE,CAC5C,MAA0C,CAAC,IAAI,KAAK,MAAM,CAAC;AAChE,CAAC,EAvDgB,oBAAoB,oCAApB,oBAAoB,QAuDpC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Type checker for raw OpenAPI v3.0 JSON schemas.
3
+ *
4
+ * `OpenApiV3TypeChecker` provides type guard functions for
5
+ * {@link OpenApiV3.IJsonSchema} (raw, unemended format). For typia's normalized
6
+ * format, use {@link OpenApiTypeChecker} instead.
7
+ *
8
+ * Key differences from v3.1: v3.0 uses `nullable: true` property instead of
9
+ * union types, and has no `const` or tuple support.
10
+ *
11
+ * @author Jeongho Nam - https://github.com/samchon
12
+ */
13
+ var OpenApiV3TypeChecker;
14
+ (function (OpenApiV3TypeChecker) {
15
+ OpenApiV3TypeChecker.isBoolean = (schema) => schema.type === "boolean";
16
+ OpenApiV3TypeChecker.isInteger = (schema) => schema.type === "integer";
17
+ OpenApiV3TypeChecker.isNumber = (schema) => schema.type === "number";
18
+ OpenApiV3TypeChecker.isString = (schema) => schema.type === "string";
19
+ OpenApiV3TypeChecker.isArray = (schema) => schema.type === "array";
20
+ OpenApiV3TypeChecker.isObject = (schema) => schema.type === "object";
21
+ OpenApiV3TypeChecker.isReference = (schema) => schema.$ref !== undefined;
22
+ OpenApiV3TypeChecker.isAllOf = (schema) => schema.allOf !== undefined;
23
+ OpenApiV3TypeChecker.isAnyOf = (schema) => schema.anyOf !== undefined;
24
+ OpenApiV3TypeChecker.isOneOf = (schema) => schema.oneOf !== undefined;
25
+ OpenApiV3TypeChecker.isNullOnly = (schema) => schema.type === "null";
26
+ })(OpenApiV3TypeChecker || (OpenApiV3TypeChecker = {}));
27
+
28
+ export { OpenApiV3TypeChecker };
29
+ //# sourceMappingURL=OpenApiV3TypeChecker.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenApiV3TypeChecker.mjs","sources":["../../src/validators/OpenApiV3TypeChecker.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;;;;;;;;;AAWG;AACG,IAAW;AAAjB,CAAA,UAAiB,oBAAoB,EAAA;IACtB,oBAAA,CAAA,SAAS,GAAG,CACvB,MAA6B,KAE5B,MAAyC,CAAC,IAAI,KAAK,SAAS;IAElD,oBAAA,CAAA,SAAS,GAAG,CACvB,MAA6B,KAE5B,MAAyC,CAAC,IAAI,KAAK,SAAS;IAElD,oBAAA,CAAA,QAAQ,GAAG,CACtB,MAA6B,KAE5B,MAAwC,CAAC,IAAI,KAAK,QAAQ;IAEhD,oBAAA,CAAA,QAAQ,GAAG,CACtB,MAA6B,KAE5B,MAAwC,CAAC,IAAI,KAAK,QAAQ;IAEhD,oBAAA,CAAA,OAAO,GAAG,CACrB,MAA6B,KAE5B,MAAuC,CAAC,IAAI,KAAK,OAAO;IAE9C,oBAAA,CAAA,QAAQ,GAAG,CACtB,MAA6B,KAE5B,MAAwC,CAAC,IAAI,KAAK,QAAQ;IAEhD,oBAAA,CAAA,WAAW,GAAG,CACzB,MAA6B,KAE5B,MAA2C,CAAC,IAAI,KAAK,SAAS;IAEpD,oBAAA,CAAA,OAAO,GAAG,CACrB,MAA6B,KAE5B,MAAuC,CAAC,KAAK,KAAK,SAAS;IAEjD,oBAAA,CAAA,OAAO,GAAG,CACrB,MAA6B,KAE5B,MAAuC,CAAC,KAAK,KAAK,SAAS;IAEjD,oBAAA,CAAA,OAAO,GAAG,CACrB,MAA6B,KAE5B,MAAuC,CAAC,KAAK,KAAK,SAAS;IAEjD,oBAAA,CAAA,UAAU,GAAG,CACxB,MAA6B,KAE5B,MAA0C,CAAC,IAAI,KAAK,MAAM;AAC/D,CAAC,EAvDgB,oBAAoB,KAApB,oBAAoB,GAAA,EAAA,CAAA,CAAA;;;;"}
@@ -0,0 +1,29 @@
1
+ import { OpenApiV3_1 } from "@typia/interface";
2
+ /**
3
+ * Type checker for raw OpenAPI v3.1 JSON schemas.
4
+ *
5
+ * `OpenApiV3_1TypeChecker` provides type guard functions for
6
+ * {@link OpenApiV3_1.IJsonSchema} (raw, unemended format). For typia's
7
+ * normalized format, use {@link OpenApiTypeChecker} instead.
8
+ *
9
+ * Key v3.1 features: `const` keyword, `type` arrays (`["string", "null"]`),
10
+ * `prefixItems` for tuples, JSON Schema draft 2020-12 compatibility.
11
+ *
12
+ * @author Jeongho Nam - https://github.com/samchon
13
+ */
14
+ export declare namespace OpenApiV3_1TypeChecker {
15
+ const isConstant: (schema: OpenApiV3_1.IJsonSchema) => schema is OpenApiV3_1.IJsonSchema.IConstant;
16
+ const isBoolean: (schema: OpenApiV3_1.IJsonSchema) => schema is OpenApiV3_1.IJsonSchema.IBoolean;
17
+ const isInteger: (schema: OpenApiV3_1.IJsonSchema) => schema is OpenApiV3_1.IJsonSchema.IInteger;
18
+ const isNumber: (schema: OpenApiV3_1.IJsonSchema) => schema is OpenApiV3_1.IJsonSchema.INumber;
19
+ const isString: (schema: OpenApiV3_1.IJsonSchema) => schema is OpenApiV3_1.IJsonSchema.IString;
20
+ const isArray: (schema: OpenApiV3_1.IJsonSchema) => schema is OpenApiV3_1.IJsonSchema.IArray;
21
+ const isObject: (schema: OpenApiV3_1.IJsonSchema) => schema is OpenApiV3_1.IJsonSchema.IObject;
22
+ const isReference: (schema: OpenApiV3_1.IJsonSchema) => schema is OpenApiV3_1.IJsonSchema.IReference;
23
+ const isRecursiveReference: (schema: OpenApiV3_1.IJsonSchema) => schema is OpenApiV3_1.IJsonSchema.IRecursiveReference;
24
+ const isAllOf: (schema: OpenApiV3_1.IJsonSchema) => schema is OpenApiV3_1.IJsonSchema.IAllOf;
25
+ const isAnyOf: (schema: OpenApiV3_1.IJsonSchema) => schema is OpenApiV3_1.IJsonSchema.IAnyOf;
26
+ const isOneOf: (schema: OpenApiV3_1.IJsonSchema) => schema is OpenApiV3_1.IJsonSchema.IOneOf;
27
+ const isNullOnly: (schema: OpenApiV3_1.IJsonSchema) => schema is OpenApiV3_1.IJsonSchema.INull;
28
+ const isMixed: (schema: OpenApiV3_1.IJsonSchema) => schema is OpenApiV3_1.IJsonSchema.IMixed;
29
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenApiV3_1TypeChecker = void 0;
4
+ /**
5
+ * Type checker for raw OpenAPI v3.1 JSON schemas.
6
+ *
7
+ * `OpenApiV3_1TypeChecker` provides type guard functions for
8
+ * {@link OpenApiV3_1.IJsonSchema} (raw, unemended format). For typia's
9
+ * normalized format, use {@link OpenApiTypeChecker} instead.
10
+ *
11
+ * Key v3.1 features: `const` keyword, `type` arrays (`["string", "null"]`),
12
+ * `prefixItems` for tuples, JSON Schema draft 2020-12 compatibility.
13
+ *
14
+ * @author Jeongho Nam - https://github.com/samchon
15
+ */
16
+ var OpenApiV3_1TypeChecker;
17
+ (function (OpenApiV3_1TypeChecker) {
18
+ OpenApiV3_1TypeChecker.isConstant = (schema) => schema.const !== undefined;
19
+ OpenApiV3_1TypeChecker.isBoolean = (schema) => schema.type === "boolean";
20
+ OpenApiV3_1TypeChecker.isInteger = (schema) => schema.type === "integer";
21
+ OpenApiV3_1TypeChecker.isNumber = (schema) => schema.type === "number";
22
+ OpenApiV3_1TypeChecker.isString = (schema) => schema.type === "string";
23
+ OpenApiV3_1TypeChecker.isArray = (schema) => schema.type === "array";
24
+ OpenApiV3_1TypeChecker.isObject = (schema) => schema.type === "object";
25
+ OpenApiV3_1TypeChecker.isReference = (schema) => schema.$ref !== undefined;
26
+ OpenApiV3_1TypeChecker.isRecursiveReference = (schema) => schema.$recursiveRef !==
27
+ undefined;
28
+ OpenApiV3_1TypeChecker.isAllOf = (schema) => schema.allOf !== undefined;
29
+ OpenApiV3_1TypeChecker.isAnyOf = (schema) => schema.anyOf !== undefined;
30
+ OpenApiV3_1TypeChecker.isOneOf = (schema) => schema.oneOf !== undefined;
31
+ OpenApiV3_1TypeChecker.isNullOnly = (schema) => schema.type === "null";
32
+ OpenApiV3_1TypeChecker.isMixed = (schema) => Array.isArray(schema.type);
33
+ })(OpenApiV3_1TypeChecker || (exports.OpenApiV3_1TypeChecker = OpenApiV3_1TypeChecker = {}));
34
+ //# sourceMappingURL=OpenApiV3_1TypeChecker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenApiV3_1TypeChecker.js","sourceRoot":"","sources":["../../src/validators/OpenApiV3_1TypeChecker.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AACH,IAAiB,sBAAsB,CAuEtC;AAvED,WAAiB,sBAAsB;IACxB,iCAAU,GAAG,CACxB,MAA+B,EACc,EAAE,CAC9C,MAA4C,CAAC,KAAK,KAAK,SAAS,CAAC;IAEvD,gCAAS,GAAG,CACvB,MAA+B,EACa,EAAE,CAC7C,MAA2C,CAAC,IAAI,KAAK,SAAS,CAAC;IAErD,gCAAS,GAAG,CACvB,MAA+B,EACa,EAAE,CAC7C,MAA2C,CAAC,IAAI,KAAK,SAAS,CAAC;IAErD,+BAAQ,GAAG,CACtB,MAA+B,EACY,EAAE,CAC5C,MAA0C,CAAC,IAAI,KAAK,QAAQ,CAAC;IAEnD,+BAAQ,GAAG,CACtB,MAA+B,EACY,EAAE,CAC5C,MAA0C,CAAC,IAAI,KAAK,QAAQ,CAAC;IAEnD,8BAAO,GAAG,CACrB,MAA+B,EACW,EAAE,CAC3C,MAAyC,CAAC,IAAI,KAAK,OAAO,CAAC;IAEjD,+BAAQ,GAAG,CACtB,MAA+B,EACY,EAAE,CAC5C,MAA0C,CAAC,IAAI,KAAK,QAAQ,CAAC;IAEnD,kCAAW,GAAG,CACzB,MAA+B,EACe,EAAE,CAC/C,MAA6C,CAAC,IAAI,KAAK,SAAS,CAAC;IAEvD,2CAAoB,GAAG,CAClC,MAA+B,EACwB,EAAE,CACxD,MAAsD,CAAC,aAAa;QACrE,SAAS,CAAC;IAEC,8BAAO,GAAG,CACrB,MAA+B,EACW,EAAE,CAC3C,MAAyC,CAAC,KAAK,KAAK,SAAS,CAAC;IAEpD,8BAAO,GAAG,CACrB,MAA+B,EACW,EAAE,CAC3C,MAAyC,CAAC,KAAK,KAAK,SAAS,CAAC;IAEpD,8BAAO,GAAG,CACrB,MAA+B,EACW,EAAE,CAC3C,MAAyC,CAAC,KAAK,KAAK,SAAS,CAAC;IAEpD,iCAAU,GAAG,CACxB,MAA+B,EACU,EAAE,CAC1C,MAAwC,CAAC,IAAI,KAAK,MAAM,CAAC;IAE/C,8BAAO,GAAG,CACrB,MAA+B,EACW,EAAE,CAC5C,KAAK,CAAC,OAAO,CAAE,MAAyC,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC,EAvEgB,sBAAsB,sCAAtB,sBAAsB,QAuEtC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Type checker for raw OpenAPI v3.1 JSON schemas.
3
+ *
4
+ * `OpenApiV3_1TypeChecker` provides type guard functions for
5
+ * {@link OpenApiV3_1.IJsonSchema} (raw, unemended format). For typia's
6
+ * normalized format, use {@link OpenApiTypeChecker} instead.
7
+ *
8
+ * Key v3.1 features: `const` keyword, `type` arrays (`["string", "null"]`),
9
+ * `prefixItems` for tuples, JSON Schema draft 2020-12 compatibility.
10
+ *
11
+ * @author Jeongho Nam - https://github.com/samchon
12
+ */
13
+ var OpenApiV3_1TypeChecker;
14
+ (function (OpenApiV3_1TypeChecker) {
15
+ OpenApiV3_1TypeChecker.isConstant = (schema) => schema.const !== undefined;
16
+ OpenApiV3_1TypeChecker.isBoolean = (schema) => schema.type === "boolean";
17
+ OpenApiV3_1TypeChecker.isInteger = (schema) => schema.type === "integer";
18
+ OpenApiV3_1TypeChecker.isNumber = (schema) => schema.type === "number";
19
+ OpenApiV3_1TypeChecker.isString = (schema) => schema.type === "string";
20
+ OpenApiV3_1TypeChecker.isArray = (schema) => schema.type === "array";
21
+ OpenApiV3_1TypeChecker.isObject = (schema) => schema.type === "object";
22
+ OpenApiV3_1TypeChecker.isReference = (schema) => schema.$ref !== undefined;
23
+ OpenApiV3_1TypeChecker.isRecursiveReference = (schema) => schema.$recursiveRef !==
24
+ undefined;
25
+ OpenApiV3_1TypeChecker.isAllOf = (schema) => schema.allOf !== undefined;
26
+ OpenApiV3_1TypeChecker.isAnyOf = (schema) => schema.anyOf !== undefined;
27
+ OpenApiV3_1TypeChecker.isOneOf = (schema) => schema.oneOf !== undefined;
28
+ OpenApiV3_1TypeChecker.isNullOnly = (schema) => schema.type === "null";
29
+ OpenApiV3_1TypeChecker.isMixed = (schema) => Array.isArray(schema.type);
30
+ })(OpenApiV3_1TypeChecker || (OpenApiV3_1TypeChecker = {}));
31
+
32
+ export { OpenApiV3_1TypeChecker };
33
+ //# sourceMappingURL=OpenApiV3_1TypeChecker.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenApiV3_1TypeChecker.mjs","sources":["../../src/validators/OpenApiV3_1TypeChecker.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;;;;;;;;;AAWG;AACG,IAAW;AAAjB,CAAA,UAAiB,sBAAsB,EAAA;IACxB,sBAAA,CAAA,UAAU,GAAG,CACxB,MAA+B,KAE9B,MAA4C,CAAC,KAAK,KAAK,SAAS;IAEtD,sBAAA,CAAA,SAAS,GAAG,CACvB,MAA+B,KAE9B,MAA2C,CAAC,IAAI,KAAK,SAAS;IAEpD,sBAAA,CAAA,SAAS,GAAG,CACvB,MAA+B,KAE9B,MAA2C,CAAC,IAAI,KAAK,SAAS;IAEpD,sBAAA,CAAA,QAAQ,GAAG,CACtB,MAA+B,KAE9B,MAA0C,CAAC,IAAI,KAAK,QAAQ;IAElD,sBAAA,CAAA,QAAQ,GAAG,CACtB,MAA+B,KAE9B,MAA0C,CAAC,IAAI,KAAK,QAAQ;IAElD,sBAAA,CAAA,OAAO,GAAG,CACrB,MAA+B,KAE9B,MAAyC,CAAC,IAAI,KAAK,OAAO;IAEhD,sBAAA,CAAA,QAAQ,GAAG,CACtB,MAA+B,KAE9B,MAA0C,CAAC,IAAI,KAAK,QAAQ;IAElD,sBAAA,CAAA,WAAW,GAAG,CACzB,MAA+B,KAE9B,MAA6C,CAAC,IAAI,KAAK,SAAS;IAEtD,sBAAA,CAAA,oBAAoB,GAAG,CAClC,MAA+B,KAE9B,MAAsD,CAAC,aAAa;AACrE,QAAA,SAAS;IAEE,sBAAA,CAAA,OAAO,GAAG,CACrB,MAA+B,KAE9B,MAAyC,CAAC,KAAK,KAAK,SAAS;IAEnD,sBAAA,CAAA,OAAO,GAAG,CACrB,MAA+B,KAE9B,MAAyC,CAAC,KAAK,KAAK,SAAS;IAEnD,sBAAA,CAAA,OAAO,GAAG,CACrB,MAA+B,KAE9B,MAAyC,CAAC,KAAK,KAAK,SAAS;IAEnD,sBAAA,CAAA,UAAU,GAAG,CACxB,MAA+B,KAE9B,MAAwC,CAAC,IAAI,KAAK,MAAM;AAE9C,IAAA,sBAAA,CAAA,OAAO,GAAG,CACrB,MAA+B,KAE/B,KAAK,CAAC,OAAO,CAAE,MAAyC,CAAC,IAAI,CAAC;AAClE,CAAC,EAvEgB,sBAAsB,KAAtB,sBAAsB,GAAA,EAAA,CAAA,CAAA;;;;"}