import { type H3Event } from "h3"; import type { OrgContext, OrgRole } from "./types.js"; export declare function hasOrgScopeResolutionUnavailable(event: { context?: Record; }): boolean; export declare function queryOrgMembers(query: { sql: string; args: unknown[]; }): Promise[] | null>; export declare function getOrgContext(event: H3Event): Promise; export type OrgMembership = { orgId: string; role: OrgRole; orgName: string; allowedDomain: string | null; identityAuthority: string | null; identityId: string | null; }; export declare function isFederationMembershipValidatedForEvent(event: H3Event, email: string | undefined, orgId: string | undefined): boolean; /** * Point this caller's later requests at a fresh `active-org-id` read on every * instance. Call after the caller's own preference was written in this request. */ export declare function markActiveOrgSelectionChanged(event: H3Event): void; export declare function listOrgMemberships(email: string): Promise; export declare function listOrgMembershipsForEvent(event: H3Event, email: string, selectedOrgId: string | null): Promise; export declare function getActiveOrgSettingForEvent(event: H3Event, email: string): Promise<{ orgId: string | null; } | null>; export type OrgScopeResolution = { status: "organization"; orgId: string; } | { status: "personal"; } | { status: "unknown"; }; export declare function resolveOrgScopeForEmail(email: string): Promise; export declare function resolveOrgIdForEmail(email: string): Promise; export declare function resolveActiveOrgIdForStorageCredential(email: string): Promise; export declare function resolveOrgIdForEmailViaEvent(event: H3Event, email: string): Promise; export declare function createOrganization(name: string, email: string, role?: OrgRole, options?: { id?: string; identityAuthority?: string; identityId?: string; /** The creating caller's request; see `setActiveOrgId`. */ event?: H3Event; }): Promise<{ id: string; name: string; role: OrgRole; a2aSecret: string; createdAt: number; }>; export declare function bootstrapAdminOrganization(rawEmail: string, event?: H3Event): Promise; export declare function getOrgDomain(orgId: string): Promise; export declare function getOrgWorkspaceUrl(orgId: string): Promise; export declare function getOrgA2ASecret(orgId: string): Promise; export declare function getA2ASecretByDomain(domain: string): Promise; export type OrgDomainLookup = { status: "found"; org: { orgId: string; orgName: string; }; } | { status: "not-found"; } | { status: "ambiguous"; }; export declare function lookupOrgByDomain(domain: string): Promise; export declare function resolveOrgByDomain(domain: string): Promise<{ orgId: string; orgName: string; } | null>; export declare function resolveA2AOrganizationMetadataByDomain(domain: string): Promise<{ orgId: string; orgDomain: string | null; } | null>; export declare function resolveA2AOrganizationMetadataById(orgId: string): Promise<{ orgId: string; orgDomain: string | null; } | null>; export declare function resolveA2AOrganizationCredentialsByDomain(domain: string): Promise<{ orgId: string; orgDomain: string; secret: string; a2aMemberDelegationEnabled: boolean; } | null>; export declare function isSoleOrgDomain(domain: string): Promise;