zaileys 4.7.0 → 4.7.2
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 +5 -0
- package/dist/auth/adapters/convex.d.ts +9 -0
- package/dist/auth/adapters/file.d.ts +16 -0
- package/dist/auth/adapters/index.d.ts +6 -0
- package/dist/auth/adapters/memory.d.ts +9 -0
- package/dist/auth/adapters/postgres.d.ts +20 -0
- package/dist/auth/adapters/redis.d.ts +27 -0
- package/dist/auth/adapters/sqlite.d.ts +19 -0
- package/dist/auth/cache.d.ts +11 -0
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/types.d.ts +21 -0
- package/dist/automation/auto-delete.d.ts +30 -0
- package/dist/automation/broadcast.d.ts +10 -0
- package/dist/automation/errors.d.ts +8 -0
- package/dist/automation/index.d.ts +11 -0
- package/dist/automation/operation-guard.d.ts +20 -0
- package/dist/automation/presence.d.ts +28 -0
- package/dist/automation/queue.d.ts +18 -0
- package/dist/automation/rate-limiter.d.ts +18 -0
- package/dist/automation/schedule.d.ts +45 -0
- package/dist/automation/types.d.ts +31 -0
- package/dist/builder/album.d.ts +4 -0
- package/dist/builder/builder.d.ts +59 -0
- package/dist/builder/content/airich.d.ts +80 -0
- package/dist/builder/content/audio.d.ts +9 -0
- package/dist/builder/content/buttons.d.ts +30 -0
- package/dist/builder/content/carousel.d.ts +19 -0
- package/dist/builder/content/contact.d.ts +13 -0
- package/dist/builder/content/document.d.ts +9 -0
- package/dist/builder/content/event.d.ts +3 -0
- package/dist/builder/content/group-invite.d.ts +3 -0
- package/dist/builder/content/image.d.ts +8 -0
- package/dist/builder/content/list.d.ts +14 -0
- package/dist/builder/content/location.d.ts +11 -0
- package/dist/builder/content/markdown.d.ts +2 -0
- package/dist/builder/content/poll.d.ts +10 -0
- package/dist/builder/content/product.d.ts +3 -0
- package/dist/builder/content/sticker.d.ts +7 -0
- package/dist/builder/content/template.d.ts +3 -0
- package/dist/builder/content/text.d.ts +4 -0
- package/dist/builder/content/video.d.ts +10 -0
- package/dist/builder/edit-builder.d.ts +15 -0
- package/dist/builder/errors.d.ts +8 -0
- package/dist/builder/index.d.ts +6 -0
- package/dist/builder/media-loader.d.ts +11 -0
- package/dist/builder/mutations.d.ts +14 -0
- package/dist/builder/state.d.ts +15 -0
- package/dist/builder/types.d.ts +164 -0
- package/dist/builder/username-resolve.d.ts +8 -0
- package/dist/client/client.d.ts +130 -0
- package/dist/client/event-emitter.d.ts +19 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/types.d.ts +104 -0
- package/dist/command/dispatcher.d.ts +23 -0
- package/dist/command/errors.d.ts +8 -0
- package/dist/command/index.d.ts +7 -0
- package/dist/command/middleware.d.ts +2 -0
- package/dist/command/parser.d.ts +2 -0
- package/dist/command/registry.d.ts +13 -0
- package/dist/command/types.d.ts +30 -0
- package/dist/connection/auth-adapter.d.ts +4 -0
- package/dist/connection/auth-guard.d.ts +37 -0
- package/dist/connection/disconnect-reason.d.ts +6 -0
- package/dist/connection/index.d.ts +7 -0
- package/dist/connection/pairing-flow.d.ts +16 -0
- package/dist/connection/qr-terminal.d.ts +2 -0
- package/dist/connection/reconnect.d.ts +15 -0
- package/dist/connection/state-machine.d.ts +9 -0
- package/dist/connection/status-log.d.ts +25 -0
- package/dist/domain/business.d.ts +19 -0
- package/dist/domain/chat.d.ts +27 -0
- package/dist/domain/community.d.ts +28 -0
- package/dist/domain/contact.d.ts +21 -0
- package/dist/domain/errors.d.ts +8 -0
- package/dist/domain/group.d.ts +35 -0
- package/dist/domain/index.d.ts +11 -0
- package/dist/domain/newsletter.d.ts +35 -0
- package/dist/domain/privacy.d.ts +15 -0
- package/dist/domain/profile.d.ts +14 -0
- package/dist/domain/socket-like.d.ts +117 -0
- package/dist/domain/types.d.ts +24 -0
- package/dist/events/context.d.ts +238 -0
- package/dist/events/decoders/_media-download.d.ts +8 -0
- package/dist/events/decoders/_shared.d.ts +26 -0
- package/dist/events/decoders/calls.d.ts +11 -0
- package/dist/events/decoders/groups.d.ts +36 -0
- package/dist/events/decoders/interactive.d.ts +9 -0
- package/dist/events/decoders/lifecycle.d.ts +69 -0
- package/dist/events/decoders/messages.d.ts +30 -0
- package/dist/events/decoders/mutations.d.ts +24 -0
- package/dist/events/guards.d.ts +9 -0
- package/dist/events/index.d.ts +4 -0
- package/dist/events/pipeline.d.ts +37 -0
- package/dist/events/types.d.ts +187 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.ts +14 -2264
- package/dist/index.mjs +8 -8
- package/dist/media/ffmpeg/audio.d.ts +12 -0
- package/dist/media/ffmpeg/core.d.ts +67 -0
- package/dist/media/ffmpeg/document.d.ts +10 -0
- package/dist/media/ffmpeg/image.d.ts +7 -0
- package/dist/media/ffmpeg/index.d.ts +7 -0
- package/dist/media/ffmpeg/sticker.d.ts +14 -0
- package/dist/media/ffmpeg/transform.d.ts +2 -0
- package/dist/media/ffmpeg/video.d.ts +6 -0
- package/dist/media/index.d.ts +2 -0
- package/dist/media/media.d.ts +39 -0
- package/dist/plugin/index.d.ts +5 -0
- package/dist/plugin/loader.d.ts +30 -0
- package/dist/plugin/registry.d.ts +24 -0
- package/dist/plugin/types.d.ts +25 -0
- package/dist/store/adapters/convex.d.ts +33 -0
- package/dist/store/adapters/index.d.ts +5 -0
- package/dist/store/adapters/memory.d.ts +31 -0
- package/dist/store/adapters/postgres.d.ts +40 -0
- package/dist/store/adapters/redis.d.ts +49 -0
- package/dist/store/adapters/sqlite.d.ts +36 -0
- package/dist/store/index.d.ts +2 -0
- package/dist/store/types.d.ts +48 -0
- package/dist/types/convex.d.ts +35 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/lid-mapping.d.ts +5 -0
- package/dist/types/optional-clients.d.ts +69 -0
- package/dist/types/store-error.d.ts +8 -0
- package/dist/utils/array.d.ts +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/jid.d.ts +6 -0
- package/dist/utils/logger.d.ts +10 -0
- package/package.json +5 -7
- package/dist/index.d.cts +0 -2264
package/dist/index.d.ts
CHANGED
|
@@ -1,2264 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
caption?: string;
|
|
16
|
-
gifPlayback?: boolean;
|
|
17
|
-
viewOnce?: boolean;
|
|
18
|
-
/** Send as a round video note (PTV). */
|
|
19
|
-
ptv?: boolean;
|
|
20
|
-
};
|
|
21
|
-
type VideoNoteOptions = {
|
|
22
|
-
viewOnce?: boolean;
|
|
23
|
-
};
|
|
24
|
-
type AudioOptions = {
|
|
25
|
-
ptt?: boolean;
|
|
26
|
-
seconds?: number;
|
|
27
|
-
};
|
|
28
|
-
type DocumentOptions = {
|
|
29
|
-
fileName: string;
|
|
30
|
-
mimetype?: string;
|
|
31
|
-
caption?: string;
|
|
32
|
-
};
|
|
33
|
-
type StickerOptions = {
|
|
34
|
-
animated?: boolean;
|
|
35
|
-
};
|
|
36
|
-
type AlbumItem = {
|
|
37
|
-
type: 'image' | 'video';
|
|
38
|
-
src: MediaSource;
|
|
39
|
-
caption?: string;
|
|
40
|
-
};
|
|
41
|
-
type ReplyButton = {
|
|
42
|
-
type?: 'reply';
|
|
43
|
-
id: string;
|
|
44
|
-
text: string;
|
|
45
|
-
};
|
|
46
|
-
type UrlButton = {
|
|
47
|
-
type: 'url';
|
|
48
|
-
text: string;
|
|
49
|
-
url: string;
|
|
50
|
-
webview?: boolean;
|
|
51
|
-
};
|
|
52
|
-
type CopyButton = {
|
|
53
|
-
type: 'copy';
|
|
54
|
-
text: string;
|
|
55
|
-
code: string;
|
|
56
|
-
};
|
|
57
|
-
type CallButton = {
|
|
58
|
-
type: 'call';
|
|
59
|
-
text: string;
|
|
60
|
-
phone: string;
|
|
61
|
-
};
|
|
62
|
-
type ReminderButton = {
|
|
63
|
-
type: 'reminder';
|
|
64
|
-
text: string;
|
|
65
|
-
id?: string;
|
|
66
|
-
};
|
|
67
|
-
type CancelReminderButton = {
|
|
68
|
-
type: 'cancel-reminder';
|
|
69
|
-
text: string;
|
|
70
|
-
id?: string;
|
|
71
|
-
};
|
|
72
|
-
type LocationRequestButton = {
|
|
73
|
-
type: 'location';
|
|
74
|
-
text?: string;
|
|
75
|
-
};
|
|
76
|
-
type AddressButton = {
|
|
77
|
-
type: 'address';
|
|
78
|
-
text: string;
|
|
79
|
-
id?: string;
|
|
80
|
-
};
|
|
81
|
-
type InteractiveButton = ReplyButton | UrlButton | CopyButton | CallButton | ReminderButton | CancelReminderButton | LocationRequestButton | AddressButton;
|
|
82
|
-
type BottomSheetOptions = {
|
|
83
|
-
listTitle?: string;
|
|
84
|
-
buttonTitle?: string;
|
|
85
|
-
buttonsLimit?: number;
|
|
86
|
-
dividers?: number[];
|
|
87
|
-
};
|
|
88
|
-
type LimitedTimeOfferOptions = {
|
|
89
|
-
text?: string;
|
|
90
|
-
url?: string;
|
|
91
|
-
copyCode?: string;
|
|
92
|
-
expiresAt?: number;
|
|
93
|
-
};
|
|
94
|
-
type ButtonDef = {
|
|
95
|
-
id: string;
|
|
96
|
-
text: string;
|
|
97
|
-
};
|
|
98
|
-
type ListSection$1 = {
|
|
99
|
-
title: string;
|
|
100
|
-
rows: Array<{
|
|
101
|
-
id: string;
|
|
102
|
-
title: string;
|
|
103
|
-
description?: string;
|
|
104
|
-
}>;
|
|
105
|
-
};
|
|
106
|
-
type ListOptions = {
|
|
107
|
-
title?: string;
|
|
108
|
-
description?: string;
|
|
109
|
-
buttonText: string;
|
|
110
|
-
footerText?: string;
|
|
111
|
-
sections: ListSection$1[];
|
|
112
|
-
};
|
|
113
|
-
type PollOptions = {
|
|
114
|
-
multipleChoice?: boolean;
|
|
115
|
-
};
|
|
116
|
-
type LocationOptions = {
|
|
117
|
-
name?: string;
|
|
118
|
-
address?: string;
|
|
119
|
-
};
|
|
120
|
-
type TemplateOptions = {
|
|
121
|
-
header?: string;
|
|
122
|
-
body: string;
|
|
123
|
-
footer?: string;
|
|
124
|
-
buttons: ButtonDef[];
|
|
125
|
-
};
|
|
126
|
-
type EventOptions = {
|
|
127
|
-
name: string;
|
|
128
|
-
description?: string;
|
|
129
|
-
startAt: Date | number;
|
|
130
|
-
endAt?: Date | number;
|
|
131
|
-
location?: {
|
|
132
|
-
latitude: number;
|
|
133
|
-
longitude: number;
|
|
134
|
-
name?: string;
|
|
135
|
-
address?: string;
|
|
136
|
-
};
|
|
137
|
-
call?: 'audio' | 'video';
|
|
138
|
-
canceled?: boolean;
|
|
139
|
-
};
|
|
140
|
-
type ProductOptions = {
|
|
141
|
-
image: MediaSource;
|
|
142
|
-
title: string;
|
|
143
|
-
businessOwnerId: string;
|
|
144
|
-
description?: string;
|
|
145
|
-
/** Price in currency units (e.g. 50 = 50.00); mapped to priceAmount1000. */
|
|
146
|
-
price?: number;
|
|
147
|
-
currency?: string;
|
|
148
|
-
productId?: string;
|
|
149
|
-
retailerId?: string;
|
|
150
|
-
url?: string;
|
|
151
|
-
body?: string;
|
|
152
|
-
footer?: string;
|
|
153
|
-
};
|
|
154
|
-
type GroupInviteOptions = {
|
|
155
|
-
jid: string;
|
|
156
|
-
code: string;
|
|
157
|
-
subject?: string;
|
|
158
|
-
caption?: string;
|
|
159
|
-
/** Unix seconds when the invite expires. Defaults to ~3 days from now. WhatsApp reads this as seconds. */
|
|
160
|
-
expiresAt?: number;
|
|
161
|
-
/** Optional JPEG thumbnail (group avatar) — improves how the card renders. */
|
|
162
|
-
thumbnail?: Buffer;
|
|
163
|
-
};
|
|
164
|
-
type BuilderContext = {
|
|
165
|
-
recipient: string;
|
|
166
|
-
quoted?: WAMessage | WAMessageKey;
|
|
167
|
-
mentions?: string[];
|
|
168
|
-
mentionAll?: boolean;
|
|
169
|
-
disappearingSeconds?: number;
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
type BuilderErrorCode = 'MEDIA_LOAD_FAILED' | 'INVALID_RECIPIENT' | 'USERNAME_NOT_FOUND' | 'EMPTY_CONTENT' | 'INVALID_OPTIONS' | 'SEND_FAILED' | 'MESSAGE_NOT_FOUND';
|
|
173
|
-
declare class ZaileysBuilderError extends Error {
|
|
174
|
-
readonly code: BuilderErrorCode;
|
|
175
|
-
readonly cause?: unknown;
|
|
176
|
-
constructor(code: BuilderErrorCode, message: string, options?: {
|
|
177
|
-
cause?: unknown;
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
type ButtonsContentOptions = {
|
|
182
|
-
text?: string;
|
|
183
|
-
footer?: string;
|
|
184
|
-
title?: string;
|
|
185
|
-
subtitle?: string;
|
|
186
|
-
image?: MediaSource;
|
|
187
|
-
video?: MediaSource;
|
|
188
|
-
bottomSheet?: BottomSheetOptions;
|
|
189
|
-
limitedTimeOffer?: LimitedTimeOfferOptions;
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
type CarouselCard = {
|
|
193
|
-
title?: string;
|
|
194
|
-
subtitle?: string;
|
|
195
|
-
body?: string;
|
|
196
|
-
footer?: string;
|
|
197
|
-
image?: MediaSource;
|
|
198
|
-
video?: MediaSource;
|
|
199
|
-
buttons?: Array<ButtonDef | InteractiveButton>;
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
type AIRichOptions = {
|
|
203
|
-
title?: string;
|
|
204
|
-
footer?: string;
|
|
205
|
-
sources?: Array<[profileUrl: string, url: string, text: string]>;
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
type BuilderInternalState = {
|
|
209
|
-
recipient: string;
|
|
210
|
-
content?: AnyMessageContent;
|
|
211
|
-
pendingContent?: Promise<AnyMessageContent>;
|
|
212
|
-
albumItems?: AlbumItem[];
|
|
213
|
-
quoted?: WAMessage | WAMessageKey;
|
|
214
|
-
mentions?: string[];
|
|
215
|
-
mentionAll?: boolean;
|
|
216
|
-
disappearingSeconds?: number;
|
|
217
|
-
resolveRecipient?: (raw: string) => Promise<string>;
|
|
218
|
-
recordSent?: (message: WAMessage) => void;
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
interface BuilderSocketLike {
|
|
222
|
-
sendMessage(jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions): Promise<WAMessage | undefined>;
|
|
223
|
-
relayMessage?(jid: string, message: unknown, options: {
|
|
224
|
-
messageId: string;
|
|
225
|
-
additionalNodes?: unknown[];
|
|
226
|
-
}): Promise<string>;
|
|
227
|
-
chatModify?(mod: unknown, jid: string): Promise<void>;
|
|
228
|
-
user?: {
|
|
229
|
-
id?: string | null;
|
|
230
|
-
} | null;
|
|
231
|
-
waUploadToServer?: unknown;
|
|
232
|
-
}
|
|
233
|
-
type TextOptions = {
|
|
234
|
-
rich?: boolean;
|
|
235
|
-
} & AIRichOptions;
|
|
236
|
-
declare class MessageBuilder<State extends BuilderState> {
|
|
237
|
-
protected readonly __state?: State;
|
|
238
|
-
protected readonly socket: BuilderSocketLike;
|
|
239
|
-
protected readonly internal: BuilderInternalState;
|
|
240
|
-
constructor(socket: BuilderSocketLike, internal: BuilderInternalState);
|
|
241
|
-
static create(socket: BuilderSocketLike, recipient: string, resolveRecipient?: (raw: string) => Promise<string>, recordSent?: (message: WAMessage) => void): MessageBuilder<'init'>;
|
|
242
|
-
to(this: MessageBuilder<'init'>, recipient: string): MessageBuilder<'init'>;
|
|
243
|
-
text(this: MessageBuilder<'init'>, content: string, opts?: TextOptions): MessageBuilder<'content-set'>;
|
|
244
|
-
image(this: MessageBuilder<'init'>, src: MediaSource, opts?: ImageOptions): MessageBuilder<'content-set'>;
|
|
245
|
-
videoNote(this: MessageBuilder<'init'>, src: MediaSource, opts?: VideoNoteOptions): MessageBuilder<'content-set'>;
|
|
246
|
-
video(this: MessageBuilder<'init'>, src: MediaSource, opts?: VideoOptions): MessageBuilder<'content-set'>;
|
|
247
|
-
audio(this: MessageBuilder<'init'>, src: MediaSource, opts?: AudioOptions): MessageBuilder<'content-set'>;
|
|
248
|
-
document(this: MessageBuilder<'init'>, src: MediaSource, opts: DocumentOptions): MessageBuilder<'content-set'>;
|
|
249
|
-
sticker(this: MessageBuilder<'init'>, src: MediaSource, opts?: StickerOptions): MessageBuilder<'content-set'>;
|
|
250
|
-
buttons(this: MessageBuilder<'init'>, buttons: Array<ButtonDef | InteractiveButton>, opts?: ButtonsContentOptions): MessageBuilder<'content-set'>;
|
|
251
|
-
carousel(this: MessageBuilder<'init'>, cards: CarouselCard[], opts?: {
|
|
252
|
-
text?: string;
|
|
253
|
-
}): MessageBuilder<'content-set'>;
|
|
254
|
-
list(this: MessageBuilder<'init'>, opts: ListOptions): MessageBuilder<'content-set'>;
|
|
255
|
-
poll(this: MessageBuilder<'init'>, question: string, options: string[], opts?: PollOptions): MessageBuilder<'content-set'>;
|
|
256
|
-
location(this: MessageBuilder<'init'>, lat: number, lon: number, opts?: LocationOptions): MessageBuilder<'content-set'>;
|
|
257
|
-
contact(this: MessageBuilder<'init'>, vcard: string): MessageBuilder<'content-set'>;
|
|
258
|
-
template(this: MessageBuilder<'init'>, opts: TemplateOptions): MessageBuilder<'content-set'>;
|
|
259
|
-
event(this: MessageBuilder<'init'>, opts: EventOptions): MessageBuilder<'content-set'>;
|
|
260
|
-
groupInvite(this: MessageBuilder<'init'>, opts: GroupInviteOptions): MessageBuilder<'content-set'>;
|
|
261
|
-
product(this: MessageBuilder<'init'>, opts: ProductOptions): MessageBuilder<'content-set'>;
|
|
262
|
-
requestPhoneNumber(this: MessageBuilder<'init'>): MessageBuilder<'content-set'>;
|
|
263
|
-
sharePhoneNumber(this: MessageBuilder<'init'>): MessageBuilder<'content-set'>;
|
|
264
|
-
limitSharing(this: MessageBuilder<'init'>, enabled?: boolean): MessageBuilder<'content-set'>;
|
|
265
|
-
album(this: MessageBuilder<'init'>, items: AlbumItem[]): MessageBuilder<'content-set'>;
|
|
266
|
-
reply(quoted: WAMessage | WAMessageKey): MessageBuilder<State>;
|
|
267
|
-
mentions(jids: string[]): MessageBuilder<State>;
|
|
268
|
-
mentionAll(): MessageBuilder<State>;
|
|
269
|
-
disappearing(seconds: number): MessageBuilder<State>;
|
|
270
|
-
then<T = WAMessageKey>(this: MessageBuilder<'content-set'>, onResolved: (key: WAMessageKey) => T, onRejected?: (err: unknown) => T | PromiseLike<T>): Promise<T>;
|
|
271
|
-
private uploadHeaderMedia;
|
|
272
|
-
private sendRelay;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
declare class EditBuilder {
|
|
276
|
-
private readonly socket;
|
|
277
|
-
private readonly key;
|
|
278
|
-
private content;
|
|
279
|
-
private pendingContent;
|
|
280
|
-
constructor(socket: BuilderSocketLike, key: WAMessageKey);
|
|
281
|
-
text(content: string): this;
|
|
282
|
-
image(src: MediaSource, opts?: ImageOptions): this;
|
|
283
|
-
video(src: MediaSource, opts?: VideoOptions): this;
|
|
284
|
-
then<T = WAMessageKey>(onResolved: (key: WAMessageKey) => T, onRejected?: (err: unknown) => T | PromiseLike<T>): Promise<T>;
|
|
285
|
-
private send;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
type MessageStoreListOptions = {
|
|
289
|
-
limit?: number;
|
|
290
|
-
before?: number;
|
|
291
|
-
};
|
|
292
|
-
type PruneOptions = {
|
|
293
|
-
/** Delete messages whose `messageTimestamp` is strictly older than this epoch value, in **seconds** (matching stored `messageTimestamp`). */
|
|
294
|
-
olderThan?: number;
|
|
295
|
-
/** Keep only the newest N messages per chat. */
|
|
296
|
-
maxPerChat?: number;
|
|
297
|
-
/** Restrict pruning to chats whose jid passes this predicate. */
|
|
298
|
-
chatFilter?: (jid: string) => boolean;
|
|
299
|
-
};
|
|
300
|
-
type ScheduledJobRecord = {
|
|
301
|
-
id: string;
|
|
302
|
-
fireAt: number;
|
|
303
|
-
recipient: string;
|
|
304
|
-
payload: unknown;
|
|
305
|
-
};
|
|
306
|
-
interface BaileysSocketLike {
|
|
307
|
-
ev: {
|
|
308
|
-
on: (event: string, handler: (...args: unknown[]) => void) => void;
|
|
309
|
-
off?: (event: string, handler: (...args: unknown[]) => void) => void;
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
interface MessageStore {
|
|
313
|
-
saveMessage(message: WAMessage): Promise<void>;
|
|
314
|
-
getMessage(key: WAMessageKey): Promise<WAMessage | undefined>;
|
|
315
|
-
listMessages(jid: string, options?: MessageStoreListOptions): Promise<WAMessage[]>;
|
|
316
|
-
saveChat(chat: Chat): Promise<void>;
|
|
317
|
-
getChat(jid: string): Promise<Chat | undefined>;
|
|
318
|
-
listChats(options?: {
|
|
319
|
-
archived?: boolean;
|
|
320
|
-
}): Promise<Chat[]>;
|
|
321
|
-
saveContact(contact: Contact): Promise<void>;
|
|
322
|
-
getContact(jid: string): Promise<Contact | undefined>;
|
|
323
|
-
listContacts(): Promise<Contact[]>;
|
|
324
|
-
savePresence(jid: string, presence: PresenceData): Promise<void>;
|
|
325
|
-
getPresence(jid: string): Promise<PresenceData | undefined>;
|
|
326
|
-
bind(socket: BaileysSocketLike): void;
|
|
327
|
-
clear(): Promise<void>;
|
|
328
|
-
close(): Promise<void>;
|
|
329
|
-
saveScheduledJob?(job: ScheduledJobRecord): Promise<void>;
|
|
330
|
-
listScheduledJobs?(): Promise<ScheduledJobRecord[]>;
|
|
331
|
-
deleteScheduledJob?(id: string): Promise<void>;
|
|
332
|
-
deleteMessage?(key: WAMessageKey): Promise<void>;
|
|
333
|
-
pruneMessages?(opts: PruneOptions): Promise<number>;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
type DeleteOptions = {
|
|
337
|
-
forEveryone?: boolean;
|
|
338
|
-
};
|
|
339
|
-
type PinOptions = {
|
|
340
|
-
/** Pin duration in seconds (WhatsApp offers 86400 / 604800 / 2592000). Defaults to 24h. */
|
|
341
|
-
duration?: number;
|
|
342
|
-
};
|
|
343
|
-
declare const deleteMessage: (socket: BuilderSocketLike, key: WAMessageKey, opts?: DeleteOptions) => Promise<void>;
|
|
344
|
-
declare const reactToMessage: (socket: BuilderSocketLike, key: WAMessageKey, emoji: string) => Promise<WAMessageKey>;
|
|
345
|
-
declare const forwardMessage: (socket: BuilderSocketLike, store: Pick<MessageStore, "getMessage">, key: WAMessageKey, to: string) => Promise<WAMessageKey>;
|
|
346
|
-
declare const pinMessage: (socket: BuilderSocketLike, key: WAMessageKey, pin: boolean, opts?: PinOptions) => Promise<WAMessageKey>;
|
|
347
|
-
|
|
348
|
-
interface UsernameResolveSocketLike {
|
|
349
|
-
onWhatsApp(...phoneNumber: string[]): Promise<Array<{
|
|
350
|
-
jid: string;
|
|
351
|
-
exists: boolean;
|
|
352
|
-
}> | undefined>;
|
|
353
|
-
}
|
|
354
|
-
declare const isJid: (value: string) => boolean;
|
|
355
|
-
declare const resolveUsername: (socket: UsernameResolveSocketLike, username: string, cache: Map<string, string>, inflight?: Map<string, Promise<string>>) => Promise<string>;
|
|
356
|
-
|
|
357
|
-
interface ParticipantUpdateResult {
|
|
358
|
-
jid: string;
|
|
359
|
-
status: string;
|
|
360
|
-
}
|
|
361
|
-
interface PrivacyConfig {
|
|
362
|
-
lastSeen?: WAPrivacyValue;
|
|
363
|
-
online?: WAPrivacyOnlineValue;
|
|
364
|
-
profile?: WAPrivacyValue;
|
|
365
|
-
status?: WAPrivacyValue;
|
|
366
|
-
readReceipts?: WAReadReceiptsValue;
|
|
367
|
-
groupAdd?: WAPrivacyGroupAddValue;
|
|
368
|
-
}
|
|
369
|
-
type PrivacySettings = {
|
|
370
|
-
[key: string]: string;
|
|
371
|
-
};
|
|
372
|
-
interface LinkedGroup {
|
|
373
|
-
id?: string;
|
|
374
|
-
subject: string;
|
|
375
|
-
creation?: number;
|
|
376
|
-
owner?: string;
|
|
377
|
-
size?: number;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
type DomainErrorCode = 'NOT_CONNECTED' | 'GROUP_NOT_FOUND' | 'NEWSLETTER_NOT_FOUND' | 'INVALID_PARTICIPANT' | 'OPERATION_FAILED';
|
|
381
|
-
declare class ZaileysDomainError extends Error {
|
|
382
|
-
readonly code: DomainErrorCode;
|
|
383
|
-
readonly cause?: unknown;
|
|
384
|
-
constructor(code: DomainErrorCode, message: string, options?: {
|
|
385
|
-
cause?: unknown;
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
type OperationGuardClock = {
|
|
390
|
-
now?: () => number;
|
|
391
|
-
sleep?: (ms: number) => Promise<void>;
|
|
392
|
-
};
|
|
393
|
-
/**
|
|
394
|
-
* Per-category minimum-interval throttle for sensitive account operations
|
|
395
|
-
* (group/community/newsletter create, join, member changes). Spacing these out
|
|
396
|
-
* avoids the rapid-fire pattern WhatsApp flags as automated/bulk abuse.
|
|
397
|
-
*/
|
|
398
|
-
type OperationCategory = 'group.create' | 'group.join' | 'group.participants' | 'group.update' | 'community.create' | 'community.join' | 'community.update' | 'newsletter.create' | 'newsletter.follow' | 'newsletter.update';
|
|
399
|
-
interface OperationGuardOptions {
|
|
400
|
-
/** Master switch. When `false` operations run with no spacing. Default `true`. */
|
|
401
|
-
enabled?: boolean;
|
|
402
|
-
/** Per-category minimum interval in ms, overriding the built-in defaults. */
|
|
403
|
-
intervalsMs?: Partial<Record<OperationCategory, number>>;
|
|
404
|
-
}
|
|
405
|
-
interface OperationGuard {
|
|
406
|
-
run<T>(category: OperationCategory, op: () => Promise<T>): Promise<T>;
|
|
407
|
-
}
|
|
408
|
-
declare function createOperationGuard(options?: OperationGuardOptions, clock?: OperationGuardClock): OperationGuard;
|
|
409
|
-
|
|
410
|
-
interface DomainSocketLike {
|
|
411
|
-
groupCreate(subject: string, participants: string[]): Promise<GroupMetadata>;
|
|
412
|
-
groupParticipantsUpdate(jid: string, participants: string[], action: ParticipantAction): Promise<{
|
|
413
|
-
status: string;
|
|
414
|
-
jid: string;
|
|
415
|
-
content?: unknown;
|
|
416
|
-
}[]>;
|
|
417
|
-
groupUpdateSubject(jid: string, subject: string): Promise<void>;
|
|
418
|
-
groupUpdateDescription(jid: string, description?: string): Promise<void>;
|
|
419
|
-
groupLeave(id: string): Promise<void>;
|
|
420
|
-
groupMetadata(jid: string): Promise<GroupMetadata>;
|
|
421
|
-
groupInviteCode(jid: string): Promise<string | undefined>;
|
|
422
|
-
groupRevokeInvite(jid: string): Promise<string | undefined>;
|
|
423
|
-
groupAcceptInvite(code: string): Promise<string | undefined>;
|
|
424
|
-
groupToggleEphemeral(jid: string, ephemeralExpiration: number): Promise<void>;
|
|
425
|
-
groupSettingUpdate(jid: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked'): Promise<void>;
|
|
426
|
-
updateMemberLabel(jid: string, memberLabel: string): Promise<unknown>;
|
|
427
|
-
groupFetchAllParticipating(): Promise<{
|
|
428
|
-
[jid: string]: GroupMetadata;
|
|
429
|
-
}>;
|
|
430
|
-
groupGetInviteInfo(code: string): Promise<GroupMetadata>;
|
|
431
|
-
groupRequestParticipantsList(jid: string): Promise<Array<{
|
|
432
|
-
[k: string]: string;
|
|
433
|
-
}>>;
|
|
434
|
-
groupRequestParticipantsUpdate(jid: string, participants: string[], action: 'approve' | 'reject'): Promise<{
|
|
435
|
-
status: string;
|
|
436
|
-
jid: string;
|
|
437
|
-
}[]>;
|
|
438
|
-
groupJoinApprovalMode(jid: string, mode: 'on' | 'off'): Promise<void>;
|
|
439
|
-
groupMemberAddMode(jid: string, mode: 'admin_add' | 'all_member_add'): Promise<void>;
|
|
440
|
-
onWhatsApp(...jids: string[]): Promise<Array<{
|
|
441
|
-
jid: string;
|
|
442
|
-
exists: boolean;
|
|
443
|
-
lid?: string;
|
|
444
|
-
}> | undefined>;
|
|
445
|
-
addOrEditContact(jid: string, contact: {
|
|
446
|
-
firstName?: string;
|
|
447
|
-
lastName?: string;
|
|
448
|
-
fullName?: string;
|
|
449
|
-
}): Promise<unknown>;
|
|
450
|
-
removeContact(jid: string): Promise<unknown>;
|
|
451
|
-
getBusinessProfile(jid: string): Promise<unknown>;
|
|
452
|
-
getCatalog(opts: {
|
|
453
|
-
jid?: string;
|
|
454
|
-
limit?: number;
|
|
455
|
-
cursor?: string;
|
|
456
|
-
}): Promise<unknown>;
|
|
457
|
-
getCollections(jid?: string, limit?: number): Promise<unknown>;
|
|
458
|
-
getOrderDetails(orderId: string, tokenBase64: string): Promise<unknown>;
|
|
459
|
-
productCreate(create: Record<string, unknown>): Promise<unknown>;
|
|
460
|
-
productUpdate(productId: string, update: Record<string, unknown>): Promise<unknown>;
|
|
461
|
-
productDelete(productIds: string[]): Promise<{
|
|
462
|
-
deleted: number;
|
|
463
|
-
}>;
|
|
464
|
-
updateLastSeenPrivacy(value: WAPrivacyValue): Promise<void>;
|
|
465
|
-
updateOnlinePrivacy(value: WAPrivacyOnlineValue): Promise<void>;
|
|
466
|
-
updateProfilePicturePrivacy(value: WAPrivacyValue): Promise<void>;
|
|
467
|
-
updateStatusPrivacy(value: WAPrivacyValue): Promise<void>;
|
|
468
|
-
updateReadReceiptsPrivacy(value: WAReadReceiptsValue): Promise<void>;
|
|
469
|
-
updateGroupsAddPrivacy(value: WAPrivacyGroupAddValue): Promise<void>;
|
|
470
|
-
updateDefaultDisappearingMode(duration: number): Promise<void>;
|
|
471
|
-
fetchPrivacySettings(force?: boolean): Promise<{
|
|
472
|
-
[_: string]: string;
|
|
473
|
-
}>;
|
|
474
|
-
updateBlockStatus(jid: string, action: 'block' | 'unblock'): Promise<void>;
|
|
475
|
-
fetchBlocklist(): Promise<string[]>;
|
|
476
|
-
updateProfileName(name: string): Promise<void>;
|
|
477
|
-
updateProfileStatus(status: string): Promise<void>;
|
|
478
|
-
updateProfilePicture(jid: string, content: WAMediaUpload): Promise<void>;
|
|
479
|
-
removeProfilePicture(jid: string): Promise<void>;
|
|
480
|
-
profilePictureUrl(jid: string, type?: 'image' | 'preview', timeoutMs?: number): Promise<string | undefined>;
|
|
481
|
-
fetchStatus(jid: string): Promise<unknown>;
|
|
482
|
-
chatModify(mod: ChatModification, jid: string): Promise<void>;
|
|
483
|
-
newsletterCreate(name: string, description?: string): Promise<NewsletterMetadata>;
|
|
484
|
-
newsletterFollow(jid: string): Promise<unknown>;
|
|
485
|
-
newsletterUnfollow(jid: string): Promise<unknown>;
|
|
486
|
-
newsletterMetadata(type: 'invite' | 'jid', key: string): Promise<NewsletterMetadata | null>;
|
|
487
|
-
newsletterUpdateName(jid: string, name: string): Promise<unknown>;
|
|
488
|
-
newsletterUpdateDescription(jid: string, description: string): Promise<unknown>;
|
|
489
|
-
newsletterUpdatePicture(jid: string, content: WAMediaUpload): Promise<unknown>;
|
|
490
|
-
newsletterMute(jid: string): Promise<unknown>;
|
|
491
|
-
newsletterUnmute(jid: string): Promise<unknown>;
|
|
492
|
-
newsletterDelete(jid: string): Promise<void>;
|
|
493
|
-
newsletterSubscribers(jid: string): Promise<unknown>;
|
|
494
|
-
newsletterRemovePicture(jid: string): Promise<unknown>;
|
|
495
|
-
newsletterReactMessage(jid: string, serverId: string, reaction?: string): Promise<void>;
|
|
496
|
-
newsletterFetchMessages(jid: string, count: number, since?: number, after?: number): Promise<unknown>;
|
|
497
|
-
newsletterAdminCount(jid: string): Promise<number>;
|
|
498
|
-
newsletterChangeOwner(jid: string, newOwnerJid: string): Promise<void>;
|
|
499
|
-
newsletterDemote(jid: string, userJid: string): Promise<void>;
|
|
500
|
-
communityCreate(subject: string, body: string): Promise<GroupMetadata>;
|
|
501
|
-
communityCreateGroup(subject: string, participants: string[], parentCommunityJid: string): Promise<GroupMetadata>;
|
|
502
|
-
communityLinkGroup(groupJid: string, parentCommunityJid: string): Promise<void>;
|
|
503
|
-
communityUnlinkGroup(groupJid: string, parentCommunityJid: string): Promise<void>;
|
|
504
|
-
communityFetchLinkedGroups(jid: string): Promise<{
|
|
505
|
-
communityJid: string;
|
|
506
|
-
isCommunity: boolean;
|
|
507
|
-
linkedGroups: LinkedGroup[];
|
|
508
|
-
}>;
|
|
509
|
-
communityLeave(id: string): Promise<void>;
|
|
510
|
-
communityUpdateSubject(jid: string, subject: string): Promise<void>;
|
|
511
|
-
communityUpdateDescription(jid: string, description?: string): Promise<void>;
|
|
512
|
-
communityInviteCode(jid: string): Promise<string | undefined>;
|
|
513
|
-
communityRevokeInvite(jid: string): Promise<string | undefined>;
|
|
514
|
-
communityAcceptInvite(code: string): Promise<string | undefined>;
|
|
515
|
-
communityMetadata(jid: string): Promise<GroupMetadata>;
|
|
516
|
-
communityFetchAllParticipating(): Promise<{
|
|
517
|
-
[jid: string]: GroupMetadata;
|
|
518
|
-
}>;
|
|
519
|
-
communityGetInviteInfo(code: string): Promise<GroupMetadata>;
|
|
520
|
-
communityToggleEphemeral(jid: string, ephemeralExpiration: number): Promise<void>;
|
|
521
|
-
communitySettingUpdate(jid: string, setting: 'announcement' | 'not_announcement'): Promise<void>;
|
|
522
|
-
communityMemberAddMode(jid: string, mode: 'admin_add' | 'all_member_add'): Promise<void>;
|
|
523
|
-
communityJoinApprovalMode(jid: string, mode: 'on' | 'off'): Promise<void>;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
declare class GroupModule {
|
|
527
|
-
private readonly getSocket;
|
|
528
|
-
private readonly guard?;
|
|
529
|
-
constructor(getSocket: () => DomainSocketLike | undefined, guard?: OperationGuard | undefined);
|
|
530
|
-
protected requireSocket(): DomainSocketLike;
|
|
531
|
-
private mapParticipants;
|
|
532
|
-
private run;
|
|
533
|
-
create(subject: string, participants: string[]): Promise<GroupMetadata>;
|
|
534
|
-
addMember(groupId: string, jids: string[]): Promise<ParticipantUpdateResult[]>;
|
|
535
|
-
removeMember(groupId: string, jids: string[]): Promise<ParticipantUpdateResult[]>;
|
|
536
|
-
promote(groupId: string, jids: string[]): Promise<ParticipantUpdateResult[]>;
|
|
537
|
-
demote(groupId: string, jids: string[]): Promise<ParticipantUpdateResult[]>;
|
|
538
|
-
updateSubject(groupId: string, subject: string): Promise<void>;
|
|
539
|
-
updateDescription(groupId: string, description?: string): Promise<void>;
|
|
540
|
-
leave(groupId: string): Promise<void>;
|
|
541
|
-
metadata(groupId: string): Promise<GroupMetadata>;
|
|
542
|
-
tagMember(groupId: string, jid: string, label: string): Promise<void>;
|
|
543
|
-
inviteCode(groupId: string): Promise<string>;
|
|
544
|
-
revokeInvite(groupId: string): Promise<string>;
|
|
545
|
-
acceptInvite(code: string): Promise<string>;
|
|
546
|
-
toggleEphemeral(groupId: string, seconds: number): Promise<void>;
|
|
547
|
-
setting(groupId: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked'): Promise<void>;
|
|
548
|
-
list(): Promise<GroupMetadata[]>;
|
|
549
|
-
inviteInfo(code: string): Promise<GroupMetadata>;
|
|
550
|
-
joinRequests(groupId: string): Promise<Array<{
|
|
551
|
-
[k: string]: string;
|
|
552
|
-
}>>;
|
|
553
|
-
approveJoin(groupId: string, jids: string[]): Promise<ParticipantUpdateResult[]>;
|
|
554
|
-
rejectJoin(groupId: string, jids: string[]): Promise<ParticipantUpdateResult[]>;
|
|
555
|
-
joinApproval(groupId: string, enabled: boolean): Promise<void>;
|
|
556
|
-
memberAddMode(groupId: string, adminsOnly: boolean): Promise<void>;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
declare class PrivacyModule {
|
|
560
|
-
private readonly getSocket;
|
|
561
|
-
constructor(getSocket: () => DomainSocketLike | undefined);
|
|
562
|
-
protected requireSocket(): DomainSocketLike;
|
|
563
|
-
set(config: PrivacyConfig & {
|
|
564
|
-
readReceipts?: WAReadReceiptsValue | boolean;
|
|
565
|
-
}): Promise<void>;
|
|
566
|
-
get(): Promise<PrivacySettings>;
|
|
567
|
-
block(jid: string): Promise<void>;
|
|
568
|
-
unblock(jid: string): Promise<void>;
|
|
569
|
-
blocklist(): Promise<string[]>;
|
|
570
|
-
disappearingMode(seconds: number): Promise<void>;
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
declare class NewsletterModule {
|
|
574
|
-
private readonly getSocket;
|
|
575
|
-
private readonly guard?;
|
|
576
|
-
constructor(getSocket: () => DomainSocketLike | undefined, guard?: OperationGuard | undefined);
|
|
577
|
-
protected requireSocket(): DomainSocketLike;
|
|
578
|
-
private run;
|
|
579
|
-
create(name: string, opts?: {
|
|
580
|
-
description?: string;
|
|
581
|
-
picture?: Buffer;
|
|
582
|
-
}): Promise<NewsletterMetadata>;
|
|
583
|
-
follow(jid: string): Promise<void>;
|
|
584
|
-
unfollow(jid: string): Promise<void>;
|
|
585
|
-
metadata(jid: string): Promise<NewsletterMetadata>;
|
|
586
|
-
updateName(jid: string, name: string): Promise<void>;
|
|
587
|
-
updateDescription(jid: string, description: string): Promise<void>;
|
|
588
|
-
updatePicture(jid: string, picture: Buffer): Promise<void>;
|
|
589
|
-
mute(jid: string): Promise<void>;
|
|
590
|
-
unmute(jid: string): Promise<void>;
|
|
591
|
-
delete(jid: string): Promise<void>;
|
|
592
|
-
removePicture(jid: string): Promise<void>;
|
|
593
|
-
react(jid: string, serverId: string, emoji: string): Promise<void>;
|
|
594
|
-
/** Remove a reaction from a newsletter message. */
|
|
595
|
-
unreact(jid: string, serverId: string): Promise<void>;
|
|
596
|
-
subscribers(jid: string): Promise<unknown>;
|
|
597
|
-
messages(jid: string, count?: number, opts?: {
|
|
598
|
-
since?: number;
|
|
599
|
-
after?: number;
|
|
600
|
-
}): Promise<unknown>;
|
|
601
|
-
adminCount(jid: string): Promise<number>;
|
|
602
|
-
changeOwner(jid: string, newOwnerJid: string): Promise<void>;
|
|
603
|
-
demote(jid: string, userJid: string): Promise<void>;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
declare class CommunityModule {
|
|
607
|
-
private readonly getSocket;
|
|
608
|
-
private readonly guard?;
|
|
609
|
-
constructor(getSocket: () => DomainSocketLike | undefined, guard?: OperationGuard | undefined);
|
|
610
|
-
protected requireSocket(): DomainSocketLike;
|
|
611
|
-
private run;
|
|
612
|
-
create(subject: string, body: string): Promise<GroupMetadata>;
|
|
613
|
-
createGroup(subject: string, participants: string[], communityId: string): Promise<GroupMetadata>;
|
|
614
|
-
linkGroup(communityId: string, groupId: string): Promise<void>;
|
|
615
|
-
unlinkGroup(communityId: string, groupId: string): Promise<void>;
|
|
616
|
-
subGroups(communityId: string): Promise<LinkedGroup[]>;
|
|
617
|
-
leave(communityId: string): Promise<void>;
|
|
618
|
-
updateSubject(communityId: string, subject: string): Promise<void>;
|
|
619
|
-
updateDescription(communityId: string, description?: string): Promise<void>;
|
|
620
|
-
inviteCode(communityId: string): Promise<string | undefined>;
|
|
621
|
-
revokeInvite(communityId: string): Promise<string | undefined>;
|
|
622
|
-
acceptInvite(code: string): Promise<string | undefined>;
|
|
623
|
-
metadata(communityId: string): Promise<GroupMetadata>;
|
|
624
|
-
list(): Promise<GroupMetadata[]>;
|
|
625
|
-
inviteInfo(code: string): Promise<GroupMetadata>;
|
|
626
|
-
toggleEphemeral(communityId: string, seconds: number): Promise<void>;
|
|
627
|
-
setting(communityId: string, setting: 'announcement' | 'not_announcement'): Promise<void>;
|
|
628
|
-
memberAddMode(communityId: string, adminsOnly: boolean): Promise<void>;
|
|
629
|
-
joinApproval(communityId: string, enabled: boolean): Promise<void>;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
declare class ProfileModule {
|
|
633
|
-
private readonly getSocket;
|
|
634
|
-
constructor(getSocket: () => DomainSocketLike | undefined);
|
|
635
|
-
protected requireSocket(): DomainSocketLike;
|
|
636
|
-
setName(name: string): Promise<void>;
|
|
637
|
-
setStatus(status: string): Promise<void>;
|
|
638
|
-
/** Set the profile/group picture. `jid` defaults to self; pass a group jid to set a group avatar. */
|
|
639
|
-
setPicture(jid: string, image: WAMediaUpload): Promise<void>;
|
|
640
|
-
removePicture(jid: string): Promise<void>;
|
|
641
|
-
getPicture(jid: string, hd?: boolean): Promise<string | null>;
|
|
642
|
-
getStatus(jid: string): Promise<unknown>;
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
type LastMessage = {
|
|
646
|
-
key: WAMessageKey;
|
|
647
|
-
messageTimestamp: number;
|
|
648
|
-
};
|
|
649
|
-
type LastMessageResolver = (jid: string) => Promise<LastMessage[]>;
|
|
650
|
-
declare class ChatModule {
|
|
651
|
-
private readonly getSocket;
|
|
652
|
-
private readonly resolveLast?;
|
|
653
|
-
constructor(getSocket: () => DomainSocketLike | undefined, resolveLast?: LastMessageResolver | undefined);
|
|
654
|
-
protected requireSocket(): DomainSocketLike;
|
|
655
|
-
private last;
|
|
656
|
-
archive(jid: string): Promise<void>;
|
|
657
|
-
unarchive(jid: string): Promise<void>;
|
|
658
|
-
pin(jid: string): Promise<void>;
|
|
659
|
-
unpin(jid: string): Promise<void>;
|
|
660
|
-
/** Mute for `durationMs` (e.g. 8h = 28_800_000). Omit to mute indefinitely. */
|
|
661
|
-
mute(jid: string, durationMs?: number): Promise<void>;
|
|
662
|
-
unmute(jid: string): Promise<void>;
|
|
663
|
-
markRead(jid: string): Promise<void>;
|
|
664
|
-
markUnread(jid: string): Promise<void>;
|
|
665
|
-
star(key: WAMessageKey, starred?: boolean): Promise<void>;
|
|
666
|
-
unstar(key: WAMessageKey): Promise<void>;
|
|
667
|
-
delete(jid: string): Promise<void>;
|
|
668
|
-
clear(jid: string): Promise<void>;
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
type ContactCheckResult = {
|
|
672
|
-
jid: string;
|
|
673
|
-
exists: boolean;
|
|
674
|
-
lid?: string;
|
|
675
|
-
};
|
|
676
|
-
declare class ContactModule {
|
|
677
|
-
private readonly getSocket;
|
|
678
|
-
private readonly normalize;
|
|
679
|
-
constructor(getSocket: () => DomainSocketLike | undefined, normalize: (input: string) => string);
|
|
680
|
-
protected requireSocket(): DomainSocketLike;
|
|
681
|
-
/** Check whether phone numbers are on WhatsApp; returns the resolved jid + existence per input. */
|
|
682
|
-
check(...numbers: string[]): Promise<ContactCheckResult[]>;
|
|
683
|
-
exists(number: string): Promise<boolean>;
|
|
684
|
-
save(jid: string, name: {
|
|
685
|
-
firstName?: string;
|
|
686
|
-
lastName?: string;
|
|
687
|
-
fullName?: string;
|
|
688
|
-
}): Promise<void>;
|
|
689
|
-
remove(jid: string): Promise<void>;
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
declare class BusinessModule {
|
|
693
|
-
private readonly getSocket;
|
|
694
|
-
constructor(getSocket: () => DomainSocketLike | undefined);
|
|
695
|
-
protected requireSocket(): DomainSocketLike;
|
|
696
|
-
profile(jid: string): Promise<unknown>;
|
|
697
|
-
catalog(opts?: {
|
|
698
|
-
jid?: string;
|
|
699
|
-
limit?: number;
|
|
700
|
-
cursor?: string;
|
|
701
|
-
}): Promise<unknown>;
|
|
702
|
-
collections(jid?: string, limit?: number): Promise<unknown>;
|
|
703
|
-
orderDetails(orderId: string, tokenBase64: string): Promise<unknown>;
|
|
704
|
-
createProduct(create: Record<string, unknown>): Promise<unknown>;
|
|
705
|
-
updateProduct(productId: string, update: Record<string, unknown>): Promise<unknown>;
|
|
706
|
-
deleteProduct(...productIds: string[]): Promise<{
|
|
707
|
-
deleted: number;
|
|
708
|
-
}>;
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
interface SenderInfo {
|
|
712
|
-
jid: string;
|
|
713
|
-
deviceJid?: string;
|
|
714
|
-
lid?: string;
|
|
715
|
-
pn?: string;
|
|
716
|
-
username?: string;
|
|
717
|
-
pushName?: string;
|
|
718
|
-
isMe?: boolean;
|
|
719
|
-
}
|
|
720
|
-
interface GroupParticipantInfo {
|
|
721
|
-
jid: string;
|
|
722
|
-
participantAlt?: string;
|
|
723
|
-
authorPn?: string;
|
|
724
|
-
authorUsername?: string;
|
|
725
|
-
isAdmin?: boolean;
|
|
726
|
-
}
|
|
727
|
-
interface QuotedRef {
|
|
728
|
-
key: WAMessageKey;
|
|
729
|
-
content?: string;
|
|
730
|
-
sender?: SenderInfo;
|
|
731
|
-
}
|
|
732
|
-
type MediaKind = 'image' | 'video' | 'audio' | 'document' | 'sticker';
|
|
733
|
-
interface MediaDownloadResult {
|
|
734
|
-
buffer: Buffer;
|
|
735
|
-
mime: string;
|
|
736
|
-
size: number;
|
|
737
|
-
}
|
|
738
|
-
interface MediaDescriptor {
|
|
739
|
-
mimetype: string;
|
|
740
|
-
size?: number;
|
|
741
|
-
caption?: string;
|
|
742
|
-
fileName?: string;
|
|
743
|
-
ptt?: boolean;
|
|
744
|
-
}
|
|
745
|
-
interface ReactionPayload {
|
|
746
|
-
key: WAMessageKey;
|
|
747
|
-
emoji: string | null;
|
|
748
|
-
sender: SenderInfo;
|
|
749
|
-
timestamp: number;
|
|
750
|
-
}
|
|
751
|
-
interface EditPayload {
|
|
752
|
-
key: WAMessageKey;
|
|
753
|
-
newContent: string;
|
|
754
|
-
editedAt: number;
|
|
755
|
-
sender: SenderInfo;
|
|
756
|
-
}
|
|
757
|
-
interface DeletePayload {
|
|
758
|
-
key: WAMessageKey;
|
|
759
|
-
deletedFor: 'everyone' | 'me';
|
|
760
|
-
sender: SenderInfo;
|
|
761
|
-
timestamp: number;
|
|
762
|
-
}
|
|
763
|
-
interface PollVotePayload {
|
|
764
|
-
pollKey: WAMessageKey;
|
|
765
|
-
selectedOptions: string[];
|
|
766
|
-
voter: SenderInfo;
|
|
767
|
-
timestamp: number;
|
|
768
|
-
}
|
|
769
|
-
interface ButtonClickPayload {
|
|
770
|
-
key: WAMessageKey;
|
|
771
|
-
buttonId: string;
|
|
772
|
-
buttonText?: string;
|
|
773
|
-
sender: SenderInfo;
|
|
774
|
-
timestamp: number;
|
|
775
|
-
}
|
|
776
|
-
interface ListSelectPayload {
|
|
777
|
-
key: WAMessageKey;
|
|
778
|
-
rowId: string;
|
|
779
|
-
title?: string;
|
|
780
|
-
sender: SenderInfo;
|
|
781
|
-
timestamp: number;
|
|
782
|
-
}
|
|
783
|
-
interface GroupUpdatePayload {
|
|
784
|
-
groupId: string;
|
|
785
|
-
update: Partial<{
|
|
786
|
-
subject: string;
|
|
787
|
-
description: string;
|
|
788
|
-
announce: boolean;
|
|
789
|
-
restrict: boolean;
|
|
790
|
-
ephemeralDuration: number;
|
|
791
|
-
}>;
|
|
792
|
-
timestamp: number;
|
|
793
|
-
}
|
|
794
|
-
interface GroupJoinPayload {
|
|
795
|
-
groupId: string;
|
|
796
|
-
participants: GroupParticipantInfo[];
|
|
797
|
-
action: 'add' | 'invite' | 'invite-link';
|
|
798
|
-
by?: string;
|
|
799
|
-
timestamp: number;
|
|
800
|
-
}
|
|
801
|
-
interface GroupLeavePayload {
|
|
802
|
-
groupId: string;
|
|
803
|
-
participants: GroupParticipantInfo[];
|
|
804
|
-
action: 'remove' | 'leave';
|
|
805
|
-
by?: string;
|
|
806
|
-
timestamp: number;
|
|
807
|
-
}
|
|
808
|
-
interface MemberTagPayload {
|
|
809
|
-
groupId: string;
|
|
810
|
-
participant: string;
|
|
811
|
-
participantAlt?: string;
|
|
812
|
-
label: string;
|
|
813
|
-
timestamp: number;
|
|
814
|
-
}
|
|
815
|
-
type CallPayload = (CallBase & {
|
|
816
|
-
kind: 'incoming';
|
|
817
|
-
}) | (CallBase & {
|
|
818
|
-
kind: 'ended';
|
|
819
|
-
});
|
|
820
|
-
interface CallBase {
|
|
821
|
-
callId: string;
|
|
822
|
-
from: string;
|
|
823
|
-
isGroup: boolean;
|
|
824
|
-
isVideo: boolean;
|
|
825
|
-
timestamp: number;
|
|
826
|
-
status?: string;
|
|
827
|
-
}
|
|
828
|
-
interface HistorySyncPayload {
|
|
829
|
-
syncType: string;
|
|
830
|
-
status: 'complete' | 'paused';
|
|
831
|
-
explicit: boolean;
|
|
832
|
-
}
|
|
833
|
-
type LimitedPayload = {
|
|
834
|
-
reason: 'reachout-timelock';
|
|
835
|
-
retryAt: number;
|
|
836
|
-
} | {
|
|
837
|
-
reason: 'chat-limit-reached';
|
|
838
|
-
usedQuota?: number;
|
|
839
|
-
totalQuota?: number;
|
|
840
|
-
};
|
|
841
|
-
interface PresencePayload {
|
|
842
|
-
jid: string;
|
|
843
|
-
participant?: string;
|
|
844
|
-
status: 'available' | 'unavailable' | 'composing' | 'recording' | 'paused';
|
|
845
|
-
}
|
|
846
|
-
type NewsletterPayload = {
|
|
847
|
-
newsletterId: string;
|
|
848
|
-
timestamp: number;
|
|
849
|
-
} & ({
|
|
850
|
-
action: 'reaction';
|
|
851
|
-
serverId?: string;
|
|
852
|
-
emoji?: string;
|
|
853
|
-
} | {
|
|
854
|
-
action: 'view';
|
|
855
|
-
serverId?: string;
|
|
856
|
-
count?: number;
|
|
857
|
-
} | {
|
|
858
|
-
action: 'participants';
|
|
859
|
-
count?: number;
|
|
860
|
-
} | {
|
|
861
|
-
action: 'settings';
|
|
862
|
-
update?: Record<string, unknown>;
|
|
863
|
-
});
|
|
864
|
-
type InboundEventMap = {
|
|
865
|
-
message: MessageContext;
|
|
866
|
-
text: MessageContext;
|
|
867
|
-
image: MessageContext;
|
|
868
|
-
video: MessageContext;
|
|
869
|
-
audio: MessageContext;
|
|
870
|
-
document: MessageContext;
|
|
871
|
-
sticker: MessageContext;
|
|
872
|
-
reaction: ReactionPayload;
|
|
873
|
-
edit: EditPayload;
|
|
874
|
-
delete: DeletePayload;
|
|
875
|
-
'poll-vote': PollVotePayload;
|
|
876
|
-
'button-click': ButtonClickPayload;
|
|
877
|
-
'list-select': ListSelectPayload;
|
|
878
|
-
mention: MentionContext;
|
|
879
|
-
'mention-all': MentionAllContext;
|
|
880
|
-
'group-update': GroupUpdatePayload;
|
|
881
|
-
'group-join': GroupJoinPayload;
|
|
882
|
-
'group-leave': GroupLeavePayload;
|
|
883
|
-
'member-tag': MemberTagPayload;
|
|
884
|
-
'call-incoming': Extract<CallPayload, {
|
|
885
|
-
kind: 'incoming';
|
|
886
|
-
}>;
|
|
887
|
-
'call-ended': Extract<CallPayload, {
|
|
888
|
-
kind: 'ended';
|
|
889
|
-
}>;
|
|
890
|
-
'history-sync': HistorySyncPayload;
|
|
891
|
-
limited: LimitedPayload;
|
|
892
|
-
presence: PresencePayload;
|
|
893
|
-
newsletter: NewsletterPayload;
|
|
894
|
-
};
|
|
895
|
-
type InboundEventName = keyof InboundEventMap;
|
|
896
|
-
|
|
897
|
-
type ChatType = 'text' | 'image' | 'video' | 'audio' | 'document' | 'sticker' | 'poll' | 'contact' | 'location' | 'live-location' | 'event' | 'album' | 'group-invite' | 'product' | 'order' | 'payment' | 'buttons' | 'list' | 'interactive' | 'template' | 'unknown';
|
|
898
|
-
type SenderDevice = 'unknown' | 'android' | 'ios' | 'web' | 'desktop' | string;
|
|
899
|
-
interface CitationConfig {
|
|
900
|
-
authors?: string[] | ((jid: string) => boolean | Promise<boolean>);
|
|
901
|
-
banned?: string[] | ((jid: string) => boolean | Promise<boolean>);
|
|
902
|
-
}
|
|
903
|
-
interface CitationPredicates {
|
|
904
|
-
authors(): Promise<boolean>;
|
|
905
|
-
banned(): Promise<boolean>;
|
|
906
|
-
}
|
|
907
|
-
interface MediaAttachment {
|
|
908
|
-
type: 'image' | 'video' | 'audio' | 'document' | 'sticker';
|
|
909
|
-
mimetype: string | null;
|
|
910
|
-
caption: string | null;
|
|
911
|
-
fileName: string | null;
|
|
912
|
-
fileSize: number | null;
|
|
913
|
-
ptt: boolean;
|
|
914
|
-
buffer(): Promise<Buffer>;
|
|
915
|
-
stream(): Promise<Readable>;
|
|
916
|
-
}
|
|
917
|
-
interface PollMedia {
|
|
918
|
-
type: 'poll';
|
|
919
|
-
name: string | null;
|
|
920
|
-
options: string[];
|
|
921
|
-
selectableCount: number;
|
|
922
|
-
}
|
|
923
|
-
interface ContactCard {
|
|
924
|
-
displayName: string | null;
|
|
925
|
-
vcard: string | null;
|
|
926
|
-
}
|
|
927
|
-
interface ContactMedia {
|
|
928
|
-
type: 'contact';
|
|
929
|
-
displayName: string | null;
|
|
930
|
-
vcard: string | null;
|
|
931
|
-
contacts: ContactCard[];
|
|
932
|
-
}
|
|
933
|
-
interface LocationMedia {
|
|
934
|
-
type: 'location' | 'live-location';
|
|
935
|
-
latitude: number | null;
|
|
936
|
-
longitude: number | null;
|
|
937
|
-
name: string | null;
|
|
938
|
-
address: string | null;
|
|
939
|
-
accuracy: number | null;
|
|
940
|
-
speed: number | null;
|
|
941
|
-
caption: string | null;
|
|
942
|
-
}
|
|
943
|
-
interface AlbumMedia {
|
|
944
|
-
type: 'album';
|
|
945
|
-
expectedImageCount: number | null;
|
|
946
|
-
expectedVideoCount: number | null;
|
|
947
|
-
}
|
|
948
|
-
interface GroupInviteMedia {
|
|
949
|
-
type: 'group-invite';
|
|
950
|
-
groupId: string | null;
|
|
951
|
-
groupName: string | null;
|
|
952
|
-
inviteCode: string | null;
|
|
953
|
-
caption: string | null;
|
|
954
|
-
expiresAt: number | null;
|
|
955
|
-
}
|
|
956
|
-
interface ProductMedia {
|
|
957
|
-
type: 'product';
|
|
958
|
-
productId: string | null;
|
|
959
|
-
title: string | null;
|
|
960
|
-
description: string | null;
|
|
961
|
-
price: number | null;
|
|
962
|
-
currency: string | null;
|
|
963
|
-
retailerId: string | null;
|
|
964
|
-
url: string | null;
|
|
965
|
-
businessOwnerId: string | null;
|
|
966
|
-
}
|
|
967
|
-
interface OrderMedia {
|
|
968
|
-
type: 'order';
|
|
969
|
-
orderId: string | null;
|
|
970
|
-
title: string | null;
|
|
971
|
-
itemCount: number | null;
|
|
972
|
-
total: number | null;
|
|
973
|
-
currency: string | null;
|
|
974
|
-
status: string | null;
|
|
975
|
-
message: string | null;
|
|
976
|
-
}
|
|
977
|
-
interface PaymentMedia {
|
|
978
|
-
type: 'payment';
|
|
979
|
-
kind: 'request' | 'send' | 'invite';
|
|
980
|
-
amount: number | null;
|
|
981
|
-
currency: string | null;
|
|
982
|
-
note: string | null;
|
|
983
|
-
expiresAt: number | null;
|
|
984
|
-
}
|
|
985
|
-
interface LinkPreviewMedia {
|
|
986
|
-
type: 'link';
|
|
987
|
-
url: string | null;
|
|
988
|
-
title: string | null;
|
|
989
|
-
description: string | null;
|
|
990
|
-
}
|
|
991
|
-
interface EventMedia {
|
|
992
|
-
type: 'event';
|
|
993
|
-
name: string | null;
|
|
994
|
-
description: string | null;
|
|
995
|
-
location: string | null;
|
|
996
|
-
startTime: number | null;
|
|
997
|
-
endTime: number | null;
|
|
998
|
-
isCanceled: boolean;
|
|
999
|
-
}
|
|
1000
|
-
interface MessageButton {
|
|
1001
|
-
id: string | null;
|
|
1002
|
-
text: string | null;
|
|
1003
|
-
}
|
|
1004
|
-
interface ButtonsMedia {
|
|
1005
|
-
type: 'buttons';
|
|
1006
|
-
contentText: string | null;
|
|
1007
|
-
footerText: string | null;
|
|
1008
|
-
buttons: MessageButton[];
|
|
1009
|
-
}
|
|
1010
|
-
interface ListRow {
|
|
1011
|
-
id: string | null;
|
|
1012
|
-
title: string | null;
|
|
1013
|
-
description: string | null;
|
|
1014
|
-
}
|
|
1015
|
-
interface ListSection {
|
|
1016
|
-
title: string | null;
|
|
1017
|
-
rows: ListRow[];
|
|
1018
|
-
}
|
|
1019
|
-
interface ListMedia {
|
|
1020
|
-
type: 'list';
|
|
1021
|
-
title: string | null;
|
|
1022
|
-
description: string | null;
|
|
1023
|
-
buttonText: string | null;
|
|
1024
|
-
sections: ListSection[];
|
|
1025
|
-
}
|
|
1026
|
-
interface InteractiveMedia {
|
|
1027
|
-
type: 'interactive';
|
|
1028
|
-
title: string | null;
|
|
1029
|
-
body: string | null;
|
|
1030
|
-
footer: string | null;
|
|
1031
|
-
buttons: Array<{
|
|
1032
|
-
name: string | null;
|
|
1033
|
-
params: string | null;
|
|
1034
|
-
}>;
|
|
1035
|
-
}
|
|
1036
|
-
interface TemplateMedia {
|
|
1037
|
-
type: 'template';
|
|
1038
|
-
text: string | null;
|
|
1039
|
-
buttons: MessageButton[];
|
|
1040
|
-
}
|
|
1041
|
-
type ContextMedia = MediaAttachment | PollMedia | ContactMedia | LocationMedia | EventMedia | AlbumMedia | GroupInviteMedia | ProductMedia | OrderMedia | PaymentMedia | LinkPreviewMedia | ButtonsMedia | ListMedia | InteractiveMedia | TemplateMedia;
|
|
1042
|
-
interface MessageContext {
|
|
1043
|
-
uniqueId: string;
|
|
1044
|
-
staticId: string;
|
|
1045
|
-
channelId: string;
|
|
1046
|
-
chatId: string;
|
|
1047
|
-
chatType: ChatType;
|
|
1048
|
-
receiverId: string;
|
|
1049
|
-
roomId: string | null;
|
|
1050
|
-
senderId: string;
|
|
1051
|
-
senderLid: string | null;
|
|
1052
|
-
senderName: string | null;
|
|
1053
|
-
senderDevice: SenderDevice;
|
|
1054
|
-
timestamp: number;
|
|
1055
|
-
text: string;
|
|
1056
|
-
mentions: string[];
|
|
1057
|
-
links: string[];
|
|
1058
|
-
isFromMe: boolean;
|
|
1059
|
-
isGroup: boolean;
|
|
1060
|
-
isNewsletter: boolean;
|
|
1061
|
-
isBroadcast: boolean;
|
|
1062
|
-
isViewOnce: boolean;
|
|
1063
|
-
isEphemeral: boolean;
|
|
1064
|
-
isForwarded: boolean;
|
|
1065
|
-
isQuestion: boolean;
|
|
1066
|
-
isPrefix: boolean;
|
|
1067
|
-
isTagMe: boolean;
|
|
1068
|
-
isEdited: boolean;
|
|
1069
|
-
isDeleted: boolean;
|
|
1070
|
-
isPinned: boolean;
|
|
1071
|
-
isUnPinned: boolean;
|
|
1072
|
-
isBot: boolean;
|
|
1073
|
-
isSpam: boolean;
|
|
1074
|
-
isHideTags: boolean;
|
|
1075
|
-
isStatusMention: boolean;
|
|
1076
|
-
isGroupStatusMention: boolean;
|
|
1077
|
-
isStory: boolean;
|
|
1078
|
-
roomName(): Promise<string | null>;
|
|
1079
|
-
receiverName(): Promise<string | null>;
|
|
1080
|
-
media?: ContextMedia;
|
|
1081
|
-
replied(): Promise<MessageContext | null>;
|
|
1082
|
-
message(): WAMessage;
|
|
1083
|
-
citation: CitationPredicates;
|
|
1084
|
-
reply(content: string, opts?: TextOptions): Promise<WAMessageKey>;
|
|
1085
|
-
react(emoji: string): Promise<WAMessageKey>;
|
|
1086
|
-
}
|
|
1087
|
-
interface MentionContext extends MessageContext {
|
|
1088
|
-
mentionedJids: string[];
|
|
1089
|
-
selfJid: string;
|
|
1090
|
-
}
|
|
1091
|
-
interface MentionAllContext extends MessageContext {
|
|
1092
|
-
isMentionAll: true;
|
|
1093
|
-
selfJid: string;
|
|
1094
|
-
members?: string[];
|
|
1095
|
-
}
|
|
1096
|
-
interface BuildContextInput {
|
|
1097
|
-
message: WAMessage;
|
|
1098
|
-
key: WAMessageKey;
|
|
1099
|
-
channelId: string;
|
|
1100
|
-
receiverId: string;
|
|
1101
|
-
selfJid: string;
|
|
1102
|
-
text: string;
|
|
1103
|
-
chatType: ChatType;
|
|
1104
|
-
sender: SenderInfo;
|
|
1105
|
-
mentions: string[];
|
|
1106
|
-
isViewOnce: boolean;
|
|
1107
|
-
isEphemeral: boolean;
|
|
1108
|
-
isForwarded: boolean;
|
|
1109
|
-
isBroadcast: boolean;
|
|
1110
|
-
isNewsletter: boolean;
|
|
1111
|
-
prefixes: string[];
|
|
1112
|
-
citationConfig?: CitationConfig;
|
|
1113
|
-
lidMap?: Map<string, string>;
|
|
1114
|
-
resolveRoomName: () => Promise<string | null>;
|
|
1115
|
-
resolveReceiverName: () => Promise<string | null>;
|
|
1116
|
-
resolveReplied: () => Promise<MessageContext | null>;
|
|
1117
|
-
reply: (content: string, opts?: TextOptions) => Promise<WAMessageKey>;
|
|
1118
|
-
react: (emoji: string) => Promise<WAMessageKey>;
|
|
1119
|
-
media?: ContextMedia;
|
|
1120
|
-
}
|
|
1121
|
-
declare const extractLinks: (text: string) => string[];
|
|
1122
|
-
declare const computeUniqueId: (key: WAMessageKey) => string;
|
|
1123
|
-
declare const computeStaticId: (roomId: string | null, senderId: string) => string;
|
|
1124
|
-
declare const epochSecondsToMs: (value: unknown) => number;
|
|
1125
|
-
declare const senderDeviceOf: (jid: string) => SenderDevice;
|
|
1126
|
-
declare const buildMessageContext: (input: BuildContextInput) => MessageContext;
|
|
1127
|
-
|
|
1128
|
-
type CommandPrefix = string | string[];
|
|
1129
|
-
interface ParsedArgs {
|
|
1130
|
-
matched: boolean;
|
|
1131
|
-
name?: string;
|
|
1132
|
-
args: string[];
|
|
1133
|
-
flags: Record<string, string | boolean>;
|
|
1134
|
-
json: unknown;
|
|
1135
|
-
raw: string;
|
|
1136
|
-
}
|
|
1137
|
-
interface CommandContext extends MessageContext {
|
|
1138
|
-
raw: string;
|
|
1139
|
-
command: string;
|
|
1140
|
-
args: string[];
|
|
1141
|
-
flags: Record<string, string | boolean>;
|
|
1142
|
-
json: unknown;
|
|
1143
|
-
reply(content: string, opts?: TextOptions): Promise<WAMessageKey>;
|
|
1144
|
-
react(emoji: string): Promise<WAMessageKey>;
|
|
1145
|
-
edit(content: string): Promise<void>;
|
|
1146
|
-
}
|
|
1147
|
-
type CommandHandler = (ctx: CommandContext) => Promise<void> | void;
|
|
1148
|
-
type Middleware = (ctx: CommandContext, next: () => Promise<void>) => Promise<void> | void;
|
|
1149
|
-
interface CommandDefinition {
|
|
1150
|
-
name: string;
|
|
1151
|
-
aliases: string[];
|
|
1152
|
-
parts: string[];
|
|
1153
|
-
handler: CommandHandler;
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
type CommandErrorCode = 'DUPLICATE_COMMAND' | 'INVALID_COMMAND_NAME' | 'HANDLER_ERROR' | 'MIDDLEWARE_ERROR' | 'NO_SENT_MESSAGE' | 'NOT_CONNECTED';
|
|
1157
|
-
declare class ZaileysCommandError extends Error {
|
|
1158
|
-
readonly code: CommandErrorCode;
|
|
1159
|
-
readonly cause?: unknown;
|
|
1160
|
-
constructor(code: CommandErrorCode, message: string, options?: {
|
|
1161
|
-
cause?: unknown;
|
|
1162
|
-
});
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
declare function parseCommand(text: string, prefixes: string[]): ParsedArgs;
|
|
1166
|
-
|
|
1167
|
-
declare class CommandRegistry {
|
|
1168
|
-
private readonly paths;
|
|
1169
|
-
private readonly defs;
|
|
1170
|
-
private maxDepth;
|
|
1171
|
-
register(spec: string, handler: CommandHandler): void;
|
|
1172
|
-
resolve(parsed: ParsedArgs): {
|
|
1173
|
-
def: CommandDefinition;
|
|
1174
|
-
args: string[];
|
|
1175
|
-
} | undefined;
|
|
1176
|
-
unregister(spec: string): void;
|
|
1177
|
-
list(): CommandDefinition[];
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
declare function runMiddleware(chain: Middleware[], ctx: CommandContext, final: () => Promise<void> | void): Promise<void>;
|
|
1181
|
-
|
|
1182
|
-
type AuthStoreKey = keyof SignalDataTypeMap;
|
|
1183
|
-
type AuthStoreValue<K extends AuthStoreKey> = SignalDataTypeMap[K];
|
|
1184
|
-
interface AuthStore {
|
|
1185
|
-
read<K extends AuthStoreKey>(type: K, ids: readonly string[]): Promise<{
|
|
1186
|
-
[id: string]: AuthStoreValue<K> | undefined;
|
|
1187
|
-
}>;
|
|
1188
|
-
write(data: SignalDataSet): Promise<void>;
|
|
1189
|
-
delete<K extends AuthStoreKey>(type: K, ids: readonly string[]): Promise<void>;
|
|
1190
|
-
clear(): Promise<void>;
|
|
1191
|
-
close(): Promise<void>;
|
|
1192
|
-
}
|
|
1193
|
-
interface AuthCredsStore {
|
|
1194
|
-
readCreds(): Promise<AuthenticationCreds | undefined>;
|
|
1195
|
-
writeCreds(creds: AuthenticationCreds): Promise<void>;
|
|
1196
|
-
deleteCreds(): Promise<void>;
|
|
1197
|
-
}
|
|
1198
|
-
interface AuthStoreBundle {
|
|
1199
|
-
readonly creds: AuthCredsStore;
|
|
1200
|
-
readonly signal: AuthStore;
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
type AutoDeleteOptions = {
|
|
1204
|
-
maxAgeMs?: number;
|
|
1205
|
-
maxPerChat?: number;
|
|
1206
|
-
intervalMs?: number;
|
|
1207
|
-
chats?: 'all' | ((jid: string) => boolean);
|
|
1208
|
-
};
|
|
1209
|
-
declare function genericPrune(store: MessageStore, opts: PruneOptions): Promise<number>;
|
|
1210
|
-
declare class AutoDeleteSweeper {
|
|
1211
|
-
private readonly store;
|
|
1212
|
-
private readonly options;
|
|
1213
|
-
private readonly logger;
|
|
1214
|
-
private readonly now;
|
|
1215
|
-
private timer;
|
|
1216
|
-
private running;
|
|
1217
|
-
private warnedUnsupported;
|
|
1218
|
-
private disabled;
|
|
1219
|
-
constructor(deps: {
|
|
1220
|
-
store: MessageStore;
|
|
1221
|
-
options: AutoDeleteOptions;
|
|
1222
|
-
logger?: Logger;
|
|
1223
|
-
now?: () => number;
|
|
1224
|
-
});
|
|
1225
|
-
private get active();
|
|
1226
|
-
private buildPruneOptions;
|
|
1227
|
-
runOnce(): Promise<number>;
|
|
1228
|
-
start(): void;
|
|
1229
|
-
stop(): void;
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
type WAPresence = 'unavailable' | 'available' | 'composing' | 'recording' | 'paused';
|
|
1233
|
-
interface AutomationSocketLike {
|
|
1234
|
-
sendPresenceUpdate(type: WAPresence, toJid?: string): Promise<void>;
|
|
1235
|
-
}
|
|
1236
|
-
/** Drops presence updates that repeat the same (type, chat) inside `minIntervalMs`. */
|
|
1237
|
-
interface PresenceThrottleOptions {
|
|
1238
|
-
enabled?: boolean;
|
|
1239
|
-
minIntervalMs?: number;
|
|
1240
|
-
}
|
|
1241
|
-
type PresenceClock = {
|
|
1242
|
-
now?: () => number;
|
|
1243
|
-
};
|
|
1244
|
-
declare class PresenceModule {
|
|
1245
|
-
private readonly getSocket;
|
|
1246
|
-
private readonly throttleEnabled;
|
|
1247
|
-
private readonly minIntervalMs;
|
|
1248
|
-
private readonly now;
|
|
1249
|
-
private readonly lastSent;
|
|
1250
|
-
constructor(getSocket: () => AutomationSocketLike | undefined, throttle?: PresenceThrottleOptions, clock?: PresenceClock);
|
|
1251
|
-
protected requireSocket(): AutomationSocketLike;
|
|
1252
|
-
private throttled;
|
|
1253
|
-
private update;
|
|
1254
|
-
private scheduleClear;
|
|
1255
|
-
online(): Promise<void>;
|
|
1256
|
-
offline(): Promise<void>;
|
|
1257
|
-
typing(jid: string, ms?: number): Promise<void>;
|
|
1258
|
-
recording(jid: string, ms?: number): Promise<void>;
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
/**
|
|
1262
|
-
* Bounds QR and pairing-code regeneration across a client's lifetime to avoid
|
|
1263
|
-
* tripping WhatsApp's spam/automation restriction. Each reconnect creates a fresh
|
|
1264
|
-
* socket which re-emits a QR or requests a new pairing code; without a budget and
|
|
1265
|
-
* cooldown this loops unbounded and gets the account restricted.
|
|
1266
|
-
*/
|
|
1267
|
-
interface AuthGuardOptions {
|
|
1268
|
-
/** Master switch. When `false` the guard never blocks (legacy behaviour). Default `true`. */
|
|
1269
|
-
enabled?: boolean;
|
|
1270
|
-
/** Total QR codes emitted before the guard stops and signals exhaustion. Default `5`. */
|
|
1271
|
-
maxQrAttempts?: number;
|
|
1272
|
-
/** Total pairing-code requests before the guard stops and signals exhaustion. Default `3`. */
|
|
1273
|
-
maxPairingAttempts?: number;
|
|
1274
|
-
/** Base cooldown between pairing-code requests; escalates per attempt. Default `60000`. */
|
|
1275
|
-
pairingCooldownMs?: number;
|
|
1276
|
-
}
|
|
1277
|
-
type AuthAttemptBlockReason = 'budget-exhausted' | 'cooldown';
|
|
1278
|
-
interface AuthAttemptDecision {
|
|
1279
|
-
allowed: boolean;
|
|
1280
|
-
reason?: AuthAttemptBlockReason;
|
|
1281
|
-
waitMs: number;
|
|
1282
|
-
attempts: number;
|
|
1283
|
-
max: number;
|
|
1284
|
-
}
|
|
1285
|
-
interface AuthGuard {
|
|
1286
|
-
/** Decide whether a new auth attempt of `kind` is permitted at time `now` (does not mutate). */
|
|
1287
|
-
evaluate(kind: ConnectionAuthType, now: number): AuthAttemptDecision;
|
|
1288
|
-
/** Record that an attempt of `kind` was actually issued at time `now`. */
|
|
1289
|
-
record(kind: ConnectionAuthType, now: number): void;
|
|
1290
|
-
/** Clear all counters and cooldowns (call on a successful connection or manual restart). */
|
|
1291
|
-
reset(): void;
|
|
1292
|
-
readonly enabled: boolean;
|
|
1293
|
-
readonly qrAttempts: number;
|
|
1294
|
-
readonly pairingAttempts: number;
|
|
1295
|
-
}
|
|
1296
|
-
declare function createAuthGuard(options?: AuthGuardOptions): AuthGuard;
|
|
1297
|
-
|
|
1298
|
-
type DisconnectReasonDomain = 'logged-out' | 'connection-replaced' | 'forbidden' | 'restart-required' | 'bad-session' | 'connection-closed' | 'connection-lost' | 'multi-device-mismatch' | 'unavailable-service' | 'rate-limited' | 'unknown';
|
|
1299
|
-
declare function mapDisconnectReason(code: number | undefined): DisconnectReasonDomain;
|
|
1300
|
-
declare function isFatalDisconnect(reason: DisconnectReasonDomain): boolean;
|
|
1301
|
-
declare function isRateLimited(reason: DisconnectReasonDomain): boolean;
|
|
1302
|
-
declare function shouldClearAuth(reason: DisconnectReasonDomain): boolean;
|
|
1303
|
-
declare function shouldReconnect(reason: DisconnectReasonDomain): boolean;
|
|
1304
|
-
|
|
1305
|
-
interface PluginContext {
|
|
1306
|
-
client: Client;
|
|
1307
|
-
logger: Logger | undefined;
|
|
1308
|
-
pluginDir: string;
|
|
1309
|
-
command(spec: string, handler: CommandHandler): void;
|
|
1310
|
-
use(middleware: Middleware): void;
|
|
1311
|
-
on<E extends keyof ClientEventMap>(event: E, handler: (payload: ClientEventMap[E]) => void): () => void;
|
|
1312
|
-
once<E extends keyof ClientEventMap>(event: E, handler: (payload: ClientEventMap[E]) => void): () => void;
|
|
1313
|
-
}
|
|
1314
|
-
interface Plugin {
|
|
1315
|
-
name: string;
|
|
1316
|
-
setup(ctx: PluginContext): void | (() => void) | Promise<void | (() => void)>;
|
|
1317
|
-
onUnload?(): void | Promise<void>;
|
|
1318
|
-
}
|
|
1319
|
-
type PluginsOptions = {
|
|
1320
|
-
dir?: string;
|
|
1321
|
-
watch?: boolean;
|
|
1322
|
-
pattern?: RegExp;
|
|
1323
|
-
ignore?: RegExp;
|
|
1324
|
-
onError?: (err: unknown, file: string) => void;
|
|
1325
|
-
};
|
|
1326
|
-
declare const definePlugin: (plugin: Plugin) => Plugin;
|
|
1327
|
-
|
|
1328
|
-
type ConnectionState = 'idle' | 'connecting' | 'qr-pending' | 'pairing-pending' | 'connected' | 'reconnecting' | 'disconnecting' | 'disconnected';
|
|
1329
|
-
type ConnectionAuthType = 'qr' | 'pairing';
|
|
1330
|
-
interface Logger {
|
|
1331
|
-
debug(...args: unknown[]): void;
|
|
1332
|
-
info(...args: unknown[]): void;
|
|
1333
|
-
warn(...args: unknown[]): void;
|
|
1334
|
-
error(...args: unknown[]): void;
|
|
1335
|
-
fatal(...args: unknown[]): void;
|
|
1336
|
-
}
|
|
1337
|
-
interface ReconnectOptions {
|
|
1338
|
-
enabled?: boolean;
|
|
1339
|
-
maxAttempts?: number;
|
|
1340
|
-
initialDelayMs?: number;
|
|
1341
|
-
maxDelayMs?: number;
|
|
1342
|
-
jitterFactor?: number;
|
|
1343
|
-
/** Fixed backoff applied when the disconnect reason is `rate-limited` (429). Default `300000`. */
|
|
1344
|
-
rateLimitedDelayMs?: number;
|
|
1345
|
-
}
|
|
1346
|
-
interface ClientOptions {
|
|
1347
|
-
sessionId?: string;
|
|
1348
|
-
auth?: AuthStoreBundle;
|
|
1349
|
-
store?: MessageStore;
|
|
1350
|
-
authType?: ConnectionAuthType;
|
|
1351
|
-
phoneNumber?: string;
|
|
1352
|
-
logger?: Logger;
|
|
1353
|
-
cacheSignal?: boolean;
|
|
1354
|
-
reconnect?: ReconnectOptions;
|
|
1355
|
-
qrTerminal?: boolean;
|
|
1356
|
-
baileys?: Partial<UserFacingSocketConfig>;
|
|
1357
|
-
autoConnect?: boolean;
|
|
1358
|
-
statusLog?: boolean;
|
|
1359
|
-
commandPrefix?: string | string[];
|
|
1360
|
-
citation?: CitationConfig;
|
|
1361
|
-
ignoreMe?: boolean;
|
|
1362
|
-
/** Bounds QR/pairing regeneration to avoid spam restriction. ON by default; `{ enabled: false }` to opt out. */
|
|
1363
|
-
authGuard?: AuthGuardOptions;
|
|
1364
|
-
/** Spaces out sensitive group/community/newsletter operations. ON by default; `{ enabled: false }` to opt out. */
|
|
1365
|
-
operationGuard?: OperationGuardOptions;
|
|
1366
|
-
/** Drops duplicate presence (typing/recording/online) updates within a window. ON by default. */
|
|
1367
|
-
presence?: PresenceThrottleOptions;
|
|
1368
|
-
/** Max scheduled messages dispatched per second, smoothing backlog bursts. Default `1`; `0` disables. */
|
|
1369
|
-
scheduleRateLimitPerSec?: number;
|
|
1370
|
-
/** Periodically prune old messages from the store. Enabled by default with a 1-month `maxAgeMs`; pass `false` to disable or override any field. */
|
|
1371
|
-
autoDelete?: AutoDeleteOptions | false;
|
|
1372
|
-
/** Load and manage plugins from a directory. */
|
|
1373
|
-
plugins?: PluginsOptions;
|
|
1374
|
-
}
|
|
1375
|
-
type ConnectionEventMap = {
|
|
1376
|
-
connect: {
|
|
1377
|
-
sessionId: string;
|
|
1378
|
-
me: {
|
|
1379
|
-
id: string;
|
|
1380
|
-
lid?: string;
|
|
1381
|
-
name?: string;
|
|
1382
|
-
};
|
|
1383
|
-
};
|
|
1384
|
-
disconnect: {
|
|
1385
|
-
sessionId: string;
|
|
1386
|
-
reason: DisconnectReasonDomain;
|
|
1387
|
-
willReconnect: boolean;
|
|
1388
|
-
};
|
|
1389
|
-
qr: {
|
|
1390
|
-
sessionId: string;
|
|
1391
|
-
qrString: string;
|
|
1392
|
-
expiresAt: number;
|
|
1393
|
-
};
|
|
1394
|
-
'pairing-code': {
|
|
1395
|
-
sessionId: string;
|
|
1396
|
-
code: string;
|
|
1397
|
-
expiresAt: number;
|
|
1398
|
-
};
|
|
1399
|
-
reconnecting: {
|
|
1400
|
-
sessionId: string;
|
|
1401
|
-
attempt: number;
|
|
1402
|
-
delayMs: number;
|
|
1403
|
-
reason: DisconnectReasonDomain;
|
|
1404
|
-
};
|
|
1405
|
-
'auth-exhausted': {
|
|
1406
|
-
sessionId: string;
|
|
1407
|
-
kind: ConnectionAuthType;
|
|
1408
|
-
attempts: number;
|
|
1409
|
-
max: number;
|
|
1410
|
-
};
|
|
1411
|
-
error: {
|
|
1412
|
-
sessionId: string;
|
|
1413
|
-
error: Error;
|
|
1414
|
-
};
|
|
1415
|
-
};
|
|
1416
|
-
type ConnectionEventName = keyof ConnectionEventMap;
|
|
1417
|
-
type ConnectionEventHandler<E extends ConnectionEventName> = (payload: ConnectionEventMap[E]) => void;
|
|
1418
|
-
type ClientEventMap = ConnectionEventMap & InboundEventMap;
|
|
1419
|
-
type ClientEventName = keyof ClientEventMap;
|
|
1420
|
-
type BaileysSocket = WASocket;
|
|
1421
|
-
|
|
1422
|
-
interface ResolvedCommand {
|
|
1423
|
-
command: string;
|
|
1424
|
-
args: string[];
|
|
1425
|
-
flags: Record<string, string | boolean>;
|
|
1426
|
-
json: unknown;
|
|
1427
|
-
raw: string;
|
|
1428
|
-
}
|
|
1429
|
-
interface DispatcherDeps {
|
|
1430
|
-
registry: CommandRegistry;
|
|
1431
|
-
middleware: Middleware[];
|
|
1432
|
-
prefixes: string[];
|
|
1433
|
-
onText: (handler: (msg: MessageContext) => void) => () => void;
|
|
1434
|
-
buildContext: (resolved: ResolvedCommand, msg: MessageContext) => CommandContext;
|
|
1435
|
-
logger: Logger;
|
|
1436
|
-
}
|
|
1437
|
-
interface DispatcherHandle {
|
|
1438
|
-
detach(): void;
|
|
1439
|
-
}
|
|
1440
|
-
declare function attachCommandDispatcher(deps: DispatcherDeps): DispatcherHandle;
|
|
1441
|
-
|
|
1442
|
-
type RateLimiterOptions = {
|
|
1443
|
-
perSec: number;
|
|
1444
|
-
perJidPerSec?: number;
|
|
1445
|
-
burst?: number;
|
|
1446
|
-
};
|
|
1447
|
-
type RetryPolicy = {
|
|
1448
|
-
maxRetries: number;
|
|
1449
|
-
backoffMs: (attempt: number) => number;
|
|
1450
|
-
};
|
|
1451
|
-
type TaskQueueOptions = {
|
|
1452
|
-
concurrency?: number;
|
|
1453
|
-
retry?: RetryPolicy;
|
|
1454
|
-
};
|
|
1455
|
-
type BroadcastOptions = {
|
|
1456
|
-
rateLimitPerSec?: number;
|
|
1457
|
-
retry?: RetryPolicy;
|
|
1458
|
-
onProgress?: (done: number, total: number, jid: string, ok: boolean) => void;
|
|
1459
|
-
};
|
|
1460
|
-
type BroadcastResult = {
|
|
1461
|
-
sent: string[];
|
|
1462
|
-
failed: {
|
|
1463
|
-
jid: string;
|
|
1464
|
-
error: Error;
|
|
1465
|
-
}[];
|
|
1466
|
-
};
|
|
1467
|
-
type ScheduledJob = {
|
|
1468
|
-
id: string;
|
|
1469
|
-
fireAt: number;
|
|
1470
|
-
recipient: string;
|
|
1471
|
-
payload: unknown;
|
|
1472
|
-
};
|
|
1473
|
-
|
|
1474
|
-
type AutomationErrorCode = 'NOT_CONNECTED' | 'RATE_LIMIT_INVALID' | 'TASK_FAILED' | 'SCHEDULE_INVALID' | 'STORE_UNAVAILABLE' | 'PRESENCE_FAILED';
|
|
1475
|
-
declare class ZaileysAutomationError extends Error {
|
|
1476
|
-
readonly code: AutomationErrorCode;
|
|
1477
|
-
readonly cause?: unknown;
|
|
1478
|
-
constructor(code: AutomationErrorCode, message: string, options?: {
|
|
1479
|
-
cause?: unknown;
|
|
1480
|
-
});
|
|
1481
|
-
}
|
|
1482
|
-
|
|
1483
|
-
type RateLimiterClock = {
|
|
1484
|
-
now?: () => number;
|
|
1485
|
-
sleep?: (ms: number) => Promise<void>;
|
|
1486
|
-
};
|
|
1487
|
-
declare class RateLimiter {
|
|
1488
|
-
private readonly now;
|
|
1489
|
-
private readonly sleep;
|
|
1490
|
-
private readonly perJidRatePerMs?;
|
|
1491
|
-
private readonly perJidCapacity?;
|
|
1492
|
-
private readonly global;
|
|
1493
|
-
private readonly perJid;
|
|
1494
|
-
constructor(options: RateLimiterOptions, clock?: RateLimiterClock);
|
|
1495
|
-
acquire(jid?: string): Promise<void>;
|
|
1496
|
-
private bucketFor;
|
|
1497
|
-
private consume;
|
|
1498
|
-
private refill;
|
|
1499
|
-
}
|
|
1500
|
-
|
|
1501
|
-
type TaskQueueClock = {
|
|
1502
|
-
sleep?: (ms: number) => Promise<void>;
|
|
1503
|
-
};
|
|
1504
|
-
declare class TaskQueue {
|
|
1505
|
-
private readonly concurrency;
|
|
1506
|
-
private readonly retry;
|
|
1507
|
-
private readonly sleep;
|
|
1508
|
-
private readonly pending;
|
|
1509
|
-
private active;
|
|
1510
|
-
private idleWaiters;
|
|
1511
|
-
constructor(options?: TaskQueueOptions, clock?: TaskQueueClock);
|
|
1512
|
-
add<T>(task: () => Promise<T>): Promise<T>;
|
|
1513
|
-
onIdle(): Promise<void>;
|
|
1514
|
-
private pump;
|
|
1515
|
-
private settleIdle;
|
|
1516
|
-
private execute;
|
|
1517
|
-
}
|
|
1518
|
-
|
|
1519
|
-
type BroadcastDeps = {
|
|
1520
|
-
sendTo: (jid: string) => MessageBuilder<'init'>;
|
|
1521
|
-
limiter?: RateLimiter;
|
|
1522
|
-
now?: () => number;
|
|
1523
|
-
sleep?: (ms: number) => Promise<void>;
|
|
1524
|
-
};
|
|
1525
|
-
declare function runBroadcast(jids: string[], build: (b: MessageBuilder<'init'>) => MessageBuilder<'content-set'>, deps: BroadcastDeps, options?: BroadcastOptions): Promise<BroadcastResult>;
|
|
1526
|
-
|
|
1527
|
-
type ScheduledContentSnapshot = {
|
|
1528
|
-
recipient: string;
|
|
1529
|
-
content: AnyMessageContent;
|
|
1530
|
-
options?: MiscMessageGenerationOptions;
|
|
1531
|
-
};
|
|
1532
|
-
type SchedulerTimer = {
|
|
1533
|
-
set: (cb: () => void, ms: number) => unknown;
|
|
1534
|
-
clear: (handle: unknown) => void;
|
|
1535
|
-
};
|
|
1536
|
-
type SchedulerDeps = {
|
|
1537
|
-
store: MessageStore;
|
|
1538
|
-
sendSnapshot: (snapshot: ScheduledContentSnapshot) => Promise<void>;
|
|
1539
|
-
now?: () => number;
|
|
1540
|
-
timer?: SchedulerTimer;
|
|
1541
|
-
logger?: Logger;
|
|
1542
|
-
acquire?: () => Promise<void>;
|
|
1543
|
-
};
|
|
1544
|
-
type ScheduleHandle = {
|
|
1545
|
-
id: string;
|
|
1546
|
-
cancel(): void;
|
|
1547
|
-
};
|
|
1548
|
-
declare class Scheduler {
|
|
1549
|
-
private readonly store;
|
|
1550
|
-
private readonly sendSnapshot;
|
|
1551
|
-
private readonly now;
|
|
1552
|
-
private readonly timer;
|
|
1553
|
-
private readonly logger;
|
|
1554
|
-
private readonly acquire;
|
|
1555
|
-
private readonly memory;
|
|
1556
|
-
private readonly timers;
|
|
1557
|
-
constructor(deps: SchedulerDeps);
|
|
1558
|
-
scheduleAt(date: Date, build: (b: MessageBuilder<'init'>) => MessageBuilder<'content-set'>): Promise<ScheduleHandle>;
|
|
1559
|
-
loadPending(): Promise<void>;
|
|
1560
|
-
dispose(): void;
|
|
1561
|
-
private cancel;
|
|
1562
|
-
private arm;
|
|
1563
|
-
private fire;
|
|
1564
|
-
private persist;
|
|
1565
|
-
private remove;
|
|
1566
|
-
private evaluate;
|
|
1567
|
-
}
|
|
1568
|
-
|
|
1569
|
-
interface TypedEventEmitterOptions {
|
|
1570
|
-
logger?: Logger | undefined;
|
|
1571
|
-
}
|
|
1572
|
-
declare class TypedEventEmitter<M extends Record<string, unknown>> {
|
|
1573
|
-
private readonly inner;
|
|
1574
|
-
protected readonly emitterLogger: Logger | undefined;
|
|
1575
|
-
constructor(options?: TypedEventEmitterOptions);
|
|
1576
|
-
on<E extends keyof M>(event: E, handler: (payload: M[E]) => void): () => void;
|
|
1577
|
-
off<E extends keyof M>(event: E, handler: (payload: M[E]) => void): void;
|
|
1578
|
-
emit<E extends keyof M>(event: E, payload: M[E]): void;
|
|
1579
|
-
removeAllListeners(event?: keyof M): void;
|
|
1580
|
-
listenerCount(event: keyof M): number;
|
|
1581
|
-
private wrap;
|
|
1582
|
-
private tag;
|
|
1583
|
-
private untag;
|
|
1584
|
-
private lookup;
|
|
1585
|
-
private tagMap;
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
declare class Client extends TypedEventEmitter<ClientEventMap> {
|
|
1589
|
-
readonly sessionId: string;
|
|
1590
|
-
auth: AuthStoreBundle;
|
|
1591
|
-
readonly store: MessageStore;
|
|
1592
|
-
private readonly logger;
|
|
1593
|
-
private readonly authType;
|
|
1594
|
-
private readonly phoneNumber;
|
|
1595
|
-
private readonly cacheSignal;
|
|
1596
|
-
private readonly qrTerminal;
|
|
1597
|
-
private readonly statusLog;
|
|
1598
|
-
private readonly reconnectOptions;
|
|
1599
|
-
private readonly baileysExtra;
|
|
1600
|
-
private readonly machine;
|
|
1601
|
-
private reconnectStrategy;
|
|
1602
|
-
private readonly authGuard;
|
|
1603
|
-
private readonly operationGuard;
|
|
1604
|
-
private readonly presenceThrottle;
|
|
1605
|
-
private readonly scheduleLimiter;
|
|
1606
|
-
private authExhausted;
|
|
1607
|
-
private _socket;
|
|
1608
|
-
private reconnectTimer;
|
|
1609
|
-
private listenerCleanup;
|
|
1610
|
-
private inboundHandle;
|
|
1611
|
-
private connectResolve;
|
|
1612
|
-
private connectReject;
|
|
1613
|
-
private pairingRequested;
|
|
1614
|
-
private cachedSignalWrap;
|
|
1615
|
-
private creds;
|
|
1616
|
-
private credsLoadedAtConnect;
|
|
1617
|
-
private openedThisRun;
|
|
1618
|
-
private credsHintShown;
|
|
1619
|
-
private disconnectEmittedFor;
|
|
1620
|
-
private connectAttemptSeq;
|
|
1621
|
-
private pendingDisconnectReason;
|
|
1622
|
-
private readonly usernameCache;
|
|
1623
|
-
private _group?;
|
|
1624
|
-
private _privacy?;
|
|
1625
|
-
private _newsletter?;
|
|
1626
|
-
private _community?;
|
|
1627
|
-
private _profile?;
|
|
1628
|
-
private _chat?;
|
|
1629
|
-
private _contact?;
|
|
1630
|
-
private _business?;
|
|
1631
|
-
private commandRegistry?;
|
|
1632
|
-
private readonly commandMiddleware;
|
|
1633
|
-
private readonly commandPrefixes;
|
|
1634
|
-
private readonly citationConfig;
|
|
1635
|
-
private readonly ignoreMe;
|
|
1636
|
-
private commandDispatcher;
|
|
1637
|
-
private _presence?;
|
|
1638
|
-
private _scheduler?;
|
|
1639
|
-
private readonly autoDeleteOptions;
|
|
1640
|
-
private autoDeleteSweeper;
|
|
1641
|
-
private readonly pluginsOptions;
|
|
1642
|
-
private pluginRegistry;
|
|
1643
|
-
private pluginLoader;
|
|
1644
|
-
private waVersion?;
|
|
1645
|
-
private versionWarming?;
|
|
1646
|
-
constructor(options?: ClientOptions);
|
|
1647
|
-
private warmVersion;
|
|
1648
|
-
private emitAutoConnectError;
|
|
1649
|
-
private logStatus;
|
|
1650
|
-
private resolveMe;
|
|
1651
|
-
get state(): ConnectionState;
|
|
1652
|
-
get socket(): BaileysSocket | undefined;
|
|
1653
|
-
get group(): GroupModule;
|
|
1654
|
-
get privacy(): PrivacyModule;
|
|
1655
|
-
get newsletter(): NewsletterModule;
|
|
1656
|
-
get community(): CommunityModule;
|
|
1657
|
-
get profile(): ProfileModule;
|
|
1658
|
-
get chat(): ChatModule;
|
|
1659
|
-
get contact(): ContactModule;
|
|
1660
|
-
get business(): BusinessModule;
|
|
1661
|
-
get presence(): PresenceModule;
|
|
1662
|
-
broadcast(jids: string[], build: (b: MessageBuilder<'init'>) => MessageBuilder<'content-set'>, options?: BroadcastOptions): Promise<BroadcastResult>;
|
|
1663
|
-
scheduleAt(date: Date, build: (b: MessageBuilder<'init'>) => MessageBuilder<'content-set'>): Promise<ScheduleHandle>;
|
|
1664
|
-
private ensureScheduler;
|
|
1665
|
-
private dispatchSnapshot;
|
|
1666
|
-
connect(): Promise<void>;
|
|
1667
|
-
disconnect(): Promise<void>;
|
|
1668
|
-
logout(): Promise<void>;
|
|
1669
|
-
command(spec: string, handler: CommandHandler): this;
|
|
1670
|
-
unregisterCommand(spec: string): this;
|
|
1671
|
-
use(middleware: Middleware): this;
|
|
1672
|
-
unuse(middleware: Middleware): this;
|
|
1673
|
-
private attachCommandsIfReady;
|
|
1674
|
-
private buildCommandContext;
|
|
1675
|
-
private detachCommands;
|
|
1676
|
-
send(to: string): MessageBuilder<'init'>;
|
|
1677
|
-
edit(key: WAMessageKey): EditBuilder;
|
|
1678
|
-
delete(key: WAMessageKey, opts?: DeleteOptions): Promise<void>;
|
|
1679
|
-
react(key: WAMessageKey, emoji: string): Promise<WAMessageKey>;
|
|
1680
|
-
forward(key: WAMessageKey, to: string): Promise<WAMessageKey>;
|
|
1681
|
-
pin(key: WAMessageKey, opts?: PinOptions): Promise<WAMessageKey>;
|
|
1682
|
-
unpin(key: WAMessageKey): Promise<WAMessageKey>;
|
|
1683
|
-
setDisappearing(to: string, seconds: number): Promise<void>;
|
|
1684
|
-
private resolveRecipient;
|
|
1685
|
-
private requireSocket;
|
|
1686
|
-
private attachEmitterLogger;
|
|
1687
|
-
private wireSocket;
|
|
1688
|
-
private handleConnectionUpdate;
|
|
1689
|
-
private handleQrUpdate;
|
|
1690
|
-
private handleAuthExhausted;
|
|
1691
|
-
private handleOpen;
|
|
1692
|
-
private resolveMessageForResend;
|
|
1693
|
-
private lidMapping;
|
|
1694
|
-
/** Resolve a `@lid` JID to its phone-number JID (uses WhatsApp's LID mapping; may hit the network). */
|
|
1695
|
-
lidToPn(lid: string): Promise<string | null>;
|
|
1696
|
-
/** Resolve a phone-number JID to its `@lid` JID (uses WhatsApp's LID mapping; may hit the network). */
|
|
1697
|
-
pnToLid(pn: string): Promise<string | null>;
|
|
1698
|
-
/**
|
|
1699
|
-
* Download media bytes for a message stored in the message store (by key).
|
|
1700
|
-
* Tries both `fromMe` variants. `null` when the message is unknown or carries no media.
|
|
1701
|
-
*/
|
|
1702
|
-
downloadMedia(key: WAMessageKey): Promise<MediaDownloadResult | null>;
|
|
1703
|
-
private lookupQuoted;
|
|
1704
|
-
private handleClose;
|
|
1705
|
-
private rejectPendingConnect;
|
|
1706
|
-
}
|
|
1707
|
-
|
|
1708
|
-
declare class MemoryAuthStore implements AuthStoreBundle {
|
|
1709
|
-
private credsBlob;
|
|
1710
|
-
private readonly signalMap;
|
|
1711
|
-
private closed;
|
|
1712
|
-
readonly signal: AuthStore;
|
|
1713
|
-
readonly creds: AuthCredsStore;
|
|
1714
|
-
private assertOpen;
|
|
1715
|
-
}
|
|
1716
|
-
|
|
1717
|
-
interface FileAuthStoreOptions {
|
|
1718
|
-
basePath?: string;
|
|
1719
|
-
}
|
|
1720
|
-
declare class FileAuthStore implements AuthStoreBundle {
|
|
1721
|
-
private readonly basePath;
|
|
1722
|
-
private closed;
|
|
1723
|
-
constructor(options?: FileAuthStoreOptions);
|
|
1724
|
-
readonly signal: AuthStore;
|
|
1725
|
-
readonly creds: AuthCredsStore;
|
|
1726
|
-
private credsPath;
|
|
1727
|
-
private signalDir;
|
|
1728
|
-
private signalPath;
|
|
1729
|
-
private atomicWrite;
|
|
1730
|
-
private assertOpen;
|
|
1731
|
-
}
|
|
1732
|
-
|
|
1733
|
-
interface SqliteAuthStoreOptions {
|
|
1734
|
-
database: string | Buffer;
|
|
1735
|
-
readonly?: boolean;
|
|
1736
|
-
}
|
|
1737
|
-
declare class SqliteAuthStore implements AuthStoreBundle {
|
|
1738
|
-
private readonly options;
|
|
1739
|
-
private db;
|
|
1740
|
-
private prepared;
|
|
1741
|
-
private readyPromise;
|
|
1742
|
-
private closed;
|
|
1743
|
-
constructor(options: SqliteAuthStoreOptions);
|
|
1744
|
-
readonly creds: AuthCredsStore;
|
|
1745
|
-
readonly signal: AuthStore;
|
|
1746
|
-
private ensureReady;
|
|
1747
|
-
private openAndMigrate;
|
|
1748
|
-
private encodeBlob;
|
|
1749
|
-
private parseBlob;
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
|
-
interface PostgresAuthStoreOptions {
|
|
1753
|
-
pool?: Pool;
|
|
1754
|
-
connectionString?: string;
|
|
1755
|
-
max?: number;
|
|
1756
|
-
}
|
|
1757
|
-
declare class PostgresAuthStore implements AuthStoreBundle {
|
|
1758
|
-
private readonly externalPool;
|
|
1759
|
-
private readonly connectionString;
|
|
1760
|
-
private readonly poolMax;
|
|
1761
|
-
private ownedPool;
|
|
1762
|
-
private resolvedPool;
|
|
1763
|
-
private readyPromise;
|
|
1764
|
-
private closed;
|
|
1765
|
-
constructor(options: PostgresAuthStoreOptions);
|
|
1766
|
-
private ensureReady;
|
|
1767
|
-
readonly signal: AuthStore;
|
|
1768
|
-
readonly creds: AuthCredsStore;
|
|
1769
|
-
}
|
|
1770
|
-
|
|
1771
|
-
interface RedisAuthStoreOptions {
|
|
1772
|
-
client?: RedisClientType;
|
|
1773
|
-
url?: string;
|
|
1774
|
-
namespace?: string;
|
|
1775
|
-
}
|
|
1776
|
-
declare class RedisAuthStore implements AuthStoreBundle {
|
|
1777
|
-
private readonly namespace;
|
|
1778
|
-
private readonly externalClient;
|
|
1779
|
-
private readonly url;
|
|
1780
|
-
private ownedClient;
|
|
1781
|
-
private ready;
|
|
1782
|
-
private closed;
|
|
1783
|
-
constructor(options: RedisAuthStoreOptions);
|
|
1784
|
-
readonly signal: AuthStore;
|
|
1785
|
-
readonly creds: AuthCredsStore;
|
|
1786
|
-
private credsKey;
|
|
1787
|
-
private signalKey;
|
|
1788
|
-
private indexKey;
|
|
1789
|
-
private ensureReady;
|
|
1790
|
-
private connect;
|
|
1791
|
-
private runRead;
|
|
1792
|
-
private runWrite;
|
|
1793
|
-
private shutdown;
|
|
1794
|
-
private assertOpen;
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
interface ConvexClientLike {
|
|
1798
|
-
query(name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
1799
|
-
mutation(name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
1800
|
-
}
|
|
1801
|
-
interface ConvexKvOptions {
|
|
1802
|
-
client?: ConvexClientLike;
|
|
1803
|
-
url?: string;
|
|
1804
|
-
namespace?: string;
|
|
1805
|
-
}
|
|
1806
|
-
|
|
1807
|
-
type ConvexAuthStoreOptions = ConvexKvOptions;
|
|
1808
|
-
declare class ConvexAuthStore implements AuthStoreBundle {
|
|
1809
|
-
readonly creds: AuthCredsStore;
|
|
1810
|
-
readonly signal: AuthStore;
|
|
1811
|
-
private readonly kv;
|
|
1812
|
-
constructor(options: ConvexAuthStoreOptions);
|
|
1813
|
-
}
|
|
1814
|
-
|
|
1815
|
-
interface CacheableAuthStoreOptions {
|
|
1816
|
-
logger?: {
|
|
1817
|
-
trace?: (msg: unknown) => void;
|
|
1818
|
-
debug?: (msg: unknown) => void;
|
|
1819
|
-
info?: (msg: unknown) => void;
|
|
1820
|
-
warn?: (msg: unknown) => void;
|
|
1821
|
-
error?: (msg: unknown) => void;
|
|
1822
|
-
};
|
|
1823
|
-
}
|
|
1824
|
-
declare function makeCacheableAuthStore(bundle: AuthStoreBundle, options?: CacheableAuthStoreOptions): AuthStoreBundle;
|
|
1825
|
-
|
|
1826
|
-
declare class MemoryMessageStore implements MessageStore {
|
|
1827
|
-
private readonly messages;
|
|
1828
|
-
private readonly messagesByJid;
|
|
1829
|
-
private readonly chats;
|
|
1830
|
-
private readonly contacts;
|
|
1831
|
-
private readonly presence;
|
|
1832
|
-
private boundSocket;
|
|
1833
|
-
private readonly listeners;
|
|
1834
|
-
private closed;
|
|
1835
|
-
saveMessage(message: WAMessage): Promise<void>;
|
|
1836
|
-
getMessage(key: WAMessageKey): Promise<WAMessage | undefined>;
|
|
1837
|
-
listMessages(jid: string, options?: MessageStoreListOptions): Promise<WAMessage[]>;
|
|
1838
|
-
saveChat(chat: Chat): Promise<void>;
|
|
1839
|
-
getChat(jid: string): Promise<Chat | undefined>;
|
|
1840
|
-
listChats(options?: {
|
|
1841
|
-
archived?: boolean;
|
|
1842
|
-
}): Promise<Chat[]>;
|
|
1843
|
-
saveContact(contact: Contact): Promise<void>;
|
|
1844
|
-
getContact(jid: string): Promise<Contact | undefined>;
|
|
1845
|
-
listContacts(): Promise<Contact[]>;
|
|
1846
|
-
savePresence(jid: string, presence: PresenceData): Promise<void>;
|
|
1847
|
-
getPresence(jid: string): Promise<PresenceData | undefined>;
|
|
1848
|
-
bind(socket: BaileysSocketLike): void;
|
|
1849
|
-
deleteMessage(key: WAMessageKey): Promise<void>;
|
|
1850
|
-
pruneMessages(opts: PruneOptions): Promise<number>;
|
|
1851
|
-
clear(): Promise<void>;
|
|
1852
|
-
close(): Promise<void>;
|
|
1853
|
-
private assertOpen;
|
|
1854
|
-
}
|
|
1855
|
-
|
|
1856
|
-
interface SqliteMessageStoreOptions {
|
|
1857
|
-
database: string | Buffer;
|
|
1858
|
-
readonly?: boolean;
|
|
1859
|
-
}
|
|
1860
|
-
declare class SqliteMessageStore implements MessageStore {
|
|
1861
|
-
private readonly options;
|
|
1862
|
-
private db;
|
|
1863
|
-
private prepared;
|
|
1864
|
-
private readyPromise;
|
|
1865
|
-
private closed;
|
|
1866
|
-
private boundSocket;
|
|
1867
|
-
private readonly listeners;
|
|
1868
|
-
constructor(options: SqliteMessageStoreOptions);
|
|
1869
|
-
saveMessage(message: WAMessage): Promise<void>;
|
|
1870
|
-
getMessage(key: WAMessageKey): Promise<WAMessage | undefined>;
|
|
1871
|
-
listMessages(jid: string, options?: MessageStoreListOptions): Promise<WAMessage[]>;
|
|
1872
|
-
saveChat(chat: Chat): Promise<void>;
|
|
1873
|
-
getChat(jid: string): Promise<Chat | undefined>;
|
|
1874
|
-
listChats(options?: {
|
|
1875
|
-
archived?: boolean;
|
|
1876
|
-
}): Promise<Chat[]>;
|
|
1877
|
-
saveContact(contact: Contact): Promise<void>;
|
|
1878
|
-
getContact(jid: string): Promise<Contact | undefined>;
|
|
1879
|
-
listContacts(): Promise<Contact[]>;
|
|
1880
|
-
savePresence(jid: string, presence: PresenceData): Promise<void>;
|
|
1881
|
-
getPresence(jid: string): Promise<PresenceData | undefined>;
|
|
1882
|
-
deleteMessage(key: WAMessageKey): Promise<void>;
|
|
1883
|
-
pruneMessages(opts: PruneOptions): Promise<number>;
|
|
1884
|
-
bind(socket: BaileysSocketLike): void;
|
|
1885
|
-
clear(): Promise<void>;
|
|
1886
|
-
close(): Promise<void>;
|
|
1887
|
-
private ensureReady;
|
|
1888
|
-
private openAndMigrate;
|
|
1889
|
-
}
|
|
1890
|
-
|
|
1891
|
-
interface PostgresMessageStoreOptions {
|
|
1892
|
-
pool?: Pool;
|
|
1893
|
-
connectionString?: string;
|
|
1894
|
-
max?: number;
|
|
1895
|
-
}
|
|
1896
|
-
declare class PostgresMessageStore implements MessageStore {
|
|
1897
|
-
private readonly externalPool;
|
|
1898
|
-
private readonly connectionString;
|
|
1899
|
-
private readonly poolMax;
|
|
1900
|
-
private ownedPool;
|
|
1901
|
-
private resolvedPool;
|
|
1902
|
-
private readyPromise;
|
|
1903
|
-
private boundSocket;
|
|
1904
|
-
private readonly listeners;
|
|
1905
|
-
private closed;
|
|
1906
|
-
constructor(options: PostgresMessageStoreOptions);
|
|
1907
|
-
private assertOpen;
|
|
1908
|
-
private ensureReady;
|
|
1909
|
-
saveMessage(message: WAMessage): Promise<void>;
|
|
1910
|
-
getMessage(key: WAMessageKey): Promise<WAMessage | undefined>;
|
|
1911
|
-
listMessages(jid: string, options?: MessageStoreListOptions): Promise<WAMessage[]>;
|
|
1912
|
-
saveChat(chat: Chat): Promise<void>;
|
|
1913
|
-
getChat(jid: string): Promise<Chat | undefined>;
|
|
1914
|
-
listChats(options?: {
|
|
1915
|
-
archived?: boolean;
|
|
1916
|
-
}): Promise<Chat[]>;
|
|
1917
|
-
saveContact(contact: Contact): Promise<void>;
|
|
1918
|
-
getContact(jid: string): Promise<Contact | undefined>;
|
|
1919
|
-
listContacts(): Promise<Contact[]>;
|
|
1920
|
-
savePresence(jid: string, presence: PresenceData): Promise<void>;
|
|
1921
|
-
getPresence(jid: string): Promise<PresenceData | undefined>;
|
|
1922
|
-
deleteMessage(key: WAMessageKey): Promise<void>;
|
|
1923
|
-
pruneMessages(opts: PruneOptions): Promise<number>;
|
|
1924
|
-
bind(socket: BaileysSocketLike): void;
|
|
1925
|
-
clear(): Promise<void>;
|
|
1926
|
-
close(): Promise<void>;
|
|
1927
|
-
}
|
|
1928
|
-
|
|
1929
|
-
interface RedisMessageStoreOptions {
|
|
1930
|
-
client?: RedisClientType;
|
|
1931
|
-
url?: string;
|
|
1932
|
-
namespace?: string;
|
|
1933
|
-
}
|
|
1934
|
-
declare class RedisMessageStore implements MessageStore {
|
|
1935
|
-
private readonly namespace;
|
|
1936
|
-
private readonly externalClient;
|
|
1937
|
-
private readonly url;
|
|
1938
|
-
private ownedClient;
|
|
1939
|
-
private ready;
|
|
1940
|
-
private closed;
|
|
1941
|
-
private boundSocket;
|
|
1942
|
-
private readonly listeners;
|
|
1943
|
-
constructor(options: RedisMessageStoreOptions);
|
|
1944
|
-
saveMessage(message: WAMessage): Promise<void>;
|
|
1945
|
-
getMessage(key: WAMessageKey): Promise<WAMessage | undefined>;
|
|
1946
|
-
listMessages(jid: string, options?: MessageStoreListOptions): Promise<WAMessage[]>;
|
|
1947
|
-
saveChat(chat: Chat): Promise<void>;
|
|
1948
|
-
getChat(jid: string): Promise<Chat | undefined>;
|
|
1949
|
-
listChats(options?: {
|
|
1950
|
-
archived?: boolean;
|
|
1951
|
-
}): Promise<Chat[]>;
|
|
1952
|
-
saveContact(contact: Contact): Promise<void>;
|
|
1953
|
-
getContact(jid: string): Promise<Contact | undefined>;
|
|
1954
|
-
listContacts(): Promise<Contact[]>;
|
|
1955
|
-
savePresence(jid: string, presence: PresenceData): Promise<void>;
|
|
1956
|
-
getPresence(jid: string): Promise<PresenceData | undefined>;
|
|
1957
|
-
bind(socket: BaileysSocketLike): void;
|
|
1958
|
-
clear(): Promise<void>;
|
|
1959
|
-
close(): Promise<void>;
|
|
1960
|
-
deleteMessage(key: WAMessageKey): Promise<void>;
|
|
1961
|
-
pruneMessages(opts: PruneOptions): Promise<number>;
|
|
1962
|
-
private jidFromIndexKey;
|
|
1963
|
-
private msgIndexKey;
|
|
1964
|
-
private msgDataKey;
|
|
1965
|
-
private chatsKey;
|
|
1966
|
-
private chatsArchiveKey;
|
|
1967
|
-
private contactsKey;
|
|
1968
|
-
private presenceKey;
|
|
1969
|
-
private ensureReady;
|
|
1970
|
-
private connect;
|
|
1971
|
-
private runRead;
|
|
1972
|
-
private runWrite;
|
|
1973
|
-
private assertOpen;
|
|
1974
|
-
}
|
|
1975
|
-
|
|
1976
|
-
type ConvexMessageStoreOptions = ConvexKvOptions;
|
|
1977
|
-
declare class ConvexMessageStore implements MessageStore {
|
|
1978
|
-
private readonly kv;
|
|
1979
|
-
private closed;
|
|
1980
|
-
private boundSocket;
|
|
1981
|
-
private readonly listeners;
|
|
1982
|
-
constructor(options: ConvexMessageStoreOptions);
|
|
1983
|
-
saveMessage(message: WAMessage): Promise<void>;
|
|
1984
|
-
getMessage(key: WAMessageKey): Promise<WAMessage | undefined>;
|
|
1985
|
-
listMessages(jid: string, options?: MessageStoreListOptions): Promise<WAMessage[]>;
|
|
1986
|
-
saveChat(chat: Chat): Promise<void>;
|
|
1987
|
-
getChat(jid: string): Promise<Chat | undefined>;
|
|
1988
|
-
listChats(options?: {
|
|
1989
|
-
archived?: boolean;
|
|
1990
|
-
}): Promise<Chat[]>;
|
|
1991
|
-
saveContact(contact: Contact): Promise<void>;
|
|
1992
|
-
getContact(jid: string): Promise<Contact | undefined>;
|
|
1993
|
-
listContacts(): Promise<Contact[]>;
|
|
1994
|
-
savePresence(jid: string, presence: PresenceData): Promise<void>;
|
|
1995
|
-
getPresence(jid: string): Promise<PresenceData | undefined>;
|
|
1996
|
-
saveScheduledJob(job: ScheduledJobRecord): Promise<void>;
|
|
1997
|
-
listScheduledJobs(): Promise<ScheduledJobRecord[]>;
|
|
1998
|
-
deleteScheduledJob(id: string): Promise<void>;
|
|
1999
|
-
deleteMessage(key: WAMessageKey): Promise<void>;
|
|
2000
|
-
pruneMessages(opts: PruneOptions): Promise<number>;
|
|
2001
|
-
bind(socket: BaileysSocketLike): void;
|
|
2002
|
-
clear(): Promise<void>;
|
|
2003
|
-
close(): Promise<void>;
|
|
2004
|
-
private assertOpen;
|
|
2005
|
-
}
|
|
2006
|
-
|
|
2007
|
-
declare function signalKeyStoreFromAuthStore(store: AuthStore, _logger?: Logger): SignalKeyStore;
|
|
2008
|
-
|
|
2009
|
-
interface PairingFlowOptions {
|
|
2010
|
-
phoneNumber: string;
|
|
2011
|
-
ttlMs?: number;
|
|
2012
|
-
}
|
|
2013
|
-
interface PairingFlowResult {
|
|
2014
|
-
code: string;
|
|
2015
|
-
expiresAt: number;
|
|
2016
|
-
}
|
|
2017
|
-
interface PairingFlow {
|
|
2018
|
-
readonly phoneNumber: string;
|
|
2019
|
-
requestCode(socket: Pick<BaileysSocket, 'requestPairingCode'>): Promise<PairingFlowResult>;
|
|
2020
|
-
}
|
|
2021
|
-
declare function normalizePhoneNumber(raw: string): string;
|
|
2022
|
-
declare function validateE164(raw: string): string;
|
|
2023
|
-
declare function createPairingFlow(options: PairingFlowOptions): PairingFlow;
|
|
2024
|
-
|
|
2025
|
-
declare function renderQrInTerminal(qrString: string): Promise<string>;
|
|
2026
|
-
declare function printQrToTerminal(qrString: string, write?: (s: string) => void): Promise<void>;
|
|
2027
|
-
|
|
2028
|
-
interface ReconnectDecision {
|
|
2029
|
-
attempt: number;
|
|
2030
|
-
delayMs: number;
|
|
2031
|
-
}
|
|
2032
|
-
interface ReconnectStrategy {
|
|
2033
|
-
next(reason: DisconnectReasonDomain): ReconnectDecision | null;
|
|
2034
|
-
reset(): void;
|
|
2035
|
-
readonly attempts: number;
|
|
2036
|
-
}
|
|
2037
|
-
interface ReconnectStrategyDeps {
|
|
2038
|
-
random?: () => number;
|
|
2039
|
-
}
|
|
2040
|
-
declare function createReconnectStrategy(options?: ReconnectOptions, deps?: ReconnectStrategyDeps): ReconnectStrategy;
|
|
2041
|
-
|
|
2042
|
-
type StateTransitionListener = (prev: ConnectionState, next: ConnectionState) => void;
|
|
2043
|
-
interface ConnectionStateMachine {
|
|
2044
|
-
readonly state: ConnectionState;
|
|
2045
|
-
canTransition(next: ConnectionState): boolean;
|
|
2046
|
-
transition(next: ConnectionState): void;
|
|
2047
|
-
onChange(listener: StateTransitionListener): () => void;
|
|
2048
|
-
}
|
|
2049
|
-
declare function createConnectionStateMachine(initial?: ConnectionState): ConnectionStateMachine;
|
|
2050
|
-
|
|
2051
|
-
declare const SELF_ONLY_PROTOCOL_TYPES: readonly ["HISTORY_SYNC_NOTIFICATION", "APP_STATE_SYNC_KEY_SHARE", "LID_MIGRATION_MAPPING_SYNC", "PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE"];
|
|
2052
|
-
type SelfOnlyProtocolType = (typeof SELF_ONLY_PROTOCOL_TYPES)[number];
|
|
2053
|
-
interface UpsertPayload {
|
|
2054
|
-
messages: WAMessage[];
|
|
2055
|
-
type: MessageUpsertType;
|
|
2056
|
-
requestId?: string;
|
|
2057
|
-
}
|
|
2058
|
-
declare const dropSpoofedSelfOnly: (upsert: UpsertPayload) => UpsertPayload;
|
|
2059
|
-
|
|
2060
|
-
declare const chunk: <T>(input: readonly T[], size: number) => T[][];
|
|
2061
|
-
|
|
2062
|
-
type LoggerLevel = 'silent' | 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace';
|
|
2063
|
-
interface CreateLoggerOptions {
|
|
2064
|
-
sessionId?: string;
|
|
2065
|
-
level?: LoggerLevel;
|
|
2066
|
-
}
|
|
2067
|
-
type ZaileysLogger = Logger$1;
|
|
2068
|
-
declare function createLogger(options?: CreateLoggerOptions): ZaileysLogger;
|
|
2069
|
-
declare function adoptLogger(maybe: Logger | Partial<Logger> | undefined, fallback?: Logger): Logger;
|
|
2070
|
-
|
|
2071
|
-
declare const extractJid: (remoteJid: string | undefined | null) => string | null;
|
|
2072
|
-
declare const isLidJid: (jid: string) => boolean;
|
|
2073
|
-
declare const isPnJid: (jid: string) => boolean;
|
|
2074
|
-
|
|
2075
|
-
/** Digits-only phone number from a JID (e.g. `628xx@s.whatsapp.net` → `628xx`). Empty for groups/lids. */
|
|
2076
|
-
declare const jidToPhone: (jid: string) => string;
|
|
2077
|
-
/** Build a user JID from a phone number or digits (e.g. `+62 812` → `62812@s.whatsapp.net`). */
|
|
2078
|
-
declare const phoneToJid: (phone: string) => string;
|
|
2079
|
-
|
|
2080
|
-
type LoadedMedia = {
|
|
2081
|
-
buffer: Buffer;
|
|
2082
|
-
mime: string;
|
|
2083
|
-
size: number;
|
|
2084
|
-
};
|
|
2085
|
-
type LoadMediaOptions = {
|
|
2086
|
-
timeoutMs?: number;
|
|
2087
|
-
};
|
|
2088
|
-
declare const detectMimeFromBuffer: (buffer: Buffer) => Promise<string>;
|
|
2089
|
-
declare const loadMedia: (src: MediaSource, options?: LoadMediaOptions) => Promise<LoadedMedia>;
|
|
2090
|
-
|
|
2091
|
-
interface LIDMapping {
|
|
2092
|
-
readonly lid: string;
|
|
2093
|
-
readonly pn: string;
|
|
2094
|
-
}
|
|
2095
|
-
type LIDMappingUpdatePayload = LIDMapping;
|
|
2096
|
-
|
|
2097
|
-
type StoreErrorCode = 'STORE_NOT_AVAILABLE' | 'STORE_CONNECTION_FAILED' | 'STORE_WRITE_FAILED' | 'STORE_READ_FAILED' | 'STORE_CORRUPTED' | 'STORE_CLOSED';
|
|
2098
|
-
declare class ZaileysStoreError extends Error {
|
|
2099
|
-
readonly code: StoreErrorCode;
|
|
2100
|
-
readonly cause?: unknown;
|
|
2101
|
-
constructor(code: StoreErrorCode, message: string, options?: {
|
|
2102
|
-
cause?: unknown;
|
|
2103
|
-
});
|
|
2104
|
-
}
|
|
2105
|
-
|
|
2106
|
-
declare const FFMPEG_CONSTANTS: {
|
|
2107
|
-
readonly OPUS: {
|
|
2108
|
-
readonly CODEC: "libopus";
|
|
2109
|
-
readonly CHANNELS: 1;
|
|
2110
|
-
readonly FREQUENCY: 48000;
|
|
2111
|
-
readonly BITRATE: "48k";
|
|
2112
|
-
readonly FORMAT: "ogg";
|
|
2113
|
-
};
|
|
2114
|
-
readonly THUMBNAIL: {
|
|
2115
|
-
readonly SIZE: 100;
|
|
2116
|
-
readonly QUALITY: 50;
|
|
2117
|
-
readonly TIMESTAMP: "10%";
|
|
2118
|
-
};
|
|
2119
|
-
readonly STICKER: {
|
|
2120
|
-
readonly SIZE: 512;
|
|
2121
|
-
readonly MAX_DURATION: 6;
|
|
2122
|
-
readonly FPS: 10;
|
|
2123
|
-
readonly DEFAULT_QUALITY: 60;
|
|
2124
|
-
readonly COMPRESSION_LEVEL: 6;
|
|
2125
|
-
};
|
|
2126
|
-
readonly MIME: {
|
|
2127
|
-
readonly AUDIO: "audio/";
|
|
2128
|
-
readonly VIDEO: "video/";
|
|
2129
|
-
readonly IMAGE: "image/";
|
|
2130
|
-
readonly GIF: "image/gif";
|
|
2131
|
-
readonly MP4: "video/mp4";
|
|
2132
|
-
};
|
|
2133
|
-
};
|
|
2134
|
-
type MediaInput = string | ArrayBuffer | Buffer;
|
|
2135
|
-
type FileExtension = 'wav' | 'ogg' | 'mp4' | 'gif' | 'jpg' | 'webp' | 'tmp' | 'mp3' | 'png';
|
|
2136
|
-
interface FFmpegConfig {
|
|
2137
|
-
input: string;
|
|
2138
|
-
output: string;
|
|
2139
|
-
options: string[];
|
|
2140
|
-
onEnd: () => Promise<void>;
|
|
2141
|
-
onError: (err: Error) => Promise<void>;
|
|
2142
|
-
}
|
|
2143
|
-
declare const initializeFFmpeg: (disable?: boolean) => Promise<void>;
|
|
2144
|
-
declare const generateId: () => string;
|
|
2145
|
-
declare const detectFileType: (buffer: Buffer) => Promise<{
|
|
2146
|
-
ext: string;
|
|
2147
|
-
mime: string;
|
|
2148
|
-
} | undefined>;
|
|
2149
|
-
declare class FileManager {
|
|
2150
|
-
private static generateUniqueId;
|
|
2151
|
-
static createTempPath(prefix: string, ext: FileExtension): string;
|
|
2152
|
-
static cleanup(files: string[]): Promise<void>;
|
|
2153
|
-
static safeReadFile(filePath: string): Promise<Buffer>;
|
|
2154
|
-
static safeWriteFile(filePath: string, data: Buffer): Promise<void>;
|
|
2155
|
-
}
|
|
2156
|
-
declare class BufferConverter {
|
|
2157
|
-
static toBuffer(input: MediaInput): Promise<Buffer>;
|
|
2158
|
-
private static fromString;
|
|
2159
|
-
private static fromUrl;
|
|
2160
|
-
static getExtension(buffer: Buffer): Promise<FileExtension>;
|
|
2161
|
-
}
|
|
2162
|
-
declare class MimeValidator {
|
|
2163
|
-
static validate(fileType: {
|
|
2164
|
-
mime: string;
|
|
2165
|
-
} | undefined, expectedPrefix: string): void;
|
|
2166
|
-
static isMedia(mime: string): boolean;
|
|
2167
|
-
static isAnimated(mime: string): boolean;
|
|
2168
|
-
}
|
|
2169
|
-
declare class FFmpegProcessor {
|
|
2170
|
-
static process(config: FFmpegConfig): Promise<void>;
|
|
2171
|
-
static getDuration(filePath: string): Promise<number>;
|
|
2172
|
-
}
|
|
2173
|
-
|
|
2174
|
-
declare const ffmpegTransform: (buffer: Buffer, inExt: FileExtension, outExt: FileExtension, label: string, options: string[] | ((tempIn: string) => string[] | Promise<string[]>)) => Promise<Buffer>;
|
|
2175
|
-
|
|
2176
|
-
type AudioType = 'opus' | 'mp3';
|
|
2177
|
-
declare class AudioProcessor {
|
|
2178
|
-
static toOpus(input: MediaInput): Promise<Buffer>;
|
|
2179
|
-
static toMp3(input: MediaInput): Promise<Buffer>;
|
|
2180
|
-
static convert(input: MediaInput, type?: AudioType): Promise<Buffer>;
|
|
2181
|
-
static waveform(input: MediaInput): Promise<{
|
|
2182
|
-
waveform: Uint8Array;
|
|
2183
|
-
seconds: number;
|
|
2184
|
-
}>;
|
|
2185
|
-
private static computeWaveform;
|
|
2186
|
-
}
|
|
2187
|
-
|
|
2188
|
-
declare class VideoProcessor {
|
|
2189
|
-
static toMp4(input: MediaInput): Promise<Buffer>;
|
|
2190
|
-
static thumbnail(input: MediaInput): Promise<string>;
|
|
2191
|
-
static duration(filePath: string): Promise<number>;
|
|
2192
|
-
}
|
|
2193
|
-
|
|
2194
|
-
declare class ImageProcessor {
|
|
2195
|
-
static thumbnail(buffer: Buffer): Promise<string>;
|
|
2196
|
-
static resize(buffer: Buffer, width: number, height: number): Promise<Buffer>;
|
|
2197
|
-
static toJpeg(input: MediaInput): Promise<Buffer>;
|
|
2198
|
-
static resizeForSticker(buffer: Buffer, quality: number, shape?: string): Promise<Buffer>;
|
|
2199
|
-
}
|
|
2200
|
-
|
|
2201
|
-
type StickerShapeType = 'circle' | 'rounded' | 'oval' | 'default';
|
|
2202
|
-
interface StickerMetadataType {
|
|
2203
|
-
packageName?: string;
|
|
2204
|
-
authorName?: string;
|
|
2205
|
-
quality?: number;
|
|
2206
|
-
shape?: StickerShapeType;
|
|
2207
|
-
}
|
|
2208
|
-
declare class StickerProcessor {
|
|
2209
|
-
static create(input: MediaInput, metadata?: StickerMetadataType): Promise<Buffer>;
|
|
2210
|
-
private static createExifMetadata;
|
|
2211
|
-
private static processAnimated;
|
|
2212
|
-
private static getExtension;
|
|
2213
|
-
}
|
|
2214
|
-
|
|
2215
|
-
declare class DocumentProcessor {
|
|
2216
|
-
static create(input: MediaInput): Promise<{
|
|
2217
|
-
document: Buffer<ArrayBufferLike>;
|
|
2218
|
-
mimetype: string;
|
|
2219
|
-
ext: string;
|
|
2220
|
-
fileName: string;
|
|
2221
|
-
jpegThumbnail: string;
|
|
2222
|
-
}>;
|
|
2223
|
-
}
|
|
2224
|
-
|
|
2225
|
-
declare class Media {
|
|
2226
|
-
private input;
|
|
2227
|
-
constructor(input: MediaInput);
|
|
2228
|
-
get audio(): {
|
|
2229
|
-
toOpus: () => Promise<Buffer<ArrayBufferLike>>;
|
|
2230
|
-
toMp3: () => Promise<Buffer<ArrayBufferLike>>;
|
|
2231
|
-
convert: (type?: AudioType) => Promise<Buffer<ArrayBufferLike>>;
|
|
2232
|
-
waveform: () => Promise<{
|
|
2233
|
-
waveform: Uint8Array;
|
|
2234
|
-
seconds: number;
|
|
2235
|
-
}>;
|
|
2236
|
-
};
|
|
2237
|
-
get video(): {
|
|
2238
|
-
toMp4: () => Promise<Buffer<ArrayBufferLike>>;
|
|
2239
|
-
thumbnail: () => Promise<string>;
|
|
2240
|
-
};
|
|
2241
|
-
get image(): {
|
|
2242
|
-
toJpeg: () => Promise<Buffer<ArrayBufferLike>>;
|
|
2243
|
-
thumbnail: () => Promise<string>;
|
|
2244
|
-
resize: (width: number, height: number) => Promise<Buffer<ArrayBufferLike>>;
|
|
2245
|
-
};
|
|
2246
|
-
get sticker(): {
|
|
2247
|
-
create: (metadata?: StickerMetadataType) => Promise<Buffer<ArrayBufferLike>>;
|
|
2248
|
-
};
|
|
2249
|
-
get document(): {
|
|
2250
|
-
create: () => Promise<{
|
|
2251
|
-
document: Buffer<ArrayBufferLike>;
|
|
2252
|
-
mimetype: string;
|
|
2253
|
-
ext: string;
|
|
2254
|
-
fileName: string;
|
|
2255
|
-
jpegThumbnail: string;
|
|
2256
|
-
}>;
|
|
2257
|
-
};
|
|
2258
|
-
get thumbnail(): {
|
|
2259
|
-
get: () => Promise<string>;
|
|
2260
|
-
};
|
|
2261
|
-
toBuffer(): Promise<Buffer>;
|
|
2262
|
-
}
|
|
2263
|
-
|
|
2264
|
-
export { type AddressButton, type AlbumItem, type AudioOptions, AudioProcessor, type AudioType, type AuthAttemptBlockReason, type AuthAttemptDecision, type AuthCredsStore, type AuthGuard, type AuthGuardOptions, type AuthStore, type AuthStoreBundle, type AuthStoreKey, type AuthStoreValue, type AutoDeleteOptions, AutoDeleteSweeper, type AutomationErrorCode, type AutomationSocketLike, type BaileysSocket, type BaileysSocketLike, type BottomSheetOptions, type BroadcastDeps, type BroadcastOptions, type BroadcastResult, BufferConverter, type BuildContextInput, type BuilderContext, type BuilderErrorCode, type BuilderSocketLike, type BuilderState, BusinessModule, type ButtonClickPayload, type ButtonDef, type CacheableAuthStoreOptions, type CallBase, type CallButton, type CallPayload, type CancelReminderButton, ChatModule, type ChatType, type CitationConfig, type CitationPredicates, Client, type ClientEventMap, type ClientEventName, type ClientOptions, type CommandContext, type CommandDefinition, type CommandErrorCode, type CommandHandler, type CommandPrefix, CommandRegistry, CommunityModule, type ConnectionAuthType, type ConnectionEventHandler, type ConnectionEventMap, type ConnectionEventName, type ConnectionState, type ConnectionStateMachine, ContactModule, type ContextMedia, ConvexAuthStore, type ConvexAuthStoreOptions, ConvexMessageStore, type ConvexMessageStoreOptions, type CopyButton, type CreateLoggerOptions, type DeleteOptions, type DeletePayload, type DisconnectReasonDomain, type DispatcherDeps, type DispatcherHandle, type DocumentOptions, DocumentProcessor, type DomainErrorCode, type DomainSocketLike, EditBuilder, type EditPayload, type EventOptions, FFMPEG_CONSTANTS, type FFmpegConfig, FFmpegProcessor, FileAuthStore, type FileAuthStoreOptions, type FileExtension, FileManager, type GroupInviteOptions, type GroupJoinPayload, type GroupLeavePayload, GroupModule, type GroupParticipantInfo, type GroupUpdatePayload, type HistorySyncPayload, type ImageOptions, ImageProcessor, type InboundEventMap, type InboundEventName, type InteractiveButton, type LIDMapping, type LIDMappingUpdatePayload, type LimitedPayload, type LimitedTimeOfferOptions, type LinkedGroup, type ListOptions, type ListSection$1 as ListSection, type ListSelectPayload, type LoadMediaOptions, type LoadedMedia, type LocationOptions, type LocationRequestButton, type Logger, type LoggerLevel, Media, type MediaDescriptor, type MediaDownloadResult, type MediaInput, type MediaKind, type MediaSource, type MemberTagPayload, MemoryAuthStore, MemoryMessageStore, type MentionAllContext, type MentionContext, MessageBuilder, type MessageContext, type MessageStore, type MessageStoreListOptions, type Middleware, MimeValidator, NewsletterModule, type NewsletterPayload, type OperationCategory, type OperationGuard, type OperationGuardClock, type OperationGuardOptions, type PairingFlow, type PairingFlowOptions, type PairingFlowResult, type ParsedArgs, type ParticipantUpdateResult, type PinOptions, type Plugin, type PluginContext, type PluginsOptions, type PollOptions, type PollVotePayload, PostgresAuthStore, type PostgresAuthStoreOptions, PostgresMessageStore, type PostgresMessageStoreOptions, type PresenceClock, PresenceModule, type PresencePayload, type PresenceThrottleOptions, type PrivacyConfig, PrivacyModule, type PrivacySettings, type ProductOptions, ProfileModule, type PruneOptions, type QuotedRef, RateLimiter, type RateLimiterClock, type RateLimiterOptions, type ReactionPayload, type ReconnectDecision, type ReconnectOptions, type ReconnectStrategy, type ReconnectStrategyDeps, RedisAuthStore, type RedisAuthStoreOptions, RedisMessageStore, type RedisMessageStoreOptions, type ReminderButton, type ReplyButton, type ResolvedCommand, type RetryPolicy, SELF_ONLY_PROTOCOL_TYPES, type ScheduleHandle, type ScheduledContentSnapshot, type ScheduledJob, type ScheduledJobRecord, Scheduler, type SchedulerDeps, type SchedulerTimer, type SelfOnlyProtocolType, type SenderDevice, type SenderInfo, SqliteAuthStore, type SqliteAuthStoreOptions, SqliteMessageStore, type SqliteMessageStoreOptions, type StateTransitionListener, type StickerMetadataType, type StickerOptions, StickerProcessor, type StickerShapeType, type StoreErrorCode, TaskQueue, type TaskQueueClock, type TaskQueueOptions, type TemplateOptions, type TextOptions, TypedEventEmitter, type TypedEventEmitterOptions, type UpsertPayload, type UrlButton, type UsernameResolveSocketLike, type VideoNoteOptions, type VideoOptions, VideoProcessor, type WAPresence, ZaileysAutomationError, ZaileysBuilderError, ZaileysCommandError, ZaileysDomainError, type ZaileysLogger, ZaileysStoreError, adoptLogger, attachCommandDispatcher, buildMessageContext, chunk, computeStaticId, computeUniqueId, createAuthGuard, createConnectionStateMachine, createLogger, createOperationGuard, createPairingFlow, createReconnectStrategy, definePlugin, deleteMessage, detectFileType, detectMimeFromBuffer, dropSpoofedSelfOnly, epochSecondsToMs, extractLinks, ffmpegTransform, forwardMessage, generateId, genericPrune, initializeFFmpeg, isFatalDisconnect, isJid, isLidJid, isPnJid, isRateLimited, jidToPhone, loadMedia, makeCacheableAuthStore, mapDisconnectReason, extractJid as normalizeJid, normalizePhoneNumber, parseCommand, phoneToJid, pinMessage, printQrToTerminal, reactToMessage, renderQrInTerminal, resolveUsername, runBroadcast, runMiddleware, senderDeviceOf, shouldClearAuth, shouldReconnect, signalKeyStoreFromAuthStore, validateE164 };
|
|
1
|
+
export * from './client/index.js';
|
|
2
|
+
export { definePlugin } from './plugin/index.js';
|
|
3
|
+
export type { Plugin, PluginContext, PluginsOptions } from './plugin/index.js';
|
|
4
|
+
export * from './auth/index.js';
|
|
5
|
+
export * from './store/index.js';
|
|
6
|
+
export * from './connection/index.js';
|
|
7
|
+
export * from './events/index.js';
|
|
8
|
+
export * from './builder/index.js';
|
|
9
|
+
export * from './domain/index.js';
|
|
10
|
+
export * from './command/index.js';
|
|
11
|
+
export * from './automation/index.js';
|
|
12
|
+
export * from './utils/index.js';
|
|
13
|
+
export * from './types/index.js';
|
|
14
|
+
export * from './media/index.js';
|