@vanzxy/baileys 2.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/NOTICE.md +111 -0
- package/README.md +830 -0
- package/WAProto/index.d.ts +9 -0
- package/WAProto/index.js +142036 -0
- package/engine-requirements.js +13 -0
- package/lib/Defaults/index.d.ts +152 -0
- package/lib/Defaults/index.js +179 -0
- package/lib/Framework/Bot.js +209 -0
- package/lib/Framework/Context.js +90 -0
- package/lib/Framework/MediaManager.js +152 -0
- package/lib/Framework/SessionManager.js +34 -0
- package/lib/Framework/StatsManager.js +120 -0
- package/lib/Framework/Store/SQLiteStore.js +74 -0
- package/lib/Framework/index.js +11 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
- package/lib/Signal/Group/ciphertext-message.js +12 -0
- package/lib/Signal/Group/group-session-builder.d.ts +7 -0
- package/lib/Signal/Group/group-session-builder.js +30 -0
- package/lib/Signal/Group/group_cipher.d.ts +10 -0
- package/lib/Signal/Group/group_cipher.js +82 -0
- package/lib/Signal/Group/index.d.ts +11 -0
- package/lib/Signal/Group/index.js +12 -0
- package/lib/Signal/Group/keyhelper.d.ts +6 -0
- package/lib/Signal/Group/keyhelper.js +18 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +13 -0
- package/lib/Signal/Group/sender-chain-key.js +26 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
- package/lib/Signal/Group/sender-key-message.d.ts +18 -0
- package/lib/Signal/Group/sender-key-message.js +66 -0
- package/lib/Signal/Group/sender-key-name.d.ts +11 -0
- package/lib/Signal/Group/sender-key-name.js +48 -0
- package/lib/Signal/Group/sender-key-record.d.ts +12 -0
- package/lib/Signal/Group/sender-key-record.js +41 -0
- package/lib/Signal/Group/sender-key-state.d.ts +16 -0
- package/lib/Signal/Group/sender-key-state.js +84 -0
- package/lib/Signal/Group/sender-message-key.d.ts +11 -0
- package/lib/Signal/Group/sender-message-key.js +26 -0
- package/lib/Signal/libsignal.d.ts +54 -0
- package/lib/Signal/libsignal.js +431 -0
- package/lib/Signal/lid-mapping.d.ts +20 -0
- package/lib/Signal/lid-mapping.js +277 -0
- package/lib/Socket/Client/index.d.ts +2 -0
- package/lib/Socket/Client/index.js +3 -0
- package/lib/Socket/Client/types.d.ts +5 -0
- package/lib/Socket/Client/types.js +11 -0
- package/lib/Socket/Client/websocket.d.ts +12 -0
- package/lib/Socket/Client/websocket.js +54 -0
- package/lib/Socket/business.d.ts +395 -0
- package/lib/Socket/business.js +380 -0
- package/lib/Socket/chats.d.ts +136 -0
- package/lib/Socket/chats.js +1328 -0
- package/lib/Socket/communities.d.ts +561 -0
- package/lib/Socket/communities.js +434 -0
- package/lib/Socket/dugong.d.ts +117 -0
- package/lib/Socket/dugong.js +799 -0
- package/lib/Socket/groups.d.ts +285 -0
- package/lib/Socket/groups.js +355 -0
- package/lib/Socket/index.d.ts +531 -0
- package/lib/Socket/index.js +34 -0
- package/lib/Socket/messages-recv.d.ts +333 -0
- package/lib/Socket/messages-recv.js +1782 -0
- package/lib/Socket/messages-send.d.ts +329 -0
- package/lib/Socket/messages-send.js +1383 -0
- package/lib/Socket/mex.d.ts +1 -0
- package/lib/Socket/mex.js +42 -0
- package/lib/Socket/newsletter.d.ts +281 -0
- package/lib/Socket/newsletter.js +321 -0
- package/lib/Socket/socket.d.ts +60 -0
- package/lib/Socket/socket.js +1001 -0
- package/lib/Socket/username.js +153 -0
- package/lib/Store/index.d.ts +3 -0
- package/lib/Store/index.js +4 -0
- package/lib/Store/make-in-memory-store.d.ts +62 -0
- package/lib/Store/make-in-memory-store.js +429 -0
- package/lib/Store/make-ordered-dictionary.d.ts +12 -0
- package/lib/Store/make-ordered-dictionary.js +79 -0
- package/lib/Store/object-repository.d.ts +10 -0
- package/lib/Store/object-repository.js +24 -0
- package/lib/Types/Auth.d.ts +117 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Bussines.d.ts +25 -0
- package/lib/Types/Bussines.js +2 -0
- package/lib/Types/Call.d.ts +15 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Chat.d.ts +124 -0
- package/lib/Types/Chat.js +8 -0
- package/lib/Types/Contact.d.ts +26 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Events.d.ts +256 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/GroupMetadata.d.ts +71 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/Label.d.ts +2 -0
- package/lib/Types/Label.js +25 -0
- package/lib/Types/LabelAssociation.d.ts +2 -0
- package/lib/Types/LabelAssociation.js +7 -0
- package/lib/Types/Message.d.ts +11 -0
- package/lib/Types/Message.js +18 -0
- package/lib/Types/Mex.d.ts +2 -0
- package/lib/Types/Mex.js +39 -0
- package/lib/Types/Product.d.ts +79 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/RichType.d.ts +2 -0
- package/lib/Types/RichType.js +23 -0
- package/lib/Types/Signal.d.ts +87 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Socket.d.ts +136 -0
- package/lib/Types/Socket.js +2 -0
- package/lib/Types/State.d.ts +5 -0
- package/lib/Types/State.js +56 -0
- package/lib/Types/USync.d.ts +26 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/index.d.ts +66 -0
- package/lib/Types/index.js +26 -0
- package/lib/Utils/A2UI.js +277 -0
- package/lib/Utils/MessageBuilder.js +4405 -0
- package/lib/Utils/MessageBuilder_d.ts +411 -0
- package/lib/Utils/PersistentStore.js +592 -0
- package/lib/Utils/PersistentStore_d.ts +60 -0
- package/lib/Utils/anti-delete.d.ts +74 -0
- package/lib/Utils/anti-delete.js +222 -0
- package/lib/Utils/auth-utils.d.ts +57 -0
- package/lib/Utils/auth-utils.js +307 -0
- package/lib/Utils/auto-reply.d.ts +47 -0
- package/lib/Utils/auto-reply.js +158 -0
- package/lib/Utils/baileys-event-stream.d.ts +8 -0
- package/lib/Utils/baileys-event-stream.js +62 -0
- package/lib/Utils/browser-utils.d.ts +8 -0
- package/lib/Utils/browser-utils.js +28 -0
- package/lib/Utils/business.d.ts +49 -0
- package/lib/Utils/business.js +240 -0
- package/lib/Utils/button-helper-utils.js +314 -0
- package/lib/Utils/button-sender.js +824 -0
- package/lib/Utils/chat-control.d.ts +159 -0
- package/lib/Utils/chat-control.js +232 -0
- package/lib/Utils/chat-history-helpers.d.ts +21 -0
- package/lib/Utils/chat-history-helpers.js +71 -0
- package/lib/Utils/chat-utils.d.ts +407 -0
- package/lib/Utils/chat-utils.js +886 -0
- package/lib/Utils/companion-reg-client-utils.d.ts +4 -0
- package/lib/Utils/companion-reg-client-utils.js +40 -0
- package/lib/Utils/crypto.d.ts +41 -0
- package/lib/Utils/crypto.js +148 -0
- package/lib/Utils/decode-wa-message.d.ts +83 -0
- package/lib/Utils/decode-wa-message.js +317 -0
- package/lib/Utils/event-buffer.d.ts +12 -0
- package/lib/Utils/event-buffer.js +636 -0
- package/lib/Utils/generics.d.ts +69 -0
- package/lib/Utils/generics.js +439 -0
- package/lib/Utils/history.d.ts +90 -0
- package/lib/Utils/history.js +147 -0
- package/lib/Utils/identity-change-handler.d.ts +13 -0
- package/lib/Utils/identity-change-handler.js +50 -0
- package/lib/Utils/index.d.ts +39 -0
- package/lib/Utils/index.js +46 -0
- package/lib/Utils/link-preview.d.ts +12 -0
- package/lib/Utils/link-preview.js +85 -0
- package/lib/Utils/logger.d.ts +2 -0
- package/lib/Utils/logger.js +3 -0
- package/lib/Utils/lt-hash.d.ts +12 -0
- package/lib/Utils/lt-hash.js +27 -0
- package/lib/Utils/make-mutex.d.ts +6 -0
- package/lib/Utils/make-mutex.js +33 -0
- package/lib/Utils/media-messages.d.ts +18 -0
- package/lib/Utils/media-messages.js +71 -0
- package/lib/Utils/media-set.d.ts +13 -0
- package/lib/Utils/media-set.js +172 -0
- package/lib/Utils/message-kind.js +139 -0
- package/lib/Utils/message-retry-manager.d.ts +79 -0
- package/lib/Utils/message-retry-manager.js +265 -0
- package/lib/Utils/message-search.d.ts +44 -0
- package/lib/Utils/message-search.js +189 -0
- package/lib/Utils/messages-media.d.ts +135 -0
- package/lib/Utils/messages-media.js +869 -0
- package/lib/Utils/messages.d.ts +44 -0
- package/lib/Utils/messages.js +2155 -0
- package/lib/Utils/noise-handler.d.ts +20 -0
- package/lib/Utils/noise-handler.js +201 -0
- package/lib/Utils/offline-node-processor.d.ts +9 -0
- package/lib/Utils/offline-node-processor.js +40 -0
- package/lib/Utils/past-participants.d.ts +14 -0
- package/lib/Utils/past-participants.js +40 -0
- package/lib/Utils/pre-key-manager.d.ts +25 -0
- package/lib/Utils/pre-key-manager.js +106 -0
- package/lib/Utils/process-message.d.ts +82 -0
- package/lib/Utils/process-message.js +809 -0
- package/lib/Utils/reporting-utils.d.ts +12 -0
- package/lib/Utils/reporting-utils.js +258 -0
- package/lib/Utils/rich-message-utils.d.ts +48 -0
- package/lib/Utils/rich-message-utils.js +445 -0
- package/lib/Utils/scheduling.d.ts +42 -0
- package/lib/Utils/scheduling.js +140 -0
- package/lib/Utils/signal.d.ts +82 -0
- package/lib/Utils/signal.js +201 -0
- package/lib/Utils/stanza-ack.d.ts +16 -0
- package/lib/Utils/stanza-ack.js +38 -0
- package/lib/Utils/status.d.ts +50 -0
- package/lib/Utils/status.js +108 -0
- package/lib/Utils/stickerpack.d.ts +51 -0
- package/lib/Utils/stickerpack.js +275 -0
- package/lib/Utils/sync-action-utils.d.ts +2 -0
- package/lib/Utils/sync-action-utils.js +49 -0
- package/lib/Utils/tc-token-utils.d.ts +29 -0
- package/lib/Utils/tc-token-utils.js +163 -0
- package/lib/Utils/templates.d.ts +76 -0
- package/lib/Utils/templates.js +151 -0
- package/lib/Utils/use-cache-manager-auth-state.d.ts +13 -0
- package/lib/Utils/use-cache-manager-auth-state.js +82 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +10 -0
- package/lib/Utils/use-multi-file-auth-state.js +167 -0
- package/lib/Utils/use-single-file-auth-state.d.ts +10 -0
- package/lib/Utils/use-single-file-auth-state.js +114 -0
- package/lib/Utils/use-sqlite-auth-state.d.ts +11 -0
- package/lib/Utils/use-sqlite-auth-state.js +170 -0
- package/lib/Utils/validate-connection.d.ts +42 -0
- package/lib/Utils/validate-connection.js +199 -0
- package/lib/Utils/vcard.d.ts +58 -0
- package/lib/Utils/vcard.js +105 -0
- package/lib/VoIP/audio-feeder.d.ts +15 -0
- package/lib/VoIP/audio-feeder.js +132 -0
- package/lib/VoIP/index.js +277 -0
- package/lib/VoIP/relay-transport.d.ts +43 -0
- package/lib/VoIP/relay-transport.js +559 -0
- package/lib/VoIP/signaling.js +624 -0
- package/lib/VoIP/types.d.ts +69 -0
- package/lib/VoIP/types.js +17 -0
- package/lib/VoIP/wasm-engine.d.ts +103 -0
- package/lib/VoIP/wasm-engine.js +1214 -0
- package/lib/VoIP/worker-bootstrap.js +1042 -0
- package/lib/WABinary/constants.d.ts +61 -0
- package/lib/WABinary/constants.js +1467 -0
- package/lib/WABinary/decode.d.ts +9 -0
- package/lib/WABinary/decode.js +262 -0
- package/lib/WABinary/encode.d.ts +2 -0
- package/lib/WABinary/encode.js +220 -0
- package/lib/WABinary/generic-utils.d.ts +74 -0
- package/lib/WABinary/generic-utils.js +277 -0
- package/lib/WABinary/index.d.ts +5 -0
- package/lib/WABinary/index.js +6 -0
- package/lib/WABinary/jid-utils.d.ts +28 -0
- package/lib/WABinary/jid-utils.js +96 -0
- package/lib/WABinary/types.d.ts +19 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WAM/BinaryInfo.d.ts +7 -0
- package/lib/WAM/BinaryInfo.js +10 -0
- package/lib/WAM/constants.d.ts +34926 -0
- package/lib/WAM/constants.js +22853 -0
- package/lib/WAM/encode.d.ts +1 -0
- package/lib/WAM/encode.js +150 -0
- package/lib/WAM/index.d.ts +3 -0
- package/lib/WAM/index.js +4 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +36 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +52 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +29 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +63 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +9 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +38 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +14 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
- package/lib/WAUSync/Protocols/index.d.ts +7 -0
- package/lib/WAUSync/Protocols/index.js +8 -0
- package/lib/WAUSync/USyncQuery.d.ts +20 -0
- package/lib/WAUSync/USyncQuery.js +122 -0
- package/lib/WAUSync/USyncUser.d.ts +16 -0
- package/lib/WAUSync/USyncUser.js +31 -0
- package/lib/WAUSync/index.d.ts +3 -0
- package/lib/WAUSync/index.js +4 -0
- package/lib/assets/wasm/loader.js +5 -0
- package/lib/assets/wasm/whatsapp.wasm +0 -0
- package/lib/assets/wasm/worker-modules.js +273 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.js +20 -0
- package/package.json +175 -0
- package/postinstall-banner.js +56 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export function createSignalIdentity(wid: any, accountSignatureKey: any): {
|
|
2
|
+
identifier: {
|
|
3
|
+
name: any;
|
|
4
|
+
deviceId: number;
|
|
5
|
+
};
|
|
6
|
+
identifierKey: any;
|
|
7
|
+
};
|
|
8
|
+
export function getPreKeys({ get }: {
|
|
9
|
+
get: any;
|
|
10
|
+
}, min: any, limit: any): Promise<any>;
|
|
11
|
+
export function generateOrGetPreKeys(creds: any, range: any): {
|
|
12
|
+
newPreKeys: {};
|
|
13
|
+
lastPreKeyId: number;
|
|
14
|
+
preKeysRange: any[];
|
|
15
|
+
};
|
|
16
|
+
export function xmppSignedPreKey(key: any): {
|
|
17
|
+
tag: string;
|
|
18
|
+
attrs: {};
|
|
19
|
+
content: {
|
|
20
|
+
tag: string;
|
|
21
|
+
attrs: {};
|
|
22
|
+
content: any;
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
export function xmppPreKey(pair: any, id: any): {
|
|
26
|
+
tag: string;
|
|
27
|
+
attrs: {};
|
|
28
|
+
content: {
|
|
29
|
+
tag: string;
|
|
30
|
+
attrs: {};
|
|
31
|
+
content: any;
|
|
32
|
+
}[];
|
|
33
|
+
};
|
|
34
|
+
export function extractE2ESessionFromRetryReceipt(receipt: any): {
|
|
35
|
+
registrationId: number | undefined;
|
|
36
|
+
identityKey: any;
|
|
37
|
+
signedPreKey: {
|
|
38
|
+
keyId: number | undefined;
|
|
39
|
+
publicKey: any;
|
|
40
|
+
signature: any;
|
|
41
|
+
};
|
|
42
|
+
preKey: {
|
|
43
|
+
keyId: number | undefined;
|
|
44
|
+
publicKey: any;
|
|
45
|
+
} | undefined;
|
|
46
|
+
} | null;
|
|
47
|
+
export function parseAndInjectE2ESessions(node: any, repository: any): Promise<void>;
|
|
48
|
+
export function extractDeviceJids(result: any, myJid: any, myLid: any, excludeZeroDevices: any): {
|
|
49
|
+
user: any;
|
|
50
|
+
device: any;
|
|
51
|
+
domainType: any;
|
|
52
|
+
server: any;
|
|
53
|
+
}[];
|
|
54
|
+
export function getNextPreKeys({ creds, keys }: {
|
|
55
|
+
creds: any;
|
|
56
|
+
keys: any;
|
|
57
|
+
}, count: any): Promise<{
|
|
58
|
+
update: {
|
|
59
|
+
nextPreKeyId: number;
|
|
60
|
+
firstUnuploadedPreKeyId: number;
|
|
61
|
+
};
|
|
62
|
+
preKeys: any;
|
|
63
|
+
}>;
|
|
64
|
+
export function getNextPreKeysNode(state: any, count: any): Promise<{
|
|
65
|
+
update: {
|
|
66
|
+
nextPreKeyId: number;
|
|
67
|
+
firstUnuploadedPreKeyId: number;
|
|
68
|
+
};
|
|
69
|
+
node: {
|
|
70
|
+
tag: string;
|
|
71
|
+
attrs: {
|
|
72
|
+
xmlns: string;
|
|
73
|
+
type: string;
|
|
74
|
+
to: string;
|
|
75
|
+
};
|
|
76
|
+
content: {
|
|
77
|
+
tag: string;
|
|
78
|
+
attrs: {};
|
|
79
|
+
content: any;
|
|
80
|
+
}[];
|
|
81
|
+
};
|
|
82
|
+
}>;
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { KEY_BUNDLE_TYPE } from '../Defaults/index.js';
|
|
2
|
+
import { assertNodeErrorFree, getBinaryNodeChild, getBinaryNodeChildBuffer, getBinaryNodeChildren, getBinaryNodeChildUInt, getServerFromDomainType, jidDecode, S_WHATSAPP_NET, WAJIDDomains } from '../WABinary/index.js';
|
|
3
|
+
import { Curve, generateSignalPubKey } from './crypto.js';
|
|
4
|
+
import { encodeBigEndian } from './generics.js';
|
|
5
|
+
function chunk(array, size) {
|
|
6
|
+
const chunks = [];
|
|
7
|
+
for (let i = 0; i < array.length; i += size) {
|
|
8
|
+
chunks.push(array.slice(i, i + size));
|
|
9
|
+
}
|
|
10
|
+
return chunks;
|
|
11
|
+
}
|
|
12
|
+
export const createSignalIdentity = (wid, accountSignatureKey) => {
|
|
13
|
+
return {
|
|
14
|
+
identifier: { name: wid, deviceId: 0 },
|
|
15
|
+
identifierKey: generateSignalPubKey(accountSignatureKey)
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export const getPreKeys = async ({ get }, min, limit) => {
|
|
19
|
+
const idList = [];
|
|
20
|
+
for (let id = min; id < limit; id++) {
|
|
21
|
+
idList.push(id.toString());
|
|
22
|
+
}
|
|
23
|
+
return get('pre-key', idList);
|
|
24
|
+
};
|
|
25
|
+
export const generateOrGetPreKeys = (creds, range) => {
|
|
26
|
+
const avaliable = creds.nextPreKeyId - creds.firstUnuploadedPreKeyId;
|
|
27
|
+
const remaining = range - avaliable;
|
|
28
|
+
const lastPreKeyId = creds.nextPreKeyId + remaining - 1;
|
|
29
|
+
const newPreKeys = {};
|
|
30
|
+
if (remaining > 0) {
|
|
31
|
+
for (let i = creds.nextPreKeyId; i <= lastPreKeyId; i++) {
|
|
32
|
+
newPreKeys[i] = Curve.generateKeyPair();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
newPreKeys,
|
|
37
|
+
lastPreKeyId,
|
|
38
|
+
preKeysRange: [creds.firstUnuploadedPreKeyId, range]
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export const xmppSignedPreKey = (key) => ({
|
|
42
|
+
tag: 'skey',
|
|
43
|
+
attrs: {},
|
|
44
|
+
content: [
|
|
45
|
+
{ tag: 'id', attrs: {}, content: encodeBigEndian(key.keyId, 3) },
|
|
46
|
+
{ tag: 'value', attrs: {}, content: key.keyPair.public },
|
|
47
|
+
{ tag: 'signature', attrs: {}, content: key.signature }
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
export const xmppPreKey = (pair, id) => ({
|
|
51
|
+
tag: 'key',
|
|
52
|
+
attrs: {},
|
|
53
|
+
content: [
|
|
54
|
+
{ tag: 'id', attrs: {}, content: encodeBigEndian(id, 3) },
|
|
55
|
+
{ tag: 'value', attrs: {}, content: pair.public }
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
const isValidUInt = (n) => typeof n === 'number' && Number.isInteger(n);
|
|
59
|
+
export const extractE2ESessionFromRetryReceipt = (receipt) => {
|
|
60
|
+
const keysNode = getBinaryNodeChild(receipt, 'keys');
|
|
61
|
+
if (!keysNode)
|
|
62
|
+
return null;
|
|
63
|
+
const typeBuf = getBinaryNodeChildBuffer(keysNode, 'type');
|
|
64
|
+
if (!typeBuf || typeBuf.length !== 1 || typeBuf[0] !== KEY_BUNDLE_TYPE[0])
|
|
65
|
+
return null;
|
|
66
|
+
const identity = getBinaryNodeChildBuffer(keysNode, 'identity');
|
|
67
|
+
const skey = getBinaryNodeChild(keysNode, 'skey');
|
|
68
|
+
if (!identity || identity.length !== 32 || !skey)
|
|
69
|
+
return null;
|
|
70
|
+
const registrationId = getBinaryNodeChildUInt(receipt, 'registration', 4);
|
|
71
|
+
if (!isValidUInt(registrationId))
|
|
72
|
+
return null;
|
|
73
|
+
const signedPubKey = getBinaryNodeChildBuffer(skey, 'value');
|
|
74
|
+
const signedSig = getBinaryNodeChildBuffer(skey, 'signature');
|
|
75
|
+
const signedKeyId = getBinaryNodeChildUInt(skey, 'id', 3);
|
|
76
|
+
if (!signedPubKey || signedPubKey.length !== 32 || !signedSig || !isValidUInt(signedKeyId)) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
const preKeyNode = getBinaryNodeChild(keysNode, 'key');
|
|
80
|
+
let preKey;
|
|
81
|
+
if (preKeyNode) {
|
|
82
|
+
const preKeyPub = getBinaryNodeChildBuffer(preKeyNode, 'value');
|
|
83
|
+
const preKeyId = getBinaryNodeChildUInt(preKeyNode, 'id', 3);
|
|
84
|
+
if (!preKeyPub || preKeyPub.length !== 32 || !isValidUInt(preKeyId)) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
preKey = { keyId: preKeyId, publicKey: generateSignalPubKey(preKeyPub) };
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
registrationId,
|
|
91
|
+
identityKey: generateSignalPubKey(identity),
|
|
92
|
+
signedPreKey: {
|
|
93
|
+
keyId: signedKeyId,
|
|
94
|
+
publicKey: generateSignalPubKey(signedPubKey),
|
|
95
|
+
signature: signedSig
|
|
96
|
+
},
|
|
97
|
+
preKey
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
export const parseAndInjectE2ESessions = async (node, repository) => {
|
|
101
|
+
const extractKey = (key) => key
|
|
102
|
+
? {
|
|
103
|
+
keyId: getBinaryNodeChildUInt(key, 'id', 3),
|
|
104
|
+
publicKey: generateSignalPubKey(getBinaryNodeChildBuffer(key, 'value')),
|
|
105
|
+
signature: getBinaryNodeChildBuffer(key, 'signature')
|
|
106
|
+
}
|
|
107
|
+
: undefined;
|
|
108
|
+
const nodes = getBinaryNodeChildren(getBinaryNodeChild(node, 'list'), 'user');
|
|
109
|
+
for (const node of nodes) {
|
|
110
|
+
assertNodeErrorFree(node);
|
|
111
|
+
}
|
|
112
|
+
// Most of the work in repository.injectE2ESession is CPU intensive, not IO
|
|
113
|
+
// So Promise.all doesn't really help here,
|
|
114
|
+
// but blocks even loop if we're using it inside keys.transaction, and it makes it "sync" actually
|
|
115
|
+
// This way we chunk it in smaller parts and between those parts we can yield to the event loop
|
|
116
|
+
// It's rare case when you need to E2E sessions for so many users, but it's possible
|
|
117
|
+
const chunkSize = 100;
|
|
118
|
+
const chunks = chunk(nodes, chunkSize);
|
|
119
|
+
for (const nodesChunk of chunks) {
|
|
120
|
+
for (const node of nodesChunk) {
|
|
121
|
+
const signedKey = getBinaryNodeChild(node, 'skey');
|
|
122
|
+
const key = getBinaryNodeChild(node, 'key');
|
|
123
|
+
const identity = getBinaryNodeChildBuffer(node, 'identity');
|
|
124
|
+
const jid = node.attrs.jid;
|
|
125
|
+
const registrationId = getBinaryNodeChildUInt(node, 'registration', 4);
|
|
126
|
+
await repository.injectE2ESession({
|
|
127
|
+
jid,
|
|
128
|
+
session: {
|
|
129
|
+
registrationId: registrationId,
|
|
130
|
+
identityKey: generateSignalPubKey(identity),
|
|
131
|
+
signedPreKey: extractKey(signedKey),
|
|
132
|
+
preKey: extractKey(key)
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
export const extractDeviceJids = (result, myJid, myLid, excludeZeroDevices) => {
|
|
139
|
+
const { user: myUser, device: myDevice } = jidDecode(myJid);
|
|
140
|
+
const extracted = [];
|
|
141
|
+
for (const userResult of result) {
|
|
142
|
+
const { devices, id } = userResult;
|
|
143
|
+
const decoded = jidDecode(id), { user, server } = decoded;
|
|
144
|
+
let { domainType } = decoded;
|
|
145
|
+
const deviceList = devices?.deviceList;
|
|
146
|
+
if (!Array.isArray(deviceList))
|
|
147
|
+
continue;
|
|
148
|
+
for (const { id: device, keyIndex, isHosted } of deviceList) {
|
|
149
|
+
if ((!excludeZeroDevices || device !== 0) && // if zero devices are not-excluded, or device is non zero
|
|
150
|
+
((myUser !== user && myLid !== user) || myDevice !== device) && // either different user or if me user, not this device
|
|
151
|
+
(device === 0 || !!keyIndex) // ensure that "key-index" is specified for "non-zero" devices, produces a bad req otherwise
|
|
152
|
+
) {
|
|
153
|
+
if (isHosted) {
|
|
154
|
+
domainType = domainType === WAJIDDomains.LID ? WAJIDDomains.HOSTED_LID : WAJIDDomains.HOSTED;
|
|
155
|
+
}
|
|
156
|
+
extracted.push({
|
|
157
|
+
user,
|
|
158
|
+
device,
|
|
159
|
+
domainType,
|
|
160
|
+
server: getServerFromDomainType(server, domainType)
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return extracted;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* get the next N keys for upload or processing
|
|
169
|
+
* @param count number of pre-keys to get or generate
|
|
170
|
+
*/
|
|
171
|
+
export const getNextPreKeys = async ({ creds, keys }, count) => {
|
|
172
|
+
const { newPreKeys, lastPreKeyId, preKeysRange } = generateOrGetPreKeys(creds, count);
|
|
173
|
+
const update = {
|
|
174
|
+
nextPreKeyId: Math.max(lastPreKeyId + 1, creds.nextPreKeyId),
|
|
175
|
+
firstUnuploadedPreKeyId: Math.max(creds.firstUnuploadedPreKeyId, lastPreKeyId + 1)
|
|
176
|
+
};
|
|
177
|
+
await keys.set({ 'pre-key': newPreKeys });
|
|
178
|
+
const preKeys = await getPreKeys(keys, preKeysRange[0], preKeysRange[0] + preKeysRange[1]);
|
|
179
|
+
return { update, preKeys };
|
|
180
|
+
};
|
|
181
|
+
export const getNextPreKeysNode = async (state, count) => {
|
|
182
|
+
const { creds } = state;
|
|
183
|
+
const { update, preKeys } = await getNextPreKeys(state, count);
|
|
184
|
+
const node = {
|
|
185
|
+
tag: 'iq',
|
|
186
|
+
attrs: {
|
|
187
|
+
xmlns: 'encrypt',
|
|
188
|
+
type: 'set',
|
|
189
|
+
to: S_WHATSAPP_NET
|
|
190
|
+
},
|
|
191
|
+
content: [
|
|
192
|
+
{ tag: 'registration', attrs: {}, content: encodeBigEndian(creds.registrationId) },
|
|
193
|
+
{ tag: 'type', attrs: {}, content: KEY_BUNDLE_TYPE },
|
|
194
|
+
{ tag: 'identity', attrs: {}, content: creds.signedIdentityKey.public },
|
|
195
|
+
{ tag: 'list', attrs: {}, content: Object.keys(preKeys).map(k => xmppPreKey(preKeys[+k], +k)) },
|
|
196
|
+
xmppSignedPreKey(creds.signedPreKey)
|
|
197
|
+
]
|
|
198
|
+
};
|
|
199
|
+
return { update, node };
|
|
200
|
+
};
|
|
201
|
+
//# sourceMappingURL=signal.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds an ACK stanza for a received node.
|
|
3
|
+
* Pure function -- no I/O, no side effects.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors WhatsApp Web's ACK construction:
|
|
6
|
+
* - WAWebHandleMsgSendAck.sendAck / sendNack
|
|
7
|
+
* - WAWebCreateNackFromStanza.createNackFromStanza
|
|
8
|
+
*/
|
|
9
|
+
export function buildAckStanza(node: any, errorCode: any, meId: any): {
|
|
10
|
+
tag: string;
|
|
11
|
+
attrs: {
|
|
12
|
+
id: any;
|
|
13
|
+
to: any;
|
|
14
|
+
class: any;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds an ACK stanza for a received node.
|
|
3
|
+
* Pure function -- no I/O, no side effects.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors WhatsApp Web's ACK construction:
|
|
6
|
+
* - WAWebHandleMsgSendAck.sendAck / sendNack
|
|
7
|
+
* - WAWebCreateNackFromStanza.createNackFromStanza
|
|
8
|
+
*/
|
|
9
|
+
export function buildAckStanza(node, errorCode, meId) {
|
|
10
|
+
const { tag, attrs } = node;
|
|
11
|
+
const stanza = {
|
|
12
|
+
tag: 'ack',
|
|
13
|
+
attrs: {
|
|
14
|
+
id: attrs.id,
|
|
15
|
+
to: attrs.from,
|
|
16
|
+
class: tag
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
if (errorCode) {
|
|
20
|
+
stanza.attrs.error = errorCode.toString();
|
|
21
|
+
}
|
|
22
|
+
if (attrs.participant) {
|
|
23
|
+
stanza.attrs.participant = attrs.participant;
|
|
24
|
+
}
|
|
25
|
+
if (attrs.recipient) {
|
|
26
|
+
stanza.attrs.recipient = attrs.recipient;
|
|
27
|
+
}
|
|
28
|
+
// WA Web always includes type when present: `n.type || DROP_ATTR`
|
|
29
|
+
if (attrs.type) {
|
|
30
|
+
stanza.attrs.type = attrs.type;
|
|
31
|
+
}
|
|
32
|
+
// WA Web WAWebHandleMsgSendAck.sendAck/sendNack always include `from` for message-class ACKs
|
|
33
|
+
if (tag === 'message' && meId) {
|
|
34
|
+
stanza.attrs.from = meId;
|
|
35
|
+
}
|
|
36
|
+
return stanza;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=stanza-ack.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { AnyMessageContent } from '../Types/index.js';
|
|
2
|
+
import type makeWASocket from '../Socket/index.js';
|
|
3
|
+
type WASocket = ReturnType<typeof makeWASocket>;
|
|
4
|
+
export declare const STATUS_BROADCAST_JID = "status@broadcast";
|
|
5
|
+
export declare const STATUS_BACKGROUNDS: {
|
|
6
|
+
solid: Record<string, string>;
|
|
7
|
+
gradient: Record<string, string[]>;
|
|
8
|
+
};
|
|
9
|
+
export declare const STATUS_FONTS: {
|
|
10
|
+
readonly SANS_SERIF: 0;
|
|
11
|
+
readonly SERIF: 1;
|
|
12
|
+
readonly NORICAN: 2;
|
|
13
|
+
readonly BRYNDAN: 3;
|
|
14
|
+
readonly BEBASNEUE: 4;
|
|
15
|
+
readonly OSWALD: 5;
|
|
16
|
+
readonly DAMION: 6;
|
|
17
|
+
readonly DANCING: 7;
|
|
18
|
+
readonly COMFORTAA: 8;
|
|
19
|
+
readonly EXOTWO: 9;
|
|
20
|
+
};
|
|
21
|
+
export type StatusFont = (typeof STATUS_FONTS)[keyof typeof STATUS_FONTS];
|
|
22
|
+
export declare const generateStatusMessageId: () => string;
|
|
23
|
+
export type TextStatusOptions = {
|
|
24
|
+
text: string;
|
|
25
|
+
backgroundColor?: string;
|
|
26
|
+
font?: StatusFont;
|
|
27
|
+
textColor?: string;
|
|
28
|
+
mentions?: string[];
|
|
29
|
+
};
|
|
30
|
+
export type MediaStatusOptions = {
|
|
31
|
+
caption?: string;
|
|
32
|
+
gifPlayback?: boolean;
|
|
33
|
+
waveform?: Uint8Array;
|
|
34
|
+
};
|
|
35
|
+
export declare const createTextStatus: (options: TextStatusOptions) => AnyMessageContent;
|
|
36
|
+
export declare const createImageStatus: (media: Buffer | string, options?: MediaStatusOptions) => AnyMessageContent;
|
|
37
|
+
export declare const createVideoStatus: (media: Buffer | string, options?: MediaStatusOptions) => AnyMessageContent;
|
|
38
|
+
export declare const createAudioStatus: (media: Buffer | string, options?: MediaStatusOptions) => AnyMessageContent;
|
|
39
|
+
export declare const getStatusJid: () => string;
|
|
40
|
+
export declare const StatusHelper: {
|
|
41
|
+
text: (text: string, backgroundColor?: string, font?: StatusFont) => AnyMessageContent;
|
|
42
|
+
image: (buffer: Buffer, caption?: string) => AnyMessageContent;
|
|
43
|
+
imageUrl: (url: string, caption?: string) => AnyMessageContent;
|
|
44
|
+
video: (buffer: Buffer, caption?: string) => AnyMessageContent;
|
|
45
|
+
videoUrl: (url: string, caption?: string) => AnyMessageContent;
|
|
46
|
+
gif: (buffer: Buffer, caption?: string) => AnyMessageContent;
|
|
47
|
+
voiceNote: (buffer: Buffer) => AnyMessageContent;
|
|
48
|
+
send: (sock: WASocket, content: AnyMessageContent, jidList?: string[]) => Promise<any>;
|
|
49
|
+
};
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// Vanz@Add --- ported from Bail-master addons/status-helpers.ts (type-only
|
|
2
|
+
// annotations dropped; behavior unchanged). status-posting.ts (the other
|
|
3
|
+
// addon shipping identical STATUS_BACKGROUNDS/STATUS_FONTS/createXStatus/
|
|
4
|
+
// StatusHelper) additionally exposed `makeStatusMentionsAddon`, a
|
|
5
|
+
// socket-factory-style addon requiring deep internal wiring (authState,
|
|
6
|
+
// waUploadToServer, groupMetadata, generateWAMessageContent) matching
|
|
7
|
+
// Baileys' own makeXSocket pattern — left out of this port as too tightly
|
|
8
|
+
// coupled to socket internals to safely merge without live testing.
|
|
9
|
+
// Basic status mentions are still supported via createTextStatus's own
|
|
10
|
+
// `mentions` option (contextInfo.mentionedJid).
|
|
11
|
+
import { randomBytes } from 'crypto';
|
|
12
|
+
export const STATUS_BROADCAST_JID = 'status@broadcast';
|
|
13
|
+
export const STATUS_BACKGROUNDS = {
|
|
14
|
+
solid: {
|
|
15
|
+
green: '#25D366',
|
|
16
|
+
blue: '#34B7F1',
|
|
17
|
+
purple: '#8B5CF6',
|
|
18
|
+
red: '#EF4444',
|
|
19
|
+
orange: '#F97316',
|
|
20
|
+
yellow: '#EAB308',
|
|
21
|
+
pink: '#EC4899',
|
|
22
|
+
teal: '#14B8A6',
|
|
23
|
+
gray: '#6B7280',
|
|
24
|
+
black: '#000000',
|
|
25
|
+
white: '#FFFFFF'
|
|
26
|
+
},
|
|
27
|
+
gradient: {
|
|
28
|
+
sunset: ['#F97316', '#EF4444'],
|
|
29
|
+
ocean: ['#3B82F6', '#06B6D4'],
|
|
30
|
+
forest: ['#22C55E', '#10B981'],
|
|
31
|
+
purple: ['#8B5CF6', '#EC4899'],
|
|
32
|
+
midnight: ['#1E3A8A', '#4C1D95'],
|
|
33
|
+
aurora: ['#06B6D4', '#8B5CF6', '#EC4899']
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
export const STATUS_FONTS = {
|
|
37
|
+
SANS_SERIF: 0,
|
|
38
|
+
SERIF: 1,
|
|
39
|
+
NORICAN: 2,
|
|
40
|
+
BRYNDAN: 3,
|
|
41
|
+
BEBASNEUE: 4,
|
|
42
|
+
OSWALD: 5,
|
|
43
|
+
DAMION: 6,
|
|
44
|
+
DANCING: 7,
|
|
45
|
+
COMFORTAA: 8,
|
|
46
|
+
EXOTWO: 9
|
|
47
|
+
};
|
|
48
|
+
/** Generate a status message ID with a 4NY4W3B prefix. */
|
|
49
|
+
export const generateStatusMessageId = () => `4NY4W3B${randomBytes(16).toString('hex').toUpperCase()}`;
|
|
50
|
+
export const createTextStatus = (options) => ({
|
|
51
|
+
text: options.text,
|
|
52
|
+
backgroundColor: options.backgroundColor || STATUS_BACKGROUNDS.solid.green,
|
|
53
|
+
font: options.font ?? STATUS_FONTS.SANS_SERIF,
|
|
54
|
+
textColor: options.textColor || '#FFFFFF',
|
|
55
|
+
contextInfo: { mentionedJid: options.mentions || [], isForwarded: false }
|
|
56
|
+
});
|
|
57
|
+
export const createImageStatus = (media, options) => ({
|
|
58
|
+
image: typeof media === 'string' ? { url: media } : media,
|
|
59
|
+
caption: options?.caption || ''
|
|
60
|
+
});
|
|
61
|
+
export const createVideoStatus = (media, options) => ({
|
|
62
|
+
video: typeof media === 'string' ? { url: media } : media,
|
|
63
|
+
caption: options?.caption || '',
|
|
64
|
+
gifPlayback: options?.gifPlayback || false
|
|
65
|
+
});
|
|
66
|
+
export const createAudioStatus = (media, options) => ({
|
|
67
|
+
audio: typeof media === 'string' ? { url: media } : media,
|
|
68
|
+
ptt: true,
|
|
69
|
+
mimetype: 'audio/ogg; codecs=opus',
|
|
70
|
+
waveform: options?.waveform
|
|
71
|
+
});
|
|
72
|
+
export const getStatusJid = () => STATUS_BROADCAST_JID;
|
|
73
|
+
/** Convenience wrappers + a `send()` that routes group vs. individual/broadcast status delivery. */
|
|
74
|
+
export const StatusHelper = {
|
|
75
|
+
text: (text, backgroundColor, font) => createTextStatus({ text, backgroundColor, font }),
|
|
76
|
+
image: (buffer, caption) => createImageStatus(buffer, { caption }),
|
|
77
|
+
imageUrl: (url, caption) => createImageStatus(url, { caption }),
|
|
78
|
+
video: (buffer, caption) => createVideoStatus(buffer, { caption }),
|
|
79
|
+
videoUrl: (url, caption) => createVideoStatus(url, { caption }),
|
|
80
|
+
gif: (buffer, caption) => createVideoStatus(buffer, { caption, gifPlayback: true }),
|
|
81
|
+
voiceNote: (buffer) => createAudioStatus(buffer),
|
|
82
|
+
/**
|
|
83
|
+
* Send a status to specific JIDs (groups and/or individuals).
|
|
84
|
+
* Handles group status (groupStatus:true) and broadcast (status@broadcast) separately.
|
|
85
|
+
* Pass an empty jidList (or omit it) to broadcast to everyone.
|
|
86
|
+
*/
|
|
87
|
+
send: async (sock, content, jidList = []) => {
|
|
88
|
+
const groups = jidList.filter((j) => j?.endsWith('@g.us'));
|
|
89
|
+
const individuals = jidList.filter((j) => j?.endsWith('@s.whatsapp.net') || j?.endsWith('@lid'));
|
|
90
|
+
let lastResult;
|
|
91
|
+
if (groups.length > 0) {
|
|
92
|
+
const groupContent = { ...content, groupStatus: true };
|
|
93
|
+
for (const groupJid of groups) {
|
|
94
|
+
lastResult = await sock.sendMessage(groupJid, groupContent, { messageId: generateStatusMessageId() });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (individuals.length > 0 || jidList.length === 0) {
|
|
98
|
+
const result = await sock.sendMessage(STATUS_BROADCAST_JID, content, {
|
|
99
|
+
statusJidList: individuals.length > 0 ? individuals : undefined,
|
|
100
|
+
messageId: generateStatusMessageId()
|
|
101
|
+
});
|
|
102
|
+
if (!lastResult)
|
|
103
|
+
lastResult = result;
|
|
104
|
+
}
|
|
105
|
+
return lastResult;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ILogger } from './logger.js';
|
|
2
|
+
import type { WAMediaUpload } from '../Types/index.js';
|
|
3
|
+
import { proto } from '../../WAProto/index.js';
|
|
4
|
+
export declare const isWebPBuffer: (buffer: Buffer) => boolean;
|
|
5
|
+
export declare const isAnimatedWebP: (buffer: Buffer) => boolean;
|
|
6
|
+
export declare const convertToWebP: (input: WAMediaUpload) => Promise<{
|
|
7
|
+
buffer: Buffer;
|
|
8
|
+
isAnimated: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const generateStickerPackId: () => string;
|
|
11
|
+
export declare const buildStickerPackProto: (pack: {
|
|
12
|
+
name: string;
|
|
13
|
+
publisher: string;
|
|
14
|
+
packId?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
}) => {
|
|
17
|
+
name: string;
|
|
18
|
+
publisher: string;
|
|
19
|
+
packId: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const STICKER_PACK_MESSAGE_TYPE: 'sticker_pack';
|
|
23
|
+
export type ItsliaaaStickerInput = {
|
|
24
|
+
data: WAMediaUpload;
|
|
25
|
+
emojis?: string[];
|
|
26
|
+
accessibilityLabel?: string;
|
|
27
|
+
};
|
|
28
|
+
export type ItsliaaaStickerPackInput = {
|
|
29
|
+
cover: WAMediaUpload;
|
|
30
|
+
stickers: ItsliaaaStickerInput[];
|
|
31
|
+
name?: string;
|
|
32
|
+
publisher?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
};
|
|
35
|
+
export type ItsliaaaStickerPackOptions = {
|
|
36
|
+
logger?: ILogger;
|
|
37
|
+
upload: (filePath: string, opts: {
|
|
38
|
+
fileEncSha256B64: string;
|
|
39
|
+
mediaType: string;
|
|
40
|
+
timeoutMs?: number;
|
|
41
|
+
}) => Promise<{
|
|
42
|
+
directPath: string;
|
|
43
|
+
}>;
|
|
44
|
+
options?: RequestInit;
|
|
45
|
+
mediaUploadTimeoutMs?: number;
|
|
46
|
+
mediaCache?: {
|
|
47
|
+
get: (key: string) => Promise<Buffer | undefined>;
|
|
48
|
+
set: (key: string, value: Buffer) => void;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export declare const prepareStickerPackMessageItsliaaa: (message: ItsliaaaStickerPackInput, options: ItsliaaaStickerPackOptions) => Promise<proto.Message.IStickerPackMessage>;
|