supunmd-bail 2.1.1 → 2.1.4
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 +428 -0
- package/WAProto/index.js +130529 -45236
- package/engine-requirements.js +1 -1
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.d.ts +9 -18
- package/lib/Defaults/index.js +136 -104
- 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 +0 -1
- package/lib/Signal/Group/queue-job.js +5 -2
- 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 -258
- package/lib/Socket/Client/{types.d.ts → abstract-socket-client.d.ts} +3 -2
- 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} +1 -2
- package/lib/Socket/Client/web-socket-client.js +62 -0
- package/lib/Socket/business.d.ts +108 -125
- package/lib/Socket/business.js +43 -159
- package/lib/Socket/chats.d.ts +239 -70
- package/lib/Socket/chats.js +384 -363
- package/lib/Socket/dugong.d.ts +254 -0
- package/lib/Socket/dugong.js +484 -0
- package/lib/Socket/groups.d.ts +56 -78
- package/lib/Socket/groups.js +96 -106
- package/lib/Socket/index.d.ts +115 -173
- package/lib/Socket/index.js +10 -17
- package/lib/Socket/messages-recv.d.ts +79 -91
- package/lib/Socket/messages-recv.js +521 -639
- package/lib/Socket/messages-send.d.ts +91 -111
- package/lib/Socket/messages-send.js +438 -599
- package/lib/Socket/newsletter.d.ts +84 -97
- package/lib/Socket/newsletter.js +239 -145
- package/lib/Socket/registration.d.ts +267 -0
- package/lib/Socket/registration.js +166 -0
- package/lib/Socket/socket.d.ts +18 -26
- package/lib/Socket/socket.js +230 -448
- package/lib/Socket/usync.d.ts +16 -17
- package/lib/Socket/usync.js +26 -19
- package/lib/Store/index.d.ts +3 -0
- package/lib/Store/index.js +10 -0
- package/lib/Store/make-cache-manager-store.d.ts +13 -0
- package/lib/Store/make-cache-manager-store.js +83 -0
- package/lib/Store/make-in-memory-store.d.ts +118 -0
- package/lib/Store/make-in-memory-store.js +427 -0
- package/lib/Store/make-ordered-dictionary.d.ts +13 -0
- package/lib/Store/make-ordered-dictionary.js +81 -0
- package/lib/Store/object-repository.d.ts +10 -0
- package/lib/Store/object-repository.js +27 -0
- package/lib/Types/Auth.d.ts +12 -13
- package/lib/Types/Auth.js +2 -2
- package/lib/Types/Call.d.ts +1 -2
- package/lib/Types/Call.js +2 -2
- package/lib/Types/Chat.d.ts +13 -34
- package/lib/Types/Chat.js +4 -8
- package/lib/Types/Contact.d.ts +1 -6
- package/lib/Types/Contact.js +2 -2
- package/lib/Types/Events.d.ts +15 -60
- package/lib/Types/Events.js +2 -2
- package/lib/Types/GroupMetadata.d.ts +5 -17
- 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 +54 -84
- package/lib/Types/Message.js +9 -11
- package/lib/Types/Newsletter.d.ts +98 -130
- package/lib/Types/Newsletter.js +38 -31
- package/lib/Types/Product.d.ts +1 -2
- package/lib/Types/Product.js +2 -2
- package/lib/Types/Signal.d.ts +1 -20
- package/lib/Types/Signal.js +2 -2
- package/lib/Types/Socket.d.ts +25 -47
- package/lib/Types/Socket.js +2 -3
- package/lib/Types/State.d.ts +2 -14
- package/lib/Types/State.js +2 -13
- 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 -7
- package/lib/Utils/auth-utils.js +148 -199
- package/lib/Utils/baileys-event-stream.d.ts +1 -2
- package/lib/Utils/baileys-event-stream.js +22 -15
- package/lib/Utils/business.d.ts +2 -3
- package/lib/Utils/business.js +69 -66
- package/lib/Utils/chat-utils.d.ts +22 -21
- package/lib/Utils/chat-utils.js +226 -260
- package/lib/Utils/crypto.d.ts +19 -19
- package/lib/Utils/crypto.js +86 -77
- package/lib/Utils/decode-wa-message.d.ts +8 -37
- package/lib/Utils/decode-wa-message.js +83 -164
- package/lib/Utils/event-buffer.d.ts +8 -7
- package/lib/Utils/event-buffer.js +76 -110
- package/lib/Utils/generics.d.ts +29 -27
- package/lib/Utils/generics.js +210 -168
- package/lib/Utils/history.d.ts +8 -12
- package/lib/Utils/history.js +46 -34
- package/lib/Utils/index.d.ts +17 -20
- package/lib/Utils/index.js +33 -20
- package/lib/Utils/link-preview.d.ts +5 -5
- package/lib/Utils/link-preview.js +22 -14
- package/lib/Utils/logger.d.ts +3 -11
- package/lib/Utils/logger.js +7 -3
- package/lib/Utils/lt-hash.d.ts +8 -9
- package/lib/Utils/lt-hash.js +28 -25
- package/lib/Utils/make-mutex.d.ts +2 -3
- package/lib/Utils/make-mutex.js +10 -7
- package/lib/Utils/messages-media.d.ts +44 -42
- package/lib/Utils/messages-media.js +475 -319
- package/lib/Utils/messages.d.ts +18 -17
- package/lib/Utils/messages.js +259 -383
- package/lib/Utils/noise-handler.d.ts +15 -14
- package/lib/Utils/noise-handler.js +38 -30
- package/lib/Utils/process-message.d.ts +13 -14
- package/lib/Utils/process-message.js +147 -239
- package/lib/Utils/signal.d.ts +5 -7
- package/lib/Utils/signal.js +72 -78
- 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 +106 -72
- 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 -28
- package/lib/WABinary/encode.d.ts +3 -3
- package/lib/WABinary/encode.js +154 -105
- package/lib/WABinary/generic-utils.d.ts +7 -5
- package/lib/WABinary/generic-utils.js +63 -56
- 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 +11 -8
- 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 -5
- package/lib/WAUSync/Protocols/index.js +20 -5
- package/lib/WAUSync/USyncQuery.d.ts +4 -5
- package/lib/WAUSync/USyncQuery.js +35 -40
- package/lib/WAUSync/USyncUser.d.ts +5 -6
- package/lib/WAUSync/USyncUser.js +5 -2
- package/lib/WAUSync/index.d.ts +3 -4
- package/lib/WAUSync/index.js +19 -4
- package/lib/index.d.ts +9 -19
- package/lib/index.js +47 -24
- package/package.json +109 -99
- package/WAProto/GenerateStatics.sh +0 -3
- package/WAProto/WAProto.proto +0 -5519
- package/WAProto/fix-imports.js +0 -29
- package/WAProto/index.d.ts +0 -11969
- package/lib/Signal/lid-mapping.d.ts +0 -23
- package/lib/Signal/lid-mapping.js +0 -171
- package/lib/Socket/Client/types.js +0 -11
- package/lib/Socket/Client/websocket.js +0 -50
- package/lib/Socket/communities.d.ts +0 -244
- package/lib/Socket/communities.js +0 -431
- package/lib/Socket/mex.d.ts +0 -3
- package/lib/Socket/mex.js +0 -42
- package/lib/Types/Bussines.d.ts +0 -25
- package/lib/Types/Bussines.js +0 -2
- package/lib/Utils/browser-utils.d.ts +0 -4
- package/lib/Utils/browser-utils.js +0 -28
- package/lib/Utils/message-retry-manager.d.ts +0 -82
- package/lib/Utils/message-retry-manager.js +0 -149
- package/lib/Utils/pre-key-manager.d.ts +0 -28
- package/lib/Utils/pre-key-manager.js +0 -106
- /package/lib/{supun → supunmd} +0 -0
package/lib/Types/Message.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
})(WAMessageAddressingMode || (WAMessageAddressingMode = {}));
|
|
11
|
-
//# sourceMappingURL=Message.js.map
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WAMessageStatus = exports.WAMessageStubType = exports.WAProto = void 0;
|
|
4
|
+
const WAProto_1 = require("../../WAProto");
|
|
5
|
+
Object.defineProperty(exports, "WAProto", { enumerable: true, get: function () { return WAProto_1.proto; } });
|
|
6
|
+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
7
|
+
exports.WAMessageStubType = WAProto_1.proto.WebMessageInfo.StubType;
|
|
8
|
+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
9
|
+
exports.WAMessageStatus = WAProto_1.proto.WebMessageInfo.Status;
|
|
@@ -1,135 +1,103 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
xwa2_newsletter_demote = "xwa2_newsletter_demote",
|
|
13
|
-
xwa2_newsletter_delete_v2 = "xwa2_newsletter_delete_v2"
|
|
1
|
+
import { proto } from "../../WAProto"
|
|
2
|
+
|
|
3
|
+
export type NewsletterReactionMode = "ALL" | "BASIC" | "NONE"
|
|
4
|
+
export type NewsletterState = "ACTIVE" | "GEOSUSPENDED" | "SUSPENDED"
|
|
5
|
+
export type NewsletterVerification = "VERIFIED" | "UNVERIFIED"
|
|
6
|
+
export type NewsletterMute = "ON" | "OFF" | "UNDEFINED"
|
|
7
|
+
export type NewsletterViewRole = "ADMIN" | "GUEST" | "OWNER" | "SUBSCRIBER"
|
|
8
|
+
|
|
9
|
+
export type NewsletterViewerMetadata = {
|
|
10
|
+
mute: NewsletterMute
|
|
11
|
+
view_role: NewsletterViewRole
|
|
14
12
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
|
|
14
|
+
export type NewsletterMetadata = {
|
|
15
|
+
/** jid of newsletter */
|
|
16
|
+
id: string
|
|
17
|
+
/** state of newsletter */
|
|
18
|
+
state: NewsletterState
|
|
19
|
+
/** creation timestamp of newsletter */
|
|
20
|
+
creation_time: number
|
|
21
|
+
/** name of newsletter */
|
|
22
|
+
name: string
|
|
23
|
+
/** timestamp of last name modification of newsletter */
|
|
24
|
+
nameTime: number
|
|
25
|
+
/** description of newsletter */
|
|
26
|
+
description: string
|
|
27
|
+
/** timestamp of last description modification of newsletter */
|
|
28
|
+
descriptionTime: number
|
|
29
|
+
/** invite code of newsletter */
|
|
30
|
+
invite: string
|
|
31
|
+
/** direct path of picture */
|
|
32
|
+
picture: string | null
|
|
33
|
+
/** direct path of picture preview (lower quality) */
|
|
34
|
+
preview: string | null
|
|
35
|
+
/** reaction mode of newsletter */
|
|
36
|
+
reaction_codes?: NewsletterReactionMode
|
|
37
|
+
/** subscribers count of newsletter */
|
|
38
|
+
subscribers: number
|
|
39
|
+
/** verification state of newsletter */
|
|
40
|
+
verification: NewsletterVerification
|
|
41
|
+
/** viewer metadata */
|
|
42
|
+
viewer_metadata: NewsletterViewerMetadata
|
|
28
43
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
39
|
-
thread_metadata: {
|
|
40
|
-
creation_time: string;
|
|
41
|
-
description: {
|
|
42
|
-
id: string;
|
|
43
|
-
text: string;
|
|
44
|
-
update_time: string;
|
|
45
|
-
};
|
|
46
|
-
handle: string | null;
|
|
47
|
-
invite: string;
|
|
48
|
-
name: {
|
|
49
|
-
id: string;
|
|
50
|
-
text: string;
|
|
51
|
-
update_time: string;
|
|
52
|
-
};
|
|
53
|
-
picture: {
|
|
54
|
-
direct_path: string;
|
|
55
|
-
id: string;
|
|
56
|
-
type: string;
|
|
57
|
-
};
|
|
58
|
-
preview: {
|
|
59
|
-
direct_path: string;
|
|
60
|
-
id: string;
|
|
61
|
-
type: string;
|
|
62
|
-
};
|
|
63
|
-
subscribers_count: string;
|
|
64
|
-
verification: 'VERIFIED' | 'UNVERIFIED';
|
|
65
|
-
};
|
|
66
|
-
viewer_metadata: {
|
|
67
|
-
mute: 'ON' | 'OFF';
|
|
68
|
-
role: NewsletterViewRole;
|
|
69
|
-
};
|
|
44
|
+
|
|
45
|
+
export type SubscriberAction = "promote" | "demote"
|
|
46
|
+
|
|
47
|
+
export type ReactionModeUpdate = {
|
|
48
|
+
reaction_codes: {
|
|
49
|
+
blocked_codes: null
|
|
50
|
+
enabled_ts_sec: null
|
|
51
|
+
value: NewsletterReactionMode
|
|
52
|
+
}
|
|
70
53
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
description: {
|
|
79
|
-
id: string;
|
|
80
|
-
text: string;
|
|
81
|
-
update_time: string;
|
|
82
|
-
};
|
|
83
|
-
handle: string | null;
|
|
84
|
-
invite: string;
|
|
85
|
-
name: {
|
|
86
|
-
id: string;
|
|
87
|
-
text: string;
|
|
88
|
-
update_time: string;
|
|
89
|
-
};
|
|
90
|
-
picture: {
|
|
91
|
-
direct_path: string;
|
|
92
|
-
id: string;
|
|
93
|
-
type: string;
|
|
94
|
-
};
|
|
95
|
-
preview: {
|
|
96
|
-
direct_path: string;
|
|
97
|
-
id: string;
|
|
98
|
-
type: string;
|
|
99
|
-
};
|
|
100
|
-
subscribers_count: string;
|
|
101
|
-
verification: 'VERIFIED' | 'UNVERIFIED';
|
|
102
|
-
};
|
|
103
|
-
viewer_metadata: {
|
|
104
|
-
mute: 'ON' | 'OFF';
|
|
105
|
-
role: NewsletterViewRole;
|
|
106
|
-
};
|
|
54
|
+
|
|
55
|
+
/** only exists reaction mode update */
|
|
56
|
+
export type NewsletterSettingsUpdate = ReactionModeUpdate
|
|
57
|
+
|
|
58
|
+
export type NewsletterReaction = {
|
|
59
|
+
count: number
|
|
60
|
+
code: string
|
|
107
61
|
}
|
|
108
|
-
|
|
109
|
-
export
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
url?: string;
|
|
119
|
-
directPath?: string;
|
|
120
|
-
mediaKey?: string;
|
|
121
|
-
id?: string;
|
|
122
|
-
};
|
|
123
|
-
verification?: 'VERIFIED' | 'UNVERIFIED';
|
|
124
|
-
reaction_codes?: {
|
|
125
|
-
code: string;
|
|
126
|
-
count: number;
|
|
127
|
-
}[];
|
|
128
|
-
mute_state?: 'ON' | 'OFF';
|
|
129
|
-
thread_metadata?: {
|
|
130
|
-
creation_time?: number;
|
|
131
|
-
name?: string;
|
|
132
|
-
description?: string;
|
|
133
|
-
};
|
|
62
|
+
|
|
63
|
+
export type NewsletterFetchedUpdate = {
|
|
64
|
+
/** id of message in newsletter, starts from 100 */
|
|
65
|
+
server_id: string
|
|
66
|
+
/** count of views in this message */
|
|
67
|
+
views?: number
|
|
68
|
+
/** reactions in this message */
|
|
69
|
+
reactions: NewsletterReaction[]
|
|
70
|
+
/** the message, if you requested only updates, you will not receive message */
|
|
71
|
+
message?: proto.IWebMessageInfo
|
|
134
72
|
}
|
|
135
|
-
|
|
73
|
+
|
|
74
|
+
export const MexOperations = {
|
|
75
|
+
PROMOTE: "NotificationNewsletterAdminPromote",
|
|
76
|
+
DEMOTE: "NotificationNewsletterAdminDemote",
|
|
77
|
+
UPDATE: "NotificationNewsletterUpdate"
|
|
78
|
+
} as const
|
|
79
|
+
|
|
80
|
+
export const XWAPaths = {
|
|
81
|
+
PROMOTE: "xwa2_notify_newsletter_admin_promote",
|
|
82
|
+
DEMOTE: "xwa2_notify_newsletter_admin_demote",
|
|
83
|
+
ADMIN_COUNT: "xwa2_newsletter_admin",
|
|
84
|
+
CREATE: "xwa2_newsletter_create",
|
|
85
|
+
NEWSLETTER: "xwa2_newsletter",
|
|
86
|
+
SUBSCRIBED: "xwa2_newsletter_subscribed",
|
|
87
|
+
METADATA_UPDATE: "xwa2_notify_newsletter_on_metadata_update"
|
|
88
|
+
} as const
|
|
89
|
+
|
|
90
|
+
export const QueryIds = {
|
|
91
|
+
JOB_MUTATION: "7150902998257522",
|
|
92
|
+
METADATA: "6620195908089573",
|
|
93
|
+
UNFOLLOW: "7238632346214362",
|
|
94
|
+
FOLLOW: "7871414976211147",
|
|
95
|
+
UNMUTE: "7337137176362961",
|
|
96
|
+
MUTE: "25151904754424642",
|
|
97
|
+
CREATE: "6996806640408138",
|
|
98
|
+
ADMIN_COUNT: "7130823597031706",
|
|
99
|
+
CHANGE_OWNER: "7341777602580933",
|
|
100
|
+
DELETE: "8316537688363079",
|
|
101
|
+
DEMOTE: "6551828931592903",
|
|
102
|
+
SUBSCRIBED: "6388546374527196"
|
|
103
|
+
} as const
|
package/lib/Types/Newsletter.js
CHANGED
|
@@ -1,31 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
"use strict"
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true })
|
|
4
|
+
|
|
5
|
+
const MexOperations = {
|
|
6
|
+
PROMOTE: "NotificationNewsletterAdminPromote",
|
|
7
|
+
DEMOTE: "NotificationNewsletterAdminDemote",
|
|
8
|
+
UPDATE: "NotificationNewsletterUpdate"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const XWAPaths = {
|
|
12
|
+
PROMOTE: "xwa2_notify_newsletter_admin_promote",
|
|
13
|
+
DEMOTE: "xwa2_notify_newsletter_admin_demote",
|
|
14
|
+
ADMIN_COUNT: "xwa2_newsletter_admin",
|
|
15
|
+
CREATE: "xwa2_newsletter_create",
|
|
16
|
+
NEWSLETTER: "xwa2_newsletter",
|
|
17
|
+
SUBSCRIBED: "xwa2_newsletter_subscribed",
|
|
18
|
+
METADATA_UPDATE: "xwa2_notify_newsletter_on_metadata_update"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const QueryIds = {
|
|
22
|
+
JOB_MUTATION: "7150902998257522",
|
|
23
|
+
METADATA: "6620195908089573",
|
|
24
|
+
UNFOLLOW: "7238632346214362",
|
|
25
|
+
FOLLOW: "7871414976211147",
|
|
26
|
+
UNMUTE: "7337137176362961",
|
|
27
|
+
MUTE: "25151904754424642",
|
|
28
|
+
CREATE: "6996806640408138",
|
|
29
|
+
ADMIN_COUNT: "7130823597031706",
|
|
30
|
+
CHANGE_OWNER: "7341777602580933",
|
|
31
|
+
DELETE: "8316537688363079",
|
|
32
|
+
DEMOTE: "6551828931592903",
|
|
33
|
+
SUBSCRIBED: "6388546374527196"
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
exports.MexOperations = MexOperations
|
|
37
|
+
exports.XWAPaths = XWAPaths
|
|
38
|
+
exports.QueryIds = QueryIds
|
package/lib/Types/Product.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { WAMediaUpload } from './Message';
|
|
2
2
|
export type CatalogResult = {
|
|
3
3
|
data: {
|
|
4
4
|
paging: {
|
|
@@ -76,4 +76,3 @@ export type GetCatalogOptions = {
|
|
|
76
76
|
limit?: number;
|
|
77
77
|
jid?: string;
|
|
78
78
|
};
|
|
79
|
-
//# sourceMappingURL=Product.d.ts.map
|
package/lib/Types/Product.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/lib/Types/Signal.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { proto } from '../../WAProto
|
|
2
|
-
import type { LIDMappingStore } from '../Signal/lid-mapping.js';
|
|
1
|
+
import { proto } from '../../WAProto';
|
|
3
2
|
type DecryptGroupSignalOpts = {
|
|
4
3
|
group: string;
|
|
5
4
|
authorJid: string;
|
|
@@ -53,24 +52,6 @@ export type SignalRepository = {
|
|
|
53
52
|
ciphertext: Uint8Array;
|
|
54
53
|
}>;
|
|
55
54
|
injectE2ESession(opts: E2ESessionOpts): Promise<void>;
|
|
56
|
-
validateSession(jid: string): Promise<{
|
|
57
|
-
exists: boolean;
|
|
58
|
-
reason?: string;
|
|
59
|
-
}>;
|
|
60
55
|
jidToSignalProtocolAddress(jid: string): string;
|
|
61
|
-
migrateSession(fromJid: string, toJid: string): Promise<{
|
|
62
|
-
migrated: number;
|
|
63
|
-
skipped: number;
|
|
64
|
-
total: number;
|
|
65
|
-
}>;
|
|
66
|
-
validateSession(jid: string): Promise<{
|
|
67
|
-
exists: boolean;
|
|
68
|
-
reason?: string;
|
|
69
|
-
}>;
|
|
70
|
-
deleteSession(jids: string[]): Promise<void>;
|
|
71
56
|
};
|
|
72
|
-
export interface SignalRepositoryWithLIDStore extends SignalRepository {
|
|
73
|
-
lidMapping: LIDMappingStore;
|
|
74
|
-
}
|
|
75
57
|
export {};
|
|
76
|
-
//# sourceMappingURL=Signal.d.ts.map
|
package/lib/Types/Signal.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/lib/Types/Socket.d.ts
CHANGED
|
@@ -1,33 +1,24 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { AxiosRequestConfig } from 'axios';
|
|
1
4
|
import type { Agent } from 'https';
|
|
5
|
+
import type { Logger } from 'pino';
|
|
2
6
|
import type { URL } from 'url';
|
|
3
|
-
import { proto } from '../../WAProto
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { type MediaConnInfo, type WAMessageKey } from './Message.js';
|
|
8
|
-
import type { SignalRepositoryWithLIDStore } from './Signal.js';
|
|
7
|
+
import { proto } from '../../WAProto';
|
|
8
|
+
import { AuthenticationState, SignalAuthState, TransactionCapabilityOptions } from './Auth';
|
|
9
|
+
import { MediaConnInfo } from './Message';
|
|
10
|
+
import { SignalRepository } from './Signal';
|
|
9
11
|
export type WAVersion = [number, number, number];
|
|
10
12
|
export type WABrowserDescription = [string, string, string];
|
|
11
13
|
export type CacheStore = {
|
|
12
14
|
/** get a cached key and change the stats */
|
|
13
|
-
get<T>(key: string):
|
|
15
|
+
get<T>(key: string): T | undefined;
|
|
14
16
|
/** set a key in the cache */
|
|
15
|
-
set<T>(key: string, value: T):
|
|
17
|
+
set<T>(key: string, value: T): void;
|
|
16
18
|
/** delete a key from the cache */
|
|
17
|
-
del(key: string): void
|
|
19
|
+
del(key: string): void;
|
|
18
20
|
/** flush all data */
|
|
19
|
-
flushAll(): void
|
|
20
|
-
};
|
|
21
|
-
export type PossiblyExtendedCacheStore = CacheStore & {
|
|
22
|
-
mget?: <T>(keys: string[]) => Promise<Record<string, T | undefined>>;
|
|
23
|
-
mset?: <T>(entries: {
|
|
24
|
-
key: string;
|
|
25
|
-
value: T;
|
|
26
|
-
}[]) => Promise<void> | void | number | boolean;
|
|
27
|
-
mdel?: (keys: string[]) => void | Promise<void> | number | boolean;
|
|
28
|
-
};
|
|
29
|
-
export type PatchedMessageWithRecipientJID = proto.IMessage & {
|
|
30
|
-
recipientJid?: string;
|
|
21
|
+
flushAll(): void;
|
|
31
22
|
};
|
|
32
23
|
export type SocketConfig = {
|
|
33
24
|
/** the WS url to connect to WA */
|
|
@@ -38,24 +29,20 @@ export type SocketConfig = {
|
|
|
38
29
|
defaultQueryTimeoutMs: number | undefined;
|
|
39
30
|
/** ping-pong interval for WS connection */
|
|
40
31
|
keepAliveIntervalMs: number;
|
|
41
|
-
/** should baileys use the mobile api instead of the multi device api
|
|
42
|
-
* @deprecated This feature has been removed
|
|
43
|
-
*/
|
|
32
|
+
/** should baileys use the mobile api instead of the multi device api */
|
|
44
33
|
mobile?: boolean;
|
|
45
34
|
/** proxy agent */
|
|
46
35
|
agent?: Agent;
|
|
47
|
-
/** logger */
|
|
48
|
-
logger:
|
|
36
|
+
/** pino logger */
|
|
37
|
+
logger: Logger;
|
|
49
38
|
/** version to connect with */
|
|
50
39
|
version: WAVersion;
|
|
51
40
|
/** override browser config */
|
|
52
41
|
browser: WABrowserDescription;
|
|
53
42
|
/** agent used for fetch requests -- uploading/downloading media */
|
|
54
43
|
fetchAgent?: Agent;
|
|
55
|
-
/** should the QR be printed in the terminal
|
|
56
|
-
|
|
57
|
-
*/
|
|
58
|
-
printQRInTerminal?: boolean;
|
|
44
|
+
/** should the QR be printed in the terminal */
|
|
45
|
+
printQRInTerminal: boolean;
|
|
59
46
|
/** should events be emitted for actions done by this socket connection */
|
|
60
47
|
emitOwnEvents: boolean;
|
|
61
48
|
/** custom upload hosts to upload media to */
|
|
@@ -74,8 +61,6 @@ export type SocketConfig = {
|
|
|
74
61
|
transactionOpts: TransactionCapabilityOptions;
|
|
75
62
|
/** marks the client as online whenever the socket successfully connects */
|
|
76
63
|
markOnlineOnConnect: boolean;
|
|
77
|
-
/** alphanumeric country code (USA -> US) for the number used */
|
|
78
|
-
countryCode: string;
|
|
79
64
|
/** provide a cache to store media, so does not have to be re-uploaded */
|
|
80
65
|
mediaCache?: CacheStore;
|
|
81
66
|
/**
|
|
@@ -83,11 +68,9 @@ export type SocketConfig = {
|
|
|
83
68
|
* used to determine whether to retry a message or not */
|
|
84
69
|
msgRetryCounterCache?: CacheStore;
|
|
85
70
|
/** provide a cache to store a user's device list */
|
|
86
|
-
userDevicesCache?:
|
|
71
|
+
userDevicesCache?: CacheStore;
|
|
87
72
|
/** cache to store call offers */
|
|
88
73
|
callOfferCache?: CacheStore;
|
|
89
|
-
/** cache to track placeholder resends */
|
|
90
|
-
placeholderResendCache?: CacheStore;
|
|
91
74
|
/** width for link preview images */
|
|
92
75
|
linkPreviewImageThumbnailWidth: number;
|
|
93
76
|
/** Should Baileys ask the phone for full history, will be received async */
|
|
@@ -99,10 +82,6 @@ export type SocketConfig = {
|
|
|
99
82
|
* entails uploading the jpegThumbnail to WA
|
|
100
83
|
* */
|
|
101
84
|
generateHighQualityLinkPreview: boolean;
|
|
102
|
-
/** Enable automatic session recreation for failed messages */
|
|
103
|
-
enableAutoSessionRecreation: boolean;
|
|
104
|
-
/** Enable recent message caching for retry handling */
|
|
105
|
-
enableRecentMessageCache: boolean;
|
|
106
85
|
/**
|
|
107
86
|
* Returns if a jid should be ignored,
|
|
108
87
|
* no event for that jid will be triggered.
|
|
@@ -112,22 +91,21 @@ export type SocketConfig = {
|
|
|
112
91
|
/**
|
|
113
92
|
* Optionally patch the message before sending out
|
|
114
93
|
* */
|
|
115
|
-
patchMessageBeforeSending: (msg: proto.IMessage, recipientJids
|
|
94
|
+
patchMessageBeforeSending: (msg: proto.IMessage, recipientJids: string[]) => Promise<proto.IMessage> | proto.IMessage;
|
|
116
95
|
/** verify app state MACs */
|
|
117
96
|
appStateMacVerification: {
|
|
118
97
|
patch: boolean;
|
|
119
98
|
snapshot: boolean;
|
|
120
99
|
};
|
|
121
|
-
/** options for
|
|
122
|
-
options:
|
|
100
|
+
/** options for axios */
|
|
101
|
+
options: AxiosRequestConfig<{}>;
|
|
123
102
|
/**
|
|
124
103
|
* fetch a message from your store
|
|
125
104
|
* implement this so that messages failed to send
|
|
126
105
|
* (solves the "this message can take a while" issue) can be retried
|
|
127
106
|
* */
|
|
128
|
-
getMessage: (key:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
107
|
+
getMessage: (key: proto.IMessageKey) => Promise<proto.IMessage | undefined>;
|
|
108
|
+
makeSignalRepository: (auth: SignalAuthState) => SignalRepository;
|
|
109
|
+
/** Socket passthrough */
|
|
110
|
+
socket?: any;
|
|
132
111
|
};
|
|
133
|
-
//# sourceMappingURL=Socket.d.ts.map
|
package/lib/Types/Socket.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=Socket.js.map
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/lib/Types/State.d.ts
CHANGED
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Contact } from './Contact.js';
|
|
3
|
-
export declare enum SyncState {
|
|
4
|
-
/** The socket is connecting, but we haven't received pending notifications yet. */
|
|
5
|
-
Connecting = 0,
|
|
6
|
-
/** Pending notifications received. Buffering events until we decide whether to sync or not. */
|
|
7
|
-
AwaitingInitialSync = 1,
|
|
8
|
-
/** The initial app state sync (history, etc.) is in progress. Buffering continues. */
|
|
9
|
-
Syncing = 2,
|
|
10
|
-
/** Initial sync is complete, or was skipped. The socket is fully operational and events are processed in real-time. */
|
|
11
|
-
Online = 3
|
|
12
|
-
}
|
|
1
|
+
import { Contact } from './Contact';
|
|
13
2
|
export type WAConnectionState = 'open' | 'connecting' | 'close';
|
|
14
3
|
export type ConnectionState = {
|
|
15
4
|
/** connection is now open, connecting or closed */
|
|
16
5
|
connection: WAConnectionState;
|
|
17
6
|
/** the error that caused the connection to close */
|
|
18
7
|
lastDisconnect?: {
|
|
19
|
-
error:
|
|
8
|
+
error: Error | undefined;
|
|
20
9
|
date: Date;
|
|
21
10
|
};
|
|
22
11
|
/** is this a new login */
|
|
@@ -36,4 +25,3 @@ export type ConnectionState = {
|
|
|
36
25
|
* */
|
|
37
26
|
isOnline?: boolean;
|
|
38
27
|
};
|
|
39
|
-
//# sourceMappingURL=State.d.ts.map
|
package/lib/Types/State.js
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
(function (SyncState) {
|
|
4
|
-
/** The socket is connecting, but we haven't received pending notifications yet. */
|
|
5
|
-
SyncState[SyncState["Connecting"] = 0] = "Connecting";
|
|
6
|
-
/** Pending notifications received. Buffering events until we decide whether to sync or not. */
|
|
7
|
-
SyncState[SyncState["AwaitingInitialSync"] = 1] = "AwaitingInitialSync";
|
|
8
|
-
/** The initial app state sync (history, etc.) is in progress. Buffering continues. */
|
|
9
|
-
SyncState[SyncState["Syncing"] = 2] = "Syncing";
|
|
10
|
-
/** Initial sync is complete, or was skipped. The socket is fully operational and events are processed in real-time. */
|
|
11
|
-
SyncState[SyncState["Online"] = 3] = "Online";
|
|
12
|
-
})(SyncState || (SyncState = {}));
|
|
13
|
-
//# sourceMappingURL=State.js.map
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/lib/Types/USync.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { USyncUser } from '../WAUSync
|
|
1
|
+
import { BinaryNode } from '../WABinary';
|
|
2
|
+
import { USyncUser } from '../WAUSync';
|
|
3
3
|
/**
|
|
4
4
|
* Defines the interface for a USyncQuery protocol
|
|
5
5
|
*/
|
|
@@ -23,4 +23,3 @@ export interface USyncQueryProtocol {
|
|
|
23
23
|
*/
|
|
24
24
|
parser: (data: BinaryNode) => unknown;
|
|
25
25
|
}
|
|
26
|
-
//# sourceMappingURL=USync.d.ts.map
|
package/lib/Types/USync.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/lib/Types/index.d.ts
CHANGED
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
export * from './Auth
|
|
2
|
-
export * from './GroupMetadata
|
|
3
|
-
export * from './Chat
|
|
4
|
-
export * from './Contact
|
|
5
|
-
export * from './State
|
|
6
|
-
export * from './Message
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
13
|
-
import
|
|
14
|
-
import
|
|
1
|
+
export * from './Auth';
|
|
2
|
+
export * from './GroupMetadata';
|
|
3
|
+
export * from './Chat';
|
|
4
|
+
export * from './Contact';
|
|
5
|
+
export * from './State';
|
|
6
|
+
export * from './Message';
|
|
7
|
+
export * from './Newsletter';
|
|
8
|
+
export * from './Socket';
|
|
9
|
+
export * from './Events';
|
|
10
|
+
export * from './Product';
|
|
11
|
+
export * from './Call';
|
|
12
|
+
export * from './Signal';
|
|
13
|
+
import { AuthenticationState } from './Auth';
|
|
14
|
+
import { SocketConfig } from './Socket';
|
|
15
15
|
export type UserFacingSocketConfig = Partial<SocketConfig> & {
|
|
16
16
|
auth: AuthenticationState;
|
|
17
17
|
};
|
|
18
|
-
export type BrowsersMap = {
|
|
19
|
-
ubuntu(browser: string): [string, string, string];
|
|
20
|
-
macOS(browser: string): [string, string, string];
|
|
21
|
-
baileys(browser: string): [string, string, string];
|
|
22
|
-
windows(browser: string): [string, string, string];
|
|
23
|
-
appropriate(browser: string): [string, string, string];
|
|
24
|
-
};
|
|
25
18
|
export declare enum DisconnectReason {
|
|
26
19
|
connectionClosed = 428,
|
|
27
20
|
connectionLost = 408,
|
|
@@ -62,4 +55,3 @@ export type CurveKeyPair = {
|
|
|
62
55
|
private: Uint8Array;
|
|
63
56
|
public: Uint8Array;
|
|
64
57
|
};
|
|
65
|
-
//# sourceMappingURL=index.d.ts.map
|