@findhotel/sapi 0.23.9 → 0.23.12
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 +337 -40
- package/dist/index.js +1 -1
- package/dist/types/packages/core/src/app-config.d.ts +1 -0
- package/dist/types/packages/core/src/hotel.d.ts +3 -1
- package/dist/types/packages/core/src/offers-client.d.ts +108 -0
- package/dist/types/packages/core/src/{raa/utils.test.d.ts → offers-client.test.d.ts} +0 -0
- package/dist/types/packages/core/src/offers.d.ts +27 -100
- package/dist/types/packages/core/src/sapi.d.ts +1 -1
- package/dist/types/packages/core/src/types/sapi-client.d.ts +2 -0
- package/dist/types/packages/core/src/types/types.d.ts +4 -1
- package/dist/types/packages/core/src/utils/build-offers-response.d.ts +21 -0
- package/dist/types/packages/core/src/utils/build-offers-response.test.d.ts +1 -0
- package/dist/types/packages/core/src/utils/index.d.ts +2 -0
- package/dist/types/packages/core/src/utils/search-id.d.ts +4 -4
- package/dist/types/packages/core/src/utils/sorting-boosts.d.ts +11 -0
- package/dist/types/packages/core/src/utils/sorting-boosts.test.d.ts +1 -0
- package/package.json +1 -1
- package/dist/types/packages/core/src/raa/index.d.ts +0 -2
- package/dist/types/packages/core/src/raa/raa.d.ts +0 -45
- package/dist/types/packages/core/src/raa/utils.d.ts +0 -36
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseWithConfig } from '.';
|
|
2
|
-
import { Language, HotelId, TranslatedString, GuestRating, GuestType, Location, TranslatedArray, Pricing, ContentHotel, LOVItem } from './types';
|
|
2
|
+
import { Language, HotelId, TranslatedString, GuestRating, GuestType, Location, TranslatedArray, Pricing, ContentHotel, LOVItem, Currency } from './types';
|
|
3
3
|
export interface SafHotel {
|
|
4
4
|
objectID: HotelId;
|
|
5
5
|
_geoloc: Location;
|
|
@@ -24,6 +24,7 @@ export interface SafHotel {
|
|
|
24
24
|
checkInMinAge?: number;
|
|
25
25
|
reviewCount?: number;
|
|
26
26
|
chainID?: string;
|
|
27
|
+
parentChainID?: string;
|
|
27
28
|
checkInEnd?: string;
|
|
28
29
|
lastBooked?: number;
|
|
29
30
|
checkOutTime?: string;
|
|
@@ -36,6 +37,7 @@ export interface SafHotel {
|
|
|
36
37
|
themes?: LOVItem[];
|
|
37
38
|
propertyType?: LOVItem;
|
|
38
39
|
sentiments?: LOVItem[];
|
|
40
|
+
currency?: Currency;
|
|
39
41
|
}
|
|
40
42
|
export declare type HotelHandler = (hotelId: HotelId) => Promise<ContentHotel>;
|
|
41
43
|
export declare function safToSapiHotel(safHotel: SafHotel, languages: Language[]): ContentHotel;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { CugDeals, HotelId, HotelOfferEntity, Brand, Currency, DeviceType, RoomId, Meals, Logger } from './types';
|
|
2
|
+
interface V3RateBreakdown {
|
|
3
|
+
base: number;
|
|
4
|
+
hotelFees: number;
|
|
5
|
+
taxes: number;
|
|
6
|
+
}
|
|
7
|
+
interface CancellationPenalty {
|
|
8
|
+
amount: number;
|
|
9
|
+
percent?: number;
|
|
10
|
+
nights?: number;
|
|
11
|
+
currency: string;
|
|
12
|
+
end: string;
|
|
13
|
+
start: string;
|
|
14
|
+
}
|
|
15
|
+
declare type Amenities = Meals & 'internetIncluded';
|
|
16
|
+
declare type OfferTag = 'top_offer' | 'anchor_price' | 'exclusive_cheapest_offer';
|
|
17
|
+
interface SapiResponseOffer {
|
|
18
|
+
accessTier: string;
|
|
19
|
+
availableRooms: number;
|
|
20
|
+
cancellationPenalties: CancellationPenalty[];
|
|
21
|
+
currency: Currency;
|
|
22
|
+
id: string;
|
|
23
|
+
intermediaryProvider: string;
|
|
24
|
+
metadata: {
|
|
25
|
+
feedID: string;
|
|
26
|
+
providerRateType?: string;
|
|
27
|
+
};
|
|
28
|
+
occupancy: string | number | null;
|
|
29
|
+
package: {
|
|
30
|
+
amenities: Amenities[];
|
|
31
|
+
canPayLater: boolean;
|
|
32
|
+
refundable: boolean;
|
|
33
|
+
};
|
|
34
|
+
providerCode: string;
|
|
35
|
+
rate: V3RateBreakdown;
|
|
36
|
+
roomID: RoomId;
|
|
37
|
+
tags: OfferTag[] | null;
|
|
38
|
+
url: string;
|
|
39
|
+
}
|
|
40
|
+
declare type Rooms = Record<RoomId, {
|
|
41
|
+
name: string;
|
|
42
|
+
}>;
|
|
43
|
+
export interface SapiResponseOfferEntity {
|
|
44
|
+
anchorRate: V3RateBreakdown;
|
|
45
|
+
availableOffersCount: number;
|
|
46
|
+
fetchedAllOffers: boolean;
|
|
47
|
+
hasMoreOffers: boolean;
|
|
48
|
+
id: HotelId;
|
|
49
|
+
offers: SapiResponseOffer[];
|
|
50
|
+
rooms: Rooms;
|
|
51
|
+
}
|
|
52
|
+
interface Options {
|
|
53
|
+
brand?: Brand;
|
|
54
|
+
anonymousId: string;
|
|
55
|
+
currency: string;
|
|
56
|
+
countryCode: string;
|
|
57
|
+
language: string;
|
|
58
|
+
includeLocalTaxes?: boolean;
|
|
59
|
+
includeTaxes?: boolean;
|
|
60
|
+
skipBackendAugmentation?: boolean;
|
|
61
|
+
facetsEnabled?: boolean;
|
|
62
|
+
WebSocket?: any;
|
|
63
|
+
sapiCliKey?: string;
|
|
64
|
+
deviceType: DeviceType;
|
|
65
|
+
variations: string[];
|
|
66
|
+
logger: Logger;
|
|
67
|
+
}
|
|
68
|
+
export interface GetOffersParameters {
|
|
69
|
+
anchorHotelId?: HotelId;
|
|
70
|
+
hotelIds?: HotelId[];
|
|
71
|
+
cugDeals?: CugDeals;
|
|
72
|
+
getAllOffers?: boolean;
|
|
73
|
+
originId?: string;
|
|
74
|
+
checkIn: string;
|
|
75
|
+
checkOut: string;
|
|
76
|
+
rooms: string;
|
|
77
|
+
searchId: string;
|
|
78
|
+
filters?: {
|
|
79
|
+
freeCancellation?: boolean;
|
|
80
|
+
};
|
|
81
|
+
preferredRate?: number;
|
|
82
|
+
trafficSource?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface OffersResponse {
|
|
85
|
+
anchorHotelOfferEntity?: HotelOfferEntity;
|
|
86
|
+
hotelOfferEntities?: HotelOfferEntity[];
|
|
87
|
+
}
|
|
88
|
+
export interface OffersClient {
|
|
89
|
+
getOffers: (parameters: GetOffersParameters, onOffersReceived?: (response: OffersResponse) => void) => Promise<OffersResponse>;
|
|
90
|
+
}
|
|
91
|
+
export declare function hasAnchorPrice(price: number, anchorPrice: number): boolean;
|
|
92
|
+
interface MappingContext {
|
|
93
|
+
checkIn: string;
|
|
94
|
+
checkOut: string;
|
|
95
|
+
includeTaxes?: boolean;
|
|
96
|
+
includeLocalTaxes?: boolean;
|
|
97
|
+
}
|
|
98
|
+
export declare function sapiResponseToHotelOfferEntity(offerEntity: SapiResponseOfferEntity, context: MappingContext): HotelOfferEntity;
|
|
99
|
+
interface ApiConfig {
|
|
100
|
+
baseUrl: string;
|
|
101
|
+
endpoints: {
|
|
102
|
+
offers: string;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
export declare function offersClient(config: ApiConfig, options: Options): {
|
|
106
|
+
getOffers: (parameters: GetOffersParameters, onOffersReceived?: ((response: OffersResponse) => void) | undefined) => Promise<OffersResponse>;
|
|
107
|
+
};
|
|
108
|
+
export {};
|
|
File without changes
|
|
@@ -1,107 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
interface CancellationPenalty {
|
|
8
|
-
amount: number;
|
|
9
|
-
percent?: number;
|
|
10
|
-
nights?: number;
|
|
11
|
-
currency: string;
|
|
12
|
-
end: string;
|
|
13
|
-
start: string;
|
|
14
|
-
}
|
|
15
|
-
declare type Amenities = Meals & 'internetIncluded';
|
|
16
|
-
declare type OfferTag = 'top_offer' | 'anchor_price' | 'exclusive_cheapest_offer';
|
|
17
|
-
interface SapiResponseOffer {
|
|
18
|
-
accessTier: string;
|
|
19
|
-
availableRooms: number;
|
|
20
|
-
cancellationPenalties: CancellationPenalty[];
|
|
21
|
-
currency: Currency;
|
|
22
|
-
id: string;
|
|
23
|
-
intermediaryProvider: string;
|
|
24
|
-
metadata: {
|
|
25
|
-
feedID: string;
|
|
26
|
-
providerRateType?: string;
|
|
27
|
-
};
|
|
28
|
-
occupancy: string | number | null;
|
|
29
|
-
package: {
|
|
30
|
-
amenities: Amenities[];
|
|
31
|
-
canPayLater: boolean;
|
|
32
|
-
refundable: boolean;
|
|
33
|
-
};
|
|
34
|
-
providerCode: string;
|
|
35
|
-
rate: V3RateBreakdown;
|
|
36
|
-
roomID: RoomId;
|
|
37
|
-
tags: OfferTag[] | null;
|
|
38
|
-
url: string;
|
|
39
|
-
}
|
|
40
|
-
declare type Rooms = Record<RoomId, {
|
|
41
|
-
name: string;
|
|
42
|
-
}>;
|
|
43
|
-
export interface SapiResponseOfferEntity {
|
|
44
|
-
anchorRate: V3RateBreakdown;
|
|
45
|
-
availableOffersCount: number;
|
|
46
|
-
fetchedAllOffers: boolean;
|
|
47
|
-
hasMoreOffers: boolean;
|
|
48
|
-
id: HotelId;
|
|
49
|
-
offers: SapiResponseOffer[];
|
|
50
|
-
rooms: Rooms;
|
|
51
|
-
}
|
|
52
|
-
interface Options {
|
|
53
|
-
brand?: Brand;
|
|
54
|
-
anonymousId: string;
|
|
55
|
-
currency: string;
|
|
56
|
-
countryCode: string;
|
|
57
|
-
language: string;
|
|
58
|
-
includeLocalTaxes?: boolean;
|
|
59
|
-
includeTaxes?: boolean;
|
|
60
|
-
skipBackendAugmentation?: boolean;
|
|
61
|
-
facetsEnabled?: boolean;
|
|
62
|
-
WebSocket?: any;
|
|
63
|
-
sapiCliKey?: string;
|
|
64
|
-
deviceType: DeviceType;
|
|
65
|
-
variations: string[];
|
|
66
|
-
logger: Logger;
|
|
67
|
-
}
|
|
68
|
-
export interface GetOffersParameters {
|
|
69
|
-
anchorHotelId?: HotelId;
|
|
70
|
-
hotelIds?: HotelId[];
|
|
71
|
-
cugDeals?: CugDeals;
|
|
72
|
-
getAllOffers?: boolean;
|
|
73
|
-
originId?: string;
|
|
1
|
+
import { BaseWithConfig } from '.';
|
|
2
|
+
import { GetOffersParameters } from './offers-client';
|
|
3
|
+
import { HotelId, HotelOfferEntity, CugDeals } from './types';
|
|
4
|
+
import { AppConfig } from './app-config';
|
|
5
|
+
interface OffersParameters {
|
|
6
|
+
hotelId: HotelId;
|
|
74
7
|
checkIn: string;
|
|
75
8
|
checkOut: string;
|
|
76
9
|
rooms: string;
|
|
77
|
-
searchId
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
10
|
+
searchId?: string;
|
|
11
|
+
cugDeals?: CugDeals;
|
|
12
|
+
isAnchor?: boolean;
|
|
13
|
+
getAllOffers?: boolean;
|
|
14
|
+
originId?: string;
|
|
15
|
+
freeCancellation?: boolean;
|
|
81
16
|
preferredRate?: number;
|
|
82
17
|
trafficSource?: string;
|
|
83
18
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
baseUrl: string;
|
|
100
|
-
endpoints: {
|
|
101
|
-
offers: string;
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
export declare function offers(config: ApiConfig, options: Options): {
|
|
105
|
-
getOffers: (parameters: GetOffersParameters, onOffersReceived?: ((response: OffersResponse) => void) | undefined) => Promise<OffersResponse>;
|
|
106
|
-
};
|
|
19
|
+
interface Callbacks {
|
|
20
|
+
onStart?: (parameters: GetOffersParameters) => void;
|
|
21
|
+
onOffersReceived?: (response: HotelOfferEntity | undefined) => void;
|
|
22
|
+
onComplete?: (response: HotelOfferEntity | undefined) => void;
|
|
23
|
+
}
|
|
24
|
+
export declare type OffersHandler = (parameters: OffersParameters, callbacks: Callbacks) => Promise<HotelOfferEntity | undefined>;
|
|
25
|
+
export declare function getOffersParameters(parameters: OffersParameters, options: BaseWithConfig['options'], appConfig: AppConfig): GetOffersParameters;
|
|
26
|
+
/**
|
|
27
|
+
* Creates offers function with configuration object
|
|
28
|
+
*
|
|
29
|
+
* @param configuration - Configuration for offers initialisation
|
|
30
|
+
*
|
|
31
|
+
* @returns function for fetching offers
|
|
32
|
+
*/
|
|
33
|
+
export declare function offers({ offersClient, options, appConfig }: Pick<BaseWithConfig, 'offersClient' | 'options' | 'appConfig'>): OffersHandler;
|
|
107
34
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SearchClient } from 'algoliasearch';
|
|
2
2
|
import { Except } from 'type-fest';
|
|
3
|
-
import { OffersClient } from './offers';
|
|
3
|
+
import { OffersClient } from './offers-client';
|
|
4
4
|
import { Configs } from './algolia';
|
|
5
5
|
import { AppConfig, Features } from './app-config';
|
|
6
6
|
import { ProfileKey, ClientOptions, SapiClient, Language, Logger } from './types';
|
|
@@ -6,6 +6,7 @@ import { RoomsHandler } from '../rooms';
|
|
|
6
6
|
import { HotelHandler } from '../hotel';
|
|
7
7
|
import { SuggestHandler } from '../suggest';
|
|
8
8
|
import { Configs } from '../algolia';
|
|
9
|
+
import { OffersHandler } from '../offers';
|
|
9
10
|
export declare type ProfileKey = 'findhotel-website' | 'findhotel-website-e2e' | 'findhotel-website-stg' | 'findhotel-website-ci' | 'findhotel-website-dev' | 'findhotel-checkout' | 'findhotel-checkout-e2e' | 'findhotel-checkout-stg';
|
|
10
11
|
interface Event {
|
|
11
12
|
name: string;
|
|
@@ -19,6 +20,7 @@ export interface SapiClient {
|
|
|
19
20
|
search: SearchHandler;
|
|
20
21
|
suggest: SuggestHandler;
|
|
21
22
|
hotel: HotelHandler;
|
|
23
|
+
offers: OffersHandler;
|
|
22
24
|
}
|
|
23
25
|
/** Options for initializing the Search API client. Persistent within single SAPI instance but may vary for different users */
|
|
24
26
|
export interface ClientOptions {
|
|
@@ -52,7 +52,6 @@ export interface OptionalSearchParameters {
|
|
|
52
52
|
cugDeals?: CugDeals;
|
|
53
53
|
originId?: string;
|
|
54
54
|
searchId?: string;
|
|
55
|
-
useAlternativeRaaKeys?: boolean;
|
|
56
55
|
skipGeoSearch?: boolean;
|
|
57
56
|
preferredRate?: number;
|
|
58
57
|
trafficSource?: string;
|
|
@@ -164,6 +163,8 @@ export interface Hit {
|
|
|
164
163
|
starRating: number;
|
|
165
164
|
themeIds: number[];
|
|
166
165
|
_geoloc: Partial<Location>;
|
|
166
|
+
chainID?: string;
|
|
167
|
+
parentChainID?: string;
|
|
167
168
|
}
|
|
168
169
|
/**
|
|
169
170
|
* Product
|
|
@@ -206,6 +207,7 @@ export interface ContentHotel {
|
|
|
206
207
|
checkInMinAge?: number;
|
|
207
208
|
reviewCount?: number;
|
|
208
209
|
chainID?: string;
|
|
210
|
+
parentChainID?: string;
|
|
209
211
|
checkInEnd?: string;
|
|
210
212
|
lastBooked?: number;
|
|
211
213
|
checkOutTime?: string;
|
|
@@ -219,6 +221,7 @@ export interface ContentHotel {
|
|
|
219
221
|
themes?: TranslatedLOVItem[];
|
|
220
222
|
propertyType?: TranslatedLOVItem;
|
|
221
223
|
sentiments?: TranslatedLOVItem[];
|
|
224
|
+
currency?: Currency;
|
|
222
225
|
}
|
|
223
226
|
export interface HotelAnchor extends Omit<HotelAnchorHit, 'hotelName' | 'placeADN' | 'placeDN'> {
|
|
224
227
|
placeDisplayName: string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OffersResponse } from '../offers-client';
|
|
2
|
+
import { HotelOfferEntity, Offer } from '../types';
|
|
3
|
+
interface Parameters {
|
|
4
|
+
sortField?: string;
|
|
5
|
+
sortOrder?: string;
|
|
6
|
+
filters?: {
|
|
7
|
+
priceMin?: number;
|
|
8
|
+
priceMax?: number;
|
|
9
|
+
};
|
|
10
|
+
priceBucketWidth?: number;
|
|
11
|
+
priceBucketsCount: number;
|
|
12
|
+
exchangeRate: number;
|
|
13
|
+
variations?: string[];
|
|
14
|
+
}
|
|
15
|
+
export declare function isOfferInPriceRange(offer: Offer, upperBound: number, priceMin?: number, priceMax?: number): boolean;
|
|
16
|
+
export declare function applyPriceFilter(parameters: Parameters, hotelOfferEntity: HotelOfferEntity): HotelOfferEntity;
|
|
17
|
+
export declare function buildOffersResponse(offersResults: OffersResponse, parameters: Parameters): {
|
|
18
|
+
hotelIds: string[];
|
|
19
|
+
hotelOfferEntities: Record<string, HotelOfferEntity>;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AnonymousId, ApiSearchParameters } from '../types';
|
|
1
|
+
import { AnonymousId, ApiSearchParameters, Country, Currency, Language } from '../types';
|
|
2
2
|
interface SearchIdOptions {
|
|
3
3
|
anonymousId: AnonymousId;
|
|
4
|
-
language:
|
|
5
|
-
currency:
|
|
6
|
-
countryCode:
|
|
4
|
+
language: Language;
|
|
5
|
+
currency: Currency;
|
|
6
|
+
countryCode: Country;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Generates a deterministic hash of a combination of ApiSearchParameters and SAPI options.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface SortingBoostParameters {
|
|
2
|
+
filters?: {
|
|
3
|
+
freeCancellation?: boolean;
|
|
4
|
+
};
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Generates sorting boost for offers request
|
|
8
|
+
*
|
|
9
|
+
* @param parameters - SortingBoostParameters
|
|
10
|
+
*/
|
|
11
|
+
export declare function generateSortingBoost(parameters: SortingBoostParameters): "freeCancellation=true:100" | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { CugDeals, HotelId, HotelOfferEntity, Logger } from '../types';
|
|
2
|
-
export interface OffersClient {
|
|
3
|
-
getOffers: GetOffers;
|
|
4
|
-
}
|
|
5
|
-
interface RaaOptions {
|
|
6
|
-
anonymousId: string;
|
|
7
|
-
currency: string;
|
|
8
|
-
countryCode: string;
|
|
9
|
-
language: string;
|
|
10
|
-
includeLocalTaxes?: boolean;
|
|
11
|
-
includeTaxes?: boolean;
|
|
12
|
-
skipBackendAugmentation?: boolean;
|
|
13
|
-
facetsEnabled?: boolean;
|
|
14
|
-
WebSocket?: any;
|
|
15
|
-
sapiCliKey?: string;
|
|
16
|
-
deviceType: string;
|
|
17
|
-
variations: string[];
|
|
18
|
-
logger: Logger;
|
|
19
|
-
}
|
|
20
|
-
export interface GetOffersParameters {
|
|
21
|
-
anchorHotelId?: HotelId;
|
|
22
|
-
hotelIds?: HotelId[];
|
|
23
|
-
cugDeals?: CugDeals;
|
|
24
|
-
getAllOffers?: boolean;
|
|
25
|
-
originId?: string;
|
|
26
|
-
useAlternativeRaaKeys?: boolean;
|
|
27
|
-
checkIn: string;
|
|
28
|
-
checkOut: string;
|
|
29
|
-
rooms: string;
|
|
30
|
-
searchId: string;
|
|
31
|
-
filters?: {
|
|
32
|
-
freeCancellation?: boolean;
|
|
33
|
-
};
|
|
34
|
-
preferredRate?: number;
|
|
35
|
-
trafficSource?: string;
|
|
36
|
-
}
|
|
37
|
-
export interface OffersResponse {
|
|
38
|
-
anchorHotelOfferEntity?: HotelOfferEntity;
|
|
39
|
-
hotelOfferEntities?: HotelOfferEntity[];
|
|
40
|
-
}
|
|
41
|
-
declare type GetOffers = (parameters: GetOffersParameters, onOffersReceived?: (response: OffersResponse) => void) => Promise<OffersResponse>;
|
|
42
|
-
export declare function raa(raaEndpoint: string, options: RaaOptions): {
|
|
43
|
-
getOffers: (parameters: GetOffersParameters, onOffersReceived?: ((response: OffersResponse) => void) | undefined) => Promise<OffersResponse>;
|
|
44
|
-
};
|
|
45
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { OffersResponse } from './raa';
|
|
2
|
-
import { HotelOfferEntity, Offer, TopOfferData, AnchorPriceRateBreakdown } from '../types';
|
|
3
|
-
interface Parameters {
|
|
4
|
-
sortField?: string;
|
|
5
|
-
sortOrder?: string;
|
|
6
|
-
filters?: {
|
|
7
|
-
priceMin?: number;
|
|
8
|
-
priceMax?: number;
|
|
9
|
-
};
|
|
10
|
-
priceBucketWidth?: number;
|
|
11
|
-
priceBucketsCount: number;
|
|
12
|
-
exchangeRate: number;
|
|
13
|
-
variations?: string[];
|
|
14
|
-
}
|
|
15
|
-
interface SortingBoostParameters {
|
|
16
|
-
filters?: {
|
|
17
|
-
freeCancellation?: boolean;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export declare function generateSortingBoost(parameters: SortingBoostParameters): "freeCancellation=true:100" | undefined;
|
|
21
|
-
export declare function isOfferInPriceRange(offer: Offer, upperBound: number, priceMin?: number, priceMax?: number): boolean;
|
|
22
|
-
export declare function applyPriceFilter(parameters: Parameters, hotelOfferEntity: HotelOfferEntity): HotelOfferEntity;
|
|
23
|
-
interface TopOfferDataWithAnchorPriceParameters {
|
|
24
|
-
topOfferData: TopOfferData;
|
|
25
|
-
anchorPriceRateBreakdown: AnchorPriceRateBreakdown;
|
|
26
|
-
}
|
|
27
|
-
export declare function augmentTopOfferDataWithAnchorPrice({ topOfferData, anchorPriceRateBreakdown }: TopOfferDataWithAnchorPriceParameters): TopOfferData;
|
|
28
|
-
export declare function augmentOffersWithAnchorPrice({ offers }: {
|
|
29
|
-
offers: Offer[];
|
|
30
|
-
}, topOfferData: TopOfferData): Offer[];
|
|
31
|
-
export declare function augmentHotelOffersWithAnchorPrice(hotelOfferEntity: HotelOfferEntity): HotelOfferEntity;
|
|
32
|
-
export declare function augmentRaaResponse(offersResults: OffersResponse, parameters: Parameters): {
|
|
33
|
-
hotelIds: string[];
|
|
34
|
-
hotelOfferEntities: Record<string, HotelOfferEntity>;
|
|
35
|
-
};
|
|
36
|
-
export {};
|