@sabstravtech/obtservices 0.2.2607131100 → 0.2.2607131200

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.
Files changed (27) hide show
  1. package/angular/components/basket-panel.d.ts +5 -5
  2. package/angular/lib/vendor/services/chatbot-car-hire-search.service.d.ts +7 -9
  3. package/angular/lib/vendor/services/chatbot-eurostar-search.service.d.ts +12 -5
  4. package/angular/lib/vendor/services/chatbot-flight-search.service.d.ts +78 -42
  5. package/angular/lib/vendor/services/chatbot-hotel-search.service.d.ts +8 -8
  6. package/angular/lib/vendor/services/chatbot-lounge-search.service.d.ts +7 -5
  7. package/angular/lib/vendor/services/chatbot-rail-search.service.d.ts +12 -7
  8. package/angular/lib/vendor/services/chatbot-search-dispatcher.service.d.ts +1 -5
  9. package/angular/lib/vendor/services/chatbot-taxi-search.service.d.ts +2 -8
  10. package/angular/lib/vendor/services/chatbot.service.d.ts +2 -12
  11. package/angular/lib/vendor/services/result-aware.service.d.ts +5 -5
  12. package/angular/services.d.ts +0 -3
  13. package/base/lib/utils/search-helpers.d.ts +0 -9
  14. package/base/lib/vendor/interfaces/Ienterprise-basket.service.d.ts +2 -4
  15. package/base/lib/vendor/interfaces/Isearch.service.d.ts +5 -8
  16. package/base/lib/vendor/interfaces/chatbot.types.d.ts +12 -60
  17. package/base/lib/vendor/services/chatbot.service.d.ts +0 -19
  18. package/base/lib/vendor/services/search.service.d.ts +0 -1
  19. package/base/lib/vendor/types/types.d.ts +1 -1
  20. package/fesm2022/sabstravtech-obtservices-angular.mjs +1599 -1537
  21. package/fesm2022/sabstravtech-obtservices-angular.mjs.map +1 -1
  22. package/fesm2022/sabstravtech-obtservices-base.mjs +1 -60
  23. package/fesm2022/sabstravtech-obtservices-base.mjs.map +1 -1
  24. package/package.json +1 -1
  25. package/angular/lib/vendor/services/chatbot-fast-track-search.service.d.ts +0 -31
  26. package/angular/lib/vendor/services/chatbot-parking-search.service.d.ts +0 -23
  27. package/angular/lib/vendor/services/chatbot-search.util.d.ts +0 -35
@@ -1,20 +1,20 @@
1
1
  import { OnInit } from '@angular/core';
2
- import { InternalBasketInterface, EnterpriseBasketServiceInterface, UserServiceInterface, EnterpriseSearchServiceInterface } from '@sabstravtech/obtservices/base';
2
+ import { InternalBasketInterface } from '@sabstravtech/obtservices/base';
3
3
  import { Router } from '@angular/router';
4
- import { ModalOpenerService } from '../services';
4
+ import { EnterpriseBasketService, EnterpriseSearchService, ModalOpenerService, UserService } from '../services';
5
5
  import { BasketItem, ServiceType } from '../lib/vendor/types/graphql.angular.types';
6
6
  import { WithSubscriptionComponent } from './with-component';
7
7
  import * as i0 from "@angular/core";
8
8
  export declare class BasketPanelComponent extends WithSubscriptionComponent implements OnInit {
9
- basketService: EnterpriseBasketServiceInterface;
10
- userService: UserServiceInterface;
9
+ basketService: EnterpriseBasketService;
10
+ userService: UserService;
11
11
  private searchService;
12
12
  router: Router;
13
13
  modalService: ModalOpenerService;
14
14
  selectedBasketIndex: string;
15
15
  selectedBasket: InternalBasketInterface;
16
16
  ItemTypes: typeof ServiceType;
17
- constructor(basketService: EnterpriseBasketServiceInterface, userService: UserServiceInterface, searchService: EnterpriseSearchServiceInterface, router: Router, modalService?: ModalOpenerService);
17
+ constructor(basketService: EnterpriseBasketService, userService: UserService, searchService: EnterpriseSearchService, router: Router, modalService?: ModalOpenerService);
18
18
  ngOnInit(): void;
19
19
  findBasket(baskets: InternalBasketInterface[], id: string): InternalBasketInterface;
20
20
  showCO2(): boolean;
@@ -1,7 +1,8 @@
1
- import { ChatSearchParameters, ChatbotTravelHandler, EnterpriseSearchServiceInterface, UserServiceInterface } from '@sabstravtech/obtservices/base';
1
+ import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
2
2
  import { ChatbotService } from './chatbot.service';
3
+ import { EnterpriseSearchService } from './search.service';
3
4
  import { ResultAwareService } from './result-aware.service';
4
- import { WithSubscriptionComponent } from '../../../components/with-component';
5
+ import { UserService } from './user.service';
5
6
  import * as i0 from "@angular/core";
6
7
  /**
7
8
  * Handles chatbot-driven car hire searches. Registered with
@@ -11,20 +12,20 @@ import * as i0 from "@angular/core";
11
12
  * search headlessly, then injects a `ChatCarHireResults` message so the chat
12
13
  * widget can render car hire cards.
13
14
  */
14
- export declare class ChatbotCarHireSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
15
+ export declare class ChatbotCarHireSearchService implements ChatbotTravelHandler {
15
16
  private chatbotService;
16
17
  private searchService;
17
18
  private resultAwareService;
18
19
  private userService;
19
20
  readonly travelType: "car-hire";
20
21
  private pendingDepotChoice;
21
- private carHireSearchParams;
22
- constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchServiceInterface, resultAwareService: ResultAwareService, userService: UserServiceInterface);
22
+ constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, resultAwareService: ResultAwareService, userService: UserService);
23
+ private ensureSelfTraveller;
23
24
  handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
24
25
  private runSearch;
25
26
  private buildCarHireCards;
26
27
  private calculateDays;
27
- private toDepotChoice;
28
+ private injectNoResultsMessage;
28
29
  private injectLocationHelpMessage;
29
30
  private handleDepotSelectionReply;
30
31
  private populateCarHireParams;
@@ -32,7 +33,6 @@ export declare class ChatbotCarHireSearchService extends WithSubscriptionCompone
32
33
  private resolveVendorCode;
33
34
  private resolveLocation;
34
35
  private resolveAirportLocation;
35
- private fetchAirports;
36
36
  private airportToLocation;
37
37
  private pickBestLocation;
38
38
  private toAirportDetails;
@@ -40,14 +40,12 @@ export declare class ChatbotCarHireSearchService extends WithSubscriptionCompone
40
40
  private applyAirportDropoff;
41
41
  private applyCityPickup;
42
42
  private applyCityDropoff;
43
- private plainCityName;
44
43
  private toCityLocation;
45
44
  private resolveCityDepots;
46
45
  private fetchDepotsWithinRadius;
47
46
  private resolveDepot;
48
47
  private resolveEnterpriseDepot;
49
48
  private fetchEnterpriseDepots;
50
- private fetchDepotsFrom;
51
49
  private toEnterpriseDepot;
52
50
  private applyPostcodePickupAndDropoff;
53
51
  private resolvePostcode;
@@ -1,6 +1,7 @@
1
- import { ChatSearchParameters, ChatbotTravelHandler, EnterpriseSearchServiceInterface, UserServiceInterface } from '@sabstravtech/obtservices/base';
1
+ import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
2
2
  import { ChatbotService } from './chatbot.service';
3
- import { WithSubscriptionComponent } from '../../../components/with-component';
3
+ import { EnterpriseSearchService } from './search.service';
4
+ import { UserService } from './user.service';
4
5
  import * as i0 from "@angular/core";
5
6
  /**
6
7
  * Handles chatbot-driven Eurostar searches. Registered with
@@ -11,21 +12,27 @@ import * as i0 from "@angular/core";
11
12
  * Once results arrive, builds `ChatEurostarResults` and patches them onto the
12
13
  * last assistant message via {@link ChatbotService.patchAssistantMessage}.
13
14
  */
14
- export declare class ChatbotEurostarSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
15
+ export declare class ChatbotEurostarSearchService implements ChatbotTravelHandler {
15
16
  private chatbotService;
16
17
  private searchService;
17
18
  private userService;
18
19
  readonly travelType: "eurostar";
19
- private eurostarSearchParams;
20
- constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchServiceInterface, userService: UserServiceInterface);
20
+ private resultsSubscription;
21
+ constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, userService: UserService);
21
22
  handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
22
23
  private runSearch;
24
+ /**
25
+ * Render OBT's validationMessages array as a chatbot reply. Single message →
26
+ * inline sentence; multiple → bullet list so each issue reads clearly.
27
+ */
28
+ private formatValidationMessages;
23
29
  private subscribeToResults;
24
30
  private extractItems;
25
31
  private buildCard;
26
32
  private populateEurostarParams;
27
33
  private mapCabinClass;
28
34
  private resolveStation;
35
+ private normalizeTime;
29
36
  static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotEurostarSearchService, never>;
30
37
  static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotEurostarSearchService>;
31
38
  }
@@ -1,13 +1,20 @@
1
- import { ChatSearchParameters, ChatbotTravelHandler, EnterpriseSearchServiceInterface, UserServiceInterface } from '@sabstravtech/obtservices/base';
1
+ import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
2
2
  import { ChatbotService } from './chatbot.service';
3
+ import { EnterpriseSearchService } from './search.service';
3
4
  import { ResultAwareService } from './result-aware.service';
4
- import { WithSubscriptionComponent } from '../../../components/with-component';
5
+ import { UserService } from './user.service';
5
6
  import * as i0 from "@angular/core";
6
7
  /**
7
- * Handles chatbot-driven flight searches: populates flight state from chat
8
- * parameters, runs `startSearch()` headlessly, and patches result cards on.
8
+ * Handles chatbot-driven flight searches. Registered with
9
+ * `ChatbotSearchDispatcherService`; not used directly.
10
+ *
11
+ * Populates the flight search state from the chatbot's parameters (same state
12
+ * the search form binds to via ngModel) and runs `startSearch()` headlessly
13
+ * so chatbot flight searches work from any page. Once results arrive, builds
14
+ * `ChatFlightResultCard`s and patches them onto the last assistant message
15
+ * via {@link ChatbotService.patchAssistantMessage}.
9
16
  */
10
- export declare class ChatbotFlightSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
17
+ export declare class ChatbotFlightSearchService implements ChatbotTravelHandler {
11
18
  private chatbotService;
12
19
  private searchService;
13
20
  private resultAwareService;
@@ -19,54 +26,73 @@ export declare class ChatbotFlightSearchService extends WithSubscriptionComponen
19
26
  private static readonly NO_CARRIER_PREFERENCE;
20
27
  /** Regional/subsidiary markers, so "KLM" doesn't resolve to "KLM Cityhopper". */
21
28
  private static readonly CARRIER_SUBSIDIARY;
29
+ private resultsSubscription;
22
30
  /**
23
- * Most recent full search parameters, cached so a {@link resort} (which only
24
- * carries new ranking intent) can still render card headers/dates.
31
+ * The most recent full search parameters (origin, destination, dates,
32
+ * cabin, etc.). Cached so a {@link resort} call — whose own parameters carry
33
+ * only the new ranking intent (sortType / time target) — can still render
34
+ * card headers and dates for the trip that produced the cached results.
25
35
  */
26
36
  private lastSearchParameters;
27
- private flightSearchParams;
28
- constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchServiceInterface, resultAwareService: ResultAwareService, userService: UserServiceInterface);
29
- /** The flight search's current validation messages, empty-filtered. */
30
- private readValidationMessages;
31
- /** Patch a final assistant message and stop the searching spinner. */
32
- private respondAndStop;
37
+ constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, resultAwareService: ResultAwareService, userService: UserService);
33
38
  handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
34
39
  private subscribeToFlightResults;
35
40
  /**
36
- * Re-render the chat flight cards from the flight-search session's cached
37
- * results. Used post-search and by {@link resort} (re-rank, no new search).
41
+ * Re-render the chat flight cards from whatever the flight-search session
42
+ * currently holds the same cached results that "View Full Results" shows.
43
+ * Used both by the post-search subscription and by {@link resort} (which
44
+ * re-ranks without a new backend search). Reads `results.value` (falling
45
+ * back to the unfiltered `fullResults`), re-extracts the journeys, and builds
46
+ * cards using `parameters` (sort/time/airline/stops) so the same data can be
47
+ * re-ordered for a new preference.
38
48
  */
39
49
  private buildAndPatchResultsFromCache;
40
50
  /**
41
51
  * Re-rank the results already in the flight-search session for a new user
42
- * preference WITHOUT a new backend search, then patch fresh cards on.
52
+ * preference (cheapest / fastest / shortest / nearest-to-time) WITHOUT
53
+ * running a new backend search. The cached itineraries are the same set the
54
+ * results page shows; we just re-order them via `buildFlightResults` and
55
+ * patch fresh cards onto the latest assistant message.
43
56
  */
44
57
  resort(parameters: ChatSearchParameters): Promise<void>;
45
58
  private buildFlightResults;
46
59
  /**
47
- * Builds a map keyed by an itinerary's flight-number signature to all bookable
48
- * fare variants (cabin/brand/price) for the same physical flights.
60
+ * Builds a map keyed by an itinerary's flight-number signature to all
61
+ * bookable fare variants (cabin/brand/price) for the same physical flights.
62
+ * For combined-return journeys the key includes both outbound + inbound
63
+ * flight numbers; for dual-single legs it's just that leg's numbers.
49
64
  */
50
65
  private indexFaresByFlights;
51
- /** Marketing carrier + flight number for a single leg, e.g. "BA123". */
52
- private flightCode;
53
66
  private flightSignature;
54
67
  private toFareTicket;
55
68
  /**
56
- * Builds chat cards for a multi-city itinerary: OBT concatenates all legs in
57
- * `outboundFlights[]`, which we split by leg-date into N `ChatFlightLeg`s.
69
+ * Builds chat cards for a multi-city itinerary. OBT returns one bundle per
70
+ * search with per-leg result arrays; we surface the top N itineraries by
71
+ * pairing the i-th cheapest option from every leg into a single "stacked"
72
+ * card. This is naive (it doesn't try every combinatorial combination) but
73
+ * gives the user a useful headline view; View Full Results owns the proper
74
+ * fare-combination picker.
75
+ *
76
+ * OBT returns multi-city itineraries as a single `bundle.journeys[]` where
77
+ * each entry has all legs concatenated in `outboundFlights[]`. We split each
78
+ * itinerary by leg-date to produce N `ChatFlightLeg`s per card.
58
79
  */
59
80
  private buildMultiCityFlightResults;
60
81
  /**
61
- * Split a concatenated multi-city flight list into per-leg buckets by matching
62
- * each flight's depart date to a leg date (latest leg on/before it as fallback).
82
+ * Split a concatenated multi-city flight list into per-leg buckets. Primary
83
+ * key is the flight's depart date matching a leg date; falls back to the
84
+ * latest leg whose date is on or before the flight (covers overnight
85
+ * connections that depart the day before the next leg's planned date).
63
86
  */
64
87
  private splitFlightsByLeg;
65
88
  /** Build a `ChatFlightLeg` from the flights assigned to a single leg. */
66
89
  private flightsToChatLeg;
67
90
  /**
68
- * Calendar days the arrival falls after departure (0 = same day, 1 = next day).
69
- * Compares date components not elapsed time; returns 0 for missing/invalid.
91
+ * Calendar days the arrival falls after departure (0 = same day, 1 = next
92
+ * day). Compares date components rather than elapsed time so a 23:30 → 00:40
93
+ * hop still counts as +1. Returns 0 when datetimes are missing/invalid so a
94
+ * lack of data never hides an otherwise-valid result. Accepts either a full
95
+ * `CondensedResult` (outbound) or its `inbound` sub-leg.
70
96
  */
71
97
  private arrivalDayOffset;
72
98
  private formatHHmm;
@@ -75,8 +101,16 @@ export declare class ChatbotFlightSearchService extends WithSubscriptionComponen
75
101
  private formatDate;
76
102
  private formatCabinLabel;
77
103
  /**
78
- * Tracks the last search's resolved airports to decide whether a follow-up
79
- * refines the same journey (keep sticky options) or is a fresh search (clear).
104
+ * Render OBT's validationMessages array as a chatbot reply. Single message →
105
+ * inline sentence; multiple bullet list so each issue reads clearly.
106
+ */
107
+ private formatValidationMessages;
108
+ /**
109
+ * Tracks the last chatbot flight search's resolved airports so we can decide
110
+ * whether a follow-up turn is a "refinement of the same journey" (e.g. swap
111
+ * MAN → AMS for LPL → AMS — same metro, user is just nudging a parameter)
112
+ * or a "fresh search" (e.g. MAN → AMS to BER → ATH — clearly unrelated, so
113
+ * any sticky options like "direct only" should be cleared).
80
114
  */
81
115
  private lastSearch;
82
116
  private static readonly NEARBY_AIRPORT_KM;
@@ -84,32 +118,34 @@ export declare class ChatbotFlightSearchService extends WithSubscriptionComponen
84
118
  private airportCoords;
85
119
  /**
86
120
  * Multi-city counterpart to `populateFlightParams`. Resolves each leg's
87
- * airports, builds `IMultiDestination[]`, and switches to multiCity (full reset).
121
+ * origin/destination airports, builds the `IMultiDestination[]` shape the
122
+ * flight search expects, and switches `chosenSearchType` to multiCity.
123
+ * Same-journey detection is skipped (the user is describing a fundamentally
124
+ * new itinerary), so we always do a full reset.
88
125
  */
89
126
  private populateMultiCityFlightParams;
90
127
  /**
91
- * Normalise a chat cabin value: `null` when unset, `Any` for "any"/"all"
92
- * sentinels, else the mapped {@link FlightCabinClass}.
93
- */
94
- private resolveCabinClass;
95
- /** Apply the passenger breakdown (adults/children/infants), leg-agnostic. */
96
- private applyPassengers;
97
- /**
98
- * Apply the leg-agnostic subset of `populateFlightParams` (cabin class,
99
- * passenger breakdown, sort, refundable). Shared by single/return + multi-city.
128
+ * Apply the subset of `populateFlightParams` that is leg-agnostic (cabin
129
+ * class, passenger breakdown, sort, refundable flag). Shared between
130
+ * single/return and multi-city paths.
100
131
  */
101
132
  private applySharedFlightParams;
102
133
  private populateFlightParams;
103
134
  private mapCabinClass;
135
+ private normalizeTime;
104
136
  private resolveAirport;
105
137
  /**
106
- * Build the de-duplicated list of carrier search terms from the `airlines`
107
- * array (or singular airline/airlineCode), dropping sentinels + sub-2-char.
138
+ * Build the de-duplicated list of carrier search terms from the chat
139
+ * parameters. Prefers the `airlines` array (up to {@link MAX_PREFERRED_CARRIERS})
140
+ * when present, else falls back to the singular airline/airlineCode. Drops
141
+ * "no preference" sentinels ("any"/"all"/empty) and terms shorter than 2 chars.
108
142
  */
109
143
  private collectCarrierTerms;
110
144
  /**
111
- * Resolve an airline term to a real {code, name} from searchAirlines,
112
- * highest-confidence first: exact code, exact name, then non-subsidiary match.
145
+ * Resolve a single airline search term to a real {code, name} from the
146
+ * searchAirlines GraphQL source, trying the highest-confidence match first:
147
+ * exact IATA code, exact name, then non-subsidiary startsWith/contains — so
148
+ * "KLM" resolves to "KLM Royal Dutch Airlines" rather than "KLM Cityhopper".
113
149
  */
114
150
  private resolveCarrier;
115
151
  static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotFlightSearchService, never>;
@@ -1,8 +1,9 @@
1
- import { ChatSearchParameters, ChatbotTravelHandler, EnterpriseSearchServiceInterface, UserServiceInterface, HotelEnterpriseSearchInterface } from '@sabstravtech/obtservices/base';
1
+ import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
2
2
  import { ChatbotService } from './chatbot.service';
3
+ import { EnterpriseSearchService } from './search.service';
3
4
  import { HotelAvalibilityService } from './hotel-avallibility.service';
4
5
  import { ResultAwareService } from './result-aware.service';
5
- import { WithSubscriptionComponent } from '../../../components/with-component';
6
+ import { UserService } from './user.service';
6
7
  import * as i0 from "@angular/core";
7
8
  /**
8
9
  * Handles chatbot-driven hotel searches. Registered with
@@ -13,25 +14,24 @@ import * as i0 from "@angular/core";
13
14
  * a `ChatHotelResults` message so the chat widget can render hotel cards.
14
15
  * Works from any page — no search form component needs to be mounted.
15
16
  */
16
- export declare class ChatbotHotelSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
17
+ export declare class ChatbotHotelSearchService implements ChatbotTravelHandler {
17
18
  private chatbotService;
18
19
  private searchService;
19
20
  private hotelAvalibilityService;
20
21
  private resultAwareService;
21
22
  private userService;
22
23
  readonly travelType: "hotel";
24
+ private availabilitySubscription;
23
25
  lastParameters: ChatSearchParameters | null;
24
- hotelSearchParams: HotelEnterpriseSearchInterface;
25
26
  markAsLoading(): void;
26
27
  get hasHotelResults(): boolean;
27
- constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchServiceInterface, hotelAvalibilityService: HotelAvalibilityService, resultAwareService: ResultAwareService, userService: UserServiceInterface);
28
+ constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, hotelAvalibilityService: HotelAvalibilityService, resultAwareService: ResultAwareService, userService: UserService);
28
29
  handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
29
- private makeAvailabilitySubjects;
30
- private awaitAvailability$;
31
- private buildSearchHeader;
30
+ private ensureSelfTraveller;
32
31
  private runSearch;
33
32
  private runSearchFromOffset;
34
33
  private buildHotelCards;
34
+ private injectNoResultsMessage;
35
35
  private sortHotels;
36
36
  private cheapestRoomTotal;
37
37
  private populateHotelParams;
@@ -1,7 +1,8 @@
1
- import { ChatSearchParameters, ChatbotTravelHandler, EnterpriseSearchServiceInterface, UserServiceInterface } from '@sabstravtech/obtservices/base';
1
+ import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
2
2
  import { ChatbotService } from './chatbot.service';
3
+ import { EnterpriseSearchService } from './search.service';
3
4
  import { ResultAwareService } from './result-aware.service';
4
- import { WithSubscriptionComponent } from '../../../components/with-component';
5
+ import { UserService } from './user.service';
5
6
  import * as i0 from "@angular/core";
6
7
  /**
7
8
  * Handles chatbot-driven lounge searches. Registered with
@@ -12,17 +13,18 @@ import * as i0 from "@angular/core";
12
13
  * Once results arrive, builds `ChatLoungeResultCard`s and patches them onto
13
14
  * the last assistant message via {@link ChatbotService.patchAssistantMessage}.
14
15
  */
15
- export declare class ChatbotLoungeSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
16
+ export declare class ChatbotLoungeSearchService implements ChatbotTravelHandler {
16
17
  private chatbotService;
17
18
  private searchService;
18
19
  private resultAwareService;
19
20
  private userService;
20
21
  readonly travelType: "lounge";
21
- private loungeSearchParams;
22
- constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchServiceInterface, resultAwareService: ResultAwareService, userService: UserServiceInterface);
22
+ private resultsSubscription;
23
+ constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, resultAwareService: ResultAwareService, userService: UserService);
23
24
  handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
24
25
  private subscribeToLoungeResults;
25
26
  private buildLoungeCards;
27
+ private formatValidationMessages;
26
28
  private populateLoungeParams;
27
29
  private resolveAirport;
28
30
  static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotLoungeSearchService, never>;
@@ -1,7 +1,8 @@
1
- import { ChatSearchParameters, ChatbotTravelHandler, EnterpriseSearchServiceInterface, UserServiceInterface } from '@sabstravtech/obtservices/base';
1
+ import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
2
2
  import { ChatbotService } from './chatbot.service';
3
+ import { EnterpriseSearchService } from './search.service';
3
4
  import { ResultAwareService } from './result-aware.service';
4
- import { WithSubscriptionComponent } from '../../../components/with-component';
5
+ import { UserService } from './user.service';
5
6
  import * as i0 from "@angular/core";
6
7
  /**
7
8
  * Handles chatbot-driven rail searches. Registered with
@@ -13,15 +14,20 @@ import * as i0 from "@angular/core";
13
14
  * `ChatRailResultCard`s and patches them onto the last assistant message
14
15
  * via {@link ChatbotService.patchAssistantMessage}.
15
16
  */
16
- export declare class ChatbotRailSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
17
+ export declare class ChatbotRailSearchService implements ChatbotTravelHandler {
17
18
  private chatbotService;
18
19
  private searchService;
19
20
  private resultAwareService;
20
21
  private userService;
21
22
  readonly travelType: "rail";
22
- private railSearchParams;
23
- constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchServiceInterface, resultAwareService: ResultAwareService, userService: UserServiceInterface);
23
+ private resultsSubscription;
24
+ constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, resultAwareService: ResultAwareService, userService: UserService);
24
25
  handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
26
+ /**
27
+ * Render OBT's validationMessages array as a chatbot reply. Single message →
28
+ * inline sentence; multiple → bullet list so each issue reads clearly.
29
+ */
30
+ private formatValidationMessages;
25
31
  /**
26
32
  * Subscribe to ResultAwareService for the next rail result emission, build
27
33
  * the top-N cards per leg, then patch the last assistant message so the
@@ -30,11 +36,10 @@ export declare class ChatbotRailSearchService extends WithSubscriptionComponent
30
36
  private subscribeToRailResults;
31
37
  private buildRailResults;
32
38
  private buildInboundCards;
33
- /** Keep the first entry for each distinct `index`, preserving order. */
34
- private dedupeByIndex;
35
39
  private toRailCard;
36
40
  private formatDate;
37
41
  private populateRailParams;
42
+ private normalizeTime;
38
43
  private preferRailStation;
39
44
  private resolveRailStation;
40
45
  private lookupRailStations;
@@ -4,8 +4,6 @@ import { ChatbotFlightSearchService } from './chatbot-flight-search.service';
4
4
  import { ChatbotRailSearchService } from './chatbot-rail-search.service';
5
5
  import { ChatbotHotelSearchService } from './chatbot-hotel-search.service';
6
6
  import { ChatbotLoungeSearchService } from './chatbot-lounge-search.service';
7
- import { ChatbotFastTrackSearchService } from './chatbot-fast-track-search.service';
8
- import { ChatbotParkingSearchService } from './chatbot-parking-search.service';
9
7
  import { ChatbotCarHireSearchService } from './chatbot-car-hire-search.service';
10
8
  import { ChatbotTaxiSearchService } from './chatbot-taxi-search.service';
11
9
  import { ChatbotService } from './chatbot.service';
@@ -26,11 +24,9 @@ export declare class ChatbotSearchDispatcherService {
26
24
  private chatbotService;
27
25
  private initialised;
28
26
  private readonly handlers;
29
- constructor(chatbotService: ChatbotService, rail: ChatbotRailSearchService, flight: ChatbotFlightSearchService, hotel: ChatbotHotelSearchService, carHire: ChatbotCarHireSearchService, eurostar: ChatbotEurostarSearchService, lounge: ChatbotLoungeSearchService, fastTrack: ChatbotFastTrackSearchService, parking: ChatbotParkingSearchService, taxi: ChatbotTaxiSearchService);
27
+ constructor(chatbotService: ChatbotService, rail: ChatbotRailSearchService, flight: ChatbotFlightSearchService, hotel: ChatbotHotelSearchService, carHire: ChatbotCarHireSearchService, eurostar: ChatbotEurostarSearchService, lounge: ChatbotLoungeSearchService, taxi: ChatbotTaxiSearchService);
30
28
  /** Call once at app start. Idempotent. */
31
29
  init(): void;
32
- /** Run a handler promise, logging any rejection without breaking the stream. */
33
- private run;
34
30
  /**
35
31
  * Whether a global handler is registered for the given travel type. Used by
36
32
  * search forms to know which travel types they should skip (avoiding
@@ -1,27 +1,21 @@
1
1
  import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
2
- import { WithSubscriptionComponent } from '../../../components/with-component';
3
2
  import { ChatbotService } from './chatbot.service';
4
3
  import { EnterpriseSearchService } from './search.service';
5
4
  import { ResultAwareService } from './result-aware.service';
6
5
  import { UserService } from './user.service';
7
6
  import * as i0 from "@angular/core";
8
- export declare class ChatbotTaxiSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
7
+ export declare class ChatbotTaxiSearchService implements ChatbotTravelHandler {
9
8
  private chatbotService;
10
9
  private searchService;
11
10
  private resultAwareService;
12
11
  private userService;
13
12
  readonly travelType: "taxi";
14
- private taxiSearchParams;
15
- chatbotFilterId: string | null;
16
- lastParameters: ChatSearchParameters | null;
17
- get hasTaxiResults(): boolean;
18
- markAsLoading(): void;
19
13
  constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, resultAwareService: ResultAwareService, userService: UserService);
20
14
  handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
21
15
  private runSearch;
22
16
  private buildTaxiCards;
17
+ private injectNoResultsMessage;
23
18
  private populateTaxiParams;
24
- private prepareAddress;
25
19
  private searchAndResolveGeoLocation;
26
20
  private locationDataToResolved;
27
21
  private resolveGeoLocation;
@@ -1,22 +1,16 @@
1
1
  import { OnDestroy } from '@angular/core';
2
- import { Router } from '@angular/router';
3
2
  import { Subject } from 'rxjs';
4
- import { BaseChatbotService, BotFaq, ChatFeedbackAck, ChatMessage, ChatSearchParameters, ChatTokenEvent, ChatToolEvent, ChatWsResponse, CondensedResult, UserCapabilities, IRiskFlag } from '@sabstravtech/obtservices/base';
5
3
  import { WebTokenService } from '../services/webtoken.service';
6
4
  import { Environment } from '../classes/environment';
5
+ import { BaseChatbotService, BotFaq, ChatFeedbackAck, ChatMessage, ChatSearchParameters, ChatTokenEvent, ChatToolEvent, ChatWsResponse, CondensedResult, UserCapabilities, IRiskFlag } from '@sabstravtech/obtservices/base';
7
6
  import { ResultAwareService } from './result-aware.service';
8
7
  import { UserService } from './user.service';
9
- import { EnterpriseBasketService } from './enterprise-basket.service';
10
- import { EnterpriseSearchService } from './search.service';
11
8
  import * as i0 from "@angular/core";
12
9
  export declare class ChatbotService extends BaseChatbotService implements OnDestroy {
13
10
  private webTokenService;
14
11
  private resultAwareService;
15
12
  private environment;
16
13
  private userService;
17
- private basketService;
18
- private searchService;
19
- private router;
20
14
  private messagesSubject;
21
15
  messages$: import("rxjs").Observable<ChatMessage[]>;
22
16
  private loadingSubject;
@@ -52,7 +46,7 @@ export declare class ChatbotService extends BaseChatbotService implements OnDest
52
46
  /** Tracks the user ID that owns the current chat session, to detect user switches. */
53
47
  private sessionOwnerId;
54
48
  private userChangeSubscription;
55
- constructor(webTokenService: WebTokenService, resultAwareService: ResultAwareService, environment: Environment, userService: UserService, basketService: EnterpriseBasketService, searchService: EnterpriseSearchService, router: Router);
49
+ constructor(webTokenService: WebTokenService, resultAwareService: ResultAwareService, environment: Environment, userService: UserService);
56
50
  ngOnDestroy(): void;
57
51
  protected getRequestUrl(): string | null;
58
52
  protected getAuthToken(): string | null;
@@ -78,10 +72,6 @@ export declare class ChatbotService extends BaseChatbotService implements OnDest
78
72
  */
79
73
  private resolveAllowedFlightCabins;
80
74
  protected getUserFirstName(): string | undefined;
81
- /** The active basket selected in the floating basket, if any. */
82
- protected getActiveBasketId(): string | undefined;
83
- protected executeBasketDeletion(): Promise<void>;
84
- protected executeStartAgain(): Promise<void>;
85
75
  /** Set by ChatbotCarHireSearchService when the user is choosing from a depot list. */
86
76
  depotSelectionHandler: ((text: string) => Promise<boolean>) | null;
87
77
  connect(): void;
@@ -1,5 +1,7 @@
1
1
  import { Router } from '@angular/router';
2
- import { CondensedResult, ChatRailFareTicket, ChatFlightFareTicket, EnterpriseBasketServiceInterface, EnterpriseSearchServiceInterface, FlightEnterpriseSearchInterface, HotelEnterpriseSearchInterface, RailEnterpriseSearchInterface } from '@sabstravtech/obtservices/base';
2
+ import { EnterpriseSearchService } from './search.service';
3
+ import { EnterpriseBasketService } from './enterprise-basket.service';
4
+ import { CondensedResult, ChatRailFareTicket, ChatFlightFareTicket } from '@sabstravtech/obtservices/base';
3
5
  import * as i0 from "@angular/core";
4
6
  export declare class ResultAwareService {
5
7
  private searchService;
@@ -18,10 +20,7 @@ export declare class ResultAwareService {
18
20
  private flightInboundRaw;
19
21
  private resultsAvailableSubject;
20
22
  resultsAvailable$: import("rxjs").Observable<boolean>;
21
- flightSearchParams: FlightEnterpriseSearchInterface;
22
- railSearchParams: RailEnterpriseSearchInterface;
23
- hotelSearchParams: HotelEnterpriseSearchInterface;
24
- constructor(searchService: EnterpriseSearchServiceInterface, basketService: EnterpriseBasketServiceInterface, router: Router);
23
+ constructor(searchService: EnterpriseSearchService, basketService: EnterpriseBasketService, router: Router);
25
24
  captureFlightResults(results: any[]): void;
26
25
  captureRailResults(quoteResult: any): void;
27
26
  captureHotelResults(results: any[]): void;
@@ -76,6 +75,7 @@ export declare class ResultAwareService {
76
75
  private condenseRailResults;
77
76
  private derivePolicyStatus;
78
77
  private derivePolicyMessages;
78
+ private getFirstCabinClassName;
79
79
  private filterDownCompressedReturnRailOptions;
80
80
  selectHotelRoom(hotelIndex: number, roomId: string): Promise<void>;
81
81
  private executeHotelSelection;
@@ -24,8 +24,5 @@ export * from './lib/vendor/services/chatbot-hotel-search.service';
24
24
  export * from './lib/vendor/services/chatbot-car-hire-search.service';
25
25
  export * from './lib/vendor/services/chatbot-taxi-search.service';
26
26
  export * from './lib/vendor/services/chatbot-eurostar-search.service';
27
- export * from './lib/vendor/services/chatbot-lounge-search.service';
28
- export * from './lib/vendor/services/chatbot-fast-track-search.service';
29
- export * from './lib/vendor/services/chatbot-parking-search.service';
30
27
  export * from './lib/vendor/services/chatbot-search-dispatcher.service';
31
28
  export * from './lib/vendor/services/result-aware.service';
@@ -1,5 +1,4 @@
1
1
  import { ServiceType } from '../vendor/types/graphql.types';
2
- import { LocationDetails, SearchDiscoverLocationResult } from '../vendor/types/types';
3
2
  import { SearchObject } from '../vendor/interfaces/search-objects.interface';
4
3
  /**
5
4
  * Get the ServiceType for a start tab string
@@ -15,11 +14,3 @@ export declare function getServiceTypeFromPriority(searchObjects: {
15
14
  * Check if the selected service type is NOT an offline booking type
16
15
  */
17
16
  export declare function isNotOfflineBookingType(serviceType: ServiceType): boolean;
18
- /**
19
- * Map a discover-locations result onto the LocationDetails domain shape.
20
- *
21
- * The discover-locations query returns loosely-typed results (`type` is a plain
22
- * string and most fields are nullable). This normalises them to LocationDetails,
23
- * converting null to undefined so downstream resolvers get the expected shape.
24
- */
25
- export declare function discoverToLocationDetails(d: SearchDiscoverLocationResult): LocationDetails;
@@ -32,7 +32,6 @@ export interface EnterpriseBasketServiceInterface extends BasketServiceMinimalMI
32
32
  highlightBasketItemsEmitter: Subject<GetUserBasketItemResult[]>;
33
33
  autoSuggestDefaultsLoading: BehaviorSubject<boolean>;
34
34
  loadingSupplementaryBookingInfo: BehaviorSubject<boolean>;
35
- deletingBasket: BehaviorSubject<boolean>;
36
35
  chosenEvolviSeat: BehaviorSubject<any>;
37
36
  evolviSeatReservationResponse: BehaviorSubject<any>;
38
37
  evolviWantToReserveSeat: BehaviorSubject<any>;
@@ -51,14 +50,13 @@ export interface EnterpriseBasketServiceInterface extends BasketServiceMinimalMI
51
50
  basketUpdating: boolean;
52
51
  isApprovedBasket: boolean;
53
52
  updatingBasket: boolean;
54
- miUpdating: BehaviorSubject<boolean>;
55
53
  missingMIs: ValidationResponse[];
56
54
  miViewed: boolean;
57
55
  addToBasket(item: AddItemToBasket.Variables, intBasket: InternalBasketInterface, searchService: SearchServiceMinimal, travellers: Traveller[], requiresReasonKeys: string[], invokedSplit?: boolean, ignoreInvokedCheck?: boolean): Promise<DifferentInvokdedUserReasons>;
58
56
  getRequiresReasonService(): RequiresReasonServiceInterface;
59
57
  getRequiresOverrideReasonService(): RequiresOverrideReasonServiceInterface;
60
58
  canCancel(basketItem: BasketItem): Observable<BeforeCancellationInfo>;
61
- createBasket(createdByBolt?: boolean, createdByGut?: boolean): Promise<InternalBasketInterface>;
59
+ createBasket(createdByBolt: boolean, createdByGut?: boolean): Promise<InternalBasketInterface>;
62
60
  loadBasket(id: string, forceload?: boolean): void;
63
61
  removeBasketItem(basketId: string, item: GetUserBasketItemResult): Promise<void>;
64
62
  getDefaultBasket(): Promise<InternalBasketInterface>;
@@ -69,7 +67,7 @@ export interface EnterpriseBasketServiceInterface extends BasketServiceMinimalMI
69
67
  getNumberItemsForBasket(basket: InternalBasketInterface): number;
70
68
  removeBasket(basketid: string): Observable<unknown>;
71
69
  removeExpiredItems(id: string): void;
72
- continueSearchAndBook(basketItems: any[], itiniaryUrl: string[], searchService: SearchServiceMinimal): string[];
70
+ continueSearchAndBook(basketItems: any[], itiniaryUrl: string[], searchService: SearchServiceMinimal): {};
73
71
  addTravellers(basketid: string, basketItem: BasketItem, travellers: Traveller[], index: number): void;
74
72
  setLeadPassenger(basketid: string, basketItem: BasketItem, travellers: Traveller, index: number, guest?: LeadPassengerType): void;
75
73
  revalidate(basketid: string): Promise<void>;