@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,343 @@
|
|
|
1
|
+
import { IJsonSchemaAttribute } from "../schema/IJsonSchemaAttribute";
|
|
2
|
+
import * as tags from "../tags";
|
|
3
|
+
/**
|
|
4
|
+
* Swagger v2.0 specification types.
|
|
5
|
+
*
|
|
6
|
+
* `SwaggerV2` contains TypeScript type definitions for Swagger v2.0 (OpenAPI
|
|
7
|
+
* v2) documents. Used for parsing legacy Swagger specifications. For a
|
|
8
|
+
* normalized format that unifies all OpenAPI versions, use {@link OpenApi}.
|
|
9
|
+
*
|
|
10
|
+
* Key differences from OpenAPI v3.x:
|
|
11
|
+
*
|
|
12
|
+
* - Uses `definitions` instead of `components.schemas`
|
|
13
|
+
* - Body parameters use `in: "body"` with `schema` property
|
|
14
|
+
* - No `requestBody`, `oneOf`, `anyOf`, or `nullable`
|
|
15
|
+
* - Uses `host` + `basePath` instead of `servers`
|
|
16
|
+
*
|
|
17
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
18
|
+
*/
|
|
19
|
+
export declare namespace SwaggerV2 {
|
|
20
|
+
/** HTTP method of the operation. */
|
|
21
|
+
type Method = "get" | "post" | "put" | "delete" | "options" | "head" | "patch" | "trace";
|
|
22
|
+
/** Swagger document structure. */
|
|
23
|
+
interface IDocument {
|
|
24
|
+
/** Swagger version. */
|
|
25
|
+
swagger: "2.0" | `2.0.${number}`;
|
|
26
|
+
/** API metadata. */
|
|
27
|
+
info?: IDocument.IInfo;
|
|
28
|
+
/** Host address. */
|
|
29
|
+
host?: string;
|
|
30
|
+
/** Base path for all operations. */
|
|
31
|
+
basePath?: string;
|
|
32
|
+
/** Global content types consumed. */
|
|
33
|
+
consumes?: string[];
|
|
34
|
+
/** Global content types produced. */
|
|
35
|
+
produces?: string[];
|
|
36
|
+
/** Schema definitions. */
|
|
37
|
+
definitions?: Record<string, IJsonSchema>;
|
|
38
|
+
/** Reusable parameter definitions. */
|
|
39
|
+
parameters?: Record<string, IOperation.IParameter>;
|
|
40
|
+
/** Reusable response definitions. */
|
|
41
|
+
responses?: Record<string, IOperation.IResponse>;
|
|
42
|
+
/** Security scheme definitions. */
|
|
43
|
+
securityDefinitions?: Record<string, ISecurityDefinition>;
|
|
44
|
+
/** Global security requirements. */
|
|
45
|
+
security?: Record<string, string[]>[];
|
|
46
|
+
/** API paths and operations. */
|
|
47
|
+
paths?: Record<string, IPath>;
|
|
48
|
+
/** Tag definitions. */
|
|
49
|
+
tags?: IDocument.ITag[];
|
|
50
|
+
}
|
|
51
|
+
namespace IDocument {
|
|
52
|
+
/** API metadata. */
|
|
53
|
+
interface IInfo {
|
|
54
|
+
/** API title. */
|
|
55
|
+
title: string;
|
|
56
|
+
/** API description. */
|
|
57
|
+
description?: string;
|
|
58
|
+
/** Terms of service URL. */
|
|
59
|
+
termsOfService?: string;
|
|
60
|
+
/** Contact information. */
|
|
61
|
+
contact?: IContact;
|
|
62
|
+
/** License information. */
|
|
63
|
+
license?: ILicense;
|
|
64
|
+
/** API version. */
|
|
65
|
+
version: string;
|
|
66
|
+
}
|
|
67
|
+
/** Contact information. */
|
|
68
|
+
interface IContact {
|
|
69
|
+
/** Contact name. */
|
|
70
|
+
name?: string;
|
|
71
|
+
/** Contact URL. */
|
|
72
|
+
url?: string;
|
|
73
|
+
/** Contact email. */
|
|
74
|
+
email?: string & tags.Format<"email">;
|
|
75
|
+
}
|
|
76
|
+
/** License information. */
|
|
77
|
+
interface ILicense {
|
|
78
|
+
/** License name. */
|
|
79
|
+
name: string;
|
|
80
|
+
/** License URL. */
|
|
81
|
+
url?: string;
|
|
82
|
+
}
|
|
83
|
+
/** Tag for grouping operations. */
|
|
84
|
+
interface ITag {
|
|
85
|
+
/** Tag name. */
|
|
86
|
+
name: string;
|
|
87
|
+
/** Tag description. */
|
|
88
|
+
description?: string;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/** Path item containing operations by HTTP method. */
|
|
92
|
+
interface IPath extends Partial<Record<Method, IOperation | undefined>> {
|
|
93
|
+
/** Path-level parameters. */
|
|
94
|
+
parameters?: Array<IOperation.IParameter | IJsonSchema.IReference<`#/parameters/${string}`>>;
|
|
95
|
+
}
|
|
96
|
+
/** API operation metadata. */
|
|
97
|
+
interface IOperation {
|
|
98
|
+
/** Unique operation identifier. */
|
|
99
|
+
operationId?: string;
|
|
100
|
+
/** Operation parameters. */
|
|
101
|
+
parameters?: Array<IOperation.IParameter | IJsonSchema.IReference<`#/definitions/parameters/${string}`>>;
|
|
102
|
+
/** Response definitions by status code. */
|
|
103
|
+
responses?: Record<string, IOperation.IResponse | IJsonSchema.IReference<`#/definitions/responses/${string}`>>;
|
|
104
|
+
/** Short summary. */
|
|
105
|
+
summary?: string;
|
|
106
|
+
/** Full description. */
|
|
107
|
+
description?: string;
|
|
108
|
+
/** Security requirements. */
|
|
109
|
+
security?: Record<string, string[]>[];
|
|
110
|
+
/** Operation tags. */
|
|
111
|
+
tags?: string[];
|
|
112
|
+
/** Whether deprecated. */
|
|
113
|
+
deprecated?: boolean;
|
|
114
|
+
}
|
|
115
|
+
namespace IOperation {
|
|
116
|
+
/** Operation parameter (general or body). */
|
|
117
|
+
type IParameter = IGeneralParameter | IBodyParameter;
|
|
118
|
+
/** General parameter (path, query, header, formData). */
|
|
119
|
+
type IGeneralParameter = IJsonSchema & {
|
|
120
|
+
name: string;
|
|
121
|
+
in: string;
|
|
122
|
+
description?: string;
|
|
123
|
+
};
|
|
124
|
+
/** Body parameter. */
|
|
125
|
+
interface IBodyParameter {
|
|
126
|
+
/** Body schema. */
|
|
127
|
+
schema: IJsonSchema;
|
|
128
|
+
/** Parameter name. */
|
|
129
|
+
name: string;
|
|
130
|
+
/** Parameter location (always "body"). */
|
|
131
|
+
in: string;
|
|
132
|
+
/** Parameter description. */
|
|
133
|
+
description?: string;
|
|
134
|
+
/** Whether required. */
|
|
135
|
+
required?: boolean;
|
|
136
|
+
}
|
|
137
|
+
/** Response definition. */
|
|
138
|
+
interface IResponse {
|
|
139
|
+
/** Response description. */
|
|
140
|
+
description?: string;
|
|
141
|
+
/** Response headers. */
|
|
142
|
+
headers?: Record<string, IJsonSchema>;
|
|
143
|
+
/** Response body schema. */
|
|
144
|
+
schema?: IJsonSchema;
|
|
145
|
+
/** Example value. */
|
|
146
|
+
example?: any;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/** JSON Schema type for Swagger. */
|
|
150
|
+
type IJsonSchema = IJsonSchema.IBoolean | IJsonSchema.IInteger | IJsonSchema.INumber | IJsonSchema.IString | IJsonSchema.IArray | IJsonSchema.IObject | IJsonSchema.IReference | IJsonSchema.IAnyOf | IJsonSchema.IOneOf | IJsonSchema.INullOnly | IJsonSchema.IUnknown;
|
|
151
|
+
namespace IJsonSchema {
|
|
152
|
+
/** Boolean type. */
|
|
153
|
+
interface IBoolean extends Omit<IJsonSchemaAttribute.IBoolean, "examples">, __ISignificant<"boolean"> {
|
|
154
|
+
/** Default value. */
|
|
155
|
+
default?: boolean | null;
|
|
156
|
+
/** Allowed values. */
|
|
157
|
+
enum?: Array<boolean | null>;
|
|
158
|
+
}
|
|
159
|
+
/** Integer type. */
|
|
160
|
+
interface IInteger extends Omit<IJsonSchemaAttribute.IInteger, "examples">, __ISignificant<"integer"> {
|
|
161
|
+
/** Default value. */
|
|
162
|
+
default?: (number & tags.Type<"int64">) | null;
|
|
163
|
+
/** Allowed values. */
|
|
164
|
+
enum?: Array<(number & tags.Type<"int64">) | null>;
|
|
165
|
+
/** Minimum value. */
|
|
166
|
+
minimum?: number & tags.Type<"int64">;
|
|
167
|
+
/** Maximum value. */
|
|
168
|
+
maximum?: number & tags.Type<"int64">;
|
|
169
|
+
/** Exclusive minimum. */
|
|
170
|
+
exclusiveMinimum?: number | boolean;
|
|
171
|
+
/** Exclusive maximum. */
|
|
172
|
+
exclusiveMaximum?: number | boolean;
|
|
173
|
+
/** Multiple of constraint. */
|
|
174
|
+
multipleOf?: number & tags.ExclusiveMinimum<0>;
|
|
175
|
+
}
|
|
176
|
+
/** Number (double) type. */
|
|
177
|
+
interface INumber extends Omit<IJsonSchemaAttribute.INumber, "examples">, __ISignificant<"number"> {
|
|
178
|
+
/** Default value. */
|
|
179
|
+
default?: number | null;
|
|
180
|
+
/** Allowed values. */
|
|
181
|
+
enum?: Array<number | null>;
|
|
182
|
+
/** Minimum value. */
|
|
183
|
+
minimum?: number;
|
|
184
|
+
/** Maximum value. */
|
|
185
|
+
maximum?: number;
|
|
186
|
+
/** Exclusive minimum. */
|
|
187
|
+
exclusiveMinimum?: number | boolean;
|
|
188
|
+
/** Exclusive maximum. */
|
|
189
|
+
exclusiveMaximum?: number | boolean;
|
|
190
|
+
/** Multiple of constraint. */
|
|
191
|
+
multipleOf?: number & tags.ExclusiveMinimum<0>;
|
|
192
|
+
}
|
|
193
|
+
/** String type. */
|
|
194
|
+
interface IString extends Omit<IJsonSchemaAttribute.IString, "examples">, __ISignificant<"string"> {
|
|
195
|
+
/** Default value. */
|
|
196
|
+
default?: string | null;
|
|
197
|
+
/** Allowed values. */
|
|
198
|
+
enum?: Array<string | null>;
|
|
199
|
+
/** String format. */
|
|
200
|
+
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 & {});
|
|
201
|
+
/** Regex pattern. */
|
|
202
|
+
pattern?: string;
|
|
203
|
+
/** Minimum length. */
|
|
204
|
+
minLength?: number & tags.Type<"uint64">;
|
|
205
|
+
/** Maximum length. */
|
|
206
|
+
maxLength?: number & tags.Type<"uint64">;
|
|
207
|
+
}
|
|
208
|
+
/** Array type. */
|
|
209
|
+
interface IArray extends Omit<IJsonSchemaAttribute.IArray, "examples">, __ISignificant<"array"> {
|
|
210
|
+
/** Element type. */
|
|
211
|
+
items: IJsonSchema;
|
|
212
|
+
/** Whether elements must be unique. */
|
|
213
|
+
uniqueItems?: boolean;
|
|
214
|
+
/** Minimum items. */
|
|
215
|
+
minItems?: number & tags.Type<"uint64">;
|
|
216
|
+
/** Maximum items. */
|
|
217
|
+
maxItems?: number & tags.Type<"uint64">;
|
|
218
|
+
}
|
|
219
|
+
/** Object type. */
|
|
220
|
+
interface IObject extends Omit<IJsonSchemaAttribute.IObject, "examples">, __ISignificant<"object"> {
|
|
221
|
+
/** Property schemas. */
|
|
222
|
+
properties?: Record<string, IJsonSchema>;
|
|
223
|
+
/** Required property names. */
|
|
224
|
+
required?: string[];
|
|
225
|
+
/** Additional properties schema. */
|
|
226
|
+
additionalProperties?: boolean | IJsonSchema;
|
|
227
|
+
/** Maximum properties. */
|
|
228
|
+
maxProperties?: number;
|
|
229
|
+
/** Minimum properties. */
|
|
230
|
+
minProperties?: number;
|
|
231
|
+
}
|
|
232
|
+
/** Reference to a named schema. */
|
|
233
|
+
interface IReference<Key = string> extends __IAttribute {
|
|
234
|
+
/** Reference path. */
|
|
235
|
+
$ref: Key;
|
|
236
|
+
}
|
|
237
|
+
/** All-of combination. */
|
|
238
|
+
interface IAllOf extends __IAttribute {
|
|
239
|
+
/** Schemas to combine. */
|
|
240
|
+
allOf: IJsonSchema[];
|
|
241
|
+
}
|
|
242
|
+
/** Any-of union (Swagger extension). */
|
|
243
|
+
interface IAnyOf extends __IAttribute {
|
|
244
|
+
/** Union member schemas. */
|
|
245
|
+
"x-anyOf": IJsonSchema[];
|
|
246
|
+
}
|
|
247
|
+
/** One-of union (Swagger extension). */
|
|
248
|
+
interface IOneOf extends __IAttribute {
|
|
249
|
+
/** Union member schemas. */
|
|
250
|
+
"x-oneOf": IJsonSchema[];
|
|
251
|
+
}
|
|
252
|
+
/** Null type. */
|
|
253
|
+
interface INullOnly extends __IAttribute {
|
|
254
|
+
/** Type discriminator. */
|
|
255
|
+
type: "null";
|
|
256
|
+
/** Default value. */
|
|
257
|
+
default?: null;
|
|
258
|
+
}
|
|
259
|
+
/** Unknown type. */
|
|
260
|
+
interface IUnknown extends __IAttribute {
|
|
261
|
+
/** Type discriminator (undefined for unknown). */
|
|
262
|
+
type?: undefined;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
/** Security scheme types. */
|
|
266
|
+
type ISecurityDefinition = ISecurityDefinition.IApiKey | ISecurityDefinition.IBasic | ISecurityDefinition.IOauth2Implicit | ISecurityDefinition.IOauth2AccessCode | ISecurityDefinition.IOauth2Password | ISecurityDefinition.IOauth2Application;
|
|
267
|
+
namespace ISecurityDefinition {
|
|
268
|
+
/** API key authentication. */
|
|
269
|
+
interface IApiKey {
|
|
270
|
+
/** Scheme type. */
|
|
271
|
+
type: "apiKey";
|
|
272
|
+
/** Key location. */
|
|
273
|
+
in?: "header" | "query" | "cookie";
|
|
274
|
+
/** Key name. */
|
|
275
|
+
name?: string;
|
|
276
|
+
/** Scheme description. */
|
|
277
|
+
description?: string;
|
|
278
|
+
}
|
|
279
|
+
/** HTTP basic authentication. */
|
|
280
|
+
interface IBasic {
|
|
281
|
+
/** Scheme type. */
|
|
282
|
+
type: "basic";
|
|
283
|
+
/** Scheme name. */
|
|
284
|
+
name?: string;
|
|
285
|
+
/** Scheme description. */
|
|
286
|
+
description?: string;
|
|
287
|
+
}
|
|
288
|
+
/** OAuth2 implicit flow. */
|
|
289
|
+
interface IOauth2Implicit {
|
|
290
|
+
/** Scheme type. */
|
|
291
|
+
type: "oauth2";
|
|
292
|
+
/** OAuth2 flow type. */
|
|
293
|
+
flow: "implicit";
|
|
294
|
+
/** Authorization URL. */
|
|
295
|
+
authorizationUrl?: string;
|
|
296
|
+
/** Available scopes. */
|
|
297
|
+
scopes?: Record<string, string>;
|
|
298
|
+
/** Scheme description. */
|
|
299
|
+
description?: string;
|
|
300
|
+
}
|
|
301
|
+
/** OAuth2 authorization code flow. */
|
|
302
|
+
interface IOauth2AccessCode {
|
|
303
|
+
/** Scheme type. */
|
|
304
|
+
type: "oauth2";
|
|
305
|
+
/** OAuth2 flow type. */
|
|
306
|
+
flow: "accessCode";
|
|
307
|
+
/** Authorization URL. */
|
|
308
|
+
authorizationUrl?: string;
|
|
309
|
+
/** Token URL. */
|
|
310
|
+
tokenUrl?: string;
|
|
311
|
+
/** Available scopes. */
|
|
312
|
+
scopes?: Record<string, string>;
|
|
313
|
+
/** Scheme description. */
|
|
314
|
+
description?: string;
|
|
315
|
+
}
|
|
316
|
+
/** OAuth2 password flow. */
|
|
317
|
+
interface IOauth2Password {
|
|
318
|
+
/** Scheme type. */
|
|
319
|
+
type: "oauth2";
|
|
320
|
+
/** OAuth2 flow type. */
|
|
321
|
+
flow: "password";
|
|
322
|
+
/** Token URL. */
|
|
323
|
+
tokenUrl?: string;
|
|
324
|
+
/** Available scopes. */
|
|
325
|
+
scopes?: Record<string, string>;
|
|
326
|
+
/** Scheme description. */
|
|
327
|
+
description?: string;
|
|
328
|
+
}
|
|
329
|
+
/** OAuth2 application (client credentials) flow. */
|
|
330
|
+
interface IOauth2Application {
|
|
331
|
+
/** Scheme type. */
|
|
332
|
+
type: "oauth2";
|
|
333
|
+
/** OAuth2 flow type. */
|
|
334
|
+
flow: "application";
|
|
335
|
+
/** Token URL. */
|
|
336
|
+
tokenUrl?: string;
|
|
337
|
+
/** Available scopes. */
|
|
338
|
+
scopes?: Record<string, string>;
|
|
339
|
+
/** Scheme description. */
|
|
340
|
+
description?: string;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwaggerV2.js","sourceRoot":"","sources":["../../src/openapi/SwaggerV2.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./OpenApi"), exports);
|
|
18
|
+
__exportStar(require("./OpenApiV3"), exports);
|
|
19
|
+
__exportStar(require("./OpenApiV3_1"), exports);
|
|
20
|
+
__exportStar(require("./SwaggerV2"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/openapi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,8CAA4B;AAC5B,gDAA8B;AAC9B,8CAA4B"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Protocol Buffers wire types.
|
|
3
|
+
*
|
|
4
|
+
* `ProtobufWire` defines the wire types used in Protocol Buffers binary
|
|
5
|
+
* encoding. Each type determines how the value is serialized on the wire.
|
|
6
|
+
*
|
|
7
|
+
* Wire types:
|
|
8
|
+
*
|
|
9
|
+
* - {@link VARIANT} (0): Varints (int32, int64, uint32, uint64, sint32, sint64,
|
|
10
|
+
* bool, enum)
|
|
11
|
+
* - {@link I64} (1): 64-bit (fixed64, sfixed64, double)
|
|
12
|
+
* - {@link LEN} (2): Length-delimited (string, bytes, embedded messages, packed
|
|
13
|
+
* repeated)
|
|
14
|
+
* - {@link I32} (5): 32-bit (fixed32, sfixed32, float)
|
|
15
|
+
*
|
|
16
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
17
|
+
*/
|
|
18
|
+
export declare const enum ProtobufWire {
|
|
19
|
+
/**
|
|
20
|
+
* - Integers
|
|
21
|
+
* - Bool
|
|
22
|
+
* - Enum
|
|
23
|
+
*/
|
|
24
|
+
VARIANT = 0,
|
|
25
|
+
/**
|
|
26
|
+
* - Fixed64
|
|
27
|
+
* - Sfixed64
|
|
28
|
+
* - Double
|
|
29
|
+
*/
|
|
30
|
+
I64 = 1,
|
|
31
|
+
/**
|
|
32
|
+
* - String
|
|
33
|
+
* - Bytes
|
|
34
|
+
* - Embedded messages
|
|
35
|
+
* - Packed repeated fields
|
|
36
|
+
*/
|
|
37
|
+
LEN = 2,
|
|
38
|
+
START_GROUP = 3,
|
|
39
|
+
END_GROUP = 4,
|
|
40
|
+
/**
|
|
41
|
+
* - Fixed
|
|
42
|
+
* - Sfixed32
|
|
43
|
+
* - Float
|
|
44
|
+
*/
|
|
45
|
+
I32 = 5
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProtobufWire.js","sourceRoot":"","sources":["../../src/protobuf/ProtobufWire.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ProtobufWire";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ProtobufWire"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/protobuf/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B"}
|