@findhotel/sapi 1.0.0-beta.0 → 1.0.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.
@@ -15,14 +15,6 @@ export interface RateBreakdown {
15
15
  * Available amenities within the offer
16
16
  */
17
17
  export declare type Amenities = 'allInclusive' | 'breakfast' | 'partialBreakfast' | 'lunch' | 'dinner' | 'fullBoard' | 'halfBoard' | 'meals' | 'internetIncluded';
18
- /**
19
- * Tag is an attribute that annotates the offer indicating a particular characteristic
20
- *
21
- * "top_offer" - is offer a top offer \
22
- * "anchor_price" - offer is an anchor price offer \
23
- * "exclusive_cheapest_offer" - offer is the cheapest offer amoun others
24
- */
25
- export declare type OfferTags = 'top_offer' | 'anchor_price' | 'exclusive_cheapest_offer';
26
18
  /**
27
19
  * Attribute indicating the minimum tier the user should be in order to be able to book this offer.
28
20
  */
@@ -48,7 +40,7 @@ export interface Offer {
48
40
  providerCode: string;
49
41
  rate: RateBreakdown;
50
42
  roomName?: string;
51
- tags: OfferTags[] | null;
43
+ tags: string[] | null;
52
44
  url: string;
53
45
  }
54
46
  export interface Discount {
@@ -5,7 +5,7 @@ import { Configs } from './config';
5
5
  import { AnonymousId, Language, Currency, Country, DeviceType, Brand } from './types';
6
6
  import { Logger } from './logger';
7
7
  import { RateBreakdown } from './offers';
8
- export declare type TotalRateFormula = (rate: RateBreakdown) => number;
8
+ export declare type GetTotalRate = (rate: RateBreakdown) => number;
9
9
  /** Options for initializing the Search API client. Persistent within single SAPI instance but may vary for different users */
10
10
  export interface ClientOptions {
11
11
  /** Unique ID identifying users */
@@ -39,18 +39,18 @@ export interface ClientOptions {
39
39
  /** Websoket implementation */
40
40
  WebSocket?: WebSocket;
41
41
  /**
42
- * Formula to calculate total display rate based on tax display logic.
42
+ * Function to calculate total display rate based on tax display logic.
43
43
  * If not provided SAPI will use rate including all taxes and fees.
44
44
  * Used for price filter and sort by price functionalities.
45
45
  */
46
- totalRateFormula?: TotalRateFormula;
46
+ getTotalRate?: GetTotalRate;
47
47
  }
48
48
  /**
49
49
  * Adjusted options
50
50
  */
51
- export declare type Options = Except<ClientOptions, 'variations' | 'logger' | 'totalRateFormula'> & {
51
+ export declare type Options = Except<ClientOptions, 'variations' | 'logger' | 'getTotalRate'> & {
52
52
  logger: Logger;
53
- totalRateFormula: TotalRateFormula;
53
+ getTotalRate: GetTotalRate;
54
54
  variations: string[];
55
55
  pageSize: number;
56
56
  languages: Language[];
@@ -164,7 +164,10 @@ export interface HotelSuggestHit extends BasicSuggestHit {
164
164
  };
165
165
  }
166
166
  export declare type SuggestHit = HotelSuggestHit | PlaceSuggestHit;
167
- /** Search Hit */
167
+ export interface DatelessProviderLink {
168
+ provider: string;
169
+ url: string;
170
+ }
168
171
  export interface Hit {
169
172
  address: TranslatedString;
170
173
  checkInTime: string;
@@ -175,6 +178,7 @@ export interface Hit {
175
178
  guestType: GuestType;
176
179
  hotelName: TranslatedString;
177
180
  imageURIs: string[];
181
+ urls?: DatelessProviderLink[];
178
182
  isDeleted: boolean;
179
183
  lastBooked: number;
180
184
  objectID: string;
@@ -1,5 +1,5 @@
1
1
  import { OffersResponse } from '../offers-client';
2
- import { HotelOfferEntity, TotalRateFormula } from '../types';
2
+ import { HotelOfferEntity, GetTotalRate } from '../types';
3
3
  interface Parameters {
4
4
  checkIn: string;
5
5
  checkOut: string;
@@ -12,7 +12,7 @@ interface Parameters {
12
12
  priceBucketWidth?: number;
13
13
  priceBucketsCount: number;
14
14
  exchangeRate: number;
15
- totalRateFormula: TotalRateFormula;
15
+ getTotalRate: GetTotalRate;
16
16
  }
17
17
  export declare function isRateInPriceRange(rate: number, upperBound: number, priceMin?: number, priceMax?: number): boolean;
18
18
  export declare function applyPriceFilter(parameters: Parameters, hotelOfferEntity: HotelOfferEntity): HotelOfferEntity;
@@ -1,7 +1,7 @@
1
- import { HotelOfferEntity, TotalRateFormula } from '../types';
1
+ import { HotelOfferEntity, GetTotalRate } from '../types';
2
2
  /**
3
3
  * Returns cheapest display rate for provided hotel offer entity
4
4
  *
5
5
  * @param hotelOfferEntity
6
6
  */
7
- export declare function getCheapestRate(hotelOfferEntity: HotelOfferEntity, totalRateFormula: TotalRateFormula): number | undefined;
7
+ export declare function getCheapestRate(hotelOfferEntity: HotelOfferEntity, getTotalRate: GetTotalRate): number | undefined;
@@ -1,7 +1,8 @@
1
1
  import { RateBreakdown } from '../types/offers';
2
2
  /**
3
- * Deafault formula for calculating total rate
3
+ * Deafault funtion for calculating total rate
4
+ *
4
5
  * @param rate - offer's rate breakdown
5
6
  * @returns - total rate
6
7
  */
7
- export declare function totalRateFormula(rate: RateBreakdown): number;
8
+ export declare function getTotalRate(rate: RateBreakdown): number;
@@ -11,4 +11,4 @@ export * from './sorting-boosts';
11
11
  export * from './build-offers-response';
12
12
  export * from './algolia';
13
13
  export * from './search-parameters';
14
- export * from './total-rate-formula';
14
+ export * from './get-total-rate';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@findhotel/sapi",
3
- "version": "1.0.0-beta.0",
3
+ "version": "1.0.0",
4
4
  "description": "FindHotel Search API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types/packages/core/src",