@xyd-js/openapi 0.1.0-build.168

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 (64) hide show
  1. package/CHANGELOG.md +1517 -0
  2. package/LICENSE +21 -0
  3. package/README.md +3 -0
  4. package/__fixtures__/-2.complex.openai/input.yaml +39848 -0
  5. package/__fixtures__/-2.complex.openai/output.json +321646 -0
  6. package/__fixtures__/-2.complex.openai/pluginOasOpenai.ts +553 -0
  7. package/__fixtures__/-3.random/input.yaml +234 -0
  8. package/__fixtures__/-3.random/output.json +1140 -0
  9. package/__fixtures__/1.basic/input.yaml +226 -0
  10. package/__fixtures__/1.basic/output.json +1919 -0
  11. package/__fixtures__/2.more/input.yaml +76 -0
  12. package/__fixtures__/2.more/output.json +327 -0
  13. package/__fixtures__/3.multiple-responses/input.yaml +48 -0
  14. package/__fixtures__/3.multiple-responses/output.json +311 -0
  15. package/__fixtures__/5.xdocs.codeLanguages/input.yaml +231 -0
  16. package/__fixtures__/5.xdocs.codeLanguages/output.json +1879 -0
  17. package/__fixtures__/5.xdocs.sidebar/input.yaml +256 -0
  18. package/__fixtures__/5.xdocs.sidebar/output.json +843 -0
  19. package/__fixtures__/6.codeSamples/input.yaml +75 -0
  20. package/__fixtures__/6.codeSamples/output.json +293 -0
  21. package/__tests__/oapSchemaToReferences.test.ts +82 -0
  22. package/__tests__/utils.ts +81 -0
  23. package/dist/index.cjs +2154 -0
  24. package/dist/index.cjs.map +1 -0
  25. package/dist/index.d.cts +40 -0
  26. package/dist/index.d.ts +40 -0
  27. package/dist/index.js +2119 -0
  28. package/dist/index.js.map +1 -0
  29. package/examples/basic/index.ts +20 -0
  30. package/examples/basic/index2.ts +36 -0
  31. package/examples/basic/openapi.yaml +124 -0
  32. package/examples/dist/index.cjs +2 -0
  33. package/examples/dist/index.cjs.map +1 -0
  34. package/examples/dist/index.d.cts +2 -0
  35. package/examples/dist/index.d.ts +2 -0
  36. package/examples/dist/index.js +2 -0
  37. package/examples/dist/index.js.map +1 -0
  38. package/examples/semi/index.ts +16 -0
  39. package/examples/semi/openapi.yaml +365 -0
  40. package/examples/semi/references.json +500 -0
  41. package/examples/webhooks/index.ts +16 -0
  42. package/examples/webhooks/openapi.yaml +248 -0
  43. package/examples/webhooks/references.json +895 -0
  44. package/index.ts +12 -0
  45. package/package.json +31 -0
  46. package/src/const.ts +14 -0
  47. package/src/converters/oas-componentSchemas.ts +205 -0
  48. package/src/converters/oas-examples.ts +530 -0
  49. package/src/converters/oas-parameters.ts +41 -0
  50. package/src/converters/oas-paths.ts +354 -0
  51. package/src/converters/oas-requestBody.ts +57 -0
  52. package/src/converters/oas-responses.ts +76 -0
  53. package/src/converters/oas-schema.ts +141 -0
  54. package/src/index.ts +21 -0
  55. package/src/oas-core.ts +579 -0
  56. package/src/types.ts +18 -0
  57. package/src/utils.ts +157 -0
  58. package/src/xdocs/index.ts +18 -0
  59. package/src/xdocs/pluginSidebar.ts +580 -0
  60. package/src/xdocs/types.ts +26 -0
  61. package/tsconfig.json +18 -0
  62. package/tsup.config.ts +19 -0
  63. package/tsup.examples-config.ts +30 -0
  64. package/vitest.config.ts +7 -0
@@ -0,0 +1,248 @@
1
+ openapi: 3.1.0
2
+
3
+ info:
4
+ title: Webhooks API
5
+ version: '1.0'
6
+
7
+ paths:
8
+ /session.event.JSError:
9
+ post:
10
+ summary: JSerror
11
+ description: |
12
+ ---
13
+ title: JSError
14
+ group: [EVENT TYPES, session.event]
15
+ ---
16
+ requestBody:
17
+ required: true
18
+ content:
19
+ application/json:
20
+ schema:
21
+ $ref: '#/components/schemas/SessionEventJSErrorPayload'
22
+ responses:
23
+ '200':
24
+ description: Event handled successfully
25
+
26
+ /session.event.NetError:
27
+ post:
28
+ summary: NetError
29
+ description: |
30
+ ---
31
+ title: NetError
32
+ group: [EVENT TYPES, session.event]
33
+ ---
34
+ requestBody:
35
+ required: true
36
+ content:
37
+ application/json:
38
+ schema:
39
+ $ref: '#/components/schemas/SessionEventNetErrorPayload'
40
+ responses:
41
+ '200':
42
+ description: Event handled successfully
43
+
44
+ /session.event.ErrorClick:
45
+ post:
46
+ summary: ErrorClick
47
+ description: |
48
+ ---
49
+ title: ErrorClick
50
+ group: [EVENT TYPES, session.event]
51
+ ---
52
+ requestBody:
53
+ required: true
54
+ content:
55
+ application/json:
56
+ schema:
57
+ $ref: '#/components/schemas/SessionEventErrorClickPayload'
58
+ responses:
59
+ '200':
60
+ description: Event handled successfully
61
+
62
+ /session.event.RageClick:
63
+ post:
64
+ summary: Handle session event
65
+ description: |
66
+ ---
67
+ title: RageClick
68
+ group: [EVENT TYPES, session.event]
69
+ ---
70
+ requestBody:
71
+ required: true
72
+ content:
73
+ application/json:
74
+ schema:
75
+ $ref: '#/components/schemas/SessionEventRageClickPayload'
76
+ responses:
77
+ '200':
78
+ description: Event handled successfully
79
+
80
+ /session.event.Custom:
81
+ post:
82
+ summary: Handle session event
83
+ description: |
84
+ ---
85
+ title: Custom
86
+ group: [EVENT TYPES, session.event]
87
+ ---
88
+ requestBody:
89
+ required: true
90
+ content:
91
+ application/json:
92
+ schema:
93
+ $ref: '#/components/schemas/SessionEventCustomPayload'
94
+ responses:
95
+ '200':
96
+ description: Event handled successfully
97
+
98
+ components:
99
+ schemas:
100
+ CommonProperties:
101
+ type: object
102
+ properties:
103
+ message_id:
104
+ type: string
105
+ webhook_id:
106
+ type: string
107
+ webhook_type:
108
+ type: string
109
+ api_version:
110
+ type: string
111
+ account_id:
112
+ type: string
113
+ website_id:
114
+ type: string
115
+ created_at:
116
+ type: integer
117
+
118
+ CommonPayloadProperties:
119
+ type: object
120
+ properties:
121
+ visitor:
122
+ $ref: '#/components/schemas/Visitor'
123
+ event_name:
124
+ type: string
125
+ time:
126
+ type: integer
127
+ name:
128
+ type: string
129
+
130
+ Visitor:
131
+ type: object
132
+ properties:
133
+ id:
134
+ type: string
135
+ description: The unique ID of the visitor
136
+ name:
137
+ type: string
138
+ description: The name of the visitor
139
+ email:
140
+ type: string
141
+ description: The email of the visitor
142
+ params:
143
+ type: array
144
+ items:
145
+ type: object
146
+ properties:
147
+ name:
148
+ type: string
149
+ value:
150
+ type: string
151
+ geolocation:
152
+ type: object
153
+ properties:
154
+ country_code:
155
+ type: string
156
+ city:
157
+ type: string
158
+ region:
159
+ type: string
160
+
161
+ JSErrorPayload:
162
+ type: object
163
+ properties:
164
+ count:
165
+ type: integer
166
+ value:
167
+ type: string
168
+
169
+ NetErrorPayload:
170
+ type: object
171
+ properties:
172
+ method:
173
+ type: string
174
+ url:
175
+ type: string
176
+ status:
177
+ type: integer
178
+
179
+ ErrorClickPayload:
180
+ type: object
181
+ properties:
182
+ message:
183
+ type: string
184
+
185
+ RageClickPayload:
186
+ type: object
187
+ properties:
188
+ clicks:
189
+ type: integer
190
+
191
+ CustomPayload:
192
+ type: object
193
+ properties:
194
+ properties:
195
+ type: object
196
+ additionalProperties: true
197
+
198
+ SessionEventJSErrorPayload:
199
+ allOf:
200
+ - $ref: '#/components/schemas/CommonProperties'
201
+ - type: object
202
+ properties:
203
+ payload:
204
+ allOf:
205
+ - $ref: '#/components/schemas/CommonPayloadProperties'
206
+ - $ref: '#/components/schemas/JSErrorPayload'
207
+
208
+
209
+ SessionEventNetErrorPayload:
210
+ allOf:
211
+ - $ref: '#/components/schemas/CommonProperties'
212
+ - type: object
213
+ properties:
214
+ payload:
215
+ allOf:
216
+ - $ref: '#/components/schemas/CommonPayloadProperties'
217
+ - $ref: '#/components/schemas/NetErrorPayload'
218
+
219
+
220
+ SessionEventErrorClickPayload:
221
+ allOf:
222
+ - $ref: '#/components/schemas/CommonProperties'
223
+ - type: object
224
+ properties:
225
+ payload:
226
+ allOf:
227
+ - $ref: '#/components/schemas/CommonPayloadProperties'
228
+ - $ref: '#/components/schemas/ErrorClickPayload'
229
+
230
+ SessionEventRageClickPayload:
231
+ allOf:
232
+ - $ref: '#/components/schemas/CommonProperties'
233
+ - type: object
234
+ properties:
235
+ payload:
236
+ allOf:
237
+ - $ref: '#/components/schemas/CommonPayloadProperties'
238
+ - $ref: '#/components/schemas/RageClickPayload'
239
+
240
+ SessionEventCustomPayload:
241
+ allOf:
242
+ - $ref: '#/components/schemas/CommonProperties'
243
+ - type: object
244
+ properties:
245
+ payload:
246
+ allOf:
247
+ - $ref: '#/components/schemas/CommonPayloadProperties'
248
+ - $ref: '#/components/schemas/CustomPayload'