import { type Database } from "./database.js"; import type { Permission, SiteAssetManifest } from "@opengeni/contracts"; /** * Published Sites storage (migration 0782). Every read and write runs in the * Site's workspace RLS context, except the hostname lane: a label lookup that * names exactly one row of `site_hostnames` (and of `site_hostname_holds`) * through the `opengeni.site_hostname_label` setting (the api_keys hash * pattern; a row-level policy, not a SECURITY DEFINER function). The API * decides who may do what; these functions enforce shapes, uniqueness, the * release hold, platform holds, single use and the spend reservations. * * Everything that claims, releases or publishes one hostname runs under a * transaction advisory lock on that label, so edge writes for a hostname * happen in generation order. */ export type SitePublishingScope = { accountId: string; workspaceId: string; }; export type SitePublishingErrorCode = "not_found" | "taken" | "held" | "reserved" | "conflict" | "forbidden" | "validation"; export declare class SitePublishingError extends Error { readonly code: SitePublishingErrorCode; constructor(code: SitePublishingErrorCode, message: string); } export type SitePublicationAccess = "members" | "invited" | "public"; export type SitePublicationStatusValue = "active" | "unpublished" | "suspended"; export type SiteSuspendedBy = "owner" | "admin" | "platform"; /** Public `standard` retains the stored spelling `free` for previous-release readers. */ export type SiteLimitProfileKindValue = "standard" | "free" | "credits" | "unlimited" | "custom"; export type SiteViewerKindValue = "member" | "invited" | "user"; export type StoredSiteLimitProfile = { kind: SiteLimitProfileKindValue; overrides: Record | null; }; export type SitePublicationRecord = { siteId: string; accountId: string; workspaceId: string; label: string; access: SitePublicationAccess; status: SitePublicationStatusValue; noindex: boolean; agent: { enabled: boolean; model: string | null; instructions: string | null; tools: string[] | null; /** Anonymous guests' conversations get `tools` too (an admin's opt-in). */ guestTools: boolean; }; /** The Site's own profile; null inherits the workspace default. */ limitProfile: StoredSiteLimitProfile | null; invitedEmails: string[]; suspendedAt: Date | null; suspendedBy: SiteSuspendedBy | null; suspendedReason: string | null; suspendedBySubject: string | null; generation: number; edgeSyncedGeneration: number; scanStatus: "none" | "clean" | "flagged" | "error"; scanFindings: unknown[] | null; scannedVersionId: string | null; scannedAt: Date | null; createdBy: string; updatedBy: string; createdAt: Date; updatedAt: Date; }; /** The Site behind a publication, as published Sites need it. */ export type PublishedSiteRecord = { id: string; accountId: string; workspaceId: string; title: string; status: "active" | "archived"; visibility: "workspace_shared" | "user_private"; ownerSubjectId: string | null; createdBySubjectId: string; currentVersionId: string | null; }; export type SiteHostnameRecord = { label: string; accountId: string; workspaceId: string; siteId: string; createdAt: Date; releasedAt: Date | null; }; /** * A hold on a label. `platform`: a taken-down label no workspace may claim * until the operator lifts it. `release`: the label of a deleted Site or * workspace, kept for that workspace until `expiresAt` (written by the * database when the hostname row is deleted). */ export type SiteHostnameHoldRecord = { label: string; siteId: string; workspaceId: string; reason: string; heldBy: string; kind: "platform" | "release"; expiresAt: Date | null; createdAt: Date; }; /** The database floor for the release hold; settings may only lengthen it. */ export declare const SITE_HOSTNAME_MIN_HOLD_DAYS = 30; export declare function isSitePublishingUuid(value: string): boolean; /** * Find a hostname row and its platform hold by label across every workspace * (the hostname lane). Only the named rows are visible; nothing else about * any workspace is. */ export declare function findSiteHostnameState(db: Database, label: string): Promise<{ hostname: SiteHostnameRecord | null; hold: SiteHostnameHoldRecord | null; }>; /** Find a hostname row by label across every workspace (the hostname lane). */ export declare function findSiteHostname(db: Database, label: string): Promise; /** * Lift a hold by label (operator only, as the schema owner: the application * role cannot write holds, and the Site and workspace may be gone). Returns * whether a hold existed. */ export declare function liftSiteHostnameHold(db: Database, label: string): Promise; /** Whether `label` may be claimed by `siteId` in this workspace. */ export type SiteHostnameClaimCheck = { available: true; } | { available: false; problem: "taken" | "held" | "reserved"; }; /** Availability of a label for a Site (or any Site, when siteId is null) in this workspace. */ export declare function checkSiteHostnameClaim(db: Database, scope: SitePublishingScope, label: string, siteId: string | null, holdDays: number, now?: Date): Promise; export declare function getSitePublication(db: Database, scope: SitePublishingScope, siteId: string): Promise; /** The Site itself (any audience); callers decide whether it may be published or served. */ export declare function getPublishedSite(db: Database, scope: SitePublishingScope, siteId: string): Promise; /** A version of this Site (never another Site's), with its stored content key. */ export declare function getPublishedSiteVersion(db: Database, scope: SitePublishingScope, siteId: string, versionId: string): Promise<{ id: string; contentKey: string; contentSha256: string | null; sizeBytes: number; requestedTools: Array<{ serverId: string; toolName: string; }>; assetManifest: SiteAssetManifest | null; } | null>; /** * A version a published Site may still serve: its current version, or one * that a publish or rollback replaced within `graceSeconds` (pages already * open keep loading their assets). Any other version, even of this Site, is * not served. */ export declare function getServableSiteVersion(db: Database, scope: SitePublishingScope, input: { siteId: string; versionId: string; currentVersionId: string; graceSeconds: number; }): Promise<{ id: string; contentKey: string; contentSha256: string | null; sizeBytes: number; requestedTools: Array<{ serverId: string; toolName: string; }>; assetManifest: SiteAssetManifest | null; } | null>; export type SitePublicationChanges = { label?: string; access?: SitePublicationAccess; status?: "active" | "unpublished"; noindex?: boolean; agent?: Partial; /** undefined keeps the current profile; null inherits the workspace default. */ limitProfile?: StoredSiteLimitProfile | null; invitedEmails?: string[]; }; export type UpsertSitePublicationResult = { publication: SitePublicationRecord; created: boolean; previousLabel: string | null; }; /** * Create or change a Site's publication in one transaction: claim a new label * (globally unique, honouring the release hold), release the previous one, * and advance the generation. A suspended publication keeps its status; only * restore reactivates it. */ export declare function upsertSitePublication(db: Database, scope: SitePublishingScope, input: { siteId: string; /** Used when the publication is new and no label is given. */ defaultLabel: string; changes: SitePublicationChanges; actor: string; holdDays: number; /** Defaults for a new publication. */ defaults: { access: SitePublicationAccess; noindex: boolean; }; }): Promise; /** * Take a Site down at once. A platform takedown is never replaced by an * owner's or admin's, and also places a platform hold on the label: no * workspace may claim it while the hold lasts, even after the Site or its * workspace is deleted. */ export declare function suspendSitePublication(db: Database, scope: SitePublishingScope, siteId: string, input: { by: SiteSuspendedBy; reason: string; subject: string; }): Promise; /** * Restore a taken-down Site. Only the platform restores a platform takedown * (and lifts its hostname hold); an owner cannot lift an admin's takedown. */ export declare function restoreSitePublication(db: Database, scope: SitePublishingScope, siteId: string, input: { by: SiteSuspendedBy; subject: string; }): Promise; /** Advance the generation (a new version became current, or the Site changed). */ export declare function bumpSitePublicationGeneration(db: Database, scope: SitePublishingScope, siteId: string): Promise; /** Record that the edge holds `generation` (never moves backwards). */ export declare function markSitePublicationEdgeSynced(db: Database, scope: SitePublishingScope, siteId: string, generation: number): Promise; /** What the edge should hold for one hostname, read under that hostname's lock. */ export type SiteHostnameEdgeState = { label: string; /** The hostname row (live or released), or null when no row exists. */ hostname: SiteHostnameRecord | null; hold: SiteHostnameHoldRecord | null; /** The live Site that owns this label, with its publication. */ live: { publication: SitePublicationRecord; site: PublishedSiteRecord; } | null; /** A fresh generation for a tombstone when no Site is live on the label. */ tombstoneGeneration: number | null; }; /** * Read the edge state of one hostname under that hostname's advisory lock, * allocate a fresh tombstone generation when no Site is live on it, and * commit. The caller writes the edge after this returns, outside any * transaction: the lock orders the reads (and generations) against claims, * releases and takedowns, and the edge writer never replaces a newer * generation. The live Site is read in the workspace that owns the label, * wherever it moved. */ export declare function readSiteHostnameEdgeState(db: Database, label: string): Promise; /** * Cheap re-read after an edge write: the generation of the Site live on the * label now (null when none is), with no lock and no new generation. The * writer compares it with what it wrote and syncs again when it moved. */ export declare function readSiteHostnameLiveGeneration(db: Database, label: string): Promise<{ siteId: string; generation: number; } | null>; export declare function recordSitePublicationScan(db: Database, scope: SitePublishingScope, siteId: string, input: { versionId: string; status: "none" | "clean" | "flagged" | "error"; findings: unknown[]; }): Promise; export type SiteViewerIdentity = { subjectId: string; kind: SiteViewerKindValue; email: string | null; displayName: string | null; }; export declare function createSiteAuthCode(db: Database, scope: SitePublishingScope, input: SiteViewerIdentity & { siteId: string; codeHash: string; hostname: string; codeChallenge: string; redirectUri: string; ttlSeconds: number; }): Promise; /** * Consume a sign-in code exactly once. Returns the code's binding when it was * unused, unexpired and minted for this Site and host; null otherwise. A code * presented once is spent whatever the caller does next. */ export declare function consumeSiteAuthCode(db: Database, scope: SitePublishingScope, input: { siteId: string; codeHash: string; hostname: string; }): Promise<(SiteViewerIdentity & { codeChallenge: string; redirectUri: string; }) | null>; export type SiteViewerSessionRecord = SiteViewerIdentity & { id: string; siteId: string; expiresAt: Date; /** The role the owner previews the Site as ("View as visitor"); null when not previewing. */ viewAs?: SiteViewAsValue | null; }; export type SiteViewAsValue = "invited" | "public"; export declare function createSiteViewerSession(db: Database, scope: SitePublishingScope, input: SiteViewerIdentity & { siteId: string; tokenHash: string; absoluteSeconds: number; }): Promise; /** * A live site-session of this Site by token hash: not revoked, before its * absolute expiry and used within the idle window. Marks it used at most once * a minute, so steady traffic costs no writes. */ export declare function findSiteViewerSession(db: Database, scope: SitePublishingScope, input: { siteId: string; tokenHash: string; idleSeconds: number; }): Promise; /** * Start (`invited`, `public`) or end (null) previewing a Site as another * role on one live viewer session. The API applies it only while the * session's person is a workspace member, and only to see less. */ export declare function setSiteViewerSessionViewAs(db: Database, scope: SitePublishingScope, input: { siteId: string; sessionId: string; viewAs: SiteViewAsValue | null; }): Promise; export declare function revokeSiteViewerSession(db: Database, scope: SitePublishingScope, input: { siteId: string; tokenHash: string; }): Promise; /** Revoke every live site-session of a Site (takedown, unpublish, narrower access). */ export declare function revokeSiteViewerSessions(db: Database, scope: SitePublishingScope, siteId: string): Promise; /** Whether the subject holds live authority in this workspace (re-checked on every runtime call). */ export declare function isSiteWorkspaceMember(db: Database, scope: SitePublishingScope, subjectId: string): Promise; /** * The subject's workspace permissions (normalized), or null when they hold no * live workspace authority. A Site conversation of a member gets only the * Site's tools that member may use themselves. * * For a managed person (`user:`) live authority is the canonical rule * (`subjectHasLiveWorkspaceAuthorityInScope`): a membership row whose * organization membership is active, or the person's own personal workspace, * which has no membership row and carries the managed personal workspace * permissions. The subject was verified by Site sign-in (a managed cookie at * /v1/site-auth/authorize) and is named here from the Site viewer session, * never taken from the page. Other subjects (configured external actors) * keep the plain membership answer. * * Precondition: callers pass only a subject the API has already proven (a * Site viewer session or site-auth code); this answers for that subject, it * does not authenticate it. The probed subject and the organization * tenancy lifecycle that `list_self_organization_memberships` sets are both * restored before returning, so a caller's transaction never keeps them. */ export declare function getSiteWorkspaceMemberPermissions(db: Database, scope: SitePublishingScope, subjectId: string): Promise; export declare function getWorkspaceSiteLimitProfile(db: Database, scope: SitePublishingScope): Promise; export declare function putWorkspaceSiteLimitProfile(db: Database, scope: SitePublishingScope, profile: StoredSiteLimitProfile, actor: string): Promise; /** Verified identity retained at start; legacy conversations use a matching signed-in Site session. */ export declare function siteRuntimeConversationViewerEmail(db: Database, scope: SitePublishingScope, sessionId: string): Promise; /** Who started a Site conversation, as the Site saw them then. */ export type SiteRuntimeConversationViewerKind = "member" | "invited" | "user" | "guest"; export type SiteRuntimeConversationRecord = { sessionId: string; siteId: string; viewerPrincipal: string; viewerKind: SiteRuntimeConversationViewerKind; /** The workspace tools (MCP connection ids) the conversation was started with. */ toolIds: string[]; /** * The Site-wide usage windows it counts in: `*` for viewers outside the * workspace (the Site's budgets), `*members` for workspace members. */ budgetKey: string; versionId: string | null; turns: number; meteredMicros: number; /** The conversation's total spend cap; execution receives only funded increments. */ limitMicros: number | null; reservedMicros: number; /** Work admitted so far (start, messages, steering, resumes). */ admissions: number; createdAt: Date; /** Last admitted work or counted spend. */ updatedAt: Date; }; /** A returned dispatch has finished; exceptions retain the pending marker for reconciliation. */ export declare function finishSiteRuntimeAdmission(db: Database, scope: SitePublishingScope, input: { sessionId: string; admissionId: string; }): Promise; /** The conversation when it belongs to this Site and viewer; null otherwise. */ export declare function getOwnedSiteRuntimeConversation(db: Database, scope: SitePublishingScope, input: { sessionId: string; siteId: string; viewerPrincipal: string; }): Promise; /** * Whether an agent session belongs to a published Site's agent, and which * conversation (Site and viewer) it serves. A session tree whose root was * started by a Site's service principal (`site:`) is a Site agent; * its conversation row names the viewer. `siteAgent` without a conversation * (a row that is gone or never written) must fail closed. A session that * cannot be read is reported as a Site agent without a conversation too. */ export declare function findSiteRuntimeAgentConversation(db: Database, scope: SitePublishingScope, sessionId: string): Promise<{ siteAgent: boolean; conversation: SiteRuntimeConversationRecord | null; }>; export declare function listOwnedSiteRuntimeConversations(db: Database, scope: SitePublishingScope, input: { siteId: string; viewerPrincipal: string; limit: number; }): Promise; /** Age triggers reconciliation; the canonical queue still decides whether funding can be released. */ export declare const SITE_RUNTIME_RESERVATION_MAX_IDLE_HOURS = 6; /** A start whose session has not appeared after this long failed before its create committed. */ export declare const SITE_RUNTIME_ABANDONED_START_MINUTES = 10; export type SiteRuntimeSweepCandidate = SiteRuntimeConversationRecord & { /** No admitted work or counted spend for `SITE_RUNTIME_RESERVATION_MAX_IDLE_HOURS`. */ aged: boolean; }; /** * Claim up to `limit` of the Site's conversations whose reservation can * likely be released, and mark them visited: those whose session is idle, * failed or cancelled, starts whose session never appeared, and * reservations inactive for `SITE_RUNTIME_RESERVATION_MAX_IDLE_HOURS`. * Least recently visited first, each at most every 30 seconds, so repeated * sweeps move through the Site instead of revisiting the same rows. * Running conversations are not candidates: settling them would only move * reserved spend into counted spend, freeing nothing. */ export declare function claimSiteRuntimeReservationSweep(db: Database, scope: SitePublishingScope, input: { siteId: string; limit: number; now?: Date; }): Promise; /** * The Site's conversations whose session may still be working, among those * active in the last two days (bounded: at most `limit`, newest first). */ export declare function listActiveSiteRuntimeConversations(db: Database, scope: SitePublishingScope, input: { siteId: string; limit: number; }): Promise; /** Keyset-paged lifecycle inventory; no viewer transcript or age/count cutoff. */ export declare function listSiteRuntimeCancellationCandidates(db: Database, scope: SitePublishingScope, input: { siteId: string; after?: string; limit: number; startedBefore: Date; }): Promise; export type SiteRuntimeUsageSnapshot = { visitorDay: { conversations: number; agentMicros: number; reservedMicros: number; }; visitorMonth: { conversations: number; agentMicros: number; reservedMicros: number; }; siteDay: { conversations: number; agentMicros: number; reservedMicros: number; }; siteMonth: { conversations: number; agentMicros: number; reservedMicros: number; }; }; /** The Site-wide principal key in usage windows. */ export declare const SITE_RUNTIME_SITE_PRINCIPAL = "*"; /** The Site-wide key of workspace members' conversations (apart from the Site's budgets). */ export declare const SITE_RUNTIME_MEMBERS_PRINCIPAL = "*members"; /** Current-period counters for a viewer and the Site, from three primary-key rows. */ export declare function readSiteRuntimeUsage(db: Database, scope: SitePublishingScope, input: { siteId: string; viewerPrincipal: string; /** The Site-wide key to read (default `*`, the Site's budgets). */ sitePrincipal?: string; now?: Date; }): Promise; /** The budgets a reservation is checked against (the Site's effective limits). */ export type SiteRuntimeBudgetLimits = { conversationsPerVisitorPerDay: number | null; conversationsPerSitePerDay: number | null; turnsPerConversation: number | null; agentMicrosPerConversation: number | null; agentMicrosPerVisitorPerDay: number | null; agentMicrosPerVisitorPerMonth?: number | null; agentMicrosPerSitePerDay?: number | null; agentMicrosPerSitePerMonth: number | null; /** * What one turn holds against the spend budgets while it runs (its actual * spend replaces it when settled), at most the conversation's own cap. * Unset: the whole cap. */ turnReservationMicros?: number | null; }; export type SiteRuntimeBudget = "conversations_per_visitor_per_day" | "conversations_per_site_per_day" | "turns_per_conversation" | "agent_micros_per_conversation" | "agent_micros_per_visitor_per_day" | "agent_micros_per_visitor_per_month" | "agent_micros_per_site_per_day" | "agent_micros_per_site_per_month"; export type SiteRuntimeReservation = { ok: true; limitMicros: number | null; executionLimitMicros: number | null; reservedMicros: number; /** A keyed Start was initialized while its repair request was being prepared. */ alreadyStarted?: boolean; } | { ok: false; budget: SiteRuntimeBudget; /** * Only what running conversations hold refuses it: the budget has room * once their spend settles, so a retry shortly may succeed. */ busy?: boolean; }; /** Hold the reservation row while its funded execution ceiling is stamped. */ export declare function siteRuntimeFundedLimitInTransaction(tx: Database, scope: SitePublishingScope, sessionId: string): Promise; /** A conversation is not started on less than this (or its cap, when smaller). */ export declare const SITE_RUNTIME_MIN_RESERVATION_MICROS = 1000; /** * Start a conversation: in one transaction, count the start against the * visitor's and the Site's daily starts, and reserve its first turn (the * per-turn estimate, at most its cap) in the visitor's day and month and the * Site's day and month, refusing when any budget would be exceeded (`busy` * when only other running conversations' reservations are in the way). The * cap is the per-conversation limit, lowered to what the budgets still have; * the separate executionLimitMicros funds only this first increment. * The conversation row records the owner (Site and viewer) before the * session exists; `releaseSiteRuntimeConversationStart` undoes all of it. */ export declare function reserveSiteRuntimeConversationStart(db: Database, scope: SitePublishingScope, input: { sessionId: string; siteId: string; viewerPrincipal: string; viewerKind: SiteRuntimeConversationViewerKind; /** Verified at sign-in, never taken from tool arguments. */ viewerEmail?: string | null; toolIds: readonly string[]; versionId: string | null; limits: SiteRuntimeBudgetLimits; /** The Site-wide windows to count in (default `*`; members use `*members`). */ budgetKey?: string; admissionId?: string; now?: Date; }): Promise; /** * Undo a conversation start whose session was never created: release its * reservation, uncount the start and forget the conversation. */ export declare function releaseSiteRuntimeConversationStart(db: Database, scope: SitePublishingScope, input: { sessionId: string; }): Promise; /** * Admit agent work in an existing conversation (a new message when * `newTurn`, else steering, resuming or running a queued message): under the * turn cap and its own spend cap, and set its reservation to one turn's * estimate (at most what the conversation may still spend), refusing when a * budget cannot hold it (`busy` when only other conversations' reservations * are in the way). A per-conversation limit lowered since the start lowers * the conversation's cap (returned as `limitMicros`; the caller stamps only * executionLimitMicros, cumulative spend plus funding, before work). `uncapped` (a workspace * member's conversation, including one started before members were uncapped) * drops the conversation's own cap and holds no reservation. */ export declare function reserveSiteRuntimeConversationWork(db: Database, scope: SitePublishingScope, input: { sessionId: string; limits: SiteRuntimeBudgetLimits; newTurn: boolean; uncapped?: boolean; admissionId?: string; /** Repair only the first Start; do not fund a replay that already initialized. */ repairStart?: boolean; now?: Date; }): Promise; /** * Bring a conversation's counted spend up to `usedMicros` (its session usage * so far): add the difference to the viewer's day and the Site's day and * month, and release that much of its reservation. When the session is * `idle` (no turn running or queued) the whole reservation is released, but * only if no work was admitted since `expected` was read (its `admissions` * counter moves with every admission, even one that leaves the reservation * as it was). Never counts the same micro twice; spend never goes down. * Returns the spend added. */ export declare function settleSiteRuntimeConversationSpend(db: Database, scope: SitePublishingScope, input: { sessionId: string; usedMicros: number; idle?: boolean; /** The conversation as read before the session status (guards the idle release). */ expected?: Pick; now?: Date; }): Promise; export type SiteRuntimeRateBucket = "requests" | "guest_writes" | "reports" | "sign_in"; /** * Count one operation in a fixed one-minute window for a principal and * bucket. Returns whether it is within `limit` and, when not, the seconds * until the window ends. */ export declare function consumeSiteRuntimeRate(db: Database, scope: SitePublishingScope, input: { siteId: string; principal: string; bucket: SiteRuntimeRateBucket; limit: number; now?: Date; /** Force (or skip) the stale-window cleanup; by default it runs on about 1% of calls. */ sweep?: boolean; }): Promise<{ allowed: boolean; retryAfterSeconds: number; }>; export type SiteModerationQueueItem = { kind: "report" | "flagged_scan"; accountId: string; workspaceId: string; siteId: string; label: string | null; status: SitePublicationStatusValue | null; /** Report category, or the scanner's finding count for a flagged scan. */ detail: string; message: string | null; contactEmail: string | null; reportId: string | null; at: Date; }; /** The database role operator tooling needs for cross-workspace reads. */ export declare const SITE_OPERATOR_ROLE_REQUIREMENT = "the database role that owns the Opengeni schema (the migrations credential, OPENGENI_MIGRATIONS_DATABASE_URL), or a superuser or BYPASSRLS role"; /** * The platform's moderation queue across every workspace: open abuse reports * and publications whose last content scan was flagged, newest first. For * operator tooling only, in a read-only transaction: the schema owner reads * through owner-only policies (no BYPASSRLS needed); the application role is * refused. */ export declare function listSiteModerationQueue(db: Database, input: { limit: number; }): Promise; /** * Find a publication by Site id across every workspace (operator tooling, * same global-read rules as the moderation queue). */ export declare function findSitePublicationGlobally(db: Database, siteId: string): Promise<{ accountId: string; workspaceId: string; label: string; } | null>; export type SiteAbuseReportRecord = { id: string; siteId: string; hostname: string; category: string; message: string; contactEmail: string | null; status: "open" | "dismissed" | "actioned"; createdAt: Date; }; /** Resolved (dismissed or actioned) reports are kept this long after they were made. */ export declare const SITE_ABUSE_REPORT_RETENTION_DAYS = 180; /** * Record an abuse report. The write also deletes up to 20 of the Site's * resolved reports older than the retention period (a bounded cleanup on the * write path); open reports stay until someone resolves them. */ export declare function createSiteAbuseReport(db: Database, scope: SitePublishingScope, input: { siteId: string; hostname: string; category: string; message: string; contactEmail: string | null; reporterPrincipal: string; }): Promise; export declare function listSiteAbuseReports(db: Database, scope: SitePublishingScope, input: { siteId: string; status?: SiteAbuseReportRecord["status"]; limit: number; }): Promise; export declare function countOpenSiteAbuseReports(db: Database, scope: SitePublishingScope, siteId: string): Promise; export declare function updateSiteAbuseReportStatus(db: Database, scope: SitePublishingScope, input: { siteId: string; reportId: string; status: SiteAbuseReportRecord["status"]; actor: string; }): Promise; /** Mark every open report of a Site actioned (after a takedown). */ export declare function actionOpenSiteAbuseReports(db: Database, scope: SitePublishingScope, input: { siteId: string; actor: string; }): Promise;