Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Latest commit

 

History

History
317 lines (184 loc) · 7.4 KB

api.openapi.md

File metadata and controls

317 lines (184 loc) · 7.4 KB

@tuyapi/openapi / Exports / api / OpenAPI

Class: OpenAPI

api.OpenAPI

Hierarchy

  • OpenAPI

Table of contents

Constructors

Properties

Methods

Constructors

constructor

+ new OpenAPI(__namedParameters: { handleToken: boolean ; key: string ; region: string ; schema: string ; secret: string }): OpenAPI

Parameters:

__namedParameters: object

Name Type
handleToken boolean
key string
region string
schema string
secret string

Returns: OpenAPI

Defined in: api.ts:25

Properties

_client

Private Readonly _client: Got

Defined in: api.ts:23


_key

Private Readonly _key: string

Defined in: api.ts:24


_secret

Private Readonly _secret: string

Defined in: api.ts:25


handleToken

handleToken: boolean

Defined in: api.ts:21


schema

schema: string

Defined in: api.ts:20


tokenAccess

tokenAccess: string

Defined in: api.ts:17


tokenExpiresAt

tokenExpiresAt: Date

Defined in: api.ts:19


tokenRefresh

tokenRefresh: string

Defined in: api.ts:18

Methods

getDevice

getDevice(deviceId: string): Promise<Device>

Parameters:

Name Type
deviceId string

Returns: Promise<Device>

Defined in: api.ts:193


getDeviceStatus

getDeviceStatus(deviceId: string): Promise<Status<string, unknown>[]>

Parameters:

Name Type
deviceId string

Returns: Promise<Status<string, unknown>[]>

Defined in: api.ts:199


getDeviceToken

getDeviceToken(__namedParameters: { timezone: string ; uid: string }): Promise<DeviceTokenResponse>

Parameters:

__namedParameters: object

Name Type
timezone string
uid string

Returns: Promise<DeviceTokenResponse>

Defined in: api.ts:154


getDevices

getDevices(__namedParameters?: { ids?: undefined | string[] ; pageNumber: number ; pageSize: number }): Promise<DevicesResponse>

Parameters:

__namedParameters: object

Name Type
ids? undefined | string[]
pageNumber number
pageSize number

Returns: Promise<DevicesResponse>

Defined in: api.ts:177


getDevicesByToken

getDevicesByToken(token: string): Promise<PairingResultResponse>

Parameters:

Name Type
token string

Returns: Promise<PairingResultResponse>

Defined in: api.ts:165


getDevicesByUser

getDevicesByUser(uid: string): Promise<Device[]>

Parameters:

Name Type
uid string

Returns: Promise<Device[]>

Defined in: api.ts:171


getSubDevicesOfZigbeeGateway

getSubDevicesOfZigbeeGateway(deviceId: string): Promise<Device>

Parameters:

Name Type
deviceId string

Returns: Promise<Device>

Defined in: api.ts:205


getToken

getToken(): Promise<void>

Returns: Promise<void>

Defined in: api.ts:102


getUsers

getUsers(__namedParameters?: { pageNumber: number ; pageSize: number }): Promise<UsersResponse>

Parameters:

__namedParameters: object

Name Type
pageNumber number
pageSize number

Returns: Promise<UsersResponse>

Defined in: api.ts:144


isTokenExpired

isTokenExpired(): boolean

Returns: boolean

Defined in: api.ts:98


putUser

putUser(__namedParameters: { countryCode: string ; nickname: string ; password: string ; username: string ; usernameType: string }): Promise<string>

Parameters:

__namedParameters: object

Name Type
countryCode string
nickname string
password string
username string
usernameType string

Returns: Promise<string>

Defined in: api.ts:123


refreshToken

refreshToken(): Promise<void>

Returns: Promise<void>

Defined in: api.ts:114