{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { ICourierMessage, IDefaultTemplate } from '@fonderie/core/types';\nimport type { ILocaleSettings } from '@fonderie/core';\n\nexport type { ICourierMessage, IDefaultTemplate };\n\n// A module ships its built-in copy as Record<ItsMessageKey, IDefaultTemplate>;\n// the app hands courier one (or an array, aggregated like getMigrationsPath())\n// and the resolver falls back to it before the last-resort JSON dump.\nexport type DefaultTemplateMap = Record<string, IDefaultTemplate>;\n\n// What a channel learned from the provider about a successful send. The\n// provider message id is what delivery webhooks key their updates on — a\n// channel that doesn't return it leaves delivery tracking permanently\n// 'sent' (the webhook UPDATE matches zero rows).\nexport interface ISendResult {\n\tproviderMessageId?: string;\n}\n\nexport interface ICourierChannel {\n\tname: string;\n\tsend(message: ICourierMessage, template: IRenderedTemplate): Promise<ISendResult | void>;\n}\n\nexport interface IRenderedTemplate {\n\tsubject?: string; // email only\n\thtml?: string; // email only\n\ttext: string; // all channels\n\t// The version actually used — a saved row's tag, a built-in's language, or\n\t// the system locale for the default copy. Absent for the last-resort dump.\n\t// Recorded in the message log beside the locale that was asked for.\n\tlocale?: string;\n}\n\nexport interface ITemplateResolver {\n\tresolve(type: string, data: Record<string, unknown>, locale?: string): Promise<IRenderedTemplate>;\n\t/** Receives the app's locales at install (core owns them). Optional for custom resolvers. */\n\tsetLocales?(settings: ILocaleSettings): void;\n}\n\nexport type { IMessageLog, MessageLogStatus } from './log';\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}