@scalar/oas-utils 0.2.8 → 0.2.10
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/CHANGELOG.md +13 -0
- package/dist/entities/workspace/cookie/cookie.d.ts +6 -6
- package/dist/entities/workspace/cookie/cookie.d.ts.map +1 -1
- package/dist/entities/workspace/cookie/cookie.js +5 -3
- package/dist/entities/workspace/spec/request-examples.d.ts +184 -0
- package/dist/entities/workspace/spec/request-examples.d.ts.map +1 -1
- package/dist/entities/workspace/spec/request-examples.js +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @scalar/oas-utils
|
|
2
2
|
|
|
3
|
+
## 0.2.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d58841b: feat: type, format and default to request example parameters schema
|
|
8
|
+
|
|
9
|
+
## 0.2.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- d6a2a4d: feat: oas-utils request example parameters enum
|
|
14
|
+
- 632d6f7: fix: add cookie handler and schema
|
|
15
|
+
|
|
3
16
|
## 0.2.8
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -2,8 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
declare const cookieSchema: z.ZodObject<{
|
|
3
3
|
uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
4
4
|
/** Defines the cookie name and its value. A cookie definition begins with a name-value pair. */
|
|
5
|
-
name: z.ZodString
|
|
6
|
-
value: z.ZodString
|
|
5
|
+
name: z.ZodDefault<z.ZodString>;
|
|
6
|
+
value: z.ZodDefault<z.ZodString>;
|
|
7
7
|
/** Defines the host to which the cookie will be sent. */
|
|
8
8
|
domain: z.ZodOptional<z.ZodString>;
|
|
9
9
|
/** Indicates the maximum lifetime of the cookie as an HTTP-date timestamp. See Date for the required formatting. */
|
|
@@ -30,7 +30,7 @@ declare const cookieSchema: z.ZodObject<{
|
|
|
30
30
|
* Controls whether or not a cookie is sent with cross-site requests, providing some protection against cross-site
|
|
31
31
|
* request forgery attacks (CSRF).
|
|
32
32
|
*/
|
|
33
|
-
sameSite: z.ZodUnion<[z.ZodLiteral<"Lax">, z.ZodLiteral<"Strict">, z.ZodLiteral<"None">]
|
|
33
|
+
sameSite: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"Lax">, z.ZodLiteral<"Strict">, z.ZodLiteral<"None">]>>;
|
|
34
34
|
/**
|
|
35
35
|
* Indicates that the cookie is sent to the server only when a request is made with the https: scheme (except on
|
|
36
36
|
* localhost), and therefore, is more resistant to man-in-the-middle attacks.
|
|
@@ -49,16 +49,16 @@ declare const cookieSchema: z.ZodObject<{
|
|
|
49
49
|
partitioned?: boolean | undefined;
|
|
50
50
|
secure?: boolean | undefined;
|
|
51
51
|
}, {
|
|
52
|
-
value: string;
|
|
53
|
-
name: string;
|
|
54
|
-
sameSite: "Lax" | "Strict" | "None";
|
|
55
52
|
path?: string | undefined;
|
|
53
|
+
value?: string | undefined;
|
|
56
54
|
uid?: string | undefined;
|
|
55
|
+
name?: string | undefined;
|
|
57
56
|
domain?: string | undefined;
|
|
58
57
|
expires?: Date | undefined;
|
|
59
58
|
httpOnly?: boolean | undefined;
|
|
60
59
|
maxAge?: number | undefined;
|
|
61
60
|
partitioned?: boolean | undefined;
|
|
61
|
+
sameSite?: "Lax" | "Strict" | "None" | undefined;
|
|
62
62
|
secure?: boolean | undefined;
|
|
63
63
|
}>;
|
|
64
64
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../../../../src/entities/workspace/cookie/cookie.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,QAAA,MAAM,YAAY;;IAEhB,kGAAkG;;;IAGlG,yDAAyD;;IAEzD,oHAAoH;;IAEpH;;;;OAIG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH,yGAAyG;;IAEzG;;;OAGG;;
|
|
1
|
+
{"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../../../../src/entities/workspace/cookie/cookie.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,QAAA,MAAM,YAAY;;IAEhB,kGAAkG;;;IAGlG,yDAAyD;;IAEzD,oHAAoH;;IAEpH;;;;OAIG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH,yGAAyG;;IAEzG;;;OAGG;;IAIH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAA;AAEF;;;;GAIG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AACjD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAExD,2BAA2B;AAC3B,eAAO,MAAM,YAAY,YAAa,aAAa;;;;;;;;;;;;CACP,CAAA"}
|
|
@@ -5,8 +5,8 @@ import { deepMerge } from '../../../helpers/deepMerge.js';
|
|
|
5
5
|
const cookieSchema = z.object({
|
|
6
6
|
uid: nanoidSchema,
|
|
7
7
|
/** Defines the cookie name and its value. A cookie definition begins with a name-value pair. */
|
|
8
|
-
name: z.string(),
|
|
9
|
-
value: z.string(),
|
|
8
|
+
name: z.string().default('Default Cookie'),
|
|
9
|
+
value: z.string().default('Default Value'),
|
|
10
10
|
/** Defines the host to which the cookie will be sent. */
|
|
11
11
|
domain: z.string().optional(),
|
|
12
12
|
/** Indicates the maximum lifetime of the cookie as an HTTP-date timestamp. See Date for the required formatting. */
|
|
@@ -33,7 +33,9 @@ const cookieSchema = z.object({
|
|
|
33
33
|
* Controls whether or not a cookie is sent with cross-site requests, providing some protection against cross-site
|
|
34
34
|
* request forgery attacks (CSRF).
|
|
35
35
|
*/
|
|
36
|
-
sameSite: z
|
|
36
|
+
sameSite: z
|
|
37
|
+
.union([z.literal('Lax'), z.literal('Strict'), z.literal('None')])
|
|
38
|
+
.default('None'),
|
|
37
39
|
/**
|
|
38
40
|
* Indicates that the cookie is sent to the server only when a request is made with the https: scheme (except on
|
|
39
41
|
* localhost), and therefore, is more resistant to man-in-the-middle attacks.
|
|
@@ -8,22 +8,34 @@ declare const requestExampleParametersSchema: z.ZodObject<{
|
|
|
8
8
|
/** Params are linked to parents such as path params and global headers/cookies */
|
|
9
9
|
refUid: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodString>>>;
|
|
10
10
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
12
|
+
type: z.ZodOptional<z.ZodString>;
|
|
13
|
+
format: z.ZodOptional<z.ZodString>;
|
|
14
|
+
default: z.ZodOptional<z.ZodAny>;
|
|
11
15
|
}, "strip", z.ZodTypeAny, {
|
|
12
16
|
value: string;
|
|
13
17
|
key: string;
|
|
14
18
|
enabled: boolean;
|
|
19
|
+
type?: string | undefined;
|
|
20
|
+
default?: any;
|
|
15
21
|
description?: string | undefined;
|
|
22
|
+
enum?: string[] | undefined;
|
|
16
23
|
required?: boolean | undefined;
|
|
17
24
|
file?: File | undefined;
|
|
18
25
|
refUid?: string | undefined;
|
|
26
|
+
format?: string | undefined;
|
|
19
27
|
}, {
|
|
28
|
+
type?: string | undefined;
|
|
20
29
|
value?: string | number | undefined;
|
|
30
|
+
default?: any;
|
|
21
31
|
description?: string | undefined;
|
|
22
32
|
key?: string | undefined;
|
|
33
|
+
enum?: string[] | undefined;
|
|
23
34
|
required?: boolean | undefined;
|
|
24
35
|
enabled?: boolean | undefined;
|
|
25
36
|
file?: File | undefined;
|
|
26
37
|
refUid?: string | undefined;
|
|
38
|
+
format?: string | undefined;
|
|
27
39
|
}>;
|
|
28
40
|
/** Request examples - formerly known as instances - are "children" of requests */
|
|
29
41
|
export type RequestExampleParameter = z.infer<typeof requestExampleParametersSchema>;
|
|
@@ -33,10 +45,14 @@ export declare const createRequestExampleParameter: (payload: RequestExamplePara
|
|
|
33
45
|
value: string;
|
|
34
46
|
key: string;
|
|
35
47
|
enabled: boolean;
|
|
48
|
+
type?: string | undefined;
|
|
49
|
+
default?: any;
|
|
36
50
|
description?: string | undefined;
|
|
51
|
+
enum?: string[] | undefined;
|
|
37
52
|
required?: boolean | undefined;
|
|
38
53
|
file?: File | undefined;
|
|
39
54
|
refUid?: string | undefined;
|
|
55
|
+
format?: string | undefined;
|
|
40
56
|
};
|
|
41
57
|
declare const requestExampleSchema: z.ZodObject<{
|
|
42
58
|
uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -64,43 +80,63 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
64
80
|
/** Params are linked to parents such as path params and global headers/cookies */
|
|
65
81
|
refUid: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodString>>>;
|
|
66
82
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
84
|
+
type: z.ZodOptional<z.ZodString>;
|
|
85
|
+
format: z.ZodOptional<z.ZodString>;
|
|
86
|
+
default: z.ZodOptional<z.ZodAny>;
|
|
67
87
|
}, "strip", z.ZodTypeAny, {
|
|
68
88
|
value: string;
|
|
69
89
|
key: string;
|
|
70
90
|
enabled: boolean;
|
|
91
|
+
type?: string | undefined;
|
|
92
|
+
default?: any;
|
|
71
93
|
description?: string | undefined;
|
|
94
|
+
enum?: string[] | undefined;
|
|
72
95
|
required?: boolean | undefined;
|
|
73
96
|
file?: File | undefined;
|
|
74
97
|
refUid?: string | undefined;
|
|
98
|
+
format?: string | undefined;
|
|
75
99
|
}, {
|
|
100
|
+
type?: string | undefined;
|
|
76
101
|
value?: string | number | undefined;
|
|
102
|
+
default?: any;
|
|
77
103
|
description?: string | undefined;
|
|
78
104
|
key?: string | undefined;
|
|
105
|
+
enum?: string[] | undefined;
|
|
79
106
|
required?: boolean | undefined;
|
|
80
107
|
enabled?: boolean | undefined;
|
|
81
108
|
file?: File | undefined;
|
|
82
109
|
refUid?: string | undefined;
|
|
110
|
+
format?: string | undefined;
|
|
83
111
|
}>, "many">>;
|
|
84
112
|
}, "strip", z.ZodTypeAny, {
|
|
85
113
|
value: {
|
|
86
114
|
value: string;
|
|
87
115
|
key: string;
|
|
88
116
|
enabled: boolean;
|
|
117
|
+
type?: string | undefined;
|
|
118
|
+
default?: any;
|
|
89
119
|
description?: string | undefined;
|
|
120
|
+
enum?: string[] | undefined;
|
|
90
121
|
required?: boolean | undefined;
|
|
91
122
|
file?: File | undefined;
|
|
92
123
|
refUid?: string | undefined;
|
|
124
|
+
format?: string | undefined;
|
|
93
125
|
}[];
|
|
94
126
|
encoding: "form-data" | "urlencoded";
|
|
95
127
|
}, {
|
|
96
128
|
value?: {
|
|
129
|
+
type?: string | undefined;
|
|
97
130
|
value?: string | number | undefined;
|
|
131
|
+
default?: any;
|
|
98
132
|
description?: string | undefined;
|
|
99
133
|
key?: string | undefined;
|
|
134
|
+
enum?: string[] | undefined;
|
|
100
135
|
required?: boolean | undefined;
|
|
101
136
|
enabled?: boolean | undefined;
|
|
102
137
|
file?: File | undefined;
|
|
103
138
|
refUid?: string | undefined;
|
|
139
|
+
format?: string | undefined;
|
|
104
140
|
}[] | undefined;
|
|
105
141
|
encoding?: "form-data" | "urlencoded" | undefined;
|
|
106
142
|
}>>;
|
|
@@ -116,10 +152,14 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
116
152
|
value: string;
|
|
117
153
|
key: string;
|
|
118
154
|
enabled: boolean;
|
|
155
|
+
type?: string | undefined;
|
|
156
|
+
default?: any;
|
|
119
157
|
description?: string | undefined;
|
|
158
|
+
enum?: string[] | undefined;
|
|
120
159
|
required?: boolean | undefined;
|
|
121
160
|
file?: File | undefined;
|
|
122
161
|
refUid?: string | undefined;
|
|
162
|
+
format?: string | undefined;
|
|
123
163
|
}[];
|
|
124
164
|
encoding: "form-data" | "urlencoded";
|
|
125
165
|
};
|
|
@@ -132,13 +172,17 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
132
172
|
} | undefined;
|
|
133
173
|
formData?: {
|
|
134
174
|
value?: {
|
|
175
|
+
type?: string | undefined;
|
|
135
176
|
value?: string | number | undefined;
|
|
177
|
+
default?: any;
|
|
136
178
|
description?: string | undefined;
|
|
137
179
|
key?: string | undefined;
|
|
180
|
+
enum?: string[] | undefined;
|
|
138
181
|
required?: boolean | undefined;
|
|
139
182
|
enabled?: boolean | undefined;
|
|
140
183
|
file?: File | undefined;
|
|
141
184
|
refUid?: string | undefined;
|
|
185
|
+
format?: string | undefined;
|
|
142
186
|
}[] | undefined;
|
|
143
187
|
encoding?: "form-data" | "urlencoded" | undefined;
|
|
144
188
|
} | undefined;
|
|
@@ -155,22 +199,34 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
155
199
|
/** Params are linked to parents such as path params and global headers/cookies */
|
|
156
200
|
refUid: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodString>>>;
|
|
157
201
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
202
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
203
|
+
type: z.ZodOptional<z.ZodString>;
|
|
204
|
+
format: z.ZodOptional<z.ZodString>;
|
|
205
|
+
default: z.ZodOptional<z.ZodAny>;
|
|
158
206
|
}, "strip", z.ZodTypeAny, {
|
|
159
207
|
value: string;
|
|
160
208
|
key: string;
|
|
161
209
|
enabled: boolean;
|
|
210
|
+
type?: string | undefined;
|
|
211
|
+
default?: any;
|
|
162
212
|
description?: string | undefined;
|
|
213
|
+
enum?: string[] | undefined;
|
|
163
214
|
required?: boolean | undefined;
|
|
164
215
|
file?: File | undefined;
|
|
165
216
|
refUid?: string | undefined;
|
|
217
|
+
format?: string | undefined;
|
|
166
218
|
}, {
|
|
219
|
+
type?: string | undefined;
|
|
167
220
|
value?: string | number | undefined;
|
|
221
|
+
default?: any;
|
|
168
222
|
description?: string | undefined;
|
|
169
223
|
key?: string | undefined;
|
|
224
|
+
enum?: string[] | undefined;
|
|
170
225
|
required?: boolean | undefined;
|
|
171
226
|
enabled?: boolean | undefined;
|
|
172
227
|
file?: File | undefined;
|
|
173
228
|
refUid?: string | undefined;
|
|
229
|
+
format?: string | undefined;
|
|
174
230
|
}>, "many">>;
|
|
175
231
|
query: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
176
232
|
key: z.ZodDefault<z.ZodString>;
|
|
@@ -181,22 +237,34 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
181
237
|
/** Params are linked to parents such as path params and global headers/cookies */
|
|
182
238
|
refUid: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodString>>>;
|
|
183
239
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
240
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
241
|
+
type: z.ZodOptional<z.ZodString>;
|
|
242
|
+
format: z.ZodOptional<z.ZodString>;
|
|
243
|
+
default: z.ZodOptional<z.ZodAny>;
|
|
184
244
|
}, "strip", z.ZodTypeAny, {
|
|
185
245
|
value: string;
|
|
186
246
|
key: string;
|
|
187
247
|
enabled: boolean;
|
|
248
|
+
type?: string | undefined;
|
|
249
|
+
default?: any;
|
|
188
250
|
description?: string | undefined;
|
|
251
|
+
enum?: string[] | undefined;
|
|
189
252
|
required?: boolean | undefined;
|
|
190
253
|
file?: File | undefined;
|
|
191
254
|
refUid?: string | undefined;
|
|
255
|
+
format?: string | undefined;
|
|
192
256
|
}, {
|
|
257
|
+
type?: string | undefined;
|
|
193
258
|
value?: string | number | undefined;
|
|
259
|
+
default?: any;
|
|
194
260
|
description?: string | undefined;
|
|
195
261
|
key?: string | undefined;
|
|
262
|
+
enum?: string[] | undefined;
|
|
196
263
|
required?: boolean | undefined;
|
|
197
264
|
enabled?: boolean | undefined;
|
|
198
265
|
file?: File | undefined;
|
|
199
266
|
refUid?: string | undefined;
|
|
267
|
+
format?: string | undefined;
|
|
200
268
|
}>, "many">>;
|
|
201
269
|
headers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
202
270
|
key: z.ZodDefault<z.ZodString>;
|
|
@@ -207,22 +275,34 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
207
275
|
/** Params are linked to parents such as path params and global headers/cookies */
|
|
208
276
|
refUid: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodString>>>;
|
|
209
277
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
278
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
279
|
+
type: z.ZodOptional<z.ZodString>;
|
|
280
|
+
format: z.ZodOptional<z.ZodString>;
|
|
281
|
+
default: z.ZodOptional<z.ZodAny>;
|
|
210
282
|
}, "strip", z.ZodTypeAny, {
|
|
211
283
|
value: string;
|
|
212
284
|
key: string;
|
|
213
285
|
enabled: boolean;
|
|
286
|
+
type?: string | undefined;
|
|
287
|
+
default?: any;
|
|
214
288
|
description?: string | undefined;
|
|
289
|
+
enum?: string[] | undefined;
|
|
215
290
|
required?: boolean | undefined;
|
|
216
291
|
file?: File | undefined;
|
|
217
292
|
refUid?: string | undefined;
|
|
293
|
+
format?: string | undefined;
|
|
218
294
|
}, {
|
|
295
|
+
type?: string | undefined;
|
|
219
296
|
value?: string | number | undefined;
|
|
297
|
+
default?: any;
|
|
220
298
|
description?: string | undefined;
|
|
221
299
|
key?: string | undefined;
|
|
300
|
+
enum?: string[] | undefined;
|
|
222
301
|
required?: boolean | undefined;
|
|
223
302
|
enabled?: boolean | undefined;
|
|
224
303
|
file?: File | undefined;
|
|
225
304
|
refUid?: string | undefined;
|
|
305
|
+
format?: string | undefined;
|
|
226
306
|
}>, "many">>;
|
|
227
307
|
cookies: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
228
308
|
key: z.ZodDefault<z.ZodString>;
|
|
@@ -233,96 +313,140 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
233
313
|
/** Params are linked to parents such as path params and global headers/cookies */
|
|
234
314
|
refUid: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodString>>>;
|
|
235
315
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
316
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
317
|
+
type: z.ZodOptional<z.ZodString>;
|
|
318
|
+
format: z.ZodOptional<z.ZodString>;
|
|
319
|
+
default: z.ZodOptional<z.ZodAny>;
|
|
236
320
|
}, "strip", z.ZodTypeAny, {
|
|
237
321
|
value: string;
|
|
238
322
|
key: string;
|
|
239
323
|
enabled: boolean;
|
|
324
|
+
type?: string | undefined;
|
|
325
|
+
default?: any;
|
|
240
326
|
description?: string | undefined;
|
|
327
|
+
enum?: string[] | undefined;
|
|
241
328
|
required?: boolean | undefined;
|
|
242
329
|
file?: File | undefined;
|
|
243
330
|
refUid?: string | undefined;
|
|
331
|
+
format?: string | undefined;
|
|
244
332
|
}, {
|
|
333
|
+
type?: string | undefined;
|
|
245
334
|
value?: string | number | undefined;
|
|
335
|
+
default?: any;
|
|
246
336
|
description?: string | undefined;
|
|
247
337
|
key?: string | undefined;
|
|
338
|
+
enum?: string[] | undefined;
|
|
248
339
|
required?: boolean | undefined;
|
|
249
340
|
enabled?: boolean | undefined;
|
|
250
341
|
file?: File | undefined;
|
|
251
342
|
refUid?: string | undefined;
|
|
343
|
+
format?: string | undefined;
|
|
252
344
|
}>, "many">>;
|
|
253
345
|
}, "strip", z.ZodTypeAny, {
|
|
254
346
|
path: {
|
|
255
347
|
value: string;
|
|
256
348
|
key: string;
|
|
257
349
|
enabled: boolean;
|
|
350
|
+
type?: string | undefined;
|
|
351
|
+
default?: any;
|
|
258
352
|
description?: string | undefined;
|
|
353
|
+
enum?: string[] | undefined;
|
|
259
354
|
required?: boolean | undefined;
|
|
260
355
|
file?: File | undefined;
|
|
261
356
|
refUid?: string | undefined;
|
|
357
|
+
format?: string | undefined;
|
|
262
358
|
}[];
|
|
263
359
|
query: {
|
|
264
360
|
value: string;
|
|
265
361
|
key: string;
|
|
266
362
|
enabled: boolean;
|
|
363
|
+
type?: string | undefined;
|
|
364
|
+
default?: any;
|
|
267
365
|
description?: string | undefined;
|
|
366
|
+
enum?: string[] | undefined;
|
|
268
367
|
required?: boolean | undefined;
|
|
269
368
|
file?: File | undefined;
|
|
270
369
|
refUid?: string | undefined;
|
|
370
|
+
format?: string | undefined;
|
|
271
371
|
}[];
|
|
272
372
|
cookies: {
|
|
273
373
|
value: string;
|
|
274
374
|
key: string;
|
|
275
375
|
enabled: boolean;
|
|
376
|
+
type?: string | undefined;
|
|
377
|
+
default?: any;
|
|
276
378
|
description?: string | undefined;
|
|
379
|
+
enum?: string[] | undefined;
|
|
277
380
|
required?: boolean | undefined;
|
|
278
381
|
file?: File | undefined;
|
|
279
382
|
refUid?: string | undefined;
|
|
383
|
+
format?: string | undefined;
|
|
280
384
|
}[];
|
|
281
385
|
headers: {
|
|
282
386
|
value: string;
|
|
283
387
|
key: string;
|
|
284
388
|
enabled: boolean;
|
|
389
|
+
type?: string | undefined;
|
|
390
|
+
default?: any;
|
|
285
391
|
description?: string | undefined;
|
|
392
|
+
enum?: string[] | undefined;
|
|
286
393
|
required?: boolean | undefined;
|
|
287
394
|
file?: File | undefined;
|
|
288
395
|
refUid?: string | undefined;
|
|
396
|
+
format?: string | undefined;
|
|
289
397
|
}[];
|
|
290
398
|
}, {
|
|
291
399
|
path?: {
|
|
400
|
+
type?: string | undefined;
|
|
292
401
|
value?: string | number | undefined;
|
|
402
|
+
default?: any;
|
|
293
403
|
description?: string | undefined;
|
|
294
404
|
key?: string | undefined;
|
|
405
|
+
enum?: string[] | undefined;
|
|
295
406
|
required?: boolean | undefined;
|
|
296
407
|
enabled?: boolean | undefined;
|
|
297
408
|
file?: File | undefined;
|
|
298
409
|
refUid?: string | undefined;
|
|
410
|
+
format?: string | undefined;
|
|
299
411
|
}[] | undefined;
|
|
300
412
|
query?: {
|
|
413
|
+
type?: string | undefined;
|
|
301
414
|
value?: string | number | undefined;
|
|
415
|
+
default?: any;
|
|
302
416
|
description?: string | undefined;
|
|
303
417
|
key?: string | undefined;
|
|
418
|
+
enum?: string[] | undefined;
|
|
304
419
|
required?: boolean | undefined;
|
|
305
420
|
enabled?: boolean | undefined;
|
|
306
421
|
file?: File | undefined;
|
|
307
422
|
refUid?: string | undefined;
|
|
423
|
+
format?: string | undefined;
|
|
308
424
|
}[] | undefined;
|
|
309
425
|
cookies?: {
|
|
426
|
+
type?: string | undefined;
|
|
310
427
|
value?: string | number | undefined;
|
|
428
|
+
default?: any;
|
|
311
429
|
description?: string | undefined;
|
|
312
430
|
key?: string | undefined;
|
|
431
|
+
enum?: string[] | undefined;
|
|
313
432
|
required?: boolean | undefined;
|
|
314
433
|
enabled?: boolean | undefined;
|
|
315
434
|
file?: File | undefined;
|
|
316
435
|
refUid?: string | undefined;
|
|
436
|
+
format?: string | undefined;
|
|
317
437
|
}[] | undefined;
|
|
318
438
|
headers?: {
|
|
439
|
+
type?: string | undefined;
|
|
319
440
|
value?: string | number | undefined;
|
|
441
|
+
default?: any;
|
|
320
442
|
description?: string | undefined;
|
|
321
443
|
key?: string | undefined;
|
|
444
|
+
enum?: string[] | undefined;
|
|
322
445
|
required?: boolean | undefined;
|
|
323
446
|
enabled?: boolean | undefined;
|
|
324
447
|
file?: File | undefined;
|
|
325
448
|
refUid?: string | undefined;
|
|
449
|
+
format?: string | undefined;
|
|
326
450
|
}[] | undefined;
|
|
327
451
|
}>>>;
|
|
328
452
|
auth: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -334,37 +458,53 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
334
458
|
value: string;
|
|
335
459
|
key: string;
|
|
336
460
|
enabled: boolean;
|
|
461
|
+
type?: string | undefined;
|
|
462
|
+
default?: any;
|
|
337
463
|
description?: string | undefined;
|
|
464
|
+
enum?: string[] | undefined;
|
|
338
465
|
required?: boolean | undefined;
|
|
339
466
|
file?: File | undefined;
|
|
340
467
|
refUid?: string | undefined;
|
|
468
|
+
format?: string | undefined;
|
|
341
469
|
}[];
|
|
342
470
|
query: {
|
|
343
471
|
value: string;
|
|
344
472
|
key: string;
|
|
345
473
|
enabled: boolean;
|
|
474
|
+
type?: string | undefined;
|
|
475
|
+
default?: any;
|
|
346
476
|
description?: string | undefined;
|
|
477
|
+
enum?: string[] | undefined;
|
|
347
478
|
required?: boolean | undefined;
|
|
348
479
|
file?: File | undefined;
|
|
349
480
|
refUid?: string | undefined;
|
|
481
|
+
format?: string | undefined;
|
|
350
482
|
}[];
|
|
351
483
|
cookies: {
|
|
352
484
|
value: string;
|
|
353
485
|
key: string;
|
|
354
486
|
enabled: boolean;
|
|
487
|
+
type?: string | undefined;
|
|
488
|
+
default?: any;
|
|
355
489
|
description?: string | undefined;
|
|
490
|
+
enum?: string[] | undefined;
|
|
356
491
|
required?: boolean | undefined;
|
|
357
492
|
file?: File | undefined;
|
|
358
493
|
refUid?: string | undefined;
|
|
494
|
+
format?: string | undefined;
|
|
359
495
|
}[];
|
|
360
496
|
headers: {
|
|
361
497
|
value: string;
|
|
362
498
|
key: string;
|
|
363
499
|
enabled: boolean;
|
|
500
|
+
type?: string | undefined;
|
|
501
|
+
default?: any;
|
|
364
502
|
description?: string | undefined;
|
|
503
|
+
enum?: string[] | undefined;
|
|
365
504
|
required?: boolean | undefined;
|
|
366
505
|
file?: File | undefined;
|
|
367
506
|
refUid?: string | undefined;
|
|
507
|
+
format?: string | undefined;
|
|
368
508
|
}[];
|
|
369
509
|
};
|
|
370
510
|
requestUid: string;
|
|
@@ -378,10 +518,14 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
378
518
|
value: string;
|
|
379
519
|
key: string;
|
|
380
520
|
enabled: boolean;
|
|
521
|
+
type?: string | undefined;
|
|
522
|
+
default?: any;
|
|
381
523
|
description?: string | undefined;
|
|
524
|
+
enum?: string[] | undefined;
|
|
382
525
|
required?: boolean | undefined;
|
|
383
526
|
file?: File | undefined;
|
|
384
527
|
refUid?: string | undefined;
|
|
528
|
+
format?: string | undefined;
|
|
385
529
|
}[];
|
|
386
530
|
encoding: "form-data" | "urlencoded";
|
|
387
531
|
};
|
|
@@ -395,40 +539,56 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
395
539
|
name?: string | undefined;
|
|
396
540
|
parameters?: {
|
|
397
541
|
path?: {
|
|
542
|
+
type?: string | undefined;
|
|
398
543
|
value?: string | number | undefined;
|
|
544
|
+
default?: any;
|
|
399
545
|
description?: string | undefined;
|
|
400
546
|
key?: string | undefined;
|
|
547
|
+
enum?: string[] | undefined;
|
|
401
548
|
required?: boolean | undefined;
|
|
402
549
|
enabled?: boolean | undefined;
|
|
403
550
|
file?: File | undefined;
|
|
404
551
|
refUid?: string | undefined;
|
|
552
|
+
format?: string | undefined;
|
|
405
553
|
}[] | undefined;
|
|
406
554
|
query?: {
|
|
555
|
+
type?: string | undefined;
|
|
407
556
|
value?: string | number | undefined;
|
|
557
|
+
default?: any;
|
|
408
558
|
description?: string | undefined;
|
|
409
559
|
key?: string | undefined;
|
|
560
|
+
enum?: string[] | undefined;
|
|
410
561
|
required?: boolean | undefined;
|
|
411
562
|
enabled?: boolean | undefined;
|
|
412
563
|
file?: File | undefined;
|
|
413
564
|
refUid?: string | undefined;
|
|
565
|
+
format?: string | undefined;
|
|
414
566
|
}[] | undefined;
|
|
415
567
|
cookies?: {
|
|
568
|
+
type?: string | undefined;
|
|
416
569
|
value?: string | number | undefined;
|
|
570
|
+
default?: any;
|
|
417
571
|
description?: string | undefined;
|
|
418
572
|
key?: string | undefined;
|
|
573
|
+
enum?: string[] | undefined;
|
|
419
574
|
required?: boolean | undefined;
|
|
420
575
|
enabled?: boolean | undefined;
|
|
421
576
|
file?: File | undefined;
|
|
422
577
|
refUid?: string | undefined;
|
|
578
|
+
format?: string | undefined;
|
|
423
579
|
}[] | undefined;
|
|
424
580
|
headers?: {
|
|
581
|
+
type?: string | undefined;
|
|
425
582
|
value?: string | number | undefined;
|
|
583
|
+
default?: any;
|
|
426
584
|
description?: string | undefined;
|
|
427
585
|
key?: string | undefined;
|
|
586
|
+
enum?: string[] | undefined;
|
|
428
587
|
required?: boolean | undefined;
|
|
429
588
|
enabled?: boolean | undefined;
|
|
430
589
|
file?: File | undefined;
|
|
431
590
|
refUid?: string | undefined;
|
|
591
|
+
format?: string | undefined;
|
|
432
592
|
}[] | undefined;
|
|
433
593
|
} | undefined;
|
|
434
594
|
body?: {
|
|
@@ -438,13 +598,17 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
438
598
|
} | undefined;
|
|
439
599
|
formData?: {
|
|
440
600
|
value?: {
|
|
601
|
+
type?: string | undefined;
|
|
441
602
|
value?: string | number | undefined;
|
|
603
|
+
default?: any;
|
|
442
604
|
description?: string | undefined;
|
|
443
605
|
key?: string | undefined;
|
|
606
|
+
enum?: string[] | undefined;
|
|
444
607
|
required?: boolean | undefined;
|
|
445
608
|
enabled?: boolean | undefined;
|
|
446
609
|
file?: File | undefined;
|
|
447
610
|
refUid?: string | undefined;
|
|
611
|
+
format?: string | undefined;
|
|
448
612
|
}[] | undefined;
|
|
449
613
|
encoding?: "form-data" | "urlencoded" | undefined;
|
|
450
614
|
} | undefined;
|
|
@@ -465,37 +629,53 @@ export declare const createRequestExample: (payload: RequestExamplePayload) => {
|
|
|
465
629
|
value: string;
|
|
466
630
|
key: string;
|
|
467
631
|
enabled: boolean;
|
|
632
|
+
type?: string | undefined;
|
|
633
|
+
default?: any;
|
|
468
634
|
description?: string | undefined;
|
|
635
|
+
enum?: string[] | undefined;
|
|
469
636
|
required?: boolean | undefined;
|
|
470
637
|
file?: File | undefined;
|
|
471
638
|
refUid?: string | undefined;
|
|
639
|
+
format?: string | undefined;
|
|
472
640
|
}[];
|
|
473
641
|
query: {
|
|
474
642
|
value: string;
|
|
475
643
|
key: string;
|
|
476
644
|
enabled: boolean;
|
|
645
|
+
type?: string | undefined;
|
|
646
|
+
default?: any;
|
|
477
647
|
description?: string | undefined;
|
|
648
|
+
enum?: string[] | undefined;
|
|
478
649
|
required?: boolean | undefined;
|
|
479
650
|
file?: File | undefined;
|
|
480
651
|
refUid?: string | undefined;
|
|
652
|
+
format?: string | undefined;
|
|
481
653
|
}[];
|
|
482
654
|
cookies: {
|
|
483
655
|
value: string;
|
|
484
656
|
key: string;
|
|
485
657
|
enabled: boolean;
|
|
658
|
+
type?: string | undefined;
|
|
659
|
+
default?: any;
|
|
486
660
|
description?: string | undefined;
|
|
661
|
+
enum?: string[] | undefined;
|
|
487
662
|
required?: boolean | undefined;
|
|
488
663
|
file?: File | undefined;
|
|
489
664
|
refUid?: string | undefined;
|
|
665
|
+
format?: string | undefined;
|
|
490
666
|
}[];
|
|
491
667
|
headers: {
|
|
492
668
|
value: string;
|
|
493
669
|
key: string;
|
|
494
670
|
enabled: boolean;
|
|
671
|
+
type?: string | undefined;
|
|
672
|
+
default?: any;
|
|
495
673
|
description?: string | undefined;
|
|
674
|
+
enum?: string[] | undefined;
|
|
496
675
|
required?: boolean | undefined;
|
|
497
676
|
file?: File | undefined;
|
|
498
677
|
refUid?: string | undefined;
|
|
678
|
+
format?: string | undefined;
|
|
499
679
|
}[];
|
|
500
680
|
};
|
|
501
681
|
requestUid: string;
|
|
@@ -509,10 +689,14 @@ export declare const createRequestExample: (payload: RequestExamplePayload) => {
|
|
|
509
689
|
value: string;
|
|
510
690
|
key: string;
|
|
511
691
|
enabled: boolean;
|
|
692
|
+
type?: string | undefined;
|
|
693
|
+
default?: any;
|
|
512
694
|
description?: string | undefined;
|
|
695
|
+
enum?: string[] | undefined;
|
|
513
696
|
required?: boolean | undefined;
|
|
514
697
|
file?: File | undefined;
|
|
515
698
|
refUid?: string | undefined;
|
|
699
|
+
format?: string | undefined;
|
|
516
700
|
}[];
|
|
517
701
|
encoding: "form-data" | "urlencoded";
|
|
518
702
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-examples.d.ts","sourceRoot":"","sources":["../../../../src/entities/workspace/spec/request-examples.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,QAAA,MAAM,8BAA8B;;;;;;IAMlC,kFAAkF
|
|
1
|
+
{"version":3,"file":"request-examples.d.ts","sourceRoot":"","sources":["../../../../src/entities/workspace/spec/request-examples.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,QAAA,MAAM,8BAA8B;;;;;;IAMlC,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOlF,CAAA;AAEF,kFAAkF;AAClF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,8BAA8B,CACtC,CAAA;AACD,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,8BAA8B,CACtC,CAAA;AAED,8CAA8C;AAC9C,eAAO,MAAM,6BAA6B,YAC/B,8BAA8B;;;;;;;;;;;;CACwB,CAAA;AAEjE,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;gBAtBxB,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAAlF,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAAlF,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAAlF,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAAlF,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsElF,CAAA;AAEF,mDAAmD;AACnD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAExE,oCAAoC;AACpC,eAAO,MAAM,oBAAoB,YAAa,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIhE,CAAA"}
|
|
@@ -11,6 +11,10 @@ const requestExampleParametersSchema = z.object({
|
|
|
11
11
|
/** Params are linked to parents such as path params and global headers/cookies */
|
|
12
12
|
refUid: nanoidSchema.optional(),
|
|
13
13
|
required: z.boolean().optional(),
|
|
14
|
+
enum: z.array(z.string()).optional(),
|
|
15
|
+
type: z.string().optional(),
|
|
16
|
+
format: z.string().optional(),
|
|
17
|
+
default: z.any().optional(),
|
|
14
18
|
});
|
|
15
19
|
/** Create request example parameter helper */
|
|
16
20
|
const createRequestExampleParameter = (payload) => deepMerge(requestExampleParametersSchema.parse({}), payload);
|