@xyd-js/openapi 0.1.0-xyd.4 → 0.1.0-xyd.52

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 +410 -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,415 @@
1
1
  # @xyd-js/openapi
2
2
 
3
+ ## 0.1.0-xyd.52
4
+
5
+ ### Patch Changes
6
+
7
+ - update all packages
8
+ - Updated dependencies
9
+ - @xyd-js/uniform@0.1.0-xyd.56
10
+ - @xyd-js/openapi-sampler@0.1.0-xyd.22
11
+
12
+ ## 0.1.0-xyd.51
13
+
14
+ ### Patch Changes
15
+
16
+ - update all packages
17
+ - Updated dependencies
18
+ - @xyd-js/uniform@0.1.0-xyd.55
19
+ - @xyd-js/openapi-sampler@0.1.0-xyd.21
20
+
21
+ ## 0.1.0-xyd.50
22
+
23
+ ### Patch Changes
24
+
25
+ - update all packages
26
+ - Updated dependencies
27
+ - @xyd-js/uniform@0.1.0-xyd.54
28
+ - @xyd-js/openapi-sampler@0.1.0-xyd.20
29
+
30
+ ## 0.1.0-xyd.49
31
+
32
+ ### Patch Changes
33
+
34
+ - update all packages
35
+ - Updated dependencies
36
+ - @xyd-js/uniform@0.1.0-xyd.53
37
+ - @xyd-js/openapi-sampler@0.1.0-xyd.19
38
+
39
+ ## 0.1.0-xyd.48
40
+
41
+ ### Patch Changes
42
+
43
+ - update all packages
44
+ - Updated dependencies
45
+ - @xyd-js/uniform@0.1.0-xyd.52
46
+ - @xyd-js/openapi-sampler@0.1.0-xyd.18
47
+
48
+ ## 0.1.0-xyd.47
49
+
50
+ ### Patch Changes
51
+
52
+ - update all packages
53
+ - Updated dependencies
54
+ - @xyd-js/uniform@0.1.0-xyd.51
55
+ - @xyd-js/openapi-sampler@0.1.0-xyd.17
56
+
57
+ ## 0.1.0-xyd.46
58
+
59
+ ### Patch Changes
60
+
61
+ - update all packages
62
+ - Updated dependencies
63
+ - @xyd-js/uniform@0.1.0-xyd.50
64
+ - @xyd-js/openapi-sampler@0.1.0-xyd.16
65
+
66
+ ## 0.1.0-xyd.45
67
+
68
+ ### Patch Changes
69
+
70
+ - update all packages
71
+ - Updated dependencies
72
+ - @xyd-js/uniform@0.1.0-xyd.49
73
+ - @xyd-js/openapi-sampler@0.1.0-xyd.15
74
+
75
+ ## 0.1.0-xyd.44
76
+
77
+ ### Patch Changes
78
+
79
+ - update all packages
80
+ - Updated dependencies
81
+ - @xyd-js/uniform@0.1.0-xyd.48
82
+ - @xyd-js/openapi-sampler@0.1.0-xyd.14
83
+
84
+ ## 0.1.0-xyd.43
85
+
86
+ ### Patch Changes
87
+
88
+ - update all packages
89
+ - Updated dependencies
90
+ - @xyd-js/uniform@0.1.0-xyd.47
91
+ - @xyd-js/openapi-sampler@0.1.0-xyd.13
92
+
93
+ ## 0.1.0-xyd.42
94
+
95
+ ### Patch Changes
96
+
97
+ - update all packages
98
+ - Updated dependencies
99
+ - @xyd-js/uniform@0.1.0-xyd.46
100
+ - @xyd-js/openapi-sampler@0.1.0-xyd.12
101
+
102
+ ## 0.1.0-xyd.41
103
+
104
+ ### Patch Changes
105
+
106
+ - update all packages
107
+ - Updated dependencies
108
+ - @xyd-js/uniform@0.1.0-xyd.45
109
+ - @xyd-js/openapi-sampler@0.1.0-xyd.11
110
+
111
+ ## 0.1.0-xyd.40
112
+
113
+ ### Patch Changes
114
+
115
+ - update all packages
116
+ - Updated dependencies
117
+ - @xyd-js/uniform@0.1.0-xyd.44
118
+ - @xyd-js/openapi-sampler@0.1.0-xyd.10
119
+
120
+ ## 0.1.0-xyd.39
121
+
122
+ ### Patch Changes
123
+
124
+ - update all packages
125
+ - Updated dependencies
126
+ - @xyd-js/uniform@0.1.0-xyd.43
127
+ - @xyd-js/openapi-sampler@0.1.0-xyd.9
128
+
129
+ ## 0.1.0-xyd.38
130
+
131
+ ### Patch Changes
132
+
133
+ - update all packages
134
+ - Updated dependencies
135
+ - @xyd-js/uniform@0.1.0-xyd.42
136
+ - @xyd-js/openapi-sampler@0.1.0-xyd.8
137
+
138
+ ## 0.1.0-xyd.37
139
+
140
+ ### Patch Changes
141
+
142
+ - update all packages
143
+ - Updated dependencies
144
+ - @xyd-js/uniform@0.1.0-xyd.41
145
+ - @xyd-js/openapi-sampler@0.1.0-xyd.7
146
+
147
+ ## 0.1.0-xyd.36
148
+
149
+ ### Patch Changes
150
+
151
+ - update all packages
152
+ - Updated dependencies
153
+ - @xyd-js/uniform@0.1.0-xyd.40
154
+ - @xyd-js/openapi-sampler@0.1.0-xyd.6
155
+
156
+ ## 0.1.0-xyd.35
157
+
158
+ ### Patch Changes
159
+
160
+ - update all packages
161
+ - Updated dependencies
162
+ - @xyd-js/uniform@0.1.0-xyd.39
163
+ - @xyd-js/openapi-sampler@0.1.0-xyd.5
164
+
165
+ ## 0.1.0-xyd.34
166
+
167
+ ### Patch Changes
168
+
169
+ - update all packages
170
+ - Updated dependencies
171
+ - @xyd-js/uniform@0.1.0-xyd.38
172
+ - @xyd-js/openapi-sampler@0.1.0-xyd.4
173
+
174
+ ## 0.1.0-xyd.33
175
+
176
+ ### Patch Changes
177
+
178
+ - update all packages
179
+ - Updated dependencies
180
+ - @xyd-js/uniform@0.1.0-xyd.37
181
+ - @xyd-js/openapi-sampler@0.1.0-xyd.3
182
+
183
+ ## 0.1.0-xyd.32
184
+
185
+ ### Patch Changes
186
+
187
+ - update all packages
188
+ - Updated dependencies
189
+ - @xyd-js/uniform@0.1.0-xyd.36
190
+ - @xyd-js/openapi-sampler@0.1.0-xyd.2
191
+
192
+ ## 0.1.0-xyd.31
193
+
194
+ ### Patch Changes
195
+
196
+ - update all packages
197
+ - Updated dependencies
198
+ - @xyd-js/uniform@0.1.0-xyd.35
199
+ - @xyd-js/openapi-sampler@0.1.0-xyd.1
200
+
201
+ ## 0.1.0-xyd.30
202
+
203
+ ### Patch Changes
204
+
205
+ - update all packages
206
+ - Updated dependencies
207
+ - @xyd-js/uniform@0.1.0-xyd.34
208
+
209
+ ## 0.1.0-xyd.29
210
+
211
+ ### Patch Changes
212
+
213
+ - update all packages
214
+ - update all packages
215
+ - Updated dependencies
216
+ - Updated dependencies
217
+ - @xyd-js/uniform@0.1.0-xyd.33
218
+
219
+ ## 0.1.0-xyd.28
220
+
221
+ ### Patch Changes
222
+
223
+ - update all packages
224
+ - Updated dependencies
225
+ - @xyd-js/uniform@0.1.0-xyd.32
226
+
227
+ ## 0.1.0-xyd.27
228
+
229
+ ### Patch Changes
230
+
231
+ - update all packages
232
+ - update all packages
233
+ - Updated dependencies
234
+ - Updated dependencies
235
+ - @xyd-js/uniform@0.1.0-xyd.31
236
+
237
+ ## 0.1.0-xyd.26
238
+
239
+ ### Patch Changes
240
+
241
+ - update all packages
242
+ - update all packages
243
+ - Updated dependencies
244
+ - Updated dependencies
245
+ - @xyd-js/uniform@0.1.0-xyd.30
246
+
247
+ ## 0.1.0-xyd.25
248
+
249
+ ### Patch Changes
250
+
251
+ - update all packages
252
+ - update all packages
253
+ - Updated dependencies
254
+ - Updated dependencies
255
+ - @xyd-js/uniform@0.1.0-xyd.29
256
+
257
+ ## 0.1.0-xyd.24
258
+
259
+ ### Patch Changes
260
+
261
+ - update all packages
262
+ - update all packages
263
+ - Updated dependencies
264
+ - Updated dependencies
265
+ - @xyd-js/uniform@0.1.0-xyd.28
266
+
267
+ ## 0.1.0-xyd.23
268
+
269
+ ### Patch Changes
270
+
271
+ - update all packages
272
+ - update all packages
273
+ - Updated dependencies
274
+ - Updated dependencies
275
+ - @xyd-js/uniform@0.1.0-xyd.27
276
+
277
+ ## 0.1.0-xyd.22
278
+
279
+ ### Patch Changes
280
+
281
+ - update all packages
282
+ - update all packages
283
+ - Updated dependencies
284
+ - Updated dependencies
285
+ - @xyd-js/uniform@0.1.0-xyd.26
286
+
287
+ ## 0.1.0-xyd.21
288
+
289
+ ### Patch Changes
290
+
291
+ - update all packages
292
+ - Updated dependencies
293
+ - @xyd-js/uniform@0.1.0-xyd.25
294
+
295
+ ## 0.1.0-xyd.20
296
+
297
+ ### Patch Changes
298
+
299
+ - update all packages
300
+ - Updated dependencies
301
+ - @xyd-js/uniform@0.1.0-xyd.24
302
+
303
+ ## 0.1.0-xyd.19
304
+
305
+ ### Patch Changes
306
+
307
+ - update all packages
308
+ - Updated dependencies
309
+ - @xyd-js/uniform@0.1.0-xyd.23
310
+
311
+ ## 0.1.0-xyd.18
312
+
313
+ ### Patch Changes
314
+
315
+ - update
316
+ - Updated dependencies
317
+ - @xyd-js/uniform@0.1.0-xyd.22
318
+
319
+ ## 0.1.0-xyd.17
320
+
321
+ ### Patch Changes
322
+
323
+ - update
324
+ - Updated dependencies
325
+ - @xyd-js/uniform@0.1.0-xyd.21
326
+
327
+ ## 0.1.0-xyd.16
328
+
329
+ ### Patch Changes
330
+
331
+ - update
332
+ - Updated dependencies
333
+ - @xyd-js/uniform@0.1.0-xyd.20
334
+
335
+ ## 0.1.0-xyd.15
336
+
337
+ ### Patch Changes
338
+
339
+ - update
340
+ - Updated dependencies
341
+ - @xyd-js/uniform@0.1.0-xyd.19
342
+
343
+ ## 0.1.0-xyd.14
344
+
345
+ ### Patch Changes
346
+
347
+ - update
348
+ - Updated dependencies
349
+ - @xyd-js/uniform@0.1.0-xyd.18
350
+
351
+ ## 0.1.0-xyd.13
352
+
353
+ ### Patch Changes
354
+
355
+ - test
356
+ - Updated dependencies
357
+ - @xyd-js/uniform@0.1.0-xyd.17
358
+
359
+ ## 0.1.0-xyd.12
360
+
361
+ ### Patch Changes
362
+
363
+ - update packages
364
+ - Updated dependencies
365
+ - @xyd-js/uniform@0.1.0-xyd.16
366
+
367
+ ## 0.1.0-xyd.11
368
+
369
+ ### Patch Changes
370
+
371
+ - version
372
+ - Updated dependencies
373
+ - @xyd-js/uniform@0.1.0-xyd.15
374
+
375
+ ## 0.1.0-xyd.10
376
+
377
+ ### Patch Changes
378
+
379
+ - @xyd-js/uniform@0.1.0-xyd.14
380
+
381
+ ## 0.1.0-xyd.9
382
+
383
+ ### Patch Changes
384
+
385
+ - @xyd-js/uniform@0.1.0-xyd.13
386
+
387
+ ## 0.1.0-xyd.8
388
+
389
+ ### Patch Changes
390
+
391
+ - @xyd-js/uniform@0.1.0-xyd.12
392
+
393
+ ## 0.1.0-xyd.7
394
+
395
+ ### Patch Changes
396
+
397
+ - refactor, tweaks and ui changes
398
+ - Updated dependencies
399
+ - @xyd-js/uniform@0.1.0-xyd.11
400
+
401
+ ## 0.1.0-xyd.6
402
+
403
+ ### Patch Changes
404
+
405
+ - @xyd-js/uniform@0.1.0-xyd.10
406
+
407
+ ## 0.1.0-xyd.5
408
+
409
+ ### Patch Changes
410
+
411
+ - @xyd-js/uniform@0.1.0-xyd.9
412
+
3
413
  ## 0.1.0-xyd.4
4
414
 
5
415
  ### 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.