/** * In-memory CruiseAdapter for tests and templates that need a working * external source without a real upstream. * * Seed it via the `add*` methods; queries against the registered data work * exactly like a real adapter would. Booking commits return synthesized * confirmation refs and increment a per-instance counter. */ import type { CreateExternalBookingInput, CruiseAdapter, CruiseSearchProjectionEntry, ExternalBookingResult, ExternalCruise, ExternalItineraryDay, ExternalPriceRow, ExternalSailing, ExternalShip, ListEntriesOptions, ListEntriesResult, SourceRef } from "./index.js"; export type MockCruiseAdapterOptions = { name?: string; version?: string; /** Auto-fail every nth call to surface upstream-error handling in tests. */ failEveryNthCall?: number; }; export declare class MockCruiseAdapter implements CruiseAdapter { readonly name: string; readonly version: string; private readonly cruisesByRef; private readonly shipsByRef; private readonly bookingResults; private readonly bookingsByIdempotencyKey; private readonly bookingsByRef; callCount: number; bookingCount: number; private readonly failEveryNthCall; constructor(options?: MockCruiseAdapterOptions); addCruise(cruise: ExternalCruise, sailings?: ExternalSailing[]): void; addSailing(cruiseRef: SourceRef, sailing: ExternalSailing): void; addShip(ship: ExternalShip): void; setSailingPricing(sailingRef: SourceRef, prices: ExternalPriceRow[]): void; setSailingItinerary(sailingRef: SourceRef, days: ExternalItineraryDay[]): void; /** Pre-program a specific booking response for the next createBooking that matches. */ setBookingResult(sailingRef: SourceRef, cabinCategoryRef: SourceRef, result: ExternalBookingResult): void; private tickAndCheck; listEntries(options?: ListEntriesOptions): Promise; searchProjection(options?: ListEntriesOptions): AsyncIterable; fetchCruise(ref: SourceRef): Promise; fetchSailing(ref: SourceRef): Promise; fetchSailingPricing(ref: SourceRef): Promise; fetchSailingItinerary(ref: SourceRef): Promise; fetchShip(ref: SourceRef): Promise; listSailingsForCruise(cruiseRef: SourceRef): Promise; createBooking(input: CreateExternalBookingInput): Promise; getBooking(connectorBookingRef: string): Promise; getBookingByIdempotencyKey(idempotencyKey: string): Promise; }