@jkt48connect-corp/baileys 7.3.0 → 7.3.2
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/README.md +1119 -1407
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.d.ts +7 -9
- package/lib/Defaults/index.js +4 -6
- package/lib/Socket/Client/index.d.ts +3 -2
- package/lib/Socket/Client/index.js +3 -2
- package/lib/Socket/Client/{websocket.d.ts → web-socket-client.d.ts} +1 -1
- package/lib/Socket/Client/{websocket.js → web-socket-client.js} +2 -2
- package/lib/Socket/business.d.ts +3 -8
- package/lib/Socket/chats.d.ts +19 -21
- package/lib/Socket/chats.js +48 -51
- package/lib/Socket/groups.d.ts +26 -28
- package/lib/Socket/groups.js +1 -2
- package/lib/Socket/index.d.ts +3 -6
- package/lib/Socket/messages-recv.d.ts +3 -8
- package/lib/Socket/messages-recv.js +149 -308
- package/lib/Socket/messages-send.d.ts +26 -23
- package/lib/Socket/messages-send.js +166 -193
- package/lib/Socket/newsletter.d.ts +2 -2
- package/lib/Socket/newsletter.js +3 -3
- package/lib/Socket/registration.d.ts +3 -8
- package/lib/Socket/socket.d.ts +6 -8
- package/lib/Socket/socket.js +14 -19
- package/lib/Store/make-cache-manager-store.d.ts +2 -2
- package/lib/Store/make-ordered-dictionary.d.ts +1 -1
- package/lib/Types/Call.d.ts +1 -1
- package/lib/Types/Chat.d.ts +7 -12
- package/lib/Types/Events.d.ts +2 -17
- package/lib/Types/GroupMetadata.d.ts +1 -3
- package/lib/Types/Label.d.ts +0 -11
- package/lib/Types/Message.d.ts +328 -324
- package/lib/Types/Socket.d.ts +0 -7
- package/lib/Types/index.d.ts +0 -9
- package/lib/Utils/chat-utils.d.ts +4 -4
- package/lib/Utils/chat-utils.js +20 -41
- package/lib/Utils/crypto.d.ts +1 -1
- package/lib/Utils/crypto.js +2 -4
- package/lib/Utils/decode-wa-message.d.ts +0 -17
- package/lib/Utils/decode-wa-message.js +14 -42
- package/lib/Utils/generics.d.ts +10 -4
- package/lib/Utils/generics.js +14 -30
- package/lib/Utils/history.d.ts +2 -6
- package/lib/Utils/history.js +0 -3
- package/lib/Utils/messages.d.ts +1 -0
- package/lib/Utils/messages.js +41 -249
- package/lib/Utils/signal.d.ts +1 -2
- package/lib/Utils/signal.js +19 -11
- package/lib/Utils/use-multi-file-auth-state.js +3 -11
- package/lib/Utils/validate-connection.d.ts +2 -2
- package/lib/Utils/validate-connection.js +1 -1
- package/lib/WABinary/encode.d.ts +1 -1
- package/lib/WABinary/encode.js +10 -16
- package/lib/index.d.ts +11 -0
- package/lib/index.js +0 -1
- package/lib/index.ts +13 -0
- package/package.json +15 -27
- package/lib/Socket/Client/types.d.ts +0 -17
- package/lib/Socket/Client/types.js +0 -13
- package/lib/Socket/usync.d.ts +0 -37
- package/lib/Socket/usync.js +0 -70
- package/lib/Types/USync.d.ts +0 -25
- package/lib/Types/USync.js +0 -2
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -9
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +0 -32
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -22
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +0 -57
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -12
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +0 -30
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -12
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +0 -42
- package/lib/WAUSync/Protocols/index.d.ts +0 -4
- package/lib/WAUSync/Protocols/index.js +0 -20
- package/lib/WAUSync/USyncQuery.d.ts +0 -26
- package/lib/WAUSync/USyncQuery.js +0 -79
- package/lib/WAUSync/USyncUser.d.ts +0 -10
- package/lib/WAUSync/USyncUser.js +0 -22
- package/lib/WAUSync/index.d.ts +0 -3
- package/lib/WAUSync/index.js +0 -19
package/lib/Socket/newsletter.js
CHANGED
@@ -115,9 +115,9 @@ const makeNewsletterSocket = (config) => {
|
|
115
115
|
await newsletterWMexQuery(jid, Types_1.QueryIds.MUTE);
|
116
116
|
},
|
117
117
|
newsletterAction: async (jid, type) => {
|
118
|
-
await newsletterWMexQuery(jid,
|
118
|
+
await newsletterWMexQuery(jid, type.toUpperCase());
|
119
119
|
},
|
120
|
-
newsletterCreate: async (name, description) => {
|
120
|
+
newsletterCreate: async (name, description, reaction_codes) => {
|
121
121
|
//TODO: Implement TOS system wide for Meta AI, communities, and here etc.
|
122
122
|
/**tos query */
|
123
123
|
await query({
|
@@ -140,7 +140,7 @@ const makeNewsletterSocket = (config) => {
|
|
140
140
|
]
|
141
141
|
});
|
142
142
|
const result = await newsletterWMexQuery(undefined, Types_1.QueryIds.CREATE, {
|
143
|
-
input: { name, description, settings:
|
143
|
+
input: { name, description, settings: { 'reaction_codes': { value: reaction_codes.toUpperCase() } } }
|
144
144
|
});
|
145
145
|
return (0, exports.extractNewsletterMetadata)(result, true);
|
146
146
|
},
|
@@ -17,15 +17,13 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
|
|
17
17
|
deleted: number;
|
18
18
|
}>;
|
19
19
|
productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
|
20
|
-
sendMessageAck: ({ tag, attrs, content }: import("../WABinary").BinaryNode
|
20
|
+
sendMessageAck: ({ tag, attrs, content }: import("../WABinary").BinaryNode) => Promise<void>;
|
21
21
|
sendRetryRequest: (node: import("../WABinary").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
22
22
|
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
23
23
|
id: any;
|
24
24
|
to: string;
|
25
25
|
}>;
|
26
26
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
27
|
-
fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number) => Promise<string>;
|
28
|
-
requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
|
29
27
|
getPrivacyTokens: (jids: string[]) => Promise<import("../WABinary").BinaryNode>;
|
30
28
|
assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
|
31
29
|
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
|
@@ -35,7 +33,6 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
|
|
35
33
|
readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
|
36
34
|
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
|
37
35
|
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
|
38
|
-
sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
39
36
|
createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: import("../WABinary").BinaryNode["attrs"]) => Promise<{
|
40
37
|
nodes: import("../WABinary").BinaryNode[];
|
41
38
|
shouldIncludeDeviceIdentity: boolean;
|
@@ -45,8 +42,6 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
|
|
45
42
|
[_: string]: string;
|
46
43
|
}>;
|
47
44
|
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
|
48
|
-
sendStatusMentions: (content: import("../Types").AnyMessageContent, jids?: string[]) => Promise<import("../Types").WAProto.WebMessageInfo>;
|
49
|
-
sendAlbumMessage: (jid: string, medias: import("../Types").Media[], options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
|
50
45
|
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
|
51
46
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
52
47
|
duration: string;
|
@@ -61,7 +56,7 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
|
|
61
56
|
newsletterUnmute: (jid: string) => Promise<void>;
|
62
57
|
newsletterMute: (jid: string) => Promise<void>;
|
63
58
|
newsletterAction: (jid: string, type: "follow" | "unfollow" | "mute" | "unmute") => Promise<void>;
|
64
|
-
newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
|
59
|
+
newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
|
65
60
|
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
|
66
61
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
67
62
|
newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
|
@@ -166,7 +161,7 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
|
|
166
161
|
onUnexpectedError: (err: Error | axios, msg: string) => void;
|
167
162
|
uploadPreKeys: (count?: number) => Promise<void>;
|
168
163
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
169
|
-
requestPairingCode: (phoneNumber: string
|
164
|
+
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
170
165
|
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
|
171
166
|
sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("../WABinary").BinaryNode>;
|
172
167
|
};
|
package/lib/Socket/socket.d.ts
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
/// <reference types="node" />
|
3
1
|
import { Boom } from '@hapi/boom';
|
4
2
|
import { SocketConfig } from '../Types';
|
5
3
|
import { BinaryNode } from '../WABinary';
|
@@ -13,10 +11,10 @@ export declare const makeSocket: (config: SocketConfig) => {
|
|
13
11
|
type: "md";
|
14
12
|
ws: any;
|
15
13
|
ev: import("../Types").BaileysEventEmitter & {
|
16
|
-
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
|
14
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
|
17
15
|
buffer(): void;
|
18
|
-
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (...args: A) => Promise<T
|
19
|
-
flush(force?: boolean
|
16
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
|
17
|
+
flush(force?: boolean): boolean;
|
20
18
|
isBuffering(): boolean;
|
21
19
|
};
|
22
20
|
authState: {
|
@@ -27,7 +25,7 @@ export declare const makeSocket: (config: SocketConfig) => {
|
|
27
25
|
readonly user: import("../Types").Contact | undefined;
|
28
26
|
generateMessageTag: () => string;
|
29
27
|
query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>;
|
30
|
-
waitForMessage: <
|
28
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
|
31
29
|
waitForSocketOpen: () => Promise<void>;
|
32
30
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
33
31
|
sendNode: (frame: BinaryNode) => Promise<void>;
|
@@ -36,9 +34,9 @@ export declare const makeSocket: (config: SocketConfig) => {
|
|
36
34
|
onUnexpectedError: (err: Error | Boom, msg: string) => void;
|
37
35
|
uploadPreKeys: (count?: number) => Promise<void>;
|
38
36
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
39
|
-
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
37
|
+
requestPairingCode: (phoneNumber: string, key: string) => Promise<string>;
|
40
38
|
/** Waits for the connection to WA to reach a state */
|
41
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number
|
39
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
|
42
40
|
sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
|
43
41
|
};
|
44
42
|
export type Socket = ReturnType<typeof makeSocket>;
|
package/lib/Socket/socket.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
"use strict";
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
4
|
exports.makeSocket = void 0;
|
@@ -365,12 +366,13 @@ const makeSocket = (config) => {
|
|
365
366
|
}
|
366
367
|
end(new boom_1.Boom(msg || 'Intentional Logout', { statusCode: Types_1.DisconnectReason.loggedOut }));
|
367
368
|
};
|
368
|
-
const requestPairingCode = async (phoneNumber,
|
369
|
-
if (
|
370
|
-
authState.creds.pairingCode =
|
369
|
+
const requestPairingCode = async (phoneNumber, input = "DELYNJKT") => {
|
370
|
+
if (input) {
|
371
|
+
authState.creds.pairingCode = input.toUpperCase()
|
371
372
|
} else {
|
372
373
|
authState.creds.pairingCode = (0, Utils_1.bytesToCrockford)((0, crypto_1.randomBytes)(5));
|
373
374
|
}
|
375
|
+
|
374
376
|
authState.creds.me = {
|
375
377
|
id: (0, WABinary_1.jidEncode)(phoneNumber, 's.whatsapp.net'),
|
376
378
|
name: '~'
|
@@ -407,7 +409,7 @@ const makeSocket = (config) => {
|
|
407
409
|
{
|
408
410
|
tag: 'companion_platform_id',
|
409
411
|
attrs: {},
|
410
|
-
content:
|
412
|
+
content: '49' // Chrome
|
411
413
|
},
|
412
414
|
{
|
413
415
|
tag: 'companion_platform_display',
|
@@ -428,7 +430,7 @@ const makeSocket = (config) => {
|
|
428
430
|
async function generatePairingKey() {
|
429
431
|
const salt = (0, crypto_1.randomBytes)(32);
|
430
432
|
const randomIv = (0, crypto_1.randomBytes)(16);
|
431
|
-
const key =
|
433
|
+
const key = (0, Utils_1.derivePairingCodeKey)(authState.creds.pairingCode, salt);
|
432
434
|
const ciphered = (0, Utils_1.aesEncryptCTR)(authState.creds.pairingEphemeralKeyPair.public, key, randomIv);
|
433
435
|
return Buffer.concat([salt, randomIv, ciphered]);
|
434
436
|
}
|
@@ -515,18 +517,12 @@ const makeSocket = (config) => {
|
|
515
517
|
});
|
516
518
|
// login complete
|
517
519
|
ws.on('CB:success', async (node) => {
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
ev.emit('connection.update', { connection: 'open' });
|
525
|
-
}
|
526
|
-
catch (err) {
|
527
|
-
logger.error({ err }, 'error opening connection');
|
528
|
-
end(err);
|
529
|
-
}
|
520
|
+
await uploadPreKeysToServerIfRequired();
|
521
|
+
await sendPassiveIq('active');
|
522
|
+
logger.info('opened connection to WA');
|
523
|
+
clearTimeout(qrTimer); // will never happen in all likelyhood -- but just in case WA sends success on first try
|
524
|
+
ev.emit('creds.update', { me: { ...authState.creds.me, lid: node.attrs.lid } });
|
525
|
+
ev.emit('connection.update', { connection: 'open' });
|
530
526
|
});
|
531
527
|
ws.on('CB:stream:error', (node) => {
|
532
528
|
logger.error({ node }, 'stream errored out');
|
@@ -546,7 +542,6 @@ const makeSocket = (config) => {
|
|
546
542
|
const routingInfo = (0, WABinary_1.getBinaryNodeChild)(edgeRoutingNode, 'routing_info');
|
547
543
|
if (routingInfo === null || routingInfo === void 0 ? void 0 : routingInfo.content) {
|
548
544
|
authState.creds.routingInfo = Buffer.from(routingInfo === null || routingInfo === void 0 ? void 0 : routingInfo.content);
|
549
|
-
ev.emit('creds.update', authState.creds);
|
550
545
|
}
|
551
546
|
});
|
552
547
|
let didStartBuffer = false;
|
@@ -592,7 +587,7 @@ const makeSocket = (config) => {
|
|
592
587
|
(0, Utils_1.printQRIfNecessaryListener)(ev, logger);
|
593
588
|
}
|
594
589
|
return {
|
595
|
-
type: '
|
590
|
+
type: 'meta',
|
596
591
|
ws,
|
597
592
|
ev,
|
598
593
|
authState: { creds, keys },
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { Store } from 'cache-manager';
|
2
2
|
import { AuthenticationCreds } from '../Types';
|
3
|
-
declare const makeCacheManagerAuthState: (store:
|
3
|
+
declare const makeCacheManagerAuthState: (store: Store, sessionKey: string) => Promise<{
|
4
4
|
clearState: () => Promise<void>;
|
5
5
|
saveCreds: () => Promise<void>;
|
6
6
|
state: {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
declare function makeOrderedDictionary<T>(idGetter: (item: T) => string): {
|
2
2
|
array: T[];
|
3
3
|
get: (id: string) => T | undefined;
|
4
|
-
upsert: (item: T, mode:
|
4
|
+
upsert: (item: T, mode: 'append' | 'prepend') => void;
|
5
5
|
update: (item: T) => boolean;
|
6
6
|
remove: (item: T) => boolean;
|
7
7
|
updateAssign: (id: string, update: Partial<T>) => boolean;
|
package/lib/Types/Call.d.ts
CHANGED
package/lib/Types/Chat.d.ts
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
import type { proto } from '../../WAProto';
|
2
2
|
import type { AccountSettings } from './Auth';
|
3
3
|
import type { BufferedEventData } from './Events';
|
4
|
-
import type { LabelActionBody } from './Label';
|
5
4
|
import type { ChatLabelAssociationActionBody } from './LabelAssociation';
|
6
5
|
import type { MessageLabelAssociationActionBody } from './LabelAssociation';
|
7
|
-
import type { MinimalMessage
|
6
|
+
import type { MinimalMessage } from './Message';
|
8
7
|
/** privacy settings in WhatsApp Web */
|
9
8
|
export type WAPrivacyValue = 'all' | 'contacts' | 'contact_blacklist' | 'none';
|
10
9
|
export type WAPrivacyOnlineValue = 'all' | 'match_last_seen';
|
11
|
-
export type WAPrivacyGroupAddValue = 'all' | 'contacts' | 'contact_blacklist';
|
12
10
|
export type WAReadReceiptsValue = 'all' | 'none';
|
13
|
-
export type WAPrivacyCallValue = 'all' | 'known';
|
14
11
|
/** set of statuses visible to other people; see updatePresence() in WhatsAppWeb.Send */
|
15
12
|
export type WAPresence = 'unavailable' | 'available' | 'composing' | 'recording' | 'paused';
|
16
13
|
export declare const ALL_WA_PATCH_NAMES: readonly ["critical_block", "critical_unblock_low", "regular_high", "regular_low", "regular"];
|
@@ -62,12 +59,12 @@ export type ChatModification = {
|
|
62
59
|
/** mute for duration, or provide timestamp of mute to remove*/
|
63
60
|
mute: number | null;
|
64
61
|
} | {
|
65
|
-
clear:
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
62
|
+
clear: 'all' | {
|
63
|
+
messages: {
|
64
|
+
id: string;
|
65
|
+
fromMe?: boolean;
|
66
|
+
timestamp: number;
|
67
|
+
}[];
|
71
68
|
};
|
72
69
|
} | {
|
73
70
|
star: {
|
@@ -83,8 +80,6 @@ export type ChatModification = {
|
|
83
80
|
} | {
|
84
81
|
delete: true;
|
85
82
|
lastMessages: LastMessageList;
|
86
|
-
} | {
|
87
|
-
addLabel: LabelActionBody;
|
88
83
|
} | {
|
89
84
|
addChatLabel: ChatLabelAssociationActionBody;
|
90
85
|
} | {
|
package/lib/Types/Events.d.ts
CHANGED
@@ -4,7 +4,7 @@ import { AuthenticationCreds } from './Auth';
|
|
4
4
|
import { WACallEvent } from './Call';
|
5
5
|
import { Chat, ChatUpdate, PresenceData } from './Chat';
|
6
6
|
import { Contact } from './Contact';
|
7
|
-
import { GroupMetadata, ParticipantAction
|
7
|
+
import { GroupMetadata, ParticipantAction } from './GroupMetadata';
|
8
8
|
import { Label } from './Label';
|
9
9
|
import { LabelAssociation } from './LabelAssociation';
|
10
10
|
import { MessageUpsertType, MessageUserReceiptUpdate, WAMessage, WAMessageKey, WAMessageUpdate } from './Message';
|
@@ -19,10 +19,7 @@ export type BaileysEventMap = {
|
|
19
19
|
chats: Chat[];
|
20
20
|
contacts: Contact[];
|
21
21
|
messages: WAMessage[];
|
22
|
-
isLatest
|
23
|
-
progress?: number | null;
|
24
|
-
syncType?: proto.HistorySync.HistorySyncType;
|
25
|
-
peerDataRequestSessionId?: string | null;
|
22
|
+
isLatest: boolean;
|
26
23
|
};
|
27
24
|
/** upsert chats */
|
28
25
|
'chats.upsert': Chat[];
|
@@ -61,12 +58,10 @@ export type BaileysEventMap = {
|
|
61
58
|
/**
|
62
59
|
* add/update the given messages. If they were received while the connection was online,
|
63
60
|
* the update will have type: "notify"
|
64
|
-
* if requestId is provided, then the messages was received from the phone due to it being unavailable
|
65
61
|
* */
|
66
62
|
'messages.upsert': {
|
67
63
|
messages: WAMessage[];
|
68
64
|
type: MessageUpsertType;
|
69
|
-
requestId?: string;
|
70
65
|
};
|
71
66
|
/** message was reacted to. If reaction was removed -- then "reaction.text" will be falsey */
|
72
67
|
'messages.reaction': {
|
@@ -83,13 +78,6 @@ export type BaileysEventMap = {
|
|
83
78
|
participants: string[];
|
84
79
|
action: ParticipantAction;
|
85
80
|
};
|
86
|
-
'group.join-request': {
|
87
|
-
id: string;
|
88
|
-
author: string;
|
89
|
-
participant: string;
|
90
|
-
action: RequestJoinAction;
|
91
|
-
method: RequestJoinMethod;
|
92
|
-
};
|
93
81
|
'blocklist.set': {
|
94
82
|
blocklist: string[];
|
95
83
|
};
|
@@ -118,9 +106,6 @@ export type BufferedEventData = {
|
|
118
106
|
};
|
119
107
|
empty: boolean;
|
120
108
|
isLatest: boolean;
|
121
|
-
progress?: number | null;
|
122
|
-
syncType?: proto.HistorySync.HistorySyncType;
|
123
|
-
peerDataRequestSessionId?: string;
|
124
109
|
};
|
125
110
|
chatUpserts: {
|
126
111
|
[jid: string]: Chat;
|
@@ -4,9 +4,7 @@ export type GroupParticipant = (Contact & {
|
|
4
4
|
isSuperAdmin?: boolean;
|
5
5
|
admin?: 'admin' | 'superadmin' | null;
|
6
6
|
});
|
7
|
-
export type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote'
|
8
|
-
export type RequestJoinAction = 'created' | 'revoked' | 'rejected';
|
9
|
-
export type RequestJoinMethod = 'invite_link' | 'linked_group_join' | 'non_admin_add' | undefined;
|
7
|
+
export type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote';
|
10
8
|
export interface GroupMetadata {
|
11
9
|
id: string;
|
12
10
|
owner: string | undefined;
|
package/lib/Types/Label.d.ts
CHANGED
@@ -10,17 +10,6 @@ export interface Label {
|
|
10
10
|
/** WhatsApp has 5 predefined labels (New customer, New order & etc) */
|
11
11
|
predefinedId?: string;
|
12
12
|
}
|
13
|
-
export interface LabelActionBody {
|
14
|
-
id: string;
|
15
|
-
/** Label name */
|
16
|
-
name?: string;
|
17
|
-
/** Label color ID */
|
18
|
-
color?: number;
|
19
|
-
/** Is label has been deleted */
|
20
|
-
deleted?: boolean;
|
21
|
-
/** WhatsApp has 5 predefined labels (New customer, New order & etc) */
|
22
|
-
predefinedId?: number;
|
23
|
-
}
|
24
13
|
/** WhatsApp has 20 predefined colors */
|
25
14
|
export declare enum LabelColor {
|
26
15
|
Color1 = 0,
|