@skmtc/core 0.0.800 → 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 +14 -2
- package/esm/context/GenerateContext.d.ts.map +1 -1
- 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/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/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/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-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/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 +40 -2
- package/esm/typescript/List.d.ts.map +1 -1
- package/esm/typescript/List.js +32 -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 +14 -2
- package/script/context/GenerateContext.d.ts.map +1 -1
- 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/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/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/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-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/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 +40 -2
- package/script/typescript/List.d.ts.map +1 -1
- package/script/typescript/List.js +32 -0
package/esm/mod.js
CHANGED
|
@@ -69,11 +69,15 @@ export * from './app/validate.js';
|
|
|
69
69
|
export * from './context/CoreContext.js';
|
|
70
70
|
export * from './context/GenerateContext.js';
|
|
71
71
|
export * from './context/ParseContext.js';
|
|
72
|
+
export * from './context/RenderContext.js';
|
|
73
|
+
export * from './context/types.js';
|
|
72
74
|
export * from './dsl/constants.js';
|
|
73
75
|
export * from './dsl/ContentBase.js';
|
|
74
76
|
export * from './dsl/ContentSettings.js';
|
|
75
77
|
export * from './dsl/Definition.js';
|
|
76
78
|
export * from './dsl/EntityType.js';
|
|
79
|
+
export * from './dsl/File.js';
|
|
80
|
+
export * from './dsl/JsonFile.js';
|
|
77
81
|
export * from './dsl/GeneratedValueList.js';
|
|
78
82
|
export * from './dsl/Identifier.js';
|
|
79
83
|
export * from './dsl/Import.js';
|
|
@@ -99,25 +103,71 @@ export * from './helpers/refFns.js';
|
|
|
99
103
|
export * from './helpers/strings.js';
|
|
100
104
|
export * from './helpers/parseModuleName.js';
|
|
101
105
|
export * from './helpers/toResolvedArtifactPath.js';
|
|
106
|
+
export * from './context/StackTrail.js';
|
|
102
107
|
export * from './oas/array/Array.js';
|
|
108
|
+
export * from './oas/array/array-types.js';
|
|
109
|
+
export * from './oas/array/toArray.js';
|
|
103
110
|
export * from './oas/boolean/Boolean.js';
|
|
111
|
+
export * from './oas/boolean/boolean-types.js';
|
|
112
|
+
export * from './oas/boolean/toBoolean.js';
|
|
104
113
|
export * from './oas/components/Components.js';
|
|
114
|
+
export * from './oas/components/components-types.js';
|
|
115
|
+
export * from './oas/contact/Contact.js';
|
|
116
|
+
export * from './oas/contact/contact-types.js';
|
|
105
117
|
export * from './oas/discriminator/Discriminator.js';
|
|
118
|
+
export * from './oas/discriminator/discriminator-types.js';
|
|
106
119
|
export * from './oas/document/Document.js';
|
|
120
|
+
export * from './oas/document/document-types.js';
|
|
121
|
+
export * from './oas/example/Example.js';
|
|
122
|
+
export * from './oas/example/example-types.js';
|
|
123
|
+
export * from './oas/header/Header.js';
|
|
124
|
+
export * from './oas/header/header-types.js';
|
|
107
125
|
export * from './oas/info/Info.js';
|
|
126
|
+
export * from './oas/info/info-types.js';
|
|
127
|
+
export * from './oas/license/License.js';
|
|
128
|
+
export * from './oas/license/license-types.js';
|
|
129
|
+
export * from './oas/mediaType/MediaType.js';
|
|
130
|
+
export * from './oas/mediaType/mediaType-types.js';
|
|
108
131
|
export * from './oas/integer/Integer.js';
|
|
132
|
+
export * from './oas/integer/integer-types.js';
|
|
133
|
+
export * from './oas/integer/toInteger.js';
|
|
109
134
|
export * from './oas/number/Number.js';
|
|
135
|
+
export * from './oas/number/number-types.js';
|
|
136
|
+
export * from './oas/number/toNumber.js';
|
|
110
137
|
export * from './oas/object/Object.js';
|
|
138
|
+
export * from './oas/object/object-types.js';
|
|
139
|
+
export * from './oas/object/toObject.js';
|
|
111
140
|
export * from './oas/operation/Operation.js';
|
|
141
|
+
export * from './oas/operation/operation-types.js';
|
|
112
142
|
export * from './oas/parameter/Parameter.js';
|
|
143
|
+
export * from './oas/parameter/parameter-types.js';
|
|
144
|
+
export * from './oas/pathItem/PathItem.js';
|
|
145
|
+
export * from './oas/pathItem/pathItem-types.js';
|
|
113
146
|
export * from './oas/ref/Ref.js';
|
|
147
|
+
export * from './oas/ref/ref-types.js';
|
|
148
|
+
export * from './oas/ref/toRefV31.js';
|
|
114
149
|
export * from './oas/requestBody/RequestBody.js';
|
|
150
|
+
export * from './oas/requestBody/requestBody-types.js';
|
|
115
151
|
export * from './oas/response/Response.js';
|
|
152
|
+
export * from './oas/response/response-types.js';
|
|
116
153
|
export * from './oas/schema/Schema.js';
|
|
154
|
+
export * from './oas/schema/schema-types.js';
|
|
155
|
+
export * from './oas/schema/toSchemasV3.js';
|
|
156
|
+
export * from './oas/securityRequirement/SecurityRequirement.js';
|
|
157
|
+
export * from './oas/securitySchemes/SecurityScheme.js';
|
|
158
|
+
export * from './oas/server/Server.js';
|
|
159
|
+
export * from './oas/serverVariable/ServerVariable.js';
|
|
117
160
|
export * from './oas/string/String.js';
|
|
161
|
+
export * from './oas/string/string-types.js';
|
|
162
|
+
export * from './oas/string/toString.js';
|
|
118
163
|
export * from './oas/tag/Tag.js';
|
|
164
|
+
export * from './oas/tag/tag-types.js';
|
|
119
165
|
export * from './oas/union/Union.js';
|
|
166
|
+
export * from './oas/union/union-types.js';
|
|
167
|
+
export * from './oas/union/toUnion.js';
|
|
120
168
|
export * from './oas/unknown/Unknown.js';
|
|
169
|
+
export * from './oas/unknown/unknown-types.js';
|
|
170
|
+
export * from './oas/unknown/toUnknown.js';
|
|
121
171
|
export * from './oas/void/Void.js';
|
|
122
172
|
export * from './run/toArtifacts.js';
|
|
123
173
|
export * from './run/toV3JsonDocument.js';
|
|
@@ -135,6 +185,7 @@ export * from './types/ModuleExport.js';
|
|
|
135
185
|
export * from './types/PrettierConfig.js';
|
|
136
186
|
export * from './types/Preview.js';
|
|
137
187
|
export * from './types/RefName.js';
|
|
188
|
+
export * from './types/Results.js';
|
|
138
189
|
export * from './types/Settings.js';
|
|
139
190
|
export * from './types/TypeSystem.js';
|
|
140
191
|
export * from './typescript/FunctionParameter.js';
|
|
@@ -8,17 +8,8 @@ import { type OasSchemaRefData } from '../ref/ref-types.js';
|
|
|
8
8
|
* uniqueness requirements, and enumeration values. Uses lazy evaluation
|
|
9
9
|
* to handle recursive schema references.
|
|
10
10
|
*/
|
|
11
|
-
export declare const oasArrayData: v.
|
|
12
|
-
|
|
13
|
-
readonly items: v.LazySchema<v.UnionSchema<[v.LazySchema<v.GenericSchema<OasSchemaData>>, v.GenericSchema<OasSchemaRefData>], undefined>>;
|
|
14
|
-
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
15
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
16
|
-
readonly default: v.OptionalSchema<v.ArraySchema<v.UnknownSchema, undefined>, undefined>;
|
|
17
|
-
readonly maxItems: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
18
|
-
readonly minItems: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
19
|
-
readonly uniqueItems: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
20
|
-
readonly enums: v.OptionalSchema<v.ArraySchema<v.UnknownSchema, undefined>, undefined>;
|
|
21
|
-
}, undefined>;
|
|
11
|
+
export declare const oasArrayData: v.GenericSchema<OasArrayData>;
|
|
12
|
+
export declare const oasArrayDataWithoutItems: v.GenericSchema<OasArrayDataWithoutItems>;
|
|
22
13
|
/**
|
|
23
14
|
* Data type for OpenAPI array schema objects.
|
|
24
15
|
*
|
|
@@ -46,4 +37,22 @@ export type OasArrayData = {
|
|
|
46
37
|
/** Array of valid enumeration values */
|
|
47
38
|
enums?: unknown[];
|
|
48
39
|
};
|
|
40
|
+
export type OasArrayDataWithoutItems = {
|
|
41
|
+
/** Type identifier (always 'array') */
|
|
42
|
+
type: 'array';
|
|
43
|
+
/** Human-readable title for the array */
|
|
44
|
+
title?: string;
|
|
45
|
+
/** Detailed description of the array's purpose */
|
|
46
|
+
description?: string;
|
|
47
|
+
/** Default value for the array */
|
|
48
|
+
default?: unknown[];
|
|
49
|
+
/** Maximum number of items allowed */
|
|
50
|
+
maxItems?: number;
|
|
51
|
+
/** Minimum number of items required */
|
|
52
|
+
minItems?: number;
|
|
53
|
+
/** Whether all items must be unique */
|
|
54
|
+
uniqueItems?: boolean;
|
|
55
|
+
/** Array of valid enumeration values */
|
|
56
|
+
enums?: unknown[];
|
|
57
|
+
};
|
|
49
58
|
//# sourceMappingURL=array-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-types.d.ts","sourceRoot":"","sources":["../../../src/oas/array/array-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,2BAA2B,CAAA;AAC7E,OAAO,EAAE,KAAK,gBAAgB,EAAoB,MAAM,qBAAqB,CAAA;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"array-types.d.ts","sourceRoot":"","sources":["../../../src/oas/array/array-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,2BAA2B,CAAA;AAC7E,OAAO,EAAE,KAAK,gBAAgB,EAAoB,MAAM,qBAAqB,CAAA;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,CAAC,CAAC,aAAa,CAAC,YAAY,CAUrD,CAAA;AAEF,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,aAAa,CAAC,wBAAwB,CAS7E,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,uCAAuC;IACvC,IAAI,EAAE,OAAO,CAAA;IACb,wCAAwC;IACxC,KAAK,EAAE,aAAa,GAAG,gBAAgB,CAAA;IACvC,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kCAAkC;IAClC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAA;IACnB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,uCAAuC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,wCAAwC;IACxC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,uCAAuC;IACvC,IAAI,EAAE,OAAO,CAAA;IACb,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kCAAkC;IAClC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAA;IACnB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,uCAAuC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,wCAAwC;IACxC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAA;CAClB,CAAA"}
|
|
@@ -19,3 +19,13 @@ export const oasArrayData = v.object({
|
|
|
19
19
|
uniqueItems: v.optional(v.boolean()),
|
|
20
20
|
enums: v.optional(v.array(v.unknown()))
|
|
21
21
|
});
|
|
22
|
+
export const oasArrayDataWithoutItems = v.object({
|
|
23
|
+
type: v.literal('array'),
|
|
24
|
+
title: v.optional(v.string()),
|
|
25
|
+
description: v.optional(v.string()),
|
|
26
|
+
default: v.optional(v.array(v.unknown())),
|
|
27
|
+
maxItems: v.optional(v.number()),
|
|
28
|
+
minItems: v.optional(v.number()),
|
|
29
|
+
uniqueItems: v.optional(v.boolean()),
|
|
30
|
+
enums: v.optional(v.array(v.unknown()))
|
|
31
|
+
});
|
|
@@ -5,6 +5,65 @@ type ToArrayArgs = {
|
|
|
5
5
|
value: OpenAPIV3.ArraySchemaObject;
|
|
6
6
|
context: ParseContext;
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Transforms an OpenAPI v3 array schema object into an internal OAS array representation.
|
|
10
|
+
*
|
|
11
|
+
* This function processes OpenAPI array schemas by extracting and parsing nullable values,
|
|
12
|
+
* examples, enumerations, and default values. It handles the complete transformation from
|
|
13
|
+
* raw OpenAPI JSON to the SKMTC internal array representation with proper type safety.
|
|
14
|
+
*
|
|
15
|
+
* The transformation follows a pipeline approach:
|
|
16
|
+
* 1. Parse nullable flag and extract base value
|
|
17
|
+
* 2. Parse example values with nullable support
|
|
18
|
+
* 3. Parse enumeration constraints
|
|
19
|
+
* 4. Parse default values
|
|
20
|
+
* 5. Create final OasArray instance
|
|
21
|
+
*
|
|
22
|
+
* @param args - Transformation arguments
|
|
23
|
+
* @param args.value - The OpenAPI v3 array schema object to transform
|
|
24
|
+
* @param args.context - Parse context providing utilities and tracing
|
|
25
|
+
* @returns Transformed OAS array object with parsed properties
|
|
26
|
+
*
|
|
27
|
+
* @example Basic array transformation
|
|
28
|
+
* ```typescript
|
|
29
|
+
* import { toArray } from '@skmtc/core';
|
|
30
|
+
*
|
|
31
|
+
* const openApiArray = {
|
|
32
|
+
* type: 'array',
|
|
33
|
+
* items: { type: 'string' },
|
|
34
|
+
* maxItems: 10,
|
|
35
|
+
* uniqueItems: true
|
|
36
|
+
* };
|
|
37
|
+
*
|
|
38
|
+
* const oasArray = toArray({
|
|
39
|
+
* value: openApiArray,
|
|
40
|
+
* context: parseContext
|
|
41
|
+
* });
|
|
42
|
+
*
|
|
43
|
+
* console.log(oasArray.maxItems); // 10
|
|
44
|
+
* console.log(oasArray.uniqueItems); // true
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @example Array with nullable and examples
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const complexArray = {
|
|
50
|
+
* type: 'array',
|
|
51
|
+
* items: { type: 'number' },
|
|
52
|
+
* nullable: true,
|
|
53
|
+
* example: [1, 2, 3],
|
|
54
|
+
* default: [],
|
|
55
|
+
* enum: [[1, 2], [3, 4], null]
|
|
56
|
+
* };
|
|
57
|
+
*
|
|
58
|
+
* const oasArray = toArray({
|
|
59
|
+
* value: complexArray,
|
|
60
|
+
* context: parseContext
|
|
61
|
+
* });
|
|
62
|
+
*
|
|
63
|
+
* console.log(oasArray.nullable); // true
|
|
64
|
+
* console.log(oasArray.example); // [1, 2, 3]
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
8
67
|
export declare const toArray: ({ value, context }: ToArrayArgs) => OasArray;
|
|
9
68
|
type ToParsedArrayArgs<Nullable extends boolean | undefined> = {
|
|
10
69
|
value: Omit<OpenAPIV3.ArraySchemaObject, 'nullable' | 'example' | 'enums' | 'default'>;
|
|
@@ -14,6 +73,58 @@ type ToParsedArrayArgs<Nullable extends boolean | undefined> = {
|
|
|
14
73
|
enums: Nullable extends true ? (unknown[] | null)[] | undefined : unknown[] | undefined;
|
|
15
74
|
defaultValue: Nullable extends true ? unknown[] | null | undefined : unknown[] | undefined;
|
|
16
75
|
};
|
|
76
|
+
/**
|
|
77
|
+
* Creates an OAS array instance from pre-parsed array schema components.
|
|
78
|
+
*
|
|
79
|
+
* This function is the final step in the array transformation pipeline, taking
|
|
80
|
+
* already-parsed nullable, example, enum, and default values and combining them
|
|
81
|
+
* with the remaining array properties to create the complete OasArray instance.
|
|
82
|
+
*
|
|
83
|
+
* The function handles type-safe nullable parsing, items schema resolution,
|
|
84
|
+
* and specification extension processing. It uses Valibot for schema validation
|
|
85
|
+
* and maintains proper type relationships between nullable flags and value types.
|
|
86
|
+
*
|
|
87
|
+
* @template Nullable - Boolean type indicating if the array can be null
|
|
88
|
+
* @param args - Pre-parsed array components
|
|
89
|
+
* @param args.value - OpenAPI array object without parsed fields
|
|
90
|
+
* @param args.context - Parse context for tracing and utilities
|
|
91
|
+
* @param args.nullable - Parsed nullable flag
|
|
92
|
+
* @param args.example - Parsed example value (type-safe with nullable)
|
|
93
|
+
* @param args.enums - Parsed enumeration constraints (type-safe with nullable)
|
|
94
|
+
* @param args.defaultValue - Parsed default value (type-safe with nullable)
|
|
95
|
+
* @returns Complete OAS array instance with all properties
|
|
96
|
+
*
|
|
97
|
+
* @example Type-safe nullable array
|
|
98
|
+
* ```typescript
|
|
99
|
+
* const nullableArray = toParsedArray({
|
|
100
|
+
* context: parseContext,
|
|
101
|
+
* nullable: true,
|
|
102
|
+
* example: [1, 2, 3], // Can be null due to nullable: true
|
|
103
|
+
* enums: [[1], [2], null], // Null allowed in enums
|
|
104
|
+
* defaultValue: null,
|
|
105
|
+
* value: {
|
|
106
|
+
* type: 'array',
|
|
107
|
+
* items: { type: 'number' },
|
|
108
|
+
* maxItems: 5
|
|
109
|
+
* }
|
|
110
|
+
* });
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* @example Non-nullable array
|
|
114
|
+
* ```typescript
|
|
115
|
+
* const regularArray = toParsedArray({
|
|
116
|
+
* context: parseContext,
|
|
117
|
+
* nullable: false,
|
|
118
|
+
* example: ['a', 'b'], // Cannot be null
|
|
119
|
+
* enums: [['x'], ['y']], // No null values allowed
|
|
120
|
+
* defaultValue: [],
|
|
121
|
+
* value: {
|
|
122
|
+
* type: 'array',
|
|
123
|
+
* items: { type: 'string' }
|
|
124
|
+
* }
|
|
125
|
+
* });
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
17
128
|
export declare const toParsedArray: <Nullable extends boolean | undefined>({ context, nullable, example, enums, defaultValue, value }: ToParsedArrayArgs<Nullable>) => OasArray<Nullable>;
|
|
18
129
|
export {};
|
|
19
130
|
//# sourceMappingURL=toArray.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toArray.d.ts","sourceRoot":"","sources":["../../../src/oas/array/toArray.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAQjE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAA;IAClC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,OAAO,GAAI,oBAAoB,WAAW,KAAG,QAmCzD,CAAA;AAED,KAAK,iBAAiB,CAAC,QAAQ,SAAS,OAAO,GAAG,SAAS,IAAI;IAC7D,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC,CAAA;IACtF,OAAO,EAAE,YAAY,CAAA;IACrB,QAAQ,EAAE,QAAQ,CAAA;IAClB,OAAO,EAAE,QAAQ,SAAS,IAAI,GAAG,OAAO,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,EAAE,GAAG,SAAS,CAAA;IACrF,KAAK,EAAE,QAAQ,SAAS,IAAI,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,SAAS,GAAG,OAAO,EAAE,GAAG,SAAS,CAAA;IACvF,YAAY,EAAE,QAAQ,SAAS,IAAI,GAAG,OAAO,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,EAAE,GAAG,SAAS,CAAA;CAC3F,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,QAAQ,SAAS,OAAO,GAAG,SAAS,EAAE,4DAOjE,iBAAiB,CAAC,QAAQ,CAAC,KAAG,QAAQ,CAAC,QAAQ,CAyCjD,CAAA"}
|
|
1
|
+
{"version":3,"file":"toArray.d.ts","sourceRoot":"","sources":["../../../src/oas/array/toArray.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAQjE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAA;IAClC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,eAAO,MAAM,OAAO,GAAI,oBAAoB,WAAW,KAAG,QAmCzD,CAAA;AAED,KAAK,iBAAiB,CAAC,QAAQ,SAAS,OAAO,GAAG,SAAS,IAAI;IAC7D,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC,CAAA;IACtF,OAAO,EAAE,YAAY,CAAA;IACrB,QAAQ,EAAE,QAAQ,CAAA;IAClB,OAAO,EAAE,QAAQ,SAAS,IAAI,GAAG,OAAO,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,EAAE,GAAG,SAAS,CAAA;IACrF,KAAK,EAAE,QAAQ,SAAS,IAAI,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,SAAS,GAAG,OAAO,EAAE,GAAG,SAAS,CAAA;IACvF,YAAY,EAAE,QAAQ,SAAS,IAAI,GAAG,OAAO,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,EAAE,GAAG,SAAS,CAAA;CAC3F,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,SAAS,OAAO,GAAG,SAAS,EAAE,4DAOjE,iBAAiB,CAAC,QAAQ,CAAC,KAAG,QAAQ,CAAC,QAAQ,CAyCjD,CAAA"}
|
package/esm/oas/array/toArray.js
CHANGED
|
@@ -5,8 +5,67 @@ import { parseNullable } from '../_helpers/parseNullable.js';
|
|
|
5
5
|
import { parseExample } from '../_helpers/parseExample.js';
|
|
6
6
|
import { parseEnum } from '../_helpers/parseEnum.js';
|
|
7
7
|
import * as v from 'valibot';
|
|
8
|
-
import {
|
|
8
|
+
import { oasArrayDataWithoutItems } from './array-types.js';
|
|
9
9
|
import { parseDefault } from '../_helpers/parseDefault.js';
|
|
10
|
+
/**
|
|
11
|
+
* Transforms an OpenAPI v3 array schema object into an internal OAS array representation.
|
|
12
|
+
*
|
|
13
|
+
* This function processes OpenAPI array schemas by extracting and parsing nullable values,
|
|
14
|
+
* examples, enumerations, and default values. It handles the complete transformation from
|
|
15
|
+
* raw OpenAPI JSON to the SKMTC internal array representation with proper type safety.
|
|
16
|
+
*
|
|
17
|
+
* The transformation follows a pipeline approach:
|
|
18
|
+
* 1. Parse nullable flag and extract base value
|
|
19
|
+
* 2. Parse example values with nullable support
|
|
20
|
+
* 3. Parse enumeration constraints
|
|
21
|
+
* 4. Parse default values
|
|
22
|
+
* 5. Create final OasArray instance
|
|
23
|
+
*
|
|
24
|
+
* @param args - Transformation arguments
|
|
25
|
+
* @param args.value - The OpenAPI v3 array schema object to transform
|
|
26
|
+
* @param args.context - Parse context providing utilities and tracing
|
|
27
|
+
* @returns Transformed OAS array object with parsed properties
|
|
28
|
+
*
|
|
29
|
+
* @example Basic array transformation
|
|
30
|
+
* ```typescript
|
|
31
|
+
* import { toArray } from '@skmtc/core';
|
|
32
|
+
*
|
|
33
|
+
* const openApiArray = {
|
|
34
|
+
* type: 'array',
|
|
35
|
+
* items: { type: 'string' },
|
|
36
|
+
* maxItems: 10,
|
|
37
|
+
* uniqueItems: true
|
|
38
|
+
* };
|
|
39
|
+
*
|
|
40
|
+
* const oasArray = toArray({
|
|
41
|
+
* value: openApiArray,
|
|
42
|
+
* context: parseContext
|
|
43
|
+
* });
|
|
44
|
+
*
|
|
45
|
+
* console.log(oasArray.maxItems); // 10
|
|
46
|
+
* console.log(oasArray.uniqueItems); // true
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Array with nullable and examples
|
|
50
|
+
* ```typescript
|
|
51
|
+
* const complexArray = {
|
|
52
|
+
* type: 'array',
|
|
53
|
+
* items: { type: 'number' },
|
|
54
|
+
* nullable: true,
|
|
55
|
+
* example: [1, 2, 3],
|
|
56
|
+
* default: [],
|
|
57
|
+
* enum: [[1, 2], [3, 4], null]
|
|
58
|
+
* };
|
|
59
|
+
*
|
|
60
|
+
* const oasArray = toArray({
|
|
61
|
+
* value: complexArray,
|
|
62
|
+
* context: parseContext
|
|
63
|
+
* });
|
|
64
|
+
*
|
|
65
|
+
* console.log(oasArray.nullable); // true
|
|
66
|
+
* console.log(oasArray.example); // [1, 2, 3]
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
10
69
|
export const toArray = ({ value, context }) => {
|
|
11
70
|
const { nullable, value: valueWithoutNullable } = parseNullable({
|
|
12
71
|
value,
|
|
@@ -39,11 +98,64 @@ export const toArray = ({ value, context }) => {
|
|
|
39
98
|
value: valueWithoutDefault
|
|
40
99
|
});
|
|
41
100
|
};
|
|
101
|
+
/**
|
|
102
|
+
* Creates an OAS array instance from pre-parsed array schema components.
|
|
103
|
+
*
|
|
104
|
+
* This function is the final step in the array transformation pipeline, taking
|
|
105
|
+
* already-parsed nullable, example, enum, and default values and combining them
|
|
106
|
+
* with the remaining array properties to create the complete OasArray instance.
|
|
107
|
+
*
|
|
108
|
+
* The function handles type-safe nullable parsing, items schema resolution,
|
|
109
|
+
* and specification extension processing. It uses Valibot for schema validation
|
|
110
|
+
* and maintains proper type relationships between nullable flags and value types.
|
|
111
|
+
*
|
|
112
|
+
* @template Nullable - Boolean type indicating if the array can be null
|
|
113
|
+
* @param args - Pre-parsed array components
|
|
114
|
+
* @param args.value - OpenAPI array object without parsed fields
|
|
115
|
+
* @param args.context - Parse context for tracing and utilities
|
|
116
|
+
* @param args.nullable - Parsed nullable flag
|
|
117
|
+
* @param args.example - Parsed example value (type-safe with nullable)
|
|
118
|
+
* @param args.enums - Parsed enumeration constraints (type-safe with nullable)
|
|
119
|
+
* @param args.defaultValue - Parsed default value (type-safe with nullable)
|
|
120
|
+
* @returns Complete OAS array instance with all properties
|
|
121
|
+
*
|
|
122
|
+
* @example Type-safe nullable array
|
|
123
|
+
* ```typescript
|
|
124
|
+
* const nullableArray = toParsedArray({
|
|
125
|
+
* context: parseContext,
|
|
126
|
+
* nullable: true,
|
|
127
|
+
* example: [1, 2, 3], // Can be null due to nullable: true
|
|
128
|
+
* enums: [[1], [2], null], // Null allowed in enums
|
|
129
|
+
* defaultValue: null,
|
|
130
|
+
* value: {
|
|
131
|
+
* type: 'array',
|
|
132
|
+
* items: { type: 'number' },
|
|
133
|
+
* maxItems: 5
|
|
134
|
+
* }
|
|
135
|
+
* });
|
|
136
|
+
* ```
|
|
137
|
+
*
|
|
138
|
+
* @example Non-nullable array
|
|
139
|
+
* ```typescript
|
|
140
|
+
* const regularArray = toParsedArray({
|
|
141
|
+
* context: parseContext,
|
|
142
|
+
* nullable: false,
|
|
143
|
+
* example: ['a', 'b'], // Cannot be null
|
|
144
|
+
* enums: [['x'], ['y']], // No null values allowed
|
|
145
|
+
* defaultValue: [],
|
|
146
|
+
* value: {
|
|
147
|
+
* type: 'array',
|
|
148
|
+
* items: { type: 'string' }
|
|
149
|
+
* }
|
|
150
|
+
* });
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
42
153
|
export const toParsedArray = ({ context, nullable, example, enums, defaultValue, value }) => {
|
|
43
154
|
// We only want parse non-items fields here since items is handled below
|
|
44
155
|
const { items, ...rest } = value;
|
|
45
|
-
|
|
46
|
-
const
|
|
156
|
+
// Parse the object without items field
|
|
157
|
+
const parsed = v.parse(oasArrayDataWithoutItems, rest);
|
|
158
|
+
const { type: _type, title, description, uniqueItems, maxItems, minItems, ...skipped } = parsed;
|
|
47
159
|
const extensionFields = toSpecificationExtensionsV3({
|
|
48
160
|
skipped,
|
|
49
161
|
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,21 @@
|
|
|
1
|
+
import { oasExampleData } from '../example/example-types.js';
|
|
2
|
+
import { oasHeaderData } from '../header/header-types.js';
|
|
3
|
+
import { oasParameterData } from '../parameter/parameter-types.js';
|
|
4
|
+
import { oasExampleRefData, oasHeaderRefData, oasParameterRefData, oasRequestBodyRefData, oasResponseRefData, oasSchemaRefData } from '../ref/ref-types.js';
|
|
5
|
+
import { oasRequestBodyData } from '../requestBody/requestBody-types.js';
|
|
6
|
+
import { oasResponseData } from '../response/response-types.js';
|
|
7
|
+
import { oasSchemaData } from '../schema/schema-types.js';
|
|
8
|
+
import * as v from 'valibot';
|
|
9
|
+
export const oasComponentsData = v.object({
|
|
10
|
+
oasType: v.literal('components'),
|
|
11
|
+
schemas: v.optional(v.record(v.string(), v.union([oasSchemaData, oasSchemaRefData]))),
|
|
12
|
+
responses: v.optional(v.record(v.string(), v.union([oasResponseData, oasResponseRefData]))),
|
|
13
|
+
parameters: v.optional(v.record(v.string(), v.union([oasParameterData, oasParameterRefData]))),
|
|
14
|
+
examples: v.optional(v.record(v.string(), v.union([oasExampleData, oasExampleRefData]))),
|
|
15
|
+
requestBodies: v.optional(v.record(v.string(), v.union([oasRequestBodyData, oasRequestBodyRefData]))),
|
|
16
|
+
headers: v.optional(v.record(v.string(), v.union([oasHeaderData, oasHeaderRefData])))
|
|
17
|
+
// securitySchemes: z.record(z.union([securityScheme, ref])),
|
|
18
|
+
// links: z.record(z.union([link, ref])),
|
|
19
|
+
// callbacks: z.never(),
|
|
20
|
+
// pathItems: z.record(z.union([oasPathItemData, oasPathItemRefData])).optional()
|
|
21
|
+
});
|
|
@@ -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"}
|
|
@@ -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,18 @@
|
|
|
1
|
+
import { oasTagData } from '../tag/tag-types.js';
|
|
2
|
+
import { oasOperationData } from '../operation/operation-types.js';
|
|
3
|
+
import * as v from 'valibot';
|
|
4
|
+
import { oasComponentsData } from '../components/components-types.js';
|
|
5
|
+
import { oasInfoData } from '../info/info-types.js';
|
|
6
|
+
export const oasDocumentData = v.object({
|
|
7
|
+
oasType: v.literal('openapi'),
|
|
8
|
+
openapi: v.string(),
|
|
9
|
+
info: oasInfoData,
|
|
10
|
+
jsonSchemaDialect: v.optional(v.string()),
|
|
11
|
+
// servers: z.array(server).optional(),
|
|
12
|
+
operations: v.array(oasOperationData),
|
|
13
|
+
// webhooks: z.record(z.union([pathItem, ref])).optional(),
|
|
14
|
+
components: v.optional(oasComponentsData),
|
|
15
|
+
// security: z.never(),
|
|
16
|
+
tags: v.optional(v.array(oasTagData))
|
|
17
|
+
// externalDocs: externalDocs.optional()
|
|
18
|
+
});
|
|
@@ -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"}
|