@skravets/eapi 0.0.1
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/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/api-types.d.cts +498 -0
- package/dist/api-types.d.ts +498 -0
- package/dist/index.cjs +214 -0
- package/dist/index.d.cts +229 -0
- package/dist/index.d.ts +229 -0
- package/dist/index.js +211 -0
- package/package.json +45 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Kravets
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module
|
|
3
|
+
*
|
|
4
|
+
* Сгенерированные TypeScript типы для [API](...).
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Сгенерированные из OpenAPI типы для `paths`
|
|
8
|
+
*/
|
|
9
|
+
interface paths {
|
|
10
|
+
"/": {
|
|
11
|
+
/** Get Hello World! */
|
|
12
|
+
get: operations["app.getHello"];
|
|
13
|
+
};
|
|
14
|
+
"/channels": {
|
|
15
|
+
/** Get Hello World! */
|
|
16
|
+
get: operations["channels.getHello"];
|
|
17
|
+
};
|
|
18
|
+
"/channels/{channelId}/last-message": {
|
|
19
|
+
/** Get last channel message */
|
|
20
|
+
get: operations["channels.getLastMessage"];
|
|
21
|
+
};
|
|
22
|
+
"/channels/{channelId}/new-messages": {
|
|
23
|
+
/** Get channel messages */
|
|
24
|
+
post: operations["channels.getMessages"];
|
|
25
|
+
};
|
|
26
|
+
"/subscriptions": {
|
|
27
|
+
/** Create subscription */
|
|
28
|
+
post: operations["subscriptions.create"];
|
|
29
|
+
};
|
|
30
|
+
"/subscriptions/{subId}": {
|
|
31
|
+
/** Get subscription by subscription id */
|
|
32
|
+
get: operations["subscriptions.getById"];
|
|
33
|
+
/** Update subscription by subscription id */
|
|
34
|
+
put: operations["subscriptions.update"];
|
|
35
|
+
/** Delete subscription by subscription id */
|
|
36
|
+
delete: operations["subscriptions.delete"];
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Сгенерированные из OpenAPI типы для `components`
|
|
41
|
+
*/
|
|
42
|
+
interface components {
|
|
43
|
+
schemas: {
|
|
44
|
+
IGetChannelMessages: {
|
|
45
|
+
/**
|
|
46
|
+
* @description Cursor to get messages from id to id
|
|
47
|
+
* @example {
|
|
48
|
+
* "from": 1,
|
|
49
|
+
* "to": 10
|
|
50
|
+
* }
|
|
51
|
+
*/
|
|
52
|
+
cursor: Record<string, never>;
|
|
53
|
+
};
|
|
54
|
+
ChatDataDto: {
|
|
55
|
+
/** @example true */
|
|
56
|
+
id?: boolean;
|
|
57
|
+
/** @example true */
|
|
58
|
+
username?: boolean;
|
|
59
|
+
/** @example true */
|
|
60
|
+
title?: boolean;
|
|
61
|
+
/** @example true */
|
|
62
|
+
type?: boolean;
|
|
63
|
+
/** @example true */
|
|
64
|
+
participants_count?: boolean;
|
|
65
|
+
/** @example true */
|
|
66
|
+
last_offset_id?: boolean;
|
|
67
|
+
/** @example true */
|
|
68
|
+
last_parsed_date?: boolean;
|
|
69
|
+
/** @example true */
|
|
70
|
+
is_locked?: boolean;
|
|
71
|
+
/** @example true */
|
|
72
|
+
about?: boolean;
|
|
73
|
+
/** @example true */
|
|
74
|
+
avatar_id?: boolean;
|
|
75
|
+
};
|
|
76
|
+
SubscriptionChatDataDto: {
|
|
77
|
+
/**
|
|
78
|
+
* @description Chat schema
|
|
79
|
+
* @example {
|
|
80
|
+
* "id": true,
|
|
81
|
+
* "username": true,
|
|
82
|
+
* "title": true,
|
|
83
|
+
* "type": true,
|
|
84
|
+
* "participants_count": true,
|
|
85
|
+
* "last_offset_id": true,
|
|
86
|
+
* "last_parsed_date": true,
|
|
87
|
+
* "is_locked": true,
|
|
88
|
+
* "about": true,
|
|
89
|
+
* "avatar_id": true
|
|
90
|
+
* }
|
|
91
|
+
*/
|
|
92
|
+
data: components["schemas"]["ChatDataDto"];
|
|
93
|
+
};
|
|
94
|
+
SubscriptionMessageDataDto: {
|
|
95
|
+
/**
|
|
96
|
+
* @description Messages schema
|
|
97
|
+
* @example {
|
|
98
|
+
* "channel_id": true,
|
|
99
|
+
* "created_at": true,
|
|
100
|
+
* "first_name": true,
|
|
101
|
+
* "has_comments": true,
|
|
102
|
+
* "has_reactions": true,
|
|
103
|
+
* "last_name": true,
|
|
104
|
+
* "message_created_at": true,
|
|
105
|
+
* "message_id": true,
|
|
106
|
+
* "reply_message_id": true,
|
|
107
|
+
* "search_text": true,
|
|
108
|
+
* "text": true,
|
|
109
|
+
* "user_id": true,
|
|
110
|
+
* "username": true
|
|
111
|
+
* }
|
|
112
|
+
*/
|
|
113
|
+
data: Record<string, never>;
|
|
114
|
+
/** @description Messages limit per request */
|
|
115
|
+
limit?: number;
|
|
116
|
+
};
|
|
117
|
+
SubscriptionDataDto: {
|
|
118
|
+
/**
|
|
119
|
+
* @description Chat meta data
|
|
120
|
+
* @example {
|
|
121
|
+
* "data": {
|
|
122
|
+
* "id": true,
|
|
123
|
+
* "username": true,
|
|
124
|
+
* "title": true,
|
|
125
|
+
* "type": true,
|
|
126
|
+
* "participants_count": true,
|
|
127
|
+
* "last_offset_id": true,
|
|
128
|
+
* "last_parsed_date": true,
|
|
129
|
+
* "is_locked": true,
|
|
130
|
+
* "about": true,
|
|
131
|
+
* "avatar_id": true
|
|
132
|
+
* }
|
|
133
|
+
* }
|
|
134
|
+
*/
|
|
135
|
+
chat?: components["schemas"]["SubscriptionChatDataDto"];
|
|
136
|
+
/**
|
|
137
|
+
* @description Messages data
|
|
138
|
+
* @example {
|
|
139
|
+
* "data": {
|
|
140
|
+
* "channel_id": true,
|
|
141
|
+
* "created_at": true,
|
|
142
|
+
* "first_name": true,
|
|
143
|
+
* "has_comments": true,
|
|
144
|
+
* "has_reactions": true,
|
|
145
|
+
* "last_name": true,
|
|
146
|
+
* "message_created_at": true,
|
|
147
|
+
* "message_id": true,
|
|
148
|
+
* "reply_message_id": true,
|
|
149
|
+
* "search_text": true,
|
|
150
|
+
* "text": true,
|
|
151
|
+
* "user_id": true,
|
|
152
|
+
* "username": true
|
|
153
|
+
* },
|
|
154
|
+
* "limit": 100
|
|
155
|
+
* }
|
|
156
|
+
*/
|
|
157
|
+
messages?: components["schemas"]["SubscriptionMessageDataDto"];
|
|
158
|
+
};
|
|
159
|
+
SubscribeDto: {
|
|
160
|
+
/**
|
|
161
|
+
* @description Chat Id to subscribe
|
|
162
|
+
* @example 1234567890
|
|
163
|
+
*/
|
|
164
|
+
chatId: number;
|
|
165
|
+
/** @example {
|
|
166
|
+
* "chat": {
|
|
167
|
+
* "data": {
|
|
168
|
+
* "id": true,
|
|
169
|
+
* "username": true,
|
|
170
|
+
* "title": true,
|
|
171
|
+
* "type": true,
|
|
172
|
+
* "participants_count": true,
|
|
173
|
+
* "last_offset_id": true,
|
|
174
|
+
* "last_parsed_date": true,
|
|
175
|
+
* "is_locked": true,
|
|
176
|
+
* "about": true,
|
|
177
|
+
* "avatar_id": true
|
|
178
|
+
* }
|
|
179
|
+
* },
|
|
180
|
+
* "messages": {
|
|
181
|
+
* "data": {
|
|
182
|
+
* "channel_id": true,
|
|
183
|
+
* "created_at": true,
|
|
184
|
+
* "first_name": true,
|
|
185
|
+
* "has_comments": true,
|
|
186
|
+
* "has_reactions": true,
|
|
187
|
+
* "last_name": true,
|
|
188
|
+
* "message_created_at": true,
|
|
189
|
+
* "message_id": true,
|
|
190
|
+
* "reply_message_id": true,
|
|
191
|
+
* "search_text": true,
|
|
192
|
+
* "text": true,
|
|
193
|
+
* "user_id": true,
|
|
194
|
+
* "username": true
|
|
195
|
+
* },
|
|
196
|
+
* "limit": 100
|
|
197
|
+
* }
|
|
198
|
+
* } */
|
|
199
|
+
data: components["schemas"]["SubscriptionDataDto"];
|
|
200
|
+
/**
|
|
201
|
+
* @description Webhook url
|
|
202
|
+
* @example https://example.com/webhook
|
|
203
|
+
*/
|
|
204
|
+
webhookUrl: string;
|
|
205
|
+
/**
|
|
206
|
+
* @description Short description
|
|
207
|
+
* @example to get messages from chat 123
|
|
208
|
+
*/
|
|
209
|
+
description?: string;
|
|
210
|
+
};
|
|
211
|
+
UpdateSubscribeDto: {
|
|
212
|
+
/**
|
|
213
|
+
* @description Scopes to subscribe
|
|
214
|
+
* @example {
|
|
215
|
+
* "chat": {
|
|
216
|
+
* "data": {
|
|
217
|
+
* "username": true
|
|
218
|
+
* }
|
|
219
|
+
* }
|
|
220
|
+
* }
|
|
221
|
+
*/
|
|
222
|
+
data?: components["schemas"]["SubscriptionDataDto"];
|
|
223
|
+
/**
|
|
224
|
+
* @description Webhook url
|
|
225
|
+
* @example https://example.com/webhook
|
|
226
|
+
*/
|
|
227
|
+
webhookUrl?: string;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
type $defs = Record<string, never>;
|
|
232
|
+
/**
|
|
233
|
+
* Сгенерированные из OpenAPI типы для `operations`
|
|
234
|
+
*/
|
|
235
|
+
interface operations {
|
|
236
|
+
"app.getHello": {
|
|
237
|
+
parameters: {
|
|
238
|
+
header: {
|
|
239
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
240
|
+
Authorization: string;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
responses: {
|
|
244
|
+
/** @description returns Hello World! */
|
|
245
|
+
200: {
|
|
246
|
+
headers: {
|
|
247
|
+
[name: string]: unknown;
|
|
248
|
+
};
|
|
249
|
+
content: {
|
|
250
|
+
"application/json": unknown;
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
"channels.getHello": {
|
|
256
|
+
parameters: {
|
|
257
|
+
header: {
|
|
258
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
259
|
+
Authorization: string;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
responses: {
|
|
263
|
+
/** @description returns Hello World! */
|
|
264
|
+
200: {
|
|
265
|
+
headers: {
|
|
266
|
+
[name: string]: unknown;
|
|
267
|
+
};
|
|
268
|
+
content: {
|
|
269
|
+
"application/json": unknown;
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
/** @description Unauthorized */
|
|
273
|
+
401: {
|
|
274
|
+
headers: {
|
|
275
|
+
[name: string]: unknown;
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
"channels.getLastMessage": {
|
|
281
|
+
parameters: {
|
|
282
|
+
header: {
|
|
283
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
284
|
+
Authorization: string;
|
|
285
|
+
};
|
|
286
|
+
path: {
|
|
287
|
+
channelId: number;
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
responses: {
|
|
291
|
+
/** @description Returns array with last message by channel id */
|
|
292
|
+
200: {
|
|
293
|
+
headers: {
|
|
294
|
+
[name: string]: unknown;
|
|
295
|
+
};
|
|
296
|
+
content: {
|
|
297
|
+
"application/json": unknown;
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
/** @description Unauthorized */
|
|
301
|
+
401: {
|
|
302
|
+
headers: {
|
|
303
|
+
[name: string]: unknown;
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
"channels.getMessages": {
|
|
309
|
+
parameters: {
|
|
310
|
+
header: {
|
|
311
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
312
|
+
Authorization: string;
|
|
313
|
+
};
|
|
314
|
+
path: {
|
|
315
|
+
channelId: number;
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
requestBody: {
|
|
319
|
+
content: {
|
|
320
|
+
"application/json": components["schemas"]["IGetChannelMessages"];
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
responses: {
|
|
324
|
+
/** @description Returns array of messages by channel id and cursors */
|
|
325
|
+
200: {
|
|
326
|
+
headers: {
|
|
327
|
+
[name: string]: unknown;
|
|
328
|
+
};
|
|
329
|
+
content: {
|
|
330
|
+
"application/json": unknown;
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
/** @description Unauthorized */
|
|
334
|
+
401: {
|
|
335
|
+
headers: {
|
|
336
|
+
[name: string]: unknown;
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
"subscriptions.create": {
|
|
342
|
+
parameters: {
|
|
343
|
+
header: {
|
|
344
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
345
|
+
Authorization: string;
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
requestBody: {
|
|
349
|
+
content: {
|
|
350
|
+
"application/json": components["schemas"]["SubscribeDto"];
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
responses: {
|
|
354
|
+
/** @description Subscription created, returns created subscription */
|
|
355
|
+
201: {
|
|
356
|
+
headers: {
|
|
357
|
+
[name: string]: unknown;
|
|
358
|
+
};
|
|
359
|
+
content: {
|
|
360
|
+
"application/json": components["schemas"]["SubscribeDto"];
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
/** @description Unauthorized */
|
|
364
|
+
401: {
|
|
365
|
+
headers: {
|
|
366
|
+
[name: string]: unknown;
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
"subscriptions.getById": {
|
|
372
|
+
parameters: {
|
|
373
|
+
header: {
|
|
374
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
375
|
+
Authorization: string;
|
|
376
|
+
};
|
|
377
|
+
path: {
|
|
378
|
+
subId: number;
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
responses: {
|
|
382
|
+
/** @description Subscription found, returns subscription */
|
|
383
|
+
200: {
|
|
384
|
+
headers: {
|
|
385
|
+
[name: string]: unknown;
|
|
386
|
+
};
|
|
387
|
+
content: {
|
|
388
|
+
"application/json": components["schemas"]["SubscribeDto"];
|
|
389
|
+
};
|
|
390
|
+
};
|
|
391
|
+
/** @description Invalid subscription id */
|
|
392
|
+
400: {
|
|
393
|
+
headers: {
|
|
394
|
+
[name: string]: unknown;
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
/** @description Unauthorized */
|
|
398
|
+
401: {
|
|
399
|
+
headers: {
|
|
400
|
+
[name: string]: unknown;
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
/** @description You have no rights to manipulate subscription */
|
|
404
|
+
403: {
|
|
405
|
+
headers: {
|
|
406
|
+
[name: string]: unknown;
|
|
407
|
+
};
|
|
408
|
+
};
|
|
409
|
+
};
|
|
410
|
+
};
|
|
411
|
+
"subscriptions.update": {
|
|
412
|
+
parameters: {
|
|
413
|
+
header: {
|
|
414
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
415
|
+
Authorization: string;
|
|
416
|
+
};
|
|
417
|
+
path: {
|
|
418
|
+
subId: number;
|
|
419
|
+
};
|
|
420
|
+
};
|
|
421
|
+
requestBody: {
|
|
422
|
+
content: {
|
|
423
|
+
"application/json": components["schemas"]["UpdateSubscribeDto"];
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
responses: {
|
|
427
|
+
/** @description Subscription updated, returns updated subscription */
|
|
428
|
+
200: {
|
|
429
|
+
headers: {
|
|
430
|
+
[name: string]: unknown;
|
|
431
|
+
};
|
|
432
|
+
content: {
|
|
433
|
+
"application/json": components["schemas"]["SubscribeDto"];
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
/** @description Invalid subscription id */
|
|
437
|
+
400: {
|
|
438
|
+
headers: {
|
|
439
|
+
[name: string]: unknown;
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
/** @description Unauthorized */
|
|
443
|
+
401: {
|
|
444
|
+
headers: {
|
|
445
|
+
[name: string]: unknown;
|
|
446
|
+
};
|
|
447
|
+
};
|
|
448
|
+
/** @description You have no rights to manipulate subscription */
|
|
449
|
+
403: {
|
|
450
|
+
headers: {
|
|
451
|
+
[name: string]: unknown;
|
|
452
|
+
};
|
|
453
|
+
};
|
|
454
|
+
};
|
|
455
|
+
};
|
|
456
|
+
"subscriptions.delete": {
|
|
457
|
+
parameters: {
|
|
458
|
+
header: {
|
|
459
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
460
|
+
Authorization: string;
|
|
461
|
+
};
|
|
462
|
+
path: {
|
|
463
|
+
subId: number;
|
|
464
|
+
};
|
|
465
|
+
};
|
|
466
|
+
responses: {
|
|
467
|
+
/** @description Subscription deleted, returns deleted subscription */
|
|
468
|
+
200: {
|
|
469
|
+
headers: {
|
|
470
|
+
[name: string]: unknown;
|
|
471
|
+
};
|
|
472
|
+
content: {
|
|
473
|
+
"application/json": components["schemas"]["SubscribeDto"];
|
|
474
|
+
};
|
|
475
|
+
};
|
|
476
|
+
/** @description Invalid subscription id */
|
|
477
|
+
400: {
|
|
478
|
+
headers: {
|
|
479
|
+
[name: string]: unknown;
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
/** @description Unauthorized */
|
|
483
|
+
401: {
|
|
484
|
+
headers: {
|
|
485
|
+
[name: string]: unknown;
|
|
486
|
+
};
|
|
487
|
+
};
|
|
488
|
+
/** @description You have no rights to manipulate subscription */
|
|
489
|
+
403: {
|
|
490
|
+
headers: {
|
|
491
|
+
[name: string]: unknown;
|
|
492
|
+
};
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
export type { $defs, components, operations, paths };
|