@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.
- package/LICENSE +21 -0
- package/README.md +23 -0
- package/lib/http/IHttpConnection.d.ts +163 -0
- package/lib/http/IHttpConnection.js +4 -0
- package/lib/http/IHttpConnection.js.map +1 -0
- package/lib/http/IHttpLlmApplication.d.ts +73 -0
- package/lib/http/IHttpLlmApplication.js +3 -0
- package/lib/http/IHttpLlmApplication.js.map +1 -0
- package/lib/http/IHttpLlmController.d.ts +86 -0
- package/lib/http/IHttpLlmController.js +3 -0
- package/lib/http/IHttpLlmController.js.map +1 -0
- package/lib/http/IHttpLlmFunction.d.ts +79 -0
- package/lib/http/IHttpLlmFunction.js +3 -0
- package/lib/http/IHttpLlmFunction.js.map +1 -0
- package/lib/http/IHttpMigrateApplication.d.ts +42 -0
- package/lib/http/IHttpMigrateApplication.js +3 -0
- package/lib/http/IHttpMigrateApplication.js.map +1 -0
- package/lib/http/IHttpMigrateRoute.d.ts +121 -0
- package/lib/http/IHttpMigrateRoute.js +3 -0
- package/lib/http/IHttpMigrateRoute.js.map +1 -0
- package/lib/http/IHttpResponse.d.ts +40 -0
- package/lib/http/IHttpResponse.js +3 -0
- package/lib/http/IHttpResponse.js.map +1 -0
- package/lib/http/index.d.ts +7 -0
- package/lib/http/index.js +24 -0
- package/lib/http/index.js.map +1 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +48 -0
- package/lib/index.js.map +1 -0
- package/lib/metadata/IJsDocTagInfo.d.ts +23 -0
- package/lib/metadata/IJsDocTagInfo.js +3 -0
- package/lib/metadata/IJsDocTagInfo.js.map +1 -0
- package/lib/metadata/IMetadataComponents.d.ts +20 -0
- package/lib/metadata/IMetadataComponents.js +3 -0
- package/lib/metadata/IMetadataComponents.js.map +1 -0
- package/lib/metadata/IMetadataSchema.d.ts +219 -0
- package/lib/metadata/IMetadataSchema.js +3 -0
- package/lib/metadata/IMetadataSchema.js.map +1 -0
- package/lib/metadata/IMetadataSchemaCollection.d.ts +18 -0
- package/lib/metadata/IMetadataSchemaCollection.js +3 -0
- package/lib/metadata/IMetadataSchemaCollection.js.map +1 -0
- package/lib/metadata/IMetadataSchemaUnit.d.ts +18 -0
- package/lib/metadata/IMetadataSchemaUnit.js +3 -0
- package/lib/metadata/IMetadataSchemaUnit.js.map +1 -0
- package/lib/metadata/IMetadataTypeTag.d.ts +28 -0
- package/lib/metadata/IMetadataTypeTag.js +3 -0
- package/lib/metadata/IMetadataTypeTag.js.map +1 -0
- package/lib/metadata/index.d.ts +6 -0
- package/lib/metadata/index.js +23 -0
- package/lib/metadata/index.js.map +1 -0
- package/lib/openapi/OpenApi.d.ts +454 -0
- package/lib/openapi/OpenApi.js +3 -0
- package/lib/openapi/OpenApi.js.map +1 -0
- package/lib/openapi/OpenApiV3.d.ts +420 -0
- package/lib/openapi/OpenApiV3.js +3 -0
- package/lib/openapi/OpenApiV3.js.map +1 -0
- package/lib/openapi/OpenApiV3_1.d.ts +463 -0
- package/lib/openapi/OpenApiV3_1.js +3 -0
- package/lib/openapi/OpenApiV3_1.js.map +1 -0
- package/lib/openapi/SwaggerV2.d.ts +343 -0
- package/lib/openapi/SwaggerV2.js +3 -0
- package/lib/openapi/SwaggerV2.js.map +1 -0
- package/lib/openapi/index.d.ts +4 -0
- package/lib/openapi/index.js +21 -0
- package/lib/openapi/index.js.map +1 -0
- package/lib/protobuf/ProtobufWire.d.ts +46 -0
- package/lib/protobuf/ProtobufWire.js +3 -0
- package/lib/protobuf/ProtobufWire.js.map +1 -0
- package/lib/protobuf/index.d.ts +1 -0
- package/lib/protobuf/index.js +18 -0
- package/lib/protobuf/index.js.map +1 -0
- package/lib/schema/IJsonSchemaApplication.d.ts +232 -0
- package/lib/schema/IJsonSchemaApplication.js +3 -0
- package/lib/schema/IJsonSchemaApplication.js.map +1 -0
- package/lib/schema/IJsonSchemaAttribute.d.ts +152 -0
- package/lib/schema/IJsonSchemaAttribute.js +3 -0
- package/lib/schema/IJsonSchemaAttribute.js.map +1 -0
- package/lib/schema/IJsonSchemaCollection.d.ts +109 -0
- package/lib/schema/IJsonSchemaCollection.js +3 -0
- package/lib/schema/IJsonSchemaCollection.js.map +1 -0
- package/lib/schema/IJsonSchemaTransformError.d.ts +81 -0
- package/lib/schema/IJsonSchemaTransformError.js +3 -0
- package/lib/schema/IJsonSchemaTransformError.js.map +1 -0
- package/lib/schema/IJsonSchemaUnit.d.ts +106 -0
- package/lib/schema/IJsonSchemaUnit.js +3 -0
- package/lib/schema/IJsonSchemaUnit.js.map +1 -0
- package/lib/schema/ILlmApplication.d.ts +95 -0
- package/lib/schema/ILlmApplication.js +3 -0
- package/lib/schema/ILlmApplication.js.map +1 -0
- package/lib/schema/ILlmController.d.ts +53 -0
- package/lib/schema/ILlmController.js +3 -0
- package/lib/schema/ILlmController.js.map +1 -0
- package/lib/schema/ILlmFunction.d.ts +134 -0
- package/lib/schema/ILlmFunction.js +3 -0
- package/lib/schema/ILlmFunction.js.map +1 -0
- package/lib/schema/ILlmSchema.d.ts +412 -0
- package/lib/schema/ILlmSchema.js +3 -0
- package/lib/schema/ILlmSchema.js.map +1 -0
- package/lib/schema/IResult.d.ts +81 -0
- package/lib/schema/IResult.js +3 -0
- package/lib/schema/IResult.js.map +1 -0
- package/lib/schema/IValidation.d.ts +123 -0
- package/lib/schema/IValidation.js +3 -0
- package/lib/schema/IValidation.js.map +1 -0
- package/lib/schema/index.d.ts +11 -0
- package/lib/schema/index.js +28 -0
- package/lib/schema/index.js.map +1 -0
- package/lib/tags/Constant.d.ts +44 -0
- package/lib/tags/Constant.js +3 -0
- package/lib/tags/Constant.js.map +1 -0
- package/lib/tags/ContentMediaType.d.ts +39 -0
- package/lib/tags/ContentMediaType.js +3 -0
- package/lib/tags/ContentMediaType.js.map +1 -0
- package/lib/tags/Default.d.ts +42 -0
- package/lib/tags/Default.js +3 -0
- package/lib/tags/Default.js.map +1 -0
- package/lib/tags/Example.d.ts +38 -0
- package/lib/tags/Example.js +3 -0
- package/lib/tags/Example.js.map +1 -0
- package/lib/tags/Examples.d.ts +44 -0
- package/lib/tags/Examples.js +3 -0
- package/lib/tags/Examples.js.map +1 -0
- package/lib/tags/ExclusiveMaximum.d.ts +39 -0
- package/lib/tags/ExclusiveMaximum.js +3 -0
- package/lib/tags/ExclusiveMaximum.js.map +1 -0
- package/lib/tags/ExclusiveMinimum.d.ts +39 -0
- package/lib/tags/ExclusiveMinimum.js +3 -0
- package/lib/tags/ExclusiveMinimum.js.map +1 -0
- package/lib/tags/Format.d.ts +43 -0
- package/lib/tags/Format.js +3 -0
- package/lib/tags/Format.js.map +1 -0
- package/lib/tags/JsonSchemaPlugin.d.ts +44 -0
- package/lib/tags/JsonSchemaPlugin.js +3 -0
- package/lib/tags/JsonSchemaPlugin.js.map +1 -0
- package/lib/tags/MaxItems.d.ts +38 -0
- package/lib/tags/MaxItems.js +3 -0
- package/lib/tags/MaxItems.js.map +1 -0
- package/lib/tags/MaxLength.d.ts +36 -0
- package/lib/tags/MaxLength.js +3 -0
- package/lib/tags/MaxLength.js.map +1 -0
- package/lib/tags/Maximum.d.ts +41 -0
- package/lib/tags/Maximum.js +3 -0
- package/lib/tags/Maximum.js.map +1 -0
- package/lib/tags/MinItems.d.ts +38 -0
- package/lib/tags/MinItems.js +3 -0
- package/lib/tags/MinItems.js.map +1 -0
- package/lib/tags/MinLength.d.ts +36 -0
- package/lib/tags/MinLength.js +3 -0
- package/lib/tags/MinLength.js.map +1 -0
- package/lib/tags/Minimum.d.ts +41 -0
- package/lib/tags/Minimum.js +3 -0
- package/lib/tags/Minimum.js.map +1 -0
- package/lib/tags/MultipleOf.d.ts +49 -0
- package/lib/tags/MultipleOf.js +3 -0
- package/lib/tags/MultipleOf.js.map +1 -0
- package/lib/tags/Pattern.d.ts +51 -0
- package/lib/tags/Pattern.js +3 -0
- package/lib/tags/Pattern.js.map +1 -0
- package/lib/tags/Sequence.d.ts +42 -0
- package/lib/tags/Sequence.js +3 -0
- package/lib/tags/Sequence.js.map +1 -0
- package/lib/tags/TagBase.d.ts +109 -0
- package/lib/tags/TagBase.js +3 -0
- package/lib/tags/TagBase.js.map +1 -0
- package/lib/tags/Type.d.ts +53 -0
- package/lib/tags/Type.js +3 -0
- package/lib/tags/Type.js.map +1 -0
- package/lib/tags/UniqueItems.d.ts +41 -0
- package/lib/tags/UniqueItems.js +3 -0
- package/lib/tags/UniqueItems.js.map +1 -0
- package/lib/tags/index.d.ts +21 -0
- package/lib/tags/index.js +38 -0
- package/lib/tags/index.js.map +1 -0
- package/lib/typings/AssertionGuard.d.ts +12 -0
- package/lib/typings/AssertionGuard.js +3 -0
- package/lib/typings/AssertionGuard.js.map +1 -0
- package/lib/typings/Atomic.d.ts +19 -0
- package/lib/typings/Atomic.js +3 -0
- package/lib/typings/Atomic.js.map +1 -0
- package/lib/typings/CamelCase.d.ts +26 -0
- package/lib/typings/CamelCase.js +3 -0
- package/lib/typings/CamelCase.js.map +1 -0
- package/lib/typings/ClassProperties.d.ts +14 -0
- package/lib/typings/ClassProperties.js +3 -0
- package/lib/typings/ClassProperties.js.map +1 -0
- package/lib/typings/OmitNever.d.ts +11 -0
- package/lib/typings/OmitNever.js +3 -0
- package/lib/typings/OmitNever.js.map +1 -0
- package/lib/typings/PascalCase.d.ts +25 -0
- package/lib/typings/PascalCase.js +3 -0
- package/lib/typings/PascalCase.js.map +1 -0
- package/lib/typings/Primitive.d.ts +29 -0
- package/lib/typings/Primitive.js +3 -0
- package/lib/typings/Primitive.js.map +1 -0
- package/lib/typings/ProtobufAtomic.d.ts +15 -0
- package/lib/typings/ProtobufAtomic.js +3 -0
- package/lib/typings/ProtobufAtomic.js.map +1 -0
- package/lib/typings/Resolved.d.ts +23 -0
- package/lib/typings/Resolved.js +3 -0
- package/lib/typings/Resolved.js.map +1 -0
- package/lib/typings/SnakeCase.d.ts +31 -0
- package/lib/typings/SnakeCase.js +3 -0
- package/lib/typings/SnakeCase.js.map +1 -0
- package/lib/typings/SpecialFields.d.ts +13 -0
- package/lib/typings/SpecialFields.js +3 -0
- package/lib/typings/SpecialFields.js.map +1 -0
- package/lib/typings/ValidationPipe.d.ts +18 -0
- package/lib/typings/ValidationPipe.js +3 -0
- package/lib/typings/ValidationPipe.js.map +1 -0
- package/lib/typings/index.d.ts +12 -0
- package/lib/typings/index.js +29 -0
- package/lib/typings/index.js.map +1 -0
- package/lib/typings/internal/Equal.d.ts +11 -0
- package/lib/typings/internal/Equal.js +3 -0
- package/lib/typings/internal/Equal.js.map +1 -0
- package/lib/typings/internal/IsTuple.d.ts +13 -0
- package/lib/typings/internal/IsTuple.js +3 -0
- package/lib/typings/internal/IsTuple.js.map +1 -0
- package/lib/typings/internal/NativeClass.d.ts +9 -0
- package/lib/typings/internal/NativeClass.js +3 -0
- package/lib/typings/internal/NativeClass.js.map +1 -0
- package/lib/typings/internal/ValueOf.d.ts +15 -0
- package/lib/typings/internal/ValueOf.js +3 -0
- package/lib/typings/internal/ValueOf.js.map +1 -0
- package/lib/utils/IRandomGenerator.d.ts +68 -0
- package/lib/utils/IRandomGenerator.js +3 -0
- package/lib/utils/IRandomGenerator.js.map +1 -0
- package/lib/utils/IReadableURLSearchParams.d.ts +22 -0
- package/lib/utils/IReadableURLSearchParams.js +3 -0
- package/lib/utils/IReadableURLSearchParams.js.map +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +19 -0
- package/lib/utils/index.js.map +1 -0
- package/package.json +79 -0
- package/src/http/IHttpConnection.ts +200 -0
- package/src/http/IHttpLlmApplication.ts +83 -0
- package/src/http/IHttpLlmController.ts +96 -0
- package/src/http/IHttpLlmFunction.ts +93 -0
- package/src/http/IHttpMigrateApplication.ts +48 -0
- package/src/http/IHttpMigrateRoute.ts +165 -0
- package/src/http/IHttpResponse.ts +42 -0
- package/src/http/index.ts +7 -0
- package/src/index.ts +9 -0
- package/src/metadata/IJsDocTagInfo.ts +25 -0
- package/src/metadata/IMetadataComponents.ts +24 -0
- package/src/metadata/IMetadataSchema.ts +293 -0
- package/src/metadata/IMetadataSchemaCollection.ts +20 -0
- package/src/metadata/IMetadataSchemaUnit.ts +20 -0
- package/src/metadata/IMetadataTypeTag.ts +39 -0
- package/src/metadata/index.ts +6 -0
- package/src/openapi/OpenApi.ts +643 -0
- package/src/openapi/OpenApiV3.ts +655 -0
- package/src/openapi/OpenApiV3_1.ts +735 -0
- package/src/openapi/SwaggerV2.ts +559 -0
- package/src/openapi/index.ts +4 -0
- package/src/protobuf/ProtobufWire.ts +51 -0
- package/src/protobuf/index.ts +1 -0
- package/src/schema/IJsonSchemaApplication.ts +274 -0
- package/src/schema/IJsonSchemaAttribute.ts +158 -0
- package/src/schema/IJsonSchemaCollection.ts +123 -0
- package/src/schema/IJsonSchemaTransformError.ts +86 -0
- package/src/schema/IJsonSchemaUnit.ts +120 -0
- package/src/schema/ILlmApplication.ts +103 -0
- package/src/schema/ILlmController.ts +57 -0
- package/src/schema/ILlmFunction.ts +144 -0
- package/src/schema/ILlmSchema.ts +484 -0
- package/src/schema/IResult.ts +84 -0
- package/src/schema/IValidation.ts +134 -0
- package/src/schema/index.ts +13 -0
- package/src/tags/Constant.ts +49 -0
- package/src/tags/ContentMediaType.ts +40 -0
- package/src/tags/Default.ts +50 -0
- package/src/tags/Example.ts +48 -0
- package/src/tags/Examples.ts +50 -0
- package/src/tags/ExclusiveMaximum.ts +46 -0
- package/src/tags/ExclusiveMinimum.ts +46 -0
- package/src/tags/Format.ts +76 -0
- package/src/tags/JsonSchemaPlugin.ts +45 -0
- package/src/tags/MaxItems.ts +39 -0
- package/src/tags/MaxLength.ts +37 -0
- package/src/tags/Maximum.ts +44 -0
- package/src/tags/MinItems.ts +39 -0
- package/src/tags/MinLength.ts +37 -0
- package/src/tags/Minimum.ts +44 -0
- package/src/tags/MultipleOf.ts +54 -0
- package/src/tags/Pattern.ts +59 -0
- package/src/tags/Sequence.ts +43 -0
- package/src/tags/TagBase.ts +131 -0
- package/src/tags/Type.ts +70 -0
- package/src/tags/UniqueItems.ts +44 -0
- package/src/tags/index.ts +21 -0
- package/src/typings/AssertionGuard.ts +12 -0
- package/src/typings/Atomic.ts +21 -0
- package/src/typings/CamelCase.ts +75 -0
- package/src/typings/ClassProperties.ts +15 -0
- package/src/typings/OmitNever.ts +12 -0
- package/src/typings/PascalCase.ts +71 -0
- package/src/typings/Primitive.ts +71 -0
- package/src/typings/ProtobufAtomic.ts +30 -0
- package/src/typings/Resolved.ts +58 -0
- package/src/typings/SnakeCase.ts +126 -0
- package/src/typings/SpecialFields.ts +13 -0
- package/src/typings/ValidationPipe.ts +20 -0
- package/src/typings/index.ts +13 -0
- package/src/typings/internal/Equal.ts +14 -0
- package/src/typings/internal/IsTuple.ts +17 -0
- package/src/typings/internal/NativeClass.ts +31 -0
- package/src/typings/internal/ValueOf.ts +29 -0
- package/src/utils/IRandomGenerator.ts +105 -0
- package/src/utils/IReadableURLSearchParams.ts +25 -0
- package/src/utils/index.ts +2 -0
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
import { IJsonSchemaAttribute } from "../schema/IJsonSchemaAttribute";
|
|
2
|
+
import * as tags from "../tags";
|
|
3
|
+
/**
|
|
4
|
+
* Emended OpenAPI v3.1 specification.
|
|
5
|
+
*
|
|
6
|
+
* `OpenApi` is a refined OpenAPI v3.1 specification that normalizes ambiguous
|
|
7
|
+
* and redundant expressions from various OpenAPI versions (Swagger 2.0, OpenAPI
|
|
8
|
+
* 3.0, 3.1). This unified format simplifies schema processing for `typia` and
|
|
9
|
+
* `@nestia/sdk`.
|
|
10
|
+
*
|
|
11
|
+
* Key simplifications:
|
|
12
|
+
*
|
|
13
|
+
* - Schema `$ref` references are unified to `#/components/schemas/{name}` format
|
|
14
|
+
* - Non-schema references (parameters, responses) are resolved inline
|
|
15
|
+
* - `nullable` is converted to `{ oneOf: [schema, { type: "null\" }] }`
|
|
16
|
+
* - `allOf` compositions are merged into single schemas
|
|
17
|
+
* - Schema attributes are normalized across all versions
|
|
18
|
+
*
|
|
19
|
+
* Use `HttpLlm.application()` from `@typia/utils` to convert
|
|
20
|
+
* `OpenApi.IDocument` into {@link IHttpLlmApplication} for LLM function
|
|
21
|
+
* calling.
|
|
22
|
+
*
|
|
23
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
24
|
+
*/
|
|
25
|
+
export declare namespace OpenApi {
|
|
26
|
+
/**
|
|
27
|
+
* HTTP method supported by OpenAPI operations.
|
|
28
|
+
*
|
|
29
|
+
* Standard HTTP methods used in REST APIs. Each path can have multiple
|
|
30
|
+
* operations, one per HTTP method.
|
|
31
|
+
*/
|
|
32
|
+
type Method = "get" | "post" | "put" | "delete" | "options" | "head" | "patch" | "trace";
|
|
33
|
+
/**
|
|
34
|
+
* Root document structure for emended OpenAPI v3.1.
|
|
35
|
+
*
|
|
36
|
+
* Contains all API metadata, paths, operations, and reusable components. The
|
|
37
|
+
* `x-samchon-emended-v4` marker indicates this document has been processed by
|
|
38
|
+
* `@samchon/openapi` to normalize schema formats.
|
|
39
|
+
*/
|
|
40
|
+
interface IDocument {
|
|
41
|
+
/** OpenAPI version. */
|
|
42
|
+
openapi: `3.1.${number}`;
|
|
43
|
+
/** List of servers providing the API. */
|
|
44
|
+
servers?: IServer[];
|
|
45
|
+
/** API metadata. */
|
|
46
|
+
info?: IDocument.IInfo;
|
|
47
|
+
/** Reusable components (schemas, security schemes). */
|
|
48
|
+
components: IComponents;
|
|
49
|
+
/** Available API paths and operations. */
|
|
50
|
+
paths?: Record<string, IPath>;
|
|
51
|
+
/** Webhook definitions. */
|
|
52
|
+
webhooks?: Record<string, IPath>;
|
|
53
|
+
/** Global security requirements. */
|
|
54
|
+
security?: Record<string, string[]>[];
|
|
55
|
+
/** Tag definitions for grouping operations. */
|
|
56
|
+
tags?: IDocument.ITag[];
|
|
57
|
+
/** Marker for emended document by `@samchon/openapi`. */
|
|
58
|
+
"x-samchon-emended-v4": true;
|
|
59
|
+
}
|
|
60
|
+
namespace IDocument {
|
|
61
|
+
/**
|
|
62
|
+
* API metadata and identification.
|
|
63
|
+
*
|
|
64
|
+
* Contains essential information about the API including title, version,
|
|
65
|
+
* contact information, and licensing details.
|
|
66
|
+
*/
|
|
67
|
+
interface IInfo {
|
|
68
|
+
/** API title. */
|
|
69
|
+
title: string;
|
|
70
|
+
/** Short summary. */
|
|
71
|
+
summary?: string;
|
|
72
|
+
/** Full description. */
|
|
73
|
+
description?: string;
|
|
74
|
+
/** Terms of service URL. */
|
|
75
|
+
termsOfService?: string;
|
|
76
|
+
/** Contact information. */
|
|
77
|
+
contact?: IContact;
|
|
78
|
+
/** License information. */
|
|
79
|
+
license?: ILicense;
|
|
80
|
+
/** API version. */
|
|
81
|
+
version: string;
|
|
82
|
+
}
|
|
83
|
+
/** Tag for grouping operations. */
|
|
84
|
+
interface ITag {
|
|
85
|
+
/** Tag name. */
|
|
86
|
+
name: string;
|
|
87
|
+
/** Tag description. */
|
|
88
|
+
description?: string;
|
|
89
|
+
}
|
|
90
|
+
/** Contact information. */
|
|
91
|
+
interface IContact {
|
|
92
|
+
/** Contact name. */
|
|
93
|
+
name?: string;
|
|
94
|
+
/** Contact URL. */
|
|
95
|
+
url?: string;
|
|
96
|
+
/** Contact email. */
|
|
97
|
+
email?: string & tags.Format<"email">;
|
|
98
|
+
}
|
|
99
|
+
/** License information. */
|
|
100
|
+
interface ILicense {
|
|
101
|
+
/** License name. */
|
|
102
|
+
name: string;
|
|
103
|
+
/** SPDX license identifier. */
|
|
104
|
+
identifier?: string;
|
|
105
|
+
/** License URL. */
|
|
106
|
+
url?: string;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/** Server providing the API. */
|
|
110
|
+
interface IServer {
|
|
111
|
+
/** Server URL. */
|
|
112
|
+
url: string;
|
|
113
|
+
/** Server description. */
|
|
114
|
+
description?: string;
|
|
115
|
+
/** URL template variables. */
|
|
116
|
+
variables?: Record<string, IServer.IVariable>;
|
|
117
|
+
}
|
|
118
|
+
namespace IServer {
|
|
119
|
+
/** URL template variable. */
|
|
120
|
+
interface IVariable {
|
|
121
|
+
/** Default value. */
|
|
122
|
+
default: string;
|
|
123
|
+
/** Allowed values. */
|
|
124
|
+
enum?: string[];
|
|
125
|
+
/** Variable description. */
|
|
126
|
+
description?: string;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/** Path item containing operations by HTTP method. */
|
|
130
|
+
interface IPath extends Partial<Record<Method, IOperation>> {
|
|
131
|
+
/** Path-level servers. */
|
|
132
|
+
servers?: IServer[];
|
|
133
|
+
/** Path summary. */
|
|
134
|
+
summary?: string;
|
|
135
|
+
/** Path description. */
|
|
136
|
+
description?: string;
|
|
137
|
+
}
|
|
138
|
+
/** API operation metadata. */
|
|
139
|
+
interface IOperation {
|
|
140
|
+
/** Unique operation identifier. */
|
|
141
|
+
operationId?: string;
|
|
142
|
+
/** Operation parameters. */
|
|
143
|
+
parameters?: IOperation.IParameter[];
|
|
144
|
+
/** Request body. */
|
|
145
|
+
requestBody?: IOperation.IRequestBody;
|
|
146
|
+
/** Response definitions by status code. */
|
|
147
|
+
responses?: Record<string, IOperation.IResponse>;
|
|
148
|
+
/** Operation-level servers. */
|
|
149
|
+
servers?: IServer[];
|
|
150
|
+
/** Short summary. */
|
|
151
|
+
summary?: string;
|
|
152
|
+
/** Full description. */
|
|
153
|
+
description?: string;
|
|
154
|
+
/** Security requirements. */
|
|
155
|
+
security?: Record<string, string[]>[];
|
|
156
|
+
/** Operation tags for grouping. */
|
|
157
|
+
tags?: string[];
|
|
158
|
+
/** Whether deprecated. */
|
|
159
|
+
deprecated?: boolean;
|
|
160
|
+
/** Excludes from LLM function calling when `true`. */
|
|
161
|
+
"x-samchon-human"?: boolean;
|
|
162
|
+
/** Custom accessor path for migration. */
|
|
163
|
+
"x-samchon-accessor"?: string[];
|
|
164
|
+
/** Controller name for code generation. */
|
|
165
|
+
"x-samchon-controller"?: string;
|
|
166
|
+
}
|
|
167
|
+
namespace IOperation {
|
|
168
|
+
/** Operation parameter. */
|
|
169
|
+
interface IParameter {
|
|
170
|
+
/** Parameter name. */
|
|
171
|
+
name?: string;
|
|
172
|
+
/** Parameter location. */
|
|
173
|
+
in: "path" | "query" | "header" | "cookie";
|
|
174
|
+
/** Parameter schema. */
|
|
175
|
+
schema: IJsonSchema;
|
|
176
|
+
/** Whether required. */
|
|
177
|
+
required?: boolean;
|
|
178
|
+
/** Parameter description. */
|
|
179
|
+
description?: string;
|
|
180
|
+
/** Example value. */
|
|
181
|
+
example?: any;
|
|
182
|
+
/** Named examples. */
|
|
183
|
+
examples?: Record<string, IExample>;
|
|
184
|
+
}
|
|
185
|
+
/** Request body. */
|
|
186
|
+
interface IRequestBody {
|
|
187
|
+
/** Body content by media type. */
|
|
188
|
+
content?: IContent;
|
|
189
|
+
/** Body description. */
|
|
190
|
+
description?: string;
|
|
191
|
+
/** Whether required. */
|
|
192
|
+
required?: boolean;
|
|
193
|
+
/** Nestia encryption flag. */
|
|
194
|
+
"x-nestia-encrypted"?: boolean;
|
|
195
|
+
}
|
|
196
|
+
/** Response definition. */
|
|
197
|
+
interface IResponse {
|
|
198
|
+
/** Response headers. */
|
|
199
|
+
headers?: Record<string, IOperation.IParameter>;
|
|
200
|
+
/** Response content by media type. */
|
|
201
|
+
content?: IContent;
|
|
202
|
+
/** Response description. */
|
|
203
|
+
description?: string;
|
|
204
|
+
/** Nestia encryption flag. */
|
|
205
|
+
"x-nestia-encrypted"?: boolean;
|
|
206
|
+
}
|
|
207
|
+
/** Content by media type. */
|
|
208
|
+
interface IContent extends Partial<Record<ContentType, IMediaType>> {
|
|
209
|
+
}
|
|
210
|
+
/** Media type definition. */
|
|
211
|
+
interface IMediaType {
|
|
212
|
+
/** Content schema. */
|
|
213
|
+
schema?: IJsonSchema;
|
|
214
|
+
/** Example value. */
|
|
215
|
+
example?: any;
|
|
216
|
+
/** Named examples. */
|
|
217
|
+
examples?: Record<string, IExample>;
|
|
218
|
+
}
|
|
219
|
+
/** Supported content types. */
|
|
220
|
+
type ContentType = "text/plain" | "application/json" | "application/x-www-form-url-encoded" | "multipart/form-data" | "*/*" | (string & {});
|
|
221
|
+
}
|
|
222
|
+
/** Example value definition. */
|
|
223
|
+
interface IExample {
|
|
224
|
+
/** Example summary. */
|
|
225
|
+
summary?: string;
|
|
226
|
+
/** Example description. */
|
|
227
|
+
description?: string;
|
|
228
|
+
/** Example value. */
|
|
229
|
+
value?: any;
|
|
230
|
+
/** External value URL. */
|
|
231
|
+
externalValue?: string;
|
|
232
|
+
}
|
|
233
|
+
/** Reusable components storage. */
|
|
234
|
+
interface IComponents {
|
|
235
|
+
/** Named schemas. */
|
|
236
|
+
schemas?: Record<string, IJsonSchema>;
|
|
237
|
+
/** Named security schemes. */
|
|
238
|
+
securitySchemes?: Record<string, ISecurityScheme>;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* JSON Schema type for emended OpenAPI v3.1.
|
|
242
|
+
*
|
|
243
|
+
* Represents all possible JSON Schema types in the normalized OpenAPI format.
|
|
244
|
+
* This is a discriminated union - check the `type` property or use type
|
|
245
|
+
* guards to narrow to specific schema types.
|
|
246
|
+
*
|
|
247
|
+
* Unlike raw JSON Schema, this format:
|
|
248
|
+
*
|
|
249
|
+
* - Uses `oneOf` instead of `anyOf` for union types
|
|
250
|
+
* - Separates `IArray` (homogeneous) from `ITuple` (heterogeneous)
|
|
251
|
+
* - Normalizes nullable types to `oneOf` with null schema
|
|
252
|
+
*/
|
|
253
|
+
type IJsonSchema = IJsonSchema.IConstant | IJsonSchema.IBoolean | IJsonSchema.IInteger | IJsonSchema.INumber | IJsonSchema.IString | IJsonSchema.IArray | IJsonSchema.ITuple | IJsonSchema.IObject | IJsonSchema.IReference | IJsonSchema.IOneOf | IJsonSchema.INull | IJsonSchema.IUnknown;
|
|
254
|
+
namespace IJsonSchema {
|
|
255
|
+
/** Constant value type. */
|
|
256
|
+
interface IConstant extends IJsonSchemaAttribute {
|
|
257
|
+
/** Constant value. */
|
|
258
|
+
const: boolean | number | string;
|
|
259
|
+
}
|
|
260
|
+
/** Boolean type. */
|
|
261
|
+
interface IBoolean extends IJsonSchemaAttribute.IBoolean {
|
|
262
|
+
/** Default value. */
|
|
263
|
+
default?: boolean;
|
|
264
|
+
}
|
|
265
|
+
/** Integer type. */
|
|
266
|
+
interface IInteger extends IJsonSchemaAttribute.IInteger {
|
|
267
|
+
/** Default value. */
|
|
268
|
+
default?: number & tags.Type<"int64">;
|
|
269
|
+
/** Minimum value. */
|
|
270
|
+
minimum?: number & tags.Type<"int64">;
|
|
271
|
+
/** Maximum value. */
|
|
272
|
+
maximum?: number & tags.Type<"int64">;
|
|
273
|
+
/** Exclusive minimum. */
|
|
274
|
+
exclusiveMinimum?: number & tags.Type<"int64">;
|
|
275
|
+
/** Exclusive maximum. */
|
|
276
|
+
exclusiveMaximum?: number & tags.Type<"int64">;
|
|
277
|
+
/** Multiple of constraint. */
|
|
278
|
+
multipleOf?: number & tags.ExclusiveMinimum<0>;
|
|
279
|
+
}
|
|
280
|
+
/** Number (double) type. */
|
|
281
|
+
interface INumber extends IJsonSchemaAttribute.INumber {
|
|
282
|
+
/** Default value. */
|
|
283
|
+
default?: number;
|
|
284
|
+
/** Minimum value. */
|
|
285
|
+
minimum?: number;
|
|
286
|
+
/** Maximum value. */
|
|
287
|
+
maximum?: number;
|
|
288
|
+
/** Exclusive minimum. */
|
|
289
|
+
exclusiveMinimum?: number;
|
|
290
|
+
/** Exclusive maximum. */
|
|
291
|
+
exclusiveMaximum?: number;
|
|
292
|
+
/** Multiple of constraint. */
|
|
293
|
+
multipleOf?: number & tags.ExclusiveMinimum<0>;
|
|
294
|
+
}
|
|
295
|
+
/** String type. */
|
|
296
|
+
interface IString extends IJsonSchemaAttribute.IString {
|
|
297
|
+
/** Default value. */
|
|
298
|
+
default?: string;
|
|
299
|
+
/** String format. */
|
|
300
|
+
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 & {});
|
|
301
|
+
/** Regex pattern. */
|
|
302
|
+
pattern?: string;
|
|
303
|
+
/** Content media type. */
|
|
304
|
+
contentMediaType?: string;
|
|
305
|
+
/** Minimum length. */
|
|
306
|
+
minLength?: number & tags.Type<"uint64">;
|
|
307
|
+
/** Maximum length. */
|
|
308
|
+
maxLength?: number & tags.Type<"uint64">;
|
|
309
|
+
}
|
|
310
|
+
/** Array type. */
|
|
311
|
+
interface IArray extends IJsonSchemaAttribute.IArray {
|
|
312
|
+
/** Element type. */
|
|
313
|
+
items: IJsonSchema;
|
|
314
|
+
/** Whether elements must be unique. */
|
|
315
|
+
uniqueItems?: boolean;
|
|
316
|
+
/** Minimum items. */
|
|
317
|
+
minItems?: number & tags.Type<"uint64">;
|
|
318
|
+
/** Maximum items. */
|
|
319
|
+
maxItems?: number & tags.Type<"uint64">;
|
|
320
|
+
}
|
|
321
|
+
/** Tuple type. */
|
|
322
|
+
interface ITuple extends IJsonSchemaAttribute {
|
|
323
|
+
/** Type discriminator. */
|
|
324
|
+
type: "array";
|
|
325
|
+
/** Tuple element types. */
|
|
326
|
+
prefixItems: IJsonSchema[];
|
|
327
|
+
/** Rest element type or `true` for any. */
|
|
328
|
+
additionalItems?: boolean | IJsonSchema;
|
|
329
|
+
/** Whether elements must be unique. */
|
|
330
|
+
uniqueItems?: boolean;
|
|
331
|
+
/** Minimum items. */
|
|
332
|
+
minItems?: number & tags.Type<"uint64">;
|
|
333
|
+
/** Maximum items. */
|
|
334
|
+
maxItems?: number & tags.Type<"uint64">;
|
|
335
|
+
}
|
|
336
|
+
/** Object type. */
|
|
337
|
+
interface IObject extends IJsonSchemaAttribute.IObject {
|
|
338
|
+
/** Property schemas. */
|
|
339
|
+
properties?: Record<string, IJsonSchema>;
|
|
340
|
+
/** Additional properties schema or `true` for any. */
|
|
341
|
+
additionalProperties?: boolean | IJsonSchema;
|
|
342
|
+
/** Required property names. */
|
|
343
|
+
required?: string[];
|
|
344
|
+
}
|
|
345
|
+
/** Reference to named schema. */
|
|
346
|
+
interface IReference<Key = string> extends IJsonSchemaAttribute {
|
|
347
|
+
/** Reference path (e.g., `#/components/schemas/TypeName`). */
|
|
348
|
+
$ref: Key;
|
|
349
|
+
}
|
|
350
|
+
/** Union type (`oneOf`). */
|
|
351
|
+
interface IOneOf extends IJsonSchemaAttribute {
|
|
352
|
+
/** Union member schemas. */
|
|
353
|
+
oneOf: Exclude<IJsonSchema, IJsonSchema.IOneOf>[];
|
|
354
|
+
/** Discriminator for tagged unions. */
|
|
355
|
+
discriminator?: IOneOf.IDiscriminator;
|
|
356
|
+
}
|
|
357
|
+
namespace IOneOf {
|
|
358
|
+
/** Discriminator for tagged unions. */
|
|
359
|
+
interface IDiscriminator {
|
|
360
|
+
/** Discriminator property name. */
|
|
361
|
+
propertyName: string;
|
|
362
|
+
/** Value to schema mapping. */
|
|
363
|
+
mapping?: Record<string, string>;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
/** Null type. */
|
|
367
|
+
interface INull extends IJsonSchemaAttribute.INull {
|
|
368
|
+
/** Default value. */
|
|
369
|
+
default?: null;
|
|
370
|
+
}
|
|
371
|
+
/** Unknown (`any`) type. */
|
|
372
|
+
interface IUnknown extends IJsonSchemaAttribute.IUnknown {
|
|
373
|
+
/** Default value. */
|
|
374
|
+
default?: any;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
/** Security scheme types. */
|
|
378
|
+
type ISecurityScheme = ISecurityScheme.IApiKey | ISecurityScheme.IHttpBasic | ISecurityScheme.IHttpBearer | ISecurityScheme.IOAuth2 | ISecurityScheme.IOpenId;
|
|
379
|
+
namespace ISecurityScheme {
|
|
380
|
+
/** API key authentication. */
|
|
381
|
+
interface IApiKey {
|
|
382
|
+
/** Scheme type. */
|
|
383
|
+
type: "apiKey";
|
|
384
|
+
/** Key location. */
|
|
385
|
+
in?: "header" | "query" | "cookie";
|
|
386
|
+
/** Key name. */
|
|
387
|
+
name?: string;
|
|
388
|
+
/** Scheme description. */
|
|
389
|
+
description?: string;
|
|
390
|
+
}
|
|
391
|
+
/** HTTP basic authentication. */
|
|
392
|
+
interface IHttpBasic {
|
|
393
|
+
/** Scheme type. */
|
|
394
|
+
type: "http";
|
|
395
|
+
/** Authentication scheme. */
|
|
396
|
+
scheme: "basic";
|
|
397
|
+
/** Scheme description. */
|
|
398
|
+
description?: string;
|
|
399
|
+
}
|
|
400
|
+
/** HTTP bearer authentication. */
|
|
401
|
+
interface IHttpBearer {
|
|
402
|
+
/** Scheme type. */
|
|
403
|
+
type: "http";
|
|
404
|
+
/** Authentication scheme. */
|
|
405
|
+
scheme: "bearer";
|
|
406
|
+
/** Bearer token format hint. */
|
|
407
|
+
bearerFormat?: string;
|
|
408
|
+
/** Scheme description. */
|
|
409
|
+
description?: string;
|
|
410
|
+
}
|
|
411
|
+
/** OAuth2 authentication. */
|
|
412
|
+
interface IOAuth2 {
|
|
413
|
+
/** Scheme type. */
|
|
414
|
+
type: "oauth2";
|
|
415
|
+
/** OAuth2 flows. */
|
|
416
|
+
flows: IOAuth2.IFlowSet;
|
|
417
|
+
/** Scheme description. */
|
|
418
|
+
description?: string;
|
|
419
|
+
}
|
|
420
|
+
/** OpenID Connect authentication. */
|
|
421
|
+
interface IOpenId {
|
|
422
|
+
/** Scheme type. */
|
|
423
|
+
type: "openIdConnect";
|
|
424
|
+
/** OpenID Connect discovery URL. */
|
|
425
|
+
openIdConnectUrl: string;
|
|
426
|
+
/** Scheme description. */
|
|
427
|
+
description?: string;
|
|
428
|
+
}
|
|
429
|
+
namespace IOAuth2 {
|
|
430
|
+
/** OAuth2 flow configurations. */
|
|
431
|
+
interface IFlowSet {
|
|
432
|
+
/** Authorization code flow. */
|
|
433
|
+
authorizationCode?: IFlow;
|
|
434
|
+
/** Implicit flow. */
|
|
435
|
+
implicit?: Omit<IFlow, "tokenUrl">;
|
|
436
|
+
/** Password flow. */
|
|
437
|
+
password?: Omit<IFlow, "authorizationUrl">;
|
|
438
|
+
/** Client credentials flow. */
|
|
439
|
+
clientCredentials?: Omit<IFlow, "authorizationUrl">;
|
|
440
|
+
}
|
|
441
|
+
/** OAuth2 flow configuration. */
|
|
442
|
+
interface IFlow {
|
|
443
|
+
/** Authorization URL. */
|
|
444
|
+
authorizationUrl?: string;
|
|
445
|
+
/** Token URL. */
|
|
446
|
+
tokenUrl?: string;
|
|
447
|
+
/** Refresh URL. */
|
|
448
|
+
refreshUrl?: string;
|
|
449
|
+
/** Available scopes. */
|
|
450
|
+
scopes?: Record<string, string>;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenApi.js","sourceRoot":"","sources":["../../src/openapi/OpenApi.ts"],"names":[],"mappings":""}
|