@sabstravtech/obtservices 0.2.2606171720 → 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 +22 -6
- 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 +57 -65
- package/angular/lib/vendor/services/chatbot-hotel-search.service.d.ts +10 -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 +20 -2
- package/angular/lib/vendor/services/result-aware.service.d.ts +20 -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 +132 -16
- package/base/lib/vendor/services/chatbot.service.d.ts +28 -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 +2241 -1479
- package/fesm2022/sabstravtech-obtservices-angular.mjs.map +1 -1
- package/fesm2022/sabstravtech-obtservices-base.mjs +103 -7
- 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,7 +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';
|
|
4
|
+
import { WithSubscriptionComponent } from '../../../components/with-component';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
/**
|
|
7
7
|
* Handles chatbot-driven car hire searches. Registered with
|
|
@@ -11,21 +11,28 @@ import * as i0 from "@angular/core";
|
|
|
11
11
|
* search headlessly, then injects a `ChatCarHireResults` message so the chat
|
|
12
12
|
* widget can render car hire cards.
|
|
13
13
|
*/
|
|
14
|
-
export declare class ChatbotCarHireSearchService implements ChatbotTravelHandler {
|
|
14
|
+
export declare class ChatbotCarHireSearchService extends WithSubscriptionComponent implements ChatbotTravelHandler {
|
|
15
15
|
private chatbotService;
|
|
16
16
|
private searchService;
|
|
17
17
|
private resultAwareService;
|
|
18
|
+
private userService;
|
|
18
19
|
readonly travelType: "car-hire";
|
|
19
|
-
|
|
20
|
+
private pendingDepotChoice;
|
|
21
|
+
private carHireSearchParams;
|
|
22
|
+
constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchServiceInterface, resultAwareService: ResultAwareService, userService: UserServiceInterface);
|
|
20
23
|
handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
|
|
21
24
|
private runSearch;
|
|
22
25
|
private buildCarHireCards;
|
|
23
26
|
private calculateDays;
|
|
24
|
-
private
|
|
27
|
+
private toDepotChoice;
|
|
28
|
+
private injectLocationHelpMessage;
|
|
29
|
+
private handleDepotSelectionReply;
|
|
25
30
|
private populateCarHireParams;
|
|
26
31
|
private prefersAirport;
|
|
32
|
+
private resolveVendorCode;
|
|
27
33
|
private resolveLocation;
|
|
28
34
|
private resolveAirportLocation;
|
|
35
|
+
private fetchAirports;
|
|
29
36
|
private airportToLocation;
|
|
30
37
|
private pickBestLocation;
|
|
31
38
|
private toAirportDetails;
|
|
@@ -33,8 +40,17 @@ export declare class ChatbotCarHireSearchService implements ChatbotTravelHandler
|
|
|
33
40
|
private applyAirportDropoff;
|
|
34
41
|
private applyCityPickup;
|
|
35
42
|
private applyCityDropoff;
|
|
43
|
+
private plainCityName;
|
|
36
44
|
private toCityLocation;
|
|
37
|
-
private
|
|
45
|
+
private resolveCityDepots;
|
|
46
|
+
private fetchDepotsWithinRadius;
|
|
47
|
+
private resolveDepot;
|
|
48
|
+
private resolveEnterpriseDepot;
|
|
49
|
+
private fetchEnterpriseDepots;
|
|
50
|
+
private fetchDepotsFrom;
|
|
51
|
+
private toEnterpriseDepot;
|
|
52
|
+
private applyPostcodePickupAndDropoff;
|
|
53
|
+
private resolvePostcode;
|
|
38
54
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotCarHireSearchService, never>;
|
|
39
55
|
static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotCarHireSearchService>;
|
|
40
56
|
}
|
|
@@ -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,102 +1,82 @@
|
|
|
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;
|
|
21
14
|
private userService;
|
|
22
15
|
readonly travelType: "flight";
|
|
23
|
-
|
|
16
|
+
/** The flight form exposes four preferred-carrier slots. */
|
|
17
|
+
private static readonly MAX_PREFERRED_CARRIERS;
|
|
18
|
+
/** Terms that mean "no airline preference" and should be ignored. */
|
|
19
|
+
private static readonly NO_CARRIER_PREFERENCE;
|
|
20
|
+
/** Regional/subsidiary markers, so "KLM" doesn't resolve to "KLM Cityhopper". */
|
|
21
|
+
private static readonly CARRIER_SUBSIDIARY;
|
|
24
22
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* only the new ranking intent (sortType / time target) — can still render
|
|
28
|
-
* 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.
|
|
29
25
|
*/
|
|
30
26
|
private lastSearchParameters;
|
|
31
|
-
|
|
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;
|
|
32
33
|
handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
|
|
33
34
|
private subscribeToFlightResults;
|
|
34
35
|
/**
|
|
35
|
-
* Re-render the chat flight cards from
|
|
36
|
-
*
|
|
37
|
-
* Used both by the post-search subscription and by {@link resort} (which
|
|
38
|
-
* re-ranks without a new backend search). Reads `results.value` (falling
|
|
39
|
-
* back to the unfiltered `fullResults`), re-extracts the journeys, and builds
|
|
40
|
-
* cards using `parameters` (sort/time/airline/stops) so the same data can be
|
|
41
|
-
* 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).
|
|
42
38
|
*/
|
|
43
39
|
private buildAndPatchResultsFromCache;
|
|
44
40
|
/**
|
|
45
41
|
* Re-rank the results already in the flight-search session for a new user
|
|
46
|
-
* preference
|
|
47
|
-
* running a new backend search. The cached itineraries are the same set the
|
|
48
|
-
* results page shows; we just re-order them via `buildFlightResults` and
|
|
49
|
-
* patch fresh cards onto the latest assistant message.
|
|
42
|
+
* preference WITHOUT a new backend search, then patch fresh cards on.
|
|
50
43
|
*/
|
|
51
44
|
resort(parameters: ChatSearchParameters): Promise<void>;
|
|
52
45
|
private buildFlightResults;
|
|
53
46
|
/**
|
|
54
|
-
* Builds a map keyed by an itinerary's flight-number signature to all
|
|
55
|
-
*
|
|
56
|
-
* For combined-return journeys the key includes both outbound + inbound
|
|
57
|
-
* 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.
|
|
58
49
|
*/
|
|
59
50
|
private indexFaresByFlights;
|
|
51
|
+
/** Marketing carrier + flight number for a single leg, e.g. "BA123". */
|
|
52
|
+
private flightCode;
|
|
60
53
|
private flightSignature;
|
|
61
54
|
private toFareTicket;
|
|
62
55
|
/**
|
|
63
|
-
* Builds chat cards for a multi-city itinerary
|
|
64
|
-
*
|
|
65
|
-
* pairing the i-th cheapest option from every leg into a single "stacked"
|
|
66
|
-
* card. This is naive (it doesn't try every combinatorial combination) but
|
|
67
|
-
* gives the user a useful headline view; View Full Results owns the proper
|
|
68
|
-
* fare-combination picker.
|
|
69
|
-
*
|
|
70
|
-
* OBT returns multi-city itineraries as a single `bundle.journeys[]` where
|
|
71
|
-
* each entry has all legs concatenated in `outboundFlights[]`. We split each
|
|
72
|
-
* 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.
|
|
73
58
|
*/
|
|
74
59
|
private buildMultiCityFlightResults;
|
|
75
60
|
/**
|
|
76
|
-
* Split a concatenated multi-city flight list into per-leg buckets
|
|
77
|
-
*
|
|
78
|
-
* latest leg whose date is on or before the flight (covers overnight
|
|
79
|
-
* 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).
|
|
80
63
|
*/
|
|
81
64
|
private splitFlightsByLeg;
|
|
82
65
|
/** Build a `ChatFlightLeg` from the flights assigned to a single leg. */
|
|
83
66
|
private flightsToChatLeg;
|
|
67
|
+
/**
|
|
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.
|
|
70
|
+
*/
|
|
71
|
+
private arrivalDayOffset;
|
|
84
72
|
private formatHHmm;
|
|
85
73
|
private formatDuration;
|
|
86
74
|
private toFlightCard;
|
|
87
75
|
private formatDate;
|
|
88
76
|
private formatCabinLabel;
|
|
89
77
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*/
|
|
93
|
-
private formatValidationMessages;
|
|
94
|
-
/**
|
|
95
|
-
* Tracks the last chatbot flight search's resolved airports so we can decide
|
|
96
|
-
* whether a follow-up turn is a "refinement of the same journey" (e.g. swap
|
|
97
|
-
* MAN → AMS for LPL → AMS — same metro, user is just nudging a parameter)
|
|
98
|
-
* or a "fresh search" (e.g. MAN → AMS to BER → ATH — clearly unrelated, so
|
|
99
|
-
* 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).
|
|
100
80
|
*/
|
|
101
81
|
private lastSearch;
|
|
102
82
|
private static readonly NEARBY_AIRPORT_KM;
|
|
@@ -104,22 +84,34 @@ export declare class ChatbotFlightSearchService implements ChatbotTravelHandler
|
|
|
104
84
|
private airportCoords;
|
|
105
85
|
/**
|
|
106
86
|
* Multi-city counterpart to `populateFlightParams`. Resolves each leg's
|
|
107
|
-
*
|
|
108
|
-
* flight search expects, and switches `chosenSearchType` to multiCity.
|
|
109
|
-
* Same-journey detection is skipped (the user is describing a fundamentally
|
|
110
|
-
* new itinerary), so we always do a full reset.
|
|
87
|
+
* airports, builds `IMultiDestination[]`, and switches to multiCity (full reset).
|
|
111
88
|
*/
|
|
112
89
|
private populateMultiCityFlightParams;
|
|
113
90
|
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
|
|
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.
|
|
117
100
|
*/
|
|
118
101
|
private applySharedFlightParams;
|
|
119
102
|
private populateFlightParams;
|
|
120
103
|
private mapCabinClass;
|
|
121
|
-
private normalizeTime;
|
|
122
104
|
private resolveAirport;
|
|
105
|
+
/**
|
|
106
|
+
* Build the de-duplicated list of carrier search terms from the `airlines`
|
|
107
|
+
* array (or singular airline/airlineCode), dropping sentinels + sub-2-char.
|
|
108
|
+
*/
|
|
109
|
+
private collectCarrierTerms;
|
|
110
|
+
/**
|
|
111
|
+
* Resolve an airline term to a real {code, name} from searchAirlines,
|
|
112
|
+
* highest-confidence first: exact code, exact name, then non-subsidiary match.
|
|
113
|
+
*/
|
|
114
|
+
private resolveCarrier;
|
|
123
115
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotFlightSearchService, never>;
|
|
124
116
|
static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotFlightSearchService>;
|
|
125
117
|
}
|
|
@@ -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,27 @@ 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;
|
|
25
|
+
markAsLoading(): void;
|
|
26
26
|
get hasHotelResults(): boolean;
|
|
27
|
-
constructor(chatbotService: ChatbotService, searchService:
|
|
27
|
+
constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchServiceInterface, hotelAvalibilityService: HotelAvalibilityService, resultAwareService: ResultAwareService, userService: UserServiceInterface);
|
|
28
28
|
handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
|
|
29
|
-
private
|
|
29
|
+
private makeAvailabilitySubjects;
|
|
30
|
+
private awaitAvailability$;
|
|
31
|
+
private buildSearchHeader;
|
|
30
32
|
private runSearch;
|
|
31
33
|
private runSearchFromOffset;
|
|
32
34
|
private buildHotelCards;
|
|
33
|
-
private injectNoResultsMessage;
|
|
34
35
|
private sortHotels;
|
|
36
|
+
private cheapestRoomTotal;
|
|
35
37
|
private populateHotelParams;
|
|
36
38
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotHotelSearchService, never>;
|
|
37
39
|
static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotHotelSearchService>;
|
|
@@ -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>;
|