@findhotel/sapi 1.25.4 → 1.25.6
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/README.md +301 -1
- package/dist/index.js +1 -1
- package/dist/types/packages/core/src/app-config.d.ts +1 -1
- package/dist/types/packages/core/src/reviews.d.ts +3 -0
- package/dist/types/packages/core/src/rooms.d.ts +10 -1
- package/dist/types/packages/core/src/sapi.d.ts +3 -2
- package/dist/types/packages/core/src/types/rooms.d.ts +24 -0
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -20,7 +21,6 @@ export interface AppConfig {
|
|
|
20
21
|
endpoints: {
|
|
21
22
|
hotel: string;
|
|
22
23
|
hotels: string;
|
|
23
|
-
reviews: string;
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
algolia: {
|
|
@@ -14,6 +14,9 @@ export declare type ReviewsHandler = (ids: string | string[], parameters?: Reque
|
|
|
14
14
|
/**
|
|
15
15
|
* Reviews handler
|
|
16
16
|
*
|
|
17
|
+
* Since 14.02.2025 - a wrapper on the top of reviews V2, which maps the response to V1 contract
|
|
18
|
+
* We can remove this once website migrates to the V2 contract
|
|
19
|
+
*
|
|
17
20
|
* @param parameters - configuration parameters
|
|
18
21
|
*
|
|
19
22
|
* @returns Hotel reviews
|
|
@@ -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
|
|
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
|
+
}
|