@another-trial/whatsapp-web.js 1.34.0 → 1.35.0-alpha.1
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/.env.example +2 -2
- package/CODE_OF_CONDUCT.md +133 -133
- package/LICENSE +201 -201
- package/README.md +185 -185
- package/example.js +690 -690
- package/index.d.ts +2239 -2202
- package/index.js +35 -35
- package/package.json +59 -59
- package/shell.js +36 -36
- package/src/Client.js +2445 -2361
- package/src/authStrategies/BaseAuthStrategy.js +26 -26
- package/src/authStrategies/LocalAuth.js +58 -58
- package/src/authStrategies/NoAuth.js +11 -11
- package/src/authStrategies/RemoteAuth.js +210 -210
- package/src/factories/ChatFactory.js +21 -21
- package/src/factories/ContactFactory.js +15 -15
- package/src/structures/Base.js +21 -21
- package/src/structures/Broadcast.js +69 -69
- package/src/structures/BusinessContact.js +20 -20
- package/src/structures/Buttons.js +81 -81
- package/src/structures/Call.js +75 -75
- package/src/structures/Channel.js +382 -382
- package/src/structures/Chat.js +329 -299
- package/src/structures/ClientInfo.js +70 -70
- package/src/structures/Contact.js +208 -208
- package/src/structures/GroupChat.js +485 -485
- package/src/structures/GroupNotification.js +104 -104
- package/src/structures/Label.js +49 -49
- package/src/structures/List.js +79 -79
- package/src/structures/Location.js +61 -61
- package/src/structures/Message.js +754 -747
- package/src/structures/MessageMedia.js +111 -111
- package/src/structures/Order.js +51 -51
- package/src/structures/Payment.js +79 -79
- package/src/structures/Poll.js +44 -44
- package/src/structures/PollVote.js +75 -75
- package/src/structures/PrivateChat.js +12 -12
- package/src/structures/PrivateContact.js +12 -12
- package/src/structures/Product.js +67 -67
- package/src/structures/ProductMetadata.js +24 -24
- package/src/structures/Reaction.js +68 -68
- package/src/structures/ScheduledEvent.js +71 -71
- package/src/structures/index.js +27 -27
- package/src/util/Constants.js +183 -183
- package/src/util/Injected/AuthStore/AuthStore.js +16 -16
- package/src/util/Injected/AuthStore/LegacyAuthStore.js +21 -21
- package/src/util/Injected/LegacyStore.js +145 -145
- package/src/util/Injected/Store.js +250 -231
- package/src/util/Injected/Utils.js +1156 -1169
- package/src/util/InterfaceController.js +126 -126
- package/src/util/Puppeteer.js +23 -23
- package/src/util/Util.js +186 -186
- package/src/webCache/LocalWebCache.js +40 -40
- package/src/webCache/RemoteWebCache.js +39 -39
- package/src/webCache/WebCache.js +13 -13
- package/src/webCache/WebCacheFactory.js +19 -19
package/src/structures/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
Base: require('./Base'),
|
|
3
|
-
BusinessContact: require('./BusinessContact'),
|
|
4
|
-
Chat: require('./Chat'),
|
|
5
|
-
ClientInfo: require('./ClientInfo'),
|
|
6
|
-
Contact: require('./Contact'),
|
|
7
|
-
GroupChat: require('./GroupChat'),
|
|
8
|
-
Channel: require('./Channel'),
|
|
9
|
-
Location: require('./Location'),
|
|
10
|
-
Message: require('./Message'),
|
|
11
|
-
MessageMedia: require('./MessageMedia'),
|
|
12
|
-
PrivateChat: require('./PrivateChat'),
|
|
13
|
-
PrivateContact: require('./PrivateContact'),
|
|
14
|
-
GroupNotification: require('./GroupNotification'),
|
|
15
|
-
Label: require('./Label.js'),
|
|
16
|
-
Order: require('./Order'),
|
|
17
|
-
Product: require('./Product'),
|
|
18
|
-
Call: require('./Call'),
|
|
19
|
-
Buttons: require('./Buttons'),
|
|
20
|
-
List: require('./List'),
|
|
21
|
-
Payment: require('./Payment'),
|
|
22
|
-
Reaction: require('./Reaction'),
|
|
23
|
-
Poll: require('./Poll'),
|
|
24
|
-
PollVote: require('./PollVote'),
|
|
25
|
-
Broadcast: require('./Broadcast'),
|
|
26
|
-
ScheduledEvent: require('./ScheduledEvent'),
|
|
27
|
-
};
|
|
1
|
+
module.exports = {
|
|
2
|
+
Base: require('./Base'),
|
|
3
|
+
BusinessContact: require('./BusinessContact'),
|
|
4
|
+
Chat: require('./Chat'),
|
|
5
|
+
ClientInfo: require('./ClientInfo'),
|
|
6
|
+
Contact: require('./Contact'),
|
|
7
|
+
GroupChat: require('./GroupChat'),
|
|
8
|
+
Channel: require('./Channel'),
|
|
9
|
+
Location: require('./Location'),
|
|
10
|
+
Message: require('./Message'),
|
|
11
|
+
MessageMedia: require('./MessageMedia'),
|
|
12
|
+
PrivateChat: require('./PrivateChat'),
|
|
13
|
+
PrivateContact: require('./PrivateContact'),
|
|
14
|
+
GroupNotification: require('./GroupNotification'),
|
|
15
|
+
Label: require('./Label.js'),
|
|
16
|
+
Order: require('./Order'),
|
|
17
|
+
Product: require('./Product'),
|
|
18
|
+
Call: require('./Call'),
|
|
19
|
+
Buttons: require('./Buttons'),
|
|
20
|
+
List: require('./List'),
|
|
21
|
+
Payment: require('./Payment'),
|
|
22
|
+
Reaction: require('./Reaction'),
|
|
23
|
+
Poll: require('./Poll'),
|
|
24
|
+
PollVote: require('./PollVote'),
|
|
25
|
+
Broadcast: require('./Broadcast'),
|
|
26
|
+
ScheduledEvent: require('./ScheduledEvent'),
|
|
27
|
+
};
|
package/src/util/Constants.js
CHANGED
|
@@ -1,183 +1,183 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
exports.WhatsWebURL = 'https://web.whatsapp.com/';
|
|
4
|
-
|
|
5
|
-
exports.DefaultOptions = {
|
|
6
|
-
puppeteer: {
|
|
7
|
-
headless: true,
|
|
8
|
-
defaultViewport: null
|
|
9
|
-
},
|
|
10
|
-
webVersion: '2.3000.1017054665',
|
|
11
|
-
webVersionCache: {
|
|
12
|
-
type: 'local',
|
|
13
|
-
},
|
|
14
|
-
authTimeoutMs: 0,
|
|
15
|
-
qrMaxRetries: 0,
|
|
16
|
-
takeoverOnConflict: false,
|
|
17
|
-
takeoverTimeoutMs: 0,
|
|
18
|
-
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36',
|
|
19
|
-
ffmpegPath: 'ffmpeg',
|
|
20
|
-
bypassCSP: false,
|
|
21
|
-
proxyAuthentication: undefined,
|
|
22
|
-
pairWithPhoneNumber: {
|
|
23
|
-
phoneNumber: '',
|
|
24
|
-
showNotification: true,
|
|
25
|
-
intervalMs: 180000,
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Client status
|
|
31
|
-
* @readonly
|
|
32
|
-
* @enum {number}
|
|
33
|
-
*/
|
|
34
|
-
exports.Status = {
|
|
35
|
-
INITIALIZING: 0,
|
|
36
|
-
AUTHENTICATING: 1,
|
|
37
|
-
READY: 3
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Events that can be emitted by the client
|
|
42
|
-
* @readonly
|
|
43
|
-
* @enum {string}
|
|
44
|
-
*/
|
|
45
|
-
exports.Events = {
|
|
46
|
-
AUTHENTICATED: 'authenticated',
|
|
47
|
-
AUTHENTICATION_FAILURE: 'auth_failure',
|
|
48
|
-
READY: 'ready',
|
|
49
|
-
CHAT_REMOVED: 'chat_removed',
|
|
50
|
-
CHAT_ARCHIVED: 'chat_archived',
|
|
51
|
-
MESSAGE_RECEIVED: 'message',
|
|
52
|
-
MESSAGE_CIPHERTEXT: 'message_ciphertext',
|
|
53
|
-
MESSAGE_CREATE: 'message_create',
|
|
54
|
-
MESSAGE_REVOKED_EVERYONE: 'message_revoke_everyone',
|
|
55
|
-
MESSAGE_REVOKED_ME: 'message_revoke_me',
|
|
56
|
-
MESSAGE_ACK: 'message_ack',
|
|
57
|
-
MESSAGE_EDIT: 'message_edit',
|
|
58
|
-
UNREAD_COUNT: 'unread_count',
|
|
59
|
-
MESSAGE_REACTION: 'message_reaction',
|
|
60
|
-
MEDIA_UPLOADED: 'media_uploaded',
|
|
61
|
-
CONTACT_CHANGED: 'contact_changed',
|
|
62
|
-
GROUP_JOIN: 'group_join',
|
|
63
|
-
GROUP_LEAVE: 'group_leave',
|
|
64
|
-
GROUP_ADMIN_CHANGED: 'group_admin_changed',
|
|
65
|
-
GROUP_MEMBERSHIP_REQUEST: 'group_membership_request',
|
|
66
|
-
GROUP_UPDATE: 'group_update',
|
|
67
|
-
QR_RECEIVED: 'qr',
|
|
68
|
-
CODE_RECEIVED: 'code',
|
|
69
|
-
LOADING_SCREEN: 'loading_screen',
|
|
70
|
-
DISCONNECTED: 'disconnected',
|
|
71
|
-
STATE_CHANGED: 'change_state',
|
|
72
|
-
BATTERY_CHANGED: 'change_battery',
|
|
73
|
-
INCOMING_CALL: 'call',
|
|
74
|
-
REMOTE_SESSION_SAVED: 'remote_session_saved',
|
|
75
|
-
VOTE_UPDATE: 'vote_update'
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Message types
|
|
80
|
-
* @readonly
|
|
81
|
-
* @enum {string}
|
|
82
|
-
*/
|
|
83
|
-
exports.MessageTypes = {
|
|
84
|
-
TEXT: 'chat',
|
|
85
|
-
AUDIO: 'audio',
|
|
86
|
-
VOICE: 'ptt',
|
|
87
|
-
IMAGE: 'image',
|
|
88
|
-
VIDEO: 'video',
|
|
89
|
-
DOCUMENT: 'document',
|
|
90
|
-
STICKER: 'sticker',
|
|
91
|
-
LOCATION: 'location',
|
|
92
|
-
CONTACT_CARD: 'vcard',
|
|
93
|
-
CONTACT_CARD_MULTI: 'multi_vcard',
|
|
94
|
-
ORDER: 'order',
|
|
95
|
-
REVOKED: 'revoked',
|
|
96
|
-
PRODUCT: 'product',
|
|
97
|
-
UNKNOWN: 'unknown',
|
|
98
|
-
GROUP_INVITE: 'groups_v4_invite',
|
|
99
|
-
LIST: 'list',
|
|
100
|
-
LIST_RESPONSE: 'list_response',
|
|
101
|
-
BUTTONS_RESPONSE: 'buttons_response',
|
|
102
|
-
PAYMENT: 'payment',
|
|
103
|
-
BROADCAST_NOTIFICATION: 'broadcast_notification',
|
|
104
|
-
CALL_LOG: 'call_log',
|
|
105
|
-
CIPHERTEXT: 'ciphertext',
|
|
106
|
-
DEBUG: 'debug',
|
|
107
|
-
E2E_NOTIFICATION: 'e2e_notification',
|
|
108
|
-
GP2: 'gp2',
|
|
109
|
-
GROUP_NOTIFICATION: 'group_notification',
|
|
110
|
-
HSM: 'hsm',
|
|
111
|
-
INTERACTIVE: 'interactive',
|
|
112
|
-
NATIVE_FLOW: 'native_flow',
|
|
113
|
-
NOTIFICATION: 'notification',
|
|
114
|
-
NOTIFICATION_TEMPLATE: 'notification_template',
|
|
115
|
-
OVERSIZED: 'oversized',
|
|
116
|
-
PROTOCOL: 'protocol',
|
|
117
|
-
REACTION: 'reaction',
|
|
118
|
-
TEMPLATE_BUTTON_REPLY: 'template_button_reply',
|
|
119
|
-
POLL_CREATION: 'poll_creation',
|
|
120
|
-
SCHEDULED_EVENT_CREATION: 'scheduled_event_creation',
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Group notification types
|
|
125
|
-
* @readonly
|
|
126
|
-
* @enum {string}
|
|
127
|
-
*/
|
|
128
|
-
exports.GroupNotificationTypes = {
|
|
129
|
-
ADD: 'add',
|
|
130
|
-
INVITE: 'invite',
|
|
131
|
-
REMOVE: 'remove',
|
|
132
|
-
LEAVE: 'leave',
|
|
133
|
-
SUBJECT: 'subject',
|
|
134
|
-
DESCRIPTION: 'description',
|
|
135
|
-
PICTURE: 'picture',
|
|
136
|
-
ANNOUNCE: 'announce',
|
|
137
|
-
RESTRICT: 'restrict',
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Chat types
|
|
142
|
-
* @readonly
|
|
143
|
-
* @enum {string}
|
|
144
|
-
*/
|
|
145
|
-
exports.ChatTypes = {
|
|
146
|
-
SOLO: 'solo',
|
|
147
|
-
GROUP: 'group',
|
|
148
|
-
UNKNOWN: 'unknown'
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* WhatsApp state
|
|
153
|
-
* @readonly
|
|
154
|
-
* @enum {string}
|
|
155
|
-
*/
|
|
156
|
-
exports.WAState = {
|
|
157
|
-
CONFLICT: 'CONFLICT',
|
|
158
|
-
CONNECTED: 'CONNECTED',
|
|
159
|
-
DEPRECATED_VERSION: 'DEPRECATED_VERSION',
|
|
160
|
-
OPENING: 'OPENING',
|
|
161
|
-
PAIRING: 'PAIRING',
|
|
162
|
-
PROXYBLOCK: 'PROXYBLOCK',
|
|
163
|
-
SMB_TOS_BLOCK: 'SMB_TOS_BLOCK',
|
|
164
|
-
TIMEOUT: 'TIMEOUT',
|
|
165
|
-
TOS_BLOCK: 'TOS_BLOCK',
|
|
166
|
-
UNLAUNCHED: 'UNLAUNCHED',
|
|
167
|
-
UNPAIRED: 'UNPAIRED',
|
|
168
|
-
UNPAIRED_IDLE: 'UNPAIRED_IDLE'
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Message ACK
|
|
173
|
-
* @readonly
|
|
174
|
-
* @enum {number}
|
|
175
|
-
*/
|
|
176
|
-
exports.MessageAck = {
|
|
177
|
-
ACK_ERROR: -1,
|
|
178
|
-
ACK_PENDING: 0,
|
|
179
|
-
ACK_SERVER: 1,
|
|
180
|
-
ACK_DEVICE: 2,
|
|
181
|
-
ACK_READ: 3,
|
|
182
|
-
ACK_PLAYED: 4,
|
|
183
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.WhatsWebURL = 'https://web.whatsapp.com/';
|
|
4
|
+
|
|
5
|
+
exports.DefaultOptions = {
|
|
6
|
+
puppeteer: {
|
|
7
|
+
headless: true,
|
|
8
|
+
defaultViewport: null
|
|
9
|
+
},
|
|
10
|
+
webVersion: '2.3000.1017054665',
|
|
11
|
+
webVersionCache: {
|
|
12
|
+
type: 'local',
|
|
13
|
+
},
|
|
14
|
+
authTimeoutMs: 0,
|
|
15
|
+
qrMaxRetries: 0,
|
|
16
|
+
takeoverOnConflict: false,
|
|
17
|
+
takeoverTimeoutMs: 0,
|
|
18
|
+
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36',
|
|
19
|
+
ffmpegPath: 'ffmpeg',
|
|
20
|
+
bypassCSP: false,
|
|
21
|
+
proxyAuthentication: undefined,
|
|
22
|
+
pairWithPhoneNumber: {
|
|
23
|
+
phoneNumber: '',
|
|
24
|
+
showNotification: true,
|
|
25
|
+
intervalMs: 180000,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Client status
|
|
31
|
+
* @readonly
|
|
32
|
+
* @enum {number}
|
|
33
|
+
*/
|
|
34
|
+
exports.Status = {
|
|
35
|
+
INITIALIZING: 0,
|
|
36
|
+
AUTHENTICATING: 1,
|
|
37
|
+
READY: 3
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Events that can be emitted by the client
|
|
42
|
+
* @readonly
|
|
43
|
+
* @enum {string}
|
|
44
|
+
*/
|
|
45
|
+
exports.Events = {
|
|
46
|
+
AUTHENTICATED: 'authenticated',
|
|
47
|
+
AUTHENTICATION_FAILURE: 'auth_failure',
|
|
48
|
+
READY: 'ready',
|
|
49
|
+
CHAT_REMOVED: 'chat_removed',
|
|
50
|
+
CHAT_ARCHIVED: 'chat_archived',
|
|
51
|
+
MESSAGE_RECEIVED: 'message',
|
|
52
|
+
MESSAGE_CIPHERTEXT: 'message_ciphertext',
|
|
53
|
+
MESSAGE_CREATE: 'message_create',
|
|
54
|
+
MESSAGE_REVOKED_EVERYONE: 'message_revoke_everyone',
|
|
55
|
+
MESSAGE_REVOKED_ME: 'message_revoke_me',
|
|
56
|
+
MESSAGE_ACK: 'message_ack',
|
|
57
|
+
MESSAGE_EDIT: 'message_edit',
|
|
58
|
+
UNREAD_COUNT: 'unread_count',
|
|
59
|
+
MESSAGE_REACTION: 'message_reaction',
|
|
60
|
+
MEDIA_UPLOADED: 'media_uploaded',
|
|
61
|
+
CONTACT_CHANGED: 'contact_changed',
|
|
62
|
+
GROUP_JOIN: 'group_join',
|
|
63
|
+
GROUP_LEAVE: 'group_leave',
|
|
64
|
+
GROUP_ADMIN_CHANGED: 'group_admin_changed',
|
|
65
|
+
GROUP_MEMBERSHIP_REQUEST: 'group_membership_request',
|
|
66
|
+
GROUP_UPDATE: 'group_update',
|
|
67
|
+
QR_RECEIVED: 'qr',
|
|
68
|
+
CODE_RECEIVED: 'code',
|
|
69
|
+
LOADING_SCREEN: 'loading_screen',
|
|
70
|
+
DISCONNECTED: 'disconnected',
|
|
71
|
+
STATE_CHANGED: 'change_state',
|
|
72
|
+
BATTERY_CHANGED: 'change_battery',
|
|
73
|
+
INCOMING_CALL: 'call',
|
|
74
|
+
REMOTE_SESSION_SAVED: 'remote_session_saved',
|
|
75
|
+
VOTE_UPDATE: 'vote_update'
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Message types
|
|
80
|
+
* @readonly
|
|
81
|
+
* @enum {string}
|
|
82
|
+
*/
|
|
83
|
+
exports.MessageTypes = {
|
|
84
|
+
TEXT: 'chat',
|
|
85
|
+
AUDIO: 'audio',
|
|
86
|
+
VOICE: 'ptt',
|
|
87
|
+
IMAGE: 'image',
|
|
88
|
+
VIDEO: 'video',
|
|
89
|
+
DOCUMENT: 'document',
|
|
90
|
+
STICKER: 'sticker',
|
|
91
|
+
LOCATION: 'location',
|
|
92
|
+
CONTACT_CARD: 'vcard',
|
|
93
|
+
CONTACT_CARD_MULTI: 'multi_vcard',
|
|
94
|
+
ORDER: 'order',
|
|
95
|
+
REVOKED: 'revoked',
|
|
96
|
+
PRODUCT: 'product',
|
|
97
|
+
UNKNOWN: 'unknown',
|
|
98
|
+
GROUP_INVITE: 'groups_v4_invite',
|
|
99
|
+
LIST: 'list',
|
|
100
|
+
LIST_RESPONSE: 'list_response',
|
|
101
|
+
BUTTONS_RESPONSE: 'buttons_response',
|
|
102
|
+
PAYMENT: 'payment',
|
|
103
|
+
BROADCAST_NOTIFICATION: 'broadcast_notification',
|
|
104
|
+
CALL_LOG: 'call_log',
|
|
105
|
+
CIPHERTEXT: 'ciphertext',
|
|
106
|
+
DEBUG: 'debug',
|
|
107
|
+
E2E_NOTIFICATION: 'e2e_notification',
|
|
108
|
+
GP2: 'gp2',
|
|
109
|
+
GROUP_NOTIFICATION: 'group_notification',
|
|
110
|
+
HSM: 'hsm',
|
|
111
|
+
INTERACTIVE: 'interactive',
|
|
112
|
+
NATIVE_FLOW: 'native_flow',
|
|
113
|
+
NOTIFICATION: 'notification',
|
|
114
|
+
NOTIFICATION_TEMPLATE: 'notification_template',
|
|
115
|
+
OVERSIZED: 'oversized',
|
|
116
|
+
PROTOCOL: 'protocol',
|
|
117
|
+
REACTION: 'reaction',
|
|
118
|
+
TEMPLATE_BUTTON_REPLY: 'template_button_reply',
|
|
119
|
+
POLL_CREATION: 'poll_creation',
|
|
120
|
+
SCHEDULED_EVENT_CREATION: 'scheduled_event_creation',
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Group notification types
|
|
125
|
+
* @readonly
|
|
126
|
+
* @enum {string}
|
|
127
|
+
*/
|
|
128
|
+
exports.GroupNotificationTypes = {
|
|
129
|
+
ADD: 'add',
|
|
130
|
+
INVITE: 'invite',
|
|
131
|
+
REMOVE: 'remove',
|
|
132
|
+
LEAVE: 'leave',
|
|
133
|
+
SUBJECT: 'subject',
|
|
134
|
+
DESCRIPTION: 'description',
|
|
135
|
+
PICTURE: 'picture',
|
|
136
|
+
ANNOUNCE: 'announce',
|
|
137
|
+
RESTRICT: 'restrict',
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Chat types
|
|
142
|
+
* @readonly
|
|
143
|
+
* @enum {string}
|
|
144
|
+
*/
|
|
145
|
+
exports.ChatTypes = {
|
|
146
|
+
SOLO: 'solo',
|
|
147
|
+
GROUP: 'group',
|
|
148
|
+
UNKNOWN: 'unknown'
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* WhatsApp state
|
|
153
|
+
* @readonly
|
|
154
|
+
* @enum {string}
|
|
155
|
+
*/
|
|
156
|
+
exports.WAState = {
|
|
157
|
+
CONFLICT: 'CONFLICT',
|
|
158
|
+
CONNECTED: 'CONNECTED',
|
|
159
|
+
DEPRECATED_VERSION: 'DEPRECATED_VERSION',
|
|
160
|
+
OPENING: 'OPENING',
|
|
161
|
+
PAIRING: 'PAIRING',
|
|
162
|
+
PROXYBLOCK: 'PROXYBLOCK',
|
|
163
|
+
SMB_TOS_BLOCK: 'SMB_TOS_BLOCK',
|
|
164
|
+
TIMEOUT: 'TIMEOUT',
|
|
165
|
+
TOS_BLOCK: 'TOS_BLOCK',
|
|
166
|
+
UNLAUNCHED: 'UNLAUNCHED',
|
|
167
|
+
UNPAIRED: 'UNPAIRED',
|
|
168
|
+
UNPAIRED_IDLE: 'UNPAIRED_IDLE'
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Message ACK
|
|
173
|
+
* @readonly
|
|
174
|
+
* @enum {number}
|
|
175
|
+
*/
|
|
176
|
+
exports.MessageAck = {
|
|
177
|
+
ACK_ERROR: -1,
|
|
178
|
+
ACK_PENDING: 0,
|
|
179
|
+
ACK_SERVER: 1,
|
|
180
|
+
ACK_DEVICE: 2,
|
|
181
|
+
ACK_READ: 3,
|
|
182
|
+
ACK_PLAYED: 4,
|
|
183
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
exports.ExposeAuthStore = () => {
|
|
4
|
-
window.AuthStore = {};
|
|
5
|
-
window.AuthStore.AppState = window.require('WAWebSocketModel').Socket;
|
|
6
|
-
window.AuthStore.Cmd = window.require('WAWebCmd').Cmd;
|
|
7
|
-
window.AuthStore.Conn = window.require('WAWebConnModel').Conn;
|
|
8
|
-
window.AuthStore.OfflineMessageHandler = window.require('WAWebOfflineHandler').OfflineMessageHandler;
|
|
9
|
-
window.AuthStore.PairingCodeLinkUtils = window.require('WAWebAltDeviceLinkingApi');
|
|
10
|
-
window.AuthStore.Base64Tools = window.require('WABase64');
|
|
11
|
-
window.AuthStore.RegistrationUtils = {
|
|
12
|
-
...window.require('WAWebCompanionRegClientUtils'),
|
|
13
|
-
...window.require('WAWebAdvSignatureApi'),
|
|
14
|
-
...window.require('WAWebUserPrefsInfoStore'),
|
|
15
|
-
...window.require('WAWebSignalStoreApi'),
|
|
16
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.ExposeAuthStore = () => {
|
|
4
|
+
window.AuthStore = {};
|
|
5
|
+
window.AuthStore.AppState = window.require('WAWebSocketModel').Socket;
|
|
6
|
+
window.AuthStore.Cmd = window.require('WAWebCmd').Cmd;
|
|
7
|
+
window.AuthStore.Conn = window.require('WAWebConnModel').Conn;
|
|
8
|
+
window.AuthStore.OfflineMessageHandler = window.require('WAWebOfflineHandler').OfflineMessageHandler;
|
|
9
|
+
window.AuthStore.PairingCodeLinkUtils = window.require('WAWebAltDeviceLinkingApi');
|
|
10
|
+
window.AuthStore.Base64Tools = window.require('WABase64');
|
|
11
|
+
window.AuthStore.RegistrationUtils = {
|
|
12
|
+
...window.require('WAWebCompanionRegClientUtils'),
|
|
13
|
+
...window.require('WAWebAdvSignatureApi'),
|
|
14
|
+
...window.require('WAWebUserPrefsInfoStore'),
|
|
15
|
+
...window.require('WAWebSignalStoreApi'),
|
|
16
|
+
};
|
|
17
17
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
//TODO: To be removed by version 2.3000.x hard release
|
|
4
|
-
|
|
5
|
-
exports.ExposeLegacyAuthStore = (moduleRaidStr) => {
|
|
6
|
-
eval('var moduleRaid = ' + moduleRaidStr);
|
|
7
|
-
// eslint-disable-next-line no-undef
|
|
8
|
-
window.mR = moduleRaid();
|
|
9
|
-
window.AuthStore = {};
|
|
10
|
-
window.AuthStore.AppState = window.mR.findModule('Socket')[0].Socket;
|
|
11
|
-
window.AuthStore.Cmd = window.mR.findModule('Cmd')[0].Cmd;
|
|
12
|
-
window.AuthStore.Conn = window.mR.findModule('Conn')[0].Conn;
|
|
13
|
-
window.AuthStore.OfflineMessageHandler = window.mR.findModule('OfflineMessageHandler')[0].OfflineMessageHandler;
|
|
14
|
-
window.AuthStore.PairingCodeLinkUtils = window.mR.findModule('initializeAltDeviceLinking')[0];
|
|
15
|
-
window.AuthStore.Base64Tools = window.mR.findModule('encodeB64')[0];
|
|
16
|
-
window.AuthStore.RegistrationUtils = {
|
|
17
|
-
...window.mR.findModule('getCompanionWebClientFromBrowser')[0],
|
|
18
|
-
...window.mR.findModule('verifyKeyIndexListAccountSignature')[0],
|
|
19
|
-
...window.mR.findModule('waNoiseInfo')[0],
|
|
20
|
-
...window.mR.findModule('waSignalStore')[0],
|
|
21
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
//TODO: To be removed by version 2.3000.x hard release
|
|
4
|
+
|
|
5
|
+
exports.ExposeLegacyAuthStore = (moduleRaidStr) => {
|
|
6
|
+
eval('var moduleRaid = ' + moduleRaidStr);
|
|
7
|
+
// eslint-disable-next-line no-undef
|
|
8
|
+
window.mR = moduleRaid();
|
|
9
|
+
window.AuthStore = {};
|
|
10
|
+
window.AuthStore.AppState = window.mR.findModule('Socket')[0].Socket;
|
|
11
|
+
window.AuthStore.Cmd = window.mR.findModule('Cmd')[0].Cmd;
|
|
12
|
+
window.AuthStore.Conn = window.mR.findModule('Conn')[0].Conn;
|
|
13
|
+
window.AuthStore.OfflineMessageHandler = window.mR.findModule('OfflineMessageHandler')[0].OfflineMessageHandler;
|
|
14
|
+
window.AuthStore.PairingCodeLinkUtils = window.mR.findModule('initializeAltDeviceLinking')[0];
|
|
15
|
+
window.AuthStore.Base64Tools = window.mR.findModule('encodeB64')[0];
|
|
16
|
+
window.AuthStore.RegistrationUtils = {
|
|
17
|
+
...window.mR.findModule('getCompanionWebClientFromBrowser')[0],
|
|
18
|
+
...window.mR.findModule('verifyKeyIndexListAccountSignature')[0],
|
|
19
|
+
...window.mR.findModule('waNoiseInfo')[0],
|
|
20
|
+
...window.mR.findModule('waSignalStore')[0],
|
|
21
|
+
};
|
|
22
22
|
};
|