@jkt48connect-corp/baileys 7.3.2 → 7.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +459 -143
  2. package/WAProto/WAProto.proto +227 -2
  3. package/lib/Defaults/baileys-version.json +1 -1
  4. package/lib/Defaults/index.d.ts +9 -7
  5. package/lib/Defaults/index.js +6 -4
  6. package/lib/Socket/Client/index.d.ts +2 -3
  7. package/lib/Socket/Client/index.js +2 -3
  8. package/lib/Socket/Client/types.d.ts +17 -0
  9. package/lib/Socket/Client/types.js +13 -0
  10. package/lib/Socket/Client/{web-socket-client.d.ts → websocket.d.ts} +1 -1
  11. package/lib/Socket/Client/{web-socket-client.js → websocket.js} +2 -2
  12. package/lib/Socket/business.d.ts +8 -3
  13. package/lib/Socket/chats.d.ts +21 -19
  14. package/lib/Socket/chats.js +51 -48
  15. package/lib/Socket/groups.d.ts +28 -26
  16. package/lib/Socket/groups.js +2 -1
  17. package/lib/Socket/index.d.ts +6 -3
  18. package/lib/Socket/messages-recv.d.ts +8 -3
  19. package/lib/Socket/messages-recv.js +308 -149
  20. package/lib/Socket/messages-send.d.ts +23 -26
  21. package/lib/Socket/messages-send.js +193 -166
  22. package/lib/Socket/newsletter.d.ts +2 -2
  23. package/lib/Socket/newsletter.js +3 -3
  24. package/lib/Socket/registration.d.ts +8 -3
  25. package/lib/Socket/socket.d.ts +8 -6
  26. package/lib/Socket/socket.js +19 -14
  27. package/lib/Socket/usync.d.ts +37 -0
  28. package/lib/Socket/usync.js +70 -0
  29. package/lib/Store/make-cache-manager-store.d.ts +2 -2
  30. package/lib/Store/make-ordered-dictionary.d.ts +1 -1
  31. package/lib/Types/Call.d.ts +1 -1
  32. package/lib/Types/Chat.d.ts +12 -7
  33. package/lib/Types/Events.d.ts +17 -2
  34. package/lib/Types/GroupMetadata.d.ts +3 -1
  35. package/lib/Types/Label.d.ts +11 -0
  36. package/lib/Types/Message.d.ts +324 -328
  37. package/lib/Types/Socket.d.ts +7 -0
  38. package/lib/Types/USync.d.ts +25 -0
  39. package/lib/Types/USync.js +2 -0
  40. package/lib/Types/index.d.ts +9 -0
  41. package/lib/Utils/chat-utils.d.ts +4 -4
  42. package/lib/Utils/chat-utils.js +41 -20
  43. package/lib/Utils/crypto.d.ts +1 -1
  44. package/lib/Utils/crypto.js +4 -2
  45. package/lib/Utils/decode-wa-message.d.ts +17 -0
  46. package/lib/Utils/decode-wa-message.js +42 -14
  47. package/lib/Utils/generics.d.ts +4 -10
  48. package/lib/Utils/generics.js +30 -14
  49. package/lib/Utils/history.d.ts +6 -2
  50. package/lib/Utils/history.js +3 -0
  51. package/lib/Utils/messages.d.ts +0 -1
  52. package/lib/Utils/messages.js +247 -39
  53. package/lib/Utils/signal.d.ts +2 -1
  54. package/lib/Utils/signal.js +11 -19
  55. package/lib/Utils/use-multi-file-auth-state.js +11 -3
  56. package/lib/Utils/validate-connection.d.ts +2 -2
  57. package/lib/Utils/validate-connection.js +1 -1
  58. package/lib/WABinary/encode.d.ts +1 -1
  59. package/lib/WABinary/encode.js +16 -10
  60. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
  61. package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
  62. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  63. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
  64. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  65. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
  66. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  67. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
  68. package/lib/WAUSync/Protocols/index.d.ts +4 -0
  69. package/lib/WAUSync/Protocols/index.js +20 -0
  70. package/lib/WAUSync/USyncQuery.d.ts +26 -0
  71. package/lib/WAUSync/USyncQuery.js +79 -0
  72. package/lib/WAUSync/USyncUser.d.ts +10 -0
  73. package/lib/WAUSync/USyncUser.js +22 -0
  74. package/lib/WAUSync/index.d.ts +3 -0
  75. package/lib/WAUSync/index.js +19 -0
  76. package/lib/index.d.ts +1 -0
  77. package/lib/index.js +1 -0
  78. package/package.json +23 -18
  79. package/LICENSE +0 -21
  80. package/lib/index.ts +0 -13
@@ -1,7 +1,7 @@
1
1
  syntax = "proto3";
2
- package proto;
2
+ package waproto;
3
3
 
4
- /// WhatsApp Version: 2.3000.1020086232
4
+ /// WhatsApp Version: 2.3000.1020903593
5
5
 
6
6
  message ADVDeviceIdentity {
7
7
  optional uint32 rawId = 1;
@@ -45,6 +45,11 @@ message ADVSignedKeyIndexList {
45
45
  message AIRichResponseMessage {
46
46
  optional AIRichResponseMessageType messageType = 1;
47
47
  repeated AIRichResponseSubMessage submessages = 2;
48
+ optional AIRichResponseAbstractData abstractData = 3;
49
+ message AIRichResponseAbstractData {
50
+ optional bytes data = 1;
51
+ }
52
+
48
53
  message AIRichResponseCodeMetadata {
49
54
  optional string codeLanguage = 1;
50
55
  repeated AIRichResponseCodeBlock codeBlocks = 2;
@@ -63,6 +68,28 @@ message AIRichResponseMessage {
63
68
  }
64
69
  }
65
70
 
71
+ message AIRichResponseContentItemsMetadata {
72
+ repeated AIRichResponseContentItemMetadata itemsMetadata = 1;
73
+ optional ContentType contentType = 2;
74
+ message AIRichResponseContentItemMetadata {
75
+ oneof aIRichResponseContentItem {
76
+ AIRichResponseMessage.AIRichResponseContentItemsMetadata.AIRichResponseReelItem reelItem = 1;
77
+ }
78
+ }
79
+
80
+ message AIRichResponseReelItem {
81
+ optional string title = 1;
82
+ optional string profileIconUrl = 2;
83
+ optional string thumbnailUrl = 3;
84
+ optional string videoUrl = 4;
85
+ }
86
+
87
+ enum ContentType {
88
+ DEFAULT = 0;
89
+ CAROUSEL = 1;
90
+ }
91
+ }
92
+
66
93
  message AIRichResponseDynamicMetadata {
67
94
  optional AIRichResponseDynamicMetadataType type = 1;
68
95
  optional uint64 version = 2;
@@ -98,6 +125,36 @@ message AIRichResponseMessage {
98
125
  }
99
126
  }
100
127
 
128
+ message AIRichResponseLatexMetadata {
129
+ optional string text = 1;
130
+ repeated AIRichResponseLatexExpression expressions = 2;
131
+ message AIRichResponseLatexExpression {
132
+ optional string latexExpression = 1;
133
+ optional string url = 2;
134
+ optional double width = 3;
135
+ optional double height = 4;
136
+ optional double fontHeight = 5;
137
+ }
138
+
139
+ }
140
+
141
+ message AIRichResponseMapMetadata {
142
+ optional double centerLatitude = 1;
143
+ optional double centerLongitude = 2;
144
+ optional double latitudeDelta = 3;
145
+ optional double longitudeDelta = 4;
146
+ repeated AIRichResponseMapAnnotation annotations = 5;
147
+ optional bool showInfoList = 6;
148
+ message AIRichResponseMapAnnotation {
149
+ optional uint32 annotationNumber = 1;
150
+ optional double latitude = 2;
151
+ optional double longitude = 3;
152
+ optional string title = 4;
153
+ optional string body = 5;
154
+ }
155
+
156
+ }
157
+
101
158
  enum AIRichResponseMessageType {
102
159
  AI_RICH_RESPONSE_TYPE_UNKNOWN = 0;
103
160
  AI_RICH_RESPONSE_TYPE_STANDARD = 1;
@@ -110,6 +167,9 @@ message AIRichResponseMessage {
110
167
  optional AIRichResponseMessage.AIRichResponseCodeMetadata codeMetadata = 5;
111
168
  optional AIRichResponseMessage.AIRichResponseTableMetadata tableMetadata = 6;
112
169
  optional AIRichResponseMessage.AIRichResponseDynamicMetadata dynamicMetadata = 7;
170
+ optional AIRichResponseMessage.AIRichResponseLatexMetadata latexMetadata = 8;
171
+ optional AIRichResponseMessage.AIRichResponseMapMetadata mapMetadata = 9;
172
+ optional AIRichResponseMessage.AIRichResponseContentItemsMetadata contentItemsMetadata = 10;
113
173
  }
114
174
 
115
175
  enum AIRichResponseSubMessageType {
@@ -120,6 +180,9 @@ message AIRichResponseMessage {
120
180
  AI_RICH_RESPONSE_TABLE = 4;
121
181
  AI_RICH_RESPONSE_CODE = 5;
122
182
  AI_RICH_RESPONSE_DYNAMIC = 6;
183
+ AI_RICH_RESPONSE_MAP = 7;
184
+ AI_RICH_RESPONSE_LATEX = 8;
185
+ AI_RICH_RESPONSE_CONTENT_ITEMS = 9;
123
186
  }
124
187
  message AIRichResponseTableMetadata {
125
188
  repeated AIRichResponseTableRow rows = 1;
@@ -132,6 +195,13 @@ message AIRichResponseMessage {
132
195
 
133
196
  }
134
197
 
198
+ message Account {
199
+ optional string lid = 1;
200
+ optional string username = 2;
201
+ optional string countryCode = 3;
202
+ optional bool isUsernameDeleted = 4;
203
+ }
204
+
135
205
  message ActionLink {
136
206
  optional string url = 1;
137
207
  optional string buttonTitle = 2;
@@ -204,6 +274,7 @@ message BotAvatarMetadata {
204
274
  message BotCapabilityMetadata {
205
275
  repeated BotCapabilityType capabilities = 1;
206
276
  enum BotCapabilityType {
277
+ UNKNOWN = 0;
207
278
  PROGRESS_INDICATOR = 1;
208
279
  RICH_RESPONSE_HEADING = 2;
209
280
  RICH_RESPONSE_NESTED_LIST = 3;
@@ -227,6 +298,12 @@ message BotCapabilityMetadata {
227
298
  RICH_RESPONSE_SUB_HEADING = 21;
228
299
  RICH_RESPONSE_GRID_IMAGE = 22;
229
300
  AI_STUDIO_UGC_MEMORY = 23;
301
+ RICH_RESPONSE_LATEX = 24;
302
+ RICH_RESPONSE_MAPS = 25;
303
+ RICH_RESPONSE_INLINE_REELS = 26;
304
+ AGENTIC_PLANNING = 27;
305
+ ACCOUNT_LINKING = 28;
306
+ STREAMING_DISAGGREGATION = 29;
230
307
  }
231
308
  }
232
309
 
@@ -302,6 +379,7 @@ message BotMetadata {
302
379
  optional BotRenderingMetadata renderingMetadata = 16;
303
380
  optional BotMetricsMetadata botMetricsMetadata = 17;
304
381
  optional BotLinkedAccountsMetadata botLinkedAccountsMetadata = 18;
382
+ optional BotSourcesMetadata richResponseSourcesMetadata = 19;
305
383
  }
306
384
 
307
385
  enum BotMetricsEntryPoint {
@@ -322,12 +400,23 @@ enum BotMetricsEntryPoint {
322
400
  FORWARD = 15;
323
401
  APP_SHORTCUT = 16;
324
402
  FF_FAMILY = 17;
403
+ AI_TAB = 18;
404
+ AI_HOME = 19;
405
+ AI_DEEPLINK_IMMERSIVE = 20;
406
+ AI_DEEPLINK = 21;
325
407
  }
326
408
  message BotMetricsMetadata {
327
409
  optional string destinationId = 1;
328
410
  optional BotMetricsEntryPoint destinationEntryPoint = 2;
411
+ optional BotMetricsThreadEntryPoint threadOrigin = 3;
329
412
  }
330
413
 
414
+ enum BotMetricsThreadEntryPoint {
415
+ AI_TAB_THREAD = 1;
416
+ AI_HOME_THREAD = 2;
417
+ AI_DEEPLINK_IMMERSIVE_THREAD = 3;
418
+ AI_DEEPLINK_THREAD = 4;
419
+ }
331
420
  message BotModelMetadata {
332
421
  optional ModelType modelType = 1;
333
422
  optional PremiumModelStatus premiumModelStatus = 2;
@@ -371,6 +460,54 @@ message BotPluginMetadata {
371
460
 
372
461
  message BotProgressIndicatorMetadata {
373
462
  optional string progressDescription = 1;
463
+ repeated BotPlanningStepMetadata stepsMetadata = 2;
464
+ message BotPlanningStepMetadata {
465
+ optional string statusTitle = 1;
466
+ optional string statusBody = 2;
467
+ repeated BotPlanningSearchSourcesMetadata sourcesMetadata = 3;
468
+ optional PlanningStepStatus status = 4;
469
+ optional bool isReasoning = 5;
470
+ optional bool isEnhancedSearch = 6;
471
+ repeated BotPlanningStepSectionMetadata sections = 7;
472
+ message BotPlanningSearchSourceMetadata {
473
+ optional string title = 1;
474
+ optional BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider provider = 2;
475
+ optional string sourceUrl = 3;
476
+ optional string favIconUrl = 4;
477
+ }
478
+
479
+ message BotPlanningSearchSourcesMetadata {
480
+ optional string sourceTitle = 1;
481
+ optional BotPlanningSearchSourceProvider provider = 2;
482
+ optional string sourceUrl = 3;
483
+ enum BotPlanningSearchSourceProvider {
484
+ UNKNOWN = 0;
485
+ OTHER = 1;
486
+ GOOGLE = 2;
487
+ BING = 3;
488
+ }
489
+ }
490
+
491
+ message BotPlanningStepSectionMetadata {
492
+ optional string sectionTitle = 1;
493
+ optional string sectionBody = 2;
494
+ repeated BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata sourcesMetadata = 3;
495
+ }
496
+
497
+ enum BotSearchSourceProvider {
498
+ UNKNOWN_PROVIDER = 0;
499
+ OTHER = 1;
500
+ GOOGLE = 2;
501
+ BING = 3;
502
+ }
503
+ enum PlanningStepStatus {
504
+ UNKNOWN = 0;
505
+ PLANNED = 1;
506
+ EXECUTING = 2;
507
+ FINISHED = 3;
508
+ }
509
+ }
510
+
374
511
  }
375
512
 
376
513
  message BotPromptSuggestion {
@@ -426,6 +563,25 @@ enum BotSessionSource {
426
563
  EMU_FLASH_FOLLOWUP = 5;
427
564
  VOICE = 6;
428
565
  }
566
+ message BotSourcesMetadata {
567
+ repeated BotSourceItem sources = 1;
568
+ message BotSourceItem {
569
+ optional SourceProvider provider = 1;
570
+ optional string thumbnailCdnUrl = 2;
571
+ optional string sourceProviderUrl = 3;
572
+ optional string sourceQuery = 4;
573
+ optional string faviconCdnUrl = 5;
574
+ optional uint32 citationNumber = 6;
575
+ enum SourceProvider {
576
+ UNKNOWN = 0;
577
+ BING = 1;
578
+ GOOGLE = 2;
579
+ SUPPORT = 3;
580
+ }
581
+ }
582
+
583
+ }
584
+
429
585
  message BotSuggestedPromptMetadata {
430
586
  repeated string suggestedPrompts = 1;
431
587
  optional uint32 selectedPromptIndex = 2;
@@ -583,6 +739,7 @@ message ClientPayload {
583
739
  optional int32 memClass = 37;
584
740
  optional InteropData interopData = 38;
585
741
  optional TrafficAnonymization trafficAnonymization = 40;
742
+ optional bool lidDbMigrated = 41;
586
743
  enum ConnectReason {
587
744
  PUSH = 0;
588
745
  USER_ACTIVATED = 1;
@@ -826,6 +983,8 @@ message ContextInfo {
826
983
  optional ForwardedAIBotMessageInfo forwardedAiBotMessageInfo = 56;
827
984
  optional StatusAttributionType statusAttributionType = 57;
828
985
  optional UrlTrackingMap urlTrackingMap = 58;
986
+ optional PairedMediaType pairedMediaType = 59;
987
+ optional uint32 rankingVersion = 60;
829
988
  message AdReplyInfo {
830
989
  optional string advertiserName = 1;
831
990
  optional MediaType mediaType = 2;
@@ -879,6 +1038,7 @@ message ContextInfo {
879
1038
  optional string ctaPayload = 20;
880
1039
  optional bool disableNudge = 21;
881
1040
  optional string originalImageUrl = 22;
1041
+ optional bool wtwaAdFormat = 23;
882
1042
  enum MediaType {
883
1043
  NONE = 0;
884
1044
  IMAGE = 1;
@@ -912,6 +1072,13 @@ message ContextInfo {
912
1072
  }
913
1073
  }
914
1074
 
1075
+ enum PairedMediaType {
1076
+ NOT_PAIRED_MEDIA = 0;
1077
+ SD_VIDEO_PARENT = 1;
1078
+ HD_VIDEO_CHILD = 2;
1079
+ SD_IMAGE_PARENT = 3;
1080
+ HD_IMAGE_CHILD = 4;
1081
+ }
915
1082
  enum StatusAttributionType {
916
1083
  NONE = 0;
917
1084
  RESHARED_FROM_MENTION = 1;
@@ -974,6 +1141,8 @@ message Conversation {
974
1141
  optional PrivacySystemMessage systemMessageToInsert = 47;
975
1142
  optional bool capiCreatedGroup = 48;
976
1143
  optional string accountLid = 49;
1144
+ optional bool limitSharing = 50;
1145
+ optional int64 limitSharingSettingTimestamp = 51;
977
1146
  enum EndOfHistoryTransferType {
978
1147
  COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY = 0;
979
1148
  COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY = 1;
@@ -983,11 +1152,16 @@ message Conversation {
983
1152
 
984
1153
  message DeviceCapabilities {
985
1154
  optional ChatLockSupportLevel chatLockSupportLevel = 1;
1155
+ optional LIDMigration lidMigration = 2;
986
1156
  enum ChatLockSupportLevel {
987
1157
  NONE = 0;
988
1158
  MINIMAL = 1;
989
1159
  FULL = 2;
990
1160
  }
1161
+ message LIDMigration {
1162
+ optional uint64 chatDbMigrationTimestamp = 1;
1163
+ }
1164
+
991
1165
  }
992
1166
 
993
1167
  message DeviceConsistencyCodeMessage {
@@ -1233,6 +1407,7 @@ message HistorySync {
1233
1407
  repeated PhoneNumberToLIDMapping phoneNumberToLidMappings = 15;
1234
1408
  optional string companionMetaNonce = 16;
1235
1409
  optional bytes shareableChatIdentifierEncryptionKey = 17;
1410
+ repeated Account accounts = 18;
1236
1411
  enum BotAIWaitListState {
1237
1412
  IN_WAITLIST = 0;
1238
1413
  AI_AVAILABLE = 1;
@@ -1293,12 +1468,18 @@ message InteractiveAnnotation {
1293
1468
  repeated Point polygonVertices = 1;
1294
1469
  optional bool shouldSkipConfirmation = 4;
1295
1470
  optional EmbeddedContent embeddedContent = 5;
1471
+ optional StatusLinkType statusLinkType = 8;
1296
1472
  oneof action {
1297
1473
  Location location = 2;
1298
1474
  ContextInfo.ForwardedNewsletterMessageInfo newsletter = 3;
1299
1475
  bool embeddedAction = 6;
1300
1476
  TapLinkAction tapAction = 7;
1301
1477
  }
1478
+ enum StatusLinkType {
1479
+ RASTERIZED_LINK_PREVIEW = 1;
1480
+ RASTERIZED_LINK_TRUNCATED = 2;
1481
+ RASTERIZED_LINK_FULL_URL = 3;
1482
+ }
1302
1483
  }
1303
1484
 
1304
1485
  message KeepInChat {
@@ -1346,6 +1527,15 @@ message LegacyMessage {
1346
1527
  optional Message.PollVoteMessage pollVote = 2;
1347
1528
  }
1348
1529
 
1530
+ message LimitSharing {
1531
+ optional bool sharingLimited = 1;
1532
+ optional Trigger trigger = 2;
1533
+ enum Trigger {
1534
+ CHAT_SETTING = 0;
1535
+ BIZ_SUPPORTS_FB_HOSTING = 1;
1536
+ }
1537
+ }
1538
+
1349
1539
  message LocalizedName {
1350
1540
  optional string lg = 1;
1351
1541
  optional string lc = 2;
@@ -1469,6 +1659,7 @@ message Message {
1469
1659
  optional FutureProofMessage groupStatusMessage = 96;
1470
1660
  optional AIRichResponseMessage richResponseMessage = 97;
1471
1661
  optional StatusNotificationMessage statusNotificationMessage = 98;
1662
+ optional FutureProofMessage limitSharingMessage = 99;
1472
1663
  message AlbumMessage {
1473
1664
  optional uint32 expectedImageCount = 2;
1474
1665
  optional uint32 expectedVideoCount = 3;
@@ -1817,6 +2008,7 @@ message Message {
1817
2008
  optional uint32 videoHeight = 31;
1818
2009
  optional uint32 videoWidth = 32;
1819
2010
  optional Message.MMSThumbnailMetadata faviconMMSMetadata = 33;
2011
+ optional LinkPreviewMetadata linkPreviewMetadata = 34;
1820
2012
  enum FontType {
1821
2013
  SYSTEM = 0;
1822
2014
  SYSTEM_TEXT = 1;
@@ -1833,6 +2025,10 @@ message Message {
1833
2025
  SUB = 2;
1834
2026
  DEFAULT_SUB = 3;
1835
2027
  }
2028
+ message LinkPreviewMetadata {
2029
+ optional Message.PaymentLinkMetadata paymentLinkMetadata = 1;
2030
+ }
2031
+
1836
2032
  enum PreviewType {
1837
2033
  NONE = 0;
1838
2034
  VIDEO = 1;
@@ -1986,6 +2182,7 @@ message Message {
1986
2182
  USER_IMAGE = 0;
1987
2183
  AI_GENERATED = 1;
1988
2184
  AI_MODIFIED = 2;
2185
+ RASTERIZED_TEXT_STATUS = 3;
1989
2186
  }
1990
2187
  }
1991
2188
 
@@ -2266,6 +2463,23 @@ message Message {
2266
2463
  }
2267
2464
  }
2268
2465
 
2466
+ message PaymentLinkMetadata {
2467
+ optional PaymentLinkButton button = 1;
2468
+ optional PaymentLinkHeader header = 2;
2469
+ message PaymentLinkButton {
2470
+ required string displayText = 1;
2471
+ }
2472
+
2473
+ message PaymentLinkHeader {
2474
+ required PaymentLinkHeaderType headerType = 1;
2475
+ enum PaymentLinkHeaderType {
2476
+ LINK_PREVIEW = 0;
2477
+ ORDER = 1;
2478
+ }
2479
+ }
2480
+
2481
+ }
2482
+
2269
2483
  message PeerDataOperationRequestMessage {
2270
2484
  optional Message.PeerDataOperationRequestType peerDataOperationRequestType = 1;
2271
2485
  repeated RequestStickerReupload requestStickerReupload = 2;
@@ -2499,6 +2713,7 @@ message Message {
2499
2713
  optional MediaNotifyMessage mediaNotifyMessage = 21;
2500
2714
  optional Message.CloudAPIThreadControlNotification cloudApiThreadControlNotification = 22;
2501
2715
  optional LIDMigrationMappingSyncMessage lidMigrationMappingSyncMessage = 23;
2716
+ optional LimitSharing limitSharing = 24;
2502
2717
  enum Type {
2503
2718
  REVOKE = 0;
2504
2719
  EPHEMERAL_SETTING = 3;
@@ -2521,6 +2736,8 @@ message Message {
2521
2736
  REMINDER_MESSAGE = 23;
2522
2737
  BOT_MEMU_ONBOARDING_MESSAGE = 24;
2523
2738
  STATUS_MENTION_MESSAGE = 25;
2739
+ STOP_GENERATION_MESSAGE = 26;
2740
+ LIMIT_SHARING = 27;
2524
2741
  }
2525
2742
  }
2526
2743
 
@@ -2795,6 +3012,11 @@ message MessageAssociation {
2795
3012
  MEDIA_POLL = 7;
2796
3013
  STATUS_ADD_YOURS = 8;
2797
3014
  STATUS_NOTIFICATION = 9;
3015
+ HD_IMAGE_DUAL_UPLOAD = 10;
3016
+ STICKER_ANNOTATION = 11;
3017
+ MOTION_PHOTO = 12;
3018
+ STATUS_LINK_ACTION = 13;
3019
+ VIEW_ALL_REPLIES = 14;
2798
3020
  }
2799
3021
  }
2800
3022
 
@@ -4214,6 +4436,9 @@ message WebMessageInfo {
4214
4436
  STATUS_MENTION = 210;
4215
4437
  USER_CONTROLS_SYSTEM_MESSAGE = 211;
4216
4438
  SUPPORT_SYSTEM_MESSAGE = 212;
4439
+ CHANGE_LID = 213;
4440
+ BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_IN_MESSAGE = 214;
4441
+ BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_OUT_MESSAGE = 215;
4217
4442
  }
4218
4443
  }
4219
4444
 
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": [2, 2413, 1]
2
+ "version": [2, 3000, 1019097045]
3
3
  }
@@ -1,3 +1,5 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
1
3
  import { proto } from '../../WAProto';
2
4
  import type { MediaType, SocketConfig } from '../Types';
3
5
  export declare const UNAUTHORIZED_CODES: number[];
@@ -231,16 +233,16 @@ export declare const DEF_CALLBACK_PREFIX = "CB:";
231
233
  export declare const DEF_TAG_PREFIX = "TAG:";
232
234
  export declare const PHONE_CONNECTION_CB = "CB:Pong";
233
235
  export declare const WA_DEFAULT_EPHEMERAL: number;
234
- export declare const MOBILE_TOKEN: any;
236
+ export declare const MOBILE_TOKEN: Buffer;
235
237
  export declare const MOBILE_REGISTRATION_ENDPOINT = "https://v.whatsapp.net/v2";
236
- export declare const MOBILE_USERAGENT = "WhatsApp/2.24.6.77 iOS/15.3.1 Device/Apple-iPhone_7";
237
- export declare const REGISTRATION_PUBLIC_KEY: any;
238
+ export declare const MOBILE_USERAGENT: string;
239
+ export declare const REGISTRATION_PUBLIC_KEY: Buffer;
238
240
  export declare const NOISE_MODE = "Noise_XX_25519_AESGCM_SHA256\0\0\0\0";
239
241
  export declare const DICT_VERSION = 2;
240
- export declare const KEY_BUNDLE_TYPE: any;
241
- export declare const NOISE_WA_HEADER: any;
242
+ export declare const KEY_BUNDLE_TYPE: Buffer;
243
+ export declare const NOISE_WA_HEADER: Buffer;
242
244
  export declare const PROTOCOL_VERSION: number[];
243
- export declare const MOBILE_NOISE_HEADER: any;
245
+ export declare const MOBILE_NOISE_HEADER: Buffer;
244
246
  /** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
245
247
  export declare const URL_REGEX: RegExp;
246
248
  export declare const WA_CERT_DETAILS: {
@@ -271,7 +273,7 @@ export declare const MEDIA_HKDF_KEY_MAPPING: {
271
273
  'payment-bg-image': string;
272
274
  ptv: string;
273
275
  };
274
- export declare const MEDIA_KEYS: MediaType[];
276
+ export declare const MEDIA_KEYS: ("ppic" | "product" | "image" | "video" | "sticker" | "audio" | "gif" | "ptt" | "thumbnail-document" | "thumbnail-image" | "thumbnail-link" | "thumbnail-video" | "md-app-state" | "md-msg-hist" | "document" | "product-catalog-image" | "payment-bg-image" | "ptv")[];
275
277
  export declare const MIN_PREKEY_COUNT = 5;
276
278
  export declare const INITIAL_PREKEY_COUNT = 30;
277
279
  export declare const DEFAULT_CACHE_TTLS: {
@@ -44,7 +44,8 @@ exports.PROCESSABLE_HISTORY_TYPES = [
44
44
  WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.INITIAL_BOOTSTRAP,
45
45
  WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.PUSH_NAME,
46
46
  WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.RECENT,
47
- WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.FULL
47
+ WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.FULL,
48
+ WAProto_1.proto.Message.HistorySyncNotification.HistorySyncType.ON_DEMAND,
48
49
  ];
49
50
  exports.DEFAULT_CONNECTION_CONFIG = {
50
51
  version: baileys_version_json_1.version,
@@ -75,6 +76,7 @@ exports.DEFAULT_CONNECTION_CONFIG = {
75
76
  snapshot: false,
76
77
  },
77
78
  getMessage: async () => undefined,
79
+ cachedGroupMetadata: async () => undefined,
78
80
  makeSignalRepository: libsignal_1.makeLibSignalRepository
79
81
  };
80
82
  exports.MEDIA_PATH_MAP = {
@@ -112,8 +114,8 @@ exports.MEDIA_KEYS = Object.keys(exports.MEDIA_PATH_MAP);
112
114
  exports.MIN_PREKEY_COUNT = 5;
113
115
  exports.INITIAL_PREKEY_COUNT = 30;
114
116
  exports.DEFAULT_CACHE_TTLS = {
115
- SIGNAL_STORE: 5 * 60, // 5 minutes
116
- MSG_RETRY: 60 * 60, // 1 hour
117
- CALL_OFFER: 5 * 60, // 5 minutes
117
+ SIGNAL_STORE: 5 * 60,
118
+ MSG_RETRY: 60 * 60,
119
+ CALL_OFFER: 5 * 60,
118
120
  USER_DEVICES: 5 * 60, // 5 minutes
119
121
  };
@@ -1,3 +1,2 @@
1
- export * from './abstract-socket-client';
2
- export * from './mobile-socket-client';
3
- export * from './web-socket-client';
1
+ export * from './types';
2
+ export * from './websocket';
@@ -14,6 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./abstract-socket-client"), exports);
18
- __exportStar(require("./mobile-socket-client"), exports);
19
- __exportStar(require("./web-socket-client"), exports);
17
+ __exportStar(require("./types"), exports);
18
+ __exportStar(require("./websocket"), exports);
@@ -0,0 +1,17 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { EventEmitter } from 'events';
4
+ import { URL } from 'url';
5
+ import { SocketConfig } from '../../Types';
6
+ export declare abstract class AbstractSocketClient extends EventEmitter {
7
+ url: URL;
8
+ config: SocketConfig;
9
+ abstract get isOpen(): boolean;
10
+ abstract get isClosed(): boolean;
11
+ abstract get isClosing(): boolean;
12
+ abstract get isConnecting(): boolean;
13
+ constructor(url: URL, config: SocketConfig);
14
+ abstract connect(): Promise<void>;
15
+ abstract close(): Promise<void>;
16
+ abstract send(str: Uint8Array | string, cb?: (err?: Error) => void): boolean;
17
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AbstractSocketClient = void 0;
4
+ const events_1 = require("events");
5
+ class AbstractSocketClient extends events_1.EventEmitter {
6
+ constructor(url, config) {
7
+ super();
8
+ this.url = url;
9
+ this.config = config;
10
+ this.setMaxListeners(0);
11
+ }
12
+ }
13
+ exports.AbstractSocketClient = AbstractSocketClient;
@@ -1,5 +1,5 @@
1
1
  import WebSocket from 'ws';
2
- import { AbstractSocketClient } from './abstract-socket-client';
2
+ import { AbstractSocketClient } from './types';
3
3
  export declare class WebSocketClient extends AbstractSocketClient {
4
4
  protected socket: WebSocket | null;
5
5
  get isOpen(): boolean;
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.WebSocketClient = void 0;
7
7
  const ws_1 = __importDefault(require("ws"));
8
8
  const Defaults_1 = require("../../Defaults");
9
- const abstract_socket_client_1 = require("./abstract-socket-client");
10
- class WebSocketClient extends abstract_socket_client_1.AbstractSocketClient {
9
+ const types_1 = require("./types");
10
+ class WebSocketClient extends types_1.AbstractSocketClient {
11
11
  constructor() {
12
12
  super(...arguments);
13
13
  this.socket = null;
@@ -15,13 +15,15 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
15
15
  deleted: number;
16
16
  }>;
17
17
  productUpdate: (productId: string, update: ProductUpdate) => Promise<import("../Types").Product>;
18
- sendMessageAck: ({ tag, attrs, content }: BinaryNode) => Promise<void>;
18
+ sendMessageAck: ({ tag, attrs, content }: BinaryNode, errorCode?: number) => Promise<void>;
19
19
  sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
20
20
  offerCall: (toJid: string, isVideo?: boolean) => Promise<{
21
21
  id: any;
22
22
  to: string;
23
23
  }>;
24
24
  rejectCall: (callId: string, callFrom: string) => Promise<void>;
25
+ fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number) => Promise<string>;
26
+ requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
25
27
  getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
26
28
  assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
27
29
  relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
@@ -31,6 +33,7 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
31
33
  readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
32
34
  refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
33
35
  getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
36
+ sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
34
37
  createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
35
38
  nodes: BinaryNode[];
36
39
  shouldIncludeDeviceIdentity: boolean;
@@ -40,6 +43,8 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
40
43
  [_: string]: string;
41
44
  }>;
42
45
  updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
46
+ sendStatusMentions: (content: import("../Types").AnyMessageContent, jids?: string[]) => Promise<import("../Types").WAProto.WebMessageInfo>;
47
+ sendAlbumMessage: (jid: string, medias: import("../Types").Media[], options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
43
48
  sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
44
49
  subscribeNewsletterUpdates: (jid: string) => Promise<{
45
50
  duration: string;
@@ -54,7 +59,7 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
54
59
  newsletterUnmute: (jid: string) => Promise<void>;
55
60
  newsletterMute: (jid: string) => Promise<void>;
56
61
  newsletterAction: (jid: string, type: "follow" | "unfollow" | "mute" | "unmute") => Promise<void>;
57
- newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
62
+ newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
58
63
  newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
59
64
  newsletterAdminCount: (jid: string) => Promise<number>;
60
65
  newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
@@ -159,7 +164,7 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
159
164
  onUnexpectedError: (err: Error | Boom, msg: string) => void;
160
165
  uploadPreKeys: (count?: number) => Promise<void>;
161
166
  uploadPreKeysToServerIfRequired: () => Promise<void>;
162
- requestPairingCode: (phoneNumber: string) => Promise<string>;
167
+ requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
163
168
  waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
164
169
  sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
165
170
  };