@skravets/eapi 0.0.46 → 0.0.48
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/dist/api-types.d.cts +101 -3
- package/dist/api-types.d.ts +101 -3
- package/dist/index.cjs +42 -0
- package/dist/index.d.cts +54 -17
- package/dist/index.d.ts +54 -17
- package/dist/index.js +42 -0
- package/package.json +1 -1
package/dist/api-types.d.cts
CHANGED
|
@@ -15,6 +15,14 @@ interface paths {
|
|
|
15
15
|
/** Health check */
|
|
16
16
|
get: operations["app.health"];
|
|
17
17
|
};
|
|
18
|
+
"/health/egress": {
|
|
19
|
+
/** Health check (egress) */
|
|
20
|
+
get: operations["app.healthEgress"];
|
|
21
|
+
};
|
|
22
|
+
"/health/db": {
|
|
23
|
+
/** Health check (db) */
|
|
24
|
+
get: operations["app.healthDb"];
|
|
25
|
+
};
|
|
18
26
|
"/chats": {
|
|
19
27
|
/** Get Hello World! */
|
|
20
28
|
get: operations["channels.getHello"];
|
|
@@ -51,6 +59,10 @@ interface paths {
|
|
|
51
59
|
/** Resolve telegram usernames */
|
|
52
60
|
post: operations["chats.resolveUsername"];
|
|
53
61
|
};
|
|
62
|
+
"/chats/peer-access": {
|
|
63
|
+
/** Get account access info for chats by username */
|
|
64
|
+
post: operations["chats.getPeerAccess"];
|
|
65
|
+
};
|
|
54
66
|
"/chats/user-presence": {
|
|
55
67
|
/** Search for user presence in specified chats (sync) */
|
|
56
68
|
post: operations["chats.userPresence"];
|
|
@@ -101,7 +113,7 @@ interface components {
|
|
|
101
113
|
channel_id: number;
|
|
102
114
|
/**
|
|
103
115
|
* Format: date-time
|
|
104
|
-
* @example 2026-
|
|
116
|
+
* @example 2026-02-04T11:39:14.803Z
|
|
105
117
|
*/
|
|
106
118
|
message_created_at: string;
|
|
107
119
|
/** @example 123 */
|
|
@@ -232,8 +244,8 @@ interface components {
|
|
|
232
244
|
minParticipants?: number;
|
|
233
245
|
/** @description Maximum participants count */
|
|
234
246
|
maxParticipants?: number;
|
|
235
|
-
/** @description Filter by
|
|
236
|
-
|
|
247
|
+
/** @description Filter by languages (ISO 639-1) */
|
|
248
|
+
languages?: string[];
|
|
237
249
|
/** @description Filter by keywords (any match) */
|
|
238
250
|
keywords?: string[];
|
|
239
251
|
};
|
|
@@ -359,6 +371,31 @@ interface components {
|
|
|
359
371
|
ResolveUsernamesReqDto: {
|
|
360
372
|
usernames: string[];
|
|
361
373
|
};
|
|
374
|
+
PeerAccessRequestDto: {
|
|
375
|
+
/**
|
|
376
|
+
* @description List of usernames to check access for
|
|
377
|
+
* @example [
|
|
378
|
+
* "durov",
|
|
379
|
+
* "telegram"
|
|
380
|
+
* ]
|
|
381
|
+
*/
|
|
382
|
+
usernames: string[];
|
|
383
|
+
};
|
|
384
|
+
PeerAccessItemDto: {
|
|
385
|
+
/** @description Username that was queried */
|
|
386
|
+
username: string;
|
|
387
|
+
/** @description Resolved peer ID, null if not resolved */
|
|
388
|
+
peerId?: null | number;
|
|
389
|
+
/** @description Flood wait end time for resolving username (ISO datetime) */
|
|
390
|
+
floodWaitOnResolveUsernameEndsAt?: null | string;
|
|
391
|
+
/** @description Flood wait end time for getting history (ISO datetime) */
|
|
392
|
+
floodWaitOnGetHistoryEndsAt?: null | string;
|
|
393
|
+
/** @description Spam block end time (ISO datetime) */
|
|
394
|
+
spamBlockUntil?: null | string;
|
|
395
|
+
};
|
|
396
|
+
PeerAccessResponseDto: {
|
|
397
|
+
results: components["schemas"]["PeerAccessItemDto"][];
|
|
398
|
+
};
|
|
362
399
|
ChatIdentifierDto: {
|
|
363
400
|
/**
|
|
364
401
|
* @description Chat ID (numeric)
|
|
@@ -796,6 +833,38 @@ interface operations {
|
|
|
796
833
|
};
|
|
797
834
|
};
|
|
798
835
|
};
|
|
836
|
+
"app.healthEgress": {
|
|
837
|
+
parameters: {
|
|
838
|
+
header: {
|
|
839
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
840
|
+
Authorization: string;
|
|
841
|
+
};
|
|
842
|
+
};
|
|
843
|
+
responses: {
|
|
844
|
+
/** @description OK */
|
|
845
|
+
200: {
|
|
846
|
+
headers: {
|
|
847
|
+
[name: string]: unknown;
|
|
848
|
+
};
|
|
849
|
+
};
|
|
850
|
+
};
|
|
851
|
+
};
|
|
852
|
+
"app.healthDb": {
|
|
853
|
+
parameters: {
|
|
854
|
+
header: {
|
|
855
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
856
|
+
Authorization: string;
|
|
857
|
+
};
|
|
858
|
+
};
|
|
859
|
+
responses: {
|
|
860
|
+
/** @description OK */
|
|
861
|
+
200: {
|
|
862
|
+
headers: {
|
|
863
|
+
[name: string]: unknown;
|
|
864
|
+
};
|
|
865
|
+
};
|
|
866
|
+
};
|
|
867
|
+
};
|
|
799
868
|
"channels.getHello": {
|
|
800
869
|
parameters: {
|
|
801
870
|
header: {
|
|
@@ -1066,6 +1135,35 @@ interface operations {
|
|
|
1066
1135
|
};
|
|
1067
1136
|
};
|
|
1068
1137
|
};
|
|
1138
|
+
"chats.getPeerAccess": {
|
|
1139
|
+
parameters: {
|
|
1140
|
+
header: {
|
|
1141
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
1142
|
+
Authorization: string;
|
|
1143
|
+
};
|
|
1144
|
+
};
|
|
1145
|
+
requestBody: {
|
|
1146
|
+
content: {
|
|
1147
|
+
"application/json": components["schemas"]["PeerAccessRequestDto"];
|
|
1148
|
+
};
|
|
1149
|
+
};
|
|
1150
|
+
responses: {
|
|
1151
|
+
200: {
|
|
1152
|
+
headers: {
|
|
1153
|
+
[name: string]: unknown;
|
|
1154
|
+
};
|
|
1155
|
+
content: {
|
|
1156
|
+
"application/json": components["schemas"]["PeerAccessResponseDto"];
|
|
1157
|
+
};
|
|
1158
|
+
};
|
|
1159
|
+
/** @description Unauthorized */
|
|
1160
|
+
401: {
|
|
1161
|
+
headers: {
|
|
1162
|
+
[name: string]: unknown;
|
|
1163
|
+
};
|
|
1164
|
+
};
|
|
1165
|
+
};
|
|
1166
|
+
};
|
|
1069
1167
|
"chats.userPresence": {
|
|
1070
1168
|
parameters: {
|
|
1071
1169
|
header: {
|
package/dist/api-types.d.ts
CHANGED
|
@@ -15,6 +15,14 @@ interface paths {
|
|
|
15
15
|
/** Health check */
|
|
16
16
|
get: operations["app.health"];
|
|
17
17
|
};
|
|
18
|
+
"/health/egress": {
|
|
19
|
+
/** Health check (egress) */
|
|
20
|
+
get: operations["app.healthEgress"];
|
|
21
|
+
};
|
|
22
|
+
"/health/db": {
|
|
23
|
+
/** Health check (db) */
|
|
24
|
+
get: operations["app.healthDb"];
|
|
25
|
+
};
|
|
18
26
|
"/chats": {
|
|
19
27
|
/** Get Hello World! */
|
|
20
28
|
get: operations["channels.getHello"];
|
|
@@ -51,6 +59,10 @@ interface paths {
|
|
|
51
59
|
/** Resolve telegram usernames */
|
|
52
60
|
post: operations["chats.resolveUsername"];
|
|
53
61
|
};
|
|
62
|
+
"/chats/peer-access": {
|
|
63
|
+
/** Get account access info for chats by username */
|
|
64
|
+
post: operations["chats.getPeerAccess"];
|
|
65
|
+
};
|
|
54
66
|
"/chats/user-presence": {
|
|
55
67
|
/** Search for user presence in specified chats (sync) */
|
|
56
68
|
post: operations["chats.userPresence"];
|
|
@@ -101,7 +113,7 @@ interface components {
|
|
|
101
113
|
channel_id: number;
|
|
102
114
|
/**
|
|
103
115
|
* Format: date-time
|
|
104
|
-
* @example 2026-
|
|
116
|
+
* @example 2026-02-04T11:39:14.803Z
|
|
105
117
|
*/
|
|
106
118
|
message_created_at: string;
|
|
107
119
|
/** @example 123 */
|
|
@@ -232,8 +244,8 @@ interface components {
|
|
|
232
244
|
minParticipants?: number;
|
|
233
245
|
/** @description Maximum participants count */
|
|
234
246
|
maxParticipants?: number;
|
|
235
|
-
/** @description Filter by
|
|
236
|
-
|
|
247
|
+
/** @description Filter by languages (ISO 639-1) */
|
|
248
|
+
languages?: string[];
|
|
237
249
|
/** @description Filter by keywords (any match) */
|
|
238
250
|
keywords?: string[];
|
|
239
251
|
};
|
|
@@ -359,6 +371,31 @@ interface components {
|
|
|
359
371
|
ResolveUsernamesReqDto: {
|
|
360
372
|
usernames: string[];
|
|
361
373
|
};
|
|
374
|
+
PeerAccessRequestDto: {
|
|
375
|
+
/**
|
|
376
|
+
* @description List of usernames to check access for
|
|
377
|
+
* @example [
|
|
378
|
+
* "durov",
|
|
379
|
+
* "telegram"
|
|
380
|
+
* ]
|
|
381
|
+
*/
|
|
382
|
+
usernames: string[];
|
|
383
|
+
};
|
|
384
|
+
PeerAccessItemDto: {
|
|
385
|
+
/** @description Username that was queried */
|
|
386
|
+
username: string;
|
|
387
|
+
/** @description Resolved peer ID, null if not resolved */
|
|
388
|
+
peerId?: null | number;
|
|
389
|
+
/** @description Flood wait end time for resolving username (ISO datetime) */
|
|
390
|
+
floodWaitOnResolveUsernameEndsAt?: null | string;
|
|
391
|
+
/** @description Flood wait end time for getting history (ISO datetime) */
|
|
392
|
+
floodWaitOnGetHistoryEndsAt?: null | string;
|
|
393
|
+
/** @description Spam block end time (ISO datetime) */
|
|
394
|
+
spamBlockUntil?: null | string;
|
|
395
|
+
};
|
|
396
|
+
PeerAccessResponseDto: {
|
|
397
|
+
results: components["schemas"]["PeerAccessItemDto"][];
|
|
398
|
+
};
|
|
362
399
|
ChatIdentifierDto: {
|
|
363
400
|
/**
|
|
364
401
|
* @description Chat ID (numeric)
|
|
@@ -796,6 +833,38 @@ interface operations {
|
|
|
796
833
|
};
|
|
797
834
|
};
|
|
798
835
|
};
|
|
836
|
+
"app.healthEgress": {
|
|
837
|
+
parameters: {
|
|
838
|
+
header: {
|
|
839
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
840
|
+
Authorization: string;
|
|
841
|
+
};
|
|
842
|
+
};
|
|
843
|
+
responses: {
|
|
844
|
+
/** @description OK */
|
|
845
|
+
200: {
|
|
846
|
+
headers: {
|
|
847
|
+
[name: string]: unknown;
|
|
848
|
+
};
|
|
849
|
+
};
|
|
850
|
+
};
|
|
851
|
+
};
|
|
852
|
+
"app.healthDb": {
|
|
853
|
+
parameters: {
|
|
854
|
+
header: {
|
|
855
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
856
|
+
Authorization: string;
|
|
857
|
+
};
|
|
858
|
+
};
|
|
859
|
+
responses: {
|
|
860
|
+
/** @description OK */
|
|
861
|
+
200: {
|
|
862
|
+
headers: {
|
|
863
|
+
[name: string]: unknown;
|
|
864
|
+
};
|
|
865
|
+
};
|
|
866
|
+
};
|
|
867
|
+
};
|
|
799
868
|
"channels.getHello": {
|
|
800
869
|
parameters: {
|
|
801
870
|
header: {
|
|
@@ -1066,6 +1135,35 @@ interface operations {
|
|
|
1066
1135
|
};
|
|
1067
1136
|
};
|
|
1068
1137
|
};
|
|
1138
|
+
"chats.getPeerAccess": {
|
|
1139
|
+
parameters: {
|
|
1140
|
+
header: {
|
|
1141
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
1142
|
+
Authorization: string;
|
|
1143
|
+
};
|
|
1144
|
+
};
|
|
1145
|
+
requestBody: {
|
|
1146
|
+
content: {
|
|
1147
|
+
"application/json": components["schemas"]["PeerAccessRequestDto"];
|
|
1148
|
+
};
|
|
1149
|
+
};
|
|
1150
|
+
responses: {
|
|
1151
|
+
200: {
|
|
1152
|
+
headers: {
|
|
1153
|
+
[name: string]: unknown;
|
|
1154
|
+
};
|
|
1155
|
+
content: {
|
|
1156
|
+
"application/json": components["schemas"]["PeerAccessResponseDto"];
|
|
1157
|
+
};
|
|
1158
|
+
};
|
|
1159
|
+
/** @description Unauthorized */
|
|
1160
|
+
401: {
|
|
1161
|
+
headers: {
|
|
1162
|
+
[name: string]: unknown;
|
|
1163
|
+
};
|
|
1164
|
+
};
|
|
1165
|
+
};
|
|
1166
|
+
};
|
|
1069
1167
|
"chats.userPresence": {
|
|
1070
1168
|
parameters: {
|
|
1071
1169
|
header: {
|
package/dist/index.cjs
CHANGED
|
@@ -119,6 +119,34 @@ class EApi {
|
|
|
119
119
|
*/
|
|
120
120
|
health: (options) => {
|
|
121
121
|
return this.request("/health", void 0, { method: "GET", ...options });
|
|
122
|
+
},
|
|
123
|
+
/**
|
|
124
|
+
*
|
|
125
|
+
*
|
|
126
|
+
* @tags App
|
|
127
|
+
* @summary Health check (egress)
|
|
128
|
+
*
|
|
129
|
+
* [Documentation](.../App/operation/app.healthEgress)
|
|
130
|
+
*/
|
|
131
|
+
healthEgress: (options) => {
|
|
132
|
+
return this.request("/health/egress", void 0, {
|
|
133
|
+
method: "GET",
|
|
134
|
+
...options
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
/**
|
|
138
|
+
*
|
|
139
|
+
*
|
|
140
|
+
* @tags App
|
|
141
|
+
* @summary Health check (db)
|
|
142
|
+
*
|
|
143
|
+
* [Documentation](.../App/operation/app.healthDb)
|
|
144
|
+
*/
|
|
145
|
+
healthDb: (options) => {
|
|
146
|
+
return this.request("/health/db", void 0, {
|
|
147
|
+
method: "GET",
|
|
148
|
+
...options
|
|
149
|
+
});
|
|
122
150
|
}
|
|
123
151
|
};
|
|
124
152
|
/**
|
|
@@ -248,6 +276,20 @@ class EApi {
|
|
|
248
276
|
...options
|
|
249
277
|
});
|
|
250
278
|
},
|
|
279
|
+
/**
|
|
280
|
+
*
|
|
281
|
+
*
|
|
282
|
+
* @tags chats
|
|
283
|
+
* @summary Get account access info for chats by username
|
|
284
|
+
*
|
|
285
|
+
* [Documentation](.../chats/operation/chats.getPeerAccess)
|
|
286
|
+
*/
|
|
287
|
+
getPeerAccess: (body, options) => {
|
|
288
|
+
return this.request("/chats/peer-access", body, {
|
|
289
|
+
method: "POST",
|
|
290
|
+
...options
|
|
291
|
+
});
|
|
292
|
+
},
|
|
251
293
|
/**
|
|
252
294
|
*
|
|
253
295
|
*
|
package/dist/index.d.cts
CHANGED
|
@@ -114,8 +114,19 @@ interface MessageStored {
|
|
|
114
114
|
entities: EntityItem[];
|
|
115
115
|
matchReason?: MessageMatchReason;
|
|
116
116
|
}
|
|
117
|
+
interface FarmAccount {
|
|
118
|
+
tgId: number;
|
|
119
|
+
firstName?: string;
|
|
120
|
+
lastName?: string;
|
|
121
|
+
username?: string;
|
|
122
|
+
bio?: string;
|
|
123
|
+
spamBlockUntil?: string | null;
|
|
124
|
+
floodWaitOnResolveUsernameEndsAt?: string | null;
|
|
125
|
+
floodWaitOnGetHistoryEndsAt?: string | null;
|
|
126
|
+
}
|
|
117
127
|
interface PublishersStatusQueueInputChatParsed {
|
|
118
128
|
chat: ChatStored;
|
|
129
|
+
account: FarmAccount;
|
|
119
130
|
metadata: {
|
|
120
131
|
externalId: string;
|
|
121
132
|
};
|
|
@@ -142,6 +153,7 @@ interface PublishersStatusQueueInputMessagesParsed {
|
|
|
142
153
|
boostsForUnrestrict?: number | null;
|
|
143
154
|
paidMessagePrice?: number | null;
|
|
144
155
|
};
|
|
156
|
+
account: FarmAccount;
|
|
145
157
|
offset: {
|
|
146
158
|
start: number;
|
|
147
159
|
end: number;
|
|
@@ -245,7 +257,7 @@ interface PublishersStatusQueueAccountUpdated {
|
|
|
245
257
|
interface PublishersStatusQueueAccountUpdatedResult extends PublishersStatusQueueAccountUpdated {
|
|
246
258
|
type: "account_updated";
|
|
247
259
|
}
|
|
248
|
-
type AccountUpdateChanges = AccountUnavailableUpdate | AccountProfileUpdate | AccountSpamBlockUpdate;
|
|
260
|
+
type AccountUpdateChanges = AccountUnavailableUpdate | AccountProfileUpdate | AccountSpamBlockUpdate | AccountFloodWaitUpdate;
|
|
249
261
|
interface AccountUnavailableUpdate {
|
|
250
262
|
type: "unavailable";
|
|
251
263
|
updates: {
|
|
@@ -274,6 +286,15 @@ interface AccountSpamBlockUpdate {
|
|
|
274
286
|
spamBlockReason?: string;
|
|
275
287
|
};
|
|
276
288
|
}
|
|
289
|
+
interface AccountFloodWaitUpdate {
|
|
290
|
+
type: "flood_wait";
|
|
291
|
+
updates: {
|
|
292
|
+
method: "resolve" | "getHistory" | "join" | "send";
|
|
293
|
+
floodWaitOnResolveUsernameEndsAt?: string | null;
|
|
294
|
+
floodWaitOnGetHistoryEndsAt?: string | null;
|
|
295
|
+
seconds?: number;
|
|
296
|
+
};
|
|
297
|
+
}
|
|
277
298
|
type StreamPaginatorFlushReason = "chunk-limit" | "stream-end";
|
|
278
299
|
interface StreamPaginationChunkMeta {
|
|
279
300
|
chunkIndex: number;
|
|
@@ -320,30 +341,19 @@ interface PublishersStatusQueueInputClickHouseMessagesResult {
|
|
|
320
341
|
error: string;
|
|
321
342
|
};
|
|
322
343
|
}
|
|
323
|
-
interface
|
|
344
|
+
interface PublishersStatusQueueInputGetCommonChatsResult {
|
|
345
|
+
type: "get_common_chats_result";
|
|
324
346
|
metadata: Metadata;
|
|
325
347
|
user: {
|
|
326
348
|
id: number;
|
|
327
|
-
username
|
|
328
|
-
};
|
|
329
|
-
account: {
|
|
330
|
-
id: number;
|
|
331
|
-
username?: string;
|
|
332
|
-
firstName?: string;
|
|
333
|
-
lastName?: string;
|
|
349
|
+
username: string;
|
|
334
350
|
};
|
|
335
|
-
|
|
336
|
-
chats?: Array<{
|
|
351
|
+
chats: {
|
|
337
352
|
id: number;
|
|
338
353
|
username?: string;
|
|
339
354
|
title?: string;
|
|
340
355
|
type: "chat" | "channel";
|
|
341
|
-
}
|
|
342
|
-
error?: string;
|
|
343
|
-
seconds?: number;
|
|
344
|
-
}
|
|
345
|
-
interface PublishersStatusQueueInputGetCommonChatsResult extends PublishersStatusQueueInputCommonChats {
|
|
346
|
-
type: "get_common_chats_result";
|
|
356
|
+
}[];
|
|
347
357
|
}
|
|
348
358
|
interface EventByType {
|
|
349
359
|
chat_parsed: ChatParsedTyped;
|
|
@@ -442,6 +452,24 @@ declare class EApi {
|
|
|
442
452
|
* [Documentation](.../App/operation/app.health)
|
|
443
453
|
*/
|
|
444
454
|
health: (options?: RequestOptions) => Promise<GetResponse<"/health", "get">>;
|
|
455
|
+
/**
|
|
456
|
+
*
|
|
457
|
+
*
|
|
458
|
+
* @tags App
|
|
459
|
+
* @summary Health check (egress)
|
|
460
|
+
*
|
|
461
|
+
* [Documentation](.../App/operation/app.healthEgress)
|
|
462
|
+
*/
|
|
463
|
+
healthEgress: (options?: RequestOptions) => Promise<GetResponse<"/health/egress", "get">>;
|
|
464
|
+
/**
|
|
465
|
+
*
|
|
466
|
+
*
|
|
467
|
+
* @tags App
|
|
468
|
+
* @summary Health check (db)
|
|
469
|
+
*
|
|
470
|
+
* [Documentation](.../App/operation/app.healthDb)
|
|
471
|
+
*/
|
|
472
|
+
healthDb: (options?: RequestOptions) => Promise<GetResponse<"/health/db", "get">>;
|
|
445
473
|
};
|
|
446
474
|
/**
|
|
447
475
|
* @tags chats
|
|
@@ -528,6 +556,15 @@ declare class EApi {
|
|
|
528
556
|
* [Documentation](.../chats/operation/chats.resolveUsername)
|
|
529
557
|
*/
|
|
530
558
|
resolveUsername: (body: GetRequestBody<"/chats/resolve", "post">, options?: RequestOptions) => Promise<GetResponse<"/chats/resolve", "post">>;
|
|
559
|
+
/**
|
|
560
|
+
*
|
|
561
|
+
*
|
|
562
|
+
* @tags chats
|
|
563
|
+
* @summary Get account access info for chats by username
|
|
564
|
+
*
|
|
565
|
+
* [Documentation](.../chats/operation/chats.getPeerAccess)
|
|
566
|
+
*/
|
|
567
|
+
getPeerAccess: (body: GetRequestBody<"/chats/peer-access", "post">, options?: RequestOptions) => Promise<GetResponse<"/chats/peer-access", "post">>;
|
|
531
568
|
/**
|
|
532
569
|
*
|
|
533
570
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -114,8 +114,19 @@ interface MessageStored {
|
|
|
114
114
|
entities: EntityItem[];
|
|
115
115
|
matchReason?: MessageMatchReason;
|
|
116
116
|
}
|
|
117
|
+
interface FarmAccount {
|
|
118
|
+
tgId: number;
|
|
119
|
+
firstName?: string;
|
|
120
|
+
lastName?: string;
|
|
121
|
+
username?: string;
|
|
122
|
+
bio?: string;
|
|
123
|
+
spamBlockUntil?: string | null;
|
|
124
|
+
floodWaitOnResolveUsernameEndsAt?: string | null;
|
|
125
|
+
floodWaitOnGetHistoryEndsAt?: string | null;
|
|
126
|
+
}
|
|
117
127
|
interface PublishersStatusQueueInputChatParsed {
|
|
118
128
|
chat: ChatStored;
|
|
129
|
+
account: FarmAccount;
|
|
119
130
|
metadata: {
|
|
120
131
|
externalId: string;
|
|
121
132
|
};
|
|
@@ -142,6 +153,7 @@ interface PublishersStatusQueueInputMessagesParsed {
|
|
|
142
153
|
boostsForUnrestrict?: number | null;
|
|
143
154
|
paidMessagePrice?: number | null;
|
|
144
155
|
};
|
|
156
|
+
account: FarmAccount;
|
|
145
157
|
offset: {
|
|
146
158
|
start: number;
|
|
147
159
|
end: number;
|
|
@@ -245,7 +257,7 @@ interface PublishersStatusQueueAccountUpdated {
|
|
|
245
257
|
interface PublishersStatusQueueAccountUpdatedResult extends PublishersStatusQueueAccountUpdated {
|
|
246
258
|
type: "account_updated";
|
|
247
259
|
}
|
|
248
|
-
type AccountUpdateChanges = AccountUnavailableUpdate | AccountProfileUpdate | AccountSpamBlockUpdate;
|
|
260
|
+
type AccountUpdateChanges = AccountUnavailableUpdate | AccountProfileUpdate | AccountSpamBlockUpdate | AccountFloodWaitUpdate;
|
|
249
261
|
interface AccountUnavailableUpdate {
|
|
250
262
|
type: "unavailable";
|
|
251
263
|
updates: {
|
|
@@ -274,6 +286,15 @@ interface AccountSpamBlockUpdate {
|
|
|
274
286
|
spamBlockReason?: string;
|
|
275
287
|
};
|
|
276
288
|
}
|
|
289
|
+
interface AccountFloodWaitUpdate {
|
|
290
|
+
type: "flood_wait";
|
|
291
|
+
updates: {
|
|
292
|
+
method: "resolve" | "getHistory" | "join" | "send";
|
|
293
|
+
floodWaitOnResolveUsernameEndsAt?: string | null;
|
|
294
|
+
floodWaitOnGetHistoryEndsAt?: string | null;
|
|
295
|
+
seconds?: number;
|
|
296
|
+
};
|
|
297
|
+
}
|
|
277
298
|
type StreamPaginatorFlushReason = "chunk-limit" | "stream-end";
|
|
278
299
|
interface StreamPaginationChunkMeta {
|
|
279
300
|
chunkIndex: number;
|
|
@@ -320,30 +341,19 @@ interface PublishersStatusQueueInputClickHouseMessagesResult {
|
|
|
320
341
|
error: string;
|
|
321
342
|
};
|
|
322
343
|
}
|
|
323
|
-
interface
|
|
344
|
+
interface PublishersStatusQueueInputGetCommonChatsResult {
|
|
345
|
+
type: "get_common_chats_result";
|
|
324
346
|
metadata: Metadata;
|
|
325
347
|
user: {
|
|
326
348
|
id: number;
|
|
327
|
-
username
|
|
328
|
-
};
|
|
329
|
-
account: {
|
|
330
|
-
id: number;
|
|
331
|
-
username?: string;
|
|
332
|
-
firstName?: string;
|
|
333
|
-
lastName?: string;
|
|
349
|
+
username: string;
|
|
334
350
|
};
|
|
335
|
-
|
|
336
|
-
chats?: Array<{
|
|
351
|
+
chats: {
|
|
337
352
|
id: number;
|
|
338
353
|
username?: string;
|
|
339
354
|
title?: string;
|
|
340
355
|
type: "chat" | "channel";
|
|
341
|
-
}
|
|
342
|
-
error?: string;
|
|
343
|
-
seconds?: number;
|
|
344
|
-
}
|
|
345
|
-
interface PublishersStatusQueueInputGetCommonChatsResult extends PublishersStatusQueueInputCommonChats {
|
|
346
|
-
type: "get_common_chats_result";
|
|
356
|
+
}[];
|
|
347
357
|
}
|
|
348
358
|
interface EventByType {
|
|
349
359
|
chat_parsed: ChatParsedTyped;
|
|
@@ -442,6 +452,24 @@ declare class EApi {
|
|
|
442
452
|
* [Documentation](.../App/operation/app.health)
|
|
443
453
|
*/
|
|
444
454
|
health: (options?: RequestOptions) => Promise<GetResponse<"/health", "get">>;
|
|
455
|
+
/**
|
|
456
|
+
*
|
|
457
|
+
*
|
|
458
|
+
* @tags App
|
|
459
|
+
* @summary Health check (egress)
|
|
460
|
+
*
|
|
461
|
+
* [Documentation](.../App/operation/app.healthEgress)
|
|
462
|
+
*/
|
|
463
|
+
healthEgress: (options?: RequestOptions) => Promise<GetResponse<"/health/egress", "get">>;
|
|
464
|
+
/**
|
|
465
|
+
*
|
|
466
|
+
*
|
|
467
|
+
* @tags App
|
|
468
|
+
* @summary Health check (db)
|
|
469
|
+
*
|
|
470
|
+
* [Documentation](.../App/operation/app.healthDb)
|
|
471
|
+
*/
|
|
472
|
+
healthDb: (options?: RequestOptions) => Promise<GetResponse<"/health/db", "get">>;
|
|
445
473
|
};
|
|
446
474
|
/**
|
|
447
475
|
* @tags chats
|
|
@@ -528,6 +556,15 @@ declare class EApi {
|
|
|
528
556
|
* [Documentation](.../chats/operation/chats.resolveUsername)
|
|
529
557
|
*/
|
|
530
558
|
resolveUsername: (body: GetRequestBody<"/chats/resolve", "post">, options?: RequestOptions) => Promise<GetResponse<"/chats/resolve", "post">>;
|
|
559
|
+
/**
|
|
560
|
+
*
|
|
561
|
+
*
|
|
562
|
+
* @tags chats
|
|
563
|
+
* @summary Get account access info for chats by username
|
|
564
|
+
*
|
|
565
|
+
* [Documentation](.../chats/operation/chats.getPeerAccess)
|
|
566
|
+
*/
|
|
567
|
+
getPeerAccess: (body: GetRequestBody<"/chats/peer-access", "post">, options?: RequestOptions) => Promise<GetResponse<"/chats/peer-access", "post">>;
|
|
531
568
|
/**
|
|
532
569
|
*
|
|
533
570
|
*
|
package/dist/index.js
CHANGED
|
@@ -117,6 +117,34 @@ class EApi {
|
|
|
117
117
|
*/
|
|
118
118
|
health: (options) => {
|
|
119
119
|
return this.request("/health", void 0, { method: "GET", ...options });
|
|
120
|
+
},
|
|
121
|
+
/**
|
|
122
|
+
*
|
|
123
|
+
*
|
|
124
|
+
* @tags App
|
|
125
|
+
* @summary Health check (egress)
|
|
126
|
+
*
|
|
127
|
+
* [Documentation](.../App/operation/app.healthEgress)
|
|
128
|
+
*/
|
|
129
|
+
healthEgress: (options) => {
|
|
130
|
+
return this.request("/health/egress", void 0, {
|
|
131
|
+
method: "GET",
|
|
132
|
+
...options
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
*
|
|
137
|
+
*
|
|
138
|
+
* @tags App
|
|
139
|
+
* @summary Health check (db)
|
|
140
|
+
*
|
|
141
|
+
* [Documentation](.../App/operation/app.healthDb)
|
|
142
|
+
*/
|
|
143
|
+
healthDb: (options) => {
|
|
144
|
+
return this.request("/health/db", void 0, {
|
|
145
|
+
method: "GET",
|
|
146
|
+
...options
|
|
147
|
+
});
|
|
120
148
|
}
|
|
121
149
|
};
|
|
122
150
|
/**
|
|
@@ -246,6 +274,20 @@ class EApi {
|
|
|
246
274
|
...options
|
|
247
275
|
});
|
|
248
276
|
},
|
|
277
|
+
/**
|
|
278
|
+
*
|
|
279
|
+
*
|
|
280
|
+
* @tags chats
|
|
281
|
+
* @summary Get account access info for chats by username
|
|
282
|
+
*
|
|
283
|
+
* [Documentation](.../chats/operation/chats.getPeerAccess)
|
|
284
|
+
*/
|
|
285
|
+
getPeerAccess: (body, options) => {
|
|
286
|
+
return this.request("/chats/peer-access", body, {
|
|
287
|
+
method: "POST",
|
|
288
|
+
...options
|
|
289
|
+
});
|
|
290
|
+
},
|
|
249
291
|
/**
|
|
250
292
|
*
|
|
251
293
|
*
|