Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/auspicus/guestware
JS GuestWare Client
https://github.com/auspicus/guestware
api api-client guestware lightweight
Last synced: 18 days ago
JSON representation
JS GuestWare Client
- Host: GitHub
- URL: https://github.com/auspicus/guestware
- Owner: Auspicus
- Created: 2017-07-19T05:47:19.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-01-26T00:58:51.000Z (almost 4 years ago)
- Last Synced: 2024-12-17T01:54:35.308Z (23 days ago)
- Topics: api, api-client, guestware, lightweight
- Language: JavaScript
- Homepage:
- Size: 818 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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**
```javascript
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: "[email protected]"
};// 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: "[email protected]" #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)
});
```