@oxidezap/baileyrs 0.3.7 → 0.3.9
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.
- package/README.md +56 -8
- package/lib/Bridge/history-sync-wire.d.ts +2 -2
- package/lib/Bridge/history-sync-wire.js +4 -4
- package/lib/Bridge/schema.js +7 -1
- package/lib/Bridge/types.d.ts +7 -1
- package/lib/Compatibility/auth-state.d.ts +30 -0
- package/lib/Compatibility/auth-state.js +96 -0
- package/lib/Compatibility/encode-proto-core.d.ts +31 -0
- package/lib/Compatibility/encode-proto-core.js +51 -0
- package/lib/Compatibility/encode-proto.d.ts +0 -29
- package/lib/Compatibility/encode-proto.js +3 -50
- package/lib/Compatibility/host-auth-state.d.ts +6 -0
- package/lib/Compatibility/host-auth-state.js +162 -0
- package/lib/Compatibility/internal/auth-state.d.ts +3 -7
- package/lib/Compatibility/internal/auth-state.js +34 -1
- package/lib/Compatibility/internal/host-auth-state.d.ts +4 -0
- package/lib/Compatibility/internal/host-auth-state.js +14 -0
- package/lib/Compatibility/legacy-store/device.js +5 -5
- package/lib/Compatibility/message-ids.d.ts +17 -0
- package/lib/Compatibility/message-ids.js +47 -0
- package/lib/Compatibility/message-relay.d.ts +2 -2
- package/lib/Compatibility/message-relay.js +4 -4
- package/lib/Compatibility/proto-runtime.js +33 -11
- package/lib/Compatibility/socket-results.d.ts +1 -1
- package/lib/Compatibility/tagged-message-waiter.d.ts +5 -2
- package/lib/Compatibility/tagged-message-waiter.js +5 -5
- package/lib/Compatibility/usync/adapter.d.ts +1 -1
- package/lib/Compatibility/websocket-client.d.ts +11 -3
- package/lib/Compatibility/websocket-client.js +84 -11
- package/lib/Defaults/index.d.ts +8 -8
- package/lib/Defaults/index.js +8 -8
- package/lib/Media/content.d.ts +28 -0
- package/lib/Media/content.js +129 -0
- package/lib/Media/core.d.ts +34 -0
- package/lib/Media/core.js +120 -0
- package/lib/Media/mutations.d.ts +24 -0
- package/lib/Media/mutations.js +38 -0
- package/lib/Runtime/aes-gcm.d.ts +4 -0
- package/lib/Runtime/aes-gcm.js +11 -0
- package/lib/Runtime/bridge.d.ts +44 -0
- package/lib/Runtime/bridge.js +76 -0
- package/lib/Runtime/buffer.d.ts +9 -0
- package/lib/Runtime/buffer.js +22 -0
- package/lib/Runtime/bytes.d.ts +61 -0
- package/lib/Runtime/bytes.js +270 -0
- package/lib/Runtime/host.d.ts +22 -0
- package/lib/Runtime/host.js +43 -0
- package/lib/Runtime/long.d.ts +33 -0
- package/lib/Runtime/long.js +64 -0
- package/lib/Runtime/node-media-processors.d.ts +4 -0
- package/lib/Runtime/node-media-processors.js +29 -0
- package/lib/Runtime/node-media.d.ts +28 -0
- package/lib/Runtime/node-media.js +115 -0
- package/lib/Runtime/node.d.ts +14 -0
- package/lib/Runtime/node.js +81 -0
- package/lib/Runtime/paths.d.ts +4 -0
- package/lib/Runtime/paths.js +7 -0
- package/lib/Runtime/stream.d.ts +11 -0
- package/lib/Runtime/stream.js +25 -0
- package/lib/Runtime/types.d.ts +98 -0
- package/lib/Runtime/types.js +13 -0
- package/lib/Socket/core.d.ts +312 -0
- package/lib/Socket/core.js +1134 -0
- package/lib/Socket/events-core.d.ts +75 -0
- package/lib/Socket/events-core.js +1058 -0
- package/lib/Socket/events.d.ts +1 -63
- package/lib/Socket/events.js +4 -1047
- package/lib/Socket/groups.js +4 -3
- package/lib/Socket/index.d.ts +521 -103
- package/lib/Socket/index.js +10 -1007
- package/lib/Socket/messages-core.d.ts +41 -0
- package/lib/Socket/messages-core.js +270 -0
- package/lib/Socket/messages.d.ts +9 -36
- package/lib/Socket/messages.js +3 -260
- package/lib/Socket/newsletter.js +3 -3
- package/lib/Socket/profile.js +1 -1
- package/lib/Socket/terminal-close-reporter.d.ts +2 -0
- package/lib/Socket/terminal-close-reporter.js +3 -3
- package/lib/Socket/transport.d.ts +2 -0
- package/lib/Socket/transport.js +16 -1
- package/lib/Socket/types.d.ts +2 -0
- package/lib/Types/Auth.d.ts +11 -0
- package/lib/Types/Message.d.ts +1 -1
- package/lib/Types/Socket.d.ts +2 -2
- package/lib/Types/index.d.ts +6 -1
- package/lib/Utils/browser-utils.d.ts +4 -0
- package/lib/Utils/browser-utils.js +53 -2
- package/lib/Utils/crypto.d.ts +1 -0
- package/lib/Utils/crypto.js +1 -0
- package/lib/Utils/event-buffer.d.ts +6 -1
- package/lib/Utils/event-buffer.js +28 -27
- package/lib/Utils/link-preview.d.ts +4 -3
- package/lib/Utils/logger.d.ts +3 -0
- package/lib/Utils/logger.js +35 -6
- package/lib/Utils/messages-core.d.ts +174 -0
- package/lib/Utils/messages-core.js +1042 -0
- package/lib/Utils/messages-media-core.d.ts +73 -0
- package/lib/Utils/messages-media-core.js +319 -0
- package/lib/Utils/messages-media.d.ts +1 -72
- package/lib/Utils/messages-media.js +9 -358
- package/lib/Utils/messages.d.ts +1 -166
- package/lib/Utils/messages.js +7 -1040
- package/lib/Utils/optional-peer.js +14 -5
- package/lib/Utils/process-history-message-core.d.ts +36 -0
- package/lib/Utils/process-history-message-core.js +187 -0
- package/lib/Utils/process-history-message.d.ts +5 -43
- package/lib/Utils/process-history-message.js +11 -197
- package/lib/Utils/process-message-core.d.ts +29 -0
- package/lib/Utils/process-message-core.js +112 -0
- package/lib/Utils/process-message.d.ts +4 -24
- package/lib/Utils/process-message.js +6 -111
- package/lib/WABinary/generic-utils.js +7 -5
- package/lib/host-shared.d.ts +74 -0
- package/lib/host-shared.js +15 -0
- package/lib/host-socket-operations.d.ts +3 -0
- package/lib/host-socket-operations.js +2 -0
- package/lib/host-surface.d.ts +21 -0
- package/lib/host-surface.js +35 -0
- package/lib/host-types.d.ts +356 -0
- package/lib/host-types.js +2 -0
- package/lib/host.d.ts +33 -0
- package/lib/host.js +31 -0
- package/lib/node-surface.d.ts +9 -0
- package/lib/node-surface.js +15 -0
- package/lib/surface.d.ts +5 -0
- package/lib/surface.js +6 -0
- package/lib/wasm.d.ts +27 -0
- package/lib/wasm.js +27 -0
- package/package.json +18 -6
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import type { WasmWhatsAppClient, UploadMediaResult } from '@oxidezap/whatsapp-rust-bridge/host';
|
|
2
|
+
import type { BaileysRuntime } from '../Runtime/types.js';
|
|
3
|
+
import { WebSocketClient } from '../Compatibility/websocket-client.js';
|
|
4
|
+
import { type MediaType } from '../Defaults/index.js';
|
|
5
|
+
import type { BinaryNode, AuthenticationCreds, ConnectionState, Contact, ReachoutTimelockState, SignalKeyStoreWithTransaction, HostSocketConfig, UserFacingSocketConfig, WABusinessProfile, WAMessage, WAMessageKey, WAPresence } from '../Types/index.js';
|
|
6
|
+
import type Long from 'long';
|
|
7
|
+
import { type MediaDownloadType } from '../Utils/messages-core.js';
|
|
8
|
+
import type { MediaDownloadOptions } from '../Utils/messages-media-core.js';
|
|
9
|
+
import type { proto } from '../WAProto/runtime.js';
|
|
10
|
+
import { createRuntimeLogger } from '../Utils/logger.js';
|
|
11
|
+
/** Build the ws EventEmitter with auto-enable raw node forwarding */
|
|
12
|
+
export declare const createWASocketFactory: (runtime: BaileysRuntime) => (config: UserFacingSocketConfig | HostSocketConfig) => ReturnType<typeof createWASocketFactoryInner>;
|
|
13
|
+
declare const createWASocketFactoryInner: (runtime: BaileysRuntime, config: UserFacingSocketConfig | HostSocketConfig, claimEngineInitialization: () => boolean, resetEngineInitialization: () => void, runtimeLogger: ReturnType<typeof createRuntimeLogger>) => {
|
|
14
|
+
sendMessageAck: (node: BinaryNode, errorCode?: number) => Promise<void>;
|
|
15
|
+
sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
16
|
+
updateBlockStatus: (jid: string, action: import("./blocking.js").BlockAction) => Promise<void>;
|
|
17
|
+
fetchBlocklist: () => Promise<Array<string | undefined>>;
|
|
18
|
+
getCatalog: ({ jid, limit, cursor }: import("../index.js").GetCatalogOptions) => Promise<import("../index.js").CatalogPage>;
|
|
19
|
+
getCollections: (jid?: string, limit?: number) => Promise<import("../index.js").CollectionsPage>;
|
|
20
|
+
getOrderDetails: (orderId: string, tokenBase64: string, sellerJid?: string) => Promise<import("@oxidezap/whatsapp-rust-bridge").OrderResult>;
|
|
21
|
+
updateBussinesProfile: (args: import("../Types/Bussines.js").UpdateBussinesProfileProps) => Promise<void>;
|
|
22
|
+
updateCoverPhoto: (photo: import("../index.js").WAMediaUpload) => Promise<never>;
|
|
23
|
+
removeCoverPhoto: (id: string) => Promise<void>;
|
|
24
|
+
productCreate: (create: import("../index.js").ProductCreate) => Promise<never>;
|
|
25
|
+
productUpdate: (productId: string, update: import("../index.js").ProductUpdate) => Promise<never>;
|
|
26
|
+
productDelete: (productIds: string[]) => Promise<never>;
|
|
27
|
+
pinChat: (jid: string, pin: boolean) => Promise<void>;
|
|
28
|
+
muteChat: (jid: string, muteUntil?: number | null) => Promise<void>;
|
|
29
|
+
archiveChat: (jid: string, archive: boolean) => Promise<void>;
|
|
30
|
+
starMessage: (jid: string, messageId: string, star: boolean) => Promise<void>;
|
|
31
|
+
chatModify: (mod: import("../index.js").ChatModification, jid: string) => Promise<void>;
|
|
32
|
+
addOrEditContact: (jid: string, contact: proto.SyncActionValue.IContactAction) => Promise<void>;
|
|
33
|
+
removeContact: (jid: string) => Promise<void>;
|
|
34
|
+
addLabel: (jid: string, labels: import("../Types/Label.js").LabelActionBody) => Promise<void>;
|
|
35
|
+
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
36
|
+
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
37
|
+
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
38
|
+
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
39
|
+
star: (jid: string, messages: {
|
|
40
|
+
id: string;
|
|
41
|
+
fromMe?: boolean;
|
|
42
|
+
}[], star: boolean) => Promise<void>;
|
|
43
|
+
addOrEditQuickReply: (quickReply: import("../Types/Bussines.js").QuickReplyAction) => Promise<void>;
|
|
44
|
+
removeQuickReply: (timestamp: string) => Promise<void>;
|
|
45
|
+
onWhatsApp: (...phoneNumber: string[]) => Promise<import("./contacts.js").OnWhatsAppResult[] | undefined>;
|
|
46
|
+
profilePictureUrl: (jid: string, type?: import("./contacts.js").ProfilePictureType, timeoutMs?: number) => Promise<string | undefined>;
|
|
47
|
+
fetchUserInfo: (...jids: string[]) => Promise<Record<string, import("@oxidezap/whatsapp-rust-bridge").UserInfoResult>>;
|
|
48
|
+
groupMetadata: (jid: string) => Promise<import("../index.js").GroupMetadata>;
|
|
49
|
+
groupCreate: (subject: string, participants: string[]) => Promise<import("../index.js").GroupMetadata>;
|
|
50
|
+
groupLeave: (id: string) => Promise<void>;
|
|
51
|
+
groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
|
|
52
|
+
groupRequestParticipantsList: (jid: string) => Promise<Array<Record<string, string>>>;
|
|
53
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: import("./groups.js").GroupRequestAction) => Promise<import("../Compatibility/socket-results.js").MembershipRequestUpdateResult[]>;
|
|
54
|
+
groupParticipantsUpdate: (jid: string, participants: string[], action: import("../index.js").ParticipantAction) => Promise<import("../Compatibility/socket-results.js").ParticipantUpdateResult[]>;
|
|
55
|
+
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
56
|
+
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
57
|
+
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
58
|
+
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
59
|
+
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
60
|
+
groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
61
|
+
groupGetInviteInfo: (code: string) => Promise<import("../index.js").GroupMetadata>;
|
|
62
|
+
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
63
|
+
groupSettingUpdate: (jid: string, setting: import("./groups.js").GroupSetting) => Promise<void>;
|
|
64
|
+
groupMemberAddMode: (jid: string, mode: import("./groups.js").MemberAddMode) => Promise<void>;
|
|
65
|
+
groupJoinApprovalMode: (jid: string, mode: import("./groups.js").JoinApprovalMode) => Promise<void>;
|
|
66
|
+
groupFetchAllParticipating: () => Promise<Record<string, import("../index.js").GroupMetadata>>;
|
|
67
|
+
updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
|
|
68
|
+
communityMetadata: (jid: string) => Promise<import("../index.js").GroupMetadata>;
|
|
69
|
+
communityCreate: (subject: string, body: string) => Promise<import("../index.js").GroupMetadata | null>;
|
|
70
|
+
communityCreateGroup: (subject: string, participants: string[], parentCommunityJid: string) => Promise<import("../index.js").GroupMetadata | null>;
|
|
71
|
+
communityLeave: (id: string) => Promise<void>;
|
|
72
|
+
communityUpdateSubject: (jid: string, subject: string) => Promise<void>;
|
|
73
|
+
communityLinkGroup: (groupJid: string, parentCommunityJid: string) => Promise<void>;
|
|
74
|
+
communityUnlinkGroup: (groupJid: string, parentCommunityJid: string) => Promise<void>;
|
|
75
|
+
communityFetchLinkedGroups: (jid: string) => Promise<{
|
|
76
|
+
communityJid: string;
|
|
77
|
+
isCommunity: boolean;
|
|
78
|
+
linkedGroups: {
|
|
79
|
+
id: string | undefined;
|
|
80
|
+
subject: string;
|
|
81
|
+
creation: number | undefined;
|
|
82
|
+
owner: string | undefined;
|
|
83
|
+
size: number | undefined;
|
|
84
|
+
}[];
|
|
85
|
+
}>;
|
|
86
|
+
communityRequestParticipantsList: (jid: string) => Promise<Array<Record<string, string>>>;
|
|
87
|
+
communityRequestParticipantsUpdate: (jid: string, participants: string[], action: import("./groups.js").GroupRequestAction) => Promise<import("../Compatibility/socket-results.js").MembershipRequestUpdateResult[]>;
|
|
88
|
+
communityParticipantsUpdate: (jid: string, participants: string[], action: import("../index.js").ParticipantAction) => Promise<import("../Compatibility/socket-results.js").ParticipantUpdateResult[]>;
|
|
89
|
+
communityUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
90
|
+
communityInviteCode: (jid: string) => Promise<string | undefined>;
|
|
91
|
+
communityRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
92
|
+
communityAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
93
|
+
communityRevokeInviteV4: (communityJid: string, invitedJid: string) => Promise<boolean>;
|
|
94
|
+
communityAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
95
|
+
communityGetInviteInfo: (code: string) => Promise<import("../index.js").GroupMetadata>;
|
|
96
|
+
communityToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
97
|
+
communitySettingUpdate: (jid: string, setting: import("./groups.js").GroupSetting) => Promise<void>;
|
|
98
|
+
communityMemberAddMode: (jid: string, mode: import("./groups.js").MemberAddMode) => Promise<void>;
|
|
99
|
+
communityJoinApprovalMode: (jid: string, mode: import("./groups.js").JoinApprovalMode) => Promise<void>;
|
|
100
|
+
communityFetchAllParticipating: () => Promise<Record<string, import("../index.js").GroupMetadata>>;
|
|
101
|
+
waitForSocketOpen: () => Promise<void>;
|
|
102
|
+
upsertMessage: (msg: WAMessage, type: import("../index.js").MessageUpsertType) => Promise<void>;
|
|
103
|
+
onUnexpectedError: (err: Error, msg: string) => void;
|
|
104
|
+
resyncAppState: (collections?: readonly ('critical_block' | 'critical_unblock_low' | 'regular_high' | 'regular_low' | 'regular')[], isInitialSync?: boolean) => Promise<void>;
|
|
105
|
+
updateServerTimeOffset: (node: BinaryNode) => never;
|
|
106
|
+
sendUnifiedSession: () => Promise<never>;
|
|
107
|
+
appPatch: (patchCreate: import("../index.js").WAPatchCreate) => Promise<never>;
|
|
108
|
+
messageRetryManager: null;
|
|
109
|
+
sendMessage: (jid: string, content: import("../index.js").AnyMessageContent, options?: Omit<import("../index.js").MessageGenerationOptions, 'waClient' | 'logger' | 'userJid' | 'mediaInNote'>) => Promise<WAMessage>;
|
|
110
|
+
updateMediaMessage: (message: WAMessage) => Promise<WAMessage>;
|
|
111
|
+
relayMessage: (jid: string, message: proto.IMessage, options: import("../index.js").MessageRelayOptions) => Promise<string>;
|
|
112
|
+
readMessages: (keys: WAMessageKey[]) => Promise<void>;
|
|
113
|
+
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../index.js").MessageReceiptType) => Promise<void>;
|
|
114
|
+
sendReceipts: (keys: WAMessageKey[], type: import("../index.js").MessageReceiptType) => Promise<void>;
|
|
115
|
+
requestPlaceholderResend: (messageKey: WAMessageKey, msgData?: Partial<WAMessage>) => Promise<string | undefined>;
|
|
116
|
+
newsletterCreate: (name: string, description?: string) => Promise<import("../index.js").NewsletterMetadata>;
|
|
117
|
+
newsletterMetadata: (type: import("./newsletter.js").NewsletterKeyType, key: string) => Promise<import("../index.js").NewsletterMetadata | null>;
|
|
118
|
+
newsletterUpdate: (jid: string, updates: import("../index.js").NewsletterUpdate) => Promise<import("../index.js").NewsletterMetadata>;
|
|
119
|
+
newsletterUpdateName: (jid: string, name: string) => Promise<import("../index.js").NewsletterMetadata>;
|
|
120
|
+
newsletterUpdateDescription: (jid: string, description: string) => Promise<import("../index.js").NewsletterMetadata>;
|
|
121
|
+
newsletterUpdatePicture: (jid: string, content: import("../index.js").WAMediaUpload) => Promise<import("../index.js").NewsletterMetadata>;
|
|
122
|
+
newsletterRemovePicture: (jid: string) => Promise<import("../index.js").NewsletterMetadata>;
|
|
123
|
+
newsletterFollow: (jid: string) => Promise<import("../index.js").NewsletterMetadata>;
|
|
124
|
+
newsletterUnfollow: (jid: string) => Promise<void>;
|
|
125
|
+
newsletterSubscribe: (jid: string) => Promise<import("@oxidezap/whatsapp-rust-bridge").NewsletterMetadataResult>;
|
|
126
|
+
newsletterUnsubscribe: (jid: string) => Promise<void>;
|
|
127
|
+
newsletterMute: (jid: string) => Promise<void>;
|
|
128
|
+
newsletterUnmute: (jid: string) => Promise<void>;
|
|
129
|
+
newsletterSubscribers: (jid: string) => Promise<{
|
|
130
|
+
subscribers: number;
|
|
131
|
+
}>;
|
|
132
|
+
newsletterReactMessage: (jid: string, serverId: string, reaction?: string) => Promise<void>;
|
|
133
|
+
newsletterFetchMessages: (jid: string, count: number, since?: number, after?: number) => Promise<import("@oxidezap/whatsapp-rust-bridge").NewsletterMessageResult[]>;
|
|
134
|
+
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
135
|
+
duration: string;
|
|
136
|
+
}>;
|
|
137
|
+
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
138
|
+
newsletterChangeOwner: (jid: string, newOwnerJid: string) => Promise<void>;
|
|
139
|
+
newsletterDemote: (jid: string, userJid: string) => Promise<void>;
|
|
140
|
+
newsletterDelete: (jid: string) => Promise<void>;
|
|
141
|
+
uploadPreKeys: (count?: number) => Promise<void>;
|
|
142
|
+
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
143
|
+
digestKeyBundle: () => Promise<void>;
|
|
144
|
+
rotateSignedPreKey: () => Promise<void>;
|
|
145
|
+
sendPresence: (status: import("../index.js").WAPresenceStatus) => Promise<void>;
|
|
146
|
+
presenceSubscribe: (toJid: string) => Promise<void>;
|
|
147
|
+
sendChatState: (jid: string, state: import("../index.js").WAChatState) => Promise<void>;
|
|
148
|
+
fetchPrivacySettings: (force?: boolean) => Promise<any>;
|
|
149
|
+
updatePrivacySetting: (category: string, value: string) => Promise<void>;
|
|
150
|
+
updateLastSeenPrivacy: (value: import("../index.js").WAPrivacyValue) => Promise<void>;
|
|
151
|
+
updateOnlinePrivacy: (value: import("../index.js").WAPrivacyOnlineValue) => Promise<void>;
|
|
152
|
+
updateProfilePicturePrivacy: (value: import("../index.js").WAPrivacyValue) => Promise<void>;
|
|
153
|
+
updateStatusPrivacy: (value: import("../index.js").WAPrivacyValue) => Promise<void>;
|
|
154
|
+
updateReadReceiptsPrivacy: (value: import("../index.js").WAReadReceiptsValue) => Promise<void>;
|
|
155
|
+
updateGroupsAddPrivacy: (value: import("../index.js").WAPrivacyGroupAddValue) => Promise<void>;
|
|
156
|
+
updateCallPrivacy: (value: import("../index.js").WAPrivacyCallValue) => Promise<void>;
|
|
157
|
+
updateMessagesPrivacy: (value: import("../index.js").WAPrivacyMessagesValue) => Promise<void>;
|
|
158
|
+
issuePrivacyTokens: (jids: string[], timestamp?: number) => Promise<void>;
|
|
159
|
+
refreshMediaConn: (forceGet?: boolean) => Promise<Omit<import("../index.js").MediaConnInfo, 'hosts'> & {
|
|
160
|
+
hosts: {
|
|
161
|
+
hostname: string;
|
|
162
|
+
}[];
|
|
163
|
+
}>;
|
|
164
|
+
getMediaHost: () => string;
|
|
165
|
+
getBotListV2: () => Promise<import("../index.js").BotListInfo[]>;
|
|
166
|
+
fetchNewChatMessageCap: () => Promise<import("../index.js").NewChatMessageCapInfo & {
|
|
167
|
+
remaining_quota?: number;
|
|
168
|
+
}>;
|
|
169
|
+
cleanDirtyBits: (type: import("./server-queries.js").DirtyBitType, fromTimestamp?: number | string) => Promise<void>;
|
|
170
|
+
sendPeerDataOperationMessage: (_pdoMessage: unknown) => Promise<never>;
|
|
171
|
+
createCallLink: (_type: 'audio' | 'video', _event?: unknown, _timeoutMs?: number) => Promise<never>;
|
|
172
|
+
requestPairingCode: (phoneNumber: string, customPairingCode?: string) => Promise<string>;
|
|
173
|
+
setPushName: (name: string) => Promise<void>;
|
|
174
|
+
updateProfileName: (name: string) => Promise<void>;
|
|
175
|
+
getPushName: () => Promise<string>;
|
|
176
|
+
getJid: () => Promise<string | undefined>;
|
|
177
|
+
getLid: () => Promise<string | undefined>;
|
|
178
|
+
updateProfilePicture: (jid: string, content: import("../index.js").WAMediaUpload, dimensions?: {
|
|
179
|
+
width: number;
|
|
180
|
+
height: number;
|
|
181
|
+
}) => Promise<void>;
|
|
182
|
+
removeProfilePicture: (jid: string) => Promise<void>;
|
|
183
|
+
updateProfileStatus: (status: string) => Promise<void>;
|
|
184
|
+
executeUSyncQuery: (usyncQuery: import("../index.js").USyncQuery) => Promise<import("../index.js").USyncQueryResult | undefined>;
|
|
185
|
+
fetchStatus: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
|
|
186
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
|
|
187
|
+
ev: import("../index.js").BaileysEventEmitter & {
|
|
188
|
+
process(handler: (events: Partial<import("../index.js").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
189
|
+
buffer(): void;
|
|
190
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (...args: A) => Promise<T>;
|
|
191
|
+
flush(): boolean;
|
|
192
|
+
isBuffering(): boolean;
|
|
193
|
+
destroy(): void;
|
|
194
|
+
};
|
|
195
|
+
logger: import("../Utils/logger.js").ILogger | import("../Utils/logger.js").Logger;
|
|
196
|
+
ws: WebSocketClient;
|
|
197
|
+
type: 'md';
|
|
198
|
+
/**
|
|
199
|
+
* `await using sock = makeWASocket(config)` — frees the wasm client on
|
|
200
|
+
* scope exit. Nothing else can: the bridge holds the JS event callbacks
|
|
201
|
+
* as wasm-bindgen externrefs and those callbacks reach back to this
|
|
202
|
+
* closure, so the reference cycle crosses the JS/wasm boundary and no
|
|
203
|
+
* `FinalizationRegistry` will ever fire for the client.
|
|
204
|
+
*
|
|
205
|
+
* Delegates to `end()`, so it flushes the auth store and is idempotent.
|
|
206
|
+
*
|
|
207
|
+
* Then awaits `initPromise`, because `end()` alone does not satisfy the
|
|
208
|
+
* async-disposal contract: called before `createWhatsAppClient()`
|
|
209
|
+
* settles, it sees `client === undefined`, frees nothing, and resolves
|
|
210
|
+
* while initialization is still running. What actually disposes that
|
|
211
|
+
* client is the `ended` guard inside `init()` — so code after the
|
|
212
|
+
* `await using` scope would otherwise overlap with bridge construction,
|
|
213
|
+
* event callbacks, and store access. `end()` runs first because it sets
|
|
214
|
+
* `ended` synchronously, which is what makes `init()` bail out early.
|
|
215
|
+
*
|
|
216
|
+
* The `finally` is load-bearing: `end()` rethrows the first auth-store
|
|
217
|
+
* flush failure, and letting that propagate directly would skip the wait
|
|
218
|
+
* and resolve the disposer with `init()` still in flight — losing the
|
|
219
|
+
* one guarantee it exists to provide, in exactly the situation where
|
|
220
|
+
* cleanup already went wrong. `initPromise` swallows its own failures,
|
|
221
|
+
* so awaiting it here cannot mask the flush error.
|
|
222
|
+
*/
|
|
223
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
224
|
+
user: Contact | undefined;
|
|
225
|
+
waClient: WasmWhatsAppClient | undefined;
|
|
226
|
+
isConnected: boolean;
|
|
227
|
+
isLoggedIn: boolean;
|
|
228
|
+
authState: {
|
|
229
|
+
creds: AuthenticationCreds;
|
|
230
|
+
keys: SignalKeyStoreWithTransaction;
|
|
231
|
+
};
|
|
232
|
+
devicesMutex: {
|
|
233
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
234
|
+
};
|
|
235
|
+
messageMutex: {
|
|
236
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
237
|
+
};
|
|
238
|
+
receiptMutex: {
|
|
239
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
240
|
+
};
|
|
241
|
+
appStatePatchMutex: {
|
|
242
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
243
|
+
};
|
|
244
|
+
notificationMutex: {
|
|
245
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
246
|
+
};
|
|
247
|
+
generateMessageTag: () => string;
|
|
248
|
+
sendNode: (frame: BinaryNode) => Promise<void>;
|
|
249
|
+
assertSessions: (jids: string[], force?: boolean) => Promise<boolean>;
|
|
250
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<any>;
|
|
251
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T | undefined>;
|
|
252
|
+
query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>;
|
|
253
|
+
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
254
|
+
/**
|
|
255
|
+
* `dsmMessage` is accepted so the signature matches upstream, and
|
|
256
|
+
* refused rather than ignored. Upstream uses it to encrypt a different
|
|
257
|
+
* plaintext for the caller's own other devices; the engine encrypts one
|
|
258
|
+
* payload for every recipient, so honouring it is not possible here and
|
|
259
|
+
* dropping it would send those devices the wrong message.
|
|
260
|
+
*/
|
|
261
|
+
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode['attrs'], dsmMessage?: proto.IMessage) => Promise<{
|
|
262
|
+
nodes: BinaryNode[];
|
|
263
|
+
shouldIncludeDeviceIdentity: boolean;
|
|
264
|
+
}>;
|
|
265
|
+
signalRepository: import("../index.js").SignalRepositoryWithLIDStore;
|
|
266
|
+
end: (error: Error | undefined) => Promise<void>;
|
|
267
|
+
logout: (msg?: string) => Promise<void>;
|
|
268
|
+
registerSocketEndHandler: (handler: (error: Error | undefined) => void | Promise<void>) => void;
|
|
269
|
+
waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
|
|
270
|
+
setAutoReconnect: (enabled: boolean) => void;
|
|
271
|
+
/**
|
|
272
|
+
* Update presence either globally (`available`/`unavailable`) or per-chat
|
|
273
|
+
* (`composing`/`recording`/`paused`), matching upstream Baileys' overload.
|
|
274
|
+
* Chat-state updates require `toJid`; omitting it raises `Boom(400)` so the
|
|
275
|
+
* caller hears about the protocol mistake instead of the bridge silently
|
|
276
|
+
* sending nothing.
|
|
277
|
+
*/
|
|
278
|
+
sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>;
|
|
279
|
+
/**
|
|
280
|
+
* Plaintext media upload helper, source-compatible with the upstream
|
|
281
|
+
* Baileys `sock.waUploadToServer(buf, { mediaType })` shape so existing
|
|
282
|
+
* callers (or `prepareWAMessageMedia(msg, { upload: sock.waUploadToServer })`)
|
|
283
|
+
* keep working. Delegates to the bridge's encrypt + CDN-failover upload.
|
|
284
|
+
*/
|
|
285
|
+
waUploadToServer: (data: Uint8Array | Buffer, opts: {
|
|
286
|
+
mediaType: MediaType;
|
|
287
|
+
}) => Promise<UploadMediaResult>;
|
|
288
|
+
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
289
|
+
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
290
|
+
/**
|
|
291
|
+
* Fetch the account's current reachout-timelock state from the server.
|
|
292
|
+
*
|
|
293
|
+
* The same state is also pushed proactively via the
|
|
294
|
+
* `NotificationUserReachoutTimelockUpdate` MEX notification, which is
|
|
295
|
+
* surfaced on `connection.update.reachoutTimeLock` automatically. Use
|
|
296
|
+
* this method to query on demand (e.g. on app start, or after a 463
|
|
297
|
+
* nack hints that the timelock just kicked in).
|
|
298
|
+
*
|
|
299
|
+
* Emits the result on `connection.update.reachoutTimeLock` as a side
|
|
300
|
+
* effect for parity with the push path. Returns the same state for
|
|
301
|
+
* callers that prefer awaiting.
|
|
302
|
+
*/
|
|
303
|
+
fetchReachoutTimelock: () => Promise<ReachoutTimelockState>;
|
|
304
|
+
/** Upstream Baileys-compatible name. */
|
|
305
|
+
fetchAccountReachoutTimelock: () => Promise<ReachoutTimelockState>;
|
|
306
|
+
getBusinessProfile: (jid: string) => Promise<WABusinessProfile | void>;
|
|
307
|
+
fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
|
|
308
|
+
sendStatusMessage: (message: Record<string, unknown>, recipients: string[]) => Promise<string>;
|
|
309
|
+
downloadMedia: <T extends MediaDownloadType>(message: WAMessage, type: T, options?: MediaDownloadOptions) => Promise<T extends "buffer" ? Buffer<ArrayBufferLike> : import("node:stream").Readable>;
|
|
310
|
+
};
|
|
311
|
+
export {};
|
|
312
|
+
//# sourceMappingURL=core.d.ts.map
|