@solufy/evolution-sdk
Version:
Unofficial SDK for the Evolution Whatsapp API v2
211 lines (208 loc) • 6.28 kB
TypeScript
import * as libphonenumber_js from 'libphonenumber-js';
import { z } from 'zod';
import { MessageId } from '../../../types/tags.js';
declare const AudioMessageOptionsSchema: z.ZodObject<{
number: z.ZodUnion<[z.ZodEffects<z.ZodType<string, z.ZodTypeDef, string>, string, string>, z.ZodType<`${string}@s.whatsapp.net`, z.ZodTypeDef, `${string}@s.whatsapp.net`>, z.ZodType<`${string}@g.us`, z.ZodTypeDef, `${string}@g.us`>]>;
delay: z.ZodOptional<z.ZodNumber>;
} & {
/**
* Audio URL or file in base64
*/
audio: z.ZodUnion<[z.ZodString, z.ZodString]>;
/**
* Audio mimetype
*/
mimetype: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
number: string;
audio: string;
delay?: number | undefined;
mimetype?: string | undefined;
}, {
number: string;
audio: string;
delay?: number | undefined;
mimetype?: string | undefined;
}>;
declare const AudioMessageBodySchema: z.ZodEffects<z.ZodObject<{
number: z.ZodUnion<[z.ZodEffects<z.ZodType<string, z.ZodTypeDef, string>, string, string>, z.ZodType<`${string}@s.whatsapp.net`, z.ZodTypeDef, `${string}@s.whatsapp.net`>, z.ZodType<`${string}@g.us`, z.ZodTypeDef, `${string}@g.us`>]>;
delay: z.ZodOptional<z.ZodNumber>;
} & {
/**
* Audio URL or file in base64
*/
audio: z.ZodUnion<[z.ZodString, z.ZodString]>;
/**
* Audio mimetype
*/
mimetype: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
number: string;
audio: string;
delay?: number | undefined;
mimetype?: string | undefined;
}, {
number: string;
audio: string;
delay?: number | undefined;
mimetype?: string | undefined;
}>, {
media: string;
mediatype: string;
number: string;
delay?: number | undefined;
mimetype?: string | undefined;
}, {
number: string;
audio: string;
delay?: number | undefined;
mimetype?: string | undefined;
}>;
declare const AudioMessageResponseSchema: z.ZodEffects<z.ZodObject<{
key: z.ZodObject<{
remoteJid: z.ZodString;
id: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
remoteJid: string;
}, {
id: string;
remoteJid: string;
}>;
message: z.ZodObject<{
audioMessage: z.ZodObject<{
url: z.ZodString;
mimetype: z.ZodOptional<z.ZodString>;
fileSha256: z.ZodString;
fileLength: z.ZodNumber;
seconds: z.ZodNumber;
mediaKey: z.ZodString;
fileEncSha256: z.ZodString;
directPath: z.ZodString;
mediaKeyTimestamp: z.ZodEffects<z.ZodNumber, Date, number>;
}, "strip", z.ZodTypeAny, {
url: string;
fileSha256: string;
fileLength: number;
seconds: number;
mediaKey: string;
fileEncSha256: string;
directPath: string;
mediaKeyTimestamp: Date;
mimetype?: string | undefined;
}, {
url: string;
fileSha256: string;
fileLength: number;
seconds: number;
mediaKey: string;
fileEncSha256: string;
directPath: string;
mediaKeyTimestamp: number;
mimetype?: string | undefined;
}>;
}, "strip", z.ZodTypeAny, {
audioMessage: {
url: string;
fileSha256: string;
fileLength: number;
seconds: number;
mediaKey: string;
fileEncSha256: string;
directPath: string;
mediaKeyTimestamp: Date;
mimetype?: string | undefined;
};
}, {
audioMessage: {
url: string;
fileSha256: string;
fileLength: number;
seconds: number;
mediaKey: string;
fileEncSha256: string;
directPath: string;
mediaKeyTimestamp: number;
mimetype?: string | undefined;
};
}>;
messageTimestamp: z.ZodDate;
}, "strip", z.ZodTypeAny, {
message: {
audioMessage: {
url: string;
fileSha256: string;
fileLength: number;
seconds: number;
mediaKey: string;
fileEncSha256: string;
directPath: string;
mediaKeyTimestamp: Date;
mimetype?: string | undefined;
};
};
key: {
id: string;
remoteJid: string;
};
messageTimestamp: Date;
}, {
message: {
audioMessage: {
url: string;
fileSha256: string;
fileLength: number;
seconds: number;
mediaKey: string;
fileEncSha256: string;
directPath: string;
mediaKeyTimestamp: number;
mimetype?: string | undefined;
};
};
key: {
id: string;
remoteJid: string;
};
messageTimestamp: Date;
}>, {
receiver: {
phoneNumber: libphonenumber_js.E164Number;
jid: `${string}@s.whatsapp.net`;
};
media: {
url: string;
mimetype: string | undefined;
length: number;
durationInSeconds: number;
sha256: string;
encryptedSha256: string;
directPath: string;
key: string;
keyTimestamp: Date;
};
id: MessageId;
timestamp: Date;
}, {
message: {
audioMessage: {
url: string;
fileSha256: string;
fileLength: number;
seconds: number;
mediaKey: string;
fileEncSha256: string;
directPath: string;
mediaKeyTimestamp: number;
mimetype?: string | undefined;
};
};
key: {
id: string;
remoteJid: string;
};
messageTimestamp: Date;
}>;
type AudioMessageOptions = z.infer<typeof AudioMessageOptionsSchema>;
type AudioMessageResponse = z.infer<typeof AudioMessageResponseSchema>;
export { AudioMessageBodySchema, type AudioMessageOptions, AudioMessageOptionsSchema, type AudioMessageResponse, AudioMessageResponseSchema, AudioMessageBodySchema as BodySchema, AudioMessageOptionsSchema as OptionsSchema, AudioMessageResponseSchema as ResponseSchema };