UNPKG

tyntec-sdk

Version:

TypeScript SDK for Tyntec Conversations API V3

1,008 lines (1,007 loc) 30.9 kB
import { z } from 'zod'; export declare const templateComponentSchema: z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>; export declare const templateButtonSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"quick_reply">; index: z.ZodNumber; payload: z.ZodString; }, "strip", z.ZodTypeAny, { type: "quick_reply"; payload: string; index: number; }, { type: "quick_reply"; payload: string; index: number; }>, z.ZodObject<{ type: z.ZodLiteral<"url">; index: z.ZodNumber; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "url"; index: number; }, { text: string; type: "url"; index: number; }>]>; export declare const templateHeaderSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, z.ZodObject<{ type: z.ZodLiteral<"image">; image: z.ZodObject<{ url: z.ZodString; caption: z.ZodOptional<z.ZodString>; type: z.ZodOptional<z.ZodString>; privateUrl: z.ZodOptional<z.ZodString>; idFile: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }, { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }>; }, "strip", z.ZodTypeAny, { image: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "image"; }, { image: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "image"; }>, z.ZodObject<{ type: z.ZodLiteral<"video">; video: z.ZodObject<{ url: z.ZodString; caption: z.ZodOptional<z.ZodString>; type: z.ZodOptional<z.ZodString>; privateUrl: z.ZodOptional<z.ZodString>; idFile: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }, { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }>; }, "strip", z.ZodTypeAny, { video: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "video"; }, { video: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "video"; }>, z.ZodObject<{ type: z.ZodLiteral<"document">; document: z.ZodObject<{ url: z.ZodString; caption: z.ZodOptional<z.ZodString>; filename: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { url: string; caption?: string | undefined; filename?: string | undefined; }, { url: string; caption?: string | undefined; filename?: string | undefined; }>; }, "strip", z.ZodTypeAny, { document: { url: string; caption?: string | undefined; filename?: string | undefined; }; type: "document"; }, { document: { url: string; caption?: string | undefined; filename?: string | undefined; }; type: "document"; }>, z.ZodObject<{ type: z.ZodLiteral<"location">; location: z.ZodObject<{ longitude: z.ZodNumber; latitude: z.ZodNumber; name: z.ZodString; address: z.ZodString; }, "strip", z.ZodTypeAny, { name: string; longitude: number; latitude: number; address: string; }, { name: string; longitude: number; latitude: number; address: string; }>; }, "strip", z.ZodTypeAny, { type: "location"; location: { name: string; longitude: number; latitude: number; address: string; }; }, { type: "location"; location: { name: string; longitude: number; latitude: number; address: string; }; }>]>; export declare const templateComponentsSchema: z.ZodObject<{ header: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, z.ZodObject<{ type: z.ZodLiteral<"image">; image: z.ZodObject<{ url: z.ZodString; caption: z.ZodOptional<z.ZodString>; type: z.ZodOptional<z.ZodString>; privateUrl: z.ZodOptional<z.ZodString>; idFile: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }, { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }>; }, "strip", z.ZodTypeAny, { image: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "image"; }, { image: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "image"; }>, z.ZodObject<{ type: z.ZodLiteral<"video">; video: z.ZodObject<{ url: z.ZodString; caption: z.ZodOptional<z.ZodString>; type: z.ZodOptional<z.ZodString>; privateUrl: z.ZodOptional<z.ZodString>; idFile: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }, { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }>; }, "strip", z.ZodTypeAny, { video: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "video"; }, { video: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "video"; }>, z.ZodObject<{ type: z.ZodLiteral<"document">; document: z.ZodObject<{ url: z.ZodString; caption: z.ZodOptional<z.ZodString>; filename: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { url: string; caption?: string | undefined; filename?: string | undefined; }, { url: string; caption?: string | undefined; filename?: string | undefined; }>; }, "strip", z.ZodTypeAny, { document: { url: string; caption?: string | undefined; filename?: string | undefined; }; type: "document"; }, { document: { url: string; caption?: string | undefined; filename?: string | undefined; }; type: "document"; }>, z.ZodObject<{ type: z.ZodLiteral<"location">; location: z.ZodObject<{ longitude: z.ZodNumber; latitude: z.ZodNumber; name: z.ZodString; address: z.ZodString; }, "strip", z.ZodTypeAny, { name: string; longitude: number; latitude: number; address: string; }, { name: string; longitude: number; latitude: number; address: string; }>; }, "strip", z.ZodTypeAny, { type: "location"; location: { name: string; longitude: number; latitude: number; address: string; }; }, { type: "location"; location: { name: string; longitude: number; latitude: number; address: string; }; }>]>, "many">>; body: z.ZodOptional<z.ZodArray<z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, "many">>; button: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"quick_reply">; index: z.ZodNumber; payload: z.ZodString; }, "strip", z.ZodTypeAny, { type: "quick_reply"; payload: string; index: number; }, { type: "quick_reply"; payload: string; index: number; }>, z.ZodObject<{ type: z.ZodLiteral<"url">; index: z.ZodNumber; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "url"; index: number; }, { text: string; type: "url"; index: number; }>]>, "many">>; }, "strip", z.ZodTypeAny, { header?: ({ text: string; type: "text"; } | { image: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "image"; } | { video: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "video"; } | { document: { url: string; caption?: string | undefined; filename?: string | undefined; }; type: "document"; } | { type: "location"; location: { name: string; longitude: number; latitude: number; address: string; }; })[] | undefined; body?: { text: string; type: "text"; }[] | undefined; button?: ({ type: "quick_reply"; payload: string; index: number; } | { text: string; type: "url"; index: number; })[] | undefined; }, { header?: ({ text: string; type: "text"; } | { image: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "image"; } | { video: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "video"; } | { document: { url: string; caption?: string | undefined; filename?: string | undefined; }; type: "document"; } | { type: "location"; location: { name: string; longitude: number; latitude: number; address: string; }; })[] | undefined; body?: { text: string; type: "text"; }[] | undefined; button?: ({ type: "quick_reply"; payload: string; index: number; } | { text: string; type: "url"; index: number; })[] | undefined; }>; export declare const templateMessageSchema: z.ZodObject<{ senderName: z.ZodOptional<z.ZodString>; urlPreviewDisplayed: z.ZodOptional<z.ZodBoolean>; } & { contentType: z.ZodLiteral<"template">; template: z.ZodObject<{ templateId: z.ZodString; templateLanguage: z.ZodString; components: z.ZodObject<{ header: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, z.ZodObject<{ type: z.ZodLiteral<"image">; image: z.ZodObject<{ url: z.ZodString; caption: z.ZodOptional<z.ZodString>; type: z.ZodOptional<z.ZodString>; privateUrl: z.ZodOptional<z.ZodString>; idFile: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }, { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }>; }, "strip", z.ZodTypeAny, { image: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "image"; }, { image: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "image"; }>, z.ZodObject<{ type: z.ZodLiteral<"video">; video: z.ZodObject<{ url: z.ZodString; caption: z.ZodOptional<z.ZodString>; type: z.ZodOptional<z.ZodString>; privateUrl: z.ZodOptional<z.ZodString>; idFile: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }, { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }>; }, "strip", z.ZodTypeAny, { video: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "video"; }, { video: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "video"; }>, z.ZodObject<{ type: z.ZodLiteral<"document">; document: z.ZodObject<{ url: z.ZodString; caption: z.ZodOptional<z.ZodString>; filename: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { url: string; caption?: string | undefined; filename?: string | undefined; }, { url: string; caption?: string | undefined; filename?: string | undefined; }>; }, "strip", z.ZodTypeAny, { document: { url: string; caption?: string | undefined; filename?: string | undefined; }; type: "document"; }, { document: { url: string; caption?: string | undefined; filename?: string | undefined; }; type: "document"; }>, z.ZodObject<{ type: z.ZodLiteral<"location">; location: z.ZodObject<{ longitude: z.ZodNumber; latitude: z.ZodNumber; name: z.ZodString; address: z.ZodString; }, "strip", z.ZodTypeAny, { name: string; longitude: number; latitude: number; address: string; }, { name: string; longitude: number; latitude: number; address: string; }>; }, "strip", z.ZodTypeAny, { type: "location"; location: { name: string; longitude: number; latitude: number; address: string; }; }, { type: "location"; location: { name: string; longitude: number; latitude: number; address: string; }; }>]>, "many">>; body: z.ZodOptional<z.ZodArray<z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, "many">>; button: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"quick_reply">; index: z.ZodNumber; payload: z.ZodString; }, "strip", z.ZodTypeAny, { type: "quick_reply"; payload: string; index: number; }, { type: "quick_reply"; payload: string; index: number; }>, z.ZodObject<{ type: z.ZodLiteral<"url">; index: z.ZodNumber; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "url"; index: number; }, { text: string; type: "url"; index: number; }>]>, "many">>; }, "strip", z.ZodTypeAny, { header?: ({ text: string; type: "text"; } | { image: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "image"; } | { video: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "video"; } | { document: { url: string; caption?: string | undefined; filename?: string | undefined; }; type: "document"; } | { type: "location"; location: { name: string; longitude: number; latitude: number; address: string; }; })[] | undefined; body?: { text: string; type: "text"; }[] | undefined; button?: ({ type: "quick_reply"; payload: string; index: number; } | { text: string; type: "url"; index: number; })[] | undefined; }, { header?: ({ text: string; type: "text"; } | { image: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "image"; } | { video: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "video"; } | { document: { url: string; caption?: string | undefined; filename?: string | undefined; }; type: "document"; } | { type: "location"; location: { name: string; longitude: number; latitude: number; address: string; }; })[] | undefined; body?: { text: string; type: "text"; }[] | undefined; button?: ({ type: "quick_reply"; payload: string; index: number; } | { text: string; type: "url"; index: number; })[] | undefined; }>; }, "strip", z.ZodTypeAny, { components: { header?: ({ text: string; type: "text"; } | { image: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "image"; } | { video: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "video"; } | { document: { url: string; caption?: string | undefined; filename?: string | undefined; }; type: "document"; } | { type: "location"; location: { name: string; longitude: number; latitude: number; address: string; }; })[] | undefined; body?: { text: string; type: "text"; }[] | undefined; button?: ({ type: "quick_reply"; payload: string; index: number; } | { text: string; type: "url"; index: number; })[] | undefined; }; templateId: string; templateLanguage: string; }, { components: { header?: ({ text: string; type: "text"; } | { image: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "image"; } | { video: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "video"; } | { document: { url: string; caption?: string | undefined; filename?: string | undefined; }; type: "document"; } | { type: "location"; location: { name: string; longitude: number; latitude: number; address: string; }; })[] | undefined; body?: { text: string; type: "text"; }[] | undefined; button?: ({ type: "quick_reply"; payload: string; index: number; } | { text: string; type: "url"; index: number; })[] | undefined; }; templateId: string; templateLanguage: string; }>; }, "strip", z.ZodTypeAny, { template: { components: { header?: ({ text: string; type: "text"; } | { image: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "image"; } | { video: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "video"; } | { document: { url: string; caption?: string | undefined; filename?: string | undefined; }; type: "document"; } | { type: "location"; location: { name: string; longitude: number; latitude: number; address: string; }; })[] | undefined; body?: { text: string; type: "text"; }[] | undefined; button?: ({ type: "quick_reply"; payload: string; index: number; } | { text: string; type: "url"; index: number; })[] | undefined; }; templateId: string; templateLanguage: string; }; contentType: "template"; senderName?: string | undefined; urlPreviewDisplayed?: boolean | undefined; }, { template: { components: { header?: ({ text: string; type: "text"; } | { image: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "image"; } | { video: { url: string; type?: string | undefined; caption?: string | undefined; privateUrl?: string | undefined; idFile?: string | undefined; }; type: "video"; } | { document: { url: string; caption?: string | undefined; filename?: string | undefined; }; type: "document"; } | { type: "location"; location: { name: string; longitude: number; latitude: number; address: string; }; })[] | undefined; body?: { text: string; type: "text"; }[] | undefined; button?: ({ type: "quick_reply"; payload: string; index: number; } | { text: string; type: "url"; index: number; })[] | undefined; }; templateId: string; templateLanguage: string; }; contentType: "template"; senderName?: string | undefined; urlPreviewDisplayed?: boolean | undefined; }>;