@sabstravtech/obtservices 0.2.2606301620 → 0.2.2607131100
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/angular/components/basket-panel.d.ts +5 -5
- package/angular/lib/vendor/services/chatbot-car-hire-search.service.d.ts +9 -7
- package/angular/lib/vendor/services/chatbot-eurostar-search.service.d.ts +5 -12
- package/angular/lib/vendor/services/chatbot-fast-track-search.service.d.ts +31 -0
- package/angular/lib/vendor/services/chatbot-flight-search.service.d.ts +42 -78
- package/angular/lib/vendor/services/chatbot-hotel-search.service.d.ts +8 -8
- package/angular/lib/vendor/services/chatbot-lounge-search.service.d.ts +5 -7
- package/angular/lib/vendor/services/chatbot-parking-search.service.d.ts +23 -0
- package/angular/lib/vendor/services/chatbot-rail-search.service.d.ts +7 -12
- package/angular/lib/vendor/services/chatbot-search-dispatcher.service.d.ts +5 -1
- package/angular/lib/vendor/services/chatbot-search.util.d.ts +35 -0
- package/angular/lib/vendor/services/chatbot-taxi-search.service.d.ts +13 -3
- package/angular/lib/vendor/services/chatbot.service.d.ts +12 -2
- package/angular/lib/vendor/services/result-aware.service.d.ts +5 -5
- package/angular/services.d.ts +3 -0
- package/base/lib/utils/search-helpers.d.ts +9 -0
- package/base/lib/vendor/classes/cabhire-enterprise-search.d.ts +9 -0
- package/base/lib/vendor/interfaces/Icabhire-enterprise-search.d.ts +4 -0
- package/base/lib/vendor/interfaces/Ienterprise-basket.service.d.ts +4 -2
- package/base/lib/vendor/interfaces/Isearch.service.d.ts +8 -5
- package/base/lib/vendor/interfaces/chatbot.types.d.ts +76 -12
- package/base/lib/vendor/services/chatbot.service.d.ts +19 -0
- package/base/lib/vendor/services/search.service.d.ts +1 -0
- package/base/lib/vendor/types/types.d.ts +1 -1
- package/fesm2022/sabstravtech-obtservices-angular.mjs +1591 -1579
- package/fesm2022/sabstravtech-obtservices-angular.mjs.map +1 -1
- package/fesm2022/sabstravtech-obtservices-base.mjs +67 -1
- package/fesm2022/sabstravtech-obtservices-base.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
|
-
import { InternalBasketInterface } from '@sabstravtech/obtservices/base';
|
|
2
|
+
import { InternalBasketInterface, EnterpriseBasketServiceInterface, UserServiceInterface, EnterpriseSearchServiceInterface } from '@sabstravtech/obtservices/base';
|
|
3
3
|
import { Router } from '@angular/router';
|
|
4
|
-
import {
|
|
4
|
+
import { ModalOpenerService } 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:
|
|
10
|
-
userService:
|
|
9
|
+
basketService: EnterpriseBasketServiceInterface;
|
|
10
|
+
userService: UserServiceInterface;
|
|
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:
|
|
17
|
+
constructor(basketService: EnterpriseBasketServiceInterface, userService: UserServiceInterface, searchService: EnterpriseSearchServiceInterface, router: Router, modalService?: ModalOpenerService);
|
|
18
18
|
ngOnInit(): void;
|
|
19
19
|
findBasket(baskets: InternalBasketInterface[], id: string): InternalBasketInterface;
|
|
20
20
|
showCO2(): boolean;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
|
|
1
|
+
import { ChatSearchParameters, ChatbotTravelHandler, EnterpriseSearchServiceInterface, UserServiceInterface } from '@sabstravtech/obtservices/base';
|
|
2
2
|
import { ChatbotService } from './chatbot.service';
|
|
3
|
-
import { EnterpriseSearchService } from './search.service';
|
|
4
3
|
import { ResultAwareService } from './result-aware.service';
|
|
5
|
-
import {
|
|
4
|
+
import { WithSubscriptionComponent } from '../../../components/with-component';
|
|
6
5
|
import * as i0 from "@angular/core";
|
|
7
6
|
/**
|
|
8
7
|
* Handles chatbot-driven car hire searches. Registered with
|
|
@@ -12,20 +11,20 @@ import * as i0 from "@angular/core";
|
|
|
12
11
|
* search headlessly, then injects a `ChatCarHireResults` message so the chat
|
|
13
12
|
* widget can render car hire cards.
|
|
14
13
|
*/
|
|
15
|
-
export declare class ChatbotCarHireSearchService implements ChatbotTravelHandler {
|
|
14
|
+
export declare class ChatbotCarHireSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
|
|
16
15
|
private chatbotService;
|
|
17
16
|
private searchService;
|
|
18
17
|
private resultAwareService;
|
|
19
18
|
private userService;
|
|
20
19
|
readonly travelType: "car-hire";
|
|
21
20
|
private pendingDepotChoice;
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
private carHireSearchParams;
|
|
22
|
+
constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchServiceInterface, resultAwareService: ResultAwareService, userService: UserServiceInterface);
|
|
24
23
|
handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
|
|
25
24
|
private runSearch;
|
|
26
25
|
private buildCarHireCards;
|
|
27
26
|
private calculateDays;
|
|
28
|
-
private
|
|
27
|
+
private toDepotChoice;
|
|
29
28
|
private injectLocationHelpMessage;
|
|
30
29
|
private handleDepotSelectionReply;
|
|
31
30
|
private populateCarHireParams;
|
|
@@ -33,6 +32,7 @@ export declare class ChatbotCarHireSearchService implements ChatbotTravelHandler
|
|
|
33
32
|
private resolveVendorCode;
|
|
34
33
|
private resolveLocation;
|
|
35
34
|
private resolveAirportLocation;
|
|
35
|
+
private fetchAirports;
|
|
36
36
|
private airportToLocation;
|
|
37
37
|
private pickBestLocation;
|
|
38
38
|
private toAirportDetails;
|
|
@@ -40,12 +40,14 @@ export declare class ChatbotCarHireSearchService implements ChatbotTravelHandler
|
|
|
40
40
|
private applyAirportDropoff;
|
|
41
41
|
private applyCityPickup;
|
|
42
42
|
private applyCityDropoff;
|
|
43
|
+
private plainCityName;
|
|
43
44
|
private toCityLocation;
|
|
44
45
|
private resolveCityDepots;
|
|
45
46
|
private fetchDepotsWithinRadius;
|
|
46
47
|
private resolveDepot;
|
|
47
48
|
private resolveEnterpriseDepot;
|
|
48
49
|
private fetchEnterpriseDepots;
|
|
50
|
+
private fetchDepotsFrom;
|
|
49
51
|
private toEnterpriseDepot;
|
|
50
52
|
private applyPostcodePickupAndDropoff;
|
|
51
53
|
private resolvePostcode;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
|
|
1
|
+
import { ChatSearchParameters, ChatbotTravelHandler, EnterpriseSearchServiceInterface, UserServiceInterface } from '@sabstravtech/obtservices/base';
|
|
2
2
|
import { ChatbotService } from './chatbot.service';
|
|
3
|
-
import {
|
|
4
|
-
import { UserService } from './user.service';
|
|
3
|
+
import { WithSubscriptionComponent } from '../../../components/with-component';
|
|
5
4
|
import * as i0 from "@angular/core";
|
|
6
5
|
/**
|
|
7
6
|
* Handles chatbot-driven Eurostar searches. Registered with
|
|
@@ -12,27 +11,21 @@ import * as i0 from "@angular/core";
|
|
|
12
11
|
* Once results arrive, builds `ChatEurostarResults` and patches them onto the
|
|
13
12
|
* last assistant message via {@link ChatbotService.patchAssistantMessage}.
|
|
14
13
|
*/
|
|
15
|
-
export declare class ChatbotEurostarSearchService implements ChatbotTravelHandler {
|
|
14
|
+
export declare class ChatbotEurostarSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
|
|
16
15
|
private chatbotService;
|
|
17
16
|
private searchService;
|
|
18
17
|
private userService;
|
|
19
18
|
readonly travelType: "eurostar";
|
|
20
|
-
private
|
|
21
|
-
constructor(chatbotService: ChatbotService, searchService:
|
|
19
|
+
private eurostarSearchParams;
|
|
20
|
+
constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchServiceInterface, userService: UserServiceInterface);
|
|
22
21
|
handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
|
|
23
22
|
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;
|
|
29
23
|
private subscribeToResults;
|
|
30
24
|
private extractItems;
|
|
31
25
|
private buildCard;
|
|
32
26
|
private populateEurostarParams;
|
|
33
27
|
private mapCabinClass;
|
|
34
28
|
private resolveStation;
|
|
35
|
-
private normalizeTime;
|
|
36
29
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotEurostarSearchService, never>;
|
|
37
30
|
static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotEurostarSearchService>;
|
|
38
31
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ChatSearchParameters, ChatbotTravelHandler, EnterpriseSearchServiceInterface, UserServiceInterface } from '@sabstravtech/obtservices/base';
|
|
2
|
+
import { WithSubscriptionComponent } from '../../../components/with-component';
|
|
3
|
+
import { ChatbotService } from './chatbot.service';
|
|
4
|
+
import { ResultAwareService } from './result-aware.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Handles chatbot-driven fast track searches. Registered with
|
|
8
|
+
* `ChatbotSearchDispatcherService`; not used directly.
|
|
9
|
+
*
|
|
10
|
+
* Populates the fast track search state from the chatbot's parameters and runs
|
|
11
|
+
* `startSearch()` headlessly so chatbot fast track searches work from any page.
|
|
12
|
+
* Once results arrive, builds `ChatFastTrackResultCard`s and patches them onto
|
|
13
|
+
* the last assistant message via {@link ChatbotService.patchAssistantMessage}.
|
|
14
|
+
*/
|
|
15
|
+
export declare class ChatbotFastTrackSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
|
|
16
|
+
private chatbotService;
|
|
17
|
+
private searchService;
|
|
18
|
+
private resultAwareService;
|
|
19
|
+
private userService;
|
|
20
|
+
readonly travelType: "fast-track";
|
|
21
|
+
private fastTrackSearchParams;
|
|
22
|
+
private resolvedAirport;
|
|
23
|
+
constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchServiceInterface, resultAwareService: ResultAwareService, userService: UserServiceInterface);
|
|
24
|
+
handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
|
|
25
|
+
private subscribeToFastTrackResults;
|
|
26
|
+
private buildFastTrackCards;
|
|
27
|
+
private populateFastTrackParams;
|
|
28
|
+
private resolveAirport;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotFastTrackSearchService, never>;
|
|
30
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotFastTrackSearchService>;
|
|
31
|
+
}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
|
|
1
|
+
import { ChatSearchParameters, ChatbotTravelHandler, EnterpriseSearchServiceInterface, UserServiceInterface } from '@sabstravtech/obtservices/base';
|
|
2
2
|
import { ChatbotService } from './chatbot.service';
|
|
3
|
-
import { EnterpriseSearchService } from './search.service';
|
|
4
3
|
import { ResultAwareService } from './result-aware.service';
|
|
5
|
-
import {
|
|
4
|
+
import { WithSubscriptionComponent } from '../../../components/with-component';
|
|
6
5
|
import * as i0 from "@angular/core";
|
|
7
6
|
/**
|
|
8
|
-
* Handles chatbot-driven flight searches
|
|
9
|
-
* `
|
|
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}.
|
|
7
|
+
* Handles chatbot-driven flight searches: populates flight state from chat
|
|
8
|
+
* parameters, runs `startSearch()` headlessly, and patches result cards on.
|
|
16
9
|
*/
|
|
17
|
-
export declare class ChatbotFlightSearchService implements ChatbotTravelHandler {
|
|
10
|
+
export declare class ChatbotFlightSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
|
|
18
11
|
private chatbotService;
|
|
19
12
|
private searchService;
|
|
20
13
|
private resultAwareService;
|
|
@@ -26,73 +19,54 @@ export declare class ChatbotFlightSearchService implements ChatbotTravelHandler
|
|
|
26
19
|
private static readonly NO_CARRIER_PREFERENCE;
|
|
27
20
|
/** Regional/subsidiary markers, so "KLM" doesn't resolve to "KLM Cityhopper". */
|
|
28
21
|
private static readonly CARRIER_SUBSIDIARY;
|
|
29
|
-
private resultsSubscription;
|
|
30
22
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
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.
|
|
23
|
+
* Most recent full search parameters, cached so a {@link resort} (which only
|
|
24
|
+
* carries new ranking intent) can still render card headers/dates.
|
|
35
25
|
*/
|
|
36
26
|
private lastSearchParameters;
|
|
37
|
-
|
|
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;
|
|
38
33
|
handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
|
|
39
34
|
private subscribeToFlightResults;
|
|
40
35
|
/**
|
|
41
|
-
* Re-render the chat flight cards from
|
|
42
|
-
*
|
|
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.
|
|
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).
|
|
48
38
|
*/
|
|
49
39
|
private buildAndPatchResultsFromCache;
|
|
50
40
|
/**
|
|
51
41
|
* Re-rank the results already in the flight-search session for a new user
|
|
52
|
-
* preference
|
|
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.
|
|
42
|
+
* preference WITHOUT a new backend search, then patch fresh cards on.
|
|
56
43
|
*/
|
|
57
44
|
resort(parameters: ChatSearchParameters): Promise<void>;
|
|
58
45
|
private buildFlightResults;
|
|
59
46
|
/**
|
|
60
|
-
* Builds a map keyed by an itinerary's flight-number signature to all
|
|
61
|
-
*
|
|
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.
|
|
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.
|
|
64
49
|
*/
|
|
65
50
|
private indexFaresByFlights;
|
|
51
|
+
/** Marketing carrier + flight number for a single leg, e.g. "BA123". */
|
|
52
|
+
private flightCode;
|
|
66
53
|
private flightSignature;
|
|
67
54
|
private toFareTicket;
|
|
68
55
|
/**
|
|
69
|
-
* Builds chat cards for a multi-city itinerary
|
|
70
|
-
*
|
|
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.
|
|
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.
|
|
79
58
|
*/
|
|
80
59
|
private buildMultiCityFlightResults;
|
|
81
60
|
/**
|
|
82
|
-
* Split a concatenated multi-city flight list into per-leg buckets
|
|
83
|
-
*
|
|
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).
|
|
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).
|
|
86
63
|
*/
|
|
87
64
|
private splitFlightsByLeg;
|
|
88
65
|
/** Build a `ChatFlightLeg` from the flights assigned to a single leg. */
|
|
89
66
|
private flightsToChatLeg;
|
|
90
67
|
/**
|
|
91
|
-
* Calendar days the arrival falls after departure (0 = same day, 1 = next
|
|
92
|
-
*
|
|
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.
|
|
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.
|
|
96
70
|
*/
|
|
97
71
|
private arrivalDayOffset;
|
|
98
72
|
private formatHHmm;
|
|
@@ -101,16 +75,8 @@ export declare class ChatbotFlightSearchService implements ChatbotTravelHandler
|
|
|
101
75
|
private formatDate;
|
|
102
76
|
private formatCabinLabel;
|
|
103
77
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
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).
|
|
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).
|
|
114
80
|
*/
|
|
115
81
|
private lastSearch;
|
|
116
82
|
private static readonly NEARBY_AIRPORT_KM;
|
|
@@ -118,34 +84,32 @@ export declare class ChatbotFlightSearchService implements ChatbotTravelHandler
|
|
|
118
84
|
private airportCoords;
|
|
119
85
|
/**
|
|
120
86
|
* Multi-city counterpart to `populateFlightParams`. Resolves each leg's
|
|
121
|
-
*
|
|
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.
|
|
87
|
+
* airports, builds `IMultiDestination[]`, and switches to multiCity (full reset).
|
|
125
88
|
*/
|
|
126
89
|
private populateMultiCityFlightParams;
|
|
127
90
|
/**
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
|
|
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.
|
|
131
100
|
*/
|
|
132
101
|
private applySharedFlightParams;
|
|
133
102
|
private populateFlightParams;
|
|
134
103
|
private mapCabinClass;
|
|
135
|
-
private normalizeTime;
|
|
136
104
|
private resolveAirport;
|
|
137
105
|
/**
|
|
138
|
-
* Build the de-duplicated list of carrier search terms from the
|
|
139
|
-
*
|
|
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.
|
|
106
|
+
* Build the de-duplicated list of carrier search terms from the `airlines`
|
|
107
|
+
* array (or singular airline/airlineCode), dropping sentinels + sub-2-char.
|
|
142
108
|
*/
|
|
143
109
|
private collectCarrierTerms;
|
|
144
110
|
/**
|
|
145
|
-
* Resolve
|
|
146
|
-
*
|
|
147
|
-
* exact IATA code, exact name, then non-subsidiary startsWith/contains — so
|
|
148
|
-
* "KLM" resolves to "KLM Royal Dutch Airlines" rather than "KLM Cityhopper".
|
|
111
|
+
* Resolve an airline term to a real {code, name} from searchAirlines,
|
|
112
|
+
* highest-confidence first: exact code, exact name, then non-subsidiary match.
|
|
149
113
|
*/
|
|
150
114
|
private resolveCarrier;
|
|
151
115
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotFlightSearchService, never>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
|
|
1
|
+
import { ChatSearchParameters, ChatbotTravelHandler, EnterpriseSearchServiceInterface, UserServiceInterface, HotelEnterpriseSearchInterface } from '@sabstravtech/obtservices/base';
|
|
2
2
|
import { ChatbotService } from './chatbot.service';
|
|
3
|
-
import { EnterpriseSearchService } from './search.service';
|
|
4
3
|
import { HotelAvalibilityService } from './hotel-avallibility.service';
|
|
5
4
|
import { ResultAwareService } from './result-aware.service';
|
|
6
|
-
import {
|
|
5
|
+
import { WithSubscriptionComponent } from '../../../components/with-component';
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
7
|
/**
|
|
9
8
|
* Handles chatbot-driven hotel searches. Registered with
|
|
@@ -14,24 +13,25 @@ import * as i0 from "@angular/core";
|
|
|
14
13
|
* a `ChatHotelResults` message so the chat widget can render hotel cards.
|
|
15
14
|
* Works from any page — no search form component needs to be mounted.
|
|
16
15
|
*/
|
|
17
|
-
export declare class ChatbotHotelSearchService implements ChatbotTravelHandler {
|
|
16
|
+
export declare class ChatbotHotelSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
|
|
18
17
|
private chatbotService;
|
|
19
18
|
private searchService;
|
|
20
19
|
private hotelAvalibilityService;
|
|
21
20
|
private resultAwareService;
|
|
22
21
|
private userService;
|
|
23
22
|
readonly travelType: "hotel";
|
|
24
|
-
private availabilitySubscription;
|
|
25
23
|
lastParameters: ChatSearchParameters | null;
|
|
24
|
+
hotelSearchParams: HotelEnterpriseSearchInterface;
|
|
26
25
|
markAsLoading(): void;
|
|
27
26
|
get hasHotelResults(): boolean;
|
|
28
|
-
constructor(chatbotService: ChatbotService, searchService:
|
|
27
|
+
constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchServiceInterface, hotelAvalibilityService: HotelAvalibilityService, resultAwareService: ResultAwareService, userService: UserServiceInterface);
|
|
29
28
|
handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
|
|
30
|
-
private
|
|
29
|
+
private makeAvailabilitySubjects;
|
|
30
|
+
private awaitAvailability$;
|
|
31
|
+
private buildSearchHeader;
|
|
31
32
|
private runSearch;
|
|
32
33
|
private runSearchFromOffset;
|
|
33
34
|
private buildHotelCards;
|
|
34
|
-
private injectNoResultsMessage;
|
|
35
35
|
private sortHotels;
|
|
36
36
|
private cheapestRoomTotal;
|
|
37
37
|
private populateHotelParams;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
|
|
1
|
+
import { ChatSearchParameters, ChatbotTravelHandler, EnterpriseSearchServiceInterface, UserServiceInterface } from '@sabstravtech/obtservices/base';
|
|
2
2
|
import { ChatbotService } from './chatbot.service';
|
|
3
|
-
import { EnterpriseSearchService } from './search.service';
|
|
4
3
|
import { ResultAwareService } from './result-aware.service';
|
|
5
|
-
import {
|
|
4
|
+
import { WithSubscriptionComponent } from '../../../components/with-component';
|
|
6
5
|
import * as i0 from "@angular/core";
|
|
7
6
|
/**
|
|
8
7
|
* Handles chatbot-driven lounge searches. Registered with
|
|
@@ -13,18 +12,17 @@ import * as i0 from "@angular/core";
|
|
|
13
12
|
* Once results arrive, builds `ChatLoungeResultCard`s and patches them onto
|
|
14
13
|
* the last assistant message via {@link ChatbotService.patchAssistantMessage}.
|
|
15
14
|
*/
|
|
16
|
-
export declare class ChatbotLoungeSearchService implements ChatbotTravelHandler {
|
|
15
|
+
export declare class ChatbotLoungeSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
|
|
17
16
|
private chatbotService;
|
|
18
17
|
private searchService;
|
|
19
18
|
private resultAwareService;
|
|
20
19
|
private userService;
|
|
21
20
|
readonly travelType: "lounge";
|
|
22
|
-
private
|
|
23
|
-
constructor(chatbotService: ChatbotService, searchService:
|
|
21
|
+
private loungeSearchParams;
|
|
22
|
+
constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchServiceInterface, resultAwareService: ResultAwareService, userService: UserServiceInterface);
|
|
24
23
|
handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
|
|
25
24
|
private subscribeToLoungeResults;
|
|
26
25
|
private buildLoungeCards;
|
|
27
|
-
private formatValidationMessages;
|
|
28
26
|
private populateLoungeParams;
|
|
29
27
|
private resolveAirport;
|
|
30
28
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotLoungeSearchService, never>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ChatSearchParameters, ChatbotTravelHandler, EnterpriseSearchServiceInterface, UserServiceInterface } from '@sabstravtech/obtservices/base';
|
|
2
|
+
import { ChatbotService } from './chatbot.service';
|
|
3
|
+
import { ResultAwareService } from './result-aware.service';
|
|
4
|
+
import { WithSubscriptionComponent } from '../../../components/with-component';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class ChatbotParkingSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
|
|
7
|
+
private chatbotService;
|
|
8
|
+
private searchService;
|
|
9
|
+
private resultAwareService;
|
|
10
|
+
private userService;
|
|
11
|
+
readonly travelType: "parking";
|
|
12
|
+
private parkingSearchParams;
|
|
13
|
+
private resultsSubscription;
|
|
14
|
+
constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchServiceInterface, resultAwareService: ResultAwareService, userService: UserServiceInterface);
|
|
15
|
+
handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
|
|
16
|
+
private subscribeToParkingResults;
|
|
17
|
+
private buildParkingCards;
|
|
18
|
+
private populateParkingParams;
|
|
19
|
+
private combineDateTime;
|
|
20
|
+
private resolveAirport;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotParkingSearchService, never>;
|
|
22
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotParkingSearchService>;
|
|
23
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
|
|
1
|
+
import { ChatSearchParameters, ChatbotTravelHandler, EnterpriseSearchServiceInterface, UserServiceInterface } from '@sabstravtech/obtservices/base';
|
|
2
2
|
import { ChatbotService } from './chatbot.service';
|
|
3
|
-
import { EnterpriseSearchService } from './search.service';
|
|
4
3
|
import { ResultAwareService } from './result-aware.service';
|
|
5
|
-
import {
|
|
4
|
+
import { WithSubscriptionComponent } from '../../../components/with-component';
|
|
6
5
|
import * as i0 from "@angular/core";
|
|
7
6
|
/**
|
|
8
7
|
* Handles chatbot-driven rail searches. Registered with
|
|
@@ -14,20 +13,15 @@ import * as i0 from "@angular/core";
|
|
|
14
13
|
* `ChatRailResultCard`s and patches them onto the last assistant message
|
|
15
14
|
* via {@link ChatbotService.patchAssistantMessage}.
|
|
16
15
|
*/
|
|
17
|
-
export declare class ChatbotRailSearchService implements ChatbotTravelHandler {
|
|
16
|
+
export declare class ChatbotRailSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
|
|
18
17
|
private chatbotService;
|
|
19
18
|
private searchService;
|
|
20
19
|
private resultAwareService;
|
|
21
20
|
private userService;
|
|
22
21
|
readonly travelType: "rail";
|
|
23
|
-
private
|
|
24
|
-
constructor(chatbotService: ChatbotService, searchService:
|
|
22
|
+
private railSearchParams;
|
|
23
|
+
constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchServiceInterface, resultAwareService: ResultAwareService, userService: UserServiceInterface);
|
|
25
24
|
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;
|
|
31
25
|
/**
|
|
32
26
|
* Subscribe to ResultAwareService for the next rail result emission, build
|
|
33
27
|
* the top-N cards per leg, then patch the last assistant message so the
|
|
@@ -36,10 +30,11 @@ export declare class ChatbotRailSearchService implements ChatbotTravelHandler {
|
|
|
36
30
|
private subscribeToRailResults;
|
|
37
31
|
private buildRailResults;
|
|
38
32
|
private buildInboundCards;
|
|
33
|
+
/** Keep the first entry for each distinct `index`, preserving order. */
|
|
34
|
+
private dedupeByIndex;
|
|
39
35
|
private toRailCard;
|
|
40
36
|
private formatDate;
|
|
41
37
|
private populateRailParams;
|
|
42
|
-
private normalizeTime;
|
|
43
38
|
private preferRailStation;
|
|
44
39
|
private resolveRailStation;
|
|
45
40
|
private lookupRailStations;
|
|
@@ -4,6 +4,8 @@ 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';
|
|
7
9
|
import { ChatbotCarHireSearchService } from './chatbot-car-hire-search.service';
|
|
8
10
|
import { ChatbotTaxiSearchService } from './chatbot-taxi-search.service';
|
|
9
11
|
import { ChatbotService } from './chatbot.service';
|
|
@@ -24,9 +26,11 @@ export declare class ChatbotSearchDispatcherService {
|
|
|
24
26
|
private chatbotService;
|
|
25
27
|
private initialised;
|
|
26
28
|
private readonly handlers;
|
|
27
|
-
constructor(chatbotService: ChatbotService, rail: ChatbotRailSearchService, flight: ChatbotFlightSearchService, hotel: ChatbotHotelSearchService, carHire: ChatbotCarHireSearchService, eurostar: ChatbotEurostarSearchService, lounge: ChatbotLoungeSearchService, taxi: ChatbotTaxiSearchService);
|
|
29
|
+
constructor(chatbotService: ChatbotService, rail: ChatbotRailSearchService, flight: ChatbotFlightSearchService, hotel: ChatbotHotelSearchService, carHire: ChatbotCarHireSearchService, eurostar: ChatbotEurostarSearchService, lounge: ChatbotLoungeSearchService, fastTrack: ChatbotFastTrackSearchService, parking: ChatbotParkingSearchService, taxi: ChatbotTaxiSearchService);
|
|
28
30
|
/** Call once at app start. Idempotent. */
|
|
29
31
|
init(): void;
|
|
32
|
+
/** Run a handler promise, logging any rejection without breaking the stream. */
|
|
33
|
+
private run;
|
|
30
34
|
/**
|
|
31
35
|
* Whether a global handler is registered for the given travel type. Used by
|
|
32
36
|
* search forms to know which travel types they should skip (avoiding
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ChatbotService } from './chatbot.service';
|
|
2
|
+
import type { ServiceType } from '../types/graphql.angular.types';
|
|
3
|
+
import type { EnterpriseSearchServiceInterface, UserServiceInterface } from '@sabstravtech/obtservices/base';
|
|
4
|
+
/**
|
|
5
|
+
* Render OBT's validationMessages array as a chatbot reply. Single message →
|
|
6
|
+
* inline sentence; multiple → bullet list so each issue reads clearly.
|
|
7
|
+
*
|
|
8
|
+
* @param context - describes the search being run, e.g. `'that search'` or
|
|
9
|
+
* `'that Eurostar search'`. Defaults to `'that search'`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatValidationMessages(messages: string[], context?: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Parse a loosely-formatted human time ("9am", "9:30 pm", "09:30") into 24h
|
|
14
|
+
* "HHmm". Falls back to the input with any ":" stripped when it can't parse.
|
|
15
|
+
*/
|
|
16
|
+
export declare function normalizeTime(time: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Patch the current assistant message with `text` and mark searching complete.
|
|
19
|
+
*/
|
|
20
|
+
export declare function showMessage(chatbotService: ChatbotService, text: string): void;
|
|
21
|
+
/**
|
|
22
|
+
* Reset any prior search selection and make `serviceType` the sole chosen
|
|
23
|
+
* search, then recompute the highest search priority. Every chatbot travel
|
|
24
|
+
* handler runs this before populating its form.
|
|
25
|
+
*/
|
|
26
|
+
export declare function selectSearchServiceType(searchService: EnterpriseSearchServiceInterface, serviceType: ServiceType): void;
|
|
27
|
+
/**
|
|
28
|
+
* Ensure the search has at least one traveller by adding the current user when
|
|
29
|
+
* none are present.
|
|
30
|
+
*/
|
|
31
|
+
export declare function ensureSelfTraveller(searchService: EnterpriseSearchServiceInterface, userService: UserServiceInterface): void;
|
|
32
|
+
/**
|
|
33
|
+
* Inject an assistant "no results" message for the given travel type.
|
|
34
|
+
*/
|
|
35
|
+
export declare function injectNoResultsMessage(chatbotService: ChatbotService, travelType: string, text: string): void;
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
|
|
2
|
+
import { WithSubscriptionComponent } from '../../../components/with-component';
|
|
2
3
|
import { ChatbotService } from './chatbot.service';
|
|
3
4
|
import { EnterpriseSearchService } from './search.service';
|
|
4
5
|
import { ResultAwareService } from './result-aware.service';
|
|
6
|
+
import { UserService } from './user.service';
|
|
5
7
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class ChatbotTaxiSearchService implements ChatbotTravelHandler {
|
|
8
|
+
export declare class ChatbotTaxiSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
|
|
7
9
|
private chatbotService;
|
|
8
10
|
private searchService;
|
|
9
11
|
private resultAwareService;
|
|
12
|
+
private userService;
|
|
10
13
|
readonly travelType: "taxi";
|
|
11
|
-
|
|
14
|
+
private taxiSearchParams;
|
|
15
|
+
chatbotFilterId: string | null;
|
|
16
|
+
lastParameters: ChatSearchParameters | null;
|
|
17
|
+
get hasTaxiResults(): boolean;
|
|
18
|
+
markAsLoading(): void;
|
|
19
|
+
constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, resultAwareService: ResultAwareService, userService: UserService);
|
|
12
20
|
handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
|
|
13
21
|
private runSearch;
|
|
14
22
|
private buildTaxiCards;
|
|
15
|
-
private injectNoResultsMessage;
|
|
16
23
|
private populateTaxiParams;
|
|
24
|
+
private prepareAddress;
|
|
25
|
+
private searchAndResolveGeoLocation;
|
|
26
|
+
private locationDataToResolved;
|
|
17
27
|
private resolveGeoLocation;
|
|
18
28
|
private matchTerminal;
|
|
19
29
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotTaxiSearchService, never>;
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { Router } from '@angular/router';
|
|
2
3
|
import { Subject } from 'rxjs';
|
|
4
|
+
import { BaseChatbotService, BotFaq, ChatFeedbackAck, ChatMessage, ChatSearchParameters, ChatTokenEvent, ChatToolEvent, ChatWsResponse, CondensedResult, UserCapabilities, IRiskFlag } from '@sabstravtech/obtservices/base';
|
|
3
5
|
import { WebTokenService } from '../services/webtoken.service';
|
|
4
6
|
import { Environment } from '../classes/environment';
|
|
5
|
-
import { BaseChatbotService, BotFaq, ChatFeedbackAck, ChatMessage, ChatSearchParameters, ChatTokenEvent, ChatToolEvent, ChatWsResponse, CondensedResult, UserCapabilities, IRiskFlag } from '@sabstravtech/obtservices/base';
|
|
6
7
|
import { ResultAwareService } from './result-aware.service';
|
|
7
8
|
import { UserService } from './user.service';
|
|
9
|
+
import { EnterpriseBasketService } from './enterprise-basket.service';
|
|
10
|
+
import { EnterpriseSearchService } from './search.service';
|
|
8
11
|
import * as i0 from "@angular/core";
|
|
9
12
|
export declare class ChatbotService extends BaseChatbotService implements OnDestroy {
|
|
10
13
|
private webTokenService;
|
|
11
14
|
private resultAwareService;
|
|
12
15
|
private environment;
|
|
13
16
|
private userService;
|
|
17
|
+
private basketService;
|
|
18
|
+
private searchService;
|
|
19
|
+
private router;
|
|
14
20
|
private messagesSubject;
|
|
15
21
|
messages$: import("rxjs").Observable<ChatMessage[]>;
|
|
16
22
|
private loadingSubject;
|
|
@@ -46,7 +52,7 @@ export declare class ChatbotService extends BaseChatbotService implements OnDest
|
|
|
46
52
|
/** Tracks the user ID that owns the current chat session, to detect user switches. */
|
|
47
53
|
private sessionOwnerId;
|
|
48
54
|
private userChangeSubscription;
|
|
49
|
-
constructor(webTokenService: WebTokenService, resultAwareService: ResultAwareService, environment: Environment, userService: UserService);
|
|
55
|
+
constructor(webTokenService: WebTokenService, resultAwareService: ResultAwareService, environment: Environment, userService: UserService, basketService: EnterpriseBasketService, searchService: EnterpriseSearchService, router: Router);
|
|
50
56
|
ngOnDestroy(): void;
|
|
51
57
|
protected getRequestUrl(): string | null;
|
|
52
58
|
protected getAuthToken(): string | null;
|
|
@@ -72,6 +78,10 @@ export declare class ChatbotService extends BaseChatbotService implements OnDest
|
|
|
72
78
|
*/
|
|
73
79
|
private resolveAllowedFlightCabins;
|
|
74
80
|
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>;
|
|
75
85
|
/** Set by ChatbotCarHireSearchService when the user is choosing from a depot list. */
|
|
76
86
|
depotSelectionHandler: ((text: string) => Promise<boolean>) | null;
|
|
77
87
|
connect(): void;
|