zaileys 3.2.0 → 4.0.0
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 +263 -0
- package/dist/index.cjs +30 -0
- package/dist/index.d.cts +1670 -0
- package/dist/index.d.ts +1642 -1656
- package/dist/index.mjs +29 -18
- package/package.json +85 -31
- package/README.MD +0 -1280
- package/dist/index.d.mts +0 -1684
- package/dist/index.js +0 -19
package/dist/index.d.ts
CHANGED
|
@@ -1,1684 +1,1670 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { WAMessage, WAMessageKey, AnyMessageContent, MiscMessageGenerationOptions, Chat, Contact, PresenceData, WAPrivacyValue, WAPrivacyOnlineValue, WAReadReceiptsValue, WAPrivacyGroupAddValue, GroupMetadata, ParticipantAction, NewsletterMetadata, WAMediaUpload, AuthenticationCreds, SignalDataTypeMap, SignalDataSet, WASocket, UserFacingSocketConfig, SignalKeyStore, MessageUpsertType } from 'baileys';
|
|
2
|
+
export { GroupMetadata, GroupParticipant, NewsletterMetadata, ParticipantAction, WAMediaUpload, WAPrivacyGroupAddValue, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from 'baileys';
|
|
3
|
+
import { Readable } from 'node:stream';
|
|
4
|
+
import { Pool } from 'pg';
|
|
5
|
+
import { RedisClientType } from 'redis';
|
|
6
|
+
import { Logger as Logger$1 } from 'pino';
|
|
7
|
+
|
|
8
|
+
type BuilderState = 'init' | 'content-set';
|
|
9
|
+
type MediaSource = string | Buffer | URL;
|
|
10
|
+
type ImageOptions = {
|
|
11
|
+
caption?: string;
|
|
12
|
+
viewOnce?: boolean;
|
|
13
|
+
};
|
|
14
|
+
type VideoOptions = {
|
|
15
|
+
caption?: string;
|
|
16
|
+
gifPlayback?: boolean;
|
|
17
|
+
viewOnce?: boolean;
|
|
18
|
+
};
|
|
19
|
+
type AudioOptions = {
|
|
20
|
+
ptt?: boolean;
|
|
21
|
+
seconds?: number;
|
|
22
|
+
};
|
|
23
|
+
type DocumentOptions = {
|
|
24
|
+
fileName: string;
|
|
25
|
+
mimetype?: string;
|
|
26
|
+
caption?: string;
|
|
27
|
+
};
|
|
28
|
+
type StickerOptions = {
|
|
29
|
+
animated?: boolean;
|
|
30
|
+
};
|
|
31
|
+
type AlbumItem = {
|
|
32
|
+
type: 'image' | 'video';
|
|
33
|
+
src: MediaSource;
|
|
34
|
+
caption?: string;
|
|
35
|
+
};
|
|
36
|
+
type ReplyButton = {
|
|
37
|
+
type?: 'reply';
|
|
38
|
+
id: string;
|
|
39
|
+
text: string;
|
|
40
|
+
};
|
|
41
|
+
type UrlButton = {
|
|
42
|
+
type: 'url';
|
|
43
|
+
text: string;
|
|
44
|
+
url: string;
|
|
45
|
+
webview?: boolean;
|
|
46
|
+
};
|
|
47
|
+
type CopyButton = {
|
|
48
|
+
type: 'copy';
|
|
49
|
+
text: string;
|
|
50
|
+
code: string;
|
|
51
|
+
};
|
|
52
|
+
type CallButton = {
|
|
53
|
+
type: 'call';
|
|
54
|
+
text: string;
|
|
55
|
+
phone: string;
|
|
56
|
+
};
|
|
57
|
+
type ReminderButton = {
|
|
58
|
+
type: 'reminder';
|
|
59
|
+
text: string;
|
|
60
|
+
id?: string;
|
|
61
|
+
};
|
|
62
|
+
type CancelReminderButton = {
|
|
63
|
+
type: 'cancel-reminder';
|
|
64
|
+
text: string;
|
|
65
|
+
id?: string;
|
|
66
|
+
};
|
|
67
|
+
type LocationRequestButton = {
|
|
68
|
+
type: 'location';
|
|
69
|
+
text?: string;
|
|
70
|
+
};
|
|
71
|
+
type AddressButton = {
|
|
72
|
+
type: 'address';
|
|
73
|
+
text: string;
|
|
74
|
+
id?: string;
|
|
75
|
+
};
|
|
76
|
+
type InteractiveButton = ReplyButton | UrlButton | CopyButton | CallButton | ReminderButton | CancelReminderButton | LocationRequestButton | AddressButton;
|
|
77
|
+
type BottomSheetOptions = {
|
|
78
|
+
listTitle?: string;
|
|
79
|
+
buttonTitle?: string;
|
|
80
|
+
buttonsLimit?: number;
|
|
81
|
+
dividers?: number[];
|
|
82
|
+
};
|
|
83
|
+
type LimitedTimeOfferOptions = {
|
|
84
|
+
text?: string;
|
|
85
|
+
url?: string;
|
|
86
|
+
copyCode?: string;
|
|
87
|
+
expiresAt?: number;
|
|
88
|
+
};
|
|
89
|
+
type ButtonDef = {
|
|
90
|
+
id: string;
|
|
91
|
+
text: string;
|
|
92
|
+
};
|
|
93
|
+
type ListSection = {
|
|
94
|
+
title: string;
|
|
95
|
+
rows: Array<{
|
|
96
|
+
id: string;
|
|
97
|
+
title: string;
|
|
98
|
+
description?: string;
|
|
99
|
+
}>;
|
|
100
|
+
};
|
|
101
|
+
type ListOptions = {
|
|
102
|
+
title?: string;
|
|
103
|
+
description?: string;
|
|
104
|
+
buttonText: string;
|
|
105
|
+
footerText?: string;
|
|
106
|
+
sections: ListSection[];
|
|
107
|
+
};
|
|
108
|
+
type PollOptions = {
|
|
109
|
+
multipleChoice?: boolean;
|
|
110
|
+
};
|
|
111
|
+
type LocationOptions = {
|
|
112
|
+
name?: string;
|
|
113
|
+
address?: string;
|
|
114
|
+
};
|
|
115
|
+
type TemplateOptions = {
|
|
116
|
+
header?: string;
|
|
117
|
+
body: string;
|
|
118
|
+
footer?: string;
|
|
119
|
+
buttons: ButtonDef[];
|
|
120
|
+
};
|
|
121
|
+
type BuilderContext = {
|
|
122
|
+
recipient: string;
|
|
123
|
+
quoted?: WAMessage | WAMessageKey;
|
|
124
|
+
mentions?: string[];
|
|
125
|
+
mentionAll?: boolean;
|
|
126
|
+
disappearingSeconds?: number;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
type BuilderErrorCode = 'MEDIA_LOAD_FAILED' | 'INVALID_RECIPIENT' | 'USERNAME_NOT_FOUND' | 'EMPTY_CONTENT' | 'INVALID_OPTIONS' | 'SEND_FAILED' | 'MESSAGE_NOT_FOUND';
|
|
130
|
+
declare class ZaileysBuilderError extends Error {
|
|
131
|
+
readonly code: BuilderErrorCode;
|
|
132
|
+
readonly cause?: unknown;
|
|
133
|
+
constructor(code: BuilderErrorCode, message: string, options?: {
|
|
134
|
+
cause?: unknown;
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
type ButtonsContentOptions = {
|
|
139
|
+
text?: string;
|
|
140
|
+
footer?: string;
|
|
141
|
+
title?: string;
|
|
142
|
+
subtitle?: string;
|
|
143
|
+
image?: MediaSource;
|
|
144
|
+
video?: MediaSource;
|
|
145
|
+
bottomSheet?: BottomSheetOptions;
|
|
146
|
+
limitedTimeOffer?: LimitedTimeOfferOptions;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
type CarouselCard = {
|
|
150
|
+
title?: string;
|
|
151
|
+
subtitle?: string;
|
|
152
|
+
body?: string;
|
|
153
|
+
footer?: string;
|
|
154
|
+
image?: MediaSource;
|
|
155
|
+
video?: MediaSource;
|
|
156
|
+
buttons?: Array<ButtonDef | InteractiveButton>;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
type AIRichOptions = {
|
|
160
|
+
title?: string;
|
|
161
|
+
footer?: string;
|
|
162
|
+
sources?: Array<[profileUrl: string, url: string, text: string]>;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
type BuilderInternalState = {
|
|
166
|
+
recipient: string;
|
|
167
|
+
content?: AnyMessageContent;
|
|
168
|
+
pendingContent?: Promise<AnyMessageContent>;
|
|
169
|
+
albumItems?: AlbumItem[];
|
|
170
|
+
quoted?: WAMessage | WAMessageKey;
|
|
171
|
+
mentions?: string[];
|
|
172
|
+
mentionAll?: boolean;
|
|
173
|
+
disappearingSeconds?: number;
|
|
174
|
+
resolveRecipient?: (raw: string) => Promise<string>;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
interface BuilderSocketLike {
|
|
178
|
+
sendMessage(jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions): Promise<WAMessage | undefined>;
|
|
179
|
+
relayMessage?(jid: string, message: unknown, options: {
|
|
180
|
+
messageId: string;
|
|
181
|
+
additionalNodes?: unknown[];
|
|
182
|
+
}): Promise<string>;
|
|
183
|
+
user?: {
|
|
184
|
+
id?: string | null;
|
|
185
|
+
} | null;
|
|
186
|
+
waUploadToServer?: unknown;
|
|
187
|
+
}
|
|
188
|
+
type TextOptions = {
|
|
189
|
+
rich?: boolean;
|
|
190
|
+
} & AIRichOptions;
|
|
191
|
+
declare class MessageBuilder<State extends BuilderState> {
|
|
192
|
+
protected readonly __state?: State;
|
|
193
|
+
protected readonly socket: BuilderSocketLike;
|
|
194
|
+
protected readonly internal: BuilderInternalState;
|
|
195
|
+
constructor(socket: BuilderSocketLike, internal: BuilderInternalState);
|
|
196
|
+
static create(socket: BuilderSocketLike, recipient: string, resolveRecipient?: (raw: string) => Promise<string>): MessageBuilder<'init'>;
|
|
197
|
+
to(this: MessageBuilder<'init'>, recipient: string): MessageBuilder<'init'>;
|
|
198
|
+
text(this: MessageBuilder<'init'>, content: string, opts?: TextOptions): MessageBuilder<'content-set'>;
|
|
199
|
+
image(this: MessageBuilder<'init'>, src: MediaSource, opts?: ImageOptions): MessageBuilder<'content-set'>;
|
|
200
|
+
video(this: MessageBuilder<'init'>, src: MediaSource, opts?: VideoOptions): MessageBuilder<'content-set'>;
|
|
201
|
+
audio(this: MessageBuilder<'init'>, src: MediaSource, opts?: AudioOptions): MessageBuilder<'content-set'>;
|
|
202
|
+
document(this: MessageBuilder<'init'>, src: MediaSource, opts: DocumentOptions): MessageBuilder<'content-set'>;
|
|
203
|
+
sticker(this: MessageBuilder<'init'>, src: MediaSource, opts?: StickerOptions): MessageBuilder<'content-set'>;
|
|
204
|
+
buttons(this: MessageBuilder<'init'>, buttons: Array<ButtonDef | InteractiveButton>, opts?: ButtonsContentOptions): MessageBuilder<'content-set'>;
|
|
205
|
+
carousel(this: MessageBuilder<'init'>, cards: CarouselCard[], opts?: {
|
|
206
|
+
text?: string;
|
|
207
|
+
}): MessageBuilder<'content-set'>;
|
|
208
|
+
list(this: MessageBuilder<'init'>, opts: ListOptions): MessageBuilder<'content-set'>;
|
|
209
|
+
poll(this: MessageBuilder<'init'>, question: string, options: string[], opts?: PollOptions): MessageBuilder<'content-set'>;
|
|
210
|
+
location(this: MessageBuilder<'init'>, lat: number, lon: number, opts?: LocationOptions): MessageBuilder<'content-set'>;
|
|
211
|
+
contact(this: MessageBuilder<'init'>, vcard: string): MessageBuilder<'content-set'>;
|
|
212
|
+
template(this: MessageBuilder<'init'>, opts: TemplateOptions): MessageBuilder<'content-set'>;
|
|
213
|
+
album(this: MessageBuilder<'init'>, items: AlbumItem[]): MessageBuilder<'content-set'>;
|
|
214
|
+
reply(quoted: WAMessage | WAMessageKey): MessageBuilder<State>;
|
|
215
|
+
mentions(jids: string[]): MessageBuilder<State>;
|
|
216
|
+
mentionAll(): MessageBuilder<State>;
|
|
217
|
+
disappearing(seconds: number): MessageBuilder<State>;
|
|
218
|
+
then<T = WAMessageKey>(this: MessageBuilder<'content-set'>, onResolved: (key: WAMessageKey) => T, onRejected?: (err: unknown) => T | PromiseLike<T>): Promise<T>;
|
|
219
|
+
private uploadHeaderMedia;
|
|
220
|
+
private sendRelay;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
declare class EditBuilder {
|
|
224
|
+
private readonly socket;
|
|
225
|
+
private readonly key;
|
|
226
|
+
private content;
|
|
227
|
+
private pendingContent;
|
|
228
|
+
constructor(socket: BuilderSocketLike, key: WAMessageKey);
|
|
229
|
+
text(content: string): this;
|
|
230
|
+
image(src: MediaSource, opts?: ImageOptions): this;
|
|
231
|
+
video(src: MediaSource, opts?: VideoOptions): this;
|
|
232
|
+
then<T = WAMessageKey>(onResolved: (key: WAMessageKey) => T, onRejected?: (err: unknown) => T | PromiseLike<T>): Promise<T>;
|
|
233
|
+
private send;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
type MessageStoreListOptions = {
|
|
237
|
+
limit?: number;
|
|
238
|
+
before?: number;
|
|
239
|
+
};
|
|
240
|
+
type ScheduledJobRecord = {
|
|
241
|
+
id: string;
|
|
242
|
+
fireAt: number;
|
|
243
|
+
recipient: string;
|
|
244
|
+
payload: unknown;
|
|
245
|
+
};
|
|
246
|
+
interface BaileysSocketLike {
|
|
247
|
+
ev: {
|
|
248
|
+
on: (event: string, handler: (...args: unknown[]) => void) => void;
|
|
249
|
+
off?: (event: string, handler: (...args: unknown[]) => void) => void;
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
interface MessageStore {
|
|
253
|
+
saveMessage(message: WAMessage): Promise<void>;
|
|
254
|
+
getMessage(key: WAMessageKey): Promise<WAMessage | undefined>;
|
|
255
|
+
listMessages(jid: string, options?: MessageStoreListOptions): Promise<WAMessage[]>;
|
|
256
|
+
saveChat(chat: Chat): Promise<void>;
|
|
257
|
+
getChat(jid: string): Promise<Chat | undefined>;
|
|
258
|
+
listChats(options?: {
|
|
259
|
+
archived?: boolean;
|
|
260
|
+
}): Promise<Chat[]>;
|
|
261
|
+
saveContact(contact: Contact): Promise<void>;
|
|
262
|
+
getContact(jid: string): Promise<Contact | undefined>;
|
|
263
|
+
listContacts(): Promise<Contact[]>;
|
|
264
|
+
savePresence(jid: string, presence: PresenceData): Promise<void>;
|
|
265
|
+
getPresence(jid: string): Promise<PresenceData | undefined>;
|
|
266
|
+
bind(socket: BaileysSocketLike): void;
|
|
17
267
|
clear(): Promise<void>;
|
|
18
|
-
keys(prefix?: string): Promise<string[]>;
|
|
19
|
-
getMany<T>(keys: string[]): Promise<Record<string, T>>;
|
|
20
|
-
setMany<T>(data: Record<string, T>): Promise<void>;
|
|
21
|
-
compact(): Promise<void>;
|
|
22
268
|
close(): Promise<void>;
|
|
269
|
+
saveScheduledJob?(job: ScheduledJobRecord): Promise<void>;
|
|
270
|
+
listScheduledJobs?(): Promise<ScheduledJobRecord[]>;
|
|
271
|
+
deleteScheduledJob?(id: string): Promise<void>;
|
|
23
272
|
}
|
|
24
273
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
constructor(client: Client);
|
|
38
|
-
repair(jid: string): Promise<void>;
|
|
39
|
-
get logger(): pino.Logger<never, boolean>;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
declare const SignalType: v.PicklistSchema<["forward", "button", "edit", "delete"], undefined>;
|
|
43
|
-
declare const SignalOptionsType: v.UnionSchema<[v.StringSchema<undefined>, v.IntersectSchema<[v.UnionSchema<[v.LooseObjectSchema<{
|
|
44
|
-
readonly text: v.StringSchema<undefined>;
|
|
45
|
-
}, undefined>, v.LooseObjectSchema<{
|
|
46
|
-
readonly image: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.Base64Action<string, undefined>]>, v.CustomSchema<Buffer<ArrayBufferLike>, undefined>], undefined>;
|
|
47
|
-
readonly caption: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
48
|
-
}, undefined>, v.LooseObjectSchema<{
|
|
49
|
-
readonly audio: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.Base64Action<string, undefined>]>, v.CustomSchema<Buffer<ArrayBufferLike>, undefined>], undefined>;
|
|
50
|
-
readonly caption: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
51
|
-
readonly ptt: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
52
|
-
}, undefined>, v.LooseObjectSchema<{
|
|
53
|
-
readonly video: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.Base64Action<string, undefined>]>, v.CustomSchema<Buffer<ArrayBufferLike>, undefined>], undefined>;
|
|
54
|
-
readonly caption: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
55
|
-
readonly ptv: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
56
|
-
}, undefined>, v.LooseObjectSchema<{
|
|
57
|
-
readonly sticker: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.Base64Action<string, undefined>]>, v.CustomSchema<Buffer<ArrayBufferLike>, undefined>], undefined>;
|
|
58
|
-
readonly shape: v.OptionalSchema<v.OptionalSchema<v.PicklistSchema<["default", "rounded", "circle", "oval"], undefined>, "default">, undefined>;
|
|
59
|
-
readonly caption: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
60
|
-
}, undefined>, v.LooseObjectSchema<{
|
|
61
|
-
readonly document: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.Base64Action<string, undefined>]>, v.CustomSchema<Buffer<ArrayBufferLike>, undefined>], undefined>;
|
|
62
|
-
readonly caption: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
63
|
-
readonly fileName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
64
|
-
}, undefined>, v.LooseObjectSchema<{
|
|
65
|
-
readonly location: v.OptionalSchema<v.ObjectSchema<{
|
|
66
|
-
readonly latitude: v.NumberSchema<undefined>;
|
|
67
|
-
readonly longitude: v.NumberSchema<undefined>;
|
|
68
|
-
readonly url: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, undefined>;
|
|
69
|
-
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
70
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
71
|
-
}, undefined>, undefined>;
|
|
72
|
-
}, undefined>, v.LooseObjectSchema<{
|
|
73
|
-
readonly contacts: v.ObjectSchema<{
|
|
74
|
-
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
75
|
-
readonly contacts: v.ArraySchema<v.ObjectSchema<{
|
|
76
|
-
readonly fullname: v.StringSchema<undefined>;
|
|
77
|
-
readonly phoneNumber: v.NumberSchema<undefined>;
|
|
78
|
-
readonly organization: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
79
|
-
}, undefined>, undefined>;
|
|
80
|
-
}, undefined>;
|
|
81
|
-
}, undefined>, v.ObjectSchema<{
|
|
82
|
-
readonly poll: v.ObjectSchema<{
|
|
83
|
-
readonly name: v.StringSchema<undefined>;
|
|
84
|
-
readonly answers: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
85
|
-
readonly isMultiple: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
86
|
-
}, undefined>;
|
|
87
|
-
}, undefined>], undefined>, Omit<v.ObjectSchema<{
|
|
88
|
-
readonly replied: v.OptionalSchema<v.CustomSchema<WAMessage, undefined>, undefined>;
|
|
89
|
-
readonly isForwardedMany: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
90
|
-
readonly isViewOnce: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
91
|
-
readonly banner: v.OptionalSchema<v.CustomSchema<proto.ContextInfo.IExternalAdReplyInfo, undefined>, undefined>;
|
|
92
|
-
readonly buttons: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
93
|
-
readonly type: v.LiteralSchema<"simple", undefined>;
|
|
94
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
95
|
-
readonly data: v.ArraySchema<v.ObjectSchema<{
|
|
96
|
-
readonly id: v.StringSchema<undefined>;
|
|
97
|
-
readonly text: v.StringSchema<undefined>;
|
|
98
|
-
}, undefined>, undefined>;
|
|
99
|
-
}, undefined>, v.ObjectSchema<{
|
|
100
|
-
readonly type: v.LiteralSchema<"interactive", undefined>;
|
|
101
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
102
|
-
readonly data: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
103
|
-
readonly type: v.LiteralSchema<"quick_reply", undefined>;
|
|
104
|
-
readonly id: v.StringSchema<undefined>;
|
|
105
|
-
readonly text: v.StringSchema<undefined>;
|
|
106
|
-
}, undefined>, v.ObjectSchema<{
|
|
107
|
-
readonly type: v.LiteralSchema<"cta_url", undefined>;
|
|
108
|
-
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
109
|
-
readonly text: v.StringSchema<undefined>;
|
|
110
|
-
}, undefined>, v.ObjectSchema<{
|
|
111
|
-
readonly type: v.LiteralSchema<"cta_copy", undefined>;
|
|
112
|
-
readonly id: v.StringSchema<undefined>;
|
|
113
|
-
readonly copy: v.StringSchema<undefined>;
|
|
114
|
-
readonly text: v.StringSchema<undefined>;
|
|
115
|
-
}, undefined>, v.ObjectSchema<{
|
|
116
|
-
readonly type: v.LiteralSchema<"cta_call", undefined>;
|
|
117
|
-
readonly text: v.StringSchema<undefined>;
|
|
118
|
-
readonly phoneNumber: v.StringSchema<undefined>;
|
|
119
|
-
}, undefined>, v.ObjectSchema<{
|
|
120
|
-
readonly type: v.LiteralSchema<"single_select", undefined>;
|
|
121
|
-
readonly text: v.StringSchema<undefined>;
|
|
122
|
-
readonly section: v.ArraySchema<v.ObjectSchema<{
|
|
123
|
-
readonly title: v.StringSchema<undefined>;
|
|
124
|
-
readonly highlight_label: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
125
|
-
readonly rows: v.ArraySchema<v.ObjectSchema<{
|
|
126
|
-
readonly id: v.StringSchema<undefined>;
|
|
127
|
-
readonly title: v.StringSchema<undefined>;
|
|
128
|
-
readonly header: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
129
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
130
|
-
}, undefined>, undefined>;
|
|
131
|
-
}, undefined>, undefined>;
|
|
132
|
-
}, undefined>], undefined>, undefined>;
|
|
133
|
-
}, undefined>, v.ObjectSchema<{
|
|
134
|
-
readonly type: v.LiteralSchema<"carousel", undefined>;
|
|
135
|
-
readonly data: v.ArraySchema<v.ObjectSchema<{
|
|
136
|
-
readonly body: v.StringSchema<undefined>;
|
|
137
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
138
|
-
readonly header: v.OptionalSchema<v.ObjectSchema<{
|
|
139
|
-
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
140
|
-
readonly subtitle: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
141
|
-
readonly hasMediaAttachment: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
142
|
-
readonly image: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
143
|
-
readonly video: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
144
|
-
}, undefined>, undefined>;
|
|
145
|
-
readonly nativeFlow: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
146
|
-
readonly type: v.LiteralSchema<"quick_reply", undefined>;
|
|
147
|
-
readonly id: v.StringSchema<undefined>;
|
|
148
|
-
readonly text: v.StringSchema<undefined>;
|
|
149
|
-
}, undefined>, v.ObjectSchema<{
|
|
150
|
-
readonly type: v.LiteralSchema<"cta_url", undefined>;
|
|
151
|
-
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
152
|
-
readonly text: v.StringSchema<undefined>;
|
|
153
|
-
}, undefined>, v.ObjectSchema<{
|
|
154
|
-
readonly type: v.LiteralSchema<"cta_copy", undefined>;
|
|
155
|
-
readonly id: v.StringSchema<undefined>;
|
|
156
|
-
readonly copy: v.StringSchema<undefined>;
|
|
157
|
-
readonly text: v.StringSchema<undefined>;
|
|
158
|
-
}, undefined>, v.ObjectSchema<{
|
|
159
|
-
readonly type: v.LiteralSchema<"cta_call", undefined>;
|
|
160
|
-
readonly text: v.StringSchema<undefined>;
|
|
161
|
-
readonly phoneNumber: v.StringSchema<undefined>;
|
|
162
|
-
}, undefined>], undefined>, undefined>;
|
|
163
|
-
}, undefined>, undefined>;
|
|
164
|
-
}, undefined>], undefined>, undefined>;
|
|
165
|
-
}, undefined>, "entries" | "~types" | "~run" | "~standard"> & {
|
|
166
|
-
readonly entries: Omit<{
|
|
167
|
-
readonly replied: v.OptionalSchema<v.CustomSchema<WAMessage, undefined>, undefined>;
|
|
168
|
-
readonly isForwardedMany: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
169
|
-
readonly isViewOnce: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
170
|
-
readonly banner: v.OptionalSchema<v.CustomSchema<proto.ContextInfo.IExternalAdReplyInfo, undefined>, undefined>;
|
|
171
|
-
readonly buttons: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
172
|
-
readonly type: v.LiteralSchema<"simple", undefined>;
|
|
173
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
174
|
-
readonly data: v.ArraySchema<v.ObjectSchema<{
|
|
175
|
-
readonly id: v.StringSchema<undefined>;
|
|
176
|
-
readonly text: v.StringSchema<undefined>;
|
|
177
|
-
}, undefined>, undefined>;
|
|
178
|
-
}, undefined>, v.ObjectSchema<{
|
|
179
|
-
readonly type: v.LiteralSchema<"interactive", undefined>;
|
|
180
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
181
|
-
readonly data: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
182
|
-
readonly type: v.LiteralSchema<"quick_reply", undefined>;
|
|
183
|
-
readonly id: v.StringSchema<undefined>;
|
|
184
|
-
readonly text: v.StringSchema<undefined>;
|
|
185
|
-
}, undefined>, v.ObjectSchema<{
|
|
186
|
-
readonly type: v.LiteralSchema<"cta_url", undefined>;
|
|
187
|
-
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
188
|
-
readonly text: v.StringSchema<undefined>;
|
|
189
|
-
}, undefined>, v.ObjectSchema<{
|
|
190
|
-
readonly type: v.LiteralSchema<"cta_copy", undefined>;
|
|
191
|
-
readonly id: v.StringSchema<undefined>;
|
|
192
|
-
readonly copy: v.StringSchema<undefined>;
|
|
193
|
-
readonly text: v.StringSchema<undefined>;
|
|
194
|
-
}, undefined>, v.ObjectSchema<{
|
|
195
|
-
readonly type: v.LiteralSchema<"cta_call", undefined>;
|
|
196
|
-
readonly text: v.StringSchema<undefined>;
|
|
197
|
-
readonly phoneNumber: v.StringSchema<undefined>;
|
|
198
|
-
}, undefined>, v.ObjectSchema<{
|
|
199
|
-
readonly type: v.LiteralSchema<"single_select", undefined>;
|
|
200
|
-
readonly text: v.StringSchema<undefined>;
|
|
201
|
-
readonly section: v.ArraySchema<v.ObjectSchema<{
|
|
202
|
-
readonly title: v.StringSchema<undefined>;
|
|
203
|
-
readonly highlight_label: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
204
|
-
readonly rows: v.ArraySchema<v.ObjectSchema<{
|
|
205
|
-
readonly id: v.StringSchema<undefined>;
|
|
206
|
-
readonly title: v.StringSchema<undefined>;
|
|
207
|
-
readonly header: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
208
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
209
|
-
}, undefined>, undefined>;
|
|
210
|
-
}, undefined>, undefined>;
|
|
211
|
-
}, undefined>], undefined>, undefined>;
|
|
212
|
-
}, undefined>, v.ObjectSchema<{
|
|
213
|
-
readonly type: v.LiteralSchema<"carousel", undefined>;
|
|
214
|
-
readonly data: v.ArraySchema<v.ObjectSchema<{
|
|
215
|
-
readonly body: v.StringSchema<undefined>;
|
|
216
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
217
|
-
readonly header: v.OptionalSchema<v.ObjectSchema<{
|
|
218
|
-
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
219
|
-
readonly subtitle: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
220
|
-
readonly hasMediaAttachment: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
221
|
-
readonly image: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
222
|
-
readonly video: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
223
|
-
}, undefined>, undefined>;
|
|
224
|
-
readonly nativeFlow: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
225
|
-
readonly type: v.LiteralSchema<"quick_reply", undefined>;
|
|
226
|
-
readonly id: v.StringSchema<undefined>;
|
|
227
|
-
readonly text: v.StringSchema<undefined>;
|
|
228
|
-
}, undefined>, v.ObjectSchema<{
|
|
229
|
-
readonly type: v.LiteralSchema<"cta_url", undefined>;
|
|
230
|
-
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
231
|
-
readonly text: v.StringSchema<undefined>;
|
|
232
|
-
}, undefined>, v.ObjectSchema<{
|
|
233
|
-
readonly type: v.LiteralSchema<"cta_copy", undefined>;
|
|
234
|
-
readonly id: v.StringSchema<undefined>;
|
|
235
|
-
readonly copy: v.StringSchema<undefined>;
|
|
236
|
-
readonly text: v.StringSchema<undefined>;
|
|
237
|
-
}, undefined>, v.ObjectSchema<{
|
|
238
|
-
readonly type: v.LiteralSchema<"cta_call", undefined>;
|
|
239
|
-
readonly text: v.StringSchema<undefined>;
|
|
240
|
-
readonly phoneNumber: v.StringSchema<undefined>;
|
|
241
|
-
}, undefined>], undefined>, undefined>;
|
|
242
|
-
}, undefined>, undefined>;
|
|
243
|
-
}, undefined>], undefined>, undefined>;
|
|
244
|
-
}, "buttons">;
|
|
245
|
-
readonly "~standard": v.StandardProps<{
|
|
246
|
-
isViewOnce?: boolean;
|
|
247
|
-
replied?: proto.IWebMessageInfo & {
|
|
248
|
-
key: baileys.WAMessageKey;
|
|
249
|
-
messageStubParameters?: any;
|
|
250
|
-
category?: string;
|
|
251
|
-
retryCount?: number;
|
|
252
|
-
};
|
|
253
|
-
isForwardedMany?: boolean;
|
|
254
|
-
banner?: proto.ContextInfo.IExternalAdReplyInfo;
|
|
255
|
-
}, {
|
|
256
|
-
isViewOnce?: boolean;
|
|
257
|
-
replied?: proto.IWebMessageInfo & {
|
|
258
|
-
key: baileys.WAMessageKey;
|
|
259
|
-
messageStubParameters?: any;
|
|
260
|
-
category?: string;
|
|
261
|
-
retryCount?: number;
|
|
262
|
-
};
|
|
263
|
-
isForwardedMany?: boolean;
|
|
264
|
-
banner?: proto.ContextInfo.IExternalAdReplyInfo;
|
|
265
|
-
}>;
|
|
266
|
-
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
267
|
-
isViewOnce?: boolean;
|
|
268
|
-
replied?: proto.IWebMessageInfo & {
|
|
269
|
-
key: baileys.WAMessageKey;
|
|
270
|
-
messageStubParameters?: any;
|
|
271
|
-
category?: string;
|
|
272
|
-
retryCount?: number;
|
|
273
|
-
};
|
|
274
|
-
isForwardedMany?: boolean;
|
|
275
|
-
banner?: proto.ContextInfo.IExternalAdReplyInfo;
|
|
276
|
-
}, v.ObjectIssue | v.BooleanIssue | v.CustomIssue>;
|
|
277
|
-
readonly "~types"?: {
|
|
278
|
-
readonly input: {
|
|
279
|
-
isViewOnce?: boolean;
|
|
280
|
-
replied?: proto.IWebMessageInfo & {
|
|
281
|
-
key: baileys.WAMessageKey;
|
|
282
|
-
messageStubParameters?: any;
|
|
283
|
-
category?: string;
|
|
284
|
-
retryCount?: number;
|
|
285
|
-
};
|
|
286
|
-
isForwardedMany?: boolean;
|
|
287
|
-
banner?: proto.ContextInfo.IExternalAdReplyInfo;
|
|
288
|
-
};
|
|
289
|
-
readonly output: {
|
|
290
|
-
isViewOnce?: boolean;
|
|
291
|
-
replied?: proto.IWebMessageInfo & {
|
|
292
|
-
key: baileys.WAMessageKey;
|
|
293
|
-
messageStubParameters?: any;
|
|
294
|
-
category?: string;
|
|
295
|
-
retryCount?: number;
|
|
296
|
-
};
|
|
297
|
-
isForwardedMany?: boolean;
|
|
298
|
-
banner?: proto.ContextInfo.IExternalAdReplyInfo;
|
|
299
|
-
};
|
|
300
|
-
readonly issue: v.ObjectIssue | v.BooleanIssue | v.CustomIssue;
|
|
301
|
-
};
|
|
302
|
-
}], undefined>], undefined>;
|
|
303
|
-
declare const ButtonOptionsType: v.IntersectSchema<[v.LooseObjectSchema<{
|
|
304
|
-
readonly text: v.StringSchema<undefined>;
|
|
305
|
-
}, undefined>, Omit<v.ObjectSchema<{
|
|
306
|
-
readonly replied: v.OptionalSchema<v.CustomSchema<WAMessage, undefined>, undefined>;
|
|
307
|
-
readonly isForwardedMany: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
308
|
-
readonly isViewOnce: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
309
|
-
readonly banner: v.OptionalSchema<v.CustomSchema<proto.ContextInfo.IExternalAdReplyInfo, undefined>, undefined>;
|
|
310
|
-
readonly buttons: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
311
|
-
readonly type: v.LiteralSchema<"simple", undefined>;
|
|
312
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
313
|
-
readonly data: v.ArraySchema<v.ObjectSchema<{
|
|
314
|
-
readonly id: v.StringSchema<undefined>;
|
|
315
|
-
readonly text: v.StringSchema<undefined>;
|
|
316
|
-
}, undefined>, undefined>;
|
|
317
|
-
}, undefined>, v.ObjectSchema<{
|
|
318
|
-
readonly type: v.LiteralSchema<"interactive", undefined>;
|
|
319
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
320
|
-
readonly data: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
321
|
-
readonly type: v.LiteralSchema<"quick_reply", undefined>;
|
|
322
|
-
readonly id: v.StringSchema<undefined>;
|
|
323
|
-
readonly text: v.StringSchema<undefined>;
|
|
324
|
-
}, undefined>, v.ObjectSchema<{
|
|
325
|
-
readonly type: v.LiteralSchema<"cta_url", undefined>;
|
|
326
|
-
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
327
|
-
readonly text: v.StringSchema<undefined>;
|
|
328
|
-
}, undefined>, v.ObjectSchema<{
|
|
329
|
-
readonly type: v.LiteralSchema<"cta_copy", undefined>;
|
|
330
|
-
readonly id: v.StringSchema<undefined>;
|
|
331
|
-
readonly copy: v.StringSchema<undefined>;
|
|
332
|
-
readonly text: v.StringSchema<undefined>;
|
|
333
|
-
}, undefined>, v.ObjectSchema<{
|
|
334
|
-
readonly type: v.LiteralSchema<"cta_call", undefined>;
|
|
335
|
-
readonly text: v.StringSchema<undefined>;
|
|
336
|
-
readonly phoneNumber: v.StringSchema<undefined>;
|
|
337
|
-
}, undefined>, v.ObjectSchema<{
|
|
338
|
-
readonly type: v.LiteralSchema<"single_select", undefined>;
|
|
339
|
-
readonly text: v.StringSchema<undefined>;
|
|
340
|
-
readonly section: v.ArraySchema<v.ObjectSchema<{
|
|
341
|
-
readonly title: v.StringSchema<undefined>;
|
|
342
|
-
readonly highlight_label: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
343
|
-
readonly rows: v.ArraySchema<v.ObjectSchema<{
|
|
344
|
-
readonly id: v.StringSchema<undefined>;
|
|
345
|
-
readonly title: v.StringSchema<undefined>;
|
|
346
|
-
readonly header: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
347
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
348
|
-
}, undefined>, undefined>;
|
|
349
|
-
}, undefined>, undefined>;
|
|
350
|
-
}, undefined>], undefined>, undefined>;
|
|
351
|
-
}, undefined>, v.ObjectSchema<{
|
|
352
|
-
readonly type: v.LiteralSchema<"carousel", undefined>;
|
|
353
|
-
readonly data: v.ArraySchema<v.ObjectSchema<{
|
|
354
|
-
readonly body: v.StringSchema<undefined>;
|
|
355
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
356
|
-
readonly header: v.OptionalSchema<v.ObjectSchema<{
|
|
357
|
-
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
358
|
-
readonly subtitle: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
359
|
-
readonly hasMediaAttachment: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
360
|
-
readonly image: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
361
|
-
readonly video: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
362
|
-
}, undefined>, undefined>;
|
|
363
|
-
readonly nativeFlow: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
364
|
-
readonly type: v.LiteralSchema<"quick_reply", undefined>;
|
|
365
|
-
readonly id: v.StringSchema<undefined>;
|
|
366
|
-
readonly text: v.StringSchema<undefined>;
|
|
367
|
-
}, undefined>, v.ObjectSchema<{
|
|
368
|
-
readonly type: v.LiteralSchema<"cta_url", undefined>;
|
|
369
|
-
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
370
|
-
readonly text: v.StringSchema<undefined>;
|
|
371
|
-
}, undefined>, v.ObjectSchema<{
|
|
372
|
-
readonly type: v.LiteralSchema<"cta_copy", undefined>;
|
|
373
|
-
readonly id: v.StringSchema<undefined>;
|
|
374
|
-
readonly copy: v.StringSchema<undefined>;
|
|
375
|
-
readonly text: v.StringSchema<undefined>;
|
|
376
|
-
}, undefined>, v.ObjectSchema<{
|
|
377
|
-
readonly type: v.LiteralSchema<"cta_call", undefined>;
|
|
378
|
-
readonly text: v.StringSchema<undefined>;
|
|
379
|
-
readonly phoneNumber: v.StringSchema<undefined>;
|
|
380
|
-
}, undefined>], undefined>, undefined>;
|
|
381
|
-
}, undefined>, undefined>;
|
|
382
|
-
}, undefined>], undefined>, undefined>;
|
|
383
|
-
}, undefined>, "entries" | "~types" | "~run" | "~standard"> & {
|
|
384
|
-
readonly entries: Omit<{
|
|
385
|
-
readonly replied: v.OptionalSchema<v.CustomSchema<WAMessage, undefined>, undefined>;
|
|
386
|
-
readonly isForwardedMany: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
387
|
-
readonly isViewOnce: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
388
|
-
readonly banner: v.OptionalSchema<v.CustomSchema<proto.ContextInfo.IExternalAdReplyInfo, undefined>, undefined>;
|
|
389
|
-
readonly buttons: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
390
|
-
readonly type: v.LiteralSchema<"simple", undefined>;
|
|
391
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
392
|
-
readonly data: v.ArraySchema<v.ObjectSchema<{
|
|
393
|
-
readonly id: v.StringSchema<undefined>;
|
|
394
|
-
readonly text: v.StringSchema<undefined>;
|
|
395
|
-
}, undefined>, undefined>;
|
|
396
|
-
}, undefined>, v.ObjectSchema<{
|
|
397
|
-
readonly type: v.LiteralSchema<"interactive", undefined>;
|
|
398
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
399
|
-
readonly data: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
400
|
-
readonly type: v.LiteralSchema<"quick_reply", undefined>;
|
|
401
|
-
readonly id: v.StringSchema<undefined>;
|
|
402
|
-
readonly text: v.StringSchema<undefined>;
|
|
403
|
-
}, undefined>, v.ObjectSchema<{
|
|
404
|
-
readonly type: v.LiteralSchema<"cta_url", undefined>;
|
|
405
|
-
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
406
|
-
readonly text: v.StringSchema<undefined>;
|
|
407
|
-
}, undefined>, v.ObjectSchema<{
|
|
408
|
-
readonly type: v.LiteralSchema<"cta_copy", undefined>;
|
|
409
|
-
readonly id: v.StringSchema<undefined>;
|
|
410
|
-
readonly copy: v.StringSchema<undefined>;
|
|
411
|
-
readonly text: v.StringSchema<undefined>;
|
|
412
|
-
}, undefined>, v.ObjectSchema<{
|
|
413
|
-
readonly type: v.LiteralSchema<"cta_call", undefined>;
|
|
414
|
-
readonly text: v.StringSchema<undefined>;
|
|
415
|
-
readonly phoneNumber: v.StringSchema<undefined>;
|
|
416
|
-
}, undefined>, v.ObjectSchema<{
|
|
417
|
-
readonly type: v.LiteralSchema<"single_select", undefined>;
|
|
418
|
-
readonly text: v.StringSchema<undefined>;
|
|
419
|
-
readonly section: v.ArraySchema<v.ObjectSchema<{
|
|
420
|
-
readonly title: v.StringSchema<undefined>;
|
|
421
|
-
readonly highlight_label: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
422
|
-
readonly rows: v.ArraySchema<v.ObjectSchema<{
|
|
423
|
-
readonly id: v.StringSchema<undefined>;
|
|
424
|
-
readonly title: v.StringSchema<undefined>;
|
|
425
|
-
readonly header: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
426
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
427
|
-
}, undefined>, undefined>;
|
|
428
|
-
}, undefined>, undefined>;
|
|
429
|
-
}, undefined>], undefined>, undefined>;
|
|
430
|
-
}, undefined>, v.ObjectSchema<{
|
|
431
|
-
readonly type: v.LiteralSchema<"carousel", undefined>;
|
|
432
|
-
readonly data: v.ArraySchema<v.ObjectSchema<{
|
|
433
|
-
readonly body: v.StringSchema<undefined>;
|
|
434
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
435
|
-
readonly header: v.OptionalSchema<v.ObjectSchema<{
|
|
436
|
-
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
437
|
-
readonly subtitle: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
438
|
-
readonly hasMediaAttachment: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
439
|
-
readonly image: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
440
|
-
readonly video: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
441
|
-
}, undefined>, undefined>;
|
|
442
|
-
readonly nativeFlow: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
443
|
-
readonly type: v.LiteralSchema<"quick_reply", undefined>;
|
|
444
|
-
readonly id: v.StringSchema<undefined>;
|
|
445
|
-
readonly text: v.StringSchema<undefined>;
|
|
446
|
-
}, undefined>, v.ObjectSchema<{
|
|
447
|
-
readonly type: v.LiteralSchema<"cta_url", undefined>;
|
|
448
|
-
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
449
|
-
readonly text: v.StringSchema<undefined>;
|
|
450
|
-
}, undefined>, v.ObjectSchema<{
|
|
451
|
-
readonly type: v.LiteralSchema<"cta_copy", undefined>;
|
|
452
|
-
readonly id: v.StringSchema<undefined>;
|
|
453
|
-
readonly copy: v.StringSchema<undefined>;
|
|
454
|
-
readonly text: v.StringSchema<undefined>;
|
|
455
|
-
}, undefined>, v.ObjectSchema<{
|
|
456
|
-
readonly type: v.LiteralSchema<"cta_call", undefined>;
|
|
457
|
-
readonly text: v.StringSchema<undefined>;
|
|
458
|
-
readonly phoneNumber: v.StringSchema<undefined>;
|
|
459
|
-
}, undefined>], undefined>, undefined>;
|
|
460
|
-
}, undefined>, undefined>;
|
|
461
|
-
}, undefined>], undefined>, undefined>;
|
|
462
|
-
}, "banner">;
|
|
463
|
-
readonly "~standard": v.StandardProps<{
|
|
464
|
-
buttons?: {
|
|
465
|
-
type: "simple";
|
|
466
|
-
footer?: string;
|
|
467
|
-
data: {
|
|
468
|
-
id: string;
|
|
469
|
-
text: string;
|
|
470
|
-
}[];
|
|
471
|
-
} | {
|
|
472
|
-
type: "interactive";
|
|
473
|
-
footer?: string;
|
|
474
|
-
data: ({
|
|
475
|
-
type: "quick_reply";
|
|
476
|
-
id: string;
|
|
477
|
-
text: string;
|
|
478
|
-
} | {
|
|
479
|
-
type: "cta_url";
|
|
480
|
-
url: string;
|
|
481
|
-
text: string;
|
|
482
|
-
} | {
|
|
483
|
-
type: "cta_copy";
|
|
484
|
-
id: string;
|
|
485
|
-
copy: string;
|
|
486
|
-
text: string;
|
|
487
|
-
} | {
|
|
488
|
-
type: "cta_call";
|
|
489
|
-
text: string;
|
|
490
|
-
phoneNumber: string;
|
|
491
|
-
} | {
|
|
492
|
-
type: "single_select";
|
|
493
|
-
text: string;
|
|
494
|
-
section: {
|
|
495
|
-
title: string;
|
|
496
|
-
highlight_label?: string;
|
|
497
|
-
rows: {
|
|
498
|
-
id: string;
|
|
499
|
-
title: string;
|
|
500
|
-
header?: string;
|
|
501
|
-
description?: string;
|
|
502
|
-
}[];
|
|
503
|
-
}[];
|
|
504
|
-
})[];
|
|
505
|
-
} | {
|
|
506
|
-
type: "carousel";
|
|
507
|
-
data: {
|
|
508
|
-
body: string;
|
|
509
|
-
footer?: string;
|
|
510
|
-
header?: {
|
|
511
|
-
title?: string;
|
|
512
|
-
subtitle?: string;
|
|
513
|
-
hasMediaAttachment?: boolean;
|
|
514
|
-
image?: string;
|
|
515
|
-
video?: string;
|
|
516
|
-
};
|
|
517
|
-
nativeFlow: ({
|
|
518
|
-
type: "quick_reply";
|
|
519
|
-
id: string;
|
|
520
|
-
text: string;
|
|
521
|
-
} | {
|
|
522
|
-
type: "cta_url";
|
|
523
|
-
url: string;
|
|
524
|
-
text: string;
|
|
525
|
-
} | {
|
|
526
|
-
type: "cta_copy";
|
|
527
|
-
id: string;
|
|
528
|
-
copy: string;
|
|
529
|
-
text: string;
|
|
530
|
-
} | {
|
|
531
|
-
type: "cta_call";
|
|
532
|
-
text: string;
|
|
533
|
-
phoneNumber: string;
|
|
534
|
-
})[];
|
|
535
|
-
}[];
|
|
536
|
-
};
|
|
537
|
-
isViewOnce?: boolean;
|
|
538
|
-
replied?: proto.IWebMessageInfo & {
|
|
539
|
-
key: baileys.WAMessageKey;
|
|
540
|
-
messageStubParameters?: any;
|
|
541
|
-
category?: string;
|
|
542
|
-
retryCount?: number;
|
|
543
|
-
};
|
|
544
|
-
isForwardedMany?: boolean;
|
|
545
|
-
}, {
|
|
546
|
-
buttons?: {
|
|
547
|
-
type: "simple";
|
|
548
|
-
footer?: string;
|
|
549
|
-
data: {
|
|
550
|
-
id: string;
|
|
551
|
-
text: string;
|
|
552
|
-
}[];
|
|
553
|
-
} | {
|
|
554
|
-
type: "interactive";
|
|
555
|
-
footer?: string;
|
|
556
|
-
data: ({
|
|
557
|
-
type: "quick_reply";
|
|
558
|
-
id: string;
|
|
559
|
-
text: string;
|
|
560
|
-
} | {
|
|
561
|
-
type: "cta_url";
|
|
562
|
-
url: string;
|
|
563
|
-
text: string;
|
|
564
|
-
} | {
|
|
565
|
-
type: "cta_copy";
|
|
566
|
-
id: string;
|
|
567
|
-
copy: string;
|
|
568
|
-
text: string;
|
|
569
|
-
} | {
|
|
570
|
-
type: "cta_call";
|
|
571
|
-
text: string;
|
|
572
|
-
phoneNumber: string;
|
|
573
|
-
} | {
|
|
574
|
-
type: "single_select";
|
|
575
|
-
text: string;
|
|
576
|
-
section: {
|
|
577
|
-
title: string;
|
|
578
|
-
highlight_label?: string;
|
|
579
|
-
rows: {
|
|
580
|
-
id: string;
|
|
581
|
-
title: string;
|
|
582
|
-
header?: string;
|
|
583
|
-
description?: string;
|
|
584
|
-
}[];
|
|
585
|
-
}[];
|
|
586
|
-
})[];
|
|
587
|
-
} | {
|
|
588
|
-
type: "carousel";
|
|
589
|
-
data: {
|
|
590
|
-
body: string;
|
|
591
|
-
footer?: string;
|
|
592
|
-
header?: {
|
|
593
|
-
title?: string;
|
|
594
|
-
subtitle?: string;
|
|
595
|
-
hasMediaAttachment?: boolean;
|
|
596
|
-
image?: string;
|
|
597
|
-
video?: string;
|
|
598
|
-
};
|
|
599
|
-
nativeFlow: ({
|
|
600
|
-
type: "quick_reply";
|
|
601
|
-
id: string;
|
|
602
|
-
text: string;
|
|
603
|
-
} | {
|
|
604
|
-
type: "cta_url";
|
|
605
|
-
url: string;
|
|
606
|
-
text: string;
|
|
607
|
-
} | {
|
|
608
|
-
type: "cta_copy";
|
|
609
|
-
id: string;
|
|
610
|
-
copy: string;
|
|
611
|
-
text: string;
|
|
612
|
-
} | {
|
|
613
|
-
type: "cta_call";
|
|
614
|
-
text: string;
|
|
615
|
-
phoneNumber: string;
|
|
616
|
-
})[];
|
|
617
|
-
}[];
|
|
618
|
-
};
|
|
619
|
-
isViewOnce?: boolean;
|
|
620
|
-
replied?: proto.IWebMessageInfo & {
|
|
621
|
-
key: baileys.WAMessageKey;
|
|
622
|
-
messageStubParameters?: any;
|
|
623
|
-
category?: string;
|
|
624
|
-
retryCount?: number;
|
|
625
|
-
};
|
|
626
|
-
isForwardedMany?: boolean;
|
|
627
|
-
}>;
|
|
628
|
-
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
629
|
-
buttons?: {
|
|
630
|
-
type: "simple";
|
|
631
|
-
footer?: string;
|
|
632
|
-
data: {
|
|
633
|
-
id: string;
|
|
634
|
-
text: string;
|
|
635
|
-
}[];
|
|
636
|
-
} | {
|
|
637
|
-
type: "interactive";
|
|
638
|
-
footer?: string;
|
|
639
|
-
data: ({
|
|
640
|
-
type: "quick_reply";
|
|
641
|
-
id: string;
|
|
642
|
-
text: string;
|
|
643
|
-
} | {
|
|
644
|
-
type: "cta_url";
|
|
645
|
-
url: string;
|
|
646
|
-
text: string;
|
|
647
|
-
} | {
|
|
648
|
-
type: "cta_copy";
|
|
649
|
-
id: string;
|
|
650
|
-
copy: string;
|
|
651
|
-
text: string;
|
|
652
|
-
} | {
|
|
653
|
-
type: "cta_call";
|
|
654
|
-
text: string;
|
|
655
|
-
phoneNumber: string;
|
|
656
|
-
} | {
|
|
657
|
-
type: "single_select";
|
|
658
|
-
text: string;
|
|
659
|
-
section: {
|
|
660
|
-
title: string;
|
|
661
|
-
highlight_label?: string;
|
|
662
|
-
rows: {
|
|
663
|
-
id: string;
|
|
664
|
-
title: string;
|
|
665
|
-
header?: string;
|
|
666
|
-
description?: string;
|
|
667
|
-
}[];
|
|
668
|
-
}[];
|
|
669
|
-
})[];
|
|
670
|
-
} | {
|
|
671
|
-
type: "carousel";
|
|
672
|
-
data: {
|
|
673
|
-
body: string;
|
|
674
|
-
footer?: string;
|
|
675
|
-
header?: {
|
|
676
|
-
title?: string;
|
|
677
|
-
subtitle?: string;
|
|
678
|
-
hasMediaAttachment?: boolean;
|
|
679
|
-
image?: string;
|
|
680
|
-
video?: string;
|
|
681
|
-
};
|
|
682
|
-
nativeFlow: ({
|
|
683
|
-
type: "quick_reply";
|
|
684
|
-
id: string;
|
|
685
|
-
text: string;
|
|
686
|
-
} | {
|
|
687
|
-
type: "cta_url";
|
|
688
|
-
url: string;
|
|
689
|
-
text: string;
|
|
690
|
-
} | {
|
|
691
|
-
type: "cta_copy";
|
|
692
|
-
id: string;
|
|
693
|
-
copy: string;
|
|
694
|
-
text: string;
|
|
695
|
-
} | {
|
|
696
|
-
type: "cta_call";
|
|
697
|
-
text: string;
|
|
698
|
-
phoneNumber: string;
|
|
699
|
-
})[];
|
|
700
|
-
}[];
|
|
701
|
-
};
|
|
702
|
-
isViewOnce?: boolean;
|
|
703
|
-
replied?: proto.IWebMessageInfo & {
|
|
704
|
-
key: baileys.WAMessageKey;
|
|
705
|
-
messageStubParameters?: any;
|
|
706
|
-
category?: string;
|
|
707
|
-
retryCount?: number;
|
|
708
|
-
};
|
|
709
|
-
isForwardedMany?: boolean;
|
|
710
|
-
}, v.ObjectIssue | v.LiteralIssue | v.StringIssue | v.ArrayIssue | v.BooleanIssue | v.CustomIssue | v.UrlIssue<string> | v.UnionIssue<v.ObjectIssue | v.LiteralIssue | v.StringIssue | v.ArrayIssue | v.UrlIssue<string>> | v.UnionIssue<v.ObjectIssue | v.LiteralIssue | v.StringIssue | v.UrlIssue<string>> | v.UnionIssue<v.ObjectIssue | v.LiteralIssue | v.StringIssue | v.ArrayIssue | v.BooleanIssue | v.UrlIssue<string> | v.UnionIssue<v.ObjectIssue | v.LiteralIssue | v.StringIssue | v.ArrayIssue | v.UrlIssue<string>> | v.UnionIssue<v.ObjectIssue | v.LiteralIssue | v.StringIssue | v.UrlIssue<string>>>>;
|
|
711
|
-
readonly "~types"?: {
|
|
712
|
-
readonly input: {
|
|
713
|
-
buttons?: {
|
|
714
|
-
type: "simple";
|
|
715
|
-
footer?: string;
|
|
716
|
-
data: {
|
|
717
|
-
id: string;
|
|
718
|
-
text: string;
|
|
719
|
-
}[];
|
|
720
|
-
} | {
|
|
721
|
-
type: "interactive";
|
|
722
|
-
footer?: string;
|
|
723
|
-
data: ({
|
|
724
|
-
type: "quick_reply";
|
|
725
|
-
id: string;
|
|
726
|
-
text: string;
|
|
727
|
-
} | {
|
|
728
|
-
type: "cta_url";
|
|
729
|
-
url: string;
|
|
730
|
-
text: string;
|
|
731
|
-
} | {
|
|
732
|
-
type: "cta_copy";
|
|
733
|
-
id: string;
|
|
734
|
-
copy: string;
|
|
735
|
-
text: string;
|
|
736
|
-
} | {
|
|
737
|
-
type: "cta_call";
|
|
738
|
-
text: string;
|
|
739
|
-
phoneNumber: string;
|
|
740
|
-
} | {
|
|
741
|
-
type: "single_select";
|
|
742
|
-
text: string;
|
|
743
|
-
section: {
|
|
744
|
-
title: string;
|
|
745
|
-
highlight_label?: string;
|
|
746
|
-
rows: {
|
|
747
|
-
id: string;
|
|
748
|
-
title: string;
|
|
749
|
-
header?: string;
|
|
750
|
-
description?: string;
|
|
751
|
-
}[];
|
|
752
|
-
}[];
|
|
753
|
-
})[];
|
|
754
|
-
} | {
|
|
755
|
-
type: "carousel";
|
|
756
|
-
data: {
|
|
757
|
-
body: string;
|
|
758
|
-
footer?: string;
|
|
759
|
-
header?: {
|
|
760
|
-
title?: string;
|
|
761
|
-
subtitle?: string;
|
|
762
|
-
hasMediaAttachment?: boolean;
|
|
763
|
-
image?: string;
|
|
764
|
-
video?: string;
|
|
765
|
-
};
|
|
766
|
-
nativeFlow: ({
|
|
767
|
-
type: "quick_reply";
|
|
768
|
-
id: string;
|
|
769
|
-
text: string;
|
|
770
|
-
} | {
|
|
771
|
-
type: "cta_url";
|
|
772
|
-
url: string;
|
|
773
|
-
text: string;
|
|
774
|
-
} | {
|
|
775
|
-
type: "cta_copy";
|
|
776
|
-
id: string;
|
|
777
|
-
copy: string;
|
|
778
|
-
text: string;
|
|
779
|
-
} | {
|
|
780
|
-
type: "cta_call";
|
|
781
|
-
text: string;
|
|
782
|
-
phoneNumber: string;
|
|
783
|
-
})[];
|
|
784
|
-
}[];
|
|
785
|
-
};
|
|
786
|
-
isViewOnce?: boolean;
|
|
787
|
-
replied?: proto.IWebMessageInfo & {
|
|
788
|
-
key: baileys.WAMessageKey;
|
|
789
|
-
messageStubParameters?: any;
|
|
790
|
-
category?: string;
|
|
791
|
-
retryCount?: number;
|
|
792
|
-
};
|
|
793
|
-
isForwardedMany?: boolean;
|
|
794
|
-
};
|
|
795
|
-
readonly output: {
|
|
796
|
-
buttons?: {
|
|
797
|
-
type: "simple";
|
|
798
|
-
footer?: string;
|
|
799
|
-
data: {
|
|
800
|
-
id: string;
|
|
801
|
-
text: string;
|
|
802
|
-
}[];
|
|
803
|
-
} | {
|
|
804
|
-
type: "interactive";
|
|
805
|
-
footer?: string;
|
|
806
|
-
data: ({
|
|
807
|
-
type: "quick_reply";
|
|
808
|
-
id: string;
|
|
809
|
-
text: string;
|
|
810
|
-
} | {
|
|
811
|
-
type: "cta_url";
|
|
812
|
-
url: string;
|
|
813
|
-
text: string;
|
|
814
|
-
} | {
|
|
815
|
-
type: "cta_copy";
|
|
816
|
-
id: string;
|
|
817
|
-
copy: string;
|
|
818
|
-
text: string;
|
|
819
|
-
} | {
|
|
820
|
-
type: "cta_call";
|
|
821
|
-
text: string;
|
|
822
|
-
phoneNumber: string;
|
|
823
|
-
} | {
|
|
824
|
-
type: "single_select";
|
|
825
|
-
text: string;
|
|
826
|
-
section: {
|
|
827
|
-
title: string;
|
|
828
|
-
highlight_label?: string;
|
|
829
|
-
rows: {
|
|
830
|
-
id: string;
|
|
831
|
-
title: string;
|
|
832
|
-
header?: string;
|
|
833
|
-
description?: string;
|
|
834
|
-
}[];
|
|
835
|
-
}[];
|
|
836
|
-
})[];
|
|
837
|
-
} | {
|
|
838
|
-
type: "carousel";
|
|
839
|
-
data: {
|
|
840
|
-
body: string;
|
|
841
|
-
footer?: string;
|
|
842
|
-
header?: {
|
|
843
|
-
title?: string;
|
|
844
|
-
subtitle?: string;
|
|
845
|
-
hasMediaAttachment?: boolean;
|
|
846
|
-
image?: string;
|
|
847
|
-
video?: string;
|
|
848
|
-
};
|
|
849
|
-
nativeFlow: ({
|
|
850
|
-
type: "quick_reply";
|
|
851
|
-
id: string;
|
|
852
|
-
text: string;
|
|
853
|
-
} | {
|
|
854
|
-
type: "cta_url";
|
|
855
|
-
url: string;
|
|
856
|
-
text: string;
|
|
857
|
-
} | {
|
|
858
|
-
type: "cta_copy";
|
|
859
|
-
id: string;
|
|
860
|
-
copy: string;
|
|
861
|
-
text: string;
|
|
862
|
-
} | {
|
|
863
|
-
type: "cta_call";
|
|
864
|
-
text: string;
|
|
865
|
-
phoneNumber: string;
|
|
866
|
-
})[];
|
|
867
|
-
}[];
|
|
868
|
-
};
|
|
869
|
-
isViewOnce?: boolean;
|
|
870
|
-
replied?: proto.IWebMessageInfo & {
|
|
871
|
-
key: baileys.WAMessageKey;
|
|
872
|
-
messageStubParameters?: any;
|
|
873
|
-
category?: string;
|
|
874
|
-
retryCount?: number;
|
|
875
|
-
};
|
|
876
|
-
isForwardedMany?: boolean;
|
|
877
|
-
};
|
|
878
|
-
readonly issue: v.ObjectIssue | v.LiteralIssue | v.StringIssue | v.ArrayIssue | v.BooleanIssue | v.CustomIssue | v.UrlIssue<string> | v.UnionIssue<v.ObjectIssue | v.LiteralIssue | v.StringIssue | v.ArrayIssue | v.UrlIssue<string>> | v.UnionIssue<v.ObjectIssue | v.LiteralIssue | v.StringIssue | v.UrlIssue<string>> | v.UnionIssue<v.ObjectIssue | v.LiteralIssue | v.StringIssue | v.ArrayIssue | v.BooleanIssue | v.UrlIssue<string> | v.UnionIssue<v.ObjectIssue | v.LiteralIssue | v.StringIssue | v.ArrayIssue | v.UrlIssue<string>> | v.UnionIssue<v.ObjectIssue | v.LiteralIssue | v.StringIssue | v.UrlIssue<string>>>;
|
|
879
|
-
};
|
|
880
|
-
}], undefined>;
|
|
881
|
-
|
|
882
|
-
declare class Signal {
|
|
883
|
-
protected client: Client;
|
|
884
|
-
constructor(client: Client);
|
|
885
|
-
protected signal(roomId: string, options: v.InferInput<typeof SignalOptionsType> | any, type?: v.InferInput<typeof SignalType>, message?: WAMessage): Promise<WAMessage>;
|
|
886
|
-
send(roomId: string, options: v.InferInput<typeof SignalOptionsType>): Promise<WAMessage>;
|
|
887
|
-
forward(roomId: string, options: v.InferInput<typeof SignalOptionsType>): Promise<WAMessage>;
|
|
888
|
-
button(roomId: string, options: v.InferInput<typeof ButtonOptionsType>): Promise<WAMessage>;
|
|
889
|
-
edit(message: WAMessage, options: v.InferInput<typeof SignalOptionsType>): Promise<WAMessage>;
|
|
890
|
-
delete(message: WAMessage | WAMessage[]): Promise<WAMessage | (baileys.proto.IWebMessageInfo & {
|
|
891
|
-
key: baileys.WAMessageKey;
|
|
892
|
-
messageStubParameters?: any;
|
|
893
|
-
category?: string;
|
|
894
|
-
retryCount?: number;
|
|
895
|
-
})[]>;
|
|
896
|
-
presence(roomId: string, type: 'typing' | 'recording' | 'online' | 'offline' | 'paused'): Promise<void>;
|
|
897
|
-
reaction(message: WAMessage, reaction: string): Promise<WAMessage>;
|
|
898
|
-
memberLabel(roomId: string, label: string): Promise<string>;
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
declare class Community {
|
|
902
|
-
protected client: Client;
|
|
903
|
-
constructor(client: Client);
|
|
904
|
-
create(subject: string, description: string): Promise<baileys.GroupMetadata>;
|
|
905
|
-
createGroup(subject: string, participants: string[], parentId: string): Promise<baileys.GroupMetadata>;
|
|
906
|
-
leave(id: string): Promise<void>;
|
|
907
|
-
metadata(id: string): Promise<baileys.GroupMetadata>;
|
|
908
|
-
update(id: string, type: 'subject' | 'description', value: string): Promise<void>;
|
|
909
|
-
group(id: string, type: 'link' | 'unlink' | 'linked', groupJid?: string): Promise<void | {
|
|
910
|
-
communityJid: string;
|
|
911
|
-
isCommunity: boolean;
|
|
912
|
-
linkedGroups: {
|
|
913
|
-
id: string | undefined;
|
|
914
|
-
subject: string;
|
|
915
|
-
creation: number | undefined;
|
|
916
|
-
owner: string | undefined;
|
|
917
|
-
size: number | undefined;
|
|
918
|
-
}[];
|
|
919
|
-
}>;
|
|
920
|
-
participants(id: string, type: 'list' | 'request-update' | 'update' | 'all', action?: 'add' | 'remove' | 'promote' | 'demote' | 'approve' | 'reject', participants?: string[]): Promise<{
|
|
921
|
-
[key: string]: string;
|
|
922
|
-
}[] | {
|
|
923
|
-
status: string;
|
|
924
|
-
jid: string | undefined;
|
|
925
|
-
}[] | {
|
|
926
|
-
[_: string]: baileys.GroupMetadata;
|
|
927
|
-
}>;
|
|
928
|
-
invite(target: string | any, type: 'code' | 'revoke' | 'accept' | 'info' | 'revokeV4' | 'acceptV4', ...args: any[]): Promise<any>;
|
|
929
|
-
settings(id: string, type: 'ephemeral' | 'update' | 'memberAdd' | 'approval', value?: any): Promise<void>;
|
|
274
|
+
type DeleteOptions = {
|
|
275
|
+
forEveryone?: boolean;
|
|
276
|
+
};
|
|
277
|
+
declare const deleteMessage: (socket: BuilderSocketLike, key: WAMessageKey, opts?: DeleteOptions) => Promise<void>;
|
|
278
|
+
declare const reactToMessage: (socket: BuilderSocketLike, key: WAMessageKey, emoji: string) => Promise<WAMessageKey>;
|
|
279
|
+
declare const forwardMessage: (socket: BuilderSocketLike, store: Pick<MessageStore, "getMessage">, key: WAMessageKey, to: string) => Promise<WAMessageKey>;
|
|
280
|
+
|
|
281
|
+
interface UsernameResolveSocketLike {
|
|
282
|
+
onWhatsApp(...phoneNumber: string[]): Promise<Array<{
|
|
283
|
+
jid: string;
|
|
284
|
+
exists: boolean;
|
|
285
|
+
}> | undefined>;
|
|
930
286
|
}
|
|
931
|
-
declare
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
287
|
+
declare const isJid: (value: string) => boolean;
|
|
288
|
+
declare const resolveUsername: (socket: UsernameResolveSocketLike, username: string, cache: Map<string, string>, inflight?: Map<string, Promise<string>>) => Promise<string>;
|
|
289
|
+
|
|
290
|
+
interface ParticipantUpdateResult {
|
|
291
|
+
jid: string;
|
|
292
|
+
status: string;
|
|
293
|
+
}
|
|
294
|
+
interface PrivacyConfig {
|
|
295
|
+
lastSeen?: WAPrivacyValue;
|
|
296
|
+
online?: WAPrivacyOnlineValue;
|
|
297
|
+
profile?: WAPrivacyValue;
|
|
298
|
+
status?: WAPrivacyValue;
|
|
299
|
+
readReceipts?: WAReadReceiptsValue;
|
|
300
|
+
groupAdd?: WAPrivacyGroupAddValue;
|
|
301
|
+
}
|
|
302
|
+
type PrivacySettings = {
|
|
303
|
+
[key: string]: string;
|
|
304
|
+
};
|
|
305
|
+
interface LinkedGroup {
|
|
306
|
+
id?: string;
|
|
307
|
+
subject: string;
|
|
308
|
+
creation?: number;
|
|
309
|
+
owner?: string;
|
|
310
|
+
size?: number;
|
|
935
311
|
}
|
|
936
312
|
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
inviteCode(roomId: string, type: 'code' | 'revoke' | 'accept' | 'info'): Promise<string | baileys.GroupMetadata>;
|
|
950
|
-
metadata(roomId: string): Promise<any>;
|
|
951
|
-
requestJoin(roomId: string, participants: string[], type: 'approve' | 'reject'): Promise<{
|
|
313
|
+
type DomainErrorCode = 'NOT_CONNECTED' | 'GROUP_NOT_FOUND' | 'NEWSLETTER_NOT_FOUND' | 'INVALID_PARTICIPANT' | 'OPERATION_FAILED';
|
|
314
|
+
declare class ZaileysDomainError extends Error {
|
|
315
|
+
readonly code: DomainErrorCode;
|
|
316
|
+
readonly cause?: unknown;
|
|
317
|
+
constructor(code: DomainErrorCode, message: string, options?: {
|
|
318
|
+
cause?: unknown;
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
interface DomainSocketLike {
|
|
323
|
+
groupCreate(subject: string, participants: string[]): Promise<GroupMetadata>;
|
|
324
|
+
groupParticipantsUpdate(jid: string, participants: string[], action: ParticipantAction): Promise<{
|
|
952
325
|
status: string;
|
|
953
|
-
jid: string
|
|
954
|
-
|
|
955
|
-
requestJoinList(roomId: string): Promise<{
|
|
956
|
-
[key: string]: string;
|
|
326
|
+
jid: string;
|
|
327
|
+
content?: unknown;
|
|
957
328
|
}[]>;
|
|
958
|
-
|
|
959
|
-
|
|
329
|
+
groupUpdateSubject(jid: string, subject: string): Promise<void>;
|
|
330
|
+
groupUpdateDescription(jid: string, description?: string): Promise<void>;
|
|
331
|
+
groupLeave(id: string): Promise<void>;
|
|
332
|
+
groupMetadata(jid: string): Promise<GroupMetadata>;
|
|
333
|
+
groupInviteCode(jid: string): Promise<string | undefined>;
|
|
334
|
+
groupRevokeInvite(jid: string): Promise<string | undefined>;
|
|
335
|
+
groupAcceptInvite(code: string): Promise<string | undefined>;
|
|
336
|
+
groupToggleEphemeral(jid: string, ephemeralExpiration: number): Promise<void>;
|
|
337
|
+
groupSettingUpdate(jid: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked'): Promise<void>;
|
|
338
|
+
updateMemberLabel(jid: string, memberLabel: string): Promise<unknown>;
|
|
339
|
+
updateLastSeenPrivacy(value: WAPrivacyValue): Promise<void>;
|
|
340
|
+
updateOnlinePrivacy(value: WAPrivacyOnlineValue): Promise<void>;
|
|
341
|
+
updateProfilePicturePrivacy(value: WAPrivacyValue): Promise<void>;
|
|
342
|
+
updateStatusPrivacy(value: WAPrivacyValue): Promise<void>;
|
|
343
|
+
updateReadReceiptsPrivacy(value: WAReadReceiptsValue): Promise<void>;
|
|
344
|
+
updateGroupsAddPrivacy(value: WAPrivacyGroupAddValue): Promise<void>;
|
|
345
|
+
updateDefaultDisappearingMode(duration: number): Promise<void>;
|
|
346
|
+
fetchPrivacySettings(force?: boolean): Promise<{
|
|
347
|
+
[_: string]: string;
|
|
960
348
|
}>;
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
349
|
+
updateBlockStatus(jid: string, action: 'block' | 'unblock'): Promise<void>;
|
|
350
|
+
fetchBlocklist(): Promise<string[]>;
|
|
351
|
+
newsletterCreate(name: string, description?: string): Promise<NewsletterMetadata>;
|
|
352
|
+
newsletterFollow(jid: string): Promise<unknown>;
|
|
353
|
+
newsletterUnfollow(jid: string): Promise<unknown>;
|
|
354
|
+
newsletterMetadata(type: 'invite' | 'jid', key: string): Promise<NewsletterMetadata | null>;
|
|
355
|
+
newsletterUpdateName(jid: string, name: string): Promise<unknown>;
|
|
356
|
+
newsletterUpdateDescription(jid: string, description: string): Promise<unknown>;
|
|
357
|
+
newsletterUpdatePicture(jid: string, content: WAMediaUpload): Promise<unknown>;
|
|
358
|
+
newsletterMute(jid: string): Promise<unknown>;
|
|
359
|
+
newsletterUnmute(jid: string): Promise<unknown>;
|
|
360
|
+
newsletterDelete(jid: string): Promise<void>;
|
|
361
|
+
communityCreate(subject: string, body: string): Promise<GroupMetadata>;
|
|
362
|
+
communityCreateGroup(subject: string, participants: string[], parentCommunityJid: string): Promise<GroupMetadata>;
|
|
363
|
+
communityLinkGroup(groupJid: string, parentCommunityJid: string): Promise<void>;
|
|
364
|
+
communityUnlinkGroup(groupJid: string, parentCommunityJid: string): Promise<void>;
|
|
365
|
+
communityFetchLinkedGroups(jid: string): Promise<{
|
|
366
|
+
communityJid: string;
|
|
367
|
+
isCommunity: boolean;
|
|
368
|
+
linkedGroups: LinkedGroup[];
|
|
978
369
|
}>;
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
declare class
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
370
|
+
communityLeave(id: string): Promise<void>;
|
|
371
|
+
communityUpdateSubject(jid: string, subject: string): Promise<void>;
|
|
372
|
+
communityUpdateDescription(jid: string, description?: string): Promise<void>;
|
|
373
|
+
communityInviteCode(jid: string): Promise<string | undefined>;
|
|
374
|
+
communityRevokeInvite(jid: string): Promise<string | undefined>;
|
|
375
|
+
communityAcceptInvite(code: string): Promise<string | undefined>;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
declare class GroupModule {
|
|
379
|
+
private readonly getSocket;
|
|
380
|
+
constructor(getSocket: () => DomainSocketLike | undefined);
|
|
381
|
+
protected requireSocket(): DomainSocketLike;
|
|
382
|
+
private mapParticipants;
|
|
383
|
+
create(subject: string, participants: string[]): Promise<GroupMetadata>;
|
|
384
|
+
addMember(groupId: string, jids: string[]): Promise<ParticipantUpdateResult[]>;
|
|
385
|
+
removeMember(groupId: string, jids: string[]): Promise<ParticipantUpdateResult[]>;
|
|
386
|
+
promote(groupId: string, jids: string[]): Promise<ParticipantUpdateResult[]>;
|
|
387
|
+
demote(groupId: string, jids: string[]): Promise<ParticipantUpdateResult[]>;
|
|
388
|
+
updateSubject(groupId: string, subject: string): Promise<void>;
|
|
389
|
+
updateDescription(groupId: string, description?: string): Promise<void>;
|
|
390
|
+
leave(groupId: string): Promise<void>;
|
|
391
|
+
metadata(groupId: string): Promise<GroupMetadata>;
|
|
392
|
+
tagMember(groupId: string, jid: string, label: string): Promise<void>;
|
|
393
|
+
inviteCode(groupId: string): Promise<string>;
|
|
394
|
+
revokeInvite(groupId: string): Promise<string>;
|
|
395
|
+
acceptInvite(code: string): Promise<string>;
|
|
396
|
+
toggleEphemeral(groupId: string, seconds: number): Promise<void>;
|
|
397
|
+
setting(groupId: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked'): Promise<void>;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
declare class PrivacyModule {
|
|
401
|
+
private readonly getSocket;
|
|
402
|
+
constructor(getSocket: () => DomainSocketLike | undefined);
|
|
403
|
+
protected requireSocket(): DomainSocketLike;
|
|
404
|
+
set(config: PrivacyConfig & {
|
|
405
|
+
readReceipts?: WAReadReceiptsValue | boolean;
|
|
406
|
+
}): Promise<void>;
|
|
407
|
+
get(): Promise<PrivacySettings>;
|
|
408
|
+
block(jid: string): Promise<void>;
|
|
409
|
+
unblock(jid: string): Promise<void>;
|
|
1005
410
|
blocklist(): Promise<string[]>;
|
|
1006
|
-
|
|
1007
|
-
|
|
411
|
+
disappearingMode(seconds: number): Promise<void>;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
declare class NewsletterModule {
|
|
415
|
+
private readonly getSocket;
|
|
416
|
+
constructor(getSocket: () => DomainSocketLike | undefined);
|
|
417
|
+
protected requireSocket(): DomainSocketLike;
|
|
418
|
+
create(name: string, opts?: {
|
|
419
|
+
description?: string;
|
|
420
|
+
picture?: Buffer;
|
|
421
|
+
}): Promise<NewsletterMetadata>;
|
|
422
|
+
follow(jid: string): Promise<void>;
|
|
423
|
+
unfollow(jid: string): Promise<void>;
|
|
424
|
+
metadata(jid: string): Promise<NewsletterMetadata>;
|
|
425
|
+
updateName(jid: string, name: string): Promise<void>;
|
|
426
|
+
updateDescription(jid: string, description: string): Promise<void>;
|
|
427
|
+
updatePicture(jid: string, picture: Buffer): Promise<void>;
|
|
428
|
+
mute(jid: string): Promise<void>;
|
|
429
|
+
unmute(jid: string): Promise<void>;
|
|
430
|
+
delete(jid: string): Promise<void>;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
declare class CommunityModule {
|
|
434
|
+
private readonly getSocket;
|
|
435
|
+
constructor(getSocket: () => DomainSocketLike | undefined);
|
|
436
|
+
protected requireSocket(): DomainSocketLike;
|
|
437
|
+
create(subject: string, body: string): Promise<GroupMetadata>;
|
|
438
|
+
createGroup(subject: string, participants: string[], communityId: string): Promise<GroupMetadata>;
|
|
439
|
+
linkGroup(communityId: string, groupId: string): Promise<void>;
|
|
440
|
+
unlinkGroup(communityId: string, groupId: string): Promise<void>;
|
|
441
|
+
subGroups(communityId: string): Promise<LinkedGroup[]>;
|
|
442
|
+
leave(communityId: string): Promise<void>;
|
|
443
|
+
updateSubject(communityId: string, subject: string): Promise<void>;
|
|
444
|
+
updateDescription(communityId: string, description?: string): Promise<void>;
|
|
445
|
+
inviteCode(communityId: string): Promise<string | undefined>;
|
|
446
|
+
revokeInvite(communityId: string): Promise<string | undefined>;
|
|
447
|
+
acceptInvite(code: string): Promise<string | undefined>;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
interface SenderInfo {
|
|
451
|
+
jid: string;
|
|
452
|
+
lid?: string;
|
|
453
|
+
pn?: string;
|
|
454
|
+
username?: string;
|
|
455
|
+
pushName?: string;
|
|
456
|
+
isMe?: boolean;
|
|
457
|
+
}
|
|
458
|
+
interface GroupParticipantInfo {
|
|
459
|
+
jid: string;
|
|
460
|
+
participantAlt?: string;
|
|
461
|
+
authorPn?: string;
|
|
462
|
+
authorUsername?: string;
|
|
463
|
+
isAdmin?: boolean;
|
|
464
|
+
}
|
|
465
|
+
interface QuotedRef {
|
|
466
|
+
key: WAMessageKey;
|
|
467
|
+
content?: string;
|
|
468
|
+
sender?: SenderInfo;
|
|
469
|
+
}
|
|
470
|
+
type MediaKind = 'image' | 'video' | 'audio' | 'document' | 'sticker';
|
|
471
|
+
interface MediaDownloadResult {
|
|
472
|
+
buffer: Buffer;
|
|
473
|
+
mime: string;
|
|
474
|
+
size: number;
|
|
475
|
+
}
|
|
476
|
+
interface MediaDescriptor {
|
|
477
|
+
mimetype: string;
|
|
478
|
+
size?: number;
|
|
479
|
+
caption?: string;
|
|
480
|
+
fileName?: string;
|
|
481
|
+
ptt?: boolean;
|
|
482
|
+
}
|
|
483
|
+
interface ReactionPayload {
|
|
484
|
+
key: WAMessageKey;
|
|
485
|
+
emoji: string | null;
|
|
486
|
+
sender: SenderInfo;
|
|
487
|
+
timestamp: number;
|
|
488
|
+
}
|
|
489
|
+
interface EditPayload {
|
|
490
|
+
key: WAMessageKey;
|
|
491
|
+
newContent: string;
|
|
492
|
+
editedAt: number;
|
|
493
|
+
sender: SenderInfo;
|
|
494
|
+
}
|
|
495
|
+
interface DeletePayload {
|
|
496
|
+
key: WAMessageKey;
|
|
497
|
+
deletedFor: 'everyone' | 'me';
|
|
498
|
+
sender: SenderInfo;
|
|
499
|
+
timestamp: number;
|
|
500
|
+
}
|
|
501
|
+
interface PollVotePayload {
|
|
502
|
+
pollKey: WAMessageKey;
|
|
503
|
+
selectedOptions: string[];
|
|
504
|
+
voter: SenderInfo;
|
|
505
|
+
timestamp: number;
|
|
506
|
+
}
|
|
507
|
+
interface ButtonClickPayload {
|
|
508
|
+
key: WAMessageKey;
|
|
509
|
+
buttonId: string;
|
|
510
|
+
buttonText?: string;
|
|
511
|
+
sender: SenderInfo;
|
|
512
|
+
timestamp: number;
|
|
513
|
+
}
|
|
514
|
+
interface ListSelectPayload {
|
|
515
|
+
key: WAMessageKey;
|
|
516
|
+
rowId: string;
|
|
517
|
+
title?: string;
|
|
518
|
+
sender: SenderInfo;
|
|
519
|
+
timestamp: number;
|
|
520
|
+
}
|
|
521
|
+
interface GroupUpdatePayload {
|
|
522
|
+
groupId: string;
|
|
523
|
+
update: Partial<{
|
|
524
|
+
subject: string;
|
|
525
|
+
description: string;
|
|
526
|
+
announce: boolean;
|
|
527
|
+
restrict: boolean;
|
|
528
|
+
ephemeralDuration: number;
|
|
1008
529
|
}>;
|
|
530
|
+
timestamp: number;
|
|
531
|
+
}
|
|
532
|
+
interface GroupJoinPayload {
|
|
533
|
+
groupId: string;
|
|
534
|
+
participants: GroupParticipantInfo[];
|
|
535
|
+
action: 'add' | 'invite' | 'invite-link';
|
|
536
|
+
by?: string;
|
|
537
|
+
timestamp: number;
|
|
538
|
+
}
|
|
539
|
+
interface GroupLeavePayload {
|
|
540
|
+
groupId: string;
|
|
541
|
+
participants: GroupParticipantInfo[];
|
|
542
|
+
action: 'remove' | 'leave';
|
|
543
|
+
by?: string;
|
|
544
|
+
timestamp: number;
|
|
545
|
+
}
|
|
546
|
+
interface MemberTagPayload {
|
|
547
|
+
groupId: string;
|
|
548
|
+
participant: string;
|
|
549
|
+
participantAlt?: string;
|
|
550
|
+
label: string;
|
|
551
|
+
timestamp: number;
|
|
552
|
+
}
|
|
553
|
+
type CallPayload = (CallBase & {
|
|
554
|
+
kind: 'incoming';
|
|
555
|
+
}) | (CallBase & {
|
|
556
|
+
kind: 'ended';
|
|
557
|
+
});
|
|
558
|
+
interface CallBase {
|
|
559
|
+
callId: string;
|
|
560
|
+
from: string;
|
|
561
|
+
isGroup: boolean;
|
|
562
|
+
isVideo: boolean;
|
|
563
|
+
timestamp: number;
|
|
564
|
+
status?: string;
|
|
1009
565
|
}
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
readonly offline: v.BooleanSchema<undefined>;
|
|
1023
|
-
readonly status: v.PicklistSchema<["accept", "offer", "reject", "ringing", "terminate", "timeout"], undefined>;
|
|
1024
|
-
readonly isVideo: v.BooleanSchema<undefined>;
|
|
1025
|
-
readonly isGroup: v.BooleanSchema<undefined>;
|
|
1026
|
-
}, undefined>;
|
|
1027
|
-
type CallsContext = v.InferOutput<typeof ListenerCallsType>;
|
|
1028
|
-
|
|
1029
|
-
declare const ListenerConnectionType: v.ObjectSchema<{
|
|
1030
|
-
readonly status: v.PicklistSchema<["connecting", "open", "close", "reload", "syncing"], undefined>;
|
|
1031
|
-
readonly authType: v.PicklistSchema<["pairing", "qr"], undefined>;
|
|
1032
|
-
readonly authTimeout: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
1033
|
-
readonly syncProgress: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
1034
|
-
readonly syncCompleted: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
1035
|
-
readonly qr: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1036
|
-
readonly code: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1037
|
-
}, undefined>;
|
|
1038
|
-
type ConnectionContext = v.InferOutput<typeof ListenerConnectionType>;
|
|
1039
|
-
|
|
1040
|
-
declare const DEVICE_ENUM_TYPES: v.PicklistSchema<["unknown", "android", "ios", "desktop", "web"], undefined>;
|
|
1041
|
-
declare const MESSAGE_ENUM_TYPES: v.PicklistSchema<["text", "album", "image", "contact", "location", "document", "audio", "video", "protocol", "contacts", "highlyStructured", "sendPayment", "requestPayment", "groupStatusMention", "statusMention", "declinePaymentRequest", "cancelPaymentRequest", "template", "sticker", "groupInvite", "product", "deviceSent", "lists", "viewOnce", "order", "ephemeral", "invoice", "buttons", "paymentInvite", "interactive", "reaction", "interactiveResponse", "pollCreation", "pollUpdate", "keepInChat", "requestPhoneNumber", "scheduledCallCreation", "groupMentioned", "pinInChat", "scheduledCallEdit", "ptv", "botInvoke", "callLog", "encComment", "bcall", "lottieSticker", "event", "comment", "placeholder", "encEventUpdate"], undefined>;
|
|
1042
|
-
declare const BaseMessagesType: v.ObjectSchema<{
|
|
1043
|
-
readonly channelId: v.StringSchema<undefined>;
|
|
1044
|
-
readonly uniqueId: v.StringSchema<undefined>;
|
|
1045
|
-
readonly chatId: v.StringSchema<undefined>;
|
|
1046
|
-
readonly chatType: v.PicklistSchema<["text", "album", "image", "contact", "location", "document", "audio", "video", "protocol", "contacts", "highlyStructured", "sendPayment", "requestPayment", "groupStatusMention", "statusMention", "declinePaymentRequest", "cancelPaymentRequest", "template", "sticker", "groupInvite", "product", "deviceSent", "lists", "viewOnce", "order", "ephemeral", "invoice", "buttons", "paymentInvite", "interactive", "reaction", "interactiveResponse", "pollCreation", "pollUpdate", "keepInChat", "requestPhoneNumber", "scheduledCallCreation", "groupMentioned", "pinInChat", "scheduledCallEdit", "ptv", "botInvoke", "callLog", "encComment", "bcall", "lottieSticker", "event", "comment", "placeholder", "encEventUpdate"], undefined>;
|
|
1047
|
-
readonly receiverLid: v.StringSchema<undefined>;
|
|
1048
|
-
readonly receiverId: v.StringSchema<undefined>;
|
|
1049
|
-
readonly receiverName: v.StringSchema<undefined>;
|
|
1050
|
-
readonly roomId: v.StringSchema<undefined>;
|
|
1051
|
-
readonly roomLid: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1052
|
-
readonly roomName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1053
|
-
readonly senderLid: v.StringSchema<undefined>;
|
|
1054
|
-
readonly senderId: v.StringSchema<undefined>;
|
|
1055
|
-
readonly senderName: v.StringSchema<undefined>;
|
|
1056
|
-
readonly senderDevice: v.PicklistSchema<["unknown", "android", "ios", "desktop", "web"], undefined>;
|
|
1057
|
-
readonly timestamp: v.NumberSchema<undefined>;
|
|
1058
|
-
readonly text: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1059
|
-
readonly mentions: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
1060
|
-
readonly links: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
1061
|
-
readonly isBot: v.BooleanSchema<undefined>;
|
|
1062
|
-
readonly isFromMe: v.BooleanSchema<undefined>;
|
|
1063
|
-
readonly isPrefix: v.BooleanSchema<undefined>;
|
|
1064
|
-
readonly isSpam: v.BooleanSchema<undefined>;
|
|
1065
|
-
readonly isTagMe: v.BooleanSchema<undefined>;
|
|
1066
|
-
readonly isStatusMention: v.BooleanSchema<undefined>;
|
|
1067
|
-
readonly isGroupStatusMention: v.BooleanSchema<undefined>;
|
|
1068
|
-
readonly isHideTags: v.BooleanSchema<undefined>;
|
|
1069
|
-
readonly isGroup: v.BooleanSchema<undefined>;
|
|
1070
|
-
readonly isNewsletter: v.BooleanSchema<undefined>;
|
|
1071
|
-
readonly isQuestion: v.BooleanSchema<undefined>;
|
|
1072
|
-
readonly isStory: v.BooleanSchema<undefined>;
|
|
1073
|
-
readonly isViewOnce: v.BooleanSchema<undefined>;
|
|
1074
|
-
readonly isEdited: v.BooleanSchema<undefined>;
|
|
1075
|
-
readonly isDeleted: v.BooleanSchema<undefined>;
|
|
1076
|
-
readonly isPinned: v.BooleanSchema<undefined>;
|
|
1077
|
-
readonly isUnPinned: v.BooleanSchema<undefined>;
|
|
1078
|
-
readonly isBroadcast: v.BooleanSchema<undefined>;
|
|
1079
|
-
readonly isEphemeral: v.BooleanSchema<undefined>;
|
|
1080
|
-
readonly isForwarded: v.BooleanSchema<undefined>;
|
|
1081
|
-
readonly citation: v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.CustomSchema<(...args: unknown[]) => Promise<boolean>, undefined>, undefined>, undefined>;
|
|
1082
|
-
readonly media: v.NullableSchema<v.LooseObjectSchema<{
|
|
1083
|
-
readonly buffer: v.CustomSchema<() => Promise<Buffer>, undefined>;
|
|
1084
|
-
readonly stream: v.CustomSchema<() => Promise<Stream>, undefined>;
|
|
1085
|
-
}, undefined>, undefined>;
|
|
1086
|
-
readonly injection: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.AnySchema, undefined>, {}>;
|
|
1087
|
-
readonly message: v.CustomSchema<() => WAMessage, undefined>;
|
|
1088
|
-
}, undefined>;
|
|
1089
|
-
declare const ListenerMessagesType: v.ObjectSchema<{
|
|
1090
|
-
readonly replied: v.NullableSchema<v.ObjectSchema<{
|
|
1091
|
-
readonly channelId: v.StringSchema<undefined>;
|
|
1092
|
-
readonly uniqueId: v.StringSchema<undefined>;
|
|
1093
|
-
readonly chatId: v.StringSchema<undefined>;
|
|
1094
|
-
readonly chatType: v.PicklistSchema<["text", "album", "image", "contact", "location", "document", "audio", "video", "protocol", "contacts", "highlyStructured", "sendPayment", "requestPayment", "groupStatusMention", "statusMention", "declinePaymentRequest", "cancelPaymentRequest", "template", "sticker", "groupInvite", "product", "deviceSent", "lists", "viewOnce", "order", "ephemeral", "invoice", "buttons", "paymentInvite", "interactive", "reaction", "interactiveResponse", "pollCreation", "pollUpdate", "keepInChat", "requestPhoneNumber", "scheduledCallCreation", "groupMentioned", "pinInChat", "scheduledCallEdit", "ptv", "botInvoke", "callLog", "encComment", "bcall", "lottieSticker", "event", "comment", "placeholder", "encEventUpdate"], undefined>;
|
|
1095
|
-
readonly receiverLid: v.StringSchema<undefined>;
|
|
1096
|
-
readonly receiverId: v.StringSchema<undefined>;
|
|
1097
|
-
readonly receiverName: v.StringSchema<undefined>;
|
|
1098
|
-
readonly roomId: v.StringSchema<undefined>;
|
|
1099
|
-
readonly roomLid: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1100
|
-
readonly roomName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1101
|
-
readonly senderLid: v.StringSchema<undefined>;
|
|
1102
|
-
readonly senderId: v.StringSchema<undefined>;
|
|
1103
|
-
readonly senderName: v.StringSchema<undefined>;
|
|
1104
|
-
readonly senderDevice: v.PicklistSchema<["unknown", "android", "ios", "desktop", "web"], undefined>;
|
|
1105
|
-
readonly timestamp: v.NumberSchema<undefined>;
|
|
1106
|
-
readonly text: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1107
|
-
readonly mentions: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
1108
|
-
readonly links: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
1109
|
-
readonly isBot: v.BooleanSchema<undefined>;
|
|
1110
|
-
readonly isFromMe: v.BooleanSchema<undefined>;
|
|
1111
|
-
readonly isPrefix: v.BooleanSchema<undefined>;
|
|
1112
|
-
readonly isSpam: v.BooleanSchema<undefined>;
|
|
1113
|
-
readonly isTagMe: v.BooleanSchema<undefined>;
|
|
1114
|
-
readonly isStatusMention: v.BooleanSchema<undefined>;
|
|
1115
|
-
readonly isGroupStatusMention: v.BooleanSchema<undefined>;
|
|
1116
|
-
readonly isHideTags: v.BooleanSchema<undefined>;
|
|
1117
|
-
readonly isGroup: v.BooleanSchema<undefined>;
|
|
1118
|
-
readonly isNewsletter: v.BooleanSchema<undefined>;
|
|
1119
|
-
readonly isQuestion: v.BooleanSchema<undefined>;
|
|
1120
|
-
readonly isStory: v.BooleanSchema<undefined>;
|
|
1121
|
-
readonly isViewOnce: v.BooleanSchema<undefined>;
|
|
1122
|
-
readonly isEdited: v.BooleanSchema<undefined>;
|
|
1123
|
-
readonly isDeleted: v.BooleanSchema<undefined>;
|
|
1124
|
-
readonly isPinned: v.BooleanSchema<undefined>;
|
|
1125
|
-
readonly isUnPinned: v.BooleanSchema<undefined>;
|
|
1126
|
-
readonly isBroadcast: v.BooleanSchema<undefined>;
|
|
1127
|
-
readonly isEphemeral: v.BooleanSchema<undefined>;
|
|
1128
|
-
readonly isForwarded: v.BooleanSchema<undefined>;
|
|
1129
|
-
readonly citation: v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.CustomSchema<(...args: unknown[]) => Promise<boolean>, undefined>, undefined>, undefined>;
|
|
1130
|
-
readonly media: v.NullableSchema<v.LooseObjectSchema<{
|
|
1131
|
-
readonly buffer: v.CustomSchema<() => Promise<Buffer>, undefined>;
|
|
1132
|
-
readonly stream: v.CustomSchema<() => Promise<Stream>, undefined>;
|
|
1133
|
-
}, undefined>, undefined>;
|
|
1134
|
-
readonly injection: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.AnySchema, undefined>, {}>;
|
|
1135
|
-
readonly message: v.CustomSchema<() => WAMessage, undefined>;
|
|
1136
|
-
}, undefined>, undefined>;
|
|
1137
|
-
readonly channelId: v.StringSchema<undefined>;
|
|
1138
|
-
readonly uniqueId: v.StringSchema<undefined>;
|
|
1139
|
-
readonly chatId: v.StringSchema<undefined>;
|
|
1140
|
-
readonly chatType: v.PicklistSchema<["text", "album", "image", "contact", "location", "document", "audio", "video", "protocol", "contacts", "highlyStructured", "sendPayment", "requestPayment", "groupStatusMention", "statusMention", "declinePaymentRequest", "cancelPaymentRequest", "template", "sticker", "groupInvite", "product", "deviceSent", "lists", "viewOnce", "order", "ephemeral", "invoice", "buttons", "paymentInvite", "interactive", "reaction", "interactiveResponse", "pollCreation", "pollUpdate", "keepInChat", "requestPhoneNumber", "scheduledCallCreation", "groupMentioned", "pinInChat", "scheduledCallEdit", "ptv", "botInvoke", "callLog", "encComment", "bcall", "lottieSticker", "event", "comment", "placeholder", "encEventUpdate"], undefined>;
|
|
1141
|
-
readonly receiverLid: v.StringSchema<undefined>;
|
|
1142
|
-
readonly receiverId: v.StringSchema<undefined>;
|
|
1143
|
-
readonly receiverName: v.StringSchema<undefined>;
|
|
1144
|
-
readonly roomId: v.StringSchema<undefined>;
|
|
1145
|
-
readonly roomLid: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1146
|
-
readonly roomName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1147
|
-
readonly senderLid: v.StringSchema<undefined>;
|
|
1148
|
-
readonly senderId: v.StringSchema<undefined>;
|
|
1149
|
-
readonly senderName: v.StringSchema<undefined>;
|
|
1150
|
-
readonly senderDevice: v.PicklistSchema<["unknown", "android", "ios", "desktop", "web"], undefined>;
|
|
1151
|
-
readonly timestamp: v.NumberSchema<undefined>;
|
|
1152
|
-
readonly text: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1153
|
-
readonly mentions: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
1154
|
-
readonly links: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
1155
|
-
readonly isBot: v.BooleanSchema<undefined>;
|
|
1156
|
-
readonly isFromMe: v.BooleanSchema<undefined>;
|
|
1157
|
-
readonly isPrefix: v.BooleanSchema<undefined>;
|
|
1158
|
-
readonly isSpam: v.BooleanSchema<undefined>;
|
|
1159
|
-
readonly isTagMe: v.BooleanSchema<undefined>;
|
|
1160
|
-
readonly isStatusMention: v.BooleanSchema<undefined>;
|
|
1161
|
-
readonly isGroupStatusMention: v.BooleanSchema<undefined>;
|
|
1162
|
-
readonly isHideTags: v.BooleanSchema<undefined>;
|
|
1163
|
-
readonly isGroup: v.BooleanSchema<undefined>;
|
|
1164
|
-
readonly isNewsletter: v.BooleanSchema<undefined>;
|
|
1165
|
-
readonly isQuestion: v.BooleanSchema<undefined>;
|
|
1166
|
-
readonly isStory: v.BooleanSchema<undefined>;
|
|
1167
|
-
readonly isViewOnce: v.BooleanSchema<undefined>;
|
|
1168
|
-
readonly isEdited: v.BooleanSchema<undefined>;
|
|
1169
|
-
readonly isDeleted: v.BooleanSchema<undefined>;
|
|
1170
|
-
readonly isPinned: v.BooleanSchema<undefined>;
|
|
1171
|
-
readonly isUnPinned: v.BooleanSchema<undefined>;
|
|
1172
|
-
readonly isBroadcast: v.BooleanSchema<undefined>;
|
|
1173
|
-
readonly isEphemeral: v.BooleanSchema<undefined>;
|
|
1174
|
-
readonly isForwarded: v.BooleanSchema<undefined>;
|
|
1175
|
-
readonly citation: v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.CustomSchema<(...args: unknown[]) => Promise<boolean>, undefined>, undefined>, undefined>;
|
|
1176
|
-
readonly media: v.NullableSchema<v.LooseObjectSchema<{
|
|
1177
|
-
readonly buffer: v.CustomSchema<() => Promise<Buffer>, undefined>;
|
|
1178
|
-
readonly stream: v.CustomSchema<() => Promise<Stream>, undefined>;
|
|
1179
|
-
}, undefined>, undefined>;
|
|
1180
|
-
readonly injection: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.AnySchema, undefined>, {}>;
|
|
1181
|
-
readonly message: v.CustomSchema<() => WAMessage, undefined>;
|
|
1182
|
-
}, undefined>;
|
|
1183
|
-
type MessagesContext = v.InferOutput<typeof ListenerMessagesType>;
|
|
1184
|
-
|
|
1185
|
-
declare const LimiterType: v.OptionalSchema<v.ObjectSchema<{
|
|
1186
|
-
readonly maxMessages: v.OptionalSchema<v.NumberSchema<undefined>, 20>;
|
|
1187
|
-
readonly durationMs: v.OptionalSchema<v.NumberSchema<undefined>, 10000>;
|
|
1188
|
-
}, undefined>, undefined>;
|
|
1189
|
-
declare const CitationType: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.CustomSchema<(...args: unknown[]) => Promise<number[]>, undefined>, undefined>, undefined>;
|
|
1190
|
-
declare const FakeReplyType: v.OptionalSchema<v.ObjectSchema<{
|
|
1191
|
-
readonly provider: v.UnionSchema<[v.PicklistSchema<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"], undefined>, v.NumberSchema<undefined>], undefined>;
|
|
1192
|
-
}, undefined>, undefined>;
|
|
1193
|
-
declare const ClientStickerShapeType: v.OptionalSchema<v.PicklistSchema<["default", "rounded", "circle", "oval"], undefined>, "default">;
|
|
1194
|
-
declare const ClientStickerOptionsType: v.OptionalSchema<v.ObjectSchema<{
|
|
1195
|
-
readonly packageName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1196
|
-
readonly authorName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1197
|
-
readonly quality: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
1198
|
-
readonly shape: v.OptionalSchema<v.OptionalSchema<v.PicklistSchema<["default", "rounded", "circle", "oval"], undefined>, "default">, undefined>;
|
|
1199
|
-
}, undefined>, undefined>;
|
|
1200
|
-
declare const autoCleanUp: v.OptionalSchema<v.ObjectSchema<{
|
|
1201
|
-
readonly enabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
1202
|
-
readonly intervalMs: v.OptionalSchema<v.NumberSchema<undefined>, number>;
|
|
1203
|
-
readonly maxAgeMs: v.OptionalSchema<v.NumberSchema<undefined>, number>;
|
|
1204
|
-
readonly scopes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly ["messages"]>;
|
|
1205
|
-
}, undefined>, undefined>;
|
|
1206
|
-
declare const ClientBaseType: v.ObjectSchema<{
|
|
1207
|
-
readonly session: v.OptionalSchema<v.StringSchema<undefined>, "zaileys">;
|
|
1208
|
-
readonly prefix: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.ArraySchema<v.StringSchema<undefined>, undefined>], undefined>, undefined>;
|
|
1209
|
-
readonly ignoreMe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1210
|
-
readonly showLogs: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1211
|
-
readonly fancyLogs: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
1212
|
-
readonly syncFullHistory: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1213
|
-
readonly disableFFmpeg: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
1214
|
-
readonly autoMarkAI: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1215
|
-
readonly autoMentions: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1216
|
-
readonly autoOnline: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1217
|
-
readonly autoRead: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1218
|
-
readonly autoPresence: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1219
|
-
readonly autoRejectCall: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1220
|
-
readonly showSpinner: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1221
|
-
readonly maxReplies: v.OptionalSchema<v.NumberSchema<undefined>, 3>;
|
|
1222
|
-
readonly deleteSessionOnLogout: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
1223
|
-
readonly pluginsDir: v.OptionalSchema<v.StringSchema<undefined>, "plugins">;
|
|
1224
|
-
readonly pluginsHmr: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1225
|
-
readonly autoCleanUp: v.OptionalSchema<v.ObjectSchema<{
|
|
1226
|
-
readonly enabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
1227
|
-
readonly intervalMs: v.OptionalSchema<v.NumberSchema<undefined>, number>;
|
|
1228
|
-
readonly maxAgeMs: v.OptionalSchema<v.NumberSchema<undefined>, number>;
|
|
1229
|
-
readonly scopes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly ["messages"]>;
|
|
1230
|
-
}, undefined>, undefined>;
|
|
1231
|
-
readonly limiter: v.OptionalSchema<v.ObjectSchema<{
|
|
1232
|
-
readonly maxMessages: v.OptionalSchema<v.NumberSchema<undefined>, 20>;
|
|
1233
|
-
readonly durationMs: v.OptionalSchema<v.NumberSchema<undefined>, 10000>;
|
|
1234
|
-
}, undefined>, undefined>;
|
|
1235
|
-
readonly citation: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.CustomSchema<(...args: unknown[]) => Promise<number[]>, undefined>, undefined>, undefined>;
|
|
1236
|
-
readonly fakeReply: v.OptionalSchema<v.ObjectSchema<{
|
|
1237
|
-
readonly provider: v.UnionSchema<[v.PicklistSchema<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"], undefined>, v.NumberSchema<undefined>], undefined>;
|
|
1238
|
-
}, undefined>, undefined>;
|
|
1239
|
-
readonly sticker: v.OptionalSchema<v.ObjectSchema<{
|
|
1240
|
-
readonly packageName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1241
|
-
readonly authorName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1242
|
-
readonly quality: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
1243
|
-
readonly shape: v.OptionalSchema<v.OptionalSchema<v.PicklistSchema<["default", "rounded", "circle", "oval"], undefined>, "default">, undefined>;
|
|
1244
|
-
}, undefined>, undefined>;
|
|
1245
|
-
}, undefined>;
|
|
1246
|
-
declare const ClientAuthPairingType: v.ObjectSchema<{
|
|
1247
|
-
readonly authType: v.LiteralSchema<"pairing", undefined>;
|
|
1248
|
-
readonly phoneNumber: v.NumberSchema<undefined>;
|
|
1249
|
-
}, undefined>;
|
|
1250
|
-
declare const ClientAuthQRType: v.ObjectSchema<{
|
|
1251
|
-
readonly authType: v.LiteralSchema<"qr", undefined>;
|
|
1252
|
-
}, undefined>;
|
|
1253
|
-
declare const ClientOptionsType: v.UnionSchema<[v.ObjectSchema<{
|
|
1254
|
-
readonly session: v.OptionalSchema<v.StringSchema<undefined>, "zaileys">;
|
|
1255
|
-
readonly prefix: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.ArraySchema<v.StringSchema<undefined>, undefined>], undefined>, undefined>;
|
|
1256
|
-
readonly ignoreMe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1257
|
-
readonly showLogs: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1258
|
-
readonly fancyLogs: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
1259
|
-
readonly syncFullHistory: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1260
|
-
readonly disableFFmpeg: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
1261
|
-
readonly autoMarkAI: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1262
|
-
readonly autoMentions: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1263
|
-
readonly autoOnline: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1264
|
-
readonly autoRead: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1265
|
-
readonly autoPresence: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1266
|
-
readonly autoRejectCall: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1267
|
-
readonly showSpinner: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1268
|
-
readonly maxReplies: v.OptionalSchema<v.NumberSchema<undefined>, 3>;
|
|
1269
|
-
readonly deleteSessionOnLogout: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
1270
|
-
readonly pluginsDir: v.OptionalSchema<v.StringSchema<undefined>, "plugins">;
|
|
1271
|
-
readonly pluginsHmr: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1272
|
-
readonly autoCleanUp: v.OptionalSchema<v.ObjectSchema<{
|
|
1273
|
-
readonly enabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
1274
|
-
readonly intervalMs: v.OptionalSchema<v.NumberSchema<undefined>, number>;
|
|
1275
|
-
readonly maxAgeMs: v.OptionalSchema<v.NumberSchema<undefined>, number>;
|
|
1276
|
-
readonly scopes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly ["messages"]>;
|
|
1277
|
-
}, undefined>, undefined>;
|
|
1278
|
-
readonly limiter: v.OptionalSchema<v.ObjectSchema<{
|
|
1279
|
-
readonly maxMessages: v.OptionalSchema<v.NumberSchema<undefined>, 20>;
|
|
1280
|
-
readonly durationMs: v.OptionalSchema<v.NumberSchema<undefined>, 10000>;
|
|
1281
|
-
}, undefined>, undefined>;
|
|
1282
|
-
readonly citation: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.CustomSchema<(...args: unknown[]) => Promise<number[]>, undefined>, undefined>, undefined>;
|
|
1283
|
-
readonly fakeReply: v.OptionalSchema<v.ObjectSchema<{
|
|
1284
|
-
readonly provider: v.UnionSchema<[v.PicklistSchema<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"], undefined>, v.NumberSchema<undefined>], undefined>;
|
|
1285
|
-
}, undefined>, undefined>;
|
|
1286
|
-
readonly sticker: v.OptionalSchema<v.ObjectSchema<{
|
|
1287
|
-
readonly packageName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1288
|
-
readonly authorName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1289
|
-
readonly quality: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
1290
|
-
readonly shape: v.OptionalSchema<v.OptionalSchema<v.PicklistSchema<["default", "rounded", "circle", "oval"], undefined>, "default">, undefined>;
|
|
1291
|
-
}, undefined>, undefined>;
|
|
1292
|
-
readonly authType: v.LiteralSchema<"pairing", undefined>;
|
|
1293
|
-
readonly phoneNumber: v.NumberSchema<undefined>;
|
|
1294
|
-
}, undefined>, v.ObjectSchema<{
|
|
1295
|
-
readonly session: v.OptionalSchema<v.StringSchema<undefined>, "zaileys">;
|
|
1296
|
-
readonly prefix: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.ArraySchema<v.StringSchema<undefined>, undefined>], undefined>, undefined>;
|
|
1297
|
-
readonly ignoreMe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1298
|
-
readonly showLogs: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1299
|
-
readonly fancyLogs: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
1300
|
-
readonly syncFullHistory: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1301
|
-
readonly disableFFmpeg: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
1302
|
-
readonly autoMarkAI: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1303
|
-
readonly autoMentions: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1304
|
-
readonly autoOnline: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1305
|
-
readonly autoRead: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1306
|
-
readonly autoPresence: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1307
|
-
readonly autoRejectCall: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1308
|
-
readonly showSpinner: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1309
|
-
readonly maxReplies: v.OptionalSchema<v.NumberSchema<undefined>, 3>;
|
|
1310
|
-
readonly deleteSessionOnLogout: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
1311
|
-
readonly pluginsDir: v.OptionalSchema<v.StringSchema<undefined>, "plugins">;
|
|
1312
|
-
readonly pluginsHmr: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
1313
|
-
readonly autoCleanUp: v.OptionalSchema<v.ObjectSchema<{
|
|
1314
|
-
readonly enabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
1315
|
-
readonly intervalMs: v.OptionalSchema<v.NumberSchema<undefined>, number>;
|
|
1316
|
-
readonly maxAgeMs: v.OptionalSchema<v.NumberSchema<undefined>, number>;
|
|
1317
|
-
readonly scopes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly ["messages"]>;
|
|
1318
|
-
}, undefined>, undefined>;
|
|
1319
|
-
readonly limiter: v.OptionalSchema<v.ObjectSchema<{
|
|
1320
|
-
readonly maxMessages: v.OptionalSchema<v.NumberSchema<undefined>, 20>;
|
|
1321
|
-
readonly durationMs: v.OptionalSchema<v.NumberSchema<undefined>, 10000>;
|
|
1322
|
-
}, undefined>, undefined>;
|
|
1323
|
-
readonly citation: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.CustomSchema<(...args: unknown[]) => Promise<number[]>, undefined>, undefined>, undefined>;
|
|
1324
|
-
readonly fakeReply: v.OptionalSchema<v.ObjectSchema<{
|
|
1325
|
-
readonly provider: v.UnionSchema<[v.PicklistSchema<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"], undefined>, v.NumberSchema<undefined>], undefined>;
|
|
1326
|
-
}, undefined>, undefined>;
|
|
1327
|
-
readonly sticker: v.OptionalSchema<v.ObjectSchema<{
|
|
1328
|
-
readonly packageName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1329
|
-
readonly authorName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1330
|
-
readonly quality: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
1331
|
-
readonly shape: v.OptionalSchema<v.OptionalSchema<v.PicklistSchema<["default", "rounded", "circle", "oval"], undefined>, "default">, undefined>;
|
|
1332
|
-
}, undefined>, undefined>;
|
|
1333
|
-
readonly authType: v.LiteralSchema<"qr", undefined>;
|
|
1334
|
-
}, undefined>], undefined>;
|
|
1335
|
-
declare const EventEnumType: v.PicklistSchema<["connection", "messages", "calls"], undefined>;
|
|
1336
|
-
type EventCallbackType = {
|
|
1337
|
-
connection: (ctx: ConnectionContext) => void;
|
|
1338
|
-
messages: (ctx: MessagesContext) => void;
|
|
1339
|
-
calls: (ctx: CallsContext) => void;
|
|
566
|
+
interface HistorySyncPayload {
|
|
567
|
+
syncType: string;
|
|
568
|
+
status: 'complete' | 'paused';
|
|
569
|
+
explicit: boolean;
|
|
570
|
+
}
|
|
571
|
+
type LimitedPayload = {
|
|
572
|
+
reason: 'reachout-timelock';
|
|
573
|
+
retryAt: number;
|
|
574
|
+
} | {
|
|
575
|
+
reason: 'chat-limit-reached';
|
|
576
|
+
usedQuota?: number;
|
|
577
|
+
totalQuota?: number;
|
|
1340
578
|
};
|
|
579
|
+
interface PresencePayload {
|
|
580
|
+
jid: string;
|
|
581
|
+
participant?: string;
|
|
582
|
+
status: 'available' | 'unavailable' | 'composing' | 'recording' | 'paused';
|
|
583
|
+
}
|
|
584
|
+
type NewsletterPayload = {
|
|
585
|
+
newsletterId: string;
|
|
586
|
+
timestamp: number;
|
|
587
|
+
} & ({
|
|
588
|
+
action: 'reaction';
|
|
589
|
+
serverId?: string;
|
|
590
|
+
emoji?: string;
|
|
591
|
+
} | {
|
|
592
|
+
action: 'view';
|
|
593
|
+
serverId?: string;
|
|
594
|
+
count?: number;
|
|
595
|
+
} | {
|
|
596
|
+
action: 'participants';
|
|
597
|
+
count?: number;
|
|
598
|
+
} | {
|
|
599
|
+
action: 'settings';
|
|
600
|
+
update?: Record<string, unknown>;
|
|
601
|
+
});
|
|
602
|
+
type InboundEventMap = {
|
|
603
|
+
text: MessageContext;
|
|
604
|
+
image: MessageContext;
|
|
605
|
+
video: MessageContext;
|
|
606
|
+
audio: MessageContext;
|
|
607
|
+
document: MessageContext;
|
|
608
|
+
sticker: MessageContext;
|
|
609
|
+
reaction: ReactionPayload;
|
|
610
|
+
edit: EditPayload;
|
|
611
|
+
delete: DeletePayload;
|
|
612
|
+
'poll-vote': PollVotePayload;
|
|
613
|
+
'button-click': ButtonClickPayload;
|
|
614
|
+
'list-select': ListSelectPayload;
|
|
615
|
+
mention: MentionContext;
|
|
616
|
+
'mention-all': MentionAllContext;
|
|
617
|
+
'group-update': GroupUpdatePayload;
|
|
618
|
+
'group-join': GroupJoinPayload;
|
|
619
|
+
'group-leave': GroupLeavePayload;
|
|
620
|
+
'member-tag': MemberTagPayload;
|
|
621
|
+
'call-incoming': Extract<CallPayload, {
|
|
622
|
+
kind: 'incoming';
|
|
623
|
+
}>;
|
|
624
|
+
'call-ended': Extract<CallPayload, {
|
|
625
|
+
kind: 'ended';
|
|
626
|
+
}>;
|
|
627
|
+
'history-sync': HistorySyncPayload;
|
|
628
|
+
limited: LimitedPayload;
|
|
629
|
+
presence: PresencePayload;
|
|
630
|
+
newsletter: NewsletterPayload;
|
|
631
|
+
};
|
|
632
|
+
type InboundEventName = keyof InboundEventMap;
|
|
633
|
+
|
|
634
|
+
type ChatType = 'text' | 'image' | 'video' | 'audio' | 'document' | 'sticker' | 'unknown';
|
|
635
|
+
type SenderDevice = 'unknown' | 'android' | 'ios' | 'web' | 'desktop' | string;
|
|
636
|
+
interface CitationConfig {
|
|
637
|
+
authors?: string[] | ((jid: string) => boolean | Promise<boolean>);
|
|
638
|
+
banned?: string[] | ((jid: string) => boolean | Promise<boolean>);
|
|
639
|
+
}
|
|
640
|
+
interface CitationPredicates {
|
|
641
|
+
authors(): Promise<boolean>;
|
|
642
|
+
banned(): Promise<boolean>;
|
|
643
|
+
}
|
|
644
|
+
interface ContextMedia {
|
|
645
|
+
buffer(): Promise<Buffer>;
|
|
646
|
+
stream(): Promise<Readable>;
|
|
647
|
+
}
|
|
648
|
+
interface MessageContext {
|
|
649
|
+
uniqueId: string;
|
|
650
|
+
channelId: string;
|
|
651
|
+
chatId: string;
|
|
652
|
+
chatType: ChatType;
|
|
653
|
+
receiverId: string;
|
|
654
|
+
roomId: string | null;
|
|
655
|
+
senderId: string;
|
|
656
|
+
senderLid: string | null;
|
|
657
|
+
senderName: string | null;
|
|
658
|
+
senderDevice: SenderDevice;
|
|
659
|
+
timestamp: number;
|
|
660
|
+
text: string;
|
|
661
|
+
mentions: string[];
|
|
662
|
+
links: string[];
|
|
663
|
+
isFromMe: boolean;
|
|
664
|
+
isGroup: boolean;
|
|
665
|
+
isNewsletter: boolean;
|
|
666
|
+
isBroadcast: boolean;
|
|
667
|
+
isViewOnce: boolean;
|
|
668
|
+
isEphemeral: boolean;
|
|
669
|
+
isForwarded: boolean;
|
|
670
|
+
isQuestion: boolean;
|
|
671
|
+
isPrefix: boolean;
|
|
672
|
+
isTagMe: boolean;
|
|
673
|
+
isEdited: boolean;
|
|
674
|
+
isDeleted: boolean;
|
|
675
|
+
isPinned: boolean;
|
|
676
|
+
isUnPinned: boolean;
|
|
677
|
+
isBot: boolean;
|
|
678
|
+
isSpam: boolean;
|
|
679
|
+
isHideTags: boolean;
|
|
680
|
+
isStatusMention: boolean;
|
|
681
|
+
isGroupStatusMention: boolean;
|
|
682
|
+
isStory: boolean;
|
|
683
|
+
roomName(): Promise<string | null>;
|
|
684
|
+
receiverName(): Promise<string | null>;
|
|
685
|
+
media?: ContextMedia;
|
|
686
|
+
replied(): Promise<MessageContext | null>;
|
|
687
|
+
message(): WAMessage;
|
|
688
|
+
citation: CitationPredicates;
|
|
689
|
+
reply(content: string, opts?: TextOptions): Promise<WAMessageKey>;
|
|
690
|
+
react(emoji: string): Promise<WAMessageKey>;
|
|
691
|
+
}
|
|
692
|
+
interface MentionContext extends MessageContext {
|
|
693
|
+
mentionedJids: string[];
|
|
694
|
+
selfJid: string;
|
|
695
|
+
}
|
|
696
|
+
interface MentionAllContext extends MessageContext {
|
|
697
|
+
isMentionAll: true;
|
|
698
|
+
selfJid: string;
|
|
699
|
+
members?: string[];
|
|
700
|
+
}
|
|
701
|
+
interface BuildContextInput {
|
|
702
|
+
message: WAMessage;
|
|
703
|
+
key: WAMessageKey;
|
|
704
|
+
channelId: string;
|
|
705
|
+
receiverId: string;
|
|
706
|
+
selfJid: string;
|
|
707
|
+
text: string;
|
|
708
|
+
chatType: ChatType;
|
|
709
|
+
sender: SenderInfo;
|
|
710
|
+
mentions: string[];
|
|
711
|
+
isViewOnce: boolean;
|
|
712
|
+
isEphemeral: boolean;
|
|
713
|
+
isForwarded: boolean;
|
|
714
|
+
isBroadcast: boolean;
|
|
715
|
+
isNewsletter: boolean;
|
|
716
|
+
prefixes: string[];
|
|
717
|
+
citationConfig?: CitationConfig;
|
|
718
|
+
resolveRoomName: () => Promise<string | null>;
|
|
719
|
+
resolveReceiverName: () => Promise<string | null>;
|
|
720
|
+
resolveReplied: () => Promise<MessageContext | null>;
|
|
721
|
+
reply: (content: string, opts?: TextOptions) => Promise<WAMessageKey>;
|
|
722
|
+
react: (emoji: string) => Promise<WAMessageKey>;
|
|
723
|
+
media?: ContextMedia;
|
|
724
|
+
}
|
|
725
|
+
declare const buildMessageContext: (input: BuildContextInput) => MessageContext;
|
|
726
|
+
|
|
727
|
+
type CommandPrefix = string | string[];
|
|
728
|
+
interface ParsedArgs {
|
|
729
|
+
matched: boolean;
|
|
730
|
+
name?: string;
|
|
731
|
+
args: string[];
|
|
732
|
+
flags: Record<string, string | boolean>;
|
|
733
|
+
json: unknown;
|
|
734
|
+
raw: string;
|
|
735
|
+
}
|
|
736
|
+
interface CommandContext extends MessageContext {
|
|
737
|
+
raw: string;
|
|
738
|
+
command: string;
|
|
739
|
+
args: string[];
|
|
740
|
+
flags: Record<string, string | boolean>;
|
|
741
|
+
json: unknown;
|
|
742
|
+
reply(content: string, opts?: TextOptions): Promise<WAMessageKey>;
|
|
743
|
+
react(emoji: string): Promise<WAMessageKey>;
|
|
744
|
+
edit(content: string): Promise<void>;
|
|
745
|
+
}
|
|
746
|
+
type CommandHandler = (ctx: CommandContext) => Promise<void> | void;
|
|
747
|
+
type Middleware = (ctx: CommandContext, next: () => Promise<void>) => Promise<void> | void;
|
|
748
|
+
interface CommandDefinition {
|
|
749
|
+
name: string;
|
|
750
|
+
aliases: string[];
|
|
751
|
+
parts: string[];
|
|
752
|
+
handler: CommandHandler;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
type CommandErrorCode = 'DUPLICATE_COMMAND' | 'INVALID_COMMAND_NAME' | 'HANDLER_ERROR' | 'MIDDLEWARE_ERROR' | 'NO_SENT_MESSAGE' | 'NOT_CONNECTED';
|
|
756
|
+
declare class ZaileysCommandError extends Error {
|
|
757
|
+
readonly code: CommandErrorCode;
|
|
758
|
+
readonly cause?: unknown;
|
|
759
|
+
constructor(code: CommandErrorCode, message: string, options?: {
|
|
760
|
+
cause?: unknown;
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
declare function parseCommand(text: string, prefixes: string[]): ParsedArgs;
|
|
765
|
+
|
|
766
|
+
declare class CommandRegistry {
|
|
767
|
+
private readonly paths;
|
|
768
|
+
private readonly defs;
|
|
769
|
+
private maxDepth;
|
|
770
|
+
register(spec: string, handler: CommandHandler): void;
|
|
771
|
+
resolve(parsed: ParsedArgs): {
|
|
772
|
+
def: CommandDefinition;
|
|
773
|
+
args: string[];
|
|
774
|
+
} | undefined;
|
|
775
|
+
list(): CommandDefinition[];
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
declare function runMiddleware(chain: Middleware[], ctx: CommandContext, final: () => Promise<void> | void): Promise<void>;
|
|
779
|
+
|
|
780
|
+
type AuthStoreKey = keyof SignalDataTypeMap;
|
|
781
|
+
type AuthStoreValue<K extends AuthStoreKey> = SignalDataTypeMap[K];
|
|
782
|
+
interface AuthStore {
|
|
783
|
+
read<K extends AuthStoreKey>(type: K, ids: readonly string[]): Promise<{
|
|
784
|
+
[id: string]: AuthStoreValue<K> | undefined;
|
|
785
|
+
}>;
|
|
786
|
+
write(data: SignalDataSet): Promise<void>;
|
|
787
|
+
delete<K extends AuthStoreKey>(type: K, ids: readonly string[]): Promise<void>;
|
|
788
|
+
clear(): Promise<void>;
|
|
789
|
+
close(): Promise<void>;
|
|
790
|
+
}
|
|
791
|
+
interface AuthCredsStore {
|
|
792
|
+
readCreds(): Promise<AuthenticationCreds | undefined>;
|
|
793
|
+
writeCreds(creds: AuthenticationCreds): Promise<void>;
|
|
794
|
+
deleteCreds(): Promise<void>;
|
|
795
|
+
}
|
|
796
|
+
interface AuthStoreBundle {
|
|
797
|
+
readonly creds: AuthCredsStore;
|
|
798
|
+
readonly signal: AuthStore;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
type DisconnectReasonDomain = 'logged-out' | 'connection-replaced' | 'forbidden' | 'restart-required' | 'bad-session' | 'connection-closed' | 'connection-lost' | 'multi-device-mismatch' | 'unavailable-service' | 'unknown';
|
|
802
|
+
declare function mapDisconnectReason(code: number | undefined): DisconnectReasonDomain;
|
|
803
|
+
declare function isFatalDisconnect(reason: DisconnectReasonDomain): boolean;
|
|
804
|
+
declare function shouldClearAuth(reason: DisconnectReasonDomain): boolean;
|
|
805
|
+
declare function shouldReconnect(reason: DisconnectReasonDomain): boolean;
|
|
1341
806
|
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
}
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
}, undefined>, undefined>;
|
|
1410
|
-
}, undefined>], undefined>, undefined>;
|
|
1411
|
-
}, undefined>;
|
|
1412
|
-
declare const ButtonSimpleType: v.ObjectSchema<{
|
|
1413
|
-
readonly type: v.LiteralSchema<"simple", undefined>;
|
|
1414
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1415
|
-
readonly data: v.ArraySchema<v.ObjectSchema<{
|
|
1416
|
-
readonly id: v.StringSchema<undefined>;
|
|
1417
|
-
readonly text: v.StringSchema<undefined>;
|
|
1418
|
-
}, undefined>, undefined>;
|
|
1419
|
-
}, undefined>;
|
|
1420
|
-
declare const ButtonCarouselCardType: v.ObjectSchema<{
|
|
1421
|
-
readonly body: v.StringSchema<undefined>;
|
|
1422
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1423
|
-
readonly header: v.OptionalSchema<v.ObjectSchema<{
|
|
1424
|
-
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1425
|
-
readonly subtitle: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1426
|
-
readonly hasMediaAttachment: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
1427
|
-
readonly image: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1428
|
-
readonly video: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1429
|
-
}, undefined>, undefined>;
|
|
1430
|
-
readonly nativeFlow: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
1431
|
-
readonly type: v.LiteralSchema<"quick_reply", undefined>;
|
|
1432
|
-
readonly id: v.StringSchema<undefined>;
|
|
1433
|
-
readonly text: v.StringSchema<undefined>;
|
|
1434
|
-
}, undefined>, v.ObjectSchema<{
|
|
1435
|
-
readonly type: v.LiteralSchema<"cta_url", undefined>;
|
|
1436
|
-
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
1437
|
-
readonly text: v.StringSchema<undefined>;
|
|
1438
|
-
}, undefined>, v.ObjectSchema<{
|
|
1439
|
-
readonly type: v.LiteralSchema<"cta_copy", undefined>;
|
|
1440
|
-
readonly id: v.StringSchema<undefined>;
|
|
1441
|
-
readonly copy: v.StringSchema<undefined>;
|
|
1442
|
-
readonly text: v.StringSchema<undefined>;
|
|
1443
|
-
}, undefined>, v.ObjectSchema<{
|
|
1444
|
-
readonly type: v.LiteralSchema<"cta_call", undefined>;
|
|
1445
|
-
readonly text: v.StringSchema<undefined>;
|
|
1446
|
-
readonly phoneNumber: v.StringSchema<undefined>;
|
|
1447
|
-
}, undefined>], undefined>, undefined>;
|
|
1448
|
-
}, undefined>;
|
|
1449
|
-
declare const ButtonCarouselType: v.ObjectSchema<{
|
|
1450
|
-
readonly type: v.LiteralSchema<"carousel", undefined>;
|
|
1451
|
-
readonly data: v.ArraySchema<v.ObjectSchema<{
|
|
1452
|
-
readonly body: v.StringSchema<undefined>;
|
|
1453
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1454
|
-
readonly header: v.OptionalSchema<v.ObjectSchema<{
|
|
1455
|
-
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1456
|
-
readonly subtitle: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1457
|
-
readonly hasMediaAttachment: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
1458
|
-
readonly image: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1459
|
-
readonly video: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1460
|
-
}, undefined>, undefined>;
|
|
1461
|
-
readonly nativeFlow: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
1462
|
-
readonly type: v.LiteralSchema<"quick_reply", undefined>;
|
|
1463
|
-
readonly id: v.StringSchema<undefined>;
|
|
1464
|
-
readonly text: v.StringSchema<undefined>;
|
|
1465
|
-
}, undefined>, v.ObjectSchema<{
|
|
1466
|
-
readonly type: v.LiteralSchema<"cta_url", undefined>;
|
|
1467
|
-
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
1468
|
-
readonly text: v.StringSchema<undefined>;
|
|
1469
|
-
}, undefined>, v.ObjectSchema<{
|
|
1470
|
-
readonly type: v.LiteralSchema<"cta_copy", undefined>;
|
|
1471
|
-
readonly id: v.StringSchema<undefined>;
|
|
1472
|
-
readonly copy: v.StringSchema<undefined>;
|
|
1473
|
-
readonly text: v.StringSchema<undefined>;
|
|
1474
|
-
}, undefined>, v.ObjectSchema<{
|
|
1475
|
-
readonly type: v.LiteralSchema<"cta_call", undefined>;
|
|
1476
|
-
readonly text: v.StringSchema<undefined>;
|
|
1477
|
-
readonly phoneNumber: v.StringSchema<undefined>;
|
|
1478
|
-
}, undefined>], undefined>, undefined>;
|
|
1479
|
-
}, undefined>, undefined>;
|
|
1480
|
-
}, undefined>;
|
|
1481
|
-
declare const ButtonType: v.UnionSchema<[v.ObjectSchema<{
|
|
1482
|
-
readonly type: v.LiteralSchema<"simple", undefined>;
|
|
1483
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1484
|
-
readonly data: v.ArraySchema<v.ObjectSchema<{
|
|
1485
|
-
readonly id: v.StringSchema<undefined>;
|
|
1486
|
-
readonly text: v.StringSchema<undefined>;
|
|
1487
|
-
}, undefined>, undefined>;
|
|
1488
|
-
}, undefined>, v.ObjectSchema<{
|
|
1489
|
-
readonly type: v.LiteralSchema<"interactive", undefined>;
|
|
1490
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1491
|
-
readonly data: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
1492
|
-
readonly type: v.LiteralSchema<"quick_reply", undefined>;
|
|
1493
|
-
readonly id: v.StringSchema<undefined>;
|
|
1494
|
-
readonly text: v.StringSchema<undefined>;
|
|
1495
|
-
}, undefined>, v.ObjectSchema<{
|
|
1496
|
-
readonly type: v.LiteralSchema<"cta_url", undefined>;
|
|
1497
|
-
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
1498
|
-
readonly text: v.StringSchema<undefined>;
|
|
1499
|
-
}, undefined>, v.ObjectSchema<{
|
|
1500
|
-
readonly type: v.LiteralSchema<"cta_copy", undefined>;
|
|
1501
|
-
readonly id: v.StringSchema<undefined>;
|
|
1502
|
-
readonly copy: v.StringSchema<undefined>;
|
|
1503
|
-
readonly text: v.StringSchema<undefined>;
|
|
1504
|
-
}, undefined>, v.ObjectSchema<{
|
|
1505
|
-
readonly type: v.LiteralSchema<"cta_call", undefined>;
|
|
1506
|
-
readonly text: v.StringSchema<undefined>;
|
|
1507
|
-
readonly phoneNumber: v.StringSchema<undefined>;
|
|
1508
|
-
}, undefined>, v.ObjectSchema<{
|
|
1509
|
-
readonly type: v.LiteralSchema<"single_select", undefined>;
|
|
1510
|
-
readonly text: v.StringSchema<undefined>;
|
|
1511
|
-
readonly section: v.ArraySchema<v.ObjectSchema<{
|
|
1512
|
-
readonly title: v.StringSchema<undefined>;
|
|
1513
|
-
readonly highlight_label: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1514
|
-
readonly rows: v.ArraySchema<v.ObjectSchema<{
|
|
1515
|
-
readonly id: v.StringSchema<undefined>;
|
|
1516
|
-
readonly title: v.StringSchema<undefined>;
|
|
1517
|
-
readonly header: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1518
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1519
|
-
}, undefined>, undefined>;
|
|
1520
|
-
}, undefined>, undefined>;
|
|
1521
|
-
}, undefined>], undefined>, undefined>;
|
|
1522
|
-
}, undefined>, v.ObjectSchema<{
|
|
1523
|
-
readonly type: v.LiteralSchema<"carousel", undefined>;
|
|
1524
|
-
readonly data: v.ArraySchema<v.ObjectSchema<{
|
|
1525
|
-
readonly body: v.StringSchema<undefined>;
|
|
1526
|
-
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1527
|
-
readonly header: v.OptionalSchema<v.ObjectSchema<{
|
|
1528
|
-
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1529
|
-
readonly subtitle: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1530
|
-
readonly hasMediaAttachment: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
1531
|
-
readonly image: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1532
|
-
readonly video: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1533
|
-
}, undefined>, undefined>;
|
|
1534
|
-
readonly nativeFlow: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
1535
|
-
readonly type: v.LiteralSchema<"quick_reply", undefined>;
|
|
1536
|
-
readonly id: v.StringSchema<undefined>;
|
|
1537
|
-
readonly text: v.StringSchema<undefined>;
|
|
1538
|
-
}, undefined>, v.ObjectSchema<{
|
|
1539
|
-
readonly type: v.LiteralSchema<"cta_url", undefined>;
|
|
1540
|
-
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
1541
|
-
readonly text: v.StringSchema<undefined>;
|
|
1542
|
-
}, undefined>, v.ObjectSchema<{
|
|
1543
|
-
readonly type: v.LiteralSchema<"cta_copy", undefined>;
|
|
1544
|
-
readonly id: v.StringSchema<undefined>;
|
|
1545
|
-
readonly copy: v.StringSchema<undefined>;
|
|
1546
|
-
readonly text: v.StringSchema<undefined>;
|
|
1547
|
-
}, undefined>, v.ObjectSchema<{
|
|
1548
|
-
readonly type: v.LiteralSchema<"cta_call", undefined>;
|
|
1549
|
-
readonly text: v.StringSchema<undefined>;
|
|
1550
|
-
readonly phoneNumber: v.StringSchema<undefined>;
|
|
1551
|
-
}, undefined>], undefined>, undefined>;
|
|
1552
|
-
}, undefined>, undefined>;
|
|
1553
|
-
}, undefined>], undefined>;
|
|
1554
|
-
|
|
1555
|
-
declare class Logs {
|
|
1556
|
-
private client;
|
|
1557
|
-
private logsInitialized;
|
|
1558
|
-
private logsDisplayed;
|
|
1559
|
-
private isReady;
|
|
1560
|
-
constructor(client: Client);
|
|
1561
|
-
getRoomColor(validator: any): "lime" | "blue" | "orange" | "dimgray";
|
|
1562
|
-
initialize(): void;
|
|
1563
|
-
private displayIndicator;
|
|
1564
|
-
message(message: Partial<MessagesContext>): void;
|
|
1565
|
-
call(call: Partial<CallsContext>): void;
|
|
1566
|
-
}
|
|
1567
|
-
|
|
1568
|
-
type MiddlewareContextType = {
|
|
1569
|
-
messages?: Partial<MessagesContext>;
|
|
1570
|
-
calls?: Partial<CallsContext>;
|
|
807
|
+
type ConnectionState = 'idle' | 'connecting' | 'qr-pending' | 'pairing-pending' | 'connected' | 'reconnecting' | 'disconnecting' | 'disconnected';
|
|
808
|
+
type ConnectionAuthType = 'qr' | 'pairing';
|
|
809
|
+
interface Logger {
|
|
810
|
+
debug(...args: unknown[]): void;
|
|
811
|
+
info(...args: unknown[]): void;
|
|
812
|
+
warn(...args: unknown[]): void;
|
|
813
|
+
error(...args: unknown[]): void;
|
|
814
|
+
fatal(...args: unknown[]): void;
|
|
815
|
+
}
|
|
816
|
+
interface ReconnectOptions {
|
|
817
|
+
enabled?: boolean;
|
|
818
|
+
maxAttempts?: number;
|
|
819
|
+
initialDelayMs?: number;
|
|
820
|
+
maxDelayMs?: number;
|
|
821
|
+
jitterFactor?: number;
|
|
822
|
+
}
|
|
823
|
+
interface ClientOptions {
|
|
824
|
+
sessionId?: string;
|
|
825
|
+
auth?: AuthStoreBundle;
|
|
826
|
+
store?: MessageStore;
|
|
827
|
+
authType?: ConnectionAuthType;
|
|
828
|
+
phoneNumber?: string;
|
|
829
|
+
logger?: Logger;
|
|
830
|
+
cacheSignal?: boolean;
|
|
831
|
+
reconnect?: ReconnectOptions;
|
|
832
|
+
qrTerminal?: boolean;
|
|
833
|
+
baileys?: Partial<UserFacingSocketConfig>;
|
|
834
|
+
autoConnect?: boolean;
|
|
835
|
+
statusLog?: boolean;
|
|
836
|
+
commandPrefix?: string | string[];
|
|
837
|
+
citation?: CitationConfig;
|
|
838
|
+
ignoreMe?: boolean;
|
|
839
|
+
}
|
|
840
|
+
type ConnectionEventMap = {
|
|
841
|
+
connect: {
|
|
842
|
+
sessionId: string;
|
|
843
|
+
me: {
|
|
844
|
+
id: string;
|
|
845
|
+
lid?: string;
|
|
846
|
+
name?: string;
|
|
847
|
+
};
|
|
848
|
+
};
|
|
849
|
+
disconnect: {
|
|
850
|
+
sessionId: string;
|
|
851
|
+
reason: DisconnectReasonDomain;
|
|
852
|
+
willReconnect: boolean;
|
|
853
|
+
};
|
|
854
|
+
qr: {
|
|
855
|
+
sessionId: string;
|
|
856
|
+
qrString: string;
|
|
857
|
+
expiresAt: number;
|
|
858
|
+
};
|
|
859
|
+
'pairing-code': {
|
|
860
|
+
sessionId: string;
|
|
861
|
+
code: string;
|
|
862
|
+
expiresAt: number;
|
|
863
|
+
};
|
|
864
|
+
reconnecting: {
|
|
865
|
+
sessionId: string;
|
|
866
|
+
attempt: number;
|
|
867
|
+
delayMs: number;
|
|
868
|
+
reason: DisconnectReasonDomain;
|
|
869
|
+
};
|
|
870
|
+
error: {
|
|
871
|
+
sessionId: string;
|
|
872
|
+
error: Error;
|
|
873
|
+
};
|
|
1571
874
|
};
|
|
875
|
+
type ConnectionEventName = keyof ConnectionEventMap;
|
|
876
|
+
type ConnectionEventHandler<E extends ConnectionEventName> = (payload: ConnectionEventMap[E]) => void;
|
|
877
|
+
type ClientEventMap = ConnectionEventMap & InboundEventMap;
|
|
878
|
+
type ClientEventName = keyof ClientEventMap;
|
|
879
|
+
type BaileysSocket = WASocket;
|
|
1572
880
|
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
881
|
+
interface ResolvedCommand {
|
|
882
|
+
command: string;
|
|
883
|
+
args: string[];
|
|
884
|
+
flags: Record<string, string | boolean>;
|
|
885
|
+
json: unknown;
|
|
886
|
+
raw: string;
|
|
887
|
+
}
|
|
888
|
+
interface DispatcherDeps {
|
|
889
|
+
registry: CommandRegistry;
|
|
890
|
+
middleware: Middleware[];
|
|
891
|
+
prefixes: string[];
|
|
892
|
+
onText: (handler: (msg: MessageContext) => void) => () => void;
|
|
893
|
+
buildContext: (resolved: ResolvedCommand, msg: MessageContext) => CommandContext;
|
|
894
|
+
logger: Logger;
|
|
895
|
+
}
|
|
896
|
+
interface DispatcherHandle {
|
|
897
|
+
detach(): void;
|
|
1579
898
|
}
|
|
899
|
+
declare function attachCommandDispatcher(deps: DispatcherDeps): DispatcherHandle;
|
|
1580
900
|
|
|
1581
|
-
type
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
901
|
+
type RateLimiterOptions = {
|
|
902
|
+
perSec: number;
|
|
903
|
+
perJidPerSec?: number;
|
|
904
|
+
burst?: number;
|
|
1585
905
|
};
|
|
1586
|
-
type
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
filePath: string;
|
|
1590
|
-
parent: string | null;
|
|
1591
|
-
enabled: boolean;
|
|
906
|
+
type RetryPolicy = {
|
|
907
|
+
maxRetries: number;
|
|
908
|
+
backoffMs: (attempt: number) => number;
|
|
1592
909
|
};
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
enableAll(): void;
|
|
1608
|
-
disableAll(): void;
|
|
1609
|
-
enable(matcher: string | RegExp): number;
|
|
1610
|
-
disable(matcher: string | RegExp): number;
|
|
1611
|
-
enableByParent(parent: string): number;
|
|
1612
|
-
disableByParent(parent: string): number;
|
|
1613
|
-
isEnabled(): boolean;
|
|
1614
|
-
getLoadedPlugins(): PluginDefinition[];
|
|
1615
|
-
getPluginsInfo(): {
|
|
1616
|
-
matcher: (string | RegExp)[];
|
|
1617
|
-
metadata?: Record<string, unknown>;
|
|
1618
|
-
parent: string | null;
|
|
1619
|
-
enabled: boolean;
|
|
910
|
+
type TaskQueueOptions = {
|
|
911
|
+
concurrency?: number;
|
|
912
|
+
retry?: RetryPolicy;
|
|
913
|
+
};
|
|
914
|
+
type BroadcastOptions = {
|
|
915
|
+
rateLimitPerSec?: number;
|
|
916
|
+
retry?: RetryPolicy;
|
|
917
|
+
onProgress?: (done: number, total: number, jid: string, ok: boolean) => void;
|
|
918
|
+
};
|
|
919
|
+
type BroadcastResult = {
|
|
920
|
+
sent: string[];
|
|
921
|
+
failed: {
|
|
922
|
+
jid: string;
|
|
923
|
+
error: Error;
|
|
1620
924
|
}[];
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
}
|
|
1624
|
-
declare const definePlugins: (handler: PluginsHandlerType, config: PluginsConfigType) => Omit<PluginDefinition, "parent" | "enabled" | "filePath">;
|
|
1625
|
-
|
|
1626
|
-
interface Client extends Signal, SignalGroup, SignalPrivacy, SignalNewsletter, SignalCommunity {
|
|
1627
|
-
}
|
|
1628
|
-
declare class Client {
|
|
1629
|
-
private _ready;
|
|
1630
|
-
logs: Logs;
|
|
1631
|
-
middleware: Middleware<any>;
|
|
1632
|
-
plugins: Plugins;
|
|
1633
|
-
health: HealthManager;
|
|
1634
|
-
cleanup: CleanUpManager;
|
|
1635
|
-
options: v.InferOutput<typeof ClientOptionsType>;
|
|
1636
|
-
constructor(options: v.InferInput<typeof ClientOptionsType>);
|
|
1637
|
-
initialize(client?: Client): Promise<void>;
|
|
1638
|
-
ready(): Promise<void>;
|
|
1639
|
-
db(scope: string): IStoreAdapter;
|
|
1640
|
-
on<T extends v.InferOutput<typeof EventEnumType>>(event: T, handler: EventCallbackType[T]): void;
|
|
1641
|
-
use<T>(handler: MiddlewareHandler<T>): this;
|
|
1642
|
-
get socket(): ReturnType<typeof baileys__default>;
|
|
1643
|
-
getRoomName(roomId: string): Promise<string>;
|
|
1644
|
-
inject<T = any>(key: string, value: T): void;
|
|
1645
|
-
getInjection<T = any>(key: string): T | undefined;
|
|
1646
|
-
removeInjection(key: string): void;
|
|
1647
|
-
clearInjections(): void;
|
|
1648
|
-
}
|
|
1649
|
-
|
|
1650
|
-
declare const registerAuthCreds: (client: Client) => Promise<void>;
|
|
1651
|
-
|
|
1652
|
-
declare const logColor: (text: string, color?: string[] | string) => string;
|
|
1653
|
-
declare const toJson: (object: unknown) => any;
|
|
1654
|
-
declare const toString: (object: unknown) => string;
|
|
1655
|
-
declare const shuffleString: (str?: string) => string;
|
|
1656
|
-
declare const findGlobalWord: (text?: string, word?: string) => boolean;
|
|
1657
|
-
declare const extractUrls: (text?: string) => any[] | RegExpMatchArray;
|
|
1658
|
-
declare const randomize: (arr: string[]) => string;
|
|
1659
|
-
declare const pickKeysFromArray: (arr: any[], keys: string[]) => any;
|
|
1660
|
-
declare const findNestedByKeys: (data: unknown, target: Record<string, any> | Record<string, any>[]) => any;
|
|
1661
|
-
declare const modifyFn: <T extends (...args: any[]) => any>(fn: T, before?: (args: any[]) => void | any, after?: (result: any, args: any[]) => any) => T;
|
|
1662
|
-
declare const escapeRegExp: (text: string) => string;
|
|
1663
|
-
|
|
1664
|
-
declare const generateId: (input: string | string[]) => string;
|
|
1665
|
-
declare const getUsersMentions: (text?: string) => string[];
|
|
1666
|
-
declare const extractJids: (text?: string) => string[];
|
|
1667
|
-
declare const resolveJids: (jids: (string | null | undefined)[]) => {
|
|
925
|
+
};
|
|
926
|
+
type ScheduledJob = {
|
|
1668
927
|
id: string;
|
|
1669
|
-
|
|
928
|
+
fireAt: number;
|
|
929
|
+
recipient: string;
|
|
930
|
+
payload: unknown;
|
|
1670
931
|
};
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
declare
|
|
1674
|
-
|
|
1675
|
-
|
|
932
|
+
|
|
933
|
+
type AutomationErrorCode = 'NOT_CONNECTED' | 'RATE_LIMIT_INVALID' | 'TASK_FAILED' | 'SCHEDULE_INVALID' | 'STORE_UNAVAILABLE' | 'PRESENCE_FAILED';
|
|
934
|
+
declare class ZaileysAutomationError extends Error {
|
|
935
|
+
readonly code: AutomationErrorCode;
|
|
936
|
+
readonly cause?: unknown;
|
|
937
|
+
constructor(code: AutomationErrorCode, message: string, options?: {
|
|
938
|
+
cause?: unknown;
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
type RateLimiterClock = {
|
|
943
|
+
now?: () => number;
|
|
944
|
+
sleep?: (ms: number) => Promise<void>;
|
|
945
|
+
};
|
|
946
|
+
declare class RateLimiter {
|
|
947
|
+
private readonly now;
|
|
948
|
+
private readonly sleep;
|
|
949
|
+
private readonly perJidRatePerMs?;
|
|
950
|
+
private readonly perJidCapacity?;
|
|
951
|
+
private readonly global;
|
|
952
|
+
private readonly perJid;
|
|
953
|
+
constructor(options: RateLimiterOptions, clock?: RateLimiterClock);
|
|
954
|
+
acquire(jid?: string): Promise<void>;
|
|
955
|
+
private bucketFor;
|
|
956
|
+
private consume;
|
|
957
|
+
private refill;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
type TaskQueueClock = {
|
|
961
|
+
sleep?: (ms: number) => Promise<void>;
|
|
962
|
+
};
|
|
963
|
+
declare class TaskQueue {
|
|
964
|
+
private readonly concurrency;
|
|
965
|
+
private readonly retry;
|
|
966
|
+
private readonly sleep;
|
|
967
|
+
private readonly pending;
|
|
968
|
+
private active;
|
|
969
|
+
private idleWaiters;
|
|
970
|
+
constructor(options?: TaskQueueOptions, clock?: TaskQueueClock);
|
|
971
|
+
add<T>(task: () => Promise<T>): Promise<T>;
|
|
972
|
+
onIdle(): Promise<void>;
|
|
973
|
+
private pump;
|
|
974
|
+
private settleIdle;
|
|
975
|
+
private execute;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
type BroadcastDeps = {
|
|
979
|
+
sendTo: (jid: string) => MessageBuilder<'init'>;
|
|
980
|
+
limiter?: RateLimiter;
|
|
981
|
+
now?: () => number;
|
|
982
|
+
sleep?: (ms: number) => Promise<void>;
|
|
983
|
+
};
|
|
984
|
+
declare function runBroadcast(jids: string[], build: (b: MessageBuilder<'init'>) => MessageBuilder<'content-set'>, deps: BroadcastDeps, options?: BroadcastOptions): Promise<BroadcastResult>;
|
|
985
|
+
|
|
986
|
+
type WAPresence = 'unavailable' | 'available' | 'composing' | 'recording' | 'paused';
|
|
987
|
+
interface AutomationSocketLike {
|
|
988
|
+
sendPresenceUpdate(type: WAPresence, toJid?: string): Promise<void>;
|
|
989
|
+
}
|
|
990
|
+
declare class PresenceModule {
|
|
991
|
+
private readonly getSocket;
|
|
992
|
+
constructor(getSocket: () => AutomationSocketLike | undefined);
|
|
993
|
+
protected requireSocket(): AutomationSocketLike;
|
|
994
|
+
private update;
|
|
995
|
+
private scheduleClear;
|
|
996
|
+
online(): Promise<void>;
|
|
997
|
+
offline(): Promise<void>;
|
|
998
|
+
typing(jid: string, ms?: number): Promise<void>;
|
|
999
|
+
recording(jid: string, ms?: number): Promise<void>;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
type ScheduledContentSnapshot = {
|
|
1003
|
+
recipient: string;
|
|
1004
|
+
content: AnyMessageContent;
|
|
1005
|
+
options?: MiscMessageGenerationOptions;
|
|
1006
|
+
};
|
|
1007
|
+
type SchedulerTimer = {
|
|
1008
|
+
set: (cb: () => void, ms: number) => unknown;
|
|
1009
|
+
clear: (handle: unknown) => void;
|
|
1010
|
+
};
|
|
1011
|
+
type SchedulerDeps = {
|
|
1012
|
+
store: MessageStore;
|
|
1013
|
+
sendSnapshot: (snapshot: ScheduledContentSnapshot) => Promise<void>;
|
|
1014
|
+
now?: () => number;
|
|
1015
|
+
timer?: SchedulerTimer;
|
|
1016
|
+
logger?: Logger;
|
|
1017
|
+
};
|
|
1018
|
+
type ScheduleHandle = {
|
|
1019
|
+
id: string;
|
|
1020
|
+
cancel(): void;
|
|
1676
1021
|
};
|
|
1677
|
-
declare
|
|
1022
|
+
declare class Scheduler {
|
|
1023
|
+
private readonly store;
|
|
1024
|
+
private readonly sendSnapshot;
|
|
1025
|
+
private readonly now;
|
|
1026
|
+
private readonly timer;
|
|
1027
|
+
private readonly logger;
|
|
1028
|
+
private readonly memory;
|
|
1029
|
+
private readonly timers;
|
|
1030
|
+
constructor(deps: SchedulerDeps);
|
|
1031
|
+
scheduleAt(date: Date, build: (b: MessageBuilder<'init'>) => MessageBuilder<'content-set'>): Promise<ScheduleHandle>;
|
|
1032
|
+
loadPending(): Promise<void>;
|
|
1033
|
+
dispose(): void;
|
|
1034
|
+
private cancel;
|
|
1035
|
+
private arm;
|
|
1036
|
+
private fire;
|
|
1037
|
+
private persist;
|
|
1038
|
+
private remove;
|
|
1039
|
+
private evaluate;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
interface TypedEventEmitterOptions {
|
|
1043
|
+
logger?: Logger | undefined;
|
|
1044
|
+
}
|
|
1045
|
+
declare class TypedEventEmitter<M extends Record<string, unknown>> {
|
|
1046
|
+
private readonly inner;
|
|
1047
|
+
protected readonly emitterLogger: Logger | undefined;
|
|
1048
|
+
constructor(options?: TypedEventEmitterOptions);
|
|
1049
|
+
on<E extends keyof M>(event: E, handler: (payload: M[E]) => void): () => void;
|
|
1050
|
+
off<E extends keyof M>(event: E, handler: (payload: M[E]) => void): void;
|
|
1051
|
+
emit<E extends keyof M>(event: E, payload: M[E]): void;
|
|
1052
|
+
removeAllListeners(event?: keyof M): void;
|
|
1053
|
+
listenerCount(event: keyof M): number;
|
|
1054
|
+
private wrap;
|
|
1055
|
+
private tag;
|
|
1056
|
+
private untag;
|
|
1057
|
+
private lookup;
|
|
1058
|
+
private tagMap;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
declare class Client extends TypedEventEmitter<ClientEventMap> {
|
|
1062
|
+
readonly sessionId: string;
|
|
1063
|
+
auth: AuthStoreBundle;
|
|
1064
|
+
readonly store: MessageStore;
|
|
1065
|
+
private readonly logger;
|
|
1066
|
+
private readonly authType;
|
|
1067
|
+
private readonly phoneNumber;
|
|
1068
|
+
private readonly cacheSignal;
|
|
1069
|
+
private readonly qrTerminal;
|
|
1070
|
+
private readonly statusLog;
|
|
1071
|
+
private readonly reconnectOptions;
|
|
1072
|
+
private readonly baileysExtra;
|
|
1073
|
+
private readonly machine;
|
|
1074
|
+
private reconnectStrategy;
|
|
1075
|
+
private _socket;
|
|
1076
|
+
private reconnectTimer;
|
|
1077
|
+
private listenerCleanup;
|
|
1078
|
+
private inboundHandle;
|
|
1079
|
+
private connectResolve;
|
|
1080
|
+
private connectReject;
|
|
1081
|
+
private pairingRequested;
|
|
1082
|
+
private cachedSignalWrap;
|
|
1083
|
+
private creds;
|
|
1084
|
+
private credsLoadedAtConnect;
|
|
1085
|
+
private openedThisRun;
|
|
1086
|
+
private credsHintShown;
|
|
1087
|
+
private disconnectEmittedFor;
|
|
1088
|
+
private connectAttemptSeq;
|
|
1089
|
+
private pendingDisconnectReason;
|
|
1090
|
+
private readonly usernameCache;
|
|
1091
|
+
private _group?;
|
|
1092
|
+
private _privacy?;
|
|
1093
|
+
private _newsletter?;
|
|
1094
|
+
private _community?;
|
|
1095
|
+
private commandRegistry?;
|
|
1096
|
+
private readonly commandMiddleware;
|
|
1097
|
+
private readonly commandPrefixes;
|
|
1098
|
+
private readonly citationConfig;
|
|
1099
|
+
private readonly ignoreMe;
|
|
1100
|
+
private commandDispatcher;
|
|
1101
|
+
private _presence?;
|
|
1102
|
+
private _scheduler?;
|
|
1103
|
+
constructor(options?: ClientOptions);
|
|
1104
|
+
private emitAutoConnectError;
|
|
1105
|
+
private logStatus;
|
|
1106
|
+
private resolveMe;
|
|
1107
|
+
get state(): ConnectionState;
|
|
1108
|
+
get socket(): BaileysSocket | undefined;
|
|
1109
|
+
get group(): GroupModule;
|
|
1110
|
+
get privacy(): PrivacyModule;
|
|
1111
|
+
get newsletter(): NewsletterModule;
|
|
1112
|
+
get community(): CommunityModule;
|
|
1113
|
+
get presence(): PresenceModule;
|
|
1114
|
+
broadcast(jids: string[], build: (b: MessageBuilder<'init'>) => MessageBuilder<'content-set'>, options?: BroadcastOptions): Promise<BroadcastResult>;
|
|
1115
|
+
scheduleAt(date: Date, build: (b: MessageBuilder<'init'>) => MessageBuilder<'content-set'>): Promise<ScheduleHandle>;
|
|
1116
|
+
private ensureScheduler;
|
|
1117
|
+
private dispatchSnapshot;
|
|
1118
|
+
connect(): Promise<void>;
|
|
1119
|
+
disconnect(): Promise<void>;
|
|
1120
|
+
logout(): Promise<void>;
|
|
1121
|
+
command(spec: string, handler: CommandHandler): this;
|
|
1122
|
+
use(middleware: Middleware): this;
|
|
1123
|
+
private attachCommandsIfReady;
|
|
1124
|
+
private buildCommandContext;
|
|
1125
|
+
private detachCommands;
|
|
1126
|
+
send(to: string): MessageBuilder<'init'>;
|
|
1127
|
+
edit(key: WAMessageKey): EditBuilder;
|
|
1128
|
+
delete(key: WAMessageKey, opts?: DeleteOptions): Promise<void>;
|
|
1129
|
+
react(key: WAMessageKey, emoji: string): Promise<WAMessageKey>;
|
|
1130
|
+
forward(key: WAMessageKey, to: string): Promise<WAMessageKey>;
|
|
1131
|
+
private resolveRecipient;
|
|
1132
|
+
private requireSocket;
|
|
1133
|
+
private attachEmitterLogger;
|
|
1134
|
+
private wireSocket;
|
|
1135
|
+
private handleConnectionUpdate;
|
|
1136
|
+
private handleQrUpdate;
|
|
1137
|
+
private handleOpen;
|
|
1138
|
+
private lookupQuoted;
|
|
1139
|
+
private handleClose;
|
|
1140
|
+
private rejectPendingConnect;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
declare class MemoryAuthStore implements AuthStoreBundle {
|
|
1144
|
+
private credsBlob;
|
|
1145
|
+
private readonly signalMap;
|
|
1146
|
+
private closed;
|
|
1147
|
+
readonly signal: AuthStore;
|
|
1148
|
+
readonly creds: AuthCredsStore;
|
|
1149
|
+
private assertOpen;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
interface FileAuthStoreOptions {
|
|
1153
|
+
basePath?: string;
|
|
1154
|
+
}
|
|
1155
|
+
declare class FileAuthStore implements AuthStoreBundle {
|
|
1156
|
+
private readonly basePath;
|
|
1157
|
+
private closed;
|
|
1158
|
+
constructor(options?: FileAuthStoreOptions);
|
|
1159
|
+
readonly signal: AuthStore;
|
|
1160
|
+
readonly creds: AuthCredsStore;
|
|
1161
|
+
private credsPath;
|
|
1162
|
+
private signalDir;
|
|
1163
|
+
private signalPath;
|
|
1164
|
+
private atomicWrite;
|
|
1165
|
+
private assertOpen;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
interface SqliteAuthStoreOptions {
|
|
1169
|
+
database: string | Buffer;
|
|
1170
|
+
readonly?: boolean;
|
|
1171
|
+
}
|
|
1172
|
+
declare class SqliteAuthStore implements AuthStoreBundle {
|
|
1173
|
+
private readonly options;
|
|
1174
|
+
private db;
|
|
1175
|
+
private prepared;
|
|
1176
|
+
private readyPromise;
|
|
1177
|
+
private closed;
|
|
1178
|
+
constructor(options: SqliteAuthStoreOptions);
|
|
1179
|
+
readonly creds: AuthCredsStore;
|
|
1180
|
+
readonly signal: AuthStore;
|
|
1181
|
+
private ensureReady;
|
|
1182
|
+
private openAndMigrate;
|
|
1183
|
+
private encodeBlob;
|
|
1184
|
+
private parseBlob;
|
|
1185
|
+
}
|
|
1678
1186
|
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1187
|
+
interface PostgresAuthStoreOptions {
|
|
1188
|
+
pool?: Pool;
|
|
1189
|
+
connectionString?: string;
|
|
1190
|
+
max?: number;
|
|
1191
|
+
}
|
|
1192
|
+
declare class PostgresAuthStore implements AuthStoreBundle {
|
|
1193
|
+
private readonly externalPool;
|
|
1194
|
+
private readonly connectionString;
|
|
1195
|
+
private readonly poolMax;
|
|
1196
|
+
private ownedPool;
|
|
1197
|
+
private resolvedPool;
|
|
1198
|
+
private readyPromise;
|
|
1199
|
+
private closed;
|
|
1200
|
+
constructor(options: PostgresAuthStoreOptions);
|
|
1201
|
+
private ensureReady;
|
|
1202
|
+
readonly signal: AuthStore;
|
|
1203
|
+
readonly creds: AuthCredsStore;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
interface RedisAuthStoreOptions {
|
|
1207
|
+
client?: RedisClientType;
|
|
1208
|
+
url?: string;
|
|
1209
|
+
namespace?: string;
|
|
1210
|
+
}
|
|
1211
|
+
declare class RedisAuthStore implements AuthStoreBundle {
|
|
1212
|
+
private readonly namespace;
|
|
1213
|
+
private readonly externalClient;
|
|
1214
|
+
private readonly url;
|
|
1215
|
+
private ownedClient;
|
|
1216
|
+
private ready;
|
|
1217
|
+
private closed;
|
|
1218
|
+
constructor(options: RedisAuthStoreOptions);
|
|
1219
|
+
readonly signal: AuthStore;
|
|
1220
|
+
readonly creds: AuthCredsStore;
|
|
1221
|
+
private credsKey;
|
|
1222
|
+
private signalKey;
|
|
1223
|
+
private indexKey;
|
|
1224
|
+
private ensureReady;
|
|
1225
|
+
private connect;
|
|
1226
|
+
private runRead;
|
|
1227
|
+
private runWrite;
|
|
1228
|
+
private shutdown;
|
|
1229
|
+
private assertOpen;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
interface ConvexClientLike {
|
|
1233
|
+
query(name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
1234
|
+
mutation(name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
1235
|
+
}
|
|
1236
|
+
interface ConvexKvOptions {
|
|
1237
|
+
client?: ConvexClientLike;
|
|
1238
|
+
url?: string;
|
|
1239
|
+
namespace?: string;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
type ConvexAuthStoreOptions = ConvexKvOptions;
|
|
1243
|
+
declare class ConvexAuthStore implements AuthStoreBundle {
|
|
1244
|
+
readonly creds: AuthCredsStore;
|
|
1245
|
+
readonly signal: AuthStore;
|
|
1246
|
+
private readonly kv;
|
|
1247
|
+
constructor(options: ConvexAuthStoreOptions);
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
interface CacheableAuthStoreOptions {
|
|
1251
|
+
logger?: {
|
|
1252
|
+
trace?: (msg: unknown) => void;
|
|
1253
|
+
debug?: (msg: unknown) => void;
|
|
1254
|
+
info?: (msg: unknown) => void;
|
|
1255
|
+
warn?: (msg: unknown) => void;
|
|
1256
|
+
error?: (msg: unknown) => void;
|
|
1257
|
+
};
|
|
1258
|
+
cacheSize?: number;
|
|
1259
|
+
cacheTtlSeconds?: number;
|
|
1260
|
+
}
|
|
1261
|
+
declare function makeCacheableAuthStore(bundle: AuthStoreBundle, options?: CacheableAuthStoreOptions): AuthStoreBundle;
|
|
1262
|
+
|
|
1263
|
+
declare class MemoryMessageStore implements MessageStore {
|
|
1264
|
+
private readonly messages;
|
|
1265
|
+
private readonly messagesByJid;
|
|
1266
|
+
private readonly chats;
|
|
1267
|
+
private readonly contacts;
|
|
1268
|
+
private readonly presence;
|
|
1269
|
+
private boundSocket;
|
|
1270
|
+
private readonly listeners;
|
|
1271
|
+
private closed;
|
|
1272
|
+
saveMessage(message: WAMessage): Promise<void>;
|
|
1273
|
+
getMessage(key: WAMessageKey): Promise<WAMessage | undefined>;
|
|
1274
|
+
listMessages(jid: string, options?: MessageStoreListOptions): Promise<WAMessage[]>;
|
|
1275
|
+
saveChat(chat: Chat): Promise<void>;
|
|
1276
|
+
getChat(jid: string): Promise<Chat | undefined>;
|
|
1277
|
+
listChats(options?: {
|
|
1278
|
+
archived?: boolean;
|
|
1279
|
+
}): Promise<Chat[]>;
|
|
1280
|
+
saveContact(contact: Contact): Promise<void>;
|
|
1281
|
+
getContact(jid: string): Promise<Contact | undefined>;
|
|
1282
|
+
listContacts(): Promise<Contact[]>;
|
|
1283
|
+
savePresence(jid: string, presence: PresenceData): Promise<void>;
|
|
1284
|
+
getPresence(jid: string): Promise<PresenceData | undefined>;
|
|
1285
|
+
bind(socket: BaileysSocketLike): void;
|
|
1286
|
+
clear(): Promise<void>;
|
|
1287
|
+
close(): Promise<void>;
|
|
1288
|
+
private assertOpen;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
interface SqliteMessageStoreOptions {
|
|
1292
|
+
database: string | Buffer;
|
|
1293
|
+
readonly?: boolean;
|
|
1294
|
+
}
|
|
1295
|
+
declare class SqliteMessageStore implements MessageStore {
|
|
1296
|
+
private readonly options;
|
|
1297
|
+
private db;
|
|
1298
|
+
private prepared;
|
|
1299
|
+
private readyPromise;
|
|
1300
|
+
private closed;
|
|
1301
|
+
private boundSocket;
|
|
1302
|
+
private readonly listeners;
|
|
1303
|
+
constructor(options: SqliteMessageStoreOptions);
|
|
1304
|
+
saveMessage(message: WAMessage): Promise<void>;
|
|
1305
|
+
getMessage(key: WAMessageKey): Promise<WAMessage | undefined>;
|
|
1306
|
+
listMessages(jid: string, options?: MessageStoreListOptions): Promise<WAMessage[]>;
|
|
1307
|
+
saveChat(chat: Chat): Promise<void>;
|
|
1308
|
+
getChat(jid: string): Promise<Chat | undefined>;
|
|
1309
|
+
listChats(options?: {
|
|
1310
|
+
archived?: boolean;
|
|
1311
|
+
}): Promise<Chat[]>;
|
|
1312
|
+
saveContact(contact: Contact): Promise<void>;
|
|
1313
|
+
getContact(jid: string): Promise<Contact | undefined>;
|
|
1314
|
+
listContacts(): Promise<Contact[]>;
|
|
1315
|
+
savePresence(jid: string, presence: PresenceData): Promise<void>;
|
|
1316
|
+
getPresence(jid: string): Promise<PresenceData | undefined>;
|
|
1317
|
+
bind(socket: BaileysSocketLike): void;
|
|
1318
|
+
clear(): Promise<void>;
|
|
1319
|
+
close(): Promise<void>;
|
|
1320
|
+
private ensureReady;
|
|
1321
|
+
private openAndMigrate;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
interface PostgresMessageStoreOptions {
|
|
1325
|
+
pool?: Pool;
|
|
1326
|
+
connectionString?: string;
|
|
1327
|
+
max?: number;
|
|
1328
|
+
}
|
|
1329
|
+
declare class PostgresMessageStore implements MessageStore {
|
|
1330
|
+
private readonly externalPool;
|
|
1331
|
+
private readonly connectionString;
|
|
1332
|
+
private readonly poolMax;
|
|
1333
|
+
private ownedPool;
|
|
1334
|
+
private resolvedPool;
|
|
1335
|
+
private readyPromise;
|
|
1336
|
+
private boundSocket;
|
|
1337
|
+
private readonly listeners;
|
|
1338
|
+
private closed;
|
|
1339
|
+
constructor(options: PostgresMessageStoreOptions);
|
|
1340
|
+
private assertOpen;
|
|
1341
|
+
private ensureReady;
|
|
1342
|
+
saveMessage(message: WAMessage): Promise<void>;
|
|
1343
|
+
getMessage(key: WAMessageKey): Promise<WAMessage | undefined>;
|
|
1344
|
+
listMessages(jid: string, options?: MessageStoreListOptions): Promise<WAMessage[]>;
|
|
1345
|
+
saveChat(chat: Chat): Promise<void>;
|
|
1346
|
+
getChat(jid: string): Promise<Chat | undefined>;
|
|
1347
|
+
listChats(options?: {
|
|
1348
|
+
archived?: boolean;
|
|
1349
|
+
}): Promise<Chat[]>;
|
|
1350
|
+
saveContact(contact: Contact): Promise<void>;
|
|
1351
|
+
getContact(jid: string): Promise<Contact | undefined>;
|
|
1352
|
+
listContacts(): Promise<Contact[]>;
|
|
1353
|
+
savePresence(jid: string, presence: PresenceData): Promise<void>;
|
|
1354
|
+
getPresence(jid: string): Promise<PresenceData | undefined>;
|
|
1355
|
+
bind(socket: BaileysSocketLike): void;
|
|
1356
|
+
clear(): Promise<void>;
|
|
1357
|
+
close(): Promise<void>;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
interface RedisMessageStoreOptions {
|
|
1361
|
+
client?: RedisClientType;
|
|
1362
|
+
url?: string;
|
|
1363
|
+
namespace?: string;
|
|
1364
|
+
}
|
|
1365
|
+
declare class RedisMessageStore implements MessageStore {
|
|
1366
|
+
private readonly namespace;
|
|
1367
|
+
private readonly externalClient;
|
|
1368
|
+
private readonly url;
|
|
1369
|
+
private ownedClient;
|
|
1370
|
+
private ready;
|
|
1371
|
+
private closed;
|
|
1372
|
+
private boundSocket;
|
|
1373
|
+
private readonly listeners;
|
|
1374
|
+
constructor(options: RedisMessageStoreOptions);
|
|
1375
|
+
saveMessage(message: WAMessage): Promise<void>;
|
|
1376
|
+
getMessage(key: WAMessageKey): Promise<WAMessage | undefined>;
|
|
1377
|
+
listMessages(jid: string, options?: MessageStoreListOptions): Promise<WAMessage[]>;
|
|
1378
|
+
saveChat(chat: Chat): Promise<void>;
|
|
1379
|
+
getChat(jid: string): Promise<Chat | undefined>;
|
|
1380
|
+
listChats(options?: {
|
|
1381
|
+
archived?: boolean;
|
|
1382
|
+
}): Promise<Chat[]>;
|
|
1383
|
+
saveContact(contact: Contact): Promise<void>;
|
|
1384
|
+
getContact(jid: string): Promise<Contact | undefined>;
|
|
1385
|
+
listContacts(): Promise<Contact[]>;
|
|
1386
|
+
savePresence(jid: string, presence: PresenceData): Promise<void>;
|
|
1387
|
+
getPresence(jid: string): Promise<PresenceData | undefined>;
|
|
1388
|
+
bind(socket: BaileysSocketLike): void;
|
|
1389
|
+
clear(): Promise<void>;
|
|
1390
|
+
close(): Promise<void>;
|
|
1391
|
+
private msgIndexKey;
|
|
1392
|
+
private msgDataKey;
|
|
1393
|
+
private chatsKey;
|
|
1394
|
+
private chatsArchiveKey;
|
|
1395
|
+
private contactsKey;
|
|
1396
|
+
private presenceKey;
|
|
1397
|
+
private ensureReady;
|
|
1398
|
+
private connect;
|
|
1399
|
+
private runRead;
|
|
1400
|
+
private runWrite;
|
|
1401
|
+
private assertOpen;
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
type ConvexMessageStoreOptions = ConvexKvOptions;
|
|
1405
|
+
declare class ConvexMessageStore implements MessageStore {
|
|
1406
|
+
private readonly kv;
|
|
1407
|
+
private closed;
|
|
1408
|
+
private boundSocket;
|
|
1409
|
+
private readonly listeners;
|
|
1410
|
+
constructor(options: ConvexMessageStoreOptions);
|
|
1411
|
+
saveMessage(message: WAMessage): Promise<void>;
|
|
1412
|
+
getMessage(key: WAMessageKey): Promise<WAMessage | undefined>;
|
|
1413
|
+
listMessages(jid: string, options?: MessageStoreListOptions): Promise<WAMessage[]>;
|
|
1414
|
+
saveChat(chat: Chat): Promise<void>;
|
|
1415
|
+
getChat(jid: string): Promise<Chat | undefined>;
|
|
1416
|
+
listChats(options?: {
|
|
1417
|
+
archived?: boolean;
|
|
1418
|
+
}): Promise<Chat[]>;
|
|
1419
|
+
saveContact(contact: Contact): Promise<void>;
|
|
1420
|
+
getContact(jid: string): Promise<Contact | undefined>;
|
|
1421
|
+
listContacts(): Promise<Contact[]>;
|
|
1422
|
+
savePresence(jid: string, presence: PresenceData): Promise<void>;
|
|
1423
|
+
getPresence(jid: string): Promise<PresenceData | undefined>;
|
|
1424
|
+
saveScheduledJob(job: ScheduledJobRecord): Promise<void>;
|
|
1425
|
+
listScheduledJobs(): Promise<ScheduledJobRecord[]>;
|
|
1426
|
+
deleteScheduledJob(id: string): Promise<void>;
|
|
1427
|
+
bind(socket: BaileysSocketLike): void;
|
|
1428
|
+
clear(): Promise<void>;
|
|
1429
|
+
close(): Promise<void>;
|
|
1430
|
+
private assertOpen;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
declare function signalKeyStoreFromAuthStore(store: AuthStore, _logger?: Logger): SignalKeyStore;
|
|
1434
|
+
|
|
1435
|
+
interface PairingFlowOptions {
|
|
1436
|
+
phoneNumber: string;
|
|
1437
|
+
ttlMs?: number;
|
|
1438
|
+
}
|
|
1439
|
+
interface PairingFlowResult {
|
|
1440
|
+
code: string;
|
|
1441
|
+
expiresAt: number;
|
|
1442
|
+
}
|
|
1443
|
+
interface PairingFlow {
|
|
1444
|
+
readonly phoneNumber: string;
|
|
1445
|
+
requestCode(socket: Pick<BaileysSocket, 'requestPairingCode'>): Promise<PairingFlowResult>;
|
|
1446
|
+
}
|
|
1447
|
+
declare function normalizePhoneNumber(raw: string): string;
|
|
1448
|
+
declare function validateE164(raw: string): string;
|
|
1449
|
+
declare function createPairingFlow(options: PairingFlowOptions): PairingFlow;
|
|
1450
|
+
|
|
1451
|
+
declare function renderQrInTerminal(qrString: string): Promise<string>;
|
|
1452
|
+
declare function printQrToTerminal(qrString: string, write?: (s: string) => void): Promise<void>;
|
|
1453
|
+
|
|
1454
|
+
interface ReconnectDecision {
|
|
1455
|
+
attempt: number;
|
|
1456
|
+
delayMs: number;
|
|
1457
|
+
}
|
|
1458
|
+
interface ReconnectStrategy {
|
|
1459
|
+
next(reason: DisconnectReasonDomain): ReconnectDecision | null;
|
|
1460
|
+
reset(): void;
|
|
1461
|
+
readonly attempts: number;
|
|
1462
|
+
}
|
|
1463
|
+
interface ReconnectStrategyDeps {
|
|
1464
|
+
random?: () => number;
|
|
1465
|
+
}
|
|
1466
|
+
declare function createReconnectStrategy(options?: ReconnectOptions, deps?: ReconnectStrategyDeps): ReconnectStrategy;
|
|
1467
|
+
|
|
1468
|
+
type StateTransitionListener = (prev: ConnectionState, next: ConnectionState) => void;
|
|
1469
|
+
interface ConnectionStateMachine {
|
|
1470
|
+
readonly state: ConnectionState;
|
|
1471
|
+
canTransition(next: ConnectionState): boolean;
|
|
1472
|
+
transition(next: ConnectionState): void;
|
|
1473
|
+
onChange(listener: StateTransitionListener): () => void;
|
|
1474
|
+
}
|
|
1475
|
+
declare function createConnectionStateMachine(initial?: ConnectionState): ConnectionStateMachine;
|
|
1476
|
+
|
|
1477
|
+
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"];
|
|
1478
|
+
type SelfOnlyProtocolType = (typeof SELF_ONLY_PROTOCOL_TYPES)[number];
|
|
1479
|
+
interface UpsertPayload {
|
|
1480
|
+
messages: WAMessage[];
|
|
1481
|
+
type: MessageUpsertType;
|
|
1482
|
+
requestId?: string;
|
|
1483
|
+
}
|
|
1484
|
+
declare const dropSpoofedSelfOnly: (upsert: UpsertPayload) => UpsertPayload;
|
|
1485
|
+
|
|
1486
|
+
declare const chunk: <T>(input: readonly T[], size: number) => T[][];
|
|
1487
|
+
|
|
1488
|
+
type LoggerLevel = 'silent' | 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace';
|
|
1489
|
+
interface CreateLoggerOptions {
|
|
1490
|
+
sessionId?: string;
|
|
1491
|
+
level?: LoggerLevel;
|
|
1492
|
+
}
|
|
1493
|
+
type ZaileysLogger = Logger$1;
|
|
1494
|
+
declare function createLogger(options?: CreateLoggerOptions): ZaileysLogger;
|
|
1495
|
+
declare function adoptLogger(maybe: Logger | Partial<Logger> | undefined, fallback?: Logger): Logger;
|
|
1496
|
+
|
|
1497
|
+
interface LIDMapping {
|
|
1498
|
+
readonly lid: string;
|
|
1499
|
+
readonly pn: string;
|
|
1500
|
+
}
|
|
1501
|
+
type LIDMappingUpdatePayload = LIDMapping;
|
|
1502
|
+
|
|
1503
|
+
type StoreErrorCode = 'STORE_NOT_AVAILABLE' | 'STORE_CONNECTION_FAILED' | 'STORE_WRITE_FAILED' | 'STORE_READ_FAILED' | 'STORE_CORRUPTED' | 'STORE_CLOSED';
|
|
1504
|
+
declare class ZaileysStoreError extends Error {
|
|
1505
|
+
readonly code: StoreErrorCode;
|
|
1506
|
+
readonly cause?: unknown;
|
|
1507
|
+
constructor(code: StoreErrorCode, message: string, options?: {
|
|
1508
|
+
cause?: unknown;
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
declare const FFMPEG_CONSTANTS: {
|
|
1513
|
+
readonly OPUS: {
|
|
1514
|
+
readonly CODEC: "libopus";
|
|
1515
|
+
readonly CHANNELS: 1;
|
|
1516
|
+
readonly FREQUENCY: 48000;
|
|
1517
|
+
readonly BITRATE: "48k";
|
|
1518
|
+
readonly FORMAT: "ogg";
|
|
1519
|
+
};
|
|
1520
|
+
readonly THUMBNAIL: {
|
|
1521
|
+
readonly SIZE: 100;
|
|
1522
|
+
readonly QUALITY: 50;
|
|
1523
|
+
readonly TIMESTAMP: "10%";
|
|
1524
|
+
};
|
|
1525
|
+
readonly STICKER: {
|
|
1526
|
+
readonly SIZE: 512;
|
|
1527
|
+
readonly MAX_DURATION: 6;
|
|
1528
|
+
readonly FPS: 10;
|
|
1529
|
+
readonly DEFAULT_QUALITY: 60;
|
|
1530
|
+
readonly COMPRESSION_LEVEL: 6;
|
|
1531
|
+
};
|
|
1532
|
+
readonly MIME: {
|
|
1533
|
+
readonly AUDIO: "audio/";
|
|
1534
|
+
readonly VIDEO: "video/";
|
|
1535
|
+
readonly IMAGE: "image/";
|
|
1536
|
+
readonly GIF: "image/gif";
|
|
1537
|
+
readonly MP4: "video/mp4";
|
|
1538
|
+
};
|
|
1539
|
+
};
|
|
1540
|
+
type MediaInput = string | ArrayBuffer | Buffer;
|
|
1541
|
+
type FileExtension = 'wav' | 'ogg' | 'mp4' | 'gif' | 'jpg' | 'webp' | 'tmp' | 'mp3' | 'png';
|
|
1542
|
+
interface FFmpegConfig {
|
|
1543
|
+
input: string;
|
|
1544
|
+
output: string;
|
|
1545
|
+
options: string[];
|
|
1546
|
+
onEnd: () => Promise<void>;
|
|
1547
|
+
onError: (err: Error) => Promise<void>;
|
|
1548
|
+
}
|
|
1549
|
+
declare const initializeFFmpeg: (disable?: boolean) => Promise<void>;
|
|
1550
|
+
declare const generateId: () => string;
|
|
1551
|
+
declare const detectFileType: (buffer: Buffer) => Promise<{
|
|
1552
|
+
ext: string;
|
|
1553
|
+
mime: string;
|
|
1554
|
+
} | undefined>;
|
|
1555
|
+
declare class FileManager {
|
|
1556
|
+
private static generateUniqueId;
|
|
1557
|
+
static createTempPath(prefix: string, ext: FileExtension): string;
|
|
1558
|
+
static cleanup(files: string[]): Promise<void>;
|
|
1559
|
+
static safeReadFile(filePath: string): Promise<Buffer>;
|
|
1560
|
+
static safeWriteFile(filePath: string, data: Buffer): Promise<void>;
|
|
1561
|
+
}
|
|
1562
|
+
declare class BufferConverter {
|
|
1563
|
+
static toBuffer(input: MediaInput): Promise<Buffer>;
|
|
1564
|
+
private static fromString;
|
|
1565
|
+
private static fromUrl;
|
|
1566
|
+
static getExtension(buffer: Buffer): Promise<FileExtension>;
|
|
1567
|
+
}
|
|
1568
|
+
declare class MimeValidator {
|
|
1569
|
+
static validate(fileType: {
|
|
1570
|
+
mime: string;
|
|
1571
|
+
} | undefined, expectedPrefix: string): void;
|
|
1572
|
+
static isMedia(mime: string): boolean;
|
|
1573
|
+
static isAnimated(mime: string): boolean;
|
|
1574
|
+
}
|
|
1575
|
+
declare class FFmpegProcessor {
|
|
1576
|
+
static process(config: FFmpegConfig): Promise<void>;
|
|
1577
|
+
static getDuration(filePath: string): Promise<number>;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
declare const ffmpegTransform: (buffer: Buffer, inExt: FileExtension, outExt: FileExtension, label: string, options: string[] | ((tempIn: string) => string[] | Promise<string[]>)) => Promise<Buffer>;
|
|
1581
|
+
|
|
1582
|
+
type AudioType = 'opus' | 'mp3';
|
|
1583
|
+
declare class AudioProcessor {
|
|
1584
|
+
static toOpus(input: MediaInput): Promise<Buffer>;
|
|
1585
|
+
static toMp3(input: MediaInput): Promise<Buffer>;
|
|
1586
|
+
static convert(input: MediaInput, type?: AudioType): Promise<Buffer>;
|
|
1587
|
+
static waveform(input: MediaInput): Promise<{
|
|
1588
|
+
waveform: Uint8Array;
|
|
1589
|
+
seconds: number;
|
|
1590
|
+
}>;
|
|
1591
|
+
private static computeWaveform;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
declare class VideoProcessor {
|
|
1595
|
+
static toMp4(input: MediaInput): Promise<Buffer>;
|
|
1596
|
+
static thumbnail(input: MediaInput): Promise<string>;
|
|
1597
|
+
static duration(filePath: string): Promise<number>;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
declare class ImageProcessor {
|
|
1601
|
+
static thumbnail(buffer: Buffer): Promise<string>;
|
|
1602
|
+
static resize(buffer: Buffer, width: number, height: number): Promise<Buffer>;
|
|
1603
|
+
static toJpeg(input: MediaInput): Promise<Buffer>;
|
|
1604
|
+
static resizeForSticker(buffer: Buffer, quality: number, shape?: string): Promise<Buffer>;
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
type StickerShapeType = 'circle' | 'rounded' | 'oval' | 'default';
|
|
1608
|
+
interface StickerMetadataType {
|
|
1609
|
+
packageName?: string;
|
|
1610
|
+
authorName?: string;
|
|
1611
|
+
quality?: number;
|
|
1612
|
+
shape?: StickerShapeType;
|
|
1613
|
+
}
|
|
1614
|
+
declare class StickerProcessor {
|
|
1615
|
+
static create(input: MediaInput, metadata?: StickerMetadataType): Promise<Buffer>;
|
|
1616
|
+
private static createExifMetadata;
|
|
1617
|
+
private static processAnimated;
|
|
1618
|
+
private static getExtension;
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
declare class DocumentProcessor {
|
|
1622
|
+
static create(input: MediaInput): Promise<{
|
|
1623
|
+
document: Buffer<ArrayBufferLike>;
|
|
1624
|
+
mimetype: string;
|
|
1625
|
+
ext: string;
|
|
1626
|
+
fileName: string;
|
|
1627
|
+
jpegThumbnail: string;
|
|
1628
|
+
}>;
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
declare class Media {
|
|
1632
|
+
private input;
|
|
1633
|
+
constructor(input: MediaInput);
|
|
1634
|
+
get audio(): {
|
|
1635
|
+
toOpus: () => Promise<Buffer<ArrayBufferLike>>;
|
|
1636
|
+
toMp3: () => Promise<Buffer<ArrayBufferLike>>;
|
|
1637
|
+
convert: (type?: AudioType) => Promise<Buffer<ArrayBufferLike>>;
|
|
1638
|
+
waveform: () => Promise<{
|
|
1639
|
+
waveform: Uint8Array;
|
|
1640
|
+
seconds: number;
|
|
1641
|
+
}>;
|
|
1642
|
+
};
|
|
1643
|
+
get video(): {
|
|
1644
|
+
toMp4: () => Promise<Buffer<ArrayBufferLike>>;
|
|
1645
|
+
thumbnail: () => Promise<string>;
|
|
1646
|
+
};
|
|
1647
|
+
get image(): {
|
|
1648
|
+
toJpeg: () => Promise<Buffer<ArrayBufferLike>>;
|
|
1649
|
+
thumbnail: () => Promise<string>;
|
|
1650
|
+
resize: (width: number, height: number) => Promise<Buffer<ArrayBufferLike>>;
|
|
1651
|
+
};
|
|
1652
|
+
get sticker(): {
|
|
1653
|
+
create: (metadata?: StickerMetadataType) => Promise<Buffer<ArrayBufferLike>>;
|
|
1654
|
+
};
|
|
1655
|
+
get document(): {
|
|
1656
|
+
create: () => Promise<{
|
|
1657
|
+
document: Buffer<ArrayBufferLike>;
|
|
1658
|
+
mimetype: string;
|
|
1659
|
+
ext: string;
|
|
1660
|
+
fileName: string;
|
|
1661
|
+
jpegThumbnail: string;
|
|
1662
|
+
}>;
|
|
1663
|
+
};
|
|
1664
|
+
get thumbnail(): {
|
|
1665
|
+
get: () => Promise<string>;
|
|
1666
|
+
};
|
|
1667
|
+
toBuffer(): Promise<Buffer>;
|
|
1668
|
+
}
|
|
1683
1669
|
|
|
1684
|
-
export {
|
|
1670
|
+
export { type AddressButton, type AlbumItem, type AudioOptions, AudioProcessor, type AudioType, type AuthCredsStore, type AuthStore, type AuthStoreBundle, type AuthStoreKey, type AuthStoreValue, 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, type ButtonClickPayload, type ButtonDef, type CacheableAuthStoreOptions, type CallBase, type CallButton, type CallPayload, type CancelReminderButton, 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, 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, FFMPEG_CONSTANTS, type FFmpegConfig, FFmpegProcessor, FileAuthStore, type FileAuthStoreOptions, type FileExtension, FileManager, 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, type ListSelectPayload, 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 PairingFlow, type PairingFlowOptions, type PairingFlowResult, type ParsedArgs, type ParticipantUpdateResult, type PollOptions, type PollVotePayload, PostgresAuthStore, type PostgresAuthStoreOptions, PostgresMessageStore, type PostgresMessageStoreOptions, PresenceModule, type PresencePayload, type PrivacyConfig, PrivacyModule, type PrivacySettings, 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 VideoOptions, VideoProcessor, type WAPresence, ZaileysAutomationError, ZaileysBuilderError, ZaileysCommandError, ZaileysDomainError, type ZaileysLogger, ZaileysStoreError, adoptLogger, attachCommandDispatcher, buildMessageContext, chunk, createConnectionStateMachine, createLogger, createPairingFlow, createReconnectStrategy, deleteMessage, detectFileType, dropSpoofedSelfOnly, ffmpegTransform, forwardMessage, generateId, initializeFFmpeg, isFatalDisconnect, isJid, makeCacheableAuthStore, mapDisconnectReason, normalizePhoneNumber, parseCommand, printQrToTerminal, reactToMessage, renderQrInTerminal, resolveUsername, runBroadcast, runMiddleware, shouldClearAuth, shouldReconnect, signalKeyStoreFromAuthStore, validateE164 };
|