@kubb/plugin-oas 3.16.2 → 3.16.4

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.
Files changed (110) hide show
  1. package/dist/Oas-CuqAnIw-.js +60 -0
  2. package/dist/Oas-CuqAnIw-.js.map +1 -0
  3. package/dist/Oas-Cv_pyXRM.cjs +78 -0
  4. package/dist/Oas-Cv_pyXRM.cjs.map +1 -0
  5. package/dist/OperationGenerator-CgbXErhW.d.cts +900 -0
  6. package/dist/OperationGenerator-OtLcGk2y.d.ts +900 -0
  7. package/dist/Schema-DJshqHto.d.cts +38 -0
  8. package/dist/Schema-DOXGUW1m.d.ts +38 -0
  9. package/dist/SchemaGenerator-8205BXCp.cjs +942 -0
  10. package/dist/SchemaGenerator-8205BXCp.cjs.map +1 -0
  11. package/dist/SchemaGenerator-B8Io6kky.js +930 -0
  12. package/dist/SchemaGenerator-B8Io6kky.js.map +1 -0
  13. package/dist/SchemaMapper-BaZQKrQB.js +54 -0
  14. package/dist/SchemaMapper-BaZQKrQB.js.map +1 -0
  15. package/dist/SchemaMapper-BiagBQN4.d.cts +388 -0
  16. package/dist/SchemaMapper-C2J2d3o4.d.ts +388 -0
  17. package/dist/SchemaMapper-D8J0V9Pj.cjs +66 -0
  18. package/dist/SchemaMapper-D8J0V9Pj.cjs.map +1 -0
  19. package/dist/chunk-CUT6urMc.cjs +30 -0
  20. package/dist/components.cjs +4 -19
  21. package/dist/components.d.cts +42 -35
  22. package/dist/components.d.ts +42 -35
  23. package/dist/components.js +3 -3
  24. package/dist/generators-BhLMlRNk.js +137 -0
  25. package/dist/generators-BhLMlRNk.js.map +1 -0
  26. package/dist/generators-DLH2kvlh.cjs +155 -0
  27. package/dist/generators-DLH2kvlh.cjs.map +1 -0
  28. package/dist/generators.cjs +4 -13
  29. package/dist/generators.d.cts +5 -7
  30. package/dist/generators.d.ts +5 -7
  31. package/dist/generators.js +5 -5
  32. package/dist/getFooter-BChY2kC1.cjs +43 -0
  33. package/dist/getFooter-BChY2kC1.cjs.map +1 -0
  34. package/dist/getFooter-T7_pZ6f8.js +31 -0
  35. package/dist/getFooter-T7_pZ6f8.js.map +1 -0
  36. package/dist/getSchemas-D8mP129c.cjs +67 -0
  37. package/dist/getSchemas-D8mP129c.cjs.map +1 -0
  38. package/dist/getSchemas-WoSBIxG8.js +55 -0
  39. package/dist/getSchemas-WoSBIxG8.js.map +1 -0
  40. package/dist/hooks.cjs +213 -195
  41. package/dist/hooks.cjs.map +1 -1
  42. package/dist/hooks.d.cts +91 -86
  43. package/dist/hooks.d.ts +91 -86
  44. package/dist/hooks.js +212 -193
  45. package/dist/hooks.js.map +1 -1
  46. package/dist/index.cjs +280 -342
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.cts +7 -10
  49. package/dist/index.d.ts +7 -10
  50. package/dist/index.js +274 -318
  51. package/dist/index.js.map +1 -1
  52. package/dist/mocks.cjs +802 -737
  53. package/dist/mocks.cjs.map +1 -1
  54. package/dist/mocks.d.cts +12 -11
  55. package/dist/mocks.d.ts +12 -11
  56. package/dist/mocks.js +802 -735
  57. package/dist/mocks.js.map +1 -1
  58. package/dist/parseFromConfig-CMNGsef2.cjs +33 -0
  59. package/dist/parseFromConfig-CMNGsef2.cjs.map +1 -0
  60. package/dist/parseFromConfig-yAiFK03V.js +27 -0
  61. package/dist/parseFromConfig-yAiFK03V.js.map +1 -0
  62. package/dist/utils.cjs +58 -74
  63. package/dist/utils.cjs.map +1 -1
  64. package/dist/utils.d.cts +96 -42
  65. package/dist/utils.d.ts +96 -42
  66. package/dist/utils.js +47 -46
  67. package/dist/utils.js.map +1 -1
  68. package/package.json +26 -34
  69. package/src/components/Operation.tsx +1 -2
  70. package/src/mocks/schemas.ts +39 -0
  71. package/src/utils/getBanner.ts +5 -5
  72. package/src/utils/getFooter.ts +4 -4
  73. package/dist/OperationGenerator-C7NPZtOM.d.ts +0 -288
  74. package/dist/OperationGenerator-DJE2XQ83.d.cts +0 -288
  75. package/dist/Schema-AjebpeVY.d.ts +0 -32
  76. package/dist/Schema-M6983FL1.d.cts +0 -32
  77. package/dist/SchemaMapper-B21ZmWag.d.cts +0 -275
  78. package/dist/SchemaMapper-B21ZmWag.d.ts +0 -275
  79. package/dist/chunk-6S7YFY6F.js +0 -33
  80. package/dist/chunk-6S7YFY6F.js.map +0 -1
  81. package/dist/chunk-76E35IZ2.js +0 -56
  82. package/dist/chunk-76E35IZ2.js.map +0 -1
  83. package/dist/chunk-7RFNM43R.cjs +0 -41
  84. package/dist/chunk-7RFNM43R.cjs.map +0 -1
  85. package/dist/chunk-DTD4ZUDA.cjs +0 -36
  86. package/dist/chunk-DTD4ZUDA.cjs.map +0 -1
  87. package/dist/chunk-G3FDK7YW.js +0 -35
  88. package/dist/chunk-G3FDK7YW.js.map +0 -1
  89. package/dist/chunk-JNN4JPWK.js +0 -28
  90. package/dist/chunk-JNN4JPWK.js.map +0 -1
  91. package/dist/chunk-MBX66JAT.js +0 -93
  92. package/dist/chunk-MBX66JAT.js.map +0 -1
  93. package/dist/chunk-NC5PWNEF.js +0 -866
  94. package/dist/chunk-NC5PWNEF.js.map +0 -1
  95. package/dist/chunk-PORSNYI5.js +0 -47
  96. package/dist/chunk-PORSNYI5.js.map +0 -1
  97. package/dist/chunk-QJMOOF2A.cjs +0 -97
  98. package/dist/chunk-QJMOOF2A.cjs.map +0 -1
  99. package/dist/chunk-RKHCI3WI.cjs +0 -1002
  100. package/dist/chunk-RKHCI3WI.cjs.map +0 -1
  101. package/dist/chunk-YWMMI3MO.cjs +0 -59
  102. package/dist/chunk-YWMMI3MO.cjs.map +0 -1
  103. package/dist/chunk-Z2NREI4X.cjs +0 -32
  104. package/dist/chunk-Z2NREI4X.cjs.map +0 -1
  105. package/dist/chunk-ZVFL3NXX.cjs +0 -50
  106. package/dist/chunk-ZVFL3NXX.cjs.map +0 -1
  107. package/dist/components.cjs.map +0 -1
  108. package/dist/components.js.map +0 -1
  109. package/dist/generators.cjs.map +0 -1
  110. package/dist/generators.js.map +0 -1
package/dist/mocks.js CHANGED
@@ -1,742 +1,809 @@
1
- import { schemaKeywords } from './chunk-76E35IZ2.js';
1
+ import { schemaKeywords } from "./SchemaMapper-BaZQKrQB.js";
2
2
 
3
- // src/mocks/schemas.ts
4
- var basic = [
5
- {
6
- name: "any",
7
- schema: {
8
- keyword: schemaKeywords.any
9
- }
10
- },
11
- {
12
- name: "unknown",
13
- schema: {
14
- keyword: schemaKeywords.unknown
15
- }
16
- },
17
- {
18
- name: "string",
19
- schema: {
20
- keyword: schemaKeywords.string
21
- }
22
- },
23
- {
24
- name: "number",
25
- schema: {
26
- keyword: schemaKeywords.number
27
- }
28
- },
29
- {
30
- name: "integer",
31
- schema: {
32
- keyword: schemaKeywords.integer
33
- }
34
- },
35
- {
36
- name: "boolean",
37
- schema: {
38
- keyword: schemaKeywords.boolean
39
- }
40
- },
41
- {
42
- name: "primitiveDate",
43
- schema: {
44
- keyword: schemaKeywords.date,
45
- args: {
46
- type: "date"
47
- }
48
- }
49
- },
50
- {
51
- name: "date",
52
- schema: {
53
- keyword: schemaKeywords.date,
54
- args: {
55
- type: "string"
56
- }
57
- }
58
- },
59
- {
60
- name: "time",
61
- schema: {
62
- keyword: schemaKeywords.time,
63
- args: {
64
- type: "string"
65
- }
66
- }
67
- },
68
- {
69
- name: "stringOffset",
70
- schema: {
71
- keyword: schemaKeywords.datetime,
72
- args: {
73
- offset: true
74
- }
75
- }
76
- },
77
- {
78
- name: "stringLocal",
79
- schema: {
80
- keyword: schemaKeywords.datetime,
81
- args: {
82
- local: true
83
- }
84
- }
85
- },
86
- {
87
- name: "datetime",
88
- schema: {
89
- keyword: schemaKeywords.datetime,
90
- args: {
91
- offset: false
92
- }
93
- }
94
- },
95
- {
96
- name: "nullable",
97
- schema: {
98
- keyword: schemaKeywords.nullable
99
- }
100
- },
101
- {
102
- name: "undefined",
103
- schema: {
104
- keyword: schemaKeywords.undefined
105
- }
106
- },
107
- {
108
- name: "min",
109
- schema: {
110
- keyword: schemaKeywords.min,
111
- args: 2
112
- }
113
- },
114
- {
115
- name: "max",
116
- schema: {
117
- keyword: schemaKeywords.max,
118
- args: 2
119
- }
120
- },
121
- {
122
- name: "matchesReg",
123
- schema: {
124
- keyword: schemaKeywords.matches,
125
- args: "/node_modules/"
126
- // pure regexp
127
- }
128
- },
129
- {
130
- name: "matches",
131
- schema: {
132
- keyword: schemaKeywords.matches,
133
- args: "^[A-Z]{2}$"
134
- }
135
- },
136
- {
137
- name: "const",
138
- schema: {
139
- keyword: schemaKeywords.const,
140
- args: {
141
- name: "",
142
- value: "",
143
- format: schemaKeywords.string
144
- }
145
- }
146
- },
147
- {
148
- name: "ref",
149
- schema: {
150
- keyword: schemaKeywords.ref,
151
- args: {
152
- $ref: "$ref",
153
- name: "Pet",
154
- path: "./pet.ts",
155
- isImportable: true
156
- }
157
- }
158
- },
159
- {
160
- name: "enum",
161
- schema: {
162
- keyword: schemaKeywords.enum,
163
- args: {
164
- name: "enum",
165
- typeName: "Enum",
166
- asConst: false,
167
- items: [
168
- { name: "A", value: "A", format: schemaKeywords.string },
169
- { name: "B", value: "B", format: schemaKeywords.string },
170
- { name: "C", value: "C", format: schemaKeywords.string },
171
- { name: 2, value: 2, format: schemaKeywords.number }
172
- ]
173
- }
174
- }
175
- },
176
- {
177
- name: "enumLiteralBoolean",
178
- schema: {
179
- keyword: schemaKeywords.enum,
180
- args: {
181
- asConst: true,
182
- items: [
183
- {
184
- format: "boolean",
185
- name: "true",
186
- value: true
187
- },
188
- {
189
- format: "boolean",
190
- name: "false",
191
- value: false
192
- }
193
- ],
194
- name: "PetEnumLiteral",
195
- typeName: "PetEnumLiteral"
196
- }
197
- }
198
- },
199
- {
200
- name: "tuple",
201
- schema: {
202
- keyword: schemaKeywords.tuple,
203
- args: {
204
- items: []
205
- }
206
- }
207
- },
208
- {
209
- name: "tupleMulti",
210
- schema: {
211
- keyword: schemaKeywords.tuple,
212
- args: {
213
- items: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }]
214
- }
215
- }
216
- },
217
- {
218
- name: "array",
219
- schema: {
220
- keyword: schemaKeywords.array,
221
- args: {
222
- items: [
223
- {
224
- keyword: schemaKeywords.union,
225
- args: [{ keyword: schemaKeywords.number }, { keyword: schemaKeywords.string }]
226
- }
227
- ]
228
- }
229
- }
230
- },
231
- {
232
- name: "arrayEmpty",
233
- schema: {
234
- keyword: schemaKeywords.array,
235
- args: {
236
- items: []
237
- }
238
- }
239
- },
240
- {
241
- name: "arrayRef",
242
- schema: {
243
- keyword: schemaKeywords.array,
244
- args: {
245
- items: [
246
- {
247
- keyword: schemaKeywords.ref,
248
- args: { name: "Pet", $ref: "#component/schema/Pet", path: "./pet.ts", isImportable: true }
249
- }
250
- ]
251
- }
252
- }
253
- },
254
- {
255
- name: "arrayAdvanced",
256
- schema: {
257
- keyword: schemaKeywords.array,
258
- args: {
259
- items: [{ keyword: schemaKeywords.min, args: 1 }, { keyword: schemaKeywords.max, args: 10 }, { keyword: schemaKeywords.number }],
260
- min: 3,
261
- max: 10
262
- }
263
- }
264
- },
265
- {
266
- name: "arrayRegex",
267
- schema: {
268
- keyword: schemaKeywords.array,
269
- args: {
270
- items: [{ keyword: schemaKeywords.matches, args: "^[a-zA-Z0-9]{1,13}$" }],
271
- min: 3,
272
- max: 10
273
- }
274
- }
275
- },
276
- {
277
- name: "union",
278
- schema: {
279
- keyword: schemaKeywords.union,
280
- args: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }]
281
- }
282
- },
283
- {
284
- name: "unionOne",
285
- schema: {
286
- keyword: schemaKeywords.union,
287
- args: [{ keyword: schemaKeywords.string }]
288
- }
289
- },
290
- {
291
- name: "catchall",
292
- schema: {
293
- keyword: schemaKeywords.object,
294
- args: {
295
- properties: {},
296
- additionalProperties: [
297
- {
298
- keyword: schemaKeywords.ref,
299
- args: { name: "Pet", $ref: "#component/schema/Pet", path: "./Pet.ts", isImportable: true }
300
- }
301
- ]
302
- }
303
- }
304
- },
305
- {
306
- name: "and",
307
- schema: {
308
- keyword: schemaKeywords.and,
309
- args: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }]
310
- }
311
- },
312
- {
313
- name: "object",
314
- schema: {
315
- keyword: schemaKeywords.object,
316
- args: {
317
- properties: {
318
- firstName: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.min, args: 2 }],
319
- address: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.nullable }, { keyword: schemaKeywords.describe, args: '"Your address"' }]
320
- },
321
- additionalProperties: []
322
- }
323
- }
324
- },
325
- {
326
- name: "objectOptional",
327
- schema: {
328
- keyword: schemaKeywords.object,
329
- args: {
330
- properties: {
331
- firstName: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.optional }, { keyword: schemaKeywords.min, args: 2 }],
332
- address: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.nullable }, { keyword: schemaKeywords.describe, args: '"Your address"' }]
333
- },
334
- additionalProperties: []
335
- }
336
- }
337
- },
338
- {
339
- name: "objectArray",
340
- schema: {
341
- keyword: schemaKeywords.object,
342
- args: {
343
- properties: {
344
- ids: [
345
- {
346
- keyword: schemaKeywords.array,
347
- args: {
348
- items: [{ keyword: schemaKeywords.matches, args: "^[a-zA-Z0-9]{1,13}$" }],
349
- min: 3,
350
- max: 10
351
- }
352
- }
353
- ]
354
- },
355
- additionalProperties: []
356
- }
357
- }
358
- },
359
- {
360
- name: "objectDates",
361
- schema: {
362
- keyword: schemaKeywords.object,
363
- args: {
364
- properties: {
365
- dateTime: [{ keyword: schemaKeywords.datetime, args: { offset: true } }],
366
- date: [{ keyword: schemaKeywords.date, args: { type: "string" } }],
367
- time: [{ keyword: schemaKeywords.time, args: { type: "string" } }],
368
- nativeDate: [{ keyword: schemaKeywords.date, args: { type: "date" } }]
369
- },
370
- additionalProperties: []
371
- }
372
- }
373
- },
374
- {
375
- name: "objectAnd",
376
- schema: {
377
- keyword: schemaKeywords.object,
378
- args: {
379
- properties: {
380
- firstName: [
381
- { keyword: schemaKeywords.deprecated },
382
- { keyword: schemaKeywords.default, args: "test" },
383
- {
384
- keyword: schemaKeywords.min,
385
- args: 2
386
- },
387
- {
388
- keyword: schemaKeywords.string
389
- }
390
- ],
391
- age: [
392
- { keyword: schemaKeywords.example, args: "2" },
393
- { keyword: schemaKeywords.default, args: 2 },
394
- {
395
- keyword: schemaKeywords.min,
396
- args: 3
397
- },
398
- {
399
- keyword: schemaKeywords.number
400
- }
401
- ],
402
- address: [
403
- {
404
- keyword: schemaKeywords.and,
405
- args: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }]
406
- },
407
- { keyword: schemaKeywords.nullable },
408
- { keyword: schemaKeywords.describe, args: "Your address" }
409
- ]
410
- },
411
- additionalProperties: []
412
- }
413
- }
414
- },
415
- {
416
- name: "objectEnum",
417
- schema: {
418
- keyword: schemaKeywords.object,
419
- args: {
420
- properties: {
421
- version: [
422
- {
423
- keyword: schemaKeywords.schema,
424
- args: {
425
- format: "string",
426
- type: "string"
427
- }
428
- },
429
- {
430
- keyword: schemaKeywords.enum,
431
- args: {
432
- name: "enum",
433
- typeName: "Enum",
434
- asConst: false,
435
- items: [
436
- { name: "A", value: "A", format: schemaKeywords.string },
437
- { name: "B", value: "B", format: schemaKeywords.string },
438
- { name: "C", value: "C", format: schemaKeywords.string },
439
- { name: 2, value: 2, format: schemaKeywords.number }
440
- ]
441
- }
442
- },
443
- {
444
- keyword: schemaKeywords.min,
445
- args: 4
446
- },
447
- { keyword: schemaKeywords.describe, args: "Your address" }
448
- ]
449
- },
450
- additionalProperties: []
451
- }
452
- }
453
- },
454
- {
455
- name: "objectArrayObject",
456
- schema: {
457
- keyword: schemaKeywords.object,
458
- args: {
459
- properties: {
460
- ids: [
461
- {
462
- keyword: schemaKeywords.array,
463
- args: {
464
- items: [
465
- {
466
- keyword: schemaKeywords.object,
467
- args: {
468
- properties: {
469
- enum: [
470
- {
471
- keyword: schemaKeywords.schema,
472
- args: {
473
- format: "string",
474
- type: "string"
475
- }
476
- },
477
- {
478
- keyword: schemaKeywords.enum,
479
- args: {
480
- name: "enum",
481
- typeName: "Enum",
482
- asConst: false,
483
- items: [
484
- { name: "A", value: "A", format: schemaKeywords.string },
485
- { name: "B", value: "B", format: schemaKeywords.string },
486
- { name: "C", value: "C", format: schemaKeywords.string },
487
- { name: 2, value: 2, format: schemaKeywords.number }
488
- ]
489
- }
490
- }
491
- ]
492
- },
493
- additionalProperties: []
494
- }
495
- }
496
- ],
497
- min: 3,
498
- max: 10
499
- }
500
- }
501
- ]
502
- },
503
- additionalProperties: []
504
- }
505
- }
506
- },
507
- {
508
- name: "objectEmpty",
509
- schema: {
510
- keyword: schemaKeywords.object,
511
- args: {
512
- properties: {},
513
- additionalProperties: []
514
- }
515
- }
516
- },
517
- {
518
- name: "default",
519
- schema: {
520
- keyword: schemaKeywords.default
521
- }
522
- },
523
- {
524
- name: "default",
525
- schema: {
526
- keyword: schemaKeywords.default,
527
- args: "default"
528
- }
529
- },
530
- {
531
- name: "blob",
532
- schema: {
533
- keyword: schemaKeywords.blob
534
- }
535
- },
536
- {
537
- name: "nullableAdditionalProperties",
538
- schema: {
539
- keyword: schemaKeywords.object,
540
- args: {
541
- properties: {},
542
- additionalProperties: [
543
- {
544
- keyword: schemaKeywords.string
545
- },
546
- {
547
- args: {
548
- format: void 0,
549
- type: schemaKeywords.string
550
- },
551
- keyword: schemaKeywords.schema
552
- },
553
- {
554
- keyword: schemaKeywords.nullable
555
- }
556
- ]
557
- }
558
- }
559
- }
3
+ //#region src/mocks/schemas.ts
4
+ const basic = [
5
+ {
6
+ name: "any",
7
+ schema: { keyword: schemaKeywords.any }
8
+ },
9
+ {
10
+ name: "unknown",
11
+ schema: { keyword: schemaKeywords.unknown }
12
+ },
13
+ {
14
+ name: "string",
15
+ schema: { keyword: schemaKeywords.string }
16
+ },
17
+ {
18
+ name: "number",
19
+ schema: { keyword: schemaKeywords.number }
20
+ },
21
+ {
22
+ name: "integer",
23
+ schema: { keyword: schemaKeywords.integer }
24
+ },
25
+ {
26
+ name: "boolean",
27
+ schema: { keyword: schemaKeywords.boolean }
28
+ },
29
+ {
30
+ name: "primitiveDate",
31
+ schema: {
32
+ keyword: schemaKeywords.date,
33
+ args: { type: "date" }
34
+ }
35
+ },
36
+ {
37
+ name: "date",
38
+ schema: {
39
+ keyword: schemaKeywords.date,
40
+ args: { type: "string" }
41
+ }
42
+ },
43
+ {
44
+ name: "time",
45
+ schema: {
46
+ keyword: schemaKeywords.time,
47
+ args: { type: "string" }
48
+ }
49
+ },
50
+ {
51
+ name: "stringOffset",
52
+ schema: {
53
+ keyword: schemaKeywords.datetime,
54
+ args: { offset: true }
55
+ }
56
+ },
57
+ {
58
+ name: "stringLocal",
59
+ schema: {
60
+ keyword: schemaKeywords.datetime,
61
+ args: { local: true }
62
+ }
63
+ },
64
+ {
65
+ name: "datetime",
66
+ schema: {
67
+ keyword: schemaKeywords.datetime,
68
+ args: { offset: false }
69
+ }
70
+ },
71
+ {
72
+ name: "nullable",
73
+ schema: { keyword: schemaKeywords.nullable }
74
+ },
75
+ {
76
+ name: "undefined",
77
+ schema: { keyword: schemaKeywords.undefined }
78
+ },
79
+ {
80
+ name: "min",
81
+ schema: {
82
+ keyword: schemaKeywords.min,
83
+ args: 2
84
+ }
85
+ },
86
+ {
87
+ name: "max",
88
+ schema: {
89
+ keyword: schemaKeywords.max,
90
+ args: 2
91
+ }
92
+ },
93
+ {
94
+ name: "matchesReg",
95
+ schema: {
96
+ keyword: schemaKeywords.matches,
97
+ args: "/node_modules/"
98
+ }
99
+ },
100
+ {
101
+ name: "matches",
102
+ schema: {
103
+ keyword: schemaKeywords.matches,
104
+ args: "^[A-Z]{2}$"
105
+ }
106
+ },
107
+ {
108
+ name: "const",
109
+ schema: {
110
+ keyword: schemaKeywords.const,
111
+ args: {
112
+ name: "",
113
+ value: "",
114
+ format: schemaKeywords.string
115
+ }
116
+ }
117
+ },
118
+ {
119
+ name: "ref",
120
+ schema: {
121
+ keyword: schemaKeywords.ref,
122
+ args: {
123
+ $ref: "$ref",
124
+ name: "Pet",
125
+ path: "./pet.ts",
126
+ isImportable: true
127
+ }
128
+ }
129
+ },
130
+ {
131
+ name: "enum",
132
+ schema: {
133
+ keyword: schemaKeywords.enum,
134
+ args: {
135
+ name: "enum",
136
+ typeName: "Enum",
137
+ asConst: false,
138
+ items: [
139
+ {
140
+ name: "A",
141
+ value: "A",
142
+ format: schemaKeywords.string
143
+ },
144
+ {
145
+ name: "B",
146
+ value: "B",
147
+ format: schemaKeywords.string
148
+ },
149
+ {
150
+ name: "C",
151
+ value: "C",
152
+ format: schemaKeywords.string
153
+ },
154
+ {
155
+ name: 2,
156
+ value: 2,
157
+ format: schemaKeywords.number
158
+ }
159
+ ]
160
+ }
161
+ }
162
+ },
163
+ {
164
+ name: "enumLiteralBoolean",
165
+ schema: {
166
+ keyword: schemaKeywords.enum,
167
+ args: {
168
+ asConst: true,
169
+ items: [{
170
+ format: "boolean",
171
+ name: "true",
172
+ value: true
173
+ }, {
174
+ format: "boolean",
175
+ name: "false",
176
+ value: false
177
+ }],
178
+ name: "PetEnumLiteral",
179
+ typeName: "PetEnumLiteral"
180
+ }
181
+ }
182
+ },
183
+ {
184
+ name: "tuple",
185
+ schema: {
186
+ keyword: schemaKeywords.tuple,
187
+ args: { items: [] }
188
+ }
189
+ },
190
+ {
191
+ name: "tupleMulti",
192
+ schema: {
193
+ keyword: schemaKeywords.tuple,
194
+ args: { items: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }] }
195
+ }
196
+ },
197
+ {
198
+ name: "array",
199
+ schema: {
200
+ keyword: schemaKeywords.array,
201
+ args: { items: [{
202
+ keyword: schemaKeywords.union,
203
+ args: [{ keyword: schemaKeywords.number }, { keyword: schemaKeywords.string }]
204
+ }] }
205
+ }
206
+ },
207
+ {
208
+ name: "arrayEmpty",
209
+ schema: {
210
+ keyword: schemaKeywords.array,
211
+ args: { items: [] }
212
+ }
213
+ },
214
+ {
215
+ name: "arrayRef",
216
+ schema: {
217
+ keyword: schemaKeywords.array,
218
+ args: { items: [{
219
+ keyword: schemaKeywords.ref,
220
+ args: {
221
+ name: "Pet",
222
+ $ref: "#component/schema/Pet",
223
+ path: "./pet.ts",
224
+ isImportable: true
225
+ }
226
+ }] }
227
+ }
228
+ },
229
+ {
230
+ name: "arrayAdvanced",
231
+ schema: {
232
+ keyword: schemaKeywords.array,
233
+ args: {
234
+ items: [
235
+ {
236
+ keyword: schemaKeywords.min,
237
+ args: 1
238
+ },
239
+ {
240
+ keyword: schemaKeywords.max,
241
+ args: 10
242
+ },
243
+ { keyword: schemaKeywords.number }
244
+ ],
245
+ min: 3,
246
+ max: 10
247
+ }
248
+ }
249
+ },
250
+ {
251
+ name: "arrayRegex",
252
+ schema: {
253
+ keyword: schemaKeywords.array,
254
+ args: {
255
+ items: [{
256
+ keyword: schemaKeywords.matches,
257
+ args: "^[a-zA-Z0-9]{1,13}$"
258
+ }],
259
+ min: 3,
260
+ max: 10
261
+ }
262
+ }
263
+ },
264
+ {
265
+ name: "union",
266
+ schema: {
267
+ keyword: schemaKeywords.union,
268
+ args: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }]
269
+ }
270
+ },
271
+ {
272
+ name: "unionOne",
273
+ schema: {
274
+ keyword: schemaKeywords.union,
275
+ args: [{ keyword: schemaKeywords.string }]
276
+ }
277
+ },
278
+ {
279
+ name: "catchall",
280
+ schema: {
281
+ keyword: schemaKeywords.object,
282
+ args: {
283
+ properties: {},
284
+ additionalProperties: [{
285
+ keyword: schemaKeywords.ref,
286
+ args: {
287
+ name: "Pet",
288
+ $ref: "#component/schema/Pet",
289
+ path: "./Pet.ts",
290
+ isImportable: true
291
+ }
292
+ }]
293
+ }
294
+ }
295
+ },
296
+ {
297
+ name: "and",
298
+ schema: {
299
+ keyword: schemaKeywords.and,
300
+ args: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }]
301
+ }
302
+ },
303
+ {
304
+ name: "object",
305
+ schema: {
306
+ keyword: schemaKeywords.object,
307
+ args: {
308
+ properties: {
309
+ firstName: [{ keyword: schemaKeywords.string }, {
310
+ keyword: schemaKeywords.min,
311
+ args: 2
312
+ }],
313
+ address: [
314
+ { keyword: schemaKeywords.string },
315
+ { keyword: schemaKeywords.nullable },
316
+ {
317
+ keyword: schemaKeywords.describe,
318
+ args: "\"Your address\""
319
+ }
320
+ ]
321
+ },
322
+ additionalProperties: []
323
+ }
324
+ }
325
+ },
326
+ {
327
+ name: "objectOptional",
328
+ schema: {
329
+ keyword: schemaKeywords.object,
330
+ args: {
331
+ properties: {
332
+ firstName: [
333
+ { keyword: schemaKeywords.string },
334
+ { keyword: schemaKeywords.optional },
335
+ {
336
+ keyword: schemaKeywords.min,
337
+ args: 2
338
+ }
339
+ ],
340
+ address: [
341
+ { keyword: schemaKeywords.string },
342
+ { keyword: schemaKeywords.nullable },
343
+ {
344
+ keyword: schemaKeywords.describe,
345
+ args: "\"Your address\""
346
+ }
347
+ ]
348
+ },
349
+ additionalProperties: []
350
+ }
351
+ }
352
+ },
353
+ {
354
+ name: "objectArray",
355
+ schema: {
356
+ keyword: schemaKeywords.object,
357
+ args: {
358
+ properties: { ids: [{
359
+ keyword: schemaKeywords.array,
360
+ args: {
361
+ items: [{
362
+ keyword: schemaKeywords.matches,
363
+ args: "^[a-zA-Z0-9]{1,13}$"
364
+ }],
365
+ min: 3,
366
+ max: 10
367
+ }
368
+ }] },
369
+ additionalProperties: []
370
+ }
371
+ }
372
+ },
373
+ {
374
+ name: "objectDates",
375
+ schema: {
376
+ keyword: schemaKeywords.object,
377
+ args: {
378
+ properties: {
379
+ dateTime: [{
380
+ keyword: schemaKeywords.datetime,
381
+ args: { offset: true }
382
+ }],
383
+ date: [{
384
+ keyword: schemaKeywords.date,
385
+ args: { type: "string" }
386
+ }],
387
+ time: [{
388
+ keyword: schemaKeywords.time,
389
+ args: { type: "string" }
390
+ }],
391
+ nativeDate: [{
392
+ keyword: schemaKeywords.date,
393
+ args: { type: "date" }
394
+ }]
395
+ },
396
+ additionalProperties: []
397
+ }
398
+ }
399
+ },
400
+ {
401
+ name: "objectAnd",
402
+ schema: {
403
+ keyword: schemaKeywords.object,
404
+ args: {
405
+ properties: {
406
+ firstName: [
407
+ { keyword: schemaKeywords.deprecated },
408
+ {
409
+ keyword: schemaKeywords.default,
410
+ args: "test"
411
+ },
412
+ {
413
+ keyword: schemaKeywords.min,
414
+ args: 2
415
+ },
416
+ { keyword: schemaKeywords.string }
417
+ ],
418
+ age: [
419
+ {
420
+ keyword: schemaKeywords.example,
421
+ args: "2"
422
+ },
423
+ {
424
+ keyword: schemaKeywords.default,
425
+ args: 2
426
+ },
427
+ {
428
+ keyword: schemaKeywords.min,
429
+ args: 3
430
+ },
431
+ { keyword: schemaKeywords.number }
432
+ ],
433
+ address: [
434
+ {
435
+ keyword: schemaKeywords.and,
436
+ args: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }]
437
+ },
438
+ { keyword: schemaKeywords.nullable },
439
+ {
440
+ keyword: schemaKeywords.describe,
441
+ args: "Your address"
442
+ }
443
+ ]
444
+ },
445
+ additionalProperties: []
446
+ }
447
+ }
448
+ },
449
+ {
450
+ name: "objectEnum",
451
+ schema: {
452
+ keyword: schemaKeywords.object,
453
+ args: {
454
+ properties: { version: [
455
+ {
456
+ keyword: schemaKeywords.schema,
457
+ args: {
458
+ format: "string",
459
+ type: "string"
460
+ }
461
+ },
462
+ {
463
+ keyword: schemaKeywords.enum,
464
+ args: {
465
+ name: "enum",
466
+ typeName: "Enum",
467
+ asConst: false,
468
+ items: [
469
+ {
470
+ name: "A",
471
+ value: "A",
472
+ format: schemaKeywords.string
473
+ },
474
+ {
475
+ name: "B",
476
+ value: "B",
477
+ format: schemaKeywords.string
478
+ },
479
+ {
480
+ name: "C",
481
+ value: "C",
482
+ format: schemaKeywords.string
483
+ },
484
+ {
485
+ name: 2,
486
+ value: 2,
487
+ format: schemaKeywords.number
488
+ }
489
+ ]
490
+ }
491
+ },
492
+ {
493
+ keyword: schemaKeywords.min,
494
+ args: 4
495
+ },
496
+ {
497
+ keyword: schemaKeywords.describe,
498
+ args: "Your address"
499
+ }
500
+ ] },
501
+ additionalProperties: []
502
+ }
503
+ }
504
+ },
505
+ {
506
+ name: "objectObjectEnum",
507
+ schema: {
508
+ keyword: schemaKeywords.object,
509
+ args: {
510
+ properties: { prop1: [{
511
+ keyword: schemaKeywords.object,
512
+ args: {
513
+ properties: { prop2: [{
514
+ keyword: schemaKeywords.schema,
515
+ args: {
516
+ format: "string",
517
+ type: "string"
518
+ }
519
+ }, {
520
+ keyword: schemaKeywords.enum,
521
+ args: {
522
+ name: "enum",
523
+ typeName: "Enum",
524
+ asConst: false,
525
+ items: [{
526
+ name: "A",
527
+ value: "A",
528
+ format: schemaKeywords.string
529
+ }, {
530
+ name: "B",
531
+ value: "B",
532
+ format: schemaKeywords.string
533
+ }]
534
+ }
535
+ }] },
536
+ additionalProperties: []
537
+ }
538
+ }] },
539
+ additionalProperties: []
540
+ }
541
+ }
542
+ },
543
+ {
544
+ name: "objectArrayObject",
545
+ schema: {
546
+ keyword: schemaKeywords.object,
547
+ args: {
548
+ properties: { ids: [{
549
+ keyword: schemaKeywords.array,
550
+ args: {
551
+ items: [{
552
+ keyword: schemaKeywords.object,
553
+ args: {
554
+ properties: { enum: [{
555
+ keyword: schemaKeywords.schema,
556
+ args: {
557
+ format: "string",
558
+ type: "string"
559
+ }
560
+ }, {
561
+ keyword: schemaKeywords.enum,
562
+ args: {
563
+ name: "enum",
564
+ typeName: "Enum",
565
+ asConst: false,
566
+ items: [
567
+ {
568
+ name: "A",
569
+ value: "A",
570
+ format: schemaKeywords.string
571
+ },
572
+ {
573
+ name: "B",
574
+ value: "B",
575
+ format: schemaKeywords.string
576
+ },
577
+ {
578
+ name: "C",
579
+ value: "C",
580
+ format: schemaKeywords.string
581
+ },
582
+ {
583
+ name: 2,
584
+ value: 2,
585
+ format: schemaKeywords.number
586
+ }
587
+ ]
588
+ }
589
+ }] },
590
+ additionalProperties: []
591
+ }
592
+ }],
593
+ min: 3,
594
+ max: 10
595
+ }
596
+ }] },
597
+ additionalProperties: []
598
+ }
599
+ }
600
+ },
601
+ {
602
+ name: "objectEmpty",
603
+ schema: {
604
+ keyword: schemaKeywords.object,
605
+ args: {
606
+ properties: {},
607
+ additionalProperties: []
608
+ }
609
+ }
610
+ },
611
+ {
612
+ name: "default",
613
+ schema: { keyword: schemaKeywords.default }
614
+ },
615
+ {
616
+ name: "default",
617
+ schema: {
618
+ keyword: schemaKeywords.default,
619
+ args: "default"
620
+ }
621
+ },
622
+ {
623
+ name: "blob",
624
+ schema: { keyword: schemaKeywords.blob }
625
+ },
626
+ {
627
+ name: "nullableAdditionalProperties",
628
+ schema: {
629
+ keyword: schemaKeywords.object,
630
+ args: {
631
+ properties: {},
632
+ additionalProperties: [
633
+ { keyword: schemaKeywords.string },
634
+ {
635
+ args: {
636
+ format: void 0,
637
+ type: schemaKeywords.string
638
+ },
639
+ keyword: schemaKeywords.schema
640
+ },
641
+ { keyword: schemaKeywords.nullable }
642
+ ]
643
+ }
644
+ }
645
+ }
560
646
  ];
561
- var full = [
562
- {
563
- name: "Upload",
564
- schema: [
565
- {
566
- keyword: schemaKeywords.blob
567
- }
568
- ]
569
- },
570
- {
571
- name: "PageSizeNumber",
572
- schema: [
573
- {
574
- keyword: schemaKeywords.number
575
- },
576
- {
577
- keyword: schemaKeywords.default,
578
- args: 10
579
- }
580
- ]
581
- },
582
- {
583
- name: "PageSizeInteger",
584
- schema: [
585
- {
586
- keyword: schemaKeywords.integer
587
- },
588
- {
589
- keyword: schemaKeywords.default,
590
- args: 10
591
- }
592
- ]
593
- },
594
- {
595
- name: "Object",
596
- schema: [
597
- { keyword: schemaKeywords.nullable },
598
- { keyword: schemaKeywords.describe, args: "Your address" },
599
- {
600
- keyword: schemaKeywords.object,
601
- args: {
602
- properties: {
603
- firstName: [
604
- { keyword: schemaKeywords.deprecated },
605
- { keyword: schemaKeywords.default, args: "test" },
606
- {
607
- keyword: schemaKeywords.min,
608
- args: 2
609
- },
610
- {
611
- keyword: schemaKeywords.string
612
- }
613
- ],
614
- age: [
615
- { keyword: schemaKeywords.example, args: "2" },
616
- { keyword: schemaKeywords.default, args: 2 },
617
- {
618
- keyword: schemaKeywords.min,
619
- args: 2
620
- },
621
- {
622
- keyword: schemaKeywords.number
623
- }
624
- ],
625
- address: [
626
- {
627
- keyword: schemaKeywords.and,
628
- args: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }]
629
- },
630
- { keyword: schemaKeywords.nullable },
631
- { keyword: schemaKeywords.describe, args: "Your address" }
632
- ]
633
- },
634
- additionalProperties: []
635
- }
636
- }
637
- ]
638
- },
639
- {
640
- name: "Order",
641
- schema: [
642
- {
643
- keyword: schemaKeywords.schema,
644
- args: {
645
- type: "object"
646
- }
647
- },
648
- {
649
- keyword: schemaKeywords.object,
650
- args: {
651
- properties: {
652
- status: [
653
- {
654
- keyword: schemaKeywords.enum,
655
- args: {
656
- name: "orderStatus",
657
- asConst: false,
658
- typeName: "OrderStatus",
659
- items: [
660
- { name: "Placed", value: "placed", format: "string" },
661
- { name: "Approved", value: "approved", format: "string" }
662
- ]
663
- }
664
- }
665
- ]
666
- },
667
- additionalProperties: []
668
- }
669
- }
670
- ]
671
- },
672
- {
673
- name: "nullableAdditionalProperties",
674
- schema: [
675
- {
676
- keyword: schemaKeywords.object,
677
- args: {
678
- properties: {},
679
- additionalProperties: [
680
- {
681
- keyword: schemaKeywords.string
682
- },
683
- {
684
- args: {
685
- format: void 0,
686
- type: schemaKeywords.string
687
- },
688
- keyword: schemaKeywords.schema
689
- },
690
- {
691
- keyword: schemaKeywords.number
692
- }
693
- ]
694
- }
695
- }
696
- ]
697
- },
698
- {
699
- name: "Record",
700
- schema: [
701
- {
702
- keyword: schemaKeywords.object,
703
- args: {
704
- properties: {},
705
- additionalProperties: [
706
- {
707
- keyword: schemaKeywords.integer
708
- },
709
- {
710
- keyword: schemaKeywords.schema,
711
- args: {
712
- type: "integer",
713
- format: "int32"
714
- }
715
- },
716
- {
717
- keyword: schemaKeywords.optional
718
- }
719
- ]
720
- }
721
- },
722
- {
723
- keyword: schemaKeywords.schema,
724
- args: {
725
- type: "integer",
726
- format: "int32"
727
- }
728
- },
729
- {
730
- keyword: schemaKeywords.optional
731
- }
732
- ]
733
- }
647
+ const full = [
648
+ {
649
+ name: "Upload",
650
+ schema: [{ keyword: schemaKeywords.blob }]
651
+ },
652
+ {
653
+ name: "PageSizeNumber",
654
+ schema: [{ keyword: schemaKeywords.number }, {
655
+ keyword: schemaKeywords.default,
656
+ args: 10
657
+ }]
658
+ },
659
+ {
660
+ name: "PageSizeInteger",
661
+ schema: [{ keyword: schemaKeywords.integer }, {
662
+ keyword: schemaKeywords.default,
663
+ args: 10
664
+ }]
665
+ },
666
+ {
667
+ name: "Object",
668
+ schema: [
669
+ { keyword: schemaKeywords.nullable },
670
+ {
671
+ keyword: schemaKeywords.describe,
672
+ args: "Your address"
673
+ },
674
+ {
675
+ keyword: schemaKeywords.object,
676
+ args: {
677
+ properties: {
678
+ firstName: [
679
+ { keyword: schemaKeywords.deprecated },
680
+ {
681
+ keyword: schemaKeywords.default,
682
+ args: "test"
683
+ },
684
+ {
685
+ keyword: schemaKeywords.min,
686
+ args: 2
687
+ },
688
+ { keyword: schemaKeywords.string }
689
+ ],
690
+ age: [
691
+ {
692
+ keyword: schemaKeywords.example,
693
+ args: "2"
694
+ },
695
+ {
696
+ keyword: schemaKeywords.default,
697
+ args: 2
698
+ },
699
+ {
700
+ keyword: schemaKeywords.min,
701
+ args: 2
702
+ },
703
+ { keyword: schemaKeywords.number }
704
+ ],
705
+ address: [
706
+ {
707
+ keyword: schemaKeywords.and,
708
+ args: [{ keyword: schemaKeywords.string }, { keyword: schemaKeywords.number }]
709
+ },
710
+ { keyword: schemaKeywords.nullable },
711
+ {
712
+ keyword: schemaKeywords.describe,
713
+ args: "Your address"
714
+ }
715
+ ]
716
+ },
717
+ additionalProperties: []
718
+ }
719
+ }
720
+ ]
721
+ },
722
+ {
723
+ name: "Order",
724
+ schema: [{
725
+ keyword: schemaKeywords.schema,
726
+ args: { type: "object" }
727
+ }, {
728
+ keyword: schemaKeywords.object,
729
+ args: {
730
+ properties: { status: [{
731
+ keyword: schemaKeywords.enum,
732
+ args: {
733
+ name: "orderStatus",
734
+ asConst: false,
735
+ typeName: "OrderStatus",
736
+ items: [{
737
+ name: "Placed",
738
+ value: "placed",
739
+ format: "string"
740
+ }, {
741
+ name: "Approved",
742
+ value: "approved",
743
+ format: "string"
744
+ }]
745
+ }
746
+ }] },
747
+ additionalProperties: []
748
+ }
749
+ }]
750
+ },
751
+ {
752
+ name: "nullableAdditionalProperties",
753
+ schema: [{
754
+ keyword: schemaKeywords.object,
755
+ args: {
756
+ properties: {},
757
+ additionalProperties: [
758
+ { keyword: schemaKeywords.string },
759
+ {
760
+ args: {
761
+ format: void 0,
762
+ type: schemaKeywords.string
763
+ },
764
+ keyword: schemaKeywords.schema
765
+ },
766
+ { keyword: schemaKeywords.number }
767
+ ]
768
+ }
769
+ }]
770
+ },
771
+ {
772
+ name: "Record",
773
+ schema: [
774
+ {
775
+ keyword: schemaKeywords.object,
776
+ args: {
777
+ properties: {},
778
+ additionalProperties: [
779
+ { keyword: schemaKeywords.integer },
780
+ {
781
+ keyword: schemaKeywords.schema,
782
+ args: {
783
+ type: "integer",
784
+ format: "int32"
785
+ }
786
+ },
787
+ { keyword: schemaKeywords.optional }
788
+ ]
789
+ }
790
+ },
791
+ {
792
+ keyword: schemaKeywords.schema,
793
+ args: {
794
+ type: "integer",
795
+ format: "int32"
796
+ }
797
+ },
798
+ { keyword: schemaKeywords.optional }
799
+ ]
800
+ }
734
801
  ];
735
- var schemas = {
736
- basic,
737
- full
802
+ const schemas = {
803
+ basic,
804
+ full
738
805
  };
739
806
 
807
+ //#endregion
740
808
  export { schemas };
741
- //# sourceMappingURL=mocks.js.map
742
809
  //# sourceMappingURL=mocks.js.map