import { type Database } from "./database.js"; /** * Automation templates saved in a workspace (migration 0959). Everyone in the * workspace reads them; the API decides who may change one. `definition` is * stored as the API validated it and read back through the same schema. */ export interface AutomationTemplateRecord { id: string; accountId: string; workspaceId: string; name: string; description: string; definition: unknown; createdBySubjectId: string | null; createdAt: Date; updatedAt: Date; } /** Saving another template would pass the workspace's limit. */ export declare class AutomationTemplateLimitError extends Error { readonly name = "AutomationTemplateLimitError"; constructor(); } /** The workspace's templates, oldest first. */ export declare function listAutomationTemplates(db: Database, workspaceId: string): Promise; export declare function getAutomationTemplate(db: Database, workspaceId: string, templateId: string): Promise; export declare function createAutomationTemplate(db: Database, input: { accountId: string; workspaceId: string; name: string; description: string; definition: Record; createdBySubjectId: string | null; }): Promise; /** Null when it no longer exists. */ export declare function updateAutomationTemplate(db: Database, input: { workspaceId: string; templateId: string; name?: string | undefined; description?: string | undefined; definition?: Record | undefined; }): Promise; /** False when it no longer exists. */ export declare function deleteAutomationTemplate(db: Database, workspaceId: string, templateId: string): Promise;