@skravets/eapi 0.0.6 → 0.0.8

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-11T23:03:13.539Z
64
+ * @example 2025-08-13T12:03:37.021Z
65
65
  */
66
66
  message_created_at: string;
67
67
  /** @example 123 */
@@ -89,6 +89,11 @@ interface components {
89
89
  * @example 1
90
90
  */
91
91
  accountId: number;
92
+ /**
93
+ * @description Webhook url POST
94
+ * @example https://webhook.site/123e4567-e89b-12d3-a456-426614174000
95
+ */
96
+ webhookUrl: string;
92
97
  };
93
98
  ISendMessageMessage: {
94
99
  /**
@@ -100,7 +105,7 @@ interface components {
100
105
  * @description Message id to reply to
101
106
  * @example 123
102
107
  */
103
- replyToId: number;
108
+ replyToId?: number;
104
109
  };
105
110
  ISendMessage: {
106
111
  /**
@@ -111,11 +116,21 @@ interface components {
111
116
  * }
112
117
  */
113
118
  message: components["schemas"]["ISendMessageMessage"];
119
+ /**
120
+ * @description Seconds to typing
121
+ * @example 5
122
+ */
123
+ secondsToTyping?: number;
114
124
  /**
115
125
  * @description Account id
116
126
  * @example 1
117
127
  */
118
128
  accountId: number;
129
+ /**
130
+ * @description Webhook url POST
131
+ * @example https://webhook.site/123e4567-e89b-12d3-a456-426614174000
132
+ */
133
+ webhookUrl: string;
119
134
  };
120
135
  /** @description Which fields of chat to return */
121
136
  ChatData: {
@@ -61,7 +61,7 @@ interface components {
61
61
  channel_id: number;
62
62
  /**
63
63
  * Format: date-time
64
- * @example 2025-08-11T23:03:13.539Z
64
+ * @example 2025-08-13T12:03:37.021Z
65
65
  */
66
66
  message_created_at: string;
67
67
  /** @example 123 */
@@ -89,6 +89,11 @@ interface components {
89
89
  * @example 1
90
90
  */
91
91
  accountId: number;
92
+ /**
93
+ * @description Webhook url POST
94
+ * @example https://webhook.site/123e4567-e89b-12d3-a456-426614174000
95
+ */
96
+ webhookUrl: string;
92
97
  };
93
98
  ISendMessageMessage: {
94
99
  /**
@@ -100,7 +105,7 @@ interface components {
100
105
  * @description Message id to reply to
101
106
  * @example 123
102
107
  */
103
- replyToId: number;
108
+ replyToId?: number;
104
109
  };
105
110
  ISendMessage: {
106
111
  /**
@@ -111,11 +116,21 @@ interface components {
111
116
  * }
112
117
  */
113
118
  message: components["schemas"]["ISendMessageMessage"];
119
+ /**
120
+ * @description Seconds to typing
121
+ * @example 5
122
+ */
123
+ secondsToTyping?: number;
114
124
  /**
115
125
  * @description Account id
116
126
  * @example 1
117
127
  */
118
128
  accountId: number;
129
+ /**
130
+ * @description Webhook url POST
131
+ * @example https://webhook.site/123e4567-e89b-12d3-a456-426614174000
132
+ */
133
+ webhookUrl: string;
119
134
  };
120
135
  /** @description Which fields of chat to return */
121
136
  ChatData: {
package/dist/index.cjs CHANGED
@@ -76,7 +76,8 @@ class EApi {
76
76
  const length = response.headers.get("content-length");
77
77
  if (contentType?.includes("application/json")) {
78
78
  return response.json();
79
- } else if (length) {
79
+ }
80
+ if (length) {
80
81
  return response.text();
81
82
  }
82
83
  return void 0;
@@ -96,15 +97,15 @@ class EApi {
96
97
  */
97
98
  app = {
98
99
  /**
99
- *
100
- *
101
- * @tags App
102
- * @summary Get Hello World!
103
- *
104
- * [Documentation](.../App/operation/app.getHello)
105
- */
100
+ *
101
+ *
102
+ * @tags App
103
+ * @summary Get Hello World!
104
+ *
105
+ * [Documentation](.../App/operation/app.getHello)
106
+ */
106
107
  getHello: (options) => {
107
- return this.request(`/`, void 0, { method: "GET", ...options });
108
+ return this.request("/", void 0, { method: "GET", ...options });
108
109
  }
109
110
  };
110
111
  /**
@@ -112,70 +113,85 @@ class EApi {
112
113
  */
113
114
  chats = {
114
115
  /**
115
- *
116
- *
117
- * @tags chats
118
- * @summary Get Hello World!
119
- *
120
- * [Documentation](.../chats/operation/channels.getHello)
121
- */
116
+ *
117
+ *
118
+ * @tags chats
119
+ * @summary Get Hello World!
120
+ *
121
+ * [Documentation](.../chats/operation/channels.getHello)
122
+ */
122
123
  getHello: (options) => {
123
- return this.request(`/chats`, void 0, { method: "GET", ...options });
124
+ return this.request("/chats", void 0, { method: "GET", ...options });
124
125
  },
125
126
  /**
126
- *
127
- *
128
- * @tags chats
129
- * @summary Get last channel message
130
- *
131
- * [Documentation](.../chats/operation/channels.getLastMessage)
132
- */
127
+ *
128
+ *
129
+ * @tags chats
130
+ * @summary Get last channel message
131
+ *
132
+ * [Documentation](.../chats/operation/channels.getLastMessage)
133
+ */
133
134
  getLastMessage: (chat, options) => {
134
- return this.request(`/chats/${chat}/last-message`, void 0, { method: "GET", ...options });
135
+ return this.request(`/chats/${chat}/last-message`, void 0, {
136
+ method: "GET",
137
+ ...options
138
+ });
135
139
  },
136
140
  /**
137
- *
138
- *
139
- * @tags chats
140
- * @summary Get chat messages
141
- *
142
- * [Documentation](.../chats/operation/chats.getMessages)
143
- */
141
+ *
142
+ *
143
+ * @tags chats
144
+ * @summary Get chat messages
145
+ *
146
+ * [Documentation](.../chats/operation/chats.getMessages)
147
+ */
144
148
  getMessages: (chat, body, options) => {
145
- return this.request(`/chats/${chat}/new-messages`, body, { method: "POST", ...options });
149
+ return this.request(`/chats/${chat}/new-messages`, body, {
150
+ method: "POST",
151
+ ...options
152
+ });
146
153
  },
147
154
  /**
148
- *
149
- *
150
- * @tags chats
151
- * @summary Queue chat
152
- *
153
- * [Documentation](.../chats/operation/chats.queue)
154
- */
155
+ *
156
+ *
157
+ * @tags chats
158
+ * @summary Queue chat
159
+ *
160
+ * [Documentation](.../chats/operation/chats.queue)
161
+ */
155
162
  queue: (externalId, chat, options) => {
156
- return this.request(`/chats/${chat}/queue/${externalId}`, void 0, { method: "POST", ...options });
163
+ return this.request(`/chats/${chat}/queue/${externalId}`, void 0, {
164
+ method: "POST",
165
+ ...options
166
+ });
157
167
  },
158
168
  /**
159
- *
160
- *
161
- * @tags chats
162
- * @summary Add task to join chat
163
- *
164
- * [Documentation](.../chats/operation/chats.join)
165
- */
169
+ *
170
+ *
171
+ * @tags chats
172
+ * @summary Add task to join chat
173
+ *
174
+ * [Documentation](.../chats/operation/chats.join)
175
+ */
166
176
  join: (externalId, chat, body, options) => {
167
- return this.request(`/chats/${chat}/join/${externalId}`, body, { method: "POST", ...options });
177
+ return this.request(`/chats/${chat}/join/${externalId}`, body, {
178
+ method: "POST",
179
+ ...options
180
+ });
168
181
  },
169
182
  /**
170
- *
171
- *
172
- * @tags chats
173
- * @summary Add task to send message
174
- *
175
- * [Documentation](.../chats/operation/chats.send)
176
- */
183
+ *
184
+ *
185
+ * @tags chats
186
+ * @summary Add task to send message
187
+ *
188
+ * [Documentation](.../chats/operation/chats.send)
189
+ */
177
190
  send: (externalId, chat, body, options) => {
178
- return this.request(`/chats/${chat}/send/${externalId}`, body, { method: "POST", ...options });
191
+ return this.request(`/chats/${chat}/send/${externalId}`, body, {
192
+ method: "POST",
193
+ ...options
194
+ });
179
195
  }
180
196
  };
181
197
  /**
@@ -183,59 +199,74 @@ class EApi {
183
199
  */
184
200
  subscriptions = {
185
201
  /**
186
- *
187
- *
188
- * @tags Subscriptions
189
- * @summary Create subscription
190
- *
191
- * [Documentation](.../Subscriptions/operation/subscriptions.create)
192
- */
202
+ *
203
+ *
204
+ * @tags Subscriptions
205
+ * @summary Create subscription
206
+ *
207
+ * [Documentation](.../Subscriptions/operation/subscriptions.create)
208
+ */
193
209
  create: (body, options) => {
194
- return this.request(`/subscriptions`, body, { method: "POST", ...options });
210
+ return this.request("/subscriptions", body, {
211
+ method: "POST",
212
+ ...options
213
+ });
195
214
  },
196
215
  /**
197
- *
198
- *
199
- * @tags Subscriptions
200
- * @summary Upsert subscription
201
- *
202
- * [Documentation](.../Subscriptions/operation/subscriptions.upsert)
203
- */
216
+ *
217
+ *
218
+ * @tags Subscriptions
219
+ * @summary Upsert subscription
220
+ *
221
+ * [Documentation](.../Subscriptions/operation/subscriptions.upsert)
222
+ */
204
223
  upsert: (body, options) => {
205
- return this.request(`/subscriptions`, body, { method: "PUT", ...options });
224
+ return this.request("/subscriptions", body, {
225
+ method: "PUT",
226
+ ...options
227
+ });
206
228
  },
207
229
  /**
208
- *
209
- *
210
- * @tags Subscriptions
211
- * @summary Get subscription by subscription id
212
- *
213
- * [Documentation](.../Subscriptions/operation/subscriptions.getById)
214
- */
230
+ *
231
+ *
232
+ * @tags Subscriptions
233
+ * @summary Get subscription by subscription id
234
+ *
235
+ * [Documentation](.../Subscriptions/operation/subscriptions.getById)
236
+ */
215
237
  getById: (subId, options) => {
216
- return this.request(`/subscriptions/${subId}`, void 0, { method: "GET", ...options });
238
+ return this.request(`/subscriptions/${subId}`, void 0, {
239
+ method: "GET",
240
+ ...options
241
+ });
217
242
  },
218
243
  /**
219
- *
220
- *
221
- * @tags Subscriptions
222
- * @summary Update subscription by subscription id
223
- *
224
- * [Documentation](.../Subscriptions/operation/subscriptions.update)
225
- */
244
+ *
245
+ *
246
+ * @tags Subscriptions
247
+ * @summary Update subscription by subscription id
248
+ *
249
+ * [Documentation](.../Subscriptions/operation/subscriptions.update)
250
+ */
226
251
  update: (subId, body, options) => {
227
- return this.request(`/subscriptions/${subId}`, body, { method: "PUT", ...options });
252
+ return this.request(`/subscriptions/${subId}`, body, {
253
+ method: "PUT",
254
+ ...options
255
+ });
228
256
  },
229
257
  /**
230
- *
231
- *
232
- * @tags Subscriptions
233
- * @summary Delete subscription by subscription id
234
- *
235
- * [Documentation](.../Subscriptions/operation/subscriptions.delete)
236
- */
258
+ *
259
+ *
260
+ * @tags Subscriptions
261
+ * @summary Delete subscription by subscription id
262
+ *
263
+ * [Documentation](.../Subscriptions/operation/subscriptions.delete)
264
+ */
237
265
  delete: (subId, options) => {
238
- return this.request(`/subscriptions/${subId}`, void 0, { method: "DELETE", ...options });
266
+ return this.request(`/subscriptions/${subId}`, void 0, {
267
+ method: "DELETE",
268
+ ...options
269
+ });
239
270
  }
240
271
  };
241
272
  /** @generated stop-generate-methods */
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;
@@ -55,7 +55,7 @@ interface PublishersStatusQueueInputChatParsed {
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: {
@@ -73,7 +73,7 @@ interface PublishersStatusQueueInputMessagesParsed {
73
73
  };
74
74
  }
75
75
  interface MessagesParsedTyped extends PublishersStatusQueueInputMessagesParsed {
76
- type: 'messages_parsed';
76
+ type: "messages_parsed";
77
77
  }
78
78
  interface PublishersStatusQueueInputJoin {
79
79
  metadata: {
@@ -85,10 +85,10 @@ interface PublishersStatusQueueInputJoin {
85
85
  account: {
86
86
  id: number;
87
87
  };
88
- status: 'UNAVAILABLE' | 'ALREADY_JOINED' | 'JOINED';
88
+ status: "UNAVAILABLE" | "ALREADY_JOINED" | "JOINED";
89
89
  }
90
90
  interface PublishersStatusQueueInputJoinResult extends PublishersStatusQueueInputJoin {
91
- type: 'chat_join_result';
91
+ type: "chat_join_result";
92
92
  }
93
93
  interface PublishersStatusQueueInputSend {
94
94
  metadata: {
@@ -101,14 +101,14 @@ interface PublishersStatusQueueInputSend {
101
101
  account: {
102
102
  id: number;
103
103
  };
104
- status: 'SENT' | 'ERROR';
104
+ status: "SENT" | "ERROR";
105
105
  message?: {
106
106
  id: number;
107
107
  text: string;
108
108
  };
109
109
  }
110
110
  interface PublishersStatusQueueInputSendResult extends PublishersStatusQueueInputSend {
111
- type: 'chat_send_result';
111
+ type: "chat_send_result";
112
112
  }
113
113
  interface EventByType {
114
114
  chat_parsed: ChatParsedTyped;
@@ -185,13 +185,13 @@ declare class EApi {
185
185
  */
186
186
  app: {
187
187
  /**
188
- *
189
- *
190
- * @tags App
191
- * @summary Get Hello World!
192
- *
193
- * [Documentation](.../App/operation/app.getHello)
194
- */
188
+ *
189
+ *
190
+ * @tags App
191
+ * @summary Get Hello World!
192
+ *
193
+ * [Documentation](.../App/operation/app.getHello)
194
+ */
195
195
  getHello: (options?: RequestOptions) => Promise<GetResponse<"/", "get">>;
196
196
  };
197
197
  /**
@@ -199,58 +199,58 @@ declare class EApi {
199
199
  */
200
200
  chats: {
201
201
  /**
202
- *
203
- *
204
- * @tags chats
205
- * @summary Get Hello World!
206
- *
207
- * [Documentation](.../chats/operation/channels.getHello)
208
- */
202
+ *
203
+ *
204
+ * @tags chats
205
+ * @summary Get Hello World!
206
+ *
207
+ * [Documentation](.../chats/operation/channels.getHello)
208
+ */
209
209
  getHello: (options?: RequestOptions) => Promise<GetResponse<"/chats", "get">>;
210
210
  /**
211
- *
212
- *
213
- * @tags chats
214
- * @summary Get last channel message
215
- *
216
- * [Documentation](.../chats/operation/channels.getLastMessage)
217
- */
211
+ *
212
+ *
213
+ * @tags chats
214
+ * @summary Get last channel message
215
+ *
216
+ * [Documentation](.../chats/operation/channels.getLastMessage)
217
+ */
218
218
  getLastMessage: (chat: paths["/chats/{chat}/last-message"]["get"]["parameters"]["path"]["chat"], options?: RequestOptions) => Promise<GetResponse<"/chats/{chat}/last-message", "get">>;
219
219
  /**
220
- *
221
- *
222
- * @tags chats
223
- * @summary Get chat messages
224
- *
225
- * [Documentation](.../chats/operation/chats.getMessages)
226
- */
220
+ *
221
+ *
222
+ * @tags chats
223
+ * @summary Get chat messages
224
+ *
225
+ * [Documentation](.../chats/operation/chats.getMessages)
226
+ */
227
227
  getMessages: (chat: paths["/chats/{chat}/new-messages"]["post"]["parameters"]["path"]["chat"], body: GetRequestBody<"/chats/{chat}/new-messages", "post">, options?: RequestOptions) => Promise<GetResponse<"/chats/{chat}/new-messages", "post">>;
228
228
  /**
229
- *
230
- *
231
- * @tags chats
232
- * @summary Queue chat
233
- *
234
- * [Documentation](.../chats/operation/chats.queue)
235
- */
229
+ *
230
+ *
231
+ * @tags chats
232
+ * @summary Queue chat
233
+ *
234
+ * [Documentation](.../chats/operation/chats.queue)
235
+ */
236
236
  queue: (externalId: paths["/chats/{chat}/queue/{externalId}"]["post"]["parameters"]["path"]["externalId"], chat: paths["/chats/{chat}/queue/{externalId}"]["post"]["parameters"]["path"]["chat"], options?: RequestOptions) => Promise<GetResponse<"/chats/{chat}/queue/{externalId}", "post">>;
237
237
  /**
238
- *
239
- *
240
- * @tags chats
241
- * @summary Add task to join chat
242
- *
243
- * [Documentation](.../chats/operation/chats.join)
244
- */
238
+ *
239
+ *
240
+ * @tags chats
241
+ * @summary Add task to join chat
242
+ *
243
+ * [Documentation](.../chats/operation/chats.join)
244
+ */
245
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">>;
246
246
  /**
247
- *
248
- *
249
- * @tags chats
250
- * @summary Add task to send message
251
- *
252
- * [Documentation](.../chats/operation/chats.send)
253
- */
247
+ *
248
+ *
249
+ * @tags chats
250
+ * @summary Add task to send message
251
+ *
252
+ * [Documentation](.../chats/operation/chats.send)
253
+ */
254
254
  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">>;
255
255
  };
256
256
  /**
@@ -258,49 +258,49 @@ declare class EApi {
258
258
  */
259
259
  subscriptions: {
260
260
  /**
261
- *
262
- *
263
- * @tags Subscriptions
264
- * @summary Create subscription
265
- *
266
- * [Documentation](.../Subscriptions/operation/subscriptions.create)
267
- */
261
+ *
262
+ *
263
+ * @tags Subscriptions
264
+ * @summary Create subscription
265
+ *
266
+ * [Documentation](.../Subscriptions/operation/subscriptions.create)
267
+ */
268
268
  create: (body: GetRequestBody<"/subscriptions", "post">, options?: RequestOptions) => Promise<GetResponse<"/subscriptions", "post">>;
269
269
  /**
270
- *
271
- *
272
- * @tags Subscriptions
273
- * @summary Upsert subscription
274
- *
275
- * [Documentation](.../Subscriptions/operation/subscriptions.upsert)
276
- */
270
+ *
271
+ *
272
+ * @tags Subscriptions
273
+ * @summary Upsert subscription
274
+ *
275
+ * [Documentation](.../Subscriptions/operation/subscriptions.upsert)
276
+ */
277
277
  upsert: (body: GetRequestBody<"/subscriptions", "put">, options?: RequestOptions) => Promise<GetResponse<"/subscriptions", "put">>;
278
278
  /**
279
- *
280
- *
281
- * @tags Subscriptions
282
- * @summary Get subscription by subscription id
283
- *
284
- * [Documentation](.../Subscriptions/operation/subscriptions.getById)
285
- */
279
+ *
280
+ *
281
+ * @tags Subscriptions
282
+ * @summary Get subscription by subscription id
283
+ *
284
+ * [Documentation](.../Subscriptions/operation/subscriptions.getById)
285
+ */
286
286
  getById: (subId: paths["/subscriptions/{subId}"]["get"]["parameters"]["path"]["subId"], options?: RequestOptions) => Promise<GetResponse<"/subscriptions/{subId}", "get">>;
287
287
  /**
288
- *
289
- *
290
- * @tags Subscriptions
291
- * @summary Update subscription by subscription id
292
- *
293
- * [Documentation](.../Subscriptions/operation/subscriptions.update)
294
- */
288
+ *
289
+ *
290
+ * @tags Subscriptions
291
+ * @summary Update subscription by subscription id
292
+ *
293
+ * [Documentation](.../Subscriptions/operation/subscriptions.update)
294
+ */
295
295
  update: (subId: paths["/subscriptions/{subId}"]["put"]["parameters"]["path"]["subId"], body: GetRequestBody<"/subscriptions/{subId}", "put">, options?: RequestOptions) => Promise<GetResponse<"/subscriptions/{subId}", "put">>;
296
296
  /**
297
- *
298
- *
299
- * @tags Subscriptions
300
- * @summary Delete subscription by subscription id
301
- *
302
- * [Documentation](.../Subscriptions/operation/subscriptions.delete)
303
- */
297
+ *
298
+ *
299
+ * @tags Subscriptions
300
+ * @summary Delete subscription by subscription id
301
+ *
302
+ * [Documentation](.../Subscriptions/operation/subscriptions.delete)
303
+ */
304
304
  delete: (subId: paths["/subscriptions/{subId}"]["delete"]["parameters"]["path"]["subId"], options?: RequestOptions) => Promise<GetResponse<"/subscriptions/{subId}", "delete">>;
305
305
  };
306
306
  }
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;
@@ -55,7 +55,7 @@ interface PublishersStatusQueueInputChatParsed {
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: {
@@ -73,7 +73,7 @@ interface PublishersStatusQueueInputMessagesParsed {
73
73
  };
74
74
  }
75
75
  interface MessagesParsedTyped extends PublishersStatusQueueInputMessagesParsed {
76
- type: 'messages_parsed';
76
+ type: "messages_parsed";
77
77
  }
78
78
  interface PublishersStatusQueueInputJoin {
79
79
  metadata: {
@@ -85,10 +85,10 @@ interface PublishersStatusQueueInputJoin {
85
85
  account: {
86
86
  id: number;
87
87
  };
88
- status: 'UNAVAILABLE' | 'ALREADY_JOINED' | 'JOINED';
88
+ status: "UNAVAILABLE" | "ALREADY_JOINED" | "JOINED";
89
89
  }
90
90
  interface PublishersStatusQueueInputJoinResult extends PublishersStatusQueueInputJoin {
91
- type: 'chat_join_result';
91
+ type: "chat_join_result";
92
92
  }
93
93
  interface PublishersStatusQueueInputSend {
94
94
  metadata: {
@@ -101,14 +101,14 @@ interface PublishersStatusQueueInputSend {
101
101
  account: {
102
102
  id: number;
103
103
  };
104
- status: 'SENT' | 'ERROR';
104
+ status: "SENT" | "ERROR";
105
105
  message?: {
106
106
  id: number;
107
107
  text: string;
108
108
  };
109
109
  }
110
110
  interface PublishersStatusQueueInputSendResult extends PublishersStatusQueueInputSend {
111
- type: 'chat_send_result';
111
+ type: "chat_send_result";
112
112
  }
113
113
  interface EventByType {
114
114
  chat_parsed: ChatParsedTyped;
@@ -185,13 +185,13 @@ declare class EApi {
185
185
  */
186
186
  app: {
187
187
  /**
188
- *
189
- *
190
- * @tags App
191
- * @summary Get Hello World!
192
- *
193
- * [Documentation](.../App/operation/app.getHello)
194
- */
188
+ *
189
+ *
190
+ * @tags App
191
+ * @summary Get Hello World!
192
+ *
193
+ * [Documentation](.../App/operation/app.getHello)
194
+ */
195
195
  getHello: (options?: RequestOptions) => Promise<GetResponse<"/", "get">>;
196
196
  };
197
197
  /**
@@ -199,58 +199,58 @@ declare class EApi {
199
199
  */
200
200
  chats: {
201
201
  /**
202
- *
203
- *
204
- * @tags chats
205
- * @summary Get Hello World!
206
- *
207
- * [Documentation](.../chats/operation/channels.getHello)
208
- */
202
+ *
203
+ *
204
+ * @tags chats
205
+ * @summary Get Hello World!
206
+ *
207
+ * [Documentation](.../chats/operation/channels.getHello)
208
+ */
209
209
  getHello: (options?: RequestOptions) => Promise<GetResponse<"/chats", "get">>;
210
210
  /**
211
- *
212
- *
213
- * @tags chats
214
- * @summary Get last channel message
215
- *
216
- * [Documentation](.../chats/operation/channels.getLastMessage)
217
- */
211
+ *
212
+ *
213
+ * @tags chats
214
+ * @summary Get last channel message
215
+ *
216
+ * [Documentation](.../chats/operation/channels.getLastMessage)
217
+ */
218
218
  getLastMessage: (chat: paths["/chats/{chat}/last-message"]["get"]["parameters"]["path"]["chat"], options?: RequestOptions) => Promise<GetResponse<"/chats/{chat}/last-message", "get">>;
219
219
  /**
220
- *
221
- *
222
- * @tags chats
223
- * @summary Get chat messages
224
- *
225
- * [Documentation](.../chats/operation/chats.getMessages)
226
- */
220
+ *
221
+ *
222
+ * @tags chats
223
+ * @summary Get chat messages
224
+ *
225
+ * [Documentation](.../chats/operation/chats.getMessages)
226
+ */
227
227
  getMessages: (chat: paths["/chats/{chat}/new-messages"]["post"]["parameters"]["path"]["chat"], body: GetRequestBody<"/chats/{chat}/new-messages", "post">, options?: RequestOptions) => Promise<GetResponse<"/chats/{chat}/new-messages", "post">>;
228
228
  /**
229
- *
230
- *
231
- * @tags chats
232
- * @summary Queue chat
233
- *
234
- * [Documentation](.../chats/operation/chats.queue)
235
- */
229
+ *
230
+ *
231
+ * @tags chats
232
+ * @summary Queue chat
233
+ *
234
+ * [Documentation](.../chats/operation/chats.queue)
235
+ */
236
236
  queue: (externalId: paths["/chats/{chat}/queue/{externalId}"]["post"]["parameters"]["path"]["externalId"], chat: paths["/chats/{chat}/queue/{externalId}"]["post"]["parameters"]["path"]["chat"], options?: RequestOptions) => Promise<GetResponse<"/chats/{chat}/queue/{externalId}", "post">>;
237
237
  /**
238
- *
239
- *
240
- * @tags chats
241
- * @summary Add task to join chat
242
- *
243
- * [Documentation](.../chats/operation/chats.join)
244
- */
238
+ *
239
+ *
240
+ * @tags chats
241
+ * @summary Add task to join chat
242
+ *
243
+ * [Documentation](.../chats/operation/chats.join)
244
+ */
245
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">>;
246
246
  /**
247
- *
248
- *
249
- * @tags chats
250
- * @summary Add task to send message
251
- *
252
- * [Documentation](.../chats/operation/chats.send)
253
- */
247
+ *
248
+ *
249
+ * @tags chats
250
+ * @summary Add task to send message
251
+ *
252
+ * [Documentation](.../chats/operation/chats.send)
253
+ */
254
254
  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">>;
255
255
  };
256
256
  /**
@@ -258,49 +258,49 @@ declare class EApi {
258
258
  */
259
259
  subscriptions: {
260
260
  /**
261
- *
262
- *
263
- * @tags Subscriptions
264
- * @summary Create subscription
265
- *
266
- * [Documentation](.../Subscriptions/operation/subscriptions.create)
267
- */
261
+ *
262
+ *
263
+ * @tags Subscriptions
264
+ * @summary Create subscription
265
+ *
266
+ * [Documentation](.../Subscriptions/operation/subscriptions.create)
267
+ */
268
268
  create: (body: GetRequestBody<"/subscriptions", "post">, options?: RequestOptions) => Promise<GetResponse<"/subscriptions", "post">>;
269
269
  /**
270
- *
271
- *
272
- * @tags Subscriptions
273
- * @summary Upsert subscription
274
- *
275
- * [Documentation](.../Subscriptions/operation/subscriptions.upsert)
276
- */
270
+ *
271
+ *
272
+ * @tags Subscriptions
273
+ * @summary Upsert subscription
274
+ *
275
+ * [Documentation](.../Subscriptions/operation/subscriptions.upsert)
276
+ */
277
277
  upsert: (body: GetRequestBody<"/subscriptions", "put">, options?: RequestOptions) => Promise<GetResponse<"/subscriptions", "put">>;
278
278
  /**
279
- *
280
- *
281
- * @tags Subscriptions
282
- * @summary Get subscription by subscription id
283
- *
284
- * [Documentation](.../Subscriptions/operation/subscriptions.getById)
285
- */
279
+ *
280
+ *
281
+ * @tags Subscriptions
282
+ * @summary Get subscription by subscription id
283
+ *
284
+ * [Documentation](.../Subscriptions/operation/subscriptions.getById)
285
+ */
286
286
  getById: (subId: paths["/subscriptions/{subId}"]["get"]["parameters"]["path"]["subId"], options?: RequestOptions) => Promise<GetResponse<"/subscriptions/{subId}", "get">>;
287
287
  /**
288
- *
289
- *
290
- * @tags Subscriptions
291
- * @summary Update subscription by subscription id
292
- *
293
- * [Documentation](.../Subscriptions/operation/subscriptions.update)
294
- */
288
+ *
289
+ *
290
+ * @tags Subscriptions
291
+ * @summary Update subscription by subscription id
292
+ *
293
+ * [Documentation](.../Subscriptions/operation/subscriptions.update)
294
+ */
295
295
  update: (subId: paths["/subscriptions/{subId}"]["put"]["parameters"]["path"]["subId"], body: GetRequestBody<"/subscriptions/{subId}", "put">, options?: RequestOptions) => Promise<GetResponse<"/subscriptions/{subId}", "put">>;
296
296
  /**
297
- *
298
- *
299
- * @tags Subscriptions
300
- * @summary Delete subscription by subscription id
301
- *
302
- * [Documentation](.../Subscriptions/operation/subscriptions.delete)
303
- */
297
+ *
298
+ *
299
+ * @tags Subscriptions
300
+ * @summary Delete subscription by subscription id
301
+ *
302
+ * [Documentation](.../Subscriptions/operation/subscriptions.delete)
303
+ */
304
304
  delete: (subId: paths["/subscriptions/{subId}"]["delete"]["parameters"]["path"]["subId"], options?: RequestOptions) => Promise<GetResponse<"/subscriptions/{subId}", "delete">>;
305
305
  };
306
306
  }
package/dist/index.js CHANGED
@@ -74,7 +74,8 @@ class EApi {
74
74
  const length = response.headers.get("content-length");
75
75
  if (contentType?.includes("application/json")) {
76
76
  return response.json();
77
- } else if (length) {
77
+ }
78
+ if (length) {
78
79
  return response.text();
79
80
  }
80
81
  return void 0;
@@ -94,15 +95,15 @@ class EApi {
94
95
  */
95
96
  app = {
96
97
  /**
97
- *
98
- *
99
- * @tags App
100
- * @summary Get Hello World!
101
- *
102
- * [Documentation](.../App/operation/app.getHello)
103
- */
98
+ *
99
+ *
100
+ * @tags App
101
+ * @summary Get Hello World!
102
+ *
103
+ * [Documentation](.../App/operation/app.getHello)
104
+ */
104
105
  getHello: (options) => {
105
- return this.request(`/`, void 0, { method: "GET", ...options });
106
+ return this.request("/", void 0, { method: "GET", ...options });
106
107
  }
107
108
  };
108
109
  /**
@@ -110,70 +111,85 @@ class EApi {
110
111
  */
111
112
  chats = {
112
113
  /**
113
- *
114
- *
115
- * @tags chats
116
- * @summary Get Hello World!
117
- *
118
- * [Documentation](.../chats/operation/channels.getHello)
119
- */
114
+ *
115
+ *
116
+ * @tags chats
117
+ * @summary Get Hello World!
118
+ *
119
+ * [Documentation](.../chats/operation/channels.getHello)
120
+ */
120
121
  getHello: (options) => {
121
- return this.request(`/chats`, void 0, { method: "GET", ...options });
122
+ return this.request("/chats", void 0, { method: "GET", ...options });
122
123
  },
123
124
  /**
124
- *
125
- *
126
- * @tags chats
127
- * @summary Get last channel message
128
- *
129
- * [Documentation](.../chats/operation/channels.getLastMessage)
130
- */
125
+ *
126
+ *
127
+ * @tags chats
128
+ * @summary Get last channel message
129
+ *
130
+ * [Documentation](.../chats/operation/channels.getLastMessage)
131
+ */
131
132
  getLastMessage: (chat, options) => {
132
- return this.request(`/chats/${chat}/last-message`, void 0, { method: "GET", ...options });
133
+ return this.request(`/chats/${chat}/last-message`, void 0, {
134
+ method: "GET",
135
+ ...options
136
+ });
133
137
  },
134
138
  /**
135
- *
136
- *
137
- * @tags chats
138
- * @summary Get chat messages
139
- *
140
- * [Documentation](.../chats/operation/chats.getMessages)
141
- */
139
+ *
140
+ *
141
+ * @tags chats
142
+ * @summary Get chat messages
143
+ *
144
+ * [Documentation](.../chats/operation/chats.getMessages)
145
+ */
142
146
  getMessages: (chat, body, options) => {
143
- return this.request(`/chats/${chat}/new-messages`, body, { method: "POST", ...options });
147
+ return this.request(`/chats/${chat}/new-messages`, body, {
148
+ method: "POST",
149
+ ...options
150
+ });
144
151
  },
145
152
  /**
146
- *
147
- *
148
- * @tags chats
149
- * @summary Queue chat
150
- *
151
- * [Documentation](.../chats/operation/chats.queue)
152
- */
153
+ *
154
+ *
155
+ * @tags chats
156
+ * @summary Queue chat
157
+ *
158
+ * [Documentation](.../chats/operation/chats.queue)
159
+ */
153
160
  queue: (externalId, chat, options) => {
154
- return this.request(`/chats/${chat}/queue/${externalId}`, void 0, { method: "POST", ...options });
161
+ return this.request(`/chats/${chat}/queue/${externalId}`, void 0, {
162
+ method: "POST",
163
+ ...options
164
+ });
155
165
  },
156
166
  /**
157
- *
158
- *
159
- * @tags chats
160
- * @summary Add task to join chat
161
- *
162
- * [Documentation](.../chats/operation/chats.join)
163
- */
167
+ *
168
+ *
169
+ * @tags chats
170
+ * @summary Add task to join chat
171
+ *
172
+ * [Documentation](.../chats/operation/chats.join)
173
+ */
164
174
  join: (externalId, chat, body, options) => {
165
- return this.request(`/chats/${chat}/join/${externalId}`, body, { method: "POST", ...options });
175
+ return this.request(`/chats/${chat}/join/${externalId}`, body, {
176
+ method: "POST",
177
+ ...options
178
+ });
166
179
  },
167
180
  /**
168
- *
169
- *
170
- * @tags chats
171
- * @summary Add task to send message
172
- *
173
- * [Documentation](.../chats/operation/chats.send)
174
- */
181
+ *
182
+ *
183
+ * @tags chats
184
+ * @summary Add task to send message
185
+ *
186
+ * [Documentation](.../chats/operation/chats.send)
187
+ */
175
188
  send: (externalId, chat, body, options) => {
176
- return this.request(`/chats/${chat}/send/${externalId}`, body, { method: "POST", ...options });
189
+ return this.request(`/chats/${chat}/send/${externalId}`, body, {
190
+ method: "POST",
191
+ ...options
192
+ });
177
193
  }
178
194
  };
179
195
  /**
@@ -181,59 +197,74 @@ class EApi {
181
197
  */
182
198
  subscriptions = {
183
199
  /**
184
- *
185
- *
186
- * @tags Subscriptions
187
- * @summary Create subscription
188
- *
189
- * [Documentation](.../Subscriptions/operation/subscriptions.create)
190
- */
200
+ *
201
+ *
202
+ * @tags Subscriptions
203
+ * @summary Create subscription
204
+ *
205
+ * [Documentation](.../Subscriptions/operation/subscriptions.create)
206
+ */
191
207
  create: (body, options) => {
192
- return this.request(`/subscriptions`, body, { method: "POST", ...options });
208
+ return this.request("/subscriptions", body, {
209
+ method: "POST",
210
+ ...options
211
+ });
193
212
  },
194
213
  /**
195
- *
196
- *
197
- * @tags Subscriptions
198
- * @summary Upsert subscription
199
- *
200
- * [Documentation](.../Subscriptions/operation/subscriptions.upsert)
201
- */
214
+ *
215
+ *
216
+ * @tags Subscriptions
217
+ * @summary Upsert subscription
218
+ *
219
+ * [Documentation](.../Subscriptions/operation/subscriptions.upsert)
220
+ */
202
221
  upsert: (body, options) => {
203
- return this.request(`/subscriptions`, body, { method: "PUT", ...options });
222
+ return this.request("/subscriptions", body, {
223
+ method: "PUT",
224
+ ...options
225
+ });
204
226
  },
205
227
  /**
206
- *
207
- *
208
- * @tags Subscriptions
209
- * @summary Get subscription by subscription id
210
- *
211
- * [Documentation](.../Subscriptions/operation/subscriptions.getById)
212
- */
228
+ *
229
+ *
230
+ * @tags Subscriptions
231
+ * @summary Get subscription by subscription id
232
+ *
233
+ * [Documentation](.../Subscriptions/operation/subscriptions.getById)
234
+ */
213
235
  getById: (subId, options) => {
214
- return this.request(`/subscriptions/${subId}`, void 0, { method: "GET", ...options });
236
+ return this.request(`/subscriptions/${subId}`, void 0, {
237
+ method: "GET",
238
+ ...options
239
+ });
215
240
  },
216
241
  /**
217
- *
218
- *
219
- * @tags Subscriptions
220
- * @summary Update subscription by subscription id
221
- *
222
- * [Documentation](.../Subscriptions/operation/subscriptions.update)
223
- */
242
+ *
243
+ *
244
+ * @tags Subscriptions
245
+ * @summary Update subscription by subscription id
246
+ *
247
+ * [Documentation](.../Subscriptions/operation/subscriptions.update)
248
+ */
224
249
  update: (subId, body, options) => {
225
- return this.request(`/subscriptions/${subId}`, body, { method: "PUT", ...options });
250
+ return this.request(`/subscriptions/${subId}`, body, {
251
+ method: "PUT",
252
+ ...options
253
+ });
226
254
  },
227
255
  /**
228
- *
229
- *
230
- * @tags Subscriptions
231
- * @summary Delete subscription by subscription id
232
- *
233
- * [Documentation](.../Subscriptions/operation/subscriptions.delete)
234
- */
256
+ *
257
+ *
258
+ * @tags Subscriptions
259
+ * @summary Delete subscription by subscription id
260
+ *
261
+ * [Documentation](.../Subscriptions/operation/subscriptions.delete)
262
+ */
235
263
  delete: (subId, options) => {
236
- return this.request(`/subscriptions/${subId}`, void 0, { method: "DELETE", ...options });
264
+ return this.request(`/subscriptions/${subId}`, void 0, {
265
+ method: "DELETE",
266
+ ...options
267
+ });
237
268
  }
238
269
  };
239
270
  /** @generated stop-generate-methods */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skravets/eapi",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "module": "./dist/index.js",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.ts",