UNPKG

@wepublish/api

Version:
24 lines (23 loc) 992 B
import { MailTemplate, PrismaClient } from '@prisma/client'; import { MailContext, MailProviderTemplate } from "../../../../mail-api/src"; export interface MailTemplateSyncDiff { remoteNew: MailProviderTemplate[]; remoteExisting: MailProviderTemplate[]; localOutdated: MailTemplate[]; } export declare class MailTemplateSyncService { private prismaService; private mailContext; constructor(prismaService: PrismaClient, mailContext: MailContext); /** * Synchronizes the local template list with the remote mail provider. * This performs the following actions: * - updates locally existing templates to match their remote counterpart * - creates local templates for any new remote templates * - marks any local templates as outdated if their remote counterpart is missing */ synchronizeTemplates(): Promise<void>; private findUpdatedRemoteTemplates; private findNewRemoteTemplates; private findOutdatedLocalTemplates; }