import * as IShared from '../../../shared/interface'; import { EmailTemplate, EmailTemplateAttachment } from '../../../shared/entities/integration'; import { IEmailAddress, IEmailAttachment } from '../emailLog/interfaces'; export type Entity = EmailTemplate; export declare const Route = "email_template"; export declare const UpperName = "EmailTemplate"; export declare const LowerName: string; export interface IEntityExtended extends Entity { attachments: EmailTemplateAttachment[]; } export interface ICreateAttachments { multimedia_id: string; name: string; } export interface ICreateRequest { name: string; body: string; attachments: ICreateAttachments[]; key: string; } export interface IUpdateRequest { name?: string; body?: string; } export interface ISendRequest { owner_id: string | null; from: IEmailAddress; to: IEmailAddress[]; cc: IEmailAddress[]; bcc: IEmailAddress[]; subject: string; html: string; attachments: IEmailAttachment[]; } export interface EmailPreviewRequest { body: string; } export interface EmailPreviewResponse { html: string; } export interface IRepository { find(): Promise; create(data: ICreateRequest): Promise; update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise; deleteOne(selector: IShared.IFindByIdRequest): Promise; send(data: ISendRequest): Promise; preview(selector: IShared.IFindByIdRequest, data: EmailPreviewRequest): Promise; } export type IController = IShared.IEntityWithUserToken; export type IApi = IRepository;