import { SmrtObject, SmrtObjectOptions } from '@happyvertical/smrt-core'; /** * Built-in provider names. The string type is intentionally open so apps can * add providers without a model migration. */ export type TenantIntegrationProvider = 'aws' | 'bifrost' | 'glitchtip' | 'imago' | 'matomo' | (string & {}); /** * Provisioning and health states for a tenant integration. * * - `unprovisioned`: no external resources have been created yet. * - `provisioning`: provisioning is currently queued or running. * - `active`: external resources exist and the latest health check passed. * - `drifted`: local bookkeeping disagrees with provider state. * - `failed`: the latest provisioning attempt or health check failed. */ export type TenantIntegrationStatus = 'unprovisioned' | 'provisioning' | 'active' | 'drifted' | 'failed'; export interface TenantIntegrationCheckSummary { name: string; ok: boolean; message?: string; } export interface TenantIntegrationOptions extends SmrtObjectOptions { tenantId?: string; provider?: TenantIntegrationProvider; externalIds?: Record | string; status?: TenantIntegrationStatus; lastCheckedAt?: Date | null; lastCheckSummary?: TenantIntegrationCheckSummary[] | string; lastError?: string | null; } export declare class TenantIntegration extends SmrtObject { /** * Tenant this integration belongs to. Combined with `provider`, this is the * natural key for the row. */ tenantId: string; /** * Provider identifier, such as `aws`, `matomo`, `glitchtip`, or an * app-defined provider string. */ provider: TenantIntegrationProvider; /** * Provider-side identifiers. Shape depends on the provider. This must not * contain provider credentials or secret material. */ externalIds: string; /** * Current provisioning/health status. */ status: TenantIntegrationStatus; /** * UTC timestamp of the most recent doctor/provisioning check. */ lastCheckedAt: Date | null; /** * Per-check pass/fail summary from the most recent doctor run. */ lastCheckSummary: string; /** * Most recent error message when `status === 'failed'`, or null otherwise. */ lastError: string | null; constructor(options?: TenantIntegrationOptions); initialize(): Promise; private normalizeJsonFields; getExternalIds(): Record; setExternalIds(externalIds: Record | string): void; getExternalId(key: string): string | undefined; setExternalId(key: string, value: string | undefined): void; getLastCheckSummary(): TenantIntegrationCheckSummary[]; setLastCheckSummary(summary: TenantIntegrationCheckSummary[] | string): void; recordDoctorRun(outcome: { status: TenantIntegrationStatus; summary: TenantIntegrationCheckSummary[]; error?: string | null; }): void; } //# sourceMappingURL=TenantIntegration.d.ts.map