@sabstravtech/obtservices 0.2.2505190850 → 0.2.2505201645

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,5 +1,5 @@
1
1
  import { __awaiter, __decorate, __metadata } from 'tslib';
2
- import { BehaviorSubject, of, combineLatest, Subject, firstValueFrom, forkJoin, Subscription } from 'rxjs';
2
+ import { BehaviorSubject, of, combineLatest, Subject, forkJoin, Subscription } from 'rxjs';
3
3
  import { take, map, catchError, debounceTime, distinctUntilChanged, switchMap, tap, takeUntil } from 'rxjs/operators';
4
4
  import moment from 'moment';
5
5
  import _, { uniq } from 'lodash';
@@ -8373,7 +8373,7 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
8373
8373
  const term = location.buildingName.replace(/^[^,]+,\s*/, "");
8374
8374
  const isTrueSubject = new BehaviorSubject(true);
8375
8375
  if (location.terminal) { // airport type
8376
- const locations = yield firstValueFrom(this.searchService.getAirportLocations(term, location.countryCode, isTrueSubject));
8376
+ const locations = yield this.searchService.getAirportLocations(term, location.countryCode, isTrueSubject).toPromise();
8377
8377
  if (locations === null || locations === void 0 ? void 0 : locations.length) {
8378
8378
  const { airport, name, type } = locations[0];
8379
8379
  return {
@@ -8388,7 +8388,7 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
8388
8388
  }
8389
8389
  }
8390
8390
  else if (location.buildingName === location.streetAndNumber) { // Train St. type
8391
- const locations = yield firstValueFrom(this.searchService.getStationLocations(term, isTrueSubject));
8391
+ const locations = yield this.searchService.getStationLocations(term, isTrueSubject).toPromise();
8392
8392
  if (locations === null || locations === void 0 ? void 0 : locations.length) {
8393
8393
  const { name, railstation, type } = locations[0];
8394
8394
  return {
@@ -24434,8 +24434,12 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
24434
24434
  if (this.applyRailcards) {
24435
24435
  this.railCards = query.railCardQualifiers;
24436
24436
  }
24437
+ // const fetchRailStation = async (locationId: string): Promise<{ name: string; railstation: RailStation }> => {
24438
+ // const station = await firstValueFrom(this.searchService.getRailStationById(locationId));
24439
+ // return { name: station.name, railstation: station };
24440
+ // };
24437
24441
  const fetchRailStation = (locationId) => __awaiter(this, void 0, void 0, function* () {
24438
- const station = yield firstValueFrom(this.searchService.getRailStationById(locationId));
24442
+ const station = yield this.searchService.getRailStationById(locationId).toPromise();
24439
24443
  return { name: station.name, railstation: station };
24440
24444
  });
24441
24445
  const resiN = yield fetchRailStation(query.arrivalLocationId);
@@ -28778,7 +28782,7 @@ class BaseEnterpriseBasketService {
28778
28782
  for (const basket of this.currentBaskets) {
28779
28783
  const basketValue = basket.subject.value;
28780
28784
  if (basketValue.invokedUser) {
28781
- yield firstValueFrom(this.removeBasket(basketValue.id));
28785
+ yield this.removeBasket(basketValue.id).toPromise();
28782
28786
  }
28783
28787
  }
28784
28788
  });
@@ -29534,10 +29538,19 @@ class BaseEnterpriseBasketService {
29534
29538
  this.validateBasketItemMiFetcher.fetchOne(query);
29535
29539
  });
29536
29540
  }
29541
+ // async validateMiBasket(basketId: string): Promise<void> {
29542
+ // const query = { basketId };
29543
+ // return firstValueFrom(this.validateBasketMiFetcher.fetchOne(query)).then(data => {
29544
+ // this.miViewed = true;
29545
+ // this.missingMIs = data;
29546
+ // });
29547
+ // }
29537
29548
  validateMiBasket(basketId) {
29538
29549
  return __awaiter(this, void 0, void 0, function* () {
29539
- const query = { basketId };
29540
- return firstValueFrom(this.validateBasketMiFetcher.fetchOne(query)).then(data => {
29550
+ const query = {
29551
+ basketId
29552
+ };
29553
+ this.validateBasketMiFetcher.fetchOne(query).subscribe(data => {
29541
29554
  this.miViewed = true;
29542
29555
  this.missingMIs = data;
29543
29556
  });