import { ConnectionUseAttribution, type ConnectionUseDenialReason as ConnectionUseDenialReasonValue } from "@opengeni/contracts/connection-authority"; import { type ConnectionKind as ConnectionKindValue } from "@opengeni/contracts"; import { type Database } from "./database.js"; /** Called only after the core layer has established the authenticated sender. */ export declare function listOwnedConnectionAccounts(db: Database, input: { accountId: string; workspaceId: string; subjectId: string; }): Promise>; /** * `listOwnedConnectionAccounts` and then, only when there is an account and * `loginsTurnedOn` is true, `listOwnLoginsTurnedOn`, in the one owner scope * both use (the same account, workspace and subject): the same two answers, * one scope. Called only after the core layer has established the * authenticated sender. */ export declare function listOwnedConnectionAccountsAndLoginsTurnedOn(db: Database, input: { accountId: string; workspaceId: string; subjectId: string; loginsTurnedOn: boolean; }): Promise<{ accounts: Array<{ connectionId: string; originWorkspaceId: string; }>; /** Null when not read: no accounts, or `loginsTurnedOn` was false. */ turnedOn: Map | null; }>; export type AcceptedConnectionUseContext = { accountId: string; workspaceId: string; sessionId: string; turnId: string; attemptId: string; executionGeneration: number; physicalRequestId: string; usePhase: "credential_resolution" | "provider_request"; }; export type AcceptedConnectionUseResolution = { status: "denied"; reason: ConnectionUseDenialReasonValue; } | { status: "authorized"; originWorkspaceId: string; connectionKind: ConnectionKindValue; attribution: ConnectionUseAttribution; }; export declare function resolveAcceptedConnectionUse(db: Database, input: AcceptedConnectionUseContext & { serverId: string; connectionId?: string; providerDomain: string; connectionKind?: ConnectionKindValue; subjectScope?: "workspace" | "subject"; ownerSubjectId?: string; }): Promise;