@revolugo/booking-api-client
Advanced tools
Comparing version 1.0.0 to 1.0.1-beta.0
@@ -11,2 +11,3 @@ import { ApiClientConfig, ApiVersions } from './lib/types'; | ||
hotelRoomOffers: apis.HotelRoomOffersInterface; | ||
hotels: apis.HotelsInterface; | ||
}; | ||
@@ -21,2 +22,3 @@ declare type ApiVersionCalls = { | ||
get bookings(): ApiVersionCalls[P]['bookings']; | ||
get bookingPolicies(): ApiVersionCalls[P]['bookingPolicies']; | ||
get hotelOfferRequests(): ApiVersionCalls[P]['hotelOfferRequests']; | ||
@@ -26,4 +28,4 @@ get hotelOffers(): ApiVersionCalls[P]['hotelOffers']; | ||
get hotelRoomOffers(): ApiVersionCalls[P]['hotelRoomOffers']; | ||
get bookingPolicies(): ApiVersionCalls[P]['bookingPolicies']; | ||
get hotels(): ApiVersionCalls[P]['hotels']; | ||
} | ||
export {}; |
@@ -42,3 +42,4 @@ "use strict"; | ||
hotelRoomOfferRequests: new apis.HotelRoomOfferRequests(apiConfig), | ||
hotelRoomOffers: new apis.HotelRoomOffers(apiConfig) | ||
hotelRoomOffers: new apis.HotelRoomOffers(apiConfig), | ||
hotels: new apis.Hotels(apiConfig) | ||
}; | ||
@@ -75,2 +76,5 @@ }; | ||
} | ||
get bookingPolicies() { | ||
return this.apiVersionsToClient[this.config.apiVersion].bookingPolicies; | ||
} | ||
get hotelOfferRequests() { | ||
@@ -88,4 +92,4 @@ return this.apiVersionsToClient[this.config.apiVersion].hotelOfferRequests; | ||
} | ||
get bookingPolicies() { | ||
return this.apiVersionsToClient[this.config.apiVersion].bookingPolicies; | ||
get hotels() { | ||
return this.apiVersionsToClient[this.config.apiVersion].hotels; | ||
} | ||
@@ -92,0 +96,0 @@ } |
@@ -7,1 +7,2 @@ export * from './ResourceBookingPoliciesApi'; | ||
export * from './ResourceHotelRoomOffersApi'; | ||
export * from './ResourceHotelsApi'; |
@@ -25,2 +25,3 @@ "use strict"; | ||
__exportStar(require("./ResourceHotelRoomOffersApi"), exports); | ||
__exportStar(require("./ResourceHotelsApi"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -25,2 +25,3 @@ /** | ||
onlyRecommendedHotelOffers?: boolean; | ||
priceHistogramStepCount?: number; | ||
sortBy?: HotelOffersSortByEnum; | ||
@@ -50,2 +51,3 @@ sortByOrder?: HotelOffersSortByOrderEnum; | ||
* @param {boolean} [onlyRecommendedHotelOffers] By default, filtering and sorting of returned **Hotel Offer** list is performed by our own **Search Engine** algorithm in order to maximize conversion rate. 💡 <span style=\"color:green\">When turned on, the endpoint returns a list limited to 10 **Hotel Offers**</span> Set it to **false** in order to disable this feature. | ||
* @param {number} [priceHistogramStepCount] Number of price steps to be included in the returned **price_histogram** dataset. e.g.: \"15\" will return a dataset with 15 price steps. | ||
* @param {'distance' | 'price' | 'rating' | 'review_rating'} [sortBy] Sort the returned **Hotel Offer** list. The sorting feature can only perform sorting based on 1 type whichever specified first. ⚠️ Has no effect when **only_recommended_hotel_offers** = **true** (default). | ||
@@ -52,0 +54,0 @@ * @param {'asc' | 'desc'} [sortByOrder] Sort **Hotel Offer** list in **asc**ending or **desc**ending order. ⚠️ Has no effect when **only_recommended_hotel_offers** = **true** (default). |
@@ -89,2 +89,5 @@ "use strict"; | ||
} | ||
if (requestParameters.priceHistogramStepCount !== undefined) { | ||
queryParameters['price_histogram_step_count'] = requestParameters.priceHistogramStepCount; | ||
} | ||
if (requestParameters.sortBy !== undefined) { | ||
@@ -91,0 +94,0 @@ queryParameters['sort_by'] = requestParameters.sortBy; |
{ | ||
"name": "@revolugo/booking-api-client", | ||
"version": "1.0.0", | ||
"author": "Revolugo <tech@revolugo.com>", | ||
"browser": "build/browser/booking-api-client.min.js", | ||
"bugs": { | ||
"url": "https://bitbucket.org/revolugo/booking-api/issues" | ||
}, | ||
"description": "Javascript Revolugo Booking API Client (browser + server)", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"browser": "build/browser/booking-api-client.min.js", | ||
"author": "Revolugo <tech@revolugo.com>", | ||
"dependencies": { | ||
@@ -19,10 +15,2 @@ "camel-case": "4.1.2", | ||
}, | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://bitbucket.org/revolugo/booking-api.git" | ||
}, | ||
"bugs": { | ||
"url": "https://bitbucket.org/revolugo/booking-api/issues" | ||
}, | ||
"homepage": "https://bitbucket.org/revolugo/booking-api#readme", | ||
@@ -35,6 +23,18 @@ "keywords": [ | ||
], | ||
"license": "MIT", | ||
"main": "build/index.js", | ||
"name": "@revolugo/booking-api-client", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://bitbucket.org/revolugo/booking-api.git" | ||
}, | ||
"scripts": { | ||
"build": "rm -f ./tsconfig.tsbuildinfo && tsc", | ||
"prepublishOnly": "npm run build" | ||
} | ||
}, | ||
"types": "build/index.d.ts", | ||
"version": "1.0.1-beta.0" | ||
} |
@@ -21,3 +21,4 @@ import fetch from 'cross-fetch' | ||
hotelRoomOfferRequests: apis.HotelRoomOfferRequestsInterface, | ||
hotelRoomOffers: apis.HotelRoomOffersInterface | ||
hotelRoomOffers: apis.HotelRoomOffersInterface, | ||
hotels: apis.HotelsInterface, | ||
} => { | ||
@@ -30,3 +31,4 @@ return { | ||
hotelRoomOfferRequests: new apis.HotelRoomOfferRequests(apiConfig), | ||
hotelRoomOffers: new apis.HotelRoomOffers(apiConfig) | ||
hotelRoomOffers: new apis.HotelRoomOffers(apiConfig), | ||
hotels: new apis.Hotels(apiConfig) | ||
} | ||
@@ -71,2 +73,6 @@ } | ||
public get bookingPolicies (): ApiVersionCalls[P]['bookingPolicies'] { | ||
return this.apiVersionsToClient[this.config.apiVersion].bookingPolicies | ||
} | ||
public get hotelOfferRequests (): ApiVersionCalls[P]['hotelOfferRequests'] { | ||
@@ -88,5 +94,5 @@ return this.apiVersionsToClient[this.config.apiVersion].hotelOfferRequests | ||
public get bookingPolicies (): ApiVersionCalls[P]['bookingPolicies'] { | ||
return this.apiVersionsToClient[this.config.apiVersion].bookingPolicies | ||
public get hotels (): ApiVersionCalls[P]['hotels'] { | ||
return this.apiVersionsToClient[this.config.apiVersion].hotels | ||
} | ||
} |
@@ -14,2 +14,3 @@ /* tslint:disable */ | ||
export * from './ResourceBookingPoliciesApi'; | ||
@@ -21,1 +22,2 @@ export * from './ResourceBookingsApi'; | ||
export * from './ResourceHotelRoomOffersApi'; | ||
export * from './ResourceHotelsApi'; |
@@ -37,2 +37,3 @@ /* tslint:disable */ | ||
onlyRecommendedHotelOffers?: boolean; | ||
priceHistogramStepCount?: number; | ||
sortBy?: HotelOffersSortByEnum; | ||
@@ -62,2 +63,3 @@ sortByOrder?: HotelOffersSortByOrderEnum; | ||
* @param {boolean} [onlyRecommendedHotelOffers] By default, filtering and sorting of returned **Hotel Offer** list is performed by our own **Search Engine** algorithm in order to maximize conversion rate. 💡 <span style=\"color:green\">When turned on, the endpoint returns a list limited to 10 **Hotel Offers**</span> Set it to **false** in order to disable this feature. | ||
* @param {number} [priceHistogramStepCount] Number of price steps to be included in the returned **price_histogram** dataset. e.g.: \"15\" will return a dataset with 15 price steps. | ||
* @param {'distance' | 'price' | 'rating' | 'review_rating'} [sortBy] Sort the returned **Hotel Offer** list. The sorting feature can only perform sorting based on 1 type whichever specified first. ⚠️ Has no effect when **only_recommended_hotel_offers** = **true** (default). | ||
@@ -121,2 +123,5 @@ * @param {'asc' | 'desc'} [sortByOrder] Sort **Hotel Offer** list in **asc**ending or **desc**ending order. ⚠️ Has no effect when **only_recommended_hotel_offers** = **true** (default). | ||
} | ||
if (requestParameters.priceHistogramStepCount !== undefined) { | ||
queryParameters['price_histogram_step_count'] = requestParameters.priceHistogramStepCount; | ||
} | ||
if (requestParameters.sortBy !== undefined) { | ||
@@ -123,0 +128,0 @@ queryParameters['sort_by'] = requestParameters.sortBy; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1098359
80
21928
2