import type { CapturedIntent } from "@decionis/agent-safe-pipeline"; import type { CardOutcomesConfig } from "../config/ExecutorConfig.js"; import type { FetchLike } from "../handlers/HandlerRegistration.js"; import type { SecurityEvents } from "../incident/SecurityEvents.js"; import type { ActionResponse } from "../service/Requests.js"; import type { CardOutcomeLedger } from "./CardOutcomeLedger.js"; import { type OutcomeEvidenceSink } from "./CoreOutcomeEvidenceClient.js"; import { type OutcomePublishSummary } from "./OutcomeEvidencePublisher.js"; /** The state file the publisher keeps beside the facts. */ export declare const CARD_OUTCOMES_STATE_FILE = "card-outcomes-state.json"; export interface CardOutcomesOptions { readonly config: CardOutcomesConfig; /** The authority's normalized base URL: Core serves the meter beside it. */ readonly authorityUrl: string; /** The producer token, read from its secret handle at each request. */ readonly token: () => string; /** The guarded fetch. */ readonly fetch: FetchLike; readonly events: SecurityEvents; /** Test seams: the ledger, Core's resource, the clock and this replica's name. */ readonly ledger?: CardOutcomeLedger; readonly sink?: OutcomeEvidenceSink; readonly clock?: () => Date; readonly replica?: string; } /** * The card purchases' outcome evidence, as the executor runs it: a recorder the card path * tells what each purchase came to once its answer is decided, and, when publishing, the * publisher that states it to Decionis on its own timer. Every method the request path calls * returns at once and never throws; none of them is awaited, so with outcomes on or off every * authorization is answered exactly the same. * * What is recorded is read from what the path already holds (the captured intent, the answer, * the claim, the issuer's result), and only identifiers, codes, times and the purchase's amount * are kept: the card reference, the merchant and the authorization id stay where they are. */ export declare class CardOutcomes { private readonly recorder; private readonly publisher; private constructor(); /** Null when the configuration leaves outcomes off. */ static create(options: CardOutcomesOptions): CardOutcomes | null; /** Starts publishing, when this deployment publishes. */ start(): void; stop(): void; /** Resolves once every fact recorded so far is written or dropped. */ flush(): Promise; /** One run now, for an operator or a test; never throws. */ publish(): Promise; /** * The first decision a card purchase was given: in enforcement the held grant or the hold, in * shadow what would have been decided. A decision the authority never took (it did not * answer, and the boundary refused on its own) is not a decision to measure. */ decided(captured: CapturedIntent, answer: ActionResponse): void; /** * A fresh decision on an open escalation. Only an `ALLOW` or a `BLOCK` is a resolution: an * answer still pending, or a hold that is still escalated, changes nothing yet. */ resumed(captured: CapturedIntent, answer: ActionResponse, via: "ATTESTATION" | "PRESENCE"): void; /** The issuer's authorization matched the hold and claimed its grant. */ claimed(intentId: string, grantId: string): void; /** What the issuer said it did with the authorization that claimed the grant. */ settled(intentId: string, outcome: "COMMITTED" | "FAILED" | "INDETERMINATE", receiptDigest: string): void; /** The held grant's expiry, when the answer held one for the issuer. */ private static heldUntil; } //# sourceMappingURL=CardOutcomes.d.ts.map