@deathnaitsa/wa-api 1.0.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/LICENSE +21 -0
- package/dist/Defaults/index.d.ts +18 -0
- package/dist/Defaults/index.d.ts.map +1 -0
- package/dist/Defaults/index.js +28 -0
- package/dist/Error/index.d.ts +5 -0
- package/dist/Error/index.d.ts.map +1 -0
- package/dist/Error/index.js +14 -0
- package/dist/Messaging/index.d.ts +43 -0
- package/dist/Messaging/index.d.ts.map +1 -0
- package/dist/Messaging/index.js +410 -0
- package/dist/Socket/Socket.d.ts +21 -0
- package/dist/Socket/Socket.d.ts.map +1 -0
- package/dist/Socket/Socket.interface.d.ts +4 -0
- package/dist/Socket/Socket.interface.d.ts.map +1 -0
- package/dist/Socket/Socket.interface.js +2 -0
- package/dist/Socket/Socket.js +31 -0
- package/dist/Socket/index.d.ts +22 -0
- package/dist/Socket/index.d.ts.map +1 -0
- package/dist/Socket/index.js +375 -0
- package/dist/Types/WhatsappOptions.d.ts +3 -0
- package/dist/Types/WhatsappOptions.d.ts.map +1 -0
- package/dist/Types/WhatsappOptions.js +2 -0
- package/dist/Types/index.d.ts +51 -0
- package/dist/Types/index.d.ts.map +1 -0
- package/dist/Types/index.js +2 -0
- package/dist/Utils/create-delay.d.ts +2 -0
- package/dist/Utils/create-delay.d.ts.map +1 -0
- package/dist/Utils/create-delay.js +18 -0
- package/dist/Utils/error.d.ts +4 -0
- package/dist/Utils/error.d.ts.map +1 -0
- package/dist/Utils/error.js +8 -0
- package/dist/Utils/index.d.ts +5 -0
- package/dist/Utils/index.d.ts.map +1 -0
- package/dist/Utils/index.js +21 -0
- package/dist/Utils/is-exist.d.ts +3 -0
- package/dist/Utils/is-exist.d.ts.map +1 -0
- package/dist/Utils/is-exist.js +38 -0
- package/dist/Utils/message-status.d.ts +4 -0
- package/dist/Utils/message-status.d.ts.map +1 -0
- package/dist/Utils/message-status.js +18 -0
- package/dist/Utils/phone-to-jid.d.ts +5 -0
- package/dist/Utils/phone-to-jid.d.ts.map +1 -0
- package/dist/Utils/phone-to-jid.js +30 -0
- package/dist/Utils/save-media.d.ts +5 -0
- package/dist/Utils/save-media.d.ts.map +1 -0
- package/dist/Utils/save-media.js +47 -0
- package/dist/Utils/set-credentials-dir.d.ts +2 -0
- package/dist/Utils/set-credentials-dir.d.ts.map +1 -0
- package/dist/Utils/set-credentials-dir.js +8 -0
- package/dist/Utils/set-credentials.d.ts +2 -0
- package/dist/Utils/set-credentials.d.ts.map +1 -0
- package/dist/Utils/set-credentials.js +8 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/whatsapp/index.d.ts +15 -0
- package/dist/whatsapp/index.d.ts.map +1 -0
- package/dist/whatsapp/index.js +206 -0
- package/package.json +37 -0
- package/readme.md +108 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Muhammad Imam Choirudin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare abstract class CREDENTIALS {
|
|
2
|
+
static DIR_NAME: string;
|
|
3
|
+
static SUFFIX: string;
|
|
4
|
+
}
|
|
5
|
+
export declare enum CALLBACK_KEY {
|
|
6
|
+
ON_MESSAGE_RECEIVED = "on-message-received",
|
|
7
|
+
ON_QR = "on-qr",
|
|
8
|
+
ON_CONNECTED = "on-connected",
|
|
9
|
+
ON_DISCONNECTED = "on-disconnected",
|
|
10
|
+
ON_CONNECTING = "on-connecting",
|
|
11
|
+
ON_MESSAGE_UPDATED = "on-message-updated"
|
|
12
|
+
}
|
|
13
|
+
export declare abstract class Messages {
|
|
14
|
+
static sessionAlreadyExist: (sessionId: string) => string;
|
|
15
|
+
static sessionNotFound: (sessionId: string) => string;
|
|
16
|
+
static paremetersRequired: (props: string[] | string) => string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Defaults/index.ts"],"names":[],"mappings":"AAAA,8BAAsB,WAAW;IAC/B,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAoB;IAC3C,MAAM,CAAC,MAAM,EAAE,MAAM,CAAkB;CACxC;AAED,oBAAY,YAAY;IACtB,mBAAmB,wBAAwB;IAC3C,KAAK,UAAU;IACf,YAAY,iBAAiB;IAC7B,eAAe,oBAAoB;IACnC,aAAa,kBAAkB;IAC/B,kBAAkB,uBAAuB;CAC1C;AAED,8BAAsB,QAAQ;IAC5B,MAAM,CAAC,mBAAmB,cAAe,MAAM,KAAG,MAAM,CACe;IAEvE,MAAM,CAAC,eAAe,cAAe,MAAM,KAAG,MAAM,CACP;IAE7C,MAAM,CAAC,kBAAkB,UAAW,MAAM,EAAE,GAAG,MAAM,YAOpC;CAClB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Messages = exports.CALLBACK_KEY = exports.CREDENTIALS = void 0;
|
|
4
|
+
class CREDENTIALS {
|
|
5
|
+
}
|
|
6
|
+
exports.CREDENTIALS = CREDENTIALS;
|
|
7
|
+
CREDENTIALS.DIR_NAME = "wa_credentials";
|
|
8
|
+
CREDENTIALS.SUFFIX = "_credentials";
|
|
9
|
+
var CALLBACK_KEY;
|
|
10
|
+
(function (CALLBACK_KEY) {
|
|
11
|
+
CALLBACK_KEY["ON_MESSAGE_RECEIVED"] = "on-message-received";
|
|
12
|
+
CALLBACK_KEY["ON_QR"] = "on-qr";
|
|
13
|
+
CALLBACK_KEY["ON_CONNECTED"] = "on-connected";
|
|
14
|
+
CALLBACK_KEY["ON_DISCONNECTED"] = "on-disconnected";
|
|
15
|
+
CALLBACK_KEY["ON_CONNECTING"] = "on-connecting";
|
|
16
|
+
CALLBACK_KEY["ON_MESSAGE_UPDATED"] = "on-message-updated";
|
|
17
|
+
CALLBACK_KEY["ON_PAIRING_CODE"] = "on-pairing-code";
|
|
18
|
+
})(CALLBACK_KEY || (exports.CALLBACK_KEY = CALLBACK_KEY = {}));
|
|
19
|
+
class Messages {
|
|
20
|
+
}
|
|
21
|
+
exports.Messages = Messages;
|
|
22
|
+
Messages.sessionAlreadyExist = (sessionId) => `Session ID :${sessionId} is already exist, Try another Session ID.`;
|
|
23
|
+
Messages.sessionNotFound = (sessionId) => `Session with ID: ${sessionId} Not Exist!`;
|
|
24
|
+
Messages.paremetersRequired = (props) => `Parameter ${typeof props == "string"
|
|
25
|
+
? props
|
|
26
|
+
: props instanceof Array
|
|
27
|
+
? props.join(", ")
|
|
28
|
+
: ""} is required`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Error/index.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM;IAM3B,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,aAAa;CAG3D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WhatsappError = void 0;
|
|
4
|
+
class WhatsappError extends Error {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = "WhatsappError";
|
|
8
|
+
Object.setPrototypeOf(this, WhatsappError.prototype);
|
|
9
|
+
}
|
|
10
|
+
static isWhatsappError(error) {
|
|
11
|
+
return error instanceof WhatsappError || error instanceof Error;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.WhatsappError = WhatsappError;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { proto } from "@whiskeysockets/baileys";
|
|
2
|
+
import { SendMediaTypes, SendMessageTypes, SendReadTypes, SendTypingTypes } from "../Types";
|
|
3
|
+
export declare const sendTextMessage: ({ sessionId, to, text, isGroup, ...props }: SendMessageTypes) => Promise<proto.WebMessageInfo | undefined>;
|
|
4
|
+
export declare const sendImage: ({ sessionId, to, text, isGroup, media, ...props }: SendMediaTypes) => Promise<proto.WebMessageInfo | undefined>;
|
|
5
|
+
export declare const sendVideo: ({ sessionId, to, text, isGroup, media, ...props }: SendMediaTypes) => Promise<proto.WebMessageInfo | undefined>;
|
|
6
|
+
export declare const sendDocument: ({ sessionId, to, text, isGroup, media, filename, ...props }: SendMediaTypes & {
|
|
7
|
+
filename: string;
|
|
8
|
+
}) => Promise<proto.WebMessageInfo | undefined>;
|
|
9
|
+
export declare function sendMessage(
|
|
10
|
+
sessionId: string,
|
|
11
|
+
jid: string,
|
|
12
|
+
content: import("@whiskeysockets/baileys").AnyMessageContent,
|
|
13
|
+
options?: import("@whiskeysockets/baileys").MiscMessageGenerationOptions
|
|
14
|
+
): Promise<import("@whiskeysockets/baileys").proto.WebMessageInfo>;
|
|
15
|
+
|
|
16
|
+
export declare const kickusr: ({ sessionId, to, text }: SendMessageTypes) => Promise<proto.WebMessageInfo | undefined>;
|
|
17
|
+
export declare const del: ({ sessionId, to, id,sender }: SendMessageTypes) => Promise<proto.WebMessageInfo | undefined>;
|
|
18
|
+
|
|
19
|
+
export declare const sendVoiceNote: ({ sessionId, to, isGroup, media, ...props }: Omit<SendMediaTypes, "text">) => Promise<proto.WebMessageInfo | undefined>;
|
|
20
|
+
export declare const sendSticker: ({ sessionId, to, isGroup, media, ...props }: SendMediaTypes) => Promise<proto.WebMessageInfo | undefined>;
|
|
21
|
+
/**
|
|
22
|
+
* Give typing effect to target
|
|
23
|
+
*
|
|
24
|
+
* Looks like human typing
|
|
25
|
+
*
|
|
26
|
+
*
|
|
27
|
+
* @param sessionId - Session ID
|
|
28
|
+
* @param to - Target
|
|
29
|
+
* @param duration - Duration in miliseconds typing effect will appear
|
|
30
|
+
*/
|
|
31
|
+
export declare const sendTyping: ({ sessionId, to, duration, isGroup, }: SendTypingTypes) => Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Give typing effect to target
|
|
34
|
+
*
|
|
35
|
+
* Looks like human typing
|
|
36
|
+
*
|
|
37
|
+
*
|
|
38
|
+
* @param sessionId - Session ID
|
|
39
|
+
* @param to - Target
|
|
40
|
+
* @param duration - Duration in miliseconds typing effect will appear
|
|
41
|
+
*/
|
|
42
|
+
export declare const readMessage: ({ sessionId, key }: SendReadTypes) => Promise<void>;
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Messaging/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGhD,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,eAAe,EAChB,MAAM,UAAU,CAAC;AAOlB,eAAO,MAAM,eAAe,+CAMzB,gBAAgB,KAAG,QAAQ,MAAM,cAAc,GAAG,SAAS,CAsB7D,CAAC;AACF,eAAO,MAAM,SAAS,sDAOnB,cAAc,KAAG,QAAQ,MAAM,cAAc,GAAG,SAAS,CA8B3D,CAAC;AACF,eAAO,MAAM,SAAS,sDAOnB,cAAc,KAAG,QAAQ,MAAM,cAAc,GAAG,SAAS,CA8B3D,CAAC;AACF,eAAO,MAAM,YAAY;cASb,MAAM;MACd,QAAQ,MAAM,cAAc,GAAG,SAAS,CAuC3C,CAAC;AAEF,eAAO,MAAM,aAAa,gDAMvB,KAAK,cAAc,EAAE,MAAM,CAAC,KAAG,QAAQ,MAAM,cAAc,GAAG,SAAS,CAgCzE,CAAC;AAEF,eAAO,MAAM,WAAW,gDAMrB,cAAc,KAAG,QAAQ,MAAM,cAAc,GAAG,SAAS,CA+B3D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,0CAKpB,eAAe,kBAgBjB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,uBAA8B,aAAa,kBAKlE,CAAC"}
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.readMessage = exports.sendTyping =exports.del= exports.sendSticker = exports.sendVoiceNote = exports.sendDocument = exports.sendVideo = exports.sendImage = exports.kickusr = exports.sendTextMessage = void 0;
|
|
27
|
+
const Defaults_1 = require("../Defaults");
|
|
28
|
+
const Socket_1 = require("../Socket");
|
|
29
|
+
const Utils_1 = require("../Utils");
|
|
30
|
+
const create_delay_1 = require("../Utils/create-delay");
|
|
31
|
+
const is_exist_1 = require("../Utils/is-exist");
|
|
32
|
+
const mime_1 = __importDefault(require("mime"));
|
|
33
|
+
const Error_1 = require("../Error");
|
|
34
|
+
const qrcode = require("qrcode")
|
|
35
|
+
const joinGroup = (_a) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
var { sessionId, text = ""} = _a, props = __rest(_a, ["sessionId", "text"]);
|
|
37
|
+
const session = (0, Socket_1.getSession)(sessionId);
|
|
38
|
+
if (!session) {
|
|
39
|
+
throw new Error_1.SessionNotFound(sessionId);
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
session.groupAcceptInvite(text)
|
|
43
|
+
});
|
|
44
|
+
exports.joinGroup = joinGroup;
|
|
45
|
+
const del = (_a) => __awaiter(void 0, void 0, void 0, function* () {
|
|
46
|
+
var { sessionId, to = "",id='',sender=''} = _a, props = __rest(_a, ["sessionId", "to","id","sender"]);
|
|
47
|
+
const session = (0, Socket_1.getSession)(sessionId);
|
|
48
|
+
if (!session) {
|
|
49
|
+
throw new Error_1.SessionNotFound(sessionId);
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
session.sendMessage(to, { delete: { remoteJid: to, id: id, participant: sender } })
|
|
53
|
+
});
|
|
54
|
+
exports.del = del;
|
|
55
|
+
const sendTextMessage = (_a) => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
+
var { sessionId, to, text = "", isGroup = false,Jid } = _a, props = __rest(_a, ["sessionId", "to", "text", "isGroup","Jid"]);
|
|
57
|
+
const session = (0, Socket_1.getSession)(sessionId);
|
|
58
|
+
|
|
59
|
+
if (!session)
|
|
60
|
+
throw new Error_1.WhatsappError(Defaults_1.Messages.sessionNotFound(sessionId));
|
|
61
|
+
const oldPhone = to;
|
|
62
|
+
to = (0, Utils_1.phoneToJid)({ to, isGroup });
|
|
63
|
+
const isRegistered = yield (0, is_exist_1.isExist)({
|
|
64
|
+
sessionId,
|
|
65
|
+
to,
|
|
66
|
+
isGroup,
|
|
67
|
+
});
|
|
68
|
+
if (!isRegistered) {
|
|
69
|
+
throw new Error_1.WhatsappError(`${oldPhone} is not registered on Whatsapp`);
|
|
70
|
+
}
|
|
71
|
+
return yield session.sendMessage(to, { text: text,mentions: Jid
|
|
72
|
+
}, {
|
|
73
|
+
quoted: props.answering,
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
exports.sendTextMessage = sendTextMessage;
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
// Cache sessions to avoid repeated lookups
|
|
81
|
+
const sessionCache = new Map();
|
|
82
|
+
|
|
83
|
+
function getCachedSession(sessionId) {
|
|
84
|
+
let session = sessionCache.get(sessionId);
|
|
85
|
+
if (!session) {
|
|
86
|
+
session = getSession(sessionId);
|
|
87
|
+
if (!session) throw new WhatsappError(Messages.sessionNotFound(sessionId));
|
|
88
|
+
sessionCache.set(sessionId, session);
|
|
89
|
+
}
|
|
90
|
+
return session;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Universal sendMessage wrapper for all Baileys message types in JavaScript.
|
|
95
|
+
*
|
|
96
|
+
* @param {string} sessionId Your multi-session identifier
|
|
97
|
+
* @param {string} jid Destination JID (user or group) or phone number
|
|
98
|
+
* @param {object} content AnyMessageContent payload
|
|
99
|
+
* @param {object} [options] MiscMessageGenerationOptions (quoted, mentions, etc.)
|
|
100
|
+
* @returns {Promise<any>}
|
|
101
|
+
*/
|
|
102
|
+
async function sendMessage(sessionId, jid, content, options) {
|
|
103
|
+
const session = getCachedSession(sessionId);
|
|
104
|
+
|
|
105
|
+
// Convert phone number to JID if needed
|
|
106
|
+
const destJid = jid.includes("@") ? jid : phoneToJid({ to: jid });
|
|
107
|
+
|
|
108
|
+
try {
|
|
109
|
+
return await session.sendMessage(destJid, content, options || {});
|
|
110
|
+
} catch (err) {
|
|
111
|
+
// Wrap Baileys errors into WhatsappError for consistency
|
|
112
|
+
throw new WhatsappError(
|
|
113
|
+
`Failed to send message to ${destJid}: ${err.message}`,
|
|
114
|
+
{ cause: err }
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
exports.sendMessage = sendMessage;
|
|
120
|
+
|
|
121
|
+
const kickusr = (_a) => __awaiter(void 0, void 0, void 0, function* () {
|
|
122
|
+
var { sessionId, to, text = "", isGroup = true } = _a, props = __rest(_a, ["sessionId", "to", "text",'isGroup']);
|
|
123
|
+
const session = (0, Socket_1.getSession)(sessionId);
|
|
124
|
+
|
|
125
|
+
if (!session)
|
|
126
|
+
throw new Error_1.WhatsappError(Defaults_1.Messages.sessionNotFound(sessionId));
|
|
127
|
+
const oldPhone = to;
|
|
128
|
+
to = (0, Utils_1.phoneToJid)({ to, isGroup });
|
|
129
|
+
const isRegistered = yield (0, is_exist_1.isExist)({
|
|
130
|
+
sessionId,
|
|
131
|
+
to,
|
|
132
|
+
isGroup,
|
|
133
|
+
});
|
|
134
|
+
if (!isRegistered) {
|
|
135
|
+
throw new Error_1.WhatsappError(`${oldPhone} is not registered on Whatsapp`);
|
|
136
|
+
}
|
|
137
|
+
return session.groupParticipantsUpdate(to,[`${text}`],"remove")
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
exports.kickusr = kickusr;
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
const sendImage = (_b) => __awaiter(void 0, void 0, void 0, function* () {
|
|
144
|
+
var { sessionId, to, text = "", isGroup = false, media } = _b, props = __rest(_b, ["sessionId", "to", "text", "isGroup", "media"]);
|
|
145
|
+
const session = (0, Socket_1.getSession)(sessionId);
|
|
146
|
+
if (!session)
|
|
147
|
+
throw new Error_1.WhatsappError(Defaults_1.Messages.sessionNotFound(sessionId));
|
|
148
|
+
const oldPhone = to;
|
|
149
|
+
to = (0, Utils_1.phoneToJid)({ to, isGroup });
|
|
150
|
+
const isRegistered = yield (0, is_exist_1.isExist)({
|
|
151
|
+
sessionId,
|
|
152
|
+
to,
|
|
153
|
+
isGroup,
|
|
154
|
+
});
|
|
155
|
+
if (!isRegistered) {
|
|
156
|
+
throw new Error_1.WhatsappError(`${oldPhone} is not registered on Whatsapp`);
|
|
157
|
+
}
|
|
158
|
+
if (!media)
|
|
159
|
+
throw new Error_1.WhatsappError("parameter media must be Buffer or String URL");
|
|
160
|
+
return yield session.sendMessage(to, {
|
|
161
|
+
image: typeof media == "string"
|
|
162
|
+
? {
|
|
163
|
+
url: media,
|
|
164
|
+
}
|
|
165
|
+
: media,
|
|
166
|
+
caption: text,
|
|
167
|
+
}, {
|
|
168
|
+
quoted: props.answering,
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
exports.sendImage = sendImage;
|
|
172
|
+
const sendQr = (_b) => __awaiter(void 0, void 0, void 0, function* () {
|
|
173
|
+
var { sessionId, to, text = "", isGroup = false } = _b, props = __rest(_b, ["sessionId", "to", "text", "isGroup"]);
|
|
174
|
+
const session = (0, Socket_1.getSession)(sessionId);
|
|
175
|
+
if (!session)
|
|
176
|
+
throw new Error_1.WhatsappError(Defaults_1.Messages.sessionNotFound(sessionId));
|
|
177
|
+
const oldPhone = to;
|
|
178
|
+
to = (0, Utils_1.phoneToJid)({ to, isGroup });
|
|
179
|
+
const isRegistered = yield (0, is_exist_1.isExist)({
|
|
180
|
+
sessionId,
|
|
181
|
+
to,
|
|
182
|
+
isGroup,
|
|
183
|
+
});
|
|
184
|
+
if (!isRegistered) {
|
|
185
|
+
throw new Error_1.WhatsappError(`${oldPhone} is not registered on Whatsapp`);
|
|
186
|
+
}
|
|
187
|
+
session.sendMessage(to,{image: { url: qrcode.toDataURL(text.slice(0, 2048), { scale: 8 })},"fileName":'qrcode.png'}, { quoted: props.answering});
|
|
188
|
+
});
|
|
189
|
+
exports.sendQr = sendQr;
|
|
190
|
+
const sendVideo = (_c) => __awaiter(void 0, void 0, void 0, function* () {
|
|
191
|
+
var { sessionId, to, text = "", isGroup = false, media } = _c, props = __rest(_c, ["sessionId", "to", "text", "isGroup", "media"]);
|
|
192
|
+
const session = (0, Socket_1.getSession)(sessionId);
|
|
193
|
+
if (!session)
|
|
194
|
+
throw new Error_1.WhatsappError(Defaults_1.Messages.sessionNotFound(sessionId));
|
|
195
|
+
const oldPhone = to;
|
|
196
|
+
to = (0, Utils_1.phoneToJid)({ to, isGroup });
|
|
197
|
+
const isRegistered = yield (0, is_exist_1.isExist)({
|
|
198
|
+
sessionId,
|
|
199
|
+
to,
|
|
200
|
+
isGroup,
|
|
201
|
+
});
|
|
202
|
+
if (!isRegistered) {
|
|
203
|
+
throw new Error_1.WhatsappError(`${oldPhone} is not registered on Whatsapp`);
|
|
204
|
+
}
|
|
205
|
+
if (!media)
|
|
206
|
+
throw new Error_1.WhatsappError("parameter media must be Buffer or String URL");
|
|
207
|
+
return yield session.sendMessage(to, {
|
|
208
|
+
video: typeof media == "string"
|
|
209
|
+
? {
|
|
210
|
+
url: media,
|
|
211
|
+
}
|
|
212
|
+
: media,
|
|
213
|
+
caption: text,
|
|
214
|
+
}, {
|
|
215
|
+
quoted: props.answering,
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
exports.sendVideo = sendVideo;
|
|
219
|
+
const sendDocument = (_d) => __awaiter(void 0, void 0, void 0, function* () {
|
|
220
|
+
var { sessionId, to, text = "", isGroup = false, media, filename } = _d, props = __rest(_d, ["sessionId", "to", "text", "isGroup", "media", "filename"]);
|
|
221
|
+
const session = (0, Socket_1.getSession)(sessionId);
|
|
222
|
+
if (!session)
|
|
223
|
+
throw new Error_1.WhatsappError(Defaults_1.Messages.sessionNotFound(sessionId));
|
|
224
|
+
const oldPhone = to;
|
|
225
|
+
to = (0, Utils_1.phoneToJid)({ to, isGroup });
|
|
226
|
+
const isRegistered = yield (0, is_exist_1.isExist)({
|
|
227
|
+
sessionId,
|
|
228
|
+
to,
|
|
229
|
+
isGroup,
|
|
230
|
+
});
|
|
231
|
+
if (!isRegistered) {
|
|
232
|
+
throw new Error_1.WhatsappError(`${oldPhone} is not registered on Whatsapp`);
|
|
233
|
+
}
|
|
234
|
+
if (!media) {
|
|
235
|
+
throw new Error_1.WhatsappError(`Invalid Media`);
|
|
236
|
+
}
|
|
237
|
+
const mimetype = mime_1.default.getType(filename);
|
|
238
|
+
if (!mimetype) {
|
|
239
|
+
throw new Error_1.WhatsappError(`Filename must include valid extension`);
|
|
240
|
+
}
|
|
241
|
+
return yield session.sendMessage(to, {
|
|
242
|
+
fileName: filename,
|
|
243
|
+
document: typeof media == "string"
|
|
244
|
+
? {
|
|
245
|
+
url: media,
|
|
246
|
+
}
|
|
247
|
+
: media,
|
|
248
|
+
mimetype: mimetype,
|
|
249
|
+
caption: text,
|
|
250
|
+
}, {
|
|
251
|
+
quoted: props.answering,
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
exports.sendDocument = sendDocument;
|
|
255
|
+
const gruppeninfo = (_e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
256
|
+
var { sessionId, to, isGroup = false } = _e, props = __rest(_e, ["sessionId", "to","isGroup"]);
|
|
257
|
+
const session = (0, Socket_1.getSession)(sessionId);
|
|
258
|
+
if (!session)
|
|
259
|
+
throw new Error_1.WhatsappError(Defaults_1.Messages.sessionNotFound(sessionId));
|
|
260
|
+
const oldPhone = to;
|
|
261
|
+
to = (0, Utils_1.phoneToJid)({ to, isGroup });
|
|
262
|
+
const isRegistered = yield (0, is_exist_1.isExist)({
|
|
263
|
+
sessionId,
|
|
264
|
+
to,
|
|
265
|
+
isGroup,
|
|
266
|
+
});
|
|
267
|
+
if (!isRegistered) {
|
|
268
|
+
throw new Error_1.WhatsappError(`${oldPhone} is not registered on Whatsapp`);
|
|
269
|
+
}
|
|
270
|
+
return yield session.groupMetadata(to);
|
|
271
|
+
})
|
|
272
|
+
exports.gruppeninfo = gruppeninfo;
|
|
273
|
+
const getAllGroupInfo = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
274
|
+
const sessions = Socket_1.getAllSessions();
|
|
275
|
+
const groupMetadatas = [];
|
|
276
|
+
for (const session of sessions) {
|
|
277
|
+
const groups = yield session.getAllGroups();
|
|
278
|
+
for (const group of groups) {
|
|
279
|
+
const metadata = yield session.groupMetadata(group);
|
|
280
|
+
groupMetadatas.push(metadata);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return groupMetadatas;
|
|
284
|
+
});
|
|
285
|
+
exports.getAllGroupInfo = getAllGroupInfo;
|
|
286
|
+
|
|
287
|
+
const sendMention = (_e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
288
|
+
var { sessionId, to,text = "",mention = "", isGroup = false } = _e, props = __rest(_e, ["sessionId", "to","text", "mention","isGroup"]);
|
|
289
|
+
const session = (0, Socket_1.getSession)(sessionId);
|
|
290
|
+
if (!session)
|
|
291
|
+
throw new Error_1.WhatsappError(Defaults_1.Messages.sessionNotFound(sessionId));
|
|
292
|
+
const oldPhone = to;
|
|
293
|
+
to = (0, Utils_1.phoneToJid)({ to, isGroup });
|
|
294
|
+
const isRegistered = yield (0, is_exist_1.isExist)({
|
|
295
|
+
sessionId,
|
|
296
|
+
to,
|
|
297
|
+
isGroup,
|
|
298
|
+
});
|
|
299
|
+
if (!isRegistered) {
|
|
300
|
+
throw new Error_1.WhatsappError(`${oldPhone} is not registered on Whatsapp`);
|
|
301
|
+
}
|
|
302
|
+
return yield session.sendMessage(to, {
|
|
303
|
+
text: text,
|
|
304
|
+
mentions: mention,
|
|
305
|
+
}, {
|
|
306
|
+
quoted: props.answering,
|
|
307
|
+
});
|
|
308
|
+
})
|
|
309
|
+
exports.sendMention = sendMention;
|
|
310
|
+
|
|
311
|
+
const sendVoiceNote = (_e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
312
|
+
var { sessionId, to, isGroup = false, media } = _e, props = __rest(_e, ["sessionId", "to", "isGroup", "media"]);
|
|
313
|
+
const session = (0, Socket_1.getSession)(sessionId);
|
|
314
|
+
if (!session)
|
|
315
|
+
throw new Error_1.WhatsappError(Defaults_1.Messages.sessionNotFound(sessionId));
|
|
316
|
+
const oldPhone = to;
|
|
317
|
+
to = (0, Utils_1.phoneToJid)({ to, isGroup });
|
|
318
|
+
const isRegistered = yield (0, is_exist_1.isExist)({
|
|
319
|
+
sessionId,
|
|
320
|
+
to,
|
|
321
|
+
isGroup,
|
|
322
|
+
});
|
|
323
|
+
if (!isRegistered) {
|
|
324
|
+
throw new Error_1.WhatsappError(`${oldPhone} is not registered on Whatsapp`);
|
|
325
|
+
}
|
|
326
|
+
if (!media) {
|
|
327
|
+
throw new Error_1.WhatsappError(`Invalid Media`);
|
|
328
|
+
}
|
|
329
|
+
return yield session.sendMessage(to, {
|
|
330
|
+
audio : {url: media},
|
|
331
|
+
fileName: "test" + '.mp3', mimetype: 'audio/mpeg' }, {
|
|
332
|
+
quoted: props.answering,
|
|
333
|
+
});
|
|
334
|
+
});
|
|
335
|
+
exports.sendVoiceNote = sendVoiceNote;
|
|
336
|
+
const sendSticker = (_f) => __awaiter(void 0, void 0, void 0, function* () {
|
|
337
|
+
var { sessionId, to, isGroup, media } = _f, props = __rest(_f, ["sessionId", "to", "isGroup", "media"]);
|
|
338
|
+
const session = (0, Socket_1.getSession)(sessionId);
|
|
339
|
+
if (!session)
|
|
340
|
+
throw new Error_1.WhatsappError(Defaults_1.Messages.sessionNotFound(sessionId));
|
|
341
|
+
const oldPhone = to;
|
|
342
|
+
to = (0, Utils_1.phoneToJid)({ to, isGroup });
|
|
343
|
+
const isRegistered = yield (0, is_exist_1.isExist)({
|
|
344
|
+
sessionId,
|
|
345
|
+
to,
|
|
346
|
+
isGroup,
|
|
347
|
+
});
|
|
348
|
+
if (!isRegistered) {
|
|
349
|
+
throw new Error_1.WhatsappError(`${oldPhone} is not registered on Whatsapp`);
|
|
350
|
+
}
|
|
351
|
+
if (!media) {
|
|
352
|
+
throw new Error_1.WhatsappError(`Invalid Media`);
|
|
353
|
+
}
|
|
354
|
+
return yield session.sendMessage(to, {
|
|
355
|
+
sticker: typeof media == "string"
|
|
356
|
+
? {
|
|
357
|
+
url: media,
|
|
358
|
+
}
|
|
359
|
+
: media,
|
|
360
|
+
}, {
|
|
361
|
+
quoted: props.answering,
|
|
362
|
+
});
|
|
363
|
+
});
|
|
364
|
+
exports.sendSticker = sendSticker;
|
|
365
|
+
/**
|
|
366
|
+
* Give typing effect to target
|
|
367
|
+
*
|
|
368
|
+
* Looks like human typing
|
|
369
|
+
*
|
|
370
|
+
*
|
|
371
|
+
* @param sessionId - Session ID
|
|
372
|
+
* @param to - Target
|
|
373
|
+
* @param duration - Duration in miliseconds typing effect will appear
|
|
374
|
+
*/
|
|
375
|
+
const sendTyping = ({ sessionId, to, duration = 1000, isGroup = false, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
376
|
+
const oldPhone = to;
|
|
377
|
+
to = (0, Utils_1.phoneToJid)({ to, isGroup });
|
|
378
|
+
const session = (0, Socket_1.getSession)(sessionId);
|
|
379
|
+
if (!session)
|
|
380
|
+
throw new Error_1.WhatsappError(Defaults_1.Messages.sessionNotFound(sessionId));
|
|
381
|
+
const isRegistered = yield (0, is_exist_1.isExist)({
|
|
382
|
+
sessionId,
|
|
383
|
+
to,
|
|
384
|
+
isGroup,
|
|
385
|
+
});
|
|
386
|
+
if (!isRegistered) {
|
|
387
|
+
throw new Error_1.WhatsappError(`${oldPhone} is not registered on Whatsapp`);
|
|
388
|
+
}
|
|
389
|
+
yield session.sendPresenceUpdate("composing", to);
|
|
390
|
+
yield (0, create_delay_1.createDelay)(duration);
|
|
391
|
+
yield session.sendPresenceUpdate("available", to);
|
|
392
|
+
});
|
|
393
|
+
exports.sendTyping = sendTyping;
|
|
394
|
+
/**
|
|
395
|
+
* Give typing effect to target
|
|
396
|
+
*
|
|
397
|
+
* Looks like human typing
|
|
398
|
+
*
|
|
399
|
+
*
|
|
400
|
+
* @param sessionId - Session ID
|
|
401
|
+
* @param to - Target
|
|
402
|
+
* @param duration - Duration in miliseconds typing effect will appear
|
|
403
|
+
*/
|
|
404
|
+
const readMessage = ({ sessionId, key }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
405
|
+
const session = (0, Socket_1.getSession)(sessionId);
|
|
406
|
+
if (!session)
|
|
407
|
+
throw new Error_1.WhatsappError(Defaults_1.Messages.sessionNotFound(sessionId));
|
|
408
|
+
yield session.readMessages([key]);
|
|
409
|
+
});
|
|
410
|
+
exports.readMessage = readMessage;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { WASocket } from "@whiskeysockets/baileys";
|
|
2
|
+
import { MessageReceived, MessageUpdated } from "../Types";
|
|
3
|
+
export declare class Socket {
|
|
4
|
+
constructor({ id, phoneNumber, socket, }: {
|
|
5
|
+
id: string;
|
|
6
|
+
phoneNumber: string;
|
|
7
|
+
socket?: WASocket;
|
|
8
|
+
});
|
|
9
|
+
id: string;
|
|
10
|
+
socket: WASocket | undefined;
|
|
11
|
+
phoneNumber: string;
|
|
12
|
+
logout(): Promise<void>;
|
|
13
|
+
onQr?: (qr: string) => void;
|
|
14
|
+
onPairing?: (code: string) => void;
|
|
15
|
+
onConnecting?: () => void;
|
|
16
|
+
onConnected?: () => void;
|
|
17
|
+
onDisconnected?: () => void;
|
|
18
|
+
onMessageUpdated?: (data: MessageUpdated) => void;
|
|
19
|
+
onMessageReceived?: (data: MessageReceived) => void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=Socket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Socket.d.ts","sourceRoot":"","sources":["../../src/Socket/Socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE3D,qBAAa,MAAM;gBACL,EACV,EAAE,EACF,WAAW,EACX,MAAM,GACP,EAAE;QACD,EAAE,EAAE,MAAM,CAAC;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,QAAQ,CAAC;KACnB;IAMD,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IAEd,MAAM;IAOZ,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAClD,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;CACrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Socket.interface.d.ts","sourceRoot":"","sources":["../../src/Socket/Socket.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;CACZ"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Socket = void 0;
|
|
13
|
+
class Socket {
|
|
14
|
+
constructor({ id, phoneNumber, socket, }) {
|
|
15
|
+
this.id = id;
|
|
16
|
+
this.phoneNumber = phoneNumber;
|
|
17
|
+
this.socket = socket;
|
|
18
|
+
}
|
|
19
|
+
logout() {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
try {
|
|
23
|
+
yield ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.logout());
|
|
24
|
+
}
|
|
25
|
+
catch (error) { }
|
|
26
|
+
(_b = this.socket) === null || _b === void 0 ? void 0 : _b.end(undefined);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.Socket = Socket;
|
|
31
|
+
// const socket = new Socket({ id: "1" });
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { WASocket } from "@whiskeysockets/baileys";
|
|
2
|
+
import type { MessageReceived, MessageUpdated, StartSessionParams } from "../Types";
|
|
3
|
+
export declare const startSession: (sessionId?: string, options?: StartSessionParams) => Promise<WASocket>;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use startSession method instead
|
|
6
|
+
*/
|
|
7
|
+
export declare const startWhatsapp: (sessionId?: string, options?: StartSessionParams) => Promise<WASocket>;
|
|
8
|
+
export declare const startSessionWithPairingCode: (sessionId?: string, options?: {phoneNumber}) => Promise<WASocket>;
|
|
9
|
+
export declare const deleteSession: (sessionId: string) => Promise<void>;
|
|
10
|
+
export declare const getAllSession: () => string[];
|
|
11
|
+
export declare const getSession: (key: string) => WASocket | undefined;
|
|
12
|
+
export declare const loadSessionsFromStorage: () => void;
|
|
13
|
+
export declare const onMessageReceived: (listener: (msg: MessageReceived) => any) => void;
|
|
14
|
+
export declare const onQRUpdated: (listener: ({ sessionId, qr }: {
|
|
15
|
+
sessionId: string;
|
|
16
|
+
qr: string;
|
|
17
|
+
}) => any) => void;
|
|
18
|
+
export declare const onConnected: (listener: (sessionId: string) => any) => void;
|
|
19
|
+
export declare const onDisconnected: (listener: (sessionId: string) => any) => void;
|
|
20
|
+
export declare const onConnecting: (listener: (sessionId: string) => any) => void;
|
|
21
|
+
export declare const onMessageUpdate: (listener: (data: MessageUpdated) => any) => void;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Socket/index.ts"],"names":[],"mappings":"AAAA,OAAqB,EAKnB,QAAQ,EAET,MAAM,yBAAyB,CAAC;AAKjC,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAgBlB,eAAO,MAAM,YAAY,iCAEd,kBAAkB,KAC1B,QAAQ,QAAQ,CAwFlB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,iCA9Ff,kBAAkB,KAC1B,QAAQ,QAAQ,CA6FsB,CAAC;AAE1C,eAAO,MAAM,aAAa,cAAqB,MAAM,kBAcpD,CAAC;AACF,eAAO,MAAM,aAAa,QAAO,MAAM,EAAiC,CAAC;AAEzE,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,QAAQ,GAAG,SACrB,CAAC;AAiChC,eAAO,MAAM,uBAAuB,YAcnC,CAAC;AAEF,eAAO,MAAM,iBAAiB,mBAAoB,eAAe,KAAK,GAAG,SAExE,CAAC;AACF,eAAO,MAAM,WAAW;eACqB,MAAM;QAAM,MAAM;MAAO,GAAG,SAGxE,CAAC;AACF,eAAO,MAAM,WAAW,yBAA0B,MAAM,KAAK,GAAG,SAE/D,CAAC;AACF,eAAO,MAAM,cAAc,yBAA0B,MAAM,KAAK,GAAG,SAElE,CAAC;AACF,eAAO,MAAM,YAAY,yBAA0B,MAAM,KAAK,GAAG,SAEhE,CAAC;AAEF,eAAO,MAAM,eAAe,oBAAqB,cAAc,KAAK,GAAG,SAEtE,CAAC"}
|