@open-wa/wa-automate-types-only 4.44.9 → 4.45.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.
package/dist/api/Client.d.ts
CHANGED
@@ -8,7 +8,7 @@ import { ParticipantChangedEventModel } from './model/group-metadata';
|
|
8
8
|
import { ConfigObject, STATE, LicenseType, Webhook, EventPayload } from './model';
|
9
9
|
import PQueue, { DefaultAddOptions, Options } from 'p-queue';
|
10
10
|
import { HealthCheck, SessionInfo } from './model/sessionInfo';
|
11
|
-
import { ChatId, GroupChatId, Content, Base64, MessageId, ContactId, DataURL,
|
11
|
+
import { ChatId, GroupChatId, Content, Base64, MessageId, ContactId, DataURL, AdvancedFile } from './model/aliases';
|
12
12
|
import { CustomProduct, Order, Product } from './model/product';
|
13
13
|
import { Label } from './model/label';
|
14
14
|
import { Mp4StickerConversionProcessOptions, StickerMetadata } from './model/media';
|
@@ -637,7 +637,7 @@ export declare class Client {
|
|
637
637
|
* @param hideTags boolean default: false [INSIDERS] set this to try silent tag someone in the caption
|
638
638
|
* @returns `Promise <boolean | string>` This will either return true or the id of the message. It will return true after 10 seconds even if waitForId is true
|
639
639
|
*/
|
640
|
-
sendImage(to: ChatId, file:
|
640
|
+
sendImage(to: ChatId, file: AdvancedFile, filename: string, caption: Content, quotedMsgId?: MessageId, waitForId?: boolean, ptt?: boolean, withoutPreview?: boolean, hideTags?: boolean, viewOnce?: boolean): Promise<MessageId | boolean>;
|
641
641
|
/**
|
642
642
|
* Automatically sends a youtube link with the auto generated link preview. You can also add a custom message.
|
643
643
|
* @param chatId
|
@@ -696,7 +696,7 @@ export declare class Client {
|
|
696
696
|
* @param hideTags boolean default: false [INSIDERS] set this to try silent tag someone in the caption
|
697
697
|
* @returns `Promise <boolean | MessageId>` This will either return true or the id of the message. It will return true after 10 seconds even if waitForId is true
|
698
698
|
*/
|
699
|
-
sendFile(to: ChatId, file:
|
699
|
+
sendFile(to: ChatId, file: AdvancedFile, filename: string, caption: Content, quotedMsgId?: MessageId, waitForId?: boolean, ptt?: boolean, withoutPreview?: boolean, hideTags?: boolean, viewOnce?: boolean): Promise<MessageId | boolean>;
|
700
700
|
/**
|
701
701
|
* {@license:insiders@}
|
702
702
|
*
|
@@ -712,14 +712,14 @@ export declare class Client {
|
|
712
712
|
* @param quotedMsgId string true_0000000000@c.us_JHB2HB23HJ4B234HJB to send as a reply to a message
|
713
713
|
* @returns `Promise <boolean | string>` This will either return true or the id of the message. It will return true after 10 seconds even if waitForId is true
|
714
714
|
*/
|
715
|
-
sendPtt(to: ChatId, file:
|
715
|
+
sendPtt(to: ChatId, file: AdvancedFile, quotedMsgId: MessageId): Promise<MessageId>;
|
716
716
|
/**
|
717
717
|
* Send an audio file with the default audio player (not PTT/voice message)
|
718
718
|
* @param to chat id `xxxxx@c.us`
|
719
719
|
* @param base64 base64 data:image/xxx;base64,xxx or the path of the file you want to send.
|
720
720
|
* @param quotedMsgId string true_0000000000@c.us_JHB2HB23HJ4B234HJB to send as a reply to a message
|
721
721
|
*/
|
722
|
-
sendAudio(to: ChatId, file:
|
722
|
+
sendAudio(to: ChatId, file: AdvancedFile, quotedMsgId?: MessageId): Promise<MessageId>;
|
723
723
|
/**
|
724
724
|
* Sends a video to given chat as a gif, with caption or not, using base64
|
725
725
|
* @param to chat id `xxxxx@c.us`
|
@@ -729,7 +729,7 @@ export declare class Client {
|
|
729
729
|
* @param quotedMsgId string true_0000000000@c.us_JHB2HB23HJ4B234HJB to send as a reply to a message
|
730
730
|
* @param requestConfig {} By default the request is a get request, however you can override that and many other options by sending this parameter. You can read more about this parameter here: https://github.com/axios/axios#request-config
|
731
731
|
*/
|
732
|
-
sendVideoAsGif(to: ChatId, file:
|
732
|
+
sendVideoAsGif(to: ChatId, file: AdvancedFile, filename: string, caption: Content, quotedMsgId?: MessageId, requestConfig?: AxiosRequestConfig): Promise<MessageId>;
|
733
733
|
/**
|
734
734
|
* Sends a video to given chat as a gif by using a giphy link, with caption or not, using base64
|
735
735
|
* @param to chat id `xxxxx@c.us`
|
@@ -95,4 +95,12 @@ export declare type Base64 = Brand<string, "Base64">;
|
|
95
95
|
* Learn more here: https://www.w3schools.com/html/html_filepaths.asp
|
96
96
|
*/
|
97
97
|
export declare type FilePath = Brand<string, "FilePath">;
|
98
|
+
/**
|
99
|
+
* A URL of a file used with a GET request
|
100
|
+
*/
|
101
|
+
export declare type GetURL = Brand<string, "GetURL">;
|
102
|
+
/**
|
103
|
+
* Some file based actions in open-wa are powerful enough to take a dataurl, url or filepath
|
104
|
+
*/
|
105
|
+
export declare type AdvancedFile = DataURL | FilePath | GetURL;
|
98
106
|
export {};
|
@@ -8,9 +8,25 @@ export interface Message {
|
|
8
8
|
*/
|
9
9
|
selectedButtonId: string;
|
10
10
|
/**
|
11
|
-
* The id of the message
|
11
|
+
* The id of the message. Consists of the Chat ID and a unique string.
|
12
|
+
*
|
13
|
+
* Example:
|
14
|
+
*
|
15
|
+
* ```
|
16
|
+
* false_447123456789@c.us_7D914FEA78BE10277743F4B785045C37
|
17
|
+
* ```
|
12
18
|
*/
|
13
19
|
id: MessageId;
|
20
|
+
/**
|
21
|
+
* The unique segment of the message id.
|
22
|
+
*
|
23
|
+
* Example:
|
24
|
+
*
|
25
|
+
* ```
|
26
|
+
* 7D914FEA78BE10277743F4B785045C37
|
27
|
+
* ```
|
28
|
+
*/
|
29
|
+
mId: string;
|
14
30
|
/**
|
15
31
|
* The body of the message. If the message type is `chat` , `body` will be the text of the chat. If the message type is some sort of media, then this body will be the thumbnail of the media.
|
16
32
|
*/
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { Client } from '../..';
|
2
2
|
import { cliFlags } from '../server';
|
3
3
|
import { Request, Response } from "express";
|
4
|
+
export declare const chatwoot_webhook_check_event_name = "cli.integrations.chatwoot.check";
|
4
5
|
export declare type expressMiddleware = (req: Request, res: Response) => Promise<Response<any, Record<string, any>>>;
|
5
6
|
export declare const chatwootMiddleware: (cliConfig: cliFlags, client: Client) => expressMiddleware;
|
6
7
|
export declare const setupChatwootOutgoingMessageHandler: (cliConfig: cliFlags, client: Client) => Promise<void>;
|