@kelvdra/baileys 1.0.3 → 1.0.4
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/README.md +75 -1499
- package/lib/Defaults/index.d.ts +62 -0
- package/lib/Defaults/index.js +2 -2
- package/lib/Defaults/phonenumber-mcc.json +223 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +10 -0
- package/lib/Signal/Group/group-session-builder.d.ts +15 -0
- package/lib/Signal/Group/group_cipher.d.ts +17 -0
- package/lib/Signal/Group/index.d.ts +12 -0
- package/lib/Signal/Group/keyhelper.d.ts +11 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +14 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
- package/lib/Signal/Group/sender-key-message.d.ts +19 -0
- package/lib/Signal/Group/sender-key-name.d.ts +18 -0
- package/lib/Signal/Group/sender-key-record.d.ts +31 -0
- package/lib/Signal/Group/sender-key-state.d.ts +39 -0
- package/lib/Signal/Group/sender-message-key.d.ts +12 -0
- package/lib/Signal/libsignal.d.ts +5 -0
- package/lib/Signal/lid-mapping.d.ts +23 -0
- package/lib/Socket/Client/index.d.ts +3 -0
- package/lib/Socket/Client/types.d.ts +16 -0
- package/lib/Socket/Client/websocket.d.ts +13 -0
- package/lib/Socket/business.d.ts +190 -0
- package/lib/Socket/chats.d.ts +100 -0
- package/lib/Socket/chats.js +14 -13
- package/lib/Socket/communities.d.ts +246 -0
- package/lib/Socket/groups.d.ts +139 -0
- package/lib/Socket/groups.js +2 -3
- package/lib/Socket/hydra.js +1 -2
- package/lib/Socket/index.d.ts +233 -0
- package/lib/Socket/messages-recv.d.ts +175 -0
- package/lib/Socket/messages-recv.js +325 -515
- package/lib/Socket/messages-send.d.ts +171 -0
- package/lib/Socket/messages-send.js +104 -467
- package/lib/Socket/mex.d.ts +3 -0
- package/lib/Socket/newsletter.d.ts +149 -0
- package/lib/Socket/socket.d.ts +53 -0
- package/lib/Socket/socket.js +52 -51
- package/lib/Store/index.d.ts +4 -0
- package/lib/Store/make-cache-manager-store.d.ts +14 -0
- package/lib/Store/make-in-memory-store.d.ts +123 -0
- package/lib/Store/make-ordered-dictionary.d.ts +12 -0
- package/lib/Store/object-repository.d.ts +10 -0
- package/lib/Types/Auth.d.ts +115 -0
- package/lib/Types/Bussines.d.ts +25 -0
- package/lib/Types/Call.d.ts +14 -0
- package/lib/Types/Chat.d.ts +123 -0
- package/lib/Types/Contact.d.ts +24 -0
- package/lib/Types/Events.d.ts +202 -0
- package/lib/Types/GroupMetadata.d.ts +67 -0
- package/lib/Types/Label.d.ts +47 -0
- package/lib/Types/LabelAssociation.d.ts +30 -0
- package/lib/Types/Message.d.ts +382 -0
- package/lib/Types/Newsletter.d.ts +135 -0
- package/lib/Types/Product.d.ts +79 -0
- package/lib/Types/Signal.d.ts +76 -0
- package/lib/Types/Socket.d.ts +133 -0
- package/lib/Types/State.d.ts +39 -0
- package/lib/Types/USync.d.ts +26 -0
- package/lib/Types/index.d.ts +65 -0
- package/lib/Utils/auth-utils.d.ts +19 -0
- package/lib/Utils/browser-utils.d.ts +4 -0
- package/lib/Utils/business.d.ts +23 -0
- package/lib/Utils/chat-utils.d.ts +70 -0
- package/lib/Utils/crypto.d.ts +41 -0
- package/lib/Utils/decode-wa-message.d.ts +48 -0
- package/lib/Utils/decode-wa-message.js +5 -7
- package/lib/Utils/event-buffer.d.ts +34 -0
- package/lib/Utils/generics.d.ts +90 -0
- package/lib/Utils/history.d.ts +19 -0
- package/lib/Utils/index.d.ts +19 -0
- package/lib/Utils/link-preview.d.ts +21 -0
- package/lib/Utils/logger.d.ts +12 -0
- package/lib/Utils/lt-hash.d.ts +13 -0
- package/lib/Utils/make-mutex.d.ts +8 -0
- package/lib/Utils/message-retry-manager.d.ts +82 -0
- package/lib/Utils/messages-media.d.ts +114 -0
- package/lib/Utils/messages-media.js +69 -33
- package/lib/Utils/messages.d.ts +89 -0
- package/lib/Utils/messages.js +42 -12
- package/lib/Utils/noise-handler.d.ts +20 -0
- package/lib/Utils/pre-key-manager.d.ts +28 -0
- package/lib/Utils/process-message.d.ts +60 -0
- package/lib/Utils/signal.d.ts +34 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +13 -0
- package/lib/Utils/validate-connection.d.ts +11 -0
- package/lib/WABinary/constants.d.ts +28 -0
- package/lib/WABinary/decode.d.ts +7 -0
- package/lib/WABinary/encode.d.ts +3 -0
- package/lib/WABinary/generic-utils.d.ts +15 -0
- package/lib/WABinary/generic-utils.js +7 -0
- package/lib/WABinary/index.d.ts +6 -0
- package/lib/WABinary/jid-utils.d.ts +48 -0
- package/lib/WABinary/types.d.ts +19 -0
- package/lib/WAM/BinaryInfo.d.ts +9 -0
- package/lib/WAM/constants.d.ts +40 -0
- package/lib/WAM/encode.d.ts +3 -0
- package/lib/WAM/index.d.ts +4 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +10 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +26 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +10 -0
- package/lib/WAUSync/Protocols/index.d.ts +5 -0
- package/lib/WAUSync/USyncQuery.d.ts +29 -0
- package/lib/WAUSync/USyncUser.d.ts +13 -0
- package/lib/WAUSync/index.d.ts +4 -0
- package/lib/index.d.ts +13 -0
- package/package.json +3 -34
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { Agent } from 'https';
|
|
2
|
+
import type { URL } from 'url';
|
|
3
|
+
import { proto } from '../../WAProto/index.js';
|
|
4
|
+
import type { ILogger } from '../Utils/logger.js';
|
|
5
|
+
import type { AuthenticationState, LIDMapping, SignalAuthState, TransactionCapabilityOptions } from './Auth.js';
|
|
6
|
+
import type { GroupMetadata } from './GroupMetadata.js';
|
|
7
|
+
import { type MediaConnInfo, type WAMessageKey } from './Message.js';
|
|
8
|
+
import type { SignalRepositoryWithLIDStore } from './Signal.js';
|
|
9
|
+
export type WAVersion = [number, number, number];
|
|
10
|
+
export type WABrowserDescription = [string, string, string];
|
|
11
|
+
export type CacheStore = {
|
|
12
|
+
/** get a cached key and change the stats */
|
|
13
|
+
get<T>(key: string): Promise<T> | T | undefined;
|
|
14
|
+
/** set a key in the cache */
|
|
15
|
+
set<T>(key: string, value: T): Promise<void> | void | number | boolean;
|
|
16
|
+
/** delete a key from the cache */
|
|
17
|
+
del(key: string): void | Promise<void> | number | boolean;
|
|
18
|
+
/** flush all data */
|
|
19
|
+
flushAll(): void | Promise<void>;
|
|
20
|
+
};
|
|
21
|
+
export type PossiblyExtendedCacheStore = CacheStore & {
|
|
22
|
+
mget?: <T>(keys: string[]) => Promise<Record<string, T | undefined>>;
|
|
23
|
+
mset?: <T>(entries: {
|
|
24
|
+
key: string;
|
|
25
|
+
value: T;
|
|
26
|
+
}[]) => Promise<void> | void | number | boolean;
|
|
27
|
+
mdel?: (keys: string[]) => void | Promise<void> | number | boolean;
|
|
28
|
+
};
|
|
29
|
+
export type PatchedMessageWithRecipientJID = proto.IMessage & {
|
|
30
|
+
recipientJid?: string;
|
|
31
|
+
};
|
|
32
|
+
export type SocketConfig = {
|
|
33
|
+
/** the WS url to connect to WA */
|
|
34
|
+
waWebSocketUrl: string | URL;
|
|
35
|
+
/** Fails the connection if the socket times out in this interval */
|
|
36
|
+
connectTimeoutMs: number;
|
|
37
|
+
/** Default timeout for queries, undefined for no timeout */
|
|
38
|
+
defaultQueryTimeoutMs: number | undefined;
|
|
39
|
+
/** ping-pong interval for WS connection */
|
|
40
|
+
keepAliveIntervalMs: number;
|
|
41
|
+
/** should baileys use the mobile api instead of the multi device api
|
|
42
|
+
* @deprecated This feature has been removed
|
|
43
|
+
*/
|
|
44
|
+
mobile?: boolean;
|
|
45
|
+
/** proxy agent */
|
|
46
|
+
agent?: Agent;
|
|
47
|
+
/** logger */
|
|
48
|
+
logger: ILogger;
|
|
49
|
+
/** version to connect with */
|
|
50
|
+
version: WAVersion;
|
|
51
|
+
/** override browser config */
|
|
52
|
+
browser: WABrowserDescription;
|
|
53
|
+
/** agent used for fetch requests -- uploading/downloading media */
|
|
54
|
+
fetchAgent?: Agent;
|
|
55
|
+
/** should the QR be printed in the terminal
|
|
56
|
+
* @deprecated This feature has been removed
|
|
57
|
+
*/
|
|
58
|
+
printQRInTerminal?: boolean;
|
|
59
|
+
/** should events be emitted for actions done by this socket connection */
|
|
60
|
+
emitOwnEvents: boolean;
|
|
61
|
+
/** custom upload hosts to upload media to */
|
|
62
|
+
customUploadHosts: MediaConnInfo['hosts'];
|
|
63
|
+
/** time to wait between sending new retry requests */
|
|
64
|
+
retryRequestDelayMs: number;
|
|
65
|
+
/** max retry count */
|
|
66
|
+
maxMsgRetryCount: number;
|
|
67
|
+
/** time to wait for the generation of the next QR in ms */
|
|
68
|
+
qrTimeout?: number;
|
|
69
|
+
/** provide an auth state object to maintain the auth state */
|
|
70
|
+
auth: AuthenticationState;
|
|
71
|
+
/** manage history processing with this control; by default will sync up everything */
|
|
72
|
+
shouldSyncHistoryMessage: (msg: proto.Message.IHistorySyncNotification) => boolean;
|
|
73
|
+
/** transaction capability options for SignalKeyStore */
|
|
74
|
+
transactionOpts: TransactionCapabilityOptions;
|
|
75
|
+
/** marks the client as online whenever the socket successfully connects */
|
|
76
|
+
markOnlineOnConnect: boolean;
|
|
77
|
+
/** alphanumeric country code (USA -> US) for the number used */
|
|
78
|
+
countryCode: string;
|
|
79
|
+
/** provide a cache to store media, so does not have to be re-uploaded */
|
|
80
|
+
mediaCache?: CacheStore;
|
|
81
|
+
/**
|
|
82
|
+
* map to store the retry counts for failed messages;
|
|
83
|
+
* used to determine whether to retry a message or not */
|
|
84
|
+
msgRetryCounterCache?: CacheStore;
|
|
85
|
+
/** provide a cache to store a user's device list */
|
|
86
|
+
userDevicesCache?: PossiblyExtendedCacheStore;
|
|
87
|
+
/** cache to store call offers */
|
|
88
|
+
callOfferCache?: CacheStore;
|
|
89
|
+
/** cache to track placeholder resends */
|
|
90
|
+
placeholderResendCache?: CacheStore;
|
|
91
|
+
/** width for link preview images */
|
|
92
|
+
linkPreviewImageThumbnailWidth: number;
|
|
93
|
+
/** Should Baileys ask the phone for full history, will be received async */
|
|
94
|
+
syncFullHistory: boolean;
|
|
95
|
+
/** Should baileys fire init queries automatically, default true */
|
|
96
|
+
fireInitQueries: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* generate a high quality link preview,
|
|
99
|
+
* entails uploading the jpegThumbnail to WA
|
|
100
|
+
* */
|
|
101
|
+
generateHighQualityLinkPreview: boolean;
|
|
102
|
+
/** Enable automatic session recreation for failed messages */
|
|
103
|
+
enableAutoSessionRecreation: boolean;
|
|
104
|
+
/** Enable recent message caching for retry handling */
|
|
105
|
+
enableRecentMessageCache: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Returns if a jid should be ignored,
|
|
108
|
+
* no event for that jid will be triggered.
|
|
109
|
+
* Messages from that jid will also not be decrypted
|
|
110
|
+
* */
|
|
111
|
+
shouldIgnoreJid: (jid: string) => boolean | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* Optionally patch the message before sending out
|
|
114
|
+
* */
|
|
115
|
+
patchMessageBeforeSending: (msg: proto.IMessage, recipientJids?: string[]) => Promise<PatchedMessageWithRecipientJID[] | PatchedMessageWithRecipientJID> | PatchedMessageWithRecipientJID[] | PatchedMessageWithRecipientJID;
|
|
116
|
+
/** verify app state MACs */
|
|
117
|
+
appStateMacVerification: {
|
|
118
|
+
patch: boolean;
|
|
119
|
+
snapshot: boolean;
|
|
120
|
+
};
|
|
121
|
+
/** options for HTTP fetch requests */
|
|
122
|
+
options: RequestInit;
|
|
123
|
+
/**
|
|
124
|
+
* fetch a message from your store
|
|
125
|
+
* implement this so that messages failed to send
|
|
126
|
+
* (solves the "this message can take a while" issue) can be retried
|
|
127
|
+
* */
|
|
128
|
+
getMessage: (key: WAMessageKey) => Promise<proto.IMessage | undefined>;
|
|
129
|
+
/** cached group metadata, use to prevent redundant requests to WA & speed up msg sending */
|
|
130
|
+
cachedGroupMetadata: (jid: string) => Promise<GroupMetadata | undefined>;
|
|
131
|
+
makeSignalRepository: (auth: SignalAuthState, logger: ILogger, pnToLIDFunc?: (jids: string[]) => Promise<LIDMapping[] | undefined>) => SignalRepositoryWithLIDStore;
|
|
132
|
+
};
|
|
133
|
+
//# sourceMappingURL=Socket.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Boom } from '@hapi/boom';
|
|
2
|
+
import type { Contact } from './Contact.js';
|
|
3
|
+
export declare enum SyncState {
|
|
4
|
+
/** The socket is connecting, but we haven't received pending notifications yet. */
|
|
5
|
+
Connecting = 0,
|
|
6
|
+
/** Pending notifications received. Buffering events until we decide whether to sync or not. */
|
|
7
|
+
AwaitingInitialSync = 1,
|
|
8
|
+
/** The initial app state sync (history, etc.) is in progress. Buffering continues. */
|
|
9
|
+
Syncing = 2,
|
|
10
|
+
/** Initial sync is complete, or was skipped. The socket is fully operational and events are processed in real-time. */
|
|
11
|
+
Online = 3
|
|
12
|
+
}
|
|
13
|
+
export type WAConnectionState = 'open' | 'connecting' | 'close';
|
|
14
|
+
export type ConnectionState = {
|
|
15
|
+
/** connection is now open, connecting or closed */
|
|
16
|
+
connection: WAConnectionState;
|
|
17
|
+
/** the error that caused the connection to close */
|
|
18
|
+
lastDisconnect?: {
|
|
19
|
+
error: Boom | Error | undefined;
|
|
20
|
+
date: Date;
|
|
21
|
+
};
|
|
22
|
+
/** is this a new login */
|
|
23
|
+
isNewLogin?: boolean;
|
|
24
|
+
/** the current QR code */
|
|
25
|
+
qr?: string;
|
|
26
|
+
/** has the device received all pending notifications while it was offline */
|
|
27
|
+
receivedPendingNotifications?: boolean;
|
|
28
|
+
/** legacy connection options */
|
|
29
|
+
legacy?: {
|
|
30
|
+
phoneConnected: boolean;
|
|
31
|
+
user?: Contact;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* if the client is shown as an active, online client.
|
|
35
|
+
* If this is false, the primary phone and other devices will receive notifs
|
|
36
|
+
* */
|
|
37
|
+
isOnline?: boolean;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=State.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BinaryNode } from '../WABinary/index.js';
|
|
2
|
+
import { USyncUser } from '../WAUSync/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Defines the interface for a USyncQuery protocol
|
|
5
|
+
*/
|
|
6
|
+
export interface USyncQueryProtocol {
|
|
7
|
+
/**
|
|
8
|
+
* The name of the protocol
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* Defines what goes inside the query part of a USyncQuery
|
|
13
|
+
*/
|
|
14
|
+
getQueryElement: () => BinaryNode;
|
|
15
|
+
/**
|
|
16
|
+
* Defines what goes inside the user part of a USyncQuery
|
|
17
|
+
*/
|
|
18
|
+
getUserElement: (user: USyncUser) => BinaryNode | null;
|
|
19
|
+
/**
|
|
20
|
+
* Parse the result of the query
|
|
21
|
+
* @param data Data from the result
|
|
22
|
+
* @returns Whatever the protocol is supposed to return
|
|
23
|
+
*/
|
|
24
|
+
parser: (data: BinaryNode) => unknown;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=USync.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export * from './Auth.js';
|
|
2
|
+
export * from './GroupMetadata.js';
|
|
3
|
+
export * from './Chat.js';
|
|
4
|
+
export * from './Contact.js';
|
|
5
|
+
export * from './State.js';
|
|
6
|
+
export * from './Message.js';
|
|
7
|
+
export * from './Socket.js';
|
|
8
|
+
export * from './Events.js';
|
|
9
|
+
export * from './Product.js';
|
|
10
|
+
export * from './Call.js';
|
|
11
|
+
export * from './Signal.js';
|
|
12
|
+
export * from './Newsletter.js';
|
|
13
|
+
import type { AuthenticationState } from './Auth.js';
|
|
14
|
+
import type { SocketConfig } from './Socket.js';
|
|
15
|
+
export type UserFacingSocketConfig = Partial<SocketConfig> & {
|
|
16
|
+
auth: AuthenticationState;
|
|
17
|
+
};
|
|
18
|
+
export type BrowsersMap = {
|
|
19
|
+
ubuntu(browser: string): [string, string, string];
|
|
20
|
+
macOS(browser: string): [string, string, string];
|
|
21
|
+
baileys(browser: string): [string, string, string];
|
|
22
|
+
windows(browser: string): [string, string, string];
|
|
23
|
+
appropriate(browser: string): [string, string, string];
|
|
24
|
+
};
|
|
25
|
+
export declare enum DisconnectReason {
|
|
26
|
+
connectionClosed = 428,
|
|
27
|
+
connectionLost = 408,
|
|
28
|
+
connectionReplaced = 440,
|
|
29
|
+
timedOut = 408,
|
|
30
|
+
loggedOut = 401,
|
|
31
|
+
badSession = 500,
|
|
32
|
+
restartRequired = 515,
|
|
33
|
+
multideviceMismatch = 411,
|
|
34
|
+
forbidden = 403,
|
|
35
|
+
unavailableService = 503
|
|
36
|
+
}
|
|
37
|
+
export type WAInitResponse = {
|
|
38
|
+
ref: string;
|
|
39
|
+
ttl: number;
|
|
40
|
+
status: 200;
|
|
41
|
+
};
|
|
42
|
+
export type WABusinessHoursConfig = {
|
|
43
|
+
day_of_week: string;
|
|
44
|
+
mode: string;
|
|
45
|
+
open_time?: number;
|
|
46
|
+
close_time?: number;
|
|
47
|
+
};
|
|
48
|
+
export type WABusinessProfile = {
|
|
49
|
+
description: string;
|
|
50
|
+
email: string | undefined;
|
|
51
|
+
business_hours: {
|
|
52
|
+
timezone?: string;
|
|
53
|
+
config?: WABusinessHoursConfig[];
|
|
54
|
+
business_config?: WABusinessHoursConfig[];
|
|
55
|
+
};
|
|
56
|
+
website: string[];
|
|
57
|
+
category?: string;
|
|
58
|
+
wid?: string;
|
|
59
|
+
address?: string;
|
|
60
|
+
};
|
|
61
|
+
export type CurveKeyPair = {
|
|
62
|
+
private: Uint8Array;
|
|
63
|
+
public: Uint8Array;
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AuthenticationCreds, CacheStore, SignalKeyStore, SignalKeyStoreWithTransaction, TransactionCapabilityOptions } from '../Types/index.js';
|
|
2
|
+
import type { ILogger } from './logger.js';
|
|
3
|
+
/**
|
|
4
|
+
* Adds caching capability to a SignalKeyStore
|
|
5
|
+
* @param store the store to add caching to
|
|
6
|
+
* @param logger to log trace events
|
|
7
|
+
* @param _cache cache store to use
|
|
8
|
+
*/
|
|
9
|
+
export declare function makeCacheableSignalKeyStore(store: SignalKeyStore, logger?: ILogger, _cache?: CacheStore): SignalKeyStore;
|
|
10
|
+
/**
|
|
11
|
+
* Adds DB-like transaction capability to the SignalKeyStore
|
|
12
|
+
* Uses AsyncLocalStorage for automatic context management
|
|
13
|
+
* @param state the key store to apply this capability to
|
|
14
|
+
* @param logger logger to log events
|
|
15
|
+
* @returns SignalKeyStore with transaction capability
|
|
16
|
+
*/
|
|
17
|
+
export declare const addTransactionCapability: (state: SignalKeyStore, logger: ILogger, { maxCommitRetries, delayBetweenTriesMs }: TransactionCapabilityOptions) => SignalKeyStoreWithTransaction;
|
|
18
|
+
export declare const initAuthCreds: () => AuthenticationCreds;
|
|
19
|
+
//# sourceMappingURL=auth-utils.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CatalogCollection, OrderDetails, Product, ProductCreate, ProductUpdate, WAMediaUpload, WAMediaUploadFunction } from '../Types/index.js';
|
|
2
|
+
import { type BinaryNode } from '../WABinary/index.js';
|
|
3
|
+
export declare const parseCatalogNode: (node: BinaryNode) => {
|
|
4
|
+
products: Product[];
|
|
5
|
+
nextPageCursor: string | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare const parseCollectionsNode: (node: BinaryNode) => {
|
|
8
|
+
collections: CatalogCollection[];
|
|
9
|
+
};
|
|
10
|
+
export declare const parseOrderDetailsNode: (node: BinaryNode) => OrderDetails;
|
|
11
|
+
export declare const toProductNode: (productId: string | undefined, product: ProductCreate | ProductUpdate) => BinaryNode;
|
|
12
|
+
export declare const parseProductNode: (productNode: BinaryNode) => Product;
|
|
13
|
+
/**
|
|
14
|
+
* Uploads images not already uploaded to WA's servers
|
|
15
|
+
*/
|
|
16
|
+
export declare function uploadingNecessaryImagesOfProduct<T extends ProductUpdate | ProductCreate>(product: T, waUploadToServer: WAMediaUploadFunction, timeoutMs?: number): Promise<T>;
|
|
17
|
+
/**
|
|
18
|
+
* Uploads images not already uploaded to WA's servers
|
|
19
|
+
*/
|
|
20
|
+
export declare const uploadingNecessaryImages: (images: WAMediaUpload[], waUploadToServer: WAMediaUploadFunction, timeoutMs?: number) => Promise<{
|
|
21
|
+
url: string;
|
|
22
|
+
}[]>;
|
|
23
|
+
//# sourceMappingURL=business.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { proto } from '../../WAProto/index.js';
|
|
2
|
+
import type { BaileysEventEmitter, ChatModification, ChatMutation, Contact, InitialAppStateSyncOptions, LTHashState, WAPatchCreate, WAPatchName } from '../Types/index.js';
|
|
3
|
+
import { type BinaryNode } from '../WABinary/index.js';
|
|
4
|
+
import type { ILogger } from './logger.js';
|
|
5
|
+
type FetchAppStateSyncKey = (keyId: string) => Promise<proto.Message.IAppStateSyncKeyData | null | undefined>;
|
|
6
|
+
export type ChatMutationMap = {
|
|
7
|
+
[index: string]: ChatMutation;
|
|
8
|
+
};
|
|
9
|
+
export declare const newLTHashState: () => LTHashState;
|
|
10
|
+
export declare const encodeSyncdPatch: ({ type, index, syncAction, apiVersion, operation }: WAPatchCreate, myAppStateKeyId: string, state: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey) => Promise<{
|
|
11
|
+
patch: proto.ISyncdPatch;
|
|
12
|
+
state: LTHashState;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const decodeSyncdMutations: (msgMutations: (proto.ISyncdMutation | proto.ISyncdRecord)[], initialState: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, onMutation: (mutation: ChatMutation) => void, validateMacs: boolean) => Promise<{
|
|
15
|
+
hash: Buffer<ArrayBuffer>;
|
|
16
|
+
indexValueMap: {
|
|
17
|
+
[indexMacBase64: string]: {
|
|
18
|
+
valueMac: Uint8Array | Buffer;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}>;
|
|
22
|
+
export declare const decodeSyncdPatch: (msg: proto.ISyncdPatch, name: WAPatchName, initialState: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, onMutation: (mutation: ChatMutation) => void, validateMacs: boolean) => Promise<{
|
|
23
|
+
hash: Buffer<ArrayBuffer>;
|
|
24
|
+
indexValueMap: {
|
|
25
|
+
[indexMacBase64: string]: {
|
|
26
|
+
valueMac: Uint8Array | Buffer;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
30
|
+
export declare const extractSyncdPatches: (result: BinaryNode, options: RequestInit) => Promise<{
|
|
31
|
+
critical_unblock_low: {
|
|
32
|
+
patches: proto.ISyncdPatch[];
|
|
33
|
+
hasMorePatches: boolean;
|
|
34
|
+
snapshot?: proto.ISyncdSnapshot;
|
|
35
|
+
};
|
|
36
|
+
regular_high: {
|
|
37
|
+
patches: proto.ISyncdPatch[];
|
|
38
|
+
hasMorePatches: boolean;
|
|
39
|
+
snapshot?: proto.ISyncdSnapshot;
|
|
40
|
+
};
|
|
41
|
+
regular_low: {
|
|
42
|
+
patches: proto.ISyncdPatch[];
|
|
43
|
+
hasMorePatches: boolean;
|
|
44
|
+
snapshot?: proto.ISyncdSnapshot;
|
|
45
|
+
};
|
|
46
|
+
critical_block: {
|
|
47
|
+
patches: proto.ISyncdPatch[];
|
|
48
|
+
hasMorePatches: boolean;
|
|
49
|
+
snapshot?: proto.ISyncdSnapshot;
|
|
50
|
+
};
|
|
51
|
+
regular: {
|
|
52
|
+
patches: proto.ISyncdPatch[];
|
|
53
|
+
hasMorePatches: boolean;
|
|
54
|
+
snapshot?: proto.ISyncdSnapshot;
|
|
55
|
+
};
|
|
56
|
+
}>;
|
|
57
|
+
export declare const downloadExternalBlob: (blob: proto.IExternalBlobReference, options: RequestInit) => Promise<Buffer<ArrayBuffer>>;
|
|
58
|
+
export declare const downloadExternalPatch: (blob: proto.IExternalBlobReference, options: RequestInit) => Promise<proto.SyncdMutations>;
|
|
59
|
+
export declare const decodeSyncdSnapshot: (name: WAPatchName, snapshot: proto.ISyncdSnapshot, getAppStateSyncKey: FetchAppStateSyncKey, minimumVersionNumber: number | undefined, validateMacs?: boolean) => Promise<{
|
|
60
|
+
state: LTHashState;
|
|
61
|
+
mutationMap: ChatMutationMap;
|
|
62
|
+
}>;
|
|
63
|
+
export declare const decodePatches: (name: WAPatchName, syncds: proto.ISyncdPatch[], initial: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, options: RequestInit, minimumVersionNumber?: number, logger?: ILogger, validateMacs?: boolean) => Promise<{
|
|
64
|
+
state: LTHashState;
|
|
65
|
+
mutationMap: ChatMutationMap;
|
|
66
|
+
}>;
|
|
67
|
+
export declare const chatModificationToAppPatch: (mod: ChatModification, jid: string) => WAPatchCreate;
|
|
68
|
+
export declare const processSyncAction: (syncAction: ChatMutation, ev: BaileysEventEmitter, me: Contact, initialSyncOpts?: InitialAppStateSyncOptions, logger?: ILogger) => void;
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=chat-utils.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { KeyPair } from '../Types/index.js';
|
|
2
|
+
/** prefix version byte to the pub keys, required for some curve crypto functions */
|
|
3
|
+
export declare const generateSignalPubKey: (pubKey: Uint8Array | Buffer) => Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>;
|
|
4
|
+
export declare const Curve: {
|
|
5
|
+
generateKeyPair: () => KeyPair;
|
|
6
|
+
sharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Buffer<ArrayBuffer>;
|
|
7
|
+
sign: (privateKey: Uint8Array, buf: Uint8Array) => Uint8Array<ArrayBufferLike>;
|
|
8
|
+
verify: (pubKey: Uint8Array, message: Uint8Array, signature: Uint8Array) => boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const signedKeyPair: (identityKeyPair: KeyPair, keyId: number) => {
|
|
11
|
+
keyPair: KeyPair;
|
|
12
|
+
signature: Uint8Array<ArrayBufferLike>;
|
|
13
|
+
keyId: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* encrypt AES 256 GCM;
|
|
17
|
+
* where the tag tag is suffixed to the ciphertext
|
|
18
|
+
* */
|
|
19
|
+
export declare function aesEncryptGCM(plaintext: Uint8Array, key: Uint8Array, iv: Uint8Array, additionalData: Uint8Array): Buffer<ArrayBuffer>;
|
|
20
|
+
/**
|
|
21
|
+
* decrypt AES 256 GCM;
|
|
22
|
+
* where the auth tag is suffixed to the ciphertext
|
|
23
|
+
* */
|
|
24
|
+
export declare function aesDecryptGCM(ciphertext: Uint8Array, key: Uint8Array, iv: Uint8Array, additionalData: Uint8Array): Buffer<ArrayBuffer>;
|
|
25
|
+
export declare function aesEncryptCTR(plaintext: Uint8Array, key: Uint8Array, iv: Uint8Array): Buffer<ArrayBuffer>;
|
|
26
|
+
export declare function aesDecryptCTR(ciphertext: Uint8Array, key: Uint8Array, iv: Uint8Array): Buffer<ArrayBuffer>;
|
|
27
|
+
/** decrypt AES 256 CBC; where the IV is prefixed to the buffer */
|
|
28
|
+
export declare function aesDecrypt(buffer: Buffer, key: Buffer): Buffer<ArrayBuffer>;
|
|
29
|
+
/** decrypt AES 256 CBC */
|
|
30
|
+
export declare function aesDecryptWithIV(buffer: Buffer, key: Buffer, IV: Buffer): Buffer<ArrayBuffer>;
|
|
31
|
+
export declare function aesEncrypt(buffer: Buffer | Uint8Array, key: Buffer): Buffer<ArrayBuffer>;
|
|
32
|
+
export declare function aesEncrypWithIV(buffer: Buffer, key: Buffer, IV: Buffer): Buffer<ArrayBuffer>;
|
|
33
|
+
export declare function hmacSign(buffer: Buffer | Uint8Array, key: Buffer | Uint8Array, variant?: 'sha256' | 'sha512'): Buffer<ArrayBufferLike>;
|
|
34
|
+
export declare function sha256(buffer: Buffer): Buffer<ArrayBufferLike>;
|
|
35
|
+
export declare function md5(buffer: Buffer): Buffer<ArrayBufferLike>;
|
|
36
|
+
export declare function hkdf(buffer: Uint8Array | Buffer, expandedLength: number, info: {
|
|
37
|
+
salt?: Buffer;
|
|
38
|
+
info?: string;
|
|
39
|
+
}): Promise<Buffer>;
|
|
40
|
+
export declare function derivePairingCodeKey(pairingCode: string, salt: Buffer): Promise<Buffer>;
|
|
41
|
+
//# sourceMappingURL=crypto.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { WAMessage } from '../Types/index.js';
|
|
2
|
+
import type { SignalRepositoryWithLIDStore } from '../Types/Signal.js';
|
|
3
|
+
import { type BinaryNode } from '../WABinary/index.js';
|
|
4
|
+
import type { ILogger } from './logger.js';
|
|
5
|
+
export declare const getDecryptionJid: (sender: string, repository: SignalRepositoryWithLIDStore) => Promise<string>;
|
|
6
|
+
export declare const NO_MESSAGE_FOUND_ERROR_TEXT = "Message absent from node";
|
|
7
|
+
export declare const MISSING_KEYS_ERROR_TEXT = "Key used already or never filled";
|
|
8
|
+
export declare const DECRYPTION_RETRY_CONFIG: {
|
|
9
|
+
maxRetries: number;
|
|
10
|
+
baseDelayMs: number;
|
|
11
|
+
sessionRecordErrors: string[];
|
|
12
|
+
};
|
|
13
|
+
export declare const NACK_REASONS: {
|
|
14
|
+
ParsingError: number;
|
|
15
|
+
UnrecognizedStanza: number;
|
|
16
|
+
UnrecognizedStanzaClass: number;
|
|
17
|
+
UnrecognizedStanzaType: number;
|
|
18
|
+
InvalidProtobuf: number;
|
|
19
|
+
InvalidHostedCompanionStanza: number;
|
|
20
|
+
MissingMessageSecret: number;
|
|
21
|
+
SignalErrorOldCounter: number;
|
|
22
|
+
MessageDeletedOnPeer: number;
|
|
23
|
+
UnhandledError: number;
|
|
24
|
+
UnsupportedAdminRevoke: number;
|
|
25
|
+
UnsupportedLIDGroup: number;
|
|
26
|
+
DBOperationFailed: number;
|
|
27
|
+
};
|
|
28
|
+
export declare const extractAddressingContext: (stanza: BinaryNode) => {
|
|
29
|
+
addressingMode: string;
|
|
30
|
+
senderAlt: string | undefined;
|
|
31
|
+
recipientAlt: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Decode the received node as a message.
|
|
35
|
+
* @note this will only parse the message, not decrypt it
|
|
36
|
+
*/
|
|
37
|
+
export declare function decodeMessageNode(stanza: BinaryNode, meId: string, meLid: string): {
|
|
38
|
+
fullMessage: WAMessage;
|
|
39
|
+
author: string;
|
|
40
|
+
sender: string;
|
|
41
|
+
};
|
|
42
|
+
export declare const decryptMessageNode: (stanza: BinaryNode, meId: string, meLid: string, repository: SignalRepositoryWithLIDStore, logger: ILogger) => {
|
|
43
|
+
fullMessage: WAMessage;
|
|
44
|
+
category: string | undefined;
|
|
45
|
+
author: string;
|
|
46
|
+
decrypt(): Promise<void>;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=decode-wa-message.d.ts.map
|
|
@@ -137,9 +137,6 @@ export function decodeMessageNode(stanza, meId, meLid) {
|
|
|
137
137
|
msgType = 'newsletter';
|
|
138
138
|
chatId = from;
|
|
139
139
|
author = from;
|
|
140
|
-
if (isMe(from) || isMeLid(from)) {
|
|
141
|
-
fromMe = true;
|
|
142
|
-
}
|
|
143
140
|
}
|
|
144
141
|
else {
|
|
145
142
|
throw new Boom('Unknown message type', { data: stanza });
|
|
@@ -147,12 +144,13 @@ export function decodeMessageNode(stanza, meId, meLid) {
|
|
|
147
144
|
const pushname = stanza?.attrs?.notify;
|
|
148
145
|
const key = {
|
|
149
146
|
remoteJid: chatId,
|
|
150
|
-
remoteJidAlt: !isJidGroup(chatId) ? addressingContext.senderAlt : undefined,
|
|
151
147
|
fromMe,
|
|
152
148
|
id: msgId,
|
|
149
|
+
senderLid: stanza?.attrs?.sender_lid,
|
|
150
|
+
senderPn: stanza?.attrs?.sender_pn,
|
|
153
151
|
participant,
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
participantPn: stanza?.attrs?.participant_pn,
|
|
153
|
+
participantLid: stanza?.attrs?.participant_lid,
|
|
156
154
|
...(msgType === 'newsletter' && stanza.attrs.server_id ? { server_id: stanza.attrs.server_id } : {})
|
|
157
155
|
};
|
|
158
156
|
const fullMessage = {
|
|
@@ -280,4 +278,4 @@ function isSessionRecordError(error) {
|
|
|
280
278
|
const errorMessage = error?.message || error?.toString() || '';
|
|
281
279
|
return DECRYPTION_RETRY_CONFIG.sessionRecordErrors.some(errorPattern => errorMessage.includes(errorPattern));
|
|
282
280
|
}
|
|
283
|
-
//# sourceMappingURL=decode-wa-message.js.map
|
|
281
|
+
//# sourceMappingURL=decode-wa-message.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { BaileysEventEmitter, BaileysEventMap } from '../Types/index.js';
|
|
2
|
+
import type { ILogger } from './logger.js';
|
|
3
|
+
/**
|
|
4
|
+
* A map that contains a list of all events that have been triggered
|
|
5
|
+
*
|
|
6
|
+
* Note, this can contain different type of events
|
|
7
|
+
* this can make processing events extremely efficient -- since everything
|
|
8
|
+
* can be done in a single transaction
|
|
9
|
+
*/
|
|
10
|
+
type BaileysEventData = Partial<BaileysEventMap>;
|
|
11
|
+
type BaileysBufferableEventEmitter = BaileysEventEmitter & {
|
|
12
|
+
/** Use to process events in a batch */
|
|
13
|
+
process(handler: (events: BaileysEventData) => void | Promise<void>): () => void;
|
|
14
|
+
/**
|
|
15
|
+
* starts buffering events, call flush() to release them
|
|
16
|
+
* */
|
|
17
|
+
buffer(): void;
|
|
18
|
+
/** buffers all events till the promise completes */
|
|
19
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (...args: A) => Promise<T>;
|
|
20
|
+
/**
|
|
21
|
+
* flushes all buffered events
|
|
22
|
+
* @returns returns true if the flush actually happened, otherwise false
|
|
23
|
+
*/
|
|
24
|
+
flush(): boolean;
|
|
25
|
+
/** is there an ongoing buffer */
|
|
26
|
+
isBuffering(): boolean;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The event buffer logically consolidates different events into a single event
|
|
30
|
+
* making the data processing more efficient.
|
|
31
|
+
*/
|
|
32
|
+
export declare const makeEventBuffer: (logger: ILogger) => BaileysBufferableEventEmitter;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=event-buffer.d.ts.map
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { proto } from '../../WAProto/index.js';
|
|
2
|
+
import type { BaileysEventEmitter, BaileysEventMap, ConnectionState, WACallUpdateType, WAMessageKey, WAVersion } from '../Types/index.js';
|
|
3
|
+
import { type BinaryNode } from '../WABinary/index.js';
|
|
4
|
+
export declare const BufferJSON: {
|
|
5
|
+
replacer: (k: any, value: any) => any;
|
|
6
|
+
reviver: (_: any, value: any) => any;
|
|
7
|
+
};
|
|
8
|
+
export declare const getKeyAuthor: (key: WAMessageKey | undefined | null, meId?: string) => string;
|
|
9
|
+
export declare const writeRandomPadMax16: (msg: Uint8Array) => Buffer<ArrayBuffer>;
|
|
10
|
+
export declare const unpadRandomMax16: (e: Uint8Array | Buffer) => Uint8Array<ArrayBuffer>;
|
|
11
|
+
export declare const generateParticipantHashV2: (participants: string[]) => string;
|
|
12
|
+
export declare const encodeWAMessage: (message: proto.IMessage) => Buffer<ArrayBuffer>;
|
|
13
|
+
export declare const generateRegistrationId: () => number;
|
|
14
|
+
export declare const encodeBigEndian: (e: number, t?: number) => Uint8Array<ArrayBuffer>;
|
|
15
|
+
export declare const toNumber: (t: Long | number | null | undefined) => number;
|
|
16
|
+
/** unix timestamp of a date in seconds */
|
|
17
|
+
export declare const unixTimestampSeconds: (date?: Date) => number;
|
|
18
|
+
export type DebouncedTimeout = ReturnType<typeof debouncedTimeout>;
|
|
19
|
+
export declare const debouncedTimeout: (intervalMs?: number, task?: () => void) => {
|
|
20
|
+
start: (newIntervalMs?: number, newTask?: () => void) => void;
|
|
21
|
+
cancel: () => void;
|
|
22
|
+
setTask: (newTask: () => void) => () => void;
|
|
23
|
+
setInterval: (newInterval: number) => number;
|
|
24
|
+
};
|
|
25
|
+
export declare const delay: (ms: number) => Promise<void>;
|
|
26
|
+
export declare const delayCancellable: (ms: number) => {
|
|
27
|
+
delay: Promise<void>;
|
|
28
|
+
cancel: () => void;
|
|
29
|
+
};
|
|
30
|
+
export declare function promiseTimeout<T>(ms: number | undefined, promise: (resolve: (v: T) => void, reject: (error: any) => void) => void): Promise<T>;
|
|
31
|
+
export declare const generateMessageIDV2: (userId?: string) => string;
|
|
32
|
+
export declare const generateMessageID: () => string;
|
|
33
|
+
export declare function bindWaitForEvent<T extends keyof BaileysEventMap>(ev: BaileysEventEmitter, event: T): (check: (u: BaileysEventMap[T]) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
|
|
34
|
+
export declare const bindWaitForConnectionUpdate: (ev: BaileysEventEmitter) => (check: (u: Partial<ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* utility that fetches latest baileys version from the master branch.
|
|
37
|
+
* Use to ensure your WA connection is always on the latest version
|
|
38
|
+
*/
|
|
39
|
+
export declare const fetchLatestBaileysVersion: (options?: RequestInit) => Promise<{
|
|
40
|
+
version: WAVersion;
|
|
41
|
+
isLatest: boolean;
|
|
42
|
+
error?: undefined;
|
|
43
|
+
} | {
|
|
44
|
+
version: WAVersion;
|
|
45
|
+
isLatest: boolean;
|
|
46
|
+
error: unknown;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* A utility that fetches the latest web version of whatsapp.
|
|
50
|
+
* Use to ensure your WA connection is always on the latest version
|
|
51
|
+
*/
|
|
52
|
+
export declare const fetchLatestWaWebVersion: (options?: RequestInit) => Promise<{
|
|
53
|
+
version: WAVersion;
|
|
54
|
+
isLatest: boolean;
|
|
55
|
+
error?: undefined;
|
|
56
|
+
} | {
|
|
57
|
+
version: WAVersion;
|
|
58
|
+
isLatest: boolean;
|
|
59
|
+
error: unknown;
|
|
60
|
+
}>;
|
|
61
|
+
/** unique message tag prefix for MD clients */
|
|
62
|
+
export declare const generateMdTagPrefix: () => string;
|
|
63
|
+
/**
|
|
64
|
+
* Given a type of receipt, returns what the new status of the message should be
|
|
65
|
+
* @param type type from receipt
|
|
66
|
+
*/
|
|
67
|
+
export declare const getStatusFromReceiptType: (type: string | undefined) => proto.WebMessageInfo.Status | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Stream errors generally provide a reason, map that to a baileys DisconnectReason
|
|
70
|
+
* @param reason the string reason given, eg. "conflict"
|
|
71
|
+
*/
|
|
72
|
+
export declare const getErrorCodeFromStreamError: (node: BinaryNode) => {
|
|
73
|
+
reason: string;
|
|
74
|
+
statusCode: number;
|
|
75
|
+
};
|
|
76
|
+
export declare const getCallStatusFromNode: ({ tag, attrs }: BinaryNode) => WACallUpdateType;
|
|
77
|
+
export declare const getCodeFromWSError: (error: Error) => number;
|
|
78
|
+
/**
|
|
79
|
+
* Is the given platform WA business
|
|
80
|
+
* @param platform AuthenticationCreds.platform
|
|
81
|
+
*/
|
|
82
|
+
export declare const isWABusinessPlatform: (platform: string) => platform is "smba" | "smbi";
|
|
83
|
+
export declare function trimUndefined(obj: {
|
|
84
|
+
[_: string]: any;
|
|
85
|
+
}): {
|
|
86
|
+
[_: string]: any;
|
|
87
|
+
};
|
|
88
|
+
export declare function bytesToCrockford(buffer: Buffer): string;
|
|
89
|
+
export declare function encodeNewsletterMessage(message: proto.IMessage): Uint8Array;
|
|
90
|
+
//# sourceMappingURL=generics.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { proto } from '../../WAProto/index.js';
|
|
2
|
+
import type { Chat, Contact, WAMessage } from '../Types/index.js';
|
|
3
|
+
export declare const downloadHistory: (msg: proto.Message.IHistorySyncNotification, options: RequestInit) => Promise<proto.HistorySync>;
|
|
4
|
+
export declare const processHistoryMessage: (item: proto.IHistorySync) => {
|
|
5
|
+
chats: Chat[];
|
|
6
|
+
contacts: Contact[];
|
|
7
|
+
messages: WAMessage[];
|
|
8
|
+
syncType: proto.HistorySync.HistorySyncType | null | undefined;
|
|
9
|
+
progress: number | null | undefined;
|
|
10
|
+
};
|
|
11
|
+
export declare const downloadAndProcessHistorySyncNotification: (msg: proto.Message.IHistorySyncNotification, options: RequestInit) => Promise<{
|
|
12
|
+
chats: Chat[];
|
|
13
|
+
contacts: Contact[];
|
|
14
|
+
messages: WAMessage[];
|
|
15
|
+
syncType: proto.HistorySync.HistorySyncType | null | undefined;
|
|
16
|
+
progress: number | null | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const getHistoryMsg: (message: proto.IMessage) => proto.Message.IHistorySyncNotification;
|
|
19
|
+
//# sourceMappingURL=history.d.ts.map
|