@skravets/eapi 0.0.28 → 0.0.30

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.
@@ -19,6 +19,10 @@ interface paths {
19
19
  /** Get messages context around specified message IDs */
20
20
  post: operations["messages.getMessagesContext"];
21
21
  };
22
+ "/messages/search/webhook/{externalId}": {
23
+ /** Search messages by phrases and time interval (async with webhook) */
24
+ post: operations["messages.searchMessagesWebhook"];
25
+ };
22
26
  "/chats": {
23
27
  /** Get Hello World! */
24
28
  get: operations["channels.getHello"];
@@ -127,13 +131,40 @@ interface components {
127
131
  */
128
132
  messageChannelPairs: string[];
129
133
  };
134
+ SearchMessagesWebhookDto: {
135
+ /**
136
+ * @description Search phrases (comma-separated)
137
+ * @example phrase1,phrase2
138
+ */
139
+ phrases: string;
140
+ /**
141
+ * @description Number of days to search back (default: 30)
142
+ * @example 60
143
+ */
144
+ days?: number;
145
+ /**
146
+ * @description Start date for search (YYYY-MM-DD format)
147
+ * @example 2024-01-01
148
+ */
149
+ fromDate?: string;
150
+ /**
151
+ * @description End date for search (YYYY-MM-DD format)
152
+ * @example 2024-12-31
153
+ */
154
+ toDate?: string;
155
+ /**
156
+ * @description Webhook URL to send results to
157
+ * @example https://your-app.com/webhooks/messages-search
158
+ */
159
+ webhookUrl: string;
160
+ };
130
161
  /** @description Message schema */
131
162
  Message: {
132
163
  /** @example 123 */
133
164
  channel_id: number;
134
165
  /**
135
166
  * Format: date-time
136
- * @example 2025-10-28T12:34:44.820Z
167
+ * @example 2025-11-10T14:35:07.235Z
137
168
  */
138
169
  message_created_at: string;
139
170
  /** @example 123 */
@@ -547,6 +578,29 @@ interface operations {
547
578
  };
548
579
  };
549
580
  };
581
+ "messages.searchMessagesWebhook": {
582
+ parameters: {
583
+ header: {
584
+ /** @description `Basic token`, where token is `id:secret` base64 encoded */
585
+ Authorization: string;
586
+ };
587
+ path: {
588
+ externalId: string;
589
+ };
590
+ };
591
+ requestBody: {
592
+ content: {
593
+ "application/json": components["schemas"]["SearchMessagesWebhookDto"];
594
+ };
595
+ };
596
+ responses: {
597
+ 201: {
598
+ headers: {
599
+ [name: string]: unknown;
600
+ };
601
+ };
602
+ };
603
+ };
550
604
  "channels.getHello": {
551
605
  parameters: {
552
606
  header: {
@@ -19,6 +19,10 @@ interface paths {
19
19
  /** Get messages context around specified message IDs */
20
20
  post: operations["messages.getMessagesContext"];
21
21
  };
22
+ "/messages/search/webhook/{externalId}": {
23
+ /** Search messages by phrases and time interval (async with webhook) */
24
+ post: operations["messages.searchMessagesWebhook"];
25
+ };
22
26
  "/chats": {
23
27
  /** Get Hello World! */
24
28
  get: operations["channels.getHello"];
@@ -127,13 +131,40 @@ interface components {
127
131
  */
128
132
  messageChannelPairs: string[];
129
133
  };
134
+ SearchMessagesWebhookDto: {
135
+ /**
136
+ * @description Search phrases (comma-separated)
137
+ * @example phrase1,phrase2
138
+ */
139
+ phrases: string;
140
+ /**
141
+ * @description Number of days to search back (default: 30)
142
+ * @example 60
143
+ */
144
+ days?: number;
145
+ /**
146
+ * @description Start date for search (YYYY-MM-DD format)
147
+ * @example 2024-01-01
148
+ */
149
+ fromDate?: string;
150
+ /**
151
+ * @description End date for search (YYYY-MM-DD format)
152
+ * @example 2024-12-31
153
+ */
154
+ toDate?: string;
155
+ /**
156
+ * @description Webhook URL to send results to
157
+ * @example https://your-app.com/webhooks/messages-search
158
+ */
159
+ webhookUrl: string;
160
+ };
130
161
  /** @description Message schema */
131
162
  Message: {
132
163
  /** @example 123 */
133
164
  channel_id: number;
134
165
  /**
135
166
  * Format: date-time
136
- * @example 2025-10-28T12:34:44.820Z
167
+ * @example 2025-11-10T14:35:07.235Z
137
168
  */
138
169
  message_created_at: string;
139
170
  /** @example 123 */
@@ -547,6 +578,29 @@ interface operations {
547
578
  };
548
579
  };
549
580
  };
581
+ "messages.searchMessagesWebhook": {
582
+ parameters: {
583
+ header: {
584
+ /** @description `Basic token`, where token is `id:secret` base64 encoded */
585
+ Authorization: string;
586
+ };
587
+ path: {
588
+ externalId: string;
589
+ };
590
+ };
591
+ requestBody: {
592
+ content: {
593
+ "application/json": components["schemas"]["SearchMessagesWebhookDto"];
594
+ };
595
+ };
596
+ responses: {
597
+ 201: {
598
+ headers: {
599
+ [name: string]: unknown;
600
+ };
601
+ };
602
+ };
603
+ };
550
604
  "channels.getHello": {
551
605
  parameters: {
552
606
  header: {
package/dist/index.cjs CHANGED
@@ -139,6 +139,21 @@ class EApi {
139
139
  method: "POST",
140
140
  ...options
141
141
  });
142
+ },
143
+ /**
144
+ *
145
+ *
146
+ * @tags messages
147
+ * @summary Search messages by phrases and time interval (async with webhook)
148
+ *
149
+ * [Documentation](.../messages/operation/messages.searchMessagesWebhook)
150
+ */
151
+ searchMessagesWebhook: (externalId, body, options) => {
152
+ return this.request(
153
+ `/messages/search/webhook/${externalId}`,
154
+ body,
155
+ { method: "POST", ...options }
156
+ );
142
157
  }
143
158
  };
144
159
  /**
package/dist/index.d.cts CHANGED
@@ -139,13 +139,13 @@ interface PublishersStatusQueueInputAgentPrivateMessage {
139
139
  username?: string;
140
140
  first_name?: string;
141
141
  last_name?: string;
142
- is_bot?: boolean;
143
142
  };
144
143
  from: {
145
144
  id: number;
146
145
  username?: string;
147
146
  first_name?: string;
148
147
  last_name?: string;
148
+ is_bot?: boolean;
149
149
  };
150
150
  message: AgentMessage;
151
151
  }
@@ -309,6 +309,15 @@ declare class EApi {
309
309
  * [Documentation](.../messages/operation/messages.getMessagesContext)
310
310
  */
311
311
  getMessagesContext: (body: GetRequestBody<"/messages/context", "post">, options?: RequestOptions) => Promise<GetResponse<"/messages/context", "post">>;
312
+ /**
313
+ *
314
+ *
315
+ * @tags messages
316
+ * @summary Search messages by phrases and time interval (async with webhook)
317
+ *
318
+ * [Documentation](.../messages/operation/messages.searchMessagesWebhook)
319
+ */
320
+ searchMessagesWebhook: (externalId: paths["/messages/search/webhook/{externalId}"]["post"]["parameters"]["path"]["externalId"], body: GetRequestBody<"/messages/search/webhook/{externalId}", "post">, options?: RequestOptions) => Promise<GetResponse<"/messages/search/webhook/{externalId}", "post">>;
312
321
  };
313
322
  /**
314
323
  * @tags chats
package/dist/index.d.ts CHANGED
@@ -139,13 +139,13 @@ interface PublishersStatusQueueInputAgentPrivateMessage {
139
139
  username?: string;
140
140
  first_name?: string;
141
141
  last_name?: string;
142
- is_bot?: boolean;
143
142
  };
144
143
  from: {
145
144
  id: number;
146
145
  username?: string;
147
146
  first_name?: string;
148
147
  last_name?: string;
148
+ is_bot?: boolean;
149
149
  };
150
150
  message: AgentMessage;
151
151
  }
@@ -309,6 +309,15 @@ declare class EApi {
309
309
  * [Documentation](.../messages/operation/messages.getMessagesContext)
310
310
  */
311
311
  getMessagesContext: (body: GetRequestBody<"/messages/context", "post">, options?: RequestOptions) => Promise<GetResponse<"/messages/context", "post">>;
312
+ /**
313
+ *
314
+ *
315
+ * @tags messages
316
+ * @summary Search messages by phrases and time interval (async with webhook)
317
+ *
318
+ * [Documentation](.../messages/operation/messages.searchMessagesWebhook)
319
+ */
320
+ searchMessagesWebhook: (externalId: paths["/messages/search/webhook/{externalId}"]["post"]["parameters"]["path"]["externalId"], body: GetRequestBody<"/messages/search/webhook/{externalId}", "post">, options?: RequestOptions) => Promise<GetResponse<"/messages/search/webhook/{externalId}", "post">>;
312
321
  };
313
322
  /**
314
323
  * @tags chats
package/dist/index.js CHANGED
@@ -137,6 +137,21 @@ class EApi {
137
137
  method: "POST",
138
138
  ...options
139
139
  });
140
+ },
141
+ /**
142
+ *
143
+ *
144
+ * @tags messages
145
+ * @summary Search messages by phrases and time interval (async with webhook)
146
+ *
147
+ * [Documentation](.../messages/operation/messages.searchMessagesWebhook)
148
+ */
149
+ searchMessagesWebhook: (externalId, body, options) => {
150
+ return this.request(
151
+ `/messages/search/webhook/${externalId}`,
152
+ body,
153
+ { method: "POST", ...options }
154
+ );
140
155
  }
141
156
  };
142
157
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skravets/eapi",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "module": "./dist/index.js",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.ts",