sabre-client 0.5.0 → 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.
- package/README.es.md +29 -5
- package/README.md +29 -5
- package/dist/anonymize.d.ts +54 -0
- package/dist/anonymize.js +111 -0
- package/dist/anonymize.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/{reservation-history-bKDqkf8T.d.ts → reservation-history-BKRFlxpA.d.ts} +5 -1
- package/dist/testing.d.ts +10 -55
- package/dist/testing.js.map +1 -1
- package/package.json +5 -1
|
@@ -647,6 +647,10 @@ interface RequestOptions {
|
|
|
647
647
|
type QueueRef = number | string | {
|
|
648
648
|
name: string;
|
|
649
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;
|
|
650
654
|
|
|
651
655
|
interface QueueActivityRequest {
|
|
652
656
|
/** PCC cuyas colas se analizan. Por defecto, el de la sesión. */
|
|
@@ -785,4 +789,4 @@ interface ReservationHistoryResponse {
|
|
|
785
789
|
respondedAt?: string;
|
|
786
790
|
}
|
|
787
791
|
|
|
788
|
-
export { type
|
|
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 };
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Q as QueueRef,
|
|
1
|
+
import { Q as QueueRef, a as QueueActivityCounters, R as ReservationHistoryTransaction, b as ReservationHistoryFlightSegment, c as ReservationHistoryText, d as ReservationHistoryAccounting } from './reservation-history-BKRFlxpA.js';
|
|
2
|
+
export { Anonymizer, AnonymizerLeak, AnonymizerOptions, createAnonymizer, isSafeHostLine } from './anonymize.js';
|
|
2
3
|
|
|
3
4
|
/** Un PNR del fake, con los campos que Sabre manda en `Line`. */
|
|
4
5
|
interface QueueFakePnr {
|
|
@@ -97,59 +98,6 @@ interface QueueFake {
|
|
|
97
98
|
}
|
|
98
99
|
declare function createQueueFake(options?: QueueFakeOptions): QueueFake;
|
|
99
100
|
|
|
100
|
-
/** Qué dato real quedó en un texto: lo que devuelve `Anonymizer.leaks`. */
|
|
101
|
-
type AnonymizerLeak = 'secreto' | 'localizador' | 'nombre' | 'línea del PNR' | 'token';
|
|
102
|
-
interface AnonymizerOptions {
|
|
103
|
-
/**
|
|
104
|
-
* Valores que nunca deben quedar: credenciales, usuario, PCC. Cada uno pasa a `XXXX` donde
|
|
105
|
-
* aparezca. Se ignoran los que no son string o tienen menos de 3 caracteres.
|
|
106
|
-
*/
|
|
107
|
-
secrets?: ReadonlyArray<string | undefined>;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Una anonimización con memoria: el mismo localizador da siempre el mismo alias y el mismo
|
|
111
|
-
* pasajero el mismo nombre falso, en todos los textos que pasen por ella. Una por grabación.
|
|
112
|
-
*/
|
|
113
|
-
interface Anonymizer {
|
|
114
|
-
/**
|
|
115
|
-
* Un sobre SOAP o cualquier texto con su XML (también un JSON con XML adentro):
|
|
116
|
-
* - cada `UniqueID@ID` pasa a un alias (`AAAAAA`, `AAAAAB`…), y el localizador real se reemplaza
|
|
117
|
-
* por su alias en todo el texto;
|
|
118
|
-
* - `PassengerName` a `PASAJERO/UNO`, `PASAJERO/DOS`…, y `Group` a `GRUPO`;
|
|
119
|
-
* - `AgentSine` a `AAA` (salvo `SABRE`), `PseudoCityCode` a `XXXX` y `LNIATA` a `XXXXXX`;
|
|
120
|
-
* - cada `<Text>` pasa por `maskLine`;
|
|
121
|
-
* - los `secrets`, a `XXXX`.
|
|
122
|
-
*/
|
|
123
|
-
anonymize(text: string): string;
|
|
124
|
-
/**
|
|
125
|
-
* Una línea del PNR en formato de host. Las de la lista blanca (`isSafeHostLine`) quedan tal
|
|
126
|
-
* cual; en las demás, letras a `X` y dígitos a `9`. La cabecera `QUEUE LIST FOR <PCC>` solo
|
|
127
|
-
* tapa el PCC, y `RECEIVED FROM - ` conserva el prefijo. La línea de firma
|
|
128
|
-
* (`… HHMM/DDMMMYY <localizador> H`) conserva su forma, y el localizador solo si ya es un alias:
|
|
129
|
-
* de ella sale el localizador del PNR siguiente en `place` dentro de una cola. Llamarla después
|
|
130
|
-
* de dar alias a los localizadores.
|
|
131
|
-
*/
|
|
132
|
-
maskLine(line: string): string;
|
|
133
|
-
/** `maskLine` sobre cada línea de un párrafo, p. ej. `QueueItem.paragraph`. */
|
|
134
|
-
maskParagraph(lines: readonly string[]): string[];
|
|
135
|
-
/** El alias de un localizador: lo asigna la primera vez, en orden (`AAAAAA`, `AAAAAB`…). */
|
|
136
|
-
aliasOf(locator: string): string;
|
|
137
|
-
/**
|
|
138
|
-
* Qué datos reales siguen en `text`, sin repetir: un `secret`, un localizador o un nombre que ya
|
|
139
|
-
* tienen alias, una línea del PNR que se enmascaró, o un token de sesión. Vacío si no queda
|
|
140
|
-
* ninguno. Sirve para no escribir una fixture que todavía trae datos reales.
|
|
141
|
-
*/
|
|
142
|
-
leaks(text: string): AnonymizerLeak[];
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Si una línea del PNR en formato de host queda tal cual al anonimizar: está en la lista blanca de
|
|
146
|
-
* #96 (líneas vacías, avisos PIC como `011 SEE REMARKS`, títulos de sección como `REMARKS`, el fin
|
|
147
|
-
* de cola).
|
|
148
|
-
*/
|
|
149
|
-
declare function isSafeHostLine(line: string): boolean;
|
|
150
|
-
/** Ver `Anonymizer`. */
|
|
151
|
-
declare function createAnonymizer(options?: AnonymizerOptions): Anonymizer;
|
|
152
|
-
|
|
153
101
|
/** Una respuesta grabada: la operación del SDK, el HTTP status y el sobre SOAP tal cual llegó. */
|
|
154
102
|
interface RecordedResponse {
|
|
155
103
|
/** `operation` de `onRawResponse` (`'openSession'`, `'queue.access'`…) o `probe.*` si el script la mandó crudo. */
|
|
@@ -176,6 +124,9 @@ interface RecordedFixture {
|
|
|
176
124
|
* - `place`: `place` fuera y dentro de una cola, y `remove` hasta el fin de cola;
|
|
177
125
|
* - `placeWithoutInstructionCode` y `placeWithoutInstructionCodeInside`: `place` sin PIC, fuera
|
|
178
126
|
* (`INSTRUCTION NUMBER NOT IN RANGE`) y dentro de una cola (`NEED INSTRUCTION NUMBER`).
|
|
127
|
+
*
|
|
128
|
+
* El `list` de `walk` se grabó sin `primaryPassenger: true` (sin `/LN`), así que ningún `Line`
|
|
129
|
+
* trae `PassengerName` (#193).
|
|
179
130
|
*/
|
|
180
131
|
declare const queueFixtures: Readonly<{
|
|
181
132
|
walk: RecordedFixture;
|
|
@@ -193,6 +144,10 @@ declare const queueFixtures: Readonly<{
|
|
|
193
144
|
* - `placedAt`, `placedBy` y `primaryPassenger` salen del `Line` de `list`. Si el PNR no está en la
|
|
194
145
|
* lista, salen del `Line` del primer `access`, `ignore` o `remove` que lo trae (ahí `placedAt` es
|
|
195
146
|
* la última modificación del PNR, no su colocación en la cola).
|
|
147
|
+
* - `primaryPassenger` solo sale si el `Line` trae `PassengerName`, y Sabre solo lo manda en un
|
|
148
|
+
* `list` con `primaryPassenger: true` (`/LN`). Las fixtures de `queueFixtures` se grabaron sin
|
|
149
|
+
* `/LN`, así que sus PNR van sin pasajero. Si el consumidor necesita uno, lo agrega con un
|
|
150
|
+
* `map`; el helper no inventa datos que la grabación no tiene (#193).
|
|
196
151
|
* - `paragraph` es el del primer `access`, `ignore`, `remove` o `place` que muestra el PNR, tal
|
|
197
152
|
* cual. El localizador del párrafo sale del `Line`, o de la línea de firma si no hay `Line`
|
|
198
153
|
* (`place` dentro de una cola).
|
|
@@ -211,4 +166,4 @@ declare const queueFixtures: Readonly<{
|
|
|
211
166
|
*/
|
|
212
167
|
declare function queueFakePnrs(fixture: RecordedFixture): QueueFakePnr[];
|
|
213
168
|
|
|
214
|
-
export { type
|
|
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 };
|