import type { FetchLike } from "../handlers/HandlerRegistration.js"; import { type ExposureAnswer, type ExposureLedger, type ExposureLimit, type ExposureSubjectUsage, type ExposureReservationRequest } from "./ExposureLedger.js"; /** Where Decionis serves the exposure ledger (`COMMERCE_EXPOSURE_PATH`). */ export declare const EXPOSURE_PATH = "/v1/commerce/exposure"; export interface DecionisExposureLedgerOptions { readonly baseUrl: string; /** Read at each call, so a rotated key takes effect at once. */ readonly apiKey: () => string; /** The authority's guarded egress. */ readonly fetch: FetchLike; readonly timeoutMs: number; readonly userAgent?: string; } /** * The Decionis exposure ledger over HTTP (`apps/api` ExposureRoutes): * * - `GET /v1/commerce/exposure`: the limits in the org's active bundle; * - `POST /v1/commerce/exposure/{key}/reservations`: reserve, idempotent * by `reservation_key`; * - `POST …/reservations/{id}/settle` and `…/release`: end it. * * The org is the one the API key belongs to; the key needs a draw scope * (`decision:write`, `decision:*` or `org:*`). Every fault is an * `ExposureUnavailable` with a stable code and nothing of the body. */ export declare class DecionisExposureLedger implements ExposureLedger { private readonly options; private readonly base; constructor(options: DecionisExposureLedgerOptions); limits(): Promise; /** * `GET /v1/commerce/exposure?subject_kind&subject_digest`: the subject's usage of each limit, * read-only. The only call a hosted gateway's shadow key may make to the ledger. */ subjectUsage(kind: string, idDigest: string): Promise>; reserve(limitKey: string, request: ExposureReservationRequest): Promise; settle(limitKey: string, reservationId: string, amount?: number): Promise; release(limitKey: string, reservationId: string): Promise; private static path; private call; /** The body as text, or null once it passes the cap; the rest is never read. */ private static bounded; } //# sourceMappingURL=DecionisExposureLedger.d.ts.map