cuki-bailx 1.1.2 → 1.2.3

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 (116) hide show
  1. package/WAProto/index.js +79296 -118676
  2. package/engine-requirements.js +1 -1
  3. package/lib/Defaults/baileys-version.json +1 -1
  4. package/lib/Defaults/index.d.ts +6 -4
  5. package/lib/Defaults/index.js +102 -78
  6. package/lib/Defaults/phonenumber-mcc.json +223 -0
  7. package/lib/Socket/Client/{types.d.ts → abstract-socket-client.d.ts} +2 -1
  8. package/lib/Socket/Client/index.d.ts +3 -2
  9. package/lib/Socket/Client/index.js +3 -2
  10. package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
  11. package/lib/Socket/Client/mobile-socket-client.js +65 -0
  12. package/lib/Socket/Client/{websocket.d.ts → web-socket-client.d.ts} +1 -2
  13. package/lib/Socket/Client/{websocket.js → web-socket-client.js} +2 -12
  14. package/lib/Socket/business.d.ts +58 -59
  15. package/lib/Socket/chats.d.ts +27 -29
  16. package/lib/Socket/chats.js +90 -97
  17. package/lib/Socket/dugong.d.ts +219 -0
  18. package/lib/Socket/dugong.js +441 -0
  19. package/lib/Socket/groups.d.ts +32 -41
  20. package/lib/Socket/groups.js +5 -20
  21. package/lib/Socket/index.d.ts +64 -63
  22. package/lib/Socket/index.js +2 -2
  23. package/lib/Socket/messages-recv.js +65 -9
  24. package/lib/Socket/messages-send.d.ts +47 -49
  25. package/lib/Socket/messages-send.js +312 -379
  26. package/lib/Socket/newsletter.d.ts +37 -39
  27. package/lib/Socket/newsletter.js +40 -54
  28. package/lib/Socket/registration.d.ts +267 -0
  29. package/lib/Socket/registration.js +166 -0
  30. package/lib/Socket/socket.d.ts +10 -10
  31. package/lib/Socket/socket.js +32 -39
  32. package/lib/Socket/socket.js.bak +630 -0
  33. package/lib/Socket/usync.d.ts +3 -3
  34. package/lib/Store/index.d.ts +2 -1
  35. package/lib/Store/index.js +3 -1
  36. package/lib/Store/make-cache-manager-store.d.ts +13 -0
  37. package/lib/Store/make-cache-manager-store.js +83 -0
  38. package/lib/Store/make-in-memory-store.d.ts +24 -24
  39. package/lib/Store/make-in-memory-store.js +11 -13
  40. package/lib/Store/make-ordered-dictionary.d.ts +1 -1
  41. package/lib/Store/make-ordered-dictionary.js +2 -2
  42. package/lib/Types/Auth.d.ts +7 -0
  43. package/lib/Types/Call.d.ts +1 -1
  44. package/lib/Types/Chat.d.ts +7 -14
  45. package/lib/Types/Contact.d.ts +1 -5
  46. package/lib/Types/Events.d.ts +2 -44
  47. package/lib/Types/GroupMetadata.d.ts +2 -11
  48. package/lib/Types/Label.js +1 -1
  49. package/lib/Types/LabelAssociation.js +1 -1
  50. package/lib/Types/Message.d.ts +21 -148
  51. package/lib/Types/Message.js +2 -0
  52. package/lib/Types/Newsletter.d.ts +13 -0
  53. package/lib/Types/Newsletter.js +17 -3
  54. package/lib/Types/Socket.d.ts +9 -17
  55. package/lib/Types/index.d.ts +1 -8
  56. package/lib/Types/index.js +2 -2
  57. package/lib/Utils/auth-utils.d.ts +3 -3
  58. package/lib/Utils/auth-utils.js +13 -6
  59. package/lib/Utils/business.js +2 -2
  60. package/lib/Utils/chat-utils.d.ts +16 -15
  61. package/lib/Utils/chat-utils.js +35 -36
  62. package/lib/Utils/crypto.d.ts +16 -15
  63. package/lib/Utils/crypto.js +29 -71
  64. package/lib/Utils/decode-wa-message.d.ts +6 -22
  65. package/lib/Utils/decode-wa-message.js +56 -65
  66. package/lib/Utils/event-buffer.d.ts +2 -2
  67. package/lib/Utils/event-buffer.js +7 -11
  68. package/lib/Utils/generics.d.ts +20 -17
  69. package/lib/Utils/generics.js +23 -73
  70. package/lib/Utils/history.d.ts +0 -4
  71. package/lib/Utils/history.js +6 -4
  72. package/lib/Utils/link-preview.d.ts +2 -2
  73. package/lib/Utils/link-preview.js +1 -34
  74. package/lib/Utils/logger.d.ts +3 -10
  75. package/lib/Utils/lt-hash.d.ts +2 -2
  76. package/lib/Utils/lt-hash.js +6 -6
  77. package/lib/Utils/make-mutex.d.ts +2 -2
  78. package/lib/Utils/messages-media.d.ts +24 -28
  79. package/lib/Utils/messages-media.js +115 -263
  80. package/lib/Utils/messages.d.ts +10 -8
  81. package/lib/Utils/messages.js +72 -298
  82. package/lib/Utils/noise-handler.d.ts +12 -10
  83. package/lib/Utils/noise-handler.js +23 -18
  84. package/lib/Utils/process-message.d.ts +4 -5
  85. package/lib/Utils/process-message.js +23 -74
  86. package/lib/Utils/signal.d.ts +1 -2
  87. package/lib/Utils/signal.js +35 -37
  88. package/lib/Utils/use-multi-file-auth-state.d.ts +1 -0
  89. package/lib/Utils/use-multi-file-auth-state.js +6 -51
  90. package/lib/Utils/validate-connection.d.ts +4 -3
  91. package/lib/Utils/validate-connection.js +52 -20
  92. package/lib/WABinary/constants.d.ts +4 -4
  93. package/lib/WABinary/constants.js +13 -1276
  94. package/lib/WABinary/decode.d.ts +4 -3
  95. package/lib/WABinary/decode.js +13 -26
  96. package/lib/WABinary/encode.d.ts +2 -1
  97. package/lib/WABinary/encode.js +17 -39
  98. package/lib/WABinary/generic-utils.d.ts +3 -1
  99. package/lib/WABinary/generic-utils.js +85 -2
  100. package/lib/WABinary/jid-utils.d.ts +5 -10
  101. package/lib/WABinary/jid-utils.js +5 -26
  102. package/lib/WAM/BinaryInfo.d.ts +11 -2
  103. package/lib/WAM/encode.d.ts +2 -1
  104. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -1
  105. package/lib/index.d.ts +2 -6
  106. package/lib/index.js +7 -21
  107. package/lib/index.js.bak +48 -0
  108. package/package.json +103 -111
  109. package/LICENSE +0 -21
  110. package/WAProto/GenerateStatics.sh +0 -4
  111. package/WAProto/WAProto.proto +0 -4775
  112. package/WAProto/index.d.ts +0 -55057
  113. package/WAProto/index.ts.ts +0 -53473
  114. package/WAProto/p.html +0 -1
  115. package/lib/WABinary/jid-utils.js.bak +0 -83
  116. /package/lib/Socket/Client/{types.js → abstract-socket-client.js} +0 -0
@@ -1,7 +1,8 @@
1
+ /// <reference types="node" />
1
2
  import { GetCatalogOptions, ProductCreate, ProductUpdate, SocketConfig } from '../Types';
2
3
  import { BinaryNode } from '../WABinary';
3
4
  export declare const makeBusinessSocket: (config: SocketConfig) => {
4
- logger: import("../Utils/logger").ILogger;
5
+ logger: import("pino").Logger<import("pino").LoggerOptions>;
5
6
  getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
6
7
  getCatalog: ({ jid, limit, cursor }: GetCatalogOptions) => Promise<{
7
8
  products: import("../Types").Product[];
@@ -15,40 +16,41 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
15
16
  deleted: number;
16
17
  }>;
17
18
  productUpdate: (productId: string, update: ProductUpdate) => Promise<import("../Types").Product>;
18
- sendMessageAck: ({ tag, attrs, content }: BinaryNode, errorCode?: number) => Promise<void>;
19
+ sendMessageAck: ({ tag, attrs, content }: BinaryNode) => Promise<void>;
19
20
  sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
20
- rejectCall: (callId: string, callFrom: string) => Promise<void>;
21
21
  offerCall: (toJid: string, isVideo?: boolean) => Promise<{
22
- callId: string;
23
- toJid: string;
24
- isVideo: boolean;
22
+ id: string;
23
+ to: string;
25
24
  }>;
26
- fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
27
- requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
28
- getPrivacyTokens: (jids: string[]) => Promise<any>;
25
+ rejectCall: (callId: string, callFrom: string) => Promise<void>;
26
+ getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
29
27
  assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
30
- relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
28
+ relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
31
29
  sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
32
- sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
33
- readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
30
+ sendReceipts: (keys: import("../Types").WAProto.IMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
31
+ getButtonArgs: (message: import("../Types").WAProto.IMessage) => {
32
+ [key: string]: string;
33
+ };
34
+ readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise<void>;
34
35
  refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
35
- waUploadToServer: import("../Types").WAMediaUploadFunction;
36
- fetchPrivacySettings: (force?: boolean) => Promise<{
37
- [_: string]: string;
38
- }>;
39
36
  getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
40
- createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
37
+ createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: {
38
+ [key: string]: string;
39
+ } | undefined) => Promise<{
41
40
  nodes: BinaryNode[];
42
41
  shouldIncludeDeviceIdentity: boolean;
43
42
  }>;
44
- sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
43
+ waUploadToServer: import("../Types").WAMediaUploadFunction;
44
+ fetchPrivacySettings: (force?: boolean) => Promise<{
45
+ [_: string]: string;
46
+ }>;
45
47
  updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
46
- sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
48
+ sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
47
49
  subscribeNewsletterUpdates: (jid: string) => Promise<{
48
50
  duration: string;
49
51
  }>;
50
52
  newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
51
- newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
53
+ newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
52
54
  newsletterUpdateName: (jid: string, name: string) => Promise<void>;
53
55
  newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
54
56
  newsletterRemovePicture: (jid: string) => Promise<void>;
@@ -56,16 +58,16 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
56
58
  newsletterFollow: (jid: string) => Promise<void>;
57
59
  newsletterUnmute: (jid: string) => Promise<void>;
58
60
  newsletterMute: (jid: string) => Promise<void>;
59
- newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>;
60
- newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
61
+ newsletterAction: (jid: string, type: "mute" | "follow" | "unfollow" | "unmute") => Promise<void>;
62
+ newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
63
+ newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
61
64
  newsletterAdminCount: (jid: string) => Promise<number>;
62
65
  newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
63
66
  newsletterDemote: (jid: string, user: string) => Promise<void>;
64
67
  newsletterDelete: (jid: string) => Promise<void>;
65
- newsletterReactMessage: (jid: string, server_id: string, code?: string) => Promise<void>;
66
- newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
67
- newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
68
- groupQuery: (jid: string, type: "get" | "set", content: BinaryNode[]) => Promise<any>;
68
+ newsletterReactMessage: (jid: string, serverId: string, code?: string | undefined) => Promise<void>;
69
+ newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
70
+ newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
69
71
  groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
70
72
  groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
71
73
  groupLeave: (id: string) => Promise<void>;
@@ -73,7 +75,7 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
73
75
  groupRequestParticipantsList: (jid: string) => Promise<{
74
76
  [key: string]: string;
75
77
  }[]>;
76
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
78
+ groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
77
79
  status: string;
78
80
  jid: string;
79
81
  }[]>;
@@ -82,71 +84,68 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
82
84
  jid: string;
83
85
  content: BinaryNode;
84
86
  }[]>;
85
- groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
87
+ groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
86
88
  groupInviteCode: (jid: string) => Promise<string | undefined>;
87
89
  groupRevokeInvite: (jid: string) => Promise<string | undefined>;
88
90
  groupAcceptInvite: (code: string) => Promise<string | undefined>;
89
- groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
90
- groupAcceptInviteV4: (key: string | import("../Types").WAMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<any>;
91
+ groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
91
92
  groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
92
93
  groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
93
- groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
94
- groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
94
+ groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
95
+ groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
95
96
  groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
96
97
  groupFetchAllParticipating: () => Promise<{
97
98
  [_: string]: import("../Types").GroupMetadata;
98
99
  }>;
99
- getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
100
100
  processingMutex: {
101
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
101
+ mutex<T>(code: () => T | Promise<T>): Promise<T>;
102
102
  };
103
- upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
103
+ upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
104
104
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
105
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
106
- presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
107
- profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
105
+ sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
106
+ presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
107
+ profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
108
108
  onWhatsApp: (...jids: string[]) => Promise<{
109
109
  jid: string;
110
110
  exists: unknown;
111
111
  lid: unknown;
112
112
  }[] | undefined>;
113
113
  fetchBlocklist: () => Promise<string[]>;
114
- fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
115
- fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
114
+ fetchStatus: (jid: string) => Promise<{
115
+ status: string | undefined;
116
+ setAt: Date;
117
+ } | undefined>;
116
118
  updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
117
119
  removeProfilePicture: (jid: string) => Promise<void>;
118
120
  updateProfileStatus: (status: string) => Promise<void>;
119
121
  updateProfileName: (name: string) => Promise<void>;
120
122
  updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
121
- updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
122
- updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
123
123
  updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
124
124
  updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
125
125
  updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
126
126
  updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
127
127
  updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
128
- updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
128
+ updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
129
129
  updateDefaultDisappearingMode: (duration: number) => Promise<void>;
130
- getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
131
- resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
130
+ getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
131
+ resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
132
132
  chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
133
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
133
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
134
134
  addChatLabel: (jid: string, labelId: string) => Promise<void>;
135
135
  removeChatLabel: (jid: string, labelId: string) => Promise<void>;
136
136
  addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
137
137
  removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
138
138
  star: (jid: string, messages: {
139
139
  id: string;
140
- fromMe?: boolean;
140
+ fromMe?: boolean | undefined;
141
141
  }[], star: boolean) => Promise<void>;
142
- executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
143
142
  type: "md";
144
- ws: import("./Client").WebSocketClient;
143
+ ws: any;
145
144
  ev: import("../Types").BaileysEventEmitter & {
146
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
145
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
147
146
  buffer(): void;
148
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
149
- flush(force?: boolean): boolean;
147
+ createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
148
+ flush(force?: boolean | undefined): boolean;
150
149
  isBuffering(): boolean;
151
150
  };
152
151
  authState: {
@@ -156,17 +155,17 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
156
155
  signalRepository: import("../Types").SignalRepository;
157
156
  user: import("../Types").Contact | undefined;
158
157
  generateMessageTag: () => string;
159
- query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
160
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
158
+ query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
159
+ waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
161
160
  waitForSocketOpen: () => Promise<void>;
162
161
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
163
162
  sendNode: (frame: BinaryNode) => Promise<void>;
164
- logout: (msg?: string) => Promise<void>;
163
+ logout: (msg?: string | undefined) => Promise<void>;
165
164
  end: (error: Error | undefined) => void;
166
- onUnexpectedError: (err: Error | import("@hapi/boom").Boom, msg: string) => void;
165
+ onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
167
166
  uploadPreKeys: (count?: number) => Promise<void>;
168
167
  uploadPreKeysToServerIfRequired: () => Promise<void>;
169
- requestPairingCode: (phoneNumber: any, pairKey?: string) => Promise<string>;
170
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
171
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
168
+ requestPairingCode: (phoneNumber: string) => Promise<string>;
169
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
170
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
172
171
  };
@@ -1,46 +1,45 @@
1
+ /// <reference types="node" />
1
2
  import { Boom } from '@hapi/boom';
2
- import { BotListInfo, ChatModification, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAMessage, WAPatchCreate, WAPresence, WAPrivacyCallValue, WAPrivacyGroupAddValue, WAPrivacyMessagesValue, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types';
3
+ import { proto } from '../../WAProto';
4
+ import { ChatModification, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPresence, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types';
3
5
  import { BinaryNode } from '../WABinary';
4
- import { USyncQuery } from '../WAUSync';
5
6
  export declare const makeChatsSocket: (config: SocketConfig) => {
6
- getBotListV2: () => Promise<BotListInfo[]>;
7
7
  processingMutex: {
8
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
8
+ mutex<T>(code: () => T | Promise<T>): Promise<T>;
9
9
  };
10
10
  fetchPrivacySettings: (force?: boolean) => Promise<{
11
11
  [_: string]: string;
12
12
  }>;
13
- upsertMessage: (msg: WAMessage, type: MessageUpsertType) => Promise<void>;
13
+ upsertMessage: (msg: proto.IWebMessageInfo, type: MessageUpsertType) => Promise<void>;
14
14
  appPatch: (patchCreate: WAPatchCreate) => Promise<void>;
15
15
  sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>;
16
16
  presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
17
- profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
17
+ profilePictureUrl: (jid: string, type?: 'preview' | 'image', timeoutMs?: number) => Promise<string | undefined>;
18
18
  onWhatsApp: (...jids: string[]) => Promise<{
19
+ exists: boolean;
19
20
  jid: string;
20
- exists: unknown;
21
- lid: unknown;
22
- }[] | undefined>;
21
+ }[]>;
23
22
  fetchBlocklist: () => Promise<string[]>;
24
- fetchDisappearingDuration: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
25
- fetchStatus: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
23
+ fetchStatus: (jid: string) => Promise<{
24
+ status: string | undefined;
25
+ setAt: Date;
26
+ } | undefined>;
26
27
  updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>;
27
28
  removeProfilePicture: (jid: string) => Promise<void>;
28
29
  updateProfileStatus: (status: string) => Promise<void>;
29
30
  updateProfileName: (name: string) => Promise<void>;
30
- updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
31
- updateCallPrivacy: (value: WAPrivacyCallValue) => Promise<void>;
32
- updateMessagesPrivacy: (value: WAPrivacyMessagesValue) => Promise<void>;
31
+ updateBlockStatus: (jid: string, action: 'block' | 'unblock') => Promise<void>;
33
32
  updateLastSeenPrivacy: (value: WAPrivacyValue) => Promise<void>;
34
33
  updateOnlinePrivacy: (value: WAPrivacyOnlineValue) => Promise<void>;
35
34
  updateProfilePicturePrivacy: (value: WAPrivacyValue) => Promise<void>;
36
35
  updateStatusPrivacy: (value: WAPrivacyValue) => Promise<void>;
37
36
  updateReadReceiptsPrivacy: (value: WAReadReceiptsValue) => Promise<void>;
38
- updateGroupsAddPrivacy: (value: WAPrivacyGroupAddValue) => Promise<void>;
37
+ updateGroupsAddPrivacy: (value: WAPrivacyValue) => Promise<void>;
39
38
  updateDefaultDisappearingMode: (duration: number) => Promise<void>;
40
39
  getBusinessProfile: (jid: string) => Promise<WABusinessProfile | void>;
41
- resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
40
+ resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
42
41
  chatModify: (mod: ChatModification, jid: string) => Promise<void>;
43
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
42
+ cleanDirtyBits: (type: 'account_sync' | 'groups', fromTimestamp?: number | string) => Promise<void>;
44
43
  addChatLabel: (jid: string, labelId: string) => Promise<void>;
45
44
  removeChatLabel: (jid: string, labelId: string) => Promise<void>;
46
45
  addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
@@ -49,14 +48,13 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
49
48
  id: string;
50
49
  fromMe?: boolean;
51
50
  }[], star: boolean) => Promise<void>;
52
- executeUSyncQuery: (usyncQuery: USyncQuery) => Promise<import("../WAUSync").USyncQueryResult | undefined>;
53
51
  type: "md";
54
- ws: import("./Client").WebSocketClient;
52
+ ws: any;
55
53
  ev: import("../Types").BaileysEventEmitter & {
56
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
54
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
57
55
  buffer(): void;
58
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
59
- flush(force?: boolean): boolean;
56
+ createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
57
+ flush(force?: boolean | undefined): boolean;
60
58
  isBuffering(): boolean;
61
59
  };
62
60
  authState: {
@@ -66,17 +64,17 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
66
64
  signalRepository: import("../Types").SignalRepository;
67
65
  user: import("../Types").Contact | undefined;
68
66
  generateMessageTag: () => string;
69
- query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
70
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
67
+ query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
68
+ waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
71
69
  waitForSocketOpen: () => Promise<void>;
72
70
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
73
71
  sendNode: (frame: BinaryNode) => Promise<void>;
74
- logout: (msg?: string) => Promise<void>;
72
+ logout: (msg?: string | undefined) => Promise<void>;
75
73
  end: (error: Error | undefined) => void;
76
- onUnexpectedError: (err: Error | Boom, msg: string) => void;
74
+ onUnexpectedError: (err: Error | Boom<any>, msg: string) => void;
77
75
  uploadPreKeys: (count?: number) => Promise<void>;
78
76
  uploadPreKeysToServerIfRequired: () => Promise<void>;
79
- requestPairingCode: (phoneNumber: any, pairKey?: string) => Promise<string>;
80
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
81
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
77
+ requestPairingCode: (phoneNumber: string) => Promise<string>;
78
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
79
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
82
80
  };