import { isAbortError } from "./errors.js"; import { Interceptor, Transport } from "@connectrpc/connect"; //#region src/shared/transports.d.ts interface Transports { authApi: Transport; publicApi: Transport; } /** Connect transports available to services that call authenticated APIs. */ type AuthApiTransports = Pick; /** Connect transports available to services that call public APIs. */ type PublicApiTransports = Pick; /** Connect transports available to services that call both public and authenticated APIs. */ type AuthAndPublicApiTransports = Pick; /** * Generic JWT auth for HTTP/Connect endpoints that follow the Bearer token contract. */ interface JwtAuthProvider { kind: "jwt"; /** * Typically wraps the configured browser auth token storage. The SDK reads * the current value for every request and for every realtime auth check, so * keep this cheap and return the freshest credential rather than caching. */ getToken: () => string | null | Promise; } /** * Generic Ed25519 API key auth for HTTP/Connect endpoints that follow the * X-API-KEY-ID / X-API-TIMESTAMP / X-API-SIGNATURE contract. * * Each request is signed immediately before dispatch, but the runtime's fetch * may still queue it (connection limits). Bound concurrency for large bursts; * a request that waits past its receive window fails with a retryable * `TimestampSkewError` (or its `RequestDeadlineExceededError` subclass), and * retrying signs it again. */ interface ApiKeyEd25519AuthProvider { kind: "api-key-ed25519"; getKeyId: () => string | null | Promise; /** Ed25519 secret key bytes (not hex) for signing. */ getSecretKey: () => Uint8Array | null | Promise; /** * Receive window in whole milliseconds, 1 to 60000, sent and signed as * `X-API-RECV-WINDOW`. The backend processes a request only until its timestamp * plus this window and answers a later one with a retryable error. Omit for the * backend default of 5000. Timestamps more than 1000 ms ahead of the server clock are * refused, so keep the clock synchronized. A shorter window also frees replay capacity sooner. */ recvWindow?: number; } //#endregion export { ApiKeyEd25519AuthProvider, AuthAndPublicApiTransports, AuthApiTransports, JwtAuthProvider, PublicApiTransports, Transports }; //# sourceMappingURL=transports.d.ts.map