@solufy/evolution-sdk
Version:
Unofficial SDK for the Evolution Whatsapp API v2
294 lines (291 loc) • 8.17 kB
text/typescript
import * as libphonenumber_js from 'libphonenumber-js';
import { z } from 'zod';
import { MessageId } from '../../../types/tags.mjs';
declare const ContactMessageOptionsSchema: 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>;
} & {
/**
* Contact list
*/
contacts: z.ZodArray<z.ZodObject<{
/**
* Contact display name
*/
fullName: z.ZodString;
/**
* Contact phone number
*/
phoneNumber: z.ZodEffects<z.ZodType<string, z.ZodTypeDef, string>, string, string>;
/**
* Contact organization
*/
organization: z.ZodOptional<z.ZodString>;
/**
* Contact email
*/
email: z.ZodOptional<z.ZodString>;
/**
* Contact website url
*/
url: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
fullName: string;
phoneNumber: string;
url?: string | undefined;
organization?: string | undefined;
email?: string | undefined;
}, {
fullName: string;
phoneNumber: string;
url?: string | undefined;
organization?: string | undefined;
email?: string | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
number: string;
contacts: {
fullName: string;
phoneNumber: string;
url?: string | undefined;
organization?: string | undefined;
email?: string | undefined;
}[];
delay?: number | undefined;
}, {
number: string;
contacts: {
fullName: string;
phoneNumber: string;
url?: string | undefined;
organization?: string | undefined;
email?: string | undefined;
}[];
delay?: number | undefined;
}>;
declare const ContactMessageBodySchema: 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>;
} & {
/**
* Contact list
*/
contacts: z.ZodArray<z.ZodObject<{
/**
* Contact display name
*/
fullName: z.ZodString;
/**
* Contact phone number
*/
phoneNumber: z.ZodEffects<z.ZodType<string, z.ZodTypeDef, string>, string, string>;
/**
* Contact organization
*/
organization: z.ZodOptional<z.ZodString>;
/**
* Contact email
*/
email: z.ZodOptional<z.ZodString>;
/**
* Contact website url
*/
url: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
fullName: string;
phoneNumber: string;
url?: string | undefined;
organization?: string | undefined;
email?: string | undefined;
}, {
fullName: string;
phoneNumber: string;
url?: string | undefined;
organization?: string | undefined;
email?: string | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
number: string;
contacts: {
fullName: string;
phoneNumber: string;
url?: string | undefined;
organization?: string | undefined;
email?: string | undefined;
}[];
delay?: number | undefined;
}, {
number: string;
contacts: {
fullName: string;
phoneNumber: string;
url?: string | undefined;
organization?: string | undefined;
email?: string | undefined;
}[];
delay?: number | undefined;
}>, {
contact: {
phoneNumber: string;
wuid: string;
fullName: string;
url?: string | undefined;
organization?: string | undefined;
email?: string | undefined;
}[];
number: string;
delay?: number | undefined;
}, {
number: string;
contacts: {
fullName: string;
phoneNumber: string;
url?: string | undefined;
organization?: string | undefined;
email?: string | undefined;
}[];
delay?: number | undefined;
}>;
declare const ContactMessageResponseSchema: 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.ZodUnion<[z.ZodObject<{
contactMessage: z.ZodObject<{
displayName: z.ZodString;
vcard: z.ZodString;
}, "strip", z.ZodTypeAny, {
displayName: string;
vcard: string;
}, {
displayName: string;
vcard: string;
}>;
}, "strip", z.ZodTypeAny, {
contactMessage: {
displayName: string;
vcard: string;
};
}, {
contactMessage: {
displayName: string;
vcard: string;
};
}>, z.ZodObject<{
contactsArrayMessage: z.ZodObject<{
contacts: z.ZodArray<z.ZodObject<{
displayName: z.ZodString;
vcard: z.ZodString;
}, "strip", z.ZodTypeAny, {
displayName: string;
vcard: string;
}, {
displayName: string;
vcard: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
contacts: {
displayName: string;
vcard: string;
}[];
}, {
contacts: {
displayName: string;
vcard: string;
}[];
}>;
}, "strip", z.ZodTypeAny, {
contactsArrayMessage: {
contacts: {
displayName: string;
vcard: string;
}[];
};
}, {
contactsArrayMessage: {
contacts: {
displayName: string;
vcard: string;
}[];
};
}>]>;
messageTimestamp: z.ZodDate;
}, "strip", z.ZodTypeAny, {
message: {
contactMessage: {
displayName: string;
vcard: string;
};
} | {
contactsArrayMessage: {
contacts: {
displayName: string;
vcard: string;
}[];
};
};
key: {
id: string;
remoteJid: string;
};
messageTimestamp: Date;
}, {
message: {
contactMessage: {
displayName: string;
vcard: string;
};
} | {
contactsArrayMessage: {
contacts: {
displayName: string;
vcard: string;
}[];
};
};
key: {
id: string;
remoteJid: string;
};
messageTimestamp: Date;
}>, {
receiver: {
phoneNumber: libphonenumber_js.E164Number;
jid: `${string}@s.whatsapp.net`;
};
contacts: {
displayName: string;
vcard: string;
}[];
id: MessageId;
timestamp: Date;
}, {
message: {
contactMessage: {
displayName: string;
vcard: string;
};
} | {
contactsArrayMessage: {
contacts: {
displayName: string;
vcard: string;
}[];
};
};
key: {
id: string;
remoteJid: string;
};
messageTimestamp: Date;
}>;
type ContactMessageOptions = z.infer<typeof ContactMessageOptionsSchema>;
type ContactMessageResponse = z.infer<typeof ContactMessageResponseSchema>;
export { ContactMessageBodySchema as BodySchema, ContactMessageBodySchema, type ContactMessageOptions, ContactMessageOptionsSchema, type ContactMessageResponse, ContactMessageResponseSchema, ContactMessageOptionsSchema as OptionsSchema, ContactMessageResponseSchema as ResponseSchema };