@tuyapi/openapi
Advanced tools
Comparing version
@@ -45,3 +45,3 @@ "use strict"; | ||
headers: { | ||
_client_id: this._key, | ||
client_id: this._key, | ||
sign_method: 'HMAC-SHA256' | ||
@@ -59,3 +59,3 @@ }, | ||
if (this.tokenAccess === '') { | ||
sign = crypto.createHmac('sha256', this._secret).update(`${this._key}${now}`).digest('hex').toUpperCase(); | ||
sign = crypto.createHmac('sha256', this._secret).update(this._key + now.toString()).digest('hex').toUpperCase(); | ||
} else { | ||
@@ -62,0 +62,0 @@ sign = crypto.createHmac('sha256', this._secret).update(`${this._key}${this.tokenAccess}${now}`).digest('hex').toUpperCase(); |
{ | ||
"name": "@tuyapi/openapi", | ||
"version": "0.1.0", | ||
"version": "0.1.2", | ||
"description": "🚪 a wrapper for Tuya's OpenAPI", | ||
@@ -5,0 +5,0 @@ "main": "dist/api.js", |
@@ -45,1 +45,3 @@ # A TypeScript wrapper for Tuya's [OpenAPI](https://docs.tuya.com/en/iot/open-api/quick-start/solution-overview) | ||
``` | ||
## [Docs](https://tuyaapi.github.io/openapi/) |
9543
0.55%47
4.44%