@solufy/evolution-sdk
Version:
Unofficial SDK for the Evolution Whatsapp API v2
234 lines (231 loc) • 7.08 kB
TypeScript
import * as libphonenumber_js from 'libphonenumber-js';
import { z } from 'zod';
import { MessageId } from '../../../types/tags.js';
declare const VideoMessageOptionsSchema: 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>;
} & {
/**
* Video URL or file in base64
*/
video: z.ZodUnion<[z.ZodString, z.ZodString]>;
/**
* Caption to send with video
*/
caption: z.ZodOptional<z.ZodString>;
/**
* Video mimetype
*/
mimetype: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
number: string;
video: string;
delay?: number | undefined;
mimetype?: string | undefined;
caption?: string | undefined;
}, {
number: string;
video: string;
delay?: number | undefined;
mimetype?: string | undefined;
caption?: string | undefined;
}>;
declare const VideoMessageBodySchema: 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>;
} & {
/**
* Video URL or file in base64
*/
video: z.ZodUnion<[z.ZodString, z.ZodString]>;
/**
* Caption to send with video
*/
caption: z.ZodOptional<z.ZodString>;
/**
* Video mimetype
*/
mimetype: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
number: string;
video: string;
delay?: number | undefined;
mimetype?: string | undefined;
caption?: string | undefined;
}, {
number: string;
video: string;
delay?: number | undefined;
mimetype?: string | undefined;
caption?: string | undefined;
}>, {
media: string;
mediatype: string;
number: string;
delay?: number | undefined;
mimetype?: string | undefined;
caption?: string | undefined;
}, {
number: string;
video: string;
delay?: number | undefined;
mimetype?: string | undefined;
caption?: string | undefined;
}>;
declare const VideoMessageResponseSchema: 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<{
videoMessage: z.ZodObject<{
url: z.ZodString;
mimetype: z.ZodOptional<z.ZodString>;
fileSha256: z.ZodString;
fileLength: z.ZodNumber;
mediaKey: z.ZodString;
caption: z.ZodOptional<z.ZodString>;
gifPlayback: z.ZodBoolean;
fileEncSha256: z.ZodString;
directPath: z.ZodString;
mediaKeyTimestamp: z.ZodEffects<z.ZodNumber, Date, number>;
}, "strip", z.ZodTypeAny, {
url: string;
fileSha256: string;
fileLength: number;
mediaKey: string;
fileEncSha256: string;
directPath: string;
mediaKeyTimestamp: Date;
gifPlayback: boolean;
mimetype?: string | undefined;
caption?: string | undefined;
}, {
url: string;
fileSha256: string;
fileLength: number;
mediaKey: string;
fileEncSha256: string;
directPath: string;
mediaKeyTimestamp: number;
gifPlayback: boolean;
mimetype?: string | undefined;
caption?: string | undefined;
}>;
}, "strip", z.ZodTypeAny, {
videoMessage: {
url: string;
fileSha256: string;
fileLength: number;
mediaKey: string;
fileEncSha256: string;
directPath: string;
mediaKeyTimestamp: Date;
gifPlayback: boolean;
mimetype?: string | undefined;
caption?: string | undefined;
};
}, {
videoMessage: {
url: string;
fileSha256: string;
fileLength: number;
mediaKey: string;
fileEncSha256: string;
directPath: string;
mediaKeyTimestamp: number;
gifPlayback: boolean;
mimetype?: string | undefined;
caption?: string | undefined;
};
}>;
messageTimestamp: z.ZodDate;
}, "strip", z.ZodTypeAny, {
message: {
videoMessage: {
url: string;
fileSha256: string;
fileLength: number;
mediaKey: string;
fileEncSha256: string;
directPath: string;
mediaKeyTimestamp: Date;
gifPlayback: boolean;
mimetype?: string | undefined;
caption?: string | undefined;
};
};
key: {
id: string;
remoteJid: string;
};
messageTimestamp: Date;
}, {
message: {
videoMessage: {
url: string;
fileSha256: string;
fileLength: number;
mediaKey: string;
fileEncSha256: string;
directPath: string;
mediaKeyTimestamp: number;
gifPlayback: boolean;
mimetype?: string | undefined;
caption?: string | undefined;
};
};
key: {
id: string;
remoteJid: string;
};
messageTimestamp: Date;
}>, {
receiver: {
phoneNumber: libphonenumber_js.E164Number;
jid: `${string}@s.whatsapp.net`;
};
media: {
url: string;
caption: string | undefined;
mimetype: string | undefined;
gifPlayback: boolean;
length: number;
sha256: string;
encryptedSha256: string;
directPath: string;
key: string;
keyTimestamp: Date;
};
id: MessageId;
timestamp: Date;
}, {
message: {
videoMessage: {
url: string;
fileSha256: string;
fileLength: number;
mediaKey: string;
fileEncSha256: string;
directPath: string;
mediaKeyTimestamp: number;
gifPlayback: boolean;
mimetype?: string | undefined;
caption?: string | undefined;
};
};
key: {
id: string;
remoteJid: string;
};
messageTimestamp: Date;
}>;
type VideoMessageOptions = z.infer<typeof VideoMessageOptionsSchema>;
type VideoMessageResponse = z.infer<typeof VideoMessageResponseSchema>;
export { VideoMessageBodySchema as BodySchema, VideoMessageOptionsSchema as OptionsSchema, VideoMessageResponseSchema as ResponseSchema, VideoMessageBodySchema, type VideoMessageOptions, VideoMessageOptionsSchema, type VideoMessageResponse, VideoMessageResponseSchema };