@scalar/oas-utils 0.2.26 → 0.2.27
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 +6 -0
- package/dist/entities/workspace/consts/hot-keys.d.ts +13 -0
- package/dist/entities/workspace/consts/hot-keys.d.ts.map +1 -0
- package/dist/entities/workspace/consts/hot-keys.js +92 -0
- package/dist/entities/workspace/consts/index.d.ts +2 -0
- package/dist/entities/workspace/consts/index.d.ts.map +1 -0
- package/dist/entities/workspace/consts/index.js +1 -0
- package/dist/entities/workspace/spec/request-examples.d.ts +40 -40
- package/dist/entities/workspace/workspace.d.ts +60 -0
- package/dist/entities/workspace/workspace.d.ts.map +1 -1
- package/dist/entities/workspace/workspace.js +17 -0
- package/dist/spec-getters/getExampleFromSchema.d.ts.map +1 -1
- package/dist/spec-getters/getExampleFromSchema.js +15 -30
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Array of all of the events that we support
|
|
3
|
+
*/
|
|
4
|
+
export declare const HOTKEY_EVENT_NAMES: readonly ["closeModal"];
|
|
5
|
+
export type HotkeyEventName = (typeof HOTKEY_EVENT_NAMES)[number];
|
|
6
|
+
/**
|
|
7
|
+
* Array of all of the hotkeys that we support
|
|
8
|
+
*
|
|
9
|
+
* Space is a special case because its actually ' ' but we name it space here and will handle it separately
|
|
10
|
+
*/
|
|
11
|
+
export declare const KEYDOWN_KEYS: readonly ["Space", "Backspace", "Tab", "Enter", "Escape", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "*", "+", "-", ".", "/", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", ";", "=", ",", "-", ".", "/", "`", "[", "\\", "]", ""];
|
|
12
|
+
export type KeydownKey = (typeof KEYDOWN_KEYS)[number];
|
|
13
|
+
//# sourceMappingURL=hot-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hot-keys.d.ts","sourceRoot":"","sources":["../../../../src/entities/workspace/consts/hot-keys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,kBAAkB,yBAA0B,CAAA;AACzD,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEjE;;;;GAIG;AACH,eAAO,MAAM,YAAY,4bAgFf,CAAA;AACV,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Array of all of the events that we support
|
|
3
|
+
*/
|
|
4
|
+
const HOTKEY_EVENT_NAMES = ['closeModal'];
|
|
5
|
+
/**
|
|
6
|
+
* Array of all of the hotkeys that we support
|
|
7
|
+
*
|
|
8
|
+
* Space is a special case because its actually ' ' but we name it space here and will handle it separately
|
|
9
|
+
*/
|
|
10
|
+
const KEYDOWN_KEYS = [
|
|
11
|
+
'Space',
|
|
12
|
+
'Backspace',
|
|
13
|
+
'Tab',
|
|
14
|
+
'Enter',
|
|
15
|
+
'Escape',
|
|
16
|
+
'0',
|
|
17
|
+
'1',
|
|
18
|
+
'2',
|
|
19
|
+
'3',
|
|
20
|
+
'4',
|
|
21
|
+
'5',
|
|
22
|
+
'6',
|
|
23
|
+
'7',
|
|
24
|
+
'8',
|
|
25
|
+
'9',
|
|
26
|
+
'a',
|
|
27
|
+
'b',
|
|
28
|
+
'c',
|
|
29
|
+
'd',
|
|
30
|
+
'e',
|
|
31
|
+
'f',
|
|
32
|
+
'g',
|
|
33
|
+
'h',
|
|
34
|
+
'i',
|
|
35
|
+
'j',
|
|
36
|
+
'k',
|
|
37
|
+
'l',
|
|
38
|
+
'm',
|
|
39
|
+
'n',
|
|
40
|
+
'o',
|
|
41
|
+
'p',
|
|
42
|
+
'q',
|
|
43
|
+
'r',
|
|
44
|
+
's',
|
|
45
|
+
't',
|
|
46
|
+
'u',
|
|
47
|
+
'v',
|
|
48
|
+
'w',
|
|
49
|
+
'x',
|
|
50
|
+
'y',
|
|
51
|
+
'z',
|
|
52
|
+
'0',
|
|
53
|
+
'1',
|
|
54
|
+
'2',
|
|
55
|
+
'3',
|
|
56
|
+
'4',
|
|
57
|
+
'5',
|
|
58
|
+
'6',
|
|
59
|
+
'7',
|
|
60
|
+
'8',
|
|
61
|
+
'9',
|
|
62
|
+
'*',
|
|
63
|
+
'+',
|
|
64
|
+
'-',
|
|
65
|
+
'.',
|
|
66
|
+
'/',
|
|
67
|
+
'F1',
|
|
68
|
+
'F2',
|
|
69
|
+
'F3',
|
|
70
|
+
'F4',
|
|
71
|
+
'F5',
|
|
72
|
+
'F6',
|
|
73
|
+
'F7',
|
|
74
|
+
'F8',
|
|
75
|
+
'F9',
|
|
76
|
+
'F10',
|
|
77
|
+
'F11',
|
|
78
|
+
'F12',
|
|
79
|
+
';',
|
|
80
|
+
'=',
|
|
81
|
+
',',
|
|
82
|
+
'-',
|
|
83
|
+
'.',
|
|
84
|
+
'/',
|
|
85
|
+
'`',
|
|
86
|
+
'[',
|
|
87
|
+
'\\',
|
|
88
|
+
']',
|
|
89
|
+
'',
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
export { HOTKEY_EVENT_NAMES, KEYDOWN_KEYS };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/entities/workspace/consts/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HOTKEY_EVENT_NAMES, KEYDOWN_KEYS } from './hot-keys.js';
|
|
@@ -24,8 +24,8 @@ declare const requestExampleParametersSchema: z.ZodObject<{
|
|
|
24
24
|
maximum?: number | undefined;
|
|
25
25
|
description?: string | undefined;
|
|
26
26
|
default?: any;
|
|
27
|
-
enum?: string[] | undefined;
|
|
28
27
|
required?: boolean | undefined;
|
|
28
|
+
enum?: string[] | undefined;
|
|
29
29
|
file?: File | undefined;
|
|
30
30
|
refUid?: string | undefined;
|
|
31
31
|
format?: string | undefined;
|
|
@@ -37,9 +37,9 @@ declare const requestExampleParametersSchema: z.ZodObject<{
|
|
|
37
37
|
value?: string | number | undefined;
|
|
38
38
|
description?: string | undefined;
|
|
39
39
|
default?: any;
|
|
40
|
+
required?: boolean | undefined;
|
|
40
41
|
key?: string | undefined;
|
|
41
42
|
enum?: string[] | undefined;
|
|
42
|
-
required?: boolean | undefined;
|
|
43
43
|
enabled?: boolean | undefined;
|
|
44
44
|
file?: File | undefined;
|
|
45
45
|
refUid?: string | undefined;
|
|
@@ -59,8 +59,8 @@ export declare const createRequestExampleParameter: (payload: RequestExamplePara
|
|
|
59
59
|
maximum?: number | undefined;
|
|
60
60
|
description?: string | undefined;
|
|
61
61
|
default?: any;
|
|
62
|
-
enum?: string[] | undefined;
|
|
63
62
|
required?: boolean | undefined;
|
|
63
|
+
enum?: string[] | undefined;
|
|
64
64
|
file?: File | undefined;
|
|
65
65
|
refUid?: string | undefined;
|
|
66
66
|
format?: string | undefined;
|
|
@@ -109,8 +109,8 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
109
109
|
maximum?: number | undefined;
|
|
110
110
|
description?: string | undefined;
|
|
111
111
|
default?: any;
|
|
112
|
-
enum?: string[] | undefined;
|
|
113
112
|
required?: boolean | undefined;
|
|
113
|
+
enum?: string[] | undefined;
|
|
114
114
|
file?: File | undefined;
|
|
115
115
|
refUid?: string | undefined;
|
|
116
116
|
format?: string | undefined;
|
|
@@ -122,9 +122,9 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
122
122
|
value?: string | number | undefined;
|
|
123
123
|
description?: string | undefined;
|
|
124
124
|
default?: any;
|
|
125
|
+
required?: boolean | undefined;
|
|
125
126
|
key?: string | undefined;
|
|
126
127
|
enum?: string[] | undefined;
|
|
127
|
-
required?: boolean | undefined;
|
|
128
128
|
enabled?: boolean | undefined;
|
|
129
129
|
file?: File | undefined;
|
|
130
130
|
refUid?: string | undefined;
|
|
@@ -141,8 +141,8 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
141
141
|
maximum?: number | undefined;
|
|
142
142
|
description?: string | undefined;
|
|
143
143
|
default?: any;
|
|
144
|
-
enum?: string[] | undefined;
|
|
145
144
|
required?: boolean | undefined;
|
|
145
|
+
enum?: string[] | undefined;
|
|
146
146
|
file?: File | undefined;
|
|
147
147
|
refUid?: string | undefined;
|
|
148
148
|
format?: string | undefined;
|
|
@@ -157,9 +157,9 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
157
157
|
value?: string | number | undefined;
|
|
158
158
|
description?: string | undefined;
|
|
159
159
|
default?: any;
|
|
160
|
+
required?: boolean | undefined;
|
|
160
161
|
key?: string | undefined;
|
|
161
162
|
enum?: string[] | undefined;
|
|
162
|
-
required?: boolean | undefined;
|
|
163
163
|
enabled?: boolean | undefined;
|
|
164
164
|
file?: File | undefined;
|
|
165
165
|
refUid?: string | undefined;
|
|
@@ -185,8 +185,8 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
185
185
|
maximum?: number | undefined;
|
|
186
186
|
description?: string | undefined;
|
|
187
187
|
default?: any;
|
|
188
|
-
enum?: string[] | undefined;
|
|
189
188
|
required?: boolean | undefined;
|
|
189
|
+
enum?: string[] | undefined;
|
|
190
190
|
file?: File | undefined;
|
|
191
191
|
refUid?: string | undefined;
|
|
192
192
|
format?: string | undefined;
|
|
@@ -209,9 +209,9 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
209
209
|
value?: string | number | undefined;
|
|
210
210
|
description?: string | undefined;
|
|
211
211
|
default?: any;
|
|
212
|
+
required?: boolean | undefined;
|
|
212
213
|
key?: string | undefined;
|
|
213
214
|
enum?: string[] | undefined;
|
|
214
|
-
required?: boolean | undefined;
|
|
215
215
|
enabled?: boolean | undefined;
|
|
216
216
|
file?: File | undefined;
|
|
217
217
|
refUid?: string | undefined;
|
|
@@ -249,8 +249,8 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
249
249
|
maximum?: number | undefined;
|
|
250
250
|
description?: string | undefined;
|
|
251
251
|
default?: any;
|
|
252
|
-
enum?: string[] | undefined;
|
|
253
252
|
required?: boolean | undefined;
|
|
253
|
+
enum?: string[] | undefined;
|
|
254
254
|
file?: File | undefined;
|
|
255
255
|
refUid?: string | undefined;
|
|
256
256
|
format?: string | undefined;
|
|
@@ -262,9 +262,9 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
262
262
|
value?: string | number | undefined;
|
|
263
263
|
description?: string | undefined;
|
|
264
264
|
default?: any;
|
|
265
|
+
required?: boolean | undefined;
|
|
265
266
|
key?: string | undefined;
|
|
266
267
|
enum?: string[] | undefined;
|
|
267
|
-
required?: boolean | undefined;
|
|
268
268
|
enabled?: boolean | undefined;
|
|
269
269
|
file?: File | undefined;
|
|
270
270
|
refUid?: string | undefined;
|
|
@@ -296,8 +296,8 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
296
296
|
maximum?: number | undefined;
|
|
297
297
|
description?: string | undefined;
|
|
298
298
|
default?: any;
|
|
299
|
-
enum?: string[] | undefined;
|
|
300
299
|
required?: boolean | undefined;
|
|
300
|
+
enum?: string[] | undefined;
|
|
301
301
|
file?: File | undefined;
|
|
302
302
|
refUid?: string | undefined;
|
|
303
303
|
format?: string | undefined;
|
|
@@ -309,9 +309,9 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
309
309
|
value?: string | number | undefined;
|
|
310
310
|
description?: string | undefined;
|
|
311
311
|
default?: any;
|
|
312
|
+
required?: boolean | undefined;
|
|
312
313
|
key?: string | undefined;
|
|
313
314
|
enum?: string[] | undefined;
|
|
314
|
-
required?: boolean | undefined;
|
|
315
315
|
enabled?: boolean | undefined;
|
|
316
316
|
file?: File | undefined;
|
|
317
317
|
refUid?: string | undefined;
|
|
@@ -343,8 +343,8 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
343
343
|
maximum?: number | undefined;
|
|
344
344
|
description?: string | undefined;
|
|
345
345
|
default?: any;
|
|
346
|
-
enum?: string[] | undefined;
|
|
347
346
|
required?: boolean | undefined;
|
|
347
|
+
enum?: string[] | undefined;
|
|
348
348
|
file?: File | undefined;
|
|
349
349
|
refUid?: string | undefined;
|
|
350
350
|
format?: string | undefined;
|
|
@@ -356,9 +356,9 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
356
356
|
value?: string | number | undefined;
|
|
357
357
|
description?: string | undefined;
|
|
358
358
|
default?: any;
|
|
359
|
+
required?: boolean | undefined;
|
|
359
360
|
key?: string | undefined;
|
|
360
361
|
enum?: string[] | undefined;
|
|
361
|
-
required?: boolean | undefined;
|
|
362
362
|
enabled?: boolean | undefined;
|
|
363
363
|
file?: File | undefined;
|
|
364
364
|
refUid?: string | undefined;
|
|
@@ -390,8 +390,8 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
390
390
|
maximum?: number | undefined;
|
|
391
391
|
description?: string | undefined;
|
|
392
392
|
default?: any;
|
|
393
|
-
enum?: string[] | undefined;
|
|
394
393
|
required?: boolean | undefined;
|
|
394
|
+
enum?: string[] | undefined;
|
|
395
395
|
file?: File | undefined;
|
|
396
396
|
refUid?: string | undefined;
|
|
397
397
|
format?: string | undefined;
|
|
@@ -403,9 +403,9 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
403
403
|
value?: string | number | undefined;
|
|
404
404
|
description?: string | undefined;
|
|
405
405
|
default?: any;
|
|
406
|
+
required?: boolean | undefined;
|
|
406
407
|
key?: string | undefined;
|
|
407
408
|
enum?: string[] | undefined;
|
|
408
|
-
required?: boolean | undefined;
|
|
409
409
|
enabled?: boolean | undefined;
|
|
410
410
|
file?: File | undefined;
|
|
411
411
|
refUid?: string | undefined;
|
|
@@ -422,8 +422,8 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
422
422
|
maximum?: number | undefined;
|
|
423
423
|
description?: string | undefined;
|
|
424
424
|
default?: any;
|
|
425
|
-
enum?: string[] | undefined;
|
|
426
425
|
required?: boolean | undefined;
|
|
426
|
+
enum?: string[] | undefined;
|
|
427
427
|
file?: File | undefined;
|
|
428
428
|
refUid?: string | undefined;
|
|
429
429
|
format?: string | undefined;
|
|
@@ -438,8 +438,8 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
438
438
|
maximum?: number | undefined;
|
|
439
439
|
description?: string | undefined;
|
|
440
440
|
default?: any;
|
|
441
|
-
enum?: string[] | undefined;
|
|
442
441
|
required?: boolean | undefined;
|
|
442
|
+
enum?: string[] | undefined;
|
|
443
443
|
file?: File | undefined;
|
|
444
444
|
refUid?: string | undefined;
|
|
445
445
|
format?: string | undefined;
|
|
@@ -454,8 +454,8 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
454
454
|
maximum?: number | undefined;
|
|
455
455
|
description?: string | undefined;
|
|
456
456
|
default?: any;
|
|
457
|
-
enum?: string[] | undefined;
|
|
458
457
|
required?: boolean | undefined;
|
|
458
|
+
enum?: string[] | undefined;
|
|
459
459
|
file?: File | undefined;
|
|
460
460
|
refUid?: string | undefined;
|
|
461
461
|
format?: string | undefined;
|
|
@@ -470,8 +470,8 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
470
470
|
maximum?: number | undefined;
|
|
471
471
|
description?: string | undefined;
|
|
472
472
|
default?: any;
|
|
473
|
-
enum?: string[] | undefined;
|
|
474
473
|
required?: boolean | undefined;
|
|
474
|
+
enum?: string[] | undefined;
|
|
475
475
|
file?: File | undefined;
|
|
476
476
|
refUid?: string | undefined;
|
|
477
477
|
format?: string | undefined;
|
|
@@ -485,9 +485,9 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
485
485
|
value?: string | number | undefined;
|
|
486
486
|
description?: string | undefined;
|
|
487
487
|
default?: any;
|
|
488
|
+
required?: boolean | undefined;
|
|
488
489
|
key?: string | undefined;
|
|
489
490
|
enum?: string[] | undefined;
|
|
490
|
-
required?: boolean | undefined;
|
|
491
491
|
enabled?: boolean | undefined;
|
|
492
492
|
file?: File | undefined;
|
|
493
493
|
refUid?: string | undefined;
|
|
@@ -501,9 +501,9 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
501
501
|
value?: string | number | undefined;
|
|
502
502
|
description?: string | undefined;
|
|
503
503
|
default?: any;
|
|
504
|
+
required?: boolean | undefined;
|
|
504
505
|
key?: string | undefined;
|
|
505
506
|
enum?: string[] | undefined;
|
|
506
|
-
required?: boolean | undefined;
|
|
507
507
|
enabled?: boolean | undefined;
|
|
508
508
|
file?: File | undefined;
|
|
509
509
|
refUid?: string | undefined;
|
|
@@ -517,9 +517,9 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
517
517
|
value?: string | number | undefined;
|
|
518
518
|
description?: string | undefined;
|
|
519
519
|
default?: any;
|
|
520
|
+
required?: boolean | undefined;
|
|
520
521
|
key?: string | undefined;
|
|
521
522
|
enum?: string[] | undefined;
|
|
522
|
-
required?: boolean | undefined;
|
|
523
523
|
enabled?: boolean | undefined;
|
|
524
524
|
file?: File | undefined;
|
|
525
525
|
refUid?: string | undefined;
|
|
@@ -533,9 +533,9 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
533
533
|
value?: string | number | undefined;
|
|
534
534
|
description?: string | undefined;
|
|
535
535
|
default?: any;
|
|
536
|
+
required?: boolean | undefined;
|
|
536
537
|
key?: string | undefined;
|
|
537
538
|
enum?: string[] | undefined;
|
|
538
|
-
required?: boolean | undefined;
|
|
539
539
|
enabled?: boolean | undefined;
|
|
540
540
|
file?: File | undefined;
|
|
541
541
|
refUid?: string | undefined;
|
|
@@ -558,8 +558,8 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
558
558
|
maximum?: number | undefined;
|
|
559
559
|
description?: string | undefined;
|
|
560
560
|
default?: any;
|
|
561
|
-
enum?: string[] | undefined;
|
|
562
561
|
required?: boolean | undefined;
|
|
562
|
+
enum?: string[] | undefined;
|
|
563
563
|
file?: File | undefined;
|
|
564
564
|
refUid?: string | undefined;
|
|
565
565
|
format?: string | undefined;
|
|
@@ -574,8 +574,8 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
574
574
|
maximum?: number | undefined;
|
|
575
575
|
description?: string | undefined;
|
|
576
576
|
default?: any;
|
|
577
|
-
enum?: string[] | undefined;
|
|
578
577
|
required?: boolean | undefined;
|
|
578
|
+
enum?: string[] | undefined;
|
|
579
579
|
file?: File | undefined;
|
|
580
580
|
refUid?: string | undefined;
|
|
581
581
|
format?: string | undefined;
|
|
@@ -590,8 +590,8 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
590
590
|
maximum?: number | undefined;
|
|
591
591
|
description?: string | undefined;
|
|
592
592
|
default?: any;
|
|
593
|
-
enum?: string[] | undefined;
|
|
594
593
|
required?: boolean | undefined;
|
|
594
|
+
enum?: string[] | undefined;
|
|
595
595
|
file?: File | undefined;
|
|
596
596
|
refUid?: string | undefined;
|
|
597
597
|
format?: string | undefined;
|
|
@@ -606,8 +606,8 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
606
606
|
maximum?: number | undefined;
|
|
607
607
|
description?: string | undefined;
|
|
608
608
|
default?: any;
|
|
609
|
-
enum?: string[] | undefined;
|
|
610
609
|
required?: boolean | undefined;
|
|
610
|
+
enum?: string[] | undefined;
|
|
611
611
|
file?: File | undefined;
|
|
612
612
|
refUid?: string | undefined;
|
|
613
613
|
format?: string | undefined;
|
|
@@ -630,8 +630,8 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
630
630
|
maximum?: number | undefined;
|
|
631
631
|
description?: string | undefined;
|
|
632
632
|
default?: any;
|
|
633
|
-
enum?: string[] | undefined;
|
|
634
633
|
required?: boolean | undefined;
|
|
634
|
+
enum?: string[] | undefined;
|
|
635
635
|
file?: File | undefined;
|
|
636
636
|
refUid?: string | undefined;
|
|
637
637
|
format?: string | undefined;
|
|
@@ -656,9 +656,9 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
656
656
|
value?: string | number | undefined;
|
|
657
657
|
description?: string | undefined;
|
|
658
658
|
default?: any;
|
|
659
|
+
required?: boolean | undefined;
|
|
659
660
|
key?: string | undefined;
|
|
660
661
|
enum?: string[] | undefined;
|
|
661
|
-
required?: boolean | undefined;
|
|
662
662
|
enabled?: boolean | undefined;
|
|
663
663
|
file?: File | undefined;
|
|
664
664
|
refUid?: string | undefined;
|
|
@@ -672,9 +672,9 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
672
672
|
value?: string | number | undefined;
|
|
673
673
|
description?: string | undefined;
|
|
674
674
|
default?: any;
|
|
675
|
+
required?: boolean | undefined;
|
|
675
676
|
key?: string | undefined;
|
|
676
677
|
enum?: string[] | undefined;
|
|
677
|
-
required?: boolean | undefined;
|
|
678
678
|
enabled?: boolean | undefined;
|
|
679
679
|
file?: File | undefined;
|
|
680
680
|
refUid?: string | undefined;
|
|
@@ -688,9 +688,9 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
688
688
|
value?: string | number | undefined;
|
|
689
689
|
description?: string | undefined;
|
|
690
690
|
default?: any;
|
|
691
|
+
required?: boolean | undefined;
|
|
691
692
|
key?: string | undefined;
|
|
692
693
|
enum?: string[] | undefined;
|
|
693
|
-
required?: boolean | undefined;
|
|
694
694
|
enabled?: boolean | undefined;
|
|
695
695
|
file?: File | undefined;
|
|
696
696
|
refUid?: string | undefined;
|
|
@@ -704,9 +704,9 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
704
704
|
value?: string | number | undefined;
|
|
705
705
|
description?: string | undefined;
|
|
706
706
|
default?: any;
|
|
707
|
+
required?: boolean | undefined;
|
|
707
708
|
key?: string | undefined;
|
|
708
709
|
enum?: string[] | undefined;
|
|
709
|
-
required?: boolean | undefined;
|
|
710
710
|
enabled?: boolean | undefined;
|
|
711
711
|
file?: File | undefined;
|
|
712
712
|
refUid?: string | undefined;
|
|
@@ -727,9 +727,9 @@ declare const requestExampleSchema: z.ZodObject<{
|
|
|
727
727
|
value?: string | number | undefined;
|
|
728
728
|
description?: string | undefined;
|
|
729
729
|
default?: any;
|
|
730
|
+
required?: boolean | undefined;
|
|
730
731
|
key?: string | undefined;
|
|
731
732
|
enum?: string[] | undefined;
|
|
732
|
-
required?: boolean | undefined;
|
|
733
733
|
enabled?: boolean | undefined;
|
|
734
734
|
file?: File | undefined;
|
|
735
735
|
refUid?: string | undefined;
|
|
@@ -761,8 +761,8 @@ export declare const createRequestExample: (payload: RequestExamplePayload) => {
|
|
|
761
761
|
maximum?: number | undefined;
|
|
762
762
|
description?: string | undefined;
|
|
763
763
|
default?: any;
|
|
764
|
-
enum?: string[] | undefined;
|
|
765
764
|
required?: boolean | undefined;
|
|
765
|
+
enum?: string[] | undefined;
|
|
766
766
|
file?: File | undefined;
|
|
767
767
|
refUid?: string | undefined;
|
|
768
768
|
format?: string | undefined;
|
|
@@ -777,8 +777,8 @@ export declare const createRequestExample: (payload: RequestExamplePayload) => {
|
|
|
777
777
|
maximum?: number | undefined;
|
|
778
778
|
description?: string | undefined;
|
|
779
779
|
default?: any;
|
|
780
|
-
enum?: string[] | undefined;
|
|
781
780
|
required?: boolean | undefined;
|
|
781
|
+
enum?: string[] | undefined;
|
|
782
782
|
file?: File | undefined;
|
|
783
783
|
refUid?: string | undefined;
|
|
784
784
|
format?: string | undefined;
|
|
@@ -793,8 +793,8 @@ export declare const createRequestExample: (payload: RequestExamplePayload) => {
|
|
|
793
793
|
maximum?: number | undefined;
|
|
794
794
|
description?: string | undefined;
|
|
795
795
|
default?: any;
|
|
796
|
-
enum?: string[] | undefined;
|
|
797
796
|
required?: boolean | undefined;
|
|
797
|
+
enum?: string[] | undefined;
|
|
798
798
|
file?: File | undefined;
|
|
799
799
|
refUid?: string | undefined;
|
|
800
800
|
format?: string | undefined;
|
|
@@ -809,8 +809,8 @@ export declare const createRequestExample: (payload: RequestExamplePayload) => {
|
|
|
809
809
|
maximum?: number | undefined;
|
|
810
810
|
description?: string | undefined;
|
|
811
811
|
default?: any;
|
|
812
|
-
enum?: string[] | undefined;
|
|
813
812
|
required?: boolean | undefined;
|
|
813
|
+
enum?: string[] | undefined;
|
|
814
814
|
file?: File | undefined;
|
|
815
815
|
refUid?: string | undefined;
|
|
816
816
|
format?: string | undefined;
|
|
@@ -833,8 +833,8 @@ export declare const createRequestExample: (payload: RequestExamplePayload) => {
|
|
|
833
833
|
maximum?: number | undefined;
|
|
834
834
|
description?: string | undefined;
|
|
835
835
|
default?: any;
|
|
836
|
-
enum?: string[] | undefined;
|
|
837
836
|
required?: boolean | undefined;
|
|
837
|
+
enum?: string[] | undefined;
|
|
838
838
|
file?: File | undefined;
|
|
839
839
|
refUid?: string | undefined;
|
|
840
840
|
format?: string | undefined;
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
declare const modifier: z.ZodDefault<z.ZodOptional<z.ZodEnum<["Meta", "Control", "Shift", "Alt", "default"]>>>;
|
|
3
|
+
export type HotKeyModifier = z.infer<typeof modifier>;
|
|
4
|
+
declare const hotKeys: z.ZodRecord<z.ZodEnum<["Space", "Backspace", "Tab", "Enter", "Escape", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "*", "+", "-", ".", "/", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", ";", "=", ",", "-", ".", "/", "`", "[", "\\", "]", ""]>, z.ZodObject<{
|
|
5
|
+
modifier: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
event: z.ZodEnum<["closeModal"]>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
event: "closeModal";
|
|
9
|
+
modifier?: boolean | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
event: "closeModal";
|
|
12
|
+
modifier?: boolean | undefined;
|
|
13
|
+
}>>;
|
|
14
|
+
export type HotKeyConfig = z.infer<typeof hotKeys>;
|
|
2
15
|
declare const workspaceSchema: z.ZodObject<{
|
|
3
16
|
uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
4
17
|
name: z.ZodDefault<z.ZodString>;
|
|
@@ -10,6 +23,32 @@ declare const workspaceSchema: z.ZodObject<{
|
|
|
10
23
|
collectionUids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
11
24
|
/** List of all environment uids in a given workspace */
|
|
12
25
|
environmentUids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
26
|
+
/** Customize hotkeys */
|
|
27
|
+
hotKeyConfig: z.ZodOptional<z.ZodObject<{
|
|
28
|
+
modifier: z.ZodDefault<z.ZodOptional<z.ZodEnum<["Meta", "Control", "Shift", "Alt", "default"]>>>;
|
|
29
|
+
hotKeys: z.ZodOptional<z.ZodRecord<z.ZodEnum<["Space", "Backspace", "Tab", "Enter", "Escape", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "*", "+", "-", ".", "/", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", ";", "=", ",", "-", ".", "/", "`", "[", "\\", "]", ""]>, z.ZodObject<{
|
|
30
|
+
modifier: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
event: z.ZodEnum<["closeModal"]>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
event: "closeModal";
|
|
34
|
+
modifier?: boolean | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
event: "closeModal";
|
|
37
|
+
modifier?: boolean | undefined;
|
|
38
|
+
}>>>;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
modifier: "default" | "Meta" | "Control" | "Shift" | "Alt";
|
|
41
|
+
hotKeys?: Partial<Record<"" | "0" | "/" | "[" | "1" | "2" | "Space" | "Backspace" | "Tab" | "Enter" | "Escape" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "*" | "+" | "-" | "." | "F1" | "F2" | "F3" | "F4" | "F5" | "F6" | "F7" | "F8" | "F9" | "F10" | "F11" | "F12" | ";" | "=" | "," | "`" | "\\" | "]", {
|
|
42
|
+
event: "closeModal";
|
|
43
|
+
modifier?: boolean | undefined;
|
|
44
|
+
}>> | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
modifier?: "default" | "Meta" | "Control" | "Shift" | "Alt" | undefined;
|
|
47
|
+
hotKeys?: Partial<Record<"" | "0" | "/" | "[" | "1" | "2" | "Space" | "Backspace" | "Tab" | "Enter" | "Escape" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "*" | "+" | "-" | "." | "F1" | "F2" | "F3" | "F4" | "F5" | "F6" | "F7" | "F8" | "F9" | "F10" | "F11" | "F12" | ";" | "=" | "," | "`" | "\\" | "]", {
|
|
48
|
+
event: "closeModal";
|
|
49
|
+
modifier?: boolean | undefined;
|
|
50
|
+
}>> | undefined;
|
|
51
|
+
}>>;
|
|
13
52
|
/** List of all cookie uids in a given workspace */
|
|
14
53
|
cookieUids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
15
54
|
/** Workspace level proxy for all requests to be sent through */
|
|
@@ -25,6 +64,13 @@ declare const workspaceSchema: z.ZodObject<{
|
|
|
25
64
|
environmentUids: string[];
|
|
26
65
|
cookieUids: string[];
|
|
27
66
|
themeId: "default" | "alternate" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "mars" | "none";
|
|
67
|
+
hotKeyConfig?: {
|
|
68
|
+
modifier: "default" | "Meta" | "Control" | "Shift" | "Alt";
|
|
69
|
+
hotKeys?: Partial<Record<"" | "0" | "/" | "[" | "1" | "2" | "Space" | "Backspace" | "Tab" | "Enter" | "Escape" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "*" | "+" | "-" | "." | "F1" | "F2" | "F3" | "F4" | "F5" | "F6" | "F7" | "F8" | "F9" | "F10" | "F11" | "F12" | ";" | "=" | "," | "`" | "\\" | "]", {
|
|
70
|
+
event: "closeModal";
|
|
71
|
+
modifier?: boolean | undefined;
|
|
72
|
+
}>> | undefined;
|
|
73
|
+
} | undefined;
|
|
28
74
|
proxyUrl?: string | undefined;
|
|
29
75
|
}, {
|
|
30
76
|
uid?: string | undefined;
|
|
@@ -33,6 +79,13 @@ declare const workspaceSchema: z.ZodObject<{
|
|
|
33
79
|
isReadOnly?: boolean | undefined;
|
|
34
80
|
collectionUids?: string[] | undefined;
|
|
35
81
|
environmentUids?: string[] | undefined;
|
|
82
|
+
hotKeyConfig?: {
|
|
83
|
+
modifier?: "default" | "Meta" | "Control" | "Shift" | "Alt" | undefined;
|
|
84
|
+
hotKeys?: Partial<Record<"" | "0" | "/" | "[" | "1" | "2" | "Space" | "Backspace" | "Tab" | "Enter" | "Escape" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "*" | "+" | "-" | "." | "F1" | "F2" | "F3" | "F4" | "F5" | "F6" | "F7" | "F8" | "F9" | "F10" | "F11" | "F12" | ";" | "=" | "," | "`" | "\\" | "]", {
|
|
85
|
+
event: "closeModal";
|
|
86
|
+
modifier?: boolean | undefined;
|
|
87
|
+
}>> | undefined;
|
|
88
|
+
} | undefined;
|
|
36
89
|
cookieUids?: string[] | undefined;
|
|
37
90
|
proxyUrl?: string | undefined;
|
|
38
91
|
themeId?: "default" | "alternate" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "mars" | "none" | undefined;
|
|
@@ -49,6 +102,13 @@ export declare const createWorkspace: (payload: WorkspacePayload) => {
|
|
|
49
102
|
environmentUids: string[];
|
|
50
103
|
cookieUids: string[];
|
|
51
104
|
themeId: "default" | "alternate" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "mars" | "none";
|
|
105
|
+
hotKeyConfig?: {
|
|
106
|
+
modifier: "default" | "Meta" | "Control" | "Shift" | "Alt";
|
|
107
|
+
hotKeys?: Partial<Record<"" | "0" | "/" | "[" | "1" | "2" | "Space" | "Backspace" | "Tab" | "Enter" | "Escape" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "*" | "+" | "-" | "." | "F1" | "F2" | "F3" | "F4" | "F5" | "F6" | "F7" | "F8" | "F9" | "F10" | "F11" | "F12" | ";" | "=" | "," | "`" | "\\" | "]", {
|
|
108
|
+
event: "closeModal";
|
|
109
|
+
modifier?: boolean | undefined;
|
|
110
|
+
}>> | undefined;
|
|
111
|
+
} | undefined;
|
|
52
112
|
proxyUrl?: string | undefined;
|
|
53
113
|
};
|
|
54
114
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../../src/entities/workspace/workspace.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../../src/entities/workspace/workspace.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,QAAA,MAAM,QAAQ,wFAGO,CAAA;AAErB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA;AAErD,QAAA,MAAM,OAAO;;;;;;;;;GAMZ,CAAA;AACD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAA;AASlD,QAAA,MAAM,eAAe;;;IAGnB,4BAA4B;;IAE5B,6EAA6E;;IAE7E,uDAAuD;;IAEvD,wDAAwD;;IAExD,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;IAExB,mDAAmD;;IAEnD,gEAAgE;;IAEhE,oEAAoE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEpE,CAAA;AAEF,gCAAgC;AAChC,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AACvD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAE9D,eAAO,MAAM,eAAe,YAAa,gBAAgB;;;;;;;;;;;;;;;;;CACzB,CAAA"}
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import { themeIds } from '@scalar/themes';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { KEYDOWN_KEYS, HOTKEY_EVENT_NAMES } from './consts/hot-keys.js';
|
|
3
4
|
import { nanoidSchema } from './shared/utility.js';
|
|
4
5
|
|
|
6
|
+
const modifier = z
|
|
7
|
+
.enum(['Meta', 'Control', 'Shift', 'Alt', 'default'])
|
|
8
|
+
.optional()
|
|
9
|
+
.default('default');
|
|
10
|
+
const hotKeys = z.record(z.enum(KEYDOWN_KEYS), z.object({
|
|
11
|
+
modifier: z.boolean().optional(),
|
|
12
|
+
event: z.enum(HOTKEY_EVENT_NAMES),
|
|
13
|
+
}));
|
|
14
|
+
const hotKeyConfigSchema = z
|
|
15
|
+
.object({
|
|
16
|
+
modifier,
|
|
17
|
+
hotKeys: hotKeys.optional(),
|
|
18
|
+
})
|
|
19
|
+
.optional();
|
|
5
20
|
const workspaceSchema = z.object({
|
|
6
21
|
uid: nanoidSchema,
|
|
7
22
|
name: z.string().default('Default Workspace'),
|
|
@@ -13,6 +28,8 @@ const workspaceSchema = z.object({
|
|
|
13
28
|
collectionUids: z.array(z.string()).default([]),
|
|
14
29
|
/** List of all environment uids in a given workspace */
|
|
15
30
|
environmentUids: z.array(z.string()).default([]),
|
|
31
|
+
/** Customize hotkeys */
|
|
32
|
+
hotKeyConfig: hotKeyConfigSchema,
|
|
16
33
|
/** List of all cookie uids in a given workspace */
|
|
17
34
|
cookieUids: z.array(z.string()).default([]),
|
|
18
35
|
/** Workspace level proxy for all requests to be sent through */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getExampleFromSchema.d.ts","sourceRoot":"","sources":["../../src/spec-getters/getExampleFromSchema.ts"],"names":[],"mappings":"AAsCA;;GAEG;AACH,eAAO,MAAM,oBAAoB,WACvB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YACjB;IACR;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC/B;;OAEG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAA;CACzC,UACM,MAAM,iBACE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,SAC3B,MAAM,KACZ,
|
|
1
|
+
{"version":3,"file":"getExampleFromSchema.d.ts","sourceRoot":"","sources":["../../src/spec-getters/getExampleFromSchema.ts"],"names":[],"mappings":"AAsCA;;GAEG;AACH,eAAO,MAAM,oBAAoB,WACvB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YACjB;IACR;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC/B;;OAEG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAA;CACzC,UACM,MAAM,iBACE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,SAC3B,MAAM,KACZ,GAqQF,CAAA"}
|
|
@@ -105,6 +105,21 @@ const getExampleFromSchema = (schema, options, level = 0, parentSchema, name) =>
|
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
|
+
// Additional properties
|
|
109
|
+
if (schema.additionalProperties !== undefined) {
|
|
110
|
+
const anyTypeIsValid =
|
|
111
|
+
// true
|
|
112
|
+
schema.additionalProperties === true ||
|
|
113
|
+
// or an empty object {}
|
|
114
|
+
(typeof schema.additionalProperties === 'object' &&
|
|
115
|
+
!Object.keys(schema.additionalProperties).length);
|
|
116
|
+
if (anyTypeIsValid) {
|
|
117
|
+
response['ANY_ADDITIONAL_PROPERTY'] = 'anything';
|
|
118
|
+
}
|
|
119
|
+
else if (schema.additionalProperties !== false) {
|
|
120
|
+
response['ANY_ADDITIONAL_PROPERTY'] = getExampleFromSchema(schema.additionalProperties, options, level + 1);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
108
123
|
if (schema.anyOf !== undefined) {
|
|
109
124
|
Object.assign(response, getExampleFromSchema(schema.anyOf[0]), options, level + 1);
|
|
110
125
|
}
|
|
@@ -116,36 +131,6 @@ const getExampleFromSchema = (schema, options, level = 0, parentSchema, name) =>
|
|
|
116
131
|
.map((item) => getExampleFromSchema(item, options, level + 1, schema))
|
|
117
132
|
.filter((item) => item !== undefined));
|
|
118
133
|
}
|
|
119
|
-
// Merge additionalProperties
|
|
120
|
-
if (schema.additionalProperties !== undefined &&
|
|
121
|
-
schema.additionalProperties !== false) {
|
|
122
|
-
const additionalSchema = getExampleFromSchema(schema.additionalProperties, options, level + 1);
|
|
123
|
-
// Merge objects, but not arrays
|
|
124
|
-
if (additionalSchema &&
|
|
125
|
-
typeof additionalSchema === 'object' &&
|
|
126
|
-
!Array.isArray(additionalSchema)) {
|
|
127
|
-
return {
|
|
128
|
-
...response,
|
|
129
|
-
...getExampleFromSchema(schema.additionalProperties, options, level + 1),
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
// Add an example for nullable properties
|
|
133
|
-
if (additionalSchema === null) {
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
// Otherwise, add an example of key-value pair
|
|
137
|
-
const additionalProperties = getExampleFromSchema(schema.additionalProperties, {
|
|
138
|
-
...options,
|
|
139
|
-
// Let’s just add the additionalProperties, even if they are optional.
|
|
140
|
-
omitEmptyAndOptionalProperties: false,
|
|
141
|
-
}, level + 1);
|
|
142
|
-
return {
|
|
143
|
-
...response,
|
|
144
|
-
...(additionalProperties === undefined
|
|
145
|
-
? {}
|
|
146
|
-
: { '{{key}}': additionalProperties }),
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
134
|
return response;
|
|
150
135
|
}
|
|
151
136
|
// Array
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"specification",
|
|
17
17
|
"yaml"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.2.
|
|
19
|
+
"version": "0.2.27",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -75,6 +75,10 @@
|
|
|
75
75
|
"import": "./dist/entities/workspace/cookie/index.js",
|
|
76
76
|
"types": "./dist/entities/workspace/cookie/index.d.ts"
|
|
77
77
|
},
|
|
78
|
+
"./entities/workspace/consts": {
|
|
79
|
+
"import": "./dist/entities/workspace/consts/index.js",
|
|
80
|
+
"types": "./dist/entities/workspace/consts/index.d.ts"
|
|
81
|
+
},
|
|
78
82
|
"./entities/workspace/collection": {
|
|
79
83
|
"import": "./dist/entities/workspace/collection/index.js",
|
|
80
84
|
"types": "./dist/entities/workspace/collection/index.d.ts"
|