Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/@adiwajshing/baileys/lib/LegacySocket/business.d.ts
1129 views
1
/// <reference types="node" />
2
/// <reference types="node" />
3
/// <reference types="ws" />
4
import { LegacySocketConfig, OrderDetails } from '../Types';
5
import { Product, ProductCreate, ProductUpdate } from '../Types';
6
declare const makeBusinessSocket: (config: LegacySocketConfig) => {
7
getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>;
8
getCatalog: (jid?: string, limit?: number) => Promise<{
9
beforeCursor: string;
10
products: Product[];
11
}>;
12
productCreate: (product: ProductCreate) => Promise<Product>;
13
productDelete: (productIds: string[]) => Promise<{
14
deleted: any;
15
}>;
16
productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>;
17
groupMetadata: (jid: string, minimal: boolean) => Promise<import("../Types").GroupMetadata>;
18
groupCreate: (title: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
19
groupLeave: (id: string) => Promise<void>;
20
groupUpdateSubject: (id: string, title: string) => Promise<void>;
21
groupUpdateDescription: (jid: string, description: string) => Promise<{
22
status: number;
23
}>;
24
groupParticipantsUpdate: (id: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
25
jid: string;
26
status: any;
27
}[]>;
28
getBroadcastListInfo: (jid: string) => Promise<import("../Types").GroupMetadata>;
29
groupInviteCode: (jid: string) => Promise<string>;
30
relayMessage: (message: import("../Types").WAProto.IWebMessageInfo, { waitForAck }?: {
31
waitForAck: boolean;
32
}) => Promise<void>;
33
waUploadToServer: import("../Types").WAMediaUploadFunction;
34
generateUrlInfo: (text: string) => Promise<import("../Types").WAUrlInfo>;
35
messageInfo: (jid: string, messageID: string) => Promise<import("../Types").WAProto.IUserReceipt[]>;
36
downloadMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo, type?: "stream" | "buffer", options?: import("..").MediaDownloadOptions) => Promise<Buffer | import("stream").Transform>;
37
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
38
fetchMessagesFromWA: (jid: string, count: number, cursor?: import("../Types").WAMessageCursor | undefined) => Promise<import("../Types").WAProto.WebMessageInfo[]>;
39
loadMessageFromWA: (jid: string, id: string) => Promise<import("../Types").WAProto.WebMessageInfo>;
40
searchMessages: (txt: string, inJid: string | null, count: number, page: number) => Promise<{
41
last: boolean;
42
messages: import("../Types").WAProto.WebMessageInfo[];
43
}>;
44
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: {
45
messageId?: string | undefined;
46
cachedGroupMetadata?: ((jid: string) => Promise<import("../Types").GroupMetadataParticipants | undefined>) | undefined;
47
} & {
48
timestamp?: Date | undefined;
49
quoted?: import("../Types").WAProto.IWebMessageInfo | undefined;
50
ephemeralExpiration?: string | number | undefined;
51
mediaUploadTimeoutMs?: number | undefined;
52
} & {
53
waitForAck?: boolean | undefined;
54
}) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
55
sendChatsQuery: (epoch: number) => Promise<string>;
56
profilePictureUrl: (jid: string, timeoutMs?: number | undefined) => Promise<string | undefined>;
57
chatRead: (fromMessage: import("../Types").WAProto.IMessageKey, count: number) => Promise<void>;
58
chatModify: (modification: import("../Types").ChatModification, jid: string, chatInfo: Pick<import("../Types").Chat, "mute" | "pin">, timestampNow?: number | undefined) => Promise<void | {
59
status: number;
60
}>;
61
onWhatsApp: (str: string) => Promise<{
62
exists: boolean;
63
jid: string;
64
isBusiness: boolean;
65
} | undefined>;
66
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<string>;
67
presenceSubscribe: (jid: string) => Promise<string>;
68
getStatus: (jid: string) => Promise<{
69
status: string;
70
}>;
71
setStatus: (status: string) => Promise<{
72
status: number;
73
}>;
74
updateBusinessProfile: (profile: import("../Types").WABusinessProfile) => Promise<void>;
75
updateProfileName: (name: string) => Promise<{
76
status: number;
77
pushname: string;
78
}>;
79
updateProfilePicture(jid: string, imgBuffer: Buffer): Promise<void>;
80
blockUser: (jid: string, type?: "add" | "remove") => Promise<void>;
81
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile>;
82
state: import("../Types").ConnectionState;
83
authInfo: import("../Types").LegacyAuthenticationCreds;
84
ev: import("../Types").LegacyBaileysEventEmitter;
85
canLogin: () => boolean;
86
logout: () => Promise<void>;
87
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
88
type: "legacy";
89
ws: import("ws");
90
sendAdminTest: () => Promise<string>;
91
updateKeys: (info: {
92
encKey: Buffer;
93
macKey: Buffer;
94
}) => {
95
encKey: Buffer;
96
macKey: Buffer;
97
};
98
waitForSocketOpen: () => Promise<void>;
99
sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise<string>;
100
generateMessageTag: (longTag?: boolean) => string;
101
waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number | undefined) => {
102
promise: Promise<any>;
103
cancelToken: () => void;
104
};
105
query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise<any>;
106
setQuery: (nodes: import("..").BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string | undefined) => Promise<{
107
status: number;
108
}>;
109
currentEpoch: () => number;
110
end: (error: Error | undefined) => void;
111
};
112
export default makeBusinessSocket;
113
114