0.20.0 • Published 1 year ago

@hgv/mss-nodejs v0.20.0

Weekly downloads
10
License
MIT
Repository
github
Last release
1 year 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

1 year ago

0.19.0

1 year ago

0.18.0

2 years ago

0.14.0

2 years ago

0.15.0

2 years ago

0.16.0

2 years ago

0.17.0

2 years ago

0.12.0

2 years ago

0.13.0

2 years ago

0.11.0

3 years ago

0.10.0

3 years ago

0.9.0

3 years ago

0.8.0

3 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.10

5 years ago

0.6.9

5 years ago

0.6.8

5 years ago

0.6.6

5 years ago

0.6.5

6 years ago

0.6.4

6 years ago

0.6.3

6 years ago

0.6.2

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.0

6 years ago

0.4.0

6 years ago

0.3.11

6 years ago

0.3.10

6 years ago

0.3.9

6 years ago

0.3.8

6 years ago

0.3.7

6 years ago

0.3.6

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago