@findhotel/sapi 1.1.9-beta.0 → 1.1.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/README.md +4 -0
- package/dist/index.js +1 -1
- package/dist/types/packages/core/src/hotel.d.ts +2 -2
- package/dist/types/packages/core/src/offers-client.d.ts +4 -0
- package/dist/types/packages/core/src/rooms.d.ts +4 -3
- package/dist/types/packages/core/src/types/search.d.ts +4 -1
- package/dist/types/packages/core/src/utils/build-offers-response.d.ts +4 -3
- package/package.json +1 -1
- package/dist/index.js.map +0 -1
|
@@ -45,11 +45,11 @@ export declare function safToSapiHotel(safHotel: SafHotel, languages: Language[]
|
|
|
45
45
|
* Creates hotel request string
|
|
46
46
|
*
|
|
47
47
|
* @param hotelId - Requested hotel id
|
|
48
|
-
* @param
|
|
48
|
+
* @param options - hotel request options - persistent within single SAPI instance
|
|
49
49
|
*
|
|
50
50
|
* @returns request string
|
|
51
51
|
*/
|
|
52
|
-
export declare function createRequestString(hotelId: HotelId,
|
|
52
|
+
export declare function createRequestString(hotelId: HotelId, options: ClientOptions): string;
|
|
53
53
|
export interface Parameters {
|
|
54
54
|
appConfig: AppConfig;
|
|
55
55
|
options: ClientOptions;
|
|
@@ -65,6 +65,10 @@ export interface GetOffersParameters {
|
|
|
65
65
|
export interface OffersResponse {
|
|
66
66
|
anchorHotelOfferEntity?: HotelOfferEntity;
|
|
67
67
|
hotelOfferEntities?: HotelOfferEntity[];
|
|
68
|
+
status: {
|
|
69
|
+
anchorComplete: boolean;
|
|
70
|
+
nonAnchorComplete: boolean;
|
|
71
|
+
};
|
|
68
72
|
}
|
|
69
73
|
export interface OffersClient {
|
|
70
74
|
getOffers: (parameters: GetOffersParameters, onOffersReceived?: (response: OffersResponse) => void) => Promise<OffersResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RoomsRequestParameters, RoomsResults, Options as ClientOptions } from './types';
|
|
2
|
-
import { AppConfig } from './app-config';
|
|
2
|
+
import { AppConfig, ProfileKey } from './app-config';
|
|
3
3
|
export declare type RoomsHandler = (parameters: RoomsRequestParameters) => Promise<RoomsResults>;
|
|
4
4
|
/**
|
|
5
5
|
* Creates rooms request string.
|
|
@@ -30,9 +30,10 @@ export declare type RoomsHandler = (parameters: RoomsRequestParameters) => Promi
|
|
|
30
30
|
* ```
|
|
31
31
|
*
|
|
32
32
|
*/
|
|
33
|
-
export declare function createRequestString(parameters: RoomsRequestParameters, options: ClientOptions): string;
|
|
33
|
+
export declare function createRequestString(profileKey: ProfileKey, parameters: RoomsRequestParameters, options: ClientOptions): string;
|
|
34
34
|
export interface Parameters {
|
|
35
35
|
appConfig: AppConfig;
|
|
36
|
+
profileKey: ProfileKey;
|
|
36
37
|
options: ClientOptions;
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
@@ -42,4 +43,4 @@ export interface Parameters {
|
|
|
42
43
|
*
|
|
43
44
|
* @returns rooms search function
|
|
44
45
|
*/
|
|
45
|
-
export declare function rooms({ appConfig, options }: Parameters): RoomsHandler;
|
|
46
|
+
export declare function rooms({ appConfig, profileKey, options, }: Parameters): RoomsHandler;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OffersResponse } from '../offers-client';
|
|
2
|
-
import { HotelOfferEntity, GetTotalRate } from '../types';
|
|
2
|
+
import { HotelOfferEntity, GetTotalRate, HotelId } from '../types';
|
|
3
3
|
interface Parameters {
|
|
4
4
|
checkIn: string;
|
|
5
5
|
checkOut: string;
|
|
@@ -12,13 +12,14 @@ interface Parameters {
|
|
|
12
12
|
priceBucketWidth?: number;
|
|
13
13
|
priceBucketsCount: number;
|
|
14
14
|
exchangeRate: number;
|
|
15
|
+
hotelIds: HotelId[];
|
|
15
16
|
getTotalRate: GetTotalRate;
|
|
16
17
|
}
|
|
17
18
|
export declare function isRateInPriceRange(rate: number, upperBound: number, priceMin?: number, priceMax?: number): boolean;
|
|
18
19
|
export declare function applyPriceFilter(parameters: Parameters, hotelOfferEntity: HotelOfferEntity): HotelOfferEntity;
|
|
19
|
-
export declare function applySort(
|
|
20
|
+
export declare function applySort(hotelOfferEntities: HotelOfferEntity[], parameters: Parameters): HotelOfferEntity[];
|
|
20
21
|
export declare function buildOffersResponse(offersResults: OffersResponse, parameters: Parameters): {
|
|
21
|
-
hotelIds: string[];
|
|
22
22
|
hotelOfferEntities: Record<string, HotelOfferEntity>;
|
|
23
|
+
hotelIds: string[];
|
|
23
24
|
};
|
|
24
25
|
export {};
|