@jkt48connect-corp/baileys 7.2.7 → 7.2.9
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 +1 -1
- package/README.md +838 -94
- package/WAProto/WAProto.proto +969 -88
- package/WAProto/index.js +124901 -74525
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.js +5 -3
- package/lib/Defaults/phonenumber-mcc.json +221 -221
- package/lib/Signal/libsignal.js +18 -9
- package/lib/Socket/groups.js +1 -1
- package/lib/Socket/messages-recv.js +310 -151
- package/lib/Socket/messages-send.js +269 -36
- package/lib/Socket/newsletter.js +3 -3
- package/lib/Socket/registration.js +7 -7
- package/lib/Socket/socket.js +7 -3
- package/lib/Store/make-in-memory-store.js +13 -11
- package/lib/Types/Label.js +1 -1
- package/lib/Types/LabelAssociation.js +1 -1
- package/lib/Types/Newsletter.js +3 -3
- package/lib/Types/index.js +1 -1
- package/lib/Utils/auth-utils.js +3 -3
- package/lib/Utils/business.js +2 -2
- package/lib/Utils/chat-utils.js +41 -20
- package/lib/Utils/crypto.js +35 -23
- package/lib/Utils/decode-wa-message.js +43 -15
- package/lib/Utils/generics.js +32 -16
- package/lib/Utils/history.js +3 -0
- package/lib/Utils/index.js +0 -1
- package/lib/Utils/messages-media.js +38 -47
- package/lib/Utils/messages.js +430 -12
- package/lib/Utils/process-message.js +2 -2
- package/lib/Utils/use-multi-file-auth-state.js +17 -3
- package/lib/Utils/validate-connection.js +12 -23
- package/lib/WABinary/decode.js +17 -7
- package/lib/WABinary/encode.js +33 -17
- package/lib/WABinary/generic-utils.js +2 -2
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
- package/lib/WAUSync/Protocols/index.js +20 -0
- package/lib/WAUSync/USyncQuery.js +79 -0
- package/lib/WAUSync/USyncUser.js +22 -0
- package/lib/WAUSync/index.js +19 -0
- package/lib/index.js +4 -1
- package/package.json +15 -10
- package/WAProto/index.d.ts +0 -37016
- package/lib/Defaults/index.d.ts +0 -283
- package/lib/Signal/libsignal.d.ts +0 -3
- package/lib/Socket/Client/abstract-socket-client.d.ts +0 -17
- package/lib/Socket/Client/index.d.ts +0 -3
- package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
- package/lib/Socket/Client/web-socket-client.d.ts +0 -12
- package/lib/Socket/business.d.ts +0 -170
- package/lib/Socket/chats.d.ts +0 -80
- package/lib/Socket/community.d.ts +0 -219
- package/lib/Socket/community.js +0 -354
- package/lib/Socket/groups.d.ts +0 -114
- package/lib/Socket/index.d.ts +0 -172
- package/lib/Socket/messages-recv.d.ts +0 -158
- package/lib/Socket/messages-send.d.ts +0 -147
- package/lib/Socket/newsletter.d.ts +0 -133
- package/lib/Socket/registration.d.ts +0 -267
- package/lib/Socket/socket.d.ts +0 -43
- package/lib/Store/index.d.ts +0 -3
- package/lib/Store/make-cache-manager-store.d.ts +0 -13
- package/lib/Store/make-in-memory-store.d.ts +0 -118
- package/lib/Store/make-ordered-dictionary.d.ts +0 -13
- package/lib/Store/object-repository.d.ts +0 -10
- package/lib/Types/Auth.d.ts +0 -110
- package/lib/Types/Call.d.ts +0 -13
- package/lib/Types/Chat.d.ts +0 -102
- package/lib/Types/Contact.d.ts +0 -19
- package/lib/Types/Events.d.ts +0 -157
- package/lib/Types/GroupMetadata.d.ts +0 -54
- package/lib/Types/Label.d.ts +0 -35
- package/lib/Types/LabelAssociation.d.ts +0 -29
- package/lib/Types/Message.d.ts +0 -273
- package/lib/Types/Newsletter.d.ts +0 -92
- package/lib/Types/Product.d.ts +0 -78
- package/lib/Types/Signal.d.ts +0 -57
- package/lib/Types/Socket.d.ts +0 -111
- package/lib/Types/State.d.ts +0 -27
- package/lib/Types/index.d.ts +0 -57
- package/lib/Utils/auth-utils.d.ts +0 -18
- package/lib/Utils/baileys-event-stream.d.ts +0 -16
- package/lib/Utils/business.d.ts +0 -22
- package/lib/Utils/chat-utils.d.ts +0 -71
- package/lib/Utils/crypto.d.ts +0 -41
- package/lib/Utils/decode-wa-message.d.ts +0 -19
- package/lib/Utils/event-buffer.d.ts +0 -35
- package/lib/Utils/generics.d.ts +0 -97
- package/lib/Utils/history.d.ts +0 -15
- package/lib/Utils/index.d.ts +0 -18
- package/lib/Utils/link-preview.d.ts +0 -21
- package/lib/Utils/logger.d.ts +0 -4
- package/lib/Utils/lt-hash.d.ts +0 -12
- package/lib/Utils/make-mutex.d.ts +0 -7
- package/lib/Utils/messages-media.d.ts +0 -116
- package/lib/Utils/messages.d.ts +0 -77
- package/lib/Utils/noise-handler.d.ts +0 -21
- package/lib/Utils/process-message.d.ts +0 -41
- package/lib/Utils/signal.d.ts +0 -32
- package/lib/Utils/use-multi-file-auth-state.d.ts +0 -12
- package/lib/Utils/use-single-file-auth-statev2.d.ts +0 -12
- package/lib/Utils/use-single-file-auth-statev2.js +0 -75
- package/lib/Utils/validate-connection.d.ts +0 -11
- package/lib/WABinary/constants.d.ts +0 -27
- package/lib/WABinary/decode.d.ts +0 -7
- package/lib/WABinary/encode.d.ts +0 -3
- package/lib/WABinary/generic-utils.d.ts +0 -15
- package/lib/WABinary/index.d.ts +0 -5
- package/lib/WABinary/jid-utils.d.ts +0 -31
- package/lib/WABinary/types.d.ts +0 -18
- package/lib/WAM/BinaryInfo.d.ts +0 -17
- package/lib/WAM/constants.d.ts +0 -38
- package/lib/WAM/encode.d.ts +0 -3
- package/lib/WAM/index.d.ts +0 -3
- package/lib/index.d.ts +0 -11
@@ -1,41 +0,0 @@
|
|
1
|
-
import { AxiosRequestConfig } from 'axios';
|
2
|
-
import type { Logger } from 'pino';
|
3
|
-
import { proto } from '../../WAProto';
|
4
|
-
import { AuthenticationCreds, BaileysEventEmitter, SignalKeyStoreWithTransaction, SocketConfig } from '../Types';
|
5
|
-
type ProcessMessageContext = {
|
6
|
-
shouldProcessHistoryMsg: boolean;
|
7
|
-
creds: AuthenticationCreds;
|
8
|
-
keyStore: SignalKeyStoreWithTransaction;
|
9
|
-
ev: BaileysEventEmitter;
|
10
|
-
getMessage: SocketConfig['getMessage'];
|
11
|
-
logger?: Logger;
|
12
|
-
options: AxiosRequestConfig<{}>;
|
13
|
-
};
|
14
|
-
/** Cleans a received message to further processing */
|
15
|
-
export declare const cleanMessage: (message: proto.IWebMessageInfo, meId: string) => void;
|
16
|
-
export declare const isRealMessage: (message: proto.IWebMessageInfo, meId: string) => boolean | undefined;
|
17
|
-
export declare const shouldIncrementChatUnread: (message: proto.IWebMessageInfo) => boolean;
|
18
|
-
/**
|
19
|
-
* Get the ID of the chat from the given key.
|
20
|
-
* Typically -- that'll be the remoteJid, but for broadcasts, it'll be the participant
|
21
|
-
*/
|
22
|
-
export declare const getChatId: ({ remoteJid, participant, fromMe }: proto.IMessageKey) => string;
|
23
|
-
type PollContext = {
|
24
|
-
/** normalised jid of the person that created the poll */
|
25
|
-
pollCreatorJid: string;
|
26
|
-
/** ID of the poll creation message */
|
27
|
-
pollMsgId: string;
|
28
|
-
/** poll creation message enc key */
|
29
|
-
pollEncKey: Uint8Array;
|
30
|
-
/** jid of the person that voted */
|
31
|
-
voterJid: string;
|
32
|
-
};
|
33
|
-
/**
|
34
|
-
* Decrypt a poll vote
|
35
|
-
* @param vote encrypted vote
|
36
|
-
* @param ctx additional info about the poll required for decryption
|
37
|
-
* @returns list of SHA256 options
|
38
|
-
*/
|
39
|
-
export declare function decryptPollVote({ encPayload, encIv }: proto.Message.IPollEncValue, { pollCreatorJid, pollMsgId, pollEncKey, voterJid, }: PollContext): proto.Message.PollVoteMessage;
|
40
|
-
declare const processMessage: (message: proto.IWebMessageInfo, { shouldProcessHistoryMsg, ev, creds, keyStore, logger, options, getMessage }: ProcessMessageContext) => Promise<void>;
|
41
|
-
export default processMessage;
|
package/lib/Utils/signal.d.ts
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
import { SignalRepository } from '../Types';
|
2
|
-
import { AuthenticationCreds, AuthenticationState, KeyPair, SignalIdentity, SignalKeyStore, SignedKeyPair } from '../Types/Auth';
|
3
|
-
import { BinaryNode, JidWithDevice } from '../WABinary';
|
4
|
-
export declare const createSignalIdentity: (wid: string, accountSignatureKey: Uint8Array) => SignalIdentity;
|
5
|
-
export declare const getPreKeys: ({ get }: SignalKeyStore, min: number, limit: number) => Promise<{
|
6
|
-
[id: string]: KeyPair;
|
7
|
-
}>;
|
8
|
-
export declare const generateOrGetPreKeys: (creds: AuthenticationCreds, range: number) => {
|
9
|
-
newPreKeys: {
|
10
|
-
[id: number]: KeyPair;
|
11
|
-
};
|
12
|
-
lastPreKeyId: number;
|
13
|
-
preKeysRange: readonly [number, number];
|
14
|
-
};
|
15
|
-
export declare const xmppSignedPreKey: (key: SignedKeyPair) => BinaryNode;
|
16
|
-
export declare const xmppPreKey: (pair: KeyPair, id: number) => BinaryNode;
|
17
|
-
export declare const parseAndInjectE2ESessions: (node: BinaryNode, repository: SignalRepository) => Promise<void>;
|
18
|
-
export declare const extractDeviceJids: (result: BinaryNode, myJid: string, excludeZeroDevices: boolean) => JidWithDevice[];
|
19
|
-
/**
|
20
|
-
* get the next N keys for upload or processing
|
21
|
-
* @param count number of pre-keys to get or generate
|
22
|
-
*/
|
23
|
-
export declare const getNextPreKeys: ({ creds, keys }: AuthenticationState, count: number) => Promise<{
|
24
|
-
update: Partial<AuthenticationCreds>;
|
25
|
-
preKeys: {
|
26
|
-
[id: string]: KeyPair;
|
27
|
-
};
|
28
|
-
}>;
|
29
|
-
export declare const getNextPreKeysNode: (state: AuthenticationState, count: number) => Promise<{
|
30
|
-
update: Partial<AuthenticationCreds>;
|
31
|
-
node: BinaryNode;
|
32
|
-
}>;
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import { AuthenticationState } from '../Types';
|
2
|
-
/**
|
3
|
-
* stores the full authentication state in a single folder.
|
4
|
-
* Far more efficient than singlefileauthstate
|
5
|
-
*
|
6
|
-
* Again, I wouldn't endorse this for any production level use other than perhaps a bot.
|
7
|
-
* Would recommend writing an auth state for use with a proper SQL or No-SQL DB
|
8
|
-
* */
|
9
|
-
export declare const useMultiFileAuthState: (folder: string) => Promise<{
|
10
|
-
state: AuthenticationState;
|
11
|
-
saveCreds: () => Promise<void>;
|
12
|
-
}>;
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import type { Logger } from 'pino';
|
2
|
-
import type { AuthenticationState } from '../Types';
|
3
|
-
/**
|
4
|
-
* @deprecated use multi file auth state instead please
|
5
|
-
* stores the full authentication state in a single JSON file
|
6
|
-
*
|
7
|
-
* DO NOT USE IN A PROD ENVIRONMENT, only meant to serve as an example
|
8
|
-
* */
|
9
|
-
export declare const useSingleFileAuthStateV2: (filename: string, logger?: Logger) => {
|
10
|
-
state: AuthenticationState;
|
11
|
-
saveState: () => void;
|
12
|
-
};
|
@@ -1,75 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.useSingleFileAuthStateV2 = void 0;
|
4
|
-
const WAProto_1 = require("../../WAProto");
|
5
|
-
const auth_utils_1 = require("./auth-utils");
|
6
|
-
const generics_1 = require("./generics");
|
7
|
-
// useless key map only there to maintain backwards compatibility
|
8
|
-
// do not use in your own systems please
|
9
|
-
const KEY_MAP = {
|
10
|
-
'pre-key': 'preKeys',
|
11
|
-
'session': 'sessions',
|
12
|
-
'sender-key': 'senderKeys',
|
13
|
-
'app-state-sync-key': 'appStateSyncKeys',
|
14
|
-
'app-state-sync-version': 'appStateVersions',
|
15
|
-
'sender-key-memory': 'senderKeyMemory'
|
16
|
-
};
|
17
|
-
/**
|
18
|
-
* @deprecated use multi file auth state instead please
|
19
|
-
* stores the full authentication state in a single JSON file
|
20
|
-
*
|
21
|
-
* DO NOT USE IN A PROD ENVIRONMENT, only meant to serve as an example
|
22
|
-
* */
|
23
|
-
const useSingleFileAuthStateV2 = (filename, logger) => {
|
24
|
-
// require fs here so that in case "fs" is not available -- the app does not crash
|
25
|
-
const { readFileSync, writeFileSync, existsSync } = require('fs');
|
26
|
-
let creds;
|
27
|
-
let keys = {};
|
28
|
-
// save the authentication state to a file
|
29
|
-
const saveState = () => {
|
30
|
-
logger && logger.trace('saving auth state');
|
31
|
-
writeFileSync(filename,
|
32
|
-
// BufferJSON replacer utility saves buffers nicely
|
33
|
-
JSON.stringify({ creds, keys }, generics_1.BufferJSON.replacer, 2));
|
34
|
-
};
|
35
|
-
if (existsSync(filename)) {
|
36
|
-
const result = JSON.parse(readFileSync(filename, { encoding: 'utf-8' }), generics_1.BufferJSON.reviver);
|
37
|
-
creds = result.creds;
|
38
|
-
keys = result.keys;
|
39
|
-
}
|
40
|
-
else {
|
41
|
-
creds = (0, auth_utils_1.initAuthCreds)();
|
42
|
-
keys = {};
|
43
|
-
}
|
44
|
-
return {
|
45
|
-
state: {
|
46
|
-
creds,
|
47
|
-
keys: {
|
48
|
-
get: (type, ids) => {
|
49
|
-
const key = KEY_MAP[type];
|
50
|
-
return ids.reduce((dict, id) => {
|
51
|
-
var _a;
|
52
|
-
let value = (_a = keys[key]) === null || _a === void 0 ? void 0 : _a[id];
|
53
|
-
if (value) {
|
54
|
-
if (type === 'app-state-sync-key') {
|
55
|
-
value = WAProto_1.proto.Message.AppStateSyncKeyData.fromObject(value);
|
56
|
-
}
|
57
|
-
dict[id] = value;
|
58
|
-
}
|
59
|
-
return dict;
|
60
|
-
}, {});
|
61
|
-
},
|
62
|
-
set: (data) => {
|
63
|
-
for (const _key in data) {
|
64
|
-
const key = KEY_MAP[_key];
|
65
|
-
keys[key] = keys[key] || {};
|
66
|
-
Object.assign(keys[key], data[_key]);
|
67
|
-
}
|
68
|
-
saveState();
|
69
|
-
}
|
70
|
-
}
|
71
|
-
},
|
72
|
-
saveState
|
73
|
-
};
|
74
|
-
};
|
75
|
-
exports.useSingleFileAuthStateV2 = useSingleFileAuthStateV2;
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { proto } from '../../WAProto';
|
2
|
-
import type { AuthenticationCreds, SignalCreds, SocketConfig } from '../Types';
|
3
|
-
import { BinaryNode } from '../WABinary';
|
4
|
-
export declare const generateMobileNode: (config: SocketConfig) => proto.IClientPayload;
|
5
|
-
export declare const generateLoginNode: (userJid: string, config: SocketConfig) => proto.IClientPayload;
|
6
|
-
export declare const generateRegistrationNode: ({ registrationId, signedPreKey, signedIdentityKey }: SignalCreds, config: SocketConfig) => proto.ClientPayload;
|
7
|
-
export declare const configureSuccessfulPairing: (stanza: BinaryNode, { advSecretKey, signedIdentityKey, signalIdentities }: Pick<AuthenticationCreds, 'advSecretKey' | 'signedIdentityKey' | 'signalIdentities'>) => {
|
8
|
-
creds: Partial<AuthenticationCreds>;
|
9
|
-
reply: BinaryNode;
|
10
|
-
};
|
11
|
-
export declare const encodeSignedDeviceIdentity: (account: proto.IADVSignedDeviceIdentity, includeSignatureKey: boolean) => Uint8Array;
|
@@ -1,27 +0,0 @@
|
|
1
|
-
export declare const TAGS: {
|
2
|
-
LIST_EMPTY: number;
|
3
|
-
DICTIONARY_0: number;
|
4
|
-
DICTIONARY_1: number;
|
5
|
-
DICTIONARY_2: number;
|
6
|
-
DICTIONARY_3: number;
|
7
|
-
AD_JID: number;
|
8
|
-
LIST_8: number;
|
9
|
-
LIST_16: number;
|
10
|
-
JID_PAIR: number;
|
11
|
-
HEX_8: number;
|
12
|
-
BINARY_8: number;
|
13
|
-
BINARY_20: number;
|
14
|
-
BINARY_32: number;
|
15
|
-
NIBBLE_8: number;
|
16
|
-
PACKED_MAX: number;
|
17
|
-
SINGLE_BYTE_MAX: number;
|
18
|
-
STREAM_END: number;
|
19
|
-
};
|
20
|
-
export declare const DOUBLE_BYTE_TOKENS: string[][];
|
21
|
-
export declare const SINGLE_BYTE_TOKENS: (string | null)[];
|
22
|
-
export declare const TOKEN_MAP: {
|
23
|
-
[token: string]: {
|
24
|
-
dict?: number;
|
25
|
-
index: number;
|
26
|
-
};
|
27
|
-
};
|
package/lib/WABinary/decode.d.ts
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
import type { BinaryNode, BinaryNodeCodingOptions } from './types';
|
3
|
-
export declare const decompressingIfRequired: (buffer: Buffer) => Buffer;
|
4
|
-
export declare const decodeDecompressedBinaryNode: (buffer: Buffer, opts: Pick<BinaryNodeCodingOptions, 'DOUBLE_BYTE_TOKENS' | 'SINGLE_BYTE_TOKENS' | 'TAGS'>, indexRef?: {
|
5
|
-
index: number;
|
6
|
-
}) => BinaryNode;
|
7
|
-
export declare const decodeBinaryNode: (buff: Buffer) => BinaryNode;
|
package/lib/WABinary/encode.d.ts
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
import { proto } from '../../WAProto';
|
3
|
-
import { BinaryNode } from './types';
|
4
|
-
export declare const getBinaryNodeChildren: (node: BinaryNode | undefined, childTag: string) => BinaryNode[];
|
5
|
-
export declare const getAllBinaryNodeChildren: ({ content }: BinaryNode) => BinaryNode[];
|
6
|
-
export declare const getBinaryNodeChild: (node: BinaryNode | undefined, childTag: string) => BinaryNode | undefined;
|
7
|
-
export declare const getBinaryNodeChildBuffer: (node: BinaryNode | undefined, childTag: string) => Uint8Array | Buffer | undefined;
|
8
|
-
export declare const getBinaryNodeChildString: (node: BinaryNode | undefined, childTag: string) => string | undefined;
|
9
|
-
export declare const getBinaryNodeChildUInt: (node: BinaryNode, childTag: string, length: number) => number | undefined;
|
10
|
-
export declare const assertNodeErrorFree: (node: BinaryNode) => void;
|
11
|
-
export declare const reduceBinaryNodeToDictionary: (node: BinaryNode, tag: string) => {
|
12
|
-
[_: string]: string;
|
13
|
-
};
|
14
|
-
export declare const getBinaryNodeMessages: ({ content }: BinaryNode) => proto.WebMessageInfo[];
|
15
|
-
export declare function binaryNodeToString(node: BinaryNode | BinaryNode['content'], i?: number): any;
|
package/lib/WABinary/index.d.ts
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
export declare const S_WHATSAPP_NET = "@s.whatsapp.net";
|
2
|
-
export declare const OFFICIAL_BIZ_JID = "16505361212@c.us";
|
3
|
-
export declare const SERVER_JID = "server@c.us";
|
4
|
-
export declare const PSA_WID = "0@c.us";
|
5
|
-
export declare const STORIES_JID = "status@broadcast";
|
6
|
-
export type JidServer = 'c.us' | 'g.us' | 'broadcast' | 's.whatsapp.net' | 'call' | 'lid' | 'newsletter';
|
7
|
-
export type JidWithDevice = {
|
8
|
-
user: string;
|
9
|
-
device?: number;
|
10
|
-
};
|
11
|
-
export type FullJid = JidWithDevice & {
|
12
|
-
server: JidServer | string;
|
13
|
-
domainType?: number;
|
14
|
-
};
|
15
|
-
export declare const jidEncode: (user: string | number | null, server: JidServer, device?: number, agent?: number) => string;
|
16
|
-
export declare const jidDecode: (jid: string | undefined) => FullJid | undefined;
|
17
|
-
/** is the jid a user */
|
18
|
-
export declare const areJidsSameUser: (jid1: string | undefined, jid2: string | undefined) => boolean;
|
19
|
-
/** is the jid a user */
|
20
|
-
export declare const isJidUser: (jid: string | undefined) => boolean | undefined;
|
21
|
-
/** is the jid a group */
|
22
|
-
export declare const isLidUser: (jid: string | undefined) => boolean | undefined;
|
23
|
-
/** is the jid a broadcast */
|
24
|
-
export declare const isJidBroadcast: (jid: string | undefined) => boolean | undefined;
|
25
|
-
/** is the jid a group */
|
26
|
-
export declare const isJidGroup: (jid: string | undefined) => boolean | undefined;
|
27
|
-
/** is the jid the status broadcast */
|
28
|
-
export declare const isJidStatusBroadcast: (jid: string) => boolean;
|
29
|
-
/** is the jid the newsletter */
|
30
|
-
export declare const isJidNewsLetter: (jid: string | undefined) => boolean | undefined;
|
31
|
-
export declare const jidNormalizedUser: (jid: string | undefined) => string;
|
package/lib/WABinary/types.d.ts
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
import * as constants from './constants';
|
2
|
-
/**
|
3
|
-
* the binary node WA uses internally for communication
|
4
|
-
*
|
5
|
-
* this is manipulated soley as an object and it does not have any functions.
|
6
|
-
* This is done for easy serialization, to prevent running into issues with prototypes &
|
7
|
-
* to maintain functional code structure
|
8
|
-
* */
|
9
|
-
export type BinaryNode = {
|
10
|
-
tag: string;
|
11
|
-
attrs: {
|
12
|
-
[key: string]: string;
|
13
|
-
};
|
14
|
-
content?: BinaryNode[] | string | Uint8Array;
|
15
|
-
};
|
16
|
-
export type BinaryNodeAttributes = BinaryNode['attrs'];
|
17
|
-
export type BinaryNodeData = BinaryNode['content'];
|
18
|
-
export type BinaryNodeCodingOptions = typeof constants;
|
package/lib/WAM/BinaryInfo.d.ts
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
export declare class BinaryInfo {
|
3
|
-
protocolVersion: number;
|
4
|
-
sequence: number;
|
5
|
-
events: {
|
6
|
-
[x: string]: {
|
7
|
-
props: {
|
8
|
-
[x: string]: any;
|
9
|
-
};
|
10
|
-
globals: {
|
11
|
-
[x: string]: any;
|
12
|
-
};
|
13
|
-
};
|
14
|
-
}[];
|
15
|
-
buffer: Buffer[];
|
16
|
-
constructor(options?: Partial<BinaryInfo>);
|
17
|
-
}
|
package/lib/WAM/constants.d.ts
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
export declare const WEB_EVENTS: Event[];
|
2
|
-
export declare const WEB_GLOBALS: Global[];
|
3
|
-
export declare const FLAG_BYTE = 8, FLAG_GLOBAL = 0, FLAG_EVENT = 1, FLAG_FIELD = 2, FLAG_EXTENDED = 4;
|
4
|
-
export type Event = {
|
5
|
-
name: string;
|
6
|
-
id: number;
|
7
|
-
props: {
|
8
|
-
[key: string]: [number, string | {
|
9
|
-
[key: string]: number;
|
10
|
-
}];
|
11
|
-
};
|
12
|
-
weight: number;
|
13
|
-
wamChannel: string;
|
14
|
-
privateStatsIdInt: number;
|
15
|
-
};
|
16
|
-
export type Global = {
|
17
|
-
name: string;
|
18
|
-
id: number;
|
19
|
-
type: string | {
|
20
|
-
[key: string]: number;
|
21
|
-
};
|
22
|
-
validator?: string;
|
23
|
-
channels: string[];
|
24
|
-
};
|
25
|
-
type EventByName<T extends Event['name']> = Extract<Event, {
|
26
|
-
name: T;
|
27
|
-
}>;
|
28
|
-
export type EventInputType = {
|
29
|
-
[key in Event['name']]: {
|
30
|
-
props: {
|
31
|
-
[k in keyof EventByName<key>['props']]: any;
|
32
|
-
};
|
33
|
-
globals: {
|
34
|
-
[x: string]: any;
|
35
|
-
};
|
36
|
-
};
|
37
|
-
} & {};
|
38
|
-
export {};
|
package/lib/WAM/encode.d.ts
DELETED
package/lib/WAM/index.d.ts
DELETED
package/lib/index.d.ts
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
import makeWASocket from './Socket';
|
2
|
-
export * from '../WAProto';
|
3
|
-
export * from './Utils';
|
4
|
-
export * from './Types';
|
5
|
-
export * from './Store';
|
6
|
-
export * from './Defaults';
|
7
|
-
export * from './WABinary';
|
8
|
-
export * from './WAM';
|
9
|
-
export type WASocket = ReturnType<typeof makeWASocket>;
|
10
|
-
export { makeWASocket };
|
11
|
-
export default makeWASocket;
|