@builderbot/provider-wppconnect 1.3.3 → 1.3.5-alpha.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/index.d.ts DELETED
@@ -1,115 +0,0 @@
1
- import { ProviderClass } from '@builderbot/bot';
2
- import type { BotContext, GlobalVendorArgs, SendOptions } from '@builderbot/bot/dist/types';
3
- import type { Message, Whatsapp } from '@wppconnect-team/wppconnect';
4
- import type { Middleware } from 'polka';
5
-
6
- import type { SaveFileOptions } from './types';
7
- declare class WPPConnectProvider extends ProviderClass {
8
- protected afterHttpServerInit(): void;
9
- globalVendorArgs: GlobalVendorArgs;
10
- vendor: Whatsapp;
11
- constructor(args: {
12
- name: string;
13
- });
14
- /**
15
- * Iniciar WppConnect
16
- */
17
- protected initVendor(): Promise<any>;
18
- /**
19
- * Mapeamos los eventos nativos a los que la clase Provider espera
20
- * para tener un standar de eventos
21
- * @returns
22
- */
23
- busEvents: () => {
24
- event: string;
25
- func: (payload: Message & {
26
- lat?: string;
27
- lng?: string;
28
- name: string;
29
- }) => void;
30
- }[];
31
- protected listenOnEvents(vendor: any): void;
32
- /**
33
- *
34
- * @param req
35
- * @param res
36
- */
37
- indexHome: Middleware;
38
- protected beforeHttpServerInit(): void;
39
- /**
40
- * @deprecated Buttons are not available in this provider, please use sendButtons instead
41
- * @private
42
- * @param {string} number
43
- * @param {string} text
44
- * @param {Array} buttons
45
- * @example await sendButtons("+XXXXXXXXXXX", "Your Text", [{"body": "Button 1"},{"body": "Button 2"}])
46
- */
47
- sendButtons: (number: any, text: any, buttons: any[]) => Promise<Message>;
48
- /**
49
- * Enviar mensaje con encuesta
50
- * @param {string} number
51
- * @param {string} text
52
- * @param {Array} poll
53
- * @example await sendPollMessage("+XXXXXXXXXXX", "You accept terms", [ "Yes", "Not"], {"selectableCount": 1})
54
- */
55
- sendPoll: (number: any, text: any, poll: {
56
- options: string[];
57
- multiselect: any;
58
- }) => Promise<false | Message>;
59
- /**
60
- * Enviar audio
61
- * @alpha
62
- * @param {string} number
63
- * @param {string} message
64
- * @param {boolean} voiceNote optional
65
- * @example await sendMessage('+XXXXXXXXXXX', 'audio.mp3')
66
- */
67
- sendPtt: (number: any, audioPath: string) => Promise<unknown>;
68
- /**
69
- * Enviar imagen
70
- * @param {string} number - The phone number to send the image to.
71
- * @param {string} filePath - The path to the image file.
72
- * @param {string} text - The text to accompany the image.
73
- * @returns {Promise<any>} - A promise representing the result of sending the image.
74
- */
75
- sendImage: (number: string, filePath: string, text: string) => Promise<any>;
76
- /**
77
- *
78
- * @param {string} number
79
- * @param {string} filePath
80
- * @example await sendMessage('+XXXXXXXXXXX', './document/file.pdf')
81
- */
82
- sendFile: (number: any, filePath: string, text: any) => Promise<any>;
83
- /**
84
- * Enviar video
85
- * @param {string} number - El número de teléfono al que se enviará el video.
86
- * @param {string} filePath - La ruta al archivo de video.
87
- * @param {string} text - El texto que acompañará al video.
88
- * @returns {Promise<{
89
- * ack: number;
90
- * id: string;
91
- * sendMsgResult: SendMsgResult;
92
- * }>} - Una promesa que representa el resultado de enviar el video.
93
- */
94
- sendVideo: (number: string, filePath: string, text: string) => Promise<any>;
95
- /**
96
- * Enviar imagen o multimedia
97
- * @param {*} number
98
- * @param {*} mediaInput
99
- * @param {*} message
100
- * @returns
101
- */
102
- sendMedia: (number: any, mediaUrl: string, text: any) => Promise<any>;
103
- /**
104
- * Enviar mensaje al usuario
105
- * @param {*} to
106
- * @param {*} message
107
- * @param {*} param2
108
- * @returns
109
- */
110
- sendMessage: (number: string, message: string, options?: SendOptions) => Promise<any>;
111
- private generateFileName;
112
- saveFile: (ctx: Partial<Message & BotContext>, options?: SaveFileOptions) => Promise<string>;
113
- }
114
- export { WPPConnectProvider };
115
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAS,MAAM,iB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UAAU,MAAM,EAAE,MAAM,MAAM,KAAG,OAAO,CAAC,GAAG,CAAC,CAE/E;IAED;;;;;OAKG;IAEH,QAAQ,GAAU,QAAQ,GAAG,EAAE,UAAU,MAAM,EAAE,MAAM,GAAG,kBAGzD;IAED;;;;;;;;;;OAUG;IACH,SAAS,GAAU,QAAQ,MAAM,EAAE,UAAU,MAAM,EAAE,MAAM,MAAM,KAAG,OAAO,CAAC,GAAG,CAAC,CAE/E;IAED;;;;;;OAMG;IACH,SAAS,GAAU,QAAQ,GAAG,EAAE,UAAU,MAAM,EAAE,MAAM,GAAG,kBAW1D;IAED;;;;;;OAMG;IACH,WAAW,GAAU,QAAQ,MAAM,EAAE,SAAS,MAAM,EAAE,UAAU,WAAW,KAAG,OAAO,CAAC,GAAG,CAAC,CAKzF;IAED,OAAO,CAAC,gBAAgB,CAAmE;IAE3F,QAAQ,GAAU,KAAK,OAAO,CAAC,OAAO,GAAG,UAAU,CAAC,EAAE,UAAS,eAAoB,KAAG,OAAO,CAAC,MAAM,CAAC,CAapG;CACJ;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
package/dist/types.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import type { ProviderClass } from '@builderbot/bot';
2
- export interface Response {
3
- type: string;
4
- data: Buffer;
5
- }
6
- export type BotCtxMiddleware = Partial<ProviderClass & {
7
- provider: any;
8
- }>;
9
- export interface SaveFileOptions {
10
- path?: string;
11
- }
12
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,MAAM,WAAW,QAAQ;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,aAAa,GAAG;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,CAAC,CAAA;AAEzE,MAAM,WAAW,eAAe;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB"}
package/dist/utils.d.ts DELETED
@@ -1,10 +0,0 @@
1
- import type { Response } from './types';
2
- declare const emptyDirSessions: (pathBase: string) => Promise<unknown>;
3
- declare const WppConnectCleanNumber: (number: string, full?: boolean) => string;
4
- declare const notMatches: (matches: RegExpMatchArray | null) => boolean;
5
- declare const writeFilePromise: (pathQr: string, response: Response) => Promise<boolean>;
6
- declare const WppDeleteTokens: (session: string) => void;
7
- declare const WppConnectGenerateImage: (base: string, name?: string) => Promise<void | Error>;
8
- declare const WppConnectValidNumber: (rawNumber: string) => boolean;
9
- export { WppConnectValidNumber, WppDeleteTokens, WppConnectGenerateImage, WppConnectCleanNumber, notMatches, writeFilePromise, emptyDirSessions, };
10
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,QAAA,MAAM,gBAAgB,GAAU,UAAU,MAAM,qBAM1C,CAAA;AAEN,QAAA,MAAM,qBAAqB,GAAI,QAAQ,MAAM,EAAE,OAAM,OAAe,KAAG,MAItE,CAAA;AAED,QAAA,MAAM,UAAU,GAAI,SAAS,gBAAgB,GAAG,IAAI,KAAG,OAEtD,CAAA;AAED,QAAA,MAAM,gBAAgB,GAAI,QAAQ,MAAM,EAAE,UAAU,QAAQ,KAAG,OAAO,CAAC,OAAO,CAO7E,CAAA;AAED,QAAA,MAAM,eAAe,GAAI,SAAS,MAAM,SAQvC,CAAA;AAED,QAAA,MAAM,uBAAuB,GAAU,MAAM,MAAM,EAAE,OAAM,MAAiB,KAAG,OAAO,CAAC,IAAI,GAAG,KAAK,CAclG,CAAA;AAED,QAAA,MAAM,qBAAqB,GAAI,WAAW,MAAM,KAAG,OAIlD,CAAA;AAED,OAAO,EACH,qBAAqB,EACrB,eAAe,EACf,uBAAuB,EACvB,qBAAqB,EACrB,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GACnB,CAAA"}