@skravets/eapi 0.0.11 → 0.0.13

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.
@@ -35,6 +35,10 @@ interface paths {
35
35
  /** Add task to send message */
36
36
  post: operations["chats.send"];
37
37
  };
38
+ "/chats/{chat}/delete/{externalId}": {
39
+ /** Add task to delete messages */
40
+ post: operations["chats.deleteMessages"];
41
+ };
38
42
  "/subscriptions": {
39
43
  /** Upsert subscription */
40
44
  put: operations["subscriptions.upsert"];
@@ -61,7 +65,7 @@ interface components {
61
65
  channel_id: number;
62
66
  /**
63
67
  * Format: date-time
64
- * @example 2025-08-22T12:15:09.377Z
68
+ * @example 2025-08-25T12:12:30.286Z
65
69
  */
66
70
  message_created_at: string;
67
71
  /** @example 123 */
@@ -146,6 +150,22 @@ interface components {
146
150
  */
147
151
  webhookUrl: string;
148
152
  };
153
+ IDeleteMessage: {
154
+ /**
155
+ * @description Message ids to delete
156
+ * @example [
157
+ * 1,
158
+ * 2,
159
+ * 3
160
+ * ]
161
+ */
162
+ messageIds: number[];
163
+ /**
164
+ * @description Account id
165
+ * @example 1
166
+ */
167
+ accountId: number;
168
+ };
149
169
  /** @description Which fields of chat to return */
150
170
  ChatData: {
151
171
  /** @default false */
@@ -476,6 +496,38 @@ interface operations {
476
496
  };
477
497
  };
478
498
  };
499
+ "chats.deleteMessages": {
500
+ parameters: {
501
+ header: {
502
+ /** @description `Basic token`, where token is `id:secret` base64 encoded */
503
+ Authorization: string;
504
+ };
505
+ path: {
506
+ /** @description External id of the task */
507
+ externalId: string;
508
+ /** @description `Chat id` or `username` */
509
+ chat: number | string;
510
+ };
511
+ };
512
+ requestBody: {
513
+ content: {
514
+ "application/json": components["schemas"]["IDeleteMessage"];
515
+ };
516
+ };
517
+ responses: {
518
+ 200: {
519
+ headers: {
520
+ [name: string]: unknown;
521
+ };
522
+ };
523
+ /** @description Unauthorized */
524
+ 401: {
525
+ headers: {
526
+ [name: string]: unknown;
527
+ };
528
+ };
529
+ };
530
+ };
479
531
  "subscriptions.upsert": {
480
532
  parameters: {
481
533
  header: {
@@ -35,6 +35,10 @@ interface paths {
35
35
  /** Add task to send message */
36
36
  post: operations["chats.send"];
37
37
  };
38
+ "/chats/{chat}/delete/{externalId}": {
39
+ /** Add task to delete messages */
40
+ post: operations["chats.deleteMessages"];
41
+ };
38
42
  "/subscriptions": {
39
43
  /** Upsert subscription */
40
44
  put: operations["subscriptions.upsert"];
@@ -61,7 +65,7 @@ interface components {
61
65
  channel_id: number;
62
66
  /**
63
67
  * Format: date-time
64
- * @example 2025-08-22T12:15:09.377Z
68
+ * @example 2025-08-25T12:12:30.286Z
65
69
  */
66
70
  message_created_at: string;
67
71
  /** @example 123 */
@@ -146,6 +150,22 @@ interface components {
146
150
  */
147
151
  webhookUrl: string;
148
152
  };
153
+ IDeleteMessage: {
154
+ /**
155
+ * @description Message ids to delete
156
+ * @example [
157
+ * 1,
158
+ * 2,
159
+ * 3
160
+ * ]
161
+ */
162
+ messageIds: number[];
163
+ /**
164
+ * @description Account id
165
+ * @example 1
166
+ */
167
+ accountId: number;
168
+ };
149
169
  /** @description Which fields of chat to return */
150
170
  ChatData: {
151
171
  /** @default false */
@@ -476,6 +496,38 @@ interface operations {
476
496
  };
477
497
  };
478
498
  };
499
+ "chats.deleteMessages": {
500
+ parameters: {
501
+ header: {
502
+ /** @description `Basic token`, where token is `id:secret` base64 encoded */
503
+ Authorization: string;
504
+ };
505
+ path: {
506
+ /** @description External id of the task */
507
+ externalId: string;
508
+ /** @description `Chat id` or `username` */
509
+ chat: number | string;
510
+ };
511
+ };
512
+ requestBody: {
513
+ content: {
514
+ "application/json": components["schemas"]["IDeleteMessage"];
515
+ };
516
+ };
517
+ responses: {
518
+ 200: {
519
+ headers: {
520
+ [name: string]: unknown;
521
+ };
522
+ };
523
+ /** @description Unauthorized */
524
+ 401: {
525
+ headers: {
526
+ [name: string]: unknown;
527
+ };
528
+ };
529
+ };
530
+ };
479
531
  "subscriptions.upsert": {
480
532
  parameters: {
481
533
  header: {
package/dist/index.cjs CHANGED
@@ -192,6 +192,20 @@ class EApi {
192
192
  method: "POST",
193
193
  ...options
194
194
  });
195
+ },
196
+ /**
197
+ *
198
+ *
199
+ * @tags chats
200
+ * @summary Add task to delete messages
201
+ *
202
+ * [Documentation](.../chats/operation/chats.deleteMessages)
203
+ */
204
+ deleteMessages: (externalId, chat, body, options) => {
205
+ return this.request(`/chats/${chat}/delete/${externalId}`, body, {
206
+ method: "POST",
207
+ ...options
208
+ });
195
209
  }
196
210
  };
197
211
  /**
package/dist/index.d.cts CHANGED
@@ -111,13 +111,38 @@ interface PublishersStatusQueueInputSend {
111
111
  interface PublishersStatusQueueInputSendResult extends PublishersStatusQueueInputSend {
112
112
  type: "chat_send_result";
113
113
  }
114
+ interface AgentMessage {
115
+ id: number;
116
+ text: string;
117
+ reply_message_id?: number;
118
+ created_at: string;
119
+ }
120
+ interface PublishersStatusQueueInputAgentPrivateMessage {
121
+ agent: {
122
+ id: number;
123
+ username?: string;
124
+ first_name?: string;
125
+ last_name?: string;
126
+ };
127
+ from: {
128
+ id: number;
129
+ username?: string;
130
+ first_name?: string;
131
+ last_name?: string;
132
+ };
133
+ message: AgentMessage;
134
+ }
135
+ interface PublishersStatusQueueInputAgentPrivateMessageResult extends PublishersStatusQueueInputAgentPrivateMessage {
136
+ type: "agent_private_message";
137
+ }
114
138
  interface EventByType {
115
139
  chat_parsed: ChatParsedTyped;
116
140
  messages_parsed: MessagesParsedTyped;
117
141
  chat_join_result: PublishersStatusQueueInputJoinResult;
118
142
  chat_send_result: PublishersStatusQueueInputSendResult;
143
+ agent_private_message: PublishersStatusQueueInputAgentPrivateMessageResult;
119
144
  }
120
- type WebhookBody = ChatParsedTyped | MessagesParsedTyped | PublishersStatusQueueInputJoinResult | PublishersStatusQueueInputSendResult;
145
+ type WebhookBody = ChatParsedTyped | MessagesParsedTyped | PublishersStatusQueueInputJoinResult | PublishersStatusQueueInputSendResult | PublishersStatusQueueInputAgentPrivateMessageResult;
121
146
  type WebhookBodyTypes = keyof EventByType;
122
147
 
123
148
  declare const frameworks: {
@@ -253,6 +278,15 @@ declare class EApi {
253
278
  * [Documentation](.../chats/operation/chats.send)
254
279
  */
255
280
  send: (externalId: paths["/chats/{chat}/send/{externalId}"]["post"]["parameters"]["path"]["externalId"], chat: paths["/chats/{chat}/send/{externalId}"]["post"]["parameters"]["path"]["chat"], body: GetRequestBody<"/chats/{chat}/send/{externalId}", "post">, options?: RequestOptions) => Promise<GetResponse<"/chats/{chat}/send/{externalId}", "post">>;
281
+ /**
282
+ *
283
+ *
284
+ * @tags chats
285
+ * @summary Add task to delete messages
286
+ *
287
+ * [Documentation](.../chats/operation/chats.deleteMessages)
288
+ */
289
+ deleteMessages: (externalId: paths["/chats/{chat}/delete/{externalId}"]["post"]["parameters"]["path"]["externalId"], chat: paths["/chats/{chat}/delete/{externalId}"]["post"]["parameters"]["path"]["chat"], body: GetRequestBody<"/chats/{chat}/delete/{externalId}", "post">, options?: RequestOptions) => Promise<GetResponse<"/chats/{chat}/delete/{externalId}", "post">>;
256
290
  };
257
291
  /**
258
292
  * @tags subscriptions
package/dist/index.d.ts CHANGED
@@ -111,13 +111,38 @@ interface PublishersStatusQueueInputSend {
111
111
  interface PublishersStatusQueueInputSendResult extends PublishersStatusQueueInputSend {
112
112
  type: "chat_send_result";
113
113
  }
114
+ interface AgentMessage {
115
+ id: number;
116
+ text: string;
117
+ reply_message_id?: number;
118
+ created_at: string;
119
+ }
120
+ interface PublishersStatusQueueInputAgentPrivateMessage {
121
+ agent: {
122
+ id: number;
123
+ username?: string;
124
+ first_name?: string;
125
+ last_name?: string;
126
+ };
127
+ from: {
128
+ id: number;
129
+ username?: string;
130
+ first_name?: string;
131
+ last_name?: string;
132
+ };
133
+ message: AgentMessage;
134
+ }
135
+ interface PublishersStatusQueueInputAgentPrivateMessageResult extends PublishersStatusQueueInputAgentPrivateMessage {
136
+ type: "agent_private_message";
137
+ }
114
138
  interface EventByType {
115
139
  chat_parsed: ChatParsedTyped;
116
140
  messages_parsed: MessagesParsedTyped;
117
141
  chat_join_result: PublishersStatusQueueInputJoinResult;
118
142
  chat_send_result: PublishersStatusQueueInputSendResult;
143
+ agent_private_message: PublishersStatusQueueInputAgentPrivateMessageResult;
119
144
  }
120
- type WebhookBody = ChatParsedTyped | MessagesParsedTyped | PublishersStatusQueueInputJoinResult | PublishersStatusQueueInputSendResult;
145
+ type WebhookBody = ChatParsedTyped | MessagesParsedTyped | PublishersStatusQueueInputJoinResult | PublishersStatusQueueInputSendResult | PublishersStatusQueueInputAgentPrivateMessageResult;
121
146
  type WebhookBodyTypes = keyof EventByType;
122
147
 
123
148
  declare const frameworks: {
@@ -253,6 +278,15 @@ declare class EApi {
253
278
  * [Documentation](.../chats/operation/chats.send)
254
279
  */
255
280
  send: (externalId: paths["/chats/{chat}/send/{externalId}"]["post"]["parameters"]["path"]["externalId"], chat: paths["/chats/{chat}/send/{externalId}"]["post"]["parameters"]["path"]["chat"], body: GetRequestBody<"/chats/{chat}/send/{externalId}", "post">, options?: RequestOptions) => Promise<GetResponse<"/chats/{chat}/send/{externalId}", "post">>;
281
+ /**
282
+ *
283
+ *
284
+ * @tags chats
285
+ * @summary Add task to delete messages
286
+ *
287
+ * [Documentation](.../chats/operation/chats.deleteMessages)
288
+ */
289
+ deleteMessages: (externalId: paths["/chats/{chat}/delete/{externalId}"]["post"]["parameters"]["path"]["externalId"], chat: paths["/chats/{chat}/delete/{externalId}"]["post"]["parameters"]["path"]["chat"], body: GetRequestBody<"/chats/{chat}/delete/{externalId}", "post">, options?: RequestOptions) => Promise<GetResponse<"/chats/{chat}/delete/{externalId}", "post">>;
256
290
  };
257
291
  /**
258
292
  * @tags subscriptions
package/dist/index.js CHANGED
@@ -190,6 +190,20 @@ class EApi {
190
190
  method: "POST",
191
191
  ...options
192
192
  });
193
+ },
194
+ /**
195
+ *
196
+ *
197
+ * @tags chats
198
+ * @summary Add task to delete messages
199
+ *
200
+ * [Documentation](.../chats/operation/chats.deleteMessages)
201
+ */
202
+ deleteMessages: (externalId, chat, body, options) => {
203
+ return this.request(`/chats/${chat}/delete/${externalId}`, body, {
204
+ method: "POST",
205
+ ...options
206
+ });
193
207
  }
194
208
  };
195
209
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skravets/eapi",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "module": "./dist/index.js",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.ts",