UNPKG

@solufy/evolution-sdk

Version:

Unofficial SDK for the Evolution Whatsapp API v2

243 lines (240 loc) 7.27 kB
import * as libphonenumber_js from 'libphonenumber-js'; import { z } from 'zod'; import { MessageId } from '../../../types/tags.js'; declare const ImageMessageOptionsSchema: 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>; } & { /** * Image URL or file in base64 */ image: z.ZodUnion<[z.ZodString, z.ZodString]>; /** * Caption to send with image */ caption: z.ZodOptional<z.ZodString>; /** * Image mimetype */ mimetype: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { number: string; image: string; delay?: number | undefined; mimetype?: string | undefined; caption?: string | undefined; }, { number: string; image: string; delay?: number | undefined; mimetype?: string | undefined; caption?: string | undefined; }>; declare const ImageMessageBodySchema: 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>; } & { /** * Image URL or file in base64 */ image: z.ZodUnion<[z.ZodString, z.ZodString]>; /** * Caption to send with image */ caption: z.ZodOptional<z.ZodString>; /** * Image mimetype */ mimetype: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { number: string; image: string; delay?: number | undefined; mimetype?: string | undefined; caption?: string | undefined; }, { number: string; image: 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; image: string; delay?: number | undefined; mimetype?: string | undefined; caption?: string | undefined; }>; declare const ImageMessageResponseSchema: 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<{ imageMessage: z.ZodObject<{ url: z.ZodString; mimetype: z.ZodOptional<z.ZodString>; fileSha256: z.ZodString; fileLength: z.ZodNumber; height: z.ZodNumber; width: z.ZodNumber; mediaKey: z.ZodString; caption: z.ZodOptional<z.ZodString>; 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; height: number; width: number; mimetype?: string | undefined; caption?: string | undefined; }, { url: string; fileSha256: string; fileLength: number; mediaKey: string; fileEncSha256: string; directPath: string; mediaKeyTimestamp: number; height: number; width: number; mimetype?: string | undefined; caption?: string | undefined; }>; }, "strip", z.ZodTypeAny, { imageMessage: { url: string; fileSha256: string; fileLength: number; mediaKey: string; fileEncSha256: string; directPath: string; mediaKeyTimestamp: Date; height: number; width: number; mimetype?: string | undefined; caption?: string | undefined; }; }, { imageMessage: { url: string; fileSha256: string; fileLength: number; mediaKey: string; fileEncSha256: string; directPath: string; mediaKeyTimestamp: number; height: number; width: number; mimetype?: string | undefined; caption?: string | undefined; }; }>; messageTimestamp: z.ZodDate; }, "strip", z.ZodTypeAny, { message: { imageMessage: { url: string; fileSha256: string; fileLength: number; mediaKey: string; fileEncSha256: string; directPath: string; mediaKeyTimestamp: Date; height: number; width: number; mimetype?: string | undefined; caption?: string | undefined; }; }; key: { id: string; remoteJid: string; }; messageTimestamp: Date; }, { message: { imageMessage: { url: string; fileSha256: string; fileLength: number; mediaKey: string; fileEncSha256: string; directPath: string; mediaKeyTimestamp: number; height: number; width: number; 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; length: number; height: number; width: number; sha256: string; encryptedSha256: string; directPath: string; key: string; keyTimestamp: Date; }; id: MessageId; timestamp: Date; }, { message: { imageMessage: { url: string; fileSha256: string; fileLength: number; mediaKey: string; fileEncSha256: string; directPath: string; mediaKeyTimestamp: number; height: number; width: number; mimetype?: string | undefined; caption?: string | undefined; }; }; key: { id: string; remoteJid: string; }; messageTimestamp: Date; }>; type ImageMessageOptions = z.infer<typeof ImageMessageOptionsSchema>; type ImageMessageResponse = z.infer<typeof ImageMessageResponseSchema>; export { ImageMessageBodySchema as BodySchema, ImageMessageBodySchema, type ImageMessageOptions, ImageMessageOptionsSchema, type ImageMessageResponse, ImageMessageResponseSchema, ImageMessageOptionsSchema as OptionsSchema, ImageMessageResponseSchema as ResponseSchema };