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.
Files changed (216) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +428 -0
  3. package/WAProto/index.js +130529 -45236
  4. package/engine-requirements.js +1 -1
  5. package/lib/Defaults/baileys-version.json +1 -1
  6. package/lib/Defaults/index.d.ts +9 -18
  7. package/lib/Defaults/index.js +136 -104
  8. package/lib/Defaults/phonenumber-mcc.json +223 -0
  9. package/lib/Signal/Group/ciphertext-message.d.ts +0 -1
  10. package/lib/Signal/Group/ciphertext-message.js +5 -2
  11. package/lib/Signal/Group/group-session-builder.d.ts +3 -4
  12. package/lib/Signal/Group/group-session-builder.js +41 -7
  13. package/lib/Signal/Group/group_cipher.d.ts +4 -4
  14. package/lib/Signal/Group/group_cipher.js +51 -37
  15. package/lib/Signal/Group/index.d.ts +11 -12
  16. package/lib/Signal/Group/index.js +57 -12
  17. package/lib/Signal/Group/keyhelper.d.ts +1 -2
  18. package/lib/Signal/Group/keyhelper.js +44 -7
  19. package/lib/Signal/Group/queue-job.d.ts +0 -1
  20. package/lib/Signal/Group/queue-job.js +5 -2
  21. package/lib/Signal/Group/sender-chain-key.d.ts +2 -3
  22. package/lib/Signal/Group/sender-chain-key.js +15 -7
  23. package/lib/Signal/Group/sender-key-distribution-message.d.ts +1 -2
  24. package/lib/Signal/Group/sender-key-distribution-message.js +11 -8
  25. package/lib/Signal/Group/sender-key-message.d.ts +1 -2
  26. package/lib/Signal/Group/sender-key-message.js +12 -9
  27. package/lib/Signal/Group/sender-key-name.d.ts +0 -1
  28. package/lib/Signal/Group/sender-key-name.js +5 -2
  29. package/lib/Signal/Group/sender-key-record.d.ts +2 -3
  30. package/lib/Signal/Group/sender-key-record.js +21 -9
  31. package/lib/Signal/Group/sender-key-state.d.ts +6 -7
  32. package/lib/Signal/Group/sender-key-state.js +42 -27
  33. package/lib/Signal/Group/sender-message-key.d.ts +0 -1
  34. package/lib/Signal/Group/sender-message-key.js +7 -4
  35. package/lib/Signal/libsignal.d.ts +3 -5
  36. package/lib/Signal/libsignal.js +90 -258
  37. package/lib/Socket/Client/{types.d.ts → abstract-socket-client.d.ts} +3 -2
  38. package/lib/Socket/Client/abstract-socket-client.js +13 -0
  39. package/lib/Socket/Client/index.d.ts +3 -3
  40. package/lib/Socket/Client/index.js +19 -3
  41. package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
  42. package/lib/Socket/Client/mobile-socket-client.js +65 -0
  43. package/lib/Socket/Client/{websocket.d.ts → web-socket-client.d.ts} +1 -2
  44. package/lib/Socket/Client/web-socket-client.js +62 -0
  45. package/lib/Socket/business.d.ts +108 -125
  46. package/lib/Socket/business.js +43 -159
  47. package/lib/Socket/chats.d.ts +239 -70
  48. package/lib/Socket/chats.js +384 -363
  49. package/lib/Socket/dugong.d.ts +254 -0
  50. package/lib/Socket/dugong.js +484 -0
  51. package/lib/Socket/groups.d.ts +56 -78
  52. package/lib/Socket/groups.js +96 -106
  53. package/lib/Socket/index.d.ts +115 -173
  54. package/lib/Socket/index.js +10 -17
  55. package/lib/Socket/messages-recv.d.ts +79 -91
  56. package/lib/Socket/messages-recv.js +521 -639
  57. package/lib/Socket/messages-send.d.ts +91 -111
  58. package/lib/Socket/messages-send.js +438 -599
  59. package/lib/Socket/newsletter.d.ts +84 -97
  60. package/lib/Socket/newsletter.js +239 -145
  61. package/lib/Socket/registration.d.ts +267 -0
  62. package/lib/Socket/registration.js +166 -0
  63. package/lib/Socket/socket.d.ts +18 -26
  64. package/lib/Socket/socket.js +230 -448
  65. package/lib/Socket/usync.d.ts +16 -17
  66. package/lib/Socket/usync.js +26 -19
  67. package/lib/Store/index.d.ts +3 -0
  68. package/lib/Store/index.js +10 -0
  69. package/lib/Store/make-cache-manager-store.d.ts +13 -0
  70. package/lib/Store/make-cache-manager-store.js +83 -0
  71. package/lib/Store/make-in-memory-store.d.ts +118 -0
  72. package/lib/Store/make-in-memory-store.js +427 -0
  73. package/lib/Store/make-ordered-dictionary.d.ts +13 -0
  74. package/lib/Store/make-ordered-dictionary.js +81 -0
  75. package/lib/Store/object-repository.d.ts +10 -0
  76. package/lib/Store/object-repository.js +27 -0
  77. package/lib/Types/Auth.d.ts +12 -13
  78. package/lib/Types/Auth.js +2 -2
  79. package/lib/Types/Call.d.ts +1 -2
  80. package/lib/Types/Call.js +2 -2
  81. package/lib/Types/Chat.d.ts +13 -34
  82. package/lib/Types/Chat.js +4 -8
  83. package/lib/Types/Contact.d.ts +1 -6
  84. package/lib/Types/Contact.js +2 -2
  85. package/lib/Types/Events.d.ts +15 -60
  86. package/lib/Types/Events.js +2 -2
  87. package/lib/Types/GroupMetadata.d.ts +5 -17
  88. package/lib/Types/GroupMetadata.js +2 -2
  89. package/lib/Types/Label.d.ts +0 -12
  90. package/lib/Types/Label.js +5 -3
  91. package/lib/Types/LabelAssociation.d.ts +0 -1
  92. package/lib/Types/LabelAssociation.js +5 -3
  93. package/lib/Types/Message.d.ts +54 -84
  94. package/lib/Types/Message.js +9 -11
  95. package/lib/Types/Newsletter.d.ts +98 -130
  96. package/lib/Types/Newsletter.js +38 -31
  97. package/lib/Types/Product.d.ts +1 -2
  98. package/lib/Types/Product.js +2 -2
  99. package/lib/Types/Signal.d.ts +1 -20
  100. package/lib/Types/Signal.js +2 -2
  101. package/lib/Types/Socket.d.ts +25 -47
  102. package/lib/Types/Socket.js +2 -3
  103. package/lib/Types/State.d.ts +2 -14
  104. package/lib/Types/State.js +2 -13
  105. package/lib/Types/USync.d.ts +2 -3
  106. package/lib/Types/USync.js +2 -2
  107. package/lib/Types/index.d.ts +14 -22
  108. package/lib/Types/index.js +31 -15
  109. package/lib/Utils/auth-utils.d.ts +6 -7
  110. package/lib/Utils/auth-utils.js +148 -199
  111. package/lib/Utils/baileys-event-stream.d.ts +1 -2
  112. package/lib/Utils/baileys-event-stream.js +22 -15
  113. package/lib/Utils/business.d.ts +2 -3
  114. package/lib/Utils/business.js +69 -66
  115. package/lib/Utils/chat-utils.d.ts +22 -21
  116. package/lib/Utils/chat-utils.js +226 -260
  117. package/lib/Utils/crypto.d.ts +19 -19
  118. package/lib/Utils/crypto.js +86 -77
  119. package/lib/Utils/decode-wa-message.d.ts +8 -37
  120. package/lib/Utils/decode-wa-message.js +83 -164
  121. package/lib/Utils/event-buffer.d.ts +8 -7
  122. package/lib/Utils/event-buffer.js +76 -110
  123. package/lib/Utils/generics.d.ts +29 -27
  124. package/lib/Utils/generics.js +210 -168
  125. package/lib/Utils/history.d.ts +8 -12
  126. package/lib/Utils/history.js +46 -34
  127. package/lib/Utils/index.d.ts +17 -20
  128. package/lib/Utils/index.js +33 -20
  129. package/lib/Utils/link-preview.d.ts +5 -5
  130. package/lib/Utils/link-preview.js +22 -14
  131. package/lib/Utils/logger.d.ts +3 -11
  132. package/lib/Utils/logger.js +7 -3
  133. package/lib/Utils/lt-hash.d.ts +8 -9
  134. package/lib/Utils/lt-hash.js +28 -25
  135. package/lib/Utils/make-mutex.d.ts +2 -3
  136. package/lib/Utils/make-mutex.js +10 -7
  137. package/lib/Utils/messages-media.d.ts +44 -42
  138. package/lib/Utils/messages-media.js +475 -319
  139. package/lib/Utils/messages.d.ts +18 -17
  140. package/lib/Utils/messages.js +259 -383
  141. package/lib/Utils/noise-handler.d.ts +15 -14
  142. package/lib/Utils/noise-handler.js +38 -30
  143. package/lib/Utils/process-message.d.ts +13 -14
  144. package/lib/Utils/process-message.js +147 -239
  145. package/lib/Utils/signal.d.ts +5 -7
  146. package/lib/Utils/signal.js +72 -78
  147. package/lib/Utils/use-multi-file-auth-state.d.ts +2 -2
  148. package/lib/Utils/use-multi-file-auth-state.js +27 -29
  149. package/lib/Utils/validate-connection.d.ts +7 -7
  150. package/lib/Utils/validate-connection.js +106 -72
  151. package/lib/WABinary/constants.d.ts +27 -25
  152. package/lib/WABinary/constants.js +20 -1281
  153. package/lib/WABinary/decode.d.ts +5 -5
  154. package/lib/WABinary/decode.js +42 -28
  155. package/lib/WABinary/encode.d.ts +3 -3
  156. package/lib/WABinary/encode.js +154 -105
  157. package/lib/WABinary/generic-utils.d.ts +7 -5
  158. package/lib/WABinary/generic-utils.js +63 -56
  159. package/lib/WABinary/index.d.ts +5 -6
  160. package/lib/WABinary/index.js +21 -6
  161. package/lib/WABinary/jid-utils.d.ts +8 -25
  162. package/lib/WABinary/jid-utils.js +40 -74
  163. package/lib/WABinary/types.d.ts +1 -2
  164. package/lib/WABinary/types.js +2 -2
  165. package/lib/WAM/BinaryInfo.d.ts +11 -3
  166. package/lib/WAM/BinaryInfo.js +5 -2
  167. package/lib/WAM/constants.d.ts +3 -5
  168. package/lib/WAM/constants.js +11958 -19461
  169. package/lib/WAM/encode.d.ts +3 -3
  170. package/lib/WAM/encode.js +22 -17
  171. package/lib/WAM/index.d.ts +3 -4
  172. package/lib/WAM/index.js +19 -4
  173. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +3 -4
  174. package/lib/WAUSync/Protocols/USyncContactProtocol.js +11 -8
  175. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +2 -3
  176. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +14 -11
  177. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +2 -3
  178. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +12 -9
  179. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +2 -3
  180. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +13 -9
  181. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +3 -4
  182. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +22 -20
  183. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +3 -5
  184. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +8 -13
  185. package/lib/WAUSync/Protocols/index.d.ts +4 -5
  186. package/lib/WAUSync/Protocols/index.js +20 -5
  187. package/lib/WAUSync/USyncQuery.d.ts +4 -5
  188. package/lib/WAUSync/USyncQuery.js +35 -40
  189. package/lib/WAUSync/USyncUser.d.ts +5 -6
  190. package/lib/WAUSync/USyncUser.js +5 -2
  191. package/lib/WAUSync/index.d.ts +3 -4
  192. package/lib/WAUSync/index.js +19 -4
  193. package/lib/index.d.ts +9 -19
  194. package/lib/index.js +47 -24
  195. package/package.json +109 -99
  196. package/WAProto/GenerateStatics.sh +0 -3
  197. package/WAProto/WAProto.proto +0 -5519
  198. package/WAProto/fix-imports.js +0 -29
  199. package/WAProto/index.d.ts +0 -11969
  200. package/lib/Signal/lid-mapping.d.ts +0 -23
  201. package/lib/Signal/lid-mapping.js +0 -171
  202. package/lib/Socket/Client/types.js +0 -11
  203. package/lib/Socket/Client/websocket.js +0 -50
  204. package/lib/Socket/communities.d.ts +0 -244
  205. package/lib/Socket/communities.js +0 -431
  206. package/lib/Socket/mex.d.ts +0 -3
  207. package/lib/Socket/mex.js +0 -42
  208. package/lib/Types/Bussines.d.ts +0 -25
  209. package/lib/Types/Bussines.js +0 -2
  210. package/lib/Utils/browser-utils.d.ts +0 -4
  211. package/lib/Utils/browser-utils.js +0 -28
  212. package/lib/Utils/message-retry-manager.d.ts +0 -82
  213. package/lib/Utils/message-retry-manager.js +0 -149
  214. package/lib/Utils/pre-key-manager.d.ts +0 -28
  215. package/lib/Utils/pre-key-manager.js +0 -106
  216. /package/lib/{supun → supunmd} +0 -0
@@ -1,11 +1,9 @@
1
- import { proto } from '../../WAProto/index.js';
2
- // export the WAMessage Prototypes
3
- export { proto as WAProto };
4
- export const WAMessageStubType = proto.WebMessageInfo.StubType;
5
- export const WAMessageStatus = proto.WebMessageInfo.Status;
6
- export var WAMessageAddressingMode;
7
- (function (WAMessageAddressingMode) {
8
- WAMessageAddressingMode["PN"] = "pn";
9
- WAMessageAddressingMode["LID"] = "lid";
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
- export declare enum XWAPaths {
2
- xwa2_newsletter_create = "xwa2_newsletter_create",
3
- xwa2_newsletter_subscribers = "xwa2_newsletter_subscribers",
4
- xwa2_newsletter_view = "xwa2_newsletter_view",
5
- xwa2_newsletter_metadata = "xwa2_newsletter",
6
- xwa2_newsletter_admin_count = "xwa2_newsletter_admin",
7
- xwa2_newsletter_mute_v2 = "xwa2_newsletter_mute_v2",
8
- xwa2_newsletter_unmute_v2 = "xwa2_newsletter_unmute_v2",
9
- xwa2_newsletter_follow = "xwa2_newsletter_follow",
10
- xwa2_newsletter_unfollow = "xwa2_newsletter_unfollow",
11
- xwa2_newsletter_change_owner = "xwa2_newsletter_change_owner",
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
- export declare enum QueryIds {
16
- CREATE = "8823471724422422",
17
- UPDATE_METADATA = "24250201037901610",
18
- METADATA = "6563316087068696",
19
- SUBSCRIBERS = "9783111038412085",
20
- FOLLOW = "7871414976211147",
21
- UNFOLLOW = "7238632346214362",
22
- MUTE = "29766401636284406",
23
- UNMUTE = "9864994326891137",
24
- ADMIN_COUNT = "7130823597031706",
25
- CHANGE_OWNER = "7341777602580933",
26
- DEMOTE = "6551828931592903",
27
- DELETE = "30062808666639665"
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
- export type NewsletterUpdate = {
30
- name?: string;
31
- description?: string;
32
- picture?: string;
33
- };
34
- export interface NewsletterCreateResponse {
35
- id: string;
36
- state: {
37
- type: string;
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
- export interface NewsletterCreateResponse {
72
- id: string;
73
- state: {
74
- type: string;
75
- };
76
- thread_metadata: {
77
- creation_time: string;
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
- export type NewsletterViewRole = 'ADMIN' | 'GUEST' | 'OWNER' | 'SUBSCRIBER';
109
- export interface NewsletterMetadata {
110
- id: string;
111
- owner?: string;
112
- name: string;
113
- description?: string;
114
- invite?: string;
115
- creation_time?: number;
116
- subscribers?: number;
117
- picture?: {
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
- //# sourceMappingURL=Newsletter.d.ts.map
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
@@ -1,31 +1,38 @@
1
- export var XWAPaths;
2
- (function (XWAPaths) {
3
- XWAPaths["xwa2_newsletter_create"] = "xwa2_newsletter_create";
4
- XWAPaths["xwa2_newsletter_subscribers"] = "xwa2_newsletter_subscribers";
5
- XWAPaths["xwa2_newsletter_view"] = "xwa2_newsletter_view";
6
- XWAPaths["xwa2_newsletter_metadata"] = "xwa2_newsletter";
7
- XWAPaths["xwa2_newsletter_admin_count"] = "xwa2_newsletter_admin";
8
- XWAPaths["xwa2_newsletter_mute_v2"] = "xwa2_newsletter_mute_v2";
9
- XWAPaths["xwa2_newsletter_unmute_v2"] = "xwa2_newsletter_unmute_v2";
10
- XWAPaths["xwa2_newsletter_follow"] = "xwa2_newsletter_follow";
11
- XWAPaths["xwa2_newsletter_unfollow"] = "xwa2_newsletter_unfollow";
12
- XWAPaths["xwa2_newsletter_change_owner"] = "xwa2_newsletter_change_owner";
13
- XWAPaths["xwa2_newsletter_demote"] = "xwa2_newsletter_demote";
14
- XWAPaths["xwa2_newsletter_delete_v2"] = "xwa2_newsletter_delete_v2";
15
- })(XWAPaths || (XWAPaths = {}));
16
- export var QueryIds;
17
- (function (QueryIds) {
18
- QueryIds["CREATE"] = "8823471724422422";
19
- QueryIds["UPDATE_METADATA"] = "24250201037901610";
20
- QueryIds["METADATA"] = "6563316087068696";
21
- QueryIds["SUBSCRIBERS"] = "9783111038412085";
22
- QueryIds["FOLLOW"] = "7871414976211147";
23
- QueryIds["UNFOLLOW"] = "7238632346214362";
24
- QueryIds["MUTE"] = "29766401636284406";
25
- QueryIds["UNMUTE"] = "9864994326891137";
26
- QueryIds["ADMIN_COUNT"] = "7130823597031706";
27
- QueryIds["CHANGE_OWNER"] = "7341777602580933";
28
- QueryIds["DEMOTE"] = "6551828931592903";
29
- QueryIds["DELETE"] = "30062808666639665";
30
- })(QueryIds || (QueryIds = {}));
31
- //# sourceMappingURL=Newsletter.js.map
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
@@ -1,4 +1,4 @@
1
- import type { WAMediaUpload } from './Message.js';
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
@@ -1,2 +1,2 @@
1
- export {};
2
- //# sourceMappingURL=Product.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,4 @@
1
- import { proto } from '../../WAProto/index.js';
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
@@ -1,2 +1,2 @@
1
- import { proto } from '../../WAProto/index.js';
2
- //# sourceMappingURL=Signal.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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/index.js';
4
- import type { ILogger } from '../Utils/logger.js';
5
- import type { AuthenticationState, LIDMapping, SignalAuthState, TransactionCapabilityOptions } from './Auth.js';
6
- import type { GroupMetadata } from './GroupMetadata.js';
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): Promise<T> | T | undefined;
15
+ get<T>(key: string): T | undefined;
14
16
  /** set a key in the cache */
15
- set<T>(key: string, value: T): Promise<void> | void | number | boolean;
17
+ set<T>(key: string, value: T): void;
16
18
  /** delete a key from the cache */
17
- del(key: string): void | Promise<void> | number | boolean;
19
+ del(key: string): void;
18
20
  /** flush all data */
19
- flushAll(): void | Promise<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: ILogger;
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
- * @deprecated This feature has been removed
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?: PossiblyExtendedCacheStore;
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?: string[]) => Promise<PatchedMessageWithRecipientJID[] | PatchedMessageWithRecipientJID> | PatchedMessageWithRecipientJID[] | PatchedMessageWithRecipientJID;
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 HTTP fetch requests */
122
- options: RequestInit;
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: WAMessageKey) => Promise<proto.IMessage | undefined>;
129
- /** cached group metadata, use to prevent redundant requests to WA & speed up msg sending */
130
- cachedGroupMetadata: (jid: string) => Promise<GroupMetadata | undefined>;
131
- makeSignalRepository: (auth: SignalAuthState, logger: ILogger, pnToLIDFunc?: (jids: string[]) => Promise<LIDMapping[] | undefined>) => SignalRepositoryWithLIDStore;
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
@@ -1,3 +1,2 @@
1
- import { proto } from '../../WAProto/index.js';
2
- import {} from './Message.js';
3
- //# sourceMappingURL=Socket.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,22 +1,11 @@
1
- import { Boom } from '@hapi/boom';
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: Boom | Error | undefined;
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
@@ -1,13 +1,2 @@
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
- //# sourceMappingURL=State.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
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
  * 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
@@ -1,2 +1,2 @@
1
- import { USyncUser } from '../WAUSync/index.js';
2
- //# sourceMappingURL=USync.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,27 +1,20 @@
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 './Newsletter.js';
13
- import type { AuthenticationState } from './Auth.js';
14
- import type { SocketConfig } from './Socket.js';
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