@botonic/plugin-flow-builder
Version:
Botonic plugin for **Hubtype Flow Builder**: run and bridge flow-driven logic from bots on the **current** line.
76 lines (75 loc) • 2.47 kB
TypeScript
import type { WhatsappTemplateComponentSubType, WhatsappTemplateComponentType, WhatsappTemplateParameterType } from '@botonic/shared';
import type { HtButton } from './button';
import type { HtBaseNode, HtMediaFileLocale } from './common';
import type { HtNodeWithContentType } from './node-types';
export declare const WHATSAPP_TEMPLATE: {
readonly Buttons: "buttons";
};
type HtWhatsAppTemplateButton = {
type: WhatsappTemplateComponentSubType.Url;
text: string;
url?: string;
index: number;
} | {
type: WhatsappTemplateComponentSubType.QuickReply;
text: string;
id: string;
index: number;
} | {
type: WhatsappTemplateComponentSubType.PhoneNumber;
text: string;
phone_number: string;
index: number;
};
export interface HtWhatsAppTemplateHeaderComponent {
type: WhatsappTemplateComponentType.Header;
format: WhatsappTemplateParameterType.Text | WhatsappTemplateParameterType.Image | WhatsappTemplateParameterType.Video;
text?: string;
image?: {
link: string;
};
video?: {
link: string;
};
}
export interface HtWhatsAppTemplateBodyComponent {
type: WhatsappTemplateComponentType.Body;
text: string;
}
export interface HtWhatsAppTemplateFooterComponent {
type: WhatsappTemplateComponentType.Footer;
text: string;
}
export interface HtWhatsAppTemplateButtonsComponent {
type: typeof WHATSAPP_TEMPLATE.Buttons;
buttons: HtWhatsAppTemplateButton[];
}
export type HtWhatsAppTemplateComponent = HtWhatsAppTemplateHeaderComponent | HtWhatsAppTemplateBodyComponent | HtWhatsAppTemplateFooterComponent | HtWhatsAppTemplateButtonsComponent;
export interface HtWhatsAppTemplate {
id: string;
name: string;
language: string;
status: string;
category: string;
components: HtWhatsAppTemplateComponent[];
namespace: string;
parameter_format: string;
}
export interface HtWhatsappTemplateContentByLocale {
template: HtWhatsAppTemplate;
header_variables?: {
type: WhatsappTemplateParameterType;
text?: Record<string, string>;
media?: HtMediaFileLocale[];
};
variable_values: Record<string, string>;
url_variable_values?: Record<string, string>;
}
export interface HtWhatsappTemplateNode extends HtBaseNode {
type: HtNodeWithContentType.WHATSAPP_TEMPLATE;
content: {
by_locale: Record<string, HtWhatsappTemplateContentByLocale>;
buttons: HtButton[];
};
}
export {};