@tuyapi/openapi / Exports / api / OpenAPI
api.OpenAPI
- OpenAPI
- getDevice
- getDeviceStatus
- getDeviceToken
- getDevices
- getDevicesByToken
- getDevicesByUser
- getSubDevicesOfZigbeeGateway
- getToken
- getUsers
- isTokenExpired
- putUser
- refreshToken
+ new OpenAPI(__namedParameters
: { handleToken
: boolean ; key
: string ; region
: string ; schema
: string ; secret
: string }): OpenAPI
• __namedParameters: object
Name | Type |
---|---|
handleToken |
boolean |
key |
string |
region |
string |
schema |
string |
secret |
string |
Returns: OpenAPI
Defined in: api.ts:25
• Private
Readonly
_client: Got
Defined in: api.ts:23
• Private
Readonly
_key: string
Defined in: api.ts:24
• Private
Readonly
_secret: string
Defined in: api.ts:25
• handleToken: boolean
Defined in: api.ts:21
• schema: string
Defined in: api.ts:20
• tokenAccess: string
Defined in: api.ts:17
• tokenExpiresAt: Date
Defined in: api.ts:19
• tokenRefresh: string
Defined in: api.ts:18
▸ getDevice(deviceId
: string): Promise<Device>
Name | Type |
---|---|
deviceId |
string |
Returns: Promise<Device>
Defined in: api.ts:193
▸ getDeviceStatus(deviceId
: string): Promise<Status<string, unknown>[]>
Name | Type |
---|---|
deviceId |
string |
Returns: Promise<Status<string, unknown>[]>
Defined in: api.ts:199
▸ getDeviceToken(__namedParameters
: { timezone
: string ; uid
: string }): Promise<DeviceTokenResponse>
• __namedParameters: object
Name | Type |
---|---|
timezone |
string |
uid |
string |
Returns: Promise<DeviceTokenResponse>
Defined in: api.ts:154
▸ getDevices(__namedParameters?
: { ids?
: undefined | string[] ; pageNumber
: number ; pageSize
: number }): Promise<DevicesResponse>
• __namedParameters: object
Name | Type |
---|---|
ids? |
undefined | string[] |
pageNumber |
number |
pageSize |
number |
Returns: Promise<DevicesResponse>
Defined in: api.ts:177
▸ getDevicesByToken(token
: string): Promise<PairingResultResponse>
Name | Type |
---|---|
token |
string |
Returns: Promise<PairingResultResponse>
Defined in: api.ts:165
▸ getDevicesByUser(uid
: string): Promise<Device[]>
Name | Type |
---|---|
uid |
string |
Returns: Promise<Device[]>
Defined in: api.ts:171
▸ getSubDevicesOfZigbeeGateway(deviceId
: string): Promise<Device>
Name | Type |
---|---|
deviceId |
string |
Returns: Promise<Device>
Defined in: api.ts:205
▸ getToken(): Promise<void>
Returns: Promise<void>
Defined in: api.ts:102
▸ getUsers(__namedParameters?
: { pageNumber
: number ; pageSize
: number }): Promise<UsersResponse>
• __namedParameters: object
Name | Type |
---|---|
pageNumber |
number |
pageSize |
number |
Returns: Promise<UsersResponse>
Defined in: api.ts:144
▸ isTokenExpired(): boolean
Returns: boolean
Defined in: api.ts:98
▸ putUser(__namedParameters
: { countryCode
: string ; nickname
: string ; password
: string ; username
: string ; usernameType
: string }): Promise<string>
• __namedParameters: object
Name | Type |
---|---|
countryCode |
string |
nickname |
string |
password |
string |
username |
string |
usernameType |
string |
Returns: Promise<string>
Defined in: api.ts:123
▸ refreshToken(): Promise<void>
Returns: Promise<void>
Defined in: api.ts:114