@findhotel/sapi 1.25.3 → 1.25.5

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.
@@ -8,6 +8,7 @@ export interface AppConfig {
8
8
  offers: string;
9
9
  offersPoll: string;
10
10
  roomsOffers: string;
11
+ roomsOffersV2: string;
11
12
  addressSuggest: string;
12
13
  autocompleteSuggest: string;
13
14
  freeTextSuggest: string;
@@ -1,6 +1,7 @@
1
- import { type RoomsRequestParameters, type RoomsResults, type Options as ClientOptions } from './types';
1
+ import { type RoomsRequestParameters, type RoomsResults, type Options as ClientOptions, type RoomsResultsV2 } from './types';
2
2
  import { type AppConfig, type ProfileKey } from './app-config';
3
3
  export declare type RoomsHandler = (parameters: RoomsRequestParameters) => Promise<RoomsResults>;
4
+ export declare type RoomsHandlerV2 = (parameters: RoomsRequestParameters) => Promise<RoomsResultsV2>;
4
5
  /**
5
6
  * Creates rooms request string.
6
7
  *
@@ -44,3 +45,11 @@ export interface Parameters {
44
45
  * @returns rooms search function
45
46
  */
46
47
  export declare function rooms({ appConfig, profileKey, options, }: Parameters): RoomsHandler;
48
+ /**
49
+ * Creates rooms search (using v2 version of rooms endpoint) function with bind base configuration object
50
+ *
51
+ * @param parameters - Parameters for rooms fn initialization
52
+ *
53
+ * @returns rooms search function
54
+ */
55
+ export declare function roomsV2({ appConfig, profileKey, options, }: Parameters): RoomsHandlerV2;
@@ -1,7 +1,7 @@
1
+ import { type ProfileKey } from './app-config';
1
2
  import { type SearchHandler } from './search';
2
3
  import { type SuggestHandler } from './suggest';
3
- import { type ProfileKey } from './app-config';
4
- import { type RoomsHandler } from './rooms';
4
+ import { type RoomsHandler, type RoomsHandlerV2 } from './rooms';
5
5
  import { type HotelHandler, type HotelsHandler } from './hotel';
6
6
  import { type OffersHandler } from './offers';
7
7
  import { type AvailabilityHandler } from './hotel-availability';
@@ -18,6 +18,7 @@ import { type HotelsOffersHandler } from './hotels-offers';
18
18
  export declare function variationsToArray(variations?: Record<string, string>): string[];
19
19
  export interface SapiClient {
20
20
  rooms: RoomsHandler;
21
+ roomsV2: RoomsHandlerV2;
21
22
  search: SearchHandler;
22
23
  suggest: SuggestHandler;
23
24
  /**
@@ -110,6 +110,24 @@ export interface Room {
110
110
  squashedIds?: string[];
111
111
  area: Area;
112
112
  }
113
+ export interface Itinerary {
114
+ checkIn: string;
115
+ checkOut: string;
116
+ roomID: string;
117
+ offer: EntityOffer;
118
+ }
119
+ export declare type EntityOffer = {
120
+ offerType: 'regular' | 'split_booking';
121
+ itineraries?: Itinerary[];
122
+ totalRate?: RateBreakdown;
123
+ } & RoomOffer;
124
+ export interface Entity {
125
+ id: string;
126
+ entityType: 'room' | 'split_booking';
127
+ rooms: Room[];
128
+ offers: EntityOffer[];
129
+ hasClickedOffer: boolean;
130
+ }
113
131
  export interface RoomSplitBookingOffer {
114
132
  checkIn: string;
115
133
  checkOut: string;
@@ -136,3 +154,9 @@ export interface RoomsResults {
136
154
  anonymousId: AnonymousId;
137
155
  splitBooking?: RoomsSplitBooking;
138
156
  }
157
+ export interface RoomsResultsV2 {
158
+ hotelId: HotelId;
159
+ entities: Entity[];
160
+ searchId: string;
161
+ anonymousId: AnonymousId;
162
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@findhotel/sapi",
3
- "version": "1.25.3",
3
+ "version": "1.25.5",
4
4
  "description": "FindHotel Search API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types/packages/core/src",