zaileys
Version:
Zaileys - Simplified WhatsApp Node.js TypeScript/JavaScript API
1,041 lines (1,028 loc) • 92 kB
text/typescript
import * as baileys from 'baileys';
import baileys__default, { AuthenticationState, WAMessage, proto, ParticipantAction, WAPrivacyValue, WAPrivacyOnlineValue, WAReadReceiptsValue, WAPrivacyGroupAddValue } from 'baileys';
import * as v from 'valibot';
import pino from 'pino';
import Stream from 'stream';
export * from '@zaileys/media-process';
declare const useAuthState: (folder: string) => Promise<{
state: AuthenticationState;
saveCreds: () => Promise<void>;
}>;
interface IStoreAdapter {
get<T>(key: string): Promise<T | undefined>;
set<T>(key: string, value: T): Promise<void>;
del(key: string): Promise<void>;
clear(): Promise<void>;
keys(prefix?: string): Promise<string[]>;
getMany<T>(keys: string[]): Promise<Record<string, T>>;
setMany<T>(data: Record<string, T>): Promise<void>;
compact(): Promise<void>;
close(): Promise<void>;
}
declare class CleanUpManager {
private client;
private interval;
constructor(client: Client);
start(): void;
stop(): void;
run(): Promise<void>;
}
declare class HealthManager {
private client;
private keysDb;
constructor(client: Client);
repair(jid: string): Promise<void>;
get logger(): pino.Logger<never, boolean>;
}
declare const SignalType: v.PicklistSchema<["forward", "button", "edit", "delete"], undefined>;
declare const SignalOptionsType: v.UnionSchema<[v.StringSchema<undefined>, v.IntersectSchema<[v.UnionSchema<[v.LooseObjectSchema<{
readonly text: v.StringSchema<undefined>;
}, undefined>, v.LooseObjectSchema<{
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>;
readonly caption: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
}, undefined>, v.LooseObjectSchema<{
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>;
readonly caption: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly ptt: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
}, undefined>, v.LooseObjectSchema<{
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>;
readonly caption: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly ptv: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
}, undefined>, v.LooseObjectSchema<{
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>;
readonly shape: v.OptionalSchema<v.OptionalSchema<v.PicklistSchema<["default", "rounded", "circle", "oval"], undefined>, "default">, undefined>;
readonly caption: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
}, undefined>, v.LooseObjectSchema<{
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>;
readonly caption: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly fileName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
}, undefined>, v.LooseObjectSchema<{
readonly location: v.OptionalSchema<v.ObjectSchema<{
readonly latitude: v.NumberSchema<undefined>;
readonly longitude: v.NumberSchema<undefined>;
readonly url: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, undefined>;
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
}, undefined>, undefined>;
}, undefined>, v.LooseObjectSchema<{
readonly contacts: v.ObjectSchema<{
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly contacts: v.ArraySchema<v.ObjectSchema<{
readonly fullname: v.StringSchema<undefined>;
readonly phoneNumber: v.NumberSchema<undefined>;
readonly organization: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
}, undefined>, undefined>;
}, undefined>;
}, undefined>, v.ObjectSchema<{
readonly poll: v.ObjectSchema<{
readonly name: v.StringSchema<undefined>;
readonly answers: v.ArraySchema<v.StringSchema<undefined>, undefined>;
readonly isMultiple: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
}, undefined>;
}, undefined>], undefined>, Omit<v.ObjectSchema<{
readonly replied: v.OptionalSchema<v.CustomSchema<WAMessage, undefined>, undefined>;
readonly isForwardedMany: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
readonly isViewOnce: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
readonly banner: v.OptionalSchema<v.CustomSchema<proto.ContextInfo.IExternalAdReplyInfo, undefined>, undefined>;
readonly buttons: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
readonly type: v.LiteralSchema<"simple", undefined>;
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly data: v.ArraySchema<v.ObjectSchema<{
readonly id: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"interactive", undefined>;
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly data: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
readonly type: v.LiteralSchema<"quick_reply", undefined>;
readonly id: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_url", undefined>;
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_copy", undefined>;
readonly id: v.StringSchema<undefined>;
readonly copy: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_call", undefined>;
readonly text: v.StringSchema<undefined>;
readonly phoneNumber: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"single_select", undefined>;
readonly text: v.StringSchema<undefined>;
readonly section: v.ArraySchema<v.ObjectSchema<{
readonly title: v.StringSchema<undefined>;
readonly highlight_label: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly rows: v.ArraySchema<v.ObjectSchema<{
readonly id: v.StringSchema<undefined>;
readonly title: v.StringSchema<undefined>;
readonly header: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
}, undefined>, undefined>;
}, undefined>, undefined>;
}, undefined>], undefined>, undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"carousel", undefined>;
readonly data: v.ArraySchema<v.ObjectSchema<{
readonly body: v.StringSchema<undefined>;
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly header: v.OptionalSchema<v.ObjectSchema<{
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly subtitle: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly hasMediaAttachment: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
readonly image: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly video: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
}, undefined>, undefined>;
readonly nativeFlow: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
readonly type: v.LiteralSchema<"quick_reply", undefined>;
readonly id: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_url", undefined>;
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_copy", undefined>;
readonly id: v.StringSchema<undefined>;
readonly copy: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_call", undefined>;
readonly text: v.StringSchema<undefined>;
readonly phoneNumber: v.StringSchema<undefined>;
}, undefined>], undefined>, undefined>;
}, undefined>, undefined>;
}, undefined>], undefined>, undefined>;
}, undefined>, "entries" | "~types" | "~run" | "~standard"> & {
readonly entries: Omit<{
readonly replied: v.OptionalSchema<v.CustomSchema<WAMessage, undefined>, undefined>;
readonly isForwardedMany: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
readonly isViewOnce: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
readonly banner: v.OptionalSchema<v.CustomSchema<proto.ContextInfo.IExternalAdReplyInfo, undefined>, undefined>;
readonly buttons: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
readonly type: v.LiteralSchema<"simple", undefined>;
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly data: v.ArraySchema<v.ObjectSchema<{
readonly id: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"interactive", undefined>;
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly data: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
readonly type: v.LiteralSchema<"quick_reply", undefined>;
readonly id: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_url", undefined>;
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_copy", undefined>;
readonly id: v.StringSchema<undefined>;
readonly copy: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_call", undefined>;
readonly text: v.StringSchema<undefined>;
readonly phoneNumber: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"single_select", undefined>;
readonly text: v.StringSchema<undefined>;
readonly section: v.ArraySchema<v.ObjectSchema<{
readonly title: v.StringSchema<undefined>;
readonly highlight_label: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly rows: v.ArraySchema<v.ObjectSchema<{
readonly id: v.StringSchema<undefined>;
readonly title: v.StringSchema<undefined>;
readonly header: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
}, undefined>, undefined>;
}, undefined>, undefined>;
}, undefined>], undefined>, undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"carousel", undefined>;
readonly data: v.ArraySchema<v.ObjectSchema<{
readonly body: v.StringSchema<undefined>;
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly header: v.OptionalSchema<v.ObjectSchema<{
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly subtitle: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly hasMediaAttachment: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
readonly image: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly video: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
}, undefined>, undefined>;
readonly nativeFlow: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
readonly type: v.LiteralSchema<"quick_reply", undefined>;
readonly id: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_url", undefined>;
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_copy", undefined>;
readonly id: v.StringSchema<undefined>;
readonly copy: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_call", undefined>;
readonly text: v.StringSchema<undefined>;
readonly phoneNumber: v.StringSchema<undefined>;
}, undefined>], undefined>, undefined>;
}, undefined>, undefined>;
}, undefined>], undefined>, undefined>;
}, "buttons">;
readonly "~standard": v.StandardProps<{
isViewOnce?: boolean;
replied?: proto.IWebMessageInfo & {
key: baileys.WAMessageKey;
messageStubParameters?: any;
category?: string;
retryCount?: number;
};
isForwardedMany?: boolean;
banner?: proto.ContextInfo.IExternalAdReplyInfo;
}, {
isViewOnce?: boolean;
replied?: proto.IWebMessageInfo & {
key: baileys.WAMessageKey;
messageStubParameters?: any;
category?: string;
retryCount?: number;
};
isForwardedMany?: boolean;
banner?: proto.ContextInfo.IExternalAdReplyInfo;
}>;
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
isViewOnce?: boolean;
replied?: proto.IWebMessageInfo & {
key: baileys.WAMessageKey;
messageStubParameters?: any;
category?: string;
retryCount?: number;
};
isForwardedMany?: boolean;
banner?: proto.ContextInfo.IExternalAdReplyInfo;
}, v.ObjectIssue | v.BooleanIssue | v.CustomIssue>;
readonly "~types"?: {
readonly input: {
isViewOnce?: boolean;
replied?: proto.IWebMessageInfo & {
key: baileys.WAMessageKey;
messageStubParameters?: any;
category?: string;
retryCount?: number;
};
isForwardedMany?: boolean;
banner?: proto.ContextInfo.IExternalAdReplyInfo;
};
readonly output: {
isViewOnce?: boolean;
replied?: proto.IWebMessageInfo & {
key: baileys.WAMessageKey;
messageStubParameters?: any;
category?: string;
retryCount?: number;
};
isForwardedMany?: boolean;
banner?: proto.ContextInfo.IExternalAdReplyInfo;
};
readonly issue: v.ObjectIssue | v.BooleanIssue | v.CustomIssue;
};
}], undefined>], undefined>;
declare const ButtonOptionsType: v.IntersectSchema<[v.LooseObjectSchema<{
readonly text: v.StringSchema<undefined>;
}, undefined>, Omit<v.ObjectSchema<{
readonly replied: v.OptionalSchema<v.CustomSchema<WAMessage, undefined>, undefined>;
readonly isForwardedMany: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
readonly isViewOnce: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
readonly banner: v.OptionalSchema<v.CustomSchema<proto.ContextInfo.IExternalAdReplyInfo, undefined>, undefined>;
readonly buttons: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
readonly type: v.LiteralSchema<"simple", undefined>;
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly data: v.ArraySchema<v.ObjectSchema<{
readonly id: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"interactive", undefined>;
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly data: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
readonly type: v.LiteralSchema<"quick_reply", undefined>;
readonly id: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_url", undefined>;
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_copy", undefined>;
readonly id: v.StringSchema<undefined>;
readonly copy: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_call", undefined>;
readonly text: v.StringSchema<undefined>;
readonly phoneNumber: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"single_select", undefined>;
readonly text: v.StringSchema<undefined>;
readonly section: v.ArraySchema<v.ObjectSchema<{
readonly title: v.StringSchema<undefined>;
readonly highlight_label: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly rows: v.ArraySchema<v.ObjectSchema<{
readonly id: v.StringSchema<undefined>;
readonly title: v.StringSchema<undefined>;
readonly header: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
}, undefined>, undefined>;
}, undefined>, undefined>;
}, undefined>], undefined>, undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"carousel", undefined>;
readonly data: v.ArraySchema<v.ObjectSchema<{
readonly body: v.StringSchema<undefined>;
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly header: v.OptionalSchema<v.ObjectSchema<{
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly subtitle: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly hasMediaAttachment: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
readonly image: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly video: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
}, undefined>, undefined>;
readonly nativeFlow: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
readonly type: v.LiteralSchema<"quick_reply", undefined>;
readonly id: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_url", undefined>;
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_copy", undefined>;
readonly id: v.StringSchema<undefined>;
readonly copy: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_call", undefined>;
readonly text: v.StringSchema<undefined>;
readonly phoneNumber: v.StringSchema<undefined>;
}, undefined>], undefined>, undefined>;
}, undefined>, undefined>;
}, undefined>], undefined>, undefined>;
}, undefined>, "entries" | "~types" | "~run" | "~standard"> & {
readonly entries: Omit<{
readonly replied: v.OptionalSchema<v.CustomSchema<WAMessage, undefined>, undefined>;
readonly isForwardedMany: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
readonly isViewOnce: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
readonly banner: v.OptionalSchema<v.CustomSchema<proto.ContextInfo.IExternalAdReplyInfo, undefined>, undefined>;
readonly buttons: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
readonly type: v.LiteralSchema<"simple", undefined>;
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly data: v.ArraySchema<v.ObjectSchema<{
readonly id: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"interactive", undefined>;
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly data: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
readonly type: v.LiteralSchema<"quick_reply", undefined>;
readonly id: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_url", undefined>;
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_copy", undefined>;
readonly id: v.StringSchema<undefined>;
readonly copy: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_call", undefined>;
readonly text: v.StringSchema<undefined>;
readonly phoneNumber: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"single_select", undefined>;
readonly text: v.StringSchema<undefined>;
readonly section: v.ArraySchema<v.ObjectSchema<{
readonly title: v.StringSchema<undefined>;
readonly highlight_label: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly rows: v.ArraySchema<v.ObjectSchema<{
readonly id: v.StringSchema<undefined>;
readonly title: v.StringSchema<undefined>;
readonly header: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
}, undefined>, undefined>;
}, undefined>, undefined>;
}, undefined>], undefined>, undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"carousel", undefined>;
readonly data: v.ArraySchema<v.ObjectSchema<{
readonly body: v.StringSchema<undefined>;
readonly footer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly header: v.OptionalSchema<v.ObjectSchema<{
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly subtitle: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly hasMediaAttachment: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
readonly image: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly video: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
}, undefined>, undefined>;
readonly nativeFlow: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
readonly type: v.LiteralSchema<"quick_reply", undefined>;
readonly id: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_url", undefined>;
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_copy", undefined>;
readonly id: v.StringSchema<undefined>;
readonly copy: v.StringSchema<undefined>;
readonly text: v.StringSchema<undefined>;
}, undefined>, v.ObjectSchema<{
readonly type: v.LiteralSchema<"cta_call", undefined>;
readonly text: v.StringSchema<undefined>;
readonly phoneNumber: v.StringSchema<undefined>;
}, undefined>], undefined>, undefined>;
}, undefined>, undefined>;
}, undefined>], undefined>, undefined>;
}, "banner">;
readonly "~standard": v.StandardProps<{
buttons?: {
type: "simple";
footer?: string;
data: {
id: string;
text: string;
}[];
} | {
type: "interactive";
footer?: string;
data: ({
type: "quick_reply";
id: string;
text: string;
} | {
type: "cta_url";
url: string;
text: string;
} | {
type: "cta_copy";
id: string;
copy: string;
text: string;
} | {
type: "cta_call";
text: string;
phoneNumber: string;
} | {
type: "single_select";
text: string;
section: {
title: string;
highlight_label?: string;
rows: {
id: string;
title: string;
header?: string;
description?: string;
}[];
}[];
})[];
} | {
type: "carousel";
data: {
body: string;
footer?: string;
header?: {
title?: string;
subtitle?: string;
hasMediaAttachment?: boolean;
image?: string;
video?: string;
};
nativeFlow: ({
type: "quick_reply";
id: string;
text: string;
} | {
type: "cta_url";
url: string;
text: string;
} | {
type: "cta_copy";
id: string;
copy: string;
text: string;
} | {
type: "cta_call";
text: string;
phoneNumber: string;
})[];
}[];
};
isViewOnce?: boolean;
replied?: proto.IWebMessageInfo & {
key: baileys.WAMessageKey;
messageStubParameters?: any;
category?: string;
retryCount?: number;
};
isForwardedMany?: boolean;
}, {
buttons?: {
type: "simple";
footer?: string;
data: {
id: string;
text: string;
}[];
} | {
type: "interactive";
footer?: string;
data: ({
type: "quick_reply";
id: string;
text: string;
} | {
type: "cta_url";
url: string;
text: string;
} | {
type: "cta_copy";
id: string;
copy: string;
text: string;
} | {
type: "cta_call";
text: string;
phoneNumber: string;
} | {
type: "single_select";
text: string;
section: {
title: string;
highlight_label?: string;
rows: {
id: string;
title: string;
header?: string;
description?: string;
}[];
}[];
})[];
} | {
type: "carousel";
data: {
body: string;
footer?: string;
header?: {
title?: string;
subtitle?: string;
hasMediaAttachment?: boolean;
image?: string;
video?: string;
};
nativeFlow: ({
type: "quick_reply";
id: string;
text: string;
} | {
type: "cta_url";
url: string;
text: string;
} | {
type: "cta_copy";
id: string;
copy: string;
text: string;
} | {
type: "cta_call";
text: string;
phoneNumber: string;
})[];
}[];
};
isViewOnce?: boolean;
replied?: proto.IWebMessageInfo & {
key: baileys.WAMessageKey;
messageStubParameters?: any;
category?: string;
retryCount?: number;
};
isForwardedMany?: boolean;
}>;
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
buttons?: {
type: "simple";
footer?: string;
data: {
id: string;
text: string;
}[];
} | {
type: "interactive";
footer?: string;
data: ({
type: "quick_reply";
id: string;
text: string;
} | {
type: "cta_url";
url: string;
text: string;
} | {
type: "cta_copy";
id: string;
copy: string;
text: string;
} | {
type: "cta_call";
text: string;
phoneNumber: string;
} | {
type: "single_select";
text: string;
section: {
title: string;
highlight_label?: string;
rows: {
id: string;
title: string;
header?: string;
description?: string;
}[];
}[];
})[];
} | {
type: "carousel";
data: {
body: string;
footer?: string;
header?: {
title?: string;
subtitle?: string;
hasMediaAttachment?: boolean;
image?: string;
video?: string;
};
nativeFlow: ({
type: "quick_reply";
id: string;
text: string;
} | {
type: "cta_url";
url: string;
text: string;
} | {
type: "cta_copy";
id: string;
copy: string;
text: string;
} | {
type: "cta_call";
text: string;
phoneNumber: string;
})[];
}[];
};
isViewOnce?: boolean;
replied?: proto.IWebMessageInfo & {
key: baileys.WAMessageKey;
messageStubParameters?: any;
category?: string;
retryCount?: number;
};
isForwardedMany?: boolean;
}, 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>>>>;
readonly "~types"?: {
readonly input: {
buttons?: {
type: "simple";
footer?: string;
data: {
id: string;
text: string;
}[];
} | {
type: "interactive";
footer?: string;
data: ({
type: "quick_reply";
id: string;
text: string;
} | {
type: "cta_url";
url: string;
text: string;
} | {
type: "cta_copy";
id: string;
copy: string;
text: string;
} | {
type: "cta_call";
text: string;
phoneNumber: string;
} | {
type: "single_select";
text: string;
section: {
title: string;
highlight_label?: string;
rows: {
id: string;
title: string;
header?: string;
description?: string;
}[];
}[];
})[];
} | {
type: "carousel";
data: {
body: string;
footer?: string;
header?: {
title?: string;
subtitle?: string;
hasMediaAttachment?: boolean;
image?: string;
video?: string;
};
nativeFlow: ({
type: "quick_reply";
id: string;
text: string;
} | {
type: "cta_url";
url: string;
text: string;
} | {
type: "cta_copy";
id: string;
copy: string;
text: string;
} | {
type: "cta_call";
text: string;
phoneNumber: string;
})[];
}[];
};
isViewOnce?: boolean;
replied?: proto.IWebMessageInfo & {
key: baileys.WAMessageKey;
messageStubParameters?: any;
category?: string;
retryCount?: number;
};
isForwardedMany?: boolean;
};
readonly output: {
buttons?: {
type: "simple";
footer?: string;
data: {
id: string;
text: string;
}[];
} | {
type: "interactive";
footer?: string;
data: ({
type: "quick_reply";
id: string;
text: string;
} | {
type: "cta_url";
url: string;
text: string;
} | {
type: "cta_copy";
id: string;
copy: string;
text: string;
} | {
type: "cta_call";
text: string;
phoneNumber: string;
} | {
type: "single_select";
text: string;
section: {
title: string;
highlight_label?: string;
rows: {
id: string;
title: string;
header?: string;
description?: string;
}[];
}[];
})[];
} | {
type: "carousel";
data: {
body: string;
footer?: string;
header?: {
title?: string;
subtitle?: string;
hasMediaAttachment?: boolean;
image?: string;
video?: string;
};
nativeFlow: ({
type: "quick_reply";
id: string;
text: string;
} | {
type: "cta_url";
url: string;
text: string;
} | {
type: "cta_copy";
id: string;
copy: string;
text: string;
} | {
type: "cta_call";
text: string;
phoneNumber: string;
})[];
}[];
};
isViewOnce?: boolean;
replied?: proto.IWebMessageInfo & {
key: baileys.WAMessageKey;
messageStubParameters?: any;
category?: string;
retryCount?: number;
};
isForwardedMany?: boolean;
};
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>>>;
};
}], undefined>;
declare class Signal {
protected client: Client;
constructor(client: Client);
protected signal(roomId: string, options: v.InferInput<typeof SignalOptionsType> | any, type?: v.InferInput<typeof SignalType>, message?: WAMessage): Promise<WAMessage>;
send(roomId: string, options: v.InferInput<typeof SignalOptionsType>): Promise<WAMessage>;
forward(roomId: string, options: v.InferInput<typeof SignalOptionsType>): Promise<WAMessage>;
button(roomId: string, options: v.InferInput<typeof ButtonOptionsType>): Promise<WAMessage>;
edit(message: WAMessage, options: v.InferInput<typeof SignalOptionsType>): Promise<WAMessage>;
delete(message: WAMessage | WAMessage[]): Promise<WAMessage | (baileys.proto.IWebMessageInfo & {
key: baileys.WAMessageKey;
messageStubParameters?: any;
category?: string;
retryCount?: number;
})[]>;
presence(roomId: string, type: 'typing' | 'recording' | 'online' | 'offline' | 'paused'): Promise<void>;
reaction(message: WAMessage, reaction: string): Promise<WAMessage>;
memberLabel(roomId: string, label: string): Promise<string>;
}
declare class Community {
protected client: Client;
constructor(client: Client);
create(subject: string, description: string): Promise<baileys.GroupMetadata>;
createGroup(subject: string, participants: string[], parentId: string): Promise<baileys.GroupMetadata>;
leave(id: string): Promise<void>;
metadata(id: string): Promise<baileys.GroupMetadata>;
update(id: string, type: 'subject' | 'description', value: string): Promise<void>;
group(id: string, type: 'link' | 'unlink' | 'linked', groupJid?: string): Promise<void | {
communityJid: string;
isCommunity: boolean;
linkedGroups: {
id: string | undefined;
subject: string;
creation: number | undefined;
owner: string | undefined;
size: number | undefined;
}[];
}>;
participants(id: string, type: 'list' | 'request-update' | 'update' | 'all', action?: 'add' | 'remove' | 'promote' | 'demote' | 'approve' | 'reject', participants?: string[]): Promise<{
[key: string]: string;
}[] | {
status: string;
jid: string | undefined;
}[] | {
[_: string]: baileys.GroupMetadata;
}>;
invite(target: string | any, type: 'code' | 'revoke' | 'accept' | 'info' | 'revokeV4' | 'acceptV4', ...args: any[]): Promise<any>;
settings(id: string, type: 'ephemeral' | 'update' | 'memberAdd' | 'approval', value?: any): Promise<void>;
}
declare class SignalCommunity {
protected mlient: Client;
community: Community;
constructor(mlient: Client);
}
declare class Group {
protected client: Client;
constructor(client: Client);
create(name: string, participants: string[]): Promise<baileys.GroupMetadata>;
participant(roomId: string, participants: string[], action: ParticipantAction): Promise<{
status: string;
jid: string | undefined;
content: baileys.BinaryNode;
}[]>;
profile(roomId: string, update: string | Buffer, type: 'subject' | 'description' | 'picture'): Promise<void>;
setting(roomId: string, type: 'open' | 'close' | 'locked' | 'unlocked' | 'all_member_add' | 'admin_add'): Promise<void>;
leave(roomId: string): Promise<void>;
inviteCode(roomId: string, type: 'code' | 'revoke' | 'accept' | 'info'): Promise<string | baileys.GroupMetadata>;
metadata(roomId: string): Promise<any>;
requestJoin(roomId: string, participants: string[], type: 'approve' | 'reject'): Promise<{
status: string;
jid: string | undefined;
}[]>;
requestJoinList(roomId: string): Promise<{
[key: string]: string;
}[]>;
fetchAllGroups(): Promise<{
[_: string]: baileys.GroupMetadata;
}>;
ephemeral(roomId: string, type: 'off' | '24h' | '7d' | '90d'): Promise<void>;
}
declare class SignalGroup {
protected glient: Client;
group: Group;
constructor(glient: Client);
}
declare class Newsletter {
protected client: Client;
constructor(client: Client);
create(name: string, description: string): Promise<baileys.NewsletterMetadata>;
action(roomId: string, type: 'follow' | 'unfollow' | 'mute' | 'unmute' | ''): Promise<unknown>;
update(roomId: string, update: string | Buffer, type: 'name' | 'description' | 'picture'): Promise<unknown>;
metadata(roomId: string, type: 'invite' | 'jid'): Promise<baileys.NewsletterMetadata>;
subscribers(roomId: string): Promise<{
subscribers: number;
}>;
reaction(roomId: string, chatId: string, reaction: string): Promise<void>;
fetchMessages(roomId: string, count: number, since: Date, after: Date): Promise<any>;
adminCount(roomId: string): Promise<number>;
changeOwner(roomId: string, owner: string): Promise<void>;
demote(roomId: string, senderId: string): Promise<void>;
delete(roomId: string): Promise<void>;
removePicture(roomId: string): Promise<unknown>;
}
declare class SignalNewsletter {
protected nlient: Client;
newsletter: Newsletter;
constructor(nlient: Client);
}
declare class Privacy {
protected client: Client;
constructor(client: Client);
block(senderId: string): Promise<void>;
unblock(senderId: string): Promise<void>;
lastSeen(type: WAPrivacyValue): Promise<void>;
online(type: WAPrivacyOnlineValue): Promise<void>;
picture(type: WAPrivacyValue): Promise<void>;
status(type: WAPrivacyValue): Promise<void>;
readReceipt(type: WAReadReceiptsValue): Promise<void>;
groupsAdd(type: WAPrivacyGroupAddValue): Promise<void>;
ephemeral(type: 'off' | '24h' | '7d' | '90d'): Promise<void>;
blocklist(): Promise<string[]>;
getSettings(): Promise<{
[_: string]: string;
}>;
}
declare class SignalPrivacy {
protected plient: Client;
privacy: Privacy;
constructor(plient: Client);
}
declare const ListenerCallsType: v.ObjectSchema<{
readonly callId: v.StringSchema<undefined>;
readonly callerId: v.StringSchema<undefined>;
readonly roomId: v.StringSchema<undefined>;
readonly roomName: v.StringSchema<undefined>;
readonly date: v.DateSchema<undefined>;
readonly offline: v.BooleanSchema<undefined>;
readonly status: v.PicklistSchema<["accept", "offer", "reject", "ringing", "terminate", "timeout"], undefined>;
readonly isVideo: v.BooleanSchema<undefined>;
readonly isGroup: v.BooleanSchema<undefined>;
}, undefined>;
type CallsContext = v.InferOutput<typeof ListenerCallsType>;
declare const ListenerConnectionType: v.ObjectSchema<{
readonly status: v.PicklistSchema<["connecting", "open", "close", "reload", "syncing"], undefined>;
readonly authType: v.PicklistSchema<["pairing", "qr"], undefined>;
readonly authTimeout: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
readonly syncProgress: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
readonly syncCompleted: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
readonly qr: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
readonly code: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
}, undefined>;
type ConnectionContext = v.InferOutput<typeof ListenerConnectionType>;
declare const DEVICE_ENUM_TYPES: v.PicklistSchema<["unknown", "android", "ios", "desktop", "web"], undefined>;
declare const MESSAGE_ENUM_TYPES: v.PicklistSchema<["text", "album", "image", "contact", "location", "document", "audio", "video", "protocol", "contacts", "highlyStructured", "sendPayment", "requestPayment", "groupStatusM