@queenanya/baileys 7.4.14 → 7.5.3-0

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 (110) hide show
  1. package/README.md +26 -26
  2. package/lib/Defaults/baileys-version.json +1 -1
  3. package/lib/Defaults/index.d.ts +1 -231
  4. package/lib/Defaults/index.js +11 -23
  5. package/lib/Socket/Client/index.d.ts +2 -3
  6. package/lib/Socket/Client/index.js +2 -3
  7. package/lib/Socket/Client/{web-socket-client.d.ts → websocket.d.ts} +1 -1
  8. package/lib/Socket/Client/{web-socket-client.js → websocket.js} +2 -2
  9. package/lib/Socket/business.d.ts +31 -28
  10. package/lib/Socket/chats.d.ts +17 -9
  11. package/lib/Socket/chats.js +115 -116
  12. package/lib/Socket/{registration.d.ts → communities.d.ts} +94 -145
  13. package/lib/Socket/communities.js +354 -0
  14. package/lib/Socket/groups.d.ts +23 -10
  15. package/lib/Socket/groups.js +12 -1
  16. package/lib/Socket/index.d.ts +69 -38
  17. package/lib/Socket/index.js +2 -2
  18. package/lib/Socket/messages-recv.d.ts +30 -28
  19. package/lib/Socket/messages-recv.js +291 -180
  20. package/lib/Socket/messages-send.d.ts +25 -19
  21. package/lib/Socket/messages-send.js +110 -76
  22. package/lib/Socket/newsletter.d.ts +19 -13
  23. package/lib/Socket/newsletter.js +67 -54
  24. package/lib/Socket/socket.d.ts +3 -1
  25. package/lib/Socket/socket.js +15 -17
  26. package/lib/Socket/usync.d.ts +38 -0
  27. package/lib/Socket/usync.js +70 -0
  28. package/lib/Store/make-cache-manager-store.d.ts +2 -1
  29. package/lib/Store/make-in-memory-store.js +13 -11
  30. package/lib/Store/make-ordered-dictionary.js +2 -2
  31. package/lib/Types/Auth.d.ts +1 -6
  32. package/lib/Types/Call.d.ts +1 -1
  33. package/lib/Types/Chat.d.ts +15 -7
  34. package/lib/Types/Contact.d.ts +6 -1
  35. package/lib/Types/Events.d.ts +44 -2
  36. package/lib/Types/GroupMetadata.d.ts +3 -1
  37. package/lib/Types/Label.d.ts +11 -0
  38. package/lib/Types/Message.d.ts +37 -30
  39. package/lib/Types/Newsletter.d.ts +0 -13
  40. package/lib/Types/Newsletter.js +1 -15
  41. package/lib/Types/Socket.d.ts +10 -3
  42. package/lib/Types/USync.d.ts +25 -0
  43. package/lib/Types/USync.js +2 -0
  44. package/lib/Types/index.d.ts +8 -0
  45. package/lib/Utils/auth-utils.js +1 -7
  46. package/lib/Utils/chat-utils.d.ts +5 -4
  47. package/lib/Utils/chat-utils.js +52 -20
  48. package/lib/Utils/crypto.d.ts +2 -1
  49. package/lib/Utils/crypto.js +4 -2
  50. package/lib/Utils/decode-wa-message.d.ts +1 -0
  51. package/lib/Utils/decode-wa-message.js +34 -14
  52. package/lib/Utils/event-buffer.js +14 -8
  53. package/lib/Utils/generics.d.ts +37 -13
  54. package/lib/Utils/generics.js +103 -18
  55. package/lib/Utils/history.d.ts +6 -2
  56. package/lib/Utils/history.js +3 -0
  57. package/lib/Utils/index.d.ts +1 -0
  58. package/lib/Utils/index.js +1 -0
  59. package/lib/Utils/link-preview.js +24 -1
  60. package/lib/Utils/logger.d.ts +1 -3
  61. package/lib/Utils/make-mutex.js +1 -0
  62. package/lib/Utils/messages-media.d.ts +3 -2
  63. package/lib/Utils/messages-media.js +17 -32
  64. package/lib/Utils/messages.d.ts +1 -0
  65. package/lib/Utils/messages.js +67 -72
  66. package/lib/Utils/noise-handler.d.ts +3 -3
  67. package/lib/Utils/noise-handler.js +7 -12
  68. package/lib/Utils/process-message.d.ts +3 -2
  69. package/lib/Utils/process-message.js +55 -21
  70. package/lib/Utils/signal.js +23 -16
  71. package/lib/Utils/use-multi-file-auth-state.js +17 -3
  72. package/lib/Utils/validate-connection.d.ts +0 -1
  73. package/lib/Utils/validate-connection.js +10 -44
  74. package/lib/WABinary/constants.js +5 -5
  75. package/lib/WABinary/decode.d.ts +3 -2
  76. package/lib/WABinary/decode.js +6 -4
  77. package/lib/WABinary/encode.d.ts +1 -2
  78. package/lib/WABinary/encode.js +8 -6
  79. package/lib/WABinary/generic-utils.d.ts +1 -0
  80. package/lib/WABinary/jid-utils.d.ts +3 -3
  81. package/lib/WABinary/jid-utils.js +5 -5
  82. package/lib/WAM/BinaryInfo.d.ts +3 -2
  83. package/lib/WAM/constants.d.ts +3 -2
  84. package/lib/WAM/encode.d.ts +1 -0
  85. package/lib/WAM/encode.js +2 -2
  86. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
  87. package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
  88. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  89. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
  90. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  91. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
  92. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  93. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
  94. package/lib/WAUSync/Protocols/index.d.ts +4 -0
  95. package/lib/WAUSync/Protocols/index.js +20 -0
  96. package/lib/WAUSync/USyncQuery.d.ts +26 -0
  97. package/lib/WAUSync/USyncQuery.js +79 -0
  98. package/lib/WAUSync/USyncUser.d.ts +10 -0
  99. package/lib/WAUSync/USyncUser.js +22 -0
  100. package/lib/WAUSync/index.d.ts +3 -0
  101. package/lib/WAUSync/index.js +19 -0
  102. package/lib/index.d.ts +1 -0
  103. package/lib/index.js +1 -0
  104. package/package.json +36 -34
  105. package/lib/Defaults/phonenumber-mcc.json +0 -223
  106. package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
  107. package/lib/Socket/Client/mobile-socket-client.js +0 -65
  108. package/lib/Socket/registration.js +0 -166
  109. /package/lib/Socket/Client/{abstract-socket-client.d.ts → types.d.ts} +0 -0
  110. /package/lib/Socket/Client/{abstract-socket-client.js → types.js} +0 -0
@@ -1,10 +1,52 @@
1
+ /// <reference types="long" />
1
2
  /// <reference types="node" />
2
- import { AxiosRequestConfig } from 'axios';
3
- import { KeyPair, SignedKeyPair, SocketConfig } from '../Types';
4
- export declare const makeRegistrationSocket: (config: SocketConfig) => {
5
- register: (code: string) => Promise<ExistsResponse>;
6
- requestRegistrationCode: (registrationOptions?: RegistrationOptions) => Promise<ExistsResponse>;
7
- logger: import("pino").Logger<import("pino").LoggerOptions>;
3
+ /// <reference types="node" />
4
+ import { proto } from '../../WAProto';
5
+ import { GroupMetadata, ParticipantAction, SocketConfig, WAMessageKey } from '../Types';
6
+ import { BinaryNode } from '../WABinary';
7
+ export declare const makeCommunitiesSocket: (config: SocketConfig) => {
8
+ communityMetadata: (jid: string) => Promise<GroupMetadata>;
9
+ communityCreate: (subject: any, body: any) => Promise<GroupMetadata | null>;
10
+ communityLeave: (id: string) => Promise<void>;
11
+ communityUpdateSubject: (jid: string, subject: string) => Promise<void>;
12
+ communityRequestParticipantsList: (jid: string) => Promise<{
13
+ [key: string]: string;
14
+ }[]>;
15
+ communityRequestParticipantsUpdate: (jid: string, participants: string[], action: 'approve' | 'reject') => Promise<{
16
+ status: string;
17
+ jid: string;
18
+ }[]>;
19
+ communityParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<{
20
+ status: string;
21
+ jid: string;
22
+ content: BinaryNode;
23
+ }[]>;
24
+ communityUpdateDescription: (jid: string, description?: string) => Promise<void>;
25
+ communityInviteCode: (jid: string) => Promise<string | undefined>;
26
+ communityRevokeInvite: (jid: string) => Promise<string | undefined>;
27
+ communityAcceptInvite: (code: string) => Promise<string | undefined>;
28
+ /**
29
+ * revoke a v4 invite for someone
30
+ * @param communityJid community jid
31
+ * @param invitedJid jid of person you invited
32
+ * @returns true if successful
33
+ */
34
+ communityRevokeInviteV4: (communityJid: string, invitedJid: string) => Promise<boolean>;
35
+ /**
36
+ * accept a CommunityInviteMessage
37
+ * @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
38
+ * @param inviteMessage the message to accept
39
+ */
40
+ communityAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
41
+ communityGetInviteInfo: (code: string) => Promise<GroupMetadata>;
42
+ communityToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
43
+ communitySettingUpdate: (jid: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked') => Promise<void>;
44
+ communityMemberAddMode: (jid: string, mode: 'admin_add' | 'all_member_add') => Promise<void>;
45
+ communityJoinApprovalMode: (jid: string, mode: 'on' | 'off') => Promise<void>;
46
+ communityFetchAllParticipating: () => Promise<{
47
+ [_: string]: GroupMetadata;
48
+ }>;
49
+ logger: import("pino").Logger<never, boolean>;
8
50
  getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
9
51
  getCatalog: ({ jid, limit, cursor }: import("../Types").GetCatalogOptions) => Promise<{
10
52
  products: import("../Types").Product[];
@@ -18,36 +60,32 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
18
60
  deleted: number;
19
61
  }>;
20
62
  productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
21
- sendMessageAck: ({ tag, attrs, content }: import("../WABinary").BinaryNode) => Promise<void>;
22
- sendRetryRequest: (node: import("../WABinary").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
23
- offerCall: (toJid: string, isVideo?: boolean) => Promise<{
24
- id: string;
25
- to: string;
26
- }>;
63
+ sendMessageAck: ({ tag, attrs, content }: BinaryNode) => Promise<void>;
64
+ sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
27
65
  rejectCall: (callId: string, callFrom: string) => Promise<void>;
28
- getPrivacyTokens: (jids: string[]) => Promise<import("../WABinary").BinaryNode>;
66
+ fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number | import("long").Long) => Promise<string>;
67
+ requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<string | undefined>;
68
+ getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
29
69
  assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
30
- relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
70
+ relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
31
71
  sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
32
- sendReceipts: (keys: import("../Types").WAProto.IMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
33
- getButtonArgs: (message: import("../Types").WAProto.IMessage) => {
34
- [key: string]: string;
35
- };
36
- readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise<void>;
72
+ sendReceipts: (keys: WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
73
+ readMessages: (keys: WAMessageKey[]) => Promise<void>;
37
74
  refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
38
- getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
39
- createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: {
40
- [key: string]: string;
41
- } | undefined) => Promise<{
42
- nodes: import("../WABinary").BinaryNode[];
43
- shouldIncludeDeviceIdentity: boolean;
44
- }>;
45
75
  waUploadToServer: import("../Types").WAMediaUploadFunction;
46
76
  fetchPrivacySettings: (force?: boolean) => Promise<{
47
77
  [_: string]: string;
48
78
  }>;
49
- updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
50
- sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
79
+ sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
80
+ createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: {
81
+ [key: string]: string;
82
+ } | undefined) => Promise<{
83
+ nodes: BinaryNode[];
84
+ shouldIncludeDeviceIdentity: boolean;
85
+ }>;
86
+ getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
87
+ updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
88
+ sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>;
51
89
  subscribeNewsletterUpdates: (jid: string) => Promise<{
52
90
  duration: string;
53
91
  }>;
@@ -60,22 +98,18 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
60
98
  newsletterFollow: (jid: string) => Promise<void>;
61
99
  newsletterUnmute: (jid: string) => Promise<void>;
62
100
  newsletterMute: (jid: string) => Promise<void>;
63
- newsletterAction: (jid: string, type: "mute" | "follow" | "unfollow" | "unmute") => Promise<void>;
64
- newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
101
+ newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
65
102
  newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
66
103
  newsletterAdminCount: (jid: string) => Promise<number>;
67
104
  newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
68
105
  newsletterDemote: (jid: string, user: string) => Promise<void>;
69
106
  newsletterDelete: (jid: string) => Promise<void>;
70
- newsletterReactMessage: (jid: string, serverId: string, code?: string | undefined) => Promise<void>;
107
+ newsletterReactMessage: (jid: string, server_id: string, code?: string | undefined) => Promise<void>;
71
108
  newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
72
109
  newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
73
- groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
74
- groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
110
+ groupMetadata: (jid: string) => Promise<GroupMetadata>;
111
+ groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>;
75
112
  groupLeave: (id: string) => Promise<void>;
76
- /** the network code of your mobile network
77
- * @see {@link https://de.wikipedia.org/wiki/Mobile_Network_Code}
78
- */
79
113
  groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
80
114
  groupRequestParticipantsList: (jid: string) => Promise<{
81
115
  [key: string]: string;
@@ -84,57 +118,62 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
84
118
  status: string;
85
119
  jid: string;
86
120
  }[]>;
87
- groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
121
+ groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<{
88
122
  status: string;
89
123
  jid: string;
90
- content: import("../WABinary").BinaryNode;
124
+ content: BinaryNode;
91
125
  }[]>;
92
126
  groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
93
127
  groupInviteCode: (jid: string) => Promise<string | undefined>;
94
128
  groupRevokeInvite: (jid: string) => Promise<string | undefined>;
95
129
  groupAcceptInvite: (code: string) => Promise<string | undefined>;
96
- groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
97
- groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
130
+ groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
131
+ groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
132
+ groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
98
133
  groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
99
134
  groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
100
135
  groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
101
136
  groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
102
137
  groupFetchAllParticipating: () => Promise<{
103
- [_: string]: import("../Types").GroupMetadata;
138
+ [_: string]: GroupMetadata;
104
139
  }>;
105
140
  processingMutex: {
106
141
  mutex<T>(code: () => T | Promise<T>): Promise<T>;
107
142
  };
108
- upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
143
+ upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
109
144
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
110
145
  sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
111
146
  presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
112
147
  profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
113
148
  onWhatsApp: (...jids: string[]) => Promise<{
114
- exists: boolean;
115
149
  jid: string;
116
- }[]>;
150
+ exists: unknown;
151
+ }[] | undefined>;
117
152
  fetchBlocklist: () => Promise<string[]>;
118
- fetchStatus: (jid: string) => Promise<{
119
- status: string | undefined;
120
- setAt: Date;
121
- } | undefined>;
153
+ fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
154
+ fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
122
155
  updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
156
+ updateProfilePictureFull: (jid: any, content: any) => Promise<void>;
157
+ updateProfilePictureFull2: (jid: any, content: any) => Promise<void>;
123
158
  removeProfilePicture: (jid: string) => Promise<void>;
124
159
  updateProfileStatus: (status: string) => Promise<void>;
125
160
  updateProfileName: (name: string) => Promise<void>;
126
161
  updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
162
+ updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
127
163
  updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
128
164
  updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
129
165
  updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
130
166
  updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
131
167
  updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
132
- updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
168
+ updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
133
169
  updateDefaultDisappearingMode: (duration: number) => Promise<void>;
134
170
  getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
135
171
  resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
136
172
  chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
137
173
  cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
174
+ addOrEditContact: (jid: string, contact: import("../Types").ContactAction) => Promise<void>;
175
+ removeContact: (jid: string) => Promise<void>;
176
+ addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
138
177
  addChatLabel: (jid: string, labelId: string) => Promise<void>;
139
178
  removeChatLabel: (jid: string, labelId: string) => Promise<void>;
140
179
  addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
@@ -143,8 +182,9 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
143
182
  id: string;
144
183
  fromMe?: boolean | undefined;
145
184
  }[], star: boolean) => Promise<void>;
185
+ executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
146
186
  type: "md";
147
- ws: any;
187
+ ws: import("./Client").WebSocketClient;
148
188
  ev: import("../Types").BaileysEventEmitter & {
149
189
  process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
150
190
  buffer(): void;
@@ -159,11 +199,11 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
159
199
  signalRepository: import("../Types").SignalRepository;
160
200
  user: import("../Types").Contact | undefined;
161
201
  generateMessageTag: () => string;
162
- query: (node: import("../WABinary").BinaryNode, timeoutMs?: number | undefined) => Promise<import("../WABinary").BinaryNode>;
202
+ query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
163
203
  waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
164
204
  waitForSocketOpen: () => Promise<void>;
165
205
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
166
- sendNode: (frame: import("../WABinary").BinaryNode) => Promise<void>;
206
+ sendNode: (frame: BinaryNode) => Promise<void>;
167
207
  logout: (msg?: string | undefined) => Promise<void>;
168
208
  end: (error: Error | undefined) => void;
169
209
  onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
@@ -171,97 +211,6 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
171
211
  uploadPreKeysToServerIfRequired: () => Promise<void>;
172
212
  requestPairingCode: (phoneNumber: string) => Promise<string>;
173
213
  waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
174
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("../WABinary").BinaryNode>;
175
- };
176
- export interface RegistrationData {
177
- registrationId: number;
178
- signedPreKey: SignedKeyPair;
179
- noiseKey: KeyPair;
180
- signedIdentityKey: KeyPair;
181
- identityId: Buffer;
182
- phoneId: string;
183
- deviceId: string;
184
- backupToken: Buffer;
185
- }
186
- export interface RegistrationOptions {
187
- /** your phone number */
188
- phoneNumber?: string;
189
- /** the country code of your phone number */
190
- phoneNumberCountryCode: string;
191
- /** your phone number without country code */
192
- phoneNumberNationalNumber: string;
193
- /** the country code of your mobile network
194
- * @see {@link https://de.wikipedia.org/wiki/Mobile_Country_Code}
195
- */
196
- phoneNumberMobileCountryCode: string;
197
- /** the network code of your mobile network
198
- * @see {@link https://de.wikipedia.org/wiki/Mobile_Network_Code}
199
- */
200
- phoneNumberMobileNetworkCode: string;
201
- /**
202
- * How to send the one time code
203
- */
204
- method?: 'sms' | 'voice' | 'captcha';
205
- /**
206
- * The captcha code if it was requested
207
- */
208
- captcha?: string;
209
- }
210
- export type RegistrationParams = RegistrationData & RegistrationOptions;
211
- export declare function registrationParams(params: RegistrationParams): {
212
- cc: string;
213
- in: string;
214
- Rc: string;
215
- lg: string;
216
- lc: string;
217
- mistyped: string;
218
- authkey: string;
219
- e_regid: string;
220
- e_keytype: string;
221
- e_ident: string;
222
- e_skey_id: string;
223
- e_skey_val: string;
224
- e_skey_sig: string;
225
- fdid: string;
226
- network_ratio_type: string;
227
- expid: string;
228
- simnum: string;
229
- hasinrc: string;
230
- pid: string;
231
- id: string;
232
- backup_token: string;
233
- token: string;
234
- fraud_checkpoint_code: string | undefined;
214
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
235
215
  };
236
- /**
237
- * Requests a registration code for the given phone number.
238
- */
239
- export declare function mobileRegisterCode(params: RegistrationParams, fetchOptions?: AxiosRequestConfig): Promise<ExistsResponse>;
240
- export declare function mobileRegisterExists(params: RegistrationParams, fetchOptions?: AxiosRequestConfig): Promise<ExistsResponse>;
241
- /**
242
- * Registers the phone number on whatsapp with the received OTP code.
243
- */
244
- export declare function mobileRegister(params: RegistrationParams & {
245
- code: string;
246
- }, fetchOptions?: AxiosRequestConfig): Promise<ExistsResponse>;
247
- /**
248
- * Encrypts the given string as AEAD aes-256-gcm with the public whatsapp key and a random keypair.
249
- */
250
- export declare function mobileRegisterEncrypt(data: string): string;
251
- export declare function mobileRegisterFetch(path: string, opts?: AxiosRequestConfig): Promise<ExistsResponse>;
252
- export interface ExistsResponse {
253
- status: 'fail' | 'sent';
254
- voice_length?: number;
255
- voice_wait?: number;
256
- sms_length?: number;
257
- sms_wait?: number;
258
- reason?: 'incorrect' | 'missing_param' | 'code_checkpoint';
259
- login?: string;
260
- flash_type?: number;
261
- ab_hash?: string;
262
- ab_key?: string;
263
- exp_cfg?: string;
264
- lid?: string;
265
- image_blob?: string;
266
- audio_blob?: string;
267
- }
216
+ export declare const extractCommunityMetadata: (result: BinaryNode) => GroupMetadata;