liteapi-travel
Advanced tools
Comparing version 2.0.1 to 2.0.2-alpha
{ | ||
"name": "liteapi-travel", | ||
"version": "2.0.1", | ||
"version": "2.0.2-alpha", | ||
"description": "The **liteAPI** can be used to to do the following Get room rates & availability for a set of hotels Select a specific hotel with room availability and make a booking Manage the bookings - retrieve and cancel existing bookings Get static content for hotels, search hotels by destination", | ||
"license": "Unlicense", | ||
"main": "dist/index.js", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "babel src -d dist", | ||
"prepare": "npm run build", | ||
"test": "mocha --require @babel/register --recursive" | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"browser": { | ||
"fs": false | ||
}, | ||
"repository": { | ||
@@ -20,35 +14,12 @@ "type": "git", | ||
"keywords": [ | ||
"liteapi" | ||
"travel", | ||
"hotels", | ||
"api", | ||
"sdk", | ||
"booking", | ||
"vacation" | ||
], | ||
"dependencies": { | ||
"@babel/cli": "^7.0.0", | ||
"superagent": "^5.3.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.0.0", | ||
"@babel/plugin-proposal-class-properties": "^7.0.0", | ||
"@babel/plugin-proposal-decorators": "^7.0.0", | ||
"@babel/plugin-proposal-do-expressions": "^7.0.0", | ||
"@babel/plugin-proposal-export-default-from": "^7.0.0", | ||
"@babel/plugin-proposal-export-namespace-from": "^7.0.0", | ||
"@babel/plugin-proposal-function-bind": "^7.0.0", | ||
"@babel/plugin-proposal-function-sent": "^7.0.0", | ||
"@babel/plugin-proposal-json-strings": "^7.0.0", | ||
"@babel/plugin-proposal-logical-assignment-operators": "^7.0.0", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", | ||
"@babel/plugin-proposal-numeric-separator": "^7.0.0", | ||
"@babel/plugin-proposal-optional-chaining": "^7.0.0", | ||
"@babel/plugin-proposal-pipeline-operator": "^7.0.0", | ||
"@babel/plugin-proposal-throw-expressions": "^7.0.0", | ||
"@babel/plugin-syntax-dynamic-import": "^7.0.0", | ||
"@babel/plugin-syntax-import-meta": "^7.0.0", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/register": "^7.0.0", | ||
"expect.js": "^0.3.1", | ||
"mocha": "^8.0.1", | ||
"sinon": "^7.2.0" | ||
}, | ||
"files": [ | ||
"dist" | ||
] | ||
"author": "Nuitée Travel LTD <hfadili@berkeley.systems>", | ||
"license": "ISC", | ||
"homepage": "https://github.com/liteapi-travel/nodejs-sdk.git#readme" | ||
} |
563
README.md
@@ -1,27 +0,28 @@ | ||
# liteAPI SDK | ||
<h1 style="font-weight: 500;">liteAPI SDK</h1> | ||
## Table of Contents | ||
- [liteAPI SDK](#liteapi-sdk) | ||
- [Table of Contents](#table-of-contents) | ||
# Table of Contents | ||
- [Table of Contents](#table-of-contents) | ||
- [Introduction](#introduction) | ||
- [Installing](#installing) | ||
- [Usage](#usage) | ||
- [Static data](#static-data) | ||
- [List of cities](#list-of-cities) | ||
- [List of Countries](#list-of-countries) | ||
- [List of available currencies](#list-of-available-currencies) | ||
- [List of hotels](#list-of-hotels) | ||
- [Hotel details](#hotel-details) | ||
- [IATA code list](#iata-code-list) | ||
- [Booking flow](#booking-flow) | ||
- [Search](#search) | ||
- [Hotel Minimum Rates availability](#hotel-minimum-rates-availability) | ||
- [Hotel full rates availability](#hotel-full-rates-availability) | ||
- [book](#book) | ||
- [Hotel rate prebook](#hotel-rate-prebook) | ||
- [Hotel rate book](#hotel-rate-book) | ||
- [Booking management](#booking-management) | ||
- [Booking list](#booking-list) | ||
- [Booking retrieve](#booking-retrieve) | ||
- [Booking cancel](#booking-cancel) | ||
- [Installing](#installing) | ||
- [Usage](#usage) | ||
- [Static data](#static-data) | ||
- [List of cities](#list-of-cities) | ||
- [List of Countries](#list-of-countries) | ||
- [List of available currencies](#list-of-available-currencies) | ||
- [List of hotels](#list-of-hotels) | ||
- [Hotel details](#hotel-details) | ||
- [IATA code list](#iata-code-list) | ||
- [Booking flow](#booking-flow) | ||
- [Search](#search) | ||
- [Minimum Rates availability](#minimum-rates-availability) | ||
- [Hotel full rates availability](#hotel-full-rates-availability) | ||
- [Book](#book) | ||
- [Hotel rate prebook](#hotel-rate-prebook) | ||
- [Hotel rate book](#hotel-rate-book) | ||
- [Booking management](#booking-management) | ||
- [Booking list](#booking-list) | ||
- [Booking retrieve](#booking-retrieve) | ||
- [Booking cancel](#booking-cancel) | ||
- [Guest and loyalty](#guest-and-loyalty) | ||
- [Guests](#guests) | ||
@@ -44,3 +45,3 @@ # Introduction | ||
## Installing | ||
# Installing | ||
@@ -55,3 +56,3 @@ Install the package with: | ||
## Usage | ||
# Usage | ||
The package needs to be configured with your account's apikey, which is | ||
@@ -62,13 +63,8 @@ available in the [liteAPI Dashboard](https://dashboard.liteapi.travel/apikeys/). Require it with the key's | ||
```js | ||
const liteApi = require('liteapi-travel'); | ||
const defaultClient = liteApi.ApiClient.instance; | ||
const apikeyAuth = defaultClient.authentications['apikeyAuth']; | ||
apikeyAuth.apiKey = "YOUR API KEY" | ||
const liteApi = require('liteapi-travel')(YOUR_API_KEY); | ||
``` | ||
## Static data | ||
# Static data | ||
### List of cities | ||
## List of cities | ||
@@ -79,26 +75,4 @@ The API returns a list of city names from a specific country. The country codes needs be is in ISO-2 format. To get the country codes in ISO-2 for all countries please use the GET Country list endpoint | ||
```js | ||
fetchCitiesByCountryCode = (countryCode: string) => { | ||
const apiInstance = new liteApi.StaticDataApi(); | ||
return new Promise((resolve, reject) => { | ||
apiInstance.dataCitiesGet(countryCode, (error, data) => { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(data.data); | ||
} | ||
}); | ||
}); | ||
}; | ||
public async getDataCities() { | ||
try { | ||
let countryCode = "US"; | ||
const data = await this.fetchCitiesByCountryCode(countryCode); | ||
return {data }; | ||
} catch (error) { | ||
console.error(error); | ||
return { error }; | ||
} | ||
} | ||
const countryCode = "IT"; | ||
const result = await liteApi.getCitiesByCountryCode(countryCode); | ||
``` | ||
@@ -120,4 +94,6 @@ * <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
### List of Countries | ||
<br> | ||
## List of Countries | ||
The API returns the list of countries available along with its ISO-2 code. | ||
@@ -127,25 +103,3 @@ | ||
```js | ||
fetchCountries = () => { | ||
const apiInstance = new liteApi.StaticDataApi(); | ||
return new Promise((resolve, reject) => { | ||
apiInstance.dataCountriesGet((error, data) => { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(data.data); | ||
} | ||
}); | ||
}); | ||
}; | ||
public async getDataCountries() { | ||
try { | ||
const data = await this.fetchCountries(); | ||
return {data }; | ||
} catch (error) { | ||
console.error(error); | ||
return { error }; | ||
} | ||
} | ||
const result = await liteApi.getCountries(); | ||
``` | ||
@@ -165,4 +119,6 @@ * <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
### List of available currencies | ||
<br> | ||
## List of available currencies | ||
The API returns all available currency codes along with its name and the list of supported countries that the currency applies to. | ||
@@ -173,25 +129,3 @@ | ||
```js | ||
fetchCurrencies = () => { | ||
const apiInstance = new liteApi.StaticDataApi(); | ||
return new Promise((resolve, reject) => { | ||
apiInstance.dataCurrenciesGet((error, data) => { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(data.data); | ||
} | ||
}); | ||
}); | ||
}; | ||
public async getDataCurrencies() { | ||
try { | ||
const data = await this.fetchCurrencies(); | ||
return {data }; | ||
} catch (error) { | ||
console.error(error); | ||
return { error }; | ||
} | ||
} | ||
const result = await liteApi.getCurrencies(); | ||
``` | ||
@@ -212,4 +146,5 @@ * <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
<br> | ||
### List of hotels | ||
## List of hotels | ||
@@ -220,35 +155,20 @@ The API returns a list of hotels available based on different search criterion. The minimum required information is the county code in ISO-2 format. | ||
```js | ||
fetchHotels = (countryCode: string,cityName: string,opts:any) => { | ||
const apiInstance = new liteApi.StaticDataApi(); | ||
return new Promise((resolve, reject) => { | ||
apiInstance.dataHotelsGet(countryCode, cityName, opts, (error, data) => { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(data.data); | ||
} | ||
}); | ||
}); | ||
}; | ||
const countryCode = "IT"; | ||
const cityName = "Rome"; | ||
//Optional values | ||
const offset = 1000; | ||
const limit = 1000; | ||
const longitude = "-115.16988"; | ||
const latitude = "36.12510"; | ||
const distance = 1000; | ||
const result = await liteApi.getHotels(countryCode, cityName); | ||
``` | ||
public async getDataHotels() { | ||
let countryCode = "SG"; | ||
let cityName = "Singapore"; | ||
let opts = { | ||
'offset': 0, | ||
'limit': 1000, | ||
'longitude': -115.16988, | ||
'latitude': 36.12510, | ||
'distance': 1000 | ||
}; | ||
try { | ||
const data = await this.fetchHotels(countryCode,cityName,opts); | ||
return {data }; | ||
} catch (error) { | ||
console.error(error); | ||
return { error }; | ||
} | ||
} | ||
To utilize optional values, you can invoke the function as follows: | ||
```js | ||
const result = await liteApi.getHotels(countryCode, cityName, offset, limit, longitude, latitude, distance) | ||
``` | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
@@ -286,6 +206,6 @@ | ||
<br> | ||
## Hotel details | ||
### Hotel details | ||
The hotel details API returns all the static contents details of a hotel or property if the hotel ID is provided. The static content include name, description, address, amenities, cancellation policies, images and more. | ||
@@ -296,26 +216,4 @@ | ||
```js | ||
fetchHotelDetails = (hotelId: string) => { | ||
const apiInstance = new liteApi.StaticDataApi(); | ||
return new Promise((resolve, reject) => { | ||
apiInstance.dataHotelGet(hotelId, (error, data) => { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(data.data); | ||
} | ||
}); | ||
}); | ||
}; | ||
public async getDataHotelDetails() { | ||
let hotelId = "lp19c06"; | ||
try { | ||
const data = await this.fetchHotelDetails(hotelId); | ||
return {data }; | ||
} catch (error) { | ||
console.error(error); | ||
return { error }; | ||
} | ||
} | ||
const hotelID = "lp24373"; | ||
const result = await liteApi.getHotelDetails(hotelID); | ||
``` | ||
@@ -355,6 +253,6 @@ * <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
<br> | ||
## IATA code list | ||
### IATA code list | ||
The API returns the IATA (International Air Transport Association) codes for all available airports along with the name of the airport, geographical coordinates and country code in ISO-2 format. | ||
@@ -365,25 +263,3 @@ | ||
```js | ||
fetchIataCode = () => { | ||
const apiInstance = new liteApi.StaticDataApi(); | ||
return new Promise((resolve, reject) => { | ||
apiInstance.dataIataCodesGet((error, data) => { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(data.data); | ||
} | ||
}); | ||
}); | ||
}; | ||
public async getDataIataCode() { | ||
try { | ||
const data = await this.fetchIataCode(); | ||
return {data }; | ||
} catch (error) { | ||
console.error(error); | ||
return { error }; | ||
} | ||
} | ||
const result = await liteApi.getIataCodes(); | ||
``` | ||
@@ -406,4 +282,5 @@ * <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
<br> | ||
## Booking flow | ||
# Booking flow | ||
@@ -413,4 +290,8 @@ liteAPI is a comprehensive and simple to implement Hotel Booking API. The booking flow consists of 3 section: Search, Book, and | ||
### Search | ||
#### Hotel Minimum Rates availability | ||
<br> | ||
## Search | ||
### Minimum Rates availability | ||
------ | ||
Hotel Minimum Rates API is to search and return the minimum room rates that are available for a list of hotel ID's on the specified search dates. | ||
@@ -428,36 +309,21 @@ | ||
```js | ||
fetchHotelMinimumRates = (hotelIds: string,checkin: string,checkout: string,currency: string,guestNationality: string,adults: number, opts: any) => { | ||
const apiInstance = new liteApi.SearchApi(); | ||
return new Promise((resolve, reject) => { | ||
apiInstance.hotelsGet(hotelIds, checkin, checkout, currency, guestNationality, adults, opts, (error, data) => { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(data.data); | ||
} | ||
}); | ||
}); | ||
}; | ||
const checkin = "2023-07-15"; | ||
const checkout = "2023-07-16"; | ||
const currency = "USD"; | ||
const guestNationality = "US"; | ||
const hotelIdsList = ["lp3803c", "lp1f982", "lp19b70", "lp19e75"]; | ||
const adults = 2; | ||
//Optional values | ||
const childrenAges = [2,3]; | ||
const travelerID = "traveler1"; | ||
const result = await liteApi.getMinimumRates(checkin, checkout, currency, guestNationality, hotelIdsList, adults); | ||
``` | ||
public async getHotelMinimumRates() { | ||
let hotelIds = "lp3803c,lp1f982,lp19b70,lp19e75"; | ||
let checkin = "2023-11-15"; | ||
let checkout = "2023-11-16"; | ||
let currency = "USD"; | ||
let guestNationality = "US"; | ||
let adults = 1; | ||
let opts = { | ||
'children': "12,9", | ||
'guestId': "testtraveler1" | ||
}; | ||
try { | ||
const data = await this.fetchHotelMinimumRates(hotelIds,checkin,checkout,currency,guestNationality,adults,opts); | ||
return {data }; | ||
} catch (error) { | ||
console.error(error); | ||
return { error }; | ||
} | ||
} | ||
To utilize optional values, you can invoke the function as follows: | ||
```js | ||
const result = await liteApi.getMinimumRates(checkin, checkout, currency, guestNationality, hotelIdsList, adults,childrenAges,travelerID); | ||
``` | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
@@ -489,3 +355,7 @@ | ||
#### Hotel full rates availability | ||
<br> | ||
### Hotel full rates availability | ||
------ | ||
The Full Rates API is to search and return all available rooms along with its rates, cancellation policies for a list of hotel ID's based on the search dates. | ||
@@ -504,35 +374,18 @@ | ||
```js | ||
fetchHotelFullRates = (hotelIds: string,checkin: string,checkout: string,currency: string,guestNationality: string,adults: number, opts: any) => { | ||
const apiInstance = new liteApi.SearchApi(); | ||
return new Promise((resolve, reject) => { | ||
apiInstance.hotelsRatesGet(hotelIds, checkin, checkout, currency, guestNationality, adults, opts, (error, data) => { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(data.data); | ||
} | ||
}); | ||
}); | ||
}; | ||
const checkin = "2023-07-15"; | ||
const checkout = "2023-07-16"; | ||
const currency = "USD"; | ||
const guestNationality = "US"; | ||
const hotelIdsList = ["lp3803c", "lp1f982", "lp19b70", "lp19e75"]; | ||
const adults = 2; | ||
//Optional values | ||
const childrenAges = [2,3]; | ||
const travelerID = "traveler1"; | ||
const result = await liteApi.getFullRates(checkin, checkout, currency, guestNationality, hotelIdsList, adults); | ||
``` | ||
public async getHotelFullRates() { | ||
let hotelIds = "lp3803c,lp1f982,lp19b70,lp19e75"; | ||
let checkin = "2023-11-15"; | ||
let checkout = "2023-11-16"; | ||
let currency = "USD"; | ||
let guestNationality = "US"; | ||
let adults = 1; | ||
let opts = { | ||
'children': "12,9", | ||
'guestId': "testtraveler1" | ||
}; | ||
try { | ||
const data = await this.fetchHotelFullRates(hotelIds,checkin,checkout,currency,guestNationality,adults,opts); | ||
return {data }; | ||
} catch (error) { | ||
console.error(error); | ||
return { error }; | ||
} | ||
} | ||
To utilize optional values, you can invoke the function as follows: | ||
```js | ||
const result = await liteApi.getFullRates(checkin, checkout, currency, guestNationality, hotelIdsList, adults,childrenAges,travelerID); | ||
``` | ||
@@ -579,5 +432,9 @@ * <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
### book | ||
#### Hotel rate prebook | ||
<br> | ||
## Book | ||
### Hotel rate prebook | ||
------ | ||
This API is used to confirm if the room and rates for the search criterion. The input to the endpoint is a specific rate Id coming from the GET hotel full rates availability API. | ||
@@ -591,28 +448,5 @@ | ||
```js | ||
fetchHotelRatePrebook = (opts: any) => { | ||
const apiInstance = new liteApi.BookApi(); | ||
return new Promise((resolve, reject) => { | ||
apiInstance.ratesPrebookPost(opts, (error, data) => { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(data.data); | ||
} | ||
}); | ||
}); | ||
}; | ||
const rateId = "NRYDCZRZHAZHYMRQGIZS2MBXFUYTK7BSGAZDGLJQG4WTCNT4GJ6HYVKTPRDVSWSEJVMVUV2HIUZUOS2OKJKEOWKZKRCU2QSXJVETGRCTJZKEMR2ZGNMFSTKKIRDUSWKEIVGVUUKHGRMVISZXIJJUOQK2IRDU2QSYI5CTGSCZLJGE6TBVJNLEON2DKZFU4NSGJNKTERKQKFNEKQ2NINCFAUK2IRCU6QSUKBJEWVCFKZJVST2KGZCEGTSSLFEEKWKEINHFUV2HKUZVIUKOJJNE6QSELBHVKQSEI5CVURCTJZBFER2BKJKEOTKKJZDUKWSEKNHEEUSHII3EMRKSKNHVAUK2IRAU2USUI5ATGVCDJVJFCR2FLFCECN2CKRIFCWKUJFHEEVCHLFJFMRKULJCEWSSEIU2ESWSTI5AVURCHJRFFCRZUK5KEGTKRPRKVGRD4PR6DCNRWFYYDC7BSGAZDGLJQG4WTCMT4IJHXYMJSHE2DCMD4GI"; | ||
public async getHotelRatePrebook() { | ||
let opts = { | ||
'body': {"rateId":"2_3P6L4TRYIFKLFM3DRKUQ4SBFCSO3QJBU27UQ76RU6HTAVUULOUZN3HLFLDS6HRUUQXXZNPELVXHLEXZF3J26PGYXGZEMZOPATZGAUBZLMB7BR6OL7QW4FIAIWTOCOLVHBIRGQFE7UJLTQP5RB6AXVPADIRT34YR56BBBSLSAWK2BMTRYBFRZCYG6HQKMULTSO6JIWWTEGVSBOHNFO7KTFXFMGCULXME2B4PZDCFWK62PT3EL4XUVOEB37V2EA7CWJKOZZU4OYDFB36YWUCID6LWVCCRMVU4PYZH2WBTJ6SLVVEGVZHTVGCVXA5GXEOCUE4ARMWXCIGRPASA5WBFI2T557GWUUZ6YMBZZMPUPCWI7DVO2OG6KY36WWASVBLEJRYFHJRRGQKDV5HY6INAD3YARYKVNFMITJ6BX5LVBVXNF33OZF34ZQDE5S74ND73FMHCYSSTZFOBCOBKYDHQ5BWGRYS7GALROITVAFG2OIFSXLUSKRT3MEURPJL7S3MHWEJMAYJFGGPMRZBEQZXAXDJI"} | ||
}; | ||
try { | ||
const data = await this.fetchHotelRatePrebook(opts); | ||
return {data }; | ||
} catch (error) { | ||
console.error(error); | ||
return { error }; | ||
} | ||
} | ||
const result = await liteApi.preBook(rateId) | ||
``` | ||
@@ -663,4 +497,8 @@ * <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
#### Hotel rate book | ||
<br> | ||
### Hotel rate book | ||
------ | ||
This API confirms a booking when the prebook Id and the rate Id from the pre book stage along with the guest and payment information are passed. | ||
@@ -677,32 +515,11 @@ | ||
```js | ||
fetchHotelRateBook = (opts: any) => { | ||
const apiInstance = new liteApi.BookApi(); | ||
return new Promise((resolve, reject) => { | ||
apiInstance.ratesBookPost(opts, (error, data) => { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(data.data); | ||
} | ||
}); | ||
}); | ||
}; | ||
const prebookID = "8iaO7PXBU"; | ||
const guestInfo = { guestFirstName: 'Kim', guestLastName: 'James', guestEmail: 'test@nlite.ml' }; | ||
const paymentMethod = "CREDIT_CARD"; | ||
const holderName = "Kim James"; | ||
const paymentInfo = { "card_number": "4242424242424242", "exp_month": 11, exp_year: "23", "cvc": 123 } | ||
public async getHotelRateBook() { | ||
let opts = { | ||
'ratesBookPostRequest': { | ||
"prebookId":"UwfMkUWH6", | ||
"guestInfo":{"guestFirstName":"Kim","guestLastName":"James","guestEmail":"test@nlite.ml"}, | ||
"payment":{"holderName":"Kim James","number":"4242424242424242","expireDate":"11/29","cvc":"456","method":"CREDIT_CARD"}} | ||
}; | ||
const result = await liteApi.book(prebookID, guestInfo, paymentMethod, holderName, paymentInfo) | ||
try { | ||
const data = await this.fetchHotelRateBook(opts); | ||
return {data }; | ||
} catch (error) { | ||
console.error(error); | ||
return { error }; | ||
} | ||
} | ||
``` | ||
@@ -753,4 +570,8 @@ * <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
### Booking management | ||
#### Booking list | ||
<br> | ||
## Booking management | ||
### Booking list | ||
------ | ||
The API returns the list of booking Id's for a given guest Id. | ||
@@ -760,26 +581,4 @@ | ||
```js | ||
fetchBookingListByGuestId = (guestId: string) => { | ||
const apiInstance = new liteApi.BookingManagementApi(); | ||
return new Promise((resolve, reject) => { | ||
apiInstance.bookingsGet(guestId, (error, data) => { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(data.data); | ||
} | ||
}); | ||
}); | ||
}; | ||
public async getBookingList() { | ||
let guestId = "FrT56hfty"; | ||
try { | ||
const data = await this.fetchBookingListByGuestId(guestId); | ||
return {data }; | ||
} catch (error) { | ||
console.error(error); | ||
return { error }; | ||
} | ||
} | ||
const guestId = "FrT56hfty"; | ||
const result = await liteApi.getBookingListByGuestId(guestId) | ||
``` | ||
@@ -803,4 +602,6 @@ * <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
#### Booking retrieve | ||
<br> | ||
### Booking retrieve | ||
------ | ||
The API returns the status and the details for the a specific booking Id. | ||
@@ -811,26 +612,4 @@ | ||
```js | ||
fetchBookingDetailsByBookingId = (bookingId: string) => { | ||
const apiInstance = new liteApi.BookingManagementApi(); | ||
return new Promise((resolve, reject) => { | ||
apiInstance.bookingsBookingIdGet(bookingId, (error, data) => { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(data.data); | ||
} | ||
}); | ||
}); | ||
}; | ||
public async getBookingDetails() { | ||
let bookingId = "uSQ6Zsc5R"; | ||
try { | ||
const data = await this.fetchBookingDetailsByBookingId(bookingId); | ||
return {data }; | ||
} catch (error) { | ||
console.error(error); | ||
return { error }; | ||
} | ||
} | ||
const bookingId = "uSQ6Zsc5R"; | ||
const result = await liteApi.retrievedBooking(bookingId); | ||
``` | ||
@@ -877,4 +656,8 @@ * <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
#### Booking cancel | ||
<br> | ||
### Booking cancel | ||
------ | ||
This API is used to request a cancellation of an existing confirmed booking. Cancellation policies and conditions will be used to determine the success of the cancellation. For example a booking with non-refundable (NRFN) tag or a booking with a cancellation policy that was requested past the cancellation date will not be able to cancel the confirmed booking. | ||
@@ -884,26 +667,4 @@ | ||
```js | ||
cancelationBookingByBookingId = (bookingId: string) => { | ||
const apiInstance = new liteApi.BookingManagementApi(); | ||
return new Promise((resolve, reject) => { | ||
apiInstance.bookingsBookingIdPut(bookingId, (error, data) => { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(data.data); | ||
} | ||
}); | ||
}); | ||
}; | ||
public async cancelationBooking() { | ||
let bookingId = "uSQ6Zsc5R"; | ||
try { | ||
const data = await this.cancelationBookingByBookingId(bookingId); | ||
return {data }; | ||
} catch (error) { | ||
console.error(error); | ||
return { error }; | ||
} | ||
} | ||
const bookingId = "K8Hvb-85O"; | ||
const result = await liteApi.cancelBooking(bookingId); | ||
``` | ||
@@ -927,1 +688,33 @@ * <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
| **currency** | **string** | The currency of the booking. | | ||
<br> | ||
# Guest and loyalty | ||
## Guests | ||
The guests API returns the unique guest IDs | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Example :</h4> | ||
```js | ||
const result = await liteApi.getGuestsIds(); | ||
``` | ||
If you want to retrieve the guest IDs of a specific user based on their email, you can provide the email as an optional parameter: | ||
```js | ||
const email = "johndoe@nlite.ml"; //Optional | ||
const result = await liteApi.getGuestsIds(email); | ||
``` | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**email** | **string**| Email ID of the guest | [optional] | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Return type :</h4> | ||
An array containing objects with the following properties: | ||
| Name | Type | Description | | ||
| ---------- | ------ | ---------------- | | ||
| **guestId** | **string** | The guest ID. | |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
0
1
0
71367
3
701
2
691
15
- Removed@babel/cli@^7.0.0
- Removedsuperagent@^5.3.0
- Removed@ampproject/remapping@2.3.0(transitive)
- Removed@babel/cli@7.26.4(transitive)
- Removed@babel/code-frame@7.26.2(transitive)
- Removed@babel/compat-data@7.26.5(transitive)
- Removed@babel/core@7.26.7(transitive)
- Removed@babel/generator@7.26.5(transitive)
- Removed@babel/helper-compilation-targets@7.26.5(transitive)
- Removed@babel/helper-module-imports@7.25.9(transitive)
- Removed@babel/helper-module-transforms@7.26.0(transitive)
- Removed@babel/helper-string-parser@7.25.9(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@babel/helper-validator-option@7.25.9(transitive)
- Removed@babel/helpers@7.26.7(transitive)
- Removed@babel/parser@7.26.7(transitive)
- Removed@babel/template@7.25.9(transitive)
- Removed@babel/traverse@7.26.7(transitive)
- Removed@babel/types@7.26.7(transitive)
- Removed@jridgewell/gen-mapping@0.3.8(transitive)
- Removed@jridgewell/resolve-uri@3.1.2(transitive)
- Removed@jridgewell/set-array@1.2.1(transitive)
- Removed@jridgewell/sourcemap-codec@1.5.0(transitive)
- Removed@jridgewell/trace-mapping@0.3.25(transitive)
- Removed@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3(transitive)
- Removedanymatch@3.1.3(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbinary-extensions@2.3.0(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbraces@3.0.3(transitive)
- Removedbrowserslist@4.24.4(transitive)
- Removedcall-bind-apply-helpers@1.0.1(transitive)
- Removedcall-bound@1.0.3(transitive)
- Removedcaniuse-lite@1.0.30001696(transitive)
- Removedchokidar@3.6.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcommander@6.2.1(transitive)
- Removedcomponent-emitter@1.3.1(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconvert-source-map@2.0.0(transitive)
- Removedcookiejar@2.1.4(transitive)
- Removeddebug@4.4.0(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removeddunder-proto@1.0.1(transitive)
- Removedelectron-to-chromium@1.5.90(transitive)
- Removedes-define-property@1.0.1(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.1.1(transitive)
- Removedescalade@3.2.0(transitive)
- Removedfast-safe-stringify@2.1.1(transitive)
- Removedfill-range@7.1.1(transitive)
- Removedform-data@3.0.2(transitive)
- Removedformidable@1.2.6(transitive)
- Removedfs-readdir-recursive@1.1.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfsevents@2.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedgensync@1.0.0-beta.2(transitive)
- Removedget-intrinsic@1.2.7(transitive)
- Removedget-proto@1.0.1(transitive)
- Removedglob@7.2.3(transitive)
- Removedglob-parent@5.1.2(transitive)
- Removedglobals@11.12.0(transitive)
- Removedgopd@1.2.0(transitive)
- Removedhas-symbols@1.1.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-binary-path@2.1.0(transitive)
- Removedis-extglob@2.1.1(transitive)
- Removedis-glob@4.0.3(transitive)
- Removedis-number@7.0.0(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjsesc@3.1.0(transitive)
- Removedjson5@2.2.3(transitive)
- Removedlru-cache@5.1.1(transitive)
- Removedmake-dir@2.1.0(transitive)
- Removedmath-intrinsics@1.1.0(transitive)
- Removedmethods@1.1.2(transitive)
- Removedmime@2.6.0(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedms@2.1.3(transitive)
- Removednode-releases@2.0.19(transitive)
- Removednormalize-path@3.0.0(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedonce@1.4.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedpify@4.0.1(transitive)
- Removedqs@6.14.0(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedreaddirp@3.6.0(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsemver@5.7.26.3.17.7.0(transitive)
- Removedside-channel@1.1.0(transitive)
- Removedside-channel-list@1.0.0(transitive)
- Removedside-channel-map@1.0.1(transitive)
- Removedside-channel-weakmap@1.0.2(transitive)
- Removedslash@2.0.0(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedsuperagent@5.3.1(transitive)
- Removedto-regex-range@5.0.1(transitive)
- Removedupdate-browserslist-db@1.1.2(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedyallist@3.1.1(transitive)