sabre-client 0.4.1 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,792 @@
1
+ interface RetryOptions {
2
+ /** Reintentos después de la primera llamada (3 → hasta 4 llamadas en total). */
3
+ maxRetries: number;
4
+ /** Delay base del backoff exponencial, en milisegundos. */
5
+ baseDelayMs: number;
6
+ }
7
+
8
+ interface SabreErrorOptions {
9
+ /** Si la política de reintentos puede volver a intentar la operación. */
10
+ retryable: boolean;
11
+ /** Fragmento de la respuesta original sin transformar (JSON parseado o nodo XML). */
12
+ raw?: unknown;
13
+ cause?: unknown;
14
+ }
15
+ /**
16
+ * Base de todos los errores del SDK.
17
+ *
18
+ * `raw` puede contener credenciales o datos de pasajero: no es enumerable, así que
19
+ * no aparece en `JSON.stringify`, spreads ni serializadores de logs, pero sigue
20
+ * accesible como `error.raw` para debugging. No lo vuelques a un logger sin sanitizar.
21
+ */
22
+ declare class SabreError extends Error {
23
+ name: string;
24
+ readonly retryable: boolean;
25
+ readonly raw: unknown;
26
+ constructor(message: string, options: SabreErrorOptions);
27
+ toJSON(): Record<string, unknown>;
28
+ }
29
+ type SabreProtocol = 'rest' | 'soap';
30
+ interface SabreGatewayErrorOptions extends SabreErrorOptions {
31
+ protocol: SabreProtocol;
32
+ /** HTTP status de la respuesta, si la hubo. */
33
+ status?: number;
34
+ /** Código tal cual lo devuelve el gateway (`ERR.2SG.*`, `USG_*`), si viene en el body. */
35
+ code?: string;
36
+ }
37
+ /** Error de transporte/gateway (`ERR.2SG.*` + HTTP status en REST, `USG_*` en SOAP). */
38
+ declare class SabreGatewayError extends SabreError {
39
+ name: string;
40
+ readonly protocol: SabreProtocol;
41
+ readonly status: number | undefined;
42
+ readonly code: string | undefined;
43
+ constructor(message: string, options: SabreGatewayErrorOptions);
44
+ }
45
+ /**
46
+ * Por qué una sesión SOAP no sirve: `'limit'` (más de 50 sesiones), `'invalid'` (uso
47
+ * concurrente de la sesión), `'expired'` (sesión vencida) o `'blocked'` (creación de sesión
48
+ * bloqueada para el usuario).
49
+ */
50
+ type SabreSessionErrorKind = 'limit' | 'invalid' | 'expired' | 'blocked';
51
+ interface SabreSessionErrorOptions extends Omit<SabreGatewayErrorOptions, 'protocol'> {
52
+ kind: SabreSessionErrorKind;
53
+ }
54
+ /**
55
+ * Error de la sesión SOAP de `SabreLegacy`. Se distingue con `instanceof` y `kind`, sin comparar
56
+ * mensajes. La sesión que lo lanzó queda inutilizable: las llamadas siguientes lanzan sin red.
57
+ */
58
+ declare class SabreSessionError extends SabreGatewayError {
59
+ name: string;
60
+ readonly kind: SabreSessionErrorKind;
61
+ constructor(message: string, options: SabreSessionErrorOptions);
62
+ }
63
+ interface SabreOrchestrationErrorOptions extends Omit<SabreErrorOptions, 'retryable'> {
64
+ /** `SP.PROVIDER_ERROR` o `SP.INTERNAL_ERROR`. */
65
+ code: string;
66
+ }
67
+ /**
68
+ * Error de servicio orquestado (`SP.*`), viaja dentro de una respuesta 200.
69
+ * `SP.PROVIDER_ERROR` es reintentable; `SP.INTERNAL_ERROR` (y cualquier otro) no.
70
+ */
71
+ declare class SabreOrchestrationError extends SabreError {
72
+ name: string;
73
+ readonly code: string;
74
+ constructor(message: string, options: SabreOrchestrationErrorOptions);
75
+ }
76
+ interface SabreServiceErrorOptions extends Omit<SabreErrorOptions, 'retryable'> {
77
+ /** Servicio que originó el error, p. ej. `'createBooking'`. */
78
+ service: string;
79
+ /** Código tal cual lo documenta Sabre, sin normalizar. */
80
+ code: string;
81
+ }
82
+ interface SabreBusinessErrorOptions extends SabreServiceErrorOptions {
83
+ /**
84
+ * Solo para códigos que Sabre documenta como temporales en un servicio de lectura
85
+ * (p. ej. `Transmission timeout` de Bargain Finder Max). Por defecto `false`.
86
+ * La política de reintentos igual exige que la operación sea idempotente.
87
+ */
88
+ retryable?: boolean;
89
+ /** Avisos que llegaron junto con el error (p. ej. `category: WARNING` de Create Booking). */
90
+ warnings?: readonly SabreWarning[];
91
+ /**
92
+ * Otros errores que llegaron junto con este (p. ej. la causa real detrás de
93
+ * `NO_ITEMS_CANCELLED` en Cancel Booking).
94
+ */
95
+ errors?: readonly SabreBusinessError[];
96
+ }
97
+ /**
98
+ * Error del catálogo propio de un servicio. No es reintentable, salvo los códigos
99
+ * temporales de servicios de lectura que se marcan con `retryable: true`.
100
+ */
101
+ declare class SabreBusinessError extends SabreError {
102
+ name: string;
103
+ readonly service: string;
104
+ readonly code: string;
105
+ readonly warnings: readonly SabreWarning[];
106
+ readonly errors: readonly SabreBusinessError[];
107
+ constructor(message: string, options: SabreBusinessErrorOptions);
108
+ }
109
+ /**
110
+ * Advertencia de un servicio (p. ej. `category: WARNING` de Create Booking, soft errors
111
+ * de End Transaction): no es un fallo fatal. Nunca se reintenta automáticamente.
112
+ */
113
+ declare class SabreWarning extends SabreError {
114
+ name: string;
115
+ readonly service: string;
116
+ readonly code: string;
117
+ constructor(message: string, options: SabreServiceErrorOptions);
118
+ }
119
+
120
+ /**
121
+ * Respuesta tal cual llegó de Sabre, para guardarla junto al resultado tipado.
122
+ *
123
+ * ⚠️ El `body` trae datos de pasajeros (PII). El SDK nunca lo envía al logger; quien usa
124
+ * `onRawResponse` responde por dónde lo guarda.
125
+ */
126
+ interface SabreRawResponse {
127
+ /** Método público sin `sabre.`, p. ej. `'booking.get'` o `'air.bargainFinderMax'`. */
128
+ operation: string;
129
+ protocol: 'rest' | 'soap';
130
+ /** HTTP status del intento que se entrega. */
131
+ status: number;
132
+ headers: Headers;
133
+ /**
134
+ * Texto tal cual llegó, sin parsear. `''` si vino vacío. En SOAP es el sobre completo, con
135
+ * una sola modificación: el valor de cada `BinarySecurityToken` va como `[REDACTED]`.
136
+ */
137
+ body: string;
138
+ /** Intentos HTTP hechos, contando los reintentos (1 si no hubo). */
139
+ attempts: number;
140
+ }
141
+ /**
142
+ * Se llama una sola vez por operación, con la respuesta del último intento HTTP, antes de
143
+ * devolver o de lanzar: también si termina en `SabreBusinessError` o `SabreGatewayError`. No
144
+ * se llama si ningún intento tuvo respuesta HTTP, ni con las llamadas de token.
145
+ *
146
+ * Es síncrono y su retorno se ignora. Si lanza, el SDK lo atrapa, emite
147
+ * `sabre.request.rawResponseHookFailed` al logger (sin el body) y la operación sigue.
148
+ */
149
+ type SabreRawResponseCallback = (raw: SabreRawResponse) => void;
150
+
151
+ /**
152
+ * Lo que el SDK mandó por la red en el último intento de una operación.
153
+ *
154
+ * ⚠️ El `body` y la `url` traen datos de pasajeros (PII): localizadores, nombres, contactos. El
155
+ * SDK nunca los envía al logger; quien usa `onRawRequest` responde por dónde los guarda.
156
+ */
157
+ interface SabreRawRequest {
158
+ /** El mismo valor que en `onRawResponse`, p. ej. `'booking.get'` o `'queue.access'`. */
159
+ operation: string;
160
+ protocol: 'rest' | 'soap';
161
+ /** `'GET'`, `'POST'`… En SOAP, siempre `'POST'`. */
162
+ method: string;
163
+ /** URL completa, con query string. */
164
+ url: string;
165
+ /** Los headers que se mandaron, sin `Authorization` (se quita el header entero). */
166
+ headers: Headers;
167
+ /**
168
+ * El texto que se mandó, o `undefined` si el request no llevaba body. En REST va tal cual. En
169
+ * SOAP es el sobre completo, con una sola modificación: el valor de cada `BinarySecurityToken`
170
+ * va como `[REDACTED]`.
171
+ */
172
+ body: string | undefined;
173
+ /** Intentos que llegaron a llamar a `fetch`, contando los reintentos (1 si no hubo). */
174
+ attempts: number;
175
+ }
176
+ /**
177
+ * Se llama una sola vez por operación, con el último intento que se mandó, antes de devolver o de
178
+ * lanzar y antes que `onRawResponse`. A diferencia de este, se llama también si ningún intento tuvo
179
+ * respuesta HTTP (fallo de red, `AbortError`). No se llama si la operación lanza antes de mandar
180
+ * nada, ni con las llamadas de auth: el token de OAuth y `SessionCreateRQ` (`openSession`), que
181
+ * llevan credenciales, y `SessionCloseRQ` (`close`).
182
+ *
183
+ * Es síncrono y su retorno se ignora. Si lanza, el SDK lo atrapa, emite
184
+ * `sabre.request.rawRequestHookFailed` al logger (sin el body) y la operación sigue.
185
+ */
186
+ type SabreRawRequestCallback = (raw: SabreRawRequest) => void;
187
+
188
+ interface ScheduleEndpoint {
189
+ airport: string;
190
+ city?: string;
191
+ /** Visto en sandbox para aeropuertos de EE. UU. */
192
+ state?: string;
193
+ country?: string;
194
+ /** Hora local con offset, p. ej. `17:10:00+02:00`. */
195
+ time: string;
196
+ terminal?: string;
197
+ /** Días que se suman a la fecha de salida del vuelo. Visto en sandbox (`arrival`). */
198
+ dateAdjustment?: number;
199
+ }
200
+ interface ScheduleEquipment {
201
+ code: string;
202
+ typeForFirstLeg?: string;
203
+ typeForLastLeg?: string;
204
+ }
205
+ interface ScheduleCarrier {
206
+ marketing: string;
207
+ marketingFlightNumber: number;
208
+ operating?: string;
209
+ operatingFlightNumber?: number;
210
+ alliances?: string;
211
+ equipment?: ScheduleEquipment;
212
+ /**
213
+ * Nombre del operador en un código compartido, tal cual (p. ej. `"/AVIANCA"`). No está en el
214
+ * spec. Se observó en BFM y Revalidate en CERT, también cuando `operating` y
215
+ * `operatingFlightNumber` coinciden con el comercializador (AM101 TRC→MEX, operado por
216
+ * `"AEROLITORAL DBA AEROMEXICO CONNECT"`, 2026-11-05).
217
+ */
218
+ codeShared?: string;
219
+ }
220
+ /** Vuelo/segmento operado (`scheduleDescs[]`). */
221
+ interface ScheduleDesc {
222
+ id: number;
223
+ /** Visto en sandbox, p. ej. `"7"`; significado sin confirmar. */
224
+ dotRating?: string;
225
+ frequency?: string;
226
+ stopCount?: number;
227
+ eTicketable?: boolean;
228
+ totalMilesFlown?: number;
229
+ /** Minutos. */
230
+ elapsedTime?: number;
231
+ departure: ScheduleEndpoint;
232
+ arrival: ScheduleEndpoint;
233
+ carrier: ScheduleCarrier;
234
+ }
235
+ /** Tramo lógico (`legDescs[]`): agrupa schedules por `ref`. */
236
+ interface LegDesc {
237
+ id: number;
238
+ /** Minutos. */
239
+ elapsedTime?: number;
240
+ schedules: LegScheduleRef[];
241
+ }
242
+ /**
243
+ * Schedule dentro de un tramo. `departureDateAdjustment`: días que se suman a la fecha del
244
+ * tramo para la salida de este vuelo (conexión al día siguiente). Visto en sandbox, sin
245
+ * documentar en los ejemplos de Sabre.
246
+ */
247
+ interface LegScheduleRef extends Ref {
248
+ departureDateAdjustment?: number;
249
+ }
250
+ /** Impuesto individual (`taxDescs[]`). */
251
+ interface TaxDesc {
252
+ id: number;
253
+ code: string;
254
+ amount: number;
255
+ currency: string;
256
+ description?: string;
257
+ publishedAmount?: number;
258
+ publishedCurrency?: string;
259
+ station?: string;
260
+ country?: string;
261
+ /** Visto en sandbox. */
262
+ taxReissue?: {
263
+ refundable?: boolean;
264
+ };
265
+ }
266
+ /** Resumen de impuestos por código (`taxSummaryDescs[]`). Misma forma que `TaxDesc`. */
267
+ type TaxSummaryDesc = TaxDesc;
268
+ /** Cargo adicional (`obFeeDescs[]`). Significado exacto de "OB" sin confirmar. */
269
+ interface ObFeeDesc {
270
+ id: number;
271
+ amount: number;
272
+ currency: string;
273
+ }
274
+ interface FareComponentDescSegment {
275
+ segment: {
276
+ stopover?: boolean;
277
+ };
278
+ }
279
+ /** Componente de tarifa (`fareComponentDescs[]`). */
280
+ interface FareComponentDesc {
281
+ id: number;
282
+ governingCarrier?: string;
283
+ fareAmount?: number;
284
+ fareCurrency?: string;
285
+ fareBasisCode: string;
286
+ farePassengerType?: string;
287
+ publishedFareAmount?: number;
288
+ publishedFareCurrency?: string;
289
+ /** `FROM` / `TO`. */
290
+ directionality?: string;
291
+ applicablePricingCategories?: string;
292
+ vendorCode?: string;
293
+ fareTypeBitmap?: string;
294
+ fareType?: string;
295
+ fareTariff?: string;
296
+ fareRule?: string;
297
+ cabinCode?: string;
298
+ segments?: FareComponentDescSegment[];
299
+ ticketDesignator?: string;
300
+ mileageSurcharge?: number;
301
+ mileage?: boolean;
302
+ oneWayFare?: boolean;
303
+ negotiatedFare?: boolean;
304
+ privateFare?: boolean;
305
+ notValidAfter?: string;
306
+ /** Distinto de `directionality`; significado sin confirmar. */
307
+ direction?: string;
308
+ }
309
+ /** Aerolínea validadora (`validatingCarrierDescs[]`). */
310
+ interface ValidatingCarrierDesc {
311
+ id: number;
312
+ settlementMethod?: string;
313
+ newVcxProcess?: boolean;
314
+ default?: {
315
+ code: string;
316
+ };
317
+ }
318
+ /** Franquicia de equipaje (`baggageAllowanceDescs[]`). */
319
+ interface BaggageAllowanceDesc {
320
+ id: number;
321
+ pieceCount?: number;
322
+ }
323
+ /** Referencia a un descriptor por su `id`. */
324
+ interface Ref {
325
+ ref: number;
326
+ }
327
+ interface ItineraryMessage {
328
+ severity: string;
329
+ type: string;
330
+ code: string;
331
+ text: string;
332
+ }
333
+ interface LegDescription {
334
+ departureDate: string;
335
+ departureLocation: string;
336
+ arrivalLocation: string;
337
+ }
338
+ interface CurrencyConversion {
339
+ from: string;
340
+ to: string;
341
+ exchangeRateUsed: number;
342
+ }
343
+ interface PassengerTotalFare {
344
+ totalFare: number;
345
+ totalTaxAmount?: number;
346
+ currency: string;
347
+ baseFareAmount?: number;
348
+ baseFareCurrency?: string;
349
+ equivalentAmount?: number;
350
+ equivalentCurrency?: string;
351
+ constructionAmount?: number;
352
+ constructionCurrency?: string;
353
+ exchangeRateOne?: number;
354
+ commissionPercentage?: number;
355
+ commissionAmount?: number;
356
+ cat35CommissionPercentage?: number;
357
+ cat35CommissionAmount?: number;
358
+ cat35MarkupAmount?: number;
359
+ commissionAmountInEquivalent?: number;
360
+ commissionSource?: string;
361
+ }
362
+ interface TotalFare {
363
+ totalPrice: number;
364
+ totalTaxAmount?: number;
365
+ currency: string;
366
+ baseFareAmount?: number;
367
+ baseFareCurrency?: string;
368
+ constructionAmount?: number;
369
+ constructionCurrency?: string;
370
+ equivalentAmount?: number;
371
+ equivalentCurrency?: string;
372
+ }
373
+ /** Disponibilidad del segmento dentro de un componente de tarifa. */
374
+ interface FareComponentSegmentDetail {
375
+ bookingCode?: string;
376
+ cabinCode?: string;
377
+ mealCode?: string;
378
+ seatsAvailable?: number;
379
+ availabilityBreak?: boolean;
380
+ fareBreakPoint?: boolean;
381
+ }
382
+ interface FareMessage {
383
+ type: string;
384
+ code: string;
385
+ /** Visto en sandbox de Revalidate. */
386
+ carrier?: string;
387
+ info: string;
388
+ }
389
+ interface RawFareComponent extends Ref {
390
+ beginAirport?: string;
391
+ endAirport?: string;
392
+ segments?: Array<{
393
+ segment: FareComponentSegmentDetail;
394
+ }>;
395
+ }
396
+ interface RawBaggageInformation {
397
+ provisionType?: string;
398
+ airlineCode?: string;
399
+ /** Índices de segmento, no referencias a descriptores. */
400
+ segments?: Array<{
401
+ id: number;
402
+ }>;
403
+ allowance?: Ref;
404
+ }
405
+ interface RawPassengerInfo {
406
+ passengerType: string;
407
+ passengerNumber?: number;
408
+ nonRefundable?: boolean;
409
+ fareComponents?: RawFareComponent[];
410
+ taxes?: Ref[];
411
+ taxSummaries?: Ref[];
412
+ obFees?: Ref[];
413
+ currencyConversion?: CurrencyConversion;
414
+ passengerTotalFare?: PassengerTotalFare;
415
+ baggageInformation?: RawBaggageInformation[];
416
+ fareMessages?: FareMessage[];
417
+ fareCalcLine?: {
418
+ info: string;
419
+ };
420
+ }
421
+ interface RawFare {
422
+ mandatoryInd?: boolean;
423
+ validatingCarrierCode?: string;
424
+ vita?: boolean;
425
+ eTicketable?: boolean;
426
+ lastTicketDate?: string;
427
+ lastTicketTime?: string;
428
+ governingCarriers?: string;
429
+ passengerInfoList: Array<{
430
+ passengerInfo: RawPassengerInfo;
431
+ }>;
432
+ totalFare?: TotalFare;
433
+ validatingCarriers?: Ref[];
434
+ }
435
+ interface RawPricingInformation {
436
+ pricingSubsource?: string;
437
+ /** P. ej. `ATPCO`. Visto en Revalidate y en sandbox de BFM. */
438
+ distributionModel?: string;
439
+ fare: RawFare;
440
+ }
441
+ interface RawItinerary {
442
+ id: number;
443
+ pricingSource?: string;
444
+ /** Visto solo en Revalidate Itinerary. */
445
+ currentItinerary?: boolean;
446
+ /** Visto en sandbox de BFM; significado sin confirmar. */
447
+ diversitySwapper?: {
448
+ weighedPrice?: number;
449
+ };
450
+ legs: Ref[];
451
+ pricingInformation: RawPricingInformation[];
452
+ }
453
+ /** Tramo con sus schedules resueltos. */
454
+ interface Leg extends Omit<LegDesc, 'schedules'> {
455
+ schedules: LegSchedule[];
456
+ }
457
+ /** Schedule resuelto, con lo que la referencia del tramo agrega. */
458
+ type LegSchedule = ScheduleDesc & Omit<LegScheduleRef, 'ref'>;
459
+ /** Segmento de un componente de tarifa: lo del descriptor más la disponibilidad del itinerario. */
460
+ interface FareComponentSegment {
461
+ segment: FareComponentDescSegment['segment'] & FareComponentSegmentDetail;
462
+ }
463
+ /** Componente de tarifa resuelto: descriptor + datos propios del itinerario. */
464
+ interface FareComponent extends Omit<FareComponentDesc, 'segments'> {
465
+ beginAirport?: string;
466
+ endAirport?: string;
467
+ segments?: FareComponentSegment[];
468
+ }
469
+ interface BaggageInformation extends Omit<RawBaggageInformation, 'allowance'> {
470
+ allowance?: BaggageAllowanceDesc;
471
+ }
472
+ interface PassengerInfo extends Omit<RawPassengerInfo, 'fareComponents' | 'taxes' | 'taxSummaries' | 'obFees' | 'baggageInformation'> {
473
+ fareComponents?: FareComponent[];
474
+ taxes?: TaxDesc[];
475
+ taxSummaries?: TaxSummaryDesc[];
476
+ obFees?: ObFeeDesc[];
477
+ baggageInformation?: BaggageInformation[];
478
+ }
479
+ interface Fare extends Omit<RawFare, 'passengerInfoList' | 'validatingCarriers'> {
480
+ passengerInfoList: Array<{
481
+ passengerInfo: PassengerInfo;
482
+ }>;
483
+ validatingCarriers?: ValidatingCarrierDesc[];
484
+ }
485
+ interface PricingInformation extends Omit<RawPricingInformation, 'fare'> {
486
+ fare: Fare;
487
+ }
488
+ interface Itinerary extends Omit<RawItinerary, 'legs' | 'pricingInformation'> {
489
+ legs: Leg[];
490
+ pricingInformation: PricingInformation[];
491
+ }
492
+ interface ItineraryGroup {
493
+ groupDescription: {
494
+ legDescriptions: LegDescription[];
495
+ };
496
+ itineraries: Itinerary[];
497
+ }
498
+ /**
499
+ * `groupedItineraryResponse` con cada `ref` resuelto al objeto completo. Los arrays de
500
+ * descriptores (`scheduleDescs`, `legDescs`, …) ya no se exponen: su contenido vive
501
+ * dentro de cada itinerario.
502
+ */
503
+ interface GroupedItineraryResponse {
504
+ version: string;
505
+ messages: ItineraryMessage[];
506
+ statistics?: {
507
+ itineraryCount: number;
508
+ };
509
+ itineraryGroups: ItineraryGroup[];
510
+ }
511
+
512
+ interface LowFareSearchLocation {
513
+ LocationCode: string;
514
+ [key: string]: unknown;
515
+ }
516
+ interface LowFareSearchRequestorId {
517
+ Type: string;
518
+ ID: string;
519
+ CompanyName: {
520
+ Code: string;
521
+ [key: string]: unknown;
522
+ };
523
+ [key: string]: unknown;
524
+ }
525
+ interface LowFareSearchSource {
526
+ /** PCC desde el que se busca. El SDK no lo inyecta. */
527
+ PseudoCityCode: string;
528
+ RequestorID: LowFareSearchRequestorId;
529
+ [key: string]: unknown;
530
+ }
531
+ /** Vuelo exacto a revalidar (`OriginDestinationInformation[].TPA_Extensions.Flight[]`). */
532
+ interface LowFareSearchFlight {
533
+ /** `"A"` en el ejemplo de Sabre; significado sin confirmar. */
534
+ Type: string;
535
+ Number: number;
536
+ /** Fecha y hora local sin offset. */
537
+ DepartureDateTime: string;
538
+ ArrivalDateTime: string;
539
+ ClassOfService: string;
540
+ OriginLocation: LowFareSearchLocation;
541
+ DestinationLocation: LowFareSearchLocation;
542
+ Airline: {
543
+ Marketing: string;
544
+ Operating?: string;
545
+ [key: string]: unknown;
546
+ };
547
+ [key: string]: unknown;
548
+ }
549
+ interface LowFareSearchOriginDestination {
550
+ /** Fecha y hora local sin offset, p. ej. `2026-09-11T20:00:00`. */
551
+ DepartureDateTime: string;
552
+ OriginLocation: LowFareSearchLocation;
553
+ DestinationLocation: LowFareSearchLocation;
554
+ /** Solo Revalidate Itinerary. `false` en el ejemplo de Sabre; efecto de `true` sin confirmar. */
555
+ Fixed?: boolean;
556
+ TPA_Extensions?: {
557
+ /** Solo Revalidate Itinerary: fija los vuelos exactos del tramo. */
558
+ Flight?: LowFareSearchFlight[];
559
+ [key: string]: unknown;
560
+ };
561
+ [key: string]: unknown;
562
+ }
563
+ interface LowFareSearchTravelPreferences {
564
+ /** `0` = solo directos. */
565
+ MaxStopsQuantity?: number;
566
+ /** Filtro por aerolínea. */
567
+ VendorPref?: Array<{
568
+ Code: string;
569
+ [key: string]: unknown;
570
+ }>;
571
+ TPA_Extensions?: {
572
+ /** Solo Revalidate Itinerary. `"L"` en el ejemplo de Sabre; significado sin confirmar. */
573
+ VerificationItinCallLogic?: {
574
+ Value: string;
575
+ [key: string]: unknown;
576
+ };
577
+ [key: string]: unknown;
578
+ };
579
+ [key: string]: unknown;
580
+ }
581
+ interface LowFareSearchPassengerTypeQuantity {
582
+ /** Tipo de pasajero, p. ej. `ADT`. */
583
+ Code: string;
584
+ Quantity: number;
585
+ [key: string]: unknown;
586
+ }
587
+ interface LowFareSearchTravelerInfoSummary {
588
+ AirTravelerAvail: Array<{
589
+ PassengerTypeQuantity: LowFareSearchPassengerTypeQuantity[];
590
+ [key: string]: unknown;
591
+ }>;
592
+ [key: string]: unknown;
593
+ }
594
+ interface LowFareSearchTpaExtensions {
595
+ IntelliSellTransaction?: {
596
+ /** Propietario de Sabre, p. ej. `50ITINS`; significado exacto sin confirmar. */
597
+ RequestType: {
598
+ Name: string;
599
+ [key: string]: unknown;
600
+ };
601
+ [key: string]: unknown;
602
+ };
603
+ [key: string]: unknown;
604
+ }
605
+ /** Contenido de `OTA_AirLowFareSearchRQ`. */
606
+ interface OtaAirLowFareSearchRq {
607
+ /** `"5"`. El SDK no lo completa. */
608
+ Version: string;
609
+ POS: {
610
+ Source: LowFareSearchSource[];
611
+ [key: string]: unknown;
612
+ };
613
+ OriginDestinationInformation: LowFareSearchOriginDestination[];
614
+ TravelPreferences?: LowFareSearchTravelPreferences;
615
+ TravelerInfoSummary: LowFareSearchTravelerInfoSummary;
616
+ TPA_Extensions?: LowFareSearchTpaExtensions;
617
+ [key: string]: unknown;
618
+ }
619
+
620
+ /** Body de Bargain Finder Max v5, tal cual lo documenta Sabre. */
621
+ interface BargainFinderMaxRequest {
622
+ OTA_AirLowFareSearchRQ: OtaAirLowFareSearchRq;
623
+ }
624
+ /** `groupedItineraryResponse` con las referencias ya resueltas. */
625
+ type BargainFinderMaxResponse = GroupedItineraryResponse;
626
+ interface RequestOptions {
627
+ signal?: AbortSignal;
628
+ /** Respuesta cruda del último intento HTTP. El body trae PII: ver `SabreRawResponse`. */
629
+ onRawResponse?: SabreRawResponseCallback;
630
+ /** Request crudo del último intento que se mandó, sin `Authorization`. Trae PII: ver `SabreRawRequest`. */
631
+ onRawRequest?: SabreRawRequestCallback;
632
+ /** Pisa los reintentos del cliente solo para esta request. */
633
+ retry?: Partial<RetryOptions>;
634
+ }
635
+
636
+ /**
637
+ * Una cola (ADR-028). Hay tres clases, y viajan por dos atributos distintos de `QueueIdentifier`:
638
+ * - **numérica**, de 0 a 511: `400` → `Number="400"`;
639
+ * - **alfabética**, una o dos letras mayúsculas: `'S'` → `Number="S"`. La `S` es la cola de
640
+ * **mensajes** del PCC (cuenta lo mismo que `Totals Type="MESSAGES"`): no tiene PNR y no se puede
641
+ * listar;
642
+ * - **con nombre** (tablas QN y QNB): `{ name: 'HOTELS' }` → `Name="HOTELS"`.
643
+ *
644
+ * Lo que devuelve `queue.count` se pasa tal cual a las demás operaciones. Las colas 0–49 son del
645
+ * sistema: el SDK no las restringe.
646
+ */
647
+ type QueueRef = number | string | {
648
+ name: string;
649
+ };
650
+ /** La cola de mensajes del PCC: no tiene PNR y Sabre no la lista (`INVALID ENTRY`). */
651
+ declare const MESSAGE_QUEUE = "S";
652
+ /** Si la cola es la de mensajes (`'S'`). */
653
+ declare function isMessageQueue(queue: QueueRef): boolean;
654
+
655
+ interface QueueActivityRequest {
656
+ /** PCC cuyas colas se analizan. Por defecto, el de la sesión. */
657
+ pcc?: string;
658
+ }
659
+ type QueueActivityOptions = RequestOptions;
660
+ /**
661
+ * Los ocho contadores de Get Queue Activity, con los nombres de Sabre. La pantalla `QA` del host los
662
+ * muestra en columnas (`ON Q`, `REMOVD`, …). Ninguna fuente dice desde cuándo cuentan (Q-097): el
663
+ * SDK los devuelve sin interpretar.
664
+ */
665
+ interface QueueActivityCounters {
666
+ /** `NumMessages`: los mensajes o PNR que están hoy en la cola (`ON Q`). */
667
+ numMessages: number;
668
+ /** `Ended`: los terminados en la cola. */
669
+ ended: number;
670
+ /** `Ignored`: los ignorados (`I`). */
671
+ ignored: number;
672
+ /** `Moved`: los movidos a otra cola. */
673
+ moved: number;
674
+ /** `Removed`: los sacados de la cola (`QR`). */
675
+ removed: number;
676
+ /** `Transferred`: los transferidos. */
677
+ transferred: number;
678
+ /** `LeftMessageToContact`: con un mensaje dejado al contacto. */
679
+ leftMessageToContact: number;
680
+ /** `UnableToReach`: los que no se pudo contactar. */
681
+ unableToReach: number;
682
+ }
683
+ /** Los contadores de una cola. Sabre lista también colas vacías con contadores. */
684
+ interface QueueActivity extends QueueActivityCounters {
685
+ /** La cola, como en `count`: `400`, `'S'` o `{ name }`. Se pasa tal cual a las demás operaciones. */
686
+ queue: QueueRef;
687
+ }
688
+ interface QueueActivityResponse {
689
+ /** Las colas que trae la respuesta, en el orden de Sabre. */
690
+ queues: QueueActivity[];
691
+ /** `Totals`: los ocho contadores sumados para el PCC. Sin `Totals`, `undefined`. */
692
+ totals?: QueueActivityCounters;
693
+ /**
694
+ * `QueueInfo@DateTime` tal cual llegó, sin año (`"11-06T11:33"`): la hora del host al analizar.
695
+ * Es un hecho pasado, así que el año se resuelve hacia atrás, como `countedAt`.
696
+ */
697
+ analyzedAt?: string;
698
+ /** Los `stl:Warning` de la respuesta. No lanzan. */
699
+ warnings: SabreWarning[];
700
+ /** `eb:Timestamp` de la respuesta de Sabre, en ISO 8601 UTC. Falta si Sabre no lo manda. */
701
+ respondedAt?: string;
702
+ }
703
+
704
+ type ReservationHistoryOptions = RequestOptions;
705
+ /**
706
+ * Un elemento con su acción y su texto: `GeneralInfo` o `RemarkInfo/Remark`. Sabre no publica el
707
+ * catálogo de `action`. En CERT llegaron `A4S` (SSR), `A7` (ticketing), `A9` (teléfono), `AN`
708
+ * (nombre), `APE` (email) y `ADT`. La `A` inicial es un alta y la `X`, una baja.
709
+ */
710
+ interface ReservationHistoryText {
711
+ action: string;
712
+ /** `Text`, tal cual. Puede traer datos del pasajero. */
713
+ text: string;
714
+ }
715
+ /** Un `FlightSegment` del historial, tal como estaba en esa transacción. */
716
+ interface ReservationHistoryFlightSegment {
717
+ /** `@Action`: `AS` (alta) o `XS` (baja), según las respuestas y el design. */
718
+ action: string;
719
+ /** `@Status` en ese momento (`HK`, `HKNN`, `UN`…). */
720
+ status?: string;
721
+ /** `MarketingAirline@Code`. */
722
+ marketingAirline?: string;
723
+ /** `@FlightNumber`. */
724
+ flightNumber?: string;
725
+ /** `@ResBookDesigCode`: la clase. */
726
+ bookingClass?: string;
727
+ /** `OriginLocation@LocationCode`. */
728
+ origin?: string;
729
+ /** `DestinationLocation@LocationCode`. */
730
+ destination?: string;
731
+ /** `@DepartureDateTime` tal cual, sin año (`"12-19T13:10"`). Se resuelve con `resolveHostDate`. */
732
+ departureDateTime?: string;
733
+ /** `@ArrivalDateTime` tal cual, sin año. */
734
+ arrivalDateTime?: string;
735
+ /** `@NumberInParty`. */
736
+ numberInParty?: number;
737
+ /** `SupplierRef@ID`: el localizador de la aerolínea (`DCAA*DVDMYA`). */
738
+ supplierRef?: string;
739
+ }
740
+ /** Una `AccountingInfo` del historial: la línea de contabilidad, sin sus importes. */
741
+ interface ReservationHistoryAccounting {
742
+ /** `@Action` (`HK` en el design). */
743
+ action?: string;
744
+ /** `@Type`: `R` reembolso, `G` cambio con reembolso, `E` cambio par, `A` cobro adicional, `L` descuento, `B` bulk. */
745
+ type?: string;
746
+ /** `@LinkCode`. */
747
+ linkCode?: string;
748
+ }
749
+ /**
750
+ * Una transacción del historial (`HistoricalInfo`): quién la firmó, cuándo y desde qué PCC
751
+ * (`ItineraryRef/Source`), y los elementos que cambió. Lo que el SDK no tipa (asientos, autos,
752
+ * hoteles, tren, seguros, facturas, importes) queda en la respuesta cruda (`onRawResponse`).
753
+ */
754
+ interface ReservationHistoryTransaction {
755
+ /** `@RPH`: el número de la firma de la transacción (`HSTSIG`). */
756
+ rph?: number;
757
+ /** `Source@CreateDateTime`, tal cual: con año y sin zona (`"2026-11-04T17:15"`). */
758
+ createdAt?: string;
759
+ /** `Source@CreationAgent`: el sine del agente que firmó. */
760
+ agent?: string;
761
+ /** `Source@CreationAgentDutyCode`. */
762
+ agentDutyCode?: string;
763
+ /** `Source@CreationAgentFunctionCode`. */
764
+ agentFunctionCode?: string;
765
+ /** `Source@PseudoCityCode`: el PCC de la firma del agente. */
766
+ pcc?: string;
767
+ /**
768
+ * `Source@AAA_PseudoCityCode`: el PCC del AAA del agente. El sample lo escribe
769
+ * `AAAPseudoCityCode`, sin guion bajo; el SDK lee los dos.
770
+ */
771
+ aaaPcc?: string;
772
+ /** `Source@ReceivedFrom`: el campo de recibido de la transacción. */
773
+ receivedFrom?: string;
774
+ /** `ItineraryInfo/ReservationItems/Item/FlightSegment`, en orden. */
775
+ flightSegments: ReservationHistoryFlightSegment[];
776
+ /** `GeneralInfo`, en orden: SSR, ticketing, teléfonos, nombres, emails… como texto. */
777
+ generalInfo: ReservationHistoryText[];
778
+ /** `RemarkInfo/Remark`, en orden. */
779
+ remarks: ReservationHistoryText[];
780
+ /** `AccountingInfo`, en orden. */
781
+ accounting: ReservationHistoryAccounting[];
782
+ }
783
+ interface ReservationHistoryResponse {
784
+ /** Las transacciones (`HistoricalInfo`), en el orden de Sabre. */
785
+ transactions: ReservationHistoryTransaction[];
786
+ /** Los `stl:Warning` de la respuesta. No lanzan. */
787
+ warnings: SabreWarning[];
788
+ /** `eb:Timestamp` de la respuesta de Sabre, en ISO 8601 UTC. Falta si Sabre no lo manda. */
789
+ respondedAt?: string;
790
+ }
791
+
792
+ export { type PricingInformation as $, type LegDesc as A, type BargainFinderMaxRequest as B, type CurrencyConversion as C, type LegDescription as D, type LegSchedule as E, type Fare as F, type GroupedItineraryResponse as G, type LegScheduleRef as H, type ItineraryGroup as I, type LowFareSearchFlight as J, type LowFareSearchLocation as K, type Leg as L, type LowFareSearchOriginDestination as M, type LowFareSearchPassengerTypeQuantity as N, type OtaAirLowFareSearchRq as O, type LowFareSearchRequestorId as P, type QueueRef as Q, type ReservationHistoryTransaction as R, SabreError as S, type LowFareSearchSource as T, type LowFareSearchTpaExtensions as U, type LowFareSearchTravelPreferences as V, type LowFareSearchTravelerInfoSummary as W, MESSAGE_QUEUE as X, type ObFeeDesc as Y, type PassengerInfo as Z, type PassengerTotalFare as _, type QueueActivityCounters as a, type QueueActivity as a0, type Ref as a1, type SabreBusinessErrorOptions as a2, type SabreErrorOptions as a3, SabreGatewayError as a4, type SabreGatewayErrorOptions as a5, SabreOrchestrationError as a6, type SabreOrchestrationErrorOptions as a7, type SabreProtocol as a8, type SabreRawRequest as a9, type SabreRawResponse as aa, type SabreServiceErrorOptions as ab, SabreSessionError as ac, type SabreSessionErrorKind as ad, type SabreSessionErrorOptions as ae, type ScheduleCarrier as af, type ScheduleDesc as ag, type ScheduleEndpoint as ah, type ScheduleEquipment as ai, type TaxDesc as aj, type TaxSummaryDesc as ak, type TotalFare as al, type ValidatingCarrierDesc as am, isMessageQueue as an, type ReservationHistoryFlightSegment as b, type ReservationHistoryText as c, type ReservationHistoryAccounting as d, type RetryOptions as e, type SabreRawResponseCallback as f, type SabreRawRequestCallback as g, SabreWarning as h, SabreBusinessError as i, type Itinerary as j, type RequestOptions as k, type BargainFinderMaxResponse as l, type QueueActivityRequest as m, type QueueActivityOptions as n, type QueueActivityResponse as o, type ReservationHistoryOptions as p, type ReservationHistoryResponse as q, type BaggageAllowanceDesc as r, type BaggageInformation as s, type FareComponent as t, type FareComponentDesc as u, type FareComponentDescSegment as v, type FareComponentSegment as w, type FareComponentSegmentDetail as x, type FareMessage as y, type ItineraryMessage as z };