@green-api/greenapi-integration 0.2.0 → 0.4.0

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.
@@ -1,7 +1,8 @@
1
- import { Instance, Settings, SendMessage, SendFileByUrl, SendFileByUpload, SendPoll, StateInstance, Reboot, Logout, QR, SendResponse, SendFileByUploadResponse, SetSettingsResponse, GetAuthorizationCode, SetProfilePicture, WaSettings, UploadFile, SendLocation, SendContact, ForwardMessages, ForwardMessagesResponse } from "../types/types";
1
+ import { Instance, Settings, SendMessage, SendFileByUrl, SendFileByUpload, SendPoll, StateInstance, Reboot, Logout, QR, SendResponse, SendFileByUploadResponse, SetSettingsResponse, GetAuthorizationCode, SetProfilePicture, WaSettings, UploadFile, SendLocation, SendContact, ForwardMessages, ForwardMessagesResponse, QueueMessage, ClearMessagesQueue, ReadChatResponse, ReadChat, CheckWhatsapp, CheckWhatsappResponse, GetAvatarResponse, GetAvatar, Contact, ContactInfo, ArchiveChat, UnarchiveChat, SetDisappearingChat, SetDisappearingChatResponse, CreateGroupResponse, CreateGroup, UpdateGroupName, UpdateGroupNameResponse, GetGroupData, GroupData, AddGroupParticipant, AddGroupParticipantResponse, RemoveGroupParticipant, RemoveGroupParticipantResponse, SetGroupAdmin, SetGroupAdminResponse, RemoveAdminResponse, RemoveAdmin, SetGroupPicture, SetGroupPictureResponse, LeaveGroup, LeaveGroupResponse, GetMessage, JournalResponse, GetChatHistory, IncomingJournalResponse, OutgoingJournalResponse } from "../types/types";
2
2
  /**
3
3
  * Client for direct interaction with GREEN-API's WhatsApp gateway.
4
4
  * Provides methods for sending messages, managing instances, and handling files.
5
+ * For more information about the methods, refer to https://green-api.com/en/docs
5
6
  *
6
7
  * @category Client
7
8
  *
@@ -213,4 +214,227 @@ export declare class GreenApiClient {
213
214
  * @throws {Error} If phone number is not an integer
214
215
  */
215
216
  getAuthorizationCode(phoneNumber: number): Promise<GetAuthorizationCode>;
217
+ /**
218
+ * Gets the list of messages in the sending queue.
219
+ * Messages are stored for 24 hours and will be sent immediately after phone authorization.
220
+ * The sending speed is regulated by the Message Sending Interval parameter.
221
+ *
222
+ * @returns Promise resolving to an array of queued messages
223
+ *
224
+ * @example
225
+ * ```typescript
226
+ * const queuedMessages = await client.showMessagesQueue();
227
+ * console.log(queuedMessages);
228
+ * ```
229
+ */
230
+ showMessagesQueue(): Promise<QueueMessage[]>;
231
+ /**
232
+ * Clears the queue of messages waiting to be sent.
233
+ * Important when switching phone numbers to prevent sending queued messages with the new number.
234
+ *
235
+ * @returns Promise resolving to queue clearing status
236
+ *
237
+ * @example
238
+ * ```typescript
239
+ * const result = await client.clearMessagesQueue();
240
+ * if (result.isCleared) {
241
+ * console.log('Queue successfully cleared');
242
+ * }
243
+ * ```
244
+ */
245
+ clearMessagesQueue(): Promise<ClearMessagesQueue>;
246
+ /**
247
+ * Marks messages in a chat as read.
248
+ * For this to work, "Receive webhooks on incoming messages and files" setting must be enabled.
249
+ * Note: Only messages received after enabling the setting can be marked as read.
250
+ *
251
+ * @param params - Parameters specifying which messages to mark as read
252
+ * @returns Promise resolving to read status
253
+ *
254
+ * @example
255
+ * ```typescript
256
+ * // Mark all messages in chat as read
257
+ * const result = await client.readChat({
258
+ * chatId: "1234567890@c.us"
259
+ * });
260
+ *
261
+ * // Mark specific message as read
262
+ * const result = await client.readChat({
263
+ * chatId: "1234567890@c.us",
264
+ * idMessage: "B275A7AA0D6EF89BB9245169BDF174E6"
265
+ * });
266
+ * ```
267
+ */
268
+ readChat(params: ReadChat): Promise<ReadChatResponse>;
269
+ /**
270
+ * Checks WhatsApp account availability on a phone number.
271
+ *
272
+ * @param params - Parameters containing the phone number to check
273
+ * @returns Promise resolving to WhatsApp availability status
274
+ * @throws {Error} If phone number is not an integer or not 11-12 digits
275
+ *
276
+ * @example
277
+ * ```typescript
278
+ * const result = await client.checkWhatsapp({
279
+ * phoneNumber: 11001234567
280
+ * });
281
+ *
282
+ * if (result.existsWhatsapp) {
283
+ * console.log('WhatsApp account exists');
284
+ * }
285
+ * ```
286
+ */
287
+ checkWhatsapp(params: CheckWhatsapp): Promise<CheckWhatsappResponse>;
288
+ /**
289
+ * Gets a user or group chat avatar.
290
+ *
291
+ * @param params - Parameters containing the chat ID
292
+ * @returns Promise resolving to avatar information
293
+ */
294
+ getAvatar(params: GetAvatar): Promise<GetAvatarResponse>;
295
+ /**
296
+ * Gets a list of the current account contacts.
297
+ * Note: Contact information updates can take up to 5 minutes.
298
+ * If an empty array is received, retry the method call.
299
+ *
300
+ * @returns Promise resolving to array of contacts
301
+ */
302
+ getContacts(): Promise<Contact[]>;
303
+ /**
304
+ * Gets detailed information about a contact.
305
+ * Note: This method does not support group chats, use getGroupData for groups.
306
+ *
307
+ * @param params - Parameters containing the chat ID
308
+ * @returns Promise resolving to contact information
309
+ */
310
+ getContactInfo(params: GetAvatar): Promise<ContactInfo>;
311
+ /**
312
+ * Archives a chat. Chat must have at least one incoming message.
313
+ * Note: "Receive webhooks on incoming messages and files" setting must be enabled.
314
+ *
315
+ * @param params - Parameters containing the chat ID to archive
316
+ * @returns Promise resolving to void on success
317
+ */
318
+ archiveChat(params: ArchiveChat): Promise<void>;
319
+ /**
320
+ * Unarchives a chat.
321
+ *
322
+ * @param params - Parameters containing the chat ID to unarchive
323
+ * @returns Promise resolving to void on success
324
+ */
325
+ unarchiveChat(params: UnarchiveChat): Promise<void>;
326
+ /**
327
+ * Changes settings of disappearing messages in chats.
328
+ * Valid expiration times: 0 (off), 86400 (24h), 604800 (7d), 7776000 (90d)
329
+ *
330
+ * @param params - Parameters containing chat ID and message expiration time
331
+ * @returns Promise resolving to chat disappearing message settings
332
+ */
333
+ setDisappearingChat(params: SetDisappearingChat): Promise<SetDisappearingChatResponse>;
334
+ /**
335
+ * Creates a group chat.
336
+ * Note: Limited to creating 1 group per 5 minutes to simulate human behavior.
337
+ *
338
+ * @param params - Parameters containing group name and participant IDs
339
+ * @returns Promise resolving to group creation result
340
+ */
341
+ createGroup(params: CreateGroup): Promise<CreateGroupResponse>;
342
+ /**
343
+ * Changes a group chat name.
344
+ *
345
+ * @param params - Parameters containing group ID and new name
346
+ * @returns Promise resolving to update status
347
+ */
348
+ updateGroupName(params: UpdateGroupName): Promise<UpdateGroupNameResponse>;
349
+ /**
350
+ * Gets group chat data.
351
+ * Note: groupInviteLink will be empty if user is not an admin or owner.
352
+ *
353
+ * @param params - Parameters containing group ID
354
+ * @returns Promise resolving to group data
355
+ */
356
+ getGroupData(params: GetGroupData): Promise<GroupData>;
357
+ /**
358
+ * Adds a participant to a group chat.
359
+ * Note: Only group administrators can add members.
360
+ * The participant's number should be saved in the phonebook for reliable addition.
361
+ *
362
+ * @param params - Parameters containing group ID and participant ID
363
+ * @returns Promise resolving to addition status
364
+ */
365
+ addGroupParticipant(params: AddGroupParticipant): Promise<AddGroupParticipantResponse>;
366
+ /**
367
+ * Removes a participant from a group chat.
368
+ *
369
+ * @param params - Parameters containing group ID and participant ID to remove
370
+ * @returns Promise resolving to removal status
371
+ */
372
+ removeGroupParticipant(params: RemoveGroupParticipant): Promise<RemoveGroupParticipantResponse>;
373
+ /**
374
+ * Sets a group chat participant as an administrator.
375
+ *
376
+ * @param params - Parameters containing group ID and participant ID to promote
377
+ * @returns Promise resolving to admin status change result
378
+ */
379
+ setGroupAdmin(params: SetGroupAdmin): Promise<SetGroupAdminResponse>;
380
+ /**
381
+ * Removes administrator rights from a group chat participant.
382
+ *
383
+ * @param params - Parameters containing group ID and participant ID to demote
384
+ * @returns Promise resolving to admin removal status
385
+ */
386
+ removeAdmin(params: RemoveAdmin): Promise<RemoveAdminResponse>;
387
+ /**
388
+ * Sets a group chat picture.
389
+ *
390
+ * @param params - Parameters containing group ID and picture file (jpg)
391
+ * @returns Promise resolving to picture update status
392
+ */
393
+ setGroupPicture(params: SetGroupPicture): Promise<SetGroupPictureResponse>;
394
+ /**
395
+ * Makes the current account leave a group chat.
396
+ *
397
+ * @param params - Parameters containing the group ID to leave
398
+ * @returns Promise resolving to leave status
399
+ */
400
+ leaveGroup(params: LeaveGroup): Promise<LeaveGroupResponse>;
401
+ /**
402
+ * Gets details of a specific message.
403
+ * Note: To receive incoming webhooks, requires "Receive webhooks on incoming messages and files" setting to be enabled.
404
+ * Note: To receive statuses of sent messsages, requires "Receive notifications about the statuses of sent messages" to be enabled.
405
+ * Messages can take up to 2 minutes to appear in the journal.
406
+ *
407
+ * @param params - Parameters containing chat ID and message ID
408
+ * @returns Promise resolving to message details
409
+ */
410
+ getMessage(params: GetMessage): Promise<JournalResponse>;
411
+ /**
412
+ * Gets chat message history.
413
+ * Note: Requires "Receive webhooks" setting to be enabled.
414
+ * Messages can take up to 2 minutes to appear in history.
415
+ *
416
+ * @param params - Parameters containing chat ID and optional message count
417
+ * @returns Promise resolving to array of messages
418
+ */
419
+ getChatHistory(params: GetChatHistory): Promise<JournalResponse[]>;
420
+ /**
421
+ * Gets last incoming messages for the specified time period.
422
+ * Default is 24 hours (1440 minutes).
423
+ * Note: Requires "Receive webhooks" setting to be enabled.
424
+ * Messages can take up to 2 minutes to appear in history.
425
+ *
426
+ * @param minutes - Optional time period in minutes
427
+ * @returns Promise resolving to array of incoming messages
428
+ */
429
+ lastIncomingMessages(minutes?: number): Promise<IncomingJournalResponse[]>;
430
+ /**
431
+ * Gets last outgoing messages for the specified time period.
432
+ * Default is 24 hours (1440 minutes).
433
+ * Note: Requires "Receive webhooks" setting to be enabled.
434
+ * Messages can take up to 2 minutes to appear in history.
435
+ *
436
+ * @param minutes - Optional time period in minutes
437
+ * @returns Promise resolving to array of outgoing messages
438
+ */
439
+ lastOutgoingMessages(minutes?: number): Promise<OutgoingJournalResponse[]>;
216
440
  }
@@ -8,6 +8,7 @@ const axios_1 = __importDefault(require("axios"));
8
8
  /**
9
9
  * Client for direct interaction with GREEN-API's WhatsApp gateway.
10
10
  * Provides methods for sending messages, managing instances, and handling files.
11
+ * For more information about the methods, refer to https://green-api.com/en/docs
11
12
  *
12
13
  * @category Client
13
14
  *
@@ -43,19 +44,20 @@ class GreenApiClient {
43
44
  buildEndpoint(endpoint) {
44
45
  return `/${endpoint}/${this.instance.apiTokenInstance}`;
45
46
  }
46
- async makeRequest(method, endpoint, data, config) {
47
+ async makeRequest(method, endpoint, data, queryParams, config) {
47
48
  try {
49
+ const url = this.buildEndpoint(endpoint) + (queryParams ? "?" + new URLSearchParams(Object.entries(queryParams).map(([key, value]) => [key, value.toString()])).toString() : "");
48
50
  const response = await (method === "get"
49
- ? this.client.get(this.buildEndpoint(endpoint), config)
50
- : this.client.post(this.buildEndpoint(endpoint), data, config));
51
+ ? this.client.get(url, config)
52
+ : this.client.post(url, data, config));
51
53
  return response.data;
52
54
  }
53
55
  catch (error) {
54
- throw new Error(`Failed to ${endpoint.replace(/([A-Z])/g, " $1").toLowerCase()}: ${error.message}`);
56
+ throw new Error(`Failed to ${endpoint.replace(/([A-Z])/g, " $1").toLowerCase()}: ${error.message}. ${JSON.stringify(error.response?.data)}`);
55
57
  }
56
58
  }
57
59
  async makeFileUploadRequest(endpoint, formData, headers) {
58
- return this.makeRequest("post", endpoint, formData, {
60
+ return this.makeRequest("post", endpoint, formData, undefined, {
59
61
  headers: { "Content-Type": "multipart/form-data" },
60
62
  ...headers,
61
63
  });
@@ -334,5 +336,284 @@ class GreenApiClient {
334
336
  }
335
337
  return this.makeRequest("post", "getAuthorizationCode", { phoneNumber });
336
338
  }
339
+ /**
340
+ * Gets the list of messages in the sending queue.
341
+ * Messages are stored for 24 hours and will be sent immediately after phone authorization.
342
+ * The sending speed is regulated by the Message Sending Interval parameter.
343
+ *
344
+ * @returns Promise resolving to an array of queued messages
345
+ *
346
+ * @example
347
+ * ```typescript
348
+ * const queuedMessages = await client.showMessagesQueue();
349
+ * console.log(queuedMessages);
350
+ * ```
351
+ */
352
+ async showMessagesQueue() {
353
+ return this.makeRequest("get", "showMessagesQueue");
354
+ }
355
+ /**
356
+ * Clears the queue of messages waiting to be sent.
357
+ * Important when switching phone numbers to prevent sending queued messages with the new number.
358
+ *
359
+ * @returns Promise resolving to queue clearing status
360
+ *
361
+ * @example
362
+ * ```typescript
363
+ * const result = await client.clearMessagesQueue();
364
+ * if (result.isCleared) {
365
+ * console.log('Queue successfully cleared');
366
+ * }
367
+ * ```
368
+ */
369
+ async clearMessagesQueue() {
370
+ return this.makeRequest("get", "clearMessagesQueue");
371
+ }
372
+ /**
373
+ * Marks messages in a chat as read.
374
+ * For this to work, "Receive webhooks on incoming messages and files" setting must be enabled.
375
+ * Note: Only messages received after enabling the setting can be marked as read.
376
+ *
377
+ * @param params - Parameters specifying which messages to mark as read
378
+ * @returns Promise resolving to read status
379
+ *
380
+ * @example
381
+ * ```typescript
382
+ * // Mark all messages in chat as read
383
+ * const result = await client.readChat({
384
+ * chatId: "1234567890@c.us"
385
+ * });
386
+ *
387
+ * // Mark specific message as read
388
+ * const result = await client.readChat({
389
+ * chatId: "1234567890@c.us",
390
+ * idMessage: "B275A7AA0D6EF89BB9245169BDF174E6"
391
+ * });
392
+ * ```
393
+ */
394
+ async readChat(params) {
395
+ return this.makeRequest("post", "readChat", params);
396
+ }
397
+ /**
398
+ * Checks WhatsApp account availability on a phone number.
399
+ *
400
+ * @param params - Parameters containing the phone number to check
401
+ * @returns Promise resolving to WhatsApp availability status
402
+ * @throws {Error} If phone number is not an integer or not 11-12 digits
403
+ *
404
+ * @example
405
+ * ```typescript
406
+ * const result = await client.checkWhatsapp({
407
+ * phoneNumber: 11001234567
408
+ * });
409
+ *
410
+ * if (result.existsWhatsapp) {
411
+ * console.log('WhatsApp account exists');
412
+ * }
413
+ * ```
414
+ */
415
+ async checkWhatsapp(params) {
416
+ const phoneStr = params.phoneNumber.toString();
417
+ if (!Number.isInteger(params.phoneNumber)) {
418
+ throw new Error("Phone number must contain only digits");
419
+ }
420
+ if (phoneStr.length < 11 || phoneStr.length > 12) {
421
+ throw new Error("Phone number must be 11 or 12 digits");
422
+ }
423
+ return this.makeRequest("post", "checkWhatsapp", params);
424
+ }
425
+ /**
426
+ * Gets a user or group chat avatar.
427
+ *
428
+ * @param params - Parameters containing the chat ID
429
+ * @returns Promise resolving to avatar information
430
+ */
431
+ async getAvatar(params) {
432
+ return this.makeRequest("post", "getAvatar", params);
433
+ }
434
+ /**
435
+ * Gets a list of the current account contacts.
436
+ * Note: Contact information updates can take up to 5 minutes.
437
+ * If an empty array is received, retry the method call.
438
+ *
439
+ * @returns Promise resolving to array of contacts
440
+ */
441
+ async getContacts() {
442
+ return this.makeRequest("get", "getContacts");
443
+ }
444
+ /**
445
+ * Gets detailed information about a contact.
446
+ * Note: This method does not support group chats, use getGroupData for groups.
447
+ *
448
+ * @param params - Parameters containing the chat ID
449
+ * @returns Promise resolving to contact information
450
+ */
451
+ async getContactInfo(params) {
452
+ return this.makeRequest("post", "getContactInfo", params);
453
+ }
454
+ /**
455
+ * Archives a chat. Chat must have at least one incoming message.
456
+ * Note: "Receive webhooks on incoming messages and files" setting must be enabled.
457
+ *
458
+ * @param params - Parameters containing the chat ID to archive
459
+ * @returns Promise resolving to void on success
460
+ */
461
+ async archiveChat(params) {
462
+ return this.makeRequest("post", "archiveChat", params);
463
+ }
464
+ /**
465
+ * Unarchives a chat.
466
+ *
467
+ * @param params - Parameters containing the chat ID to unarchive
468
+ * @returns Promise resolving to void on success
469
+ */
470
+ async unarchiveChat(params) {
471
+ return this.makeRequest("post", "unarchiveChat", params);
472
+ }
473
+ /**
474
+ * Changes settings of disappearing messages in chats.
475
+ * Valid expiration times: 0 (off), 86400 (24h), 604800 (7d), 7776000 (90d)
476
+ *
477
+ * @param params - Parameters containing chat ID and message expiration time
478
+ * @returns Promise resolving to chat disappearing message settings
479
+ */
480
+ async setDisappearingChat(params) {
481
+ return this.makeRequest("post", "setDisappearingChat", params);
482
+ }
483
+ /**
484
+ * Creates a group chat.
485
+ * Note: Limited to creating 1 group per 5 minutes to simulate human behavior.
486
+ *
487
+ * @param params - Parameters containing group name and participant IDs
488
+ * @returns Promise resolving to group creation result
489
+ */
490
+ async createGroup(params) {
491
+ return this.makeRequest("post", "createGroup", params);
492
+ }
493
+ /**
494
+ * Changes a group chat name.
495
+ *
496
+ * @param params - Parameters containing group ID and new name
497
+ * @returns Promise resolving to update status
498
+ */
499
+ async updateGroupName(params) {
500
+ return this.makeRequest("post", "updateGroupName", params);
501
+ }
502
+ /**
503
+ * Gets group chat data.
504
+ * Note: groupInviteLink will be empty if user is not an admin or owner.
505
+ *
506
+ * @param params - Parameters containing group ID
507
+ * @returns Promise resolving to group data
508
+ */
509
+ async getGroupData(params) {
510
+ return this.makeRequest("post", "getGroupData", params);
511
+ }
512
+ /**
513
+ * Adds a participant to a group chat.
514
+ * Note: Only group administrators can add members.
515
+ * The participant's number should be saved in the phonebook for reliable addition.
516
+ *
517
+ * @param params - Parameters containing group ID and participant ID
518
+ * @returns Promise resolving to addition status
519
+ */
520
+ async addGroupParticipant(params) {
521
+ return this.makeRequest("post", "addGroupParticipant", params);
522
+ }
523
+ /**
524
+ * Removes a participant from a group chat.
525
+ *
526
+ * @param params - Parameters containing group ID and participant ID to remove
527
+ * @returns Promise resolving to removal status
528
+ */
529
+ async removeGroupParticipant(params) {
530
+ return this.makeRequest("post", "removeGroupParticipant", params);
531
+ }
532
+ /**
533
+ * Sets a group chat participant as an administrator.
534
+ *
535
+ * @param params - Parameters containing group ID and participant ID to promote
536
+ * @returns Promise resolving to admin status change result
537
+ */
538
+ async setGroupAdmin(params) {
539
+ return this.makeRequest("post", "setGroupAdmin", params);
540
+ }
541
+ /**
542
+ * Removes administrator rights from a group chat participant.
543
+ *
544
+ * @param params - Parameters containing group ID and participant ID to demote
545
+ * @returns Promise resolving to admin removal status
546
+ */
547
+ async removeAdmin(params) {
548
+ return this.makeRequest("post", "removeAdmin", params);
549
+ }
550
+ /**
551
+ * Sets a group chat picture.
552
+ *
553
+ * @param params - Parameters containing group ID and picture file (jpg)
554
+ * @returns Promise resolving to picture update status
555
+ */
556
+ async setGroupPicture(params) {
557
+ const formData = new FormData();
558
+ formData.append("file", params.file);
559
+ formData.append("groupId", params.groupId);
560
+ return this.makeFileUploadRequest("setGroupPicture", formData);
561
+ }
562
+ /**
563
+ * Makes the current account leave a group chat.
564
+ *
565
+ * @param params - Parameters containing the group ID to leave
566
+ * @returns Promise resolving to leave status
567
+ */
568
+ async leaveGroup(params) {
569
+ return this.makeRequest("post", "leaveGroup", params);
570
+ }
571
+ /**
572
+ * Gets details of a specific message.
573
+ * Note: To receive incoming webhooks, requires "Receive webhooks on incoming messages and files" setting to be enabled.
574
+ * Note: To receive statuses of sent messsages, requires "Receive notifications about the statuses of sent messages" to be enabled.
575
+ * Messages can take up to 2 minutes to appear in the journal.
576
+ *
577
+ * @param params - Parameters containing chat ID and message ID
578
+ * @returns Promise resolving to message details
579
+ */
580
+ async getMessage(params) {
581
+ return this.makeRequest("post", "getMessage", params);
582
+ }
583
+ /**
584
+ * Gets chat message history.
585
+ * Note: Requires "Receive webhooks" setting to be enabled.
586
+ * Messages can take up to 2 minutes to appear in history.
587
+ *
588
+ * @param params - Parameters containing chat ID and optional message count
589
+ * @returns Promise resolving to array of messages
590
+ */
591
+ async getChatHistory(params) {
592
+ return this.makeRequest("post", "getChatHistory", params);
593
+ }
594
+ /**
595
+ * Gets last incoming messages for the specified time period.
596
+ * Default is 24 hours (1440 minutes).
597
+ * Note: Requires "Receive webhooks" setting to be enabled.
598
+ * Messages can take up to 2 minutes to appear in history.
599
+ *
600
+ * @param minutes - Optional time period in minutes
601
+ * @returns Promise resolving to array of incoming messages
602
+ */
603
+ async lastIncomingMessages(minutes) {
604
+ return this.makeRequest("get", "lastIncomingMessages", undefined, minutes ? { minutes } : undefined);
605
+ }
606
+ /**
607
+ * Gets last outgoing messages for the specified time period.
608
+ * Default is 24 hours (1440 minutes).
609
+ * Note: Requires "Receive webhooks" setting to be enabled.
610
+ * Messages can take up to 2 minutes to appear in history.
611
+ *
612
+ * @param minutes - Optional time period in minutes
613
+ * @returns Promise resolving to array of outgoing messages
614
+ */
615
+ async lastOutgoingMessages(minutes) {
616
+ return this.makeRequest("get", "lastOutgoingMessages", undefined, minutes ? { minutes } : undefined);
617
+ }
337
618
  }
338
619
  exports.GreenApiClient = GreenApiClient;
@@ -1,4 +1,4 @@
1
- import { BaseUser, Instance, Settings } from "../types/types";
1
+ import { BaseUser, Instance } from "../types/types";
2
2
  /**
3
3
  * Abstract class for managing instance and user data storage.
4
4
  * Implement this class to define how your integration stores and retrieves data.
@@ -26,10 +26,9 @@ export declare abstract class StorageProvider<TUser extends BaseUser = BaseUser,
26
26
  *
27
27
  * @param instance - The instance data to store
28
28
  * @param userId - ID of the user who owns this instance
29
- * @param settings - Optional GREEN-API settings for the instance
30
29
  * @returns Promise resolving to the created instance
31
30
  */
32
- abstract createInstance(instance: Instance, userId: bigint | number, settings?: Settings): Promise<TInstance>;
31
+ abstract createInstance(instance: Instance, userId: bigint | number): Promise<TInstance>;
33
32
  /**
34
33
  * Retrieves an instance by its ID.
35
34
  *