@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
@@ -0,0 +1,420 @@
1
+ import { IJsonSchemaAttribute } from "../schema/IJsonSchemaAttribute";
2
+ import * as tags from "../tags";
3
+ /**
4
+ * OpenAPI v3.0 specification types.
5
+ *
6
+ * `OpenApiV3` contains TypeScript type definitions for OpenAPI v3.0 documents.
7
+ * Used for parsing and generating OpenAPI v3.0 specifications. For a normalized
8
+ * format that unifies all OpenAPI versions, use {@link OpenApi} instead.
9
+ *
10
+ * Key differences from v3.1:
11
+ *
12
+ * - Uses `nullable: true` instead of `type: ["string", "null"]`
13
+ * - No `const` keyword support
14
+ * - No `prefixItems` for tuples
15
+ *
16
+ * @author Jeongho Nam - https://github.com/samchon
17
+ */
18
+ export declare namespace OpenApiV3 {
19
+ /** HTTP method of the operation. */
20
+ type Method = "get" | "post" | "put" | "delete" | "options" | "head" | "patch" | "trace";
21
+ /** OpenAPI document structure. */
22
+ interface IDocument {
23
+ /** OpenAPI version. */
24
+ openapi: "3.0" | `3.0.${number}`;
25
+ /** List of servers. */
26
+ servers?: IServer[];
27
+ /** API metadata. */
28
+ info?: IDocument.IInfo;
29
+ /** Reusable components. */
30
+ components?: IComponents;
31
+ /** API paths and operations. */
32
+ paths?: Record<string, IPath>;
33
+ /** Global security requirements. */
34
+ security?: Record<string, string[]>[];
35
+ /** Tag definitions. */
36
+ tags?: IDocument.ITag[];
37
+ }
38
+ namespace IDocument {
39
+ /** API metadata. */
40
+ interface IInfo {
41
+ /** API title. */
42
+ title: string;
43
+ /** API description. */
44
+ description?: string;
45
+ /** Terms of service URL. */
46
+ termsOfService?: string;
47
+ /** Contact information. */
48
+ contact?: IContact;
49
+ /** License information. */
50
+ license?: ILicense;
51
+ /** API version. */
52
+ version: string;
53
+ }
54
+ /** Tag for grouping operations. */
55
+ interface ITag {
56
+ /** Tag name. */
57
+ name: string;
58
+ /** Tag description. */
59
+ description?: string;
60
+ }
61
+ /** Contact information. */
62
+ interface IContact {
63
+ /** Contact name. */
64
+ name?: string;
65
+ /** Contact URL. */
66
+ url?: string;
67
+ /** Contact email. */
68
+ email?: string & tags.Format<"email">;
69
+ }
70
+ /** License information. */
71
+ interface ILicense {
72
+ /** License name. */
73
+ name: string;
74
+ /** License URL. */
75
+ url?: string;
76
+ }
77
+ }
78
+ /** Server providing the API. */
79
+ interface IServer {
80
+ /** Server URL. */
81
+ url: string;
82
+ /** Server description. */
83
+ description?: string;
84
+ /** URL template variables. */
85
+ variables?: Record<string, IServer.IVariable>;
86
+ }
87
+ namespace IServer {
88
+ /** URL template variable. */
89
+ interface IVariable {
90
+ /** Default value. */
91
+ default: string;
92
+ /** Allowed values. */
93
+ enum?: string[];
94
+ /** Variable description. */
95
+ description?: string;
96
+ }
97
+ }
98
+ /** Path item containing operations by HTTP method. */
99
+ interface IPath extends Partial<Record<Method, IOperation | undefined>> {
100
+ /** Path-level parameters. */
101
+ parameters?: Array<IOperation.IParameter | IJsonSchema.IReference<`#/components/headers/${string}`> | IJsonSchema.IReference<`#/components/parameters/${string}`>>;
102
+ /** Path-level servers. */
103
+ servers?: IServer[];
104
+ /** Path summary. */
105
+ summary?: string;
106
+ /** Path description. */
107
+ description?: string;
108
+ }
109
+ /** API operation metadata. */
110
+ interface IOperation {
111
+ /** Unique operation identifier. */
112
+ operationId?: string;
113
+ /** Operation parameters. */
114
+ parameters?: Array<IOperation.IParameter | IJsonSchema.IReference<`#/components/headers/${string}`> | IJsonSchema.IReference<`#/components/parameters/${string}`>>;
115
+ /** Request body. */
116
+ requestBody?: IOperation.IRequestBody | IJsonSchema.IReference<`#/components/requestBodies/${string}`>;
117
+ /** Response definitions by status code. */
118
+ responses?: Record<string, IOperation.IResponse | IJsonSchema.IReference<`#/components/responses/${string}`>>;
119
+ /** Operation-level servers. */
120
+ servers?: IServer[];
121
+ /** Short summary. */
122
+ summary?: string;
123
+ /** Full description. */
124
+ description?: string;
125
+ /** Security requirements. */
126
+ security?: Record<string, string[]>[];
127
+ /** Operation tags. */
128
+ tags?: string[];
129
+ /** Whether deprecated. */
130
+ deprecated?: boolean;
131
+ }
132
+ namespace IOperation {
133
+ /** Operation parameter. */
134
+ interface IParameter {
135
+ /** Parameter name. */
136
+ name?: string;
137
+ /** Parameter location. */
138
+ in: "path" | "query" | "header" | "cookie";
139
+ /** Parameter schema. */
140
+ schema: IJsonSchema;
141
+ /** Whether required. */
142
+ required?: boolean;
143
+ /** Parameter description. */
144
+ description?: string;
145
+ /** Example value. */
146
+ example?: any;
147
+ /** Named examples. */
148
+ examples?: Record<string, IExample | IJsonSchema.IReference<`#/components/examples/${string}`>>;
149
+ }
150
+ /** Request body. */
151
+ interface IRequestBody {
152
+ /** Body description. */
153
+ description?: string;
154
+ /** Whether required. */
155
+ required?: boolean;
156
+ /** Body content by media type. */
157
+ content?: Record<string, IMediaType>;
158
+ }
159
+ /** Response definition. */
160
+ interface IResponse {
161
+ /** Response content by media type. */
162
+ content?: Record<string, IMediaType>;
163
+ /** Response headers. */
164
+ headers?: Record<string, Omit<IOperation.IParameter, "in"> | IJsonSchema.IReference<`#/components/headers/${string}`>>;
165
+ /** Response description. */
166
+ description?: string;
167
+ }
168
+ /** Media type definition. */
169
+ interface IMediaType {
170
+ /** Content schema. */
171
+ schema?: IJsonSchema;
172
+ /** Example value. */
173
+ example?: any;
174
+ /** Named examples. */
175
+ examples?: Record<string, IExample | IJsonSchema.IReference<`#/components/examples/${string}`>>;
176
+ }
177
+ }
178
+ /** Example value definition. */
179
+ interface IExample {
180
+ /** Example summary. */
181
+ summary?: string;
182
+ /** Example description. */
183
+ description?: string;
184
+ /** Example value. */
185
+ value?: any;
186
+ /** External value URL. */
187
+ externalValue?: string;
188
+ }
189
+ /** Reusable components storage. */
190
+ interface IComponents {
191
+ /** Named schemas. */
192
+ schemas?: Record<string, IJsonSchema>;
193
+ /** Named responses. */
194
+ responses?: Record<string, IOperation.IResponse>;
195
+ /** Named parameters. */
196
+ parameters?: Record<string, IOperation.IParameter>;
197
+ /** Named request bodies. */
198
+ requestBodies?: Record<string, IOperation.IRequestBody>;
199
+ /** Named security schemes. */
200
+ securitySchemes?: Record<string, ISecurityScheme>;
201
+ /** Named headers. */
202
+ headers?: Record<string, Omit<IOperation.IParameter, "in">>;
203
+ /** Named examples. */
204
+ examples?: Record<string, IExample>;
205
+ }
206
+ /** JSON Schema type for OpenAPI v3.0. */
207
+ type IJsonSchema = IJsonSchema.IBoolean | IJsonSchema.IInteger | IJsonSchema.INumber | IJsonSchema.IString | IJsonSchema.IArray | IJsonSchema.IObject | IJsonSchema.IReference | IJsonSchema.IAllOf | IJsonSchema.IAnyOf | IJsonSchema.IOneOf | IJsonSchema.INullOnly | IJsonSchema.IUnknown;
208
+ namespace IJsonSchema {
209
+ /** Boolean type. */
210
+ interface IBoolean extends Omit<IJsonSchemaAttribute.IBoolean, "examples">, __IAttribute {
211
+ /** Whether nullable. */
212
+ nullable?: boolean;
213
+ /** Default value. */
214
+ default?: boolean | null;
215
+ /** Allowed values. */
216
+ enum?: Array<boolean | null>;
217
+ }
218
+ /** Integer type. */
219
+ interface IInteger extends Omit<IJsonSchemaAttribute.IInteger, "examples">, __IAttribute {
220
+ /** Whether nullable. */
221
+ nullable?: boolean;
222
+ /** Default value. */
223
+ default?: (number & tags.Type<"int64">) | null;
224
+ /** Allowed values. */
225
+ enum?: Array<(number & tags.Type<"int64">) | null>;
226
+ /** Minimum value. */
227
+ minimum?: number & tags.Type<"int64">;
228
+ /** Maximum value. */
229
+ maximum?: number & tags.Type<"int64">;
230
+ /** Exclusive minimum. */
231
+ exclusiveMinimum?: number | boolean;
232
+ /** Exclusive maximum. */
233
+ exclusiveMaximum?: number | boolean;
234
+ /** Multiple of constraint. */
235
+ multipleOf?: number & tags.ExclusiveMinimum<0>;
236
+ }
237
+ /** Number (double) type. */
238
+ interface INumber extends Omit<IJsonSchemaAttribute.INumber, "examples">, __IAttribute {
239
+ /** Whether nullable. */
240
+ nullable?: boolean;
241
+ /** Default value. */
242
+ default?: number | null;
243
+ /** Allowed values. */
244
+ enum?: Array<number | null>;
245
+ /** Minimum value. */
246
+ minimum?: number;
247
+ /** Maximum value. */
248
+ maximum?: number;
249
+ /** Exclusive minimum. */
250
+ exclusiveMinimum?: number | boolean;
251
+ /** Exclusive maximum. */
252
+ exclusiveMaximum?: number | boolean;
253
+ /** Multiple of constraint. */
254
+ multipleOf?: number & tags.ExclusiveMinimum<0>;
255
+ }
256
+ /** String type. */
257
+ interface IString extends Omit<IJsonSchemaAttribute.IString, "examples">, __IAttribute {
258
+ /** Whether nullable. */
259
+ nullable?: boolean;
260
+ /** Default value. */
261
+ default?: string | null;
262
+ /** Allowed values. */
263
+ enum?: Array<string | null>;
264
+ /** String format. */
265
+ format?: "binary" | "byte" | "password" | "regex" | "uuid" | "email" | "hostname" | "idn-email" | "idn-hostname" | "iri" | "iri-reference" | "ipv4" | "ipv6" | "uri" | "uri-reference" | "uri-template" | "url" | "date-time" | "date" | "time" | "duration" | "json-pointer" | "relative-json-pointer" | (string & {});
266
+ /** Regex pattern. */
267
+ pattern?: string;
268
+ /** Minimum length. */
269
+ minLength?: number & tags.Type<"uint64">;
270
+ /** Maximum length. */
271
+ maxLength?: number & tags.Type<"uint64">;
272
+ }
273
+ /** Array type. */
274
+ interface IArray extends Omit<IJsonSchemaAttribute.IArray, "examples">, __IAttribute {
275
+ /** Whether nullable. */
276
+ nullable?: boolean;
277
+ /** Element type. */
278
+ items: IJsonSchema;
279
+ /** Whether elements must be unique. */
280
+ uniqueItems?: boolean;
281
+ /** Minimum items. */
282
+ minItems?: number & tags.Type<"uint64">;
283
+ /** Maximum items. */
284
+ maxItems?: number & tags.Type<"uint64">;
285
+ }
286
+ /** Object type. */
287
+ interface IObject extends Omit<IJsonSchemaAttribute.IObject, "examples">, __IAttribute {
288
+ /** Whether nullable. */
289
+ nullable?: boolean;
290
+ /** Property schemas. */
291
+ properties?: Record<string, IJsonSchema>;
292
+ /** Required property names. */
293
+ required?: string[];
294
+ /** Additional properties schema. */
295
+ additionalProperties?: boolean | IJsonSchema;
296
+ /** Maximum properties. */
297
+ maxProperties?: number;
298
+ /** Minimum properties. */
299
+ minProperties?: number;
300
+ }
301
+ /** Reference to a named schema. */
302
+ interface IReference<Key = string> extends __IAttribute {
303
+ /** Reference path. */
304
+ $ref: Key;
305
+ }
306
+ /** All-of combination. */
307
+ interface IAllOf extends __IAttribute {
308
+ /** Schemas to combine. */
309
+ allOf: IJsonSchema[];
310
+ }
311
+ /** Any-of union. */
312
+ interface IAnyOf extends __IAttribute {
313
+ /** Union member schemas. */
314
+ anyOf: IJsonSchema[];
315
+ }
316
+ /** One-of union. */
317
+ interface IOneOf extends __IAttribute {
318
+ /** Union member schemas. */
319
+ oneOf: IJsonSchema[];
320
+ /** Discriminator for tagged unions. */
321
+ discriminator?: IOneOf.IDiscriminator;
322
+ }
323
+ namespace IOneOf {
324
+ /** Discriminator for tagged unions. */
325
+ interface IDiscriminator {
326
+ /** Discriminator property name. */
327
+ propertyName: string;
328
+ /** Value to schema mapping. */
329
+ mapping?: Record<string, string>;
330
+ }
331
+ }
332
+ /** Null type. */
333
+ interface INullOnly extends Omit<IJsonSchemaAttribute.INull, "examples">, __IAttribute {
334
+ /** Default value. */
335
+ default?: null;
336
+ }
337
+ /** Unknown type. */
338
+ interface IUnknown extends Omit<IJsonSchemaAttribute.IUnknown, "examples">, __IAttribute {
339
+ /** Default value. */
340
+ default?: any;
341
+ }
342
+ }
343
+ /** Security scheme types. */
344
+ type ISecurityScheme = ISecurityScheme.IApiKey | ISecurityScheme.IHttpBasic | ISecurityScheme.IHttpBearer | ISecurityScheme.IOAuth2 | ISecurityScheme.IOpenId;
345
+ namespace ISecurityScheme {
346
+ /** API key authentication. */
347
+ interface IApiKey {
348
+ /** Scheme type. */
349
+ type: "apiKey";
350
+ /** Key location. */
351
+ in?: "header" | "query" | "cookie";
352
+ /** Key name. */
353
+ name?: string;
354
+ /** Scheme description. */
355
+ description?: string;
356
+ }
357
+ /** HTTP basic authentication. */
358
+ interface IHttpBasic {
359
+ /** Scheme type. */
360
+ type: "http";
361
+ /** Authentication scheme. */
362
+ scheme: "basic";
363
+ /** Scheme description. */
364
+ description?: string;
365
+ }
366
+ /** HTTP bearer authentication. */
367
+ interface IHttpBearer {
368
+ /** Scheme type. */
369
+ type: "http";
370
+ /** Authentication scheme. */
371
+ scheme: "bearer";
372
+ /** Bearer token format hint. */
373
+ bearerFormat?: string;
374
+ /** Scheme description. */
375
+ description?: string;
376
+ }
377
+ /** OAuth2 authentication. */
378
+ interface IOAuth2 {
379
+ /** Scheme type. */
380
+ type: "oauth2";
381
+ /** OAuth2 flows. */
382
+ flows: IOAuth2.IFlowSet;
383
+ /** Scheme description. */
384
+ description?: string;
385
+ }
386
+ /** OpenID Connect authentication. */
387
+ interface IOpenId {
388
+ /** Scheme type. */
389
+ type: "openIdConnect";
390
+ /** OpenID Connect discovery URL. */
391
+ openIdConnectUrl: string;
392
+ /** Scheme description. */
393
+ description?: string;
394
+ }
395
+ namespace IOAuth2 {
396
+ /** OAuth2 flow configurations. */
397
+ interface IFlowSet {
398
+ /** Authorization code flow. */
399
+ authorizationCode?: IFlow;
400
+ /** Implicit flow. */
401
+ implicit?: Omit<IFlow, "tokenUrl">;
402
+ /** Password flow. */
403
+ password?: Omit<IFlow, "authorizationUrl">;
404
+ /** Client credentials flow. */
405
+ clientCredentials?: Omit<IFlow, "authorizationUrl">;
406
+ }
407
+ /** OAuth2 flow configuration. */
408
+ interface IFlow {
409
+ /** Authorization URL. */
410
+ authorizationUrl?: string;
411
+ /** Token URL. */
412
+ tokenUrl?: string;
413
+ /** Refresh URL. */
414
+ refreshUrl?: string;
415
+ /** Available scopes. */
416
+ scopes?: Record<string, string>;
417
+ }
418
+ }
419
+ }
420
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=OpenApiV3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenApiV3.js","sourceRoot":"","sources":["../../src/openapi/OpenApiV3.ts"],"names":[],"mappings":""}