@sabstravtech/obtservices 0.2.2412101445 → 0.2.2412201510
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/base/lib/vendor/classes/flight-enterprise-search.d.ts +2 -2
- package/base/lib/vendor/interfaces/Iflight-enterprise-search.d.ts +1 -1
- package/bundles/sabstravtech-obtservices-base.umd.js +52 -27
- package/bundles/sabstravtech-obtservices-base.umd.js.map +1 -1
- package/esm2015/base/lib/vendor/classes/flight-enterprise-search.js +49 -27
- package/esm2015/base/lib/vendor/interfaces/Iflight-enterprise-search.js +1 -1
- package/fesm2015/sabstravtech-obtservices-base.js +48 -26
- package/fesm2015/sabstravtech-obtservices-base.js.map +1 -1
- package/package.json +1 -1
|
@@ -292,7 +292,7 @@ export declare class FlightEnterpriseSearch<FQ_Q extends FlightQuoteFetcherType,
|
|
|
292
292
|
private getUpdatedCabinClass;
|
|
293
293
|
updateFromPreviousSearches(_previousItems: Record<ServiceType, BasketItem>): void;
|
|
294
294
|
updateSearchFromExpiredBasketItem(basketItem: BasketItem): void;
|
|
295
|
-
getTotalBaggage(fare: FlightItinerary): number;
|
|
295
|
+
getTotalBaggage(fare: FlightItinerary, isOutbound?: boolean): number;
|
|
296
296
|
getHandBaggage(fare: FlightItinerary): number;
|
|
297
297
|
getBaggageAllowance(fare: FlightItinerary): {
|
|
298
298
|
type: string;
|
|
@@ -313,7 +313,7 @@ export declare class FlightEnterpriseSearch<FQ_Q extends FlightQuoteFetcherType,
|
|
|
313
313
|
checkForSeatMap(flight: FlightItineraryWithExtensions, intBasket: InternalBasketInterface, dualInbound: boolean, gmt?: boolean): Promise<boolean>;
|
|
314
314
|
dualSingleSeatCheck(flight: FlightItineraryWithExtensions, intBasket: InternalBasketInterface, dualInbound: boolean): Promise<boolean>;
|
|
315
315
|
checkSeatmapExtrasEnabled(selectedFlight: FlightItineraryWithExtensions): boolean;
|
|
316
|
-
applyExtraDetailsToFlights(flights: FlightJourney[], detailExtras: DetailExtras): FlightJourney[];
|
|
316
|
+
applyExtraDetailsToFlights(flights: FlightJourney[], detailExtras: DetailExtras, isTFX?: boolean): FlightJourney[];
|
|
317
317
|
private _updateTravelPolicies;
|
|
318
318
|
private bookSingleFlight;
|
|
319
319
|
createSchemaDetails(flight: FlightItineraryWithExtensions, journeyType: string): any;
|
|
@@ -129,7 +129,7 @@ export interface FlightEnterpriseSearchInterface extends BaseEnterpriseSearch<Fl
|
|
|
129
129
|
getSearchQuery(): SearchFlightsV2QueryVariables;
|
|
130
130
|
updateFromPreviousSearches(previousItems: Record<ServiceType, BasketItem>): void;
|
|
131
131
|
updateSearchFromExpiredBasketItem(basketItem: BasketItem): void;
|
|
132
|
-
getTotalBaggage(result: FlightItinerary): number;
|
|
132
|
+
getTotalBaggage(result: FlightItinerary, isOutbound?: boolean): number;
|
|
133
133
|
getHandBaggage(result: FlightItinerary): number;
|
|
134
134
|
getFareRules(journeyHash: string): any;
|
|
135
135
|
addRulesToFlightItineraryWithExtensions(item: FlightItineraryWithExtensions, rules: RuleActionSummaryInterface): FlightItineraryWithExtensions;
|
|
@@ -13553,10 +13553,17 @@
|
|
|
13553
13553
|
});
|
|
13554
13554
|
}
|
|
13555
13555
|
};
|
|
13556
|
-
FlightEnterpriseSearch.prototype.getTotalBaggage = function (fare) {
|
|
13556
|
+
FlightEnterpriseSearch.prototype.getTotalBaggage = function (fare, isOutbound) {
|
|
13557
|
+
if (isOutbound === void 0) { isOutbound = true; }
|
|
13557
13558
|
var checkBaggages = this.getBaggageAllowance(fare);
|
|
13558
|
-
var
|
|
13559
|
-
|
|
13559
|
+
var checkBaggageAmountsOut = checkBaggages === null || checkBaggages === void 0 ? void 0 : checkBaggages.filter(function (a) { return (a === null || a === void 0 ? void 0 : a.type) === 'CheckIn' && !a.isIn; }).map(function (a) { return a === null || a === void 0 ? void 0 : a.qty; });
|
|
13560
|
+
var checkBaggageAmountsIn = checkBaggages === null || checkBaggages === void 0 ? void 0 : checkBaggages.filter(function (a) { return (a === null || a === void 0 ? void 0 : a.type) === 'CheckIn' && a.isIn; }).map(function (a) { return a === null || a === void 0 ? void 0 : a.qty; });
|
|
13561
|
+
if (isOutbound) {
|
|
13562
|
+
return checkBaggageAmountsOut.length ? Math.min.apply(Math, __spreadArray([], __read(checkBaggageAmountsOut))) : 0;
|
|
13563
|
+
}
|
|
13564
|
+
else {
|
|
13565
|
+
return checkBaggageAmountsIn.length ? Math.min.apply(Math, __spreadArray([], __read(checkBaggageAmountsIn))) : 0;
|
|
13566
|
+
}
|
|
13560
13567
|
};
|
|
13561
13568
|
FlightEnterpriseSearch.prototype.getHandBaggage = function (fare) {
|
|
13562
13569
|
var checkBaggages = this.getBaggageAllowance(fare);
|
|
@@ -14020,13 +14027,14 @@
|
|
|
14020
14027
|
) {
|
|
14021
14028
|
if (isLightning === void 0) { isLightning = false; }
|
|
14022
14029
|
return __awaiter(this, void 0, void 0, function () {
|
|
14023
|
-
var intBasket, basket, detailExtras, detailExtras, schemaDetails, schemaDetails, detailExtrasOut, detailExtrasIn;
|
|
14030
|
+
var intBasket, basket, isTFX, detailExtras, detailExtras, schemaDetails, schemaDetails, detailExtrasOut, detailExtrasIn;
|
|
14024
14031
|
return __generator(this, function (_0) {
|
|
14025
14032
|
switch (_0.label) {
|
|
14026
14033
|
case 0: return [4 /*yield*/, this.basketService.getDefaultBasket()];
|
|
14027
14034
|
case 1:
|
|
14028
14035
|
intBasket = _0.sent();
|
|
14029
14036
|
basket = intBasket === null || intBasket === void 0 ? void 0 : intBasket.subject.value;
|
|
14037
|
+
isTFX = selectedFlight.source === exports.ServiceProvider.Travelfusion;
|
|
14030
14038
|
if (!((basket && this.originalUserSearch.chosenSearchType === exports.FlightSearchType.oneWay) ||
|
|
14031
14039
|
(this.originalUserSearch.chosenSearchType === exports.FlightSearchType.multiCity &&
|
|
14032
14040
|
direction === exports.FlightDirectionEnum.Outbound))) return [3 /*break*/, 8];
|
|
@@ -14035,7 +14043,7 @@
|
|
|
14035
14043
|
case 2:
|
|
14036
14044
|
detailExtras = _0.sent();
|
|
14037
14045
|
if (!(detailExtras === null || detailExtras === void 0 ? void 0 : detailExtras.valid)) return [3 /*break*/, 4];
|
|
14038
|
-
selectedFlight.outboundFlights = this.applyExtraDetailsToFlights(selectedFlight.outboundFlights, detailExtras);
|
|
14046
|
+
selectedFlight.outboundFlights = this.applyExtraDetailsToFlights(selectedFlight.outboundFlights, detailExtras, isTFX);
|
|
14039
14047
|
return [4 /*yield*/, this.bookSingleFlight(intBasket, selectedFlight)];
|
|
14040
14048
|
case 3:
|
|
14041
14049
|
_0.sent();
|
|
@@ -14075,8 +14083,8 @@
|
|
|
14075
14083
|
case 9:
|
|
14076
14084
|
detailExtras = _0.sent();
|
|
14077
14085
|
if (!(detailExtras === null || detailExtras === void 0 ? void 0 : detailExtras.valid)) return [3 /*break*/, 11];
|
|
14078
|
-
selectedFlight.outboundFlights = this.applyExtraDetailsToFlights(selectedFlight.outboundFlights, detailExtras);
|
|
14079
|
-
selectedFlight.inboundFlights = this.applyExtraDetailsToFlights(selectedFlight.inboundFlights, detailExtras);
|
|
14086
|
+
selectedFlight.outboundFlights = this.applyExtraDetailsToFlights(selectedFlight.outboundFlights, detailExtras, isTFX);
|
|
14087
|
+
selectedFlight.inboundFlights = this.applyExtraDetailsToFlights(selectedFlight.inboundFlights, detailExtras, isTFX);
|
|
14080
14088
|
this.outboundCabinClass = ''; // reset outboundCabinClass
|
|
14081
14089
|
schemaDetails = this.createSchemaDetails(selectedFlight, FlightJourneyType.Roundtrip);
|
|
14082
14090
|
return [4 /*yield*/, this.doBooking(intBasket, selectedFlight, schemaDetails, selectedFlight.outboundFlights[0].dateTimeDepartingUTC, selectedFlight.inboundFlights[0].dateTimeDepartingUTC)];
|
|
@@ -14108,8 +14116,8 @@
|
|
|
14108
14116
|
case 16:
|
|
14109
14117
|
detailExtrasOut = _0.sent();
|
|
14110
14118
|
if (!(detailExtrasOut === null || detailExtrasOut === void 0 ? void 0 : detailExtrasOut.valid)) return [3 /*break*/, 18];
|
|
14111
|
-
selectedFlight.outboundFlights = this.applyExtraDetailsToFlights(selectedFlight.outboundFlights, detailExtrasOut);
|
|
14112
|
-
selectedFlight.inboundFlights = this.applyExtraDetailsToFlights(selectedFlight.inboundFlights, detailExtrasOut);
|
|
14119
|
+
selectedFlight.outboundFlights = this.applyExtraDetailsToFlights(selectedFlight.outboundFlights, detailExtrasOut, isTFX);
|
|
14120
|
+
selectedFlight.inboundFlights = this.applyExtraDetailsToFlights(selectedFlight.inboundFlights, detailExtrasOut, isTFX);
|
|
14113
14121
|
return [4 /*yield*/, this.bookSingleFlight(intBasket, selectedFlight, false, direction === exports.FlightDirectionEnum.DualSingleInbound)];
|
|
14114
14122
|
case 17:
|
|
14115
14123
|
_0.sent();
|
|
@@ -14118,8 +14126,8 @@
|
|
|
14118
14126
|
case 19:
|
|
14119
14127
|
detailExtrasIn = _0.sent();
|
|
14120
14128
|
if (!(detailExtrasIn === null || detailExtrasIn === void 0 ? void 0 : detailExtrasIn.valid)) return [3 /*break*/, 21];
|
|
14121
|
-
selectedFlight.outboundFlights = this.applyExtraDetailsToFlights(selectedFlight.outboundFlights, detailExtrasIn);
|
|
14122
|
-
selectedFlight.inboundFlights = this.applyExtraDetailsToFlights(selectedFlight.inboundFlights, detailExtrasIn);
|
|
14129
|
+
selectedFlight.outboundFlights = this.applyExtraDetailsToFlights(selectedFlight.outboundFlights, detailExtrasIn, isTFX);
|
|
14130
|
+
selectedFlight.inboundFlights = this.applyExtraDetailsToFlights(selectedFlight.inboundFlights, detailExtrasIn, isTFX);
|
|
14123
14131
|
return [4 /*yield*/, this.bookSingleFlight(intBasket, this.selectedGroupFlight, false, direction !== exports.FlightDirectionEnum.DualSingleInbound)];
|
|
14124
14132
|
case 20:
|
|
14125
14133
|
_0.sent();
|
|
@@ -14163,17 +14171,18 @@
|
|
|
14163
14171
|
FlightEnterpriseSearch.prototype.checkForSeatMap = function (flight, intBasket, dualInbound, gmt) {
|
|
14164
14172
|
if (gmt === void 0) { gmt = false; }
|
|
14165
14173
|
return __awaiter(this, void 0, void 0, function () {
|
|
14166
|
-
var detailExtras;
|
|
14174
|
+
var isTFX, detailExtras;
|
|
14167
14175
|
return __generator(this, function (_0) {
|
|
14168
14176
|
switch (_0.label) {
|
|
14169
14177
|
case 0:
|
|
14170
14178
|
if (!this.checkSeatmapExtrasEnabled(flight)) return [3 /*break*/, 4];
|
|
14179
|
+
isTFX = flight.source === exports.ServiceProvider.Travelfusion;
|
|
14171
14180
|
return [4 /*yield*/, this.getFlightDetailExtras(flight, exports.FlightDirectionEnum.DualSingleOutbound, gmt)];
|
|
14172
14181
|
case 1:
|
|
14173
14182
|
detailExtras = _0.sent();
|
|
14174
14183
|
if (!(detailExtras === null || detailExtras === void 0 ? void 0 : detailExtras.valid)) return [3 /*break*/, 3];
|
|
14175
|
-
flight.outboundFlights = this.applyExtraDetailsToFlights(flight.outboundFlights, detailExtras);
|
|
14176
|
-
flight.inboundFlights = this.applyExtraDetailsToFlights(flight.inboundFlights, detailExtras);
|
|
14184
|
+
flight.outboundFlights = this.applyExtraDetailsToFlights(flight.outboundFlights, detailExtras, isTFX);
|
|
14185
|
+
flight.inboundFlights = this.applyExtraDetailsToFlights(flight.inboundFlights, detailExtras, isTFX);
|
|
14177
14186
|
return [4 /*yield*/, this.addFlightJourneysToBasket(flight, intBasket, false, dualInbound, gmt)];
|
|
14178
14187
|
case 2:
|
|
14179
14188
|
_0.sent();
|
|
@@ -14238,7 +14247,8 @@
|
|
|
14238
14247
|
}
|
|
14239
14248
|
return false;
|
|
14240
14249
|
};
|
|
14241
|
-
FlightEnterpriseSearch.prototype.applyExtraDetailsToFlights = function (flights, detailExtras) {
|
|
14250
|
+
FlightEnterpriseSearch.prototype.applyExtraDetailsToFlights = function (flights, detailExtras, isTFX) {
|
|
14251
|
+
if (isTFX === void 0) { isTFX = false; }
|
|
14242
14252
|
return flights.map(function (flight) {
|
|
14243
14253
|
var id = flight.id;
|
|
14244
14254
|
var seat = detailExtras.seats[id];
|
|
@@ -14251,7 +14261,8 @@
|
|
|
14251
14261
|
flight.additional.loyalty = loyalty;
|
|
14252
14262
|
}
|
|
14253
14263
|
var additionalDetails = detailExtras.additionalDetails[id];
|
|
14254
|
-
|
|
14264
|
+
// here it's only TFX
|
|
14265
|
+
if (additionalDetails && isTFX) {
|
|
14255
14266
|
var additionalDetailsKeys = Object.keys(additionalDetails);
|
|
14256
14267
|
if (additionalDetailsKeys.length) {
|
|
14257
14268
|
additionalDetailsKeys.forEach(function (key) {
|
|
@@ -14518,20 +14529,34 @@
|
|
|
14518
14529
|
segmentIndex: segmentIndex
|
|
14519
14530
|
} });
|
|
14520
14531
|
};
|
|
14521
|
-
FlightEnterpriseSearch.prototype.addBagsAllowanceToFlightsSchema = function (selectedFlight, flightQuote) {
|
|
14522
|
-
|
|
14532
|
+
FlightEnterpriseSearch.prototype.addBagsAllowanceToFlightsSchema = function (selectedFlight, flightQuote, isIn) {
|
|
14533
|
+
if (isIn === void 0) { isIn = false; }
|
|
14534
|
+
var _a;
|
|
14523
14535
|
selectedFlight.additional['baggageAllowanceAmount'] = 0;
|
|
14524
|
-
|
|
14525
|
-
|
|
14526
|
-
|
|
14527
|
-
|
|
14536
|
+
var holdBagAmount = [0];
|
|
14537
|
+
if (!isIn) {
|
|
14538
|
+
holdBagAmount = flightQuote.outboundFlights.reduce(function (acc, flight) {
|
|
14539
|
+
var bags = flight.additional.baggageAllowance.filter(function (bag) { return bag.type === 'CheckIn'; });
|
|
14540
|
+
var result = bags.map(function (bag) { return bag.qty; });
|
|
14541
|
+
if (result.length) {
|
|
14542
|
+
acc.push(Math.min.apply(Math, __spreadArray([], __read(result))));
|
|
14528
14543
|
}
|
|
14529
|
-
return
|
|
14544
|
+
return acc;
|
|
14530
14545
|
}, []);
|
|
14531
|
-
selectedFlight.additional['baggageAllowanceAmount'] = holdBagAmount.length
|
|
14532
|
-
? Math.min.apply(Math, __spreadArray([], __read(holdBagAmount))) : 0;
|
|
14533
14546
|
}
|
|
14534
|
-
|
|
14547
|
+
else {
|
|
14548
|
+
holdBagAmount = flightQuote.inboundFlights.reduce(function (acc, flight) {
|
|
14549
|
+
var bags = flight.additional.baggageAllowance.filter(function (bag) { return bag.type === 'CheckIn'; });
|
|
14550
|
+
var result = bags.map(function (bag) { return bag.qty; });
|
|
14551
|
+
if (result.length) {
|
|
14552
|
+
acc.push(Math.min.apply(Math, __spreadArray([], __read(result))));
|
|
14553
|
+
}
|
|
14554
|
+
return acc;
|
|
14555
|
+
}, []);
|
|
14556
|
+
}
|
|
14557
|
+
selectedFlight.additional['baggageAllowanceAmount'] = holdBagAmount.length
|
|
14558
|
+
? Math.min.apply(Math, __spreadArray([], __read(holdBagAmount))) : 0;
|
|
14559
|
+
selectedFlight.additional['isHandBaggage'] = !!((_a = flightQuote === null || flightQuote === void 0 ? void 0 : flightQuote.baggageAllowance) === null || _a === void 0 ? void 0 : _a.filter(function (bag) { return bag.type === BaggageType.HandCarry; }));
|
|
14535
14560
|
return selectedFlight;
|
|
14536
14561
|
};
|
|
14537
14562
|
FlightEnterpriseSearch.prototype.addFlightJourneysToBasket = function (flightQuote, intBasket, ignoreInvoke, dualInbound, gmt) {
|
|
@@ -14616,7 +14641,7 @@
|
|
|
14616
14641
|
delete flight.additional.spanishResidencyAirport;
|
|
14617
14642
|
delete flight.additional.spanishResidencyGroup;
|
|
14618
14643
|
}
|
|
14619
|
-
return _this.addBagsAllowanceToFlightsSchema(flight, flightQuote);
|
|
14644
|
+
return _this.addBagsAllowanceToFlightsSchema(flight, flightQuote, true);
|
|
14620
14645
|
}))),
|
|
14621
14646
|
termsAndCond: termsAndConditions,
|
|
14622
14647
|
journeyType: FlightJourneyType.Single,
|