import { type Database } from "./database.js"; /** * EU-only content stays in EU-only workspaces. Content from an EU-only * workspace may reach another workspace only when that workspace is EU-only * too; content from any other workspace may go anywhere. Every check is per * workspace pair and asks only `isWorkspaceEuOnly`, so a per-workspace switch * applies here without changing callers. A failed read throws: nothing moves. * See docs/organization-tenancy.md. */ export type WorkspaceContentFlowEnd = { accountId: string; workspaceId: string; }; export declare const WORKSPACE_CONTENT_FLOW_REFUSED_MESSAGE = "Not supported in EU-only workspaces: content from an EU-only workspace can only go to another EU-only workspace."; export declare class WorkspaceContentFlowRefusedError extends Error { readonly sourceWorkspaceId: string; readonly targetWorkspaceId: string; readonly code: "region_restricted"; constructor(sourceWorkspaceId: string, targetWorkspaceId: string); } /** * A workspace with the organization it really belongs to, read from the * workspace itself; null when there is no such workspace. */ export declare function workspaceContentFlowEnd(db: Database, workspaceId: string): Promise; /** Refuse when content from `source` would reach `target` and only `source` is EU-only. */ export declare function assertWorkspaceContentFlowAllowed(db: Database, input: { source: WorkspaceContentFlowEnd; target: WorkspaceContentFlowEnd; }): Promise; /** * For a step that sends content into the other workspace and brings its * content back: allowed only when content may flow both ways. */ export declare function assertWorkspaceContentExchangeAllowed(db: Database, input: { here: WorkspaceContentFlowEnd; there: WorkspaceContentFlowEnd; }): Promise; /** * For a step that can bring content from any workspace of an organization to * `target` (an organization-wide connection): allowed when `target` is * EU-only, or when no workspace of that organization is. */ export declare function assertOrganizationContentFlowAllowed(db: Database, input: { sourceAccountId: string; target: WorkspaceContentFlowEnd; }): Promise; /** * For a step between `here` and any workspace of an organization that carries * content both ways (an organization-wide connection that can change things): * allowed only when content may go each way, so either every workspace of the * organization and `here` are EU-only, or none of them is. */ export declare function assertOrganizationContentExchangeAllowed(db: Database, input: { accountId: string; here: WorkspaceContentFlowEnd; }): Promise; /** * For an organization-wide setup that carries content both ways between any * workspace of `accountId` and any workspace of `otherAccountId` (an * organization connector holding an API key of that organization): allowed * only when every workspace of both is EU-only, or none of them is. */ export declare function assertOrganizationsContentExchangeAllowed(db: Database, input: { accountId: string; otherAccountId: string; }): Promise;