node-switchbot 2.5.0-beta.27 → 2.5.0-beta.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Server } from 'node:http';
|
|
2
|
+
import type { pushResponse } from './types/devicepush.js';
|
|
2
3
|
import type { body } from './types/deviceresponse.js';
|
|
4
|
+
import type { deviceStatus } from './types/devicestatus.js';
|
|
3
5
|
import { EventEmitter } from 'node:events';
|
|
4
6
|
/**
|
|
5
7
|
* The `SwitchBotOpenAPI` class provides methods to interact with the SwitchBot OpenAPI.
|
|
@@ -58,23 +60,13 @@ export declare class SwitchBotOpenAPI extends EventEmitter {
|
|
|
58
60
|
/**
|
|
59
61
|
* Retrieves the list of devices from the SwitchBot OpenAPI.
|
|
60
62
|
*
|
|
61
|
-
* @returns {Promise<{ response:
|
|
63
|
+
* @returns {Promise<{ response: body, statusCode: number }>} A promise that resolves to an object containing the API response.
|
|
62
64
|
* @throws {Error} Throws an error if the request to get devices fails.
|
|
63
65
|
*/
|
|
64
66
|
getDevices(): Promise<{
|
|
65
67
|
response: body;
|
|
68
|
+
statusCode: number;
|
|
66
69
|
}>;
|
|
67
|
-
/**
|
|
68
|
-
* Generates the headers required for authentication with the SwitchBot OpenAPI.
|
|
69
|
-
*
|
|
70
|
-
* @returns An object containing the following headers:
|
|
71
|
-
* - `Authorization`: The token used for authorization.
|
|
72
|
-
* - `sign`: The HMAC-SHA256 signature of the concatenated token, timestamp, and nonce.
|
|
73
|
-
* - `nonce`: A unique identifier for the request, formatted as a UUID.
|
|
74
|
-
* - `t`: The current timestamp in milliseconds since the Unix epoch.
|
|
75
|
-
* - `Content-Type`: The content type of the request, set to `application/json`.
|
|
76
|
-
*/
|
|
77
|
-
private generateHeaders;
|
|
78
70
|
/**
|
|
79
71
|
* Controls a device by sending a command to the SwitchBot API.
|
|
80
72
|
*
|
|
@@ -82,18 +74,35 @@ export declare class SwitchBotOpenAPI extends EventEmitter {
|
|
|
82
74
|
* @param command - The command to send to the device.
|
|
83
75
|
* @param parameter - The parameter for the command.
|
|
84
76
|
* @param commandType - The type of the command, defaults to 'command'.
|
|
85
|
-
* @returns A promise that resolves to the API response.
|
|
77
|
+
* @returns {Promise<{ response: pushResponse['body'], statusCode: number }>} A promise that resolves to an object containing the API response.
|
|
86
78
|
* @throws An error if the device control fails.
|
|
87
79
|
*/
|
|
88
|
-
controlDevice(deviceId: string, command: string, parameter: string, commandType?: string): Promise<
|
|
80
|
+
controlDevice(deviceId: string, command: string, parameter: string, commandType?: string): Promise<{
|
|
81
|
+
response: pushResponse['body'];
|
|
82
|
+
statusCode: number;
|
|
83
|
+
}>;
|
|
89
84
|
/**
|
|
90
85
|
* Retrieves the status of a specific device.
|
|
91
86
|
*
|
|
92
87
|
* @param deviceId - The unique identifier of the device.
|
|
93
|
-
* @returns A promise that resolves to the device status.
|
|
88
|
+
* @returns {Promise<{ response: deviceStatus, statusCode: number }>} A promise that resolves to the device status.
|
|
94
89
|
* @throws An error if the request fails.
|
|
95
90
|
*/
|
|
96
|
-
getDeviceStatus(deviceId: string): Promise<
|
|
91
|
+
getDeviceStatus(deviceId: string): Promise<{
|
|
92
|
+
response: deviceStatus;
|
|
93
|
+
statusCode: number;
|
|
94
|
+
}>;
|
|
95
|
+
/**
|
|
96
|
+
* Generates the headers required for authentication with the SwitchBot OpenAPI.
|
|
97
|
+
*
|
|
98
|
+
* @returns An object containing the following headers:
|
|
99
|
+
* - `Authorization`: The token used for authorization.
|
|
100
|
+
* - `sign`: The HMAC-SHA256 signature of the concatenated token, timestamp, and nonce.
|
|
101
|
+
* - `nonce`: A unique identifier for the request, formatted as a UUID.
|
|
102
|
+
* - `t`: The current timestamp in milliseconds since the Unix epoch.
|
|
103
|
+
* - `Content-Type`: The content type of the request, set to `application/json`.
|
|
104
|
+
*/
|
|
105
|
+
private generateHeaders;
|
|
97
106
|
/**
|
|
98
107
|
* Sets up a webhook listener and configures the webhook on the server.
|
|
99
108
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switchbot-openapi.d.ts","sourceRoot":"","sources":["../src/switchbot-openapi.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAmB,MAAM,EAAkB,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"switchbot-openapi.d.ts","sourceRoot":"","sources":["../src/switchbot-openapi.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAmB,MAAM,EAAkB,MAAM,WAAW,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAK3D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAO1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,OAAO,CAAQ;IAEvB,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAO;IAE3C;;;;;OAKG;gBACS,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAOzC;;;;;OAKG;YACW,OAAO;IAIrB;;;;;OAKG;IACG,UAAU,IAAI,OAAO,CAAC;QAAE,QAAQ,EAAE,IAAI,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAanE;;;;;;;;;OASG;IACG,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,GAAE,MAAkB,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAqB3K;;;;;;OAMG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,YAAY,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAgBhG;;;;;;;;;OASG;IACH,OAAO,CAAC,eAAe,CAiBtB;IAED;;;;;;;;;;;;;OAaG;IACG,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA6F9C;;;;;;;OAOG;IACG,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAqBhD"}
|
|
@@ -68,7 +68,7 @@ export class SwitchBotOpenAPI extends EventEmitter {
|
|
|
68
68
|
/**
|
|
69
69
|
* Retrieves the list of devices from the SwitchBot OpenAPI.
|
|
70
70
|
*
|
|
71
|
-
* @returns {Promise<{ response:
|
|
71
|
+
* @returns {Promise<{ response: body, statusCode: number }>} A promise that resolves to an object containing the API response.
|
|
72
72
|
* @throws {Error} Throws an error if the request to get devices fails.
|
|
73
73
|
*/
|
|
74
74
|
async getDevices() {
|
|
@@ -77,40 +77,13 @@ export class SwitchBotOpenAPI extends EventEmitter {
|
|
|
77
77
|
const response = await body.json();
|
|
78
78
|
this.emitLog('debug', `Got devices: ${JSON.stringify(response)}`);
|
|
79
79
|
this.emitLog('debug', `statusCode: ${statusCode}`);
|
|
80
|
-
return { response };
|
|
80
|
+
return { response, statusCode };
|
|
81
81
|
}
|
|
82
82
|
catch (error) {
|
|
83
83
|
this.emitLog('error', `Failed to get devices: ${error.message}`);
|
|
84
84
|
throw new Error(`Failed to get devices: ${error.message}`);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Generates the headers required for authentication with the SwitchBot OpenAPI.
|
|
89
|
-
*
|
|
90
|
-
* @returns An object containing the following headers:
|
|
91
|
-
* - `Authorization`: The token used for authorization.
|
|
92
|
-
* - `sign`: The HMAC-SHA256 signature of the concatenated token, timestamp, and nonce.
|
|
93
|
-
* - `nonce`: A unique identifier for the request, formatted as a UUID.
|
|
94
|
-
* - `t`: The current timestamp in milliseconds since the Unix epoch.
|
|
95
|
-
* - `Content-Type`: The content type of the request, set to `application/json`.
|
|
96
|
-
*/
|
|
97
|
-
generateHeaders = () => {
|
|
98
|
-
const t = `${Date.now()}`;
|
|
99
|
-
const nonce = randomUUID();
|
|
100
|
-
const data = this.token + t + nonce;
|
|
101
|
-
const signTerm = crypto
|
|
102
|
-
.createHmac('sha256', this.secret)
|
|
103
|
-
.update(Buffer.from(data, 'utf-8'))
|
|
104
|
-
.digest();
|
|
105
|
-
const sign = signTerm.toString('base64');
|
|
106
|
-
return {
|
|
107
|
-
'Authorization': this.token,
|
|
108
|
-
'sign': sign,
|
|
109
|
-
'nonce': nonce,
|
|
110
|
-
't': t,
|
|
111
|
-
'Content-Type': 'application/json',
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
87
|
/**
|
|
115
88
|
* Controls a device by sending a command to the SwitchBot API.
|
|
116
89
|
*
|
|
@@ -118,7 +91,7 @@ export class SwitchBotOpenAPI extends EventEmitter {
|
|
|
118
91
|
* @param command - The command to send to the device.
|
|
119
92
|
* @param parameter - The parameter for the command.
|
|
120
93
|
* @param commandType - The type of the command, defaults to 'command'.
|
|
121
|
-
* @returns A promise that resolves to the API response.
|
|
94
|
+
* @returns {Promise<{ response: pushResponse['body'], statusCode: number }>} A promise that resolves to an object containing the API response.
|
|
122
95
|
* @throws An error if the device control fails.
|
|
123
96
|
*/
|
|
124
97
|
async controlDevice(deviceId, command, parameter, commandType = 'command') {
|
|
@@ -135,7 +108,7 @@ export class SwitchBotOpenAPI extends EventEmitter {
|
|
|
135
108
|
const response = await body.json();
|
|
136
109
|
this.emitLog('debug', `Controlled device: ${deviceId} with command: ${command} and parameter: ${parameter}`);
|
|
137
110
|
this.emitLog('debug', `statusCode: ${statusCode}`);
|
|
138
|
-
return { response };
|
|
111
|
+
return { response, statusCode };
|
|
139
112
|
}
|
|
140
113
|
catch (error) {
|
|
141
114
|
this.emitLog('error', `Failed to control device: ${error.message}`);
|
|
@@ -146,7 +119,7 @@ export class SwitchBotOpenAPI extends EventEmitter {
|
|
|
146
119
|
* Retrieves the status of a specific device.
|
|
147
120
|
*
|
|
148
121
|
* @param deviceId - The unique identifier of the device.
|
|
149
|
-
* @returns A promise that resolves to the device status.
|
|
122
|
+
* @returns {Promise<{ response: deviceStatus, statusCode: number }>} A promise that resolves to the device status.
|
|
150
123
|
* @throws An error if the request fails.
|
|
151
124
|
*/
|
|
152
125
|
async getDeviceStatus(deviceId) {
|
|
@@ -158,13 +131,40 @@ export class SwitchBotOpenAPI extends EventEmitter {
|
|
|
158
131
|
const response = await body.json();
|
|
159
132
|
this.emitLog('debug', `Got device status: ${deviceId}`);
|
|
160
133
|
this.emitLog('debug', `statusCode: ${statusCode}`);
|
|
161
|
-
return { response };
|
|
134
|
+
return { response, statusCode };
|
|
162
135
|
}
|
|
163
136
|
catch (error) {
|
|
164
137
|
this.emitLog('error', `Failed to get device status: ${error.message}`);
|
|
165
138
|
throw new Error(`Failed to get device status: ${error.message}`);
|
|
166
139
|
}
|
|
167
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Generates the headers required for authentication with the SwitchBot OpenAPI.
|
|
143
|
+
*
|
|
144
|
+
* @returns An object containing the following headers:
|
|
145
|
+
* - `Authorization`: The token used for authorization.
|
|
146
|
+
* - `sign`: The HMAC-SHA256 signature of the concatenated token, timestamp, and nonce.
|
|
147
|
+
* - `nonce`: A unique identifier for the request, formatted as a UUID.
|
|
148
|
+
* - `t`: The current timestamp in milliseconds since the Unix epoch.
|
|
149
|
+
* - `Content-Type`: The content type of the request, set to `application/json`.
|
|
150
|
+
*/
|
|
151
|
+
generateHeaders = () => {
|
|
152
|
+
const t = `${Date.now()}`;
|
|
153
|
+
const nonce = randomUUID();
|
|
154
|
+
const data = this.token + t + nonce;
|
|
155
|
+
const signTerm = crypto
|
|
156
|
+
.createHmac('sha256', this.secret)
|
|
157
|
+
.update(Buffer.from(data, 'utf-8'))
|
|
158
|
+
.digest();
|
|
159
|
+
const sign = signTerm.toString('base64');
|
|
160
|
+
return {
|
|
161
|
+
'Authorization': this.token,
|
|
162
|
+
'sign': sign,
|
|
163
|
+
'nonce': nonce,
|
|
164
|
+
't': t,
|
|
165
|
+
'Content-Type': 'application/json',
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
168
|
/**
|
|
169
169
|
* Sets up a webhook listener and configures the webhook on the server.
|
|
170
170
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switchbot-openapi.js","sourceRoot":"","sources":["../src/switchbot-openapi.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAEjG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IACxC,KAAK,CAAQ;IACb,MAAM,CAAQ;IACd,OAAO,CAAQ;IAEvB,oBAAoB,GAAmB,IAAI,CAAA;IAE3C;;;;;OAKG;IACH,YAAY,KAAa,EAAE,MAAc;QACvC,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,OAAO,GAAG,iCAAiC,CAAA;IAClD,CAAC;IAED;;;;;OAKG;IACK,KAAK,CAAC,O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AAA;YACtI,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,0CAA0C,CAAC,CAAA;YACxE,CAAC;QACH,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,mCAAmC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAA;QAC7E,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-switchbot",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.5.0-beta.
|
|
4
|
+
"version": "2.5.0-beta.28",
|
|
5
5
|
"description": "The node-switchbot is a Node.js module which allows you to control your Switchbot Devices through Bluetooth (BLE).",
|
|
6
6
|
"author": "OpenWonderLabs (https://github.com/OpenWonderLabs)",
|
|
7
7
|
"license": "MIT",
|