sabre-client 0.5.1 → 0.6.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 +45 -10
- package/README.md +45 -10
- package/dist/index.d.ts +61 -10
- package/dist/index.js +80 -17
- package/dist/index.js.map +1 -1
- package/dist/{reservation-history-BKRFlxpA.d.ts → reservation-history-C6giSdFd.d.ts} +29 -3
- package/dist/testing.d.ts +13 -5
- package/dist/testing.js +423 -24
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
package/README.es.md
CHANGED
|
@@ -12,15 +12,16 @@ SDK de TypeScript para las APIs de Sabre.
|
|
|
12
12
|
|
|
13
13
|
## Estado
|
|
14
14
|
|
|
15
|
-
La `0.
|
|
15
|
+
La `0.6.0` está publicada con el dist-tag `next` mientras se prueba; `latest` sigue en la `0.5.1`.
|
|
16
16
|
Cubre el Tier 1 y el Tier 2 del flujo de Air Booking por REST, el Tier 3 (sesiones SOAP y colas) y
|
|
17
17
|
el Tier 4: actividad de colas, historial del PNR, la cola de mensajes `S`, `selection` en `list` y
|
|
18
|
-
`onRawRequest`. La
|
|
19
|
-
|
|
18
|
+
`onRawRequest`. La `0.6.0` suma filtros de cola: `count` con una cola, un rango o `selection`,
|
|
19
|
+
`activity` con una cola o un rango, y `selection` en el fake de colas. No trae cambios
|
|
20
|
+
incompatibles; la línea `0.5` trae tres (ver [Actualizar desde la 0.4](#actualizar-desde-la-04)).
|
|
20
21
|
|
|
21
22
|
```sh
|
|
22
|
-
npm install sabre-client@next # 0.
|
|
23
|
-
npm install sabre-client # 0.
|
|
23
|
+
npm install sabre-client@next # 0.6.0
|
|
24
|
+
npm install sabre-client # 0.5.1
|
|
24
25
|
```
|
|
25
26
|
|
|
26
27
|
El paquete sigue en `0.x`: una versión minor puede traer cambios incompatibles, y el
|
|
@@ -464,8 +465,8 @@ const pnrQueues = queues.filter(({ queue }) => !isMessageQueue(queue));
|
|
|
464
465
|
|
|
465
466
|
| Método | Servicio de Sabre | Devuelve |
|
|
466
467
|
| - | - | - |
|
|
467
|
-
| `count({ pcc? })` | `QueueCountLLSRQ` | `{ queues: [{ queue, count }], totals, countedAt, warnings }` |
|
|
468
|
-
| `activity({ pcc? })` | `QueueAnalysisLLSRQ` | `{ queues: [{ queue, numMessages, ended, ignored, … }], totals, analyzedAt, warnings }` |
|
|
468
|
+
| `count({ pcc?, queue?, range?, selection? })` | `QueueCountLLSRQ` | `{ queues: [{ queue, count }], totals, countedAt, additionalInfo?, warnings }` |
|
|
469
|
+
| `activity({ pcc?, queue?, range? })` | `QueueAnalysisLLSRQ` | `{ queues: [{ queue, numMessages, ended, ignored, … }], totals, analyzedAt, warnings }` |
|
|
469
470
|
| `list({ queue, pcc?, primaryPassenger?, selection? })` | `QueueAccessLLSRQ` (`List`) | `{ locators, entries, paragraph, warnings }`, sin entrar a la cola |
|
|
470
471
|
| `access({ queue, pcc?, selection? })` | `QueueAccessLLSRQ` | `QueueStep` |
|
|
471
472
|
| `ignore()` | `QueueAccessLLSRQ` (`I`) | `QueueStep` |
|
|
@@ -489,12 +490,29 @@ type QueueStep =
|
|
|
489
490
|
agente que lo colocó, PCC más firma, p. ej. `'PCC1AAT'`; todavía no se probó en la lista). Otro
|
|
490
491
|
código lanza `TypeError` sin llamar a Sabre. El `placedAt` de una entrada de la lista es cuándo
|
|
491
492
|
se colocó el PNR en la cola, la fecha por la que filtra `QD`.
|
|
493
|
+
- **Filtros de `count`**: `queue` cuenta una sola cola, y `range: { start, end }`, un rango de
|
|
494
|
+
colas numéricas; no se combinan. Con `range`, Sabre devuelve cada cola del rango, **también las
|
|
495
|
+
vacías**, con `count: 0` (sin filtros las omite). `selection` admite hasta 8 filtros, como
|
|
496
|
+
`access`, y cuenta solo los PNR que cumplen: el host acepta cualquier código (`QD`, `AK`, `AL`,
|
|
497
|
+
`PI`, `AC`… y combinaciones), y con el mismo `QD` la cuenta coincide con `list`. Necesita
|
|
498
|
+
`queue`: sin cola, Sabre responde `QUEUE SELECTED NOT VALID OR CLOSED`, y con un rango,
|
|
499
|
+
`KEYS NOT ALLOWED`, así que el SDK lanza `TypeError` antes. Con `selection`, `totals.unfiltered`
|
|
500
|
+
es cuántos PNR tiene la cola sin filtrar (el `1 MATCHING PNRS OUT OF 80` del host); con `queue`
|
|
501
|
+
sola, Sabre no manda `totals`. `additionalInfo` lee `AdditionalQueueInfo` (una cola transferida a
|
|
502
|
+
otra), tipado desde el design: ninguna respuesta real lo trajo todavía.
|
|
503
|
+
|
|
504
|
+
```ts
|
|
505
|
+
const { queues, totals } = await session.queue.count({ queue: 20, selection: [{ function: 'QD', criteria: '08NOV' }] });
|
|
506
|
+
// queues: [{ queue: 20, count: 1 }], totals: { unfiltered: 80 }
|
|
507
|
+
```
|
|
492
508
|
- **`activity`** devuelve, por cola, los ocho contadores de la pantalla `QA` del host:
|
|
493
509
|
`numMessages` (los que están hoy en la cola), `ended`, `ignored`, `moved`, `removed`,
|
|
494
510
|
`transferred`, `leftMessageToContact` y `unableToReach`, más `totals` para el PCC. Sabre lista
|
|
495
511
|
también colas vacías con contadores. Ninguna fuente dice desde cuándo cuentan, así que el SDK los
|
|
496
512
|
devuelve tal cual. Como `count`, es una lectura: se reintenta, funciona dentro o fuera de una
|
|
497
|
-
cola y no pide duty code 9.
|
|
513
|
+
cola y no pide duty code 9. Acepta los mismos `queue` o `range` que `count` (no los dos): con
|
|
514
|
+
`queue`, solo esa cola y sin `totals`; con `range`, cada cola del rango, también las que tienen
|
|
515
|
+
todos los contadores en 0, y los `totals` del rango.
|
|
498
516
|
- **Cada resultado de colas trae `respondedAt`**: el `eb:Timestamp` de Sabre, en ISO 8601 UTC
|
|
499
517
|
(`'2026-11-06T17:34:16Z'`). A diferencia de `countedAt` y `placedAt`, que llegan como los manda
|
|
500
518
|
el host (sin año y en hora local del PCC), trae año y zona. Solo falta si Sabre no lo manda.
|
|
@@ -623,8 +641,25 @@ fake.openSessions; // 0: la sesión se cerró
|
|
|
623
641
|
- Responde como producción: colas vacías, el fin de cola, `place` que mueve el PNR, el PIC
|
|
624
642
|
obligatorio y una sesión vencida con `fake.expireSessions()`. `fake.calls` lista lo que pidió el
|
|
625
643
|
SDK.
|
|
626
|
-
-
|
|
627
|
-
|
|
644
|
+
- `queue.count` y `queue.activity` con `queue` o `range` responden como producción: una cola sin
|
|
645
|
+
`totals`, o cada cola del rango, también las vacías.
|
|
646
|
+
- `selection` se simula para `QD`, `AK`, `AL`, `PI` y `AC` (`QUEUE_FAKE_SELECTION_FUNCTIONS`), en
|
|
647
|
+
`access`, `list` y `count`, combinados con Y:
|
|
648
|
+
- `QD` filtra por `placedAt` (`'05NOV'` o `'5NOV'`);
|
|
649
|
+
- `AK` filtra por `placedBy`, PCC más firma (`'ABCDAAT'`);
|
|
650
|
+
- `AL` filtra por la aerolínea de los segmentos aéreos del párrafo, y `AC` por su estado (una
|
|
651
|
+
letra cubre todos los estados que empiezan con ella);
|
|
652
|
+
- `PI` filtra por el PIC con que lo colocó `place` o, si no, por el aviso de PIC del párrafo
|
|
653
|
+
(`011 SEE REMARKS`).
|
|
654
|
+
|
|
655
|
+
`access` recorre solo los PNR que cumplen y termina en `END OF DISPLAY`, también al entrar si
|
|
656
|
+
ninguno cumple (un supuesto del fake), e `ignore`, `remove` y `place` saltan los demás. `list`
|
|
657
|
+
devuelve solo las `Line` que cumplen y, como Sabre, rechaza un código que no sea `QD` ni `AK`.
|
|
658
|
+
`count` con `queue` cuenta los que cumplen y devuelve `totals.unfiltered`; con `range` o sin
|
|
659
|
+
cola, da los errores de Sabre. Otro código recibe un error de host marcado como no simulado,
|
|
660
|
+
nunca la cola entera.
|
|
661
|
+
- **No simula** los PCC (las colas son las mismas para cualquier `pcc`) ni las reglas de
|
|
662
|
+
combinación de `selection` del host.
|
|
628
663
|
- `queueFixtures` trae las respuestas anonimizadas que se grabaron en producción (`walk`,
|
|
629
664
|
`emptyQueue`, `place`…), como `{ operation, status, body }`. Cada una tiene sus propios alias de
|
|
630
665
|
localizador (`walk`: `AAAAAA`–`AAAAAD`, `place`: `AAAAAE`–`AAAAAF`,
|
package/README.md
CHANGED
|
@@ -12,15 +12,16 @@ TypeScript SDK for the Sabre APIs.
|
|
|
12
12
|
|
|
13
13
|
## Status
|
|
14
14
|
|
|
15
|
-
`0.
|
|
15
|
+
`0.6.0` is published under the `next` dist-tag while it is tested; `latest` stays on `0.5.1`.
|
|
16
16
|
It covers Tier 1 and Tier 2 of the Air Booking flow over REST, Tier 3 (SOAP sessions and queues)
|
|
17
17
|
and Tier 4: queue activity, PNR history, the `S` message queue, `selection` in `list` and
|
|
18
|
-
`onRawRequest`.
|
|
19
|
-
|
|
18
|
+
`onRawRequest`. `0.6.0` adds queue filters: `count` with one queue, a range or `selection`,
|
|
19
|
+
`activity` with one queue or a range, and `selection` in the queue fake. It has no breaking
|
|
20
|
+
changes; the `0.5` line has three (see [Upgrading from 0.4](#upgrading-from-04)).
|
|
20
21
|
|
|
21
22
|
```sh
|
|
22
|
-
npm install sabre-client@next # 0.
|
|
23
|
-
npm install sabre-client # 0.
|
|
23
|
+
npm install sabre-client@next # 0.6.0
|
|
24
|
+
npm install sabre-client # 0.5.1
|
|
24
25
|
```
|
|
25
26
|
|
|
26
27
|
The package is still `0.x`: a minor version may include breaking changes, and the
|
|
@@ -460,8 +461,8 @@ const pnrQueues = queues.filter(({ queue }) => !isMessageQueue(queue));
|
|
|
460
461
|
|
|
461
462
|
| Method | Sabre service | Returns |
|
|
462
463
|
| - | - | - |
|
|
463
|
-
| `count({ pcc? })` | `QueueCountLLSRQ` | `{ queues: [{ queue, count }], totals, countedAt, warnings }` |
|
|
464
|
-
| `activity({ pcc? })` | `QueueAnalysisLLSRQ` | `{ queues: [{ queue, numMessages, ended, ignored, … }], totals, analyzedAt, warnings }` |
|
|
464
|
+
| `count({ pcc?, queue?, range?, selection? })` | `QueueCountLLSRQ` | `{ queues: [{ queue, count }], totals, countedAt, additionalInfo?, warnings }` |
|
|
465
|
+
| `activity({ pcc?, queue?, range? })` | `QueueAnalysisLLSRQ` | `{ queues: [{ queue, numMessages, ended, ignored, … }], totals, analyzedAt, warnings }` |
|
|
465
466
|
| `list({ queue, pcc?, primaryPassenger?, selection? })` | `QueueAccessLLSRQ` (`List`) | `{ locators, entries, paragraph, warnings }`, without entering the queue |
|
|
466
467
|
| `access({ queue, pcc?, selection? })` | `QueueAccessLLSRQ` | `QueueStep` |
|
|
467
468
|
| `ignore()` | `QueueAccessLLSRQ` (`I`) | `QueueStep` |
|
|
@@ -485,12 +486,30 @@ type QueueStep =
|
|
|
485
486
|
(the agent who placed it, PCC plus sine, e.g. `'PCC1AAT'`; not tested in the list yet).
|
|
486
487
|
Any other code throws a `TypeError` without calling Sabre. The `placedAt` of a list entry is
|
|
487
488
|
when the PNR was placed on the queue, the date `QD` filters on.
|
|
489
|
+
- **`count` filters**: `queue` counts one queue, and `range: { start, end }` a range of numeric
|
|
490
|
+
queues; the two do not combine. With `range`, Sabre returns every queue in the range, **empty
|
|
491
|
+
ones included** with `count: 0` (without filters it leaves them out). `selection` takes up to 8
|
|
492
|
+
filters, like `access`, and counts only the PNRs that match: the host accepts any code (`QD`,
|
|
493
|
+
`AK`, `AL`, `PI`, `AC`… and combinations), and with the same `QD` the count matches `list`. It
|
|
494
|
+
needs `queue`: without a queue Sabre answers `QUEUE SELECTED NOT VALID OR CLOSED`, and with a
|
|
495
|
+
range, `KEYS NOT ALLOWED`, so the SDK throws a `TypeError` first. With `selection`,
|
|
496
|
+
`totals.unfiltered` is how many PNRs the queue has before filtering (the host's
|
|
497
|
+
`1 MATCHING PNRS OUT OF 80`); with `queue` alone Sabre sends no `totals`. `additionalInfo` reads
|
|
498
|
+
`AdditionalQueueInfo` (a queue transferred elsewhere), typed from the design: no real response
|
|
499
|
+
has carried it yet.
|
|
500
|
+
|
|
501
|
+
```ts
|
|
502
|
+
const { queues, totals } = await session.queue.count({ queue: 20, selection: [{ function: 'QD', criteria: '08NOV' }] });
|
|
503
|
+
// queues: [{ queue: 20, count: 1 }], totals: { unfiltered: 80 }
|
|
504
|
+
```
|
|
488
505
|
- **`activity`** returns, per queue, the eight counters of the host's `QA` screen: `numMessages`
|
|
489
506
|
(on the queue now), `ended`, `ignored`, `moved`, `removed`, `transferred`,
|
|
490
507
|
`leftMessageToContact` and `unableToReach`, plus `totals` for the PCC. Sabre also lists empty
|
|
491
508
|
queues that have counters. No source says since when the counters run, so the SDK returns them
|
|
492
509
|
as they come. Like `count`, it is a read: it is retried, it works inside or outside a queue, and
|
|
493
|
-
it does not need duty code 9.
|
|
510
|
+
it does not need duty code 9. It takes the same `queue` or `range` as `count` (not both): with
|
|
511
|
+
`queue`, only that queue and no `totals`; with `range`, every queue in the range, even those
|
|
512
|
+
with all counters at 0, and the range's `totals`.
|
|
494
513
|
- **Every queue result carries `respondedAt`**: Sabre's `eb:Timestamp`, in ISO 8601 UTC
|
|
495
514
|
(`'2026-11-06T17:34:16Z'`). Unlike `countedAt` and `placedAt`, which come as the host sends them
|
|
496
515
|
(no year, PCC local time), it has a year and a zone. It is missing only if Sabre does not send it.
|
|
@@ -617,8 +636,24 @@ fake.openSessions; // 0: the session was closed
|
|
|
617
636
|
- It answers like production: empty queues, the end of the queue, `place` moving the PNR, the
|
|
618
637
|
required PIC, and an expired session with `fake.expireSessions()`. `fake.calls` lists what the
|
|
619
638
|
SDK asked for.
|
|
620
|
-
-
|
|
621
|
-
|
|
639
|
+
- `queue.count` and `queue.activity` with `queue` or `range` answer like production: one queue
|
|
640
|
+
without `totals`, or every queue in the range, empty ones included.
|
|
641
|
+
- `selection` is simulated for `QD`, `AK`, `AL`, `PI` and `AC` (`QUEUE_FAKE_SELECTION_FUNCTIONS`),
|
|
642
|
+
in `access`, `list` and `count`, combined with AND:
|
|
643
|
+
- `QD` filters on `placedAt` (`'05NOV'` or `'5NOV'`);
|
|
644
|
+
- `AK` filters on `placedBy`, PCC plus sine (`'ABCDAAT'`);
|
|
645
|
+
- `AL` filters on the airline of the paragraph's air segments, and `AC` on their status (one
|
|
646
|
+
letter matches every status that starts with it);
|
|
647
|
+
- `PI` filters on the PIC `place` used, or else on the paragraph's PIC notice (`011 SEE REMARKS`).
|
|
648
|
+
|
|
649
|
+
`access` walks only the PNRs that match and ends with `END OF DISPLAY`, also on entering when
|
|
650
|
+
none match (an assumption of the fake), and `ignore`, `remove` and `place` skip the rest. `list`
|
|
651
|
+
returns only the matching `Line`s and, like Sabre, rejects any code other than `QD` or `AK`.
|
|
652
|
+
`count` with `queue` counts the matches and returns `totals.unfiltered`; with `range` or without
|
|
653
|
+
a queue it gives Sabre's errors. Any other code gets a host error marked as not simulated,
|
|
654
|
+
never the whole queue.
|
|
655
|
+
- **Not simulated**: PCCs (the queues are the same for any `pcc`) and the host's combination rules
|
|
656
|
+
for `selection`.
|
|
622
657
|
- `queueFixtures` holds the anonymized responses recorded in production (`walk`, `emptyQueue`,
|
|
623
658
|
`place`, …), as `{ operation, status, body }`. Each one has its own locator aliases (`walk`:
|
|
624
659
|
`AAAAAA`–`AAAAAD`, `place`: `AAAAAE`–`AAAAAF`, `placeWithoutInstructionCodeInside`:
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { e as RetryOptions, S as SabreError, f as SabreRawResponseCallback, g as SabreRawRequestCallback, h as SabreWarning, i as SabreBusinessError, O as OtaAirLowFareSearchRq, G as GroupedItineraryResponse, B as BargainFinderMaxRequest, I as ItineraryGroup, j as Itinerary, k as RequestOptions, l as BargainFinderMaxResponse, Q as QueueRef, m as
|
|
2
|
-
export {
|
|
1
|
+
import { e as RetryOptions, S as SabreError, f as SabreRawResponseCallback, g as SabreRawRequestCallback, h as SabreWarning, i as SabreBusinessError, O as OtaAirLowFareSearchRq, G as GroupedItineraryResponse, B as BargainFinderMaxRequest, I as ItineraryGroup, j as Itinerary, k as RequestOptions, l as BargainFinderMaxResponse, Q as QueueRef, m as QueueRange, n as QueueActivityRequest, o as QueueActivityOptions, p as QueueActivityResponse, q as ReservationHistoryOptions, r as ReservationHistoryResponse } from './reservation-history-C6giSdFd.js';
|
|
2
|
+
export { s as BaggageAllowanceDesc, t as BaggageInformation, C as CurrencyConversion, F as Fare, u as FareComponent, v as FareComponentDesc, w as FareComponentDescSegment, x as FareComponentSegment, y as FareComponentSegmentDetail, z as FareMessage, A as ItineraryMessage, L as Leg, D as LegDesc, E as LegDescription, H as LegSchedule, J as LegScheduleRef, K as LowFareSearchFlight, M as LowFareSearchLocation, N as LowFareSearchOriginDestination, P as LowFareSearchPassengerTypeQuantity, T as LowFareSearchRequestorId, U as LowFareSearchSource, V as LowFareSearchTpaExtensions, W as LowFareSearchTravelPreferences, X as LowFareSearchTravelerInfoSummary, Y as MESSAGE_QUEUE, Z as ObFeeDesc, _ as PassengerInfo, $ as PassengerTotalFare, a0 as PricingInformation, a1 as QueueActivity, a as QueueActivityCounters, a2 as Ref, d as ReservationHistoryAccounting, b as ReservationHistoryFlightSegment, c as ReservationHistoryText, R as ReservationHistoryTransaction, a3 as SabreBusinessErrorOptions, a4 as SabreErrorOptions, a5 as SabreGatewayError, a6 as SabreGatewayErrorOptions, a7 as SabreOrchestrationError, a8 as SabreOrchestrationErrorOptions, a9 as SabreProtocol, aa as SabreRawRequest, ab as SabreRawResponse, ac as SabreServiceErrorOptions, ad as SabreSessionError, ae as SabreSessionErrorKind, af as SabreSessionErrorOptions, ag as ScheduleCarrier, ah as ScheduleDesc, ai as ScheduleEndpoint, aj as ScheduleEquipment, ak as TaxDesc, al as TaxSummaryDesc, am as TotalFare, an as ValidatingCarrierDesc, ao as isMessageQueue } from './reservation-history-C6giSdFd.js';
|
|
3
3
|
|
|
4
4
|
/** Token ATK tal cual se guarda: tiempos absolutos, para que otro proceso sepa cuánto le queda. */
|
|
5
5
|
interface StoredToken {
|
|
@@ -3623,6 +3623,21 @@ type QueueStep = {
|
|
|
3623
3623
|
interface QueueCountRequest {
|
|
3624
3624
|
/** PCC cuyas colas se cuentan. Por defecto, el de la sesión. */
|
|
3625
3625
|
pcc?: string;
|
|
3626
|
+
/** Contar solo esta cola (`QC/<PCC><cola>`). No se combina con `range`. */
|
|
3627
|
+
queue?: QueueRef;
|
|
3628
|
+
/**
|
|
3629
|
+
* Contar un rango de colas (`QC/<PCC>1-25`). No se combina con `queue`. La respuesta trae cada
|
|
3630
|
+
* cola del rango, también las vacías, con `count: 0`.
|
|
3631
|
+
*/
|
|
3632
|
+
range?: QueueRange;
|
|
3633
|
+
/**
|
|
3634
|
+
* Hasta 8 filtros, como en `access`: la cola cuenta solo los PNR que cumplen (`QC/<PCC>20‡QD-08NOV`).
|
|
3635
|
+
* El host acepta cualquier función (`QD`, `AK`, `AL`, `PI`, `AC`… y combinaciones); un criterio
|
|
3636
|
+
* que no vale llega como `SabreBusinessError` (p. ej. `INVALID PLACING AGENT`). Necesita `queue`:
|
|
3637
|
+
* sin cola, Sabre responde `QUEUE SELECTED NOT VALID OR CLOSED`, y con `range`, `KEYS NOT ALLOWED`
|
|
3638
|
+
* (#213), así que el SDK lo rechaza antes con `TypeError`.
|
|
3639
|
+
*/
|
|
3640
|
+
selection?: readonly QueueSelection[];
|
|
3626
3641
|
}
|
|
3627
3642
|
type QueueCountOptions = RequestOptions;
|
|
3628
3643
|
/** Una cola con mensajes o PNR. */
|
|
@@ -3630,17 +3645,44 @@ interface QueueCount {
|
|
|
3630
3645
|
queue: QueueRef;
|
|
3631
3646
|
count: number;
|
|
3632
3647
|
}
|
|
3648
|
+
/**
|
|
3649
|
+
* `AdditionalQueueInfo` (desde la 2.2.0): información extra de una cola, como su transferencia a
|
|
3650
|
+
* otra cola o PCC (`FreeText="IS TRANSFERRED TO"`). Se tipa desde el design: ninguna respuesta real
|
|
3651
|
+
* la trajo todavía (#213), así que los valores van tal cual llegan, sin interpretar.
|
|
3652
|
+
*/
|
|
3653
|
+
interface QueueAdditionalInfo {
|
|
3654
|
+
/** La cola dentro de cuyo `QueueIdentifier` llegó, si llegó dentro de uno. */
|
|
3655
|
+
queue?: QueueRef;
|
|
3656
|
+
/** `@FreeText`, p. ej. `"IS TRANSFERRED TO"`. */
|
|
3657
|
+
freeText?: string;
|
|
3658
|
+
/** `@PseudoCityCode`. */
|
|
3659
|
+
pseudoCityCode?: string;
|
|
3660
|
+
/** `@QueueNumber`, tal cual llegó. */
|
|
3661
|
+
queueNumber?: string;
|
|
3662
|
+
}
|
|
3633
3663
|
interface QueueCountResponse {
|
|
3634
|
-
/**
|
|
3664
|
+
/**
|
|
3665
|
+
* Las colas que trae la respuesta, en el orden de Sabre. Sin `range`, Sabre no lista las vacías;
|
|
3666
|
+
* con `range`, lista todas las del rango, las vacías con `count: 0`. Con `queue`, trae solo esa
|
|
3667
|
+
* (con `count: 0` si está vacía o si ningún PNR cumple `selection`).
|
|
3668
|
+
*/
|
|
3635
3669
|
queues: QueueCount[];
|
|
3670
|
+
/** Los `AdditionalQueueInfo` de la respuesta, si vino alguno. */
|
|
3671
|
+
additionalInfo?: QueueAdditionalInfo[];
|
|
3636
3672
|
/**
|
|
3637
3673
|
* Los `Totals` por `Type`: `MESSAGES`, `SPECIALS` y `PNRS`. Si Sabre no manda alguno, queda en
|
|
3638
|
-
* `undefined`.
|
|
3674
|
+
* `undefined`. Sin filtros son los del PCC, y con `range`, los del rango. Con `queue` y sin
|
|
3675
|
+
* `selection`, Sabre no manda `Totals` (CERT y producción, #213).
|
|
3676
|
+
*
|
|
3677
|
+
* `unfiltered` sale de un `Totals` sin `Type`, que Sabre manda solo con `selection` y que el
|
|
3678
|
+
* design no menciona: cuántos PNR tiene la cola sin filtrar (el `1 MATCHING PNRS OUT OF 80` del
|
|
3679
|
+
* host, #213).
|
|
3639
3680
|
*/
|
|
3640
3681
|
totals: {
|
|
3641
3682
|
messages?: number;
|
|
3642
3683
|
specials?: number;
|
|
3643
3684
|
pnrs?: number;
|
|
3685
|
+
unfiltered?: number;
|
|
3644
3686
|
};
|
|
3645
3687
|
/**
|
|
3646
3688
|
* `QueueInfo@DateTime` tal cual llegó, sin año (`"06-25T09:46"`): la hora del host al contar.
|
|
@@ -3791,9 +3833,14 @@ declare class QueueManagement {
|
|
|
3791
3833
|
* más los totales. Cada `queue` de la respuesta se puede pasar tal cual a las demás operaciones
|
|
3792
3834
|
* de cola.
|
|
3793
3835
|
*
|
|
3836
|
+
* Sin filtros cuenta todo el PCC. Con `queue`, solo esa cola; con `range`, cada cola del rango,
|
|
3837
|
+
* también las vacías. Con `selection` (que necesita `queue`), solo los PNR que cumplen: con el
|
|
3838
|
+
* mismo `QD`, da lo mismo que `list` (CERT y producción, #213).
|
|
3839
|
+
*
|
|
3794
3840
|
* Se puede llamar dentro o fuera de una cola, y no cambia `state`. Es una lectura: se reintenta
|
|
3795
|
-
* ante fallos transitorios.
|
|
3796
|
-
* `
|
|
3841
|
+
* ante fallos transitorios. Lanzan `TypeError` sin red: un PCC que no tiene 3 o 4 caracteres
|
|
3842
|
+
* alfanuméricos, una `queue` o un `range` inválidos, `queue` y `range` juntos, una `selection`
|
|
3843
|
+
* inválida (como en `access`) o una `selection` sin `queue`.
|
|
3797
3844
|
*/
|
|
3798
3845
|
count(request?: QueueCountRequest, options?: QueueCountOptions): Promise<QueueCountResponse>;
|
|
3799
3846
|
/**
|
|
@@ -3804,8 +3851,12 @@ declare class QueueManagement {
|
|
|
3804
3851
|
* (Q-097): el SDK los devuelve sin interpretar.
|
|
3805
3852
|
*
|
|
3806
3853
|
* Se puede llamar dentro o fuera de una cola, y no cambia `state`. Es una lectura: se reintenta
|
|
3807
|
-
* ante fallos transitorios. No pide duty code 9 (CERT y producción, Q-098).
|
|
3808
|
-
*
|
|
3854
|
+
* ante fallos transitorios. No pide duty code 9 (CERT y producción, Q-098).
|
|
3855
|
+
*
|
|
3856
|
+
* Sin filtros analiza todo el PCC. Con `queue`, solo esa cola; con `range`, cada cola del rango,
|
|
3857
|
+
* también las que tienen todos los contadores en 0. Lanzan `TypeError` sin red: un PCC que no
|
|
3858
|
+
* tiene 3 o 4 caracteres alfanuméricos, una `queue` o un `range` inválidos, y `queue` y `range`
|
|
3859
|
+
* juntos.
|
|
3809
3860
|
*/
|
|
3810
3861
|
activity(request?: QueueActivityRequest, options?: QueueActivityOptions): Promise<QueueActivityResponse>;
|
|
3811
3862
|
/**
|
|
@@ -4356,6 +4407,6 @@ interface BookingFlightDetailsSource {
|
|
|
4356
4407
|
*/
|
|
4357
4408
|
declare function buildBookingFlightDetails(source: BookingFlightDetailsSource): FlightDetails;
|
|
4358
4409
|
|
|
4359
|
-
declare const VERSION = "0.
|
|
4410
|
+
declare const VERSION = "0.6.0";
|
|
4360
4411
|
|
|
4361
|
-
export { Air, BargainFinderMaxRequest, BargainFinderMaxResponse, type BookContactInformation, type BookGenericSeat, type BookSeat, type BookTraveler, type Booking, type BookingAccountingFormOfPaymentTypeEnum, type BookingAccountingItem, type BookingAccountingItemCreationTypeEnum, type BookingAddress, type BookingAgency, type BookingAgencyCommission, type BookingAncillary, type BookingAncillarySourceEnum, type BookingAncillaryStatusNameEnum, type BookingAssociatedArrivalFlight, type BookingAssociatedFlightDetails, type BookingBaggageAllowance, type BookingBaggagePolicy, type BookingBasicFormOfPayment, type BookingBrandAttribute, type BookingCar, type BookingCarItem, type BookingCarReference, type BookingCarRentalSite, type BookingCardHolder, type BookingCommission, type BookingCommonOtherServiceInformation, type BookingContactInformation, type BookingCouponStatus, type BookingCouponStatusCodeEnum, type BookingCouponStatusEnum, type BookingCreationDetails, type BookingCruise, type BookingCruiseItem, type BookingCruiseReference, type BookingDateRangeRefundPenalty, type BookingDocumentSubTypeEnum, type BookingDocumentTypeEnum, type BookingEmployerIdTypeEnum, type BookingFare, type BookingFareApplicationTypeEnum, type BookingFareComponent, type BookingFareCreationDetails, type BookingFareDifferenceBreakdown, type BookingFareOffer, type BookingFareRule, type BookingFareRulePenalty, type BookingFareRulePenaltyApplicabilityEnum, type BookingFareService, type BookingFlight, type BookingFlightApplicabilityTypeEnum, type BookingFlightDetailsSource, type BookingFlightItem, type BookingFlightReference, type BookingFlightReferenceCoupon, type BookingFlightSourceEnum, type BookingFlightTicket, type BookingForceHotelUpdateDetails, type BookingFormOfPaymentResponse, type BookingFormOfPaymentTripTypeEnum, type BookingFormOfPaymentTypeResponseEnum, type BookingFormOfPaymentUseTypeEnum, type BookingFutureTicketingPolicy, type BookingGenderEnum, type BookingGenericAddress, type BookingGenericFormOfPayment, type BookingGenericTotalValues, type BookingGoodsAndServicesTax, type BookingGuaranteePaymentTypeEnum, type BookingGuaranteeTypeNameEnum, type BookingHandlingFee, type BookingHiddenStop, type BookingHotel, type BookingHotelAddress, type BookingHotelDateRangeRefundPenalty, type BookingHotelItem, type BookingHotelPaymentPolicyEnum, type BookingHotelPenaltyValue, type BookingHotelReference, type BookingHotelSourceEnum, type BookingIdentityDocument, type BookingIdentityDocumentReference, type BookingInitialSellingFare, type BookingItemReference, type BookingJourney, type BookingLoyaltyProgram, BookingManagement, type BookingManualApproval, type BookingMeal, type BookingMealDescriptionEnum, type BookingNonElectronicTicket, type BookingNonElectronicTicketStatusEnum, type BookingOriginalTotalValues, type BookingOtherServiceInformation, type BookingPassportTypeResponseEnum, type BookingPhone, type BookingPhoneResponse, type BookingPricingStatusCodeEnum, type BookingPricingStatusNameEnum, type BookingPricingTypeCodeEnum, type BookingPricingTypeNameEnum, type BookingProfile, type BookingProgramTypeEnum, type BookingRateInterval, type BookingReasonForIssuanceEnum, type BookingRemark, type BookingRemarkTypeEnum, type BookingResponseError, type BookingRoom, type BookingRoomExtraResponse, type BookingRoomExtrasNameEnum, type BookingSeat, type BookingSeatSelection, type BookingSegmentBasicAttributes, type BookingSegmentBasics, type BookingSegmentReference, type BookingSource, type BookingSpecialService, type BookingStatusNameEnum, type BookingStrongCustomerAuthentication, type BookingTariffBasisTypeEnum, type BookingTax, type BookingTaxComponent, type BookingTicketCoupon, type BookingTicketStatusEnum, type BookingTotalPayments, type BookingTotalValues, type BookingTrain, type BookingTrainItem, type BookingTrainReference, type BookingTraveler, type BookingTravelerTypeEnum, type BookingTravelersEmployer, type BookingTravelersGroup, type BookingValue, type BookingVehicleTypeNameEnum, type BookingVirtualCard, type BookingVisaTypeResponseEnum, type BookingVoucher, type BrandedFare, type BuildCredentialsOptions, type BuildCredentialsOptionsV2, type BuildCredentialsOptionsV3, type BuiltCredentialsV2, type BuiltCredentialsV3, type CancelBookingErrorPolicy, type CancelBookingNotification, type CancelBookingOptions, type CancelBookingRequest, type CancelBookingResponse, type CancelSegmentReference, type CreateBookingErrorPolicy, type CreateBookingOptions, type CreateBookingRequest, type CreateBookingResponse, type CreateBookingResponseError, type FlightDetails, type FlightStatusCode, type FlightTicketOperation, type FlightToBook, type GetBookingExtraFeatures, type GetBookingOptions, type GetBookingRequest, type GetBookingResponse, type GetBookingReturnOnly, type GetSeatsRequest, type GetSeatsResponse, GroupedItineraryResponse, type HostDateDirection, Itinerary, ItineraryGroup, type OpenSessionOptions, OtaAirLowFareSearchRq, type PassengerPricing, type PaymentMethod, type PriceComparison, type PriceComparisonType, type PricedSeat, type PricingDetails, type PricingQualifiers, type QueueAccessOptions, type QueueAccessRequest, QueueActivityOptions, QueueActivityRequest, QueueActivityResponse, type QueueCount, type QueueCountOptions, type QueueCountRequest, type QueueCountResponse, type QueueEndReason, type QueueItem, type QueueListEntry, type QueueListOptions, type QueueListRequest, type QueueListResponse, QueueManagement, type QueueMessage, type QueueNavigationOptions, type QueueParagraph, type QueueParagraphAirSegment, type QueueParagraphMessage, type QueueParagraphOptions, type QueueParagraphOtherSegment, type QueueParagraphPassenger, type QueueParagraphReceivedFrom, type QueueParagraphSegment, type QueueParagraphTicketing, type QueueParagraphTicketingEntry, type QueuePlaceOptions, type QueuePlaceRemark, type QueuePlaceRequest, type QueuePlaceResponse, type QueuePlaceResult, type QueuePlaceTarget, type QueuePlacement, type QueueProcessAction, type QueueProcessRequest, type QueueProcessResult, QueueRef, type QueueRemoveRequest, type QueueRemoveTarget, type QueueSelection, type QueueState, type QueueStep, type RawSeatAvailabilityRs, type RefundDocumentsType, RequestOptions, ReservationHistoryOptions, ReservationHistoryResponse, type ResolveHostDateOptions, RetryOptions, type RevalidateItineraryRequest, type RevalidateItineraryRequestSource, type RevalidateItineraryResponse, Sabre, type SabreAuthVersion, SabreBusinessError, type SabreCommandOptions, type SabreCommandResponse, type SabreConfig, type SabreConfigFromCredentials, type SabreConfigV2, type SabreConfigV2FromCredentials, type SabreConfigV3, type SabreCredentials, type SabreCredentialsAnyVersion, type SabreCredentialsV2, type SabreEnvironment, SabreError, SabreLegacy, type SabreLogEvent, type SabreLogLevel, type SabreLogger, SabreRawRequestCallback, SabreRawResponseCallback, SabreSession, type SabreTokenStore, SabreWarning, type Seat, type SeatAreaPreference, type SeatAvailabilityByPayloadRq, type SeatAvailabilityByPnrLocatorRq, type SeatAvailabilityIssue, type SeatAvailabilityRequestSource, type SeatAvailabilityResponse, type SeatCabinAisle, type SeatCabinCompartment, type SeatCabinFacility, type SeatCabinLayout, type SeatCabinRowPosition, type SeatCharacteristic, type SeatDisplayOnlyItem, type SeatFareComponent, type SeatFareDetail, type SeatFareSegmentAssociation, type SeatFlightLeg, type SeatKeyValuePair, type SeatLoyaltyProgramAccount, type SeatMap, type SeatOfferItem, type SeatOfferItemDetails, type SeatPassenger, type SeatPassengerPayloadRq, type SeatPassengerRs, type SeatPriceBreakdown, type SeatPriceDefinition, type SeatRow, type SeatSegment, type SeatSegmentPayloadRq, type SeatSegmentRs, type SeatServiceDefinition, type SeatSpecialServiceRequest, type SeatTax, SessionReservation, type SpecificFare, type StoredToken, type TicketingPolicy, type TravelerPhone, type TravelerTitle, VERSION, buildBookingFlightDetails, buildCredentials, buildRevalidateItineraryRequest, buildSeatAvailabilityRequest, parseQueueParagraph, parseQueuePlaceRemark, resolveHostDate };
|
|
4412
|
+
export { Air, BargainFinderMaxRequest, BargainFinderMaxResponse, type BookContactInformation, type BookGenericSeat, type BookSeat, type BookTraveler, type Booking, type BookingAccountingFormOfPaymentTypeEnum, type BookingAccountingItem, type BookingAccountingItemCreationTypeEnum, type BookingAddress, type BookingAgency, type BookingAgencyCommission, type BookingAncillary, type BookingAncillarySourceEnum, type BookingAncillaryStatusNameEnum, type BookingAssociatedArrivalFlight, type BookingAssociatedFlightDetails, type BookingBaggageAllowance, type BookingBaggagePolicy, type BookingBasicFormOfPayment, type BookingBrandAttribute, type BookingCar, type BookingCarItem, type BookingCarReference, type BookingCarRentalSite, type BookingCardHolder, type BookingCommission, type BookingCommonOtherServiceInformation, type BookingContactInformation, type BookingCouponStatus, type BookingCouponStatusCodeEnum, type BookingCouponStatusEnum, type BookingCreationDetails, type BookingCruise, type BookingCruiseItem, type BookingCruiseReference, type BookingDateRangeRefundPenalty, type BookingDocumentSubTypeEnum, type BookingDocumentTypeEnum, type BookingEmployerIdTypeEnum, type BookingFare, type BookingFareApplicationTypeEnum, type BookingFareComponent, type BookingFareCreationDetails, type BookingFareDifferenceBreakdown, type BookingFareOffer, type BookingFareRule, type BookingFareRulePenalty, type BookingFareRulePenaltyApplicabilityEnum, type BookingFareService, type BookingFlight, type BookingFlightApplicabilityTypeEnum, type BookingFlightDetailsSource, type BookingFlightItem, type BookingFlightReference, type BookingFlightReferenceCoupon, type BookingFlightSourceEnum, type BookingFlightTicket, type BookingForceHotelUpdateDetails, type BookingFormOfPaymentResponse, type BookingFormOfPaymentTripTypeEnum, type BookingFormOfPaymentTypeResponseEnum, type BookingFormOfPaymentUseTypeEnum, type BookingFutureTicketingPolicy, type BookingGenderEnum, type BookingGenericAddress, type BookingGenericFormOfPayment, type BookingGenericTotalValues, type BookingGoodsAndServicesTax, type BookingGuaranteePaymentTypeEnum, type BookingGuaranteeTypeNameEnum, type BookingHandlingFee, type BookingHiddenStop, type BookingHotel, type BookingHotelAddress, type BookingHotelDateRangeRefundPenalty, type BookingHotelItem, type BookingHotelPaymentPolicyEnum, type BookingHotelPenaltyValue, type BookingHotelReference, type BookingHotelSourceEnum, type BookingIdentityDocument, type BookingIdentityDocumentReference, type BookingInitialSellingFare, type BookingItemReference, type BookingJourney, type BookingLoyaltyProgram, BookingManagement, type BookingManualApproval, type BookingMeal, type BookingMealDescriptionEnum, type BookingNonElectronicTicket, type BookingNonElectronicTicketStatusEnum, type BookingOriginalTotalValues, type BookingOtherServiceInformation, type BookingPassportTypeResponseEnum, type BookingPhone, type BookingPhoneResponse, type BookingPricingStatusCodeEnum, type BookingPricingStatusNameEnum, type BookingPricingTypeCodeEnum, type BookingPricingTypeNameEnum, type BookingProfile, type BookingProgramTypeEnum, type BookingRateInterval, type BookingReasonForIssuanceEnum, type BookingRemark, type BookingRemarkTypeEnum, type BookingResponseError, type BookingRoom, type BookingRoomExtraResponse, type BookingRoomExtrasNameEnum, type BookingSeat, type BookingSeatSelection, type BookingSegmentBasicAttributes, type BookingSegmentBasics, type BookingSegmentReference, type BookingSource, type BookingSpecialService, type BookingStatusNameEnum, type BookingStrongCustomerAuthentication, type BookingTariffBasisTypeEnum, type BookingTax, type BookingTaxComponent, type BookingTicketCoupon, type BookingTicketStatusEnum, type BookingTotalPayments, type BookingTotalValues, type BookingTrain, type BookingTrainItem, type BookingTrainReference, type BookingTraveler, type BookingTravelerTypeEnum, type BookingTravelersEmployer, type BookingTravelersGroup, type BookingValue, type BookingVehicleTypeNameEnum, type BookingVirtualCard, type BookingVisaTypeResponseEnum, type BookingVoucher, type BrandedFare, type BuildCredentialsOptions, type BuildCredentialsOptionsV2, type BuildCredentialsOptionsV3, type BuiltCredentialsV2, type BuiltCredentialsV3, type CancelBookingErrorPolicy, type CancelBookingNotification, type CancelBookingOptions, type CancelBookingRequest, type CancelBookingResponse, type CancelSegmentReference, type CreateBookingErrorPolicy, type CreateBookingOptions, type CreateBookingRequest, type CreateBookingResponse, type CreateBookingResponseError, type FlightDetails, type FlightStatusCode, type FlightTicketOperation, type FlightToBook, type GetBookingExtraFeatures, type GetBookingOptions, type GetBookingRequest, type GetBookingResponse, type GetBookingReturnOnly, type GetSeatsRequest, type GetSeatsResponse, GroupedItineraryResponse, type HostDateDirection, Itinerary, ItineraryGroup, type OpenSessionOptions, OtaAirLowFareSearchRq, type PassengerPricing, type PaymentMethod, type PriceComparison, type PriceComparisonType, type PricedSeat, type PricingDetails, type PricingQualifiers, type QueueAccessOptions, type QueueAccessRequest, QueueActivityOptions, QueueActivityRequest, QueueActivityResponse, type QueueAdditionalInfo, type QueueCount, type QueueCountOptions, type QueueCountRequest, type QueueCountResponse, type QueueEndReason, type QueueItem, type QueueListEntry, type QueueListOptions, type QueueListRequest, type QueueListResponse, QueueManagement, type QueueMessage, type QueueNavigationOptions, type QueueParagraph, type QueueParagraphAirSegment, type QueueParagraphMessage, type QueueParagraphOptions, type QueueParagraphOtherSegment, type QueueParagraphPassenger, type QueueParagraphReceivedFrom, type QueueParagraphSegment, type QueueParagraphTicketing, type QueueParagraphTicketingEntry, type QueuePlaceOptions, type QueuePlaceRemark, type QueuePlaceRequest, type QueuePlaceResponse, type QueuePlaceResult, type QueuePlaceTarget, type QueuePlacement, type QueueProcessAction, type QueueProcessRequest, type QueueProcessResult, QueueRange, QueueRef, type QueueRemoveRequest, type QueueRemoveTarget, type QueueSelection, type QueueState, type QueueStep, type RawSeatAvailabilityRs, type RefundDocumentsType, RequestOptions, ReservationHistoryOptions, ReservationHistoryResponse, type ResolveHostDateOptions, RetryOptions, type RevalidateItineraryRequest, type RevalidateItineraryRequestSource, type RevalidateItineraryResponse, Sabre, type SabreAuthVersion, SabreBusinessError, type SabreCommandOptions, type SabreCommandResponse, type SabreConfig, type SabreConfigFromCredentials, type SabreConfigV2, type SabreConfigV2FromCredentials, type SabreConfigV3, type SabreCredentials, type SabreCredentialsAnyVersion, type SabreCredentialsV2, type SabreEnvironment, SabreError, SabreLegacy, type SabreLogEvent, type SabreLogLevel, type SabreLogger, SabreRawRequestCallback, SabreRawResponseCallback, SabreSession, type SabreTokenStore, SabreWarning, type Seat, type SeatAreaPreference, type SeatAvailabilityByPayloadRq, type SeatAvailabilityByPnrLocatorRq, type SeatAvailabilityIssue, type SeatAvailabilityRequestSource, type SeatAvailabilityResponse, type SeatCabinAisle, type SeatCabinCompartment, type SeatCabinFacility, type SeatCabinLayout, type SeatCabinRowPosition, type SeatCharacteristic, type SeatDisplayOnlyItem, type SeatFareComponent, type SeatFareDetail, type SeatFareSegmentAssociation, type SeatFlightLeg, type SeatKeyValuePair, type SeatLoyaltyProgramAccount, type SeatMap, type SeatOfferItem, type SeatOfferItemDetails, type SeatPassenger, type SeatPassengerPayloadRq, type SeatPassengerRs, type SeatPriceBreakdown, type SeatPriceDefinition, type SeatRow, type SeatSegment, type SeatSegmentPayloadRq, type SeatSegmentRs, type SeatServiceDefinition, type SeatSpecialServiceRequest, type SeatTax, SessionReservation, type SpecificFare, type StoredToken, type TicketingPolicy, type TravelerPhone, type TravelerTitle, VERSION, buildBookingFlightDetails, buildCredentials, buildRevalidateItineraryRequest, buildSeatAvailabilityRequest, parseQueueParagraph, parseQueuePlaceRemark, resolveHostDate };
|
package/dist/index.js
CHANGED
|
@@ -2004,6 +2004,24 @@ function queueRefAttribute(queue) {
|
|
|
2004
2004
|
if (typeof queue === "string") return `Number="${xmlEscape(queue)}"`;
|
|
2005
2005
|
return `Name="${xmlEscape(queue.name)}"`;
|
|
2006
2006
|
}
|
|
2007
|
+
function validateQueueRange(value, label) {
|
|
2008
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) fail3(`${label} debe ser { start, end }`);
|
|
2009
|
+
const { start, end } = value;
|
|
2010
|
+
for (const [name, bound] of [["start", start], ["end", end]]) {
|
|
2011
|
+
if (typeof bound !== "number" || !Number.isInteger(bound) || bound < MIN_QUEUE_NUMBER || bound > MAX_QUEUE_NUMBER) {
|
|
2012
|
+
fail3(`${label}.${name} debe ser un n\xFAmero de cola entero de ${MIN_QUEUE_NUMBER} a ${MAX_QUEUE_NUMBER}`);
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2015
|
+
if (start >= end) fail3(`${label}.start debe ser menor que ${label}.end (para una sola cola, usa queue)`);
|
|
2016
|
+
}
|
|
2017
|
+
function queueIdentifierXml(pcc, target = {}) {
|
|
2018
|
+
const pccAttribute = `PseudoCityCode="${xmlEscape(pcc)}"`;
|
|
2019
|
+
if (target.range !== void 0) {
|
|
2020
|
+
return `<QueueIdentifier ${pccAttribute}><Range Start="${target.range.start}" End="${target.range.end}"/></QueueIdentifier>`;
|
|
2021
|
+
}
|
|
2022
|
+
if (target.queue !== void 0) return `<QueueIdentifier ${queueRefAttribute(target.queue)} ${pccAttribute}/>`;
|
|
2023
|
+
return `<QueueIdentifier ${pccAttribute}/>`;
|
|
2024
|
+
}
|
|
2007
2025
|
function isMessageQueue(queue) {
|
|
2008
2026
|
return queue === MESSAGE_QUEUE;
|
|
2009
2027
|
}
|
|
@@ -2150,14 +2168,14 @@ function lineFields(value) {
|
|
|
2150
2168
|
var QUEUE_COUNT_SERVICE = "queueCount";
|
|
2151
2169
|
var NAMESPACE2 = "http://webservices.sabre.com/sabreXML/2011/10";
|
|
2152
2170
|
var TOTAL_TYPES = { MESSAGES: "messages", SPECIALS: "specials", PNRS: "pnrs" };
|
|
2153
|
-
function queueCountPayload(pcc) {
|
|
2154
|
-
return `<QueueCountRQ Version="2.2.1" xmlns="${NAMESPACE2}"><QueueInfo
|
|
2171
|
+
function queueCountPayload(pcc, target = {}) {
|
|
2172
|
+
return `<QueueCountRQ Version="2.2.1" xmlns="${NAMESPACE2}"><QueueInfo>${queueIdentifierXml(pcc, target)}</QueueInfo>${selectionXml(target.selection ?? [])}</QueueCountRQ>`;
|
|
2155
2173
|
}
|
|
2156
|
-
function queueCountRequest(pcc, options) {
|
|
2174
|
+
function queueCountRequest(pcc, options, target = {}) {
|
|
2157
2175
|
return {
|
|
2158
2176
|
service: QUEUE_COUNT_SERVICE,
|
|
2159
2177
|
action: "QueueCountLLSRQ",
|
|
2160
|
-
payload: queueCountPayload(pcc),
|
|
2178
|
+
payload: queueCountPayload(pcc, target),
|
|
2161
2179
|
idempotent: true,
|
|
2162
2180
|
operation: "queue.count",
|
|
2163
2181
|
...options
|
|
@@ -2173,9 +2191,12 @@ function attribute2(node3, name) {
|
|
|
2173
2191
|
}
|
|
2174
2192
|
function parseQueueCountResponse(response) {
|
|
2175
2193
|
const queues = [];
|
|
2194
|
+
const additionalInfo = [];
|
|
2176
2195
|
let countedAt;
|
|
2196
|
+
additionalInfo.push(...readAdditionalInfo(response.payload.AdditionalQueueInfo));
|
|
2177
2197
|
for (const info of asArray(response.payload.QueueInfo)) {
|
|
2178
2198
|
countedAt ??= nonEmpty3(attribute2(info, "DateTime"));
|
|
2199
|
+
additionalInfo.push(...readAdditionalInfo(info.AdditionalQueueInfo));
|
|
2179
2200
|
for (const identifier2 of asArray(info.QueueIdentifier)) {
|
|
2180
2201
|
const number = attribute2(identifier2, "Number");
|
|
2181
2202
|
const name = nonEmpty3(attribute2(identifier2, "Name"));
|
|
@@ -2185,11 +2206,13 @@ function parseQueueCountResponse(response) {
|
|
|
2185
2206
|
throw malformed(`QueueIdentifier con Number="${number ?? ""}" y Count="${attribute2(identifier2, "Count") ?? ""}"`, response);
|
|
2186
2207
|
}
|
|
2187
2208
|
queues.push({ queue, count });
|
|
2209
|
+
additionalInfo.push(...readAdditionalInfo(identifier2.AdditionalQueueInfo, queue));
|
|
2188
2210
|
}
|
|
2189
2211
|
}
|
|
2190
2212
|
const totals = {};
|
|
2191
2213
|
for (const total of asArray(response.payload.Totals)) {
|
|
2192
|
-
const
|
|
2214
|
+
const type = attribute2(total, "Type");
|
|
2215
|
+
const key = type === void 0 ? "unfiltered" : TOTAL_TYPES[type.toUpperCase()];
|
|
2193
2216
|
if (key === void 0) continue;
|
|
2194
2217
|
const count = parseHostCount(attribute2(total, "Count"));
|
|
2195
2218
|
if (count === void 0) throw malformed(`Totals ${key} con Count="${attribute2(total, "Count") ?? ""}"`, response);
|
|
@@ -2197,12 +2220,26 @@ function parseQueueCountResponse(response) {
|
|
|
2197
2220
|
}
|
|
2198
2221
|
return {
|
|
2199
2222
|
queues,
|
|
2223
|
+
...additionalInfo.length === 0 ? {} : { additionalInfo },
|
|
2200
2224
|
totals,
|
|
2201
2225
|
...countedAt === void 0 ? {} : { countedAt },
|
|
2202
2226
|
warnings: response.warnings,
|
|
2203
2227
|
...respondedAtField(response.raw)
|
|
2204
2228
|
};
|
|
2205
2229
|
}
|
|
2230
|
+
function readAdditionalInfo(value, queue) {
|
|
2231
|
+
return asArray(value).map((element2) => {
|
|
2232
|
+
const freeText = nonEmpty3(attribute2(element2, "FreeText"));
|
|
2233
|
+
const pseudoCityCode = nonEmpty3(attribute2(element2, "PseudoCityCode"));
|
|
2234
|
+
const queueNumber = nonEmpty3(attribute2(element2, "QueueNumber"));
|
|
2235
|
+
return {
|
|
2236
|
+
...queue === void 0 ? {} : { queue },
|
|
2237
|
+
...freeText === void 0 ? {} : { freeText },
|
|
2238
|
+
...pseudoCityCode === void 0 ? {} : { pseudoCityCode },
|
|
2239
|
+
...queueNumber === void 0 ? {} : { queueNumber }
|
|
2240
|
+
};
|
|
2241
|
+
});
|
|
2242
|
+
}
|
|
2206
2243
|
function malformed(detail, response) {
|
|
2207
2244
|
return new SabreGatewayError(`${QUEUE_COUNT_SERVICE}: respuesta no reconocida (${detail})`, {
|
|
2208
2245
|
protocol: "soap",
|
|
@@ -2271,14 +2308,14 @@ var COUNTERS = [
|
|
|
2271
2308
|
["LeftMessageToContact", "leftMessageToContact"],
|
|
2272
2309
|
["UnableToReach", "unableToReach"]
|
|
2273
2310
|
];
|
|
2274
|
-
function queueActivityPayload(pcc) {
|
|
2275
|
-
return `<QueueAnalysisRQ Version="2.0.0" xmlns="${NAMESPACE4}"><QueueInfo
|
|
2311
|
+
function queueActivityPayload(pcc, target = {}) {
|
|
2312
|
+
return `<QueueAnalysisRQ Version="2.0.0" xmlns="${NAMESPACE4}"><QueueInfo>${queueIdentifierXml(pcc, target)}</QueueInfo></QueueAnalysisRQ>`;
|
|
2276
2313
|
}
|
|
2277
|
-
function queueActivityRequest(pcc, options) {
|
|
2314
|
+
function queueActivityRequest(pcc, options, target = {}) {
|
|
2278
2315
|
return {
|
|
2279
2316
|
service: QUEUE_ACTIVITY_SERVICE,
|
|
2280
2317
|
action: "QueueAnalysisLLSRQ",
|
|
2281
|
-
payload: queueActivityPayload(pcc),
|
|
2318
|
+
payload: queueActivityPayload(pcc, target),
|
|
2282
2319
|
idempotent: true,
|
|
2283
2320
|
operation: "queue.activity",
|
|
2284
2321
|
...options
|
|
@@ -2446,13 +2483,27 @@ var QueueManagement = class {
|
|
|
2446
2483
|
* más los totales. Cada `queue` de la respuesta se puede pasar tal cual a las demás operaciones
|
|
2447
2484
|
* de cola.
|
|
2448
2485
|
*
|
|
2486
|
+
* Sin filtros cuenta todo el PCC. Con `queue`, solo esa cola; con `range`, cada cola del rango,
|
|
2487
|
+
* también las vacías. Con `selection` (que necesita `queue`), solo los PNR que cumplen: con el
|
|
2488
|
+
* mismo `QD`, da lo mismo que `list` (CERT y producción, #213).
|
|
2489
|
+
*
|
|
2449
2490
|
* Se puede llamar dentro o fuera de una cola, y no cambia `state`. Es una lectura: se reintenta
|
|
2450
|
-
* ante fallos transitorios.
|
|
2451
|
-
* `
|
|
2491
|
+
* ante fallos transitorios. Lanzan `TypeError` sin red: un PCC que no tiene 3 o 4 caracteres
|
|
2492
|
+
* alfanuméricos, una `queue` o un `range` inválidos, `queue` y `range` juntos, una `selection`
|
|
2493
|
+
* inválida (como en `access`) o una `selection` sin `queue`.
|
|
2452
2494
|
*/
|
|
2453
2495
|
async count(request = {}, options = {}) {
|
|
2496
|
+
if (typeof request !== "object" || request === null) fail4("queue.count recibe { pcc?, queue?, range?, selection? }");
|
|
2454
2497
|
const pcc = this.#pcc(request.pcc, "pcc");
|
|
2455
|
-
const
|
|
2498
|
+
const { queue, range } = validateQueueTarget(request, "queue.count");
|
|
2499
|
+
const selection = validateSelection(request.selection);
|
|
2500
|
+
if (selection.length > 0 && queue === void 0) {
|
|
2501
|
+
fail4(
|
|
2502
|
+
range === void 0 ? "selection en count necesita queue: sin cola, Sabre responde QUEUE SELECTED NOT VALID OR CLOSED" : "selection en count necesita queue, no range: con un rango, Sabre responde KEYS NOT ALLOWED"
|
|
2503
|
+
);
|
|
2504
|
+
}
|
|
2505
|
+
const target = { ...queue === void 0 ? {} : { queue }, ...range === void 0 ? {} : { range }, ...selection.length === 0 ? {} : { selection } };
|
|
2506
|
+
const response = await this.#context.send(queueCountRequest(pcc, options, target));
|
|
2456
2507
|
return parseQueueCountResponse(response);
|
|
2457
2508
|
}
|
|
2458
2509
|
/**
|
|
@@ -2463,13 +2514,18 @@ var QueueManagement = class {
|
|
|
2463
2514
|
* (Q-097): el SDK los devuelve sin interpretar.
|
|
2464
2515
|
*
|
|
2465
2516
|
* Se puede llamar dentro o fuera de una cola, y no cambia `state`. Es una lectura: se reintenta
|
|
2466
|
-
* ante fallos transitorios. No pide duty code 9 (CERT y producción, Q-098).
|
|
2467
|
-
*
|
|
2517
|
+
* ante fallos transitorios. No pide duty code 9 (CERT y producción, Q-098).
|
|
2518
|
+
*
|
|
2519
|
+
* Sin filtros analiza todo el PCC. Con `queue`, solo esa cola; con `range`, cada cola del rango,
|
|
2520
|
+
* también las que tienen todos los contadores en 0. Lanzan `TypeError` sin red: un PCC que no
|
|
2521
|
+
* tiene 3 o 4 caracteres alfanuméricos, una `queue` o un `range` inválidos, y `queue` y `range`
|
|
2522
|
+
* juntos.
|
|
2468
2523
|
*/
|
|
2469
2524
|
async activity(request = {}, options = {}) {
|
|
2470
|
-
if (typeof request !== "object" || request === null) fail4("queue.activity recibe { pcc? }");
|
|
2525
|
+
if (typeof request !== "object" || request === null) fail4("queue.activity recibe { pcc?, queue?, range? }");
|
|
2471
2526
|
const pcc = this.#pcc(request.pcc, "pcc");
|
|
2472
|
-
const
|
|
2527
|
+
const target = validateQueueTarget(request, "queue.activity");
|
|
2528
|
+
const response = await this.#context.send(queueActivityRequest(pcc, options, target));
|
|
2473
2529
|
return parseQueueActivityResponse(response);
|
|
2474
2530
|
}
|
|
2475
2531
|
/**
|
|
@@ -2735,6 +2791,13 @@ function validateLocators(locators) {
|
|
|
2735
2791
|
return locator;
|
|
2736
2792
|
});
|
|
2737
2793
|
}
|
|
2794
|
+
function validateQueueTarget(request, operation) {
|
|
2795
|
+
const { queue, range } = request;
|
|
2796
|
+
if (queue !== void 0) validateQueueRef(queue, "queue");
|
|
2797
|
+
if (range !== void 0) validateQueueRange(range, "range");
|
|
2798
|
+
if (queue !== void 0 && range !== void 0) fail4(`${operation} recibe queue o range, no los dos: Sabre no los combina`);
|
|
2799
|
+
return { ...queue === void 0 ? {} : { queue }, ...range === void 0 ? {} : { range } };
|
|
2800
|
+
}
|
|
2738
2801
|
function validateSelection(selection) {
|
|
2739
2802
|
if (selection === void 0) return [];
|
|
2740
2803
|
if (!Array.isArray(selection)) fail4("selection debe ser una lista de { function, criteria }");
|
|
@@ -3748,7 +3811,7 @@ function fareComponent(fareComponentId, component) {
|
|
|
3748
3811
|
}
|
|
3749
3812
|
|
|
3750
3813
|
// src/index.ts
|
|
3751
|
-
var VERSION = "0.
|
|
3814
|
+
var VERSION = "0.6.0";
|
|
3752
3815
|
export {
|
|
3753
3816
|
MESSAGE_QUEUE,
|
|
3754
3817
|
Sabre,
|