@thing-it/client-api v0.0.12
- Classes
- Interfaces
- @thing-it/client-api
- Classes
- Interfaces
- @thing-it/client-api
- Classes
- Enums
- Interfaces
- @thing-it/client-api
@thing-it/client-api / Exports
@thing-it/client-api / Exports
@thing-it/client-api / Exports
Classes
@thing-it/client-api / Exports / ThingIt
Class: ThingIt
Export
Table of contents
Constructors
Properties
Methods
- executeMeshQuery
- get
- getAccessToken
- getCurrentDeskOccupancy
- getCurrentSpaceOccupancy
- getFullUrl
- getHeaders
- getUpdatedToken
- initPostMessageListener
- listBuildings
- listFloors
- post
- retrieveCurrentlyActiveBookings
- retrieveToken
- setToken
Constructors
constructor
• new ThingIt(options)
Creates an instance of ThingIt.
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
options | ClientOptions |
Defined in
Properties
clientOptions
• Private clientOptions: ClientOptions
Defined in
isExternalToken
• Private isExternalToken: boolean = false
Defined in
tokenInfo
• Private tokenInfo: undefined | TokenInfo
Defined in
Methods
executeMeshQuery
▸ executeMeshQuery(meshId, query, options?): Promise<any>
Execute a query on the input mesh
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
query | any |
options? | RequestOptions |
Returns
Promise<any>
Defined in
get
▸ get(url, options): Promise<any>
Generic method to execute a GET request
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
url | string |
options | RequestOptions |
Returns
Promise<any>
Defined in
getAccessToken
▸ Private getAccessToken(): undefined | string
Memberof
ThingIt
Returns
undefined | string
Defined in
getCurrentDeskOccupancy
▸ getCurrentDeskOccupancy(meshId, buildingId, options?): Promise<any>
Get current desk occupancy in the input mesh and building
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Returns
Promise<any>
Defined in
getCurrentSpaceOccupancy
▸ getCurrentSpaceOccupancy(meshId, buildingId, options?): Promise<any>
Get current space occupancy in the input mesh and building
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Returns
Promise<any>
Defined in
getFullUrl
▸ Private getFullUrl(url): string
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
url | string |
Returns
string
Defined in
getHeaders
▸ Private getHeaders(options): Headers
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
options | RequestOptions |
Returns
Headers
Defined in
getUpdatedToken
▸ getUpdatedToken(): Promise<undefined | TokenInfo>
Get the updated access token
Memberof
ThingIt
Returns
Promise<undefined | TokenInfo>
Defined in
initPostMessageListener
▸ Private initPostMessageListener(): void
Memberof
ThingIt
Returns
void
Defined in
listBuildings
▸ listBuildings(meshId, options?): Promise<any>
List the buildings in the input mesh
Example
const meshId = 'ab12314';
const customer = '123123123';
thingIt = new ThingIt();
thingIt.listBuildings(meshId, {meshId, customer})Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
options? | RequestOptions |
Returns
Promise<any>
Defined in
listFloors
▸ listFloors(meshId, buildingId, options?): Promise<any>
List the floors in the input mesh and building
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Returns
Promise<any>
Defined in
post
▸ post(url, body, options): Promise<any>
Generic method to execute a POST request
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
url | string |
body | any |
options | RequestOptions |
Returns
Promise<any>
Defined in
retrieveCurrentlyActiveBookings
▸ retrieveCurrentlyActiveBookings(meshId, buildingId, options?): Promise<any>
Retrieve currently active bookings in the input mesh and building
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Returns
Promise<any>
Defined in
retrieveToken
▸ retrieveToken(): Promise<undefined | TokenInfo>
Retrieve the access token
Memberof
ThingIt
Returns
Promise<undefined | TokenInfo>
Defined in
setToken
▸ setToken(tokenInfo): void
Set the token
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
tokenInfo | TokenInfo |
Returns
void
Defined in
Interfaces
@thing-it/client-api / Exports / AuthenticationInfo
Interface: AuthenticationInfo
Table of contents
Properties
Properties
apiKey
• Optional apiKey: string
Defined in
clientId
• clientId: string
Defined in
clientSecret
• clientSecret: string
Defined in
password
• password: string
Defined in
username
• username: string
Defined in
@thing-it/client-api / Exports / ClientOptions
Interface: ClientOptions
Table of contents
Properties
Properties
authInfo
• Optional authInfo: AuthenticationInfo
Defined in
customer
• Optional customer: string
Defined in
host
• host: string
Defined in
mesh
• Optional mesh: string
Defined in
@thing-it/client-api / Exports / RequestOptions
Interface: RequestOptions
Table of contents
Properties
Properties
customer
• customer: string
Defined in
mesh
• mesh: string
Defined in
@thing-it/client-api / Exports / TokenInfo
Interface: TokenInfo
Table of contents
Properties
Properties
access_token
• access_token: string
Defined in
expires_in
• expires_in: number
Defined in
refresh_token
• refresh_token: string
Defined in
token_type
• token_type: string
Defined in
@thing-it/client-api / Exports
@thing-it/client-api
Table of contents
Classes
Interfaces
Classes
@thing-it/client-api / Exports / ThingIt
Class: ThingIt
Export
Table of contents
Constructors
Properties
Methods
- executeMeshQuery
- get
- getAccessToken
- getCurrentDeskOccupancy
- getCurrentSpaceOccupancy
- getFullUrl
- getHeaders
- getUpdatedToken
- initPostMessageListener
- isApiReady
- listBuildings
- listFloors
- post
- postMessage
- retrieveCurrentlyActiveBookings
- retrieveToken
- route
- setToken
Constructors
constructor
• new ThingIt(options)
Creates an instance of ThingIt.
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
options | ClientOptions |
Defined in
Properties
clientOptions
• Private clientOptions: ClientOptions
Defined in
isExternalToken
• Private isExternalToken: boolean = false
Defined in
tokenInfo
• Private tokenInfo: undefined | TokenInfo
Defined in
Methods
executeMeshQuery
▸ executeMeshQuery(meshId, query, options?): Promise<any>
Execute a query on the input mesh
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
query | any |
options? | RequestOptions |
Returns
Promise<any>
Defined in
get
▸ get(url, options): Promise<any>
Generic method to execute a GET request
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
url | string |
options | RequestOptions |
Returns
Promise<any>
Defined in
getAccessToken
▸ Private getAccessToken(): undefined | string
Memberof
ThingIt
Returns
undefined | string
Defined in
getCurrentDeskOccupancy
▸ getCurrentDeskOccupancy(meshId, buildingId, options?): Promise<any>
Get current desk occupancy in the input mesh and building
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Returns
Promise<any>
Defined in
getCurrentSpaceOccupancy
▸ getCurrentSpaceOccupancy(meshId, buildingId, options?): Promise<any>
Get current space occupancy in the input mesh and building
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Returns
Promise<any>
Defined in
getFullUrl
▸ Private getFullUrl(url): string
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
url | string |
Returns
string
Defined in
getHeaders
▸ Private getHeaders(options): Headers
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
options | RequestOptions |
Returns
Headers
Defined in
getUpdatedToken
▸ getUpdatedToken(): Promise<undefined | TokenInfo>
Get the updated access token
Memberof
ThingIt
Returns
Promise<undefined | TokenInfo>
Defined in
initPostMessageListener
▸ Private initPostMessageListener(): void
Memberof
ThingIt
Returns
void
Defined in
isApiReady
▸ isApiReady(): Promise<boolean>
Check if the API is ready for use
Memberof
ThingIt
Returns
Promise<boolean>
Defined in
listBuildings
▸ listBuildings(meshId, options?): Promise<any>
List the buildings in the input mesh
Example
const meshId = 'ab12314';
const customer = '123123123';
thingIt = new ThingIt();
thingIt.listBuildings(meshId, {meshId, customer})Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
options? | RequestOptions |
Returns
Promise<any>
Defined in
listFloors
▸ listFloors(meshId, buildingId, options?): Promise<any>
List the floors in the input mesh and building
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Returns
Promise<any>
Defined in
post
▸ post(url, body, options): Promise<any>
Generic method to execute a POST request
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
url | string |
body | any |
options | RequestOptions |
Returns
Promise<any>
Defined in
postMessage
▸ Private postMessage(message): void
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
message | any |
Returns
void
Defined in
retrieveCurrentlyActiveBookings
▸ retrieveCurrentlyActiveBookings(meshId, buildingId, options?): Promise<any>
Retrieve currently active bookings in the input mesh and building
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Returns
Promise<any>
Defined in
retrieveToken
▸ retrieveToken(): Promise<undefined | TokenInfo>
Retrieve the access token
Memberof
ThingIt
Returns
Promise<undefined | TokenInfo>
Defined in
route
▸ route(routeId, params): void
Navigates to the specified kiosk route
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
routeId | string |
params | Object |
Returns
void
Defined in
setToken
▸ setToken(tokenInfo): void
Set the token
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
tokenInfo | TokenInfo |
Returns
void
Defined in
Interfaces
@thing-it/client-api / Exports / AuthenticationInfo
Interface: AuthenticationInfo
Table of contents
Properties
Properties
apiKey
• Optional apiKey: string
Defined in
clientId
• clientId: string
Defined in
clientSecret
• clientSecret: string
Defined in
password
• password: string
Defined in
username
• username: string
Defined in
@thing-it/client-api / Exports / ClientOptions
Interface: ClientOptions
Table of contents
Properties
Properties
authInfo
• Optional authInfo: AuthenticationInfo
Defined in
customer
• Optional customer: string
Defined in
host
• host: string
Defined in
mesh
• Optional mesh: string
Defined in
@thing-it/client-api / Exports / RequestOptions
Interface: RequestOptions
Table of contents
Properties
Properties
customer
• customer: string
Defined in
mesh
• mesh: string
Defined in
@thing-it/client-api / Exports / TokenInfo
Interface: TokenInfo
Table of contents
Properties
Properties
access_token
• access_token: string
Defined in
expires_in
• expires_in: number
Defined in
refresh_token
• refresh_token: string
Defined in
token_type
• token_type: string
Defined in
@thing-it/client-api / Exports
@thing-it/client-api
Table of contents
Classes
Interfaces
Classes
@thing-it/client-api / Exports / ThingIt
Class: ThingIt
Export
Implements
ServerAPI
Table of contents
Constructors
Properties
Methods
- broadcastScreenshot
- broadcastUserInteraction
- executeMeshQuery
- get
- getAccessToken
- getCurrentDeskOccupancy
- getCurrentSpaceOccupancy
- getFullUrl
- getHeaders
- getUpdatedToken
- initPostMessageListener
- isApiReady
- listBuildings
- listFloors
- post
- postMessage
- retrieveCurrentlyActiveBookings
- retrieveToken
- route
- setToken
- startUsageEvent
Constructors
constructor
• new ThingIt(options)
Creates an instance of ThingIt.
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
options | ClientOptions |
Defined in
Properties
clientOptions
• Private clientOptions: ClientOptions
Defined in
isExternalToken
• Private isExternalToken: boolean = false
Defined in
tokenInfo
• Private tokenInfo: undefined | TokenInfo
Defined in
usageEventAPI
• Private usageEventAPI: UsageEventAPI
Defined in
Methods
broadcastScreenshot
▸ broadcastScreenshot(dataUrl): void
Broadcasts screenshot event to parent context
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
dataUrl | string |
Returns
void
Defined in
broadcastUserInteraction
▸ broadcastUserInteraction(): void
Broadcasts a user interaction event to any parent context
Memberof
ThingIt
Returns
void
Defined in
executeMeshQuery
▸ executeMeshQuery(meshId, query, options?): Promise<any>
Execute a query on the input mesh
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
query | any |
options? | RequestOptions |
Returns
Promise<any>
Defined in
get
▸ get(url, options): Promise<any>
Generic method to execute a GET request
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
url | string |
options | RequestOptions |
Returns
Promise<any>
Implementation of
ServerAPI.get
Defined in
getAccessToken
▸ Private getAccessToken(): undefined | string
Memberof
ThingIt
Returns
undefined | string
Defined in
getCurrentDeskOccupancy
▸ getCurrentDeskOccupancy(meshId, buildingId, options?): Promise<any>
Get current desk occupancy in the input mesh and building
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Returns
Promise<any>
Defined in
getCurrentSpaceOccupancy
▸ getCurrentSpaceOccupancy(meshId, buildingId, options?): Promise<any>
Get current space occupancy in the input mesh and building
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Returns
Promise<any>
Defined in
getFullUrl
▸ Private getFullUrl(url, base): string
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
url | string |
base | string |
Returns
string
Defined in
getHeaders
▸ Private getHeaders(options): Headers
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
options | RequestOptions |
Returns
Headers
Defined in
getUpdatedToken
▸ getUpdatedToken(): Promise<undefined | TokenInfo>
Get the updated access token
Memberof
ThingIt
Returns
Promise<undefined | TokenInfo>
Defined in
initPostMessageListener
▸ Private initPostMessageListener(): void
Memberof
ThingIt
Returns
void
Defined in
isApiReady
▸ isApiReady(): Promise<boolean>
Check if the API is ready for use
Memberof
ThingIt
Returns
Promise<boolean>
Defined in
listBuildings
▸ listBuildings(meshId, options?): Promise<any>
List the buildings in the input mesh
Example
const meshId = 'ab12314';
const customer = '123123123';
thingIt = new ThingIt();
thingIt.listBuildings(meshId, {meshId, customer})Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
options? | RequestOptions |
Returns
Promise<any>
Defined in
listFloors
▸ listFloors(meshId, buildingId, options?): Promise<any>
List the floors in the input mesh and building
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Returns
Promise<any>
Defined in
post
▸ post(url, body, options): Promise<any>
Generic method to execute a POST request
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
url | string |
body | any |
options | RequestOptions |
Returns
Promise<any>
Implementation of
ServerAPI.post
Defined in
postMessage
▸ Private postMessage(message): void
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
message | any |
Returns
void
Defined in
retrieveCurrentlyActiveBookings
▸ retrieveCurrentlyActiveBookings(meshId, buildingId, options?): Promise<any>
Retrieve currently active bookings in the input mesh and building
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Returns
Promise<any>
Defined in
retrieveToken
▸ retrieveToken(): Promise<undefined | TokenInfo>
Retrieve the access token
Memberof
ThingIt
Returns
Promise<undefined | TokenInfo>
Defined in
route
▸ route(routeId, params): void
Navigates to the specified kiosk route
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
routeId | string |
params | Object |
Returns
void
Defined in
setToken
▸ setToken(tokenInfo): void
Set the token
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
tokenInfo | TokenInfo |
Returns
void
Defined in
startUsageEvent
▸ startUsageEvent(path, timeout?): UsageEvent
Parameters
| Name | Type | Default value |
|---|---|---|
path | string | undefined |
timeout | number | 10000 |
Returns
Defined in
@thing-it/client-api / Exports / UsageEvent
Class: UsageEvent
Table of contents
Constructors
Properties
- agent
- customer
- data
- device
- deviceModel
- deviceOperatingSystem
- duration
- eventId
- mesh
- namePath
- parentId
- sessionId
- softwareVersion
- start
- state
- ts
- usageEventAPI
- user
- view
Methods
Constructors
constructor
• new UsageEvent(usageEventAPI, ts, eventId, parentId, customer, mesh, user, device, deviceModel, deviceOperatingSystem, sessionId, view, softwareVersion, agent, path)
Parameters
| Name | Type |
|---|---|
usageEventAPI | UsageEventAPI |
ts | string |
eventId | string |
parentId | undefined | string |
customer | undefined | string |
mesh | undefined | string |
user | undefined | string |
device | undefined | string |
deviceModel | undefined | string |
deviceOperatingSystem | undefined | string |
sessionId | undefined | string |
view | undefined | string |
softwareVersion | undefined | string |
agent | undefined | string |
path | string |
Defined in
Properties
agent
• Optional agent: string
Defined in
customer
• Optional customer: string
Defined in
data
• Optional data: any
Defined in
device
• Optional device: string
Defined in
deviceModel
• Optional deviceModel: string
Defined in
deviceOperatingSystem
• Optional deviceOperatingSystem: string
Defined in
duration
• Optional duration: number
Defined in
eventId
• eventId: string
Defined in
mesh
• Optional mesh: string
Defined in
namePath
• Optional namePath: string
Defined in
parentId
• Optional parentId: string
Defined in
sessionId
• Optional sessionId: string
Defined in
softwareVersion
• Optional softwareVersion: string
Defined in
start
• start: Date
Defined in
state
• state: UsageEventState
Defined in
ts
• ts: string
Defined in
usageEventAPI
• usageEventAPI: UsageEventAPI
Defined in
user
• Optional user: string
Defined in
view
• Optional view: string
Defined in
Methods
abort
▸ abort(data?): void
Parameters
| Name | Type | Default value |
|---|---|---|
data | any | null |
Returns
void
Defined in
addData
▸ addData(data?): void
Parameters
| Name | Type | Default value |
|---|---|---|
data | any | null |
Returns
void
Defined in
complete
▸ complete(data?): void
Parameters
| Name | Type | Default value |
|---|---|---|
data | any | null |
Returns
void
Defined in
@thing-it/client-api / Exports / UsageEventAPI
Class: UsageEventAPI
Export
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new UsageEventAPI(serverAPI, baseUrl, settings)
Creates an instance of UsageEventAPI.
Memberof
UsageEventAPI
Parameters
| Name | Type |
|---|---|
serverAPI | ServerAPI |
baseUrl | string |
settings | UsageEventSettings |
Defined in
Properties
baseUrl
• baseUrl: string = 'https://api.thing-it.io'
Defined in
serverAPI
• serverAPI: ServerAPI
Defined in
settings
• settings: UsageEventSettings
Defined in
Methods
getFullUrl
▸ Private getFullUrl(url, base): string
Memberof
ThingIt
Parameters
| Name | Type |
|---|---|
url | string |
base | string |
Returns
string
Defined in
start
▸ start(path, timeout?, view?, sessionId?): UsageEvent
Parameters
| Name | Type | Default value |
|---|---|---|
path | string | undefined |
timeout | number | 10000 |
view? | string | undefined |
sessionId? | string | undefined |
Returns
Defined in
submit
▸ submit(usageEvent): void
Parameters
| Name | Type |
|---|---|
usageEvent | UsageEvent |
Returns
void
Defined in
@thing-it/client-api / Exports / Utils
Class: Utils
Table of contents
Constructors
Methods
Constructors
constructor
• new Utils()
Methods
uuidv4
▸ Static uuidv4(): any
Returns
any
Defined in
Enums
@thing-it/client-api / Exports / UsageEventState
Enumeration: UsageEventState
Table of contents
Enumeration Members
Enumeration Members
ABORTED
• ABORTED = "abort"
Defined in
COMPLETED
• COMPLETED = "complete"
Defined in
STARTED
• STARTED = "started"
Defined in
SUBMITTED
• SUBMITTED = "submitted"
Defined in
TIMED_OUT
• TIMED_OUT = "timeout"
Defined in
Interfaces
@thing-it/client-api / Exports / AuthenticationInfo
Interface: AuthenticationInfo
Table of contents
Properties
Properties
apiKey
• Optional apiKey: string
Defined in
clientId
• clientId: string
Defined in
clientSecret
• clientSecret: string
Defined in
password
• password: string
Defined in
username
• username: string
Defined in
@thing-it/client-api / Exports / ClientOptions
Interface: ClientOptions
Table of contents
Properties
Properties
authInfo
• Optional authInfo: AuthenticationInfo
Defined in
customer
• Optional customer: string
Defined in
host
• host: string
Defined in
mesh
• Optional mesh: string
Defined in
usageEventsBaseUrl
• usageEventsBaseUrl: string
Defined in
@thing-it/client-api / Exports / RequestOptions
Interface: RequestOptions
Table of contents
Properties
Properties
customer
• customer: string
Defined in
mesh
• mesh: string
Defined in
@thing-it/client-api / Exports / TokenInfo
Interface: TokenInfo
Table of contents
Properties
Properties
access_token
• access_token: string
Defined in
expires_in
• expires_in: number
Defined in
refresh_token
• refresh_token: string
Defined in
token_type
• token_type: string
Defined in
@thing-it/client-api / Exports / UsageEventSettings
Interface: UsageEventSettings
Table of contents
Properties
Properties
agent
• Optional agent: string
Defined in
customer
• Optional customer: string
Defined in
device
• Optional device: string
Defined in
deviceModel
• Optional deviceModel: string
Defined in
deviceOperatingSystem
• Optional deviceOperatingSystem: string
Defined in
mesh
• Optional mesh: string
Defined in
softwareVersion
• Optional softwareVersion: string
Defined in
user
• Optional user: string
Defined in
@thing-it/client-api / Exports