/** * ArkType schemas for the auth-broker wire protocol. * * Shared between the server (validates inbound request bodies) and the client * (validates responses from the broker). Schemas mirror the TypeScript types * in `./types.ts` 1:1; the types remain the source of truth for static typing, * and `Type` is asserted-compatible with them where possible. * * Envelope and fixed-shape schemas use `"+": "reject"` so unknown keys are * rejected — the previous implementation used a hand-rolled `hasOnlyFields` * allowlist for the same effect. The OAuth credential schema is the deliberate * exception (standard type keeps extra keys): it preserves provider-specific extension fields so * they round-trip through the broker instead of being dropped (see below). */ import { type Type } from "@oh-my-pi/omptype"; import { type ApiKeyCredential, type AuthCredential, type AuthCredentialSnapshotEntry, type DisabledCredentialSummary, type OAuthCredential, type RemoteOAuthCredential, type SnapshotCredential } from "../auth-storage.js"; import type { ClientUsageReportRequest, ClientUsageReportResponse, ClientUsageSummaryResponse, CredentialBlockRequest, CredentialBlockResponse, CredentialBlockSnapshot, CredentialBlocksDeleteResponse, CredentialDisableResponse, CredentialRefreshResponse, CredentialUploadRequest, CredentialUploadResponse, DisabledCredentialsResponse, HealthzResponse, RefresherSchedule, SnapshotEntry, SnapshotResponse, SnapshotStreamEntryEvent, SnapshotStreamEvent, SnapshotStreamRemovedEvent, SnapshotStreamSnapshotEvent, UsageHistoryResponse, UsageResponse, UsageStaleResponse } from "./types.js"; export interface AuthBrokerWireSchemas { readonly oauthCredentialSchema: Type; readonly remoteOauthCredentialSchema: Type; readonly apiKeyCredentialSchema: Type; readonly writableAuthCredentialSchema: Type; readonly snapshotCredentialSchema: Type; readonly credentialSnapshotEntrySchema: Type; readonly credentialBlockSnapshotSchema: Type; readonly snapshotEntrySchema: Type; readonly refresherScheduleSchema: Type; readonly snapshotResponseSchema: Type; readonly snapshotStreamSnapshotEventSchema: Type; readonly snapshotStreamEntryEventSchema: Type; readonly snapshotStreamRemovedEventSchema: Type; readonly snapshotStreamEventSchema: Type; readonly healthzResponseSchema: Type; readonly usageResponseSchema: Type; readonly usageHistoryResponseSchema: Type; readonly clientUsageReportRequestSchema: Type; readonly clientUsageReportResponseSchema: Type; readonly clientUsageSummaryResponseSchema: Type; readonly credentialRefreshResponseSchema: Type; readonly credentialDisableRequestSchema: Type<{ cause?: string; }>; readonly credentialDisableResponseSchema: Type; readonly disabledCredentialSummarySchema: Type; readonly disabledCredentialsResponseSchema: Type; readonly credentialBlockRequestSchema: Type; readonly credentialBlockResponseSchema: Type; readonly credentialBlocksDeleteResponseSchema: Type; readonly usageStaleResponseSchema: Type; readonly credentialUploadRequestSchema: Type; readonly credentialUploadResponseSchema: Type; } export declare function getAuthBrokerWireSchemas(): AuthBrokerWireSchemas;