@kubb/plugin-oas 4.5.1 → 4.5.3
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/dist/{SchemaGenerator-BwYbrh7a.js → SchemaGenerator-BAE9VJgN.js} +6 -6
- package/dist/SchemaGenerator-BAE9VJgN.js.map +1 -0
- package/dist/{SchemaGenerator-C81yEgKY.cjs → SchemaGenerator-JB63cfsY.cjs} +7 -7
- package/dist/SchemaGenerator-JB63cfsY.cjs.map +1 -0
- package/dist/SchemaMapper-BUV8vhg0.cjs.map +1 -1
- package/dist/{createGenerator-BvCDyuKS.d.ts → SchemaMapper-BtvCVaPJ.d.ts} +327 -345
- package/dist/SchemaMapper-D30tqRoX.js.map +1 -1
- package/dist/{createGenerator-CPNglV1d.d.cts → SchemaMapper-DhH_z_t3.d.cts} +327 -345
- package/dist/createGenerator-CZv5P-nq.d.ts +319 -0
- package/dist/createGenerator-Dd3Q2BgZ.d.cts +319 -0
- package/dist/{generators-udGOxdUV.cjs → generators-DTxTiYOL.cjs} +1 -1
- package/dist/{generators-udGOxdUV.cjs.map → generators-DTxTiYOL.cjs.map} +1 -1
- package/dist/{generators-CJDEf8Kn.js → generators-v153n8vw.js} +1 -1
- package/dist/{generators-CJDEf8Kn.js.map → generators-v153n8vw.js.map} +1 -1
- package/dist/generators.cjs +1 -1
- package/dist/generators.d.cts +2 -2
- package/dist/generators.d.ts +2 -2
- package/dist/generators.js +1 -1
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +3 -3
- package/dist/hooks.d.ts +3 -3
- package/dist/hooks.js +1 -1
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +34 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -3
- package/dist/index.d.ts +17 -3
- package/dist/index.js +33 -27
- package/dist/index.js.map +1 -1
- package/dist/mocks.d.cts +1 -1
- package/dist/mocks.d.ts +1 -1
- package/dist/utils.cjs +2 -4
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +5 -14
- package/dist/utils.d.ts +5 -14
- package/dist/utils.js +2 -3
- package/dist/utils.js.map +1 -1
- package/package.json +5 -5
- package/src/SchemaGenerator.ts +1 -1
- package/src/SchemaMapper.ts +1 -1
- package/src/hooks/useOperationManager.ts +4 -2
- package/src/index.ts +20 -0
- package/src/plugin.ts +19 -19
- package/src/types.ts +13 -7
- package/src/utils/index.ts +0 -1
- package/src/utils.tsx +3 -3
- package/dist/SchemaGenerator-BwYbrh7a.js.map +0 -1
- package/dist/SchemaGenerator-C81yEgKY.cjs.map +0 -1
- package/dist/SchemaMapper-CgGWx6jF.d.cts +0 -297
- package/dist/SchemaMapper-Cj3vjPGs.d.ts +0 -297
- package/dist/parseFromConfig-BkUoWC2U.js +0 -22
- package/dist/parseFromConfig-BkUoWC2U.js.map +0 -1
- package/dist/parseFromConfig-EjsCZ0-8.cjs +0 -32
- package/dist/parseFromConfig-EjsCZ0-8.cjs.map +0 -1
- package/src/utils/parseFromConfig.ts +0 -39
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
import { KubbFile } from "@kubb/fabric-core/types";
|
|
2
|
-
import * as OasTypes from "oas/types";
|
|
3
|
-
import { HttpMethods as HttpMethod } from "oas/types";
|
|
4
|
-
import { Operation as Operation$1 } from "oas/operation";
|
|
5
|
-
import { OpenAPIV3 as OpenAPIV3$1, OpenAPIV3_1 } from "openapi-types";
|
|
6
|
-
|
|
7
|
-
//#region ../oas/src/types.d.ts
|
|
8
|
-
type contentType = 'application/json' | (string & {});
|
|
9
|
-
type SchemaObject$1 = OasTypes.SchemaObject & {
|
|
10
|
-
'x-nullable'?: boolean;
|
|
11
|
-
$ref?: string;
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/SchemaMapper.d.ts
|
|
15
|
-
type SchemaKeywordMapper = {
|
|
16
|
-
object: {
|
|
17
|
-
keyword: 'object';
|
|
18
|
-
args: {
|
|
19
|
-
properties: {
|
|
20
|
-
[x: string]: Schema[];
|
|
21
|
-
};
|
|
22
|
-
additionalProperties: Schema[];
|
|
23
|
-
strict?: boolean;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
url: {
|
|
27
|
-
keyword: 'url';
|
|
28
|
-
};
|
|
29
|
-
readOnly: {
|
|
30
|
-
keyword: 'readOnly';
|
|
31
|
-
};
|
|
32
|
-
writeOnly: {
|
|
33
|
-
keyword: 'writeOnly';
|
|
34
|
-
};
|
|
35
|
-
uuid: {
|
|
36
|
-
keyword: 'uuid';
|
|
37
|
-
};
|
|
38
|
-
email: {
|
|
39
|
-
keyword: 'email';
|
|
40
|
-
};
|
|
41
|
-
firstName: {
|
|
42
|
-
keyword: 'firstName';
|
|
43
|
-
};
|
|
44
|
-
lastName: {
|
|
45
|
-
keyword: 'lastName';
|
|
46
|
-
};
|
|
47
|
-
phone: {
|
|
48
|
-
keyword: 'phone';
|
|
49
|
-
};
|
|
50
|
-
password: {
|
|
51
|
-
keyword: 'password';
|
|
52
|
-
};
|
|
53
|
-
date: {
|
|
54
|
-
keyword: 'date';
|
|
55
|
-
args: {
|
|
56
|
-
type?: 'date' | 'string';
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
time: {
|
|
60
|
-
keyword: 'time';
|
|
61
|
-
args: {
|
|
62
|
-
type?: 'date' | 'string';
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
datetime: {
|
|
66
|
-
keyword: 'datetime';
|
|
67
|
-
args: {
|
|
68
|
-
offset?: boolean;
|
|
69
|
-
local?: boolean;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
tuple: {
|
|
73
|
-
keyword: 'tuple';
|
|
74
|
-
args: {
|
|
75
|
-
items: Schema[];
|
|
76
|
-
min?: number;
|
|
77
|
-
max?: number;
|
|
78
|
-
rest?: Schema;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
array: {
|
|
82
|
-
keyword: 'array';
|
|
83
|
-
args: {
|
|
84
|
-
items: Schema[];
|
|
85
|
-
min?: number;
|
|
86
|
-
max?: number;
|
|
87
|
-
unique?: boolean;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
enum: {
|
|
91
|
-
keyword: 'enum';
|
|
92
|
-
args: {
|
|
93
|
-
name: string;
|
|
94
|
-
typeName: string;
|
|
95
|
-
asConst: boolean;
|
|
96
|
-
items: Array<{
|
|
97
|
-
name: string | number;
|
|
98
|
-
format: 'string' | 'number' | 'boolean';
|
|
99
|
-
value?: string | number | boolean;
|
|
100
|
-
}>;
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
and: {
|
|
104
|
-
keyword: 'and';
|
|
105
|
-
args: Schema[];
|
|
106
|
-
};
|
|
107
|
-
const: {
|
|
108
|
-
keyword: 'const';
|
|
109
|
-
args: {
|
|
110
|
-
name: string | number;
|
|
111
|
-
format: 'string' | 'number' | 'boolean';
|
|
112
|
-
value?: string | number | boolean;
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
union: {
|
|
116
|
-
keyword: 'union';
|
|
117
|
-
args: Schema[];
|
|
118
|
-
};
|
|
119
|
-
ref: {
|
|
120
|
-
keyword: 'ref';
|
|
121
|
-
args: {
|
|
122
|
-
name: string;
|
|
123
|
-
$ref: string;
|
|
124
|
-
/**
|
|
125
|
-
* Full qualified path.
|
|
126
|
-
*/
|
|
127
|
-
path: KubbFile.OptionalPath;
|
|
128
|
-
/**
|
|
129
|
-
* When true `File.Import` will be used.
|
|
130
|
-
* When false a reference will be used inside the current file.
|
|
131
|
-
*/
|
|
132
|
-
isImportable: boolean;
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
matches: {
|
|
136
|
-
keyword: 'matches';
|
|
137
|
-
args?: string;
|
|
138
|
-
};
|
|
139
|
-
boolean: {
|
|
140
|
-
keyword: 'boolean';
|
|
141
|
-
};
|
|
142
|
-
default: {
|
|
143
|
-
keyword: 'default';
|
|
144
|
-
args: string | number | boolean;
|
|
145
|
-
};
|
|
146
|
-
string: {
|
|
147
|
-
keyword: 'string';
|
|
148
|
-
};
|
|
149
|
-
integer: {
|
|
150
|
-
keyword: 'integer';
|
|
151
|
-
};
|
|
152
|
-
number: {
|
|
153
|
-
keyword: 'number';
|
|
154
|
-
};
|
|
155
|
-
max: {
|
|
156
|
-
keyword: 'max';
|
|
157
|
-
args: number;
|
|
158
|
-
};
|
|
159
|
-
min: {
|
|
160
|
-
keyword: 'min';
|
|
161
|
-
args: number;
|
|
162
|
-
};
|
|
163
|
-
exclusiveMaximum: {
|
|
164
|
-
keyword: 'exclusiveMaximum';
|
|
165
|
-
args: number;
|
|
166
|
-
};
|
|
167
|
-
exclusiveMinimum: {
|
|
168
|
-
keyword: 'exclusiveMinimum';
|
|
169
|
-
args: number;
|
|
170
|
-
};
|
|
171
|
-
describe: {
|
|
172
|
-
keyword: 'describe';
|
|
173
|
-
args: string;
|
|
174
|
-
};
|
|
175
|
-
example: {
|
|
176
|
-
keyword: 'example';
|
|
177
|
-
args: string;
|
|
178
|
-
};
|
|
179
|
-
deprecated: {
|
|
180
|
-
keyword: 'deprecated';
|
|
181
|
-
};
|
|
182
|
-
optional: {
|
|
183
|
-
keyword: 'optional';
|
|
184
|
-
};
|
|
185
|
-
undefined: {
|
|
186
|
-
keyword: 'undefined';
|
|
187
|
-
};
|
|
188
|
-
nullish: {
|
|
189
|
-
keyword: 'nullish';
|
|
190
|
-
};
|
|
191
|
-
nullable: {
|
|
192
|
-
keyword: 'nullable';
|
|
193
|
-
};
|
|
194
|
-
null: {
|
|
195
|
-
keyword: 'null';
|
|
196
|
-
};
|
|
197
|
-
any: {
|
|
198
|
-
keyword: 'any';
|
|
199
|
-
};
|
|
200
|
-
unknown: {
|
|
201
|
-
keyword: 'unknown';
|
|
202
|
-
};
|
|
203
|
-
void: {
|
|
204
|
-
keyword: 'void';
|
|
205
|
-
};
|
|
206
|
-
blob: {
|
|
207
|
-
keyword: 'blob';
|
|
208
|
-
};
|
|
209
|
-
schema: {
|
|
210
|
-
keyword: 'schema';
|
|
211
|
-
args: {
|
|
212
|
-
type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
|
|
213
|
-
format?: string;
|
|
214
|
-
};
|
|
215
|
-
};
|
|
216
|
-
name: {
|
|
217
|
-
keyword: 'name';
|
|
218
|
-
args: string;
|
|
219
|
-
};
|
|
220
|
-
catchall: {
|
|
221
|
-
keyword: 'catchall';
|
|
222
|
-
};
|
|
223
|
-
interface: {
|
|
224
|
-
keyword: 'interface';
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
|
-
declare const schemaKeywords: {
|
|
228
|
-
any: "any";
|
|
229
|
-
unknown: "unknown";
|
|
230
|
-
number: "number";
|
|
231
|
-
integer: "integer";
|
|
232
|
-
string: "string";
|
|
233
|
-
boolean: "boolean";
|
|
234
|
-
undefined: "undefined";
|
|
235
|
-
nullable: "nullable";
|
|
236
|
-
null: "null";
|
|
237
|
-
nullish: "nullish";
|
|
238
|
-
array: "array";
|
|
239
|
-
tuple: "tuple";
|
|
240
|
-
enum: "enum";
|
|
241
|
-
union: "union";
|
|
242
|
-
datetime: "datetime";
|
|
243
|
-
date: "date";
|
|
244
|
-
email: "email";
|
|
245
|
-
uuid: "uuid";
|
|
246
|
-
url: "url";
|
|
247
|
-
void: "void";
|
|
248
|
-
default: "default";
|
|
249
|
-
const: "const";
|
|
250
|
-
and: "and";
|
|
251
|
-
describe: "describe";
|
|
252
|
-
min: "min";
|
|
253
|
-
max: "max";
|
|
254
|
-
exclusiveMinimum: "exclusiveMinimum";
|
|
255
|
-
exclusiveMaximum: "exclusiveMaximum";
|
|
256
|
-
optional: "optional";
|
|
257
|
-
readOnly: "readOnly";
|
|
258
|
-
writeOnly: "writeOnly";
|
|
259
|
-
object: "object";
|
|
260
|
-
ref: "ref";
|
|
261
|
-
matches: "matches";
|
|
262
|
-
firstName: "firstName";
|
|
263
|
-
lastName: "lastName";
|
|
264
|
-
password: "password";
|
|
265
|
-
phone: "phone";
|
|
266
|
-
blob: "blob";
|
|
267
|
-
deprecated: "deprecated";
|
|
268
|
-
example: "example";
|
|
269
|
-
schema: "schema";
|
|
270
|
-
catchall: "catchall";
|
|
271
|
-
time: "time";
|
|
272
|
-
name: "name";
|
|
273
|
-
interface: "interface";
|
|
274
|
-
};
|
|
275
|
-
type SchemaKeyword = keyof SchemaKeywordMapper;
|
|
276
|
-
type SchemaMapper<T = string | null | undefined> = { [K in keyof SchemaKeywordMapper]: (() => T | undefined) | undefined };
|
|
277
|
-
type SchemaKeywordBase<T> = {
|
|
278
|
-
keyword: SchemaKeyword;
|
|
279
|
-
args: T;
|
|
280
|
-
};
|
|
281
|
-
type Schema = {
|
|
282
|
-
keyword: string;
|
|
283
|
-
} | SchemaKeywordMapper[keyof SchemaKeywordMapper];
|
|
284
|
-
type SchemaTree = {
|
|
285
|
-
schema: SchemaObject$1;
|
|
286
|
-
parent: Schema | undefined;
|
|
287
|
-
current: Schema;
|
|
288
|
-
siblings: Schema[];
|
|
289
|
-
/**
|
|
290
|
-
* this will be equal to the key of a property(object)
|
|
291
|
-
*/
|
|
292
|
-
name?: string;
|
|
293
|
-
};
|
|
294
|
-
declare function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]>;
|
|
295
|
-
//#endregion
|
|
296
|
-
export { SchemaMapper as a, schemaKeywords as c, OpenAPIV3$1 as d, OpenAPIV3_1 as f, contentType as h, SchemaKeywordMapper as i, HttpMethod as l, SchemaObject$1 as m, SchemaKeyword as n, SchemaTree as o, Operation$1 as p, SchemaKeywordBase as r, isKeyword as s, Schema as t, OasTypes as u };
|
|
297
|
-
//# sourceMappingURL=SchemaMapper-CgGWx6jF.d.cts.map
|
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
import { KubbFile } from "@kubb/fabric-core/types";
|
|
2
|
-
import * as OasTypes from "oas/types";
|
|
3
|
-
import { HttpMethods as HttpMethod } from "oas/types";
|
|
4
|
-
import { Operation as Operation$1 } from "oas/operation";
|
|
5
|
-
import { OpenAPIV3 as OpenAPIV3$1, OpenAPIV3_1 } from "openapi-types";
|
|
6
|
-
|
|
7
|
-
//#region ../oas/src/types.d.ts
|
|
8
|
-
type contentType = 'application/json' | (string & {});
|
|
9
|
-
type SchemaObject$1 = OasTypes.SchemaObject & {
|
|
10
|
-
'x-nullable'?: boolean;
|
|
11
|
-
$ref?: string;
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/SchemaMapper.d.ts
|
|
15
|
-
type SchemaKeywordMapper = {
|
|
16
|
-
object: {
|
|
17
|
-
keyword: 'object';
|
|
18
|
-
args: {
|
|
19
|
-
properties: {
|
|
20
|
-
[x: string]: Schema[];
|
|
21
|
-
};
|
|
22
|
-
additionalProperties: Schema[];
|
|
23
|
-
strict?: boolean;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
url: {
|
|
27
|
-
keyword: 'url';
|
|
28
|
-
};
|
|
29
|
-
readOnly: {
|
|
30
|
-
keyword: 'readOnly';
|
|
31
|
-
};
|
|
32
|
-
writeOnly: {
|
|
33
|
-
keyword: 'writeOnly';
|
|
34
|
-
};
|
|
35
|
-
uuid: {
|
|
36
|
-
keyword: 'uuid';
|
|
37
|
-
};
|
|
38
|
-
email: {
|
|
39
|
-
keyword: 'email';
|
|
40
|
-
};
|
|
41
|
-
firstName: {
|
|
42
|
-
keyword: 'firstName';
|
|
43
|
-
};
|
|
44
|
-
lastName: {
|
|
45
|
-
keyword: 'lastName';
|
|
46
|
-
};
|
|
47
|
-
phone: {
|
|
48
|
-
keyword: 'phone';
|
|
49
|
-
};
|
|
50
|
-
password: {
|
|
51
|
-
keyword: 'password';
|
|
52
|
-
};
|
|
53
|
-
date: {
|
|
54
|
-
keyword: 'date';
|
|
55
|
-
args: {
|
|
56
|
-
type?: 'date' | 'string';
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
time: {
|
|
60
|
-
keyword: 'time';
|
|
61
|
-
args: {
|
|
62
|
-
type?: 'date' | 'string';
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
datetime: {
|
|
66
|
-
keyword: 'datetime';
|
|
67
|
-
args: {
|
|
68
|
-
offset?: boolean;
|
|
69
|
-
local?: boolean;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
tuple: {
|
|
73
|
-
keyword: 'tuple';
|
|
74
|
-
args: {
|
|
75
|
-
items: Schema[];
|
|
76
|
-
min?: number;
|
|
77
|
-
max?: number;
|
|
78
|
-
rest?: Schema;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
array: {
|
|
82
|
-
keyword: 'array';
|
|
83
|
-
args: {
|
|
84
|
-
items: Schema[];
|
|
85
|
-
min?: number;
|
|
86
|
-
max?: number;
|
|
87
|
-
unique?: boolean;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
enum: {
|
|
91
|
-
keyword: 'enum';
|
|
92
|
-
args: {
|
|
93
|
-
name: string;
|
|
94
|
-
typeName: string;
|
|
95
|
-
asConst: boolean;
|
|
96
|
-
items: Array<{
|
|
97
|
-
name: string | number;
|
|
98
|
-
format: 'string' | 'number' | 'boolean';
|
|
99
|
-
value?: string | number | boolean;
|
|
100
|
-
}>;
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
and: {
|
|
104
|
-
keyword: 'and';
|
|
105
|
-
args: Schema[];
|
|
106
|
-
};
|
|
107
|
-
const: {
|
|
108
|
-
keyword: 'const';
|
|
109
|
-
args: {
|
|
110
|
-
name: string | number;
|
|
111
|
-
format: 'string' | 'number' | 'boolean';
|
|
112
|
-
value?: string | number | boolean;
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
union: {
|
|
116
|
-
keyword: 'union';
|
|
117
|
-
args: Schema[];
|
|
118
|
-
};
|
|
119
|
-
ref: {
|
|
120
|
-
keyword: 'ref';
|
|
121
|
-
args: {
|
|
122
|
-
name: string;
|
|
123
|
-
$ref: string;
|
|
124
|
-
/**
|
|
125
|
-
* Full qualified path.
|
|
126
|
-
*/
|
|
127
|
-
path: KubbFile.OptionalPath;
|
|
128
|
-
/**
|
|
129
|
-
* When true `File.Import` will be used.
|
|
130
|
-
* When false a reference will be used inside the current file.
|
|
131
|
-
*/
|
|
132
|
-
isImportable: boolean;
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
matches: {
|
|
136
|
-
keyword: 'matches';
|
|
137
|
-
args?: string;
|
|
138
|
-
};
|
|
139
|
-
boolean: {
|
|
140
|
-
keyword: 'boolean';
|
|
141
|
-
};
|
|
142
|
-
default: {
|
|
143
|
-
keyword: 'default';
|
|
144
|
-
args: string | number | boolean;
|
|
145
|
-
};
|
|
146
|
-
string: {
|
|
147
|
-
keyword: 'string';
|
|
148
|
-
};
|
|
149
|
-
integer: {
|
|
150
|
-
keyword: 'integer';
|
|
151
|
-
};
|
|
152
|
-
number: {
|
|
153
|
-
keyword: 'number';
|
|
154
|
-
};
|
|
155
|
-
max: {
|
|
156
|
-
keyword: 'max';
|
|
157
|
-
args: number;
|
|
158
|
-
};
|
|
159
|
-
min: {
|
|
160
|
-
keyword: 'min';
|
|
161
|
-
args: number;
|
|
162
|
-
};
|
|
163
|
-
exclusiveMaximum: {
|
|
164
|
-
keyword: 'exclusiveMaximum';
|
|
165
|
-
args: number;
|
|
166
|
-
};
|
|
167
|
-
exclusiveMinimum: {
|
|
168
|
-
keyword: 'exclusiveMinimum';
|
|
169
|
-
args: number;
|
|
170
|
-
};
|
|
171
|
-
describe: {
|
|
172
|
-
keyword: 'describe';
|
|
173
|
-
args: string;
|
|
174
|
-
};
|
|
175
|
-
example: {
|
|
176
|
-
keyword: 'example';
|
|
177
|
-
args: string;
|
|
178
|
-
};
|
|
179
|
-
deprecated: {
|
|
180
|
-
keyword: 'deprecated';
|
|
181
|
-
};
|
|
182
|
-
optional: {
|
|
183
|
-
keyword: 'optional';
|
|
184
|
-
};
|
|
185
|
-
undefined: {
|
|
186
|
-
keyword: 'undefined';
|
|
187
|
-
};
|
|
188
|
-
nullish: {
|
|
189
|
-
keyword: 'nullish';
|
|
190
|
-
};
|
|
191
|
-
nullable: {
|
|
192
|
-
keyword: 'nullable';
|
|
193
|
-
};
|
|
194
|
-
null: {
|
|
195
|
-
keyword: 'null';
|
|
196
|
-
};
|
|
197
|
-
any: {
|
|
198
|
-
keyword: 'any';
|
|
199
|
-
};
|
|
200
|
-
unknown: {
|
|
201
|
-
keyword: 'unknown';
|
|
202
|
-
};
|
|
203
|
-
void: {
|
|
204
|
-
keyword: 'void';
|
|
205
|
-
};
|
|
206
|
-
blob: {
|
|
207
|
-
keyword: 'blob';
|
|
208
|
-
};
|
|
209
|
-
schema: {
|
|
210
|
-
keyword: 'schema';
|
|
211
|
-
args: {
|
|
212
|
-
type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
|
|
213
|
-
format?: string;
|
|
214
|
-
};
|
|
215
|
-
};
|
|
216
|
-
name: {
|
|
217
|
-
keyword: 'name';
|
|
218
|
-
args: string;
|
|
219
|
-
};
|
|
220
|
-
catchall: {
|
|
221
|
-
keyword: 'catchall';
|
|
222
|
-
};
|
|
223
|
-
interface: {
|
|
224
|
-
keyword: 'interface';
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
|
-
declare const schemaKeywords: {
|
|
228
|
-
any: "any";
|
|
229
|
-
unknown: "unknown";
|
|
230
|
-
number: "number";
|
|
231
|
-
integer: "integer";
|
|
232
|
-
string: "string";
|
|
233
|
-
boolean: "boolean";
|
|
234
|
-
undefined: "undefined";
|
|
235
|
-
nullable: "nullable";
|
|
236
|
-
null: "null";
|
|
237
|
-
nullish: "nullish";
|
|
238
|
-
array: "array";
|
|
239
|
-
tuple: "tuple";
|
|
240
|
-
enum: "enum";
|
|
241
|
-
union: "union";
|
|
242
|
-
datetime: "datetime";
|
|
243
|
-
date: "date";
|
|
244
|
-
email: "email";
|
|
245
|
-
uuid: "uuid";
|
|
246
|
-
url: "url";
|
|
247
|
-
void: "void";
|
|
248
|
-
default: "default";
|
|
249
|
-
const: "const";
|
|
250
|
-
and: "and";
|
|
251
|
-
describe: "describe";
|
|
252
|
-
min: "min";
|
|
253
|
-
max: "max";
|
|
254
|
-
exclusiveMinimum: "exclusiveMinimum";
|
|
255
|
-
exclusiveMaximum: "exclusiveMaximum";
|
|
256
|
-
optional: "optional";
|
|
257
|
-
readOnly: "readOnly";
|
|
258
|
-
writeOnly: "writeOnly";
|
|
259
|
-
object: "object";
|
|
260
|
-
ref: "ref";
|
|
261
|
-
matches: "matches";
|
|
262
|
-
firstName: "firstName";
|
|
263
|
-
lastName: "lastName";
|
|
264
|
-
password: "password";
|
|
265
|
-
phone: "phone";
|
|
266
|
-
blob: "blob";
|
|
267
|
-
deprecated: "deprecated";
|
|
268
|
-
example: "example";
|
|
269
|
-
schema: "schema";
|
|
270
|
-
catchall: "catchall";
|
|
271
|
-
time: "time";
|
|
272
|
-
name: "name";
|
|
273
|
-
interface: "interface";
|
|
274
|
-
};
|
|
275
|
-
type SchemaKeyword = keyof SchemaKeywordMapper;
|
|
276
|
-
type SchemaMapper<T = string | null | undefined> = { [K in keyof SchemaKeywordMapper]: (() => T | undefined) | undefined };
|
|
277
|
-
type SchemaKeywordBase<T> = {
|
|
278
|
-
keyword: SchemaKeyword;
|
|
279
|
-
args: T;
|
|
280
|
-
};
|
|
281
|
-
type Schema = {
|
|
282
|
-
keyword: string;
|
|
283
|
-
} | SchemaKeywordMapper[keyof SchemaKeywordMapper];
|
|
284
|
-
type SchemaTree = {
|
|
285
|
-
schema: SchemaObject$1;
|
|
286
|
-
parent: Schema | undefined;
|
|
287
|
-
current: Schema;
|
|
288
|
-
siblings: Schema[];
|
|
289
|
-
/**
|
|
290
|
-
* this will be equal to the key of a property(object)
|
|
291
|
-
*/
|
|
292
|
-
name?: string;
|
|
293
|
-
};
|
|
294
|
-
declare function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]>;
|
|
295
|
-
//#endregion
|
|
296
|
-
export { SchemaMapper as a, schemaKeywords as c, OpenAPIV3$1 as d, OpenAPIV3_1 as f, contentType as h, SchemaKeywordMapper as i, HttpMethod as l, SchemaObject$1 as m, SchemaKeyword as n, SchemaTree as o, Operation$1 as p, SchemaKeywordBase as r, isKeyword as s, Schema as t, OasTypes as u };
|
|
297
|
-
//# sourceMappingURL=SchemaMapper-Cj3vjPGs.d.ts.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { resolve } from "node:path";
|
|
2
|
-
import { URLPath } from "@kubb/core/utils";
|
|
3
|
-
import { Oas, merge, parse } from "@kubb/oas";
|
|
4
|
-
import yaml from "@stoplight/yaml";
|
|
5
|
-
|
|
6
|
-
//#region src/utils/parseFromConfig.ts
|
|
7
|
-
function parseFromConfig(config, oasClass = Oas) {
|
|
8
|
-
if ("data" in config.input) {
|
|
9
|
-
if (typeof config.input.data === "object") return parse(JSON.parse(JSON.stringify(config.input.data)), { oasClass });
|
|
10
|
-
try {
|
|
11
|
-
return parse(yaml.parse(config.input.data), { oasClass });
|
|
12
|
-
} catch (_e) {}
|
|
13
|
-
return parse(JSON.parse(JSON.stringify(config.input.data)), { oasClass });
|
|
14
|
-
}
|
|
15
|
-
if (Array.isArray(config.input)) return merge(config.input.map((input) => input.path), { oasClass });
|
|
16
|
-
if (new URLPath(config.input.path).isURL) return parse(config.input.path, { oasClass });
|
|
17
|
-
return parse(resolve(config.root, config.input.path), { oasClass });
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
|
-
export { parseFromConfig as t };
|
|
22
|
-
//# sourceMappingURL=parseFromConfig-BkUoWC2U.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseFromConfig-BkUoWC2U.js","names":[],"sources":["../src/utils/parseFromConfig.ts"],"sourcesContent":["import { resolve } from 'node:path'\nimport type { Config } from '@kubb/core'\nimport { URLPath } from '@kubb/core/utils'\nimport { merge, Oas, type OasTypes, parse } from '@kubb/oas'\nimport yaml from '@stoplight/yaml'\n\nexport function parseFromConfig(config: Config, oasClass: typeof Oas = Oas): Promise<Oas> {\n if ('data' in config.input) {\n if (typeof config.input.data === 'object') {\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n return parse(api, { oasClass })\n }\n\n try {\n const api: string = yaml.parse(config.input.data as string) as string\n\n return parse(api, { oasClass })\n } catch (_e) {\n /* empty */\n }\n\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n\n return parse(api, { oasClass })\n }\n\n if (Array.isArray(config.input)) {\n return merge(\n config.input.map((input) => input.path),\n { oasClass },\n )\n }\n\n if (new URLPath(config.input.path).isURL) {\n return parse(config.input.path, { oasClass })\n }\n\n return parse(resolve(config.root, config.input.path), { oasClass })\n}\n"],"mappings":";;;;;;AAMA,SAAgB,gBAAgB,QAAgB,WAAuB,KAAmB;AACxF,KAAI,UAAU,OAAO,OAAO;AAC1B,MAAI,OAAO,OAAO,MAAM,SAAS,SAE/B,QAAO,MAD2B,KAAK,MAAM,KAAK,UAAU,OAAO,MAAM,KAAK,CAAC,EAC7D,EAAE,UAAU,CAAC;AAGjC,MAAI;AAGF,UAAO,MAFa,KAAK,MAAM,OAAO,MAAM,KAAe,EAEzC,EAAE,UAAU,CAAC;WACxB,IAAI;AAMb,SAAO,MAF2B,KAAK,MAAM,KAAK,UAAU,OAAO,MAAM,KAAK,CAAC,EAE7D,EAAE,UAAU,CAAC;;AAGjC,KAAI,MAAM,QAAQ,OAAO,MAAM,CAC7B,QAAO,MACL,OAAO,MAAM,KAAK,UAAU,MAAM,KAAK,EACvC,EAAE,UAAU,CACb;AAGH,KAAI,IAAI,QAAQ,OAAO,MAAM,KAAK,CAAC,MACjC,QAAO,MAAM,OAAO,MAAM,MAAM,EAAE,UAAU,CAAC;AAG/C,QAAO,MAAM,QAAQ,OAAO,MAAM,OAAO,MAAM,KAAK,EAAE,EAAE,UAAU,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
let node_path = require("node:path");
|
|
3
|
-
node_path = require_chunk.__toESM(node_path);
|
|
4
|
-
let __kubb_core_utils = require("@kubb/core/utils");
|
|
5
|
-
__kubb_core_utils = require_chunk.__toESM(__kubb_core_utils);
|
|
6
|
-
let __kubb_oas = require("@kubb/oas");
|
|
7
|
-
__kubb_oas = require_chunk.__toESM(__kubb_oas);
|
|
8
|
-
let __stoplight_yaml = require("@stoplight/yaml");
|
|
9
|
-
__stoplight_yaml = require_chunk.__toESM(__stoplight_yaml);
|
|
10
|
-
|
|
11
|
-
//#region src/utils/parseFromConfig.ts
|
|
12
|
-
function parseFromConfig(config, oasClass = __kubb_oas.Oas) {
|
|
13
|
-
if ("data" in config.input) {
|
|
14
|
-
if (typeof config.input.data === "object") return (0, __kubb_oas.parse)(JSON.parse(JSON.stringify(config.input.data)), { oasClass });
|
|
15
|
-
try {
|
|
16
|
-
return (0, __kubb_oas.parse)(__stoplight_yaml.default.parse(config.input.data), { oasClass });
|
|
17
|
-
} catch (_e) {}
|
|
18
|
-
return (0, __kubb_oas.parse)(JSON.parse(JSON.stringify(config.input.data)), { oasClass });
|
|
19
|
-
}
|
|
20
|
-
if (Array.isArray(config.input)) return (0, __kubb_oas.merge)(config.input.map((input) => input.path), { oasClass });
|
|
21
|
-
if (new __kubb_core_utils.URLPath(config.input.path).isURL) return (0, __kubb_oas.parse)(config.input.path, { oasClass });
|
|
22
|
-
return (0, __kubb_oas.parse)((0, node_path.resolve)(config.root, config.input.path), { oasClass });
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
//#endregion
|
|
26
|
-
Object.defineProperty(exports, 'parseFromConfig', {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function () {
|
|
29
|
-
return parseFromConfig;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=parseFromConfig-EjsCZ0-8.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseFromConfig-EjsCZ0-8.cjs","names":["Oas","yaml","URLPath"],"sources":["../src/utils/parseFromConfig.ts"],"sourcesContent":["import { resolve } from 'node:path'\nimport type { Config } from '@kubb/core'\nimport { URLPath } from '@kubb/core/utils'\nimport { merge, Oas, type OasTypes, parse } from '@kubb/oas'\nimport yaml from '@stoplight/yaml'\n\nexport function parseFromConfig(config: Config, oasClass: typeof Oas = Oas): Promise<Oas> {\n if ('data' in config.input) {\n if (typeof config.input.data === 'object') {\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n return parse(api, { oasClass })\n }\n\n try {\n const api: string = yaml.parse(config.input.data as string) as string\n\n return parse(api, { oasClass })\n } catch (_e) {\n /* empty */\n }\n\n const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument\n\n return parse(api, { oasClass })\n }\n\n if (Array.isArray(config.input)) {\n return merge(\n config.input.map((input) => input.path),\n { oasClass },\n )\n }\n\n if (new URLPath(config.input.path).isURL) {\n return parse(config.input.path, { oasClass })\n }\n\n return parse(resolve(config.root, config.input.path), { oasClass })\n}\n"],"mappings":";;;;;;;;;;;AAMA,SAAgB,gBAAgB,QAAgB,WAAuBA,gBAAmB;AACxF,KAAI,UAAU,OAAO,OAAO;AAC1B,MAAI,OAAO,OAAO,MAAM,SAAS,SAE/B,8BADkC,KAAK,MAAM,KAAK,UAAU,OAAO,MAAM,KAAK,CAAC,EAC7D,EAAE,UAAU,CAAC;AAGjC,MAAI;AAGF,gCAFoBC,yBAAK,MAAM,OAAO,MAAM,KAAe,EAEzC,EAAE,UAAU,CAAC;WACxB,IAAI;AAMb,+BAFkC,KAAK,MAAM,KAAK,UAAU,OAAO,MAAM,KAAK,CAAC,EAE7D,EAAE,UAAU,CAAC;;AAGjC,KAAI,MAAM,QAAQ,OAAO,MAAM,CAC7B,8BACE,OAAO,MAAM,KAAK,UAAU,MAAM,KAAK,EACvC,EAAE,UAAU,CACb;AAGH,KAAI,IAAIC,0BAAQ,OAAO,MAAM,KAAK,CAAC,MACjC,8BAAa,OAAO,MAAM,MAAM,EAAE,UAAU,CAAC;AAG/C,qDAAqB,OAAO,MAAM,OAAO,MAAM,KAAK,EAAE,EAAE,UAAU,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { resolve } from 'node:path'
|
|
2
|
-
import type { Config } from '@kubb/core'
|
|
3
|
-
import { URLPath } from '@kubb/core/utils'
|
|
4
|
-
import { merge, Oas, type OasTypes, parse } from '@kubb/oas'
|
|
5
|
-
import yaml from '@stoplight/yaml'
|
|
6
|
-
|
|
7
|
-
export function parseFromConfig(config: Config, oasClass: typeof Oas = Oas): Promise<Oas> {
|
|
8
|
-
if ('data' in config.input) {
|
|
9
|
-
if (typeof config.input.data === 'object') {
|
|
10
|
-
const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument
|
|
11
|
-
return parse(api, { oasClass })
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
const api: string = yaml.parse(config.input.data as string) as string
|
|
16
|
-
|
|
17
|
-
return parse(api, { oasClass })
|
|
18
|
-
} catch (_e) {
|
|
19
|
-
/* empty */
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const api: OasTypes.OASDocument = JSON.parse(JSON.stringify(config.input.data)) as OasTypes.OASDocument
|
|
23
|
-
|
|
24
|
-
return parse(api, { oasClass })
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (Array.isArray(config.input)) {
|
|
28
|
-
return merge(
|
|
29
|
-
config.input.map((input) => input.path),
|
|
30
|
-
{ oasClass },
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (new URLPath(config.input.path).isURL) {
|
|
35
|
-
return parse(config.input.path, { oasClass })
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return parse(resolve(config.root, config.input.path), { oasClass })
|
|
39
|
-
}
|