@xyd-js/openapi 0.0.0-build
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 +10 -0
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/__fixtures__/-2.complex.openai/input.yaml +39848 -0
- package/__fixtures__/-2.complex.openai/output.json +321646 -0
- package/__fixtures__/-2.complex.openai/pluginOasOpenai.ts +553 -0
- package/__fixtures__/-3.random/input.yaml +234 -0
- package/__fixtures__/-3.random/output.json +1140 -0
- package/__fixtures__/1.basic/input.yaml +226 -0
- package/__fixtures__/1.basic/output.json +1919 -0
- package/__fixtures__/2.more/input.yaml +76 -0
- package/__fixtures__/2.more/output.json +327 -0
- package/__fixtures__/3.multiple-responses/input.yaml +48 -0
- package/__fixtures__/3.multiple-responses/output.json +311 -0
- package/__fixtures__/5.xdocs.codeLanguages/input.yaml +231 -0
- package/__fixtures__/5.xdocs.codeLanguages/output.json +1879 -0
- package/__fixtures__/5.xdocs.sidebar/input.yaml +256 -0
- package/__fixtures__/5.xdocs.sidebar/output.json +843 -0
- package/__fixtures__/6.codeSamples/input.yaml +75 -0
- package/__fixtures__/6.codeSamples/output.json +293 -0
- package/__tests__/oapSchemaToReferences.test.ts +82 -0
- package/__tests__/utils.ts +81 -0
- package/dist/index.cjs +2154 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +40 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +2119 -0
- package/dist/index.js.map +1 -0
- package/examples/basic/index.ts +20 -0
- package/examples/basic/index2.ts +36 -0
- package/examples/basic/openapi.yaml +124 -0
- package/examples/semi/index.ts +16 -0
- package/examples/semi/openapi.yaml +365 -0
- package/examples/semi/references.json +500 -0
- package/examples/webhooks/index.ts +16 -0
- package/examples/webhooks/openapi.yaml +248 -0
- package/examples/webhooks/references.json +895 -0
- package/index.ts +12 -0
- package/package.json +31 -0
- package/src/const.ts +14 -0
- package/src/converters/oas-componentSchemas.ts +205 -0
- package/src/converters/oas-examples.ts +530 -0
- package/src/converters/oas-parameters.ts +41 -0
- package/src/converters/oas-paths.ts +354 -0
- package/src/converters/oas-requestBody.ts +57 -0
- package/src/converters/oas-responses.ts +76 -0
- package/src/converters/oas-schema.ts +141 -0
- package/src/index.ts +21 -0
- package/src/oas-core.ts +579 -0
- package/src/types.ts +18 -0
- package/src/utils.ts +157 -0
- package/src/xdocs/index.ts +18 -0
- package/src/xdocs/pluginSidebar.ts +580 -0
- package/src/xdocs/types.ts +26 -0
- package/tsconfig.json +18 -0
- package/tsup.config.ts +19 -0
- package/tsup.examples-config.ts +30 -0
- package/vitest.config.ts +7 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
openapi: 3.1.0
|
|
2
|
+
|
|
3
|
+
info:
|
|
4
|
+
title: LiveSession API
|
|
5
|
+
version: v1
|
|
6
|
+
|
|
7
|
+
servers:
|
|
8
|
+
- url: https://api.livesession.io/v1
|
|
9
|
+
description: Production server (uses live data)
|
|
10
|
+
|
|
11
|
+
paths:
|
|
12
|
+
# BEGIN Sessions
|
|
13
|
+
/sessions:
|
|
14
|
+
get:
|
|
15
|
+
summary: Get Sessions
|
|
16
|
+
security:
|
|
17
|
+
- livesession_oauth: [ users.sessions:read ]
|
|
18
|
+
- api_token: [ users.sessions:read ]
|
|
19
|
+
description: |
|
|
20
|
+
---
|
|
21
|
+
title: List sessions
|
|
22
|
+
group: [ENDPOINTS]
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
List of all sessions
|
|
26
|
+
tags:
|
|
27
|
+
- Sessions
|
|
28
|
+
parameters:
|
|
29
|
+
- name: page
|
|
30
|
+
in: query
|
|
31
|
+
description: The number of page to start with (default 0, max 10000).
|
|
32
|
+
schema:
|
|
33
|
+
type: integer
|
|
34
|
+
- name: size
|
|
35
|
+
in: query
|
|
36
|
+
description: The number of page's size (default 25, max 100).
|
|
37
|
+
schema:
|
|
38
|
+
type: integer
|
|
39
|
+
- name: email
|
|
40
|
+
in: query
|
|
41
|
+
description: The email address that you have associated with a session via [identify](https://developers.livesession.io/javascript-api/methods/#identify).
|
|
42
|
+
schema:
|
|
43
|
+
type: string
|
|
44
|
+
- name: visitor_id
|
|
45
|
+
in: query
|
|
46
|
+
description: The visitor ID.
|
|
47
|
+
schema:
|
|
48
|
+
type: string
|
|
49
|
+
- name: tz
|
|
50
|
+
in: query
|
|
51
|
+
description: IANA timezone. Default Europe/London if RelativeDateString is applied.
|
|
52
|
+
schema:
|
|
53
|
+
type: string
|
|
54
|
+
- name: date_from
|
|
55
|
+
in: query
|
|
56
|
+
description: ISO 8601 string or RelativeDateString. For RelativeDateString see table below for possible values.
|
|
57
|
+
schema:
|
|
58
|
+
oneOf:
|
|
59
|
+
- type: string
|
|
60
|
+
- $ref: '#/components/schemas/RelativeDateString'
|
|
61
|
+
- name: date_to
|
|
62
|
+
in: query
|
|
63
|
+
description: ISO 8601 string or [RelativeDateString](#/components/schemas/RelativeDateString). For RelativeDateString see table below for possible values.
|
|
64
|
+
schema:
|
|
65
|
+
oneOf:
|
|
66
|
+
- type: string
|
|
67
|
+
- $ref: '#/components/schemas/RelativeDateString'
|
|
68
|
+
responses:
|
|
69
|
+
'200':
|
|
70
|
+
description: Successful response
|
|
71
|
+
content:
|
|
72
|
+
application/json:
|
|
73
|
+
schema:
|
|
74
|
+
$ref: '#/components/schemas/GetListSessionsResponse'
|
|
75
|
+
'400':
|
|
76
|
+
description: 400 response
|
|
77
|
+
content:
|
|
78
|
+
application/json:
|
|
79
|
+
schema:
|
|
80
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
81
|
+
'500':
|
|
82
|
+
description: 500 response
|
|
83
|
+
content:
|
|
84
|
+
application/json:
|
|
85
|
+
schema:
|
|
86
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
87
|
+
|
|
88
|
+
components:
|
|
89
|
+
securitySchemes:
|
|
90
|
+
api_token:
|
|
91
|
+
type: apiKey
|
|
92
|
+
name: Authorization
|
|
93
|
+
description: "[API Tokens](https://developers.livesession.io/rest-api/introduction/#creating-a-personal-access-token)"
|
|
94
|
+
in: header
|
|
95
|
+
|
|
96
|
+
livesession_oauth:
|
|
97
|
+
type: oauth2
|
|
98
|
+
flows:
|
|
99
|
+
authorizationCode:
|
|
100
|
+
authorizationUrl: https://apis.livesession.io/accounts/v1/oauth2/authorize # TODO: more friendly url
|
|
101
|
+
tokenUrl: https://apis.livesession.io/accounts/v1/oauth2/access_token # TODO: more friendly url
|
|
102
|
+
refreshUrl: https://apis.livesession.io/accounts/v1/oauth2/access_token # TODO: more friendly url
|
|
103
|
+
scopes:
|
|
104
|
+
users.sessions:read: read user sessions
|
|
105
|
+
|
|
106
|
+
webhooks:read: read webhooks
|
|
107
|
+
webhooks:write: write webhooks
|
|
108
|
+
|
|
109
|
+
alerts:read: read alerts
|
|
110
|
+
alerts:write: write alerts
|
|
111
|
+
|
|
112
|
+
websites:read: read websites
|
|
113
|
+
websites:write: write websites
|
|
114
|
+
|
|
115
|
+
payment_intents:write: write payment intents
|
|
116
|
+
payment_intents.confirm: confirm payment intents
|
|
117
|
+
|
|
118
|
+
schemas:
|
|
119
|
+
|
|
120
|
+
# BEGIN Errors
|
|
121
|
+
ErrorResponse:
|
|
122
|
+
type: object
|
|
123
|
+
properties:
|
|
124
|
+
error:
|
|
125
|
+
type: object
|
|
126
|
+
properties:
|
|
127
|
+
type:
|
|
128
|
+
type: string
|
|
129
|
+
code:
|
|
130
|
+
type: string
|
|
131
|
+
param:
|
|
132
|
+
type: string
|
|
133
|
+
message:
|
|
134
|
+
type: string
|
|
135
|
+
http_status_code:
|
|
136
|
+
type: integer
|
|
137
|
+
request_id:
|
|
138
|
+
type: string
|
|
139
|
+
|
|
140
|
+
# END Errors
|
|
141
|
+
|
|
142
|
+
# BEGIN Sessions
|
|
143
|
+
Session:
|
|
144
|
+
type: object
|
|
145
|
+
properties:
|
|
146
|
+
id:
|
|
147
|
+
type: string
|
|
148
|
+
website_id:
|
|
149
|
+
type: string
|
|
150
|
+
session_url:
|
|
151
|
+
type: string
|
|
152
|
+
creation_timestamp:
|
|
153
|
+
type: integer
|
|
154
|
+
duration:
|
|
155
|
+
type: integer
|
|
156
|
+
end_timestamp:
|
|
157
|
+
type: integer
|
|
158
|
+
active_time:
|
|
159
|
+
type: integer
|
|
160
|
+
end_url:
|
|
161
|
+
type: string
|
|
162
|
+
expiration_timestamp:
|
|
163
|
+
type: integer
|
|
164
|
+
last_event_timestamp:
|
|
165
|
+
type: integer
|
|
166
|
+
product:
|
|
167
|
+
type: string
|
|
168
|
+
device:
|
|
169
|
+
type: string
|
|
170
|
+
tags:
|
|
171
|
+
type: array
|
|
172
|
+
items:
|
|
173
|
+
type: string
|
|
174
|
+
last_seen_page_view_id:
|
|
175
|
+
type: string
|
|
176
|
+
seen:
|
|
177
|
+
type: boolean
|
|
178
|
+
referrer:
|
|
179
|
+
type: string
|
|
180
|
+
start_url:
|
|
181
|
+
type: string
|
|
182
|
+
visitor_first_session:
|
|
183
|
+
type: boolean
|
|
184
|
+
engagment_score:
|
|
185
|
+
type: number
|
|
186
|
+
visitor:
|
|
187
|
+
$ref: '#/components/schemas/SessionVisitorData'
|
|
188
|
+
resolution:
|
|
189
|
+
$ref: '#/components/schemas/SessionResolutionData'
|
|
190
|
+
os:
|
|
191
|
+
$ref: '#/components/schemas/SessionOsData'
|
|
192
|
+
browser:
|
|
193
|
+
$ref: '#/components/schemas/SessionBrowserData'
|
|
194
|
+
utm:
|
|
195
|
+
$ref: '#/components/schemas/SessionUTMData'
|
|
196
|
+
page_views_statistics:
|
|
197
|
+
$ref: '#/components/schemas/SessionPageViewsStatisticsData'
|
|
198
|
+
events_statistics:
|
|
199
|
+
$ref: '#/components/schemas/SessionEventsStatisticsData'
|
|
200
|
+
|
|
201
|
+
SessionVisitorData:
|
|
202
|
+
type: object
|
|
203
|
+
properties:
|
|
204
|
+
id:
|
|
205
|
+
type: string
|
|
206
|
+
ip:
|
|
207
|
+
type: string
|
|
208
|
+
geolocation:
|
|
209
|
+
$ref: '#/components/schemas/SessionVisitorDataGeolocation'
|
|
210
|
+
name:
|
|
211
|
+
type: string
|
|
212
|
+
email:
|
|
213
|
+
type: string
|
|
214
|
+
email_hash:
|
|
215
|
+
type: string
|
|
216
|
+
params:
|
|
217
|
+
type: array
|
|
218
|
+
items:
|
|
219
|
+
$ref: '#/components/schemas/SessionVisitorDataParams'
|
|
220
|
+
last_session_timestamp:
|
|
221
|
+
type: integer
|
|
222
|
+
first_session_timestamp:
|
|
223
|
+
type: integer
|
|
224
|
+
|
|
225
|
+
SessionOsData:
|
|
226
|
+
type: object
|
|
227
|
+
properties:
|
|
228
|
+
name:
|
|
229
|
+
type: string
|
|
230
|
+
version:
|
|
231
|
+
type: string
|
|
232
|
+
|
|
233
|
+
SessionBrowserData:
|
|
234
|
+
type: object
|
|
235
|
+
properties:
|
|
236
|
+
description:
|
|
237
|
+
type: string
|
|
238
|
+
name:
|
|
239
|
+
type: string
|
|
240
|
+
version:
|
|
241
|
+
type: string
|
|
242
|
+
|
|
243
|
+
SessionUTMData:
|
|
244
|
+
type: object
|
|
245
|
+
properties:
|
|
246
|
+
source:
|
|
247
|
+
type: string
|
|
248
|
+
medium:
|
|
249
|
+
type: string
|
|
250
|
+
campaign:
|
|
251
|
+
type: string
|
|
252
|
+
term:
|
|
253
|
+
type: string
|
|
254
|
+
content:
|
|
255
|
+
type: string
|
|
256
|
+
|
|
257
|
+
SessionEventsStatisticsData:
|
|
258
|
+
type: object
|
|
259
|
+
properties:
|
|
260
|
+
clicks:
|
|
261
|
+
type: integer
|
|
262
|
+
error_clicks:
|
|
263
|
+
type: integer
|
|
264
|
+
rage_clicks:
|
|
265
|
+
type: integer
|
|
266
|
+
error_logs:
|
|
267
|
+
type: integer
|
|
268
|
+
net_errors:
|
|
269
|
+
type: integer
|
|
270
|
+
|
|
271
|
+
SessionPageViewLocationData:
|
|
272
|
+
type: object
|
|
273
|
+
properties:
|
|
274
|
+
base:
|
|
275
|
+
type: string
|
|
276
|
+
href:
|
|
277
|
+
type: string
|
|
278
|
+
origin:
|
|
279
|
+
type: string
|
|
280
|
+
referrer:
|
|
281
|
+
type: string
|
|
282
|
+
|
|
283
|
+
SessionPageViewViewPortData:
|
|
284
|
+
type: object
|
|
285
|
+
properties:
|
|
286
|
+
height:
|
|
287
|
+
type: integer
|
|
288
|
+
width:
|
|
289
|
+
type: integer
|
|
290
|
+
|
|
291
|
+
SessionVisitorDataGeolocation:
|
|
292
|
+
type: object
|
|
293
|
+
properties:
|
|
294
|
+
country_code:
|
|
295
|
+
type: string
|
|
296
|
+
city:
|
|
297
|
+
type: string
|
|
298
|
+
region:
|
|
299
|
+
type: string
|
|
300
|
+
|
|
301
|
+
SessionVisitorDataParams:
|
|
302
|
+
type: object
|
|
303
|
+
properties:
|
|
304
|
+
name:
|
|
305
|
+
type: string
|
|
306
|
+
value:
|
|
307
|
+
type: string
|
|
308
|
+
|
|
309
|
+
SessionResolutionData:
|
|
310
|
+
type: object
|
|
311
|
+
properties:
|
|
312
|
+
height:
|
|
313
|
+
type: integer
|
|
314
|
+
width:
|
|
315
|
+
type: integer
|
|
316
|
+
resolution:
|
|
317
|
+
type: string
|
|
318
|
+
|
|
319
|
+
SessionPageViewsStatisticsData:
|
|
320
|
+
type: object
|
|
321
|
+
properties:
|
|
322
|
+
count:
|
|
323
|
+
type: integer
|
|
324
|
+
|
|
325
|
+
GetListSessionsResponse:
|
|
326
|
+
type: object
|
|
327
|
+
properties:
|
|
328
|
+
total:
|
|
329
|
+
type: integer
|
|
330
|
+
page:
|
|
331
|
+
$ref: '#/components/schemas/Pagination'
|
|
332
|
+
sessions:
|
|
333
|
+
type: array
|
|
334
|
+
items:
|
|
335
|
+
$ref: '#/components/schemas/Session'
|
|
336
|
+
|
|
337
|
+
Pagination:
|
|
338
|
+
type: object
|
|
339
|
+
properties:
|
|
340
|
+
num:
|
|
341
|
+
type: integer
|
|
342
|
+
size:
|
|
343
|
+
type: integer
|
|
344
|
+
|
|
345
|
+
RelativeDateString:
|
|
346
|
+
type: string
|
|
347
|
+
description: |
|
|
348
|
+
* `TODAY` - Today since midnight
|
|
349
|
+
* `YESTERDAY` - Yesterday since midnight
|
|
350
|
+
* `BEGINNING_OF_WEEK` - Nearest monday since midnight
|
|
351
|
+
* `BEGINNING_OF_MONTH` - 1st of the month since midnight
|
|
352
|
+
* `BEGINNING_OF_PREV_MONTH` - Previous 1st of the month since midnight
|
|
353
|
+
* `TODAY-7DAYS` - Exact 7 days ago since midnight
|
|
354
|
+
* `TODAY-30DAYS` - Exact 30 days ago since midnight
|
|
355
|
+
enum:
|
|
356
|
+
- TODAY
|
|
357
|
+
- YESTERDAY
|
|
358
|
+
- BEGINNING_OF_WEEK
|
|
359
|
+
- BEGINNING_OF_MONTH
|
|
360
|
+
- BEGINNING_OF_PREV_MONTH
|
|
361
|
+
- TODAY-7DAYS
|
|
362
|
+
- TODAY-30DAYS
|
|
363
|
+
# END Sessions
|
|
364
|
+
|
|
365
|
+
|