0.44.0 • Published 11 months ago
@bookingsuedtirol/mss-nodejs v0.44.0
mss-nodejs
MSS API v2.0 wrapper for Node.js projects.
Available services
- getHotelList
- getSpecialList
- getRoomList
- getPriceList
- getRoomAvailability
- getHotelPictures
- getHotelPictureGroups
- prepareBooking
- getBooking
- createInquiry
- getUserSources
Runnable example
npm run dev
Example
import { Client, Request, MSSError } from "@bookingsuedtirol/mss-nodejs";
const client = new Client({
user: "username",
password: "password",
source: "source",
});
const res = await client.request((req) => {
req.header.method = "getHotelList";
req.request.search.id = ["11230"];
req.request.options = {
hotel_details:
Request.HotelDetails.BasicInfo |
Request.HotelDetails.PaymentOptionsForOnlineBooking,
};
return req;
});
const hotel = res.result.hotel[0];
console.log(hotel.name); // => "Hotel Lichtenstern"
console.log(hotel.stars); // => 3Error handling
If MSS returns an error response or the request times out, the promise is rejected with a MSSError:
try {
const res = await client.request((req) => {
// …
});
// do something with res
} catch (err) {
if (err instanceof MSSError) {
// handle the error
console.error(err);
return;
}
// handle generic errors
throw error;
}0.42.0
11 months ago
0.43.0
11 months ago
0.40.0
12 months ago
0.41.0
11 months ago
0.39.0
1 year ago
0.38.0
1 year ago
0.37.0
1 year ago
0.36.0
1 year ago
0.48.0
9 months ago
0.49.0
6 months ago
0.46.0
10 months ago
0.47.0
10 months ago
0.44.0
11 months ago
0.45.0
10 months ago
0.35.0
1 year ago
0.34.0
1 year ago
0.33.0
1 year ago
0.32.0
1 year ago
0.31.0
2 years ago
0.30.0
2 years ago
0.29.0
2 years ago
0.27.0
2 years ago
0.26.0
2 years ago
0.25.0
2 years ago
0.24.0
3 years ago
0.23.0
3 years ago