@sabstravtech/obtservices 0.2.2605201100 → 0.2.2606091200
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/lib/vendor/services/chatbot-eurostar-search.service.d.ts +38 -0
- package/angular/lib/vendor/services/chatbot-flight-search.service.d.ts +100 -0
- package/angular/lib/vendor/services/chatbot-hotel-search.service.d.ts +32 -0
- package/angular/lib/vendor/services/chatbot-rail-search.service.d.ts +53 -0
- package/angular/lib/vendor/services/chatbot-search-dispatcher.service.d.ts +36 -0
- package/angular/lib/vendor/services/chatbot.service.d.ts +72 -0
- package/angular/lib/vendor/services/result-aware.service.d.ts +68 -0
- package/angular/lib/vendor/types/graphql.angular.types.d.ts +12 -0
- package/angular/services.d.ts +7 -0
- package/base/interfaces.d.ts +2 -0
- package/base/lib/vendor/interfaces/chatbot.types.d.ts +438 -0
- package/base/lib/vendor/services/chatbot.service.d.ts +145 -0
- package/base/lib/vendor/types/graphql.types.d.ts +12 -0
- package/base/services.d.ts +1 -0
- package/fesm2022/sabstravtech-obtservices-angular.mjs +2903 -4
- package/fesm2022/sabstravtech-obtservices-angular.mjs.map +1 -1
- package/fesm2022/sabstravtech-obtservices-base.mjs +356 -7
- package/fesm2022/sabstravtech-obtservices-base.mjs.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
|
|
2
|
+
import { ChatbotService } from './chatbot.service';
|
|
3
|
+
import { EnterpriseSearchService } from './search.service';
|
|
4
|
+
import { UserService } from './user.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Handles chatbot-driven Eurostar searches. Registered with
|
|
8
|
+
* `ChatbotSearchDispatcherService`; not used directly.
|
|
9
|
+
*
|
|
10
|
+
* Populates the Eurostar search state from the chatbot's parameters and, when
|
|
11
|
+
* `autoSearch` is true, runs the search headlessly so it works from any page.
|
|
12
|
+
* Once results arrive, builds `ChatEurostarResults` and patches them onto the
|
|
13
|
+
* last assistant message via {@link ChatbotService.patchAssistantMessage}.
|
|
14
|
+
*/
|
|
15
|
+
export declare class ChatbotEurostarSearchService implements ChatbotTravelHandler {
|
|
16
|
+
private chatbotService;
|
|
17
|
+
private searchService;
|
|
18
|
+
private userService;
|
|
19
|
+
readonly travelType: "eurostar";
|
|
20
|
+
private resultsSubscription;
|
|
21
|
+
constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, userService: UserService);
|
|
22
|
+
handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
|
|
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;
|
|
29
|
+
private subscribeToResults;
|
|
30
|
+
private extractItems;
|
|
31
|
+
private buildCard;
|
|
32
|
+
private populateEurostarParams;
|
|
33
|
+
private mapCabinClass;
|
|
34
|
+
private resolveStation;
|
|
35
|
+
private normalizeTime;
|
|
36
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotEurostarSearchService, never>;
|
|
37
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotEurostarSearchService>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
|
|
2
|
+
import { ChatbotService } from './chatbot.service';
|
|
3
|
+
import { EnterpriseSearchService } from './search.service';
|
|
4
|
+
import { ResultAwareService } from './result-aware.service';
|
|
5
|
+
import { UserService } from './user.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
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}.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ChatbotFlightSearchService implements ChatbotTravelHandler {
|
|
18
|
+
private chatbotService;
|
|
19
|
+
private searchService;
|
|
20
|
+
private resultAwareService;
|
|
21
|
+
private userService;
|
|
22
|
+
readonly travelType: "flight";
|
|
23
|
+
private resultsSubscription;
|
|
24
|
+
constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, resultAwareService: ResultAwareService, userService: UserService);
|
|
25
|
+
handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
|
|
26
|
+
private subscribeToFlightResults;
|
|
27
|
+
private buildFlightResults;
|
|
28
|
+
/**
|
|
29
|
+
* Builds a map keyed by an itinerary's flight-number signature to all
|
|
30
|
+
* bookable fare variants (cabin/brand/price) for the same physical flights.
|
|
31
|
+
* For combined-return journeys the key includes both outbound + inbound
|
|
32
|
+
* flight numbers; for dual-single legs it's just that leg's numbers.
|
|
33
|
+
*/
|
|
34
|
+
private indexFaresByFlights;
|
|
35
|
+
private flightSignature;
|
|
36
|
+
private toFareTicket;
|
|
37
|
+
/**
|
|
38
|
+
* Builds chat cards for a multi-city itinerary. OBT returns one bundle per
|
|
39
|
+
* search with per-leg result arrays; we surface the top N itineraries by
|
|
40
|
+
* pairing the i-th cheapest option from every leg into a single "stacked"
|
|
41
|
+
* card. This is naive (it doesn't try every combinatorial combination) but
|
|
42
|
+
* gives the user a useful headline view; View Full Results owns the proper
|
|
43
|
+
* fare-combination picker.
|
|
44
|
+
*
|
|
45
|
+
* OBT returns multi-city itineraries as a single `bundle.journeys[]` where
|
|
46
|
+
* each entry has all legs concatenated in `outboundFlights[]`. We split each
|
|
47
|
+
* itinerary by leg-date to produce N `ChatFlightLeg`s per card.
|
|
48
|
+
*/
|
|
49
|
+
private buildMultiCityFlightResults;
|
|
50
|
+
/**
|
|
51
|
+
* Split a concatenated multi-city flight list into per-leg buckets. Primary
|
|
52
|
+
* key is the flight's depart date matching a leg date; falls back to the
|
|
53
|
+
* latest leg whose date is on or before the flight (covers overnight
|
|
54
|
+
* connections that depart the day before the next leg's planned date).
|
|
55
|
+
*/
|
|
56
|
+
private splitFlightsByLeg;
|
|
57
|
+
/** Build a `ChatFlightLeg` from the flights assigned to a single leg. */
|
|
58
|
+
private flightsToChatLeg;
|
|
59
|
+
private formatHHmm;
|
|
60
|
+
private formatDuration;
|
|
61
|
+
private toFlightCard;
|
|
62
|
+
private formatDate;
|
|
63
|
+
private formatCabinLabel;
|
|
64
|
+
/**
|
|
65
|
+
* Render OBT's validationMessages array as a chatbot reply. Single message →
|
|
66
|
+
* inline sentence; multiple → bullet list so each issue reads clearly.
|
|
67
|
+
*/
|
|
68
|
+
private formatValidationMessages;
|
|
69
|
+
/**
|
|
70
|
+
* Tracks the last chatbot flight search's resolved airports so we can decide
|
|
71
|
+
* whether a follow-up turn is a "refinement of the same journey" (e.g. swap
|
|
72
|
+
* MAN → AMS for LPL → AMS — same metro, user is just nudging a parameter)
|
|
73
|
+
* or a "fresh search" (e.g. MAN → AMS to BER → ATH — clearly unrelated, so
|
|
74
|
+
* any sticky options like "direct only" should be cleared).
|
|
75
|
+
*/
|
|
76
|
+
private lastSearch;
|
|
77
|
+
private static readonly NEARBY_AIRPORT_KM;
|
|
78
|
+
private static distanceKm;
|
|
79
|
+
private airportCoords;
|
|
80
|
+
/**
|
|
81
|
+
* Multi-city counterpart to `populateFlightParams`. Resolves each leg's
|
|
82
|
+
* origin/destination airports, builds the `IMultiDestination[]` shape the
|
|
83
|
+
* flight search expects, and switches `chosenSearchType` to multiCity.
|
|
84
|
+
* Same-journey detection is skipped (the user is describing a fundamentally
|
|
85
|
+
* new itinerary), so we always do a full reset.
|
|
86
|
+
*/
|
|
87
|
+
private populateMultiCityFlightParams;
|
|
88
|
+
/**
|
|
89
|
+
* Apply the subset of `populateFlightParams` that is leg-agnostic (cabin
|
|
90
|
+
* class, passenger breakdown, sort, refundable flag). Shared between
|
|
91
|
+
* single/return and multi-city paths.
|
|
92
|
+
*/
|
|
93
|
+
private applySharedFlightParams;
|
|
94
|
+
private populateFlightParams;
|
|
95
|
+
private mapCabinClass;
|
|
96
|
+
private normalizeTime;
|
|
97
|
+
private resolveAirport;
|
|
98
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotFlightSearchService, never>;
|
|
99
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotFlightSearchService>;
|
|
100
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
|
|
2
|
+
import { ChatbotService } from './chatbot.service';
|
|
3
|
+
import { EnterpriseSearchService } from './search.service';
|
|
4
|
+
import { HotelAvalibilityService } from './hotel-avallibility.service';
|
|
5
|
+
import { ResultAwareService } from './result-aware.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Handles chatbot-driven hotel searches. Registered with
|
|
9
|
+
* `ChatbotSearchDispatcherService`; not used directly.
|
|
10
|
+
*
|
|
11
|
+
* Populates the hotel search state from the chatbot's parameters, runs the
|
|
12
|
+
* search headlessly, polls availability for the top candidates, then injects
|
|
13
|
+
* a `ChatHotelResults` message so the chat widget can render hotel cards.
|
|
14
|
+
* Works from any page — no search form component needs to be mounted.
|
|
15
|
+
*/
|
|
16
|
+
export declare class ChatbotHotelSearchService implements ChatbotTravelHandler {
|
|
17
|
+
private chatbotService;
|
|
18
|
+
private searchService;
|
|
19
|
+
private hotelAvalibilityService;
|
|
20
|
+
private resultAwareService;
|
|
21
|
+
readonly travelType: "hotel";
|
|
22
|
+
private availabilitySubscription;
|
|
23
|
+
constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, hotelAvalibilityService: HotelAvalibilityService, resultAwareService: ResultAwareService);
|
|
24
|
+
handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
|
|
25
|
+
private runSearch;
|
|
26
|
+
private buildHotelCards;
|
|
27
|
+
private injectNoResultsMessage;
|
|
28
|
+
private sortHotels;
|
|
29
|
+
private populateHotelParams;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotHotelSearchService, never>;
|
|
31
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotHotelSearchService>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ChatSearchParameters, ChatbotTravelHandler } from '@sabstravtech/obtservices/base';
|
|
2
|
+
import { ChatbotService } from './chatbot.service';
|
|
3
|
+
import { EnterpriseSearchService } from './search.service';
|
|
4
|
+
import { ResultAwareService } from './result-aware.service';
|
|
5
|
+
import { UserService } from './user.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Handles chatbot-driven rail searches. Registered with
|
|
9
|
+
* `ChatbotSearchDispatcherService`; not used directly.
|
|
10
|
+
*
|
|
11
|
+
* Populates the rail search state from the chatbot's parameters (same state
|
|
12
|
+
* the search form binds to via ngModel) and runs `startSearch()` headlessly
|
|
13
|
+
* so chatbot rail searches work from any page. Once results arrive, builds
|
|
14
|
+
* `ChatRailResultCard`s and patches them onto the last assistant message
|
|
15
|
+
* via {@link ChatbotService.patchAssistantMessage}.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ChatbotRailSearchService implements ChatbotTravelHandler {
|
|
18
|
+
private chatbotService;
|
|
19
|
+
private searchService;
|
|
20
|
+
private resultAwareService;
|
|
21
|
+
private userService;
|
|
22
|
+
readonly travelType: "rail";
|
|
23
|
+
private resultsSubscription;
|
|
24
|
+
constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, resultAwareService: ResultAwareService, userService: UserService);
|
|
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;
|
|
31
|
+
/**
|
|
32
|
+
* Subscribe to ResultAwareService for the next rail result emission, build
|
|
33
|
+
* the top-N cards per leg, then patch the last assistant message so the
|
|
34
|
+
* chat widget can render them.
|
|
35
|
+
*/
|
|
36
|
+
private subscribeToRailResults;
|
|
37
|
+
private buildRailResults;
|
|
38
|
+
private buildInboundCards;
|
|
39
|
+
private toRailCard;
|
|
40
|
+
private formatDate;
|
|
41
|
+
private populateRailParams;
|
|
42
|
+
private normalizeTime;
|
|
43
|
+
private preferRailStation;
|
|
44
|
+
private resolveRailStation;
|
|
45
|
+
private lookupRailStations;
|
|
46
|
+
/**
|
|
47
|
+
* Generate progressively-cleaner name variants for rail station lookup.
|
|
48
|
+
* e.g. "Manchester (all stations)" → ["Manchester (all stations)", "Manchester", "Manchester all stations"]
|
|
49
|
+
*/
|
|
50
|
+
private buildRailStationNameCandidates;
|
|
51
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotRailSearchService, never>;
|
|
52
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotRailSearchService>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ChatSearchParameters } from '@sabstravtech/obtservices/base';
|
|
2
|
+
import { ChatbotEurostarSearchService } from './chatbot-eurostar-search.service';
|
|
3
|
+
import { ChatbotFlightSearchService } from './chatbot-flight-search.service';
|
|
4
|
+
import { ChatbotRailSearchService } from './chatbot-rail-search.service';
|
|
5
|
+
import { ChatbotHotelSearchService } from './chatbot-hotel-search.service';
|
|
6
|
+
import { ChatbotService } from './chatbot.service';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* Routes `ChatbotService.fillSearchForm$` events to per-travel-type handlers.
|
|
10
|
+
*
|
|
11
|
+
* **To add a new travel type (hotel / eurostar / taxi / …):**
|
|
12
|
+
* 1. Create a new service implementing `ChatbotTravelHandler` (use
|
|
13
|
+
* `ChatbotRailSearchService` or `ChatbotFlightSearchService` as a
|
|
14
|
+
* reference implementation).
|
|
15
|
+
* 2. Inject it into this dispatcher and add it to {@link handlers}.
|
|
16
|
+
* 3. Nothing else needs to change — the consuming app calls {@link init}
|
|
17
|
+
* once (typically from its root component's `ngOnInit`), and search
|
|
18
|
+
* forms can ask {@link handles} which travel types to skip.
|
|
19
|
+
*/
|
|
20
|
+
export declare class ChatbotSearchDispatcherService {
|
|
21
|
+
private chatbotService;
|
|
22
|
+
private initialised;
|
|
23
|
+
private readonly handlers;
|
|
24
|
+
constructor(chatbotService: ChatbotService, rail: ChatbotRailSearchService, flight: ChatbotFlightSearchService, hotel: ChatbotHotelSearchService, eurostar: ChatbotEurostarSearchService);
|
|
25
|
+
/** Call once at app start. Idempotent. */
|
|
26
|
+
init(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Whether a global handler is registered for the given travel type. Used by
|
|
29
|
+
* search forms to know which travel types they should skip (avoiding
|
|
30
|
+
* double-handling).
|
|
31
|
+
*/
|
|
32
|
+
handles(travelType: ChatSearchParameters['travelType'] | undefined): boolean;
|
|
33
|
+
private findHandler;
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotSearchDispatcherService, never>;
|
|
35
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotSearchDispatcherService>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { Subject } from 'rxjs';
|
|
3
|
+
import { WebTokenService } from '../services/webtoken.service';
|
|
4
|
+
import { Environment } from '../classes/environment';
|
|
5
|
+
import { BaseChatbotService, BotFaq, ChatFeedbackAck, ChatMessage, ChatSearchParameters, ChatTokenEvent, ChatToolEvent, ChatWsResponse, CondensedResult, UserCapabilities, IRiskFlag } from '@sabstravtech/obtservices/base';
|
|
6
|
+
import { ResultAwareService } from './result-aware.service';
|
|
7
|
+
import { UserService } from './user.service';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class ChatbotService extends BaseChatbotService implements OnDestroy {
|
|
10
|
+
private webTokenService;
|
|
11
|
+
private resultAwareService;
|
|
12
|
+
private environment;
|
|
13
|
+
private userService;
|
|
14
|
+
private messagesSubject;
|
|
15
|
+
messages$: import("rxjs").Observable<ChatMessage[]>;
|
|
16
|
+
private loadingSubject;
|
|
17
|
+
loading$: import("rxjs").Observable<boolean>;
|
|
18
|
+
private searchingSubject;
|
|
19
|
+
searchingState$: import("rxjs").Observable<{
|
|
20
|
+
searching: boolean;
|
|
21
|
+
travelType?: string;
|
|
22
|
+
}>;
|
|
23
|
+
/** Back-compat boolean stream for callers that only care whether a search is in flight. */
|
|
24
|
+
searching$: import("rxjs").Observable<boolean>;
|
|
25
|
+
fillSearchForm$: Subject<{
|
|
26
|
+
parameters: ChatSearchParameters;
|
|
27
|
+
autoSearch: boolean;
|
|
28
|
+
}>;
|
|
29
|
+
private riskFlagSubject;
|
|
30
|
+
riskFlag$: import("rxjs").Observable<IRiskFlag>;
|
|
31
|
+
private faqsSubject;
|
|
32
|
+
faqs$: import("rxjs").Observable<BotFaq[]>;
|
|
33
|
+
private tokenEventsSubject;
|
|
34
|
+
tokenEvents$: import("rxjs").Observable<ChatTokenEvent>;
|
|
35
|
+
private toolEventsSubject;
|
|
36
|
+
toolEvents$: import("rxjs").Observable<ChatToolEvent>;
|
|
37
|
+
private feedbackAckSubject;
|
|
38
|
+
feedbackAck$: import("rxjs").Observable<ChatFeedbackAck>;
|
|
39
|
+
/** Tracks the user ID that owns the current chat session, to detect user switches. */
|
|
40
|
+
private sessionOwnerId;
|
|
41
|
+
private userChangeSubscription;
|
|
42
|
+
constructor(webTokenService: WebTokenService, resultAwareService: ResultAwareService, environment: Environment, userService: UserService);
|
|
43
|
+
ngOnDestroy(): void;
|
|
44
|
+
protected getRequestUrl(): string | null;
|
|
45
|
+
protected getAuthToken(): string | null;
|
|
46
|
+
protected notifyMessages(messages: ChatMessage[]): void;
|
|
47
|
+
protected notifyLoading(loading: boolean): void;
|
|
48
|
+
protected notifyFillForm(parameters: ChatSearchParameters, autoSearch: boolean): void;
|
|
49
|
+
protected notifyRiskFlag(flag: IRiskFlag): void;
|
|
50
|
+
protected notifyFaqs(faqs: BotFaq[]): void;
|
|
51
|
+
protected notifyToken(event: ChatTokenEvent): void;
|
|
52
|
+
protected notifyTool(event: ChatToolEvent): void;
|
|
53
|
+
protected notifyFeedbackAck(ack: ChatFeedbackAck): void;
|
|
54
|
+
protected hasResults(): boolean;
|
|
55
|
+
protected getCondensedResults(): CondensedResult[];
|
|
56
|
+
protected executeSelection(selectedIndex: number, returnSelectedIndex?: number): Promise<void>;
|
|
57
|
+
protected getSource(): string;
|
|
58
|
+
protected getUserCapabilities(): UserCapabilities;
|
|
59
|
+
connect(): void;
|
|
60
|
+
clearSession(): void;
|
|
61
|
+
injectMessage(message: ChatMessage): void;
|
|
62
|
+
protected handleResponse(env: ChatWsResponse): void;
|
|
63
|
+
/**
|
|
64
|
+
* Toggle the chatbot's "searching" indicator from a travel-type handler.
|
|
65
|
+
* @param travelType optional - lets the UI render a travel-aware label
|
|
66
|
+
* (e.g. "Searching for flights…" vs "Searching for trains…").
|
|
67
|
+
*/
|
|
68
|
+
setSearching(searching: boolean, travelType?: string): void;
|
|
69
|
+
patchAssistantMessage(patch: Partial<ChatMessage>): void;
|
|
70
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotService, never>;
|
|
71
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotService>;
|
|
72
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Router } from '@angular/router';
|
|
2
|
+
import { EnterpriseSearchService } from './search.service';
|
|
3
|
+
import { EnterpriseBasketService } from './enterprise-basket.service';
|
|
4
|
+
import { CondensedResult, ChatRailFareTicket } from '@sabstravtech/obtservices/base';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class ResultAwareService {
|
|
7
|
+
private searchService;
|
|
8
|
+
private basketService;
|
|
9
|
+
private router;
|
|
10
|
+
private condensedResults;
|
|
11
|
+
private rawResults;
|
|
12
|
+
private currentServiceType;
|
|
13
|
+
private railSourceId;
|
|
14
|
+
private railReturnJourneys;
|
|
15
|
+
private resultsAvailableSubject;
|
|
16
|
+
resultsAvailable$: import("rxjs").Observable<boolean>;
|
|
17
|
+
constructor(searchService: EnterpriseSearchService, basketService: EnterpriseBasketService, router: Router);
|
|
18
|
+
captureFlightResults(results: any[]): void;
|
|
19
|
+
captureRailResults(quoteResult: any): void;
|
|
20
|
+
captureHotelResults(results: any[]): void;
|
|
21
|
+
isHotelSearch(): boolean;
|
|
22
|
+
getCondensedResults(): CondensedResult[];
|
|
23
|
+
/**
|
|
24
|
+
* Returns the cheapest single and return fare prices for a raw outbound rail journey.
|
|
25
|
+
* Used by the chatbot fare panel to show per-category prices on card expand.
|
|
26
|
+
*/
|
|
27
|
+
getRailJourneyFares(journeyIndex: number): {
|
|
28
|
+
singlePrice?: number;
|
|
29
|
+
returnPrice?: number;
|
|
30
|
+
singleTickets?: ChatRailFareTicket[];
|
|
31
|
+
returnTickets?: ChatRailFareTicket[];
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Returns the cheapest single fare price and full ticket list for a raw inbound/return rail journey.
|
|
35
|
+
* Falls back to the other return-leg fare sections if no pure singles are available.
|
|
36
|
+
*/
|
|
37
|
+
getRailReturnJourneyFares(journeyIndex: number): {
|
|
38
|
+
singlePrice?: number;
|
|
39
|
+
singleTickets?: ChatRailFareTicket[];
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Open the existing OBT rail "View Conditions" dialog for a fare displayed in the chat.
|
|
43
|
+
*/
|
|
44
|
+
openRailFareDetails(ticket: ChatRailFareTicket): Promise<void>;
|
|
45
|
+
private collectFareTickets;
|
|
46
|
+
hasResults(): boolean;
|
|
47
|
+
clearResults(): void;
|
|
48
|
+
executeSelection(selectedIndex: number, returnIndex?: number): Promise<void>;
|
|
49
|
+
private executeFlightSelection;
|
|
50
|
+
private condenseFlightResults;
|
|
51
|
+
private formatTime;
|
|
52
|
+
private formatDuration;
|
|
53
|
+
private computeRailDuration;
|
|
54
|
+
private executeRailSelection;
|
|
55
|
+
private findCheapestRailJourney;
|
|
56
|
+
private getCheapestRailFare;
|
|
57
|
+
private getMostExpensiveRailFare;
|
|
58
|
+
private condenseRailResults;
|
|
59
|
+
private derivePolicyStatus;
|
|
60
|
+
private derivePolicyMessages;
|
|
61
|
+
private getFirstCabinClassName;
|
|
62
|
+
private filterDownCompressedReturnRailOptions;
|
|
63
|
+
selectHotelRoom(hotelIndex: number, roomId: string): Promise<void>;
|
|
64
|
+
private executeHotelSelection;
|
|
65
|
+
private condenseHotelResults;
|
|
66
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ResultAwareService, never>;
|
|
67
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ResultAwareService>;
|
|
68
|
+
}
|
|
@@ -3923,6 +3923,7 @@ export type ProcessTermsPriceResult = {
|
|
|
3923
3923
|
__typename?: 'ProcessTermsPriceResult';
|
|
3924
3924
|
amount: FieldWrapper<Scalars['String']['output']>;
|
|
3925
3925
|
currency: FieldWrapper<Scalars['String']['output']>;
|
|
3926
|
+
taxItemsWithoutCode: Array<FieldWrapper<ProcessTermsTaxItem>>;
|
|
3926
3927
|
};
|
|
3927
3928
|
export type ProcessTermsTaxItem = {
|
|
3928
3929
|
__typename?: 'ProcessTermsTaxItem';
|
|
@@ -5841,6 +5842,7 @@ export type User = {
|
|
|
5841
5842
|
admin?: Maybe<FieldWrapper<Scalars['Boolean']['output']>>;
|
|
5842
5843
|
agentBooker: FieldWrapper<Scalars['Boolean']['output']>;
|
|
5843
5844
|
agentId?: Maybe<FieldWrapper<Scalars['String']['output']>>;
|
|
5845
|
+
aiTravelAssistantEnabled?: Maybe<FieldWrapper<Scalars['Boolean']['output']>>;
|
|
5844
5846
|
approver: FieldWrapper<Scalars['Boolean']['output']>;
|
|
5845
5847
|
authMethods: Array<FieldWrapper<Scalars['String']['output']>>;
|
|
5846
5848
|
availableLanguages: Array<FieldWrapper<Language>>;
|
|
@@ -12590,6 +12592,7 @@ export type EditUserMutation = {
|
|
|
12590
12592
|
canSeeBookingsOfOthers: boolean;
|
|
12591
12593
|
becomeUser: boolean;
|
|
12592
12594
|
canOverrideApproval: boolean;
|
|
12595
|
+
aiTravelAssistantEnabled?: boolean | null;
|
|
12593
12596
|
dob?: any | null;
|
|
12594
12597
|
admin?: boolean | null;
|
|
12595
12598
|
companyAdmin?: boolean | null;
|
|
@@ -18986,6 +18989,12 @@ export type GetProcessTermsPriceQuery = {
|
|
|
18986
18989
|
__typename?: 'ProcessTermsPriceResult';
|
|
18987
18990
|
amount: string;
|
|
18988
18991
|
currency: string;
|
|
18992
|
+
taxItemsWithoutCode: Array<{
|
|
18993
|
+
__typename?: 'ProcessTermsTaxItem';
|
|
18994
|
+
name: string;
|
|
18995
|
+
amount: string;
|
|
18996
|
+
currency: string;
|
|
18997
|
+
}>;
|
|
18989
18998
|
};
|
|
18990
18999
|
};
|
|
18991
19000
|
export type GetRailLiveDeparturesQueryVariables = Exact<{
|
|
@@ -35883,6 +35892,7 @@ export type UserFieldsFragment = {
|
|
|
35883
35892
|
canSeeBookingsOfOthers: boolean;
|
|
35884
35893
|
becomeUser: boolean;
|
|
35885
35894
|
canOverrideApproval: boolean;
|
|
35895
|
+
aiTravelAssistantEnabled?: boolean | null;
|
|
35886
35896
|
dob?: any | null;
|
|
35887
35897
|
admin?: boolean | null;
|
|
35888
35898
|
companyAdmin?: boolean | null;
|
|
@@ -36160,6 +36170,7 @@ export type GetUserQuery = {
|
|
|
36160
36170
|
canSeeBookingsOfOthers: boolean;
|
|
36161
36171
|
becomeUser: boolean;
|
|
36162
36172
|
canOverrideApproval: boolean;
|
|
36173
|
+
aiTravelAssistantEnabled?: boolean | null;
|
|
36163
36174
|
dob?: any | null;
|
|
36164
36175
|
admin?: boolean | null;
|
|
36165
36176
|
companyAdmin?: boolean | null;
|
|
@@ -37423,6 +37434,7 @@ export declare namespace GetProcessTermsPrice {
|
|
|
37423
37434
|
type Variables = GetProcessTermsPriceQueryVariables;
|
|
37424
37435
|
type Query = GetProcessTermsPriceQuery;
|
|
37425
37436
|
type GetProcessTermsPrice = GetProcessTermsPriceQuery['getProcessTermsPrice'];
|
|
37437
|
+
type TaxItemsWithoutCode = GetProcessTermsPriceQuery['getProcessTermsPrice']['taxItemsWithoutCode'][number];
|
|
37426
37438
|
}
|
|
37427
37439
|
export declare namespace GetRailLiveDepartures {
|
|
37428
37440
|
type Variables = GetRailLiveDeparturesQueryVariables;
|
package/angular/services.d.ts
CHANGED
|
@@ -17,3 +17,10 @@ export * from './lib/vendor/services/rail-fare-processing.service';
|
|
|
17
17
|
export * from './lib/vendor/services/rail-results-state.service';
|
|
18
18
|
export * from './lib/vendor/services/search-document-validation.service';
|
|
19
19
|
export * from './lib/vendor/services/search-payment-validation.service';
|
|
20
|
+
export * from './lib/vendor/services/chatbot.service';
|
|
21
|
+
export * from './lib/vendor/services/chatbot-rail-search.service';
|
|
22
|
+
export * from './lib/vendor/services/chatbot-flight-search.service';
|
|
23
|
+
export * from './lib/vendor/services/chatbot-hotel-search.service';
|
|
24
|
+
export * from './lib/vendor/services/chatbot-eurostar-search.service';
|
|
25
|
+
export * from './lib/vendor/services/chatbot-search-dispatcher.service';
|
|
26
|
+
export * from './lib/vendor/services/result-aware.service';
|
package/base/interfaces.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export * from './lib/vendor/interfaces/terms-and-conditions.interface';
|
|
|
28
28
|
export * from './lib/vendor/interfaces/rail-basket-item.interface';
|
|
29
29
|
export * from './lib/vendor/interfaces/enable-fresh-chat-interface';
|
|
30
30
|
export * from './lib/vendor/interfaces/Ifast-track-enterprise-search';
|
|
31
|
+
export * from './lib/vendor/interfaces/chatbot.types';
|
|
31
32
|
export * from './lib/vendor/interfaces/fast-track-filters.interface';
|
|
32
33
|
export * from './lib/vendor/interfaces/Iferry-enterprise-search';
|
|
33
34
|
export * from './lib/vendor/interfaces/Iapartment-enterprise-search';
|
|
@@ -38,3 +39,4 @@ export * from './lib/vendor/interfaces/Iseason-tickets-enterprise-search';
|
|
|
38
39
|
export * from './lib/vendor/interfaces/hotel-stars-to-hide.interface';
|
|
39
40
|
export * from './lib/vendor/interfaces/cheapest-price';
|
|
40
41
|
export * from './lib/vendor/interfaces/cheapest-price-object';
|
|
42
|
+
export * from './lib/vendor/interfaces/chatbot.types';
|