@skravets/eapi 0.0.17 → 0.0.19
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 +50 -1
- package/dist/api-types.d.ts +50 -1
- package/dist/index.cjs +19 -0
- package/dist/index.d.cts +53 -1
- package/dist/index.d.ts +53 -1
- package/dist/index.js +19 -0
- package/package.json +1 -1
package/dist/api-types.d.cts
CHANGED
|
@@ -11,6 +11,10 @@ interface paths {
|
|
|
11
11
|
/** Get Hello World! */
|
|
12
12
|
get: operations["app.getHello"];
|
|
13
13
|
};
|
|
14
|
+
"/messages/search": {
|
|
15
|
+
/** Search messages by phrases and time interval */
|
|
16
|
+
post: operations["messages.searchMessages"];
|
|
17
|
+
};
|
|
14
18
|
"/chats": {
|
|
15
19
|
/** Get Hello World! */
|
|
16
20
|
get: operations["channels.getHello"];
|
|
@@ -59,13 +63,35 @@ interface paths {
|
|
|
59
63
|
*/
|
|
60
64
|
interface components {
|
|
61
65
|
schemas: {
|
|
66
|
+
SearchMessagesDto: {
|
|
67
|
+
/**
|
|
68
|
+
* @description Search phrases (comma-separated)
|
|
69
|
+
* @example phrase1,phrase2
|
|
70
|
+
*/
|
|
71
|
+
phrases: string;
|
|
72
|
+
/**
|
|
73
|
+
* @description Number of days to search back (default: 30)
|
|
74
|
+
* @example 60
|
|
75
|
+
*/
|
|
76
|
+
days?: number;
|
|
77
|
+
/**
|
|
78
|
+
* @description Start date for search (YYYY-MM-DD format)
|
|
79
|
+
* @example 2024-01-01
|
|
80
|
+
*/
|
|
81
|
+
fromDate?: string;
|
|
82
|
+
/**
|
|
83
|
+
* @description End date for search (YYYY-MM-DD format)
|
|
84
|
+
* @example 2024-12-31
|
|
85
|
+
*/
|
|
86
|
+
toDate?: string;
|
|
87
|
+
};
|
|
62
88
|
/** @description Message schema */
|
|
63
89
|
Message: {
|
|
64
90
|
/** @example 123 */
|
|
65
91
|
channel_id: number;
|
|
66
92
|
/**
|
|
67
93
|
* Format: date-time
|
|
68
|
-
* @example 2025-
|
|
94
|
+
* @example 2025-10-09T12:30:21.951Z
|
|
69
95
|
*/
|
|
70
96
|
message_created_at: string;
|
|
71
97
|
/** @example 123 */
|
|
@@ -323,6 +349,29 @@ interface operations {
|
|
|
323
349
|
};
|
|
324
350
|
};
|
|
325
351
|
};
|
|
352
|
+
"messages.searchMessages": {
|
|
353
|
+
parameters: {
|
|
354
|
+
header: {
|
|
355
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
356
|
+
Authorization: string;
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
requestBody: {
|
|
360
|
+
content: {
|
|
361
|
+
"application/json": components["schemas"]["SearchMessagesDto"];
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
responses: {
|
|
365
|
+
201: {
|
|
366
|
+
headers: {
|
|
367
|
+
[name: string]: unknown;
|
|
368
|
+
};
|
|
369
|
+
content: {
|
|
370
|
+
"application/json": Record<string, never>[];
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
};
|
|
326
375
|
"channels.getHello": {
|
|
327
376
|
parameters: {
|
|
328
377
|
header: {
|
package/dist/api-types.d.ts
CHANGED
|
@@ -11,6 +11,10 @@ interface paths {
|
|
|
11
11
|
/** Get Hello World! */
|
|
12
12
|
get: operations["app.getHello"];
|
|
13
13
|
};
|
|
14
|
+
"/messages/search": {
|
|
15
|
+
/** Search messages by phrases and time interval */
|
|
16
|
+
post: operations["messages.searchMessages"];
|
|
17
|
+
};
|
|
14
18
|
"/chats": {
|
|
15
19
|
/** Get Hello World! */
|
|
16
20
|
get: operations["channels.getHello"];
|
|
@@ -59,13 +63,35 @@ interface paths {
|
|
|
59
63
|
*/
|
|
60
64
|
interface components {
|
|
61
65
|
schemas: {
|
|
66
|
+
SearchMessagesDto: {
|
|
67
|
+
/**
|
|
68
|
+
* @description Search phrases (comma-separated)
|
|
69
|
+
* @example phrase1,phrase2
|
|
70
|
+
*/
|
|
71
|
+
phrases: string;
|
|
72
|
+
/**
|
|
73
|
+
* @description Number of days to search back (default: 30)
|
|
74
|
+
* @example 60
|
|
75
|
+
*/
|
|
76
|
+
days?: number;
|
|
77
|
+
/**
|
|
78
|
+
* @description Start date for search (YYYY-MM-DD format)
|
|
79
|
+
* @example 2024-01-01
|
|
80
|
+
*/
|
|
81
|
+
fromDate?: string;
|
|
82
|
+
/**
|
|
83
|
+
* @description End date for search (YYYY-MM-DD format)
|
|
84
|
+
* @example 2024-12-31
|
|
85
|
+
*/
|
|
86
|
+
toDate?: string;
|
|
87
|
+
};
|
|
62
88
|
/** @description Message schema */
|
|
63
89
|
Message: {
|
|
64
90
|
/** @example 123 */
|
|
65
91
|
channel_id: number;
|
|
66
92
|
/**
|
|
67
93
|
* Format: date-time
|
|
68
|
-
* @example 2025-
|
|
94
|
+
* @example 2025-10-09T12:30:21.951Z
|
|
69
95
|
*/
|
|
70
96
|
message_created_at: string;
|
|
71
97
|
/** @example 123 */
|
|
@@ -323,6 +349,29 @@ interface operations {
|
|
|
323
349
|
};
|
|
324
350
|
};
|
|
325
351
|
};
|
|
352
|
+
"messages.searchMessages": {
|
|
353
|
+
parameters: {
|
|
354
|
+
header: {
|
|
355
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
356
|
+
Authorization: string;
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
requestBody: {
|
|
360
|
+
content: {
|
|
361
|
+
"application/json": components["schemas"]["SearchMessagesDto"];
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
responses: {
|
|
365
|
+
201: {
|
|
366
|
+
headers: {
|
|
367
|
+
[name: string]: unknown;
|
|
368
|
+
};
|
|
369
|
+
content: {
|
|
370
|
+
"application/json": Record<string, never>[];
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
};
|
|
326
375
|
"channels.getHello": {
|
|
327
376
|
parameters: {
|
|
328
377
|
header: {
|
package/dist/index.cjs
CHANGED
|
@@ -108,6 +108,25 @@ class EApi {
|
|
|
108
108
|
return this.request("/", void 0, { method: "GET", ...options });
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
|
+
/**
|
|
112
|
+
* @tags messages
|
|
113
|
+
*/
|
|
114
|
+
messages = {
|
|
115
|
+
/**
|
|
116
|
+
*
|
|
117
|
+
*
|
|
118
|
+
* @tags messages
|
|
119
|
+
* @summary Search messages by phrases and time interval
|
|
120
|
+
*
|
|
121
|
+
* [Documentation](.../messages/operation/messages.searchMessages)
|
|
122
|
+
*/
|
|
123
|
+
searchMessages: (body, options) => {
|
|
124
|
+
return this.request("/messages/search", body, {
|
|
125
|
+
method: "POST",
|
|
126
|
+
...options
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
};
|
|
111
130
|
/**
|
|
112
131
|
* @tags chats
|
|
113
132
|
*/
|
package/dist/index.d.cts
CHANGED
|
@@ -33,6 +33,7 @@ interface ChatStored {
|
|
|
33
33
|
last_offset_id: number;
|
|
34
34
|
last_parsed_date: string;
|
|
35
35
|
is_locked: boolean;
|
|
36
|
+
linked_chat_id: number | null;
|
|
36
37
|
}
|
|
37
38
|
interface MessageStored {
|
|
38
39
|
channel_id: number;
|
|
@@ -161,6 +162,42 @@ interface PublishersStatusQueueParsingError {
|
|
|
161
162
|
interface PublishersStatusQueueParsingErrorResult extends PublishersStatusQueueParsingError {
|
|
162
163
|
type: "parsing_error";
|
|
163
164
|
}
|
|
165
|
+
interface PublishersStatusQueueAccountUpdated {
|
|
166
|
+
phone: string;
|
|
167
|
+
changes: AccountUpdateChanges;
|
|
168
|
+
}
|
|
169
|
+
interface PublishersStatusQueueAccountUpdatedResult extends PublishersStatusQueueAccountUpdated {
|
|
170
|
+
type: "account_updated";
|
|
171
|
+
}
|
|
172
|
+
type AccountUpdateChanges = AccountUnavailableUpdate | AccountProfileUpdate | AccountSpamBlockUpdate;
|
|
173
|
+
interface AccountUnavailableUpdate {
|
|
174
|
+
type: "unavailable";
|
|
175
|
+
updates: {
|
|
176
|
+
isBanned?: boolean;
|
|
177
|
+
isDisabled?: boolean;
|
|
178
|
+
isAccountFrozen?: boolean;
|
|
179
|
+
isAuthKeyDuplicated?: boolean;
|
|
180
|
+
isSessionRevoked?: boolean;
|
|
181
|
+
isAuthKeyUnregistered?: boolean;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
interface AccountProfileUpdate {
|
|
185
|
+
type: "profile";
|
|
186
|
+
updates: {
|
|
187
|
+
tgId?: number;
|
|
188
|
+
firstName?: string;
|
|
189
|
+
lastName?: string;
|
|
190
|
+
username?: string;
|
|
191
|
+
bio?: string;
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
interface AccountSpamBlockUpdate {
|
|
195
|
+
type: "spam_block";
|
|
196
|
+
updates: {
|
|
197
|
+
spamBlockUntil?: string | null;
|
|
198
|
+
spamBlockReason?: string;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
164
201
|
interface EventByType {
|
|
165
202
|
chat_parsed: ChatParsedTyped;
|
|
166
203
|
messages_parsed: MessagesParsedTyped;
|
|
@@ -168,8 +205,9 @@ interface EventByType {
|
|
|
168
205
|
chat_send_result: PublishersStatusQueueInputSendResult;
|
|
169
206
|
agent_private_message: PublishersStatusQueueInputAgentPrivateMessageResult;
|
|
170
207
|
parsing_error: PublishersStatusQueueParsingErrorResult;
|
|
208
|
+
account_updated: PublishersStatusQueueAccountUpdatedResult;
|
|
171
209
|
}
|
|
172
|
-
type WebhookBody = ChatParsedTyped | MessagesParsedTyped | PublishersStatusQueueInputJoinResult | PublishersStatusQueueInputSendResult | PublishersStatusQueueInputAgentPrivateMessageResult | PublishersStatusQueueParsingErrorResult;
|
|
210
|
+
type WebhookBody = ChatParsedTyped | MessagesParsedTyped | PublishersStatusQueueInputJoinResult | PublishersStatusQueueInputSendResult | PublishersStatusQueueInputAgentPrivateMessageResult | PublishersStatusQueueParsingErrorResult | PublishersStatusQueueAccountUpdatedResult;
|
|
173
211
|
type WebhookBodyTypes = keyof EventByType;
|
|
174
212
|
|
|
175
213
|
declare const frameworks: {
|
|
@@ -247,6 +285,20 @@ declare class EApi {
|
|
|
247
285
|
*/
|
|
248
286
|
getHello: (options?: RequestOptions) => Promise<GetResponse<"/", "get">>;
|
|
249
287
|
};
|
|
288
|
+
/**
|
|
289
|
+
* @tags messages
|
|
290
|
+
*/
|
|
291
|
+
messages: {
|
|
292
|
+
/**
|
|
293
|
+
*
|
|
294
|
+
*
|
|
295
|
+
* @tags messages
|
|
296
|
+
* @summary Search messages by phrases and time interval
|
|
297
|
+
*
|
|
298
|
+
* [Documentation](.../messages/operation/messages.searchMessages)
|
|
299
|
+
*/
|
|
300
|
+
searchMessages: (body: GetRequestBody<"/messages/search", "post">, options?: RequestOptions) => Promise<GetResponse<"/messages/search", "post">>;
|
|
301
|
+
};
|
|
250
302
|
/**
|
|
251
303
|
* @tags chats
|
|
252
304
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ interface ChatStored {
|
|
|
33
33
|
last_offset_id: number;
|
|
34
34
|
last_parsed_date: string;
|
|
35
35
|
is_locked: boolean;
|
|
36
|
+
linked_chat_id: number | null;
|
|
36
37
|
}
|
|
37
38
|
interface MessageStored {
|
|
38
39
|
channel_id: number;
|
|
@@ -161,6 +162,42 @@ interface PublishersStatusQueueParsingError {
|
|
|
161
162
|
interface PublishersStatusQueueParsingErrorResult extends PublishersStatusQueueParsingError {
|
|
162
163
|
type: "parsing_error";
|
|
163
164
|
}
|
|
165
|
+
interface PublishersStatusQueueAccountUpdated {
|
|
166
|
+
phone: string;
|
|
167
|
+
changes: AccountUpdateChanges;
|
|
168
|
+
}
|
|
169
|
+
interface PublishersStatusQueueAccountUpdatedResult extends PublishersStatusQueueAccountUpdated {
|
|
170
|
+
type: "account_updated";
|
|
171
|
+
}
|
|
172
|
+
type AccountUpdateChanges = AccountUnavailableUpdate | AccountProfileUpdate | AccountSpamBlockUpdate;
|
|
173
|
+
interface AccountUnavailableUpdate {
|
|
174
|
+
type: "unavailable";
|
|
175
|
+
updates: {
|
|
176
|
+
isBanned?: boolean;
|
|
177
|
+
isDisabled?: boolean;
|
|
178
|
+
isAccountFrozen?: boolean;
|
|
179
|
+
isAuthKeyDuplicated?: boolean;
|
|
180
|
+
isSessionRevoked?: boolean;
|
|
181
|
+
isAuthKeyUnregistered?: boolean;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
interface AccountProfileUpdate {
|
|
185
|
+
type: "profile";
|
|
186
|
+
updates: {
|
|
187
|
+
tgId?: number;
|
|
188
|
+
firstName?: string;
|
|
189
|
+
lastName?: string;
|
|
190
|
+
username?: string;
|
|
191
|
+
bio?: string;
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
interface AccountSpamBlockUpdate {
|
|
195
|
+
type: "spam_block";
|
|
196
|
+
updates: {
|
|
197
|
+
spamBlockUntil?: string | null;
|
|
198
|
+
spamBlockReason?: string;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
164
201
|
interface EventByType {
|
|
165
202
|
chat_parsed: ChatParsedTyped;
|
|
166
203
|
messages_parsed: MessagesParsedTyped;
|
|
@@ -168,8 +205,9 @@ interface EventByType {
|
|
|
168
205
|
chat_send_result: PublishersStatusQueueInputSendResult;
|
|
169
206
|
agent_private_message: PublishersStatusQueueInputAgentPrivateMessageResult;
|
|
170
207
|
parsing_error: PublishersStatusQueueParsingErrorResult;
|
|
208
|
+
account_updated: PublishersStatusQueueAccountUpdatedResult;
|
|
171
209
|
}
|
|
172
|
-
type WebhookBody = ChatParsedTyped | MessagesParsedTyped | PublishersStatusQueueInputJoinResult | PublishersStatusQueueInputSendResult | PublishersStatusQueueInputAgentPrivateMessageResult | PublishersStatusQueueParsingErrorResult;
|
|
210
|
+
type WebhookBody = ChatParsedTyped | MessagesParsedTyped | PublishersStatusQueueInputJoinResult | PublishersStatusQueueInputSendResult | PublishersStatusQueueInputAgentPrivateMessageResult | PublishersStatusQueueParsingErrorResult | PublishersStatusQueueAccountUpdatedResult;
|
|
173
211
|
type WebhookBodyTypes = keyof EventByType;
|
|
174
212
|
|
|
175
213
|
declare const frameworks: {
|
|
@@ -247,6 +285,20 @@ declare class EApi {
|
|
|
247
285
|
*/
|
|
248
286
|
getHello: (options?: RequestOptions) => Promise<GetResponse<"/", "get">>;
|
|
249
287
|
};
|
|
288
|
+
/**
|
|
289
|
+
* @tags messages
|
|
290
|
+
*/
|
|
291
|
+
messages: {
|
|
292
|
+
/**
|
|
293
|
+
*
|
|
294
|
+
*
|
|
295
|
+
* @tags messages
|
|
296
|
+
* @summary Search messages by phrases and time interval
|
|
297
|
+
*
|
|
298
|
+
* [Documentation](.../messages/operation/messages.searchMessages)
|
|
299
|
+
*/
|
|
300
|
+
searchMessages: (body: GetRequestBody<"/messages/search", "post">, options?: RequestOptions) => Promise<GetResponse<"/messages/search", "post">>;
|
|
301
|
+
};
|
|
250
302
|
/**
|
|
251
303
|
* @tags chats
|
|
252
304
|
*/
|
package/dist/index.js
CHANGED
|
@@ -106,6 +106,25 @@ class EApi {
|
|
|
106
106
|
return this.request("/", void 0, { method: "GET", ...options });
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
|
+
/**
|
|
110
|
+
* @tags messages
|
|
111
|
+
*/
|
|
112
|
+
messages = {
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
*
|
|
116
|
+
* @tags messages
|
|
117
|
+
* @summary Search messages by phrases and time interval
|
|
118
|
+
*
|
|
119
|
+
* [Documentation](.../messages/operation/messages.searchMessages)
|
|
120
|
+
*/
|
|
121
|
+
searchMessages: (body, options) => {
|
|
122
|
+
return this.request("/messages/search", body, {
|
|
123
|
+
method: "POST",
|
|
124
|
+
...options
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
};
|
|
109
128
|
/**
|
|
110
129
|
* @tags chats
|
|
111
130
|
*/
|