@skmtc/core 0.0.799 → 0.0.802
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/esm/context/CoreContext.d.ts +0 -3
- package/esm/context/CoreContext.d.ts.map +1 -1
- package/esm/context/CoreContext.js +12 -17
- package/esm/context/GenerateContext.d.ts +35 -3
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +21 -1
- package/esm/context/ParseContext.d.ts +64 -3
- package/esm/context/ParseContext.d.ts.map +1 -1
- package/esm/context/ParseContext.js +61 -0
- package/esm/context/RenderContext.d.ts +151 -2
- package/esm/context/RenderContext.d.ts.map +1 -1
- package/esm/context/RenderContext.js +185 -11
- package/esm/context/ResultsHandler.d.ts +10 -3
- package/esm/context/ResultsHandler.d.ts.map +1 -1
- package/esm/context/types.d.ts +30 -0
- package/esm/context/types.d.ts.map +1 -1
- package/esm/dsl/model/ModelBase.d.ts +1 -1
- package/esm/dsl/model/ModelBase.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.d.ts +62 -0
- package/esm/dsl/model/ModelDriver.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.js +63 -1
- package/esm/dsl/model/toModelBase.d.ts +66 -0
- package/esm/dsl/model/toModelBase.d.ts.map +1 -1
- package/esm/dsl/model/toModelBase.js +46 -0
- package/esm/dsl/model/toModelEntry.d.ts +63 -0
- package/esm/dsl/model/toModelEntry.d.ts.map +1 -1
- package/esm/dsl/model/toModelEntry.js +63 -0
- package/esm/dsl/model/types.d.ts +51 -4
- package/esm/dsl/model/types.d.ts.map +1 -1
- package/esm/dsl/operation/OperationBase.d.ts +3 -3
- package/esm/dsl/operation/OperationBase.d.ts.map +1 -1
- package/esm/dsl/operation/OperationDriver.d.ts +48 -0
- package/esm/dsl/operation/OperationDriver.d.ts.map +1 -1
- package/esm/dsl/operation/OperationDriver.js +49 -1
- package/esm/dsl/operation/types.d.ts +61 -3
- package/esm/dsl/operation/types.d.ts.map +1 -1
- package/esm/helpers/isEmpty.d.ts +1 -1
- package/esm/helpers/isEmpty.d.ts.map +1 -1
- package/esm/helpers/tracer.d.ts +1 -1
- package/esm/helpers/tracer.d.ts.map +1 -1
- package/esm/helpers/tracer.js +1 -1
- package/esm/mod.d.ts +51 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +51 -0
- package/esm/oas/array/array-types.d.ts +20 -11
- package/esm/oas/array/array-types.d.ts.map +1 -1
- package/esm/oas/array/array-types.js +10 -0
- package/esm/oas/array/toArray.d.ts +111 -0
- package/esm/oas/array/toArray.d.ts.map +1 -1
- package/esm/oas/array/toArray.js +115 -3
- package/esm/oas/boolean/boolean-types.d.ts +1 -7
- package/esm/oas/boolean/boolean-types.d.ts.map +1 -1
- package/esm/oas/components/components-types.d.ts +19 -0
- package/esm/oas/components/components-types.d.ts.map +1 -0
- package/esm/oas/components/components-types.js +21 -0
- package/esm/oas/contact/contact-types.d.ts +9 -0
- package/esm/oas/contact/contact-types.d.ts.map +1 -0
- package/esm/oas/contact/contact-types.js +7 -0
- package/esm/oas/discriminator/discriminator-types.d.ts +1 -5
- package/esm/oas/discriminator/discriminator-types.d.ts.map +1 -1
- package/esm/oas/document/document-types.d.ts +16 -0
- package/esm/oas/document/document-types.d.ts.map +1 -0
- package/esm/oas/document/document-types.js +18 -0
- package/esm/oas/example/example-types.d.ts +1 -6
- package/esm/oas/example/example-types.d.ts.map +1 -1
- package/esm/oas/header/header-types.d.ts +50 -0
- package/esm/oas/header/header-types.d.ts.map +1 -0
- package/esm/oas/header/header-types.js +30 -0
- package/esm/oas/info/info-types.d.ts +14 -0
- package/esm/oas/info/info-types.d.ts.map +1 -0
- package/esm/oas/info/info-types.js +13 -0
- package/esm/oas/integer/integer-types.d.ts +3 -17
- package/esm/oas/integer/integer-types.d.ts.map +1 -1
- package/esm/oas/license/license-types.d.ts +9 -0
- package/esm/oas/license/license-types.d.ts.map +1 -0
- package/esm/oas/license/license-types.js +7 -0
- package/esm/oas/mediaType/mediaType-types.d.ts +1 -11
- package/esm/oas/mediaType/mediaType-types.d.ts.map +1 -1
- package/esm/oas/number/number-types.d.ts +2 -16
- package/esm/oas/number/number-types.d.ts.map +1 -1
- package/esm/oas/operation/Operation.d.ts +47 -2
- package/esm/oas/operation/Operation.d.ts.map +1 -1
- package/esm/oas/operation/Operation.js +43 -0
- package/esm/oas/operation/operation-types.d.ts +22 -0
- package/esm/oas/operation/operation-types.d.ts.map +1 -0
- package/esm/oas/operation/operation-types.js +35 -0
- package/esm/oas/parameter/parameter-types.d.ts +3 -58
- package/esm/oas/parameter/parameter-types.d.ts.map +1 -1
- package/esm/oas/pathItem/pathItem-types.d.ts +12 -0
- package/esm/oas/pathItem/pathItem-types.d.ts.map +1 -0
- package/esm/oas/pathItem/pathItem-types.js +12 -0
- package/esm/oas/ref/Ref.d.ts +49 -2
- package/esm/oas/ref/Ref.d.ts.map +1 -1
- package/esm/oas/ref/Ref.js +28 -0
- package/esm/oas/requestBody/requestBody-types.d.ts +10 -0
- package/esm/oas/requestBody/requestBody-types.d.ts.map +1 -0
- package/esm/oas/requestBody/requestBody-types.js +9 -0
- package/esm/oas/response/response-types.d.ts +12 -0
- package/esm/oas/response/response-types.d.ts.map +1 -0
- package/esm/oas/response/response-types.js +11 -0
- package/esm/oas/schema/toSchemasV3.js +2 -2
- package/esm/oas/server/toServerV3.d.ts.map +1 -1
- package/esm/oas/string/string-types.d.ts +2 -29
- package/esm/oas/string/string-types.d.ts.map +1 -1
- package/esm/oas/string/toString.d.ts +125 -1
- package/esm/oas/string/toString.d.ts.map +1 -1
- package/esm/oas/string/toString.js +119 -0
- package/esm/oas/tag/tag-types.d.ts +8 -0
- package/esm/oas/tag/tag-types.d.ts.map +1 -0
- package/esm/oas/tag/tag-types.js +8 -0
- package/esm/oas/union/union-types.d.ts +1 -12
- package/esm/oas/union/union-types.d.ts.map +1 -1
- package/esm/oas/unknown/unknown-types.d.ts +1 -7
- package/esm/oas/unknown/unknown-types.d.ts.map +1 -1
- package/esm/types/Preview.d.ts +37 -0
- package/esm/types/Preview.d.ts.map +1 -1
- package/esm/types/Preview.js +37 -0
- package/esm/types/Settings.d.ts +35 -0
- package/esm/types/Settings.d.ts.map +1 -1
- package/esm/types/Settings.js +27 -0
- package/esm/typescript/FunctionParameter.d.ts +4 -4
- package/esm/typescript/FunctionParameter.d.ts.map +1 -1
- package/esm/typescript/List.d.ts +104 -5
- package/esm/typescript/List.d.ts.map +1 -1
- package/esm/typescript/List.js +75 -0
- package/package.json +1 -1
- package/script/context/CoreContext.d.ts +0 -3
- package/script/context/CoreContext.d.ts.map +1 -1
- package/script/context/CoreContext.js +12 -17
- package/script/context/GenerateContext.d.ts +35 -3
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +21 -1
- package/script/context/ParseContext.d.ts +64 -3
- package/script/context/ParseContext.d.ts.map +1 -1
- package/script/context/ParseContext.js +61 -0
- package/script/context/RenderContext.d.ts +151 -2
- package/script/context/RenderContext.d.ts.map +1 -1
- package/script/context/RenderContext.js +185 -11
- package/script/context/ResultsHandler.d.ts +10 -3
- package/script/context/ResultsHandler.d.ts.map +1 -1
- package/script/context/types.d.ts +30 -0
- package/script/context/types.d.ts.map +1 -1
- package/script/dsl/model/ModelBase.d.ts +1 -1
- package/script/dsl/model/ModelBase.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.d.ts +62 -0
- package/script/dsl/model/ModelDriver.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.js +63 -1
- package/script/dsl/model/toModelBase.d.ts +66 -0
- package/script/dsl/model/toModelBase.d.ts.map +1 -1
- package/script/dsl/model/toModelBase.js +46 -0
- package/script/dsl/model/toModelEntry.d.ts +63 -0
- package/script/dsl/model/toModelEntry.d.ts.map +1 -1
- package/script/dsl/model/toModelEntry.js +63 -0
- package/script/dsl/model/types.d.ts +51 -4
- package/script/dsl/model/types.d.ts.map +1 -1
- package/script/dsl/operation/OperationBase.d.ts +3 -3
- package/script/dsl/operation/OperationBase.d.ts.map +1 -1
- package/script/dsl/operation/OperationDriver.d.ts +48 -0
- package/script/dsl/operation/OperationDriver.d.ts.map +1 -1
- package/script/dsl/operation/OperationDriver.js +49 -1
- package/script/dsl/operation/types.d.ts +61 -3
- package/script/dsl/operation/types.d.ts.map +1 -1
- package/script/helpers/isEmpty.d.ts +1 -1
- package/script/helpers/isEmpty.d.ts.map +1 -1
- package/script/helpers/tracer.d.ts +1 -1
- package/script/helpers/tracer.d.ts.map +1 -1
- package/script/helpers/tracer.js +1 -1
- package/script/mod.d.ts +51 -0
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +51 -0
- package/script/oas/array/array-types.d.ts +20 -11
- package/script/oas/array/array-types.d.ts.map +1 -1
- package/script/oas/array/array-types.js +11 -1
- package/script/oas/array/toArray.d.ts +111 -0
- package/script/oas/array/toArray.d.ts.map +1 -1
- package/script/oas/array/toArray.js +114 -2
- package/script/oas/boolean/boolean-types.d.ts +1 -7
- package/script/oas/boolean/boolean-types.d.ts.map +1 -1
- package/script/oas/components/components-types.d.ts +19 -0
- package/script/oas/components/components-types.d.ts.map +1 -0
- package/script/oas/components/components-types.js +57 -0
- package/script/oas/contact/contact-types.d.ts +9 -0
- package/script/oas/contact/contact-types.d.ts.map +1 -0
- package/script/oas/contact/contact-types.js +43 -0
- package/script/oas/discriminator/discriminator-types.d.ts +1 -5
- package/script/oas/discriminator/discriminator-types.d.ts.map +1 -1
- package/script/oas/document/document-types.d.ts +16 -0
- package/script/oas/document/document-types.d.ts.map +1 -0
- package/script/oas/document/document-types.js +54 -0
- package/script/oas/example/example-types.d.ts +1 -6
- package/script/oas/example/example-types.d.ts.map +1 -1
- package/script/oas/header/header-types.d.ts +50 -0
- package/script/oas/header/header-types.d.ts.map +1 -0
- package/script/oas/header/header-types.js +66 -0
- package/script/oas/info/info-types.d.ts +14 -0
- package/script/oas/info/info-types.d.ts.map +1 -0
- package/script/oas/info/info-types.js +49 -0
- package/script/oas/integer/integer-types.d.ts +3 -17
- package/script/oas/integer/integer-types.d.ts.map +1 -1
- package/script/oas/license/license-types.d.ts +9 -0
- package/script/oas/license/license-types.d.ts.map +1 -0
- package/script/oas/license/license-types.js +43 -0
- package/script/oas/mediaType/mediaType-types.d.ts +1 -11
- package/script/oas/mediaType/mediaType-types.d.ts.map +1 -1
- package/script/oas/number/number-types.d.ts +2 -16
- package/script/oas/number/number-types.d.ts.map +1 -1
- package/script/oas/operation/Operation.d.ts +47 -2
- package/script/oas/operation/Operation.d.ts.map +1 -1
- package/script/oas/operation/Operation.js +43 -0
- package/script/oas/operation/operation-types.d.ts +22 -0
- package/script/oas/operation/operation-types.d.ts.map +1 -0
- package/script/oas/operation/operation-types.js +71 -0
- package/script/oas/parameter/parameter-types.d.ts +3 -58
- package/script/oas/parameter/parameter-types.d.ts.map +1 -1
- package/script/oas/pathItem/pathItem-types.d.ts +12 -0
- package/script/oas/pathItem/pathItem-types.d.ts.map +1 -0
- package/script/oas/pathItem/pathItem-types.js +48 -0
- package/script/oas/ref/Ref.d.ts +49 -2
- package/script/oas/ref/Ref.d.ts.map +1 -1
- package/script/oas/ref/Ref.js +28 -0
- package/script/oas/requestBody/requestBody-types.d.ts +10 -0
- package/script/oas/requestBody/requestBody-types.d.ts.map +1 -0
- package/script/oas/requestBody/requestBody-types.js +45 -0
- package/script/oas/response/response-types.d.ts +12 -0
- package/script/oas/response/response-types.d.ts.map +1 -0
- package/script/oas/response/response-types.js +47 -0
- package/script/oas/schema/toSchemasV3.js +2 -2
- package/script/oas/server/toServerV3.d.ts.map +1 -1
- package/script/oas/string/string-types.d.ts +2 -29
- package/script/oas/string/string-types.d.ts.map +1 -1
- package/script/oas/string/toString.d.ts +125 -1
- package/script/oas/string/toString.d.ts.map +1 -1
- package/script/oas/string/toString.js +119 -0
- package/script/oas/tag/tag-types.d.ts +8 -0
- package/script/oas/tag/tag-types.d.ts.map +1 -0
- package/script/oas/tag/tag-types.js +44 -0
- package/script/oas/union/union-types.d.ts +1 -12
- package/script/oas/union/union-types.d.ts.map +1 -1
- package/script/oas/unknown/unknown-types.d.ts +1 -7
- package/script/oas/unknown/unknown-types.d.ts.map +1 -1
- package/script/types/Preview.d.ts +37 -0
- package/script/types/Preview.d.ts.map +1 -1
- package/script/types/Preview.js +37 -0
- package/script/types/Settings.d.ts +35 -0
- package/script/types/Settings.d.ts.map +1 -1
- package/script/types/Settings.js +27 -0
- package/script/typescript/FunctionParameter.d.ts +4 -4
- package/script/typescript/FunctionParameter.d.ts.map +1 -1
- package/script/typescript/List.d.ts +104 -5
- package/script/typescript/List.d.ts.map +1 -1
- package/script/typescript/List.js +75 -0
|
@@ -43,6 +43,65 @@ const parseEnum_js_1 = require("../_helpers/parseEnum.js");
|
|
|
43
43
|
const v = __importStar(require("valibot"));
|
|
44
44
|
const array_types_js_1 = require("./array-types.js");
|
|
45
45
|
const parseDefault_js_1 = require("../_helpers/parseDefault.js");
|
|
46
|
+
/**
|
|
47
|
+
* Transforms an OpenAPI v3 array schema object into an internal OAS array representation.
|
|
48
|
+
*
|
|
49
|
+
* This function processes OpenAPI array schemas by extracting and parsing nullable values,
|
|
50
|
+
* examples, enumerations, and default values. It handles the complete transformation from
|
|
51
|
+
* raw OpenAPI JSON to the SKMTC internal array representation with proper type safety.
|
|
52
|
+
*
|
|
53
|
+
* The transformation follows a pipeline approach:
|
|
54
|
+
* 1. Parse nullable flag and extract base value
|
|
55
|
+
* 2. Parse example values with nullable support
|
|
56
|
+
* 3. Parse enumeration constraints
|
|
57
|
+
* 4. Parse default values
|
|
58
|
+
* 5. Create final OasArray instance
|
|
59
|
+
*
|
|
60
|
+
* @param args - Transformation arguments
|
|
61
|
+
* @param args.value - The OpenAPI v3 array schema object to transform
|
|
62
|
+
* @param args.context - Parse context providing utilities and tracing
|
|
63
|
+
* @returns Transformed OAS array object with parsed properties
|
|
64
|
+
*
|
|
65
|
+
* @example Basic array transformation
|
|
66
|
+
* ```typescript
|
|
67
|
+
* import { toArray } from '@skmtc/core';
|
|
68
|
+
*
|
|
69
|
+
* const openApiArray = {
|
|
70
|
+
* type: 'array',
|
|
71
|
+
* items: { type: 'string' },
|
|
72
|
+
* maxItems: 10,
|
|
73
|
+
* uniqueItems: true
|
|
74
|
+
* };
|
|
75
|
+
*
|
|
76
|
+
* const oasArray = toArray({
|
|
77
|
+
* value: openApiArray,
|
|
78
|
+
* context: parseContext
|
|
79
|
+
* });
|
|
80
|
+
*
|
|
81
|
+
* console.log(oasArray.maxItems); // 10
|
|
82
|
+
* console.log(oasArray.uniqueItems); // true
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* @example Array with nullable and examples
|
|
86
|
+
* ```typescript
|
|
87
|
+
* const complexArray = {
|
|
88
|
+
* type: 'array',
|
|
89
|
+
* items: { type: 'number' },
|
|
90
|
+
* nullable: true,
|
|
91
|
+
* example: [1, 2, 3],
|
|
92
|
+
* default: [],
|
|
93
|
+
* enum: [[1, 2], [3, 4], null]
|
|
94
|
+
* };
|
|
95
|
+
*
|
|
96
|
+
* const oasArray = toArray({
|
|
97
|
+
* value: complexArray,
|
|
98
|
+
* context: parseContext
|
|
99
|
+
* });
|
|
100
|
+
*
|
|
101
|
+
* console.log(oasArray.nullable); // true
|
|
102
|
+
* console.log(oasArray.example); // [1, 2, 3]
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
46
105
|
const toArray = ({ value, context }) => {
|
|
47
106
|
const { nullable, value: valueWithoutNullable } = (0, parseNullable_js_1.parseNullable)({
|
|
48
107
|
value,
|
|
@@ -76,11 +135,64 @@ const toArray = ({ value, context }) => {
|
|
|
76
135
|
});
|
|
77
136
|
};
|
|
78
137
|
exports.toArray = toArray;
|
|
138
|
+
/**
|
|
139
|
+
* Creates an OAS array instance from pre-parsed array schema components.
|
|
140
|
+
*
|
|
141
|
+
* This function is the final step in the array transformation pipeline, taking
|
|
142
|
+
* already-parsed nullable, example, enum, and default values and combining them
|
|
143
|
+
* with the remaining array properties to create the complete OasArray instance.
|
|
144
|
+
*
|
|
145
|
+
* The function handles type-safe nullable parsing, items schema resolution,
|
|
146
|
+
* and specification extension processing. It uses Valibot for schema validation
|
|
147
|
+
* and maintains proper type relationships between nullable flags and value types.
|
|
148
|
+
*
|
|
149
|
+
* @template Nullable - Boolean type indicating if the array can be null
|
|
150
|
+
* @param args - Pre-parsed array components
|
|
151
|
+
* @param args.value - OpenAPI array object without parsed fields
|
|
152
|
+
* @param args.context - Parse context for tracing and utilities
|
|
153
|
+
* @param args.nullable - Parsed nullable flag
|
|
154
|
+
* @param args.example - Parsed example value (type-safe with nullable)
|
|
155
|
+
* @param args.enums - Parsed enumeration constraints (type-safe with nullable)
|
|
156
|
+
* @param args.defaultValue - Parsed default value (type-safe with nullable)
|
|
157
|
+
* @returns Complete OAS array instance with all properties
|
|
158
|
+
*
|
|
159
|
+
* @example Type-safe nullable array
|
|
160
|
+
* ```typescript
|
|
161
|
+
* const nullableArray = toParsedArray({
|
|
162
|
+
* context: parseContext,
|
|
163
|
+
* nullable: true,
|
|
164
|
+
* example: [1, 2, 3], // Can be null due to nullable: true
|
|
165
|
+
* enums: [[1], [2], null], // Null allowed in enums
|
|
166
|
+
* defaultValue: null,
|
|
167
|
+
* value: {
|
|
168
|
+
* type: 'array',
|
|
169
|
+
* items: { type: 'number' },
|
|
170
|
+
* maxItems: 5
|
|
171
|
+
* }
|
|
172
|
+
* });
|
|
173
|
+
* ```
|
|
174
|
+
*
|
|
175
|
+
* @example Non-nullable array
|
|
176
|
+
* ```typescript
|
|
177
|
+
* const regularArray = toParsedArray({
|
|
178
|
+
* context: parseContext,
|
|
179
|
+
* nullable: false,
|
|
180
|
+
* example: ['a', 'b'], // Cannot be null
|
|
181
|
+
* enums: [['x'], ['y']], // No null values allowed
|
|
182
|
+
* defaultValue: [],
|
|
183
|
+
* value: {
|
|
184
|
+
* type: 'array',
|
|
185
|
+
* items: { type: 'string' }
|
|
186
|
+
* }
|
|
187
|
+
* });
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
79
190
|
const toParsedArray = ({ context, nullable, example, enums, defaultValue, value }) => {
|
|
80
191
|
// We only want parse non-items fields here since items is handled below
|
|
81
192
|
const { items, ...rest } = value;
|
|
82
|
-
|
|
83
|
-
const
|
|
193
|
+
// Parse the object without items field
|
|
194
|
+
const parsed = v.parse(array_types_js_1.oasArrayDataWithoutItems, rest);
|
|
195
|
+
const { type: _type, title, description, uniqueItems, maxItems, minItems, ...skipped } = parsed;
|
|
84
196
|
const extensionFields = (0, toSpecificationExtensionsV3_js_1.toSpecificationExtensionsV3)({
|
|
85
197
|
skipped,
|
|
86
198
|
parent: value,
|
|
@@ -5,13 +5,7 @@ import * as v from 'valibot';
|
|
|
5
5
|
* Validates boolean schemas including default values and enumeration
|
|
6
6
|
* constraints. Boolean enums typically contain [true, false] or single values.
|
|
7
7
|
*/
|
|
8
|
-
export declare const oasBooleanData: v.
|
|
9
|
-
readonly type: v.LiteralSchema<"boolean", undefined>;
|
|
10
|
-
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
11
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
12
|
-
readonly default: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
13
|
-
readonly enum: v.OptionalSchema<v.ArraySchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
14
|
-
}, undefined>;
|
|
8
|
+
export declare const oasBooleanData: v.GenericSchema<OasBooleanData>;
|
|
15
9
|
/**
|
|
16
10
|
* Data type for OpenAPI boolean schema objects.
|
|
17
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boolean-types.d.ts","sourceRoot":"","sources":["../../../src/oas/boolean/boolean-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"boolean-types.d.ts","sourceRoot":"","sources":["../../../src/oas/boolean/boolean-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,aAAa,CAAC,cAAc,CAMzD,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,yCAAyC;IACzC,IAAI,EAAE,SAAS,CAAA;IACf,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kFAAkF;IAClF,IAAI,CAAC,EAAE,OAAO,EAAE,CAAA;CACjB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type OasExampleData } from '../example/example-types.js';
|
|
2
|
+
import { type OasHeaderData } from '../header/header-types.js';
|
|
3
|
+
import { type OasParameterData } from '../parameter/parameter-types.js';
|
|
4
|
+
import type { OasExampleRefData, OasHeaderRefData, OasParameterRefData, OasRequestBodyRefData, OasResponseRefData, OasSchemaRefData } from '../ref/ref-types.js';
|
|
5
|
+
import { type OasRequestBodyData } from '../requestBody/requestBody-types.js';
|
|
6
|
+
import { type OasResponseData } from '../response/response-types.js';
|
|
7
|
+
import { type OasSchemaData } from '../schema/schema-types.js';
|
|
8
|
+
import * as v from 'valibot';
|
|
9
|
+
export type OasComponentsData = {
|
|
10
|
+
oasType: 'components';
|
|
11
|
+
schemas?: Record<string, OasSchemaData | OasSchemaRefData>;
|
|
12
|
+
responses?: Record<string, OasResponseData | OasResponseRefData>;
|
|
13
|
+
parameters?: Record<string, OasParameterData | OasParameterRefData>;
|
|
14
|
+
examples?: Record<string, OasExampleData | OasExampleRefData>;
|
|
15
|
+
requestBodies?: Record<string, OasRequestBodyData | OasRequestBodyRefData>;
|
|
16
|
+
headers?: Record<string, OasHeaderData | OasHeaderRefData>;
|
|
17
|
+
};
|
|
18
|
+
export declare const oasComponentsData: v.GenericSchema<OasComponentsData>;
|
|
19
|
+
//# sourceMappingURL=components-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components-types.d.ts","sourceRoot":"","sources":["../../../src/oas/components/components-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,6BAA6B,CAAA;AACjF,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,2BAA2B,CAAA;AAC7E,OAAO,EAAE,KAAK,gBAAgB,EAAoB,MAAM,iCAAiC,CAAA;AACzF,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,qBAAqB,CAAA;AAS5B,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,qCAAqC,CAAA;AACjG,OAAO,EAAE,KAAK,eAAe,EAAmB,MAAM,+BAA+B,CAAA;AACrF,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,2BAA2B,CAAA;AAC7E,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,YAAY,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,gBAAgB,CAAC,CAAA;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,GAAG,kBAAkB,CAAC,CAAA;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,CAAA;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,iBAAiB,CAAC,CAAA;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,qBAAqB,CAAC,CAAA;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,gBAAgB,CAAC,CAAA;CAC3D,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,aAAa,CAAC,iBAAiB,CAc/D,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.oasComponentsData = void 0;
|
|
37
|
+
const example_types_js_1 = require("../example/example-types.js");
|
|
38
|
+
const header_types_js_1 = require("../header/header-types.js");
|
|
39
|
+
const parameter_types_js_1 = require("../parameter/parameter-types.js");
|
|
40
|
+
const ref_types_js_1 = require("../ref/ref-types.js");
|
|
41
|
+
const requestBody_types_js_1 = require("../requestBody/requestBody-types.js");
|
|
42
|
+
const response_types_js_1 = require("../response/response-types.js");
|
|
43
|
+
const schema_types_js_1 = require("../schema/schema-types.js");
|
|
44
|
+
const v = __importStar(require("valibot"));
|
|
45
|
+
exports.oasComponentsData = v.object({
|
|
46
|
+
oasType: v.literal('components'),
|
|
47
|
+
schemas: v.optional(v.record(v.string(), v.union([schema_types_js_1.oasSchemaData, ref_types_js_1.oasSchemaRefData]))),
|
|
48
|
+
responses: v.optional(v.record(v.string(), v.union([response_types_js_1.oasResponseData, ref_types_js_1.oasResponseRefData]))),
|
|
49
|
+
parameters: v.optional(v.record(v.string(), v.union([parameter_types_js_1.oasParameterData, ref_types_js_1.oasParameterRefData]))),
|
|
50
|
+
examples: v.optional(v.record(v.string(), v.union([example_types_js_1.oasExampleData, ref_types_js_1.oasExampleRefData]))),
|
|
51
|
+
requestBodies: v.optional(v.record(v.string(), v.union([requestBody_types_js_1.oasRequestBodyData, ref_types_js_1.oasRequestBodyRefData]))),
|
|
52
|
+
headers: v.optional(v.record(v.string(), v.union([header_types_js_1.oasHeaderData, ref_types_js_1.oasHeaderRefData])))
|
|
53
|
+
// securitySchemes: z.record(z.union([securityScheme, ref])),
|
|
54
|
+
// links: z.record(z.union([link, ref])),
|
|
55
|
+
// callbacks: z.never(),
|
|
56
|
+
// pathItems: z.record(z.union([oasPathItemData, oasPathItemRefData])).optional()
|
|
57
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact-types.d.ts","sourceRoot":"","sources":["../../../src/oas/contact/contact-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,SAAS,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,aAAa,CAAC,cAAc,CAKzD,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.oasContactData = void 0;
|
|
37
|
+
const v = __importStar(require("valibot"));
|
|
38
|
+
exports.oasContactData = v.object({
|
|
39
|
+
oasType: v.literal('contact'),
|
|
40
|
+
name: v.optional(v.string()),
|
|
41
|
+
url: v.optional(v.string()),
|
|
42
|
+
email: v.optional(v.string())
|
|
43
|
+
});
|
|
@@ -21,9 +21,5 @@ export type OasDiscriminatorData = {
|
|
|
21
21
|
* and optional value-to-schema mappings. Used to ensure discriminator
|
|
22
22
|
* objects conform to OpenAPI specification requirements.
|
|
23
23
|
*/
|
|
24
|
-
export declare const oasDiscriminatorData: v.
|
|
25
|
-
readonly oasType: v.LiteralSchema<"discriminator", undefined>;
|
|
26
|
-
readonly propertyName: v.StringSchema<undefined>;
|
|
27
|
-
readonly mapping: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
28
|
-
}, undefined>;
|
|
24
|
+
export declare const oasDiscriminatorData: v.GenericSchema<OasDiscriminatorData>;
|
|
29
25
|
//# sourceMappingURL=discriminator-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discriminator-types.d.ts","sourceRoot":"","sources":["../../../src/oas/discriminator/discriminator-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,yDAAyD;IACzD,OAAO,EAAE,eAAe,CAAA;IACxB,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAA;IACpB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"discriminator-types.d.ts","sourceRoot":"","sources":["../../../src/oas/discriminator/discriminator-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,yDAAyD;IACzD,OAAO,EAAE,eAAe,CAAA;IACxB,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAA;IACpB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,aAAa,CAAC,oBAAoB,CAIrE,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type OasTagData } from '../tag/tag-types.js';
|
|
2
|
+
import { type OasOperationData } from '../operation/operation-types.js';
|
|
3
|
+
import * as v from 'valibot';
|
|
4
|
+
import { type OasComponentsData } from '../components/components-types.js';
|
|
5
|
+
import { type OasInfoData } from '../info/info-types.js';
|
|
6
|
+
export type OasDocumentData = {
|
|
7
|
+
oasType: 'openapi';
|
|
8
|
+
openapi: string;
|
|
9
|
+
info: OasInfoData;
|
|
10
|
+
jsonSchemaDialect?: string;
|
|
11
|
+
operations: OasOperationData[];
|
|
12
|
+
components?: OasComponentsData;
|
|
13
|
+
tags?: OasTagData[];
|
|
14
|
+
};
|
|
15
|
+
export declare const oasDocumentData: v.GenericSchema<OasDocumentData>;
|
|
16
|
+
//# sourceMappingURL=document-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-types.d.ts","sourceRoot":"","sources":["../../../src/oas/document/document-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAc,MAAM,qBAAqB,CAAA;AACjE,OAAO,EAAE,KAAK,gBAAgB,EAAoB,MAAM,iCAAiC,CAAA;AACzF,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,KAAK,iBAAiB,EAAqB,MAAM,mCAAmC,CAAA;AAC7F,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,uBAAuB,CAAA;AAErE,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,SAAS,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,WAAW,CAAA;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B,UAAU,EAAE,gBAAgB,EAAE,CAAA;IAE9B,UAAU,CAAC,EAAE,iBAAiB,CAAA;IAE9B,IAAI,CAAC,EAAE,UAAU,EAAE,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,aAAa,CAAC,eAAe,CAY3D,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.oasDocumentData = void 0;
|
|
37
|
+
const tag_types_js_1 = require("../tag/tag-types.js");
|
|
38
|
+
const operation_types_js_1 = require("../operation/operation-types.js");
|
|
39
|
+
const v = __importStar(require("valibot"));
|
|
40
|
+
const components_types_js_1 = require("../components/components-types.js");
|
|
41
|
+
const info_types_js_1 = require("../info/info-types.js");
|
|
42
|
+
exports.oasDocumentData = v.object({
|
|
43
|
+
oasType: v.literal('openapi'),
|
|
44
|
+
openapi: v.string(),
|
|
45
|
+
info: info_types_js_1.oasInfoData,
|
|
46
|
+
jsonSchemaDialect: v.optional(v.string()),
|
|
47
|
+
// servers: z.array(server).optional(),
|
|
48
|
+
operations: v.array(operation_types_js_1.oasOperationData),
|
|
49
|
+
// webhooks: z.record(z.union([pathItem, ref])).optional(),
|
|
50
|
+
components: v.optional(components_types_js_1.oasComponentsData),
|
|
51
|
+
// security: z.never(),
|
|
52
|
+
tags: v.optional(v.array(tag_types_js_1.oasTagData))
|
|
53
|
+
// externalDocs: externalDocs.optional()
|
|
54
|
+
});
|
|
@@ -5,10 +5,5 @@ export type OasExampleData = {
|
|
|
5
5
|
description?: string;
|
|
6
6
|
value?: unknown;
|
|
7
7
|
};
|
|
8
|
-
export declare const oasExampleData: v.
|
|
9
|
-
readonly oasType: v.LiteralSchema<"example", undefined>;
|
|
10
|
-
readonly summary: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
11
|
-
readonly description: v.OptionalSchema<v.GenericSchema<string>, undefined>;
|
|
12
|
-
readonly value: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
13
|
-
}, undefined>;
|
|
8
|
+
export declare const oasExampleData: v.GenericSchema<OasExampleData>;
|
|
14
9
|
//# sourceMappingURL=example-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example-types.d.ts","sourceRoot":"","sources":["../../../src/oas/example/example-types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,OAAO,CAAA;CAEhB,CAAA;AAED,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"example-types.d.ts","sourceRoot":"","sources":["../../../src/oas/example/example-types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,OAAO,CAAA;CAEhB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,aAAa,CAAC,cAAc,CAMzD,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type OasExampleData } from '../example/example-types.js';
|
|
2
|
+
import { type OasMediaTypeData } from '../mediaType/mediaType-types.js';
|
|
3
|
+
import { type OasExampleRefData, type OasSchemaRefData } from '../ref/ref-types.js';
|
|
4
|
+
import { type OasSchemaData } from '../schema/schema-types.js';
|
|
5
|
+
import * as v from 'valibot';
|
|
6
|
+
/**
|
|
7
|
+
* Data type for OpenAPI header objects in the SKMTC internal representation.
|
|
8
|
+
*
|
|
9
|
+
* Represents HTTP headers in OpenAPI specifications, including validation
|
|
10
|
+
* rules, examples, and serialization parameters. Headers are used in
|
|
11
|
+
* responses and can include complex schemas and multiple examples.
|
|
12
|
+
*/
|
|
13
|
+
export type OasHeaderData = {
|
|
14
|
+
/** Type identifier for OAS header objects */
|
|
15
|
+
oasType: 'header';
|
|
16
|
+
/** Human-readable description of the header */
|
|
17
|
+
description?: string;
|
|
18
|
+
/** Whether the header is required */
|
|
19
|
+
required?: boolean;
|
|
20
|
+
/** Whether the header is deprecated */
|
|
21
|
+
deprecated?: boolean;
|
|
22
|
+
/** Whether empty values are allowed for the header */
|
|
23
|
+
allowEmptyValue?: boolean;
|
|
24
|
+
/** Schema definition for the header value */
|
|
25
|
+
schema?: OasSchemaData | OasSchemaRefData;
|
|
26
|
+
/** Named examples for the header value */
|
|
27
|
+
examples?: Record<string, OasExampleData | OasExampleRefData>;
|
|
28
|
+
/** Media type definitions for complex header content */
|
|
29
|
+
content?: Record<string, OasMediaTypeData>;
|
|
30
|
+
/** Serialization style (always 'simple' for headers) */
|
|
31
|
+
style?: OasHeaderStyle;
|
|
32
|
+
/** Whether to explode parameter values */
|
|
33
|
+
explode?: boolean;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Valid serialization styles for OpenAPI headers.
|
|
37
|
+
*
|
|
38
|
+
* Headers can only use the 'simple' serialization style according to
|
|
39
|
+
* the OpenAPI specification.
|
|
40
|
+
*/
|
|
41
|
+
export type OasHeaderStyle = 'simple';
|
|
42
|
+
/**
|
|
43
|
+
* Valibot schema for validating OAS header data structures.
|
|
44
|
+
*
|
|
45
|
+
* Validates the structure and content of OpenAPI header objects,
|
|
46
|
+
* ensuring proper types for all fields including nested schemas,
|
|
47
|
+
* examples, and content definitions.
|
|
48
|
+
*/
|
|
49
|
+
export declare const oasHeaderData: v.GenericSchema<OasHeaderData>;
|
|
50
|
+
//# sourceMappingURL=header-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header-types.d.ts","sourceRoot":"","sources":["../../../src/oas/header/header-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,6BAA6B,CAAA;AAEjF,OAAO,EAAE,KAAK,gBAAgB,EAAoB,MAAM,iCAAiC,CAAA;AACzF,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAGtB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,2BAA2B,CAAA;AAC7E,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,6CAA6C;IAC7C,OAAO,EAAE,QAAQ,CAAA;IACjB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,uCAAuC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,sDAAsD;IACtD,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,aAAa,GAAG,gBAAgB,CAAA;IACzC,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,iBAAiB,CAAC,CAAA;IAC7D,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IAC1C,wDAAwD;IACxD,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAID;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAA;AAErC;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,aAAa,CAAC,aAAa,CAcvD,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.oasHeaderData = void 0;
|
|
37
|
+
const example_types_js_1 = require("../example/example-types.js");
|
|
38
|
+
const markdown_types_js_1 = require("../markdown/markdown-types.js");
|
|
39
|
+
const mediaType_types_js_1 = require("../mediaType/mediaType-types.js");
|
|
40
|
+
const ref_types_js_1 = require("../ref/ref-types.js");
|
|
41
|
+
const schema_types_js_1 = require("../schema/schema-types.js");
|
|
42
|
+
const v = __importStar(require("valibot"));
|
|
43
|
+
const oasHeaderStyle = v.literal('simple');
|
|
44
|
+
/**
|
|
45
|
+
* Valibot schema for validating OAS header data structures.
|
|
46
|
+
*
|
|
47
|
+
* Validates the structure and content of OpenAPI header objects,
|
|
48
|
+
* ensuring proper types for all fields including nested schemas,
|
|
49
|
+
* examples, and content definitions.
|
|
50
|
+
*/
|
|
51
|
+
exports.oasHeaderData = v.object({
|
|
52
|
+
oasType: v.literal('header'),
|
|
53
|
+
description: v.optional(markdown_types_js_1.markdown),
|
|
54
|
+
required: v.optional(v.boolean()),
|
|
55
|
+
deprecated: v.optional(v.boolean()),
|
|
56
|
+
allowEmptyValue: v.optional(v.boolean()),
|
|
57
|
+
// Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form.
|
|
58
|
+
style: v.optional(oasHeaderStyle),
|
|
59
|
+
explode: v.optional(v.boolean()),
|
|
60
|
+
// allowReserved: v.boolean().optional(),
|
|
61
|
+
schema: v.optional(v.union([schema_types_js_1.oasSchemaData, ref_types_js_1.oasSchemaRefData])),
|
|
62
|
+
// example: z.any().optional(),
|
|
63
|
+
examples: v.optional(v.record(v.string(), v.union([example_types_js_1.oasExampleData, ref_types_js_1.oasExampleRefData]))),
|
|
64
|
+
content: v.optional(v.record(v.string(), mediaType_types_js_1.oasMediaTypeData))
|
|
65
|
+
});
|
|
66
|
+
// export type OasHeaders = Record<string, OasHeader | OasHeaderRef>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type OasLicenseData } from '../license/license-types.js';
|
|
2
|
+
import { type OasContactData } from '../contact/contact-types.js';
|
|
3
|
+
import * as v from 'valibot';
|
|
4
|
+
export type OasInfoData = {
|
|
5
|
+
oasType: 'info';
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
termsOfService?: string;
|
|
9
|
+
contact?: OasContactData;
|
|
10
|
+
license?: OasLicenseData;
|
|
11
|
+
version: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const oasInfoData: v.GenericSchema<OasInfoData>;
|
|
14
|
+
//# sourceMappingURL=info-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info-types.d.ts","sourceRoot":"","sources":["../../../src/oas/info/info-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,6BAA6B,CAAA;AACjF,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,6BAA6B,CAAA;AAEjF,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,CAAC,CAAC,aAAa,CAAC,WAAW,CAQnD,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.oasInfoData = void 0;
|
|
37
|
+
const license_types_js_1 = require("../license/license-types.js");
|
|
38
|
+
const contact_types_js_1 = require("../contact/contact-types.js");
|
|
39
|
+
const markdown_types_js_1 = require("../markdown/markdown-types.js");
|
|
40
|
+
const v = __importStar(require("valibot"));
|
|
41
|
+
exports.oasInfoData = v.object({
|
|
42
|
+
oasType: v.literal('info'),
|
|
43
|
+
title: v.string(),
|
|
44
|
+
description: v.optional(markdown_types_js_1.markdown),
|
|
45
|
+
termsOfService: v.optional(v.string()),
|
|
46
|
+
contact: v.optional(contact_types_js_1.oasContactData),
|
|
47
|
+
license: v.optional(license_types_js_1.oasLicenseData),
|
|
48
|
+
version: v.string()
|
|
49
|
+
});
|
|
@@ -5,35 +5,21 @@ import * as v from 'valibot';
|
|
|
5
5
|
* Ensures values are numbers and specifically integers,
|
|
6
6
|
* used for integer validation throughout OAS processing.
|
|
7
7
|
*/
|
|
8
|
-
export declare const integerSchema: v.
|
|
8
|
+
export declare const integerSchema: v.GenericSchema<number>;
|
|
9
9
|
/**
|
|
10
10
|
* Valibot schema for valid integer format values.
|
|
11
11
|
*
|
|
12
12
|
* Defines the size formats for integer types: int32 for 32-bit signed
|
|
13
13
|
* integers and int64 for 64-bit signed integers.
|
|
14
14
|
*/
|
|
15
|
-
export declare const integerFormat: v.
|
|
15
|
+
export declare const integerFormat: v.GenericSchema<'int32' | 'int64'>;
|
|
16
16
|
/**
|
|
17
17
|
* Valibot schema for validating OpenAPI integer data objects.
|
|
18
18
|
*
|
|
19
19
|
* Validates integer schemas including size formats (int32/int64),
|
|
20
20
|
* range constraints, multiple validation, and enumeration values.
|
|
21
21
|
*/
|
|
22
|
-
export declare const oasIntegerData: v.
|
|
23
|
-
readonly type: v.LiteralSchema<"integer", undefined>;
|
|
24
|
-
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
25
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
26
|
-
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
27
|
-
readonly format: v.OptionalSchema<v.UnionSchema<[v.LiteralSchema<"int32", undefined>, v.LiteralSchema<"int64", undefined>], undefined>, undefined>;
|
|
28
|
-
readonly enum: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>, undefined>;
|
|
29
|
-
readonly nullable: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
30
|
-
readonly example: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
31
|
-
readonly multipleOf: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
32
|
-
readonly maximum: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
33
|
-
readonly exclusiveMaximum: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
34
|
-
readonly minimum: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
35
|
-
readonly exclusiveMinimum: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
36
|
-
}, undefined>;
|
|
22
|
+
export declare const oasIntegerData: v.GenericSchema<OasIntegerData>;
|
|
37
23
|
export type OasIntegerData = {
|
|
38
24
|
type: 'integer';
|
|
39
25
|
title?: string;
|