@findhotel/sapi 1.0.0-beta.0 → 1.0.1-beta.0
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 +14 -14
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/packages/core/src/types/offers.d.ts +1 -9
- package/dist/types/packages/core/src/types/options.d.ts +5 -5
- package/dist/types/packages/core/src/utils/build-offers-response.d.ts +2 -2
- package/dist/types/packages/core/src/utils/cheapest-rate.d.ts +2 -2
- package/dist/types/packages/core/src/utils/{total-rate-formula.d.ts → get-total-rate.d.ts} +3 -2
- package/dist/types/packages/core/src/utils/index.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -258,7 +258,7 @@ const sapiClient = await sapi(profileKey, {
|
|
|
258
258
|
log('Config received', config)
|
|
259
259
|
}
|
|
260
260
|
},
|
|
261
|
-
|
|
261
|
+
getTotalRate: (rate) => {
|
|
262
262
|
let totalRate = rate.base
|
|
263
263
|
if (includeTaxes) totalRate += rate.taxes
|
|
264
264
|
if (includeHotelFees) totalRate += rate.hotelFees
|
|
@@ -271,19 +271,19 @@ const sapiClient = await sapi(profileKey, {
|
|
|
271
271
|
### Supported options
|
|
272
272
|
<a id="client-options"></a>
|
|
273
273
|
|
|
274
|
-
| name | required | type | default | description
|
|
275
|
-
| ---------------------- | -------- | ------------------------ | ----------------------------------- |
|
|
276
|
-
| `anonymousId` | yes | `string` | | Unique ID identifying users
|
|
277
|
-
| `language` | no | `string` | `en` | 2-char language code
|
|
278
|
-
| `currency` | no | `string` | `USD` | 3-char uppercased ISO currency code
|
|
279
|
-
| `countryCode` | no | `string` | `US` | 2-char uppercased ISO country code
|
|
280
|
-
| `deviceType` | yes | `string` | | `desktop` or `mobile`
|
|
281
|
-
| `pageSize` | no | `number` | `20` | Displayed page size
|
|
282
|
-
| `initWithAppConfig` | no | `AppConfig` | | External app config to override internal one
|
|
283
|
-
| `algoliaClientOptions` | no | `AlgoliaSearchOptions` | | Algolia client options used for debugging and setting additional options like timeouts etc.
|
|
284
|
-
| `variations` | no | `Record<string, string>` | | A/B test variations
|
|
285
|
-
| `callbacks` | no | `Record<string, fnc>` | | Client callbasks
|
|
286
|
-
| `
|
|
274
|
+
| name | required | type | default | description | example |
|
|
275
|
+
| ---------------------- | -------- | ------------------------ | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
|
|
276
|
+
| `anonymousId` | yes | `string` | | Unique ID identifying users | `2d360284-577b-4a53-8b91-68f72b9227fa` |
|
|
277
|
+
| `language` | no | `string` | `en` | 2-char language code | `en` |
|
|
278
|
+
| `currency` | no | `string` | `USD` | 3-char uppercased ISO currency code | `USD` |
|
|
279
|
+
| `countryCode` | no | `string` | `US` | 2-char uppercased ISO country code | `US` |
|
|
280
|
+
| `deviceType` | yes | `string` | | `desktop` or `mobile` | `desktop` |
|
|
281
|
+
| `pageSize` | no | `number` | `20` | Displayed page size | `20` |
|
|
282
|
+
| `initWithAppConfig` | no | `AppConfig` | | External app config to override internal one | |
|
|
283
|
+
| `algoliaClientOptions` | no | `AlgoliaSearchOptions` | | Algolia client options used for debugging and setting additional options like timeouts etc. | |
|
|
284
|
+
| `variations` | no | `Record<string, string>` | | A/B test variations | `{'pp000004-tags2': 'b', 'pp000004-tags3': '1'}` |
|
|
285
|
+
| `callbacks` | no | `Record<string, fnc>` | | Client callbasks | |
|
|
286
|
+
| `getTotalRate` | no | `function` | Total rate including taxes and fees | Function to calculate total display rate based on tax display logic. Used for price filter and sort by price functionalities. | |
|
|
287
287
|
|
|
288
288
|
### Available client callbacks
|
|
289
289
|
<a id="client-callbacks"></a>
|