@sabstravtech/obtservices 0.2.2606091200 → 0.2.2606171720

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.
@@ -0,0 +1,40 @@
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 * as i0 from "@angular/core";
6
+ /**
7
+ * Handles chatbot-driven car hire searches. Registered with
8
+ * `ChatbotSearchDispatcherService`; not used directly.
9
+ *
10
+ * Populates the car hire search state from the chatbot's parameters, runs the
11
+ * search headlessly, then injects a `ChatCarHireResults` message so the chat
12
+ * widget can render car hire cards.
13
+ */
14
+ export declare class ChatbotCarHireSearchService implements ChatbotTravelHandler {
15
+ private chatbotService;
16
+ private searchService;
17
+ private resultAwareService;
18
+ readonly travelType: "car-hire";
19
+ constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, resultAwareService: ResultAwareService);
20
+ handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
21
+ private runSearch;
22
+ private buildCarHireCards;
23
+ private calculateDays;
24
+ private injectNoResultsMessage;
25
+ private populateCarHireParams;
26
+ private prefersAirport;
27
+ private resolveLocation;
28
+ private resolveAirportLocation;
29
+ private airportToLocation;
30
+ private pickBestLocation;
31
+ private toAirportDetails;
32
+ private enrichAirportDetails;
33
+ private applyAirportDropoff;
34
+ private applyCityPickup;
35
+ private applyCityDropoff;
36
+ private toCityLocation;
37
+ private resolveCityDepot;
38
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotCarHireSearchService, never>;
39
+ static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotCarHireSearchService>;
40
+ }
@@ -21,9 +21,34 @@ export declare class ChatbotFlightSearchService implements ChatbotTravelHandler
21
21
  private userService;
22
22
  readonly travelType: "flight";
23
23
  private resultsSubscription;
24
+ /**
25
+ * The most recent full search parameters (origin, destination, dates,
26
+ * cabin, etc.). Cached so a {@link resort} call — whose own parameters carry
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.
29
+ */
30
+ private lastSearchParameters;
24
31
  constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, resultAwareService: ResultAwareService, userService: UserService);
25
32
  handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
26
33
  private subscribeToFlightResults;
34
+ /**
35
+ * Re-render the chat flight cards from whatever the flight-search session
36
+ * currently holds — the same cached results that "View Full Results" shows.
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.
42
+ */
43
+ private buildAndPatchResultsFromCache;
44
+ /**
45
+ * Re-rank the results already in the flight-search session for a new user
46
+ * preference (cheapest / fastest / shortest / nearest-to-time) WITHOUT
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.
50
+ */
51
+ resort(parameters: ChatSearchParameters): Promise<void>;
27
52
  private buildFlightResults;
28
53
  /**
29
54
  * Builds a map keyed by an itinerary's flight-number signature to all
@@ -3,6 +3,7 @@ import { ChatbotService } from './chatbot.service';
3
3
  import { EnterpriseSearchService } from './search.service';
4
4
  import { HotelAvalibilityService } from './hotel-avallibility.service';
5
5
  import { ResultAwareService } from './result-aware.service';
6
+ import { UserService } from './user.service';
6
7
  import * as i0 from "@angular/core";
7
8
  /**
8
9
  * Handles chatbot-driven hotel searches. Registered with
@@ -18,11 +19,16 @@ export declare class ChatbotHotelSearchService implements ChatbotTravelHandler {
18
19
  private searchService;
19
20
  private hotelAvalibilityService;
20
21
  private resultAwareService;
22
+ private userService;
21
23
  readonly travelType: "hotel";
22
24
  private availabilitySubscription;
23
- constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, hotelAvalibilityService: HotelAvalibilityService, resultAwareService: ResultAwareService);
25
+ lastParameters: ChatSearchParameters | null;
26
+ get hasHotelResults(): boolean;
27
+ constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, hotelAvalibilityService: HotelAvalibilityService, resultAwareService: ResultAwareService, userService: UserService);
24
28
  handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
29
+ private ensureSelfTraveller;
25
30
  private runSearch;
31
+ private runSearchFromOffset;
26
32
  private buildHotelCards;
27
33
  private injectNoResultsMessage;
28
34
  private sortHotels;
@@ -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 { ResultAwareService } from './result-aware.service';
5
+ import { UserService } from './user.service';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Handles chatbot-driven lounge searches. Registered with
9
+ * `ChatbotSearchDispatcherService`; not used directly.
10
+ *
11
+ * Populates the lounge search state from the chatbot's parameters and runs
12
+ * `startSearch()` headlessly so chatbot lounge searches work from any page.
13
+ * Once results arrive, builds `ChatLoungeResultCard`s and patches them onto
14
+ * the last assistant message via {@link ChatbotService.patchAssistantMessage}.
15
+ */
16
+ export declare class ChatbotLoungeSearchService implements ChatbotTravelHandler {
17
+ private chatbotService;
18
+ private searchService;
19
+ private resultAwareService;
20
+ private userService;
21
+ readonly travelType: "lounge";
22
+ private resultsSubscription;
23
+ constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, resultAwareService: ResultAwareService, userService: UserService);
24
+ handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
25
+ private subscribeToLoungeResults;
26
+ private buildLoungeCards;
27
+ private formatValidationMessages;
28
+ private populateLoungeParams;
29
+ private resolveAirport;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotLoungeSearchService, never>;
31
+ static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotLoungeSearchService>;
32
+ }
@@ -3,6 +3,9 @@ import { ChatbotEurostarSearchService } from './chatbot-eurostar-search.service'
3
3
  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
+ import { ChatbotLoungeSearchService } from './chatbot-lounge-search.service';
7
+ import { ChatbotCarHireSearchService } from './chatbot-car-hire-search.service';
8
+ import { ChatbotTaxiSearchService } from './chatbot-taxi-search.service';
6
9
  import { ChatbotService } from './chatbot.service';
7
10
  import * as i0 from "@angular/core";
8
11
  /**
@@ -21,7 +24,7 @@ export declare class ChatbotSearchDispatcherService {
21
24
  private chatbotService;
22
25
  private initialised;
23
26
  private readonly handlers;
24
- constructor(chatbotService: ChatbotService, rail: ChatbotRailSearchService, flight: ChatbotFlightSearchService, hotel: ChatbotHotelSearchService, eurostar: ChatbotEurostarSearchService);
27
+ constructor(chatbotService: ChatbotService, rail: ChatbotRailSearchService, flight: ChatbotFlightSearchService, hotel: ChatbotHotelSearchService, carHire: ChatbotCarHireSearchService, eurostar: ChatbotEurostarSearchService, lounge: ChatbotLoungeSearchService, taxi: ChatbotTaxiSearchService);
25
28
  /** Call once at app start. Idempotent. */
26
29
  init(): void;
27
30
  /**
@@ -0,0 +1,21 @@
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 * as i0 from "@angular/core";
6
+ export declare class ChatbotTaxiSearchService implements ChatbotTravelHandler {
7
+ private chatbotService;
8
+ private searchService;
9
+ private resultAwareService;
10
+ readonly travelType: "taxi";
11
+ constructor(chatbotService: ChatbotService, searchService: EnterpriseSearchService, resultAwareService: ResultAwareService);
12
+ handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
13
+ private runSearch;
14
+ private buildTaxiCards;
15
+ private injectNoResultsMessage;
16
+ private populateTaxiParams;
17
+ private resolveGeoLocation;
18
+ private matchTerminal;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotTaxiSearchService, never>;
20
+ static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotTaxiSearchService>;
21
+ }
@@ -26,6 +26,10 @@ export declare class ChatbotService extends BaseChatbotService implements OnDest
26
26
  parameters: ChatSearchParameters;
27
27
  autoSearch: boolean;
28
28
  }>;
29
+ /** Re-rank already-cached results (no new search) — routed to the handler's resort(). */
30
+ resortResults$: Subject<{
31
+ parameters: ChatSearchParameters;
32
+ }>;
29
33
  private riskFlagSubject;
30
34
  riskFlag$: import("rxjs").Observable<IRiskFlag>;
31
35
  private faqsSubject;
@@ -46,6 +50,7 @@ export declare class ChatbotService extends BaseChatbotService implements OnDest
46
50
  protected notifyMessages(messages: ChatMessage[]): void;
47
51
  protected notifyLoading(loading: boolean): void;
48
52
  protected notifyFillForm(parameters: ChatSearchParameters, autoSearch: boolean): void;
53
+ protected notifyResort(parameters: ChatSearchParameters): void;
49
54
  protected notifyRiskFlag(flag: IRiskFlag): void;
50
55
  protected notifyFaqs(faqs: BotFaq[]): void;
51
56
  protected notifyToken(event: ChatTokenEvent): void;
@@ -56,6 +61,14 @@ export declare class ChatbotService extends BaseChatbotService implements OnDest
56
61
  protected executeSelection(selectedIndex: number, returnSelectedIndex?: number): Promise<void>;
57
62
  protected getSource(): string;
58
63
  protected getUserCapabilities(): UserCapabilities;
64
+ /**
65
+ * Translate the flight search form's `classSelection` config (where a `true`
66
+ * value HIDES a cabin) into the list of cabin classes the user is allowed to
67
+ * search/book, in the cabin enum the chatbot/AI uses. Returns undefined when
68
+ * no class is hidden (i.e. no restriction).
69
+ */
70
+ private resolveAllowedFlightCabins;
71
+ protected getUserFirstName(): string | undefined;
59
72
  connect(): void;
60
73
  clearSession(): void;
61
74
  injectMessage(message: ChatMessage): void;
@@ -18,6 +18,8 @@ export declare class ResultAwareService {
18
18
  captureFlightResults(results: any[]): void;
19
19
  captureRailResults(quoteResult: any): void;
20
20
  captureHotelResults(results: any[]): void;
21
+ captureCarHireResults(results: any[]): void;
22
+ selectCarHire(cardIndex: number): Promise<void>;
21
23
  isHotelSearch(): boolean;
22
24
  getCondensedResults(): CondensedResult[];
23
25
  /**
@@ -3923,7 +3923,6 @@ 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>>;
3927
3926
  };
3928
3927
  export type ProcessTermsTaxItem = {
3929
3928
  __typename?: 'ProcessTermsTaxItem';
@@ -18989,12 +18988,6 @@ export type GetProcessTermsPriceQuery = {
18989
18988
  __typename?: 'ProcessTermsPriceResult';
18990
18989
  amount: string;
18991
18990
  currency: string;
18992
- taxItemsWithoutCode: Array<{
18993
- __typename?: 'ProcessTermsTaxItem';
18994
- name: string;
18995
- amount: string;
18996
- currency: string;
18997
- }>;
18998
18991
  };
18999
18992
  };
19000
18993
  export type GetRailLiveDeparturesQueryVariables = Exact<{
@@ -37434,7 +37427,6 @@ export declare namespace GetProcessTermsPrice {
37434
37427
  type Variables = GetProcessTermsPriceQueryVariables;
37435
37428
  type Query = GetProcessTermsPriceQuery;
37436
37429
  type GetProcessTermsPrice = GetProcessTermsPriceQuery['getProcessTermsPrice'];
37437
- type TaxItemsWithoutCode = GetProcessTermsPriceQuery['getProcessTermsPrice']['taxItemsWithoutCode'][number];
37438
37430
  }
37439
37431
  export declare namespace GetRailLiveDepartures {
37440
37432
  type Variables = GetRailLiveDeparturesQueryVariables;
@@ -21,6 +21,8 @@ export * from './lib/vendor/services/chatbot.service';
21
21
  export * from './lib/vendor/services/chatbot-rail-search.service';
22
22
  export * from './lib/vendor/services/chatbot-flight-search.service';
23
23
  export * from './lib/vendor/services/chatbot-hotel-search.service';
24
+ export * from './lib/vendor/services/chatbot-car-hire-search.service';
25
+ export * from './lib/vendor/services/chatbot-taxi-search.service';
24
26
  export * from './lib/vendor/services/chatbot-eurostar-search.service';
25
27
  export * from './lib/vendor/services/chatbot-search-dispatcher.service';
26
28
  export * from './lib/vendor/services/result-aware.service';
@@ -28,7 +28,6 @@ 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';
32
31
  export * from './lib/vendor/interfaces/fast-track-filters.interface';
33
32
  export * from './lib/vendor/interfaces/Iferry-enterprise-search';
34
33
  export * from './lib/vendor/interfaces/Iapartment-enterprise-search';
@@ -241,7 +241,7 @@ export declare class RailEnterpriseSearch<Q extends RailQuoteFetcherType, GRS_Q
241
241
  */
242
242
  addToBasket(sourceId: string, searchQuery: RailTempParams, journey: OBTRailJourneyOption, railFare: OBTRailJourneyFare, inboundRailFare?: OBTRailJourneyFare, inboundJourney?: OBTRailJourneyOption, ingoreInvoked?: boolean, ignoreTicketExtras?: boolean): Promise<DifferentInvokdedUserReasons>;
243
243
  addOpenReturnToBasket(sourceId: string, searchQuery: RailTempParams, journey: OBTRailJourneyOption, railFare: OBTRailJourneyFare, ignoreInvoked?: boolean): Promise<DifferentInvokdedUserReasons>;
244
- addDualSingleToBasket(serviceId: string, searchQuery: RailTempParams | SearchRailQueryVariables, outbound: OBTRailJourneyOption, inbound: OBTRailJourneyOption, outboundFare: OBTRailJourneyFare, inboundFare: OBTRailJourneyFare, ignoreInvoked?: boolean, isEu?: boolean, gmt?: boolean): Promise<DifferentInvokdedUserReasons>;
244
+ addDualSingleToBasket(serviceId: string, searchQuery: RailTempParams | SearchRailQueryVariables, outbound: OBTRailJourneyOption, inbound: OBTRailJourneyOption, outboundFare: OBTRailJourneyFare, inboundFare: OBTRailJourneyFare, ignoreInvoked?: boolean, isEu?: boolean, gmt?: boolean, isInbound?: boolean): Promise<DifferentInvokdedUserReasons>;
245
245
  private isFareTypeMatch;
246
246
  private findBestFareFromFiltered;
247
247
  findCheapestTicket(notSplit?: boolean, fareType?: RailSplitComparisonType): ICheapestPrice;
@@ -67,15 +67,20 @@ export interface ChatFlightSearchLeg {
67
67
  timeCriteria?: 'Depart' | 'Arrive';
68
68
  }
69
69
  export interface ChatSearchParameters {
70
- travelType: 'flight' | 'rail' | 'hotel' | 'eurostar' | 'taxi';
70
+ travelType: 'flight' | 'rail' | 'hotel' | 'eurostar' | 'taxi' | 'car-hire' | 'lounge';
71
71
  departure: string;
72
72
  arrival: string;
73
73
  departureCode?: string;
74
74
  arrivalCode?: string;
75
75
  departureDate: string;
76
76
  departureTime?: string;
77
+ /** Outbound arrival time (e.g. "arriving before 5pm"). Maps to the leg's
78
+ * time with "Arrive By" criteria. departureTime takes precedence if both. */
79
+ arrivalTime?: string;
77
80
  returnDate?: string;
78
81
  returnTime?: string;
82
+ /** Inbound arrival time, mirror of arrivalTime for the return leg. */
83
+ returnArrivalTime?: string;
79
84
  passengers: number;
80
85
  /**
81
86
  * Flight multi-city legs. When set with 2+ entries the search runs as
@@ -95,6 +100,10 @@ export interface ChatSearchParameters {
95
100
  propertyNumber?: string;
96
101
  country?: string;
97
102
  cabinClass?: string;
103
+ /** Eurostar return-leg cabin class. When set, overrides cabinClass on the
104
+ * return leg only (e.g. business outbound, standard return). Falls back to
105
+ * cabinClass when omitted. */
106
+ returnCabinClass?: string;
98
107
  maxConnections?: number;
99
108
  outboundTimeCriteria?: 'Depart' | 'Arrive';
100
109
  returnTimeCriteria?: 'Depart' | 'Arrive';
@@ -106,10 +115,13 @@ export interface ChatSearchParameters {
106
115
  children?: number;
107
116
  /** Railcard codes to apply to this search (e.g. "YNG", "SRN", "FAM"). */
108
117
  railcards?: string[];
118
+ isEuRail?: boolean;
109
119
  airline?: string;
110
120
  airlineCode?: string;
111
121
  /** Sort field — values vary by travel type (flight: cheapest/fastest/shortest; hotel: cheapest/distance/preferred/name). */
112
122
  sortType?: 'cheapest' | 'fastest' | 'shortest' | 'distance' | 'preferred' | 'name';
123
+ /** When showing additional hotel results, the number of results already shown. */
124
+ resultOffset?: number;
113
125
  adults?: number;
114
126
  infants?: number;
115
127
  includeNearbyAirports?: boolean;
@@ -121,6 +133,16 @@ export interface ChatSearchParameters {
121
133
  pickupFlightNumber?: string;
122
134
  dropoffTerminal?: string;
123
135
  dropoffFlightNumber?: string;
136
+ locationCode?: string;
137
+ flight?: string;
138
+ terminal?: string;
139
+ carClass?: string;
140
+ carType?: string;
141
+ carTransmission?: string;
142
+ airCon?: boolean;
143
+ driverAge?: number;
144
+ carVendor?: string;
145
+ returnToPickup?: boolean;
124
146
  }
125
147
  export interface ChatRailFareTicket {
126
148
  type: string;
@@ -250,6 +272,15 @@ export interface ChatFlightResults {
250
272
  /** How the results were sorted, used in the summary text */
251
273
  sort?: 'cheapest' | 'fastest' | 'shortest';
252
274
  }
275
+ export interface ChatHotelRoomPolicies {
276
+ cancellation?: string | null;
277
+ deposit?: string | null;
278
+ disabledAccess?: boolean | null;
279
+ general?: string | null;
280
+ guarantee?: string | null;
281
+ refundAvailable?: boolean | null;
282
+ cvvRequired?: boolean | null;
283
+ }
253
284
  export interface ChatHotelRoom {
254
285
  roomId: string;
255
286
  description: string;
@@ -258,6 +289,12 @@ export interface ChatHotelRoom {
258
289
  currencyCode: string;
259
290
  unavailable: boolean;
260
291
  policyStatus?: 'IN_POLICY' | 'ALLOW_WITH_REASON' | 'UNAVAILABLE';
292
+ rateSource?: string | null;
293
+ rateCode?: string | null;
294
+ rateDescription?: string | null;
295
+ roomDescription?: string | null;
296
+ policies?: ChatHotelRoomPolicies;
297
+ additional?: any;
261
298
  }
262
299
  export interface ChatHotelResultCard {
263
300
  index: number;
@@ -273,6 +310,7 @@ export interface ChatHotelResultCard {
273
310
  policyMessages?: string[];
274
311
  co2?: number;
275
312
  currencyCode?: string;
313
+ source?: string;
276
314
  rooms?: ChatHotelRoom[];
277
315
  }
278
316
  export interface ChatHotelResults {
@@ -280,6 +318,53 @@ export interface ChatHotelResults {
280
318
  searchHeader: string;
281
319
  parameters: ChatSearchParameters;
282
320
  }
321
+ export interface ChatCarHireResultCard {
322
+ index: number;
323
+ vehicleDescription: string;
324
+ vendorName: string;
325
+ vendorCode?: string;
326
+ vendorLogoUrl?: string;
327
+ carClass?: string;
328
+ carType?: string;
329
+ transmission?: string;
330
+ airCon?: boolean;
331
+ doorsCount?: string;
332
+ price: number;
333
+ pricePerDay?: number;
334
+ currencyCode?: string;
335
+ pickupLocation: string;
336
+ dropoffLocation: string;
337
+ pickupDateTime: string;
338
+ dropoffDateTime: string;
339
+ policyStatus?: 'IN_POLICY' | 'ALLOW_WITH_REASON' | 'UNAVAILABLE';
340
+ policyMessages?: string[];
341
+ co2?: number;
342
+ }
343
+ export interface ChatCarHireResults {
344
+ cards: ChatCarHireResultCard[];
345
+ searchHeader: string;
346
+ parameters: ChatSearchParameters;
347
+ }
348
+ export interface ChatTaxiResultCard {
349
+ index: number;
350
+ supplierName: string;
351
+ vehicleType: string;
352
+ price: number;
353
+ currencyCode: string;
354
+ departs: string;
355
+ fromLocation: string;
356
+ toLocation: string;
357
+ tripDistanceMetres?: number;
358
+ tripDurationSeconds?: number;
359
+ policyStatus: 'IN_POLICY' | 'ALLOW_WITH_REASON' | 'UNAVAILABLE';
360
+ policyMessages?: string[];
361
+ co2?: number;
362
+ }
363
+ export interface ChatTaxiResults {
364
+ cards: ChatTaxiResultCard[];
365
+ searchHeader: string;
366
+ parameters: ChatSearchParameters;
367
+ }
283
368
  export interface ChatEurostarFare {
284
369
  class: string;
285
370
  price: number;
@@ -302,10 +387,74 @@ export interface ChatEurostarResults {
302
387
  isReturn: boolean;
303
388
  parameters: ChatSearchParameters;
304
389
  }
390
+ /** One service leg within an upcoming trip (flight/rail/hotel/etc.). */
391
+ export interface ChatUpcomingTripLeg {
392
+ serviceType: string;
393
+ status: string;
394
+ pnrLocator: string | null;
395
+ supplierReference: string | null;
396
+ outboundDate: string | null;
397
+ inboundDate: string | null;
398
+ leadPassenger: string | null;
399
+ detail: unknown;
400
+ }
401
+ /** A single upcoming trip (basket) shown in a "show my trips" reply. */
402
+ export interface ChatUpcomingTrip {
403
+ basketId: string;
404
+ reference: string;
405
+ title: string | null;
406
+ status: string;
407
+ serviceTypes: string[];
408
+ earliestTravelDate: string | null;
409
+ items: ChatUpcomingTripLeg[];
410
+ }
411
+ export interface ChatLoungeResultCard {
412
+ index: number;
413
+ date: string;
414
+ name: string;
415
+ airport: string;
416
+ terminal?: string;
417
+ price: number;
418
+ currency: string;
419
+ policyStatus?: 'IN_POLICY' | 'ALLOW_WITH_REASON' | 'UNAVAILABLE';
420
+ policyMessages?: string[];
421
+ isPreferred: boolean;
422
+ unavailable: boolean;
423
+ unavailableMessage?: string;
424
+ openTime?: string;
425
+ closeTime?: string;
426
+ }
427
+ export interface ChatLoungeResults {
428
+ cards: ChatLoungeResultCard[];
429
+ searchHeader: string;
430
+ parameters: ChatSearchParameters;
431
+ }
305
432
  export interface ChatSuggestion {
306
- type: 'search_action' | 'select_action';
433
+ type: 'search_action' | 'select_action' | 'redirect_action';
307
434
  label: string;
308
- action: 'FILL_FORM' | 'FILL_AND_SEARCH' | 'SELECT_RESULT';
435
+ action: 'FILL_FORM' | 'FILL_AND_SEARCH' | 'SELECT_RESULT' | 'REDIRECT_TO_MY_BOOKINGS';
436
+ params?: {
437
+ statuses?: string[];
438
+ fromDate?: string;
439
+ travelDateFrom?: string;
440
+ travelDateTo?: string;
441
+ traveller?: string;
442
+ };
443
+ }
444
+ /**
445
+ * Filters handed off from the chat widget's "View My Bookings" button to the
446
+ * My Bookings screen. The explicit `statuses` / `travelDateFrom` /
447
+ * `travelDateTo` / `traveller` fields let My Bookings reproduce the exact set
448
+ * the chatbot displayed; legacy callers may instead pass `departureDate` /
449
+ * `fromDate`, in which case My Bookings falls back to its default window.
450
+ */
451
+ export interface MyBookingsBaseParams {
452
+ statuses?: string[];
453
+ travelDateFrom?: string;
454
+ travelDateTo?: string;
455
+ traveller?: string;
456
+ fromDate?: string;
457
+ departureDate?: string;
309
458
  }
310
459
  export interface ChatRequest {
311
460
  message: string;
@@ -323,7 +472,7 @@ export interface ChatResponse {
323
472
  selectedIndex?: number;
324
473
  returnSelectedIndex?: number;
325
474
  alternativeIndex?: number;
326
- action?: 'search' | 'select' | 'navigate';
475
+ action?: 'search' | 'select' | 'navigate' | 'sort_results';
327
476
  riskFlag?: IRiskFlag | null;
328
477
  }
329
478
  export interface IRiskFlag {
@@ -344,20 +493,37 @@ export interface ChatMessage {
344
493
  selectedIndex?: number;
345
494
  returnSelectedIndex?: number;
346
495
  alternativeIndex?: number;
347
- action?: 'search' | 'select' | 'navigate';
496
+ action?: 'search' | 'select' | 'navigate' | 'sort_results';
348
497
  riskFlag?: IRiskFlag | null;
349
498
  railResults?: ChatRailResults;
350
499
  flightResults?: ChatFlightResults;
351
500
  hotelResults?: ChatHotelResults;
501
+ carHireResults?: ChatCarHireResults;
352
502
  eurostarResults?: ChatEurostarResults;
503
+ upcomingBookings?: ChatUpcomingTrip[];
504
+ hasMoreBookings?: boolean;
505
+ taxiResults?: ChatTaxiResults;
506
+ loungeResults?: ChatLoungeResults;
353
507
  searchResults?: CondensedResult[];
354
508
  searchHeader?: string;
355
509
  }
510
+ export type ChatbotFlightCabinClass = 'Economy' | 'PremiumEconomy' | 'Business' | 'First';
356
511
  export interface UserCapabilities {
357
512
  isCrown: boolean;
358
513
  isAgent: boolean;
359
514
  uiConfigs: {
360
515
  hideHotelSearchOptions: boolean;
516
+ /** Cabin classes the user may search/book. Empty/absent = all allowed. */
517
+ allowedFlightCabins?: ChatbotFlightCabinClass[];
518
+ /** Whether multi-city flight itineraries are enabled for this account. */
519
+ flightMultiCityEnabled?: boolean;
520
+ /** Max legs allowed in a multi-city itinerary, when enabled. */
521
+ flightMultiCityMaxLegs?: number;
522
+ /** When true, routing via a specific transit airport is hidden. */
523
+ hideFlightVia?: boolean;
524
+ /** Minimum time-flexibility window (± hours) the account enforces. */
525
+ flightMinTimeFlexibilityHours?: number;
526
+ hideCarHireOptions?: boolean;
361
527
  };
362
528
  }
363
529
  /**
@@ -380,6 +546,12 @@ export interface ChatbotTravelHandler {
380
546
  readonly travelType: ChatSearchParameters['travelType'];
381
547
  /** Populate search state and (if requested) run the search. */
382
548
  handle(parameters: ChatSearchParameters, autoSearch: boolean): Promise<void>;
549
+ /**
550
+ * Re-rank the results already cached in the search session (no new backend
551
+ * search) and re-render the result cards for the new preference. Optional —
552
+ * only handlers that keep a re-rankable cached set implement it.
553
+ */
554
+ resort?(parameters: ChatSearchParameters): Promise<void>;
383
555
  }
384
556
  /**
385
557
  * Source of the feedback signal — matches the values accepted by the
@@ -85,6 +85,7 @@ export interface Return {
85
85
  isSplit?: boolean;
86
86
  fares?: RailBasketDetailFare[];
87
87
  composition?: RailSearchComposition[];
88
+ dualInbound?: boolean;
88
89
  }
89
90
  export interface RailBasketDetailFare {
90
91
  id: string;
@@ -1,5 +1,5 @@
1
1
  import { Socket } from 'socket.io-client';
2
- import { BotFaq, ChatConversationState, ChatFeedbackAck, ChatFeedbackExtras, ChatFeedbackSource, ChatMessage, ChatResponse, ChatSearchParameters, ChatTokenEvent, ChatToolEvent, CondensedResult, IRiskFlag, UserCapabilities } from '../interfaces/chatbot.types';
2
+ import { BotFaq, ChatConversationState, ChatFeedbackAck, ChatFeedbackExtras, ChatFeedbackSource, ChatMessage, ChatResponse, ChatSearchParameters, ChatTokenEvent, ChatToolEvent, ChatUpcomingTrip, CondensedResult, IRiskFlag, MyBookingsBaseParams, UserCapabilities } from '../interfaces/chatbot.types';
3
3
  export interface ChatWsResponse {
4
4
  sessionId: string;
5
5
  message: string;
@@ -14,6 +14,8 @@ export interface ChatWsResponse {
14
14
  returnSelectedIndex?: number;
15
15
  alternativeIndex?: number;
16
16
  action?: ChatResponse['action'];
17
+ upcomingBookings?: ChatUpcomingTrip[];
18
+ hasMoreBookings?: boolean;
17
19
  metadata?: {
18
20
  confidence?: number;
19
21
  vectorContext?: unknown;
@@ -42,8 +44,8 @@ export declare abstract class BaseChatbotService {
42
44
  protected messages: ChatMessage[];
43
45
  protected loading: boolean;
44
46
  private myBookingsBaseParams;
45
- getMyBookingsBaseParams(): any;
46
- setMyBookingsBaseParams(newParams: any): void;
47
+ getMyBookingsBaseParams(): MyBookingsBaseParams | null;
48
+ setMyBookingsBaseParams(newParams: MyBookingsBaseParams | null): void;
47
49
  /** Base URL of the request-handler (the GraphQL `requestURL` from env). */
48
50
  protected abstract getRequestUrl(): string | null;
49
51
  /** JWT to use for socket.io auth. Return null to abort connect. */
@@ -90,6 +92,7 @@ export declare abstract class BaseChatbotService {
90
92
  * Subclasses may return undefined when capabilities aren't applicable.
91
93
  */
92
94
  protected getUserCapabilities(): UserCapabilities | undefined;
95
+ protected getUserFirstName(): string | undefined;
93
96
  /**
94
97
  * Source tag included in chat:feedback emits. Derived from getSource()
95
98
  * (web → 'OBT', mobile → 'Mobile'); subclasses may override to send
@@ -3921,7 +3921,6 @@ export type ProcessTermsPriceResult = {
3921
3921
  __typename?: 'ProcessTermsPriceResult';
3922
3922
  amount: FieldWrapper<Scalars['String']['output']>;
3923
3923
  currency: FieldWrapper<Scalars['String']['output']>;
3924
- taxItemsWithoutCode: Array<FieldWrapper<ProcessTermsTaxItem>>;
3925
3924
  };
3926
3925
  export type ProcessTermsTaxItem = {
3927
3926
  __typename?: 'ProcessTermsTaxItem';
@@ -18987,12 +18986,6 @@ export type GetProcessTermsPriceQuery = {
18987
18986
  __typename?: 'ProcessTermsPriceResult';
18988
18987
  amount: string;
18989
18988
  currency: string;
18990
- taxItemsWithoutCode: Array<{
18991
- __typename?: 'ProcessTermsTaxItem';
18992
- name: string;
18993
- amount: string;
18994
- currency: string;
18995
- }>;
18996
18989
  };
18997
18990
  };
18998
18991
  export type GetRailLiveDeparturesQueryVariables = Exact<{
@@ -37432,7 +37425,6 @@ export declare namespace GetProcessTermsPrice {
37432
37425
  type Variables = GetProcessTermsPriceQueryVariables;
37433
37426
  type Query = GetProcessTermsPriceQuery;
37434
37427
  type GetProcessTermsPrice = GetProcessTermsPriceQuery['getProcessTermsPrice'];
37435
- type TaxItemsWithoutCode = GetProcessTermsPriceQuery['getProcessTermsPrice']['taxItemsWithoutCode'][number];
37436
37428
  }
37437
37429
  export declare namespace GetRailLiveDepartures {
37438
37430
  type Variables = GetRailLiveDeparturesQueryVariables;