@skravets/eapi 0.0.2 → 0.0.3

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.
@@ -61,7 +61,7 @@ interface components {
61
61
  channel_id: number;
62
62
  /**
63
63
  * Format: date-time
64
- * @example 2025-08-11T22:51:35.630Z
64
+ * @example 2025-08-11T23:03:13.539Z
65
65
  */
66
66
  message_created_at: string;
67
67
  /** @example 123 */
@@ -83,17 +83,39 @@ interface components {
83
83
  */
84
84
  cursor: Record<string, never>;
85
85
  };
86
- ISendMessage: {
86
+ IJoin: {
87
+ /**
88
+ * @description Account id
89
+ * @example 1
90
+ */
91
+ accountId: number;
92
+ };
93
+ ISendMessageMessage: {
87
94
  /**
88
95
  * @description Message to send
89
96
  * @example Hello, world!
90
97
  */
91
- message: string;
98
+ text: string;
92
99
  /**
93
100
  * @description Message id to reply to
94
101
  * @example 123
95
102
  */
96
- replyToId: string;
103
+ replyToId: number;
104
+ };
105
+ ISendMessage: {
106
+ /**
107
+ * @description Message to send
108
+ * @example {
109
+ * "text": "Hello, world!",
110
+ * "replyToId": 123
111
+ * }
112
+ */
113
+ message: components["schemas"]["ISendMessageMessage"];
114
+ /**
115
+ * @description Account id
116
+ * @example 1
117
+ */
118
+ accountId: number;
97
119
  };
98
120
  /** @description Which fields of chat to return */
99
121
  ChatData: {
@@ -374,6 +396,11 @@ interface operations {
374
396
  chat: number | string;
375
397
  };
376
398
  };
399
+ requestBody: {
400
+ content: {
401
+ "application/json": components["schemas"]["IJoin"];
402
+ };
403
+ };
377
404
  responses: {
378
405
  200: {
379
406
  headers: {
@@ -61,7 +61,7 @@ interface components {
61
61
  channel_id: number;
62
62
  /**
63
63
  * Format: date-time
64
- * @example 2025-08-11T22:51:35.630Z
64
+ * @example 2025-08-11T23:03:13.539Z
65
65
  */
66
66
  message_created_at: string;
67
67
  /** @example 123 */
@@ -83,17 +83,39 @@ interface components {
83
83
  */
84
84
  cursor: Record<string, never>;
85
85
  };
86
- ISendMessage: {
86
+ IJoin: {
87
+ /**
88
+ * @description Account id
89
+ * @example 1
90
+ */
91
+ accountId: number;
92
+ };
93
+ ISendMessageMessage: {
87
94
  /**
88
95
  * @description Message to send
89
96
  * @example Hello, world!
90
97
  */
91
- message: string;
98
+ text: string;
92
99
  /**
93
100
  * @description Message id to reply to
94
101
  * @example 123
95
102
  */
96
- replyToId: string;
103
+ replyToId: number;
104
+ };
105
+ ISendMessage: {
106
+ /**
107
+ * @description Message to send
108
+ * @example {
109
+ * "text": "Hello, world!",
110
+ * "replyToId": 123
111
+ * }
112
+ */
113
+ message: components["schemas"]["ISendMessageMessage"];
114
+ /**
115
+ * @description Account id
116
+ * @example 1
117
+ */
118
+ accountId: number;
97
119
  };
98
120
  /** @description Which fields of chat to return */
99
121
  ChatData: {
@@ -374,6 +396,11 @@ interface operations {
374
396
  chat: number | string;
375
397
  };
376
398
  };
399
+ requestBody: {
400
+ content: {
401
+ "application/json": components["schemas"]["IJoin"];
402
+ };
403
+ };
377
404
  responses: {
378
405
  200: {
379
406
  headers: {
package/dist/index.cjs CHANGED
@@ -155,8 +155,8 @@ class EApi {
155
155
  *
156
156
  * [Documentation](.../chats/operation/chats.join)
157
157
  */
158
- join: (externalId, chat, options) => {
159
- return this.request(`/chats/${chat}/join/${externalId}`, void 0, { method: "POST", ...options });
158
+ join: (externalId, chat, body, options) => {
159
+ return this.request(`/chats/${chat}/join/${externalId}`, body, { method: "POST", ...options });
160
160
  },
161
161
  /**
162
162
  *
package/dist/index.d.cts CHANGED
@@ -27,7 +27,7 @@ interface ChatStored {
27
27
  username: string;
28
28
  title: string;
29
29
  about: string;
30
- type: "group" | "channel";
30
+ type: 'group' | 'channel';
31
31
  participants_count: number;
32
32
  avatar_id: string | null;
33
33
  last_offset_id: number;
@@ -50,12 +50,12 @@ interface MessageStored {
50
50
  }
51
51
  interface PublishersStatusQueueInputChatParsed {
52
52
  chat: ChatStored;
53
- metadata?: {
54
- externalId?: string;
53
+ metadata: {
54
+ externalId: string;
55
55
  };
56
56
  }
57
57
  interface ChatParsedTyped extends PublishersStatusQueueInputChatParsed {
58
- type: "chat_parsed";
58
+ type: 'chat_parsed';
59
59
  }
60
60
  interface PublishersStatusQueueInputMessagesParsed {
61
61
  chat: {
@@ -68,18 +68,55 @@ interface PublishersStatusQueueInputMessagesParsed {
68
68
  plannedEnd: number;
69
69
  };
70
70
  messages: MessageStored[];
71
- metadata?: {
72
- externalId?: string;
71
+ metadata: {
72
+ externalId: string;
73
73
  };
74
74
  }
75
75
  interface MessagesParsedTyped extends PublishersStatusQueueInputMessagesParsed {
76
- type: "messages_parsed";
76
+ type: 'messages_parsed';
77
+ }
78
+ interface PublishersStatusQueueInputJoin {
79
+ metadata: {
80
+ externalId: string;
81
+ };
82
+ chat: {
83
+ username: string;
84
+ };
85
+ account: {
86
+ id: number;
87
+ };
88
+ status: 'UNAVAILABLE' | 'ALREADY_JOINED' | 'JOINED';
89
+ }
90
+ interface PublishersStatusQueueInputJoinResult extends PublishersStatusQueueInputJoin {
91
+ type: 'chat_join_result';
92
+ }
93
+ interface PublishersStatusQueueInputSend {
94
+ metadata: {
95
+ externalId: string;
96
+ };
97
+ chat: {
98
+ id: number;
99
+ username: string;
100
+ };
101
+ account: {
102
+ id: number;
103
+ };
104
+ status: 'SENT' | 'ERROR';
105
+ message?: {
106
+ id: number;
107
+ text: string;
108
+ };
109
+ }
110
+ interface PublishersStatusQueueInputSendResult extends PublishersStatusQueueInputSend {
111
+ type: 'chat_send_result';
77
112
  }
78
113
  interface EventByType {
79
114
  chat_parsed: ChatParsedTyped;
80
115
  messages_parsed: MessagesParsedTyped;
116
+ chat_join_result: PublishersStatusQueueInputJoinResult;
117
+ chat_send_result: PublishersStatusQueueInputSendResult;
81
118
  }
82
- type WebhookBody = ChatParsedTyped | MessagesParsedTyped;
119
+ type WebhookBody = ChatParsedTyped | MessagesParsedTyped | PublishersStatusQueueInputJoinResult | PublishersStatusQueueInputSendResult;
83
120
  type WebhookBodyTypes = keyof EventByType;
84
121
 
85
122
  declare const frameworks: {
@@ -205,7 +242,7 @@ declare class EApi {
205
242
  *
206
243
  * [Documentation](.../chats/operation/chats.join)
207
244
  */
208
- join: (externalId: paths["/chats/{chat}/join/{externalId}"]["post"]["parameters"]["path"]["externalId"], chat: paths["/chats/{chat}/join/{externalId}"]["post"]["parameters"]["path"]["chat"], options?: RequestOptions) => Promise<GetResponse<"/chats/{chat}/join/{externalId}", "post">>;
245
+ join: (externalId: paths["/chats/{chat}/join/{externalId}"]["post"]["parameters"]["path"]["externalId"], chat: paths["/chats/{chat}/join/{externalId}"]["post"]["parameters"]["path"]["chat"], body: GetRequestBody<"/chats/{chat}/join/{externalId}", "post">, options?: RequestOptions) => Promise<GetResponse<"/chats/{chat}/join/{externalId}", "post">>;
209
246
  /**
210
247
  *
211
248
  *
package/dist/index.d.ts CHANGED
@@ -27,7 +27,7 @@ interface ChatStored {
27
27
  username: string;
28
28
  title: string;
29
29
  about: string;
30
- type: "group" | "channel";
30
+ type: 'group' | 'channel';
31
31
  participants_count: number;
32
32
  avatar_id: string | null;
33
33
  last_offset_id: number;
@@ -50,12 +50,12 @@ interface MessageStored {
50
50
  }
51
51
  interface PublishersStatusQueueInputChatParsed {
52
52
  chat: ChatStored;
53
- metadata?: {
54
- externalId?: string;
53
+ metadata: {
54
+ externalId: string;
55
55
  };
56
56
  }
57
57
  interface ChatParsedTyped extends PublishersStatusQueueInputChatParsed {
58
- type: "chat_parsed";
58
+ type: 'chat_parsed';
59
59
  }
60
60
  interface PublishersStatusQueueInputMessagesParsed {
61
61
  chat: {
@@ -68,18 +68,55 @@ interface PublishersStatusQueueInputMessagesParsed {
68
68
  plannedEnd: number;
69
69
  };
70
70
  messages: MessageStored[];
71
- metadata?: {
72
- externalId?: string;
71
+ metadata: {
72
+ externalId: string;
73
73
  };
74
74
  }
75
75
  interface MessagesParsedTyped extends PublishersStatusQueueInputMessagesParsed {
76
- type: "messages_parsed";
76
+ type: 'messages_parsed';
77
+ }
78
+ interface PublishersStatusQueueInputJoin {
79
+ metadata: {
80
+ externalId: string;
81
+ };
82
+ chat: {
83
+ username: string;
84
+ };
85
+ account: {
86
+ id: number;
87
+ };
88
+ status: 'UNAVAILABLE' | 'ALREADY_JOINED' | 'JOINED';
89
+ }
90
+ interface PublishersStatusQueueInputJoinResult extends PublishersStatusQueueInputJoin {
91
+ type: 'chat_join_result';
92
+ }
93
+ interface PublishersStatusQueueInputSend {
94
+ metadata: {
95
+ externalId: string;
96
+ };
97
+ chat: {
98
+ id: number;
99
+ username: string;
100
+ };
101
+ account: {
102
+ id: number;
103
+ };
104
+ status: 'SENT' | 'ERROR';
105
+ message?: {
106
+ id: number;
107
+ text: string;
108
+ };
109
+ }
110
+ interface PublishersStatusQueueInputSendResult extends PublishersStatusQueueInputSend {
111
+ type: 'chat_send_result';
77
112
  }
78
113
  interface EventByType {
79
114
  chat_parsed: ChatParsedTyped;
80
115
  messages_parsed: MessagesParsedTyped;
116
+ chat_join_result: PublishersStatusQueueInputJoinResult;
117
+ chat_send_result: PublishersStatusQueueInputSendResult;
81
118
  }
82
- type WebhookBody = ChatParsedTyped | MessagesParsedTyped;
119
+ type WebhookBody = ChatParsedTyped | MessagesParsedTyped | PublishersStatusQueueInputJoinResult | PublishersStatusQueueInputSendResult;
83
120
  type WebhookBodyTypes = keyof EventByType;
84
121
 
85
122
  declare const frameworks: {
@@ -205,7 +242,7 @@ declare class EApi {
205
242
  *
206
243
  * [Documentation](.../chats/operation/chats.join)
207
244
  */
208
- join: (externalId: paths["/chats/{chat}/join/{externalId}"]["post"]["parameters"]["path"]["externalId"], chat: paths["/chats/{chat}/join/{externalId}"]["post"]["parameters"]["path"]["chat"], options?: RequestOptions) => Promise<GetResponse<"/chats/{chat}/join/{externalId}", "post">>;
245
+ join: (externalId: paths["/chats/{chat}/join/{externalId}"]["post"]["parameters"]["path"]["externalId"], chat: paths["/chats/{chat}/join/{externalId}"]["post"]["parameters"]["path"]["chat"], body: GetRequestBody<"/chats/{chat}/join/{externalId}", "post">, options?: RequestOptions) => Promise<GetResponse<"/chats/{chat}/join/{externalId}", "post">>;
209
246
  /**
210
247
  *
211
248
  *
package/dist/index.js CHANGED
@@ -153,8 +153,8 @@ class EApi {
153
153
  *
154
154
  * [Documentation](.../chats/operation/chats.join)
155
155
  */
156
- join: (externalId, chat, options) => {
157
- return this.request(`/chats/${chat}/join/${externalId}`, void 0, { method: "POST", ...options });
156
+ join: (externalId, chat, body, options) => {
157
+ return this.request(`/chats/${chat}/join/${externalId}`, body, { method: "POST", ...options });
158
158
  },
159
159
  /**
160
160
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skravets/eapi",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "module": "./dist/index.js",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.ts",