sabre-client 0.5.0 → 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 +70 -11
- package/README.md +70 -11
- 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 +61 -10
- package/dist/index.js +82 -17
- package/dist/index.js.map +1 -1
- package/dist/{reservation-history-bKDqkf8T.d.ts → reservation-history-C6giSdFd.d.ts} +33 -3
- package/dist/testing.d.ts +20 -57
- package/dist/testing.js +423 -24
- package/dist/testing.js.map +1 -1
- package/package.json +5 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
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,8 +3811,9 @@ 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 {
|
|
3816
|
+
MESSAGE_QUEUE,
|
|
3753
3817
|
Sabre,
|
|
3754
3818
|
SabreBusinessError,
|
|
3755
3819
|
SabreError,
|
|
@@ -3763,6 +3827,7 @@ export {
|
|
|
3763
3827
|
buildCredentials,
|
|
3764
3828
|
buildRevalidateItineraryRequest,
|
|
3765
3829
|
buildSeatAvailabilityRequest,
|
|
3830
|
+
isMessageQueue,
|
|
3766
3831
|
parseQueueParagraph,
|
|
3767
3832
|
parseQueuePlaceRemark,
|
|
3768
3833
|
resolveHostDate
|