@elrayyxml/baileys 1.0.3 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +2517 -0
  2. package/lib/Defaults/baileys-version.json +1 -1
  3. package/lib/Defaults/index.d.ts +51 -0
  4. package/lib/Defaults/index.js +9 -1
  5. package/lib/Defaults/phonenumber-mcc.json +223 -0
  6. package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
  7. package/lib/Signal/Group/group-session-builder.d.ts +14 -0
  8. package/lib/Signal/Group/group_cipher.d.ts +17 -0
  9. package/lib/Signal/Group/index.d.ts +11 -0
  10. package/lib/Signal/Group/keyhelper.d.ts +10 -0
  11. package/lib/Signal/Group/queue-job.d.ts +1 -0
  12. package/lib/Signal/Group/sender-chain-key.d.ts +13 -0
  13. package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
  14. package/lib/Signal/Group/sender-key-message.d.ts +18 -0
  15. package/lib/Signal/Group/sender-key-name.d.ts +17 -0
  16. package/lib/Signal/Group/sender-key-record.d.ts +30 -0
  17. package/lib/Signal/Group/sender-key-state.d.ts +38 -0
  18. package/lib/Signal/Group/sender-message-key.d.ts +11 -0
  19. package/lib/Signal/libsignal.d.ts +3 -0
  20. package/lib/Socket/Client/index.d.ts +2 -0
  21. package/lib/Socket/Client/types.d.ts +16 -0
  22. package/lib/Socket/Client/websocket.d.ts +13 -0
  23. package/lib/Socket/business.d.ts +172 -0
  24. package/lib/Socket/chats.d.ts +82 -0
  25. package/lib/Socket/groups.d.ts +124 -0
  26. package/lib/Socket/index.d.ts +172 -0
  27. package/lib/Socket/messages-recv.d.ts +161 -0
  28. package/lib/Socket/messages-send.d.ts +151 -0
  29. package/lib/Socket/messages-send.js +236 -59
  30. package/lib/Socket/newsletter.d.ts +136 -0
  31. package/lib/Socket/newsletter.js +5 -1
  32. package/lib/Socket/socket.d.ts +43 -0
  33. package/lib/Socket/usync.d.ts +36 -0
  34. package/lib/Store/index.d.ts +2 -0
  35. package/lib/Store/make-in-memory-store.d.ts +118 -0
  36. package/lib/Store/make-ordered-dictionary.d.ts +13 -0
  37. package/lib/Store/object-repository.d.ts +10 -0
  38. package/lib/Types/Auth.d.ts +103 -0
  39. package/lib/Types/Call.d.ts +13 -0
  40. package/lib/Types/Chat.d.ts +109 -0
  41. package/lib/Types/Contact.d.ts +23 -0
  42. package/lib/Types/Events.d.ts +199 -0
  43. package/lib/Types/GroupMetadata.d.ts +64 -0
  44. package/lib/Types/Label.d.ts +35 -0
  45. package/lib/Types/LabelAssociation.d.ts +29 -0
  46. package/lib/Types/Message.d.ts +400 -0
  47. package/lib/Types/Newsletter.d.ts +79 -0
  48. package/lib/Types/Product.d.ts +78 -0
  49. package/lib/Types/Signal.d.ts +57 -0
  50. package/lib/Types/Socket.d.ts +119 -0
  51. package/lib/Types/State.d.ts +27 -0
  52. package/lib/Types/USync.d.ts +25 -0
  53. package/lib/Types/index.d.ts +64 -0
  54. package/lib/Utils/auth-utils.d.ts +18 -0
  55. package/lib/Utils/baileys-event-stream.d.ts +16 -0
  56. package/lib/Utils/business.d.ts +22 -0
  57. package/lib/Utils/chat-utils.d.ts +70 -0
  58. package/lib/Utils/crypto.d.ts +40 -0
  59. package/lib/Utils/decode-wa-message.d.ts +35 -0
  60. package/lib/Utils/event-buffer.d.ts +35 -0
  61. package/lib/Utils/generics.d.ts +89 -0
  62. package/lib/Utils/generics.js +31 -4
  63. package/lib/Utils/history.d.ts +19 -0
  64. package/lib/Utils/index.d.ts +17 -0
  65. package/lib/Utils/link-preview.d.ts +21 -0
  66. package/lib/Utils/logger.d.ts +11 -0
  67. package/lib/Utils/lt-hash.d.ts +12 -0
  68. package/lib/Utils/make-mutex.d.ts +7 -0
  69. package/lib/Utils/messages-media.d.ts +120 -0
  70. package/lib/Utils/messages.d.ts +75 -0
  71. package/lib/Utils/messages.js +400 -38
  72. package/lib/Utils/noise-handler.d.ts +19 -0
  73. package/lib/Utils/process-message.d.ts +42 -0
  74. package/lib/Utils/signal.d.ts +33 -0
  75. package/lib/Utils/use-multi-file-auth-state.d.ts +12 -0
  76. package/lib/Utils/validate-connection.d.ts +10 -0
  77. package/lib/WABinary/constants.d.ts +27 -0
  78. package/lib/WABinary/decode.d.ts +6 -0
  79. package/lib/WABinary/encode.d.ts +2 -0
  80. package/lib/WABinary/generic-utils.d.ts +14 -0
  81. package/lib/WABinary/generic-utils.js +11 -8
  82. package/lib/WABinary/index.d.ts +5 -0
  83. package/lib/WABinary/jid-utils.d.ts +36 -0
  84. package/lib/WABinary/types.d.ts +18 -0
  85. package/lib/WAM/BinaryInfo.d.ts +8 -0
  86. package/lib/WAM/constants.d.ts +38 -0
  87. package/lib/WAM/encode.d.ts +2 -0
  88. package/lib/WAM/index.d.ts +3 -0
  89. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
  90. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  91. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  92. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  93. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +25 -0
  94. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +8 -0
  95. package/lib/WAUSync/Protocols/index.d.ts +4 -0
  96. package/lib/WAUSync/USyncQuery.d.ts +28 -0
  97. package/lib/WAUSync/USyncUser.d.ts +12 -0
  98. package/lib/WAUSync/index.d.ts +3 -0
  99. package/lib/index.d.ts +13 -0
  100. package/lib/index.js +4 -1
  101. package/package.json +17 -14
  102. package/README.MD +0 -78
  103. package/lib/Socket/type.js +0 -405
@@ -0,0 +1,27 @@
1
+ export declare const TAGS: {
2
+ LIST_EMPTY: number;
3
+ DICTIONARY_0: number;
4
+ DICTIONARY_1: number;
5
+ DICTIONARY_2: number;
6
+ DICTIONARY_3: number;
7
+ INTEROP_JID: number;
8
+ FB_JID: number;
9
+ AD_JID: number;
10
+ LIST_8: number;
11
+ LIST_16: number;
12
+ JID_PAIR: number;
13
+ HEX_8: number;
14
+ BINARY_8: number;
15
+ BINARY_20: number;
16
+ BINARY_32: number;
17
+ NIBBLE_8: number;
18
+ PACKED_MAX: number;
19
+ };
20
+ export declare const DOUBLE_BYTE_TOKENS: readonly [readonly ["read-self", "active", "fbns", "protocol", "reaction", "screen_width", "heartbeat", "deviceid", "2:47DEQpj8", "uploadfieldstat", "voip_settings", "retry", "priority", "longitude", "conflict", "false", "ig_professional", "replaced", "preaccept", "cover_photo", "uncompressed", "encopt", "ppic", "04", "passive", "status-revoke-drop", "keygen", "540", "offer", "rate", "opus", "latitude", "w:gp2", "ver", "4", "business_profile", "medium", "sender", "prev_v_id", "email", "website", "invited", "sign_credential", "05", "transport", "skey", "reason", "peer_abtest_bucket", "America/Sao_Paulo", "appid", "refresh", "100", "06", "404", "101", "104", "107", "102", "109", "103", "member_add_mode", "105", "transaction-id", "110", "106", "outgoing", "108", "111", "tokens", "followers", "ig_handle", "self_pid", "tue", "dec", "thu", "joinable", "peer_pid", "mon", "features", "wed", "peer_device_presence", "pn", "delete", "07", "fri", "audio_duration", "admin", "connected", "delta", "rcat", "disable", "collection", "08", "480", "sat", "phash", "all", "invite", "accept", "critical_unblock_low", "group_update", "signed_credential", "blinded_credential", "eph_setting", "net", "09", "background_location", "refresh_id", "Asia/Kolkata", "privacy_mode_ts", "account_sync", "voip_payload_type", "service_areas", "acs_public_key", "v_id", "0a", "fallback_class", "relay", "actual_actors", "metadata", "w:biz", "5", "connected-limit", "notice", "0b", "host_storage", "fb_page", "subject", "privatestats", "invis", "groupadd", "010", "note.m4r", "uuid", "0c", "8000", "sun", "372", "1020", "stage", "1200", "720", "canonical", "fb", "011", "video_duration", "0d", "1140", "superadmin", "012", "Opening.m4r", "keystore_attestation", "dleq_proof", "013", "timestamp", "ab_key", "w:sync:app:state", "0e", "vertical", "600", "p_v_id", "6", "likes", "014", "500", "1260", "creator", "0f", "rte", "destination", "group", "group_info", "syncd_anti_tampering_fatal_exception_enabled", "015", "dl_bw", "Asia/Jakarta", "vp8/h.264", "online", "1320", "fb:multiway", "10", "timeout", "016", "nse_retry", "urn:xmpp:whatsapp:dirty", "017", "a_v_id", "web_shops_chat_header_button_enabled", "nse_call", "inactive-upgrade", "none", "web", "groups", "2250", "mms_hot_content_timespan_in_seconds", "contact_blacklist", "nse_read", "suspended_group_deletion_notification", "binary_version", "018", "https://www.whatsapp.com/otp/copy/", "reg_push", "shops_hide_catalog_attachment_entrypoint", "server_sync", ".", "ephemeral_messages_allowed_values", "019", "mms_vcache_aggregation_enabled", "iphone", "America/Argentina/Buenos_Aires", "01a", "mms_vcard_autodownload_size_kb", "nse_ver", "shops_header_dropdown_menu_item", "dhash", "catalog_status", "communities_mvp_new_iqs_serverprop", "blocklist", "default", "11", "ephemeral_messages_enabled", "01b", "original_dimensions", "8", "mms4_media_retry_notification_encryption_enabled", "mms4_server_error_receipt_encryption_enabled", "original_image_url", "sync", "multiway", "420", "companion_enc_static", "shops_profile_drawer_entrypoint", "01c", "vcard_as_document_size_kb", "status_video_max_duration", "request_image_url", "01d", "regular_high", "s_t", "abt", "share_ext_min_preliminary_image_quality", "01e", "32", "syncd_key_rotation_enabled", "data_namespace", "md_downgrade_read_receipts2", "patch", "polltype", "ephemeral_messages_setting", "userrate", "15", "partial_pjpeg_bw_threshold", "played-self", "catalog_exists", "01f", "mute_v2"], readonly ["reject", "dirty", "announcement", "020", "13", "9", "status_video_max_bitrate", "fb:thrift_iq", "offline_batch", "022", "full", "ctwa_first_business_reply_logging", "h.264", "smax_id", "group_description_length", "https://www.whatsapp.com/otp/code", "status_image_max_edge", "smb_upsell_business_profile_enabled", "021", "web_upgrade_to_md_modal", "14", "023", "s_o", "smaller_video_thumbs_status_enabled", "media_max_autodownload", "960", "blocking_status", "peer_msg", "joinable_group_call_client_version", "group_call_video_maximization_enabled", "return_snapshot", "high", "America/Mexico_City", "entry_point_block_logging_enabled", "pop", "024", "1050", "16", "1380", "one_tap_calling_in_group_chat_size", "regular_low", "inline_joinable_education_enabled", "hq_image_max_edge", "locked", "America/Bogota", "smb_biztools_deeplink_enabled", "status_image_quality", "1088", "025", "payments_upi_intent_transaction_limit", "voip", "w:g2", "027", "md_pin_chat_enabled", "026", "multi_scan_pjpeg_download_enabled", "shops_product_grid", "transaction_id", "ctwa_context_enabled", "20", "fna", "hq_image_quality", "alt_jpeg_doc_detection_quality", "group_call_max_participants", "pkey", "America/Belem", "image_max_kbytes", "web_cart_v1_1_order_message_changes_enabled", "ctwa_context_enterprise_enabled", "urn:xmpp:whatsapp:account", "840", "Asia/Kuala_Lumpur", "max_participants", "video_remux_after_repair_enabled", "stella_addressbook_restriction_type", "660", "900", "780", "context_menu_ios13_enabled", "mute-state", "ref", "payments_request_messages", "029", "frskmsg", "vcard_max_size_kb", "sample_buffer_gif_player_enabled", "match_last_seen", "510", "4983", "video_max_bitrate", "028", "w:comms:chat", "17", "frequently_forwarded_max", "groups_privacy_blacklist", "Asia/Karachi", "02a", "web_download_document_thumb_mms_enabled", "02b", "hist_sync", "biz_block_reasons_version", "1024", "18", "web_is_direct_connection_for_plm_transparent", "view_once_write", "file_max_size", "paid_convo_id", "online_privacy_setting", "video_max_edge", "view_once_read", "enhanced_storage_management", "multi_scan_pjpeg_encoding_enabled", "ctwa_context_forward_enabled", "video_transcode_downgrade_enable", "template_doc_mime_types", "hq_image_bw_threshold", "30", "body", "u_aud_limit_sil_restarts_ctrl", "other", "participating", "w:biz:directory", "1110", "vp8", "4018", "meta", "doc_detection_image_max_edge", "image_quality", "1170", "02c", "smb_upsell_chat_banner_enabled", "key_expiry_time_second", "pid", "stella_interop_enabled", "19", "linked_device_max_count", "md_device_sync_enabled", "02d", "02e", "360", "enhanced_block_enabled", "ephemeral_icon_in_forwarding", "paid_convo_status", "gif_provider", "project_name", "server-error", "canonical_url_validation_enabled", "wallpapers_v2", "syncd_clear_chat_delete_chat_enabled", "medianotify", "02f", "shops_required_tos_version", "vote", "reset_skey_on_id_change", "030", "image_max_edge", "multicast_limit_global", "ul_bw", "21", "25", "5000", "poll", "570", "22", "031", "1280", "WhatsApp", "032", "bloks_shops_enabled", "50", "upload_host_switching_enabled", "web_ctwa_context_compose_enabled", "ptt_forwarded_features_enabled", "unblocked", "partial_pjpeg_enabled", "fbid:devices", "height", "ephemeral_group_query_ts", "group_join_permissions", "order", "033", "alt_jpeg_status_quality", "migrate", "popular-bank", "win_uwp_deprecation_killswitch_enabled", "web_download_status_thumb_mms_enabled", "blocking", "url_text", "035", "web_forwarding_limit_to_groups", "1600", "val", "1000", "syncd_msg_date_enabled", "bank-ref-id", "max_subject", "payments_web_enabled", "web_upload_document_thumb_mms_enabled", "size", "request", "ephemeral", "24", "receipt_agg", "ptt_remember_play_position", "sampling_weight", "enc_rekey", "mute_always", "037", "034", "23", "036", "action", "click_to_chat_qr_enabled", "width", "disabled", "038", "md_blocklist_v2", "played_self_enabled", "web_buttons_message_enabled", "flow_id", "clear", "450", "fbid:thread", "bloks_session_state", "America/Lima", "attachment_picker_refresh", "download_host_switching_enabled", "1792", "u_aud_limit_sil_restarts_test2", "custom_urls", "device_fanout", "optimistic_upload", "2000", "key_cipher_suite", "web_smb_upsell_in_biz_profile_enabled", "e", "039", "siri_post_status_shortcut", "pair-device", "lg", "lc", "stream_attribution_url", "model", "mspjpeg_phash_gen", "catalog_send_all", "new_multi_vcards_ui", "share_biz_vcard_enabled", "-", "clean", "200", "md_blocklist_v2_server", "03b", "03a", "web_md_migration_experience", "ptt_conversation_waveform", "u_aud_limit_sil_restarts_test1"], readonly ["64", "ptt_playback_speed_enabled", "web_product_list_message_enabled", "paid_convo_ts", "27", "manufacturer", "psp-routing", "grp_uii_cleanup", "ptt_draft_enabled", "03c", "business_initiated", "web_catalog_products_onoff", "web_upload_link_thumb_mms_enabled", "03e", "mediaretry", "35", "hfm_string_changes", "28", "America/Fortaleza", "max_keys", "md_mhfs_days", "streaming_upload_chunk_size", "5541", "040", "03d", "2675", "03f", "...", "512", "mute", "48", "041", "alt_jpeg_quality", "60", "042", "md_smb_quick_reply", "5183", "c", "1343", "40", "1230", "043", "044", "mms_cat_v1_forward_hot_override_enabled", "user_notice", "ptt_waveform_send", "047", "Asia/Calcutta", "250", "md_privacy_v2", "31", "29", "128", "md_messaging_enabled", "046", "crypto", "690", "045", "enc_iv", "75", "failure", "ptt_oot_playback", "AIzaSyDR5yfaG7OG8sMTUj8kfQEb8T9pN8BM6Lk", "w", "048", "2201", "web_large_files_ui", "Asia/Makassar", "812", "status_collapse_muted", "1334", "257", "2HP4dm", "049", "patches", "1290", "43cY6T", "America/Caracas", "web_sticker_maker", "campaign", "ptt_pausable_enabled", "33", "42", "attestation", "biz", "04b", "query_linked", "s", "125", "04a", "810", "availability", "1411", "responsiveness_v2_m1", "catalog_not_created", "34", "America/Santiago", "1465", "enc_p", "04d", "status_info", "04f", "key_version", "..", "04c", "04e", "md_group_notification", "1598", "1215", "web_cart_enabled", "37", "630", "1920", "2394", "-1", "vcard", "38", "elapsed", "36", "828", "peer", "pricing_category", "1245", "invalid", "stella_ios_enabled", "2687", "45", "1528", "39", "u_is_redial_audio_1104_ctrl", "1025", "1455", "58", "2524", "2603", "054", "bsp_system_message_enabled", "web_pip_redesign", "051", "verify_apps", "1974", "1272", "1322", "1755", "052", "70", "050", "1063", "1135", "1361", "80", "1096", "1828", "1851", "1251", "1921", "key_config_id", "1254", "1566", "1252", "2525", "critical_block", "1669", "max_available", "w:auth:backup:token", "product", "2530", "870", "1022", "participant_uuid", "web_cart_on_off", "1255", "1432", "1867", "41", "1415", "1440", "240", "1204", "1608", "1690", "1846", "1483", "1687", "1749", "69", "url_number", "053", "1325", "1040", "365", "59", "Asia/Riyadh", "1177", "test_recommended", "057", "1612", "43", "1061", "1518", "1635", "055", "1034", "1375", "750", "1430", "event_code", "1682", "503", "55", "865", "78", "1309", "1365", "44", "America/Guayaquil", "535", "LIMITED", "1377", "1613", "1420", "1599", "1822", "05a", "1681", "password", "1111", "1214", "1376", "1478", "47", "1082", "4282", "Europe/Istanbul", "1307", "46", "058", "1124", "256", "rate-overlimit", "retail", "u_a_socket_err_fix_succ_test", "1292", "1370", "1388", "520", "861", "psa", "regular", "1181", "1766", "05b", "1183", "1213", "1304", "1537"], readonly ["1724", "profile_picture", "1071", "1314", "1605", "407", "990", "1710", "746", "pricing_model", "056", "059", "061", "1119", "6027", "65", "877", "1607", "05d", "917", "seen", "1516", "49", "470", "973", "1037", "1350", "1394", "1480", "1796", "keys", "794", "1536", "1594", "2378", "1333", "1524", "1825", "116", "309", "52", "808", "827", "909", "495", "1660", "361", "957", "google", "1357", "1565", "1967", "996", "1775", "586", "736", "1052", "1670", "bank", "177", "1416", "2194", "2222", "1454", "1839", "1275", "53", "997", "1629", "6028", "smba", "1378", "1410", "05c", "1849", "727", "create", "1559", "536", "1106", "1310", "1944", "670", "1297", "1316", "1762", "en", "1148", "1295", "1551", "1853", "1890", "1208", "1784", "7200", "05f", "178", "1283", "1332", "381", "643", "1056", "1238", "2024", "2387", "179", "981", "1547", "1705", "05e", "290", "903", "1069", "1285", "2436", "062", "251", "560", "582", "719", "56", "1700", "2321", "325", "448", "613", "777", "791", "51", "488", "902", "Asia/Almaty", "is_hidden", "1398", "1527", "1893", "1999", "2367", "2642", "237", "busy", "065", "067", "233", "590", "993", "1511", "54", "723", "860", "363", "487", "522", "605", "995", "1321", "1691", "1865", "2447", "2462", "NON_TRANSACTIONAL", "433", "871", "432", "1004", "1207", "2032", "2050", "2379", "2446", "279", "636", "703", "904", "248", "370", "691", "700", "1068", "1655", "2334", "060", "063", "364", "533", "534", "567", "1191", "1210", "1473", "1827", "069", "701", "2531", "514", "prev_dhash", "064", "496", "790", "1046", "1139", "1505", "1521", "1108", "207", "544", "637", "final", "1173", "1293", "1694", "1939", "1951", "1993", "2353", "2515", "504", "601", "857", "modify", "spam_request", "p_121_aa_1101_test4", "866", "1427", "1502", "1638", "1744", "2153", "068", "382", "725", "1704", "1864", "1990", "2003", "Asia/Dubai", "508", "531", "1387", "1474", "1632", "2307", "2386", "819", "2014", "066", "387", "1468", "1706", "2186", "2261", "471", "728", "1147", "1372", "1961"]];
21
+ export declare const SINGLE_BYTE_TOKENS: string[];
22
+ export declare const TOKEN_MAP: {
23
+ [token: string]: {
24
+ dict?: number;
25
+ index: number;
26
+ };
27
+ };
@@ -0,0 +1,6 @@
1
+ import type { BinaryNode, BinaryNodeCodingOptions } from './types';
2
+ export declare const decompressingIfRequired: (buffer: Buffer) => Promise<Buffer<ArrayBufferLike>>;
3
+ export declare const decodeDecompressedBinaryNode: (buffer: Buffer, opts: Pick<BinaryNodeCodingOptions, "DOUBLE_BYTE_TOKENS" | "SINGLE_BYTE_TOKENS" | "TAGS">, indexRef?: {
4
+ index: number;
5
+ }) => BinaryNode;
6
+ export declare const decodeBinaryNode: (buff: Buffer) => Promise<BinaryNode>;
@@ -0,0 +1,2 @@
1
+ import type { BinaryNode, BinaryNodeCodingOptions } from './types';
2
+ export declare const encodeBinaryNode: (node: BinaryNode, opts?: Pick<BinaryNodeCodingOptions, "TAGS" | "TOKEN_MAP">, buffer?: number[]) => Buffer;
@@ -0,0 +1,14 @@
1
+ import { proto } from '../../WAProto';
2
+ import { BinaryNode } from './types';
3
+ export declare const getBinaryNodeChildren: (node: BinaryNode | undefined, childTag: string) => BinaryNode[];
4
+ export declare const getAllBinaryNodeChildren: ({ content }: BinaryNode) => BinaryNode[];
5
+ export declare const getBinaryNodeChild: (node: BinaryNode | undefined, childTag: string) => BinaryNode | undefined;
6
+ export declare const getBinaryNodeChildBuffer: (node: BinaryNode | undefined, childTag: string) => Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike> | undefined;
7
+ export declare const getBinaryNodeChildString: (node: BinaryNode | undefined, childTag: string) => string | undefined;
8
+ export declare const getBinaryNodeChildUInt: (node: BinaryNode, childTag: string, length: number) => number | undefined;
9
+ export declare const assertNodeErrorFree: (node: BinaryNode) => void;
10
+ export declare const reduceBinaryNodeToDictionary: (node: BinaryNode, tag: string) => {
11
+ [_: string]: string;
12
+ };
13
+ export declare const getBinaryNodeMessages: ({ content }: BinaryNode) => proto.WebMessageInfo[];
14
+ export declare function binaryNodeToString(node: BinaryNode | BinaryNode['content'], i?: number): any;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBinaryNodeMessages = exports.reduceBinaryNodeToDictionary = exports.assertNodeErrorFree = exports.getBinaryNodeChildUInt = exports.getBinaryNodeChildString = exports.getBinaryNodeChildBuffer = exports.getBinaryNodeChild = exports.getAllBinaryNodeChildren = exports.getBinaryNodeChildren = void 0;
3
+ exports.getBinaryNodeFilter = exports.getBinaryNodeMessages = exports.reduceBinaryNodeToDictionary = exports.assertNodeErrorFree = exports.getBinaryNodeChildUInt = exports.getBinaryNodeChildString = exports.getBinaryNodeChildBuffer = exports.getBinaryNodeChild = exports.getAllBinaryNodeChildren = exports.getBinaryNodeChildren = void 0;
4
4
  exports.binaryNodeToString = binaryNodeToString;
5
5
  const boom_1 = require("@hapi/boom");
6
6
  const WAProto_1 = require("../../WAProto");
@@ -109,11 +109,14 @@ function binaryNodeToString(node, i = 0) {
109
109
  return tag + content;
110
110
  }
111
111
  exports.binaryNodeToString = binaryNodeToString;
112
- const getBinaryFilteredBizBot = (nodeContent) => {
113
- if (!Array.isArray(nodeContent)) return false
114
-
115
- return nodeContent.some(b =>
116
- ['bot'].includes(b?.tag) && b?.attrs?.biz_bot === '1'
117
- )
112
+ const getBinaryNodeFilter = (node) => {
113
+ if (!Array.isArray(node)) return false
114
+
115
+ return node.some(item =>
116
+ ['native_flow'].includes(item?.content?.[0]?.content?.[0]?.tag) ||
117
+ ['interactive', 'buttons', 'list'].includes(item?.content?.[0]?.tag) ||
118
+ ['hsm', 'biz'].includes(item?.tag) ||
119
+ ['bot'].includes(item?.tag) && item?.attrs?.biz_bot === '1'
120
+ )
118
121
  }
119
- exports.getBinaryFilteredBizBot = getBinaryFilteredBizBot;
122
+ exports.getBinaryNodeFilter = getBinaryNodeFilter;
@@ -0,0 +1,5 @@
1
+ export * from './encode';
2
+ export * from './decode';
3
+ export * from './generic-utils';
4
+ export * from './jid-utils';
5
+ export * from './types';
@@ -0,0 +1,36 @@
1
+ export declare const S_WHATSAPP_NET = "@s.whatsapp.net";
2
+ export declare const OFFICIAL_BIZ_JID = "16505361212@c.us";
3
+ export declare const SERVER_JID = "server@c.us";
4
+ export declare const PSA_WID = "0@c.us";
5
+ export declare const STORIES_JID = "status@broadcast";
6
+ export declare const META_AI_JID = "13135550002@c.us";
7
+ export type JidServer = 'c.us' | 'g.us' | 'broadcast' | 's.whatsapp.net' | 'call' | 'lid' | 'newsletter' | 'bot';
8
+ export type JidWithDevice = {
9
+ user: string;
10
+ device?: number;
11
+ };
12
+ export type FullJid = JidWithDevice & {
13
+ server: JidServer;
14
+ domainType?: number;
15
+ };
16
+ export declare const jidEncode: (user: string | number | null, server: JidServer, device?: number, agent?: number) => string;
17
+ export declare const jidDecode: (jid: string | undefined) => FullJid | undefined;
18
+ /** is the jid a user */
19
+ export declare const areJidsSameUser: (jid1: string | undefined, jid2: string | undefined) => boolean;
20
+ /** is the jid Meta IA */
21
+ export declare const isJidMetaAi: (jid: string | undefined) => boolean | undefined;
22
+ /** is the jid a user */
23
+ export declare const isJidUser: (jid: string | undefined) => boolean | undefined;
24
+ /** is the jid a group */
25
+ export declare const isLidUser: (jid: string | undefined) => boolean | undefined;
26
+ /** is the jid a broadcast */
27
+ export declare const isJidBroadcast: (jid: string | undefined) => boolean | undefined;
28
+ /** is the jid a newsletter */
29
+ export declare const isJidNewsletter: (jid: string | undefined) => boolean | undefined;
30
+ /** is the jid a group */
31
+ export declare const isJidGroup: (jid: string | undefined) => boolean | undefined;
32
+ /** is the jid the status broadcast */
33
+ export declare const isJidStatusBroadcast: (jid: string) => jid is "status@broadcast";
34
+ export declare const isJidBot: (jid: string | undefined) => boolean | "" | undefined;
35
+ export declare const jidNormalizedUser: (jid: string | undefined) => string;
36
+ export declare const getBotJid: (jid: string) => string;
@@ -0,0 +1,18 @@
1
+ import * as constants from './constants';
2
+ /**
3
+ * the binary node WA uses internally for communication
4
+ *
5
+ * this is manipulated soley as an object and it does not have any functions.
6
+ * This is done for easy serialization, to prevent running into issues with prototypes &
7
+ * to maintain functional code structure
8
+ * */
9
+ export type BinaryNode = {
10
+ tag: string;
11
+ attrs: {
12
+ [key: string]: string;
13
+ };
14
+ content?: BinaryNode[] | string | Uint8Array;
15
+ };
16
+ export type BinaryNodeAttributes = BinaryNode['attrs'];
17
+ export type BinaryNodeData = BinaryNode['content'];
18
+ export type BinaryNodeCodingOptions = typeof constants;
@@ -0,0 +1,8 @@
1
+ import { EventInputType } from './constants';
2
+ export declare class BinaryInfo {
3
+ protocolVersion: number;
4
+ sequence: number;
5
+ events: EventInputType[];
6
+ buffer: Buffer[];
7
+ constructor(options?: Partial<BinaryInfo>);
8
+ }
@@ -0,0 +1,38 @@
1
+ export declare const WEB_EVENTS: Event[];
2
+ export declare const WEB_GLOBALS: Global[];
3
+ export declare const FLAG_BYTE = 8, FLAG_GLOBAL = 0, FLAG_EVENT = 1, FLAG_FIELD = 2, FLAG_EXTENDED = 4;
4
+ export type Event = {
5
+ name: string;
6
+ id: number;
7
+ props: {
8
+ [key: string]: [number, string | {
9
+ [key: string]: number;
10
+ }];
11
+ };
12
+ weight: number;
13
+ wamChannel: string;
14
+ privateStatsIdInt: number;
15
+ };
16
+ export type Global = {
17
+ name: string;
18
+ id: number;
19
+ type: string | {
20
+ [key: string]: number;
21
+ };
22
+ validator?: string;
23
+ channels: string[];
24
+ };
25
+ type EventByName<T extends Event['name']> = Extract<Event, {
26
+ name: T;
27
+ }>;
28
+ export type EventInputType = {
29
+ [key in Event['name']]: {
30
+ props: {
31
+ [k in keyof EventByName<key>['props']]: any;
32
+ };
33
+ globals: {
34
+ [x: string]: any;
35
+ };
36
+ };
37
+ } & {};
38
+ export {};
@@ -0,0 +1,2 @@
1
+ import { BinaryInfo } from './BinaryInfo';
2
+ export declare const encodeWAM: (binaryInfo: BinaryInfo) => Buffer<ArrayBuffer>;
@@ -0,0 +1,3 @@
1
+ export * from './constants';
2
+ export * from './encode';
3
+ export * from './BinaryInfo';
@@ -0,0 +1,9 @@
1
+ import { USyncQueryProtocol } from '../../Types/USync';
2
+ import { BinaryNode } from '../../WABinary';
3
+ import { USyncUser } from '../USyncUser';
4
+ export declare class USyncContactProtocol implements USyncQueryProtocol {
5
+ name: string;
6
+ getQueryElement(): BinaryNode;
7
+ getUserElement(user: USyncUser): BinaryNode;
8
+ parser(node: BinaryNode): boolean;
9
+ }
@@ -0,0 +1,22 @@
1
+ import { USyncQueryProtocol } from '../../Types/USync';
2
+ import { BinaryNode } from '../../WABinary';
3
+ export type KeyIndexData = {
4
+ timestamp: number;
5
+ signedKeyIndex?: Uint8Array;
6
+ expectedTimestamp?: number;
7
+ };
8
+ export type DeviceListData = {
9
+ id: number;
10
+ keyIndex?: number;
11
+ isHosted?: boolean;
12
+ };
13
+ export type ParsedDeviceInfo = {
14
+ deviceList?: DeviceListData[];
15
+ keyIndex?: KeyIndexData;
16
+ };
17
+ export declare class USyncDeviceProtocol implements USyncQueryProtocol {
18
+ name: string;
19
+ getQueryElement(): BinaryNode;
20
+ getUserElement(): BinaryNode | null;
21
+ parser(node: BinaryNode): ParsedDeviceInfo;
22
+ }
@@ -0,0 +1,12 @@
1
+ import { USyncQueryProtocol } from '../../Types/USync';
2
+ import { BinaryNode } from '../../WABinary';
3
+ export type DisappearingModeData = {
4
+ duration: number;
5
+ setAt?: Date;
6
+ };
7
+ export declare class USyncDisappearingModeProtocol implements USyncQueryProtocol {
8
+ name: string;
9
+ getQueryElement(): BinaryNode;
10
+ getUserElement(): null;
11
+ parser(node: BinaryNode): DisappearingModeData | undefined;
12
+ }
@@ -0,0 +1,12 @@
1
+ import { USyncQueryProtocol } from '../../Types/USync';
2
+ import { BinaryNode } from '../../WABinary';
3
+ export type StatusData = {
4
+ status?: string | null;
5
+ setAt?: Date;
6
+ };
7
+ export declare class USyncStatusProtocol implements USyncQueryProtocol {
8
+ name: string;
9
+ getQueryElement(): BinaryNode;
10
+ getUserElement(): null;
11
+ parser(node: BinaryNode): StatusData | undefined;
12
+ }
@@ -0,0 +1,25 @@
1
+ import { USyncQueryProtocol } from '../../Types/USync';
2
+ import { BinaryNode } from '../../WABinary';
3
+ import { USyncUser } from '../USyncUser';
4
+ export type BotProfileCommand = {
5
+ name: string;
6
+ description: string;
7
+ };
8
+ export type BotProfileInfo = {
9
+ jid: string;
10
+ name: string;
11
+ attributes: string;
12
+ description: string;
13
+ category: string;
14
+ isDefault: boolean;
15
+ prompts: string[];
16
+ personaId: string;
17
+ commands: BotProfileCommand[];
18
+ commandsDescription: string;
19
+ };
20
+ export declare class USyncBotProfileProtocol implements USyncQueryProtocol {
21
+ name: string;
22
+ getQueryElement(): BinaryNode;
23
+ getUserElement(user: USyncUser): BinaryNode;
24
+ parser(node: BinaryNode): BotProfileInfo;
25
+ }
@@ -0,0 +1,8 @@
1
+ import { USyncQueryProtocol } from '../../Types/USync';
2
+ import { BinaryNode } from '../../WABinary';
3
+ export declare class USyncLIDProtocol implements USyncQueryProtocol {
4
+ name: string;
5
+ getQueryElement(): BinaryNode;
6
+ getUserElement(): null;
7
+ parser(node: BinaryNode): string | null;
8
+ }
@@ -0,0 +1,4 @@
1
+ export * from './USyncDeviceProtocol';
2
+ export * from './USyncContactProtocol';
3
+ export * from './USyncStatusProtocol';
4
+ export * from './USyncDisappearingModeProtocol';
@@ -0,0 +1,28 @@
1
+ import { USyncQueryProtocol } from '../Types/USync';
2
+ import { BinaryNode } from '../WABinary';
3
+ import { USyncUser } from './USyncUser';
4
+ export type USyncQueryResultList = {
5
+ [protocol: string]: unknown;
6
+ id: string;
7
+ };
8
+ export type USyncQueryResult = {
9
+ list: USyncQueryResultList[];
10
+ sideList: USyncQueryResultList[];
11
+ };
12
+ export declare class USyncQuery {
13
+ protocols: USyncQueryProtocol[];
14
+ users: USyncUser[];
15
+ context: string;
16
+ mode: string;
17
+ constructor();
18
+ withMode(mode: string): this;
19
+ withContext(context: string): this;
20
+ withUser(user: USyncUser): this;
21
+ parseUSyncQueryResult(result: BinaryNode): USyncQueryResult | undefined;
22
+ withDeviceProtocol(): this;
23
+ withContactProtocol(): this;
24
+ withStatusProtocol(): this;
25
+ withDisappearingModeProtocol(): this;
26
+ withBotProfileProtocol(): this;
27
+ withLIDProtocol(): this;
28
+ }
@@ -0,0 +1,12 @@
1
+ export declare class USyncUser {
2
+ id: string;
3
+ lid: string;
4
+ phone: string;
5
+ type: string;
6
+ personaId: string;
7
+ withId(id: string): this;
8
+ withLid(lid: string): this;
9
+ withPhone(phone: string): this;
10
+ withType(type: string): this;
11
+ withPersonaId(personaId: string): this;
12
+ }
@@ -0,0 +1,3 @@
1
+ export * from './Protocols';
2
+ export * from './USyncQuery';
3
+ export * from './USyncUser';
package/lib/index.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ import { proto } from '../WAProto';
2
+ import makeWASocket from './Socket';
3
+ export * from '../WAProto';
4
+ export * from './Utils';
5
+ export * from './Types';
6
+ export * from './Store';
7
+ export * from './Defaults';
8
+ export * from './WABinary';
9
+ export * from './WAM';
10
+ export * from './WAUSync';
11
+ export type WASocket = ReturnType<typeof makeWASocket>;
12
+ export { makeWASocket, proto };
13
+ export default makeWASocket;
package/lib/index.js CHANGED
@@ -1,11 +1,14 @@
1
1
  "use strict";
2
2
 
3
+ const { version } = require("../package.json");
4
+
3
5
  console.log(`
4
6
  \x1b[36m ______ ___ _____ ____ ___ ____ _____ \x1b[0m
5
7
  \x1b[36m / __/ / / _ \\/ _ \\ \\/ /\\ \\/ / |/_/ |/ / / \x1b[0m
6
8
  \x1b[36m / _// /__/ , _/ __ |\\ / \\ /> </ /|_/ / /__ \x1b[0m
7
9
  \x1b[36m /___/____/_/|_/_/ |_|/_/ /_/_/|_/_/ /_/____/\x1b[0m
8
- `)
10
+
11
+ \x1b[36m Version : ${version}\x1b[0m`)
9
12
 
10
13
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11
14
  if (k2 === undefined) k2 = k;
package/package.json CHANGED
@@ -1,25 +1,30 @@
1
1
  {
2
2
  "name": "@elrayyxml/baileys",
3
- "version": "1.0.3",
3
+ "version": "1.0.7",
4
4
  "description": "Baileys Modified ElrayyXml",
5
5
  "keywords": [
6
6
  "baileys",
7
- "elrayyxml",
8
- "Baileys",
9
- "WhatsApp",
10
- "WhatsApp-API",
11
7
  "whatsapp",
12
8
  "whatsapp-api",
13
9
  "whatsapp-web",
14
10
  "whatsapp-bot",
15
11
  "automation",
16
- "multi-device"
12
+ "multi-device",
13
+ "elrayyxml",
14
+ "nexray"
17
15
  ],
18
16
  "homepage": "https://www.npmjs.com/package/@elrayyxml/baileys",
17
+ "repository": {
18
+ "url": "https://www.npmjs.com/package/@elrayyxml/baileys"
19
+ },
19
20
  "license": "MIT",
20
21
  "author": "ElrayyXml",
22
+ "type": "commonjs",
21
23
  "main": "lib/index.js",
22
24
  "types": "lib/index.d.ts",
25
+ "directories": {
26
+ "lib": "lib"
27
+ },
23
28
  "files": [
24
29
  "lib/*",
25
30
  "WAProto/*",
@@ -46,14 +51,15 @@
46
51
  "@adiwajshing/keyed-db": "^0.2.4",
47
52
  "@cacheable/node-cache": "^1.4.0",
48
53
  "@hapi/boom": "^9.1.3",
54
+ "api-nexray": "latest",
49
55
  "async-mutex": "^0.5.0",
50
56
  "audio-decode": "^2.2.2",
51
57
  "axios": "^1.6.0",
52
58
  "cache-manager": "^5.7.6",
53
59
  "cheerio": "^1.0.0-rc.10",
60
+ "fflate": "^0.8.2",
54
61
  "jimp": "^0.16.1",
55
62
  "libphonenumber-js": "^1.10.20",
56
- "link-preview-js": "^3.0.0",
57
63
  "libsignal": "github:ElrayyXml/signal-node",
58
64
  "lodash": "^4.17.21",
59
65
  "music-metadata": "^7.12.3",
@@ -106,14 +112,11 @@
106
112
  "optional": true
107
113
  }
108
114
  },
109
- "packageManager": "yarn@1.22.19",
110
- "publishConfig": {
111
- "access": "public"
112
- },
113
115
  "engines": {
114
116
  "node": ">=20.0.0"
115
117
  },
116
- "directories": {
117
- "lib": "lib"
118
- }
118
+ "publishConfig": {
119
+ "access": "public"
120
+ },
121
+ "packageManager": "yarn@1.22.19"
119
122
  }
package/README.MD DELETED
@@ -1,78 +0,0 @@
1
- [![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/colored.png)](#table-of-contents)
2
-
3
- <div align="center">
4
-
5
- ### @elrayyxml/baileys
6
-
7
- </div>
8
-
9
- [![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/colored.png)](#table-of-contents)
10
-
11
- <div align="center">
12
-
13
- <p><em>Baileys Modified</em></p>
14
-
15
- <img src="https://files.catbox.moe/7m4cuw.jpg" width="300" alt="Cover Banner" />
16
-
17
- </div>
18
-
19
- ---
20
-
21
- - [x] Support Hosting (cPanel, Plesk, DirectAdmin, cyberPanel)
22
- - [x] No Need For FFMPEG
23
- - [x] Libsignal Updated
24
- - [x] No Spam Console
25
- - [x] Support send channel
26
- - [x] Fix LID and Native LID
27
- - [x] Support button
28
- - [x] Fix Pairing
29
- - [x] AI Private
30
- - [x] Support Group SW and Album
31
-
32
-
33
- <div align="center">
34
-
35
- [![npm version](https://img.shields.io/npm/v/@elrayyxml/baileys.svg)](https://www.npmjs.com/package/@elrayyxml/baileys)
36
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
37
- [![WhatsApp](https://img.shields.io/badge/WhatsApp-API-green.svg?logo=whatsapp)](https://whatsapp.com)
38
- [![Node.js](https://img.shields.io/badge/Node.js-20%2B-green.svg)](https://nodejs.org)
39
- [![npm downloads](https://img.shields.io/npm/dt/@elrayyxml/baileys.svg?color=blueviolet&label=Downloads&logo=npm)](https://www.npmjs.com/package/@elrayyxml/baileys)
40
- [![REST API](https://img.shields.io/badge/REST_API-green.svg)](https://api.elrayyxml.web.id)
41
-
42
- </div>
43
-
44
- ### Installation
45
-
46
- ```bash
47
- npm install @elrayyxml/baileys
48
- # or
49
- yarn add @elrayyxml/baileys
50
- ```
51
-
52
- ### `package.json` Fork Baileys
53
-
54
- ```json
55
- "dependencies": {
56
- "baileys": "npm:@elrayyxml/baileys"
57
- }
58
- ```
59
-
60
- ### Contact
61
-
62
- <div align="center">
63
-
64
- [![Instagram](https://img.shields.io/badge/Instagram-E4405F?style=for-the-badge&logo=instagram&logoColor=white)](https://instagram.com/elrayyxml)
65
- [![TikTok](https://img.shields.io/badge/TikTok-000000?style=for-the-badge&logo=tiktok&logoColor=white)](https://tik-tok.com/@elrayyxml)
66
- [![Email](https://img.shields.io/badge/Email-elrayy68@gmail.com-D14836?style=for-the-badge&logo=gmail&logoColor=white)](mailto:elrayy68@gmail.com)
67
- [![WhatsApp](https://img.shields.io/badge/WhatsApp-6289526377530-25D366?style=for-the-badge&logo=whatsapp&logoColor=white)](https://wa.me/6289526377530)
68
-
69
- </div>
70
-
71
- ### Official Channel
72
-
73
- <div align="center">
74
- <a href="https://whatsapp.com/channel/0029Vb69z8n1dAvztHQTDu3r">
75
- <img src="https://img.shields.io/badge/Join-WhatsApp%20Channel-25D366?logo=whatsapp&logoColor=white" alt="WhatsApp Channel" />
76
- </a>
77
-
78
- </div>