@findhotel/sapi 0.23.6 → 0.23.9
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/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 +1 -0
- package/dist/types/packages/core/src/backend-search.d.ts +11 -2
- package/dist/types/packages/core/src/hotel.d.ts +1 -0
- package/dist/types/packages/core/src/offers.d.ts +1 -0
- package/dist/types/packages/core/src/sapi.d.ts +1 -1
- package/dist/types/packages/core/src/types/types.d.ts +2 -0
- package/dist/types/packages/core/src/utils/omit.d.ts +2 -1
- package/package.json +10 -6
- package/CHANGELOG.md +0 -218
|
@@ -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 {};
|
|
@@ -2,13 +2,22 @@ import { Base, ProfileKey } from '.';
|
|
|
2
2
|
import { SearchResults, SearchHandler, SearchFnParameters } from './search';
|
|
3
3
|
import { SearchParameters } from './types';
|
|
4
4
|
declare type AttributesToRetrieve = keyof SearchResults;
|
|
5
|
-
interface
|
|
5
|
+
interface SearchRequestParameters {
|
|
6
|
+
searchId: string;
|
|
6
7
|
profileKey: ProfileKey;
|
|
7
8
|
searchParameters: SearchParameters;
|
|
8
9
|
options: Base['options'];
|
|
9
10
|
offset: number;
|
|
10
11
|
attributes?: AttributesToRetrieve[];
|
|
11
12
|
}
|
|
12
|
-
export declare function
|
|
13
|
+
export declare function createSearchRequestString({ profileKey, searchId, searchParameters, options, offset, attributes }: SearchRequestParameters): string;
|
|
14
|
+
interface AnchorRequestParameters {
|
|
15
|
+
searchId: string;
|
|
16
|
+
profileKey: ProfileKey;
|
|
17
|
+
searchParameters: SearchParameters;
|
|
18
|
+
options: Base['options'];
|
|
19
|
+
attributes?: AttributesToRetrieve[];
|
|
20
|
+
}
|
|
21
|
+
export declare function createAnchorRequestString({ profileKey, searchId, searchParameters, options, attributes }: AnchorRequestParameters): string;
|
|
13
22
|
export declare function backendSearch({ getFeatureEnabled, profileKey, appConfig, offersClient, options }: SearchFnParameters): SearchHandler;
|
|
14
23
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SearchClient } from 'algoliasearch';
|
|
2
2
|
import { Except } from 'type-fest';
|
|
3
|
-
import { OffersClient } from './
|
|
3
|
+
import { OffersClient } from './offers';
|
|
4
4
|
import { Configs } from './algolia';
|
|
5
5
|
import { AppConfig, Features } from './app-config';
|
|
6
6
|
import { ProfileKey, ClientOptions, SapiClient, Language, Logger } from './types';
|
|
@@ -193,6 +193,7 @@ export interface ContentHotel {
|
|
|
193
193
|
imageURIs: string[];
|
|
194
194
|
guestType: GuestType;
|
|
195
195
|
guestRating: GuestRating;
|
|
196
|
+
country?: string;
|
|
196
197
|
isDeleted?: boolean;
|
|
197
198
|
propertyTypeId?: number;
|
|
198
199
|
starRating?: number;
|
|
@@ -264,6 +265,7 @@ export declare type Meals = 'allInclusive' | 'breakfast' | 'partialBreakfast' |
|
|
|
264
265
|
export interface Offer {
|
|
265
266
|
additionalProviderParams: {
|
|
266
267
|
feedId: string;
|
|
268
|
+
rateType?: string;
|
|
267
269
|
};
|
|
268
270
|
id: string;
|
|
269
271
|
bookURI: 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.9",
|
|
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.39.1"
|
|
62
66
|
}
|
|
63
67
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
## [0.23.6](https://github.com/FindHotel/sapi/compare/v0.23.5...v0.23.6) (2022-03-21)
|
|
2
|
-
### Added
|
|
3
|
-
- `hotel()` method to get complete hotel information by hotelId
|
|
4
|
-
- `sapiOverride` parameter
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## [0.23.5](https://github.com/FindHotel/sapi/compare/v0.23.4...v0.23.5) (2022-03-04)
|
|
8
|
-
### Added
|
|
9
|
-
- SAF domain for STG environment
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## [0.23.4](https://github.com/FindHotel/sapi/compare/v0.23.3...v0.23.4) (2022-02-28)
|
|
13
|
-
### Changed
|
|
14
|
-
- SAF domain for E2E environment
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## [0.23.3](https://github.com/FindHotel/sapi/compare/v0.23.2...v0.23.3) (2022-02-22)
|
|
18
|
-
### Added
|
|
19
|
-
- Log WS errors and re-connects
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## [0.23.2](https://github.com/FindHotel/sapi/compare/v0.23.1...v0.23.2) (2022-02-16)
|
|
23
|
-
### Changed
|
|
24
|
-
- Change logic of free cancelation calculation
|
|
25
|
-
- Empty daedalus raa endpoint for e2e profile
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
## [0.23.1](https://github.com/FindHotel/sapi/compare/v0.23.0...v0.23.1) (2022-02-09)
|
|
29
|
-
### Added
|
|
30
|
-
- SAPI backend offers support.
|
|
31
|
-
- RAA V3 migration
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## [0.23.0](https://github.com/FindHotel/sapi/compare/v0.22.16...v0.23.0) (2022-02-09)
|
|
35
|
-
### Changed
|
|
36
|
-
- Skipped
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
## [0.22.16](https://github.com/FindHotel/sapi/compare/v0.22.15...v0.22.16) (2022-01-04)
|
|
40
|
-
### Added
|
|
41
|
-
- Added missing fields to Offer type
|
|
42
|
-
### Changed
|
|
43
|
-
- Clean-up of room-limit test
|
|
44
|
-
|
|
45
|
-
## [0.22.15](https://github.com/FindHotel/sapi/compare/v0.22.14...v0.22.15) (2021-12-27)
|
|
46
|
-
### Added
|
|
47
|
-
- Forward `anonymousId` to SAPI/search() backend endpoint
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
## [0.22.14](https://github.com/FindHotel/sapi/compare/v0.22.13...v0.22.14) (2021-12-17)
|
|
51
|
-
### Added
|
|
52
|
-
- `isDeleted` filter for autosuggest module
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
## [0.22.13](https://github.com/FindHotel/sapi/compare/v0.22.12...v0.22.13) (2021-12-15)
|
|
56
|
-
### Added
|
|
57
|
-
- Send A/B test variations to SAF/offers-rooms endpoint
|
|
58
|
-
|
|
59
|
-
## [0.22.12](https://github.com/FindHotel/sapi/compare/v0.22.11...v0.22.12) (2021-12-13)
|
|
60
|
-
### Changed
|
|
61
|
-
- `roomLimit` for anchor hotel has been set to 2 and for similar hotels to 1
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
## [0.22.11](https://github.com/FindHotel/sapi/compare/v0.22.10...v0.22.11) (2021-12-09)
|
|
65
|
-
### Changed
|
|
66
|
-
- SAF search replaced with SAPI backend search
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
## [0.22.10](https://github.com/FindHotel/sapi/compare/v0.22.9...v0.22.10) (2021-11-30)
|
|
70
|
-
### Added
|
|
71
|
-
- `boundingBox` parameter to SAF-search request
|
|
72
|
-
|
|
73
|
-
## [0.22.9](https://github.com/FindHotel/sapi/compare/v0.22.8...v0.22.9) (2021-11-24)
|
|
74
|
-
### Added
|
|
75
|
-
- Added missing field to suggest method
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
## [0.22.8](https://github.com/FindHotel/sapi/compare/v0.22.7...v0.22.8) (2021-11-16)
|
|
79
|
-
### Added
|
|
80
|
-
- `roomLimit` parameter for RAA requests
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
## [0.22.7](https://github.com/FindHotel/sapi/compare/v0.22.6...v0.22.7) (2021-11-09)
|
|
84
|
-
### Added
|
|
85
|
-
- clientRequestId for each individual WS request to RAA
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
## [0.22.6](https://github.com/FindHotel/sapi/compare/v0.22.5...v0.22.6) (2021-10-26)
|
|
89
|
-
### Fixed
|
|
90
|
-
- Rooms being undefined in SAPI.rooms() method
|
|
91
|
-
### Changed
|
|
92
|
-
- Bumped Immer to v9.0.6
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
## [0.22.5](https://github.com/FindHotel/sapi/compare/v0.22.4...v0.22.5) (2021-10-25)
|
|
96
|
-
### Added
|
|
97
|
-
- Forward `cugDeals` parameter to SAF/offers-rooms endpoint
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
## [0.22.4](https://github.com/FindHotel/sapi/compare/v0.22.3...v0.22.4) (2021-10-22)
|
|
101
|
-
### Added
|
|
102
|
-
- Forward `providerCode` parameter to SAF/offers-rooms endpoint
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
## [0.22.3](https://github.com/FindHotel/sapi/compare/v0.22.2...v0.22.3) (2021-10-11)
|
|
106
|
-
- Fetch missing anchorHotelId attribute for subsequent searches
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
## [0.22.2](https://github.com/FindHotel/sapi/compare/v0.22.1...v0.22.2) (2021-10-11)
|
|
110
|
-
### Fixed
|
|
111
|
-
- Fetch missing anchorHotelId attribute for subsequent searches
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
## [0.22.1](https://github.com/FindHotel/sapi/compare/v0.22.0...v0.22.1) (2021-10-06)
|
|
115
|
-
### Fixed
|
|
116
|
-
- Fetch missing attributes onload more hotels
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
## [0.22.0](https://github.com/FindHotel/sapi/compare/v0.21.2...v0.22.0) (2021-10-04)
|
|
120
|
-
### Added
|
|
121
|
-
- Support for SAF/search endpoint
|
|
122
|
-
### Changed
|
|
123
|
-
- sapi.getConfig() method replaced with onConfigReceived callback in SAPI client
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
## [0.21.2](https://github.com/FindHotel/sapi/compare/v0.21.1...v0.21.2) (2021-09-03)
|
|
127
|
-
### Changed
|
|
128
|
-
- Cloudfront url instead of CloudFlare for sapi-init
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
## [0.21.1](https://github.com/FindHotel/sapi/compare/v0.21.0...v0.21.1) (2021-08-31)
|
|
132
|
-
### Changed
|
|
133
|
-
- SAF custom domain
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
## [0.21.0](https://github.com/FindHotel/sapi/compare/v0.20.4...v0.21.0) (2021-08-26)
|
|
137
|
-
### Changed
|
|
138
|
-
- Use new Algolia index with separate HSO records for A/B test instead of switching HSO indices
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
## [0.20.4](https://github.com/FindHotel/sapi/compare/v0.20.3...v0.20.4) (2021-08-20)
|
|
142
|
-
### Added
|
|
143
|
-
- Basic logger implementation
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
## [0.20.3](https://github.com/FindHotel/sapi/compare/v0.20.2...v0.20.3) (2021-08-17)
|
|
147
|
-
### Changed
|
|
148
|
-
- Better error handling for fetch requests
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
## [0.20.2](https://github.com/FindHotel/sapi/compare/v0.20.1...v0.20.2) (2021-08-16)
|
|
152
|
-
### Changed
|
|
153
|
-
- Use first offer instead of cheapest to calculate deal score
|
|
154
|
-
### Fixed
|
|
155
|
-
- `regularPriceRange` being `[null, null]` changed to `undefined` in case of missing `priceBucketWidth`
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
## [0.20.1](https://github.com/FindHotel/sapi/compare/v0.19.3...v0.20.1) (2021-08-10)
|
|
159
|
-
### Changed
|
|
160
|
-
- SAPI initialisation requires only `profileKey` from now
|
|
161
|
-
|
|
162
|
-
### Added
|
|
163
|
-
- Added fallback for RAA WS endpoint in case it's empty in e2e environment
|
|
164
|
-
|
|
165
|
-
### Removed
|
|
166
|
-
- `clientId` and `clientKey` from sapi initialisation
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
## [0.19.3](https://github.com/FindHotel/sapi/compare/v0.19.1...v0.19.3) (2021-08-09)
|
|
170
|
-
### Fixed
|
|
171
|
-
- Docs generation
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
## [0.19.2](https://github.com/FindHotel/sapi/compare/v0.19.1...v0.19.2) (2021-08-09)
|
|
175
|
-
### Fixed
|
|
176
|
-
- Docs generation has been fixed
|
|
177
|
-
|
|
178
|
-
## [0.19.1](https://github.com/FindHotel/sapi/compare/v0.18.2...v0.19.1) (2021-08-05)
|
|
179
|
-
### Changed
|
|
180
|
-
- Disabled docs generation temporary
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
## [0.19.0](https://github.com/FindHotel/sapi/compare/v0.18.2...v0.19.0) (2021-08-05)
|
|
184
|
-
### Added
|
|
185
|
-
- Support for SAF (Search Application Frontend) init
|
|
186
|
-
|
|
187
|
-
### Changed
|
|
188
|
-
- Use internal profiles instead of external dependency
|
|
189
|
-
- `initWithConfig` renamed to `initWithProfile`
|
|
190
|
-
- Removed support of `variationIds` option
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
## [0.18.2](https://github.com/FindHotel/sapi/compare/v0.18.1...v0.18.2) (2021-06-29)
|
|
194
|
-
|
|
195
|
-
### Changed
|
|
196
|
-
- Change types path
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
## [0.18.1](https://github.com/FindHotel/sapi/compare/v0.18.0...v0.18.1) (2021-06-29)
|
|
200
|
-
|
|
201
|
-
### Changed
|
|
202
|
-
- Move `dependencies` to `devDependencies`
|
|
203
|
-
|
|
204
|
-
## [0.18.0](https://github.com/FindHotel/sapi/compare/v0.17.1...v0.18.0) (2021-06-29)
|
|
205
|
-
|
|
206
|
-
### Changed
|
|
207
|
-
- Rename `locale` to `language` when using SAF/offers-rooms
|
|
208
|
-
- Replace `merchantOfRecord` with `canPayLater`
|
|
209
|
-
- Stop sending `_rankingInfo`
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
## [0.17.1](https://github.com/FindHotel/sapi/compare/v0.16.1...v0.17.1) (2021-06-29)
|
|
213
|
-
|
|
214
|
-
### Added
|
|
215
|
-
- Use ShipJs for releases
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|