@typia/interface 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 (311) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +23 -0
  3. package/lib/http/IHttpConnection.d.ts +163 -0
  4. package/lib/http/IHttpConnection.js +4 -0
  5. package/lib/http/IHttpConnection.js.map +1 -0
  6. package/lib/http/IHttpLlmApplication.d.ts +73 -0
  7. package/lib/http/IHttpLlmApplication.js +3 -0
  8. package/lib/http/IHttpLlmApplication.js.map +1 -0
  9. package/lib/http/IHttpLlmController.d.ts +86 -0
  10. package/lib/http/IHttpLlmController.js +3 -0
  11. package/lib/http/IHttpLlmController.js.map +1 -0
  12. package/lib/http/IHttpLlmFunction.d.ts +79 -0
  13. package/lib/http/IHttpLlmFunction.js +3 -0
  14. package/lib/http/IHttpLlmFunction.js.map +1 -0
  15. package/lib/http/IHttpMigrateApplication.d.ts +42 -0
  16. package/lib/http/IHttpMigrateApplication.js +3 -0
  17. package/lib/http/IHttpMigrateApplication.js.map +1 -0
  18. package/lib/http/IHttpMigrateRoute.d.ts +121 -0
  19. package/lib/http/IHttpMigrateRoute.js +3 -0
  20. package/lib/http/IHttpMigrateRoute.js.map +1 -0
  21. package/lib/http/IHttpResponse.d.ts +40 -0
  22. package/lib/http/IHttpResponse.js +3 -0
  23. package/lib/http/IHttpResponse.js.map +1 -0
  24. package/lib/http/index.d.ts +7 -0
  25. package/lib/http/index.js +24 -0
  26. package/lib/http/index.js.map +1 -0
  27. package/lib/index.d.ts +8 -0
  28. package/lib/index.js +48 -0
  29. package/lib/index.js.map +1 -0
  30. package/lib/metadata/IJsDocTagInfo.d.ts +23 -0
  31. package/lib/metadata/IJsDocTagInfo.js +3 -0
  32. package/lib/metadata/IJsDocTagInfo.js.map +1 -0
  33. package/lib/metadata/IMetadataComponents.d.ts +20 -0
  34. package/lib/metadata/IMetadataComponents.js +3 -0
  35. package/lib/metadata/IMetadataComponents.js.map +1 -0
  36. package/lib/metadata/IMetadataSchema.d.ts +219 -0
  37. package/lib/metadata/IMetadataSchema.js +3 -0
  38. package/lib/metadata/IMetadataSchema.js.map +1 -0
  39. package/lib/metadata/IMetadataSchemaCollection.d.ts +18 -0
  40. package/lib/metadata/IMetadataSchemaCollection.js +3 -0
  41. package/lib/metadata/IMetadataSchemaCollection.js.map +1 -0
  42. package/lib/metadata/IMetadataSchemaUnit.d.ts +18 -0
  43. package/lib/metadata/IMetadataSchemaUnit.js +3 -0
  44. package/lib/metadata/IMetadataSchemaUnit.js.map +1 -0
  45. package/lib/metadata/IMetadataTypeTag.d.ts +28 -0
  46. package/lib/metadata/IMetadataTypeTag.js +3 -0
  47. package/lib/metadata/IMetadataTypeTag.js.map +1 -0
  48. package/lib/metadata/index.d.ts +6 -0
  49. package/lib/metadata/index.js +23 -0
  50. package/lib/metadata/index.js.map +1 -0
  51. package/lib/openapi/OpenApi.d.ts +454 -0
  52. package/lib/openapi/OpenApi.js +3 -0
  53. package/lib/openapi/OpenApi.js.map +1 -0
  54. package/lib/openapi/OpenApiV3.d.ts +420 -0
  55. package/lib/openapi/OpenApiV3.js +3 -0
  56. package/lib/openapi/OpenApiV3.js.map +1 -0
  57. package/lib/openapi/OpenApiV3_1.d.ts +463 -0
  58. package/lib/openapi/OpenApiV3_1.js +3 -0
  59. package/lib/openapi/OpenApiV3_1.js.map +1 -0
  60. package/lib/openapi/SwaggerV2.d.ts +343 -0
  61. package/lib/openapi/SwaggerV2.js +3 -0
  62. package/lib/openapi/SwaggerV2.js.map +1 -0
  63. package/lib/openapi/index.d.ts +4 -0
  64. package/lib/openapi/index.js +21 -0
  65. package/lib/openapi/index.js.map +1 -0
  66. package/lib/protobuf/ProtobufWire.d.ts +46 -0
  67. package/lib/protobuf/ProtobufWire.js +3 -0
  68. package/lib/protobuf/ProtobufWire.js.map +1 -0
  69. package/lib/protobuf/index.d.ts +1 -0
  70. package/lib/protobuf/index.js +18 -0
  71. package/lib/protobuf/index.js.map +1 -0
  72. package/lib/schema/IJsonSchemaApplication.d.ts +232 -0
  73. package/lib/schema/IJsonSchemaApplication.js +3 -0
  74. package/lib/schema/IJsonSchemaApplication.js.map +1 -0
  75. package/lib/schema/IJsonSchemaAttribute.d.ts +152 -0
  76. package/lib/schema/IJsonSchemaAttribute.js +3 -0
  77. package/lib/schema/IJsonSchemaAttribute.js.map +1 -0
  78. package/lib/schema/IJsonSchemaCollection.d.ts +109 -0
  79. package/lib/schema/IJsonSchemaCollection.js +3 -0
  80. package/lib/schema/IJsonSchemaCollection.js.map +1 -0
  81. package/lib/schema/IJsonSchemaTransformError.d.ts +81 -0
  82. package/lib/schema/IJsonSchemaTransformError.js +3 -0
  83. package/lib/schema/IJsonSchemaTransformError.js.map +1 -0
  84. package/lib/schema/IJsonSchemaUnit.d.ts +106 -0
  85. package/lib/schema/IJsonSchemaUnit.js +3 -0
  86. package/lib/schema/IJsonSchemaUnit.js.map +1 -0
  87. package/lib/schema/ILlmApplication.d.ts +95 -0
  88. package/lib/schema/ILlmApplication.js +3 -0
  89. package/lib/schema/ILlmApplication.js.map +1 -0
  90. package/lib/schema/ILlmController.d.ts +53 -0
  91. package/lib/schema/ILlmController.js +3 -0
  92. package/lib/schema/ILlmController.js.map +1 -0
  93. package/lib/schema/ILlmFunction.d.ts +134 -0
  94. package/lib/schema/ILlmFunction.js +3 -0
  95. package/lib/schema/ILlmFunction.js.map +1 -0
  96. package/lib/schema/ILlmSchema.d.ts +412 -0
  97. package/lib/schema/ILlmSchema.js +3 -0
  98. package/lib/schema/ILlmSchema.js.map +1 -0
  99. package/lib/schema/IResult.d.ts +81 -0
  100. package/lib/schema/IResult.js +3 -0
  101. package/lib/schema/IResult.js.map +1 -0
  102. package/lib/schema/IValidation.d.ts +123 -0
  103. package/lib/schema/IValidation.js +3 -0
  104. package/lib/schema/IValidation.js.map +1 -0
  105. package/lib/schema/index.d.ts +11 -0
  106. package/lib/schema/index.js +28 -0
  107. package/lib/schema/index.js.map +1 -0
  108. package/lib/tags/Constant.d.ts +44 -0
  109. package/lib/tags/Constant.js +3 -0
  110. package/lib/tags/Constant.js.map +1 -0
  111. package/lib/tags/ContentMediaType.d.ts +39 -0
  112. package/lib/tags/ContentMediaType.js +3 -0
  113. package/lib/tags/ContentMediaType.js.map +1 -0
  114. package/lib/tags/Default.d.ts +42 -0
  115. package/lib/tags/Default.js +3 -0
  116. package/lib/tags/Default.js.map +1 -0
  117. package/lib/tags/Example.d.ts +38 -0
  118. package/lib/tags/Example.js +3 -0
  119. package/lib/tags/Example.js.map +1 -0
  120. package/lib/tags/Examples.d.ts +44 -0
  121. package/lib/tags/Examples.js +3 -0
  122. package/lib/tags/Examples.js.map +1 -0
  123. package/lib/tags/ExclusiveMaximum.d.ts +39 -0
  124. package/lib/tags/ExclusiveMaximum.js +3 -0
  125. package/lib/tags/ExclusiveMaximum.js.map +1 -0
  126. package/lib/tags/ExclusiveMinimum.d.ts +39 -0
  127. package/lib/tags/ExclusiveMinimum.js +3 -0
  128. package/lib/tags/ExclusiveMinimum.js.map +1 -0
  129. package/lib/tags/Format.d.ts +43 -0
  130. package/lib/tags/Format.js +3 -0
  131. package/lib/tags/Format.js.map +1 -0
  132. package/lib/tags/JsonSchemaPlugin.d.ts +44 -0
  133. package/lib/tags/JsonSchemaPlugin.js +3 -0
  134. package/lib/tags/JsonSchemaPlugin.js.map +1 -0
  135. package/lib/tags/MaxItems.d.ts +38 -0
  136. package/lib/tags/MaxItems.js +3 -0
  137. package/lib/tags/MaxItems.js.map +1 -0
  138. package/lib/tags/MaxLength.d.ts +36 -0
  139. package/lib/tags/MaxLength.js +3 -0
  140. package/lib/tags/MaxLength.js.map +1 -0
  141. package/lib/tags/Maximum.d.ts +41 -0
  142. package/lib/tags/Maximum.js +3 -0
  143. package/lib/tags/Maximum.js.map +1 -0
  144. package/lib/tags/MinItems.d.ts +38 -0
  145. package/lib/tags/MinItems.js +3 -0
  146. package/lib/tags/MinItems.js.map +1 -0
  147. package/lib/tags/MinLength.d.ts +36 -0
  148. package/lib/tags/MinLength.js +3 -0
  149. package/lib/tags/MinLength.js.map +1 -0
  150. package/lib/tags/Minimum.d.ts +41 -0
  151. package/lib/tags/Minimum.js +3 -0
  152. package/lib/tags/Minimum.js.map +1 -0
  153. package/lib/tags/MultipleOf.d.ts +49 -0
  154. package/lib/tags/MultipleOf.js +3 -0
  155. package/lib/tags/MultipleOf.js.map +1 -0
  156. package/lib/tags/Pattern.d.ts +51 -0
  157. package/lib/tags/Pattern.js +3 -0
  158. package/lib/tags/Pattern.js.map +1 -0
  159. package/lib/tags/Sequence.d.ts +42 -0
  160. package/lib/tags/Sequence.js +3 -0
  161. package/lib/tags/Sequence.js.map +1 -0
  162. package/lib/tags/TagBase.d.ts +109 -0
  163. package/lib/tags/TagBase.js +3 -0
  164. package/lib/tags/TagBase.js.map +1 -0
  165. package/lib/tags/Type.d.ts +53 -0
  166. package/lib/tags/Type.js +3 -0
  167. package/lib/tags/Type.js.map +1 -0
  168. package/lib/tags/UniqueItems.d.ts +41 -0
  169. package/lib/tags/UniqueItems.js +3 -0
  170. package/lib/tags/UniqueItems.js.map +1 -0
  171. package/lib/tags/index.d.ts +21 -0
  172. package/lib/tags/index.js +38 -0
  173. package/lib/tags/index.js.map +1 -0
  174. package/lib/typings/AssertionGuard.d.ts +12 -0
  175. package/lib/typings/AssertionGuard.js +3 -0
  176. package/lib/typings/AssertionGuard.js.map +1 -0
  177. package/lib/typings/Atomic.d.ts +19 -0
  178. package/lib/typings/Atomic.js +3 -0
  179. package/lib/typings/Atomic.js.map +1 -0
  180. package/lib/typings/CamelCase.d.ts +26 -0
  181. package/lib/typings/CamelCase.js +3 -0
  182. package/lib/typings/CamelCase.js.map +1 -0
  183. package/lib/typings/ClassProperties.d.ts +14 -0
  184. package/lib/typings/ClassProperties.js +3 -0
  185. package/lib/typings/ClassProperties.js.map +1 -0
  186. package/lib/typings/OmitNever.d.ts +11 -0
  187. package/lib/typings/OmitNever.js +3 -0
  188. package/lib/typings/OmitNever.js.map +1 -0
  189. package/lib/typings/PascalCase.d.ts +25 -0
  190. package/lib/typings/PascalCase.js +3 -0
  191. package/lib/typings/PascalCase.js.map +1 -0
  192. package/lib/typings/Primitive.d.ts +29 -0
  193. package/lib/typings/Primitive.js +3 -0
  194. package/lib/typings/Primitive.js.map +1 -0
  195. package/lib/typings/ProtobufAtomic.d.ts +15 -0
  196. package/lib/typings/ProtobufAtomic.js +3 -0
  197. package/lib/typings/ProtobufAtomic.js.map +1 -0
  198. package/lib/typings/Resolved.d.ts +23 -0
  199. package/lib/typings/Resolved.js +3 -0
  200. package/lib/typings/Resolved.js.map +1 -0
  201. package/lib/typings/SnakeCase.d.ts +31 -0
  202. package/lib/typings/SnakeCase.js +3 -0
  203. package/lib/typings/SnakeCase.js.map +1 -0
  204. package/lib/typings/SpecialFields.d.ts +13 -0
  205. package/lib/typings/SpecialFields.js +3 -0
  206. package/lib/typings/SpecialFields.js.map +1 -0
  207. package/lib/typings/ValidationPipe.d.ts +18 -0
  208. package/lib/typings/ValidationPipe.js +3 -0
  209. package/lib/typings/ValidationPipe.js.map +1 -0
  210. package/lib/typings/index.d.ts +12 -0
  211. package/lib/typings/index.js +29 -0
  212. package/lib/typings/index.js.map +1 -0
  213. package/lib/typings/internal/Equal.d.ts +11 -0
  214. package/lib/typings/internal/Equal.js +3 -0
  215. package/lib/typings/internal/Equal.js.map +1 -0
  216. package/lib/typings/internal/IsTuple.d.ts +13 -0
  217. package/lib/typings/internal/IsTuple.js +3 -0
  218. package/lib/typings/internal/IsTuple.js.map +1 -0
  219. package/lib/typings/internal/NativeClass.d.ts +9 -0
  220. package/lib/typings/internal/NativeClass.js +3 -0
  221. package/lib/typings/internal/NativeClass.js.map +1 -0
  222. package/lib/typings/internal/ValueOf.d.ts +15 -0
  223. package/lib/typings/internal/ValueOf.js +3 -0
  224. package/lib/typings/internal/ValueOf.js.map +1 -0
  225. package/lib/utils/IRandomGenerator.d.ts +68 -0
  226. package/lib/utils/IRandomGenerator.js +3 -0
  227. package/lib/utils/IRandomGenerator.js.map +1 -0
  228. package/lib/utils/IReadableURLSearchParams.d.ts +22 -0
  229. package/lib/utils/IReadableURLSearchParams.js +3 -0
  230. package/lib/utils/IReadableURLSearchParams.js.map +1 -0
  231. package/lib/utils/index.d.ts +2 -0
  232. package/lib/utils/index.js +19 -0
  233. package/lib/utils/index.js.map +1 -0
  234. package/package.json +79 -0
  235. package/src/http/IHttpConnection.ts +200 -0
  236. package/src/http/IHttpLlmApplication.ts +83 -0
  237. package/src/http/IHttpLlmController.ts +96 -0
  238. package/src/http/IHttpLlmFunction.ts +93 -0
  239. package/src/http/IHttpMigrateApplication.ts +48 -0
  240. package/src/http/IHttpMigrateRoute.ts +165 -0
  241. package/src/http/IHttpResponse.ts +42 -0
  242. package/src/http/index.ts +7 -0
  243. package/src/index.ts +9 -0
  244. package/src/metadata/IJsDocTagInfo.ts +25 -0
  245. package/src/metadata/IMetadataComponents.ts +24 -0
  246. package/src/metadata/IMetadataSchema.ts +293 -0
  247. package/src/metadata/IMetadataSchemaCollection.ts +20 -0
  248. package/src/metadata/IMetadataSchemaUnit.ts +20 -0
  249. package/src/metadata/IMetadataTypeTag.ts +39 -0
  250. package/src/metadata/index.ts +6 -0
  251. package/src/openapi/OpenApi.ts +643 -0
  252. package/src/openapi/OpenApiV3.ts +655 -0
  253. package/src/openapi/OpenApiV3_1.ts +735 -0
  254. package/src/openapi/SwaggerV2.ts +559 -0
  255. package/src/openapi/index.ts +4 -0
  256. package/src/protobuf/ProtobufWire.ts +51 -0
  257. package/src/protobuf/index.ts +1 -0
  258. package/src/schema/IJsonSchemaApplication.ts +274 -0
  259. package/src/schema/IJsonSchemaAttribute.ts +158 -0
  260. package/src/schema/IJsonSchemaCollection.ts +123 -0
  261. package/src/schema/IJsonSchemaTransformError.ts +86 -0
  262. package/src/schema/IJsonSchemaUnit.ts +120 -0
  263. package/src/schema/ILlmApplication.ts +103 -0
  264. package/src/schema/ILlmController.ts +57 -0
  265. package/src/schema/ILlmFunction.ts +144 -0
  266. package/src/schema/ILlmSchema.ts +484 -0
  267. package/src/schema/IResult.ts +84 -0
  268. package/src/schema/IValidation.ts +134 -0
  269. package/src/schema/index.ts +13 -0
  270. package/src/tags/Constant.ts +49 -0
  271. package/src/tags/ContentMediaType.ts +40 -0
  272. package/src/tags/Default.ts +50 -0
  273. package/src/tags/Example.ts +48 -0
  274. package/src/tags/Examples.ts +50 -0
  275. package/src/tags/ExclusiveMaximum.ts +46 -0
  276. package/src/tags/ExclusiveMinimum.ts +46 -0
  277. package/src/tags/Format.ts +76 -0
  278. package/src/tags/JsonSchemaPlugin.ts +45 -0
  279. package/src/tags/MaxItems.ts +39 -0
  280. package/src/tags/MaxLength.ts +37 -0
  281. package/src/tags/Maximum.ts +44 -0
  282. package/src/tags/MinItems.ts +39 -0
  283. package/src/tags/MinLength.ts +37 -0
  284. package/src/tags/Minimum.ts +44 -0
  285. package/src/tags/MultipleOf.ts +54 -0
  286. package/src/tags/Pattern.ts +59 -0
  287. package/src/tags/Sequence.ts +43 -0
  288. package/src/tags/TagBase.ts +131 -0
  289. package/src/tags/Type.ts +70 -0
  290. package/src/tags/UniqueItems.ts +44 -0
  291. package/src/tags/index.ts +21 -0
  292. package/src/typings/AssertionGuard.ts +12 -0
  293. package/src/typings/Atomic.ts +21 -0
  294. package/src/typings/CamelCase.ts +75 -0
  295. package/src/typings/ClassProperties.ts +15 -0
  296. package/src/typings/OmitNever.ts +12 -0
  297. package/src/typings/PascalCase.ts +71 -0
  298. package/src/typings/Primitive.ts +71 -0
  299. package/src/typings/ProtobufAtomic.ts +30 -0
  300. package/src/typings/Resolved.ts +58 -0
  301. package/src/typings/SnakeCase.ts +126 -0
  302. package/src/typings/SpecialFields.ts +13 -0
  303. package/src/typings/ValidationPipe.ts +20 -0
  304. package/src/typings/index.ts +13 -0
  305. package/src/typings/internal/Equal.ts +14 -0
  306. package/src/typings/internal/IsTuple.ts +17 -0
  307. package/src/typings/internal/NativeClass.ts +31 -0
  308. package/src/typings/internal/ValueOf.ts +29 -0
  309. package/src/utils/IRandomGenerator.ts +105 -0
  310. package/src/utils/IReadableURLSearchParams.ts +25 -0
  311. package/src/utils/index.ts +2 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Jeongho Nam
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # `@typia/interface`
2
+
3
+ [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/typia/blob/master/LICENSE)
4
+ [![NPM Version](https://img.shields.io/npm/v/typia.svg)](https://www.npmjs.com/package/typia)
5
+ [![NPM Downloads](https://img.shields.io/npm/dm/typia.svg)](https://www.npmjs.com/package/typia)
6
+
7
+ Shared type definitions and interfaces for the [`typia`](https://github.com/samchon/typia) ecosystem.
8
+
9
+ This is an **internal package** of `typia`. You don't need to install it directly — it is automatically included as a dependency of `typia`.
10
+
11
+ ## Key Interfaces
12
+
13
+ | Module | Description |
14
+ |--------|-------------|
15
+ | `ILlmApplication` | LLM function calling application schema |
16
+ | `ILlmController` | Class-based LLM controller |
17
+ | `ILlmSchema` | LLM schema definition |
18
+ | `IJsonSchemaCollection` | JSON Schema collection |
19
+ | `IValidation` | Validation result (success/failure with errors) |
20
+ | `IHttpLlmApplication` | HTTP-based LLM application schema |
21
+ | `IHttpLlmController` | HTTP-based LLM controller |
22
+ | `IHttpConnection` | API connection configuration |
23
+ | `tags` | Decorator tags (`Format`, `Minimum`, `Maximum`, `Pattern`, etc.) |
@@ -0,0 +1,163 @@
1
+ /**
2
+ * HTTP connection configuration for remote server communication.
3
+ *
4
+ * `IHttpConnection` defines connection settings required to communicate with
5
+ * remote HTTP servers. This interface is primarily used by `@nestia/fetcher`
6
+ * and generated SDK functions to establish HTTP connections.
7
+ *
8
+ * The {@link host} property specifies the base URL of the target server, while
9
+ * {@link headers} allows passing custom HTTP headers with each request. For
10
+ * fine-grained control over fetch behavior, use {@link options} to configure
11
+ * caching, CORS, credentials, and other fetch API settings.
12
+ *
13
+ * In Node.js versions prior to 20 (which lack native fetch), provide a polyfill
14
+ * like `node-fetch` via the {@link fetch} property.
15
+ *
16
+ * @author Jeongho Nam - https://github.com/samchon
17
+ * @author Seungjun We - https://github.com/SeungjunWe
18
+ */
19
+ export interface IHttpConnection {
20
+ /**
21
+ * Base URL of the remote HTTP server.
22
+ *
23
+ * Must include protocol (http:// or https://) and may include port. Example:
24
+ * `"https://api.example.com"` or `"http://localhost:3000"`.
25
+ */
26
+ host: string;
27
+ /**
28
+ * Custom HTTP headers to send with every request.
29
+ *
30
+ * Common use cases include authentication tokens, API keys, and content
31
+ * negotiation headers. Values can be primitives or arrays.
32
+ */
33
+ headers?: Record<string, IHttpConnection.HeaderValue>;
34
+ /**
35
+ * Additional fetch API options.
36
+ *
37
+ * Configure caching, CORS mode, credentials handling, and other
38
+ * fetch-specific behaviors. These options are passed directly to the
39
+ * underlying fetch call.
40
+ */
41
+ options?: IHttpConnection.IOptions;
42
+ /**
43
+ * Custom fetch function implementation.
44
+ *
45
+ * For Node.js versions before 20 that lack native fetch support, provide a
46
+ * polyfill such as `node-fetch`. This allows the same connection
47
+ * configuration to work across all Node.js versions.
48
+ *
49
+ * @example
50
+ * import fetch from "node-fetch";
51
+ *
52
+ * const connection: IHttpConnection = {
53
+ * host: "https://api.example.com",
54
+ * fetch: fetch as any,
55
+ * };
56
+ */
57
+ fetch?: typeof fetch;
58
+ }
59
+ export declare namespace IHttpConnection {
60
+ /**
61
+ * Fetch API request options.
62
+ *
63
+ * Subset of the standard `RequestInit` interface, excluding properties that
64
+ * are managed internally (body, headers, method). These options control
65
+ * caching, CORS, credentials, and request lifecycle behavior.
66
+ */
67
+ interface IOptions {
68
+ /**
69
+ * Request cache mode.
70
+ *
71
+ * Controls how the request interacts with the browser's HTTP cache.
72
+ *
73
+ * - `"default"`: Standard browser caching behavior
74
+ * - `"no-store"`: Bypass cache completely, don't store response
75
+ * - `"reload"`: Bypass cache, but store response
76
+ * - `"no-cache"`: Validate with server before using cache
77
+ * - `"force-cache"`: Use cache even if stale
78
+ * - `"only-if-cached"`: Only use cache, fail if not cached
79
+ */
80
+ cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
81
+ /**
82
+ * Credentials inclusion mode.
83
+ *
84
+ * Controls whether cookies and HTTP authentication are sent.
85
+ *
86
+ * - `"omit"`: Never send credentials
87
+ * - `"same-origin"`: Send credentials only for same-origin requests
88
+ * - `"include"`: Always send credentials, even cross-origin
89
+ */
90
+ credentials?: "omit" | "same-origin" | "include";
91
+ /**
92
+ * Subresource integrity hash for verification.
93
+ *
94
+ * A cryptographic hash (e.g., `"sha256-abc123..."`) to verify the fetched
95
+ * resource hasn't been tampered with. The browser will reject responses
96
+ * that don't match the expected hash.
97
+ */
98
+ integrity?: string;
99
+ /**
100
+ * Whether to keep the connection alive after page unload.
101
+ *
102
+ * When `true`, the request can outlive the page that initiated it. Useful
103
+ * for analytics or logging requests that should complete even if the user
104
+ * navigates away.
105
+ */
106
+ keepalive?: boolean;
107
+ /**
108
+ * CORS (Cross-Origin Resource Sharing) mode.
109
+ *
110
+ * Controls cross-origin request behavior.
111
+ *
112
+ * - `"cors"`: Standard CORS request (requires server support)
113
+ * - `"no-cors"`: Limited cross-origin request (opaque response)
114
+ * - `"same-origin"`: Only allow same-origin requests
115
+ * - `"navigate"`: For navigation requests (used by browsers)
116
+ */
117
+ mode?: "cors" | "navigate" | "no-cors" | "same-origin";
118
+ /**
119
+ * HTTP redirect handling behavior.
120
+ *
121
+ * - `"follow"`: Automatically follow redirects (default)
122
+ * - `"error"`: Throw an error on redirect
123
+ * - `"manual"`: Return redirect response for manual handling
124
+ */
125
+ redirect?: "error" | "follow" | "manual";
126
+ /**
127
+ * Referrer URL to send with the request.
128
+ *
129
+ * Overrides the default referrer. Use empty string to suppress the referrer
130
+ * header entirely.
131
+ */
132
+ referrer?: string;
133
+ /**
134
+ * Policy for how much referrer information to include.
135
+ *
136
+ * Controls what referrer information is sent with requests. More
137
+ * restrictive policies improve privacy but may break some server-side
138
+ * analytics or security checks.
139
+ */
140
+ referrerPolicy?: "" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
141
+ /**
142
+ * AbortSignal for request cancellation.
143
+ *
144
+ * Connect to an AbortController to enable cancellation of in-flight
145
+ * requests. When the signal is aborted, the fetch promise rejects with an
146
+ * AbortError.
147
+ *
148
+ * @example
149
+ * const controller = new AbortController();
150
+ * const options = { signal: controller.signal };
151
+ * // Later: controller.abort();
152
+ */
153
+ signal?: AbortSignal | null;
154
+ }
155
+ /**
156
+ * Allowed types for HTTP header values.
157
+ *
158
+ * Supports primitive types (string, boolean, number, bigint) and arrays of
159
+ * primitives. Arrays are typically joined with commas when sent as HTTP
160
+ * headers.
161
+ */
162
+ type HeaderValue = string | boolean | number | bigint | Array<boolean> | Array<number> | Array<bigint> | Array<string>;
163
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ /// <reference lib="dom" />
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=IHttpConnection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IHttpConnection.js","sourceRoot":"","sources":["../../src/http/IHttpConnection.ts"],"names":[],"mappings":";AAAA,2BAA2B"}
@@ -0,0 +1,73 @@
1
+ import { OpenApi } from "../openapi/OpenApi";
2
+ import { ILlmSchema } from "../schema/ILlmSchema";
3
+ import { IHttpLlmFunction } from "./IHttpLlmFunction";
4
+ import { IHttpMigrateRoute } from "./IHttpMigrateRoute";
5
+ /**
6
+ * LLM function calling application from OpenAPI document.
7
+ *
8
+ * `IHttpLlmApplication` is a collection of {@link IHttpLlmFunction} schemas
9
+ * converted from {@link OpenApi.IDocument} by `HttpLlm.application()`. Each
10
+ * OpenAPI operation becomes an LLM-callable function.
11
+ *
12
+ * Successful conversions go to {@link functions}, failed ones to {@link errors}
13
+ * with detailed error messages. Common failure causes:
14
+ *
15
+ * - Unsupported schema features (tuples, `oneOf` with incompatible types)
16
+ * - Missing required fields in OpenAPI document
17
+ * - Operations marked with `x-samchon-human: true`
18
+ *
19
+ * Configure behavior via {@link IHttpLlmApplication.IConfig}:
20
+ *
21
+ * - {@link IHttpLlmApplication.IConfig.separate}: Split LLM vs human parameters
22
+ * - {@link IHttpLlmApplication.IConfig.maxLength}: Function name length limit
23
+ * - {@link ILlmSchema.IConfig.strict}: OpenAI structured output mode
24
+ *
25
+ * @author Jeongho Nam - https://github.com/samchon
26
+ */
27
+ export interface IHttpLlmApplication {
28
+ /** Successfully converted LLM function schemas. */
29
+ functions: IHttpLlmFunction[];
30
+ /** Operations that failed conversion. */
31
+ errors: IHttpLlmApplication.IError[];
32
+ /** Configuration used for composition. */
33
+ config: IHttpLlmApplication.IConfig;
34
+ }
35
+ export declare namespace IHttpLlmApplication {
36
+ /** Configuration for HTTP LLM application composition. */
37
+ interface IConfig extends ILlmSchema.IConfig {
38
+ /**
39
+ * Separates parameters into LLM and human parts.
40
+ *
41
+ * Use for file uploads or sensitive data that LLM cannot handle. Return
42
+ * `true` for human-composed, `false` for LLM-composed.
43
+ *
44
+ * @default null
45
+ */
46
+ separate: null | ((schema: ILlmSchema) => boolean);
47
+ /**
48
+ * Maximum function name length. Truncated or UUID if exceeded.
49
+ *
50
+ * @default 64
51
+ */
52
+ maxLength: number;
53
+ /**
54
+ * Whether to disallow superfluous properties.
55
+ *
56
+ * @default false
57
+ */
58
+ equals: boolean;
59
+ }
60
+ /** Composition error for an operation. */
61
+ interface IError {
62
+ /** HTTP method of the failed operation. */
63
+ method: "get" | "post" | "put" | "patch" | "delete" | "head";
64
+ /** Path of the failed operation. */
65
+ path: string;
66
+ /** Error messages describing the failure. */
67
+ messages: string[];
68
+ /** Returns source {@link OpenApi.IOperation}. */
69
+ operation: () => OpenApi.IOperation;
70
+ /** Returns source route. Undefined if error occurred at migration level. */
71
+ route: () => IHttpMigrateRoute | undefined;
72
+ }
73
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IHttpLlmApplication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IHttpLlmApplication.js","sourceRoot":"","sources":["../../src/http/IHttpLlmApplication.ts"],"names":[],"mappings":""}
@@ -0,0 +1,86 @@
1
+ import { IHttpConnection } from "./IHttpConnection";
2
+ import { IHttpLlmApplication } from "./IHttpLlmApplication";
3
+ import { IHttpLlmFunction } from "./IHttpLlmFunction";
4
+ import { IHttpResponse } from "./IHttpResponse";
5
+ /**
6
+ * Controller of HTTP LLM function calling.
7
+ *
8
+ * `IHttpLlmController` is a controller for registering OpenAPI operations as
9
+ * LLM function calling tools. It contains {@link IHttpLlmApplication} with
10
+ * {@link IHttpLlmFunction function calling schemas}, {@link name identifier},
11
+ * and {@link connection} to the API server.
12
+ *
13
+ * You can create this controller with {@link HttpLlm.controller} function,
14
+ * and register it to MCP server with {@link registerMcpControllers}:
15
+ *
16
+ * ```typescript
17
+ * import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
18
+ * import { HttpLlm } from "@typia/utils";
19
+ * import { registerMcpControllers } from "@typia/mcp";
20
+ *
21
+ * const server = new McpServer({ name: "my-server", version: "1.0.0" });
22
+ * registerMcpControllers({
23
+ * server,
24
+ * controllers: [
25
+ * HttpLlm.controller({
26
+ * name: "shopping",
27
+ * document: await fetch(
28
+ * "https://shopping-be.wrtn.io/editor/swagger.json",
29
+ * ).then((r) => r.json()),
30
+ * connection: {
31
+ * host: "https://shopping-be.wrtn.io",
32
+ * headers: {
33
+ * Authorization: "Bearer ********",
34
+ * },
35
+ * },
36
+ * }),
37
+ * ],
38
+ * });
39
+ * ```
40
+ *
41
+ * For TypeScript class-based controller, use {@link ILlmController} instead.
42
+ *
43
+ * @author Jeongho Nam - https://github.com/samchon
44
+ */
45
+ export interface IHttpLlmController {
46
+ /** Protocol discriminator. */
47
+ protocol: "http";
48
+ /** Identifier name of the controller. */
49
+ name: string;
50
+ /** Application schema of function calling. */
51
+ application: IHttpLlmApplication;
52
+ /**
53
+ * Connection to the server.
54
+ *
55
+ * Connection to the API server including the URL and headers.
56
+ */
57
+ connection: IHttpConnection;
58
+ /**
59
+ * Executor of the API function.
60
+ *
61
+ * Default executor is {@link HttpLlm.execute} function, and you can override
62
+ * it with your own function.
63
+ *
64
+ * @param props Properties of the API function call
65
+ * @returns HTTP response of the API function call
66
+ */
67
+ execute?: undefined | ((props: {
68
+ /** Connection to the server. */
69
+ connection: IHttpConnection;
70
+ /** Application schema. */
71
+ application: IHttpLlmApplication;
72
+ /** Function schema. */
73
+ function: IHttpLlmFunction;
74
+ /**
75
+ * Arguments of the function calling.
76
+ *
77
+ * It is an object of key-value pairs of the API function's parameters.
78
+ * The property keys are composed by below rules:
79
+ *
80
+ * - Parameter names
81
+ * - Query parameter as an object type if exists
82
+ * - Body parameter if exists
83
+ */
84
+ arguments: object;
85
+ }) => Promise<IHttpResponse>);
86
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IHttpLlmController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IHttpLlmController.js","sourceRoot":"","sources":["../../src/http/IHttpLlmController.ts"],"names":[],"mappings":""}
@@ -0,0 +1,79 @@
1
+ import { OpenApi } from "../openapi/OpenApi";
2
+ import { ILlmSchema } from "../schema/ILlmSchema";
3
+ import { IValidation } from "../schema/IValidation";
4
+ import { IHttpMigrateRoute } from "./IHttpMigrateRoute";
5
+ /**
6
+ * LLM function calling schema from OpenAPI operation.
7
+ *
8
+ * `IHttpLlmFunction` represents a single HTTP endpoint converted to LLM
9
+ * function calling format. Generated from {@link OpenApi.IOperation} as part of
10
+ * {@link IHttpLlmApplication}.
11
+ *
12
+ * Key properties:
13
+ *
14
+ * - {@link name}: Function name (max 64 chars for OpenAI compatibility)
15
+ * - {@link parameters}: Input schema with path/query/body merged
16
+ * - {@link output}: Response schema (undefined if void)
17
+ * - {@link description}: Critical for LLM function selection
18
+ * - {@link validate}: Built-in argument validator for error feedback
19
+ *
20
+ * The {@link validate} function is essential: LLMs make frequent type errors
21
+ * (e.g., `"123"` instead of `123`). Validate and retry improves success rate
22
+ * from ~50% to 99%.
23
+ *
24
+ * @author Jeongho Nam - https://github.com/samchon
25
+ */
26
+ export interface IHttpLlmFunction {
27
+ /** HTTP method of the endpoint. */
28
+ method: "get" | "post" | "patch" | "put" | "delete";
29
+ /** Path of the endpoint. */
30
+ path: string;
31
+ /**
32
+ * Function name composed from {@link IHttpMigrateRoute.accessor}.
33
+ *
34
+ * @maxLength 64
35
+ */
36
+ name: string;
37
+ /**
38
+ * Parameter schema.
39
+ *
40
+ * With keyword mode: single object with pathParameters, query, body merged.
41
+ * Without keyword mode: array of [pathParameters..., query?, body?].
42
+ */
43
+ parameters: ILlmSchema.IParameters;
44
+ /**
45
+ * Separated parameters when {@link IHttpLlmApplication.IConfig.separate} is
46
+ * set.
47
+ */
48
+ separated?: IHttpLlmFunction.ISeparated;
49
+ /** Return type schema. Undefined if void. */
50
+ output?: ILlmSchema | undefined;
51
+ /** Function description for LLM context. Critical for function selection. */
52
+ description?: string | undefined;
53
+ /** Whether the function is deprecated. */
54
+ deprecated?: boolean | undefined;
55
+ /** Category tags from {@link OpenApi.IOperation.tags}. */
56
+ tags?: string[];
57
+ /**
58
+ * Validates LLM-composed arguments.
59
+ *
60
+ * LLMs frequently make type errors. Use this to provide validation feedback
61
+ * and retry. Success rate improves from ~50% to 99% on retry.
62
+ */
63
+ validate: (args: unknown) => IValidation<unknown>;
64
+ /** Returns the source {@link OpenApi.IOperation}. */
65
+ operation: () => OpenApi.IOperation;
66
+ /** Returns the source {@link IHttpMigrateRoute}. */
67
+ route: () => IHttpMigrateRoute;
68
+ }
69
+ export declare namespace IHttpLlmFunction {
70
+ /** Collection of separated parameters. */
71
+ interface ISeparated {
72
+ /** Parameters for LLM composition. Always at least empty object. */
73
+ llm: ILlmSchema.IParameters;
74
+ /** Parameters for human composition. */
75
+ human: ILlmSchema.IParameters | null;
76
+ /** Validates separated LLM arguments. */
77
+ validate?: ((args: unknown) => IValidation<unknown>) | undefined;
78
+ }
79
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IHttpLlmFunction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IHttpLlmFunction.js","sourceRoot":"","sources":["../../src/http/IHttpLlmFunction.ts"],"names":[],"mappings":""}
@@ -0,0 +1,42 @@
1
+ import { OpenApi } from "../openapi/OpenApi";
2
+ import { IHttpMigrateRoute } from "./IHttpMigrateRoute";
3
+ /**
4
+ * Migrated application from OpenAPI document.
5
+ *
6
+ * `IHttpMigrateApplication` converts OpenAPI operations into callable HTTP
7
+ * routes via `HttpMigration.application()`. Unlike {@link IHttpLlmApplication}
8
+ * which targets LLM function calling, this focuses on SDK/client code
9
+ * generation with full HTTP semantics.
10
+ *
11
+ * Each {@link IHttpMigrateRoute} represents a single API endpoint with:
12
+ *
13
+ * - Resolved path parameters (`:id` format)
14
+ * - Combined query/header schemas as objects
15
+ * - Request/response body with content type
16
+ * - Accessor path for RPC-style function naming
17
+ *
18
+ * Failed operations go to {@link errors} with detailed messages.
19
+ *
20
+ * @author Jeongho Nam - https://github.com/samchon
21
+ */
22
+ export interface IHttpMigrateApplication {
23
+ /** Successfully migrated routes. */
24
+ routes: IHttpMigrateRoute[];
25
+ /** Operations that failed migration. */
26
+ errors: IHttpMigrateApplication.IError[];
27
+ /** Returns source OpenAPI document. */
28
+ document: () => OpenApi.IDocument;
29
+ }
30
+ export declare namespace IHttpMigrateApplication {
31
+ /** Migration error for an operation. */
32
+ interface IError {
33
+ /** Returns source operation. */
34
+ operation: () => OpenApi.IOperation;
35
+ /** HTTP method. */
36
+ method: "head" | "get" | "post" | "put" | "patch" | "delete";
37
+ /** Operation path. */
38
+ path: string;
39
+ /** Error messages. */
40
+ messages: string[];
41
+ }
42
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IHttpMigrateApplication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IHttpMigrateApplication.js","sourceRoot":"","sources":["../../src/http/IHttpMigrateApplication.ts"],"names":[],"mappings":""}
@@ -0,0 +1,121 @@
1
+ import { OpenApi } from "../openapi/OpenApi";
2
+ /**
3
+ * HTTP route converted from OpenAPI operation.
4
+ *
5
+ * `IHttpMigrateRoute` represents a single API endpoint with all
6
+ * request/response schemas resolved and ready for code generation. Contains
7
+ * {@link parameters} for URL path variables, {@link query} for query strings,
8
+ * {@link headers}, {@link body} for request payload, and
9
+ * {@link success}/{@link exceptions} for responses.
10
+ *
11
+ * @author Jeongho Nam - https://github.com/samchon
12
+ */
13
+ export interface IHttpMigrateRoute {
14
+ /** HTTP method. Operations with other methods are ignored. */
15
+ method: "head" | "get" | "post" | "put" | "patch" | "delete";
16
+ /** Original path from OpenAPI document. */
17
+ path: string;
18
+ /** Emended path with `:param` format, always starts with `/`. */
19
+ emendedPath: string;
20
+ /**
21
+ * Accessor path for generated RPC function.
22
+ *
23
+ * Namespaces from static path segments, function name from method +
24
+ * parameters. `delete` becomes `erase` to avoid reserved keyword.
25
+ */
26
+ accessor: string[];
27
+ /** Path parameters only. */
28
+ parameters: IHttpMigrateRoute.IParameter[];
29
+ /** Combined headers as single object. Null if none. */
30
+ headers: IHttpMigrateRoute.IHeaders | null;
31
+ /** Combined query parameters as single object. Null if none. */
32
+ query: IHttpMigrateRoute.IQuery | null;
33
+ /** Request body metadata. Null if none. */
34
+ body: IHttpMigrateRoute.IBody | null;
35
+ /** Success response (200/201). Null if void return. */
36
+ success: IHttpMigrateRoute.ISuccess | null;
37
+ /** Exception responses keyed by status code. */
38
+ exceptions: Record<string, IHttpMigrateRoute.IException>;
39
+ /** Returns description comment for the RPC function. */
40
+ comment: () => string;
41
+ /** Returns source {@link OpenApi.IOperation}. */
42
+ operation: () => OpenApi.IOperation;
43
+ }
44
+ export declare namespace IHttpMigrateRoute {
45
+ /** Path parameter metadata. */
46
+ interface IParameter {
47
+ /** Parameter name in path template. */
48
+ name: string;
49
+ /** Parameter variable key. */
50
+ key: string;
51
+ /** Parameter type schema. */
52
+ schema: OpenApi.IJsonSchema;
53
+ /** Returns source parameter definition. */
54
+ parameter: () => OpenApi.IOperation.IParameter;
55
+ }
56
+ /** Headers metadata. */
57
+ interface IHeaders {
58
+ /** Combined headers parameter name. */
59
+ name: string;
60
+ /** Headers variable key. */
61
+ key: string;
62
+ /** Combined headers schema. */
63
+ schema: OpenApi.IJsonSchema;
64
+ /** Returns title. */
65
+ title: () => string | undefined;
66
+ /** Returns description. */
67
+ description: () => string | undefined;
68
+ /** Returns example value. */
69
+ example: () => any | undefined;
70
+ /** Returns named examples. */
71
+ examples: () => Record<string, any> | undefined;
72
+ }
73
+ /** Query parameters metadata. */
74
+ interface IQuery {
75
+ /** Combined query parameter name. */
76
+ name: string;
77
+ /** Query variable key. */
78
+ key: string;
79
+ /** Combined query schema. */
80
+ schema: OpenApi.IJsonSchema;
81
+ /** Returns title. */
82
+ title: () => string | undefined;
83
+ /** Returns description. */
84
+ description: () => string | undefined;
85
+ /** Returns example value. */
86
+ example: () => any | undefined;
87
+ /** Returns named examples. */
88
+ examples: () => Record<string, any> | undefined;
89
+ }
90
+ /** Request body metadata. */
91
+ interface IBody {
92
+ /** Body parameter name. */
93
+ name: string;
94
+ /** Body variable key. */
95
+ key: string;
96
+ /** Content media type. */
97
+ type: "text/plain" | "application/json" | "application/x-www-form-urlencoded" | "multipart/form-data";
98
+ /** Body type schema. */
99
+ schema: OpenApi.IJsonSchema;
100
+ /** Returns description. */
101
+ description: () => string | undefined;
102
+ /** Returns source media type definition. */
103
+ media: () => OpenApi.IOperation.IMediaType;
104
+ /** Nestia encryption flag. */
105
+ "x-nestia-encrypted"?: boolean;
106
+ }
107
+ /** Success response metadata. */
108
+ interface ISuccess extends IBody {
109
+ /** HTTP status code. */
110
+ status: string;
111
+ }
112
+ /** Exception response metadata. */
113
+ interface IException {
114
+ /** Exception type schema. */
115
+ schema: OpenApi.IJsonSchema;
116
+ /** Returns source response definition. */
117
+ response: () => OpenApi.IOperation.IResponse;
118
+ /** Returns source media type definition. */
119
+ media: () => OpenApi.IOperation.IMediaType;
120
+ }
121
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IHttpMigrateRoute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IHttpMigrateRoute.js","sourceRoot":"","sources":["../../src/http/IHttpMigrateRoute.ts"],"names":[],"mappings":""}