0.20.0 • Published 2 years ago

@hgv/mss-nodejs v0.20.0

Weekly downloads
10
License
MIT
Repository
github
Last release
2 years ago

mss-nodejs

npm version

Experimential MSS API wrapper for Node.js projects.

Warning! Do not use this in production yet! Supports only v2.0!

Available services

  • getHotelList
  • getSpecialList
  • getRoomList
  • getPriceList
  • getRoomAvailability
  • getHotelPictures
  • getHotelPictureGroups
  • prepareBooking
  • getBooking
  • createInquiry
  • getUserSources

Runnable example

npm run dev

Example

const { Client, Request } = require("@hgv/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); // => 3

Error handling

If MSS returns an error response or the request times out, the Promise is rejected:

try {
  const res = await client.request((req) => {
    // …
  });
  // do something with res
} catch (err) {
  console.error(err);
}
0.20.0

2 years ago

0.19.0

3 years ago

0.18.0

3 years ago

0.14.0

3 years ago

0.15.0

3 years ago

0.16.0

3 years ago

0.17.0

3 years ago

0.12.0

4 years ago

0.13.0

4 years ago

0.11.0

4 years ago

0.10.0

4 years ago

0.9.0

4 years ago

0.8.0

4 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.10

6 years ago

0.6.9

6 years ago

0.6.8

6 years ago

0.6.6

7 years ago

0.6.5

7 years ago

0.6.4

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.11

7 years ago

0.3.10

7 years ago

0.3.9

7 years ago

0.3.8

7 years ago

0.3.7

7 years ago

0.3.6

7 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago