@alannxd/baileys 6.0.5 → 6.0.6
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/WAProto/fix-import.js +29 -0
- package/WAProto/index.js +160 -201
- package/engine-requirements.js +1 -1
- package/lib/Defaults/baileys-version.json +3 -0
- package/lib/Defaults/index.d.ts +15 -37
- package/lib/Defaults/index.js +136 -119
- package/lib/Defaults/phonenumber-mcc.json +223 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +0 -1
- package/lib/Signal/Group/ciphertext-message.js +5 -2
- package/lib/Signal/Group/group-session-builder.d.ts +3 -4
- package/lib/Signal/Group/group-session-builder.js +41 -7
- package/lib/Signal/Group/group_cipher.d.ts +4 -4
- package/lib/Signal/Group/group_cipher.js +51 -37
- package/lib/Signal/Group/index.d.ts +11 -12
- package/lib/Signal/Group/index.js +57 -12
- package/lib/Signal/Group/keyhelper.d.ts +1 -2
- package/lib/Signal/Group/keyhelper.js +44 -7
- package/lib/Signal/Group/queue-job.d.ts +1 -0
- package/lib/Signal/Group/queue-job.js +57 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +2 -3
- package/lib/Signal/Group/sender-chain-key.js +15 -7
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +1 -2
- package/lib/Signal/Group/sender-key-distribution-message.js +11 -8
- package/lib/Signal/Group/sender-key-message.d.ts +1 -2
- package/lib/Signal/Group/sender-key-message.js +12 -9
- package/lib/Signal/Group/sender-key-name.d.ts +0 -1
- package/lib/Signal/Group/sender-key-name.js +5 -2
- package/lib/Signal/Group/sender-key-record.d.ts +2 -3
- package/lib/Signal/Group/sender-key-record.js +21 -9
- package/lib/Signal/Group/sender-key-state.d.ts +6 -7
- package/lib/Signal/Group/sender-key-state.js +42 -27
- package/lib/Signal/Group/sender-message-key.d.ts +0 -1
- package/lib/Signal/Group/sender-message-key.js +7 -4
- package/lib/Signal/libsignal.d.ts +3 -5
- package/lib/Signal/libsignal.js +90 -347
- package/lib/Socket/Client/{types.d.ts → abstract-socket-client.d.ts} +5 -4
- package/lib/Socket/Client/abstract-socket-client.js +13 -0
- package/lib/Socket/Client/index.d.ts +3 -3
- package/lib/Socket/Client/index.js +19 -3
- package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
- package/lib/Socket/Client/mobile-socket-client.js +65 -0
- package/lib/Socket/Client/{websocket.d.ts → web-socket-client.d.ts} +2 -3
- package/lib/Socket/Client/web-socket-client.js +62 -0
- package/lib/Socket/business.d.ts +108 -154
- package/lib/Socket/business.js +43 -162
- package/lib/Socket/chats.d.ts +239 -96
- package/lib/Socket/chats.js +427 -627
- package/lib/Socket/communities.d.ts +146 -239
- package/lib/Socket/communities.js +80 -90
- package/lib/Socket/groups.d.ts +57 -104
- package/lib/Socket/groups.js +161 -154
- package/lib/Socket/index.d.ts +115 -202
- package/lib/Socket/index.js +10 -11
- package/lib/Socket/luxu.d.ts +266 -22
- package/lib/Socket/luxu.js +465 -422
- package/lib/Socket/messages-recv.d.ts +84 -136
- package/lib/Socket/messages-recv.js +615 -1421
- package/lib/Socket/messages-send.d.ts +126 -142
- package/lib/Socket/messages-send.js +671 -878
- package/lib/Socket/newsletter.d.ts +85 -121
- package/lib/Socket/newsletter.js +272 -147
- package/lib/Socket/registration.d.ts +267 -0
- package/lib/Socket/registration.js +166 -0
- package/lib/Socket/socket.d.ts +19 -34
- package/lib/Socket/socket.js +313 -544
- package/lib/Socket/usync.d.ts +36 -0
- package/lib/Socket/usync.js +70 -0
- package/lib/Store/index.d.ts +3 -10
- package/lib/Store/index.js +10 -10
- package/lib/Store/make-cache-manager-store.d.ts +11 -17
- package/lib/Store/make-cache-manager-store.js +41 -43
- package/lib/Store/make-in-memory-store.d.ts +118 -39
- package/lib/Store/make-in-memory-store.js +341 -112
- package/lib/Store/make-ordered-dictionary.d.ts +10 -11
- package/lib/Store/make-ordered-dictionary.js +20 -14
- package/lib/Store/object-repository.d.ts +9 -10
- package/lib/Store/object-repository.js +6 -11
- package/lib/Types/Auth.d.ts +12 -19
- package/lib/Types/Auth.js +2 -2
- package/lib/Types/Call.d.ts +1 -3
- package/lib/Types/Call.js +2 -2
- package/lib/Types/Chat.d.ts +13 -35
- package/lib/Types/Chat.js +4 -8
- package/lib/Types/Contact.d.ts +1 -8
- package/lib/Types/Contact.js +2 -2
- package/lib/Types/Events.d.ts +17 -116
- package/lib/Types/Events.js +2 -2
- package/lib/Types/GroupMetadata.d.ts +5 -21
- package/lib/Types/GroupMetadata.js +2 -2
- package/lib/Types/Label.d.ts +0 -12
- package/lib/Types/Label.js +5 -3
- package/lib/Types/LabelAssociation.d.ts +0 -1
- package/lib/Types/LabelAssociation.js +5 -3
- package/lib/Types/Message.d.ts +58 -105
- package/lib/Types/Message.js +9 -11
- package/lib/Types/Newsletter.d.ts +103 -0
- package/lib/Types/Newsletter.js +38 -0
- package/lib/Types/Product.d.ts +1 -2
- package/lib/Types/Product.js +2 -2
- package/lib/Types/Signal.d.ts +2 -32
- package/lib/Types/Signal.js +2 -2
- package/lib/Types/Socket.d.ts +25 -50
- package/lib/Types/Socket.js +2 -3
- package/lib/Types/State.d.ts +2 -72
- package/lib/Types/State.js +2 -56
- package/lib/Types/USync.d.ts +2 -3
- package/lib/Types/USync.js +2 -2
- package/lib/Types/index.d.ts +14 -22
- package/lib/Types/index.js +31 -15
- package/lib/Utils/auth-utils.d.ts +6 -12
- package/lib/Utils/auth-utils.js +143 -239
- package/lib/Utils/baileys-event-stream.d.ts +16 -0
- package/lib/Utils/baileys-event-stream.js +63 -0
- package/lib/Utils/business.d.ts +2 -3
- package/lib/Utils/business.js +69 -66
- package/lib/Utils/chat-utils.d.ts +23 -52
- package/lib/Utils/chat-utils.js +253 -396
- package/lib/Utils/crypto.d.ts +22 -18
- package/lib/Utils/crypto.js +90 -57
- package/lib/Utils/decode-wa-message.d.ts +8 -55
- package/lib/Utils/decode-wa-message.js +84 -203
- package/lib/Utils/event-buffer.d.ts +8 -9
- package/lib/Utils/event-buffer.js +77 -185
- package/lib/Utils/generics.d.ts +29 -28
- package/lib/Utils/generics.js +210 -180
- package/lib/Utils/history.d.ts +9 -18
- package/lib/Utils/history.js +55 -93
- package/lib/Utils/index.d.ts +17 -22
- package/lib/Utils/index.js +33 -22
- package/lib/Utils/link-preview.d.ts +5 -5
- package/lib/Utils/link-preview.js +24 -16
- package/lib/Utils/logger.d.ts +3 -11
- package/lib/Utils/logger.js +7 -3
- package/lib/Utils/lt-hash.d.ts +12 -8
- package/lib/Utils/lt-hash.js +46 -3
- package/lib/Utils/make-mutex.d.ts +2 -4
- package/lib/Utils/make-mutex.js +34 -24
- package/lib/Utils/messages-media.d.ts +44 -61
- package/lib/Utils/messages-media.js +482 -451
- package/lib/Utils/messages.d.ts +18 -32
- package/lib/Utils/messages.js +369 -458
- package/lib/Utils/noise-handler.d.ts +14 -13
- package/lib/Utils/noise-handler.js +99 -145
- package/lib/Utils/process-message.d.ts +12 -31
- package/lib/Utils/process-message.js +150 -459
- package/lib/Utils/signal.d.ts +5 -20
- package/lib/Utils/signal.js +72 -120
- package/lib/Utils/use-multi-file-auth-state.d.ts +2 -2
- package/lib/Utils/use-multi-file-auth-state.js +27 -29
- package/lib/Utils/validate-connection.d.ts +7 -7
- package/lib/Utils/validate-connection.js +99 -73
- package/lib/WABinary/constants.d.ts +27 -25
- package/lib/WABinary/constants.js +20 -1281
- package/lib/WABinary/decode.d.ts +5 -5
- package/lib/WABinary/decode.js +42 -52
- package/lib/WABinary/encode.d.ts +3 -3
- package/lib/WABinary/encode.js +155 -110
- package/lib/WABinary/generic-utils.d.ts +7 -8
- package/lib/WABinary/generic-utils.js +49 -48
- package/lib/WABinary/index.d.ts +5 -6
- package/lib/WABinary/index.js +21 -6
- package/lib/WABinary/jid-utils.d.ts +8 -25
- package/lib/WABinary/jid-utils.js +40 -74
- package/lib/WABinary/types.d.ts +1 -2
- package/lib/WABinary/types.js +2 -2
- package/lib/WAM/BinaryInfo.d.ts +11 -3
- package/lib/WAM/BinaryInfo.js +5 -2
- package/lib/WAM/constants.d.ts +3 -5
- package/lib/WAM/constants.js +11958 -19461
- package/lib/WAM/encode.d.ts +3 -3
- package/lib/WAM/encode.js +22 -17
- package/lib/WAM/index.d.ts +3 -4
- package/lib/WAM/index.js +19 -4
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +3 -4
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +13 -33
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +2 -3
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +14 -11
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +2 -3
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +12 -9
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +2 -3
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +13 -9
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +3 -4
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +22 -20
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +3 -5
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +8 -13
- package/lib/WAUSync/Protocols/index.d.ts +4 -6
- package/lib/WAUSync/Protocols/index.js +20 -6
- package/lib/WAUSync/USyncQuery.d.ts +4 -6
- package/lib/WAUSync/USyncQuery.js +35 -44
- package/lib/WAUSync/USyncUser.d.ts +5 -10
- package/lib/WAUSync/USyncUser.js +5 -10
- package/lib/WAUSync/index.js +19 -4
- package/lib/index.d.ts +9 -10
- package/lib/index.js +34 -12
- package/package.json +50 -83
- package/WAProto/GenerateStatics.sh +0 -3
- package/WAProto/WAProto.proto +0 -5479
- package/WAProto/fix-imports.js +0 -85
- package/WAProto/index.d.ts +0 -14017
- package/lib/Signal/lid-mapping.d.ts +0 -23
- package/lib/Signal/lid-mapping.js +0 -277
- package/lib/Socket/Client/types.js +0 -11
- package/lib/Socket/Client/websocket.js +0 -54
- package/lib/Socket/mex.d.ts +0 -3
- package/lib/Socket/mex.js +0 -42
- package/lib/Store/keyed-db.d.ts +0 -22
- package/lib/Store/keyed-db.js +0 -108
- package/lib/Types/Bussines.d.ts +0 -25
- package/lib/Types/Bussines.js +0 -2
- package/lib/Types/Mex.d.ts +0 -141
- package/lib/Types/Mex.js +0 -37
- package/lib/Utils/browser-utils.d.ts +0 -4
- package/lib/Utils/browser-utils.js +0 -28
- package/lib/Utils/companion-reg-client-utils.d.ts +0 -17
- package/lib/Utils/companion-reg-client-utils.js +0 -35
- package/lib/Utils/identity-change-handler.d.ts +0 -44
- package/lib/Utils/identity-change-handler.js +0 -50
- package/lib/Utils/message-retry-manager.d.ts +0 -115
- package/lib/Utils/message-retry-manager.js +0 -265
- package/lib/Utils/offline-node-processor.d.ts +0 -17
- package/lib/Utils/offline-node-processor.js +0 -40
- package/lib/Utils/pre-key-manager.d.ts +0 -28
- package/lib/Utils/pre-key-manager.js +0 -106
- package/lib/Utils/reporting-utils.d.ts +0 -11
- package/lib/Utils/reporting-utils.js +0 -258
- package/lib/Utils/stanza-ack.d.ts +0 -11
- package/lib/Utils/stanza-ack.js +0 -38
- package/lib/Utils/sync-action-utils.d.ts +0 -19
- package/lib/Utils/sync-action-utils.js +0 -49
- package/lib/Utils/tc-token-utils.d.ts +0 -37
- package/lib/Utils/tc-token-utils.js +0 -163
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +0 -10
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +0 -25
- package/lib/WAUSync/index.d.ts +0 -4
package/lib/Types/Mex.d.ts
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
export declare enum XWAPaths {
|
|
2
|
-
xwa2_newsletter_create = "xwa2_newsletter_create",
|
|
3
|
-
xwa2_newsletter_subscribers = "xwa2_newsletter_subscribers",
|
|
4
|
-
xwa2_newsletter_view = "xwa2_newsletter_view",
|
|
5
|
-
xwa2_newsletter_metadata = "xwa2_newsletter",
|
|
6
|
-
xwa2_newsletter_admin_count = "xwa2_newsletter_admin",
|
|
7
|
-
xwa2_newsletter_mute_v2 = "xwa2_newsletter_mute_v2",
|
|
8
|
-
xwa2_newsletter_unmute_v2 = "xwa2_newsletter_unmute_v2",
|
|
9
|
-
xwa2_newsletter_follow = "xwa2_newsletter_follow",
|
|
10
|
-
xwa2_newsletter_unfollow = "xwa2_newsletter_unfollow",
|
|
11
|
-
xwa2_newsletter_join_v2 = "xwa2_newsletter_join_v2",
|
|
12
|
-
xwa2_newsletter_leave_v2 = "xwa2_newsletter_leave_v2",
|
|
13
|
-
xwa2_newsletter_change_owner = "xwa2_newsletter_change_owner",
|
|
14
|
-
xwa2_newsletter_demote = "xwa2_newsletter_demote",
|
|
15
|
-
xwa2_newsletter_delete_v2 = "xwa2_newsletter_delete_v2",
|
|
16
|
-
xwa2_fetch_account_reachout_timelock = "xwa2_fetch_account_reachout_timelock",
|
|
17
|
-
xwa2_message_capping_info = "xwa2_message_capping_info"
|
|
18
|
-
}
|
|
19
|
-
export declare enum QueryIds {
|
|
20
|
-
CREATE = "8823471724422422",
|
|
21
|
-
UPDATE_METADATA = "24250201037901610",
|
|
22
|
-
METADATA = "6563316087068696",
|
|
23
|
-
SUBSCRIBERS = "9783111038412085",
|
|
24
|
-
FOLLOW = "24404358912487870",
|
|
25
|
-
UNFOLLOW = "9767147403369991",
|
|
26
|
-
MUTE = "29766401636284406",
|
|
27
|
-
UNMUTE = "9864994326891137",
|
|
28
|
-
ADMIN_COUNT = "7130823597031706",
|
|
29
|
-
CHANGE_OWNER = "7341777602580933",
|
|
30
|
-
DEMOTE = "6551828931592903",
|
|
31
|
-
DELETE = "30062808666639665",
|
|
32
|
-
REACHOUT_TIMELOCK = "23983697327930364",
|
|
33
|
-
MESSAGE_CAPPING_INFO = "24503548349331633"
|
|
34
|
-
}
|
|
35
|
-
export type NewsletterUpdate = {
|
|
36
|
-
name?: string;
|
|
37
|
-
description?: string;
|
|
38
|
-
picture?: string;
|
|
39
|
-
};
|
|
40
|
-
export interface NewsletterCreateResponse {
|
|
41
|
-
id: string;
|
|
42
|
-
state: {
|
|
43
|
-
type: string;
|
|
44
|
-
};
|
|
45
|
-
thread_metadata: {
|
|
46
|
-
creation_time: string;
|
|
47
|
-
description: {
|
|
48
|
-
id: string;
|
|
49
|
-
text: string;
|
|
50
|
-
update_time: string;
|
|
51
|
-
};
|
|
52
|
-
handle: string | null;
|
|
53
|
-
invite: string;
|
|
54
|
-
name: {
|
|
55
|
-
id: string;
|
|
56
|
-
text: string;
|
|
57
|
-
update_time: string;
|
|
58
|
-
};
|
|
59
|
-
picture: {
|
|
60
|
-
direct_path: string;
|
|
61
|
-
id: string;
|
|
62
|
-
type: string;
|
|
63
|
-
};
|
|
64
|
-
preview: {
|
|
65
|
-
direct_path: string;
|
|
66
|
-
id: string;
|
|
67
|
-
type: string;
|
|
68
|
-
};
|
|
69
|
-
subscribers_count: string;
|
|
70
|
-
verification: 'VERIFIED' | 'UNVERIFIED';
|
|
71
|
-
};
|
|
72
|
-
viewer_metadata: {
|
|
73
|
-
mute: 'ON' | 'OFF';
|
|
74
|
-
role: NewsletterViewRole;
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
export interface NewsletterCreateResponse {
|
|
78
|
-
id: string;
|
|
79
|
-
state: {
|
|
80
|
-
type: string;
|
|
81
|
-
};
|
|
82
|
-
thread_metadata: {
|
|
83
|
-
creation_time: string;
|
|
84
|
-
description: {
|
|
85
|
-
id: string;
|
|
86
|
-
text: string;
|
|
87
|
-
update_time: string;
|
|
88
|
-
};
|
|
89
|
-
handle: string | null;
|
|
90
|
-
invite: string;
|
|
91
|
-
name: {
|
|
92
|
-
id: string;
|
|
93
|
-
text: string;
|
|
94
|
-
update_time: string;
|
|
95
|
-
};
|
|
96
|
-
picture: {
|
|
97
|
-
direct_path: string;
|
|
98
|
-
id: string;
|
|
99
|
-
type: string;
|
|
100
|
-
};
|
|
101
|
-
preview: {
|
|
102
|
-
direct_path: string;
|
|
103
|
-
id: string;
|
|
104
|
-
type: string;
|
|
105
|
-
};
|
|
106
|
-
subscribers_count: string;
|
|
107
|
-
verification: 'VERIFIED' | 'UNVERIFIED';
|
|
108
|
-
};
|
|
109
|
-
viewer_metadata: {
|
|
110
|
-
mute: 'ON' | 'OFF';
|
|
111
|
-
role: NewsletterViewRole;
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
export type NewsletterViewRole = 'ADMIN' | 'GUEST' | 'OWNER' | 'SUBSCRIBER';
|
|
115
|
-
export interface NewsletterMetadata {
|
|
116
|
-
id: string;
|
|
117
|
-
owner?: string;
|
|
118
|
-
name: string;
|
|
119
|
-
description?: string;
|
|
120
|
-
invite?: string;
|
|
121
|
-
creation_time?: number;
|
|
122
|
-
subscribers?: number;
|
|
123
|
-
picture?: {
|
|
124
|
-
url?: string;
|
|
125
|
-
directPath?: string;
|
|
126
|
-
mediaKey?: string;
|
|
127
|
-
id?: string;
|
|
128
|
-
};
|
|
129
|
-
verification?: 'VERIFIED' | 'UNVERIFIED';
|
|
130
|
-
reaction_codes?: {
|
|
131
|
-
code: string;
|
|
132
|
-
count: number;
|
|
133
|
-
}[];
|
|
134
|
-
mute_state?: 'ON' | 'OFF';
|
|
135
|
-
thread_metadata?: {
|
|
136
|
-
creation_time?: number;
|
|
137
|
-
name?: string;
|
|
138
|
-
description?: string;
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
//# sourceMappingURL=Mex.d.ts.map
|
package/lib/Types/Mex.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export var XWAPaths;
|
|
2
|
-
(function (XWAPaths) {
|
|
3
|
-
XWAPaths["xwa2_newsletter_create"] = "xwa2_newsletter_create";
|
|
4
|
-
XWAPaths["xwa2_newsletter_subscribers"] = "xwa2_newsletter_subscribers";
|
|
5
|
-
XWAPaths["xwa2_newsletter_view"] = "xwa2_newsletter_view";
|
|
6
|
-
XWAPaths["xwa2_newsletter_metadata"] = "xwa2_newsletter";
|
|
7
|
-
XWAPaths["xwa2_newsletter_admin_count"] = "xwa2_newsletter_admin";
|
|
8
|
-
XWAPaths["xwa2_newsletter_mute_v2"] = "xwa2_newsletter_mute_v2";
|
|
9
|
-
XWAPaths["xwa2_newsletter_unmute_v2"] = "xwa2_newsletter_unmute_v2";
|
|
10
|
-
XWAPaths["xwa2_newsletter_follow"] = "xwa2_newsletter_follow";
|
|
11
|
-
XWAPaths["xwa2_newsletter_unfollow"] = "xwa2_newsletter_unfollow";
|
|
12
|
-
XWAPaths["xwa2_newsletter_join_v2"] = "xwa2_newsletter_join_v2";
|
|
13
|
-
XWAPaths["xwa2_newsletter_leave_v2"] = "xwa2_newsletter_leave_v2";
|
|
14
|
-
XWAPaths["xwa2_newsletter_change_owner"] = "xwa2_newsletter_change_owner";
|
|
15
|
-
XWAPaths["xwa2_newsletter_demote"] = "xwa2_newsletter_demote";
|
|
16
|
-
XWAPaths["xwa2_newsletter_delete_v2"] = "xwa2_newsletter_delete_v2";
|
|
17
|
-
XWAPaths["xwa2_fetch_account_reachout_timelock"] = "xwa2_fetch_account_reachout_timelock";
|
|
18
|
-
XWAPaths["xwa2_message_capping_info"] = "xwa2_message_capping_info";
|
|
19
|
-
})(XWAPaths || (XWAPaths = {}));
|
|
20
|
-
export var QueryIds;
|
|
21
|
-
(function (QueryIds) {
|
|
22
|
-
QueryIds["CREATE"] = "8823471724422422";
|
|
23
|
-
QueryIds["UPDATE_METADATA"] = "24250201037901610";
|
|
24
|
-
QueryIds["METADATA"] = "6563316087068696";
|
|
25
|
-
QueryIds["SUBSCRIBERS"] = "9783111038412085";
|
|
26
|
-
QueryIds["FOLLOW"] = "24404358912487870";
|
|
27
|
-
QueryIds["UNFOLLOW"] = "9767147403369991";
|
|
28
|
-
QueryIds["MUTE"] = "29766401636284406";
|
|
29
|
-
QueryIds["UNMUTE"] = "9864994326891137";
|
|
30
|
-
QueryIds["ADMIN_COUNT"] = "7130823597031706";
|
|
31
|
-
QueryIds["CHANGE_OWNER"] = "7341777602580933";
|
|
32
|
-
QueryIds["DEMOTE"] = "6551828931592903";
|
|
33
|
-
QueryIds["DELETE"] = "30062808666639665";
|
|
34
|
-
QueryIds["REACHOUT_TIMELOCK"] = "23983697327930364";
|
|
35
|
-
QueryIds["MESSAGE_CAPPING_INFO"] = "24503548349331633";
|
|
36
|
-
})(QueryIds || (QueryIds = {}));
|
|
37
|
-
//# sourceMappingURL=Mex.js.map
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { platform, release } from 'os';
|
|
2
|
-
import { proto } from '../../WAProto/index.js';
|
|
3
|
-
const PLATFORM_MAP = {
|
|
4
|
-
aix: 'AIX',
|
|
5
|
-
darwin: 'Mac OS',
|
|
6
|
-
win32: 'Windows',
|
|
7
|
-
android: 'Android',
|
|
8
|
-
freebsd: 'FreeBSD',
|
|
9
|
-
openbsd: 'OpenBSD',
|
|
10
|
-
sunos: 'Solaris',
|
|
11
|
-
linux: undefined,
|
|
12
|
-
haiku: undefined,
|
|
13
|
-
cygwin: undefined,
|
|
14
|
-
netbsd: undefined
|
|
15
|
-
};
|
|
16
|
-
export const Browsers = {
|
|
17
|
-
ubuntu: browser => ['Ubuntu', browser, '22.04.4'],
|
|
18
|
-
macOS: browser => ['Mac OS', browser, '14.4.1'],
|
|
19
|
-
baileys: browser => ['Baileys', browser, '6.5.0'],
|
|
20
|
-
windows: browser => ['Windows', browser, '10.0.22631'],
|
|
21
|
-
/** The appropriate browser based on your OS & release */
|
|
22
|
-
appropriate: browser => [PLATFORM_MAP[platform()] || 'Ubuntu', browser, release()]
|
|
23
|
-
};
|
|
24
|
-
export const getPlatformId = (browser) => {
|
|
25
|
-
const platformType = proto.DeviceProps.PlatformType[browser.toUpperCase()];
|
|
26
|
-
return platformType ? platformType.toString() : '1'; //chrome
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=browser-utils.js.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { WABrowserDescription } from '../Types/index.js';
|
|
2
|
-
export declare enum CompanionWebClientType {
|
|
3
|
-
UNKNOWN = 0,
|
|
4
|
-
CHROME = 1,
|
|
5
|
-
EDGE = 2,
|
|
6
|
-
FIREFOX = 3,
|
|
7
|
-
IE = 4,
|
|
8
|
-
OPERA = 5,
|
|
9
|
-
SAFARI = 6,
|
|
10
|
-
ELECTRON = 7,
|
|
11
|
-
UWP = 8,
|
|
12
|
-
OTHER_WEB_CLIENT = 9
|
|
13
|
-
}
|
|
14
|
-
export declare const getCompanionWebClientType: ([os, browserName]: WABrowserDescription) => CompanionWebClientType;
|
|
15
|
-
export declare const getCompanionPlatformId: (browser: WABrowserDescription) => string;
|
|
16
|
-
export declare const buildPairingQRData: (ref: string, noiseKeyB64: string, identityKeyB64: string, advB64: string, browser: WABrowserDescription) => string;
|
|
17
|
-
//# sourceMappingURL=companion-reg-client-utils.d.ts.map
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export var CompanionWebClientType;
|
|
2
|
-
(function (CompanionWebClientType) {
|
|
3
|
-
CompanionWebClientType[CompanionWebClientType["UNKNOWN"] = 0] = "UNKNOWN";
|
|
4
|
-
CompanionWebClientType[CompanionWebClientType["CHROME"] = 1] = "CHROME";
|
|
5
|
-
CompanionWebClientType[CompanionWebClientType["EDGE"] = 2] = "EDGE";
|
|
6
|
-
CompanionWebClientType[CompanionWebClientType["FIREFOX"] = 3] = "FIREFOX";
|
|
7
|
-
CompanionWebClientType[CompanionWebClientType["IE"] = 4] = "IE";
|
|
8
|
-
CompanionWebClientType[CompanionWebClientType["OPERA"] = 5] = "OPERA";
|
|
9
|
-
CompanionWebClientType[CompanionWebClientType["SAFARI"] = 6] = "SAFARI";
|
|
10
|
-
CompanionWebClientType[CompanionWebClientType["ELECTRON"] = 7] = "ELECTRON";
|
|
11
|
-
CompanionWebClientType[CompanionWebClientType["UWP"] = 8] = "UWP";
|
|
12
|
-
CompanionWebClientType[CompanionWebClientType["OTHER_WEB_CLIENT"] = 9] = "OTHER_WEB_CLIENT";
|
|
13
|
-
})(CompanionWebClientType || (CompanionWebClientType = {}));
|
|
14
|
-
const BROWSER_TO_COMPANION_WEB_CLIENT = {
|
|
15
|
-
Chrome: CompanionWebClientType.CHROME,
|
|
16
|
-
Edge: CompanionWebClientType.EDGE,
|
|
17
|
-
Firefox: CompanionWebClientType.FIREFOX,
|
|
18
|
-
IE: CompanionWebClientType.IE,
|
|
19
|
-
Opera: CompanionWebClientType.OPERA,
|
|
20
|
-
Safari: CompanionWebClientType.SAFARI
|
|
21
|
-
};
|
|
22
|
-
export const getCompanionWebClientType = ([os, browserName]) => {
|
|
23
|
-
if (browserName === 'Desktop') {
|
|
24
|
-
return os === 'Windows' ? CompanionWebClientType.UWP : CompanionWebClientType.ELECTRON;
|
|
25
|
-
}
|
|
26
|
-
return BROWSER_TO_COMPANION_WEB_CLIENT[browserName] || CompanionWebClientType.OTHER_WEB_CLIENT;
|
|
27
|
-
};
|
|
28
|
-
export const getCompanionPlatformId = (browser) => {
|
|
29
|
-
return getCompanionWebClientType(browser).toString();
|
|
30
|
-
};
|
|
31
|
-
export const buildPairingQRData = (ref, noiseKeyB64, identityKeyB64, advB64, browser) => {
|
|
32
|
-
return ('https://wa.me/settings/linked_devices#' +
|
|
33
|
-
[ref, noiseKeyB64, identityKeyB64, advB64, getCompanionPlatformId(browser)].join(','));
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=companion-reg-client-utils.js.map
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import NodeCache from '@cacheable/node-cache';
|
|
2
|
-
import { type BinaryNode } from '../WABinary/index.js';
|
|
3
|
-
import type { ILogger } from './logger.js';
|
|
4
|
-
export type IdentityChangeResult = {
|
|
5
|
-
action: 'no_identity_node';
|
|
6
|
-
} | {
|
|
7
|
-
action: 'invalid_notification';
|
|
8
|
-
} | {
|
|
9
|
-
action: 'skipped_companion_device';
|
|
10
|
-
device: number;
|
|
11
|
-
} | {
|
|
12
|
-
action: 'skipped_self_primary';
|
|
13
|
-
} | {
|
|
14
|
-
action: 'debounced';
|
|
15
|
-
} | {
|
|
16
|
-
action: 'skipped_offline';
|
|
17
|
-
} | {
|
|
18
|
-
action: 'skipped_no_session';
|
|
19
|
-
} | {
|
|
20
|
-
action: 'session_refreshed';
|
|
21
|
-
} | {
|
|
22
|
-
action: 'session_refresh_failed';
|
|
23
|
-
error: unknown;
|
|
24
|
-
};
|
|
25
|
-
export type IdentityChangeContext = {
|
|
26
|
-
meId: string | undefined;
|
|
27
|
-
meLid: string | undefined;
|
|
28
|
-
validateSession: (jid: string) => Promise<{
|
|
29
|
-
exists: boolean;
|
|
30
|
-
reason?: string;
|
|
31
|
-
}>;
|
|
32
|
-
assertSessions: (jids: string[], force?: boolean) => Promise<boolean>;
|
|
33
|
-
debounceCache: NodeCache<boolean>;
|
|
34
|
-
logger: ILogger;
|
|
35
|
-
/**
|
|
36
|
-
* Invoked right before `assertSessions` is called for an existing-session identity change.
|
|
37
|
-
* Used to kick off fire-and-forget side effects (e.g. tctoken re-issuance) in the same
|
|
38
|
-
* order WA Web does — i.e. before the E2E session is re-established.
|
|
39
|
-
* Must not throw; implementations are responsible for their own error handling.
|
|
40
|
-
*/
|
|
41
|
-
onBeforeSessionRefresh?: (jid: string) => void;
|
|
42
|
-
};
|
|
43
|
-
export declare function handleIdentityChange(node: BinaryNode, ctx: IdentityChangeContext): Promise<IdentityChangeResult>;
|
|
44
|
-
//# sourceMappingURL=identity-change-handler.d.ts.map
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import NodeCache from '@cacheable/node-cache';
|
|
2
|
-
import { areJidsSameUser, getBinaryNodeChild, jidDecode } from '../WABinary/index.js';
|
|
3
|
-
import { isStringNullOrEmpty } from './generics.js';
|
|
4
|
-
export async function handleIdentityChange(node, ctx) {
|
|
5
|
-
const from = node.attrs.from;
|
|
6
|
-
if (!from) {
|
|
7
|
-
return { action: 'invalid_notification' };
|
|
8
|
-
}
|
|
9
|
-
const identityNode = getBinaryNodeChild(node, 'identity');
|
|
10
|
-
if (!identityNode) {
|
|
11
|
-
return { action: 'no_identity_node' };
|
|
12
|
-
}
|
|
13
|
-
ctx.logger.info({ jid: from }, 'identity changed');
|
|
14
|
-
const decoded = jidDecode(from);
|
|
15
|
-
if (decoded?.device && decoded.device !== 0) {
|
|
16
|
-
ctx.logger.debug({ jid: from, device: decoded.device }, 'ignoring identity change from companion device');
|
|
17
|
-
return { action: 'skipped_companion_device', device: decoded.device };
|
|
18
|
-
}
|
|
19
|
-
const isSelfPrimary = ctx.meId && (areJidsSameUser(from, ctx.meId) || (ctx.meLid && areJidsSameUser(from, ctx.meLid)));
|
|
20
|
-
if (isSelfPrimary) {
|
|
21
|
-
ctx.logger.info({ jid: from }, 'self primary identity changed');
|
|
22
|
-
return { action: 'skipped_self_primary' };
|
|
23
|
-
}
|
|
24
|
-
if (ctx.debounceCache.get(from)) {
|
|
25
|
-
ctx.logger.debug({ jid: from }, 'skipping identity assert (debounced)');
|
|
26
|
-
return { action: 'debounced' };
|
|
27
|
-
}
|
|
28
|
-
ctx.debounceCache.set(from, true);
|
|
29
|
-
const isOfflineNotification = !isStringNullOrEmpty(node.attrs.offline);
|
|
30
|
-
const hasExistingSession = await ctx.validateSession(from);
|
|
31
|
-
if (!hasExistingSession.exists) {
|
|
32
|
-
ctx.logger.debug({ jid: from }, 'no old session, skipping session refresh');
|
|
33
|
-
return { action: 'skipped_no_session' };
|
|
34
|
-
}
|
|
35
|
-
ctx.logger.debug({ jid: from }, 'old session exists, will refresh session');
|
|
36
|
-
if (isOfflineNotification) {
|
|
37
|
-
ctx.logger.debug({ jid: from }, 'skipping session refresh during offline processing');
|
|
38
|
-
return { action: 'skipped_offline' };
|
|
39
|
-
}
|
|
40
|
-
ctx.onBeforeSessionRefresh?.(from);
|
|
41
|
-
try {
|
|
42
|
-
await ctx.assertSessions([from], true);
|
|
43
|
-
return { action: 'session_refreshed' };
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
ctx.logger.warn({ error, jid: from }, 'failed to assert sessions after identity change');
|
|
47
|
-
return { action: 'session_refresh_failed', error };
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=identity-change-handler.js.map
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import type { proto } from '../../WAProto/index.js';
|
|
2
|
-
import type { ILogger } from './logger.js';
|
|
3
|
-
export interface RecentMessageKey {
|
|
4
|
-
to: string;
|
|
5
|
-
id: string;
|
|
6
|
-
}
|
|
7
|
-
export interface RecentMessage {
|
|
8
|
-
message: proto.IMessage;
|
|
9
|
-
timestamp: number;
|
|
10
|
-
}
|
|
11
|
-
export interface SessionRecreateHistory {
|
|
12
|
-
[jid: string]: number;
|
|
13
|
-
}
|
|
14
|
-
export interface RetryCounter {
|
|
15
|
-
[messageId: string]: number;
|
|
16
|
-
}
|
|
17
|
-
export type PendingPhoneRequest = Record<string, ReturnType<typeof setTimeout>>;
|
|
18
|
-
export interface RetryStatistics {
|
|
19
|
-
totalRetries: number;
|
|
20
|
-
successfulRetries: number;
|
|
21
|
-
failedRetries: number;
|
|
22
|
-
mediaRetries: number;
|
|
23
|
-
sessionRecreations: number;
|
|
24
|
-
phoneRequests: number;
|
|
25
|
-
}
|
|
26
|
-
export declare enum RetryReason {
|
|
27
|
-
UnknownError = 0,
|
|
28
|
-
SignalErrorNoSession = 1,
|
|
29
|
-
SignalErrorInvalidKey = 2,
|
|
30
|
-
SignalErrorInvalidKeyId = 3,
|
|
31
|
-
/** MAC verification failed - most common cause of decryption failures */
|
|
32
|
-
SignalErrorInvalidMessage = 4,
|
|
33
|
-
SignalErrorInvalidSignature = 5,
|
|
34
|
-
SignalErrorFutureMessage = 6,
|
|
35
|
-
/** Explicit MAC failure - session is definitely out of sync */
|
|
36
|
-
SignalErrorBadMac = 7,
|
|
37
|
-
SignalErrorInvalidSession = 8,
|
|
38
|
-
SignalErrorInvalidMsgKey = 9,
|
|
39
|
-
BadBroadcastEphemeralSetting = 10,
|
|
40
|
-
UnknownCompanionNoPrekey = 11,
|
|
41
|
-
AdvFailure = 12,
|
|
42
|
-
StatusRevokeDelay = 13
|
|
43
|
-
}
|
|
44
|
-
export declare class MessageRetryManager {
|
|
45
|
-
private logger;
|
|
46
|
-
private recentMessagesMap;
|
|
47
|
-
private messageKeyIndex;
|
|
48
|
-
private sessionRecreateHistory;
|
|
49
|
-
private retryCounters;
|
|
50
|
-
private baseKeys;
|
|
51
|
-
private pendingPhoneRequests;
|
|
52
|
-
private readonly maxMsgRetryCount;
|
|
53
|
-
private statistics;
|
|
54
|
-
constructor(logger: ILogger, maxMsgRetryCount: number);
|
|
55
|
-
/**
|
|
56
|
-
* Add a recent message to the cache for retry handling
|
|
57
|
-
*/
|
|
58
|
-
addRecentMessage(to: string, id: string, message: proto.IMessage): void;
|
|
59
|
-
/**
|
|
60
|
-
* Get a recent message from the cache
|
|
61
|
-
*/
|
|
62
|
-
getRecentMessage(to: string, id: string): RecentMessage | undefined;
|
|
63
|
-
/**
|
|
64
|
-
* Check if a session should be recreated based on retry count, history, and error code.
|
|
65
|
-
* MAC errors (codes 4 and 7) trigger immediate session recreation regardless of timeout.
|
|
66
|
-
*/
|
|
67
|
-
shouldRecreateSession(jid: string, hasSession: boolean, errorCode?: RetryReason): {
|
|
68
|
-
reason: string;
|
|
69
|
-
recreate: boolean;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Parse error code from retry receipt's retry node.
|
|
73
|
-
* Returns undefined if no error code is present.
|
|
74
|
-
*/
|
|
75
|
-
parseRetryErrorCode(errorAttr: string | undefined): RetryReason | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* Check if an error code indicates a MAC failure
|
|
78
|
-
*/
|
|
79
|
-
isMacError(errorCode: RetryReason | undefined): boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Increment retry counter for a message
|
|
82
|
-
*/
|
|
83
|
-
incrementRetryCount(messageId: string): number;
|
|
84
|
-
/**
|
|
85
|
-
* Get retry count for a message
|
|
86
|
-
*/
|
|
87
|
-
getRetryCount(messageId: string): number;
|
|
88
|
-
/**
|
|
89
|
-
* Check if message has exceeded maximum retry attempts
|
|
90
|
-
*/
|
|
91
|
-
hasExceededMaxRetries(messageId: string): boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Mark retry as successful
|
|
94
|
-
*/
|
|
95
|
-
markRetrySuccess(messageId: string): void;
|
|
96
|
-
/**
|
|
97
|
-
* Mark retry as failed
|
|
98
|
-
*/
|
|
99
|
-
markRetryFailed(messageId: string): void;
|
|
100
|
-
/**
|
|
101
|
-
* Schedule a phone request with delay
|
|
102
|
-
*/
|
|
103
|
-
schedulePhoneRequest(messageId: string, callback: () => void, delay?: number): void;
|
|
104
|
-
/**
|
|
105
|
-
* Cancel pending phone request
|
|
106
|
-
*/
|
|
107
|
-
cancelPendingPhoneRequest(messageId: string): void;
|
|
108
|
-
clear(): void;
|
|
109
|
-
saveBaseKey(addr: string, msgId: string, baseKey: Uint8Array): void;
|
|
110
|
-
hasSameBaseKey(addr: string, msgId: string, baseKey: Uint8Array): boolean;
|
|
111
|
-
deleteBaseKey(addr: string, msgId: string): void;
|
|
112
|
-
private keyToString;
|
|
113
|
-
private removeRecentMessage;
|
|
114
|
-
}
|
|
115
|
-
//# sourceMappingURL=message-retry-manager.d.ts.map
|