UNPKG

superchats

Version:

SuperChats is a premium library with unique features that control Whatsapp functions. With Superchats you can build service bots, multiservice chats or any system that uses whatsapp

509 lines (508 loc) 24.8 kB
/// <reference types="node" /> import { GetCatalogOptions, ProductCreate, ProductUpdate, SocketConfig } from '../../Models'; import { BinaryNode } from '../../Internal'; export declare const makeBusinessSocket: (config: SocketConfig) => { getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../../Models").OrderDetails>; getCatalog: ({ jid, limit, cursor }: GetCatalogOptions) => Promise<{ products: import("../../Models").Product[]; nextPageCursor: string | undefined; }>; getCollections: (jid?: string, limit?: number) => Promise<{ collections: import("../../Models").CatalogCollection[]; }>; productCreate: (create: ProductCreate) => Promise<import("../../Models").Product>; productDelete: (productIds: string[]) => Promise<{ deleted: number; }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<import("../../Models").Product>; onAck: (listener: (...args: any[]) => void) => void; onAnyMessage: (listener: (...args: any[]) => void) => void; onReaction: (listener: (...args: any[]) => void) => Promise<void>; onCall: (listener: (...args: any[]) => void) => Promise<void>; syncHistory: (listener: (...args: any[]) => void) => Promise<void>; onPresence: (listener: (...args: any[]) => void) => Promise<void>; onDelete: (listener: (...args: any[]) => void) => Promise<void>; onGroups: (listener: (...args: any[]) => void) => Promise<void>; modifyMessages: (response: any) => Promise<{ type: string; id: any; to: any; fromMe: any; isgroup: boolean; content: {}; } | undefined>; onParticipants: (listener: (...args: any[]) => void) => Promise<void>; getAllContacts: (opt?: any) => Promise<{ session: any; device: string | undefined; status: number; type: string; qt: number; contacts: never[]; }>; getBlockList: (opt?: any) => Promise<{}>; getGroups: (opt?: any) => Promise<{}>; getChats: (opt?: any) => Promise<{ session: any; device: string | undefined; status: number; type: string; qt: number; chats: never[]; }>; setPresence: (id: string, type: string) => Promise<{}>; setPicture: (id: string, file: string) => Promise<{}>; editMessage: (id: string, text: string, options: { content?: string | undefined; msgId?: string | undefined; }) => Promise<{}>; sendCall: (id: string) => Promise<{}>; setName: (name: string) => Promise<{}>; setStatus: (status: string) => Promise<{}>; forwardMessage: (id: string, options: { content?: string | undefined; msgId?: string | undefined; }) => Promise<{}>; blockContact: (id: string) => Promise<{}>; unblockContact: (id: string) => Promise<{}>; archiveChat: (id: string, boolean: boolean) => Promise<{}>; getPicture: (id: string) => Promise<{}>; deleteChat: (id: string) => Promise<{}>; deleteMessageAll: (id: string, msgId: string) => Promise<{}>; deleteMessageMe: (id: string, msgId: string) => Promise<{}>; markReadAll: (id: string) => Promise<{}>; markRead: (msgId: string) => Promise<{}>; muteChat: (id: string, timer: "hour" | "week" | "ever") => Promise<{}>; unmuteChat: (id: string) => Promise<{}>; pinChat: (id: string, boolean: boolean) => Promise<{}>; getNumberProfile: (id: string) => Promise<{}>; getProfileStatus: (id: string) => Promise<{}>; getHostDevice: (opt?: any) => Promise<{}>; infoGroup: (id: string) => Promise<{}>; getConnectionState: (opt?: any) => Promise<{ session: any; device: string | undefined; status: number; type: string; state: string; }>; getName: (id: string) => Promise<{ session: any; device: string | undefined; status: number; type: string; message: string; }>; getLabels: (opt?: any) => Promise<{}>; getLabelsChats: (opt?: any) => Promise<{}>; getLabelsMessages: (opt?: any) => Promise<{}>; addLabelChat: (id: string, labelId: string) => Promise<{}>; addLabelMessage: (id: string, msgId: string, labelId: string) => Promise<{}>; removeLabelChat: (id: string, labelId: string) => Promise<{}>; removeLabelMessage: (id: string, msgId: string, labelId: string) => Promise<{}>; getPresence: (id: string) => Promise<{}>; getChatMessages: (id: string, number: number) => Promise<{}>; getChatAllMessages: (id: string) => Promise<{}>; getAllUnreadMessages: () => Promise<{ session: any; device: string | undefined; status: number; type: string; message: string; }>; getMessageById: (id: string, idMsg: string) => Promise<{}>; requestPayment: (id: string) => Promise<{}>; sendText: (id: string, text: string, options?: { content?: string | undefined; caption?: string | undefined; mimetype?: string | undefined; viewOnce?: boolean | undefined; reply?: string | undefined; ptv?: boolean | undefined; filename?: string | undefined; address?: string | undefined; titleBtn?: string | undefined; description?: string | undefined; footerBtn?: string | undefined; msgId?: string | undefined; } | undefined) => Promise<{}>; sendButtons: (id: string, title: string, buttons: any, description?: string | undefined, type?: string | undefined, url?: string | undefined, footer?: string) => Promise<{}>; sendReaction: (id: string, text: string, options: { content?: string | undefined; caption?: string | undefined; mimetype?: string | undefined; viewOnce?: boolean | undefined; reply?: string | undefined; ptv?: boolean | undefined; filename?: string | undefined; address?: string | undefined; titleBtn?: string | undefined; description?: string | undefined; footerBtn?: string | undefined; msgId?: string | undefined; }) => Promise<{}>; sendImage: (id: string, file: string, options?: { content?: string | undefined; caption?: string | undefined; mimetype?: string | undefined; viewOnce?: boolean | undefined; reply?: string | undefined; ptv?: boolean | undefined; filename?: string | undefined; address?: string | undefined; titleBtn?: string | undefined; description?: string | undefined; footerBtn?: string | undefined; msgId?: string | undefined; } | undefined) => Promise<{}>; sendVideo: (id: string, file: string, options?: { content?: string | undefined; caption?: string | undefined; mimetype?: string | undefined; viewOnce?: boolean | undefined; reply?: string | undefined; ptv?: boolean | undefined; filename?: string | undefined; address?: string | undefined; titleBtn?: string | undefined; description?: string | undefined; footerBtn?: string | undefined; msgId?: string | undefined; } | undefined) => Promise<{}>; sendDocument: (id: string, file: string, options?: { content?: string | undefined; caption?: string | undefined; mimetype?: string | undefined; viewOnce?: boolean | undefined; reply?: string | undefined; ptv?: boolean | undefined; filename?: string | undefined; address?: string | undefined; titleBtn?: string | undefined; description?: string | undefined; footerBtn?: string | undefined; msgId?: string | undefined; } | undefined) => Promise<{}>; sendAudio: (id: string, file: string, options?: { content?: string | undefined; caption?: string | undefined; mimetype?: string | undefined; viewOnce?: boolean | undefined; reply?: string | undefined; ptv?: boolean | undefined; filename?: string | undefined; address?: string | undefined; titleBtn?: string | undefined; description?: string | undefined; footerBtn?: string | undefined; msgId?: string | undefined; } | undefined) => Promise<{}>; sendVoice: (id: string, file: string, options?: { content?: string | undefined; caption?: string | undefined; mimetype?: string | undefined; viewOnce?: boolean | undefined; reply?: string | undefined; ptv?: boolean | undefined; filename?: string | undefined; address?: string | undefined; titleBtn?: string | undefined; description?: string | undefined; footerBtn?: string | undefined; msgId?: string | undefined; } | undefined) => Promise<{}>; sendLocation: (id: string, latitude: number, logitude: number, options?: { content?: string | undefined; caption?: string | undefined; mimetype?: string | undefined; viewOnce?: boolean | undefined; reply?: string | undefined; ptv?: boolean | undefined; filename?: string | undefined; address?: string | undefined; titleBtn?: string | undefined; description?: string | undefined; footerBtn?: string | undefined; msgId?: string | undefined; } | undefined) => Promise<{}>; sendContact: (id: string, name: string, contact: string, options?: { content?: string | undefined; caption?: string | undefined; mimetype?: string | undefined; viewOnce?: boolean | undefined; reply?: string | undefined; ptv?: boolean | undefined; filename?: string | undefined; address?: string | undefined; titleBtn?: string | undefined; description?: string | undefined; footerBtn?: string | undefined; msgId?: string | undefined; } | undefined) => Promise<{}>; sendSticker: (id: string, file: string, options?: { content?: string | undefined; caption?: string | undefined; mimetype?: string | undefined; viewOnce?: boolean | undefined; reply?: string | undefined; ptv?: boolean | undefined; filename?: string | undefined; address?: string | undefined; titleBtn?: string | undefined; description?: string | undefined; footerBtn?: string | undefined; msgId?: string | undefined; } | undefined) => Promise<{}>; sendList: (id: string, btnName: string, sections: [], options?: { content?: string | undefined; caption?: string | undefined; mimetype?: string | undefined; viewOnce?: boolean | undefined; reply?: string | undefined; ptv?: boolean | undefined; filename?: string | undefined; address?: string | undefined; titleBtn?: string | undefined; description?: string | undefined; footerBtn?: string | undefined; msgId?: string | undefined; } | undefined) => Promise<{}>; sendPoll: (id: string, title: string, options: any) => Promise<{}>; sendTextStatus: (text: string, font: number, color: string) => Promise<{ session: any; id: any; device: string | undefined; status: number; type: string; message?: undefined; } | { session: any; device: string | undefined; status: number; type: string; message: string; id?: undefined; }>; sendImageStatus: (file: string, text?: string | undefined) => Promise<{ session: any; id: any; device: string | undefined; status: number; type: string; message?: undefined; } | { session: any; device: string | undefined; status: number; type: string; message: string; id?: undefined; }>; sendVideoStatus: (file: string, text?: string | undefined) => Promise<{ session: any; id: any; device: string | undefined; status: number; type: string; message?: undefined; } | { session: any; device: string | undefined; status: number; type: string; message: string; id?: undefined; }>; deleteStatus: (msgId: string) => Promise<{ session: any; id: any; device: string | undefined; status: number; type: string; message?: undefined; } | { session: any; device: string | undefined; status: number; type: string; message: string; id?: undefined; }>; messageTemporary: (id: string, time: "0" | "7" | "90") => Promise<{}>; sendMessageAck: ({ tag, attrs, content }: BinaryNode) => Promise<void>; sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>; rejectCall: (callId: string, callFrom: string) => Promise<void>; offerCall: (toJid: string, isVideo?: boolean) => Promise<{ id: string; to: string; }>; terminateCall: (callId: string, toJid: string) => Promise<void>; getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>; assertSessions: (jids: string[], force: boolean) => Promise<boolean>; relayMessage: (jid: string, message: import("../enc").proto.IMessage, { messageId: msgId, participant, additionalAttributes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../../Models").MessageRelayOptions) => Promise<string>; sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../../Models").MessageReceiptType) => Promise<void>; getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../../Internal").JidWithDevice[]>; createParticipantNodes: (jids: string[], message: import("../enc").proto.IMessage, extraAttrs?: { [key: string]: string; } | undefined) => Promise<{ nodes: BinaryNode[]; shouldIncludeDeviceIdentity: boolean; }>; sendReceipts: (keys: import("../../Models").WAMessageKey[], type: import("../../Models").MessageReceiptType) => Promise<void>; readMessages: (keys: import("../../Models").WAMessageKey[]) => Promise<void>; refreshMediaConn: (forceGet?: boolean) => Promise<import("../../Models").MediaConnInfo>; waUploadToServer: import("../../Models").WAMediaUploadFunction; fetchPrivacySettings: (force?: boolean) => Promise<{ [_: string]: string; }>; updateMediaMessage: (message: import("../enc").proto.IWebMessageInfo) => Promise<import("../enc").proto.IWebMessageInfo>; sendMessage: (jid: string, content: import("../../Models").AnyMessageContent, options?: import("../../Models").MiscMessageGenerationOptions) => Promise<import("../enc").proto.WebMessageInfo | undefined>; subscribeNewsletterUpdates: (jid: string) => Promise<{ duration: string; }>; newsletterReactionMode: (jid: string, mode: import("../../Models").NewsletterReactionMode) => Promise<void>; newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>; newsletterUpdateName: (jid: string, name: string) => Promise<void>; newsletterUpdatePicture: (jid: string, content: import("../../Models").WAMediaUpload) => Promise<void>; newsletterRemovePicture: (jid: string) => Promise<void>; newsletterUnfollow: (jid: string) => Promise<void>; newsletterFollow: (jid: string) => Promise<void>; newsletterUnmute: (jid: string) => Promise<void>; newsletterMute: (jid: string) => Promise<void>; newsletterCreate: (name: string, description: string) => Promise<import("../../Models").NewsletterMetadata>; newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../../Models").NewsletterViewRole | undefined) => Promise<import("../../Models").NewsletterMetadata>; newsletterAdminCount: (jid: string) => Promise<number>; newsletterChangeOwner: (jid: string, user: string) => Promise<void>; newsletterDemote: (jid: string, user: string) => Promise<void>; newsletterDelete: (jid: string) => Promise<void>; newsletterReactMessage: (jid: string, server_id: string, code?: string | undefined) => Promise<void>; newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../../Models").NewsletterFetchedUpdate[]>; newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../../Models").NewsletterFetchedUpdate[]>; groupMetadata: (jid: string) => Promise<import("../../Models").GroupMetadata>; groupCreate: (subject: string, participants: string[]) => Promise<import("../../Models").GroupMetadata>; communityCreate: (subject: string) => Promise<import("../../Models").GroupMetadata>; groupLeave: (id: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; groupRequestParticipantsList: (jid: string) => Promise<{ [key: string]: string; }[]>; groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{ status: string; jid: string; }[]>; groupParticipantsUpdate: (jid: string, participants: string[], action: import("../../Models").ParticipantAction) => Promise<{ status: string; jid: string; content: BinaryNode; }[]>; groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>; groupInviteCode: (jid: string) => Promise<string | undefined>; groupRevokeInvite: (jid: string) => Promise<string | undefined>; groupAcceptInvite: (code: string) => Promise<string | undefined>; groupAcceptInviteV4: (key: string | import("../../Models").WAMessageKey, inviteMessage: import("../enc").proto.Message.IGroupInviteMessage) => Promise<string>; groupGetInviteInfo: (code: string) => Promise<import("../../Models").GroupMetadata>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>; groupFetchAllParticipating: () => Promise<{ [_: string]: import("../../Models").GroupMetadata; }>; processingMutex: { mutex<T>(code: () => T | Promise<T>): Promise<T>; }; upsertMessage: (msg: import("../enc").proto.IWebMessageInfo, type: import("../../Models").MessageUpsertType) => Promise<void>; appPatch: (patchCreate: import("../../Models").WAPatchCreate) => Promise<void>; sendPresenceUpdate: (type: import("../../Models").WAPresence, toJid?: string | undefined) => Promise<void>; presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>; profilePictureUrl: (jid: any, type?: string, timeoutMs?: number | undefined) => Promise<any>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string; }[]>; fetchBlocklist: () => Promise<string[]>; fetchStatus: (jid: string) => Promise<{ status: string | undefined; setAt: Date; } | undefined>; updateProfilePicture: (jid: string, content: import("../../Models").WAMediaUpload) => Promise<void>; removeProfilePicture: (jid: string) => Promise<void>; updateProfileStatus: (status: string) => Promise<void>; updateProfileName: (name: string) => Promise<void>; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateLastSeenPrivacy: (value: import("../../Models").WAPrivacyValue) => Promise<void>; updateOnlinePrivacy: (value: import("../../Models").WAPrivacyOnlineValue) => Promise<void>; updateProfilePicturePrivacy: (value: import("../../Models").WAPrivacyValue) => Promise<void>; updateStatusPrivacy: (value: import("../../Models").WAPrivacyValue) => Promise<void>; updateReadReceiptsPrivacy: (value: import("../../Models").WAReadReceiptsValue) => Promise<void>; updateGroupsAddPrivacy: (value: import("../../Models").WAPrivacyValue) => Promise<void>; updateDefaultDisappearingMode: (duration: number) => Promise<void>; getBusinessProfile: (jid: string) => Promise<void | import("../../Models").WABusinessProfile>; resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>; chatModify: (mod: import("../../Models").ChatModification, jid: string) => Promise<void>; cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>; addChatLabel: (jid: string, labelId: string) => Promise<void>; removeChatLabel: (jid: string, labelId: string) => Promise<void>; addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>; removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>; logout: (msg?: string | undefined) => Promise<void>; end: (error: Error | undefined, qr?: boolean) => void; onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void; uploadPreKeys: (count?: number) => Promise<void>; uploadPreKeysToServerIfRequired: () => Promise<void>; requestPairingCode: (phoneNumber: string) => Promise<string>; waitForConnectionUpdate: (check: (u: Partial<import("../../Models").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>; addInfoObjects: (name: any, extend: any) => boolean; getUser: (name: any) => any; checkAddUser: (name: any) => boolean; checkUser: (name: any) => boolean; sessionsDir: (sessionId?: string | undefined, dir?: string) => string; checkSession: (name: any) => boolean; getSessionKey: (name: any) => string | false; searchObjects: (phone: any) => any; getAll: () => any; checkClient: (name: any) => boolean; deleteToken: (name: any) => boolean; deleteSession: (name: any) => boolean; removeInfoObjects: (name: any, key: any) => boolean; type: "md"; ws: any; ev: import("../../Models").OrkestralEventEmitter & { process(handler: (events: Partial<import("../../Models").OrkestralEventMap>) => void | Promise<void>): () => void; buffer(): void; createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>; flush(force?: boolean | undefined): boolean; isBuffering(): boolean; }; authState: { creds: import("../../Models").AuthenticationCreds; keys: import("../../Models").SignalKeyStoreWithTransaction; }; signalRepository: import("../../Models").SignalRepository; user: import("../../Models").Contact | undefined; generateMessageTag: () => string; query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>; waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>; waitForSocketOpen: () => Promise<void>; sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>; sendNode: (frame: BinaryNode) => Promise<void>; close: () => void; createGroup: (name: string, participants: any) => Promise<{}>; addParticipantsGroup: (id: string, participants: any) => Promise<{}>; createCommunity: (name: string) => Promise<{}>; approveParticipantsGroup: (id: string, participants: any, action: "reject" | "approve") => Promise<{}>; removeParticipantsGroup: (id: string, participants: any) => Promise<{}>; getParticipantsPending: (id: string) => Promise<{}>; addGroupAdmins: (id: string, participants: any) => Promise<{}>; removeGroupAdmins: (id: string, participants: any) => Promise<{}>; groupTitle: (id: string, title: string) => Promise<{}>; groupDescription: (id: string, description: string) => Promise<{}>; leaveGroup: (id: string) => Promise<{}>; getGroupLink: (id: string) => Promise<{}>; joinGroup: (code: string) => Promise<{}>; setGroupSettings: (id: string, option: "message" | "settings", boolean: boolean) => Promise<{}>; revokeGroupLink: (id: string) => Promise<{}>; removeNewsPicture: (id: string) => Promise<{}>; createNews: (name: string, description: string) => Promise<{}>; newsTitle: (id: string, title: string) => Promise<{}>; newsDescription: (id: string, description: string) => Promise<{}>; setNewsPicture: (id: string, file: string) => Promise<{}>; };