/** * The `vendo_automations` row, as this engine reads and writes it: the one * ownership gate every door goes through, and the per-kind queries the tick, * emit and webhook fire from. * * There is exactly one authority question about a record — is the caller its * owner, or a member of the org that owns it — because a record has no app for * an access seam to be asked about. */ import { type AutomationRecord, type RunContext, type TriggerSource, type VendoRecord } from "@vendoai/core"; import type { EngineBase } from "./engine-context.js"; export type AutomationRowsDeps = { base: EngineBase; }; export interface AutomationRowsAccess { /** The record and the store row it came from, or null when there is none. */ automationRecord(id: string): Promise<{ record: VendoRecord; row: AutomationRecord; } | null>; /** The record, for a caller allowed to change it — null when absent OR refused. */ ownedOrNull(id: string, ctx: RunContext): Promise<{ record: VendoRecord; row: AutomationRecord; } | null>; /** The same door, existence-masked, for callers that must refuse. */ owned(id: string, ctx: RunContext): Promise<{ record: VendoRecord; row: AutomationRecord; }>; /** Whether this caller speaks for that owner subject: it is their own, or an * org the memberships seam asserted for them. */ speaksFor(ctx: RunContext, subject: string): boolean; /** The write, with the refs every read path is indexed by. */ write(row: AutomationRecord): Promise; /** The armed records that fire on this trigger kind, by its per-kind ref. */ firingOn(kind: TriggerSource["kind"], refs?: Record): Promise; } export declare const createAutomationRows: ({ base: { engine } }: AutomationRowsDeps) => AutomationRowsAccess; //# sourceMappingURL=automation-rows.d.ts.map