sauruspro-bail 0.0.0-stage → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/README.md +128 -2
  2. package/WAProto/GenerateStatics.sh +3 -0
  3. package/WAProto/WAProto.proto +6754 -0
  4. package/WAProto/fix-imports.js +85 -0
  5. package/WAProto/index.d.ts +79257 -0
  6. package/WAProto/index.js +242946 -0
  7. package/docs/CHANGELOG.md +43 -0
  8. package/docs/NEWSLETTER-STATUS.md +120 -0
  9. package/docs/SPR.md +51 -0
  10. package/engine-requirements.js +10 -0
  11. package/lib/Defaults/index.js +135 -0
  12. package/lib/Signal/Group/ciphertext-message.js +12 -0
  13. package/lib/Signal/Group/group-session-builder.js +30 -0
  14. package/lib/Signal/Group/group_cipher.js +82 -0
  15. package/lib/Signal/Group/index.js +12 -0
  16. package/lib/Signal/Group/keyhelper.js +18 -0
  17. package/lib/Signal/Group/sender-chain-key.js +26 -0
  18. package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
  19. package/lib/Signal/Group/sender-key-message.js +66 -0
  20. package/lib/Signal/Group/sender-key-name.js +48 -0
  21. package/lib/Signal/Group/sender-key-record.js +41 -0
  22. package/lib/Signal/Group/sender-key-state.js +84 -0
  23. package/lib/Signal/Group/sender-message-key.js +26 -0
  24. package/lib/Signal/libsignal.js +431 -0
  25. package/lib/Signal/lid-mapping.js +277 -0
  26. package/lib/Socket/Client/index.js +3 -0
  27. package/lib/Socket/Client/types.js +11 -0
  28. package/lib/Socket/Client/websocket.js +54 -0
  29. package/lib/Socket/MessageBuilder.js +3729 -0
  30. package/lib/Socket/business.js +379 -0
  31. package/lib/Socket/chats.js +1198 -0
  32. package/lib/Socket/communities.js +431 -0
  33. package/lib/Socket/dinonic-handler.d.ts +27 -0
  34. package/lib/Socket/dinonic-handler.js +882 -0
  35. package/lib/Socket/graphql.js +716 -0
  36. package/lib/Socket/groups.js +374 -0
  37. package/lib/Socket/index.js +96 -0
  38. package/lib/Socket/interop.js +463 -0
  39. package/lib/Socket/luxu.js +387 -0
  40. package/lib/Socket/message-builder.js +556 -0
  41. package/lib/Socket/messages-recv.js +1942 -0
  42. package/lib/Socket/messages-send.js +1541 -0
  43. package/lib/Socket/mex.js +54 -0
  44. package/lib/Socket/newsletter.js +641 -0
  45. package/lib/Socket/privacy.js +318 -0
  46. package/lib/Socket/socket.js +1115 -0
  47. package/lib/Socket/username.js +236 -0
  48. package/lib/Store/index.js +10 -0
  49. package/lib/Store/keyed-db.js +108 -0
  50. package/lib/Store/make-cache-manager-store.js +85 -0
  51. package/lib/Store/make-in-memory-store.js +244 -0
  52. package/lib/Store/make-ordered-dictionary.js +75 -0
  53. package/lib/Store/object-repository.js +32 -0
  54. package/lib/Types/Auth.js +2 -0
  55. package/lib/Types/Bussines.js +2 -0
  56. package/lib/Types/Call.js +2 -0
  57. package/lib/Types/Chat.js +8 -0
  58. package/lib/Types/Contact.js +2 -0
  59. package/lib/Types/Events.js +2 -0
  60. package/lib/Types/GroupMetadata.js +2 -0
  61. package/lib/Types/Label.js +25 -0
  62. package/lib/Types/LabelAssociation.js +7 -0
  63. package/lib/Types/Message.js +11 -0
  64. package/lib/Types/Mex.js +111 -0
  65. package/lib/Types/Product.js +2 -0
  66. package/lib/Types/Signal.js +2 -0
  67. package/lib/Types/Socket.js +3 -0
  68. package/lib/Types/State.js +56 -0
  69. package/lib/Types/USync.js +2 -0
  70. package/lib/Types/index.js +26 -0
  71. package/lib/Utils/MessageBuilder.d.ts +215 -0
  72. package/lib/Utils/MessageBuilder.js +3991 -0
  73. package/lib/Utils/a2ui.d.ts +202 -0
  74. package/lib/Utils/a2ui.js +732 -0
  75. package/lib/Utils/airich-registry.js +3 -0
  76. package/lib/Utils/auth-utils.js +302 -0
  77. package/lib/Utils/baileys-event-stream.js +58 -0
  78. package/lib/Utils/bot-signature.d.ts +22 -0
  79. package/lib/Utils/bot-signature.js +124 -0
  80. package/lib/Utils/browser-utils.js +48 -0
  81. package/lib/Utils/business.js +231 -0
  82. package/lib/Utils/chat-utils.js +872 -0
  83. package/lib/Utils/companion-reg-client-utils.js +35 -0
  84. package/lib/Utils/crypto.js +118 -0
  85. package/lib/Utils/decode-wa-message.js +350 -0
  86. package/lib/Utils/dinonic-spr.d.ts +26 -0
  87. package/lib/Utils/dinonic-spr.js +521 -0
  88. package/lib/Utils/event-buffer.js +622 -0
  89. package/lib/Utils/extras.d.ts +449 -0
  90. package/lib/Utils/extras.js +1377 -0
  91. package/lib/Utils/generics.js +403 -0
  92. package/lib/Utils/history.js +134 -0
  93. package/lib/Utils/html-app.d.ts +39 -0
  94. package/lib/Utils/html-app.js +291 -0
  95. package/lib/Utils/identity-change-handler.js +50 -0
  96. package/lib/Utils/index.js +38 -0
  97. package/lib/Utils/link-preview.js +85 -0
  98. package/lib/Utils/logger.js +3 -0
  99. package/lib/Utils/lt-hash.js +8 -0
  100. package/lib/Utils/make-mutex.js +33 -0
  101. package/lib/Utils/message-composer.js +273 -0
  102. package/lib/Utils/message-retry-manager.js +265 -0
  103. package/lib/Utils/messages-media.js +870 -0
  104. package/lib/Utils/messages.js +1394 -0
  105. package/lib/Utils/metaai.d.ts +438 -0
  106. package/lib/Utils/metaai.js +911 -0
  107. package/lib/Utils/modern-messages.d.ts +150 -0
  108. package/lib/Utils/modern-messages.js +496 -0
  109. package/lib/Utils/native-flow.d.ts +14 -0
  110. package/lib/Utils/native-flow.js +118 -0
  111. package/lib/Utils/newsletter-status.d.ts +163 -0
  112. package/lib/Utils/newsletter-status.js +694 -0
  113. package/lib/Utils/noise-handler.js +201 -0
  114. package/lib/Utils/offline-node-processor.js +40 -0
  115. package/lib/Utils/payment-messages.d.ts +59 -0
  116. package/lib/Utils/payment-messages.js +156 -0
  117. package/lib/Utils/pre-key-manager.js +106 -0
  118. package/lib/Utils/process-message.js +630 -0
  119. package/lib/Utils/reporting-utils.js +258 -0
  120. package/lib/Utils/scheduled-message.d.ts +82 -0
  121. package/lib/Utils/scheduled-message.js +113 -0
  122. package/lib/Utils/signal.js +201 -0
  123. package/lib/Utils/stanza-ack.js +38 -0
  124. package/lib/Utils/status-stickers.d.ts +78 -0
  125. package/lib/Utils/status-stickers.js +261 -0
  126. package/lib/Utils/sticker.js +133 -0
  127. package/lib/Utils/sync-action-utils.js +49 -0
  128. package/lib/Utils/tc-token-utils.js +163 -0
  129. package/lib/Utils/use-multi-file-auth-state.js +121 -0
  130. package/lib/Utils/use-sqlite-auth-state.js +162 -0
  131. package/lib/Utils/validate-connection.js +203 -0
  132. package/lib/WABinary/constants.js +1301 -0
  133. package/lib/WABinary/decode.js +262 -0
  134. package/lib/WABinary/encode.js +220 -0
  135. package/lib/WABinary/generic-utils.js +204 -0
  136. package/lib/WABinary/index.js +6 -0
  137. package/lib/WABinary/jid-utils.js +98 -0
  138. package/lib/WABinary/types.js +2 -0
  139. package/lib/WAM/BinaryInfo.js +10 -0
  140. package/lib/WAM/constants.js +22853 -0
  141. package/lib/WAM/encode.js +150 -0
  142. package/lib/WAM/index.js +4 -0
  143. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +53 -0
  144. package/lib/WAUSync/Protocols/USyncBusinessProtocol.js +43 -0
  145. package/lib/WAUSync/Protocols/USyncContactProtocol.js +54 -0
  146. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
  147. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
  148. package/lib/WAUSync/Protocols/USyncFeatureProtocol.js +58 -0
  149. package/lib/WAUSync/Protocols/USyncLIDProtocol.js +30 -0
  150. package/lib/WAUSync/Protocols/USyncPictureProtocol.js +32 -0
  151. package/lib/WAUSync/Protocols/USyncSidelistProtocol.js +28 -0
  152. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +39 -0
  153. package/lib/WAUSync/Protocols/USyncTextStatusProtocol.js +38 -0
  154. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +27 -0
  155. package/lib/WAUSync/Protocols/index.js +12 -0
  156. package/lib/WAUSync/USyncQuery.js +151 -0
  157. package/lib/WAUSync/USyncUser.js +56 -0
  158. package/lib/WAUSync/index.js +3 -0
  159. package/lib/index.js +67 -0
  160. package/package.json +147 -5
@@ -0,0 +1,75 @@
1
+ export default function makeOrderedDictionary(idGetter) {
2
+ const array = [];
3
+ const dict = {};
4
+
5
+ const get = (id) => dict[id];
6
+
7
+ const update = (item) => {
8
+ const id = idGetter(item);
9
+ const idx = array.findIndex(i => idGetter(i) === id);
10
+ if (idx >= 0) {
11
+ array[idx] = item;
12
+ dict[id] = item;
13
+ }
14
+ return false;
15
+ };
16
+
17
+ const upsert = (item, mode) => {
18
+ const id = idGetter(item);
19
+ if (get(id)) {
20
+ update(item);
21
+ } else {
22
+ if (mode === 'append') array.push(item);
23
+ else array.unshift(item);
24
+ dict[id] = item;
25
+ }
26
+ };
27
+
28
+ const remove = (item) => {
29
+ const id = idGetter(item);
30
+ const idx = array.findIndex(i => idGetter(i) === id);
31
+ if (idx >= 0) {
32
+ array.splice(idx, 1);
33
+ delete dict[id];
34
+ return true;
35
+ }
36
+ return false;
37
+ };
38
+
39
+ return {
40
+ array,
41
+ get,
42
+ upsert,
43
+ update,
44
+ remove,
45
+ updateAssign: (id, update) => {
46
+ const item = get(id);
47
+ if (item) {
48
+ Object.assign(item, update);
49
+ delete dict[id];
50
+ dict[idGetter(item)] = item;
51
+ return true;
52
+ }
53
+ return false;
54
+ },
55
+ clear: () => {
56
+ array.length = 0;
57
+ for (const key of Object.keys(dict)) delete dict[key];
58
+ },
59
+ filter: (contain) => {
60
+ let i = 0;
61
+ while (i < array.length) {
62
+ if (!contain(array[i])) {
63
+ delete dict[idGetter(array[i])];
64
+ array.splice(i, 1);
65
+ } else {
66
+ i++;
67
+ }
68
+ }
69
+ },
70
+ toJSON: () => array,
71
+ fromJSON: (newItems) => {
72
+ array.splice(0, array.length, ...newItems);
73
+ }
74
+ };
75
+ }
@@ -0,0 +1,32 @@
1
+ export class ObjectRepository {
2
+ constructor(entities = {}) {
3
+ this.entityMap = new Map(Object.entries(entities));
4
+ }
5
+
6
+ findById(id) {
7
+ return this.entityMap.get(id);
8
+ }
9
+
10
+ findAll() {
11
+ return Array.from(this.entityMap.values());
12
+ }
13
+
14
+ upsertById(id, entity) {
15
+ this.entityMap.set(id, { ...entity });
16
+ return this;
17
+ }
18
+
19
+ deleteById(id) {
20
+ return this.entityMap.delete(id);
21
+ }
22
+
23
+ count() {
24
+ return this.entityMap.size;
25
+ }
26
+
27
+ toJSON() {
28
+ return this.findAll();
29
+ }
30
+ }
31
+
32
+ export default ObjectRepository;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Auth.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Bussines.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Call.js.map
@@ -0,0 +1,8 @@
1
+ export const ALL_WA_PATCH_NAMES = [
2
+ 'critical_block',
3
+ 'critical_unblock_low',
4
+ 'regular_high',
5
+ 'regular_low',
6
+ 'regular'
7
+ ];
8
+ //# sourceMappingURL=Chat.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Contact.js.map
@@ -0,0 +1,2 @@
1
+ import { proto } from '../../WAProto/index.js';
2
+ //# sourceMappingURL=Events.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=GroupMetadata.js.map
@@ -0,0 +1,25 @@
1
+ /** WhatsApp has 20 predefined colors */
2
+ export var LabelColor;
3
+ (function (LabelColor) {
4
+ LabelColor[LabelColor["Color1"] = 0] = "Color1";
5
+ LabelColor[LabelColor["Color2"] = 1] = "Color2";
6
+ LabelColor[LabelColor["Color3"] = 2] = "Color3";
7
+ LabelColor[LabelColor["Color4"] = 3] = "Color4";
8
+ LabelColor[LabelColor["Color5"] = 4] = "Color5";
9
+ LabelColor[LabelColor["Color6"] = 5] = "Color6";
10
+ LabelColor[LabelColor["Color7"] = 6] = "Color7";
11
+ LabelColor[LabelColor["Color8"] = 7] = "Color8";
12
+ LabelColor[LabelColor["Color9"] = 8] = "Color9";
13
+ LabelColor[LabelColor["Color10"] = 9] = "Color10";
14
+ LabelColor[LabelColor["Color11"] = 10] = "Color11";
15
+ LabelColor[LabelColor["Color12"] = 11] = "Color12";
16
+ LabelColor[LabelColor["Color13"] = 12] = "Color13";
17
+ LabelColor[LabelColor["Color14"] = 13] = "Color14";
18
+ LabelColor[LabelColor["Color15"] = 14] = "Color15";
19
+ LabelColor[LabelColor["Color16"] = 15] = "Color16";
20
+ LabelColor[LabelColor["Color17"] = 16] = "Color17";
21
+ LabelColor[LabelColor["Color18"] = 17] = "Color18";
22
+ LabelColor[LabelColor["Color19"] = 18] = "Color19";
23
+ LabelColor[LabelColor["Color20"] = 19] = "Color20";
24
+ })(LabelColor || (LabelColor = {}));
25
+ //# sourceMappingURL=Label.js.map
@@ -0,0 +1,7 @@
1
+ /** Association type */
2
+ export var LabelAssociationType;
3
+ (function (LabelAssociationType) {
4
+ LabelAssociationType["Chat"] = "label_jid";
5
+ LabelAssociationType["Message"] = "label_message";
6
+ })(LabelAssociationType || (LabelAssociationType = {}));
7
+ //# sourceMappingURL=LabelAssociation.js.map
@@ -0,0 +1,11 @@
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
@@ -0,0 +1,111 @@
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_join_v2"] = "xwa2_newsletter_join_v2";
13
+ XWAPaths["xwa2_newsletter_leave_v2"] = "xwa2_newsletter_leave_v2";
14
+ XWAPaths["xwa2_newsletter_change_owner"] = "xwa2_newsletter_change_owner";
15
+ XWAPaths["xwa2_newsletter_demote"] = "xwa2_newsletter_demote";
16
+ XWAPaths["xwa2_newsletter_delete_v2"] = "xwa2_newsletter_delete_v2";
17
+ XWAPaths["xwa2_fetch_account_reachout_timelock"] = "xwa2_fetch_account_reachout_timelock";
18
+ XWAPaths["xwa2_message_capping_info"] = "xwa2_message_capping_info";
19
+ XWAPaths["xwa2_newsletter_subscribed"] = "xwa2_newsletter_subscribed";
20
+ XWAPaths["xwa2_newsletter_update"] = "xwa2_newsletter_update";
21
+ XWAPaths["xwa2_newsletter_admin"] = "xwa2_newsletter_admin";
22
+ XWAPaths["xwa2_newsletter_admin_invite_create"] = "xwa2_newsletter_admin_invite_create";
23
+ XWAPaths["xwa2_newsletter_admin_invite_revoke"] = "xwa2_newsletter_admin_invite_revoke";
24
+ XWAPaths["xwa2_newsletter_admin_invite_accept"] = "xwa2_newsletter_admin_invite_accept";
25
+ XWAPaths["xwa2_newsletter_admin_profile_update"] = "xwa2_newsletter_admin_profile_update";
26
+ XWAPaths["xwa2_newsletter_admin_insights"] = "xwa2_newsletter_admin_insights";
27
+ XWAPaths["xwa2_newsletter_following"] = "xwa2_newsletter_following";
28
+ XWAPaths["xwa2_newsletter_create_verified"] = "xwa2_newsletter_create_verified";
29
+ XWAPaths["xwa2_newsletter_enforcements"] = "xwa2_newsletter_enforcements";
30
+ XWAPaths["xwa2_newsletter_user_reports"] = "xwa2_newsletter_user_reports";
31
+ XWAPaths["xwa2_newsletter_create_report_appeal"] = "xwa2_newsletter_create_report_appeal";
32
+ XWAPaths["xwa2_newsletter_link_preview_check"] = "xwa2_newsletter_link_preview_check";
33
+ XWAPaths["xwa2_newsletter_update_verification"] = "xwa2_newsletter_update_verification";
34
+ XWAPaths["xwa2_newsletter_label_paid_partnership"] = "xwa2_newsletter_label_paid_partnership";
35
+ XWAPaths["xwa2_newsletter_log_exposures"] = "xwa2_newsletter_log_exposures";
36
+ XWAPaths["xwa2_newsletter_update_user_setting"] = "xwa2_newsletter_update_user_setting";
37
+ XWAPaths["xwa2_newsletter_ranking_features"] = "xwa2_newsletter_ranking_features";
38
+ XWAPaths["xwa2_newsletter_block_user"] = "xwa2_newsletter_block_user";
39
+ XWAPaths["xwa2_newsletters_directory_list"] = "xwa2_newsletters_directory_list";
40
+ XWAPaths["xwa2_newsletters_directory_search"] = "xwa2_newsletters_directory_search";
41
+ XWAPaths["xwa2_newsletters_directory_category_preview"] = "xwa2_newsletters_directory_category_preview";
42
+ XWAPaths["xwa2_newsletters_search"] = "xwa2_newsletters_search";
43
+ XWAPaths["xwa2_newsletters_recommended"] = "xwa2_newsletters_recommended";
44
+ XWAPaths["xwa2_newsletters_similar"] = "xwa2_newsletters_similar";
45
+ XWAPaths["xwa2_newsletters_poll_voter_list"] = "xwa2_newsletters_poll_voter_list";
46
+ XWAPaths["xwa2_newsletters_reaction_sender_list"] = "xwa2_newsletters_reaction_sender_list";
47
+ XWAPaths["xwa2_wamo_afs_age_collection"] = "xwa2_wamo_afs_age_collection";
48
+ XWAPaths["xwa2_wamo_asset_collection"] = "xwa2_wamo_asset_collection";
49
+ XWAPaths["xwa2_wamo_fetch_adhoc_notice_by_id"] = "xwa2_wamo_fetch_adhoc_notice_by_id";
50
+ XWAPaths["xwa2_wamo_fetch_identity_token"] = "xwa2_wamo_fetch_identity_token";
51
+ XWAPaths["xwa2_wamo_sub_get_compliance_info"] = "xwa2_wamo_sub_get_compliance_info";
52
+ XWAPaths["xwa2_wamo_user_id_version"] = "xwa2_wamo_user_id_version";
53
+ XWAPaths["xwa2_wamo_set_user_id_version"] = "xwa2_wamo_set_user_id_version";
54
+ })(XWAPaths || (XWAPaths = {}));
55
+
56
+ export var QueryIds;
57
+ (function (QueryIds) {
58
+ QueryIds["CREATE"] = "8823471724422422";
59
+ QueryIds["METADATA"] = "26099060629688646";
60
+ QueryIds["UPDATE_METADATA"] = "25976052865358570";
61
+ QueryIds["SUBSCRIBERS"] = "9783111038412085";
62
+ QueryIds["FOLLOW"] = "24404358912487870";
63
+ QueryIds["UNFOLLOW"] = "9767147403369991";
64
+ QueryIds["MUTE"] = "29766401636284406";
65
+ QueryIds["UNMUTE"] = "9864994326891137";
66
+ QueryIds["ADMIN_COUNT"] = "7130823597031706";
67
+ QueryIds["CHANGE_OWNER"] = "7341777602580933";
68
+ QueryIds["DEMOTE"] = "6551828931592903";
69
+ QueryIds["DELETE"] = "30062808666639665";
70
+ QueryIds["REACHOUT_TIMELOCK"] = "23983697327930364";
71
+ QueryIds["MESSAGE_CAPPING_INFO"] = "24503548349331633";
72
+ QueryIds["FETCH_SUBSCRIBE"] = "6388546374527196";
73
+ QueryIds["LEAVE"] = "9784043202933196";
74
+ QueryIds["ADMIN_INVITE"] = "7148599488585196";
75
+ QueryIds["ADMIN_INVITE_REVOKE"] = "6345824195482235";
76
+ QueryIds["ADMIN_INVITE_ACCEPT"] = "6345824195482236";
77
+ QueryIds["ADMIN_METADATA"] = "6895563180530100";
78
+ QueryIds["ADMIN_PROFILE_UPDATE"] = "6895563180530101";
79
+ QueryIds["INSIGHTS"] = "6243647912368353";
80
+ QueryIds["FOLLOWING_LIST"] = "6388546374527197";
81
+ QueryIds["CREATE_VERIFIED"] = "8823471724422423";
82
+ QueryIds["ENFORCEMENTS"] = "7130823597031707";
83
+ QueryIds["USER_REPORTS"] = "9783111038412086";
84
+ QueryIds["CREATE_REPORT_APPEAL"] = "6551828931592904";
85
+ QueryIds["LINK_PREVIEW_CHECK"] = "24404358912487871";
86
+ QueryIds["UPDATE_VERIFICATION"] = "25976052865358571";
87
+ QueryIds["LABEL_PAID_PARTNERSHIP"] = "7341777602580934";
88
+ QueryIds["LOG_EXPOSURES"] = "9864994326891138";
89
+ QueryIds["UPDATE_USER_SETTING"] = "29766401636284407";
90
+ QueryIds["RANKING_FEATURES"] = "7130823597031708";
91
+ QueryIds["BLOCK_USER"] = "6345824195482237";
92
+ QueryIds["DIRECTORY_LIST"] = "6388546374527198";
93
+ QueryIds["DIRECTORY_SEARCH"] = "6388546374527199";
94
+ QueryIds["DIRECTORY_CATEGORY_PREVIEW"] = "6388546374527200";
95
+ QueryIds["SEARCH"] = "26099060629688647";
96
+ QueryIds["RECOMMENDED"] = "26099060629688648";
97
+ QueryIds["SIMILAR"] = "26099060629688649";
98
+ QueryIds["POLL_VOTER_LIST"] = "9783111038412087";
99
+ QueryIds["REACTION_SENDERS_LIST"] = "9783111038412088";
100
+ QueryIds["WAMO_ENABLE_SUB"] = "7148599488585197";
101
+ QueryIds["WAMO_DISABLE_SUB"] = "7148599488585198";
102
+ QueryIds["WAMO_CHANGE_SUB"] = "7148599488585199";
103
+ QueryIds["WAMO_AFS_AGE_COLLECTION"] = "6895563180530102";
104
+ QueryIds["WAMO_ASSET_COLLECTION"] = "6895563180530103";
105
+ QueryIds["WAMO_FETCH_ADHOC_NOTICE"] = "6895563180530104";
106
+ QueryIds["WAMO_FETCH_IDENTITY_TOKEN"] = "6895563180530105";
107
+ QueryIds["WAMO_SUB_COMPLIANCE_INFO"] = "6895563180530106";
108
+ QueryIds["WAMO_USER_ID_VERSION"] = "6895563180530107";
109
+ QueryIds["WAMO_SET_USER_ID_VERSION"] = "6895563180530108";
110
+ })(QueryIds || (QueryIds = {}));
111
+ //# sourceMappingURL=Mex.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Product.js.map
@@ -0,0 +1,2 @@
1
+ import { proto } from '../../WAProto/index.js';
2
+ //# sourceMappingURL=Signal.js.map
@@ -0,0 +1,3 @@
1
+ import { proto } from '../../WAProto/index.js';
2
+ import {} from './Message.js';
3
+ //# sourceMappingURL=Socket.js.map
@@ -0,0 +1,56 @@
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
@@ -0,0 +1,2 @@
1
+ import { USyncUser } from '../WAUSync/index.js';
2
+ //# sourceMappingURL=USync.js.map
@@ -0,0 +1,26 @@
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
@@ -0,0 +1,215 @@
1
+ export declare const VERSION: "4.8";
2
+ export declare const MESSAGE_BUILDER_VERSION: "4.8";
3
+
4
+ export interface AIRichItemOptions {
5
+ id?: string;
6
+ replace?: string | number;
7
+ insertAt?: string | number;
8
+ }
9
+
10
+ export declare class AIRichError extends Error {
11
+ constructor(message: string, code: string, meta?: Record<string, any>);
12
+ code: string;
13
+ }
14
+
15
+ export declare class ItemNotFoundError extends AIRichError {
16
+ constructor(id: string, availableIds?: string[]);
17
+ id: string;
18
+ availableIds: string[];
19
+ }
20
+
21
+ export declare class DuplicateIdError extends AIRichError {
22
+ constructor(id: string);
23
+ id: string;
24
+ }
25
+
26
+ export declare class InvalidTargetError extends AIRichError {
27
+ constructor(message: string, meta?: Record<string, any>);
28
+ }
29
+
30
+ export declare class ContentValidationError extends AIRichError {
31
+ constructor(message: string, meta?: Record<string, any>);
32
+ }
33
+
34
+ export declare class Toolkit {
35
+ constructor();
36
+ static extractIE(text: string, options?: Record<string, any>): any;
37
+ static resize(buffer: Buffer, x: number, y: number, fit?: string): Promise<Buffer>;
38
+ static waitAllPromises(input: any): Promise<any>;
39
+ static fetchBuffer(url: string, options?: Record<string, any>, settings?: { silent?: boolean }): Promise<Buffer>;
40
+ static toUrl(client: any, path: any, mediaType?: string): Promise<any>;
41
+ static resolveMedia(client: any, media: any, mediaType?: string, options?: Record<string, any>): Promise<any>;
42
+ static getMp4Duration(buffer: Buffer, options?: { silent?: boolean }): number;
43
+ static getMp4Preview(videoBuffer: Buffer, options?: Record<string, any>): Promise<Buffer | string>;
44
+ static stringifyEscaped(obj: any): string;
45
+ }
46
+
47
+ declare class BaseBuilder {
48
+ setTitle(title: string): this;
49
+ setSubtitle(subtitle: string): this;
50
+ setBody(body: string): this;
51
+ setFooter(footer: string): this;
52
+ setContextInfo(obj: Record<string, any>): this;
53
+ addPayload(obj: Record<string, any>): this;
54
+ }
55
+
56
+ export declare class Button extends BaseBuilder {
57
+ constructor(client: any);
58
+ loadFrom(msg: any): this;
59
+ setVideo(path: any, options?: Record<string, any>): this;
60
+ setImage(path: any, options?: Record<string, any>): this;
61
+ setDocument(path: any, options?: Record<string, any>): this;
62
+ setMedia(obj: Record<string, any>): this;
63
+ clearButtons(): this;
64
+ setParams(obj: Record<string, any>): this;
65
+ addButton(name: string, params: Record<string, any> | string): this;
66
+ makeRow(header?: string, title?: string, description?: string, id?: string): this;
67
+ makeSection(title?: string, highlightLabel?: string): this;
68
+ addSelection(title: string, options?: Record<string, any>): this;
69
+ addReply(displayText?: string, id?: string, options?: Record<string, any>): this;
70
+ addCall(displayText?: string, id?: string, options?: Record<string, any>): this;
71
+ addReminder(displayText?: string, id?: string, options?: Record<string, any>): this;
72
+ addCancelReminder(displayText?: string, id?: string, options?: Record<string, any>): this;
73
+ addAddress(displayText?: string, id?: string, options?: Record<string, any>): this;
74
+ addLocation(options?: Record<string, any>): this;
75
+ addUrl(displayText?: string, url?: string, webviewInteraction?: boolean, options?: Record<string, any>): this;
76
+ addCopy(displayText?: string, copyCode?: string, options?: Record<string, any>): this;
77
+ static paramsList: Record<string, any>;
78
+ toCard(): Promise<any>;
79
+ build(jid: string, options?: Record<string, any>): Promise<any>;
80
+ send(jid: string, options?: Record<string, any>): Promise<any>;
81
+ }
82
+
83
+ export declare class ButtonV2 extends BaseBuilder {
84
+ constructor(client: any);
85
+ loadFrom(msg: any): this;
86
+ addButton(displayText?: string, buttonId?: string): this;
87
+ addRawButton(obj: Record<string, any>): this;
88
+ setRawThumbnail(thumbnail: string): this;
89
+ setThumbnail(path: any): this;
90
+ setMedia(obj: Record<string, any>): this;
91
+ build(jid: string, options?: Record<string, any>): Promise<any>;
92
+ send(jid: string, options?: Record<string, any>): Promise<any>;
93
+ }
94
+
95
+ export declare class Carousel extends BaseBuilder {
96
+ constructor(client: any);
97
+ loadFrom(msg: any): this;
98
+ addCard(card: any): this;
99
+ build(jid: string, options?: Record<string, any>): any;
100
+ send(jid: string, options?: Record<string, any>): Promise<any>;
101
+ }
102
+
103
+ export declare class AIRich extends BaseBuilder {
104
+ constructor(client: any, options?: { dynamic?: boolean; unsupportedTypeAlert?: boolean });
105
+ static readonly DEFAULT_BOT_JID: string;
106
+ static readonly MAP_DELTA: number;
107
+ static readonly LAYOUT_FIELDS: Readonly<Record<string, string>>;
108
+ static readonly SECTION_TYPENAME: string;
109
+ static readonly UNIFIED_RESPONSE_TYPENAME: string;
110
+ static tokenizer(code: string, lang?: string): any;
111
+ static toTableMetadata(rows: any[], options?: Record<string, any>): any;
112
+ static generateVerificationMetadata(): any;
113
+ static isMetaSignature(verificationMetadata: any): boolean;
114
+ static readonly PLACEHOLDER_MARKER: Buffer;
115
+ static wrapRichResponse(richResponseMessage: any, forwardWrapper?: boolean): any;
116
+ static newLayout(name: string, data: any, extra?: Record<string, any>): any;
117
+ static normalizeSection(section: any): any;
118
+ readonly isSignaturePreserved: boolean;
119
+ loadFrom(msg: any): this;
120
+ setResponseMeta(meta: Record<string, any>): this;
121
+ setResponseId(id: string): this;
122
+ refreshResponseId(): this;
123
+ setBotResponseId(id: string): this;
124
+ refreshBotResponseId(): this;
125
+ createAlert(type: string): any;
126
+ hasId(id: string): boolean;
127
+ getIds(): string[];
128
+ peek(id?: string | number): any;
129
+ assignId(target: string | number, id: string): this;
130
+ delete(target: string | number): this;
131
+ addSubmessage(submessage: any, options?: AIRichItemOptions): this;
132
+ addSection(section: any, options?: AIRichItemOptions & { text?: string; submessage?: any }): this;
133
+ addFooterSection(section: any): this;
134
+ addEmbeddedScreen(screen: any): this;
135
+ setBotMetadata(extra: Record<string, any>): this;
136
+ clearFooterSections(): this;
137
+ addText(text: string, options?: AIRichItemOptions & { hyperlink?: boolean; citation?: boolean; latex?: boolean }): this;
138
+ addFOAText(text: string, options?: AIRichItemOptions): this;
139
+ addCode(language: string, code: string, options?: AIRichItemOptions): this;
140
+ addTable(table: string[][], options?: AIRichItemOptions & { hyperlink?: boolean; citation?: boolean; latex?: boolean }): this;
141
+ addMap(
142
+ places: {
143
+ latitude: number;
144
+ longitude: number;
145
+ title?: string;
146
+ name?: string;
147
+ body?: string;
148
+ description?: string;
149
+ address?: string;
150
+ id?: string | number;
151
+ imageUrl?: string;
152
+ itemType?: string;
153
+ }[],
154
+ options?: AIRichItemOptions & {
155
+ center?: { latitude: number; longitude: number };
156
+ latitudeDelta?: number;
157
+ longitudeDelta?: number;
158
+ showInfoList?: boolean;
159
+ motivation?: string;
160
+ staticMapUrl?: string;
161
+ staticMapDarkUrl?: string;
162
+ }
163
+ ): this;
164
+ addSource(sources?: any[], options?: AIRichItemOptions): this;
165
+ addReels(reelsItems?: any, options?: AIRichItemOptions): this;
166
+ addImage(imageUrl: any, options?: AIRichItemOptions & { width?: number; height?: number; status?: string; update_text?: string; resolveUrl?: boolean }): this;
167
+ addVideo(videoUrl: any, options?: AIRichItemOptions & { autoFill?: boolean; status?: string; estimatedTime?: number }): this;
168
+ addProduct(data?: any, options?: AIRichItemOptions): this;
169
+ addPost(data?: any, options?: AIRichItemOptions): this;
170
+ addMetadata(text: string, options?: AIRichItemOptions): this;
171
+ addTip(text: string, options?: AIRichItemOptions): this;
172
+ addWidget(data: any, options?: AIRichItemOptions & { layout?: string }): this;
173
+ addFooterAction(data: any, options?: AIRichItemOptions & { layout?: string }): this;
174
+ addSuggest(suggestion: string | string[], options?: AIRichItemOptions & { scroll?: boolean; layout?: string }): this;
175
+ addHtml(html: string, options?: AIRichItemOptions & { title?: string; trusted_sources?: string[] }): this;
176
+ addA2UI(a2uiInstance: any, options?: AIRichItemOptions & { type?: string }): this;
177
+ build(jid: string, options?: Record<string, any>): Promise<any>;
178
+ buildEdit(targetJid: string, targetId: string, options?: Record<string, any>): Promise<any>;
179
+ send(jid: string, options?: Record<string, any>): Promise<any>;
180
+ sendEdit(jid?: string, id?: string, options?: Record<string, any>): Promise<any>;
181
+ readonly sections: any[];
182
+ readonly items: any[];
183
+ }
184
+
185
+ export declare function bind(client: any): any;
186
+
187
+ export declare const MessageBuilder: Readonly<{
188
+ VERSION: "4.8";
189
+ Button: typeof Button;
190
+ ButtonV2: typeof ButtonV2;
191
+ Carousel: typeof Carousel;
192
+ AIRich: typeof AIRich;
193
+ Toolkit: typeof Toolkit;
194
+ bind: typeof bind;
195
+ A2UI: any;
196
+ sendA2UI: any;
197
+ sendA2UIWidget: any;
198
+ sendBloksWidget: any;
199
+ sendHtmlApp: any;
200
+ sendHtmlDocument: any;
201
+ htmlSection: any;
202
+ checkHtmlApp: any;
203
+ autoHeight: any;
204
+ lockHeight: any;
205
+ scrollControls: any;
206
+ buildDefaultBizNodes: any;
207
+ AIRichError: typeof AIRichError;
208
+ ItemNotFoundError: typeof ItemNotFoundError;
209
+ DuplicateIdError: typeof DuplicateIdError;
210
+ InvalidTargetError: typeof InvalidTargetError;
211
+ ContentValidationError: typeof ContentValidationError;
212
+ }>;
213
+
214
+ export declare const MB: typeof MessageBuilder;
215
+ export default MessageBuilder;