@sabstravtech/obtservices 0.2.2601230900 → 0.2.2602271010

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.
@@ -602,6 +602,7 @@ var BasketItemStatus;
602
602
  BasketItemStatus["Cancelled"] = "CANCELLED";
603
603
  BasketItemStatus["Open"] = "OPEN";
604
604
  BasketItemStatus["PartiallyCancelled"] = "PARTIALLY_CANCELLED";
605
+ BasketItemStatus["ProvisionallyCancelled"] = "PROVISIONALLY_CANCELLED";
605
606
  BasketItemStatus["Requested"] = "REQUESTED";
606
607
  })(BasketItemStatus || (BasketItemStatus = {}));
607
608
  /** BasketStatus */
@@ -17117,6 +17118,7 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
17117
17118
  static STORAGE_SESSION_RESULTS = 'results_hotel';
17118
17119
  type = ServiceType.Hotel;
17119
17120
  travellers;
17121
+ searchId;
17120
17122
  location_types = new BehaviorSubject([]);
17121
17123
  offices = new BehaviorSubject([]);
17122
17124
  lastActivePage = new BehaviorSubject(null);
@@ -17421,6 +17423,9 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
17421
17423
  this.getRailStationFetcher = getRailStationFetcher;
17422
17424
  this.applyHotelRulesFetcher = applyHotelRulesFetcher;
17423
17425
  this.results_details.chains = new Set();
17426
+ this.hotelFetcher.searchId$.subscribe(searchId => {
17427
+ this.searchId = searchId;
17428
+ });
17424
17429
  const data = storageService.getSessionItem(HotelEnterpriseSearch.STORAGE_SESSION_PARAMS) || {
17425
17430
  tempParams: {}
17426
17431
  };
@@ -17578,7 +17583,8 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
17578
17583
  this.applyHotelRulesFetcher
17579
17584
  .fetchKeyedObject('id', {
17580
17585
  data,
17581
- originalSearchQuery: this.query
17586
+ originalSearchQuery: this.query,
17587
+ searchId: this.searchId
17582
17588
  })
17583
17589
  .pipe(take(1))
17584
17590
  .subscribe((data1) => {
@@ -17819,7 +17825,7 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
17819
17825
  });
17820
17826
  this.buildQuery();
17821
17827
  return this.applyHotelRulesFetcher
17822
- .fetchKeyedObject('id', { data, originalSearchQuery: this.query })
17828
+ .fetchKeyedObject('id', { data, originalSearchQuery: this.query, searchId: this.searchId })
17823
17829
  .pipe(take(1), map$1((data1) => {
17824
17830
  availabilityObservables.forEach((item) => {
17825
17831
  if (data1[item.id]) {
@@ -19107,7 +19113,8 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
19107
19113
  co2PerPassenger: hotel.co2PerPassenger,
19108
19114
  reasonKeys: hotelRoom.requiresReasonKeys,
19109
19115
  approvalKeys: hotelRoom.requiresApprovalKeys,
19110
- agentOverrodeUnavailable: hotelRoom.unavailable
19116
+ agentOverrodeUnavailable: hotelRoom.unavailable,
19117
+ policyToken: hotelRoom.policyToken
19111
19118
  }, intBasket, this.searchService,
19112
19119
  // this is an array of 1 or 2 travellers which go in 1 room
19113
19120
  // chunk
@@ -24919,7 +24926,8 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
24919
24926
  approvalKeys: [
24920
24927
  ...(outboundFare.requiresApprovalKeys || []),
24921
24928
  ...(inboundFare.requiresApprovalKeys || [])
24922
- ]
24929
+ ],
24930
+ policyToken: outboundFare.policyToken || inboundFare.policyToken || ''
24923
24931
  };
24924
24932
  // if inTicketExtras or outTicketExtras exists add the object to basketItem
24925
24933
  // dont show ticketExtras for GMT. We will have a new ticket for ticketExtras
@@ -25383,10 +25391,16 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
25383
25391
  returnDepartureDateTime: this.helpers.formatGraphQLDateTime(tempParams.inBoundDateTime),
25384
25392
  viaLocationId: tempParams.viaLocation?.railstation?.id,
25385
25393
  railCardQualifiers: tempParams.railCards
25386
- ?.filter(x => x)
25387
- ?.map((railCard) => {
25388
- return { code: railCard.code, number: railCard.code, userId: railCard.userId };
25389
- }),
25394
+ ?.map((railCard, index) => {
25395
+ if (!railCard?.code)
25396
+ return null;
25397
+ return {
25398
+ code: railCard.code,
25399
+ number: railCard.number || '',
25400
+ userId: this.trainlineTravellers[index]?.originalUserGuestId
25401
+ };
25402
+ })
25403
+ ?.filter(x => x),
25390
25404
  exchangeDirection: tempParams.exchangeDirection,
25391
25405
  exchangeFromOrderID: tempParams.exchangeFromOrderID,
25392
25406
  transactionIdentifier: tempParams.transactionIdentifier
@@ -25758,7 +25772,8 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
25758
25772
  : null,
25759
25773
  agentOverrodeUnavailable: railFare.unavailable,
25760
25774
  reasonKeys: railFare.requiresReasonKeys,
25761
- approvalKeys: railFare.requiresApprovalKeys
25775
+ approvalKeys: railFare.requiresApprovalKeys,
25776
+ policyToken: railFare.policyToken || ''
25762
25777
  };
25763
25778
  // if ticketExtras exists add the object to basketItem
25764
25779
  // dont show ticketExtras for DTD. We will have a new ticket for ticketExtras
@@ -25919,7 +25934,8 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
25919
25934
  ...(outboundFare.requiresApprovalKeys || []),
25920
25935
  ...(inboundFare.requiresApprovalKeys || [])
25921
25936
  ],
25922
- agentOverrodeUnavailable: outboundFare.unavailable || inboundFare.unavailable
25937
+ agentOverrodeUnavailable: outboundFare.unavailable || inboundFare.unavailable,
25938
+ policyToken: outboundFare.policyToken || inboundFare.policyToken || ''
25923
25939
  };
25924
25940
  // if ticketExtras exists add the object to basketItem
25925
25941
  // dont show ticketExtras for DTD. We will have a new ticket for ticketExtras
@@ -27115,7 +27131,8 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
27115
27131
  : null,
27116
27132
  agentOverrodeUnavailable: railFare.unavailable,
27117
27133
  reasonKeys: railFare.requiresReasonKeys,
27118
- approvalKeys: railFare.requiresApprovalKeys
27134
+ approvalKeys: railFare.requiresApprovalKeys,
27135
+ policyToken: railFare.policyToken || ''
27119
27136
  };
27120
27137
  // if ticketExtras exists add the object to basketItem
27121
27138
  if (outTicketExtras && !railFare.type.toLowerCase().includes('travelcard')) {
@@ -27272,7 +27289,8 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
27272
27289
  approvalKeys: [
27273
27290
  ...(outboundFare.requiresApprovalKeys || []),
27274
27291
  ...(inboundFare.requiresApprovalKeys || [])
27275
- ]
27292
+ ],
27293
+ policyToken: outboundFare.policyToken || inboundFare.policyToken || ''
27276
27294
  };
27277
27295
  // if inTicketExtras or outTicketExtras exists add the object to basketItem
27278
27296
  // dont show ticketExtras for GMT. We will have a new ticket for ticketExtras
@@ -27423,7 +27441,8 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
27423
27441
  ...(outboundFare.requiresApprovalKeys || []),
27424
27442
  ...(inboundFare.requiresApprovalKeys || [])
27425
27443
  ],
27426
- agentOverrodeUnavailable: outboundFare.unavailable || inboundFare.unavailable
27444
+ agentOverrodeUnavailable: outboundFare.unavailable || inboundFare.unavailable,
27445
+ policyToken: outboundFare.policyToken || inboundFare.policyToken || ''
27427
27446
  };
27428
27447
  // if ticketExtras exists add the object to basketItem
27429
27448
  // dont show ticketExtras for DTD. We will have a new ticket for ticketExtras
@@ -29157,7 +29176,7 @@ class SupplementaryBookingInfoImpl {
29157
29176
  userValue.supplementaryInfo.specificSeatSelection = [
29158
29177
  {
29159
29178
  seatId: seatsCopy.seat.seats[0].seatId,
29160
- passengerPricePointId: seatsCopy.seat.seats[0].availablePassengerPricePoints[0],
29179
+ passengerPricePointId: seatsCopy.seat.seats[0].availablePassengerPricePoints[0] || '',
29161
29180
  url: seatsCopy.seat.url,
29162
29181
  price: seatsCopy.seat.seats[0].price
29163
29182
  }
@@ -29169,7 +29188,7 @@ class SupplementaryBookingInfoImpl {
29169
29188
  }
29170
29189
  userValue.supplementaryInfo.specificSeatSelection.push({
29171
29190
  seatId: seatsCopy.returnSeat.seats[0].seatId,
29172
- passengerPricePointId: seatsCopy.returnSeat.seats[0].availablePassengerPricePoints[0],
29191
+ passengerPricePointId: seatsCopy.returnSeat.seats[0].availablePassengerPricePoints[0] || '',
29173
29192
  url: seatsCopy.returnSeat.url,
29174
29193
  price: seatsCopy.returnSeat.seats[0].price
29175
29194
  });
@@ -29234,7 +29253,7 @@ class SupplementaryBookingInfoImpl {
29234
29253
  {
29235
29254
  seatId: userValue.supplementaryInfo.specificSeatSelection.seats[0].seatId,
29236
29255
  passengerPricePointId: userValue.supplementaryInfo.specificSeatSelection.seats[0]
29237
- .availablePassengerPricePoints[0],
29256
+ .availablePassengerPricePoints[0] || '',
29238
29257
  url: userValue.supplementaryInfo.specificSeatSelection.url,
29239
29258
  price: userValue.supplementaryInfo.specificSeatSelection.seats[0].price
29240
29259
  }
@@ -29507,10 +29526,15 @@ class BaseCarhireQuoteFetcher extends FetchableList {
29507
29526
  }
29508
29527
  }
29509
29528
  class BaseHotelQuoteFetcher extends FetchableList {
29529
+ searchId$ = new Subject();
29510
29530
  constructor(gql, helpers, modalService) {
29511
29531
  super(gql, helpers, modalService);
29512
29532
  }
29513
29533
  getDataFromResult(results) {
29534
+ const searchId = results?.data?.searchHotels?.searchId;
29535
+ if (searchId) {
29536
+ this.searchId$.next(searchId);
29537
+ }
29514
29538
  return results?.data?.searchHotels?.results;
29515
29539
  }
29516
29540
  }
@@ -39454,8 +39478,7 @@ class BaseEnterpriseSearchService {
39454
39478
  startSearches(url) {
39455
39479
  this.newSearchStarted.next(true);
39456
39480
  this.search_loading = true;
39457
- let searchObject;
39458
- searchObject = this._findSearchObtect();
39481
+ const searchObject = this._findSearchObtect();
39459
39482
  if (searchObject) {
39460
39483
  searchObject.chosen = true;
39461
39484
  }
@@ -40952,6 +40975,16 @@ class BaseLogonService {
40952
40975
  this.setEnvironment();
40953
40976
  }
40954
40977
  checkLogin() {
40978
+ // If we've just completed login (e.g. after MFA), the session is already
40979
+ // established — skip the /refreshToken call and start the refresh timer.
40980
+ // This prevents a race condition where the AuthGuard's refreshToken() call
40981
+ // could fail before the cookie/session is fully settled (ENT-14732).
40982
+ if (this.isLoggedIn) {
40983
+ if (!this.timeoutSubscription) {
40984
+ this.setRefresh();
40985
+ }
40986
+ return Promise.resolve(true);
40987
+ }
40955
40988
  return this.refreshToken();
40956
40989
  }
40957
40990
  refreshToken() {
@@ -40997,6 +41030,7 @@ class BaseLogonService {
40997
41030
  this.logout();
40998
41031
  }
40999
41032
  resolve(false);
41033
+ return;
41000
41034
  }
41001
41035
  if (this.router.url !== '/' &&
41002
41036
  !this.router.url.includes('logon') &&
@@ -41090,10 +41124,12 @@ class BaseLogonService {
41090
41124
  this.clearRefresh();
41091
41125
  this.searchService.resetSearchParams();
41092
41126
  this.userService.setBobo(null);
41127
+ const appType = this.isLightningEnv ? 'lightning' : 'scion';
41093
41128
  return this.http
41094
41129
  .formEncodedPostNoErrorHandling(URLS.AccessToken, {
41095
41130
  username,
41096
- password
41131
+ password,
41132
+ app: appType
41097
41133
  })
41098
41134
  .pipe(take(1), map$1((value, index) => {
41099
41135
  return this.handleResponse(value);
@@ -41151,7 +41187,7 @@ class BaseLogonService {
41151
41187
  logout() {
41152
41188
  const ssoUser = this.userService.userIsSSO();
41153
41189
  console.log(`+++ User is SSO only: ${ssoUser} +++`);
41154
- if (this.isLoggedIn) {
41190
+ if (this.isLoggedIn || ssoUser) {
41155
41191
  this.clearRefresh();
41156
41192
  this.isLoggedIn = false;
41157
41193
  this.userService.setBobo(null, !this.isLoggedIn);
@@ -41543,7 +41579,9 @@ class BaseEnterpriseMyBookingsService {
41543
41579
  basketItems = this.helpers.clone(basketItems);
41544
41580
  return basketItems.reduce((total, basketItem) => {
41545
41581
  let seats = [];
41582
+ let price = basketItem.price;
41546
41583
  if (basketItem.detail.isEU) {
41584
+ price = basketItem.detail.fullPrice; // EU seems to have seat price already accounted for in total, not sure if this is consitent across all eu so leaving seat calc in
41547
41585
  basketItem.guests.forEach((guest) => {
41548
41586
  if (guest?.savedSupplementaryInfo?.specificSeatSelection) {
41549
41587
  seats = seats.concat(guest?.savedSupplementaryInfo?.specificSeatSelection);
@@ -41556,9 +41594,9 @@ class BaseEnterpriseMyBookingsService {
41556
41594
  });
41557
41595
  }
41558
41596
  seats.forEach((seat) => {
41559
- basketItem.price += seat.price ? seat.price : 0;
41597
+ price += seat.price ? seat.price : 0;
41560
41598
  });
41561
- return total + basketItem.price;
41599
+ return total + price;
41562
41600
  }, 0);
41563
41601
  }
41564
41602
  getTravellerNamesFromBasketItems(basketItems, isTitleIncluded = false) {