@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,130 @@
1
+ import { IHttpConnection, IHttpLlmApplication, IHttpLlmController, IHttpLlmFunction, IHttpResponse, ILlmFunction, OpenApi, OpenApiV3, OpenApiV3_1, SwaggerV2 } from "@typia/interface";
2
+ /**
3
+ * LLM function calling utilities for OpenAPI documents.
4
+ *
5
+ * `HttpLlm` converts OpenAPI documents into LLM function calling applications
6
+ * and executes them. Supports all OpenAPI versions (Swagger 2.0, OpenAPI 3.0,
7
+ * 3.1) through automatic conversion to {@link OpenApi} format.
8
+ *
9
+ * Main functions:
10
+ *
11
+ * - {@link controller}: Create {@link IHttpLlmController} from OpenAPI document
12
+ * - {@link application}: Convert OpenAPI document to {@link IHttpLlmApplication}
13
+ * - {@link execute}: Call an LLM function and return the response body
14
+ * - {@link propagate}: Call an LLM function and return full HTTP response
15
+ * - {@link mergeParameters}: Merge LLM-filled and human-filled parameters
16
+ *
17
+ * Typical workflow:
18
+ *
19
+ * 1. Load OpenAPI document (JSON/YAML)
20
+ * 2. Call `HttpLlm.application()` to get function schemas
21
+ * 3. Send function schemas to LLM for function selection
22
+ * 4. Call `HttpLlm.execute()` with LLM's chosen function and arguments
23
+ *
24
+ * @author Jeongho Nam - https://github.com/samchon
25
+ */
26
+ export declare namespace HttpLlm {
27
+ /**
28
+ * Create HTTP LLM controller from OpenAPI document.
29
+ *
30
+ * Composes {@link IHttpLlmController} from OpenAPI document with connection
31
+ * info. The controller can be used with {@link registerMcpControllers} to
32
+ * register all API operations as MCP tools at once.
33
+ *
34
+ * @param props Controller properties
35
+ * @returns HTTP LLM controller
36
+ */
37
+ const controller: (props: {
38
+ /** Identifier name of the controller. */
39
+ name: string;
40
+ /** OpenAPI document to convert. */
41
+ document: OpenApi.IDocument | SwaggerV2.IDocument | OpenApiV3.IDocument | OpenApiV3_1.IDocument;
42
+ /** Connection to the API server. */
43
+ connection: IHttpConnection;
44
+ /** LLM schema conversion configuration. */
45
+ config?: Partial<IHttpLlmApplication.IConfig>;
46
+ /**
47
+ * Custom executor of the API function.
48
+ *
49
+ * Default executor is {@link HttpLlm.execute} function.
50
+ */
51
+ execute?: IHttpLlmController["execute"];
52
+ }) => IHttpLlmController;
53
+ /**
54
+ * Convert OpenAPI document to LLM function calling application.
55
+ *
56
+ * Converts API operations to LLM-callable functions. Use
57
+ * {@link mergeParameters} if `separate` option is configured.
58
+ *
59
+ * @param props Composition properties
60
+ * @returns LLM function calling application
61
+ */
62
+ const application: (props: {
63
+ /** OpenAPI document to convert. */
64
+ document: OpenApi.IDocument | SwaggerV2.IDocument | OpenApiV3.IDocument | OpenApiV3_1.IDocument;
65
+ /** LLM schema conversion configuration. */
66
+ config?: Partial<IHttpLlmApplication.IConfig>;
67
+ }) => IHttpLlmApplication;
68
+ /** Properties for LLM function call. */
69
+ interface IFetchProps {
70
+ /** LLM function calling application. */
71
+ application: IHttpLlmApplication;
72
+ /** Function to call. */
73
+ function: IHttpLlmFunction;
74
+ /** HTTP connection info. */
75
+ connection: IHttpConnection;
76
+ /** Function arguments. */
77
+ input: object;
78
+ }
79
+ /**
80
+ * Execute LLM function call.
81
+ *
82
+ * Calls API endpoint and returns response body. Throws {@link HttpError} on
83
+ * non-2xx status.
84
+ *
85
+ * @param props Function call properties
86
+ * @returns Response body
87
+ * @throws HttpError on non-2xx status
88
+ */
89
+ const execute: (props: IFetchProps) => Promise<unknown>;
90
+ /**
91
+ * Propagate LLM function call.
92
+ *
93
+ * Calls API endpoint and returns full response including non-2xx. Use when
94
+ * you need to handle error responses yourself.
95
+ *
96
+ * @param props Function call properties
97
+ * @returns Full HTTP response
98
+ * @throws Error only on connection failure
99
+ */
100
+ const propagate: (props: IFetchProps) => Promise<IHttpResponse>;
101
+ /** Properties for parameter merging. */
102
+ interface IMergeProps {
103
+ /** Target function metadata. */
104
+ function: ILlmFunction;
105
+ /** LLM-provided arguments. */
106
+ llm: object | null;
107
+ /** Human-provided arguments. */
108
+ human: object | null;
109
+ }
110
+ /**
111
+ * Merge separated parameters.
112
+ *
113
+ * Combines human and LLM parameters when `separate` option was used. Throws
114
+ * error if `separate` was not configured.
115
+ *
116
+ * @param props Merge properties
117
+ * @returns Merged parameters
118
+ */
119
+ const mergeParameters: (props: IMergeProps) => object;
120
+ /**
121
+ * Merge two values.
122
+ *
123
+ * Objects are merged at property level. Primitives return `y ?? x`.
124
+ *
125
+ * @param x First value
126
+ * @param y Second value (preferred)
127
+ * @returns Merged value
128
+ */
129
+ const mergeValue: (x: unknown, y: unknown) => unknown;
130
+ }
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpLlm = void 0;
4
+ const HttpMigration_1 = require("./HttpMigration");
5
+ const HttpLlmApplicationComposer_1 = require("./internal/HttpLlmApplicationComposer");
6
+ const HttpLlmFunctionFetcher_1 = require("./internal/HttpLlmFunctionFetcher");
7
+ const LlmDataMerger_1 = require("./internal/LlmDataMerger");
8
+ /**
9
+ * LLM function calling utilities for OpenAPI documents.
10
+ *
11
+ * `HttpLlm` converts OpenAPI documents into LLM function calling applications
12
+ * and executes them. Supports all OpenAPI versions (Swagger 2.0, OpenAPI 3.0,
13
+ * 3.1) through automatic conversion to {@link OpenApi} format.
14
+ *
15
+ * Main functions:
16
+ *
17
+ * - {@link controller}: Create {@link IHttpLlmController} from OpenAPI document
18
+ * - {@link application}: Convert OpenAPI document to {@link IHttpLlmApplication}
19
+ * - {@link execute}: Call an LLM function and return the response body
20
+ * - {@link propagate}: Call an LLM function and return full HTTP response
21
+ * - {@link mergeParameters}: Merge LLM-filled and human-filled parameters
22
+ *
23
+ * Typical workflow:
24
+ *
25
+ * 1. Load OpenAPI document (JSON/YAML)
26
+ * 2. Call `HttpLlm.application()` to get function schemas
27
+ * 3. Send function schemas to LLM for function selection
28
+ * 4. Call `HttpLlm.execute()` with LLM's chosen function and arguments
29
+ *
30
+ * @author Jeongho Nam - https://github.com/samchon
31
+ */
32
+ var HttpLlm;
33
+ (function (HttpLlm) {
34
+ /* -----------------------------------------------------------
35
+ COMPOSERS
36
+ ----------------------------------------------------------- */
37
+ /**
38
+ * Create HTTP LLM controller from OpenAPI document.
39
+ *
40
+ * Composes {@link IHttpLlmController} from OpenAPI document with connection
41
+ * info. The controller can be used with {@link registerMcpControllers} to
42
+ * register all API operations as MCP tools at once.
43
+ *
44
+ * @param props Controller properties
45
+ * @returns HTTP LLM controller
46
+ */
47
+ HttpLlm.controller = (props) => ({
48
+ protocol: "http",
49
+ name: props.name,
50
+ application: HttpLlm.application({
51
+ document: props.document,
52
+ config: props.config,
53
+ }),
54
+ connection: props.connection,
55
+ execute: props.execute,
56
+ });
57
+ /**
58
+ * Convert OpenAPI document to LLM function calling application.
59
+ *
60
+ * Converts API operations to LLM-callable functions. Use
61
+ * {@link mergeParameters} if `separate` option is configured.
62
+ *
63
+ * @param props Composition properties
64
+ * @returns LLM function calling application
65
+ */
66
+ HttpLlm.application = (props) => {
67
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
68
+ // MIGRATE
69
+ const migrate = HttpMigration_1.HttpMigration.application(props.document);
70
+ return HttpLlmApplicationComposer_1.HttpLlmApplicationComposer.application({
71
+ migrate,
72
+ config: {
73
+ reference: (_b = (_a = props.config) === null || _a === void 0 ? void 0 : _a.reference) !== null && _b !== void 0 ? _b : true,
74
+ strict: (_d = (_c = props.config) === null || _c === void 0 ? void 0 : _c.strict) !== null && _d !== void 0 ? _d : false,
75
+ separate: (_f = (_e = props.config) === null || _e === void 0 ? void 0 : _e.separate) !== null && _f !== void 0 ? _f : null,
76
+ maxLength: (_h = (_g = props.config) === null || _g === void 0 ? void 0 : _g.maxLength) !== null && _h !== void 0 ? _h : 64,
77
+ equals: (_k = (_j = props.config) === null || _j === void 0 ? void 0 : _j.equals) !== null && _k !== void 0 ? _k : false,
78
+ },
79
+ });
80
+ };
81
+ /**
82
+ * Execute LLM function call.
83
+ *
84
+ * Calls API endpoint and returns response body. Throws {@link HttpError} on
85
+ * non-2xx status.
86
+ *
87
+ * @param props Function call properties
88
+ * @returns Response body
89
+ * @throws HttpError on non-2xx status
90
+ */
91
+ HttpLlm.execute = (props) => HttpLlmFunctionFetcher_1.HttpLlmFunctionFetcher.execute(props);
92
+ /**
93
+ * Propagate LLM function call.
94
+ *
95
+ * Calls API endpoint and returns full response including non-2xx. Use when
96
+ * you need to handle error responses yourself.
97
+ *
98
+ * @param props Function call properties
99
+ * @returns Full HTTP response
100
+ * @throws Error only on connection failure
101
+ */
102
+ HttpLlm.propagate = (props) => HttpLlmFunctionFetcher_1.HttpLlmFunctionFetcher.propagate(props);
103
+ /**
104
+ * Merge separated parameters.
105
+ *
106
+ * Combines human and LLM parameters when `separate` option was used. Throws
107
+ * error if `separate` was not configured.
108
+ *
109
+ * @param props Merge properties
110
+ * @returns Merged parameters
111
+ */
112
+ HttpLlm.mergeParameters = (props) => LlmDataMerger_1.LlmDataMerger.parameters(props);
113
+ /**
114
+ * Merge two values.
115
+ *
116
+ * Objects are merged at property level. Primitives return `y ?? x`.
117
+ *
118
+ * @param x First value
119
+ * @param y Second value (preferred)
120
+ * @returns Merged value
121
+ */
122
+ HttpLlm.mergeValue = (x, y) => LlmDataMerger_1.LlmDataMerger.value(x, y);
123
+ })(HttpLlm || (exports.HttpLlm = HttpLlm = {}));
124
+ //# sourceMappingURL=HttpLlm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpLlm.js","sourceRoot":"","sources":["../../src/http/HttpLlm.ts"],"names":[],"mappings":";;;AAcA,mDAAgD;AAChD,sFAAmF;AACnF,8EAA2E;AAC3E,4DAAyD;AAEzD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,IAAiB,OAAO,CAsKvB;AAtKD,WAAiB,OAAO;IACtB;;kEAE8D;IAC9D;;;;;;;;;OASG;IACU,kBAAU,GAAG,CAAC,KAuB1B,EAAsB,EAAE,CAAC,CAAC;QACzB,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,WAAW,EAAE,QAAA,WAAW,CAAC;YACvB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC;QACF,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,OAAO,EAAE,KAAK,CAAC,OAAO;KACvB,CAAC,CAAC;IAEH;;;;;;;;OAQG;IACU,mBAAW,GAAG,CAAC,KAU3B,EAAuB,EAAE;;QACxB,UAAU;QACV,MAAM,OAAO,GAA4B,6BAAa,CAAC,WAAW,CAChE,KAAK,CAAC,QAAQ,CACf,CAAC;QACF,OAAO,uDAA0B,CAAC,WAAW,CAAC;YAC5C,OAAO;YACP,MAAM,EAAE;gBACN,SAAS,EAAE,MAAA,MAAA,KAAK,CAAC,MAAM,0CAAE,SAAS,mCAAI,IAAI;gBAC1C,MAAM,EAAE,MAAA,MAAA,KAAK,CAAC,MAAM,0CAAE,MAAM,mCAAI,KAAK;gBACrC,QAAQ,EAAE,MAAA,MAAA,KAAK,CAAC,MAAM,0CAAE,QAAQ,mCAAI,IAAI;gBACxC,SAAS,EAAE,MAAA,MAAA,KAAK,CAAC,MAAM,0CAAE,SAAS,mCAAI,EAAE;gBACxC,MAAM,EAAE,MAAA,MAAA,KAAK,CAAC,MAAM,0CAAE,MAAM,mCAAI,KAAK;aACtC;SACF,CAAC,CAAC;IACL,CAAC,CAAC;IAoBF;;;;;;;;;OASG;IACU,eAAO,GAAG,CAAC,KAAkB,EAAoB,EAAE,CAC9D,+CAAsB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAExC;;;;;;;;;OASG;IACU,iBAAS,GAAG,CAAC,KAAkB,EAA0B,EAAE,CACtE,+CAAsB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAiB1C;;;;;;;;OAQG;IACU,uBAAe,GAAG,CAAC,KAAkB,EAAU,EAAE,CAC5D,6BAAa,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAElC;;;;;;;;OAQG;IACU,kBAAU,GAAG,CAAC,CAAU,EAAE,CAAU,EAAW,EAAE,CAC5D,6BAAa,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9B,CAAC,EAtKgB,OAAO,uBAAP,OAAO,QAsKvB"}
@@ -0,0 +1,123 @@
1
+ import { HttpMigration } from './HttpMigration.mjs';
2
+ import { HttpLlmApplicationComposer } from './internal/HttpLlmApplicationComposer.mjs';
3
+ import { HttpLlmFunctionFetcher } from './internal/HttpLlmFunctionFetcher.mjs';
4
+ import { LlmDataMerger } from './internal/LlmDataMerger.mjs';
5
+
6
+ /**
7
+ * LLM function calling utilities for OpenAPI documents.
8
+ *
9
+ * `HttpLlm` converts OpenAPI documents into LLM function calling applications
10
+ * and executes them. Supports all OpenAPI versions (Swagger 2.0, OpenAPI 3.0,
11
+ * 3.1) through automatic conversion to {@link OpenApi} format.
12
+ *
13
+ * Main functions:
14
+ *
15
+ * - {@link controller}: Create {@link IHttpLlmController} from OpenAPI document
16
+ * - {@link application}: Convert OpenAPI document to {@link IHttpLlmApplication}
17
+ * - {@link execute}: Call an LLM function and return the response body
18
+ * - {@link propagate}: Call an LLM function and return full HTTP response
19
+ * - {@link mergeParameters}: Merge LLM-filled and human-filled parameters
20
+ *
21
+ * Typical workflow:
22
+ *
23
+ * 1. Load OpenAPI document (JSON/YAML)
24
+ * 2. Call `HttpLlm.application()` to get function schemas
25
+ * 3. Send function schemas to LLM for function selection
26
+ * 4. Call `HttpLlm.execute()` with LLM's chosen function and arguments
27
+ *
28
+ * @author Jeongho Nam - https://github.com/samchon
29
+ */
30
+ var HttpLlm;
31
+ (function (HttpLlm) {
32
+ /* -----------------------------------------------------------
33
+ COMPOSERS
34
+ ----------------------------------------------------------- */
35
+ /**
36
+ * Create HTTP LLM controller from OpenAPI document.
37
+ *
38
+ * Composes {@link IHttpLlmController} from OpenAPI document with connection
39
+ * info. The controller can be used with {@link registerMcpControllers} to
40
+ * register all API operations as MCP tools at once.
41
+ *
42
+ * @param props Controller properties
43
+ * @returns HTTP LLM controller
44
+ */
45
+ HttpLlm.controller = (props) => ({
46
+ protocol: "http",
47
+ name: props.name,
48
+ application: HttpLlm.application({
49
+ document: props.document,
50
+ config: props.config,
51
+ }),
52
+ connection: props.connection,
53
+ execute: props.execute,
54
+ });
55
+ /**
56
+ * Convert OpenAPI document to LLM function calling application.
57
+ *
58
+ * Converts API operations to LLM-callable functions. Use
59
+ * {@link mergeParameters} if `separate` option is configured.
60
+ *
61
+ * @param props Composition properties
62
+ * @returns LLM function calling application
63
+ */
64
+ HttpLlm.application = (props) => {
65
+ // MIGRATE
66
+ const migrate = HttpMigration.application(props.document);
67
+ return HttpLlmApplicationComposer.application({
68
+ migrate,
69
+ config: {
70
+ reference: props.config?.reference ?? true,
71
+ strict: props.config?.strict ?? false,
72
+ separate: props.config?.separate ?? null,
73
+ maxLength: props.config?.maxLength ?? 64,
74
+ equals: props.config?.equals ?? false,
75
+ },
76
+ });
77
+ };
78
+ /**
79
+ * Execute LLM function call.
80
+ *
81
+ * Calls API endpoint and returns response body. Throws {@link HttpError} on
82
+ * non-2xx status.
83
+ *
84
+ * @param props Function call properties
85
+ * @returns Response body
86
+ * @throws HttpError on non-2xx status
87
+ */
88
+ HttpLlm.execute = (props) => HttpLlmFunctionFetcher.execute(props);
89
+ /**
90
+ * Propagate LLM function call.
91
+ *
92
+ * Calls API endpoint and returns full response including non-2xx. Use when
93
+ * you need to handle error responses yourself.
94
+ *
95
+ * @param props Function call properties
96
+ * @returns Full HTTP response
97
+ * @throws Error only on connection failure
98
+ */
99
+ HttpLlm.propagate = (props) => HttpLlmFunctionFetcher.propagate(props);
100
+ /**
101
+ * Merge separated parameters.
102
+ *
103
+ * Combines human and LLM parameters when `separate` option was used. Throws
104
+ * error if `separate` was not configured.
105
+ *
106
+ * @param props Merge properties
107
+ * @returns Merged parameters
108
+ */
109
+ HttpLlm.mergeParameters = (props) => LlmDataMerger.parameters(props);
110
+ /**
111
+ * Merge two values.
112
+ *
113
+ * Objects are merged at property level. Primitives return `y ?? x`.
114
+ *
115
+ * @param x First value
116
+ * @param y Second value (preferred)
117
+ * @returns Merged value
118
+ */
119
+ HttpLlm.mergeValue = (x, y) => LlmDataMerger.value(x, y);
120
+ })(HttpLlm || (HttpLlm = {}));
121
+
122
+ export { HttpLlm };
123
+ //# sourceMappingURL=HttpLlm.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpLlm.mjs","sources":["../../src/http/HttpLlm.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAmBA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACG,IAAW;AAAjB,CAAA,UAAiB,OAAO,EAAA;AACtB;;AAE8D;AAC9D;;;;;;;;;AASG;AACU,IAAA,OAAA,CAAA,UAAU,GAAG,CAAC,KAuB1B,MAA0B;AACzB,QAAA,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,WAAW,EAAE,OAAA,CAAA,WAAW,CAAC;YACvB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC;QACF,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,OAAO,EAAE,KAAK,CAAC,OAAO;AACvB,KAAA,CAAC;AAEF;;;;;;;;AAQG;AACU,IAAA,OAAA,CAAA,WAAW,GAAG,CAAC,KAU3B,KAAyB;;QAExB,MAAM,OAAO,GAA4B,aAAa,CAAC,WAAW,CAChE,KAAK,CAAC,QAAQ,CACf;QACD,OAAO,0BAA0B,CAAC,WAAW,CAAC;YAC5C,OAAO;AACP,YAAA,MAAM,EAAE;AACN,gBAAA,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,SAAS,IAAI,IAAI;AAC1C,gBAAA,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,MAAM,IAAI,KAAK;AACrC,gBAAA,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,IAAI,IAAI;AACxC,gBAAA,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE;AACxC,gBAAA,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,MAAM,IAAI,KAAK;AACtC,aAAA;AACF,SAAA,CAAC;AACJ,IAAA,CAAC;AAoBD;;;;;;;;;AASG;AACU,IAAA,OAAA,CAAA,OAAO,GAAG,CAAC,KAAkB,KACxC,sBAAsB,CAAC,OAAO,CAAC,KAAK,CAAC;AAEvC;;;;;;;;;AASG;AACU,IAAA,OAAA,CAAA,SAAS,GAAG,CAAC,KAAkB,KAC1C,sBAAsB,CAAC,SAAS,CAAC,KAAK,CAAC;AAiBzC;;;;;;;;AAQG;AACU,IAAA,OAAA,CAAA,eAAe,GAAG,CAAC,KAAkB,KAChD,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC;AAEjC;;;;;;;;AAQG;AACU,IAAA,OAAA,CAAA,UAAU,GAAG,CAAC,CAAU,EAAE,CAAU,KAC/C,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC,EAtKgB,OAAO,KAAP,OAAO,GAAA,EAAA,CAAA,CAAA;;;;"}
@@ -0,0 +1,58 @@
1
+ import { IHttpConnection, IHttpMigrateApplication, IHttpMigrateRoute, IHttpResponse, OpenApi, OpenApiV3, OpenApiV3_1, SwaggerV2 } from "@typia/interface";
2
+ /**
3
+ * OpenAPI to HTTP migration utilities.
4
+ *
5
+ * `HttpMigration` converts OpenAPI documents into executable HTTP routes
6
+ * ({@link IHttpMigrateApplication}). Unlike {@link HttpLlm} which targets LLM
7
+ * function calling, this focuses on SDK/client code generation.
8
+ *
9
+ * Supports all OpenAPI versions (Swagger 2.0, OpenAPI 3.0, 3.1) through
10
+ * automatic conversion to normalized {@link OpenApi} format.
11
+ *
12
+ * Main functions:
13
+ *
14
+ * - {@link application}: Convert OpenAPI document to
15
+ * {@link IHttpMigrateApplication}
16
+ * - {@link execute}: Call a route and return response body
17
+ * - {@link propagate}: Call a route and return full HTTP response (including
18
+ * non-2xx)
19
+ *
20
+ * @author Jeongho Nam - https://github.com/samchon
21
+ */
22
+ export declare namespace HttpMigration {
23
+ /**
24
+ * Convert OpenAPI document to migration application.
25
+ *
26
+ * @param document OpenAPI document (any version)
27
+ * @returns Migration application with callable routes
28
+ */
29
+ const application: (document: OpenApi.IDocument | SwaggerV2.IDocument | OpenApiV3.IDocument | OpenApiV3_1.IDocument) => IHttpMigrateApplication;
30
+ /**
31
+ * Execute HTTP route.
32
+ *
33
+ * @param props Fetch properties
34
+ * @returns Response body
35
+ * @throws HttpError on non-2xx status
36
+ */
37
+ const execute: (props: IFetchProps) => Promise<unknown>;
38
+ /**
39
+ * Execute HTTP route and return full response.
40
+ *
41
+ * @param props Fetch properties
42
+ * @returns Full HTTP response including non-2xx
43
+ */
44
+ const propagate: (props: IFetchProps) => Promise<IHttpResponse>;
45
+ /** Properties for HTTP route execution. */
46
+ interface IFetchProps {
47
+ /** HTTP connection info. */
48
+ connection: IHttpConnection;
49
+ /** Route to execute. */
50
+ route: IHttpMigrateRoute;
51
+ /** Path parameters. */
52
+ parameters: Array<string | number | boolean | bigint | null> | Record<string, string | number | boolean | bigint | null>;
53
+ /** Query parameters. */
54
+ query?: object | undefined;
55
+ /** Request body. */
56
+ body?: object | undefined;
57
+ }
58
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpMigration = void 0;
4
+ const OpenApiConverter_1 = require("../converters/OpenApiConverter");
5
+ const HttpMigrateApplicationComposer_1 = require("./internal/HttpMigrateApplicationComposer");
6
+ const HttpMigrateRouteFetcher_1 = require("./internal/HttpMigrateRouteFetcher");
7
+ /**
8
+ * OpenAPI to HTTP migration utilities.
9
+ *
10
+ * `HttpMigration` converts OpenAPI documents into executable HTTP routes
11
+ * ({@link IHttpMigrateApplication}). Unlike {@link HttpLlm} which targets LLM
12
+ * function calling, this focuses on SDK/client code generation.
13
+ *
14
+ * Supports all OpenAPI versions (Swagger 2.0, OpenAPI 3.0, 3.1) through
15
+ * automatic conversion to normalized {@link OpenApi} format.
16
+ *
17
+ * Main functions:
18
+ *
19
+ * - {@link application}: Convert OpenAPI document to
20
+ * {@link IHttpMigrateApplication}
21
+ * - {@link execute}: Call a route and return response body
22
+ * - {@link propagate}: Call a route and return full HTTP response (including
23
+ * non-2xx)
24
+ *
25
+ * @author Jeongho Nam - https://github.com/samchon
26
+ */
27
+ var HttpMigration;
28
+ (function (HttpMigration) {
29
+ /**
30
+ * Convert OpenAPI document to migration application.
31
+ *
32
+ * @param document OpenAPI document (any version)
33
+ * @returns Migration application with callable routes
34
+ */
35
+ HttpMigration.application = (document) => HttpMigrateApplicationComposer_1.HttpMigrateApplicationComposer.compose(OpenApiConverter_1.OpenApiConverter.upgradeDocument(document));
36
+ /**
37
+ * Execute HTTP route.
38
+ *
39
+ * @param props Fetch properties
40
+ * @returns Response body
41
+ * @throws HttpError on non-2xx status
42
+ */
43
+ HttpMigration.execute = (props) => HttpMigrateRouteFetcher_1.HttpMigrateRouteFetcher.execute(props);
44
+ /**
45
+ * Execute HTTP route and return full response.
46
+ *
47
+ * @param props Fetch properties
48
+ * @returns Full HTTP response including non-2xx
49
+ */
50
+ HttpMigration.propagate = (props) => HttpMigrateRouteFetcher_1.HttpMigrateRouteFetcher.propagate(props);
51
+ })(HttpMigration || (exports.HttpMigration = HttpMigration = {}));
52
+ //# sourceMappingURL=HttpMigration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpMigration.js","sourceRoot":"","sources":["../../src/http/HttpMigration.ts"],"names":[],"mappings":";;;AAWA,qEAAkE;AAClE,8FAA2F;AAC3F,gFAA6E;AAE7E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,IAAiB,aAAa,CAwD7B;AAxDD,WAAiB,aAAa;IAC5B;;;;;OAKG;IACU,yBAAW,GAAG,CACzB,QAIyB,EACA,EAAE,CAC3B,+DAA8B,CAAC,OAAO,CACpC,mCAAgB,CAAC,eAAe,CAAC,QAAQ,CAAC,CAC3C,CAAC;IAEJ;;;;;;OAMG;IACU,qBAAO,GAAG,CAAC,KAAkB,EAAoB,EAAE,CAC9D,iDAAuB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAEzC;;;;;OAKG;IACU,uBAAS,GAAG,CAAC,KAAkB,EAA0B,EAAE,CACtE,iDAAuB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAqB7C,CAAC,EAxDgB,aAAa,6BAAb,aAAa,QAwD7B"}
@@ -0,0 +1,52 @@
1
+ import { OpenApiConverter } from '../converters/OpenApiConverter.mjs';
2
+ import { HttpMigrateApplicationComposer } from './internal/HttpMigrateApplicationComposer.mjs';
3
+ import { HttpMigrateRouteFetcher } from './internal/HttpMigrateRouteFetcher.mjs';
4
+
5
+ /**
6
+ * OpenAPI to HTTP migration utilities.
7
+ *
8
+ * `HttpMigration` converts OpenAPI documents into executable HTTP routes
9
+ * ({@link IHttpMigrateApplication}). Unlike {@link HttpLlm} which targets LLM
10
+ * function calling, this focuses on SDK/client code generation.
11
+ *
12
+ * Supports all OpenAPI versions (Swagger 2.0, OpenAPI 3.0, 3.1) through
13
+ * automatic conversion to normalized {@link OpenApi} format.
14
+ *
15
+ * Main functions:
16
+ *
17
+ * - {@link application}: Convert OpenAPI document to
18
+ * {@link IHttpMigrateApplication}
19
+ * - {@link execute}: Call a route and return response body
20
+ * - {@link propagate}: Call a route and return full HTTP response (including
21
+ * non-2xx)
22
+ *
23
+ * @author Jeongho Nam - https://github.com/samchon
24
+ */
25
+ var HttpMigration;
26
+ (function (HttpMigration) {
27
+ /**
28
+ * Convert OpenAPI document to migration application.
29
+ *
30
+ * @param document OpenAPI document (any version)
31
+ * @returns Migration application with callable routes
32
+ */
33
+ HttpMigration.application = (document) => HttpMigrateApplicationComposer.compose(OpenApiConverter.upgradeDocument(document));
34
+ /**
35
+ * Execute HTTP route.
36
+ *
37
+ * @param props Fetch properties
38
+ * @returns Response body
39
+ * @throws HttpError on non-2xx status
40
+ */
41
+ HttpMigration.execute = (props) => HttpMigrateRouteFetcher.execute(props);
42
+ /**
43
+ * Execute HTTP route and return full response.
44
+ *
45
+ * @param props Fetch properties
46
+ * @returns Full HTTP response including non-2xx
47
+ */
48
+ HttpMigration.propagate = (props) => HttpMigrateRouteFetcher.propagate(props);
49
+ })(HttpMigration || (HttpMigration = {}));
50
+
51
+ export { HttpMigration };
52
+ //# sourceMappingURL=HttpMigration.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpMigration.mjs","sources":["../../src/http/HttpMigration.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAeA;;;;;;;;;;;;;;;;;;;AAmBG;AACG,IAAW;AAAjB,CAAA,UAAiB,aAAa,EAAA;AAC5B;;;;;AAKG;AACU,IAAA,aAAA,CAAA,WAAW,GAAG,CACzB,QAIyB,KAEzB,8BAA8B,CAAC,OAAO,CACpC,gBAAgB,CAAC,eAAe,CAAC,QAAQ,CAAC,CAC3C;AAEH;;;;;;AAMG;AACU,IAAA,aAAA,CAAA,OAAO,GAAG,CAAC,KAAkB,KACxC,uBAAuB,CAAC,OAAO,CAAC,KAAK,CAAC;AAExC;;;;;AAKG;AACU,IAAA,aAAA,CAAA,SAAS,GAAG,CAAC,KAAkB,KAC1C,uBAAuB,CAAC,SAAS,CAAC,KAAK,CAAC;AAqB5C,CAAC,EAxDgB,aAAa,KAAb,aAAa,GAAA,EAAA,CAAA,CAAA;;;;"}
@@ -0,0 +1,3 @@
1
+ export * from "./HttpError";
2
+ export * from "./HttpLlm";
3
+ export * from "./HttpMigration";
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./HttpError"), exports);
18
+ __exportStar(require("./HttpLlm"), exports);
19
+ __exportStar(require("./HttpMigration"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,4CAA0B;AAC1B,kDAAgC"}
@@ -0,0 +1,4 @@
1
+ export { HttpError } from './HttpError.mjs';
2
+ export { HttpLlm } from './HttpLlm.mjs';
3
+ export { HttpMigration } from './HttpMigration.mjs';
4
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,8 @@
1
+ import { IHttpLlmApplication, IHttpMigrateApplication } from "@typia/interface";
2
+ export declare namespace HttpLlmApplicationComposer {
3
+ const application: (props: {
4
+ migrate: IHttpMigrateApplication;
5
+ config?: Partial<IHttpLlmApplication.IConfig>;
6
+ }) => IHttpLlmApplication;
7
+ const shorten: (app: IHttpLlmApplication, limit?: number) => void;
8
+ }