Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@thing-it/client-api
Advanced tools
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
Readme
@thing-it/client-api / Exports
@thing-it/client-api / Exports
@thing-it/client-api / Exports
@thing-it/client-api / Exports / ThingIt
Export
• new ThingIt(options
)
Creates an instance of ThingIt.
Memberof
ThingIt
Name | Type |
---|---|
options | ClientOptions |
• Private
clientOptions: ClientOptions
• Private
isExternalToken: boolean
= false
• Private
tokenInfo: undefined
| TokenInfo
▸ executeMeshQuery(meshId
, query
, options?
): Promise
<any
>
Execute a query on the input mesh
Memberof
ThingIt
Name | Type |
---|---|
meshId | string |
query | any |
options? | RequestOptions |
Promise
<any
>
▸ get(url
, options
): Promise
<any
>
Generic method to execute a GET request
Memberof
ThingIt
Name | Type |
---|---|
url | string |
options | RequestOptions |
Promise
<any
>
▸ Private
getAccessToken(): undefined
| string
Memberof
ThingIt
undefined
| string
▸ getCurrentDeskOccupancy(meshId
, buildingId
, options?
): Promise
<any
>
Get current desk occupancy in the input mesh and building
Memberof
ThingIt
Name | Type |
---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Promise
<any
>
▸ getCurrentSpaceOccupancy(meshId
, buildingId
, options?
): Promise
<any
>
Get current space occupancy in the input mesh and building
Memberof
ThingIt
Name | Type |
---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Promise
<any
>
▸ Private
getFullUrl(url
): string
Memberof
ThingIt
Name | Type |
---|---|
url | string |
string
▸ Private
getHeaders(options
): Headers
Memberof
ThingIt
Name | Type |
---|---|
options | RequestOptions |
Headers
▸ getUpdatedToken(): Promise
<undefined
| TokenInfo
>
Get the updated access token
Memberof
ThingIt
Promise
<undefined
| TokenInfo
>
▸ Private
initPostMessageListener(): void
Memberof
ThingIt
void
▸ 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
Name | Type |
---|---|
meshId | string |
options? | RequestOptions |
Promise
<any
>
▸ listFloors(meshId
, buildingId
, options?
): Promise
<any
>
List the floors in the input mesh and building
Memberof
ThingIt
Name | Type |
---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Promise
<any
>
▸ post(url
, body
, options
): Promise
<any
>
Generic method to execute a POST request
Memberof
ThingIt
Name | Type |
---|---|
url | string |
body | any |
options | RequestOptions |
Promise
<any
>
▸ retrieveCurrentlyActiveBookings(meshId
, buildingId
, options?
): Promise
<any
>
Retrieve currently active bookings in the input mesh and building
Memberof
ThingIt
Name | Type |
---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Promise
<any
>
▸ retrieveToken(): Promise
<undefined
| TokenInfo
>
Retrieve the access token
Memberof
ThingIt
Promise
<undefined
| TokenInfo
>
▸ setToken(tokenInfo
): void
Set the token
Memberof
ThingIt
Name | Type |
---|---|
tokenInfo | TokenInfo |
void
@thing-it/client-api / Exports / AuthenticationInfo
• Optional
apiKey: string
• clientId: string
• clientSecret: string
• password: string
• username: string
@thing-it/client-api / Exports / ClientOptions
• Optional
authInfo: AuthenticationInfo
• Optional
customer: string
• host: string
• Optional
mesh: string
@thing-it/client-api / Exports / RequestOptions
• customer: string
• mesh: string
@thing-it/client-api / Exports / TokenInfo
• access_token: string
• expires_in: number
• refresh_token: string
• token_type: string
@thing-it/client-api / Exports
@thing-it/client-api / Exports / ThingIt
Export
• new ThingIt(options
)
Creates an instance of ThingIt.
Memberof
ThingIt
Name | Type |
---|---|
options | ClientOptions |
• Private
clientOptions: ClientOptions
• Private
isExternalToken: boolean
= false
• Private
tokenInfo: undefined
| TokenInfo
▸ executeMeshQuery(meshId
, query
, options?
): Promise
<any
>
Execute a query on the input mesh
Memberof
ThingIt
Name | Type |
---|---|
meshId | string |
query | any |
options? | RequestOptions |
Promise
<any
>
▸ get(url
, options
): Promise
<any
>
Generic method to execute a GET request
Memberof
ThingIt
Name | Type |
---|---|
url | string |
options | RequestOptions |
Promise
<any
>
▸ Private
getAccessToken(): undefined
| string
Memberof
ThingIt
undefined
| string
▸ getCurrentDeskOccupancy(meshId
, buildingId
, options?
): Promise
<any
>
Get current desk occupancy in the input mesh and building
Memberof
ThingIt
Name | Type |
---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Promise
<any
>
▸ getCurrentSpaceOccupancy(meshId
, buildingId
, options?
): Promise
<any
>
Get current space occupancy in the input mesh and building
Memberof
ThingIt
Name | Type |
---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Promise
<any
>
▸ Private
getFullUrl(url
): string
Memberof
ThingIt
Name | Type |
---|---|
url | string |
string
▸ Private
getHeaders(options
): Headers
Memberof
ThingIt
Name | Type |
---|---|
options | RequestOptions |
Headers
▸ getUpdatedToken(): Promise
<undefined
| TokenInfo
>
Get the updated access token
Memberof
ThingIt
Promise
<undefined
| TokenInfo
>
▸ Private
initPostMessageListener(): void
Memberof
ThingIt
void
▸ isApiReady(): Promise
<boolean
>
Check if the API is ready for use
Memberof
ThingIt
Promise
<boolean
>
▸ 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
Name | Type |
---|---|
meshId | string |
options? | RequestOptions |
Promise
<any
>
▸ listFloors(meshId
, buildingId
, options?
): Promise
<any
>
List the floors in the input mesh and building
Memberof
ThingIt
Name | Type |
---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Promise
<any
>
▸ post(url
, body
, options
): Promise
<any
>
Generic method to execute a POST request
Memberof
ThingIt
Name | Type |
---|---|
url | string |
body | any |
options | RequestOptions |
Promise
<any
>
▸ Private
postMessage(message
): void
Memberof
ThingIt
Name | Type |
---|---|
message | any |
void
▸ retrieveCurrentlyActiveBookings(meshId
, buildingId
, options?
): Promise
<any
>
Retrieve currently active bookings in the input mesh and building
Memberof
ThingIt
Name | Type |
---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Promise
<any
>
▸ retrieveToken(): Promise
<undefined
| TokenInfo
>
Retrieve the access token
Memberof
ThingIt
Promise
<undefined
| TokenInfo
>
▸ route(routeId
, params
): void
Navigates to the specified kiosk route
Memberof
ThingIt
Name | Type |
---|---|
routeId | string |
params | Object |
void
▸ setToken(tokenInfo
): void
Set the token
Memberof
ThingIt
Name | Type |
---|---|
tokenInfo | TokenInfo |
void
@thing-it/client-api / Exports / AuthenticationInfo
• Optional
apiKey: string
• clientId: string
• clientSecret: string
• password: string
• username: string
@thing-it/client-api / Exports / ClientOptions
• Optional
authInfo: AuthenticationInfo
• Optional
customer: string
• host: string
• Optional
mesh: string
@thing-it/client-api / Exports / RequestOptions
• customer: string
• mesh: string
@thing-it/client-api / Exports / TokenInfo
• access_token: string
• expires_in: number
• refresh_token: string
• token_type: string
@thing-it/client-api / Exports
@thing-it/client-api / Exports / ThingIt
Export
ServerAPI
• new ThingIt(options
)
Creates an instance of ThingIt.
Memberof
ThingIt
Name | Type |
---|---|
options | ClientOptions |
• Private
clientOptions: ClientOptions
• Private
isExternalToken: boolean
= false
• Private
tokenInfo: undefined
| TokenInfo
• Private
usageEventAPI: UsageEventAPI
▸ broadcastScreenshot(dataUrl
): void
Broadcasts screenshot event to parent context
Memberof
ThingIt
Name | Type |
---|---|
dataUrl | string |
void
▸ broadcastUserInteraction(): void
Broadcasts a user interaction event to any parent context
Memberof
ThingIt
void
▸ executeMeshQuery(meshId
, query
, options?
): Promise
<any
>
Execute a query on the input mesh
Memberof
ThingIt
Name | Type |
---|---|
meshId | string |
query | any |
options? | RequestOptions |
Promise
<any
>
▸ get(url
, options
): Promise
<any
>
Generic method to execute a GET request
Memberof
ThingIt
Name | Type |
---|---|
url | string |
options | RequestOptions |
Promise
<any
>
ServerAPI.get
▸ Private
getAccessToken(): undefined
| string
Memberof
ThingIt
undefined
| string
▸ getCurrentDeskOccupancy(meshId
, buildingId
, options?
): Promise
<any
>
Get current desk occupancy in the input mesh and building
Memberof
ThingIt
Name | Type |
---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Promise
<any
>
▸ getCurrentSpaceOccupancy(meshId
, buildingId
, options?
): Promise
<any
>
Get current space occupancy in the input mesh and building
Memberof
ThingIt
Name | Type |
---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Promise
<any
>
▸ Private
getFullUrl(url
, base
): string
Memberof
ThingIt
Name | Type |
---|---|
url | string |
base | string |
string
▸ Private
getHeaders(options
): Headers
Memberof
ThingIt
Name | Type |
---|---|
options | RequestOptions |
Headers
▸ getUpdatedToken(): Promise
<undefined
| TokenInfo
>
Get the updated access token
Memberof
ThingIt
Promise
<undefined
| TokenInfo
>
▸ Private
initPostMessageListener(): void
Memberof
ThingIt
void
▸ isApiReady(): Promise
<boolean
>
Check if the API is ready for use
Memberof
ThingIt
Promise
<boolean
>
▸ 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
Name | Type |
---|---|
meshId | string |
options? | RequestOptions |
Promise
<any
>
▸ listFloors(meshId
, buildingId
, options?
): Promise
<any
>
List the floors in the input mesh and building
Memberof
ThingIt
Name | Type |
---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Promise
<any
>
▸ post(url
, body
, options
): Promise
<any
>
Generic method to execute a POST request
Memberof
ThingIt
Name | Type |
---|---|
url | string |
body | any |
options | RequestOptions |
Promise
<any
>
ServerAPI.post
▸ Private
postMessage(message
): void
Memberof
ThingIt
Name | Type |
---|---|
message | any |
void
▸ retrieveCurrentlyActiveBookings(meshId
, buildingId
, options?
): Promise
<any
>
Retrieve currently active bookings in the input mesh and building
Memberof
ThingIt
Name | Type |
---|---|
meshId | string |
buildingId | string |
options? | RequestOptions |
Promise
<any
>
▸ retrieveToken(): Promise
<undefined
| TokenInfo
>
Retrieve the access token
Memberof
ThingIt
Promise
<undefined
| TokenInfo
>
▸ route(routeId
, params
): void
Navigates to the specified kiosk route
Memberof
ThingIt
Name | Type |
---|---|
routeId | string |
params | Object |
void
▸ setToken(tokenInfo
): void
Set the token
Memberof
ThingIt
Name | Type |
---|---|
tokenInfo | TokenInfo |
void
▸ startUsageEvent(path
, timeout?
): UsageEvent
Name | Type | Default value |
---|---|---|
path | string | undefined |
timeout | number | 10000 |
@thing-it/client-api / Exports / UsageEvent
• new UsageEvent(usageEventAPI
, ts
, eventId
, parentId
, customer
, mesh
, user
, device
, deviceModel
, deviceOperatingSystem
, sessionId
, view
, softwareVersion
, agent
, path
)
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 |
• Optional
agent: string
• Optional
customer: string
• Optional
data: any
• Optional
device: string
• Optional
deviceModel: string
• Optional
deviceOperatingSystem: string
• Optional
duration: number
• eventId: string
• Optional
mesh: string
• Optional
namePath: string
• Optional
parentId: string
• Optional
sessionId: string
• Optional
softwareVersion: string
• start: Date
• state: UsageEventState
• ts: string
• usageEventAPI: UsageEventAPI
• Optional
user: string
• Optional
view: string
▸ abort(data?
): void
Name | Type | Default value |
---|---|---|
data | any | null |
void
▸ addData(data?
): void
Name | Type | Default value |
---|---|---|
data | any | null |
void
▸ complete(data?
): void
Name | Type | Default value |
---|---|---|
data | any | null |
void
@thing-it/client-api / Exports / UsageEventAPI
Export
• new UsageEventAPI(serverAPI
, baseUrl
, settings
)
Creates an instance of UsageEventAPI.
Memberof
UsageEventAPI
Name | Type |
---|---|
serverAPI | ServerAPI |
baseUrl | string |
settings | UsageEventSettings |
• baseUrl: string
= 'https://api.thing-it.io'
• serverAPI: ServerAPI
• settings: UsageEventSettings
▸ Private
getFullUrl(url
, base
): string
Memberof
ThingIt
Name | Type |
---|---|
url | string |
base | string |
string
▸ start(path
, timeout?
, view?
, sessionId?
): UsageEvent
Name | Type | Default value |
---|---|---|
path | string | undefined |
timeout | number | 10000 |
view? | string | undefined |
sessionId? | string | undefined |
▸ submit(usageEvent
): void
Name | Type |
---|---|
usageEvent | UsageEvent |
void
@thing-it/client-api / Exports / Utils
• new Utils()
▸ Static
uuidv4(): any
any
@thing-it/client-api / Exports / UsageEventState
• ABORTED = "abort"
• COMPLETED = "complete"
• STARTED = "started"
• SUBMITTED = "submitted"
• TIMED_OUT = "timeout"
@thing-it/client-api / Exports / AuthenticationInfo
• Optional
apiKey: string
• clientId: string
• clientSecret: string
• password: string
• username: string
@thing-it/client-api / Exports / ClientOptions
• Optional
authInfo: AuthenticationInfo
• Optional
customer: string
• host: string
• Optional
mesh: string
• usageEventsBaseUrl: string
@thing-it/client-api / Exports / RequestOptions
• customer: string
• mesh: string
@thing-it/client-api / Exports / TokenInfo
• access_token: string
• expires_in: number
• refresh_token: string
• token_type: string
@thing-it/client-api / Exports / UsageEventSettings
• Optional
agent: string
• Optional
customer: string
• Optional
device: string
• Optional
deviceModel: string
• Optional
deviceOperatingSystem: string
• Optional
mesh: string
• Optional
softwareVersion: string
• Optional
user: string
@thing-it/client-api / Exports
FAQs
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
We found that @thing-it/client-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 19 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.