@sabstravtech/obtservices 0.2.2511120840 → 0.2.2511121920

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.
@@ -1,4 +1,4 @@
1
- import { BehaviorSubject, of, firstValueFrom, combineLatest, Subject, forkJoin, lastValueFrom, Subscription } from 'rxjs';
1
+ import { BehaviorSubject, of, combineLatest, Subject, forkJoin, Subscription } from 'rxjs';
2
2
  import { take, map, catchError, debounceTime, distinctUntilChanged, switchMap, tap, takeUntil, filter, finalize } from 'rxjs/operators';
3
3
  import moment from 'moment';
4
4
  import { __decorate } from 'tslib';
@@ -1391,7 +1391,7 @@ class AutoSugestManagementInfo extends ManagementInfoAndIsValid {
1391
1391
  searchByTriggerValue = async () => {
1392
1392
  if (!this.availableItems?.length ||
1393
1393
  (this.tempTriggerMIValueId && this.triggerMIValueId !== this.tempTriggerMIValueId)) {
1394
- const values = await firstValueFrom(this.basketService.getMiAutoSugestions(this.id, '', this.isLoading, this.serviceId, this.managementInfoValueGroup, this.triggerMIValueId));
1394
+ const values = await this.basketService.getMiAutoSugestions(this.id, '', this.isLoading, this.serviceId, this.managementInfoValueGroup, this.triggerMIValueId).toPromise();
1395
1395
  this.availableItems = values;
1396
1396
  this.tempTriggerMIValueId = this.triggerMIValueId;
1397
1397
  return values;
@@ -8579,7 +8579,7 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
8579
8579
  const isTrueSubject = new BehaviorSubject(true);
8580
8580
  if (location.terminal) {
8581
8581
  // airport type
8582
- const locations = await firstValueFrom(this.searchService.getAirportLocations(term, location.countryCode, isTrueSubject));
8582
+ const locations = await this.searchService.getAirportLocations(term, location.countryCode, isTrueSubject).toPromise();
8583
8583
  if (locations?.length) {
8584
8584
  const { airport, name, type } = locations[0];
8585
8585
  return {
@@ -8595,7 +8595,7 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
8595
8595
  }
8596
8596
  else if (location.buildingName === location.streetAndNumber) {
8597
8597
  // Train St. type
8598
- const locations = await firstValueFrom(this.searchService.getStationLocations(term, isTrueSubject));
8598
+ const locations = await this.searchService.getStationLocations(term, isTrueSubject).toPromise();
8599
8599
  if (locations?.length) {
8600
8600
  const { name, railstation, type } = locations[0];
8601
8601
  return {
@@ -11778,13 +11778,13 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
11778
11778
  this.negotiated = this.tempParams.fareType === FareType.Negotiated ? true : false;
11779
11779
  }
11780
11780
  async getFlightExchangeSearch(basketItemId, outboundDate, inboundDate, outboundClass, returnClass) {
11781
- const flightsExchange = await firstValueFrom(this.getFlightSearchExchangeFetcher.fetchOne({
11781
+ const flightsExchange = await this.getFlightSearchExchangeFetcher.fetchOne({
11782
11782
  basketItem: basketItemId.toString(),
11783
11783
  outboundDate,
11784
11784
  inboundDate,
11785
11785
  outboundClass,
11786
11786
  returnClass
11787
- }));
11787
+ }).toPromise();
11788
11788
  const results = { ...flightsExchange };
11789
11789
  const flightJourneys = [];
11790
11790
  const { journeyWhenSelected, whenSelectedAlone } = results.ruleActionSummary;
@@ -14318,7 +14318,7 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
14318
14318
  try {
14319
14319
  // now actually do the reprice call - if we want that
14320
14320
  this.searchService.repricingFlight.next(true);
14321
- const newFlight = await lastValueFrom(this.searchService.getFlightAtNewClass(this.getSearchQuery(), flight, this.adults, this.children));
14321
+ const newFlight = await this.searchService.getFlightAtNewClass(this.getSearchQuery(), flight, this.adults, this.children).toPromise();
14322
14322
  flight.total = newFlight.flights[0].total;
14323
14323
  // this bit for new policy ENT-9772
14324
14324
  const { journeyWhenSelected, whenSelectedAlone } = newFlight.ruleActionSummary;
@@ -25145,7 +25145,7 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
25145
25145
  this.railCards = query.railCardQualifiers;
25146
25146
  }
25147
25147
  const fetchRailStation = async (locationId) => {
25148
- const station = await firstValueFrom(this.searchService.getRailStationById(locationId));
25148
+ const station = await this.searchService.getRailStationById(locationId).toPromise();
25149
25149
  return { name: station.name, railstation: station };
25150
25150
  };
25151
25151
  const resiN = await fetchRailStation(query.arrivalLocationId);
@@ -29970,7 +29970,7 @@ class BaseEnterpriseBasketService {
29970
29970
  for (const basket of this.currentBaskets) {
29971
29971
  const basketValue = basket.subject.value;
29972
29972
  if (basketValue.invokedUser) {
29973
- await firstValueFrom(this.removeBasket(basketValue.id));
29973
+ await this.removeBasket(basketValue.id).toPromise();
29974
29974
  }
29975
29975
  }
29976
29976
  }
@@ -30163,9 +30163,6 @@ class BaseEnterpriseBasketService {
30163
30163
  this.addingToBasket.next(true);
30164
30164
  // this is the last point
30165
30165
  try {
30166
- // const newBasket: Partial<UserBasketResult> = await firstValueFrom(
30167
- // this.addItemToBasketUpdater.updateOne(item)
30168
- // );
30169
30166
  const newBasket = await this.addItemToBasketUpdater.updateOne(item).toPromise();
30170
30167
  this.miViewed = false;
30171
30168
  // here I want the new basketItem Id
@@ -30322,10 +30319,10 @@ class BaseEnterpriseBasketService {
30322
30319
  backdrop: 'static'
30323
30320
  });
30324
30321
  for (const item of hotelItems) {
30325
- const newBasket = await lastValueFrom(this.removeItemFromBasketUpdater.updateOne({
30322
+ const newBasket = await this.removeItemFromBasketUpdater.updateOne({
30326
30323
  convertCurrencyTo: this.userCurrency,
30327
30324
  basketItem: item.id
30328
- }));
30325
+ }).toPromise();
30329
30326
  if (newBasket) {
30330
30327
  this.miViewed = false;
30331
30328
  intBasket?.next({
@@ -30338,10 +30335,10 @@ class BaseEnterpriseBasketService {
30338
30335
  }
30339
30336
  }
30340
30337
  else {
30341
- const newBasket = await lastValueFrom(this.removeItemFromBasketUpdater.updateOne({
30338
+ const newBasket = await this.removeItemFromBasketUpdater.updateOne({
30342
30339
  convertCurrencyTo: this.userCurrency,
30343
30340
  basketItem: item.id
30344
- }));
30341
+ }).toPromise();
30345
30342
  if (newBasket) {
30346
30343
  this.miViewed = false;
30347
30344
  intBasket?.next({
@@ -30354,10 +30351,10 @@ class BaseEnterpriseBasketService {
30354
30351
  }
30355
30352
  }
30356
30353
  else {
30357
- const newBasket = await lastValueFrom(this.removeItemFromBasketUpdater.updateOne({
30354
+ const newBasket = await this.removeItemFromBasketUpdater.updateOne({
30358
30355
  convertCurrencyTo: this.userCurrency,
30359
30356
  basketItem: item.id
30360
- }));
30357
+ }).toPromise();
30361
30358
  if (newBasket) {
30362
30359
  this.miViewed = false;
30363
30360
  intBasket?.next({
@@ -30745,10 +30742,6 @@ class BaseEnterpriseBasketService {
30745
30742
  }
30746
30743
  async validateMiBasket(basketId) {
30747
30744
  const query = { basketId };
30748
- // return firstValueFrom(this.validateBasketMiFetcher.fetchOne(query)).then(data => {
30749
- // this.miViewed = true;
30750
- // this.missingMIs = data;
30751
- // });
30752
30745
  return this.validateBasketMiFetcher.fetchOne(query).toPromise().then(data => {
30753
30746
  this.miViewed = true;
30754
30747
  this.missingMIs = data;
@@ -31186,7 +31179,7 @@ class BaseEnterpriseBasketService {
31186
31179
  return this.getBasketApprovalInfoFetcher.fetchList({ basket: basketId });
31187
31180
  }
31188
31181
  async evolviSeatmapsAreEnabled() {
31189
- return await firstValueFrom(this.evolviSeatmapsAreEnabledFetcher.fetchOne());
31182
+ return await this.evolviSeatmapsAreEnabledFetcher.fetchOne().toPromise();
31190
31183
  }
31191
31184
  getRequestedBookingUpdate(basketids) {
31192
31185
  return this.getRequestedBookingUpdateFetcher.fetchOne({ basketItems: basketids });