@pontalabs/baileys 1.0.6 → 1.0.7
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/LICENSE +1 -1
- package/README.md +839 -267
- package/WAProto/GenerateStatics.sh +4 -3
- package/WAProto/WAProto.proto +511 -1215
- package/WAProto/index.d.ts +55 -14017
- package/WAProto/index.js +29 -97689
- package/lib/Defaults/index.d.ts +74 -72
- package/lib/Defaults/index.js +108 -94
- package/lib/Signal/Group/ciphertext-message.d.ts +7 -8
- package/lib/Signal/Group/ciphertext-message.js +16 -9
- package/lib/Signal/Group/group-session-builder.d.ts +13 -11
- package/lib/Signal/Group/group-session-builder.js +61 -19
- package/lib/Signal/Group/group_cipher.d.ts +16 -14
- package/lib/Signal/Group/group_cipher.js +70 -41
- package/lib/Signal/Group/index.d.ts +11 -12
- package/lib/Signal/Group/index.js +61 -12
- package/lib/Signal/Group/keyhelper.d.ts +14 -9
- package/lib/Signal/Group/keyhelper.js +58 -10
- package/lib/Signal/Group/sender-chain-key.d.ts +13 -13
- package/lib/Signal/Group/sender-chain-key.js +34 -13
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -16
- package/lib/Signal/Group/sender-key-distribution-message.js +36 -28
- package/lib/Signal/Group/sender-key-message.d.ts +18 -18
- package/lib/Signal/Group/sender-key-message.js +45 -38
- package/lib/Signal/Group/sender-key-name.d.ts +15 -14
- package/lib/Signal/Group/sender-key-name.js +31 -20
- package/lib/Signal/Group/sender-key-record.d.ts +25 -24
- package/lib/Signal/Group/sender-key-record.js +35 -18
- package/lib/Signal/Group/sender-key-state.d.ts +34 -29
- package/lib/Signal/Group/sender-key-state.js +100 -37
- package/lib/Signal/Group/sender-message-key.d.ts +10 -11
- package/lib/Signal/Group/sender-message-key.js +22 -15
- package/lib/Signal/libsignal.d.ts +8 -5
- package/lib/Signal/libsignal.js +142 -288
- package/lib/Signal/lid-mapping.d.ts +28 -23
- package/lib/Signal/lid-mapping.js +184 -277
- package/lib/Socket/Client/index.d.ts +2 -3
- package/lib/Socket/Client/index.js +22 -3
- package/lib/Socket/Client/types.d.ts +15 -15
- package/lib/Socket/Client/types.js +15 -8
- package/lib/Socket/Client/websocket.d.ts +12 -12
- package/lib/Socket/Client/websocket.js +37 -29
- package/lib/Socket/business.d.ts +178 -208
- package/lib/Socket/business.js +127 -91
- package/lib/Socket/chats.d.ts +93 -120
- package/lib/Socket/chats.js +652 -727
- package/lib/Socket/community.js +10 -2
- package/lib/Socket/groups.d.ts +111 -143
- package/lib/Socket/groups.js +186 -165
- package/lib/Socket/index.d.ts +183 -252
- package/lib/Socket/index.js +18 -38
- package/lib/Socket/messages-recv.d.ts +167 -196
- package/lib/Socket/messages-recv.js +1567 -1443
- package/lib/Socket/messages-send.d.ts +158 -192
- package/lib/Socket/messages-send.js +1208 -1102
- package/lib/Socket/newsletter.d.ts +138 -163
- package/lib/Socket/newsletter.js +249 -153
- package/lib/Socket/socket.d.ts +36 -50
- package/lib/Socket/socket.js +820 -749
- package/lib/Store/index.d.ts +4 -4
- package/lib/Store/index.js +24 -4
- package/lib/Store/make-in-memory-store.d.ts +104 -44
- package/lib/Store/make-in-memory-store.js +213 -199
- package/lib/Store/make-ordered-dictionary.d.ts +12 -13
- package/lib/Store/make-ordered-dictionary.js +45 -38
- package/lib/Store/object-repository.d.ts +10 -11
- package/lib/Store/object-repository.js +16 -9
- package/lib/Types/Auth.d.ts +97 -93
- package/lib/Types/Auth.js +3 -2
- package/lib/Types/Bussines.js +3 -2
- package/lib/Types/Call.d.ts +13 -14
- package/lib/Types/Call.js +3 -2
- package/lib/Types/Chat.d.ts +97 -78
- package/lib/Types/Chat.js +9 -8
- package/lib/Types/Contact.d.ts +9 -12
- package/lib/Types/Contact.js +3 -2
- package/lib/Types/Events.d.ts +176 -206
- package/lib/Types/Events.js +3 -2
- package/lib/Types/GroupMetadata.d.ts +48 -53
- package/lib/Types/GroupMetadata.js +3 -2
- package/lib/Types/Label.d.ts +14 -13
- package/lib/Types/Label.js +30 -24
- package/lib/Types/LabelAssociation.d.ts +20 -15
- package/lib/Types/LabelAssociation.js +12 -6
- package/lib/Types/Message.d.ts +412 -248
- package/lib/Types/Message.js +19 -17
- package/lib/Types/Product.d.ts +71 -58
- package/lib/Types/Product.js +3 -2
- package/lib/Types/Signal.d.ts +82 -71
- package/lib/Types/Signal.js +3 -2
- package/lib/Types/Socket.d.ts +81 -76
- package/lib/Types/Socket.js +3 -3
- package/lib/Types/State.d.ts +19 -75
- package/lib/Types/State.js +14 -56
- package/lib/Types/USync.d.ts +8 -8
- package/lib/Types/USync.js +3 -2
- package/lib/Types/index.d.ts +62 -47
- package/lib/Types/index.js +50 -26
- package/lib/Utils/auth-utils.d.ts +10 -13
- package/lib/Utils/auth-utils.js +472 -213
- package/lib/Utils/business.d.ts +20 -14
- package/lib/Utils/business.js +134 -110
- package/lib/Utils/chat-utils.d.ts +70 -88
- package/lib/Utils/chat-utils.js +403 -466
- package/lib/Utils/crypto.d.ts +46 -27
- package/lib/Utils/crypto.js +188 -117
- package/lib/Utils/decode-wa-message.d.ts +45 -58
- package/lib/Utils/decode-wa-message.js +311 -212
- package/lib/Utils/event-buffer.d.ts +17 -14
- package/lib/Utils/event-buffer.js +296 -321
- package/lib/Utils/generics.d.ts +92 -66
- package/lib/Utils/generics.js +436 -270
- package/lib/Utils/history.d.ts +23 -24
- package/lib/Utils/history.js +76 -106
- package/lib/Utils/index.d.ts +21 -24
- package/lib/Utils/index.js +41 -24
- package/lib/Utils/link-preview.d.ts +14 -12
- package/lib/Utils/link-preview.js +75 -40
- package/lib/Utils/logger.d.ts +11 -10
- package/lib/Utils/logger.js +7 -3
- package/lib/Utils/lt-hash.d.ts +14 -8
- package/lib/Utils/lt-hash.js +53 -3
- package/lib/Utils/make-mutex.d.ts +7 -7
- package/lib/Utils/make-mutex.js +44 -28
- package/lib/Utils/message-retry-manager.d.ts +88 -115
- package/lib/Utils/message-retry-manager.js +160 -265
- package/lib/Utils/messages-media.d.ts +107 -105
- package/lib/Utils/messages-media.js +619 -548
- package/lib/Utils/messages.d.ts +66 -52
- package/lib/Utils/messages.js +1558 -1730
- package/lib/Utils/noise-handler.d.ts +18 -18
- package/lib/Utils/noise-handler.js +130 -176
- package/lib/Utils/process-message.d.ts +32 -43
- package/lib/Utils/process-message.js +282 -484
- package/lib/Utils/rich-message-utils.js +724 -1220
- package/lib/Utils/signal.d.ts +32 -37
- package/lib/Utils/signal.js +105 -140
- package/lib/Utils/use-multi-file-auth-state.d.ts +5 -5
- package/lib/Utils/use-multi-file-auth-state.js +120 -70
- package/lib/Utils/use-single-file-auth-state.d.ts +13 -11
- package/lib/Utils/use-single-file-auth-state.js +66 -92
- package/lib/Utils/validate-connection.d.ts +13 -11
- package/lib/Utils/validate-connection.js +113 -128
- package/lib/WABinary/constants.d.ts +27 -25
- package/lib/WABinary/constants.js +1292 -1451
- package/lib/WABinary/decode.d.ts +9 -7
- package/lib/WABinary/decode.js +189 -163
- package/lib/WABinary/encode.d.ts +3 -3
- package/lib/WABinary/encode.js +155 -110
- package/lib/WABinary/generic-utils.d.ts +27 -14
- package/lib/WABinary/generic-utils.js +105 -177
- package/lib/WABinary/index.d.ts +5 -6
- package/lib/WABinary/index.js +25 -6
- package/lib/WABinary/jid-utils.d.ts +54 -41
- package/lib/WABinary/jid-utils.js +152 -83
- package/lib/WABinary/types.d.ts +13 -10
- package/lib/WABinary/types.js +3 -2
- package/lib/WAM/BinaryInfo.d.ts +15 -8
- package/lib/WAM/BinaryInfo.js +14 -7
- package/lib/WAM/constants.d.ts +37 -30
- package/lib/WAM/constants.js +11983 -19465
- package/lib/WAM/encode.d.ts +3 -3
- package/lib/WAM/encode.js +109 -95
- package/lib/WAM/index.d.ts +3 -4
- package/lib/WAM/index.js +23 -4
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -9
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +21 -37
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -19
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +26 -18
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -11
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +20 -12
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -11
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +24 -16
- package/lib/WAUSync/Protocols/index.d.ts +6 -6
- package/lib/WAUSync/Protocols/index.js +26 -6
- package/lib/WAUSync/USyncQuery.d.ts +28 -27
- package/lib/WAUSync/USyncQuery.js +62 -68
- package/lib/WAUSync/USyncUser.d.ts +10 -15
- package/lib/WAUSync/USyncUser.js +19 -20
- package/lib/WAUSync/index.d.ts +3 -4
- package/lib/WAUSync/index.js +23 -4
- package/lib/index.d.ts +12 -11
- package/lib/index.js +39 -12
- package/package.json +42 -86
- package/engine-requirements.js +0 -10
package/lib/Socket/index.d.ts
CHANGED
|
@@ -1,260 +1,191 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { UserFacingSocketConfig, ContactAction } from '../Types'
|
|
2
|
+
|
|
2
3
|
declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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[];
|
|
51
|
-
nextPageCursor: string | undefined;
|
|
52
|
-
}>;
|
|
53
|
-
getCollections: (jid?: string, limit?: number) => Promise<{
|
|
54
|
-
collections: import("../index.js").CatalogCollection[];
|
|
55
|
-
}>;
|
|
56
|
-
productCreate: (create: import("../index.js").ProductCreate) => Promise<import("../index.js").Product>;
|
|
4
|
+
logger: import("../Utils/logger").ILogger
|
|
5
|
+
getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>
|
|
6
|
+
getCatalog: ({ jid, limit, cursor }: import("../Types").GetCatalogOptions) => Promise<{
|
|
7
|
+
products: import("../Types").Product[]
|
|
8
|
+
nextPageCursor: string | undefined
|
|
9
|
+
}>
|
|
10
|
+
getCollections: (jid?: string | undefined, limit?: number) => Promise<{
|
|
11
|
+
collections: import("../Types").CatalogCollection[]
|
|
12
|
+
}>
|
|
13
|
+
productCreate: (create: import("../Types").ProductCreate) => Promise<import("../Types").Product>
|
|
57
14
|
productDelete: (productIds: string[]) => Promise<{
|
|
58
|
-
deleted: number
|
|
59
|
-
}
|
|
60
|
-
productUpdate: (productId: string, update: import("../
|
|
61
|
-
updateBussinesProfile: (args: import("../Types
|
|
62
|
-
updateCoverPhoto: (photo: import("../
|
|
63
|
-
removeCoverPhoto: (id: string) => Promise<any
|
|
64
|
-
sendMessageAck: (
|
|
65
|
-
sendRetryRequest: (node: import("
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
getMediaHost: () => string;
|
|
82
|
-
waUploadToServer: import("../index.js").WAMediaUploadFunction;
|
|
15
|
+
deleted: number
|
|
16
|
+
}>
|
|
17
|
+
productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>
|
|
18
|
+
updateBussinesProfile: (args: import("../Types").UpdateBussinesProfileProps) => Promise<any>
|
|
19
|
+
updateCoverPhoto: (photo: import("../Types").WAMediaUpload) => Promise<number>
|
|
20
|
+
removeCoverPhoto: (id: string) => Promise<any>
|
|
21
|
+
sendMessageAck: ({ tag, attrs, content }: import("..").BinaryNode, errorCode?: number | undefined) => Promise<void>
|
|
22
|
+
sendRetryRequest: (node: import("..").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>
|
|
23
|
+
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
|
24
|
+
id: any
|
|
25
|
+
to: string
|
|
26
|
+
}>
|
|
27
|
+
rejectCall: (callId: string, callFrom: string) => Promise<void>
|
|
28
|
+
fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAProto.IMessageKey, oldestMsgTimestamp: number | import("long").Long) => Promise<string>
|
|
29
|
+
requestPlaceholderResend: (messageKey: import("../Types").WAProto.IMessageKey) => Promise<string | undefined>
|
|
30
|
+
getPrivacyTokens: (jids: string[]) => Promise<import("..").BinaryNode>
|
|
31
|
+
assertSessions: (jids: string[], force: boolean) => Promise<boolean>
|
|
32
|
+
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>
|
|
33
|
+
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>
|
|
34
|
+
sendReceipts: (keys: import("../Types").WAProto.IMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>
|
|
35
|
+
readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise<void>
|
|
36
|
+
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>
|
|
37
|
+
waUploadToServer: import("../Types").WAMediaUploadFunction
|
|
83
38
|
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
84
|
-
[_: string]: string
|
|
85
|
-
}
|
|
86
|
-
sendPeerDataOperationMessage: (pdoMessage: import("../
|
|
87
|
-
createParticipantNodes: (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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>;
|
|
39
|
+
[_: string]: string
|
|
40
|
+
}>
|
|
41
|
+
sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>
|
|
42
|
+
createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: {
|
|
43
|
+
[key: string]: string
|
|
44
|
+
} | undefined) => Promise<{
|
|
45
|
+
nodes: import("..").BinaryNode[]
|
|
46
|
+
shouldIncludeDeviceIdentity: boolean
|
|
47
|
+
}>
|
|
48
|
+
profilePictureUrl: (jids: string) => Promise<string>
|
|
49
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("..").JidWithDevice[]>
|
|
50
|
+
getEphemeralGroup: (jid: string) => Promise<number>
|
|
51
|
+
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>
|
|
52
|
+
sendStatusMentions: (content: import("../Types").WAProto.IMessage, jid: string, Private?: boolean) => Promise<string>
|
|
53
|
+
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>
|
|
113
54
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
114
|
-
duration: string
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
55
|
+
duration: string
|
|
56
|
+
}>
|
|
57
|
+
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>
|
|
58
|
+
newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>
|
|
59
|
+
newsletterUpdateName: (jid: string, name: string) => Promise<void>
|
|
60
|
+
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>
|
|
61
|
+
newsletterRemovePicture: (jid: string) => Promise<void>
|
|
62
|
+
newsletterUnfollow: (jid: string) => Promise<void>
|
|
63
|
+
newsletterFollow: (jid: string) => Promise<void>
|
|
64
|
+
newsletterUnmute: (jid: string) => Promise<void>
|
|
65
|
+
newsletterMute: (jid: string) => Promise<void>
|
|
66
|
+
newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>
|
|
67
|
+
newsletterQuery: (jid: string, type: string, content: BinaryNode) => Promise<BinaryNode>
|
|
68
|
+
newsletterWMexQuery: (jid?: string | undefined, query_id: number, content: BinaryNode) => Promise<BinaryNode>
|
|
69
|
+
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>
|
|
70
|
+
newsletterFetchAllParticipating: () => Promise<{
|
|
71
|
+
[_: string]: import("../Types").NewsletterMetadata
|
|
72
|
+
}>
|
|
73
|
+
newsletterAdminCount: (jid: string) => Promise<number>
|
|
74
|
+
newsletterChangeOwner: (jid: string, userLid: string) => Promise<void>
|
|
75
|
+
newsletterDemote: (jid: string, userLid: string) => Promise<void>
|
|
76
|
+
newsletterDelete: (jid: string) => Promise<void>
|
|
77
|
+
newsletterReactMessage: (jid: string, server_id: string, code?: string | undefined) => Promise<void>
|
|
78
|
+
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>
|
|
79
|
+
newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>
|
|
80
|
+
groupQuery: (jid: string, type: string, content: BinaryNode) => Promise<BinaryNode>
|
|
81
|
+
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>
|
|
82
|
+
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>
|
|
83
|
+
groupLeave: (id: string) => Promise<void>
|
|
84
|
+
groupUpdateSubject: (jid: string, subject: string) => Promise<void>
|
|
124
85
|
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
125
|
-
[key: string]: string
|
|
126
|
-
}[]
|
|
127
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "
|
|
128
|
-
status: string
|
|
129
|
-
jid: string
|
|
130
|
-
}[]
|
|
131
|
-
groupParticipantsUpdate: (jid: string, participants: string[], action: import("../
|
|
132
|
-
status: string
|
|
133
|
-
jid: string
|
|
134
|
-
content: import("
|
|
135
|
-
}[]
|
|
136
|
-
groupUpdateDescription: (jid: string, description?: string) => Promise<void
|
|
137
|
-
groupInviteCode: (jid: string) => Promise<string | undefined
|
|
138
|
-
groupRevokeInvite: (jid: string) => Promise<string | undefined
|
|
139
|
-
groupAcceptInvite: (code: string) => Promise<string | undefined
|
|
140
|
-
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean
|
|
141
|
-
groupAcceptInviteV4: (key: string | import("../
|
|
142
|
-
groupGetInviteInfo: (code: string) => Promise<import("../
|
|
143
|
-
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void
|
|
144
|
-
groupSettingUpdate: (jid: string, setting: "announcement" | "
|
|
145
|
-
groupMemberAddMode: (jid: string, mode: "
|
|
146
|
-
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void
|
|
86
|
+
[key: string]: string
|
|
87
|
+
}[]>
|
|
88
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
|
|
89
|
+
status: string
|
|
90
|
+
jid: string
|
|
91
|
+
}[]>
|
|
92
|
+
groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
|
|
93
|
+
status: string
|
|
94
|
+
jid: string
|
|
95
|
+
content: import("..").BinaryNode
|
|
96
|
+
}[]>
|
|
97
|
+
groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>
|
|
98
|
+
groupInviteCode: (jid: string) => Promise<string | undefined>
|
|
99
|
+
groupRevokeInvite: (jid: string) => Promise<string | undefined>
|
|
100
|
+
groupAcceptInvite: (code: string) => Promise<string | undefined>
|
|
101
|
+
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>
|
|
102
|
+
groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>
|
|
103
|
+
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>
|
|
104
|
+
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>
|
|
105
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>
|
|
106
|
+
groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>
|
|
107
|
+
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>
|
|
147
108
|
groupFetchAllParticipating: () => Promise<{
|
|
148
|
-
[_: string]: import("../
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
createCallLink: (type:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
getBotListV2: () => Promise<
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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>;
|
|
196
|
-
updateDefaultDisappearingMode: (duration: number) => Promise<void>;
|
|
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>;
|
|
205
|
-
addChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
206
|
-
removeChatLabel: (jid: string, labelId: string) => Promise<void>;
|
|
207
|
-
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
208
|
-
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
|
|
109
|
+
[_: string]: import("../Types").GroupMetadata
|
|
110
|
+
}>
|
|
111
|
+
processingMutex: {
|
|
112
|
+
mutex<T>(code: () => T | Promise<T>): Promise<T>
|
|
113
|
+
}
|
|
114
|
+
upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>
|
|
115
|
+
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>
|
|
116
|
+
createCallLink: (type: 'audio' | 'video', event?: number, timeoutMs?: number) => Promise<void>
|
|
117
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>
|
|
118
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>
|
|
119
|
+
getBotListV2: () => Promise<BotListInfo[]>
|
|
120
|
+
getLidUser: (jid: string) => Promise<{
|
|
121
|
+
lid: string
|
|
122
|
+
id: string
|
|
123
|
+
}[] | undefined>
|
|
124
|
+
fetchBlocklist: () => Promise<string[]>
|
|
125
|
+
fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>
|
|
126
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>
|
|
127
|
+
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>
|
|
128
|
+
removeProfilePicture: (jid: string) => Promise<void>
|
|
129
|
+
updateProfileStatus: (status: string) => Promise<void>
|
|
130
|
+
updateProfileName: (name: string) => Promise<void>
|
|
131
|
+
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>
|
|
132
|
+
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>
|
|
133
|
+
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>
|
|
134
|
+
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>
|
|
135
|
+
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>
|
|
136
|
+
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>
|
|
137
|
+
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>
|
|
138
|
+
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>
|
|
139
|
+
updateDefaultDisappearingMode: (duration: number) => Promise<void>
|
|
140
|
+
updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>
|
|
141
|
+
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>
|
|
142
|
+
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>
|
|
143
|
+
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>
|
|
144
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>
|
|
145
|
+
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>
|
|
146
|
+
addChatLabel: (jid: string, labelId: string) => Promise<void>
|
|
147
|
+
removeChatLabel: (jid: string, labelId: string) => Promise<void>
|
|
148
|
+
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>
|
|
149
|
+
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>
|
|
150
|
+
clearMessage: (jid: string, key: import("../Types").WAProto.IMessageKey, timeStamp: number | import("long").Long) => Promise<void>
|
|
209
151
|
star: (jid: string, messages: {
|
|
210
|
-
id: string
|
|
211
|
-
fromMe?: boolean
|
|
212
|
-
}[], star: boolean) => Promise<void
|
|
213
|
-
addOrEditQuickReply: (quickReply: import("../Types/Bussines
|
|
214
|
-
removeQuickReply: (timestamp: string) => Promise<void
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
152
|
+
id: string
|
|
153
|
+
fromMe?: boolean | undefined
|
|
154
|
+
}[], star: boolean) => Promise<void>
|
|
155
|
+
addOrEditQuickReply: (quickReply: import("../Types/Bussines").QuickReplyAction) => Promise<void>
|
|
156
|
+
removeQuickReply: (timestamp: string) => Promise<void>
|
|
157
|
+
addOrEditContact: (jid: string, contact: ContactAction) => Promise<void>
|
|
158
|
+
removeContact: (jid: string) => Promise<void>
|
|
159
|
+
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>
|
|
160
|
+
type: "md"
|
|
161
|
+
ws: import("./Client").WebSocketClient
|
|
162
|
+
ev: import("../Types").BaileysEventEmitter & {
|
|
163
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void
|
|
164
|
+
buffer(): void
|
|
165
|
+
createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>
|
|
166
|
+
flush(force?: boolean | undefined): boolean
|
|
167
|
+
isBuffering(): boolean
|
|
168
|
+
}
|
|
225
169
|
authState: {
|
|
226
|
-
creds: import("../
|
|
227
|
-
keys: import("../
|
|
228
|
-
}
|
|
229
|
-
signalRepository: import("../
|
|
230
|
-
user: import("../
|
|
231
|
-
generateMessageTag: () => string
|
|
232
|
-
query: (node: import("
|
|
233
|
-
waitForMessage: <
|
|
234
|
-
waitForSocketOpen: () => Promise<void
|
|
235
|
-
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void
|
|
236
|
-
sendNode: (frame: import("
|
|
237
|
-
logout: (msg?: string) => Promise<void
|
|
238
|
-
end: (error: Error | undefined) =>
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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>;
|
|
258
|
-
};
|
|
259
|
-
export default makeWASocket;
|
|
260
|
-
//# sourceMappingURL=index.d.ts.map
|
|
170
|
+
creds: import("../Types").AuthenticationCreds
|
|
171
|
+
keys: import("../Types").SignalKeyStoreWithTransaction
|
|
172
|
+
}
|
|
173
|
+
signalRepository: import("../Types").SignalRepository
|
|
174
|
+
user: import("../Types").Contact | undefined
|
|
175
|
+
generateMessageTag: () => string
|
|
176
|
+
query: (node: import("..").BinaryNode, timeoutMs?: number | undefined) => Promise<import("..").BinaryNode>
|
|
177
|
+
waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>
|
|
178
|
+
waitForSocketOpen: () => Promise<void>
|
|
179
|
+
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>
|
|
180
|
+
sendNode: (frame: import("..").BinaryNode) => Promise<void>
|
|
181
|
+
logout: (msg?: string | undefined) => Promise<void>
|
|
182
|
+
end: (error: Error | undefined) => void
|
|
183
|
+
onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void
|
|
184
|
+
uploadPreKeys: (count?: number) => Promise<void>
|
|
185
|
+
uploadPreKeysToServerIfRequired: () => Promise<void>
|
|
186
|
+
requestPairingCode: (phoneNumber: string, code?: string) => Promise<string>
|
|
187
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>
|
|
188
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("..").BinaryNode>
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export default makeWASocket
|
package/lib/Socket/index.js
CHANGED
|
@@ -1,44 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
import { DEFAULT_CONNECTION_CONFIG } from '../Defaults/index.js';
|
|
3
|
-
import { makeCommunitiesSocket } from './communities.js';
|
|
1
|
+
"use strict"
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
const _pkg = _require('../../package.json');
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true })
|
|
7
4
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
bold: '\x1b[1m',
|
|
11
|
-
cyan: '\x1b[36m',
|
|
12
|
-
green: '\x1b[32m',
|
|
13
|
-
yellow: '\x1b[33m',
|
|
14
|
-
magenta: '\x1b[35m',
|
|
15
|
-
blue: '\x1b[34m'
|
|
16
|
-
};
|
|
5
|
+
const Defaults_1 = require("../Defaults")
|
|
6
|
+
const community_1 = require("./community")
|
|
17
7
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const line = `${C.cyan}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${C.r}`;
|
|
8
|
+
// export the last socket layer
|
|
9
|
+
const makeWASocket = (config) => {
|
|
10
|
+
const newConfig = {
|
|
11
|
+
...Defaults_1.DEFAULT_CONNECTION_CONFIG,
|
|
12
|
+
...config
|
|
13
|
+
}
|
|
25
14
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
console.log(`${C.bold} Creator :${C.r} ${C.green}© Pontact${C.r}`);
|
|
32
|
-
console.log(`${C.bold} NodeJS :${C.r} ${C.blue}${process.version}${C.r}`);
|
|
33
|
-
console.log(line);
|
|
34
|
-
console.log(`${C.magenta} Terimakasih telah menggunakan library ini!${C.r}`);
|
|
35
|
-
console.log(`${line}\n`);
|
|
36
|
-
};
|
|
15
|
+
// If the user hasn't provided their own history sync function,
|
|
16
|
+
// let's create a default one that respects the syncFullHistory flag.
|
|
17
|
+
if (config.shouldSyncHistoryMessage === undefined) {
|
|
18
|
+
newConfig.shouldSyncHistoryMessage = () => !!newConfig.syncFullHistory
|
|
19
|
+
}
|
|
37
20
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
printBanner();
|
|
41
|
-
return makeCommunitiesSocket(newConfig);
|
|
42
|
-
};
|
|
21
|
+
return community_1.makeCommunitiesSocket(newConfig)
|
|
22
|
+
}
|
|
43
23
|
|
|
44
|
-
|
|
24
|
+
exports.default = makeWASocket
|