btujs
v1.7.0
Published
BTU.JS is a javascript library that interacts with BTU Protocol. It allows any developer to build a booking application or a widget.
Downloads
7
Readme
BTU.JS
BTU.JS is a javascript library that interacts with BTU Protocol. It allows any developer to build a booking application or a widget.
- Getting started
- Components
- Resources methods
- searchResources
- getResource
- getResourceItem
- isRessourceAvailable
- addResource Private beta - contact us
- deleteResource Private beta - contact us
- editResource Private beta - contact us
- Availabilities methods
- searchAvailableResources
- getResourceAvailabilities
- bookResource
- getBookingDetails
- cancelBooking
- addAvailability Private beta - contact us
- removeAvailability Private beta - contact us
Getting started
Install BTU.JS
npm install btujs --save
Instantiate BTU.JS
const btujs = require('btujs');
const myBtujs = new btujs();
Components
Dappbar
Documentation for this project
Resources methods
searchResources()
Search for resources regardless of their availabilities.
Prototype
myBtujs.resources.searchResources(String resourceType, Object body, Function callback)
Usage
getResource()
Query resource by its ID to get its details.
Prototype
myBtujs.resources.getResource(String resourceType, String resourceId, Object body, Function callback)
Usage
getResourceItem()
Query resource by its ID and its sub-item ID to get sub-item details.
Prototype
myBtujs.resource.getResourceItem(String resourceType, String resourceId, String itemId, Object body, Function callback)
Usage
Availabilities methods
searchAvailableResources()
Search for availables resources only.
Prototype
myBtujs.availabilities.searchAvailableResources(String resourceType, Object body, Function callback)
Usage
getResourceAvailabilities()
Query a resource by its ID and get its availabilities.
Prototype
myBtujs.availabilities.getResourceAvailabilities(String resourceType, String resourceId, Object body, Function callback)
isResourceAvailable()
Check if a resource is available under different conditions.
Prototype
myBtujs.availabilities.isResourceAvailable(String resourceType, String resourceId, Object body, Function callback)
Usage
Response
{
isAvailable: true // or false
}
bookResource()
Book a resource availability.
Prototype
myBtujs.availabilities.bookResource(String resourceType, String resourceId, Object body, Function callback)
Usage
getBookingDetails()
Get informations about a booking you made.
Prototype
myBtujs.availabilities.getBookingDetails(String resourceType, String bookingId, Object body, Function callback)
Usage
cancelBooking()
Cancel a reservation you booked through the bookResource method.
Prototype
myBtujs.availabilities.cancelBooking(String resourceType, String bookingId, Object body, Function callback)