1.7.0 • Published 4 years ago

btujs v1.7.0

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

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

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)

Usage

1.7.0

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.2.0

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.1

5 years ago

0.2.10

5 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago