@ikyyjee/ikyysinggle 1.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/WAProto/GenerateStatics.sh +3 -0
- package/WAProto/WAProto.proto +8083 -0
- package/WAProto/fix-imports.js +85 -0
- package/WAProto/index.d.ts +29095 -0
- package/WAProto/index.js +172336 -0
- package/engine-requirements.js +10 -0
- package/lib/Defaults/index.js +194 -0
- package/lib/Signal/Group/ciphertext-message.js +12 -0
- package/lib/Signal/Group/group-session-builder.js +30 -0
- package/lib/Signal/Group/group_cipher.js +82 -0
- package/lib/Signal/Group/index.js +12 -0
- package/lib/Signal/Group/keyhelper.js +18 -0
- package/lib/Signal/Group/sender-chain-key.js +26 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
- package/lib/Signal/Group/sender-key-message.js +66 -0
- package/lib/Signal/Group/sender-key-name.js +48 -0
- package/lib/Signal/Group/sender-key-record.js +41 -0
- package/lib/Signal/Group/sender-key-state.js +84 -0
- package/lib/Signal/Group/sender-message-key.js +26 -0
- package/lib/Signal/libsignal.js +431 -0
- package/lib/Signal/lid-mapping.js +277 -0
- package/lib/Socket/Client/index.js +3 -0
- package/lib/Socket/Client/types.js +11 -0
- package/lib/Socket/Client/websocket.js +102 -0
- package/lib/Socket/aigroups.js +221 -0
- package/lib/Socket/business.js +379 -0
- package/lib/Socket/chats.js +1193 -0
- package/lib/Socket/communities.js +431 -0
- package/lib/Socket/graphql.js +524 -0
- package/lib/Socket/groups.js +408 -0
- package/lib/Socket/index.js +49 -0
- package/lib/Socket/interop.js +341 -0
- package/lib/Socket/luxu.js +510 -0
- package/lib/Socket/managed-account.js +99 -0
- package/lib/Socket/messages-recv.js +2009 -0
- package/lib/Socket/messages-send.js +1608 -0
- package/lib/Socket/mex.js +41 -0
- package/lib/Socket/newsletter.js +399 -0
- package/lib/Socket/privacy.js +128 -0
- package/lib/Socket/registration.js +238 -0
- package/lib/Socket/socket.js +1000 -0
- package/lib/Socket/text-router.js +67 -0
- package/lib/Socket/username.js +234 -0
- package/lib/Store/index.js +10 -0
- package/lib/Store/keyed-db.js +108 -0
- package/lib/Store/make-cache-manager-store.js +85 -0
- package/lib/Store/make-in-memory-store.js +198 -0
- package/lib/Store/make-ordered-dictionary.js +75 -0
- package/lib/Store/object-repository.js +32 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Bussines.js +2 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Chat.js +8 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/Label.js +25 -0
- package/lib/Types/LabelAssociation.js +7 -0
- package/lib/Types/Message.js +11 -0
- package/lib/Types/Mex.js +114 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Socket.js +3 -0
- package/lib/Types/State.js +56 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/index.js +26 -0
- package/lib/Utils/adaptive-healing.js +53 -0
- package/lib/Utils/auth-utils.js +302 -0
- package/lib/Utils/browser-utils.js +50 -0
- package/lib/Utils/business.js +231 -0
- package/lib/Utils/chat-utils.js +872 -0
- package/lib/Utils/command-loader.js +108 -0
- package/lib/Utils/companion-reg-client-utils.js +35 -0
- package/lib/Utils/consumer-application.js +106 -0
- package/lib/Utils/crypto.js +137 -0
- package/lib/Utils/curve25519-js.js +262 -0
- package/lib/Utils/decode-wa-message.js +498 -0
- package/lib/Utils/event-buffer.js +622 -0
- package/lib/Utils/generics.js +403 -0
- package/lib/Utils/group-history.js +47 -0
- package/lib/Utils/history.js +134 -0
- package/lib/Utils/identity-change-handler.js +50 -0
- package/lib/Utils/index.js +38 -0
- package/lib/Utils/jid-display-normalization.js +198 -0
- package/lib/Utils/link-preview.js +85 -0
- package/lib/Utils/logger.js +3 -0
- package/lib/Utils/lt-hash.js +8 -0
- package/lib/Utils/make-mutex.js +33 -0
- package/lib/Utils/message-composer.js +273 -0
- package/lib/Utils/message-retry-manager.js +267 -0
- package/lib/Utils/messages-media.js +791 -0
- package/lib/Utils/messages.js +1260 -0
- package/lib/Utils/meta-ai-msmsg.js +271 -0
- package/lib/Utils/native-bridge.js +77 -0
- package/lib/Utils/noise-handler.js +201 -0
- package/lib/Utils/offline-node-processor.js +40 -0
- package/lib/Utils/optimizer.js +90 -0
- package/lib/Utils/pre-key-manager.js +106 -0
- package/lib/Utils/process-message.js +630 -0
- package/lib/Utils/reporting-utils.js +258 -0
- package/lib/Utils/session-pool.js +73 -0
- package/lib/Utils/signal.js +207 -0
- package/lib/Utils/stanza-ack.js +38 -0
- package/lib/Utils/sticker.js +139 -0
- package/lib/Utils/sync-action-utils.js +49 -0
- package/lib/Utils/tc-token-utils.js +163 -0
- package/lib/Utils/use-multi-file-auth-state.js +121 -0
- package/lib/Utils/use-sqlite-auth-state.js +168 -0
- package/lib/Utils/validate-connection.js +203 -0
- package/lib/Utils/view-once-cache.js +79 -0
- package/lib/Utils/voip-rekey.js +25 -0
- package/lib/Utils/warmup.js +117 -0
- package/lib/WABinary/constants.js +1301 -0
- package/lib/WABinary/decode.js +262 -0
- package/lib/WABinary/encode.js +220 -0
- package/lib/WABinary/generic-utils.js +204 -0
- package/lib/WABinary/index.js +6 -0
- package/lib/WABinary/jid-utils.js +98 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WAM/BinaryInfo.js +10 -0
- package/lib/WAM/constants.js +22853 -0
- package/lib/WAM/encode.js +150 -0
- package/lib/WAM/index.js +4 -0
- package/lib/WAUSync/Protocols/USyncBusinessProtocol.js +41 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +52 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +54 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
- package/lib/WAUSync/Protocols/USyncFeatureProtocol.js +52 -0
- package/lib/WAUSync/Protocols/USyncPictureProtocol.js +31 -0
- package/lib/WAUSync/Protocols/USyncSidelistProtocol.js +26 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
- package/lib/WAUSync/Protocols/USyncTextStatusProtocol.js +35 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
- package/lib/WAUSync/Protocols/index.js +13 -0
- package/lib/WAUSync/USyncQuery.js +127 -0
- package/lib/WAUSync/USyncUser.js +31 -0
- package/lib/WAUSync/index.js +4 -0
- package/lib/antiban.js +4083 -0
- package/lib/index.js +24 -0
- package/package.json +147 -0
|
@@ -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,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
|
package/lib/Types/Mex.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
// --- Added: broader newsletter/channel admin, directory, and moderation
|
|
20
|
+
// surface not previously mapped. Pure additive data (string constants),
|
|
21
|
+
// doesn't change any existing key's value. See LITERACY.md changelog.
|
|
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"] = "xwa2_newsletter_admin";
|
|
26
|
+
XWAPaths["xwa2_newsletter_admin_profile_update"] = "xwa2_newsletter_admin_profile_update";
|
|
27
|
+
XWAPaths["xwa2_newsletters_directory_list"] = "xwa2_newsletters_directory_list";
|
|
28
|
+
XWAPaths["xwa2_newsletters_directory_search"] = "xwa2_newsletters_directory_search";
|
|
29
|
+
XWAPaths["xwa2_newsletters_directory_category_preview"] = "xwa2_newsletters_directory_category_preview";
|
|
30
|
+
XWAPaths["xwa2_newsletters_search"] = "xwa2_newsletters_search";
|
|
31
|
+
XWAPaths["xwa2_newsletters_recommended"] = "xwa2_newsletters_recommended";
|
|
32
|
+
XWAPaths["xwa2_newsletters_similar"] = "xwa2_newsletters_similar";
|
|
33
|
+
XWAPaths["xwa2_newsletter_following"] = "xwa2_newsletter_following";
|
|
34
|
+
XWAPaths["xwa2_newsletter_admin_insights"] = "xwa2_newsletter_admin_insights";
|
|
35
|
+
XWAPaths["xwa2_newsletters_poll_voter_list"] = "xwa2_newsletters_poll_voter_list";
|
|
36
|
+
XWAPaths["xwa2_newsletters_reaction_sender_list"] = "xwa2_newsletters_reaction_sender_list";
|
|
37
|
+
XWAPaths["xwa2_newsletter_enforcements"] = "xwa2_newsletter_enforcements";
|
|
38
|
+
XWAPaths["xwa2_newsletter_user_reports"] = "xwa2_newsletter_user_reports";
|
|
39
|
+
XWAPaths["xwa2_newsletter_create_report_appeal"] = "xwa2_newsletter_create_report_appeal";
|
|
40
|
+
XWAPaths["xwa2_newsletter_link_preview_check"] = "xwa2_newsletter_link_preview_check";
|
|
41
|
+
XWAPaths["xwa2_newsletter_update_verification"] = "xwa2_newsletter_update_verification";
|
|
42
|
+
XWAPaths["xwa2_newsletter_label_paid_partnership"] = "xwa2_newsletter_label_paid_partnership";
|
|
43
|
+
XWAPaths["xwa2_newsletter_log_exposures"] = "xwa2_newsletter_log_exposures";
|
|
44
|
+
XWAPaths["xwa2_newsletter_update_user_setting"] = "xwa2_newsletter_update_user_setting";
|
|
45
|
+
XWAPaths["xwa2_newsletter_create_verified"] = "xwa2_newsletter_create_verified";
|
|
46
|
+
XWAPaths["xwa2_newsletter_ranking_features"] = "xwa2_newsletter_ranking_features";
|
|
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
|
+
export var QueryIds;
|
|
56
|
+
(function (QueryIds) {
|
|
57
|
+
QueryIds["CREATE"] = "8823471724422422";
|
|
58
|
+
QueryIds["UPDATE_METADATA"] = "24250201037901610";
|
|
59
|
+
QueryIds["METADATA"] = "6563316087068696";
|
|
60
|
+
QueryIds["SUBSCRIBERS"] = "9783111038412085";
|
|
61
|
+
QueryIds["FOLLOW"] = "24404358912487870";
|
|
62
|
+
QueryIds["UNFOLLOW"] = "9767147403369991";
|
|
63
|
+
QueryIds["MUTE"] = "29766401636284406";
|
|
64
|
+
QueryIds["UNMUTE"] = "9864994326891137";
|
|
65
|
+
QueryIds["ADMIN_COUNT"] = "7130823597031706";
|
|
66
|
+
QueryIds["CHANGE_OWNER"] = "7341777602580933";
|
|
67
|
+
QueryIds["DEMOTE"] = "6551828931592903";
|
|
68
|
+
QueryIds["DELETE"] = "30062808666639665";
|
|
69
|
+
QueryIds["REACHOUT_TIMELOCK"] = "23983697327930364";
|
|
70
|
+
QueryIds["MESSAGE_CAPPING_INFO"] = "24503548349331633";
|
|
71
|
+
// --- Added: query IDs for the newly-added XWAPaths above. Not currently
|
|
72
|
+
// wired into any function (no existing call site references them yet) —
|
|
73
|
+
// available for building out newsletter admin/directory/moderation
|
|
74
|
+
// features on top of, same pattern as the FOLLOW/MUTE/etc. ones above.
|
|
75
|
+
QueryIds["CREATE_VERIFIED"] = "25691091733891788";
|
|
76
|
+
QueryIds["LEAVE"] = "25758579043742316";
|
|
77
|
+
QueryIds["UPDATE_USER_SETTING"] = "24935528202764690";
|
|
78
|
+
QueryIds["ADMIN_INVITE"] = "26278681041745440";
|
|
79
|
+
QueryIds["ADMIN_INVITE_REVOKE"] = "24369392486051948";
|
|
80
|
+
QueryIds["ADMIN_INVITE_ACCEPT"] = "24934958956134856";
|
|
81
|
+
QueryIds["ADMIN_METADATA"] = "26882701001369256";
|
|
82
|
+
QueryIds["ADMIN_PROFILE_UPDATE"] = "25959584293627630";
|
|
83
|
+
QueryIds["DIRECTORY_LIST"] = "35420207774244120";
|
|
84
|
+
QueryIds["DIRECTORY_SEARCH"] = "26545699395089024";
|
|
85
|
+
QueryIds["DIRECTORY_CATEGORY_PREVIEW"] = "25554326764266960";
|
|
86
|
+
QueryIds["SEARCH"] = "25909596625362196";
|
|
87
|
+
QueryIds["RECOMMENDED"] = "26234104032880280";
|
|
88
|
+
QueryIds["SIMILAR"] = "33639678252347084";
|
|
89
|
+
QueryIds["FOLLOWING_LIST"] = "25757497553878990";
|
|
90
|
+
QueryIds["INSIGHTS"] = "24672564052397920";
|
|
91
|
+
QueryIds["POLL_VOTER_LIST"] = "24803802869271956";
|
|
92
|
+
QueryIds["REACTION_SENDERS_LIST"] = "25219734117717030";
|
|
93
|
+
QueryIds["QUESTION_RESPONSE_STATE_UPDATE"] = "24896618076668076";
|
|
94
|
+
QueryIds["LOG_EXPOSURES"] = "24606408825709910";
|
|
95
|
+
QueryIds["RANKING_FEATURES"] = "24742757908756090";
|
|
96
|
+
QueryIds["BLOCK_USER"] = "25106066249006236";
|
|
97
|
+
QueryIds["USER_REPORTS"] = "26334442806191824";
|
|
98
|
+
QueryIds["CREATE_REPORT_APPEAL"] = "26787508127520150";
|
|
99
|
+
QueryIds["ENFORCEMENTS"] = "25956852020603264";
|
|
100
|
+
QueryIds["LINK_PREVIEW_CHECK"] = "24188786150796508";
|
|
101
|
+
QueryIds["UPDATE_VERIFICATION"] = "33965625006384290";
|
|
102
|
+
QueryIds["LABEL_PAID_PARTNERSHIP"] = "26221505494211176";
|
|
103
|
+
QueryIds["WAMO_CHANGE_SUB"] = "25201342542835864";
|
|
104
|
+
QueryIds["WAMO_ENABLE_SUB"] = "25122474967344830";
|
|
105
|
+
QueryIds["WAMO_DISABLE_SUB"] = "31916794074578680";
|
|
106
|
+
QueryIds["WAMO_AFS_AGE_COLLECTION"] = "25012618978387376";
|
|
107
|
+
QueryIds["WAMO_ASSET_COLLECTION"] = "24347085218298772";
|
|
108
|
+
QueryIds["WAMO_FETCH_ADHOC_NOTICE"] = "24758534413802424";
|
|
109
|
+
QueryIds["WAMO_FETCH_IDENTITY_TOKEN"] = "24677346488597664";
|
|
110
|
+
QueryIds["WAMO_SUB_COMPLIANCE_INFO"] = "25105596879072480";
|
|
111
|
+
QueryIds["WAMO_USER_ID_VERSION"] = "24958410737155268";
|
|
112
|
+
QueryIds["WAMO_SET_USER_ID_VERSION"] = "8148672891859281";
|
|
113
|
+
})(QueryIds || (QueryIds = {}));
|
|
114
|
+
//# sourceMappingURL=Mex.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,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,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lib/Utils/adaptive-healing.js — connection-quality helpers.
|
|
3
|
+
* `AdaptiveDelayManager` is a small backoff/cooldown timer (grows delay on
|
|
4
|
+
* repeated errors, cools back down on success) for use around any retry
|
|
5
|
+
* loop. `autoHealSession` is a targeted recovery step for the specific
|
|
6
|
+
* "MAC error" / decryption-failure symptom of a desynced Signal session:
|
|
7
|
+
* it just re-fetches the media connection info, nothing more invasive.
|
|
8
|
+
*/
|
|
9
|
+
export class AdaptiveDelayManager {
|
|
10
|
+
constructor(options = {}) {
|
|
11
|
+
this.baseDelay = options.baseDelay || 1200;
|
|
12
|
+
this.maxDelay = options.maxDelay || 10000;
|
|
13
|
+
this.currentDelay = this.baseDelay;
|
|
14
|
+
this.consecutiveErrors = 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
recordSuccess() {
|
|
18
|
+
this.consecutiveErrors = 0;
|
|
19
|
+
// Gradual cooldown back to base delay
|
|
20
|
+
if (this.currentDelay > this.baseDelay) {
|
|
21
|
+
this.currentDelay = Math.max(this.baseDelay, this.currentDelay - 200);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
recordError() {
|
|
26
|
+
this.consecutiveErrors++;
|
|
27
|
+
// Exponential backoff with ceiling
|
|
28
|
+
this.currentDelay = Math.min(this.maxDelay, this.baseDelay * Math.pow(1.5, this.consecutiveErrors));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async wait() {
|
|
32
|
+
const jitter = Math.random() * 300;
|
|
33
|
+
const delayTime = Math.floor(this.currentDelay + jitter);
|
|
34
|
+
await new Promise(resolve => setTimeout(resolve, delayTime));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export async function autoHealSession(sock, error) {
|
|
39
|
+
console.warn('[AutoHeal] Detecting session anomaly or MAC error:', error?.message || error);
|
|
40
|
+
try {
|
|
41
|
+
if (error?.output?.statusCode === 428 || error?.message?.includes('MAC') || error?.message?.includes('Decryption')) {
|
|
42
|
+
console.log('[AutoHeal] Attempting automatic pre-key synchronization and session recovery...');
|
|
43
|
+
if (typeof sock.refreshMediaConn === 'function') {
|
|
44
|
+
await sock.refreshMediaConn(true);
|
|
45
|
+
}
|
|
46
|
+
console.log('[AutoHeal] Recovery sequence executed successfully.');
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
} catch (healError) {
|
|
50
|
+
console.error('[AutoHeal] Session healing failed:', healError);
|
|
51
|
+
}
|
|
52
|
+
return false;
|
|
53
|
+
}
|