@builderbot/provider-baileys 0.1.3-alpha.22
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/README.md +11 -0
- package/dist/bailey.d.ts +162 -0
- package/dist/bailey.d.ts.map +1 -0
- package/dist/baileyWrapper.d.ts +4 -0
- package/dist/baileyWrapper.d.ts.map +1 -0
- package/dist/index.cjs +56836 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/server.d.ts +39 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/type.d.ts +13 -0
- package/dist/type.d.ts.map +1 -0
- package/dist/utils.d.ts +21 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +58 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEtC,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { BotCtxMiddleware } from '@builderbot/bot/dist/types';
|
|
3
|
+
import { WASocket } from '@whiskeysockets/baileys';
|
|
4
|
+
import { EventEmitter } from 'node:events';
|
|
5
|
+
import polka, { type Polka } from 'polka';
|
|
6
|
+
|
|
7
|
+
import type { BaileysProvider } from './bailey';
|
|
8
|
+
declare class BaileyHttpServer extends EventEmitter {
|
|
9
|
+
server: Polka;
|
|
10
|
+
port: number;
|
|
11
|
+
constructor(_port: number);
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @param _
|
|
15
|
+
* @param res
|
|
16
|
+
*/
|
|
17
|
+
protected indexHome: polka.Middleware;
|
|
18
|
+
/**
|
|
19
|
+
* Contruir HTTP Server
|
|
20
|
+
*/
|
|
21
|
+
protected buildHTTPServer(): Polka;
|
|
22
|
+
/**
|
|
23
|
+
* Iniciar el servidor HTTP
|
|
24
|
+
*/
|
|
25
|
+
start(vendor: BotCtxMiddleware, port?: number, args?: {
|
|
26
|
+
botName: string;
|
|
27
|
+
}): void;
|
|
28
|
+
stop(): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param inHandleCtx
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
declare const inHandleCtx: <T extends Pick<BaileysProvider, "sendMessage" | "vendor"> & {
|
|
36
|
+
provider: WASocket;
|
|
37
|
+
}>(ctxPolka: (bot: T, req: any, res: any) => Promise<void>) => (req: any, res: any) => any;
|
|
38
|
+
export { BaileyHttpServer, inHandleCtx };
|
|
39
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,KAAK,EAAE,EAAE,KAAK,KAAK,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAK/C,cAAM,gBAAiB,SAAQ,YAAY;IAChC,MAAM,EAAE,KAAK,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;gBAEP,KAAK,EAAE,MAAM;IAMzB;;;;OAIG;IACH,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,UAAU,CAMpC;IAED;;OAEG;IACH,SAAS,CAAC,eAAe,IAAI,KAAK;IAOlC;;OAEG;IACH,KAAK,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE;IAczE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAWxB;AAED;;;;GAIG;AACH,QAAA,MAAM,WAAW;cAC4D,QAAQ;2BACzC,GAAG,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,WAE7D,GAAG,OAAO,GAAG,QAoBlB,CAAA;AAET,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAA"}
|
package/dist/type.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface GlobalVendorArgs {
|
|
2
|
+
name: string;
|
|
3
|
+
gifPlayback: boolean;
|
|
4
|
+
usePairingCode: boolean;
|
|
5
|
+
phoneNumber: string | null;
|
|
6
|
+
browser: string[];
|
|
7
|
+
useBaileysStore: boolean;
|
|
8
|
+
port: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ButtonOption {
|
|
11
|
+
body: string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../src/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,OAAO,CAAA;IACpB,cAAc,EAAE,OAAO,CAAA;IACvB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,eAAe,EAAE,OAAO,CAAA;IACxB,IAAI,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAA;CACf"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cleans the WhatsApp number format.
|
|
3
|
+
* @param number The WhatsApp number to be cleaned.
|
|
4
|
+
* @param full Whether to return the full number format or not.
|
|
5
|
+
* @returns The cleaned number.
|
|
6
|
+
*/
|
|
7
|
+
declare const baileyCleanNumber: (number: string, full?: boolean) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Generates an image from a base64 string.
|
|
10
|
+
* @param base64 The base64 string to generate the image from.
|
|
11
|
+
* @param name The name of the file to write the image to.
|
|
12
|
+
*/
|
|
13
|
+
declare const baileyGenerateImage: (base64: string, name?: string) => Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Validates if the given number is a valid WhatsApp number and not a group ID.
|
|
16
|
+
* @param rawNumber The number to validate.
|
|
17
|
+
* @returns True if it's a valid number, false otherwise.
|
|
18
|
+
*/
|
|
19
|
+
declare const baileyIsValidNumber: (rawNumber: string) => boolean;
|
|
20
|
+
export { baileyCleanNumber, baileyGenerateImage, baileyIsValidNumber };
|
|
21
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,QAAA,MAAM,iBAAiB,WAAY,MAAM,SAAQ,OAAO,KAAW,MAIlE,CAAA;AAED;;;;GAIG;AACH,QAAA,MAAM,mBAAmB,WAAkB,MAAM,SAAQ,MAAM,KAAc,QAAQ,IAAI,CAaxF,CAAA;AAED;;;;GAIG;AACH,QAAA,MAAM,mBAAmB,cAAe,MAAM,KAAG,OAIhD,CAAA;AAED,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@builderbot/provider-baileys",
|
|
3
|
+
"version": "0.1.3-alpha.22",
|
|
4
|
+
"description": "Now I’m the model of a modern major general / The venerated Virginian veteran whose men are all / Lining up, to put me up on a pedestal / Writin’ letters to relatives / Embellishin’ my elegance and eloquence / But the elephant is in the room / The truth is in ya face when ya hear the British cannons go / BOOM",
|
|
5
|
+
"keywords": [],
|
|
6
|
+
"author": "Leifer Mendez <leifer33@gmail.com>",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"main": "dist/index.cjs",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "rimraf dist && rollup --config",
|
|
13
|
+
"test": "npx uvu -r tsm ./__tests__",
|
|
14
|
+
"test:coverage": "npx c8 npm run test"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"./dist/"
|
|
18
|
+
],
|
|
19
|
+
"directories": {
|
|
20
|
+
"src": "src",
|
|
21
|
+
"test": "__tests__"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/codigoencasa/bot-whatsapp.git"
|
|
26
|
+
},
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/codigoencasa/bot-whatsapp/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/codigoencasa/bot-whatsapp#readme",
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@builderbot/bot": "^0.1.3-alpha.22",
|
|
33
|
+
"@hapi/boom": "^10.0.1",
|
|
34
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
35
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
36
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
37
|
+
"@types/mime-types": "^2.1.4",
|
|
38
|
+
"@types/node": "^20.11.0",
|
|
39
|
+
"@types/qr-image": "^3.2.9",
|
|
40
|
+
"@types/sinon": "^17.0.3",
|
|
41
|
+
"body-parser": "^1.20.2",
|
|
42
|
+
"mime-types": "^2.1.35",
|
|
43
|
+
"pino": "^7.11.0",
|
|
44
|
+
"polka": "^0.5.2",
|
|
45
|
+
"qr-image": "^3.2.0",
|
|
46
|
+
"rimraf": "^5.0.5",
|
|
47
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
48
|
+
"sinon": "^17.0.1",
|
|
49
|
+
"wa-sticker-formatter": "^4.4.4"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@ffmpeg-installer/ffmpeg": "^1.1.0",
|
|
53
|
+
"@types/polka": "^0.5.7",
|
|
54
|
+
"@whiskeysockets/baileys": "^6.6.0",
|
|
55
|
+
"fluent-ffmpeg": "^2.1.2"
|
|
56
|
+
},
|
|
57
|
+
"gitHead": "e52a9fe13d30d65b650a54b6e116953c949b1158"
|
|
58
|
+
}
|