cuki-bailx 1.1.2 → 1.2.2

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 -22
  107. package/lib/index.js.bak +37 -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,12 +1,15 @@
1
+ /// <reference types="node" />
1
2
  import { UserFacingSocketConfig } from '../Types';
2
3
  declare const makeWASocket: (config: UserFacingSocketConfig) => {
3
- logger: import("../Utils/logger").ILogger;
4
+ register: (code: string) => Promise<import("./registration").ExistsResponse>;
5
+ requestRegistrationCode: (registrationOptions?: import("./registration").RegistrationOptions | undefined) => Promise<import("./registration").ExistsResponse>;
6
+ logger: import("pino").Logger<import("pino").LoggerOptions>;
4
7
  getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
5
8
  getCatalog: ({ jid, limit, cursor }: import("../Types").GetCatalogOptions) => Promise<{
6
9
  products: import("../Types").Product[];
7
10
  nextPageCursor: string | undefined;
8
11
  }>;
9
- getCollections: (jid?: string, limit?: number) => Promise<{
12
+ getCollections: (jid?: string | undefined, limit?: number) => Promise<{
10
13
  collections: import("../Types").CatalogCollection[];
11
14
  }>;
12
15
  productCreate: (create: import("../Types").ProductCreate) => Promise<import("../Types").Product>;
@@ -14,40 +17,41 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
14
17
  deleted: number;
15
18
  }>;
16
19
  productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
17
- sendMessageAck: ({ tag, attrs, content }: import("..").BinaryNode, errorCode?: number) => Promise<void>;
18
- sendRetryRequest: (node: import("..").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
19
- rejectCall: (callId: string, callFrom: string) => Promise<void>;
20
+ sendMessageAck: ({ tag, attrs, content }: import("../index").BinaryNode) => Promise<void>;
21
+ sendRetryRequest: (node: import("../index").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
20
22
  offerCall: (toJid: string, isVideo?: boolean) => Promise<{
21
- callId: string;
22
- toJid: string;
23
- isVideo: boolean;
23
+ id: string;
24
+ to: string;
24
25
  }>;
25
- fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
26
- requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
27
- getPrivacyTokens: (jids: string[]) => Promise<any>;
26
+ rejectCall: (callId: string, callFrom: string) => Promise<void>;
27
+ getPrivacyTokens: (jids: string[]) => Promise<import("../index").BinaryNode>;
28
28
  assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
29
- relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
29
+ relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
30
30
  sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
31
- sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
32
- readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
31
+ sendReceipts: (keys: import("../Types").WAProto.IMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
32
+ getButtonArgs: (message: import("../Types").WAProto.IMessage) => {
33
+ [key: string]: string;
34
+ };
35
+ readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise<void>;
33
36
  refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
37
+ getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../index").JidWithDevice[]>;
38
+ createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: {
39
+ [key: string]: string;
40
+ } | undefined) => Promise<{
41
+ nodes: import("../index").BinaryNode[];
42
+ shouldIncludeDeviceIdentity: boolean;
43
+ }>;
34
44
  waUploadToServer: import("../Types").WAMediaUploadFunction;
35
45
  fetchPrivacySettings: (force?: boolean) => Promise<{
36
46
  [_: string]: string;
37
47
  }>;
38
- getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("..").JidWithDevice[]>;
39
- createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: import("..").BinaryNode["attrs"]) => Promise<{
40
- nodes: import("..").BinaryNode[];
41
- shouldIncludeDeviceIdentity: boolean;
42
- }>;
43
- sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
44
48
  updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
45
- sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
49
+ sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
46
50
  subscribeNewsletterUpdates: (jid: string) => Promise<{
47
51
  duration: string;
48
52
  }>;
49
53
  newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
50
- newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
54
+ newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
51
55
  newsletterUpdateName: (jid: string, name: string) => Promise<void>;
52
56
  newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
53
57
  newsletterRemovePicture: (jid: string) => Promise<void>;
@@ -55,16 +59,16 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
55
59
  newsletterFollow: (jid: string) => Promise<void>;
56
60
  newsletterUnmute: (jid: string) => Promise<void>;
57
61
  newsletterMute: (jid: string) => Promise<void>;
58
- newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>;
59
- newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
62
+ newsletterAction: (jid: string, type: "mute" | "follow" | "unfollow" | "unmute") => Promise<void>;
63
+ newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
64
+ newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
60
65
  newsletterAdminCount: (jid: string) => Promise<number>;
61
66
  newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
62
67
  newsletterDemote: (jid: string, user: string) => Promise<void>;
63
68
  newsletterDelete: (jid: string) => Promise<void>;
64
- newsletterReactMessage: (jid: string, server_id: string, code?: string) => Promise<void>;
65
- newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
66
- newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
67
- groupQuery: (jid: string, type: "get" | "set", content: import("..").BinaryNode[]) => Promise<any>;
69
+ newsletterReactMessage: (jid: string, serverId: string, code?: string | undefined) => Promise<void>;
70
+ newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
71
+ newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
68
72
  groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
69
73
  groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
70
74
  groupLeave: (id: string) => Promise<void>;
@@ -72,80 +76,77 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
72
76
  groupRequestParticipantsList: (jid: string) => Promise<{
73
77
  [key: string]: string;
74
78
  }[]>;
75
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
79
+ groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
76
80
  status: string;
77
81
  jid: string;
78
82
  }[]>;
79
83
  groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
80
84
  status: string;
81
85
  jid: string;
82
- content: import("..").BinaryNode;
86
+ content: import("../index").BinaryNode;
83
87
  }[]>;
84
- groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
88
+ groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
85
89
  groupInviteCode: (jid: string) => Promise<string | undefined>;
86
90
  groupRevokeInvite: (jid: string) => Promise<string | undefined>;
87
91
  groupAcceptInvite: (code: string) => Promise<string | undefined>;
88
- groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
89
- groupAcceptInviteV4: (key: string | import("../Types").WAMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<any>;
92
+ groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
90
93
  groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
91
94
  groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
92
- groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
93
- groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
95
+ groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
96
+ groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
94
97
  groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
95
98
  groupFetchAllParticipating: () => Promise<{
96
99
  [_: string]: import("../Types").GroupMetadata;
97
100
  }>;
98
- getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
99
101
  processingMutex: {
100
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
102
+ mutex<T>(code: () => T | Promise<T>): Promise<T>;
101
103
  };
102
- upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
104
+ upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
103
105
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
104
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
105
- presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
106
- profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
106
+ sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
107
+ presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
108
+ profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
107
109
  onWhatsApp: (...jids: string[]) => Promise<{
108
110
  jid: string;
109
111
  exists: unknown;
110
112
  lid: unknown;
111
113
  }[] | undefined>;
112
114
  fetchBlocklist: () => Promise<string[]>;
113
- fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
114
- fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
115
+ fetchStatus: (jid: string) => Promise<{
116
+ status: string | undefined;
117
+ setAt: Date;
118
+ } | undefined>;
115
119
  updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
116
120
  removeProfilePicture: (jid: string) => Promise<void>;
117
121
  updateProfileStatus: (status: string) => Promise<void>;
118
122
  updateProfileName: (name: string) => Promise<void>;
119
123
  updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
120
- updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
121
- updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
122
124
  updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
123
125
  updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
124
126
  updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
125
127
  updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
126
128
  updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
127
- updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
129
+ updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
128
130
  updateDefaultDisappearingMode: (duration: number) => Promise<void>;
129
- getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
130
- resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
131
+ getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
132
+ resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
131
133
  chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
132
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
134
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
133
135
  addChatLabel: (jid: string, labelId: string) => Promise<void>;
134
136
  removeChatLabel: (jid: string, labelId: string) => Promise<void>;
135
137
  addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
136
138
  removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
137
139
  star: (jid: string, messages: {
138
140
  id: string;
139
- fromMe?: boolean;
141
+ fromMe?: boolean | undefined;
140
142
  }[], star: boolean) => Promise<void>;
141
- executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
142
143
  type: "md";
143
- ws: import("./Client").WebSocketClient;
144
+ ws: any;
144
145
  ev: import("../Types").BaileysEventEmitter & {
145
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
146
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
146
147
  buffer(): void;
147
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
148
- flush(force?: boolean): boolean;
148
+ createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
149
+ flush(force?: boolean | undefined): boolean;
149
150
  isBuffering(): boolean;
150
151
  };
151
152
  authState: {
@@ -155,18 +156,18 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
155
156
  signalRepository: import("../Types").SignalRepository;
156
157
  user: import("../Types").Contact | undefined;
157
158
  generateMessageTag: () => string;
158
- query: (node: import("..").BinaryNode, timeoutMs?: number) => Promise<any>;
159
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
159
+ query: (node: import("../index").BinaryNode, timeoutMs?: number | undefined) => Promise<import("../index").BinaryNode>;
160
+ waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
160
161
  waitForSocketOpen: () => Promise<void>;
161
162
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
162
- sendNode: (frame: import("..").BinaryNode) => Promise<void>;
163
- logout: (msg?: string) => Promise<void>;
163
+ sendNode: (frame: import("../index").BinaryNode) => Promise<void>;
164
+ logout: (msg?: string | undefined) => Promise<void>;
164
165
  end: (error: Error | undefined) => void;
165
- onUnexpectedError: (err: Error | import("@hapi/boom").Boom, msg: string) => void;
166
+ onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
166
167
  uploadPreKeys: (count?: number) => Promise<void>;
167
168
  uploadPreKeysToServerIfRequired: () => Promise<void>;
168
- requestPairingCode: (phoneNumber: any, pairKey?: string) => Promise<string>;
169
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
170
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
169
+ requestPairingCode: (phoneNumber: string) => Promise<string>;
170
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
171
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("../index").BinaryNode>;
171
172
  };
172
173
  export default makeWASocket;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const Defaults_1 = require("../Defaults");
4
- const business_1 = require("./business");
4
+ const registration_1 = require("./registration");
5
5
  // export the last socket layer
6
- const makeWASocket = (config) => ((0, business_1.makeBusinessSocket)({
6
+ const makeWASocket = (config) => ((0, registration_1.makeRegistrationSocket)({
7
7
  ...Defaults_1.DEFAULT_CONNECTION_CONFIG,
8
8
  ...config
9
9
  }));
@@ -16,9 +16,34 @@ const WABinary_1 = require("../WABinary");
16
16
  const groups_1 = require("./groups");
17
17
  const messages_send_1 = require("./messages-send");
18
18
  const makeMessagesRecvSocket = (config) => {
19
- const { logger, retryRequestDelayMs, maxMsgRetryCount, getMessage, shouldIgnoreJid } = config;
19
+ const {
20
+ logger,
21
+ retryRequestDelayMs,
22
+ maxMsgRetryCount,
23
+ getMessage,
24
+ shouldIgnoreJid
25
+ } = config;
20
26
  const sock = (0, messages_send_1.makeMessagesSocket)(config);
21
- const { ev, authState, ws, processingMutex, signalRepository, query, upsertMessage, resyncAppState, groupMetadata, onUnexpectedError, assertSessions, sendNode, relayMessage, sendReceipt, uploadPreKeys, createParticipantNodes, getUSyncDevices, sendPeerDataOperationMessage, } = sock;
27
+ const {
28
+ ev,
29
+ authState,
30
+ ws,
31
+ processingMutex,
32
+ signalRepository,
33
+ query,
34
+ upsertMessage,
35
+ resyncAppState,
36
+ groupMetadata,
37
+ onUnexpectedError,
38
+ assertSessions,
39
+ sendNode,
40
+ relayMessage,
41
+ sendReceipt,
42
+ uploadPreKeys,
43
+ createParticipantNodes,
44
+ getUSyncDevices,
45
+ sendPeerDataOperationMessage
46
+ } = sock;
22
47
  /** this mutex ensures that each retryRequest will wait for the previous one to finish */
23
48
  const retryMutex = (0, make_mutex_1.makeMutex)();
24
49
  const msgRetryCache = config.msgRetryCounterCache || new node_cache_1.default({
@@ -42,7 +67,7 @@ const makeMessagesRecvSocket = (config) => {
42
67
  to: attrs.from,
43
68
  class: tag
44
69
  }
45
- };
70
+ }
46
71
  if (!!errorCode) {
47
72
  stanza.attrs.error = errorCode.toString();
48
73
  }
@@ -58,14 +83,31 @@ const makeMessagesRecvSocket = (config) => {
58
83
  if (tag === 'message' && (0, WABinary_1.getBinaryNodeChild)({ tag, attrs, content }, 'unavailable')) {
59
84
  stanza.attrs.from = authState.creds.me.id;
60
85
  }
61
- logger.debug({ recv: { tag, attrs }, sent: stanza.attrs }, 'sent ack');
86
+ logger.debug({
87
+ recv: {
88
+ tag,
89
+ attrs
90
+ },
91
+ sent: stanza.attrs }, 'sent ack');
62
92
  await sendNode(stanza);
63
93
  };
64
94
  const offerCall = async (toJid, isVideo = false) => {
65
95
  const callId = (0, crypto_1.randomBytes)(16).toString('hex').toUpperCase().substring(0, 64);
66
96
  const offerContent = [];
67
- offerContent.push({ tag: 'audio', attrs: { enc: 'opus', rate: '16000' }, content: undefined });
68
- offerContent.push({ tag: 'audio', attrs: { enc: 'opus', rate: '8000' }, content: undefined });
97
+ offerContent.push({
98
+ tag: 'audio',
99
+ attrs: {
100
+ enc: 'opus',
101
+ rate: '16000'
102
+ }, content: undefined
103
+ });
104
+ offerContent.push({
105
+ tag: 'audio',
106
+ attrs: {
107
+ enc: 'opus',
108
+ rate: '8000'
109
+ }, content: undefined
110
+ });
69
111
  if (isVideo) {
70
112
  offerContent.push({
71
113
  tag: 'video',
@@ -79,9 +121,23 @@ const makeMessagesRecvSocket = (config) => {
79
121
  }
80
122
  });
81
123
  }
82
- offerContent.push({ tag: 'net', attrs: { medium: '3' }, content: undefined });
83
- offerContent.push({ tag: 'capability', attrs: { ver: '1' }, content: new Uint8Array([1, 4, 255, 131, 207, 4]) });
84
- offerContent.push({ tag: 'encopt', attrs: { keygen: '2' }, content: undefined });
124
+ offerContent.push({
125
+ tag: 'net',
126
+ attrs: {
127
+ medium: '3'
128
+ }, content: undefined
129
+ });
130
+ offerContent.push({
131
+ tag: 'capability',
132
+ attrs: {
133
+ ver: '1'
134
+ }, content: new Uint8Array([1, 4, 255, 131, 207, 4]) });
135
+ offerContent.push({
136
+ tag: 'encopt',
137
+ attrs: {
138
+ keygen: '2'
139
+ }, content: undefined
140
+ })
85
141
  const encKey = (0, crypto_1.randomBytes)(32);
86
142
  const devices = (await getUSyncDevices([toJid], true, false)).map(({ user, device }) => (0, WABinary_1.jidEncode)(user, 's.whatsapp.net', device));
87
143
  await assertSessions(devices, true);
@@ -1,33 +1,34 @@
1
+ /// <reference types="node" />
1
2
  import { Boom } from '@hapi/boom';
2
3
  import { proto } from '../../WAProto';
3
4
  import { AnyMessageContent, MediaConnInfo, MessageReceiptType, MessageRelayOptions, MiscMessageGenerationOptions, SocketConfig, WAMessageKey } from '../Types';
4
5
  import { BinaryNode, JidWithDevice } from '../WABinary';
5
- import { USyncQuery } from '../WAUSync';
6
6
  export declare const makeMessagesSocket: (config: SocketConfig) => {
7
- getPrivacyTokens: (jids: string[]) => Promise<any>;
7
+ getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
8
8
  assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
9
- relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
9
+ relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
10
10
  sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
11
11
  sendReceipts: (keys: WAMessageKey[], type: MessageReceiptType) => Promise<void>;
12
+ getButtonArgs: (message: proto.IMessage) => BinaryNode['attrs'];
12
13
  readMessages: (keys: WAMessageKey[]) => Promise<void>;
13
14
  refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>;
14
- waUploadToServer: import("../Types").WAMediaUploadFunction;
15
- fetchPrivacySettings: (force?: boolean) => Promise<{
16
- [_: string]: string;
17
- }>;
18
15
  getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<JidWithDevice[]>;
19
- createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
16
+ createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode['attrs']) => Promise<{
20
17
  nodes: BinaryNode[];
21
18
  shouldIncludeDeviceIdentity: boolean;
22
19
  }>;
20
+ waUploadToServer: import("../Types").WAMediaUploadFunction;
21
+ fetchPrivacySettings: (force?: boolean) => Promise<{
22
+ [_: string]: string;
23
+ }>;
23
24
  sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
24
25
  updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
25
- sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo>;
26
+ sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>;
26
27
  subscribeNewsletterUpdates: (jid: string) => Promise<{
27
28
  duration: string;
28
29
  }>;
29
30
  newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
30
- newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
31
+ newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
31
32
  newsletterUpdateName: (jid: string, name: string) => Promise<void>;
32
33
  newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
33
34
  newsletterRemovePicture: (jid: string) => Promise<void>;
@@ -35,16 +36,16 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
35
36
  newsletterFollow: (jid: string) => Promise<void>;
36
37
  newsletterUnmute: (jid: string) => Promise<void>;
37
38
  newsletterMute: (jid: string) => Promise<void>;
38
- newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>;
39
- newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
39
+ newsletterAction: (jid: string, type: "mute" | "follow" | "unfollow" | "unmute") => Promise<void>;
40
+ newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
41
+ newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
40
42
  newsletterAdminCount: (jid: string) => Promise<number>;
41
43
  newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
42
44
  newsletterDemote: (jid: string, user: string) => Promise<void>;
43
45
  newsletterDelete: (jid: string) => Promise<void>;
44
- newsletterReactMessage: (jid: string, server_id: string, code?: string) => Promise<void>;
45
- newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
46
- newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
47
- groupQuery: (jid: string, type: "get" | "set", content: BinaryNode[]) => Promise<any>;
46
+ newsletterReactMessage: (jid: string, serverId: string, code?: string | undefined) => Promise<void>;
47
+ newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
48
+ newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
48
49
  groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
49
50
  groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
50
51
  groupLeave: (id: string) => Promise<void>;
@@ -52,7 +53,7 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
52
53
  groupRequestParticipantsList: (jid: string) => Promise<{
53
54
  [key: string]: string;
54
55
  }[]>;
55
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
56
+ groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
56
57
  status: string;
57
58
  jid: string;
58
59
  }[]>;
@@ -61,71 +62,68 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
61
62
  jid: string;
62
63
  content: BinaryNode;
63
64
  }[]>;
64
- groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
65
+ groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
65
66
  groupInviteCode: (jid: string) => Promise<string | undefined>;
66
67
  groupRevokeInvite: (jid: string) => Promise<string | undefined>;
67
68
  groupAcceptInvite: (code: string) => Promise<string | undefined>;
68
- groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
69
- groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
69
+ groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
70
70
  groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
71
71
  groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
72
- groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
73
- groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
72
+ groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
73
+ groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
74
74
  groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
75
75
  groupFetchAllParticipating: () => Promise<{
76
76
  [_: string]: import("../Types").GroupMetadata;
77
77
  }>;
78
- getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
79
78
  processingMutex: {
80
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
79
+ mutex<T>(code: () => T | Promise<T>): Promise<T>;
81
80
  };
82
- upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
81
+ upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
83
82
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
84
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
85
- presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
86
- profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
83
+ sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
84
+ presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
85
+ profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
87
86
  onWhatsApp: (...jids: string[]) => Promise<{
88
87
  jid: string;
89
88
  exists: unknown;
90
89
  lid: unknown;
91
90
  }[] | undefined>;
92
91
  fetchBlocklist: () => Promise<string[]>;
93
- fetchDisappearingDuration: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
94
- fetchStatus: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
92
+ fetchStatus: (jid: string) => Promise<{
93
+ status: string | undefined;
94
+ setAt: Date;
95
+ } | undefined>;
95
96
  updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
96
97
  removeProfilePicture: (jid: string) => Promise<void>;
97
98
  updateProfileStatus: (status: string) => Promise<void>;
98
99
  updateProfileName: (name: string) => Promise<void>;
99
100
  updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
100
- updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
101
- updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
102
101
  updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
103
102
  updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
104
103
  updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
105
104
  updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
106
105
  updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
107
- updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
106
+ updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
108
107
  updateDefaultDisappearingMode: (duration: number) => Promise<void>;
109
- getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
110
- resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
108
+ getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
109
+ resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
111
110
  chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
112
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
111
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
113
112
  addChatLabel: (jid: string, labelId: string) => Promise<void>;
114
113
  removeChatLabel: (jid: string, labelId: string) => Promise<void>;
115
114
  addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
116
115
  removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
117
116
  star: (jid: string, messages: {
118
117
  id: string;
119
- fromMe?: boolean;
118
+ fromMe?: boolean | undefined;
120
119
  }[], star: boolean) => Promise<void>;
121
- executeUSyncQuery: (usyncQuery: USyncQuery) => Promise<import("../WAUSync").USyncQueryResult | undefined>;
122
120
  type: "md";
123
- ws: import("./Client").WebSocketClient;
121
+ ws: any;
124
122
  ev: import("../Types").BaileysEventEmitter & {
125
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
123
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
126
124
  buffer(): void;
127
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
128
- flush(force?: boolean): boolean;
125
+ createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
126
+ flush(force?: boolean | undefined): boolean;
129
127
  isBuffering(): boolean;
130
128
  };
131
129
  authState: {
@@ -135,17 +133,17 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
135
133
  signalRepository: import("../Types").SignalRepository;
136
134
  user: import("../Types").Contact | undefined;
137
135
  generateMessageTag: () => string;
138
- query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
139
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
136
+ query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
137
+ waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
140
138
  waitForSocketOpen: () => Promise<void>;
141
139
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
142
140
  sendNode: (frame: BinaryNode) => Promise<void>;
143
- logout: (msg?: string) => Promise<void>;
141
+ logout: (msg?: string | undefined) => Promise<void>;
144
142
  end: (error: Error | undefined) => void;
145
- onUnexpectedError: (err: Error | Boom, msg: string) => void;
143
+ onUnexpectedError: (err: Error | Boom<any>, msg: string) => void;
146
144
  uploadPreKeys: (count?: number) => Promise<void>;
147
145
  uploadPreKeysToServerIfRequired: () => Promise<void>;
148
- requestPairingCode: (phoneNumber: any, pairKey?: string) => Promise<string>;
149
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
150
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
146
+ requestPairingCode: (phoneNumber: string) => Promise<string>;
147
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
148
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
151
149
  };