@pontalabs/baileys 1.0.6 → 1.0.8

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.
Files changed (185) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +839 -267
  3. package/WAProto/GenerateStatics.sh +4 -3
  4. package/WAProto/WAProto.proto +511 -1215
  5. package/WAProto/index.d.ts +55 -14017
  6. package/WAProto/index.js +29 -97689
  7. package/lib/Defaults/index.d.ts +74 -72
  8. package/lib/Defaults/index.js +108 -94
  9. package/lib/Signal/Group/ciphertext-message.d.ts +7 -8
  10. package/lib/Signal/Group/ciphertext-message.js +16 -9
  11. package/lib/Signal/Group/group-session-builder.d.ts +13 -11
  12. package/lib/Signal/Group/group-session-builder.js +61 -19
  13. package/lib/Signal/Group/group_cipher.d.ts +16 -14
  14. package/lib/Signal/Group/group_cipher.js +70 -41
  15. package/lib/Signal/Group/index.d.ts +11 -12
  16. package/lib/Signal/Group/index.js +61 -12
  17. package/lib/Signal/Group/keyhelper.d.ts +14 -9
  18. package/lib/Signal/Group/keyhelper.js +58 -10
  19. package/lib/Signal/Group/sender-chain-key.d.ts +13 -13
  20. package/lib/Signal/Group/sender-chain-key.js +34 -13
  21. package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -16
  22. package/lib/Signal/Group/sender-key-distribution-message.js +36 -28
  23. package/lib/Signal/Group/sender-key-message.d.ts +18 -18
  24. package/lib/Signal/Group/sender-key-message.js +45 -38
  25. package/lib/Signal/Group/sender-key-name.d.ts +15 -14
  26. package/lib/Signal/Group/sender-key-name.js +31 -20
  27. package/lib/Signal/Group/sender-key-record.d.ts +25 -24
  28. package/lib/Signal/Group/sender-key-record.js +35 -18
  29. package/lib/Signal/Group/sender-key-state.d.ts +34 -29
  30. package/lib/Signal/Group/sender-key-state.js +100 -37
  31. package/lib/Signal/Group/sender-message-key.d.ts +10 -11
  32. package/lib/Signal/Group/sender-message-key.js +22 -15
  33. package/lib/Signal/libsignal.d.ts +8 -5
  34. package/lib/Signal/libsignal.js +142 -288
  35. package/lib/Signal/lid-mapping.d.ts +28 -23
  36. package/lib/Signal/lid-mapping.js +184 -277
  37. package/lib/Socket/Client/index.d.ts +2 -3
  38. package/lib/Socket/Client/index.js +22 -3
  39. package/lib/Socket/Client/types.d.ts +15 -15
  40. package/lib/Socket/Client/types.js +15 -8
  41. package/lib/Socket/Client/websocket.d.ts +12 -12
  42. package/lib/Socket/Client/websocket.js +37 -29
  43. package/lib/Socket/business.d.ts +178 -208
  44. package/lib/Socket/business.js +127 -91
  45. package/lib/Socket/chats.d.ts +93 -120
  46. package/lib/Socket/chats.js +652 -727
  47. package/lib/Socket/community.js +10 -2
  48. package/lib/Socket/groups.d.ts +111 -143
  49. package/lib/Socket/groups.js +186 -165
  50. package/lib/Socket/index.d.ts +183 -252
  51. package/lib/Socket/index.js +18 -38
  52. package/lib/Socket/messages-recv.d.ts +167 -196
  53. package/lib/Socket/messages-recv.js +1567 -1443
  54. package/lib/Socket/messages-send.d.ts +158 -192
  55. package/lib/Socket/messages-send.js +1208 -1102
  56. package/lib/Socket/newsletter.d.ts +138 -163
  57. package/lib/Socket/newsletter.js +249 -153
  58. package/lib/Socket/socket.d.ts +36 -50
  59. package/lib/Socket/socket.js +820 -749
  60. package/lib/Store/index.d.ts +4 -4
  61. package/lib/Store/index.js +24 -4
  62. package/lib/Store/make-in-memory-store.d.ts +104 -44
  63. package/lib/Store/make-in-memory-store.js +213 -199
  64. package/lib/Store/make-ordered-dictionary.d.ts +12 -13
  65. package/lib/Store/make-ordered-dictionary.js +45 -38
  66. package/lib/Store/object-repository.d.ts +10 -11
  67. package/lib/Store/object-repository.js +16 -9
  68. package/lib/Types/Auth.d.ts +97 -93
  69. package/lib/Types/Auth.js +3 -2
  70. package/lib/Types/Bussines.js +3 -2
  71. package/lib/Types/Call.d.ts +13 -14
  72. package/lib/Types/Call.js +3 -2
  73. package/lib/Types/Chat.d.ts +97 -78
  74. package/lib/Types/Chat.js +9 -8
  75. package/lib/Types/Contact.d.ts +9 -12
  76. package/lib/Types/Contact.js +3 -2
  77. package/lib/Types/Events.d.ts +176 -206
  78. package/lib/Types/Events.js +3 -2
  79. package/lib/Types/GroupMetadata.d.ts +48 -53
  80. package/lib/Types/GroupMetadata.js +3 -2
  81. package/lib/Types/Label.d.ts +14 -13
  82. package/lib/Types/Label.js +30 -24
  83. package/lib/Types/LabelAssociation.d.ts +20 -15
  84. package/lib/Types/LabelAssociation.js +12 -6
  85. package/lib/Types/Message.d.ts +412 -248
  86. package/lib/Types/Message.js +19 -17
  87. package/lib/Types/Product.d.ts +71 -58
  88. package/lib/Types/Product.js +3 -2
  89. package/lib/Types/Signal.d.ts +82 -71
  90. package/lib/Types/Signal.js +3 -2
  91. package/lib/Types/Socket.d.ts +81 -76
  92. package/lib/Types/Socket.js +3 -3
  93. package/lib/Types/State.d.ts +19 -75
  94. package/lib/Types/State.js +14 -56
  95. package/lib/Types/USync.d.ts +8 -8
  96. package/lib/Types/USync.js +3 -2
  97. package/lib/Types/index.d.ts +62 -47
  98. package/lib/Types/index.js +50 -26
  99. package/lib/Utils/auth-utils.d.ts +10 -13
  100. package/lib/Utils/auth-utils.js +472 -213
  101. package/lib/Utils/business.d.ts +20 -14
  102. package/lib/Utils/business.js +134 -110
  103. package/lib/Utils/chat-utils.d.ts +70 -88
  104. package/lib/Utils/chat-utils.js +403 -466
  105. package/lib/Utils/crypto.d.ts +46 -27
  106. package/lib/Utils/crypto.js +188 -117
  107. package/lib/Utils/decode-wa-message.d.ts +45 -58
  108. package/lib/Utils/decode-wa-message.js +311 -212
  109. package/lib/Utils/event-buffer.d.ts +17 -14
  110. package/lib/Utils/event-buffer.js +296 -321
  111. package/lib/Utils/generics.d.ts +92 -66
  112. package/lib/Utils/generics.js +436 -270
  113. package/lib/Utils/history.d.ts +23 -24
  114. package/lib/Utils/history.js +76 -106
  115. package/lib/Utils/index.d.ts +21 -24
  116. package/lib/Utils/index.js +41 -24
  117. package/lib/Utils/link-preview.d.ts +14 -12
  118. package/lib/Utils/link-preview.js +75 -40
  119. package/lib/Utils/logger.d.ts +11 -10
  120. package/lib/Utils/logger.js +7 -3
  121. package/lib/Utils/lt-hash.d.ts +14 -8
  122. package/lib/Utils/lt-hash.js +53 -3
  123. package/lib/Utils/make-mutex.d.ts +7 -7
  124. package/lib/Utils/make-mutex.js +44 -28
  125. package/lib/Utils/message-retry-manager.d.ts +88 -115
  126. package/lib/Utils/message-retry-manager.js +160 -265
  127. package/lib/Utils/messages-media.d.ts +107 -105
  128. package/lib/Utils/messages-media.js +619 -548
  129. package/lib/Utils/messages.d.ts +66 -52
  130. package/lib/Utils/messages.js +1558 -1730
  131. package/lib/Utils/noise-handler.d.ts +18 -18
  132. package/lib/Utils/noise-handler.js +130 -176
  133. package/lib/Utils/process-message.d.ts +32 -43
  134. package/lib/Utils/process-message.js +282 -484
  135. package/lib/Utils/rich-message-utils.js +724 -1220
  136. package/lib/Utils/signal.d.ts +32 -37
  137. package/lib/Utils/signal.js +105 -140
  138. package/lib/Utils/use-multi-file-auth-state.d.ts +5 -5
  139. package/lib/Utils/use-multi-file-auth-state.js +120 -70
  140. package/lib/Utils/use-single-file-auth-state.d.ts +13 -11
  141. package/lib/Utils/use-single-file-auth-state.js +66 -92
  142. package/lib/Utils/validate-connection.d.ts +13 -11
  143. package/lib/Utils/validate-connection.js +113 -128
  144. package/lib/WABinary/constants.d.ts +27 -25
  145. package/lib/WABinary/constants.js +1292 -1451
  146. package/lib/WABinary/decode.d.ts +9 -7
  147. package/lib/WABinary/decode.js +189 -163
  148. package/lib/WABinary/encode.d.ts +3 -3
  149. package/lib/WABinary/encode.js +155 -110
  150. package/lib/WABinary/generic-utils.d.ts +27 -14
  151. package/lib/WABinary/generic-utils.js +105 -177
  152. package/lib/WABinary/index.d.ts +5 -6
  153. package/lib/WABinary/index.js +25 -6
  154. package/lib/WABinary/jid-utils.d.ts +54 -41
  155. package/lib/WABinary/jid-utils.js +152 -83
  156. package/lib/WABinary/types.d.ts +13 -10
  157. package/lib/WABinary/types.js +3 -2
  158. package/lib/WAM/BinaryInfo.d.ts +15 -8
  159. package/lib/WAM/BinaryInfo.js +14 -7
  160. package/lib/WAM/constants.d.ts +37 -30
  161. package/lib/WAM/constants.js +11983 -19465
  162. package/lib/WAM/encode.d.ts +3 -3
  163. package/lib/WAM/encode.js +109 -95
  164. package/lib/WAM/index.d.ts +3 -4
  165. package/lib/WAM/index.js +23 -4
  166. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -9
  167. package/lib/WAUSync/Protocols/USyncContactProtocol.js +21 -37
  168. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -19
  169. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +26 -18
  170. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -11
  171. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +20 -12
  172. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -11
  173. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +24 -16
  174. package/lib/WAUSync/Protocols/index.d.ts +6 -6
  175. package/lib/WAUSync/Protocols/index.js +26 -6
  176. package/lib/WAUSync/USyncQuery.d.ts +28 -27
  177. package/lib/WAUSync/USyncQuery.js +62 -68
  178. package/lib/WAUSync/USyncUser.d.ts +10 -15
  179. package/lib/WAUSync/USyncUser.js +19 -20
  180. package/lib/WAUSync/index.d.ts +3 -4
  181. package/lib/WAUSync/index.js +23 -4
  182. package/lib/index.d.ts +12 -11
  183. package/lib/index.js +39 -12
  184. package/package.json +43 -87
  185. package/engine-requirements.js +0 -10
@@ -1,6 +1,7 @@
1
- import { Boom } from '@hapi/boom';
2
- import type { Contact } from './Contact.js';
3
- export declare enum SyncState {
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
- export type WAConnectionState = 'open' | 'connecting' | 'close';
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
+ }
@@ -1,56 +1,14 @@
1
- import { Boom } from '@hapi/boom';
2
- export var SyncState;
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
- export var ReachoutTimelockEnforcementType;
14
- (function (ReachoutTimelockEnforcementType) {
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
+ }
@@ -1,5 +1,6 @@
1
- import type { BinaryNode } from '../WABinary/index.js';
2
- import { USyncUser } from '../WAUSync/index.js';
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
+ }
@@ -1,2 +1,3 @@
1
- import { USyncUser } from '../WAUSync/index.js';
2
- //# sourceMappingURL=USync.js.map
1
+ "use strict"
2
+
3
+ Object.defineProperty(exports, "__esModule", { value: true })
@@ -1,28 +1,40 @@
1
- export * from './Auth.js';
2
- export * from './GroupMetadata.js';
3
- export * from './Chat.js';
4
- export * from './Contact.js';
5
- export * from './State.js';
6
- export * from './Message.js';
7
- export * from './Socket.js';
8
- export * from './Events.js';
9
- export * from './Product.js';
10
- export * from './Call.js';
11
- export * from './Signal.js';
12
- export * from './Mex.js';
13
- import type { AuthenticationState } from './Auth.js';
14
- import type { SocketConfig } from './Socket.js';
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
- baileys(browser: string): [string, string, string];
22
- windows(browser: string): [string, string, string];
23
- appropriate(browser: string): [string, string, string];
24
- };
25
- export declare enum DisconnectReason {
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
+ }
@@ -1,26 +1,50 @@
1
- export * from './Auth.js';
2
- export * from './GroupMetadata.js';
3
- export * from './Chat.js';
4
- export * from './Contact.js';
5
- export * from './State.js';
6
- export * from './Message.js';
7
- export * from './Socket.js';
8
- export * from './Events.js';
9
- export * from './Product.js';
10
- export * from './Call.js';
11
- export * from './Signal.js';
12
- export * from './Mex.js';
13
- export var DisconnectReason;
14
- (function (DisconnectReason) {
15
- DisconnectReason[DisconnectReason["connectionClosed"] = 428] = "connectionClosed";
16
- DisconnectReason[DisconnectReason["connectionLost"] = 408] = "connectionLost";
17
- DisconnectReason[DisconnectReason["connectionReplaced"] = 440] = "connectionReplaced";
18
- DisconnectReason[DisconnectReason["timedOut"] = 408] = "timedOut";
19
- DisconnectReason[DisconnectReason["loggedOut"] = 401] = "loggedOut";
20
- DisconnectReason[DisconnectReason["badSession"] = 500] = "badSession";
21
- DisconnectReason[DisconnectReason["restartRequired"] = 515] = "restartRequired";
22
- DisconnectReason[DisconnectReason["multideviceMismatch"] = 411] = "multideviceMismatch";
23
- DisconnectReason[DisconnectReason["forbidden"] = 403] = "forbidden";
24
- DisconnectReason[DisconnectReason["unavailableService"] = 503] = "unavailableService";
25
- })(DisconnectReason || (DisconnectReason = {}));
26
- //# sourceMappingURL=index.js.map
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/index.js';
2
- import type { ILogger } from './logger.js';
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-like transaction capability to the SignalKeyStore
12
- * Uses AsyncLocalStorage for automatic context management
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: ILogger, { maxCommitRetries, delayBetweenTriesMs }: TransactionCapabilityOptions) => SignalKeyStoreWithTransaction;
18
- /**
19
- * Returns the authenticated user's JID, or throws a Boom-401 if creds are not yet authenticated.
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