@denzy-official/baileys 1.0.8 → 1.1.1

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 (96) hide show
  1. package/lib/Socket/dugong.js +44 -3
  2. package/lib/Socket/messages-send.js +3 -1
  3. package/package.json +1 -1
  4. package/WAProto/index.d.ts +0 -55058
  5. package/WAProto/index.js +0 -169662
  6. package/WAProto/index.ts.ts +0 -53474
  7. package/lib/Defaults/index.d.ts +0 -52
  8. package/lib/Signal/Group/ciphertext-message.d.ts +0 -10
  9. package/lib/Signal/Group/group-session-builder.d.ts +0 -15
  10. package/lib/Signal/Group/group_cipher.d.ts +0 -18
  11. package/lib/Signal/Group/index.d.ts +0 -12
  12. package/lib/Signal/Group/keyhelper.d.ts +0 -11
  13. package/lib/Signal/Group/queue-job.d.ts +0 -2
  14. package/lib/Signal/Group/sender-chain-key.d.ts +0 -14
  15. package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -17
  16. package/lib/Signal/Group/sender-key-message.d.ts +0 -19
  17. package/lib/Signal/Group/sender-key-name.d.ts +0 -18
  18. package/lib/Signal/Group/sender-key-record.d.ts +0 -31
  19. package/lib/Signal/Group/sender-key-state.d.ts +0 -39
  20. package/lib/Signal/Group/sender-message-key.d.ts +0 -12
  21. package/lib/Signal/libsignal.d.ts +0 -4
  22. package/lib/Socket/Client/index.d.ts +0 -3
  23. package/lib/Socket/Client/types.d.ts +0 -17
  24. package/lib/Socket/Client/websocket.d.ts +0 -14
  25. package/lib/Socket/business.d.ts +0 -173
  26. package/lib/Socket/chats.d.ts +0 -83
  27. package/lib/Socket/dugong.d.ts +0 -220
  28. package/lib/Socket/groups.d.ts +0 -125
  29. package/lib/Socket/index.d.ts +0 -173
  30. package/lib/Socket/messages-recv.d.ts +0 -162
  31. package/lib/Socket/messages-send.d.ts +0 -152
  32. package/lib/Socket/newsletter.d.ts +0 -137
  33. package/lib/Socket/socket.d.ts +0 -44
  34. package/lib/Socket/usync.d.ts +0 -37
  35. package/lib/Store/index.d.ts +0 -3
  36. package/lib/Store/make-in-memory-store.d.ts +0 -119
  37. package/lib/Store/make-ordered-dictionary.d.ts +0 -14
  38. package/lib/Store/object-repository.d.ts +0 -11
  39. package/lib/Types/Auth.d.ts +0 -104
  40. package/lib/Types/Call.d.ts +0 -14
  41. package/lib/Types/Chat.d.ts +0 -110
  42. package/lib/Types/Contact.d.ts +0 -24
  43. package/lib/Types/Events.d.ts +0 -200
  44. package/lib/Types/GroupMetadata.d.ts +0 -65
  45. package/lib/Types/Label.d.ts +0 -36
  46. package/lib/Types/LabelAssociation.d.ts +0 -30
  47. package/lib/Types/Message.d.ts +0 -401
  48. package/lib/Types/Newsletter.d.ts +0 -80
  49. package/lib/Types/Product.d.ts +0 -78
  50. package/lib/Types/Signal.d.ts +0 -57
  51. package/lib/Types/Socket.d.ts +0 -119
  52. package/lib/Types/State.d.ts +0 -27
  53. package/lib/Types/USync.d.ts +0 -25
  54. package/lib/Types/index.d.ts +0 -65
  55. package/lib/Utils/auth-utils.d.ts +0 -19
  56. package/lib/Utils/baileys-event-stream.d.ts +0 -17
  57. package/lib/Utils/business.d.ts +0 -23
  58. package/lib/Utils/chat-utils.d.ts +0 -71
  59. package/lib/Utils/crypto.d.ts +0 -41
  60. package/lib/Utils/decode-wa-message.d.ts +0 -36
  61. package/lib/Utils/event-buffer.d.ts +0 -36
  62. package/lib/Utils/generics.d.ts +0 -90
  63. package/lib/Utils/history.d.ts +0 -20
  64. package/lib/Utils/index.d.ts +0 -18
  65. package/lib/Utils/link-preview.d.ts +0 -21
  66. package/lib/Utils/logger.d.ts +0 -11
  67. package/lib/Utils/lt-hash.d.ts +0 -12
  68. package/lib/Utils/make-mutex.d.ts +0 -7
  69. package/lib/Utils/messages-media.d.ts +0 -120
  70. package/lib/Utils/messages.d.ts +0 -75
  71. package/lib/Utils/noise-handler.d.ts +0 -19
  72. package/lib/Utils/process-message.d.ts +0 -42
  73. package/lib/Utils/signal.d.ts +0 -33
  74. package/lib/Utils/use-multi-file-auth-state.d.ts +0 -12
  75. package/lib/Utils/validate-connection.d.ts +0 -10
  76. package/lib/WABinary/constants.d.ts +0 -28
  77. package/lib/WABinary/decode.d.ts +0 -7
  78. package/lib/WABinary/encode.d.ts +0 -3
  79. package/lib/WABinary/generic-utils.d.ts +0 -15
  80. package/lib/WABinary/index.d.ts +0 -6
  81. package/lib/WABinary/jid-utils.d.ts +0 -37
  82. package/lib/WABinary/types.d.ts +0 -19
  83. package/lib/WAM/BinaryInfo.d.ts +0 -9
  84. package/lib/WAM/constants.d.ts +0 -39
  85. package/lib/WAM/encode.d.ts +0 -3
  86. package/lib/WAM/index.d.ts +0 -4
  87. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -9
  88. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -22
  89. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -12
  90. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -12
  91. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -25
  92. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -8
  93. package/lib/WAUSync/Protocols/index.d.ts +0 -4
  94. package/lib/WAUSync/USyncQuery.d.ts +0 -28
  95. package/lib/WAUSync/USyncUser.d.ts +0 -12
  96. package/lib/WAUSync/index.d.ts +0 -3
@@ -1,162 +0,0 @@
1
- // baileys by denzy
2
- import Long = require('long');
3
- import { Boom } from '@hapi/boom';
4
- import { proto } from '../../WAProto';
5
- import { MessageReceiptType, MessageRelayOptions, SocketConfig, WAMessageKey } from '../Types';
6
- import { BinaryNode } from '../WABinary';
7
- export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
8
- sendMessageAck: ({ tag, attrs, content }: BinaryNode, errorCode?: number) => Promise<void>;
9
- sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
10
- rejectCall: (callId: string, callFrom: string) => Promise<void>;
11
- offerCall: (toJid: string, isVideo?: boolean) => Promise<{
12
- callId: string;
13
- toJid: string;
14
- isVideo: boolean;
15
- }>;
16
- fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
17
- requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<string | undefined>;
18
- getPrivacyTokens: (jids: string[]) => Promise<any>;
19
- assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
20
- relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
21
- sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
22
- sendReceipts: (keys: WAMessageKey[], type: MessageReceiptType) => Promise<void>;
23
- readMessages: (keys: WAMessageKey[]) => Promise<void>;
24
- refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
25
- waUploadToServer: import("../Types").WAMediaUploadFunction;
26
- fetchPrivacySettings: (force?: boolean) => Promise<{
27
- [_: string]: string;
28
- }>;
29
- getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
30
- createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
31
- nodes: BinaryNode[];
32
- shouldIncludeDeviceIdentity: boolean;
33
- }>;
34
- sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
35
- updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
36
- sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo>;
37
- subscribeNewsletterUpdates: (jid: string) => Promise<{
38
- duration: string;
39
- }>;
40
- newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
41
- newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
42
- newsletterUpdateName: (jid: string, name: string) => Promise<void>;
43
- newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
44
- newsletterRemovePicture: (jid: string) => Promise<void>;
45
- newsletterUnfollow: (jid: string) => Promise<void>;
46
- newsletterFollow: (jid: string) => Promise<void>;
47
- newsletterUnmute: (jid: string) => Promise<void>;
48
- newsletterMute: (jid: string) => Promise<void>;
49
- newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>;
50
- newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
51
- newsletterAdminCount: (jid: string) => Promise<number>;
52
- newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
53
- newsletterDemote: (jid: string, user: string) => Promise<void>;
54
- newsletterDelete: (jid: string) => Promise<void>;
55
- newsletterReactMessage: (jid: string, server_id: string, code?: string) => Promise<void>;
56
- newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
57
- newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
58
- groupQuery: (jid: string, type: "get" | "set", content: BinaryNode[]) => Promise<any>;
59
- groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
60
- groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
61
- groupLeave: (id: string) => Promise<void>;
62
- groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
63
- groupRequestParticipantsList: (jid: string) => Promise<{
64
- [key: string]: string;
65
- }[]>;
66
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
67
- status: string;
68
- jid: string;
69
- }[]>;
70
- groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
71
- status: string;
72
- jid: string;
73
- content: BinaryNode;
74
- }[]>;
75
- groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
76
- groupInviteCode: (jid: string) => Promise<string | undefined>;
77
- groupRevokeInvite: (jid: string) => Promise<string | undefined>;
78
- groupAcceptInvite: (code: string) => Promise<string | undefined>;
79
- groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
80
- groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
81
- groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
82
- groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
83
- groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
84
- groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
85
- groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
86
- groupFetchAllParticipating: () => Promise<{
87
- [_: string]: import("../Types").GroupMetadata;
88
- }>;
89
- getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
90
- processingMutex: {
91
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
92
- };
93
- upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
94
- appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
95
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
96
- presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
97
- profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
98
- onWhatsApp: (...jids: string[]) => Promise<{
99
- jid: string;
100
- exists: unknown;
101
- lid: unknown;
102
- }[] | undefined>;
103
- fetchBlocklist: () => Promise<string[]>;
104
- fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
105
- fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
106
- updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
107
- removeProfilePicture: (jid: string) => Promise<void>;
108
- updateProfileStatus: (status: string) => Promise<void>;
109
- updateProfileName: (name: string) => Promise<void>;
110
- updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
111
- updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
112
- updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
113
- updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
114
- updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
115
- updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
116
- updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
117
- updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
118
- updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
119
- updateDefaultDisappearingMode: (duration: number) => Promise<void>;
120
- getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
121
- resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
122
- chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
123
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
124
- addChatLabel: (jid: string, labelId: string) => Promise<void>;
125
- removeChatLabel: (jid: string, labelId: string) => Promise<void>;
126
- addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
127
- removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
128
- star: (jid: string, messages: {
129
- id: string;
130
- fromMe?: boolean;
131
- }[], star: boolean) => Promise<void>;
132
- executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
133
- type: "md";
134
- ws: import("./Client").WebSocketClient;
135
- ev: import("../Types").BaileysEventEmitter & {
136
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
137
- buffer(): void;
138
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
139
- flush(force?: boolean): boolean;
140
- isBuffering(): boolean;
141
- };
142
- authState: {
143
- creds: import("../Types").AuthenticationCreds;
144
- keys: import("../Types").SignalKeyStoreWithTransaction;
145
- };
146
- signalRepository: import("../Types").SignalRepository;
147
- user: import("../Types").Contact | undefined;
148
- generateMessageTag: () => string;
149
- query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
150
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
151
- waitForSocketOpen: () => Promise<void>;
152
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
153
- sendNode: (frame: BinaryNode) => Promise<void>;
154
- logout: (msg?: string) => Promise<void>;
155
- end: (error: Error | undefined) => void;
156
- onUnexpectedError: (err: Error | Boom, msg: string) => void;
157
- uploadPreKeys: (count?: number) => Promise<void>;
158
- uploadPreKeysToServerIfRequired: () => Promise<void>;
159
- requestPairingCode: (phoneNumber: any, pairKey?: string) => Promise<string>;
160
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
161
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
162
- };
@@ -1,152 +0,0 @@
1
- // baileys by denzy
2
- import { Boom } from '@hapi/boom';
3
- import { proto } from '../../WAProto';
4
- import { AnyMessageContent, MediaConnInfo, MessageReceiptType, MessageRelayOptions, MiscMessageGenerationOptions, SocketConfig, WAMessageKey } from '../Types';
5
- import { BinaryNode, JidWithDevice } from '../WABinary';
6
- import { USyncQuery } from '../WAUSync';
7
- export declare const makeMessagesSocket: (config: SocketConfig) => {
8
- getPrivacyTokens: (jids: string[]) => Promise<any>;
9
- assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
10
- relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
11
- sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
12
- sendReceipts: (keys: WAMessageKey[], type: MessageReceiptType) => Promise<void>;
13
- readMessages: (keys: WAMessageKey[]) => Promise<void>;
14
- refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>;
15
- waUploadToServer: import("../Types").WAMediaUploadFunction;
16
- fetchPrivacySettings: (force?: boolean) => Promise<{
17
- [_: string]: string;
18
- }>;
19
- getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<JidWithDevice[]>;
20
- createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
21
- nodes: BinaryNode[];
22
- shouldIncludeDeviceIdentity: boolean;
23
- }>;
24
- sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
25
- updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
26
- sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo>;
27
- subscribeNewsletterUpdates: (jid: string) => Promise<{
28
- duration: string;
29
- }>;
30
- newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
31
- newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
32
- newsletterUpdateName: (jid: string, name: string) => Promise<void>;
33
- newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
34
- newsletterRemovePicture: (jid: string) => Promise<void>;
35
- newsletterUnfollow: (jid: string) => Promise<void>;
36
- newsletterFollow: (jid: string) => Promise<void>;
37
- newsletterUnmute: (jid: string) => Promise<void>;
38
- newsletterMute: (jid: string) => Promise<void>;
39
- newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>;
40
- newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
41
- newsletterAdminCount: (jid: string) => Promise<number>;
42
- newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
43
- newsletterDemote: (jid: string, user: string) => Promise<void>;
44
- newsletterDelete: (jid: string) => Promise<void>;
45
- newsletterReactMessage: (jid: string, server_id: string, code?: string) => Promise<void>;
46
- newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
47
- newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
48
- groupQuery: (jid: string, type: "get" | "set", content: BinaryNode[]) => Promise<any>;
49
- groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
50
- groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
51
- groupLeave: (id: string) => Promise<void>;
52
- groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
53
- groupRequestParticipantsList: (jid: string) => Promise<{
54
- [key: string]: string;
55
- }[]>;
56
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
57
- status: string;
58
- jid: string;
59
- }[]>;
60
- groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
61
- status: string;
62
- jid: string;
63
- content: BinaryNode;
64
- }[]>;
65
- groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
66
- groupInviteCode: (jid: string) => Promise<string | undefined>;
67
- groupRevokeInvite: (jid: string) => Promise<string | undefined>;
68
- groupAcceptInvite: (code: string) => Promise<string | undefined>;
69
- groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
70
- groupAcceptInviteV4: (key: string | WAMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
71
- groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
72
- groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
73
- groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
74
- groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
75
- groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
76
- groupFetchAllParticipating: () => Promise<{
77
- [_: string]: import("../Types").GroupMetadata;
78
- }>;
79
- getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
80
- processingMutex: {
81
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
82
- };
83
- upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
84
- appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
85
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
86
- presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
87
- profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
88
- onWhatsApp: (...jids: string[]) => Promise<{
89
- jid: string;
90
- exists: unknown;
91
- lid: unknown;
92
- }[] | undefined>;
93
- fetchBlocklist: () => Promise<string[]>;
94
- fetchDisappearingDuration: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
95
- fetchStatus: (...jids: string[]) => Promise<import("../WAUSync").USyncQueryResultList[] | undefined>;
96
- updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
97
- removeProfilePicture: (jid: string) => Promise<void>;
98
- updateProfileStatus: (status: string) => Promise<void>;
99
- updateProfileName: (name: string) => Promise<void>;
100
- updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
101
- updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
102
- updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
103
- updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
104
- updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
105
- updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
106
- updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
107
- updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
108
- updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
109
- updateDefaultDisappearingMode: (duration: number) => Promise<void>;
110
- getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
111
- resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
112
- chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
113
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
114
- addChatLabel: (jid: string, labelId: string) => Promise<void>;
115
- removeChatLabel: (jid: string, labelId: string) => Promise<void>;
116
- addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
117
- removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
118
- star: (jid: string, messages: {
119
- id: string;
120
- fromMe?: boolean;
121
- }[], star: boolean) => Promise<void>;
122
- executeUSyncQuery: (usyncQuery: USyncQuery) => Promise<import("../WAUSync").USyncQueryResult | undefined>;
123
- type: "md";
124
- ws: import("./Client").WebSocketClient;
125
- ev: import("../Types").BaileysEventEmitter & {
126
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
127
- buffer(): void;
128
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
129
- flush(force?: boolean): boolean;
130
- isBuffering(): boolean;
131
- };
132
- authState: {
133
- creds: import("../Types").AuthenticationCreds;
134
- keys: import("../Types").SignalKeyStoreWithTransaction;
135
- };
136
- signalRepository: import("../Types").SignalRepository;
137
- user: import("../Types").Contact | undefined;
138
- generateMessageTag: () => string;
139
- query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
140
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
141
- waitForSocketOpen: () => Promise<void>;
142
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
143
- sendNode: (frame: BinaryNode) => Promise<void>;
144
- logout: (msg?: string) => Promise<void>;
145
- end: (error: Error | undefined) => void;
146
- onUnexpectedError: (err: Error | Boom, msg: string) => void;
147
- uploadPreKeys: (count?: number) => Promise<void>;
148
- uploadPreKeysToServerIfRequired: () => Promise<void>;
149
- requestPairingCode: (phoneNumber: any, pairKey?: string) => Promise<string>;
150
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
151
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
152
- };
@@ -1,137 +0,0 @@
1
- // baileys by denzy
2
- import { SocketConfig, WAMediaUpload, NewsletterMetadata, NewsletterReactionMode, NewsletterViewRole, NewsletterFetchedUpdate } from '../Types';
3
- import { BinaryNode } from '../WABinary';
4
- export declare const makeNewsletterSocket: (config: SocketConfig) => {
5
- subscribeNewsletterUpdates: (jid: string) => Promise<{
6
- duration: string;
7
- }>;
8
- newsletterReactionMode: (jid: string, mode: NewsletterReactionMode) => Promise<void>;
9
- newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
10
- newsletterUpdateName: (jid: string, name: string) => Promise<void>;
11
- newsletterUpdatePicture: (jid: string, content: WAMediaUpload) => Promise<void>;
12
- newsletterRemovePicture: (jid: string) => Promise<void>;
13
- newsletterUnfollow: (jid: string) => Promise<void>;
14
- newsletterFollow: (jid: string) => Promise<void>;
15
- newsletterUnmute: (jid: string) => Promise<void>;
16
- newsletterMute: (jid: string) => Promise<void>;
17
- newsletterCreate: (name: string, description?: string, picture?: WAMediaUpload) => Promise<NewsletterMetadata>;
18
- newsletterMetadata: (type: "invite" | "jid", key: string, role?: NewsletterViewRole) => Promise<NewsletterMetadata>;
19
- newsletterAdminCount: (jid: string) => Promise<number>;
20
- /**user is Lid, not Jid */
21
- newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
22
- /**user is Lid, not Jid */
23
- newsletterDemote: (jid: string, user: string) => Promise<void>;
24
- newsletterDelete: (jid: string) => Promise<void>;
25
- /**if code wasn't passed, the reaction will be removed (if is reacted) */
26
- newsletterReactMessage: (jid: string, server_id: string, code?: string) => Promise<void>;
27
- newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<NewsletterFetchedUpdate[]>;
28
- newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<NewsletterFetchedUpdate[]>;
29
- groupQuery: (jid: string, type: "get" | "set", content: BinaryNode[]) => Promise<any>;
30
- groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
31
- groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
32
- groupLeave: (id: string) => Promise<void>;
33
- groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
34
- groupRequestParticipantsList: (jid: string) => Promise<{
35
- [key: string]: string;
36
- }[]>;
37
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
38
- status: string;
39
- jid: string;
40
- }[]>;
41
- groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
42
- status: string;
43
- jid: string;
44
- content: BinaryNode;
45
- }[]>;
46
- groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
47
- groupInviteCode: (jid: string) => Promise<string | undefined>;
48
- groupRevokeInvite: (jid: string) => Promise<string | undefined>;
49
- groupAcceptInvite: (code: string) => Promise<string | undefined>;
50
- groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
51
- groupAcceptInviteV4: (key: string | import("../Types").WAMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<any>;
52
- groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
53
- groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
54
- groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
55
- groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
56
- groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
57
- groupFetchAllParticipating: () => Promise<{
58
- [_: string]: import("../Types").GroupMetadata;
59
- }>;
60
- getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
61
- processingMutex: {
62
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
63
- };
64
- fetchPrivacySettings: (force?: boolean) => Promise<{
65
- [_: string]: string;
66
- }>;
67
- upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
68
- appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
69
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
70
- presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
71
- profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
72
- onWhatsApp: (...jids: string[]) => Promise<{
73
- jid: string;
74
- exists: unknown;
75
- lid: unknown;
76
- }[] | undefined>;
77
- fetchBlocklist: () => Promise<string[]>;
78
- fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
79
- fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
80
- updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>;
81
- removeProfilePicture: (jid: string) => Promise<void>;
82
- updateProfileStatus: (status: string) => Promise<void>;
83
- updateProfileName: (name: string) => Promise<void>;
84
- updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
85
- updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
86
- updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
87
- updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
88
- updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
89
- updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
90
- updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
91
- updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
92
- updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
93
- updateDefaultDisappearingMode: (duration: number) => Promise<void>;
94
- getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
95
- resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
96
- chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
97
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
98
- addChatLabel: (jid: string, labelId: string) => Promise<void>;
99
- removeChatLabel: (jid: string, labelId: string) => Promise<void>;
100
- addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
101
- removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
102
- star: (jid: string, messages: {
103
- id: string;
104
- fromMe?: boolean;
105
- }[], star: boolean) => Promise<void>;
106
- executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
107
- type: "md";
108
- ws: import("./Client").WebSocketClient;
109
- ev: import("../Types").BaileysEventEmitter & {
110
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
111
- buffer(): void;
112
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
113
- flush(force?: boolean): boolean;
114
- isBuffering(): boolean;
115
- };
116
- authState: {
117
- creds: import("../Types").AuthenticationCreds;
118
- keys: import("../Types").SignalKeyStoreWithTransaction;
119
- };
120
- signalRepository: import("../Types").SignalRepository;
121
- user: import("../Types").Contact | undefined;
122
- generateMessageTag: () => string;
123
- query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
124
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
125
- waitForSocketOpen: () => Promise<void>;
126
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
127
- sendNode: (frame: BinaryNode) => Promise<void>;
128
- logout: (msg?: string) => Promise<void>;
129
- end: (error: Error | undefined) => void;
130
- onUnexpectedError: (err: Error | import("@hapi/boom").Boom, msg: string) => void;
131
- uploadPreKeys: (count?: number) => Promise<void>;
132
- uploadPreKeysToServerIfRequired: () => Promise<void>;
133
- requestPairingCode: (phoneNumber: any, pairKey?: string) => Promise<string>;
134
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
135
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
136
- };
137
- export declare const extractNewsletterMetadata: (node: BinaryNode, isCreate?: boolean) => NewsletterMetadata;
@@ -1,44 +0,0 @@
1
- // baileys by denzy
2
- import { Boom } from '@hapi/boom';
3
- import { SocketConfig } from '../Types';
4
- import { BinaryNode } from '../WABinary';
5
- import { WebSocketClient } from './Client';
6
- /**
7
- * Connects to WA servers and performs:
8
- * - simple queries (no retry mechanism, wait for connection establishment)
9
- * - listen to messages and emit events
10
- * - query phone connection
11
- */
12
- export declare const makeSocket: (config: SocketConfig) => {
13
- type: "md";
14
- ws: WebSocketClient;
15
- ev: import("../Types").BaileysEventEmitter & {
16
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
17
- buffer(): void;
18
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
19
- flush(force?: boolean): boolean;
20
- isBuffering(): boolean;
21
- };
22
- authState: {
23
- creds: import("../Types").AuthenticationCreds;
24
- keys: import("../Types").SignalKeyStoreWithTransaction;
25
- };
26
- signalRepository: import("../Types").SignalRepository;
27
- readonly user: import("../Types").Contact | undefined;
28
- generateMessageTag: () => string;
29
- query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
30
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
31
- waitForSocketOpen: () => Promise<void>;
32
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
33
- sendNode: (frame: BinaryNode) => Promise<void>;
34
- logout: (msg?: string) => Promise<void>;
35
- end: (error: Error | undefined) => void;
36
- onUnexpectedError: (err: Error | Boom, msg: string) => void;
37
- uploadPreKeys: (count?: number) => Promise<void>;
38
- uploadPreKeysToServerIfRequired: () => Promise<void>;
39
- requestPairingCode: (phoneNumber: any, pairKey?: string) => Promise<string>;
40
- /** Waits for the connection to WA to reach a state */
41
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
42
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
43
- };
44
- export type Socket = ReturnType<typeof makeSocket>;
@@ -1,37 +0,0 @@
1
- // baileys by denzy
2
- import { Boom } from '@hapi/boom';
3
- import { SocketConfig } from '../Types';
4
- import { BinaryNode } from '../WABinary';
5
- import { USyncQuery } from '../WAUSync';
6
- export declare const makeUSyncSocket: (config: SocketConfig) => {
7
- executeUSyncQuery: (usyncQuery: USyncQuery) => Promise<import("../WAUSync").USyncQueryResult | undefined>;
8
- type: "md";
9
- ws: import("./Client").WebSocketClient;
10
- ev: import("../Types").BaileysEventEmitter & {
11
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
12
- buffer(): void;
13
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
14
- flush(force?: boolean): boolean;
15
- isBuffering(): boolean;
16
- };
17
- authState: {
18
- creds: import("../Types").AuthenticationCreds;
19
- keys: import("../Types").SignalKeyStoreWithTransaction;
20
- };
21
- signalRepository: import("../Types").SignalRepository;
22
- user: import("../Types").Contact | undefined;
23
- generateMessageTag: () => string;
24
- query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
25
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
26
- waitForSocketOpen: () => Promise<void>;
27
- sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
28
- sendNode: (frame: BinaryNode) => Promise<void>;
29
- logout: (msg?: string) => Promise<void>;
30
- end: (error: Error | undefined) => void;
31
- onUnexpectedError: (err: Error | Boom, msg: string) => void;
32
- uploadPreKeys: (count?: number) => Promise<void>;
33
- uploadPreKeysToServerIfRequired: () => Promise<void>;
34
- requestPairingCode: (phoneNumber: any, pairKey?: string) => Promise<string>;
35
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
36
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
37
- };
@@ -1,3 +0,0 @@
1
- // baileys by denzy
2
- import makeInMemoryStore from './make-in-memory-store';
3
- export { makeInMemoryStore };