@alannxd/baileys 6.0.3 → 6.0.5
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/WAProto/GenerateStatics.sh +3 -0
- package/WAProto/WAProto.proto +5479 -0
- package/WAProto/fix-imports.js +85 -0
- package/WAProto/index.d.ts +14017 -0
- package/WAProto/index.js +201 -160
- package/engine-requirements.js +1 -1
- package/lib/Defaults/index.d.ts +37 -15
- package/lib/Defaults/index.js +119 -136
- package/lib/Signal/Group/ciphertext-message.d.ts +1 -0
- package/lib/Signal/Group/ciphertext-message.js +2 -5
- package/lib/Signal/Group/group-session-builder.d.ts +4 -3
- package/lib/Signal/Group/group-session-builder.js +7 -41
- package/lib/Signal/Group/group_cipher.d.ts +4 -4
- package/lib/Signal/Group/group_cipher.js +37 -51
- package/lib/Signal/Group/index.d.ts +12 -11
- package/lib/Signal/Group/index.js +12 -57
- package/lib/Signal/Group/keyhelper.d.ts +2 -1
- package/lib/Signal/Group/keyhelper.js +7 -44
- package/lib/Signal/Group/sender-chain-key.d.ts +3 -2
- package/lib/Signal/Group/sender-chain-key.js +7 -15
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +2 -1
- package/lib/Signal/Group/sender-key-distribution-message.js +8 -11
- package/lib/Signal/Group/sender-key-message.d.ts +2 -1
- package/lib/Signal/Group/sender-key-message.js +9 -12
- package/lib/Signal/Group/sender-key-name.d.ts +1 -0
- package/lib/Signal/Group/sender-key-name.js +2 -5
- package/lib/Signal/Group/sender-key-record.d.ts +3 -2
- package/lib/Signal/Group/sender-key-record.js +9 -21
- package/lib/Signal/Group/sender-key-state.d.ts +7 -6
- package/lib/Signal/Group/sender-key-state.js +27 -42
- package/lib/Signal/Group/sender-message-key.d.ts +1 -0
- package/lib/Signal/Group/sender-message-key.js +4 -7
- package/lib/Signal/libsignal.d.ts +5 -3
- package/lib/Signal/libsignal.js +347 -90
- package/lib/Signal/lid-mapping.d.ts +23 -0
- package/lib/Signal/lid-mapping.js +277 -0
- package/lib/Socket/Client/index.d.ts +3 -3
- package/lib/Socket/Client/index.js +3 -19
- package/lib/Socket/Client/{abstract-socket-client.d.ts → types.d.ts} +4 -5
- package/lib/Socket/Client/types.js +11 -0
- package/lib/Socket/Client/{web-socket-client.d.ts → websocket.d.ts} +3 -2
- package/lib/Socket/Client/websocket.js +54 -0
- package/lib/Socket/business.d.ts +154 -108
- package/lib/Socket/business.js +162 -43
- package/lib/Socket/chats.d.ts +96 -239
- package/lib/Socket/chats.js +627 -427
- package/lib/Socket/communities.d.ts +239 -146
- package/lib/Socket/communities.js +90 -80
- package/lib/Socket/groups.d.ts +104 -57
- package/lib/Socket/groups.js +154 -161
- package/lib/Socket/index.d.ts +202 -115
- package/lib/Socket/index.js +11 -10
- package/lib/Socket/luxu.d.ts +22 -266
- package/lib/Socket/luxu.js +422 -465
- package/lib/Socket/messages-recv.d.ts +136 -84
- package/lib/Socket/messages-recv.js +1421 -615
- package/lib/Socket/messages-send.d.ts +142 -126
- package/lib/Socket/messages-send.js +878 -671
- package/lib/Socket/mex.d.ts +3 -0
- package/lib/Socket/mex.js +42 -0
- package/lib/Socket/newsletter.d.ts +121 -85
- package/lib/Socket/newsletter.js +147 -272
- package/lib/Socket/socket.d.ts +34 -19
- package/lib/Socket/socket.js +544 -313
- package/lib/Store/index.d.ts +10 -3
- package/lib/Store/index.js +10 -10
- package/lib/Store/keyed-db.d.ts +22 -0
- package/lib/Store/keyed-db.js +108 -0
- package/lib/Store/make-cache-manager-store.d.ts +17 -11
- package/lib/Store/make-cache-manager-store.js +43 -41
- package/lib/Store/make-in-memory-store.d.ts +39 -118
- package/lib/Store/make-in-memory-store.js +112 -341
- package/lib/Store/make-ordered-dictionary.d.ts +11 -10
- package/lib/Store/make-ordered-dictionary.js +14 -20
- package/lib/Store/object-repository.d.ts +10 -9
- package/lib/Store/object-repository.js +11 -6
- package/lib/Types/Auth.d.ts +19 -12
- package/lib/Types/Auth.js +2 -2
- package/lib/Types/Bussines.d.ts +25 -0
- package/lib/Types/Bussines.js +2 -0
- package/lib/Types/Call.d.ts +3 -1
- package/lib/Types/Call.js +2 -2
- package/lib/Types/Chat.d.ts +35 -13
- package/lib/Types/Chat.js +8 -4
- package/lib/Types/Contact.d.ts +8 -1
- package/lib/Types/Contact.js +2 -2
- package/lib/Types/Events.d.ts +116 -17
- package/lib/Types/Events.js +2 -2
- package/lib/Types/GroupMetadata.d.ts +21 -5
- package/lib/Types/GroupMetadata.js +2 -2
- package/lib/Types/Label.d.ts +12 -0
- package/lib/Types/Label.js +3 -5
- package/lib/Types/LabelAssociation.d.ts +1 -0
- package/lib/Types/LabelAssociation.js +3 -5
- package/lib/Types/Message.d.ts +105 -58
- package/lib/Types/Message.js +11 -9
- package/lib/Types/Mex.d.ts +141 -0
- package/lib/Types/Mex.js +37 -0
- package/lib/Types/Product.d.ts +2 -1
- package/lib/Types/Product.js +2 -2
- package/lib/Types/Signal.d.ts +32 -2
- package/lib/Types/Signal.js +2 -2
- package/lib/Types/Socket.d.ts +50 -25
- package/lib/Types/Socket.js +3 -2
- package/lib/Types/State.d.ts +72 -2
- package/lib/Types/State.js +56 -2
- package/lib/Types/USync.d.ts +3 -2
- package/lib/Types/USync.js +2 -2
- package/lib/Types/index.d.ts +22 -14
- package/lib/Types/index.js +15 -31
- package/lib/Utils/auth-utils.d.ts +12 -6
- package/lib/Utils/auth-utils.js +239 -143
- package/lib/Utils/browser-utils.d.ts +4 -0
- package/lib/Utils/browser-utils.js +28 -0
- package/lib/Utils/business.d.ts +3 -2
- package/lib/Utils/business.js +66 -69
- package/lib/Utils/chat-utils.d.ts +52 -23
- package/lib/Utils/chat-utils.js +396 -253
- package/lib/Utils/companion-reg-client-utils.d.ts +17 -0
- package/lib/Utils/companion-reg-client-utils.js +35 -0
- package/lib/Utils/crypto.d.ts +18 -22
- package/lib/Utils/crypto.js +57 -90
- package/lib/Utils/decode-wa-message.d.ts +55 -8
- package/lib/Utils/decode-wa-message.js +203 -84
- package/lib/Utils/event-buffer.d.ts +9 -8
- package/lib/Utils/event-buffer.js +185 -77
- package/lib/Utils/generics.d.ts +28 -29
- package/lib/Utils/generics.js +180 -210
- package/lib/Utils/history.d.ts +18 -9
- package/lib/Utils/history.js +93 -55
- package/lib/Utils/identity-change-handler.d.ts +44 -0
- package/lib/Utils/identity-change-handler.js +50 -0
- package/lib/Utils/index.d.ts +22 -17
- package/lib/Utils/index.js +22 -33
- package/lib/Utils/link-preview.d.ts +5 -5
- package/lib/Utils/link-preview.js +16 -24
- package/lib/Utils/logger.d.ts +11 -3
- package/lib/Utils/logger.js +3 -7
- package/lib/Utils/lt-hash.d.ts +8 -12
- package/lib/Utils/lt-hash.js +3 -46
- package/lib/Utils/make-mutex.d.ts +4 -2
- package/lib/Utils/make-mutex.js +24 -34
- package/lib/Utils/message-retry-manager.d.ts +115 -0
- package/lib/Utils/message-retry-manager.js +265 -0
- package/lib/Utils/messages-media.d.ts +61 -44
- package/lib/Utils/messages-media.js +451 -482
- package/lib/Utils/messages.d.ts +32 -18
- package/lib/Utils/messages.js +458 -369
- package/lib/Utils/noise-handler.d.ts +13 -14
- package/lib/Utils/noise-handler.js +145 -99
- package/lib/Utils/offline-node-processor.d.ts +17 -0
- package/lib/Utils/offline-node-processor.js +40 -0
- package/lib/Utils/pre-key-manager.d.ts +28 -0
- package/lib/Utils/pre-key-manager.js +106 -0
- package/lib/Utils/process-message.d.ts +31 -12
- package/lib/Utils/process-message.js +459 -150
- package/lib/Utils/reporting-utils.d.ts +11 -0
- package/lib/Utils/reporting-utils.js +258 -0
- package/lib/Utils/signal.d.ts +20 -5
- package/lib/Utils/signal.js +120 -72
- package/lib/Utils/stanza-ack.d.ts +11 -0
- package/lib/Utils/stanza-ack.js +38 -0
- package/lib/Utils/sync-action-utils.d.ts +19 -0
- package/lib/Utils/sync-action-utils.js +49 -0
- package/lib/Utils/tc-token-utils.d.ts +37 -0
- package/lib/Utils/tc-token-utils.js +163 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +2 -2
- package/lib/Utils/use-multi-file-auth-state.js +29 -27
- package/lib/Utils/validate-connection.d.ts +7 -7
- package/lib/Utils/validate-connection.js +73 -99
- package/lib/WABinary/constants.d.ts +25 -27
- package/lib/WABinary/constants.js +1281 -20
- package/lib/WABinary/decode.d.ts +5 -5
- package/lib/WABinary/decode.js +52 -42
- package/lib/WABinary/encode.d.ts +3 -3
- package/lib/WABinary/encode.js +110 -155
- package/lib/WABinary/generic-utils.d.ts +8 -7
- package/lib/WABinary/generic-utils.js +48 -49
- package/lib/WABinary/index.d.ts +6 -5
- package/lib/WABinary/index.js +6 -21
- package/lib/WABinary/jid-utils.d.ts +25 -8
- package/lib/WABinary/jid-utils.js +74 -40
- package/lib/WABinary/types.d.ts +2 -1
- package/lib/WABinary/types.js +2 -2
- package/lib/WAM/BinaryInfo.d.ts +3 -11
- package/lib/WAM/BinaryInfo.js +2 -5
- package/lib/WAM/constants.d.ts +5 -3
- package/lib/WAM/constants.js +19071 -11568
- package/lib/WAM/encode.d.ts +3 -3
- package/lib/WAM/encode.js +17 -22
- package/lib/WAM/index.d.ts +4 -3
- package/lib/WAM/index.js +4 -19
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +4 -3
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +33 -13
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +3 -2
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +11 -14
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +3 -2
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +9 -12
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +3 -2
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +9 -13
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +10 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +4 -3
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +20 -22
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +5 -3
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +13 -8
- package/lib/WAUSync/Protocols/index.d.ts +6 -4
- package/lib/WAUSync/Protocols/index.js +6 -20
- package/lib/WAUSync/USyncQuery.d.ts +6 -4
- package/lib/WAUSync/USyncQuery.js +44 -35
- package/lib/WAUSync/USyncUser.d.ts +10 -5
- package/lib/WAUSync/USyncUser.js +10 -5
- package/lib/WAUSync/index.d.ts +4 -0
- package/lib/WAUSync/index.js +4 -19
- package/lib/index.d.ts +10 -9
- package/lib/index.js +12 -34
- package/package.json +84 -53
- package/WAProto/fix-import.js +0 -29
- package/lib/Defaults/baileys-version.json +0 -3
- package/lib/Defaults/phonenumber-mcc.json +0 -223
- package/lib/Signal/Group/queue-job.d.ts +0 -1
- package/lib/Signal/Group/queue-job.js +0 -57
- package/lib/Socket/Client/abstract-socket-client.js +0 -13
- package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
- package/lib/Socket/Client/mobile-socket-client.js +0 -65
- package/lib/Socket/Client/web-socket-client.js +0 -62
- package/lib/Socket/registration.d.ts +0 -267
- package/lib/Socket/registration.js +0 -166
- package/lib/Socket/usync.d.ts +0 -36
- package/lib/Socket/usync.js +0 -70
- package/lib/Types/Newsletter.d.ts +0 -103
- package/lib/Types/Newsletter.js +0 -38
- package/lib/Utils/baileys-event-stream.d.ts +0 -16
- package/lib/Utils/baileys-event-stream.js +0 -63
package/lib/Socket/index.d.ts
CHANGED
|
@@ -1,173 +1,260 @@
|
|
|
1
|
-
|
|
2
|
-
import { UserFacingSocketConfig } from '../Types';
|
|
1
|
+
import type { UserFacingSocketConfig } from '../Types/index.js';
|
|
3
2
|
declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
communityMetadata: (jid: string) => Promise<import("../index.js").GroupMetadata>;
|
|
4
|
+
communityCreate: (subject: string, body: string) => Promise<import("../index.js").GroupMetadata | null>;
|
|
5
|
+
communityCreateGroup: (subject: string, participants: string[], parentCommunityJid: string) => Promise<import("../index.js").GroupMetadata | null>;
|
|
6
|
+
communityLeave: (id: string) => Promise<void>;
|
|
7
|
+
communityUpdateSubject: (jid: string, subject: string) => Promise<void>;
|
|
8
|
+
communityLinkGroup: (groupJid: string, parentCommunityJid: string) => Promise<void>;
|
|
9
|
+
communityUnlinkGroup: (groupJid: string, parentCommunityJid: string) => Promise<void>;
|
|
10
|
+
communityFetchLinkedGroups: (jid: string) => Promise<{
|
|
11
|
+
communityJid: string;
|
|
12
|
+
isCommunity: boolean;
|
|
13
|
+
linkedGroups: {
|
|
14
|
+
id: string | undefined;
|
|
15
|
+
subject: string;
|
|
16
|
+
creation: number | undefined;
|
|
17
|
+
owner: string | undefined;
|
|
18
|
+
size: number | undefined;
|
|
19
|
+
}[];
|
|
20
|
+
}>;
|
|
21
|
+
communityRequestParticipantsList: (jid: string) => Promise<{
|
|
22
|
+
[key: string]: string;
|
|
23
|
+
}[]>;
|
|
24
|
+
communityRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
|
|
25
|
+
status: string;
|
|
26
|
+
jid: string | undefined;
|
|
27
|
+
}[]>;
|
|
28
|
+
communityParticipantsUpdate: (jid: string, participants: string[], action: import("../index.js").ParticipantAction) => Promise<{
|
|
29
|
+
status: string;
|
|
30
|
+
jid: string | undefined;
|
|
31
|
+
content: import("../index.js").BinaryNode;
|
|
32
|
+
}[]>;
|
|
33
|
+
communityUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
34
|
+
communityInviteCode: (jid: string) => Promise<string | undefined>;
|
|
35
|
+
communityRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
36
|
+
communityAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
37
|
+
communityRevokeInviteV4: (communityJid: string, invitedJid: string) => Promise<boolean>;
|
|
38
|
+
communityAcceptInviteV4: (key: string | import("../index.js").WAMessageKey, inviteMessage: import("../index.js").proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
39
|
+
communityGetInviteInfo: (code: string) => Promise<import("../index.js").GroupMetadata>;
|
|
40
|
+
communityToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
41
|
+
communitySettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
42
|
+
communityMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
|
|
43
|
+
communityJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
|
44
|
+
communityFetchAllParticipating: () => Promise<{
|
|
45
|
+
[_: string]: import("../index.js").GroupMetadata;
|
|
46
|
+
}>;
|
|
47
|
+
logger: import("../Utils/logger.js").ILogger;
|
|
48
|
+
getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../index.js").OrderDetails>;
|
|
49
|
+
getCatalog: ({ jid, limit, cursor }: import("../index.js").GetCatalogOptions) => Promise<{
|
|
50
|
+
products: import("../index.js").Product[];
|
|
10
51
|
nextPageCursor: string | undefined;
|
|
11
52
|
}>;
|
|
12
|
-
getCollections: (jid?: string
|
|
13
|
-
collections: import("../
|
|
53
|
+
getCollections: (jid?: string, limit?: number) => Promise<{
|
|
54
|
+
collections: import("../index.js").CatalogCollection[];
|
|
14
55
|
}>;
|
|
15
|
-
productCreate: (create: import("../
|
|
56
|
+
productCreate: (create: import("../index.js").ProductCreate) => Promise<import("../index.js").Product>;
|
|
16
57
|
productDelete: (productIds: string[]) => Promise<{
|
|
17
58
|
deleted: number;
|
|
18
59
|
}>;
|
|
19
|
-
productUpdate: (productId: string, update: import("../
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}>;
|
|
60
|
+
productUpdate: (productId: string, update: import("../index.js").ProductUpdate) => Promise<import("../index.js").Product>;
|
|
61
|
+
updateBussinesProfile: (args: import("../Types/Bussines.js").UpdateBussinesProfileProps) => Promise<any>;
|
|
62
|
+
updateCoverPhoto: (photo: import("../index.js").WAMediaUpload) => Promise<number>;
|
|
63
|
+
removeCoverPhoto: (id: string) => Promise<any>;
|
|
64
|
+
sendMessageAck: (node: import("../index.js").BinaryNode, errorCode?: number) => Promise<void>;
|
|
65
|
+
sendRetryRequest: (node: import("../index.js").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
|
|
26
66
|
rejectCall: (callId: string, callFrom: string) => Promise<void>;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
[key: string]: string;
|
|
67
|
+
fetchMessageHistory: (count: number, oldestMsgKey: import("../index.js").WAMessageKey, oldestMsgTimestamp: number | import("long").default) => Promise<string>;
|
|
68
|
+
requestPlaceholderResend: (messageKey: import("../index.js").WAMessageKey, msgData?: Partial<import("../index.js").WAMessage>) => Promise<string | undefined>;
|
|
69
|
+
messageRetryManager: import("../index.js").MessageRetryManager | null;
|
|
70
|
+
userDevicesCache: import("../index.js").PossiblyExtendedCacheStore | import("@cacheable/node-cache").NodeCache<import("../index.js").JidWithDevice[]>;
|
|
71
|
+
devicesMutex: {
|
|
72
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
34
73
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
waUploadToServer: import("../Types").WAMediaUploadFunction;
|
|
74
|
+
issuePrivacyTokens: (jids: string[], timestamp?: number) => Promise<any>;
|
|
75
|
+
assertSessions: (jids: string[], force?: boolean) => Promise<boolean>;
|
|
76
|
+
relayMessage: (jid: string, message: import("../index.js").proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../index.js").MessageRelayOptions) => Promise<string>;
|
|
77
|
+
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../index.js").MessageReceiptType) => Promise<void>;
|
|
78
|
+
sendReceipts: (keys: import("../index.js").WAMessageKey[], type: import("../index.js").MessageReceiptType) => Promise<void>;
|
|
79
|
+
readMessages: (keys: import("../index.js").WAMessageKey[]) => Promise<void>;
|
|
80
|
+
refreshMediaConn: (forceGet?: boolean) => Promise<import("../index.js").MediaConnInfo>;
|
|
81
|
+
getMediaHost: () => string;
|
|
82
|
+
waUploadToServer: import("../index.js").WAMediaUploadFunction;
|
|
45
83
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
46
84
|
[_: string]: string;
|
|
47
85
|
}>;
|
|
48
|
-
|
|
49
|
-
|
|
86
|
+
sendPeerDataOperationMessage: (pdoMessage: import("../index.js").proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
|
|
87
|
+
createParticipantNodes: (recipientJids: string[], message: import("../index.js").proto.IMessage, extraAttrs?: import("../index.js").BinaryNode["attrs"], dsmMessage?: import("../index.js").proto.IMessage) => Promise<{
|
|
88
|
+
nodes: import("../index.js").BinaryNode[];
|
|
89
|
+
shouldIncludeDeviceIdentity: boolean;
|
|
90
|
+
}>;
|
|
91
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<(import("../index.js").JidWithDevice & {
|
|
92
|
+
jid: string;
|
|
93
|
+
})[]>;
|
|
94
|
+
updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
|
|
95
|
+
updateMediaMessage: (message: import("../index.js").WAMessage) => Promise<import("../index.js").WAMessage>;
|
|
96
|
+
sendMessage: (jid: string, content: import("../index.js").AnyMessageContent, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
|
|
97
|
+
newsletterCreate: (name: string, description?: string) => Promise<import("../index.js").NewsletterMetadata>;
|
|
98
|
+
newsletterUpdate: (jid: string, updates: import("../index.js").NewsletterUpdate) => Promise<unknown>;
|
|
99
|
+
newsletterSubscribers: (jid: string) => Promise<{
|
|
100
|
+
subscribers: number;
|
|
101
|
+
}>;
|
|
102
|
+
newsletterMetadata: (type: "invite" | "jid", key: string) => Promise<import("../index.js").NewsletterMetadata | null>;
|
|
103
|
+
newsletterFollow: (jid: string) => Promise<unknown>;
|
|
104
|
+
newsletterUnfollow: (jid: string) => Promise<unknown>;
|
|
105
|
+
newsletterMute: (jid: string) => Promise<unknown>;
|
|
106
|
+
newsletterUnmute: (jid: string) => Promise<unknown>;
|
|
107
|
+
newsletterUpdateName: (jid: string, name: string) => Promise<unknown>;
|
|
108
|
+
newsletterUpdateDescription: (jid: string, description: string) => Promise<unknown>;
|
|
109
|
+
newsletterUpdatePicture: (jid: string, content: import("../index.js").WAMediaUpload) => Promise<unknown>;
|
|
110
|
+
newsletterRemovePicture: (jid: string) => Promise<unknown>;
|
|
111
|
+
newsletterReactMessage: (jid: string, serverId: string, reaction?: string) => Promise<void>;
|
|
112
|
+
newsletterFetchMessages: (jid: string, count: number, since: number, after: number) => Promise<any>;
|
|
50
113
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
51
114
|
duration: string;
|
|
52
|
-
}>;
|
|
53
|
-
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
|
|
54
|
-
newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
|
|
55
|
-
newsletterUpdateName: (jid: string, name: string) => Promise<void>;
|
|
56
|
-
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
|
|
57
|
-
newsletterRemovePicture: (jid: string) => Promise<void>;
|
|
58
|
-
newsletterUnfollow: (jid: string) => Promise<void>;
|
|
59
|
-
newsletterFollow: (jid: string) => Promise<void>;
|
|
60
|
-
newsletterUnmute: (jid: string) => Promise<void>;
|
|
61
|
-
newsletterMute: (jid: string) => Promise<void>;
|
|
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>;
|
|
115
|
+
} | null>;
|
|
65
116
|
newsletterAdminCount: (jid: string) => Promise<number>;
|
|
66
|
-
newsletterChangeOwner: (jid: string,
|
|
67
|
-
newsletterDemote: (jid: string,
|
|
117
|
+
newsletterChangeOwner: (jid: string, newOwnerJid: string) => Promise<void>;
|
|
118
|
+
newsletterDemote: (jid: string, userJid: string) => Promise<void>;
|
|
68
119
|
newsletterDelete: (jid: string) => Promise<void>;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
|
|
72
|
-
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
|
|
73
|
-
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
|
|
120
|
+
groupMetadata: (jid: string) => Promise<import("../index.js").GroupMetadata>;
|
|
121
|
+
groupCreate: (subject: string, participants: string[]) => Promise<import("../index.js").GroupMetadata>;
|
|
74
122
|
groupLeave: (id: string) => Promise<void>;
|
|
75
123
|
groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
|
|
76
124
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
77
125
|
[key: string]: string;
|
|
78
126
|
}[]>;
|
|
79
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "
|
|
127
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
|
|
80
128
|
status: string;
|
|
81
|
-
jid: string;
|
|
129
|
+
jid: string | undefined;
|
|
82
130
|
}[]>;
|
|
83
|
-
groupParticipantsUpdate: (jid: string, participants: string[], action: import("../
|
|
131
|
+
groupParticipantsUpdate: (jid: string, participants: string[], action: import("../index.js").ParticipantAction) => Promise<{
|
|
84
132
|
status: string;
|
|
85
|
-
jid: string;
|
|
86
|
-
content: import("../index").BinaryNode;
|
|
133
|
+
jid: string | undefined;
|
|
134
|
+
content: import("../index.js").BinaryNode;
|
|
87
135
|
}[]>;
|
|
88
|
-
groupUpdateDescription: (jid: string, description?: string
|
|
136
|
+
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
|
|
89
137
|
groupInviteCode: (jid: string) => Promise<string | undefined>;
|
|
90
138
|
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
|
|
91
139
|
groupAcceptInvite: (code: string) => Promise<string | undefined>;
|
|
92
|
-
|
|
93
|
-
|
|
140
|
+
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
|
|
141
|
+
groupAcceptInviteV4: (key: string | import("../index.js").WAMessageKey, inviteMessage: import("../index.js").proto.Message.IGroupInviteMessage) => Promise<any>;
|
|
142
|
+
groupGetInviteInfo: (code: string) => Promise<import("../index.js").GroupMetadata>;
|
|
94
143
|
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
|
|
95
|
-
groupSettingUpdate: (jid: string, setting: "announcement" | "
|
|
96
|
-
groupMemberAddMode: (jid: string, mode: "
|
|
144
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
|
|
145
|
+
groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
|
|
97
146
|
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
|
|
98
147
|
groupFetchAllParticipating: () => Promise<{
|
|
99
|
-
[_: string]: import("../
|
|
148
|
+
[_: string]: import("../index.js").GroupMetadata;
|
|
100
149
|
}>;
|
|
101
|
-
|
|
102
|
-
|
|
150
|
+
serverProps: {
|
|
151
|
+
privacyTokenOn1to1: boolean;
|
|
152
|
+
profilePicPrivacyToken: boolean;
|
|
153
|
+
lidTrustedTokenIssueToLid: boolean;
|
|
103
154
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
155
|
+
createCallLink: (type: "audio" | "video", event?: {
|
|
156
|
+
startTime: number;
|
|
157
|
+
}, timeoutMs?: number) => Promise<string | undefined>;
|
|
158
|
+
getBotListV2: () => Promise<import("../index.js").BotListInfo[]>;
|
|
159
|
+
messageMutex: {
|
|
160
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
161
|
+
};
|
|
162
|
+
receiptMutex: {
|
|
163
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
164
|
+
};
|
|
165
|
+
appStatePatchMutex: {
|
|
166
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
167
|
+
};
|
|
168
|
+
notificationMutex: {
|
|
169
|
+
mutex<T>(code: () => Promise<T> | T): Promise<T>;
|
|
170
|
+
};
|
|
171
|
+
upsertMessage: (msg: import("../index.js").WAMessage, type: import("../index.js").MessageUpsertType) => Promise<void>;
|
|
172
|
+
appPatch: (patchCreate: import("../index.js").WAPatchCreate) => Promise<void>;
|
|
173
|
+
sendPresenceUpdate: (type: import("../index.js").WAPresence, toJid?: string) => Promise<void>;
|
|
174
|
+
presenceSubscribe: (toJid: string) => Promise<void>;
|
|
175
|
+
profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
|
|
176
|
+
fetchBlocklist: () => Promise<(string | undefined)[]>;
|
|
177
|
+
fetchStatus: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
|
|
178
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
|
|
179
|
+
updateProfilePicture: (jid: string, content: import("../index.js").WAMediaUpload, dimensions?: {
|
|
180
|
+
width: number;
|
|
181
|
+
height: number;
|
|
182
|
+
}) => Promise<void>;
|
|
120
183
|
removeProfilePicture: (jid: string) => Promise<void>;
|
|
121
184
|
updateProfileStatus: (status: string) => Promise<void>;
|
|
122
185
|
updateProfileName: (name: string) => Promise<void>;
|
|
123
186
|
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
187
|
+
updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>;
|
|
188
|
+
updateCallPrivacy: (value: import("../index.js").WAPrivacyCallValue) => Promise<void>;
|
|
189
|
+
updateMessagesPrivacy: (value: import("../index.js").WAPrivacyMessagesValue) => Promise<void>;
|
|
190
|
+
updateLastSeenPrivacy: (value: import("../index.js").WAPrivacyValue) => Promise<void>;
|
|
191
|
+
updateOnlinePrivacy: (value: import("../index.js").WAPrivacyOnlineValue) => Promise<void>;
|
|
192
|
+
updateProfilePicturePrivacy: (value: import("../index.js").WAPrivacyValue) => Promise<void>;
|
|
193
|
+
updateStatusPrivacy: (value: import("../index.js").WAPrivacyValue) => Promise<void>;
|
|
194
|
+
updateReadReceiptsPrivacy: (value: import("../index.js").WAReadReceiptsValue) => Promise<void>;
|
|
195
|
+
updateGroupsAddPrivacy: (value: import("../index.js").WAPrivacyGroupAddValue) => Promise<void>;
|
|
130
196
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
131
|
-
getBusinessProfile: (jid: string) => Promise<
|
|
132
|
-
resyncAppState: (collections: readonly ("
|
|
133
|
-
chatModify: (mod: import("../
|
|
134
|
-
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?:
|
|
197
|
+
getBusinessProfile: (jid: string) => Promise<import("../index.js").WABusinessProfile | void>;
|
|
198
|
+
resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
|
|
199
|
+
chatModify: (mod: import("../index.js").ChatModification, jid: string) => Promise<void>;
|
|
200
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
|
|
201
|
+
addOrEditContact: (jid: string, contact: import("../index.js").proto.SyncActionValue.IContactAction) => Promise<void>;
|
|
202
|
+
removeContact: (jid: string) => Promise<void>;
|
|
203
|
+
placeholderResendCache: import("../index.js").CacheStore;
|
|
204
|
+
addLabel: (jid: string, labels: import("../Types/Label.js").LabelActionBody) => Promise<void>;
|
|
135
205
|
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
136
206
|
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
137
207
|
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
138
208
|
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
139
209
|
star: (jid: string, messages: {
|
|
140
210
|
id: string;
|
|
141
|
-
fromMe?: boolean
|
|
211
|
+
fromMe?: boolean;
|
|
142
212
|
}[], star: boolean) => Promise<void>;
|
|
213
|
+
addOrEditQuickReply: (quickReply: import("../Types/Bussines.js").QuickReplyAction) => Promise<void>;
|
|
214
|
+
removeQuickReply: (timestamp: string) => Promise<void>;
|
|
143
215
|
type: "md";
|
|
144
|
-
ws:
|
|
145
|
-
ev: import("../
|
|
146
|
-
process(handler: (events: Partial<import("../
|
|
216
|
+
ws: import("./Client/index.js").WebSocketClient;
|
|
217
|
+
ev: import("../index.js").BaileysEventEmitter & {
|
|
218
|
+
process(handler: (events: Partial<import("../index.js").BaileysEventMap>) => void | Promise<void>): () => void;
|
|
147
219
|
buffer(): void;
|
|
148
|
-
createBufferedFunction<A extends any[],
|
|
149
|
-
flush(
|
|
220
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (...args: A) => Promise<T>;
|
|
221
|
+
flush(): boolean;
|
|
150
222
|
isBuffering(): boolean;
|
|
223
|
+
destroy(): void;
|
|
151
224
|
};
|
|
152
225
|
authState: {
|
|
153
|
-
creds: import("../
|
|
154
|
-
keys: import("../
|
|
226
|
+
creds: import("../index.js").AuthenticationCreds;
|
|
227
|
+
keys: import("../index.js").SignalKeyStoreWithTransaction;
|
|
155
228
|
};
|
|
156
|
-
signalRepository: import("../
|
|
157
|
-
user: import("../
|
|
229
|
+
signalRepository: import("../index.js").SignalRepositoryWithLIDStore;
|
|
230
|
+
user: import("../index.js").Contact | undefined;
|
|
158
231
|
generateMessageTag: () => string;
|
|
159
|
-
query: (node: import("../index").BinaryNode, timeoutMs?: number
|
|
160
|
-
waitForMessage: <
|
|
232
|
+
query: (node: import("../index.js").BinaryNode, timeoutMs?: number) => Promise<any>;
|
|
233
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T | undefined>;
|
|
161
234
|
waitForSocketOpen: () => Promise<void>;
|
|
162
235
|
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
|
|
163
|
-
sendNode: (frame: import("../index").BinaryNode) => Promise<void>;
|
|
164
|
-
logout: (msg?: string
|
|
165
|
-
end: (error: Error | undefined) => void
|
|
166
|
-
|
|
236
|
+
sendNode: (frame: import("../index.js").BinaryNode) => Promise<void>;
|
|
237
|
+
logout: (msg?: string) => Promise<void>;
|
|
238
|
+
end: (error: Error | undefined) => Promise<void>;
|
|
239
|
+
registerSocketEndHandler: (handler: (error: Error | undefined) => void | Promise<void>) => void;
|
|
240
|
+
onUnexpectedError: (err: Error | import("@hapi/boom").Boom, msg: string) => void;
|
|
167
241
|
uploadPreKeys: (count?: number) => Promise<void>;
|
|
168
242
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
243
|
+
digestKeyBundle: () => Promise<void>;
|
|
244
|
+
rotateSignedPreKey: () => Promise<void>;
|
|
245
|
+
requestPairingCode: (phoneNumber: string, customPairingCode?: string) => Promise<string>;
|
|
246
|
+
updateServerTimeOffset: ({ attrs }: import("../index.js").BinaryNode) => void;
|
|
247
|
+
sendUnifiedSession: () => Promise<void>;
|
|
248
|
+
wamBuffer: import("../index.js").BinaryInfo;
|
|
249
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../index.js").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
|
|
250
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
|
|
251
|
+
executeUSyncQuery: (usyncQuery: import("../index.js").USyncQuery) => Promise<import("../index.js").USyncQueryResult | undefined>;
|
|
252
|
+
onWhatsApp: (...phoneNumber: string[]) => Promise<{
|
|
253
|
+
jid: string;
|
|
254
|
+
exists: boolean;
|
|
255
|
+
}[] | undefined>;
|
|
256
|
+
fetchAccountReachoutTimelock: () => Promise<import("../index.js").ReachoutTimelockState>;
|
|
257
|
+
fetchNewChatMessageCap: () => Promise<import("../index.js").NewChatMessageCapInfo>;
|
|
172
258
|
};
|
|
173
259
|
export default makeWASocket;
|
|
260
|
+
//# sourceMappingURL=index.d.ts.map
|
package/lib/Socket/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const Defaults_1 = require("../Defaults");
|
|
4
|
-
const registration_1 = require("./registration");
|
|
1
|
+
import { DEFAULT_CONNECTION_CONFIG } from '../Defaults/index.js';
|
|
2
|
+
import { makeCommunitiesSocket } from './communities.js';
|
|
5
3
|
// export the last socket layer
|
|
6
|
-
const makeWASocket = (config) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
const makeWASocket = (config) => {
|
|
5
|
+
const newConfig = {
|
|
6
|
+
...DEFAULT_CONNECTION_CONFIG,
|
|
7
|
+
...config
|
|
8
|
+
};
|
|
9
|
+
return makeCommunitiesSocket(newConfig);
|
|
10
|
+
};
|
|
11
|
+
export default makeWASocket;
|
|
12
|
+
//# sourceMappingURL=index.js.map
|