import type { ApiServer } from '../ApiServer'; import type { UsageRepository } from '../../storage/quota/UsageRepository'; import type { PodLookupRepository } from '../../identity/drizzle/PodLookupRepository'; export interface UsageOwnershipResolver { ownsAccount(input: { webId: string; accountId: string; }): Promise; ownsPod(input: { webId: string; podId: string; }): Promise; } export interface UsageHandlerOptions { usageRepo: UsageRepository; /** Explicit Solid ownership proof. Solid requests fail closed when absent. */ ownershipResolver?: UsageOwnershipResolver; } /** * Adapt the canonical identity Pod lookup to the usage authorization boundary. * * A WebID is only considered to own an account or Pod when the identity store * returns an explicit linked record. No URL or identifier shape is inferred. */ export declare function createPodLookupUsageOwnershipResolver(podLookupRepository: Pick): UsageOwnershipResolver; /** * Handler for usage query API * * Requires ServiceAuthContext with 'usage:read' scope or explicit Solid * ownership. CSS Account sessions never cross into the API principal chain. * * GET /v1/usage/accounts/:accountId - Get account usage details * GET /v1/usage/pods/:podId - Get pod usage details */ export declare function registerUsageRoutes(server: ApiServer, options: UsageHandlerOptions): void;