@pontalabs/baileys 1.0.6 → 1.0.7
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 +839 -267
- package/WAProto/GenerateStatics.sh +4 -3
- package/WAProto/WAProto.proto +511 -1215
- package/WAProto/index.d.ts +55 -14017
- package/WAProto/index.js +29 -97689
- package/lib/Defaults/index.d.ts +74 -72
- package/lib/Defaults/index.js +108 -94
- package/lib/Signal/Group/ciphertext-message.d.ts +7 -8
- package/lib/Signal/Group/ciphertext-message.js +16 -9
- package/lib/Signal/Group/group-session-builder.d.ts +13 -11
- package/lib/Signal/Group/group-session-builder.js +61 -19
- package/lib/Signal/Group/group_cipher.d.ts +16 -14
- package/lib/Signal/Group/group_cipher.js +70 -41
- package/lib/Signal/Group/index.d.ts +11 -12
- package/lib/Signal/Group/index.js +61 -12
- package/lib/Signal/Group/keyhelper.d.ts +14 -9
- package/lib/Signal/Group/keyhelper.js +58 -10
- package/lib/Signal/Group/sender-chain-key.d.ts +13 -13
- package/lib/Signal/Group/sender-chain-key.js +34 -13
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -16
- package/lib/Signal/Group/sender-key-distribution-message.js +36 -28
- package/lib/Signal/Group/sender-key-message.d.ts +18 -18
- package/lib/Signal/Group/sender-key-message.js +45 -38
- package/lib/Signal/Group/sender-key-name.d.ts +15 -14
- package/lib/Signal/Group/sender-key-name.js +31 -20
- package/lib/Signal/Group/sender-key-record.d.ts +25 -24
- package/lib/Signal/Group/sender-key-record.js +35 -18
- package/lib/Signal/Group/sender-key-state.d.ts +34 -29
- package/lib/Signal/Group/sender-key-state.js +100 -37
- package/lib/Signal/Group/sender-message-key.d.ts +10 -11
- package/lib/Signal/Group/sender-message-key.js +22 -15
- package/lib/Signal/libsignal.d.ts +8 -5
- package/lib/Signal/libsignal.js +142 -288
- package/lib/Signal/lid-mapping.d.ts +28 -23
- package/lib/Signal/lid-mapping.js +184 -277
- package/lib/Socket/Client/index.d.ts +2 -3
- package/lib/Socket/Client/index.js +22 -3
- package/lib/Socket/Client/types.d.ts +15 -15
- package/lib/Socket/Client/types.js +15 -8
- package/lib/Socket/Client/websocket.d.ts +12 -12
- package/lib/Socket/Client/websocket.js +37 -29
- package/lib/Socket/business.d.ts +178 -208
- package/lib/Socket/business.js +127 -91
- package/lib/Socket/chats.d.ts +93 -120
- package/lib/Socket/chats.js +652 -727
- package/lib/Socket/community.js +10 -2
- package/lib/Socket/groups.d.ts +111 -143
- package/lib/Socket/groups.js +186 -165
- package/lib/Socket/index.d.ts +183 -252
- package/lib/Socket/index.js +18 -38
- package/lib/Socket/messages-recv.d.ts +167 -196
- package/lib/Socket/messages-recv.js +1567 -1443
- package/lib/Socket/messages-send.d.ts +158 -192
- package/lib/Socket/messages-send.js +1208 -1102
- package/lib/Socket/newsletter.d.ts +138 -163
- package/lib/Socket/newsletter.js +249 -153
- package/lib/Socket/socket.d.ts +36 -50
- package/lib/Socket/socket.js +820 -749
- package/lib/Store/index.d.ts +4 -4
- package/lib/Store/index.js +24 -4
- package/lib/Store/make-in-memory-store.d.ts +104 -44
- package/lib/Store/make-in-memory-store.js +213 -199
- package/lib/Store/make-ordered-dictionary.d.ts +12 -13
- package/lib/Store/make-ordered-dictionary.js +45 -38
- package/lib/Store/object-repository.d.ts +10 -11
- package/lib/Store/object-repository.js +16 -9
- package/lib/Types/Auth.d.ts +97 -93
- package/lib/Types/Auth.js +3 -2
- package/lib/Types/Bussines.js +3 -2
- package/lib/Types/Call.d.ts +13 -14
- package/lib/Types/Call.js +3 -2
- package/lib/Types/Chat.d.ts +97 -78
- package/lib/Types/Chat.js +9 -8
- package/lib/Types/Contact.d.ts +9 -12
- package/lib/Types/Contact.js +3 -2
- package/lib/Types/Events.d.ts +176 -206
- package/lib/Types/Events.js +3 -2
- package/lib/Types/GroupMetadata.d.ts +48 -53
- package/lib/Types/GroupMetadata.js +3 -2
- package/lib/Types/Label.d.ts +14 -13
- package/lib/Types/Label.js +30 -24
- package/lib/Types/LabelAssociation.d.ts +20 -15
- package/lib/Types/LabelAssociation.js +12 -6
- package/lib/Types/Message.d.ts +412 -248
- package/lib/Types/Message.js +19 -17
- package/lib/Types/Product.d.ts +71 -58
- package/lib/Types/Product.js +3 -2
- package/lib/Types/Signal.d.ts +82 -71
- package/lib/Types/Signal.js +3 -2
- package/lib/Types/Socket.d.ts +81 -76
- package/lib/Types/Socket.js +3 -3
- package/lib/Types/State.d.ts +19 -75
- package/lib/Types/State.js +14 -56
- package/lib/Types/USync.d.ts +8 -8
- package/lib/Types/USync.js +3 -2
- package/lib/Types/index.d.ts +62 -47
- package/lib/Types/index.js +50 -26
- package/lib/Utils/auth-utils.d.ts +10 -13
- package/lib/Utils/auth-utils.js +472 -213
- package/lib/Utils/business.d.ts +20 -14
- package/lib/Utils/business.js +134 -110
- package/lib/Utils/chat-utils.d.ts +70 -88
- package/lib/Utils/chat-utils.js +403 -466
- package/lib/Utils/crypto.d.ts +46 -27
- package/lib/Utils/crypto.js +188 -117
- package/lib/Utils/decode-wa-message.d.ts +45 -58
- package/lib/Utils/decode-wa-message.js +311 -212
- package/lib/Utils/event-buffer.d.ts +17 -14
- package/lib/Utils/event-buffer.js +296 -321
- package/lib/Utils/generics.d.ts +92 -66
- package/lib/Utils/generics.js +436 -270
- package/lib/Utils/history.d.ts +23 -24
- package/lib/Utils/history.js +76 -106
- package/lib/Utils/index.d.ts +21 -24
- package/lib/Utils/index.js +41 -24
- package/lib/Utils/link-preview.d.ts +14 -12
- package/lib/Utils/link-preview.js +75 -40
- package/lib/Utils/logger.d.ts +11 -10
- package/lib/Utils/logger.js +7 -3
- package/lib/Utils/lt-hash.d.ts +14 -8
- package/lib/Utils/lt-hash.js +53 -3
- package/lib/Utils/make-mutex.d.ts +7 -7
- package/lib/Utils/make-mutex.js +44 -28
- package/lib/Utils/message-retry-manager.d.ts +88 -115
- package/lib/Utils/message-retry-manager.js +160 -265
- package/lib/Utils/messages-media.d.ts +107 -105
- package/lib/Utils/messages-media.js +619 -548
- package/lib/Utils/messages.d.ts +66 -52
- package/lib/Utils/messages.js +1558 -1730
- package/lib/Utils/noise-handler.d.ts +18 -18
- package/lib/Utils/noise-handler.js +130 -176
- package/lib/Utils/process-message.d.ts +32 -43
- package/lib/Utils/process-message.js +282 -484
- package/lib/Utils/rich-message-utils.js +724 -1220
- package/lib/Utils/signal.d.ts +32 -37
- package/lib/Utils/signal.js +105 -140
- package/lib/Utils/use-multi-file-auth-state.d.ts +5 -5
- package/lib/Utils/use-multi-file-auth-state.js +120 -70
- package/lib/Utils/use-single-file-auth-state.d.ts +13 -11
- package/lib/Utils/use-single-file-auth-state.js +66 -92
- package/lib/Utils/validate-connection.d.ts +13 -11
- package/lib/Utils/validate-connection.js +113 -128
- package/lib/WABinary/constants.d.ts +27 -25
- package/lib/WABinary/constants.js +1292 -1451
- package/lib/WABinary/decode.d.ts +9 -7
- package/lib/WABinary/decode.js +189 -163
- package/lib/WABinary/encode.d.ts +3 -3
- package/lib/WABinary/encode.js +155 -110
- package/lib/WABinary/generic-utils.d.ts +27 -14
- package/lib/WABinary/generic-utils.js +105 -177
- package/lib/WABinary/index.d.ts +5 -6
- package/lib/WABinary/index.js +25 -6
- package/lib/WABinary/jid-utils.d.ts +54 -41
- package/lib/WABinary/jid-utils.js +152 -83
- package/lib/WABinary/types.d.ts +13 -10
- package/lib/WABinary/types.js +3 -2
- package/lib/WAM/BinaryInfo.d.ts +15 -8
- package/lib/WAM/BinaryInfo.js +14 -7
- package/lib/WAM/constants.d.ts +37 -30
- package/lib/WAM/constants.js +11983 -19465
- package/lib/WAM/encode.d.ts +3 -3
- package/lib/WAM/encode.js +109 -95
- package/lib/WAM/index.d.ts +3 -4
- package/lib/WAM/index.js +23 -4
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -9
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +21 -37
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -19
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +26 -18
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -11
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +20 -12
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -11
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +24 -16
- package/lib/WAUSync/Protocols/index.d.ts +6 -6
- package/lib/WAUSync/Protocols/index.js +26 -6
- package/lib/WAUSync/USyncQuery.d.ts +28 -27
- package/lib/WAUSync/USyncQuery.js +62 -68
- package/lib/WAUSync/USyncUser.d.ts +10 -15
- package/lib/WAUSync/USyncUser.js +19 -20
- package/lib/WAUSync/index.d.ts +3 -4
- package/lib/WAUSync/index.js +23 -4
- package/lib/index.d.ts +12 -11
- package/lib/index.js +39 -12
- package/package.json +42 -86
- package/engine-requirements.js +0 -10
package/lib/Types/State.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Boom } from '@hapi/boom'
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { Boom } from '@hapi/boom'
|
|
2
|
+
import { Contact } from './Contact'
|
|
3
|
+
|
|
4
|
+
export declare const enum SyncState {
|
|
4
5
|
/** The socket is connecting, but we haven't received pending notifications yet. */
|
|
5
6
|
Connecting = 0,
|
|
6
7
|
/** Pending notifications received. Buffering events until we decide whether to sync or not. */
|
|
@@ -10,88 +11,31 @@ export declare enum SyncState {
|
|
|
10
11
|
/** Initial sync is complete, or was skipped. The socket is fully operational and events are processed in real-time. */
|
|
11
12
|
Online = 3
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
+
|
|
15
|
+
export type WAConnectionState = 'open' | 'connecting' | 'close'
|
|
16
|
+
|
|
14
17
|
export type ConnectionState = {
|
|
15
18
|
/** connection is now open, connecting or closed */
|
|
16
|
-
connection: WAConnectionState
|
|
19
|
+
connection: WAConnectionState
|
|
17
20
|
/** the error that caused the connection to close */
|
|
18
21
|
lastDisconnect?: {
|
|
19
|
-
error: Boom | Error | undefined
|
|
20
|
-
date: Date
|
|
21
|
-
}
|
|
22
|
+
error: Boom | Error | undefined
|
|
23
|
+
date: Date
|
|
24
|
+
}
|
|
22
25
|
/** is this a new login */
|
|
23
|
-
isNewLogin?: boolean
|
|
26
|
+
isNewLogin?: boolean
|
|
24
27
|
/** the current QR code */
|
|
25
|
-
qr?: string
|
|
28
|
+
qr?: string
|
|
26
29
|
/** has the device received all pending notifications while it was offline */
|
|
27
|
-
receivedPendingNotifications?: boolean
|
|
30
|
+
receivedPendingNotifications?: boolean
|
|
28
31
|
/** legacy connection options */
|
|
29
32
|
legacy?: {
|
|
30
|
-
phoneConnected: boolean
|
|
31
|
-
user?: Contact
|
|
32
|
-
}
|
|
33
|
+
phoneConnected: boolean
|
|
34
|
+
user?: Contact
|
|
35
|
+
}
|
|
33
36
|
/**
|
|
34
37
|
* if the client is shown as an active, online client.
|
|
35
38
|
* If this is false, the primary phone and other devices will receive notifs
|
|
36
39
|
* */
|
|
37
|
-
isOnline?: boolean
|
|
38
|
-
|
|
39
|
-
* When you are in this state, WhatsApp prevents outgoing messages and calls.
|
|
40
|
-
*/
|
|
41
|
-
reachoutTimeLock?: ReachoutTimelockState;
|
|
42
|
-
};
|
|
43
|
-
export type ReachoutTimelockState = {
|
|
44
|
-
isActive?: boolean;
|
|
45
|
-
timeEnforcementEnds?: Date;
|
|
46
|
-
enforcementType?: ReachoutTimelockEnforcementType;
|
|
47
|
-
};
|
|
48
|
-
export declare enum ReachoutTimelockEnforcementType {
|
|
49
|
-
BIZ_COMMERCE_VIOLATION_ALCOHOL = "BIZ_COMMERCE_VIOLATION_ALCOHOL",
|
|
50
|
-
BIZ_COMMERCE_VIOLATION_ADULT = "BIZ_COMMERCE_VIOLATION_ADULT",
|
|
51
|
-
BIZ_COMMERCE_VIOLATION_ANIMALS = "BIZ_COMMERCE_VIOLATION_ANIMALS",
|
|
52
|
-
BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS = "BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS",
|
|
53
|
-
BIZ_COMMERCE_VIOLATION_DATING = "BIZ_COMMERCE_VIOLATION_DATING",
|
|
54
|
-
BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS = "BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS",
|
|
55
|
-
BIZ_COMMERCE_VIOLATION_DRUGS = "BIZ_COMMERCE_VIOLATION_DRUGS",
|
|
56
|
-
BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC = "BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC",
|
|
57
|
-
BIZ_COMMERCE_VIOLATION_GAMBLING = "BIZ_COMMERCE_VIOLATION_GAMBLING",
|
|
58
|
-
BIZ_COMMERCE_VIOLATION_HEALTHCARE = "BIZ_COMMERCE_VIOLATION_HEALTHCARE",
|
|
59
|
-
BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY = "BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY",
|
|
60
|
-
BIZ_COMMERCE_VIOLATION_SUPPLEMENTS = "BIZ_COMMERCE_VIOLATION_SUPPLEMENTS",
|
|
61
|
-
BIZ_COMMERCE_VIOLATION_TOBACCO = "BIZ_COMMERCE_VIOLATION_TOBACCO",
|
|
62
|
-
BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT = "BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT",
|
|
63
|
-
BIZ_COMMERCE_VIOLATION_WEAPONS = "BIZ_COMMERCE_VIOLATION_WEAPONS",
|
|
64
|
-
BIZ_QUALITY = "BIZ_QUALITY",
|
|
65
|
-
/** This means there is no restriction */
|
|
66
|
-
DEFAULT = "DEFAULT",
|
|
67
|
-
WEB_COMPANION_ONLY = "WEB_COMPANION_ONLY"
|
|
68
|
-
}
|
|
69
|
-
export declare enum NewChatMessageCappingStatusType {
|
|
70
|
-
NONE = "NONE",
|
|
71
|
-
FIRST_WARNING = "FIRST_WARNING",
|
|
72
|
-
SECOND_WARNING = "SECOND_WARNING",
|
|
73
|
-
CAPPED = "CAPPED"
|
|
74
|
-
}
|
|
75
|
-
export declare enum NewChatMessageCappingMVStatusType {
|
|
76
|
-
NOT_ELIGIBLE = "NOT_ELIGIBLE",
|
|
77
|
-
NOT_ACTIVE = "NOT_ACTIVE",
|
|
78
|
-
ACTIVE = "ACTIVE",
|
|
79
|
-
ACTIVE_UPGRADE_AVAILABLE = "ACTIVE_UPGRADE_AVAILABLE"
|
|
80
|
-
}
|
|
81
|
-
export declare enum NewChatMessageCappingOTEStatusType {
|
|
82
|
-
NOT_ELIGIBLE = "NOT_ELIGIBLE",
|
|
83
|
-
ELIGIBLE = "ELIGIBLE",
|
|
84
|
-
ACTIVE_IN_CURRENT_CYCLE = "ACTIVE_IN_CURRENT_CYCLE",
|
|
85
|
-
EXHAUSTED = "EXHAUSTED"
|
|
86
|
-
}
|
|
87
|
-
export type NewChatMessageCapInfo = {
|
|
88
|
-
total_quota?: number;
|
|
89
|
-
used_quota?: number;
|
|
90
|
-
cycle_start_timestamp?: string;
|
|
91
|
-
cycle_end_timestamp?: string;
|
|
92
|
-
server_sent_timestamp?: string;
|
|
93
|
-
ote_status?: NewChatMessageCappingOTEStatusType;
|
|
94
|
-
mv_status?: NewChatMessageCappingMVStatusType;
|
|
95
|
-
capping_status?: NewChatMessageCappingStatusType;
|
|
96
|
-
};
|
|
97
|
-
//# sourceMappingURL=State.d.ts.map
|
|
40
|
+
isOnline?: boolean
|
|
41
|
+
}
|
package/lib/Types/State.js
CHANGED
|
@@ -1,56 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ALCOHOL"] = "BIZ_COMMERCE_VIOLATION_ALCOHOL";
|
|
16
|
-
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ADULT"] = "BIZ_COMMERCE_VIOLATION_ADULT";
|
|
17
|
-
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ANIMALS"] = "BIZ_COMMERCE_VIOLATION_ANIMALS";
|
|
18
|
-
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS"] = "BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS";
|
|
19
|
-
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DATING"] = "BIZ_COMMERCE_VIOLATION_DATING";
|
|
20
|
-
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS"] = "BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS";
|
|
21
|
-
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DRUGS"] = "BIZ_COMMERCE_VIOLATION_DRUGS";
|
|
22
|
-
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC"] = "BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC";
|
|
23
|
-
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_GAMBLING"] = "BIZ_COMMERCE_VIOLATION_GAMBLING";
|
|
24
|
-
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_HEALTHCARE"] = "BIZ_COMMERCE_VIOLATION_HEALTHCARE";
|
|
25
|
-
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY"] = "BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY";
|
|
26
|
-
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_SUPPLEMENTS"] = "BIZ_COMMERCE_VIOLATION_SUPPLEMENTS";
|
|
27
|
-
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_TOBACCO"] = "BIZ_COMMERCE_VIOLATION_TOBACCO";
|
|
28
|
-
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT"] = "BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT";
|
|
29
|
-
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_WEAPONS"] = "BIZ_COMMERCE_VIOLATION_WEAPONS";
|
|
30
|
-
ReachoutTimelockEnforcementType["BIZ_QUALITY"] = "BIZ_QUALITY";
|
|
31
|
-
/** This means there is no restriction */
|
|
32
|
-
ReachoutTimelockEnforcementType["DEFAULT"] = "DEFAULT";
|
|
33
|
-
ReachoutTimelockEnforcementType["WEB_COMPANION_ONLY"] = "WEB_COMPANION_ONLY";
|
|
34
|
-
})(ReachoutTimelockEnforcementType || (ReachoutTimelockEnforcementType = {}));
|
|
35
|
-
export var NewChatMessageCappingStatusType;
|
|
36
|
-
(function (NewChatMessageCappingStatusType) {
|
|
37
|
-
NewChatMessageCappingStatusType["NONE"] = "NONE";
|
|
38
|
-
NewChatMessageCappingStatusType["FIRST_WARNING"] = "FIRST_WARNING";
|
|
39
|
-
NewChatMessageCappingStatusType["SECOND_WARNING"] = "SECOND_WARNING";
|
|
40
|
-
NewChatMessageCappingStatusType["CAPPED"] = "CAPPED";
|
|
41
|
-
})(NewChatMessageCappingStatusType || (NewChatMessageCappingStatusType = {}));
|
|
42
|
-
export var NewChatMessageCappingMVStatusType;
|
|
43
|
-
(function (NewChatMessageCappingMVStatusType) {
|
|
44
|
-
NewChatMessageCappingMVStatusType["NOT_ELIGIBLE"] = "NOT_ELIGIBLE";
|
|
45
|
-
NewChatMessageCappingMVStatusType["NOT_ACTIVE"] = "NOT_ACTIVE";
|
|
46
|
-
NewChatMessageCappingMVStatusType["ACTIVE"] = "ACTIVE";
|
|
47
|
-
NewChatMessageCappingMVStatusType["ACTIVE_UPGRADE_AVAILABLE"] = "ACTIVE_UPGRADE_AVAILABLE";
|
|
48
|
-
})(NewChatMessageCappingMVStatusType || (NewChatMessageCappingMVStatusType = {}));
|
|
49
|
-
export var NewChatMessageCappingOTEStatusType;
|
|
50
|
-
(function (NewChatMessageCappingOTEStatusType) {
|
|
51
|
-
NewChatMessageCappingOTEStatusType["NOT_ELIGIBLE"] = "NOT_ELIGIBLE";
|
|
52
|
-
NewChatMessageCappingOTEStatusType["ELIGIBLE"] = "ELIGIBLE";
|
|
53
|
-
NewChatMessageCappingOTEStatusType["ACTIVE_IN_CURRENT_CYCLE"] = "ACTIVE_IN_CURRENT_CYCLE";
|
|
54
|
-
NewChatMessageCappingOTEStatusType["EXHAUSTED"] = "EXHAUSTED";
|
|
55
|
-
})(NewChatMessageCappingOTEStatusType || (NewChatMessageCappingOTEStatusType = {}));
|
|
56
|
-
//# sourceMappingURL=State.js.map
|
|
1
|
+
"use strict"
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true })
|
|
4
|
+
|
|
5
|
+
const SyncState = {
|
|
6
|
+
Connecting: 0,
|
|
7
|
+
AwaitingInitialSync: 1,
|
|
8
|
+
Syncing: 2,
|
|
9
|
+
Online: 3
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
module.exports = {
|
|
13
|
+
SyncState
|
|
14
|
+
}
|
package/lib/Types/USync.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { USyncUser } from '../WAUSync
|
|
1
|
+
import { BinaryNode } from '../WABinary'
|
|
2
|
+
import { USyncUser } from '../WAUSync'
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Defines the interface for a USyncQuery protocol
|
|
5
6
|
*/
|
|
@@ -7,20 +8,19 @@ export interface USyncQueryProtocol {
|
|
|
7
8
|
/**
|
|
8
9
|
* The name of the protocol
|
|
9
10
|
*/
|
|
10
|
-
name: string
|
|
11
|
+
name: string
|
|
11
12
|
/**
|
|
12
13
|
* Defines what goes inside the query part of a USyncQuery
|
|
13
14
|
*/
|
|
14
|
-
getQueryElement: () => BinaryNode
|
|
15
|
+
getQueryElement: () => BinaryNode
|
|
15
16
|
/**
|
|
16
17
|
* Defines what goes inside the user part of a USyncQuery
|
|
17
18
|
*/
|
|
18
|
-
getUserElement: (user: USyncUser) => BinaryNode | null
|
|
19
|
+
getUserElement: (user: USyncUser) => BinaryNode | null
|
|
19
20
|
/**
|
|
20
21
|
* Parse the result of the query
|
|
21
22
|
* @param data Data from the result
|
|
22
23
|
* @returns Whatever the protocol is supposed to return
|
|
23
24
|
*/
|
|
24
|
-
parser: (data: BinaryNode) => unknown
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=USync.d.ts.map
|
|
25
|
+
parser: (data: BinaryNode) => unknown
|
|
26
|
+
}
|
package/lib/Types/USync.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict"
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true })
|
package/lib/Types/index.d.ts
CHANGED
|
@@ -1,28 +1,40 @@
|
|
|
1
|
-
export * from './Auth
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './Chat
|
|
4
|
-
export * from './Contact
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
export * from './Auth'
|
|
2
|
+
export * from './Bussines'
|
|
3
|
+
export * from './Chat'
|
|
4
|
+
export * from './Contact'
|
|
5
|
+
export * from './GroupMetadata'
|
|
6
|
+
export * from './State'
|
|
7
|
+
export * from './MexUpdates'
|
|
8
|
+
export * from './Message'
|
|
9
|
+
export * from './Newsletter'
|
|
10
|
+
export * from './Socket'
|
|
11
|
+
export * from './Events'
|
|
12
|
+
export * from './Product'
|
|
13
|
+
export * from './Call'
|
|
14
|
+
export * from './Signal'
|
|
15
|
+
|
|
16
|
+
import { AuthenticationState } from './Auth'
|
|
17
|
+
import { SocketConfig } from './Socket'
|
|
18
|
+
|
|
15
19
|
export type UserFacingSocketConfig = Partial<SocketConfig> & {
|
|
16
|
-
auth: AuthenticationState
|
|
17
|
-
}
|
|
20
|
+
auth: AuthenticationState
|
|
21
|
+
}
|
|
22
|
+
|
|
18
23
|
export type BrowsersMap = {
|
|
19
|
-
ubuntu(browser: string): [string, string, string]
|
|
20
|
-
macOS(browser: string): [string, string, string]
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
ubuntu(browser: string): [string, string, string]
|
|
25
|
+
macOS(browser: string): [string, string, string]
|
|
26
|
+
windows(browser: string): [string, string, string]
|
|
27
|
+
linux(browser: string): [string, string, string]
|
|
28
|
+
android(browser: string): [string, string, string]
|
|
29
|
+
iOS(browser: string): [string, string, string]
|
|
30
|
+
baileys(browser: string): [string, string, string]
|
|
31
|
+
kaiOS(browser: string): [string, string, string]
|
|
32
|
+
chromeOS(browser: string): [string, string, string]
|
|
33
|
+
appropriate(browser: string): [string, string, string]
|
|
34
|
+
custom(platform: string, browser: string, version: string): [string, string, string]
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export declare const enum DisconnectReason {
|
|
26
38
|
connectionClosed = 428,
|
|
27
39
|
connectionLost = 408,
|
|
28
40
|
connectionReplaced = 440,
|
|
@@ -34,32 +46,35 @@ export declare enum DisconnectReason {
|
|
|
34
46
|
forbidden = 403,
|
|
35
47
|
unavailableService = 503
|
|
36
48
|
}
|
|
49
|
+
|
|
37
50
|
export type WAInitResponse = {
|
|
38
|
-
ref: string
|
|
39
|
-
ttl: number
|
|
40
|
-
status: 200
|
|
41
|
-
}
|
|
51
|
+
ref: string
|
|
52
|
+
ttl: number
|
|
53
|
+
status: 200
|
|
54
|
+
}
|
|
55
|
+
|
|
42
56
|
export type WABusinessHoursConfig = {
|
|
43
|
-
day_of_week: string
|
|
44
|
-
mode: string
|
|
45
|
-
open_time?: number
|
|
46
|
-
close_time?: number
|
|
47
|
-
}
|
|
57
|
+
day_of_week: string
|
|
58
|
+
mode: string
|
|
59
|
+
open_time?: number
|
|
60
|
+
close_time?: number
|
|
61
|
+
}
|
|
62
|
+
|
|
48
63
|
export type WABusinessProfile = {
|
|
49
|
-
description: string
|
|
50
|
-
email: string | undefined
|
|
64
|
+
description: string
|
|
65
|
+
email: string | undefined
|
|
51
66
|
business_hours: {
|
|
52
|
-
timezone?: string
|
|
53
|
-
config?: WABusinessHoursConfig[]
|
|
54
|
-
business_config?: WABusinessHoursConfig[]
|
|
55
|
-
}
|
|
56
|
-
website: string[]
|
|
57
|
-
category?: string
|
|
58
|
-
wid?: string
|
|
59
|
-
address?: string
|
|
60
|
-
}
|
|
67
|
+
timezone?: string
|
|
68
|
+
config?: WABusinessHoursConfig[]
|
|
69
|
+
business_config?: WABusinessHoursConfig[]
|
|
70
|
+
}
|
|
71
|
+
website: string[]
|
|
72
|
+
category?: string
|
|
73
|
+
wid?: string
|
|
74
|
+
address?: string
|
|
75
|
+
}
|
|
76
|
+
|
|
61
77
|
export type CurveKeyPair = {
|
|
62
|
-
private: Uint8Array
|
|
63
|
-
public: Uint8Array
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=index.d.ts.map
|
|
78
|
+
private: Uint8Array
|
|
79
|
+
public: Uint8Array
|
|
80
|
+
}
|
package/lib/Types/index.js
CHANGED
|
@@ -1,26 +1,50 @@
|
|
|
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
|
-
|
|
1
|
+
"use strict"
|
|
2
|
+
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k)
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k] } }
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc)
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k
|
|
12
|
+
o[k2] = m[k]
|
|
13
|
+
}))
|
|
14
|
+
|
|
15
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true })
|
|
20
|
+
|
|
21
|
+
exports.DisconnectReason = void 0
|
|
22
|
+
__exportStar(require("./Auth"), exports)
|
|
23
|
+
__exportStar(require("./Bussines"), exports)
|
|
24
|
+
__exportStar(require("./Chat"), exports)
|
|
25
|
+
__exportStar(require("./Contact"), exports)
|
|
26
|
+
__exportStar(require("./GroupMetadata"), exports)
|
|
27
|
+
__exportStar(require("./State"), exports)
|
|
28
|
+
__exportStar(require("./MexUpdates"), exports)
|
|
29
|
+
__exportStar(require("./Message"), exports)
|
|
30
|
+
__exportStar(require("./Newsletter"), exports)
|
|
31
|
+
__exportStar(require("./Socket"), exports)
|
|
32
|
+
__exportStar(require("./Events"), exports)
|
|
33
|
+
__exportStar(require("./Product"), exports)
|
|
34
|
+
__exportStar(require("./Call"), exports)
|
|
35
|
+
__exportStar(require("./Signal"), exports)
|
|
36
|
+
|
|
37
|
+
const DisconnectReason = {
|
|
38
|
+
connectionClosed: 428,
|
|
39
|
+
connectionLost: 408,
|
|
40
|
+
connectionReplaced: 440,
|
|
41
|
+
timedOut: 408,
|
|
42
|
+
loggedOut: 401,
|
|
43
|
+
badSession: 500,
|
|
44
|
+
restartRequired: 515,
|
|
45
|
+
multideviceMismatch: 411,
|
|
46
|
+
forbidden: 403,
|
|
47
|
+
unavailableService: 503
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
exports.DisconnectReason = DisconnectReason
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
import type { AuthenticationCreds, CacheStore, SignalKeyStore, SignalKeyStoreWithTransaction, TransactionCapabilityOptions } from '../Types
|
|
2
|
-
import
|
|
1
|
+
import type { AuthenticationCreds, CacheStore, SignalKeyStore, SignalKeyStoreWithTransaction, TransactionCapabilityOptions } from '../Types'
|
|
2
|
+
import { ILogger } from './logger'
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Adds caching capability to a SignalKeyStore
|
|
5
6
|
* @param store the store to add caching to
|
|
6
7
|
* @param logger to log trace events
|
|
7
8
|
* @param _cache cache store to use
|
|
8
9
|
*/
|
|
9
|
-
export declare function makeCacheableSignalKeyStore(store: SignalKeyStore, logger?: ILogger, _cache?: CacheStore): SignalKeyStore
|
|
10
|
+
export declare function makeCacheableSignalKeyStore(store: SignalKeyStore, logger?: ILogger, _cache?: CacheStore): SignalKeyStore
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
|
-
* Adds DB
|
|
12
|
-
*
|
|
13
|
+
* Adds DB like transaction capability (https://en.wikipedia.org/wiki/Database_transaction) to the SignalKeyStore,
|
|
14
|
+
* this allows batch read & write operations & improves the performance of the lib
|
|
13
15
|
* @param state the key store to apply this capability to
|
|
14
16
|
* @param logger logger to log events
|
|
15
17
|
* @returns SignalKeyStore with transaction capability
|
|
16
18
|
*/
|
|
17
|
-
export declare const addTransactionCapability: (state: SignalKeyStore, logger
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* Use this anywhere we'd otherwise reach for `creds.me!.id` to fail fast with a descriptive error.
|
|
21
|
-
*/
|
|
22
|
-
export declare const assertMeId: (creds: AuthenticationCreds) => string;
|
|
23
|
-
export declare const initAuthCreds: () => AuthenticationCreds;
|
|
24
|
-
//# sourceMappingURL=auth-utils.d.ts.map
|
|
19
|
+
export declare const addTransactionCapability: (state: SignalKeyStore, logger?: ILogger, { maxCommitRetries, delayBetweenTriesMs }: TransactionCapabilityOptions) => SignalKeyStoreWithTransaction
|
|
20
|
+
|
|
21
|
+
export declare const initAuthCreds: () => AuthenticationCreds
|