/** * Types for tenant-lifecycle operations. * * `Querier` is structurally compatible with `@venturekit/data`'s * `Querier` and `@venturekit-pro/audit`'s `Querier`. We re-declare * it locally rather than peer-depend so the package builds in * isolation and works with any caller's pg-like driver adapter. */ export type Querier = []>(sql: string, params?: unknown[]) => Promise; /** Lifecycle status this package mutates `tenants.status` between. */ export type TenantLifecycleStatus = 'active' | 'suspended' | 'archived'; export interface LifecycleArgs { tenantId: string; /** Optional Cognito sub of the operator — surfaced in the audit hook below. */ actorUserId?: string; /** Optional reason — written to `tenants.metadata.lifecycleReason` when set. */ reason?: string; } /** * Audit hook: called with one event per lifecycle action. Apps * forward this to `@venturekit-pro/audit`'s `record()` (or their * own log). Optional — when omitted, lifecycle ops happen silently. */ export interface LifecycleAuditEvent { /** Always `'tenant.lifecycle'`. */ kind: 'tenant.lifecycle'; /** Which lifecycle action fired. */ action: 'suspend' | 'archive' | 'restore' | 'hard_delete'; tenantId: string; actorUserId?: string; reason?: string; /** For hard delete: the table name → number of rows removed. */ cascadeCounts?: Record; occurredAt: string; } export type LifecycleAuditSink = (event: LifecycleAuditEvent) => void | Promise; //# sourceMappingURL=types.d.ts.map