@findhotel/sapi 0.23.4 → 0.23.7
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 +158 -3
- package/dist/index.js +1 -1
- package/dist/types/packages/core/src/algolia/configs.d.ts +1 -1
- package/dist/types/packages/core/src/algolia/get-anchor.d.ts +2 -2
- package/dist/types/packages/core/src/app-config.d.ts +2 -2
- package/dist/types/packages/core/src/backend-search.d.ts +2 -2
- package/dist/types/packages/core/src/hotel.d.ts +57 -0
- package/dist/types/packages/core/src/hotel.test.d.ts +1 -0
- package/dist/types/packages/core/src/rooms.d.ts +3 -3
- package/dist/types/packages/core/src/sapi.d.ts +3 -3
- package/dist/types/packages/core/src/search.d.ts +2 -2
- package/dist/types/packages/core/src/suggest.d.ts +2 -2
- package/dist/types/packages/core/src/types/index.d.ts +0 -1
- package/dist/types/packages/core/src/types/sapi-client.d.ts +9 -7
- package/dist/types/packages/core/src/types/types.d.ts +51 -1
- package/dist/types/packages/core/src/utils/omit.d.ts +2 -1
- package/package.json +10 -6
- package/CHANGELOG.md +0 -207
- package/dist/types/packages/core/src/types/sapi-configs.d.ts +0 -27
|
@@ -54,7 +54,7 @@ export declare function evaluateHsoConfigs(context: HsoConfigContext, configs?:
|
|
|
54
54
|
*
|
|
55
55
|
* @param hits
|
|
56
56
|
*/
|
|
57
|
-
export declare function exchangeRatesFromResponse(hits: ExchangeRateHit[]):
|
|
57
|
+
export declare function exchangeRatesFromResponse(hits: ExchangeRateHit[]): ExchangeRates;
|
|
58
58
|
/**
|
|
59
59
|
* Get LOV attributes to retrieve with Translated attributes
|
|
60
60
|
*
|
|
@@ -19,8 +19,8 @@ interface IndicesConfiguration {
|
|
|
19
19
|
export declare function getAnchor({ search }: AlgoliaClient, { autocompleteIndex, hotelIndex }: IndicesConfiguration, { languages }: {
|
|
20
20
|
languages: string[];
|
|
21
21
|
}): (parameters: GetAnchorParameters) => Promise<{
|
|
22
|
-
anchor:
|
|
22
|
+
anchor: import("..").HotelAnchor | import("..").PlaceAnchor;
|
|
23
23
|
anchorHotel: Hotel | undefined;
|
|
24
|
-
anchorType:
|
|
24
|
+
anchorType: "hotel" | "place";
|
|
25
25
|
}>;
|
|
26
26
|
export {};
|
|
@@ -3,7 +3,7 @@ import { ProfileKey, IndexVariation } from './types';
|
|
|
3
3
|
* Fixed number of price bucket count
|
|
4
4
|
*/
|
|
5
5
|
export declare const PRICE_BUCKET_COUNT = 31;
|
|
6
|
-
declare type Features = 'offers' | 'search' | 'suggests' | 'configs' | 'rooms';
|
|
6
|
+
export declare type Features = 'offers' | 'search' | 'suggests' | 'configs' | 'rooms' | 'get-hotel';
|
|
7
7
|
export interface AppConfig {
|
|
8
8
|
daedalus: {
|
|
9
9
|
raaEndpoint: string | undefined;
|
|
@@ -20,6 +20,7 @@ export interface AppConfig {
|
|
|
20
20
|
endpoints: {
|
|
21
21
|
offersRooms: string;
|
|
22
22
|
search: string;
|
|
23
|
+
hotel: string;
|
|
23
24
|
};
|
|
24
25
|
};
|
|
25
26
|
algolia: {
|
|
@@ -38,4 +39,3 @@ export interface AppConfig {
|
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
41
|
export declare function getAppConfig(profileKey: ProfileKey, initWithAppConfig?: Partial<AppConfig>): AppConfig;
|
|
41
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Base, ProfileKey } from '.';
|
|
2
|
-
import { SearchResults,
|
|
2
|
+
import { SearchResults, SearchHandler, SearchFnParameters } from './search';
|
|
3
3
|
import { SearchParameters } from './types';
|
|
4
4
|
declare type AttributesToRetrieve = keyof SearchResults;
|
|
5
5
|
interface RequestParameters {
|
|
@@ -10,5 +10,5 @@ interface RequestParameters {
|
|
|
10
10
|
attributes?: AttributesToRetrieve[];
|
|
11
11
|
}
|
|
12
12
|
export declare function createRequestString({ profileKey, searchParameters, options, offset, attributes }: RequestParameters): string;
|
|
13
|
-
export declare function backendSearch({ getFeatureEnabled, profileKey, appConfig, offersClient, options }: SearchFnParameters):
|
|
13
|
+
export declare function backendSearch({ getFeatureEnabled, profileKey, appConfig, offersClient, options }: SearchFnParameters): SearchHandler;
|
|
14
14
|
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { BaseWithConfig } from '.';
|
|
2
|
+
import { Language, HotelId, TranslatedString, GuestRating, GuestType, Location, TranslatedArray, Pricing, ContentHotel, LOVItem } from './types';
|
|
3
|
+
export interface SafHotel {
|
|
4
|
+
objectID: HotelId;
|
|
5
|
+
_geoloc: Location;
|
|
6
|
+
hotelName: TranslatedString;
|
|
7
|
+
imageURIs: string[];
|
|
8
|
+
guestType: GuestType;
|
|
9
|
+
guestRating: GuestRating;
|
|
10
|
+
address?: TranslatedString;
|
|
11
|
+
isDeleted?: boolean;
|
|
12
|
+
updatedAt?: number;
|
|
13
|
+
propertyTypeId?: number;
|
|
14
|
+
starRating?: number;
|
|
15
|
+
feesOpt?: TranslatedString;
|
|
16
|
+
placeADName?: TranslatedArray;
|
|
17
|
+
checkInSpInst?: TranslatedString;
|
|
18
|
+
policies?: TranslatedString;
|
|
19
|
+
phone?: string;
|
|
20
|
+
checkInTime?: string;
|
|
21
|
+
placeDN?: TranslatedArray;
|
|
22
|
+
checkInInst?: TranslatedString;
|
|
23
|
+
checkInMinAge?: number;
|
|
24
|
+
reviewCount?: number;
|
|
25
|
+
chainID?: string;
|
|
26
|
+
checkInEnd?: string;
|
|
27
|
+
lastBooked?: number;
|
|
28
|
+
checkOutTime?: string;
|
|
29
|
+
themeIds?: number[];
|
|
30
|
+
feesMnd?: TranslatedString;
|
|
31
|
+
reviewCountBkt?: number;
|
|
32
|
+
placeID?: string;
|
|
33
|
+
pricing?: Pricing;
|
|
34
|
+
facilities?: LOVItem[];
|
|
35
|
+
themes?: LOVItem[];
|
|
36
|
+
propertyType?: LOVItem;
|
|
37
|
+
sentiments?: LOVItem[];
|
|
38
|
+
}
|
|
39
|
+
export declare type HotelHandler = (hotelId: HotelId) => Promise<ContentHotel>;
|
|
40
|
+
export declare function safToSapiHotel(safHotel: SafHotel, languages: Language[]): ContentHotel;
|
|
41
|
+
/**
|
|
42
|
+
* Creates hotel request string
|
|
43
|
+
*
|
|
44
|
+
* @param hotelId - Requested hotel id
|
|
45
|
+
* @param languages - list of languages with fallback
|
|
46
|
+
*
|
|
47
|
+
* @returns request string
|
|
48
|
+
*/
|
|
49
|
+
export declare function createRequestString(hotelId: HotelId, languages: Language[]): string;
|
|
50
|
+
/**
|
|
51
|
+
* Creates hotel function with binded in configuration object
|
|
52
|
+
*
|
|
53
|
+
* @param configuration - Configuration for hotel function initialisation
|
|
54
|
+
*
|
|
55
|
+
* @returns function that asynchronously returns hotel's content by hotelId
|
|
56
|
+
*/
|
|
57
|
+
export declare function hotel({ appConfig, options }: Pick<BaseWithConfig, 'options' | 'appConfig'>): HotelHandler;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BaseWithConfig } from '.';
|
|
2
2
|
import { RoomsRequestParameters, RoomsRequestOptions, RoomsResults } from './types';
|
|
3
|
-
export declare type
|
|
3
|
+
export declare type RoomsHandler = (parameters: RoomsRequestParameters) => Promise<RoomsResults>;
|
|
4
4
|
/**
|
|
5
5
|
* Creates rooms request string.
|
|
6
6
|
*
|
|
7
7
|
* @param parameters - Rooms request parameters - dynamic parameters that change search
|
|
8
|
-
* @param options - Rooms request options -
|
|
8
|
+
* @param options - Rooms request options - persistent within single SAPI instance
|
|
9
9
|
*
|
|
10
10
|
* @returns request string
|
|
11
11
|
*
|
|
@@ -38,4 +38,4 @@ export declare function createRequestString(parameters: RoomsRequestParameters,
|
|
|
38
38
|
*
|
|
39
39
|
* @returns rooms search function
|
|
40
40
|
*/
|
|
41
|
-
export declare function rooms({ appConfig, options }: Pick<BaseWithConfig, 'options' | 'appConfig'>):
|
|
41
|
+
export declare function rooms({ appConfig, options }: Pick<BaseWithConfig, 'options' | 'appConfig'>): RoomsHandler;
|
|
@@ -2,14 +2,14 @@ import { SearchClient } from 'algoliasearch';
|
|
|
2
2
|
import { Except } from 'type-fest';
|
|
3
3
|
import { OffersClient } from './raa';
|
|
4
4
|
import { Configs } from './algolia';
|
|
5
|
-
import { AppConfig } from './app-config';
|
|
6
|
-
import { ProfileKey, ClientOptions, SapiClient,
|
|
5
|
+
import { AppConfig, Features } from './app-config';
|
|
6
|
+
import { ProfileKey, ClientOptions, SapiClient, Language, Logger } from './types';
|
|
7
7
|
export declare type AlgoliaClient = Pick<SearchClient, 'search'>;
|
|
8
8
|
export interface Base {
|
|
9
9
|
/** SAPI client application config */
|
|
10
10
|
appConfig: AppConfig;
|
|
11
11
|
/** Check if SAPI feature is enabled */
|
|
12
|
-
getFeatureEnabled: (feature:
|
|
12
|
+
getFeatureEnabled: (feature: Features) => boolean;
|
|
13
13
|
/** Instance of Algolia Client */
|
|
14
14
|
algoliaClient: AlgoliaClient;
|
|
15
15
|
/** Instance of Offers Client */
|
|
@@ -31,7 +31,7 @@ interface Options {
|
|
|
31
31
|
countryCode: string;
|
|
32
32
|
pageSize: number;
|
|
33
33
|
}
|
|
34
|
-
export declare type
|
|
34
|
+
export declare type SearchHandler = (parameters: ApiSearchParameters, callbacks?: {
|
|
35
35
|
onStart?: OnStart;
|
|
36
36
|
onAnchorReceived?: OnAnchorReceived;
|
|
37
37
|
onHotelsReceived?: OnHotelsReceived;
|
|
@@ -44,5 +44,5 @@ export declare type SearchFn = (parameters: ApiSearchParameters, callbacks?: {
|
|
|
44
44
|
export declare function prepareSearchParameters(parameters: ApiSearchParameters, dates: DatesConfig): SearchParameters;
|
|
45
45
|
export declare function getRequestSize(anchorObject: AnchorObject, parameters: SearchParameters, options: Options): number;
|
|
46
46
|
export declare type SearchFnParameters = Pick<BaseWithConfig, 'profileKey' | 'options' | 'appConfig' | 'algoliaClient' | 'offersClient' | 'configs' | 'getFeatureEnabled'>;
|
|
47
|
-
export declare function search({ getFeatureEnabled, appConfig, algoliaClient, offersClient, options, configs }: SearchFnParameters):
|
|
47
|
+
export declare function search({ getFeatureEnabled, appConfig, algoliaClient, offersClient, options, configs }: SearchFnParameters): SearchHandler;
|
|
48
48
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Base } from '.';
|
|
2
2
|
import { Suggestion } from './types';
|
|
3
|
-
export declare type
|
|
4
|
-
export declare function suggest(base: Base):
|
|
3
|
+
export declare type SuggestHandler = (query: string, suggestsCount?: number) => Promise<Suggestion[]>;
|
|
4
|
+
export declare function suggest(base: Base): SuggestHandler;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { AlgoliaSearchOptions } from 'algoliasearch';
|
|
2
2
|
import { AnonymousId, Language, Currency, Country, DeviceType, Brand } from './types';
|
|
3
3
|
import { AppConfig } from '../app-config';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { SearchHandler } from '../search';
|
|
5
|
+
import { RoomsHandler } from '../rooms';
|
|
6
|
+
import { HotelHandler } from '../hotel';
|
|
7
|
+
import { SuggestHandler } from '../suggest';
|
|
7
8
|
import { Configs } from '../algolia';
|
|
8
|
-
export declare type ProfileKey = 'findhotel-website' | 'findhotel-website-e2e' | 'findhotel-website-stg' | 'findhotel-website-ci' | 'findhotel-website-dev' | 'findhotel-checkout' | 'findhotel-checkout-e2e';
|
|
9
|
+
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';
|
|
9
10
|
interface Event {
|
|
10
11
|
name: string;
|
|
11
12
|
value: any;
|
|
@@ -14,9 +15,10 @@ export interface Logger {
|
|
|
14
15
|
log: (event: Event) => void;
|
|
15
16
|
}
|
|
16
17
|
export interface SapiClient {
|
|
17
|
-
rooms:
|
|
18
|
-
search:
|
|
19
|
-
suggest:
|
|
18
|
+
rooms: RoomsHandler;
|
|
19
|
+
search: SearchHandler;
|
|
20
|
+
suggest: SuggestHandler;
|
|
21
|
+
hotel: HotelHandler;
|
|
20
22
|
}
|
|
21
23
|
/** Options for initializing the Search API client. Persistent within single SAPI instance but may vary for different users */
|
|
22
24
|
export interface ClientOptions {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export interface IndexVariation {
|
|
2
|
+
name: string;
|
|
3
|
+
objectID?: string;
|
|
4
|
+
variationID?: string;
|
|
5
|
+
}
|
|
1
6
|
/**
|
|
2
7
|
* Unique ID identifying users
|
|
3
8
|
*
|
|
@@ -136,7 +141,7 @@ export interface HotelSuggestHit extends BasicSuggestHit {
|
|
|
136
141
|
};
|
|
137
142
|
}
|
|
138
143
|
export declare type SuggestHit = HotelSuggestHit | PlaceSuggestHit;
|
|
139
|
-
/** Hit */
|
|
144
|
+
/** Search Hit */
|
|
140
145
|
export interface Hit {
|
|
141
146
|
address: TranslatedString;
|
|
142
147
|
checkInTime: string;
|
|
@@ -163,12 +168,57 @@ export interface Hit {
|
|
|
163
168
|
/**
|
|
164
169
|
* Product
|
|
165
170
|
*/
|
|
171
|
+
export interface LOVItem {
|
|
172
|
+
importance?: number;
|
|
173
|
+
categoryID?: number;
|
|
174
|
+
id: number;
|
|
175
|
+
value: TranslatedString;
|
|
176
|
+
}
|
|
177
|
+
export interface TranslatedLOVItem {
|
|
178
|
+
importance?: number;
|
|
179
|
+
categoryID?: number;
|
|
180
|
+
id: number;
|
|
181
|
+
value: string;
|
|
182
|
+
}
|
|
166
183
|
export interface Hotel extends Omit<Hit, 'hotelName' | 'address' | 'placeDN' | 'placeADName'> {
|
|
167
184
|
displayAddress: string;
|
|
168
185
|
hotelName: string;
|
|
169
186
|
placeDisplayName: string;
|
|
170
187
|
regularPriceRange?: [number, number];
|
|
171
188
|
}
|
|
189
|
+
export interface ContentHotel {
|
|
190
|
+
objectID: HotelId;
|
|
191
|
+
_geoloc: Location;
|
|
192
|
+
hotelName: string;
|
|
193
|
+
imageURIs: string[];
|
|
194
|
+
guestType: GuestType;
|
|
195
|
+
guestRating: GuestRating;
|
|
196
|
+
isDeleted?: boolean;
|
|
197
|
+
propertyTypeId?: number;
|
|
198
|
+
starRating?: number;
|
|
199
|
+
feesOpt?: string;
|
|
200
|
+
checkInSpInst?: string;
|
|
201
|
+
policies?: string;
|
|
202
|
+
phone?: string;
|
|
203
|
+
checkInTime?: string;
|
|
204
|
+
checkInInst?: string;
|
|
205
|
+
checkInMinAge?: number;
|
|
206
|
+
reviewCount?: number;
|
|
207
|
+
chainID?: string;
|
|
208
|
+
checkInEnd?: string;
|
|
209
|
+
lastBooked?: number;
|
|
210
|
+
checkOutTime?: string;
|
|
211
|
+
feesMnd?: string;
|
|
212
|
+
reviewCountBkt?: number;
|
|
213
|
+
placeID?: string;
|
|
214
|
+
pricing?: Pricing;
|
|
215
|
+
placeDisplayName?: string;
|
|
216
|
+
displayAddress?: string;
|
|
217
|
+
facilities?: TranslatedLOVItem[];
|
|
218
|
+
themes?: TranslatedLOVItem[];
|
|
219
|
+
propertyType?: TranslatedLOVItem;
|
|
220
|
+
sentiments?: TranslatedLOVItem[];
|
|
221
|
+
}
|
|
172
222
|
export interface HotelAnchor extends Omit<HotelAnchorHit, 'hotelName' | 'placeADN' | 'placeDN'> {
|
|
173
223
|
placeDisplayName: string;
|
|
174
224
|
hotelName: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Except } from 'type-fest';
|
|
1
2
|
/**
|
|
2
3
|
* Removes specified `keys` from `object`
|
|
3
4
|
*
|
|
@@ -6,4 +7,4 @@
|
|
|
6
7
|
* @param keys keys of the properties to remove from `object`
|
|
7
8
|
* @param object target object to emit `properties` from
|
|
8
9
|
*/
|
|
9
|
-
export declare function omit<O, K extends keyof O>(keys: readonly K[], object: O):
|
|
10
|
+
export declare function omit<O, K extends keyof O>(keys: readonly K[], object: O): Except<O, K>;
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@findhotel/sapi",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.7",
|
|
4
4
|
"description": "FindHotel Search API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/types/packages/core/src",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=16.0.0",
|
|
12
|
+
"npm": ">=7.10.0"
|
|
13
|
+
},
|
|
10
14
|
"scripts": {
|
|
11
15
|
"clean:dist": "rm -rf dist",
|
|
12
16
|
"build": "rollup -c && tsc --outDir dist/lib --declarationDir dist/types --declaration true --emitDeclarationOnly",
|
|
@@ -47,17 +51,17 @@
|
|
|
47
51
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
48
52
|
"husky": "^5.0.6",
|
|
49
53
|
"jest": "^26.6.3",
|
|
50
|
-
"lerna": "^
|
|
54
|
+
"lerna": "^4.0.0",
|
|
51
55
|
"rollup": "^2.33.3",
|
|
52
56
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
53
57
|
"rollup-plugin-terser": "^7.0.2",
|
|
54
58
|
"rollup-plugin-visualizer": "^5.5.0",
|
|
55
|
-
"shipjs": "0.
|
|
59
|
+
"shipjs": "^0.24.3",
|
|
56
60
|
"ts-jest": "^26.4.4",
|
|
57
|
-
"tslib": "^2.
|
|
61
|
+
"tslib": "^2.3.1",
|
|
58
62
|
"type-fest": "^0.20.2",
|
|
59
|
-
"typedoc": "^0.
|
|
63
|
+
"typedoc": "^0.22.13",
|
|
60
64
|
"typescript": "^4.1.2",
|
|
61
|
-
"xo": "^0.
|
|
65
|
+
"xo": "^0.48.0"
|
|
62
66
|
}
|
|
63
67
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
## [0.23.4](https://github.com/FindHotel/sapi/compare/v0.23.3...v0.23.4) (2022-02-28)
|
|
2
|
-
### Changed
|
|
3
|
-
- SAF domain for E2E environment
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## [0.23.3](https://github.com/FindHotel/sapi/compare/v0.23.2...v0.23.3) (2022-02-22)
|
|
7
|
-
### Added
|
|
8
|
-
- Log WS errors and re-connects
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## [0.23.2](https://github.com/FindHotel/sapi/compare/v0.23.1...v0.23.2) (2022-02-16)
|
|
12
|
-
### Changed
|
|
13
|
-
- Change logic of free cancelation calculation
|
|
14
|
-
- Empty daedalus raa endpoint for e2e profile
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## [0.23.1](https://github.com/FindHotel/sapi/compare/v0.23.0...v0.23.1) (2022-02-09)
|
|
18
|
-
### Added
|
|
19
|
-
- SAPI backend offers support.
|
|
20
|
-
- RAA V3 migration
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
## [0.23.0](https://github.com/FindHotel/sapi/compare/v0.22.16...v0.23.0) (2022-02-09)
|
|
24
|
-
### Changed
|
|
25
|
-
- Skipped
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
## [0.22.16](https://github.com/FindHotel/sapi/compare/v0.22.15...v0.22.16) (2022-01-04)
|
|
29
|
-
### Added
|
|
30
|
-
- Added missing fields to Offer type
|
|
31
|
-
### Changed
|
|
32
|
-
- Clean-up of room-limit test
|
|
33
|
-
|
|
34
|
-
## [0.22.15](https://github.com/FindHotel/sapi/compare/v0.22.14...v0.22.15) (2021-12-27)
|
|
35
|
-
### Added
|
|
36
|
-
- Forward `anonymousId` to SAPI/search() backend endpoint
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
## [0.22.14](https://github.com/FindHotel/sapi/compare/v0.22.13...v0.22.14) (2021-12-17)
|
|
40
|
-
### Added
|
|
41
|
-
- `isDeleted` filter for autosuggest module
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
## [0.22.13](https://github.com/FindHotel/sapi/compare/v0.22.12...v0.22.13) (2021-12-15)
|
|
45
|
-
### Added
|
|
46
|
-
- Send A/B test variations to SAF/offers-rooms endpoint
|
|
47
|
-
|
|
48
|
-
## [0.22.12](https://github.com/FindHotel/sapi/compare/v0.22.11...v0.22.12) (2021-12-13)
|
|
49
|
-
### Changed
|
|
50
|
-
- `roomLimit` for anchor hotel has been set to 2 and for similar hotels to 1
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
## [0.22.11](https://github.com/FindHotel/sapi/compare/v0.22.10...v0.22.11) (2021-12-09)
|
|
54
|
-
### Changed
|
|
55
|
-
- SAF search replaced with SAPI backend search
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
## [0.22.10](https://github.com/FindHotel/sapi/compare/v0.22.9...v0.22.10) (2021-11-30)
|
|
59
|
-
### Added
|
|
60
|
-
- `boundingBox` parameter to SAF-search request
|
|
61
|
-
|
|
62
|
-
## [0.22.9](https://github.com/FindHotel/sapi/compare/v0.22.8...v0.22.9) (2021-11-24)
|
|
63
|
-
### Added
|
|
64
|
-
- Added missing field to suggest method
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
## [0.22.8](https://github.com/FindHotel/sapi/compare/v0.22.7...v0.22.8) (2021-11-16)
|
|
68
|
-
### Added
|
|
69
|
-
- `roomLimit` parameter for RAA requests
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
## [0.22.7](https://github.com/FindHotel/sapi/compare/v0.22.6...v0.22.7) (2021-11-09)
|
|
73
|
-
### Added
|
|
74
|
-
- clientRequestId for each individual WS request to RAA
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
## [0.22.6](https://github.com/FindHotel/sapi/compare/v0.22.5...v0.22.6) (2021-10-26)
|
|
78
|
-
### Fixed
|
|
79
|
-
- Rooms being undefined in SAPI.rooms() method
|
|
80
|
-
### Changed
|
|
81
|
-
- Bumped Immer to v9.0.6
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
## [0.22.5](https://github.com/FindHotel/sapi/compare/v0.22.4...v0.22.5) (2021-10-25)
|
|
85
|
-
### Added
|
|
86
|
-
- Forward `cugDeals` parameter to SAF/offers-rooms endpoint
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
## [0.22.4](https://github.com/FindHotel/sapi/compare/v0.22.3...v0.22.4) (2021-10-22)
|
|
90
|
-
### Added
|
|
91
|
-
- Forward `providerCode` parameter to SAF/offers-rooms endpoint
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
## [0.22.3](https://github.com/FindHotel/sapi/compare/v0.22.2...v0.22.3) (2021-10-11)
|
|
95
|
-
- Fetch missing anchorHotelId attribute for subsequent searches
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
## [0.22.2](https://github.com/FindHotel/sapi/compare/v0.22.1...v0.22.2) (2021-10-11)
|
|
99
|
-
### Fixed
|
|
100
|
-
- Fetch missing anchorHotelId attribute for subsequent searches
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
## [0.22.1](https://github.com/FindHotel/sapi/compare/v0.22.0...v0.22.1) (2021-10-06)
|
|
104
|
-
### Fixed
|
|
105
|
-
- Fetch missing attributes onload more hotels
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
## [0.22.0](https://github.com/FindHotel/sapi/compare/v0.21.2...v0.22.0) (2021-10-04)
|
|
109
|
-
### Added
|
|
110
|
-
- Support for SAF/search endpoint
|
|
111
|
-
### Changed
|
|
112
|
-
- sapi.getConfig() method replaced with onConfigReceived callback in SAPI client
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
## [0.21.2](https://github.com/FindHotel/sapi/compare/v0.21.1...v0.21.2) (2021-09-03)
|
|
116
|
-
### Changed
|
|
117
|
-
- Cloudfront url instead of CloudFlare for sapi-init
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
## [0.21.1](https://github.com/FindHotel/sapi/compare/v0.21.0...v0.21.1) (2021-08-31)
|
|
121
|
-
### Changed
|
|
122
|
-
- SAF custom domain
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
## [0.21.0](https://github.com/FindHotel/sapi/compare/v0.20.4...v0.21.0) (2021-08-26)
|
|
126
|
-
### Changed
|
|
127
|
-
- Use new Algolia index with separate HSO records for A/B test instead of switching HSO indices
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
## [0.20.4](https://github.com/FindHotel/sapi/compare/v0.20.3...v0.20.4) (2021-08-20)
|
|
131
|
-
### Added
|
|
132
|
-
- Basic logger implementation
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
## [0.20.3](https://github.com/FindHotel/sapi/compare/v0.20.2...v0.20.3) (2021-08-17)
|
|
136
|
-
### Changed
|
|
137
|
-
- Better error handling for fetch requests
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
## [0.20.2](https://github.com/FindHotel/sapi/compare/v0.20.1...v0.20.2) (2021-08-16)
|
|
141
|
-
### Changed
|
|
142
|
-
- Use first offer instead of cheapest to calculate deal score
|
|
143
|
-
### Fixed
|
|
144
|
-
- `regularPriceRange` being `[null, null]` changed to `undefined` in case of missing `priceBucketWidth`
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
## [0.20.1](https://github.com/FindHotel/sapi/compare/v0.19.3...v0.20.1) (2021-08-10)
|
|
148
|
-
### Changed
|
|
149
|
-
- SAPI initialisation requires only `profileKey` from now
|
|
150
|
-
|
|
151
|
-
### Added
|
|
152
|
-
- Added fallback for RAA WS endpoint in case it's empty in e2e environment
|
|
153
|
-
|
|
154
|
-
### Removed
|
|
155
|
-
- `clientId` and `clientKey` from sapi initialisation
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
## [0.19.3](https://github.com/FindHotel/sapi/compare/v0.19.1...v0.19.3) (2021-08-09)
|
|
159
|
-
### Fixed
|
|
160
|
-
- Docs generation
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
## [0.19.2](https://github.com/FindHotel/sapi/compare/v0.19.1...v0.19.2) (2021-08-09)
|
|
164
|
-
### Fixed
|
|
165
|
-
- Docs generation has been fixed
|
|
166
|
-
|
|
167
|
-
## [0.19.1](https://github.com/FindHotel/sapi/compare/v0.18.2...v0.19.1) (2021-08-05)
|
|
168
|
-
### Changed
|
|
169
|
-
- Disabled docs generation temporary
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
## [0.19.0](https://github.com/FindHotel/sapi/compare/v0.18.2...v0.19.0) (2021-08-05)
|
|
173
|
-
### Added
|
|
174
|
-
- Support for SAF (Search Application Frontend) init
|
|
175
|
-
|
|
176
|
-
### Changed
|
|
177
|
-
- Use internal profiles instead of external dependency
|
|
178
|
-
- `initWithConfig` renamed to `initWithProfile`
|
|
179
|
-
- Removed support of `variationIds` option
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
## [0.18.2](https://github.com/FindHotel/sapi/compare/v0.18.1...v0.18.2) (2021-06-29)
|
|
183
|
-
|
|
184
|
-
### Changed
|
|
185
|
-
- Change types path
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
## [0.18.1](https://github.com/FindHotel/sapi/compare/v0.18.0...v0.18.1) (2021-06-29)
|
|
189
|
-
|
|
190
|
-
### Changed
|
|
191
|
-
- Move `dependencies` to `devDependencies`
|
|
192
|
-
|
|
193
|
-
## [0.18.0](https://github.com/FindHotel/sapi/compare/v0.17.1...v0.18.0) (2021-06-29)
|
|
194
|
-
|
|
195
|
-
### Changed
|
|
196
|
-
- Rename `locale` to `language` when using SAF/offers-rooms
|
|
197
|
-
- Replace `merchantOfRecord` with `canPayLater`
|
|
198
|
-
- Stop sending `_rankingInfo`
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
## [0.17.1](https://github.com/FindHotel/sapi/compare/v0.16.1...v0.17.1) (2021-06-29)
|
|
202
|
-
|
|
203
|
-
### Added
|
|
204
|
-
- Use ShipJs for releases
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { DateString, Language } from './types';
|
|
2
|
-
export declare type SapiFeature = 'offers' | 'search' | 'rooms' | 'suggests' | 'configs';
|
|
3
|
-
export interface IndexVariation {
|
|
4
|
-
name: string;
|
|
5
|
-
objectID?: string;
|
|
6
|
-
variationID?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface Profile {
|
|
9
|
-
features: SapiFeature[];
|
|
10
|
-
blockedDefaultDates: DateString[];
|
|
11
|
-
daysFromNow: number;
|
|
12
|
-
fallbackLanguages: Record<Language, Language[]>;
|
|
13
|
-
hotelIndex: string;
|
|
14
|
-
autocompleteIndex: string;
|
|
15
|
-
lovIndex: string;
|
|
16
|
-
currencyIndex: string;
|
|
17
|
-
hsoIndex: IndexVariation[];
|
|
18
|
-
raa: {
|
|
19
|
-
endpoint?: string;
|
|
20
|
-
};
|
|
21
|
-
offers: {
|
|
22
|
-
endpoint: string;
|
|
23
|
-
};
|
|
24
|
-
algolia: {
|
|
25
|
-
apiKey: string;
|
|
26
|
-
};
|
|
27
|
-
}
|