sabre-client 0.5.1 → 0.7.0
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.
- package/README.es.md +265 -16
- package/README.md +266 -16
- package/dist/index.d.ts +354 -10
- package/dist/index.js +786 -181
- package/dist/index.js.map +1 -1
- package/dist/{reservation-history-BKRFlxpA.d.ts → reservation-history-BRKQBHsj.d.ts} +178 -3
- package/dist/testing.d.ts +127 -8
- package/dist/testing.js +811 -51
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
|
@@ -106,6 +106,42 @@ declare class SabreBusinessError extends SabreError {
|
|
|
106
106
|
readonly errors: readonly SabreBusinessError[];
|
|
107
107
|
constructor(message: string, options: SabreBusinessErrorOptions);
|
|
108
108
|
}
|
|
109
|
+
/** Por qué el SDK no sabe si una operación que mueve dinero llegó a hacerse (ADR-031). */
|
|
110
|
+
type SabreUncertainOutcomeReason = 'UNABLE_TO_RETRIEVE_TICKETS' | 'FULFILLMENT_NOT_CONFIRMED' | 'INTERNAL_SERVER_TIMEOUT' | 'DOWNLINE_SERVICE_ERROR' | 'PAYMENT_CARD_ISSUE' | 'END_TRANSACTION_PROBLEM' | 'NOT_COMMITTED' | 'TRANSPORT' | 'GATEWAY_5XX' | 'UNPARSEABLE' | 'ABORTED';
|
|
111
|
+
/** Un boleto que Sabre alcanzó a devolver en una respuesta incierta. */
|
|
112
|
+
interface SabreUncertainTicket {
|
|
113
|
+
number: string;
|
|
114
|
+
ticketStatusCode?: string;
|
|
115
|
+
isCommitted?: boolean;
|
|
116
|
+
}
|
|
117
|
+
interface SabreUncertainOutcomeErrorOptions extends Omit<SabreErrorOptions, 'retryable'> {
|
|
118
|
+
/** Método público sin `sabre.`: `'tickets.fulfill'` o `'booking.cancel'`. */
|
|
119
|
+
operation: string;
|
|
120
|
+
confirmationId: string;
|
|
121
|
+
reason: SabreUncertainOutcomeReason;
|
|
122
|
+
tickets?: readonly SabreUncertainTicket[];
|
|
123
|
+
warnings?: readonly SabreWarning[];
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* La emisión o el void pudieron haberse hecho, o no: el SDK no lo sabe (ADR-031). **No se
|
|
127
|
+
* reintenta**, ni automáticamente ni a ciegas: primero se verifica con `sabre.tickets.verify` (o
|
|
128
|
+
* Get Booking), pasando los `tickets` de este error como `expectedTickets`.
|
|
129
|
+
*
|
|
130
|
+
* - Con `reason: 'NOT_COMMITTED'`, `tickets` trae siempre los boletos que Sabre devolvió con
|
|
131
|
+
* `isCommitted: false`: **esos boletos están emitidos**, aunque todavía no aparezcan en el PNR.
|
|
132
|
+
* No se vuelve a emitir.
|
|
133
|
+
* - Con `reason: 'ABORTED'`, el `signal` se abortó con el request ya mandado; el `AbortError` va
|
|
134
|
+
* en `cause`. Es la única excepción a que un abort se propague tal cual (ADR-011).
|
|
135
|
+
*/
|
|
136
|
+
declare class SabreUncertainOutcomeError extends SabreError {
|
|
137
|
+
name: string;
|
|
138
|
+
readonly operation: string;
|
|
139
|
+
readonly confirmationId: string;
|
|
140
|
+
readonly reason: SabreUncertainOutcomeReason;
|
|
141
|
+
readonly tickets: readonly SabreUncertainTicket[];
|
|
142
|
+
readonly warnings: readonly SabreWarning[];
|
|
143
|
+
constructor(message: string, options: SabreUncertainOutcomeErrorOptions);
|
|
144
|
+
}
|
|
109
145
|
/**
|
|
110
146
|
* Advertencia de un servicio (p. ej. `category: WARNING` de Create Booking, soft errors
|
|
111
147
|
* de End Transaction): no es un fallo fatal. Nunca se reintenta automáticamente.
|
|
@@ -649,12 +685,31 @@ type QueueRef = number | string | {
|
|
|
649
685
|
};
|
|
650
686
|
/** La cola de mensajes del PCC: no tiene PNR y Sabre no la lista (`INVALID ENTRY`). */
|
|
651
687
|
declare const MESSAGE_QUEUE = "S";
|
|
688
|
+
/**
|
|
689
|
+
* Un rango de colas numéricas, de `start` a `end`, las dos incluidas: `{ start: 1, end: 25 }` es el
|
|
690
|
+
* `QC/<PCC>1-25` del host. Lo usan `count` y `activity`. A diferencia de pedir todo el PCC, Sabre
|
|
691
|
+
* devuelve cada cola del rango, también las vacías, con cuenta `0` (CERT y producción, #213).
|
|
692
|
+
*
|
|
693
|
+
* El design también acepta rangos de colas con nombre (`TEST1-TEST2`), pero ninguna prueba los vio:
|
|
694
|
+
* por ahora solo van números.
|
|
695
|
+
*/
|
|
696
|
+
interface QueueRange {
|
|
697
|
+
start: number;
|
|
698
|
+
end: number;
|
|
699
|
+
}
|
|
652
700
|
/** Si la cola es la de mensajes (`'S'`). */
|
|
653
701
|
declare function isMessageQueue(queue: QueueRef): boolean;
|
|
654
702
|
|
|
655
703
|
interface QueueActivityRequest {
|
|
656
704
|
/** PCC cuyas colas se analizan. Por defecto, el de la sesión. */
|
|
657
705
|
pcc?: string;
|
|
706
|
+
/** Analizar solo esta cola (`QA/<PCC><cola>`). No se combina con `range`. */
|
|
707
|
+
queue?: QueueRef;
|
|
708
|
+
/**
|
|
709
|
+
* Analizar un rango de colas (`QA/<PCC>1-25`). No se combina con `queue`. La respuesta trae cada
|
|
710
|
+
* cola del rango, también las que tienen todos los contadores en 0.
|
|
711
|
+
*/
|
|
712
|
+
range?: QueueRange;
|
|
658
713
|
}
|
|
659
714
|
type QueueActivityOptions = RequestOptions;
|
|
660
715
|
/**
|
|
@@ -686,9 +741,16 @@ interface QueueActivity extends QueueActivityCounters {
|
|
|
686
741
|
queue: QueueRef;
|
|
687
742
|
}
|
|
688
743
|
interface QueueActivityResponse {
|
|
689
|
-
/**
|
|
744
|
+
/**
|
|
745
|
+
* Las colas que trae la respuesta, en el orden de Sabre. Sin filtros, Sabre omite las que tienen
|
|
746
|
+
* todos los contadores en 0; con `range`, trae todas las del rango, y con `queue`, solo esa
|
|
747
|
+
* (CERT y producción, #213).
|
|
748
|
+
*/
|
|
690
749
|
queues: QueueActivity[];
|
|
691
|
-
/**
|
|
750
|
+
/**
|
|
751
|
+
* `Totals`: los ocho contadores sumados para el PCC, o para el rango con `range`. Con `queue`,
|
|
752
|
+
* Sabre no manda `Totals` y queda en `undefined` (#213).
|
|
753
|
+
*/
|
|
692
754
|
totals?: QueueActivityCounters;
|
|
693
755
|
/**
|
|
694
756
|
* `QueueInfo@DateTime` tal cual llegó, sin año (`"11-06T11:33"`): la hora del host al analizar.
|
|
@@ -701,6 +763,119 @@ interface QueueActivityResponse {
|
|
|
701
763
|
respondedAt?: string;
|
|
702
764
|
}
|
|
703
765
|
|
|
766
|
+
type DailySalesDocumentType = 'TKT' | 'EMD' | 'RFND' | 'RFEMD' | 'MCO';
|
|
767
|
+
type DailySalesSettlementType = 'TAT' | 'TCH' | 'TKT' | 'NDC';
|
|
768
|
+
interface DailySalesSummaryRequest {
|
|
769
|
+
/** PCC del reporte. Sin él, Sabre usa el home PCC del token. Otro PCC necesita Branch Access. */
|
|
770
|
+
pcc?: string;
|
|
771
|
+
/** `'YYYY-MM-DD'`. Sin ella, Sabre da el día en curso. Una sola fecha, sin rango. */
|
|
772
|
+
date?: string;
|
|
773
|
+
/** Un solo tipo de documento. Sin él, todos. */
|
|
774
|
+
documentType?: DailySalesDocumentType;
|
|
775
|
+
/** Un solo tipo de settlement. */
|
|
776
|
+
settlementType?: DailySalesSettlementType;
|
|
777
|
+
/** La aerolínea, por código (2 caracteres) o número (3 dígitos). */
|
|
778
|
+
airline?: {
|
|
779
|
+
code?: string;
|
|
780
|
+
number?: string;
|
|
781
|
+
};
|
|
782
|
+
/** Todas las transacciones de ese documento. Sabre recomienda no combinarlo con otros filtros. */
|
|
783
|
+
documentNumber?: string;
|
|
784
|
+
}
|
|
785
|
+
type DailySalesSummaryOptions = RequestOptions;
|
|
786
|
+
/** Un pago de la transacción. Los importes van como string, tal cual llegan. */
|
|
787
|
+
interface DailySalesPaymentDetail {
|
|
788
|
+
fop: string;
|
|
789
|
+
/** `Cash` o `Credit`. */
|
|
790
|
+
category: string;
|
|
791
|
+
cardType?: string;
|
|
792
|
+
amount: string;
|
|
793
|
+
}
|
|
794
|
+
interface DailySalesPayments {
|
|
795
|
+
currencyCode: string;
|
|
796
|
+
total: string;
|
|
797
|
+
details: DailySalesPaymentDetail[];
|
|
798
|
+
}
|
|
799
|
+
/** Un movimiento del día: una venta, un reembolso, un void… */
|
|
800
|
+
interface DailySalesTransaction {
|
|
801
|
+
/** El reembolso llega como `RFD`, aunque la guía dice `RFND` (producción, 2026-11-12). */
|
|
802
|
+
documentType: 'TKT' | 'EMD' | 'RFD' | 'RFND' | 'RFEMD' | 'MCO' | (string & {});
|
|
803
|
+
transactionCode: 'SALE' | 'RFND' | 'CNCL' | 'VOID' | (string & {});
|
|
804
|
+
/** `A` additional collection, `E` even exchange, `N` net remit, `P`, `R`, `SF`, `V` void, `X` cancel refund. */
|
|
805
|
+
documentStatusCode?: string;
|
|
806
|
+
settlementType: string;
|
|
807
|
+
pnrLocator?: string;
|
|
808
|
+
passengerName?: string;
|
|
809
|
+
documentNumber: string;
|
|
810
|
+
lastConjunctiveDocumentNumber?: string;
|
|
811
|
+
stockType?: string;
|
|
812
|
+
airline: {
|
|
813
|
+
code: string;
|
|
814
|
+
number?: string;
|
|
815
|
+
};
|
|
816
|
+
commission?: {
|
|
817
|
+
amount?: string;
|
|
818
|
+
percent?: string;
|
|
819
|
+
};
|
|
820
|
+
payments?: DailySalesPayments;
|
|
821
|
+
agentSine: string;
|
|
822
|
+
agentPseudoCity?: string;
|
|
823
|
+
/**
|
|
824
|
+
* Fecha y hora **tal como llegan, sin zona**: `'YYYY-MM-DDTHH:MM:SS.sss'`. En producción vienen
|
|
825
|
+
* en hora local del PCC (México, 2026-11-12); el SDK no las convierte porque no conoce la zona.
|
|
826
|
+
*/
|
|
827
|
+
transactionDateTime: string;
|
|
828
|
+
electronicDocument?: boolean;
|
|
829
|
+
nonInteractive?: boolean;
|
|
830
|
+
itineraryType?: 'D' | 'I' | (string & {});
|
|
831
|
+
automatedRefund?: boolean;
|
|
832
|
+
}
|
|
833
|
+
/** Un total de `TotalDailySales`: por tipo de transacción, settlement y moneda. */
|
|
834
|
+
interface DailySalesTotal {
|
|
835
|
+
transactionType: string;
|
|
836
|
+
settlementType: string;
|
|
837
|
+
currencyCode?: string;
|
|
838
|
+
cash?: {
|
|
839
|
+
amount: string;
|
|
840
|
+
count?: number;
|
|
841
|
+
};
|
|
842
|
+
credit?: {
|
|
843
|
+
amount: string;
|
|
844
|
+
count?: number;
|
|
845
|
+
};
|
|
846
|
+
commission?: {
|
|
847
|
+
amount: string;
|
|
848
|
+
count?: number;
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
interface DailySalesSummaryResult {
|
|
852
|
+
/**
|
|
853
|
+
* - `complete`: el reporte entero;
|
|
854
|
+
* - `incomplete`: Sabre no pudo leer algunos documentos (`failedDocuments`); faltan transacciones;
|
|
855
|
+
* - `deferred`: Sabre lo dejó en caché (`deferred.reportId`) o sigue corriendo. El SDK no pide
|
|
856
|
+
* `CachedReportRQ`: hay que volver a pedir el reporte más tarde.
|
|
857
|
+
*
|
|
858
|
+
* Solo `complete` es el día entero.
|
|
859
|
+
*/
|
|
860
|
+
status: 'complete' | 'incomplete' | 'deferred';
|
|
861
|
+
pcc: string;
|
|
862
|
+
agencyName?: string;
|
|
863
|
+
/** `DSHeader`/`DailySalesReport` `ReportDate`, tal cual. */
|
|
864
|
+
reportDate?: string;
|
|
865
|
+
transactions: DailySalesTransaction[];
|
|
866
|
+
totals: DailySalesTotal[];
|
|
867
|
+
/** Los documentos de `Error status="Incomplete"`. */
|
|
868
|
+
failedDocuments?: string[];
|
|
869
|
+
deferred?: {
|
|
870
|
+
reportId?: string;
|
|
871
|
+
chunkNumber?: number;
|
|
872
|
+
maxChunks?: number;
|
|
873
|
+
queryStillRunning: boolean;
|
|
874
|
+
};
|
|
875
|
+
/** `eb:Timestamp` de la respuesta, en ISO 8601 UTC. */
|
|
876
|
+
respondedAt?: string;
|
|
877
|
+
}
|
|
878
|
+
|
|
704
879
|
type ReservationHistoryOptions = RequestOptions;
|
|
705
880
|
/**
|
|
706
881
|
* Un elemento con su acción y su texto: `GeneralInfo` o `RemarkInfo/Remark`. Sabre no publica el
|
|
@@ -789,4 +964,4 @@ interface ReservationHistoryResponse {
|
|
|
789
964
|
respondedAt?: string;
|
|
790
965
|
}
|
|
791
966
|
|
|
792
|
-
export { type
|
|
967
|
+
export { type LowFareSearchOriginDestination as $, type DailySalesPayments as A, type BargainFinderMaxRequest as B, type CurrencyConversion as C, type DailySalesTransaction as D, type DailySalesSettlementType as E, type DailySalesTotal as F, type GroupedItineraryResponse as G, type Fare as H, type ItineraryGroup as I, type FareComponent as J, type FareComponentDesc as K, type FareComponentDescSegment as L, type FareComponentSegment as M, type FareComponentSegmentDetail as N, type OtaAirLowFareSearchRq as O, type FareMessage as P, type QueueRef as Q, type ReservationHistoryTransaction as R, type SabreUncertainOutcomeReason as S, type ItineraryMessage as T, type Leg as U, type LegDesc as V, type LegDescription as W, type LegSchedule as X, type LegScheduleRef as Y, type LowFareSearchFlight as Z, type LowFareSearchLocation as _, type QueueActivityCounters as a, type LowFareSearchPassengerTypeQuantity as a0, type LowFareSearchRequestorId as a1, type LowFareSearchSource as a2, type LowFareSearchTpaExtensions as a3, type LowFareSearchTravelPreferences as a4, type LowFareSearchTravelerInfoSummary as a5, MESSAGE_QUEUE as a6, type ObFeeDesc as a7, type PassengerInfo as a8, type PassengerTotalFare as a9, type ValidatingCarrierDesc as aA, isMessageQueue as aB, type PricingInformation as aa, type QueueActivity as ab, type Ref as ac, type SabreBusinessErrorOptions as ad, type SabreErrorOptions as ae, SabreGatewayError as af, type SabreGatewayErrorOptions as ag, SabreOrchestrationError as ah, type SabreOrchestrationErrorOptions as ai, type SabreProtocol as aj, type SabreRawRequest as ak, type SabreRawResponse as al, type SabreServiceErrorOptions as am, SabreSessionError as an, type SabreSessionErrorKind as ao, type SabreSessionErrorOptions as ap, SabreUncertainOutcomeError as aq, type SabreUncertainOutcomeErrorOptions as ar, type SabreUncertainTicket as as, type ScheduleCarrier as at, type ScheduleDesc as au, type ScheduleEndpoint as av, type ScheduleEquipment as aw, type TaxDesc as ax, type TaxSummaryDesc as ay, type TotalFare as az, type ReservationHistoryFlightSegment as b, type ReservationHistoryText as c, type ReservationHistoryAccounting as d, type RetryOptions as e, SabreError as f, type SabreRawResponseCallback as g, type SabreRawRequestCallback as h, SabreWarning as i, SabreBusinessError as j, type Itinerary as k, type RequestOptions as l, type BargainFinderMaxResponse as m, type QueueRange as n, type QueueActivityRequest as o, type QueueActivityOptions as p, type QueueActivityResponse as q, type DailySalesSummaryRequest as r, type DailySalesSummaryOptions as s, type DailySalesSummaryResult as t, type ReservationHistoryOptions as u, type ReservationHistoryResponse as v, type BaggageAllowanceDesc as w, type BaggageInformation as x, type DailySalesDocumentType as y, type DailySalesPaymentDetail as z };
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,6 +1,65 @@
|
|
|
1
|
-
import { Q as QueueRef, a as QueueActivityCounters, R as ReservationHistoryTransaction, b as ReservationHistoryFlightSegment, c as ReservationHistoryText, d as ReservationHistoryAccounting } from './reservation-history-
|
|
1
|
+
import { S as SabreUncertainOutcomeReason, Q as QueueRef, a as QueueActivityCounters, D as DailySalesTransaction, R as ReservationHistoryTransaction, b as ReservationHistoryFlightSegment, c as ReservationHistoryText, d as ReservationHistoryAccounting } from './reservation-history-BRKQBHsj.js';
|
|
2
2
|
export { Anonymizer, AnonymizerLeak, AnonymizerOptions, createAnonymizer, isSafeHostLine } from './anonymize.js';
|
|
3
3
|
|
|
4
|
+
/** Un boleto sembrado o emitido por el fake. */
|
|
5
|
+
interface QueueFakeTicket {
|
|
6
|
+
number: string;
|
|
7
|
+
/** `TE` vigente (por defecto) o `TV` anulado. */
|
|
8
|
+
ticketStatusCode?: 'TE' | 'TV';
|
|
9
|
+
/** `YYYY-MM-DD`; por defecto, el día de `now()`. */
|
|
10
|
+
date?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Una reserva sembrada para Get, Cancel y Fulfill sin pasar por Create. */
|
|
13
|
+
interface QueueFakeBooking {
|
|
14
|
+
/** Cuántos vuelos tiene; 1 por defecto. */
|
|
15
|
+
flights?: number;
|
|
16
|
+
tickets?: readonly QueueFakeTicket[];
|
|
17
|
+
}
|
|
18
|
+
/** Los rechazos de configuración del PCC vistos en CERT (2026-11-12), como `DOWNLINE_SERVICE_ERROR`. */
|
|
19
|
+
type QueueFakeDownlineCause = 'INVALID_TICKET_STOCK' | 'COMMISSION_REQUIRED' | 'HARDCOPY_PRINTER' | 'SECURE_FLIGHT';
|
|
20
|
+
/**
|
|
21
|
+
* El desenlace del siguiente `tickets.fulfill`. Sin forzar, emite un boleto `TE` por pasajero
|
|
22
|
+
* (uno por reserva en el fake), o responde `BOOKING_FULFILLED` si la reserva ya tiene boletos
|
|
23
|
+
* vigentes.
|
|
24
|
+
*/
|
|
25
|
+
type QueueFakeFulfillOutcome = 'issued'
|
|
26
|
+
/** Emite y avisa `PARTIAL_FULFILLMENT`. */
|
|
27
|
+
| 'partial'
|
|
28
|
+
/**
|
|
29
|
+
* Fuerza un incierto. `issued` dice si la reserva queda emitida de verdad, para probar la
|
|
30
|
+
* verificación. Por defecto: sí con `UNABLE_TO_RETRIEVE_TICKETS`, `INTERNAL_SERVER_TIMEOUT`,
|
|
31
|
+
* `NOT_COMMITTED` (el boleto existe pero no aparece en el PNR), `TRANSPORT`, `GATEWAY_5XX`,
|
|
32
|
+
* `UNPARSEABLE` y `ABORTED`; no con `FULFILLMENT_NOT_CONFIRMED`, `DOWNLINE_SERVICE_ERROR` y
|
|
33
|
+
* `PAYMENT_CARD_ISSUE`.
|
|
34
|
+
*/
|
|
35
|
+
| {
|
|
36
|
+
uncertain: Exclude<SabreUncertainOutcomeReason, 'END_TRANSACTION_PROBLEM'>;
|
|
37
|
+
issued?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** Un `DOWNLINE_SERVICE_ERROR` de CERT, con su texto real. No emite. */
|
|
40
|
+
| {
|
|
41
|
+
downline: QueueFakeDownlineCause;
|
|
42
|
+
}
|
|
43
|
+
/** Un error del catálogo de Fulfill que no emite (p. ej. `PRICE_MISMATCH`). */
|
|
44
|
+
| {
|
|
45
|
+
error: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
};
|
|
48
|
+
/** El desenlace del siguiente `booking.cancel` con `VOID`. */
|
|
49
|
+
type QueueFakeVoidOutcome = 'voided'
|
|
50
|
+
/** Fuerza un incierto. `voided` dice si el void se hizo de verdad; por defecto, sí. */
|
|
51
|
+
| {
|
|
52
|
+
uncertain: 'END_TRANSACTION_PROBLEM' | 'TRANSPORT' | 'GATEWAY_5XX' | 'UNPARSEABLE' | 'ABORTED';
|
|
53
|
+
voided?: boolean;
|
|
54
|
+
};
|
|
55
|
+
/** Desenlaces forzados, en orden: cada llamada consume el primero que quede. */
|
|
56
|
+
interface QueueFakeTicketing {
|
|
57
|
+
fulfill?: readonly QueueFakeFulfillOutcome[];
|
|
58
|
+
void?: readonly QueueFakeVoidOutcome[];
|
|
59
|
+
}
|
|
60
|
+
/** Lo que la parte REST registra en `calls`. */
|
|
61
|
+
type BookingFakeCommand = 'token' | 'createBooking' | 'getBooking' | 'cancelBooking' | 'fulfill';
|
|
62
|
+
|
|
4
63
|
/** Un PNR del fake, con los campos que Sabre manda en `Line`. */
|
|
5
64
|
interface QueueFakePnr {
|
|
6
65
|
/** Localizador de 6 caracteres alfanuméricos. */
|
|
@@ -8,12 +67,14 @@ interface QueueFakePnr {
|
|
|
8
67
|
/**
|
|
9
68
|
* Las líneas del PNR en formato de host, como el `Paragraph` de Access Queue. Si no termina en
|
|
10
69
|
* una línea de firma (`… HHMM/DDMMMYY <localizador> H`), el fake agrega una: `place` dentro de
|
|
11
|
-
* una cola saca el localizador de ahí, igual que con Sabre.
|
|
70
|
+
* una cola saca el localizador de ahí, igual que con Sabre. `selection` `AL` y `AC` filtran por
|
|
71
|
+
* los segmentos del párrafo, y `PI` por su aviso de PIC (`011 SEE REMARKS`), como los lee
|
|
72
|
+
* `parseQueueParagraph`.
|
|
12
73
|
*/
|
|
13
74
|
paragraph?: readonly string[];
|
|
14
|
-
/** `Line/DateTime`, tal cual. */
|
|
75
|
+
/** `Line/DateTime`, tal cual. Es la fecha por la que filtra `selection` `QD`. */
|
|
15
76
|
placedAt?: string;
|
|
16
|
-
/** `Line/POS/Source`. */
|
|
77
|
+
/** `Line/POS/Source`. `selection` `AK` filtra por el PCC más la firma (`'ABCDAAT'`). */
|
|
17
78
|
placedBy?: {
|
|
18
79
|
agentSine?: string;
|
|
19
80
|
pseudoCityCode?: string;
|
|
@@ -36,6 +97,27 @@ type QueueFakeHistoryTransaction = Omit<ReservationHistoryTransaction, 'flightSe
|
|
|
36
97
|
remarks?: readonly ReservationHistoryText[];
|
|
37
98
|
accounting?: readonly ReservationHistoryAccounting[];
|
|
38
99
|
};
|
|
100
|
+
/**
|
|
101
|
+
* Un día de ventas para `reporting.dailySalesSummary`: las transacciones, y lo que se quiera forzar.
|
|
102
|
+
* Sin `status`, el reporte sale `complete`.
|
|
103
|
+
*/
|
|
104
|
+
interface QueueFakeDailySalesDay {
|
|
105
|
+
transactions: readonly DailySalesTransaction[];
|
|
106
|
+
/** `incomplete` agrega `Error status="Incomplete"` con `failedDocuments`; `deferred`, `reportId` y `isQueryStillRunning`. */
|
|
107
|
+
status?: 'complete' | 'incomplete' | 'deferred';
|
|
108
|
+
/** Los documentos que fallaron, con `status: 'incomplete'`. */
|
|
109
|
+
failedDocuments?: readonly string[];
|
|
110
|
+
/** Con `status: 'deferred'`. Por defecto, `reportId: 'FAKE-REPORT'` y `queryStillRunning: true`. */
|
|
111
|
+
deferred?: {
|
|
112
|
+
reportId?: string;
|
|
113
|
+
chunkNumber?: number;
|
|
114
|
+
maxChunks?: number;
|
|
115
|
+
queryStillRunning?: boolean;
|
|
116
|
+
};
|
|
117
|
+
/** Un error forzado, p. ej. `'45100'` (Branch Access) o `'21212'` (versión): el SDK lanza `SabreBusinessError`. */
|
|
118
|
+
errorCode?: string;
|
|
119
|
+
agencyName?: string;
|
|
120
|
+
}
|
|
39
121
|
/** Un PNR: sus campos, o solo el párrafo. Con solo el párrafo, el localizador sale de la línea de firma. */
|
|
40
122
|
type QueueFakeItem = QueueFakePnr | readonly string[];
|
|
41
123
|
interface QueueFakeOptions {
|
|
@@ -66,20 +148,51 @@ interface QueueFakeOptions {
|
|
|
66
148
|
* el fake no conoce da un error de host marcado como no simulado.
|
|
67
149
|
*/
|
|
68
150
|
histories?: Readonly<Record<string, readonly QueueFakeHistoryTransaction[]>>;
|
|
151
|
+
/**
|
|
152
|
+
* Las ventas de `reporting.dailySalesSummary`, por PCC y fecha (`'YYYY-MM-DD'`): las
|
|
153
|
+
* transacciones del día, o un `QueueFakeDailySalesDay` para forzar `incomplete`, `deferred` o un
|
|
154
|
+
* error. Sin `pcc` en el request vale el PCC de la sesión, y sin `date`, el día de `now()` en
|
|
155
|
+
* `dailySalesTimeZone`. Un PCC o un día sin
|
|
156
|
+
* sembrar da un reporte `complete` vacío, como un PCC que no emite (producción, 2026-11-12).
|
|
157
|
+
* Las transacciones se devuelven en el orden sembrado; el filtro `documentType` se simula
|
|
158
|
+
* (con `RFND` también entran las `RFD`, el código real del reembolso), los demás no. Los
|
|
159
|
+
* `totals` salen vacíos.
|
|
160
|
+
*/
|
|
161
|
+
dailySales?: Readonly<Record<string, Readonly<Record<string, readonly DailySalesTransaction[] | QueueFakeDailySalesDay>>>>;
|
|
162
|
+
/**
|
|
163
|
+
* La zona IANA del «día en curso» de `dailySalesSummary` sin `date`, p. ej. `'America/Mexico_City'`.
|
|
164
|
+
* Sabre usa el día local del PCC (producción, 2026-11-12, y Q-106 con `QD`): con México, entre
|
|
165
|
+
* las 18:00 y las 24:00 locales el día UTC ya es el siguiente. Por defecto, `'UTC'`.
|
|
166
|
+
*/
|
|
167
|
+
dailySalesTimeZone?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Reservas para el cliente REST (`Sabre`), por localizador, sin pasar por `booking.create`. Las
|
|
170
|
+
* que crea `booking.create` se suman solas, con localizadores `FAKEAA`, `FAKEAB`…
|
|
171
|
+
*/
|
|
172
|
+
bookings?: Readonly<Record<string, QueueFakeBooking>>;
|
|
173
|
+
/**
|
|
174
|
+
* Desenlaces forzados de `tickets.fulfill` y de `booking.cancel` con `VOID`, en orden. Sin
|
|
175
|
+
* forzar, Fulfill emite un boleto `TE` (y `BOOKING_FULFILLED` si ya hay uno vigente), y el void
|
|
176
|
+
* lo deja en `TV` y, con `cancelAll`, cancela la reserva.
|
|
177
|
+
*/
|
|
178
|
+
ticketing?: QueueFakeTicketing;
|
|
69
179
|
/** Reloj de las fechas de `count` y de `place`. Por defecto, `new Date()`. Las fechas van en UTC. */
|
|
70
180
|
now?: () => Date;
|
|
71
181
|
}
|
|
72
182
|
/** Qué le pidió el SDK al fake. */
|
|
73
|
-
type QueueFakeCommand = 'open' | 'close' | 'ping' | 'count' | 'access' | 'list' | 'ignore' | 'remove' | 'exit' | 'place' | 'activity' | 'history';
|
|
183
|
+
type QueueFakeCommand = 'open' | 'close' | 'ping' | 'count' | 'access' | 'list' | 'ignore' | 'remove' | 'exit' | 'place' | 'activity' | 'history' | 'dailySalesSummary' | BookingFakeCommand;
|
|
74
184
|
interface QueueFakeCall {
|
|
75
185
|
command: QueueFakeCommand;
|
|
76
186
|
/** La cola de `access` y `list`. */
|
|
77
187
|
queue?: QueueRef;
|
|
78
|
-
/** El localizador de `history
|
|
188
|
+
/** El localizador de `history` y de las llamadas REST de reserva y emisión. */
|
|
79
189
|
locator?: string;
|
|
190
|
+
/** El PCC y la fecha que pidió `dailySalesSummary`, si los mandó. */
|
|
191
|
+
pcc?: string;
|
|
192
|
+
date?: string;
|
|
80
193
|
}
|
|
81
194
|
interface QueueFake {
|
|
82
|
-
/** Se pasa como `config.fetch` de `SabreLegacy
|
|
195
|
+
/** Se pasa como `config.fetch` de `SabreLegacy` y de `Sabre`: el mismo atiende SOAP y REST. */
|
|
83
196
|
readonly fetch: typeof fetch;
|
|
84
197
|
/** Los localizadores de una cola, en orden, con lo que el recorrido haya sacado o colocado. */
|
|
85
198
|
locators(queue: QueueRef): string[];
|
|
@@ -96,6 +209,12 @@ interface QueueFake {
|
|
|
96
209
|
*/
|
|
97
210
|
expireSessions(): void;
|
|
98
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* Las funciones de `selection` que simula el fake (#202). En `list`, Sabre acepta solo `QD` y `AK`
|
|
214
|
+
* (producción, #155); en `access` y `count`, cualquiera (#213), pero el fake simula solo estas.
|
|
215
|
+
* Las demás dan un error de host marcado como no simulado.
|
|
216
|
+
*/
|
|
217
|
+
declare const QUEUE_FAKE_SELECTION_FUNCTIONS: readonly ["QD", "AK", "AL", "PI", "AC"];
|
|
99
218
|
declare function createQueueFake(options?: QueueFakeOptions): QueueFake;
|
|
100
219
|
|
|
101
220
|
/** Una respuesta grabada: la operación del SDK, el HTTP status y el sobre SOAP tal cual llegó. */
|
|
@@ -166,4 +285,4 @@ declare const queueFixtures: Readonly<{
|
|
|
166
285
|
*/
|
|
167
286
|
declare function queueFakePnrs(fixture: RecordedFixture): QueueFakePnr[];
|
|
168
287
|
|
|
169
|
-
export { type QueueFake, type QueueFakeActivity, type QueueFakeCall, type QueueFakeCommand, type QueueFakeHistoryTransaction, type QueueFakeItem, type QueueFakeOptions, type QueueFakePnr, type RecordedFixture, type RecordedResponse, createQueueFake, queueFakePnrs, queueFixtures };
|
|
288
|
+
export { QUEUE_FAKE_SELECTION_FUNCTIONS, type QueueFake, type QueueFakeActivity, type QueueFakeBooking, type QueueFakeCall, type QueueFakeCommand, type QueueFakeDailySalesDay, type QueueFakeDownlineCause, type QueueFakeFulfillOutcome, type QueueFakeHistoryTransaction, type QueueFakeItem, type QueueFakeOptions, type QueueFakePnr, type QueueFakeTicket, type QueueFakeTicketing, type QueueFakeVoidOutcome, type RecordedFixture, type RecordedResponse, createQueueFake, queueFakePnrs, queueFixtures };
|