@xyd-js/openapi 0.1.0-xyd.6 → 0.1.0-xyd.64

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 (51) hide show
  1. package/CHANGELOG.md +518 -0
  2. package/LICENSE +21 -0
  3. package/__fixtures__/-2.complex.openai/input.yaml +39848 -0
  4. package/__fixtures__/-2.complex.openai/output.json +321646 -0
  5. package/__fixtures__/-2.complex.openai/pluginOasOpenai.ts +553 -0
  6. package/__fixtures__/1.basic/input.yaml +226 -0
  7. package/__fixtures__/1.basic/output.json +1919 -0
  8. package/__fixtures__/2.more/input.yaml +76 -0
  9. package/__fixtures__/2.more/output.json +292 -0
  10. package/__fixtures__/3.multiple-responses/input.yaml +48 -0
  11. package/__fixtures__/3.multiple-responses/output.json +266 -0
  12. package/__fixtures__/4.abc/input.yaml +639 -0
  13. package/__fixtures__/4.abc/output.json +3828 -0
  14. package/__fixtures__/5.xdocs.codeLanguages/input.yaml +231 -0
  15. package/__fixtures__/5.xdocs.codeLanguages/output.json +1879 -0
  16. package/__fixtures__/5.xdocs.sidebar/input.yaml +256 -0
  17. package/__fixtures__/5.xdocs.sidebar/output.json +843 -0
  18. package/__fixtures__/6.codeSamples/input.yaml +75 -0
  19. package/__fixtures__/6.codeSamples/output.json +293 -0
  20. package/__tests__/oapSchemaToReferences.test.ts +88 -0
  21. package/__tests__/utils.ts +81 -0
  22. package/dist/index.cjs +1860 -163
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +36 -4
  25. package/dist/index.d.ts +36 -4
  26. package/dist/index.js +1856 -156
  27. package/dist/index.js.map +1 -1
  28. package/examples/basic/index2.ts +2 -2
  29. package/index.ts +10 -2
  30. package/package.json +11 -7
  31. package/src/const.ts +5 -1
  32. package/src/converters/oas-componentSchemas.ts +205 -0
  33. package/src/converters/oas-examples.ts +417 -0
  34. package/src/{parameters.ts → converters/oas-parameters.ts} +17 -3
  35. package/src/converters/oas-paths.ts +354 -0
  36. package/src/{requestBody.ts → converters/oas-requestBody.ts} +30 -10
  37. package/src/converters/oas-responses.ts +76 -0
  38. package/src/converters/oas-schema.ts +141 -0
  39. package/src/index.ts +13 -5
  40. package/src/oas-core.ts +579 -0
  41. package/src/types.ts +18 -0
  42. package/src/utils.ts +103 -89
  43. package/src/xdocs/index.ts +18 -0
  44. package/src/xdocs/pluginSidebar.ts +580 -0
  45. package/src/xdocs/types.ts +26 -0
  46. package/vitest.config.ts +7 -0
  47. package/src/examples.ts +0 -116
  48. package/src/paths.ts +0 -103
  49. package/src/properties.ts +0 -37
  50. package/src/responses.ts +0 -38
  51. package/src/schema.ts +0 -62
package/CHANGELOG.md CHANGED
@@ -1,5 +1,523 @@
1
1
  # @xyd-js/openapi
2
2
 
3
+ ## 0.1.0-xyd.64
4
+
5
+ ### Patch Changes
6
+
7
+ - update all packages
8
+ - update all packages
9
+ - Updated dependencies
10
+ - Updated dependencies
11
+ - @xyd-js/openapi-sampler@0.1.0-xyd.34
12
+ - @xyd-js/uniform@0.1.0-xyd.68
13
+
14
+ ## 0.1.0-xyd.63
15
+
16
+ ### Patch Changes
17
+
18
+ - update all packages
19
+ - Updated dependencies
20
+ - @xyd-js/openapi-sampler@0.1.0-xyd.33
21
+ - @xyd-js/uniform@0.1.0-xyd.67
22
+
23
+ ## 0.1.0-xyd.62
24
+
25
+ ### Patch Changes
26
+
27
+ - update all packages
28
+ - Updated dependencies
29
+ - @xyd-js/openapi-sampler@0.1.0-xyd.32
30
+ - @xyd-js/uniform@0.1.0-xyd.66
31
+
32
+ ## 0.1.0-xyd.61
33
+
34
+ ### Patch Changes
35
+
36
+ - update all packages
37
+ - Updated dependencies
38
+ - @xyd-js/openapi-sampler@0.1.0-xyd.31
39
+ - @xyd-js/uniform@0.1.0-xyd.65
40
+
41
+ ## 0.1.0-xyd.60
42
+
43
+ ### Patch Changes
44
+
45
+ - update all packages
46
+ - Updated dependencies
47
+ - @xyd-js/openapi-sampler@0.1.0-xyd.30
48
+ - @xyd-js/uniform@0.1.0-xyd.64
49
+
50
+ ## 0.1.0-xyd.59
51
+
52
+ ### Patch Changes
53
+
54
+ - update all packages
55
+ - Updated dependencies
56
+ - @xyd-js/openapi-sampler@0.1.0-xyd.29
57
+ - @xyd-js/uniform@0.1.0-xyd.63
58
+
59
+ ## 0.1.0-xyd.58
60
+
61
+ ### Patch Changes
62
+
63
+ - update all packages
64
+ - Updated dependencies
65
+ - @xyd-js/openapi-sampler@0.1.0-xyd.28
66
+ - @xyd-js/uniform@0.1.0-xyd.62
67
+
68
+ ## 0.1.0-xyd.57
69
+
70
+ ### Patch Changes
71
+
72
+ - update all packages
73
+ - Updated dependencies
74
+ - @xyd-js/openapi-sampler@0.1.0-xyd.27
75
+ - @xyd-js/uniform@0.1.0-xyd.61
76
+
77
+ ## 0.1.0-xyd.56
78
+
79
+ ### Patch Changes
80
+
81
+ - update all packages
82
+ - Updated dependencies
83
+ - @xyd-js/openapi-sampler@0.1.0-xyd.26
84
+ - @xyd-js/uniform@0.1.0-xyd.60
85
+
86
+ ## 0.1.0-xyd.55
87
+
88
+ ### Patch Changes
89
+
90
+ - update all packages
91
+ - Updated dependencies
92
+ - @xyd-js/openapi-sampler@0.1.0-xyd.25
93
+ - @xyd-js/uniform@0.1.0-xyd.59
94
+
95
+ ## 0.1.0-xyd.54
96
+
97
+ ### Patch Changes
98
+
99
+ - update all packages
100
+ - Updated dependencies
101
+ - @xyd-js/openapi-sampler@0.1.0-xyd.24
102
+ - @xyd-js/uniform@0.1.0-xyd.58
103
+
104
+ ## 0.1.0-xyd.53
105
+
106
+ ### Patch Changes
107
+
108
+ - update all packages
109
+ - update all packages
110
+ - update all packages
111
+ - update all packages
112
+ - update all packages
113
+ - update all packages
114
+ - Updated dependencies
115
+ - Updated dependencies
116
+ - Updated dependencies
117
+ - Updated dependencies
118
+ - Updated dependencies
119
+ - Updated dependencies
120
+ - @xyd-js/openapi-sampler@0.1.0-xyd.23
121
+ - @xyd-js/uniform@0.1.0-xyd.57
122
+
123
+ ## 0.1.0-xyd.52
124
+
125
+ ### Patch Changes
126
+
127
+ - update all packages
128
+ - Updated dependencies
129
+ - @xyd-js/uniform@0.1.0-xyd.56
130
+ - @xyd-js/openapi-sampler@0.1.0-xyd.22
131
+
132
+ ## 0.1.0-xyd.51
133
+
134
+ ### Patch Changes
135
+
136
+ - update all packages
137
+ - Updated dependencies
138
+ - @xyd-js/uniform@0.1.0-xyd.55
139
+ - @xyd-js/openapi-sampler@0.1.0-xyd.21
140
+
141
+ ## 0.1.0-xyd.50
142
+
143
+ ### Patch Changes
144
+
145
+ - update all packages
146
+ - Updated dependencies
147
+ - @xyd-js/uniform@0.1.0-xyd.54
148
+ - @xyd-js/openapi-sampler@0.1.0-xyd.20
149
+
150
+ ## 0.1.0-xyd.49
151
+
152
+ ### Patch Changes
153
+
154
+ - update all packages
155
+ - Updated dependencies
156
+ - @xyd-js/uniform@0.1.0-xyd.53
157
+ - @xyd-js/openapi-sampler@0.1.0-xyd.19
158
+
159
+ ## 0.1.0-xyd.48
160
+
161
+ ### Patch Changes
162
+
163
+ - update all packages
164
+ - Updated dependencies
165
+ - @xyd-js/uniform@0.1.0-xyd.52
166
+ - @xyd-js/openapi-sampler@0.1.0-xyd.18
167
+
168
+ ## 0.1.0-xyd.47
169
+
170
+ ### Patch Changes
171
+
172
+ - update all packages
173
+ - Updated dependencies
174
+ - @xyd-js/uniform@0.1.0-xyd.51
175
+ - @xyd-js/openapi-sampler@0.1.0-xyd.17
176
+
177
+ ## 0.1.0-xyd.46
178
+
179
+ ### Patch Changes
180
+
181
+ - update all packages
182
+ - Updated dependencies
183
+ - @xyd-js/uniform@0.1.0-xyd.50
184
+ - @xyd-js/openapi-sampler@0.1.0-xyd.16
185
+
186
+ ## 0.1.0-xyd.45
187
+
188
+ ### Patch Changes
189
+
190
+ - update all packages
191
+ - Updated dependencies
192
+ - @xyd-js/uniform@0.1.0-xyd.49
193
+ - @xyd-js/openapi-sampler@0.1.0-xyd.15
194
+
195
+ ## 0.1.0-xyd.44
196
+
197
+ ### Patch Changes
198
+
199
+ - update all packages
200
+ - Updated dependencies
201
+ - @xyd-js/uniform@0.1.0-xyd.48
202
+ - @xyd-js/openapi-sampler@0.1.0-xyd.14
203
+
204
+ ## 0.1.0-xyd.43
205
+
206
+ ### Patch Changes
207
+
208
+ - update all packages
209
+ - Updated dependencies
210
+ - @xyd-js/uniform@0.1.0-xyd.47
211
+ - @xyd-js/openapi-sampler@0.1.0-xyd.13
212
+
213
+ ## 0.1.0-xyd.42
214
+
215
+ ### Patch Changes
216
+
217
+ - update all packages
218
+ - Updated dependencies
219
+ - @xyd-js/uniform@0.1.0-xyd.46
220
+ - @xyd-js/openapi-sampler@0.1.0-xyd.12
221
+
222
+ ## 0.1.0-xyd.41
223
+
224
+ ### Patch Changes
225
+
226
+ - update all packages
227
+ - Updated dependencies
228
+ - @xyd-js/uniform@0.1.0-xyd.45
229
+ - @xyd-js/openapi-sampler@0.1.0-xyd.11
230
+
231
+ ## 0.1.0-xyd.40
232
+
233
+ ### Patch Changes
234
+
235
+ - update all packages
236
+ - Updated dependencies
237
+ - @xyd-js/uniform@0.1.0-xyd.44
238
+ - @xyd-js/openapi-sampler@0.1.0-xyd.10
239
+
240
+ ## 0.1.0-xyd.39
241
+
242
+ ### Patch Changes
243
+
244
+ - update all packages
245
+ - Updated dependencies
246
+ - @xyd-js/uniform@0.1.0-xyd.43
247
+ - @xyd-js/openapi-sampler@0.1.0-xyd.9
248
+
249
+ ## 0.1.0-xyd.38
250
+
251
+ ### Patch Changes
252
+
253
+ - update all packages
254
+ - Updated dependencies
255
+ - @xyd-js/uniform@0.1.0-xyd.42
256
+ - @xyd-js/openapi-sampler@0.1.0-xyd.8
257
+
258
+ ## 0.1.0-xyd.37
259
+
260
+ ### Patch Changes
261
+
262
+ - update all packages
263
+ - Updated dependencies
264
+ - @xyd-js/uniform@0.1.0-xyd.41
265
+ - @xyd-js/openapi-sampler@0.1.0-xyd.7
266
+
267
+ ## 0.1.0-xyd.36
268
+
269
+ ### Patch Changes
270
+
271
+ - update all packages
272
+ - Updated dependencies
273
+ - @xyd-js/uniform@0.1.0-xyd.40
274
+ - @xyd-js/openapi-sampler@0.1.0-xyd.6
275
+
276
+ ## 0.1.0-xyd.35
277
+
278
+ ### Patch Changes
279
+
280
+ - update all packages
281
+ - Updated dependencies
282
+ - @xyd-js/uniform@0.1.0-xyd.39
283
+ - @xyd-js/openapi-sampler@0.1.0-xyd.5
284
+
285
+ ## 0.1.0-xyd.34
286
+
287
+ ### Patch Changes
288
+
289
+ - update all packages
290
+ - Updated dependencies
291
+ - @xyd-js/uniform@0.1.0-xyd.38
292
+ - @xyd-js/openapi-sampler@0.1.0-xyd.4
293
+
294
+ ## 0.1.0-xyd.33
295
+
296
+ ### Patch Changes
297
+
298
+ - update all packages
299
+ - Updated dependencies
300
+ - @xyd-js/uniform@0.1.0-xyd.37
301
+ - @xyd-js/openapi-sampler@0.1.0-xyd.3
302
+
303
+ ## 0.1.0-xyd.32
304
+
305
+ ### Patch Changes
306
+
307
+ - update all packages
308
+ - Updated dependencies
309
+ - @xyd-js/uniform@0.1.0-xyd.36
310
+ - @xyd-js/openapi-sampler@0.1.0-xyd.2
311
+
312
+ ## 0.1.0-xyd.31
313
+
314
+ ### Patch Changes
315
+
316
+ - update all packages
317
+ - Updated dependencies
318
+ - @xyd-js/uniform@0.1.0-xyd.35
319
+ - @xyd-js/openapi-sampler@0.1.0-xyd.1
320
+
321
+ ## 0.1.0-xyd.30
322
+
323
+ ### Patch Changes
324
+
325
+ - update all packages
326
+ - Updated dependencies
327
+ - @xyd-js/uniform@0.1.0-xyd.34
328
+
329
+ ## 0.1.0-xyd.29
330
+
331
+ ### Patch Changes
332
+
333
+ - update all packages
334
+ - update all packages
335
+ - Updated dependencies
336
+ - Updated dependencies
337
+ - @xyd-js/uniform@0.1.0-xyd.33
338
+
339
+ ## 0.1.0-xyd.28
340
+
341
+ ### Patch Changes
342
+
343
+ - update all packages
344
+ - Updated dependencies
345
+ - @xyd-js/uniform@0.1.0-xyd.32
346
+
347
+ ## 0.1.0-xyd.27
348
+
349
+ ### Patch Changes
350
+
351
+ - update all packages
352
+ - update all packages
353
+ - Updated dependencies
354
+ - Updated dependencies
355
+ - @xyd-js/uniform@0.1.0-xyd.31
356
+
357
+ ## 0.1.0-xyd.26
358
+
359
+ ### Patch Changes
360
+
361
+ - update all packages
362
+ - update all packages
363
+ - Updated dependencies
364
+ - Updated dependencies
365
+ - @xyd-js/uniform@0.1.0-xyd.30
366
+
367
+ ## 0.1.0-xyd.25
368
+
369
+ ### Patch Changes
370
+
371
+ - update all packages
372
+ - update all packages
373
+ - Updated dependencies
374
+ - Updated dependencies
375
+ - @xyd-js/uniform@0.1.0-xyd.29
376
+
377
+ ## 0.1.0-xyd.24
378
+
379
+ ### Patch Changes
380
+
381
+ - update all packages
382
+ - update all packages
383
+ - Updated dependencies
384
+ - Updated dependencies
385
+ - @xyd-js/uniform@0.1.0-xyd.28
386
+
387
+ ## 0.1.0-xyd.23
388
+
389
+ ### Patch Changes
390
+
391
+ - update all packages
392
+ - update all packages
393
+ - Updated dependencies
394
+ - Updated dependencies
395
+ - @xyd-js/uniform@0.1.0-xyd.27
396
+
397
+ ## 0.1.0-xyd.22
398
+
399
+ ### Patch Changes
400
+
401
+ - update all packages
402
+ - update all packages
403
+ - Updated dependencies
404
+ - Updated dependencies
405
+ - @xyd-js/uniform@0.1.0-xyd.26
406
+
407
+ ## 0.1.0-xyd.21
408
+
409
+ ### Patch Changes
410
+
411
+ - update all packages
412
+ - Updated dependencies
413
+ - @xyd-js/uniform@0.1.0-xyd.25
414
+
415
+ ## 0.1.0-xyd.20
416
+
417
+ ### Patch Changes
418
+
419
+ - update all packages
420
+ - Updated dependencies
421
+ - @xyd-js/uniform@0.1.0-xyd.24
422
+
423
+ ## 0.1.0-xyd.19
424
+
425
+ ### Patch Changes
426
+
427
+ - update all packages
428
+ - Updated dependencies
429
+ - @xyd-js/uniform@0.1.0-xyd.23
430
+
431
+ ## 0.1.0-xyd.18
432
+
433
+ ### Patch Changes
434
+
435
+ - update
436
+ - Updated dependencies
437
+ - @xyd-js/uniform@0.1.0-xyd.22
438
+
439
+ ## 0.1.0-xyd.17
440
+
441
+ ### Patch Changes
442
+
443
+ - update
444
+ - Updated dependencies
445
+ - @xyd-js/uniform@0.1.0-xyd.21
446
+
447
+ ## 0.1.0-xyd.16
448
+
449
+ ### Patch Changes
450
+
451
+ - update
452
+ - Updated dependencies
453
+ - @xyd-js/uniform@0.1.0-xyd.20
454
+
455
+ ## 0.1.0-xyd.15
456
+
457
+ ### Patch Changes
458
+
459
+ - update
460
+ - Updated dependencies
461
+ - @xyd-js/uniform@0.1.0-xyd.19
462
+
463
+ ## 0.1.0-xyd.14
464
+
465
+ ### Patch Changes
466
+
467
+ - update
468
+ - Updated dependencies
469
+ - @xyd-js/uniform@0.1.0-xyd.18
470
+
471
+ ## 0.1.0-xyd.13
472
+
473
+ ### Patch Changes
474
+
475
+ - test
476
+ - Updated dependencies
477
+ - @xyd-js/uniform@0.1.0-xyd.17
478
+
479
+ ## 0.1.0-xyd.12
480
+
481
+ ### Patch Changes
482
+
483
+ - update packages
484
+ - Updated dependencies
485
+ - @xyd-js/uniform@0.1.0-xyd.16
486
+
487
+ ## 0.1.0-xyd.11
488
+
489
+ ### Patch Changes
490
+
491
+ - version
492
+ - Updated dependencies
493
+ - @xyd-js/uniform@0.1.0-xyd.15
494
+
495
+ ## 0.1.0-xyd.10
496
+
497
+ ### Patch Changes
498
+
499
+ - @xyd-js/uniform@0.1.0-xyd.14
500
+
501
+ ## 0.1.0-xyd.9
502
+
503
+ ### Patch Changes
504
+
505
+ - @xyd-js/uniform@0.1.0-xyd.13
506
+
507
+ ## 0.1.0-xyd.8
508
+
509
+ ### Patch Changes
510
+
511
+ - @xyd-js/uniform@0.1.0-xyd.12
512
+
513
+ ## 0.1.0-xyd.7
514
+
515
+ ### Patch Changes
516
+
517
+ - refactor, tweaks and ui changes
518
+ - Updated dependencies
519
+ - @xyd-js/uniform@0.1.0-xyd.11
520
+
3
521
  ## 0.1.0-xyd.6
4
522
 
5
523
  ### Patch Changes
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 xyd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.