1.2.8 • Published 5 years ago

guestware v1.2.8

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

guestware

JS GuestWare Client

Documentation

https://auspicus.github.io/guestware/docs/

DISCLAIMER This product is not feature complete and updates may not be backwards compatible

require('dotenv').config();
var Guestware = require('guestware');

// Create a new instance of the Guestware
var instance = new Guestware(
  process.env.WDSL,
  process.env.APPLICATION_NAME,
  process.env.VERSION_NUMBER,
  process.env.APPLICATION_ID,
  process.env.USERNAME,
  process.env.PASSWORD
);

// Set up request arguments (this data will be sent to GuestWare with the request)
var requestArguments = {
  parstrGuestID: "testemail@gmail.com"
};

// Make a request
instance
.read('ReadGuestLoginGuestIDString', requestArguments)
.then(function (response) {
  // By default, we are returned a raw string response and a parsed version
  // If you would like to clean up your response, use the formatResponse function
  // This will map response nodes to a key in a new object
  var formattedResponse = instance.formatResponse(response.parsed, {
    id: 'GuestID',
    email: 'GuestLoginID',
    password: 'GuestLoginPassword',
    langcode: 'CultureID',
    created: 'EntryDate',
    updated: 'LastEditDate'
  });
  console.log(formattedResponse);
  // {
  //   id: "testuserid" #from GuestID,
  //   email: "testemail@gmail.com" #from GuestLoginID,
  //   password: "plaintextpasswordXd" #from GuestLoginPassword,
  //   langcode: "en" #from CultureID,
  //   created: "2017-02-02T15:26:32.543-08:00" #from EntryDate,
  //   updated: "2017-02-02T15:26:32.543-08:00" #from LastEditDate
  // }
})
.catch(function (err) {
  console.error(err)
});

// Make a request which returns a list
instance
.read('ReadGuestRewardTransactionAndDetailsByGuestID', {
  parintGuestID: 123456789
})
.then(function (response) {
  // Here we are going to format a list of response data into a nice clean array
  var formattedResponse = instance.formatResponse(response.parsed, {
    liTagName: 'virtual_GuestRewardTransactionAndDetails', // #tag name of list item
    map: {
      id: 'GuestID',
      desc: 'Description'
    }
  });
  console.log(formattedResponse);
  // [
  //   {
  //     id: '123456789' #from GuestID of this reward,
  //     desc: 'A description specific to this reward' #from Description of this reward
  //   },
  //   {
  //     id: '123456789',
  //     desc: 'A different description'
  //   }
  // ]
})
.catch(function (err) {
  console.error(err)
});
1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago