elero-usb-transmitter-client 1.0.5 → 1.1.1

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.
Files changed (40) hide show
  1. package/.github/workflows/nodejs.yml +27 -0
  2. package/README.md +58 -1
  3. package/dist/UsbTransmitterClient.d.ts +18 -0
  4. package/dist/UsbTransmitterClient.js +284 -0
  5. package/dist/cli.d.ts +2 -0
  6. package/dist/cli.js +277 -0
  7. package/dist/domain/constants.d.ts +32 -0
  8. package/dist/domain/constants.js +44 -0
  9. package/dist/domain/enums.d.ts +34 -0
  10. package/dist/domain/enums.js +40 -0
  11. package/dist/domain/types.d.ts +3 -0
  12. package/dist/index.d.ts +6 -0
  13. package/dist/index.js +18 -0
  14. package/dist/model/Response.d.ts +10 -0
  15. package/dist/model/Response.js +2 -0
  16. package/dist/src/UsbTransmitterClient.d.ts +2 -2
  17. package/dist/src/UsbTransmitterClient.js +5 -4
  18. package/dist/src/cli.d.ts +2 -0
  19. package/dist/src/cli.js +277 -0
  20. package/jest.json +1 -1
  21. package/package.json +6 -3
  22. package/src/UsbTransmitterClient.ts +52 -44
  23. package/src/cli.ts +167 -0
  24. package/test/UsbTransmitterClient.test.ts +39 -0
  25. package/test/UsbTransmitterClientMock.test.ts +182 -0
  26. package/__test__/UsbTransmitterClient.test.ts +0 -31
  27. package/dist/src/ComfortCloudClient.d.ts +0 -21
  28. package/dist/src/ComfortCloudClient.js +0 -215
  29. package/dist/src/model/Device.d.ts +0 -182
  30. package/dist/src/model/Device.js +0 -374
  31. package/dist/src/model/Group.d.ts +0 -10
  32. package/dist/src/model/Group.js +0 -32
  33. package/dist/src/model/LoginData.d.ts +0 -6
  34. package/dist/src/model/LoginData.js +0 -11
  35. package/dist/src/model/Parameters.d.ts +0 -12
  36. package/dist/src/model/ServiceError.d.ts +0 -7
  37. package/dist/src/model/ServiceError.js +0 -41
  38. package/dist/src/model/TokenExpiredError.d.ts +0 -4
  39. package/dist/src/model/TokenExpiredError.js +0 -24
  40. /package/dist/{src/model/Parameters.js → domain/types.js} +0 -0
@@ -1,374 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /* eslint-disable @typescript-eslint/adjacent-overload-signatures */
4
- /* eslint-disable require-jsdoc */
5
- var enums_1 = require("../domain/enums");
6
- /*
7
- {
8
- "deviceGuid": "xxx",
9
- "deviceType": "1",
10
- "deviceName": "yyy",
11
- "permission": 3,
12
- "summerHouse": 0,
13
- "iAutoX": false,
14
- "nanoe": false,
15
- "autoMode": true,
16
- "heatMode": true,
17
- "fanMode": false,
18
- "dryMode": true,
19
- "coolMode": true,
20
- "ecoNavi": true,
21
- "powerfulMode": true,
22
- "quietMode": true,
23
- "airSwingLR": true,
24
- "ecoFunction": 0,
25
- "temperatureUnit": 0,
26
- "modeAvlList": {
27
- "autoMode": 1,
28
- "fanMode": 1
29
- },
30
- "parameters": {
31
- "operate": 1,
32
- "operationMode": 3,
33
- "temperatureSet": 19.0,
34
- "fanSpeed": 0,
35
- "fanAutoMode": 1,
36
- "airSwingLR": 0,
37
- "airSwingUD": 0,
38
- "ecoMode": 0,
39
- "ecoNavi": 1,
40
- "nanoe": 0,
41
- "iAuto": 0,
42
- "actualNanoe": 0,
43
- "airDirection": 0,
44
- "ecoFunctionData": 0
45
- }
46
- }
47
- */
48
- var Device = /** @class */ (function () {
49
- function Device(guid, name) {
50
- this._operate = enums_1.Power.Off;
51
- this._operationMode = enums_1.OperationMode.Auto;
52
- this._temperatureSet = 0;
53
- this._fanSpeed = enums_1.FanSpeed.Auto;
54
- this._fanAutoMode = enums_1.FanAutoMode.AirSwingAuto;
55
- this._airSwingLR = enums_1.AirSwingLR.Mid;
56
- this._airSwingUD = enums_1.AirSwingUD.Mid;
57
- this._ecoMode = enums_1.EcoMode.Auto;
58
- this._ecoNavi = 0;
59
- this._nanoe = 0;
60
- this._iAuto = 0;
61
- this._actualNanoe = 0;
62
- this._airDirection = 0;
63
- this._ecoFunctionData = 0;
64
- this._guid = guid;
65
- this._name = name;
66
- }
67
- Object.defineProperty(Device.prototype, "parameters", {
68
- get: function () {
69
- return {
70
- operate: this._operate,
71
- operationMode: this._operationMode,
72
- ecoMode: this._ecoMode,
73
- temperatureSet: this._temperatureSet,
74
- airSwingUD: this._airSwingUD,
75
- airSwingLR: this._airSwingLR,
76
- fanAutoMode: this._fanAutoMode,
77
- fanSpeed: this._fanSpeed
78
- };
79
- },
80
- enumerable: true,
81
- configurable: true
82
- });
83
- Object.defineProperty(Device.prototype, "operate", {
84
- /**
85
- * Getter operate
86
- * @return {Power}
87
- */
88
- get: function () {
89
- return this._operate;
90
- },
91
- /**
92
- * Setter operate
93
- * @param {Power} value
94
- */
95
- set: function (value) {
96
- this._operate = value;
97
- },
98
- enumerable: true,
99
- configurable: true
100
- });
101
- Object.defineProperty(Device.prototype, "operationMode", {
102
- /**
103
- * Getter operationMode
104
- * @return {OperationMode}
105
- */
106
- get: function () {
107
- // eslint-disable-next-line semi
108
- return this._operationMode;
109
- },
110
- /**
111
- * Setter operationMode
112
- * @param {OperationMode} value
113
- */
114
- set: function (value) {
115
- this._operationMode = value;
116
- },
117
- enumerable: true,
118
- configurable: true
119
- });
120
- Object.defineProperty(Device.prototype, "temperatureSet", {
121
- /**
122
- * Getter temperatureSet
123
- * @return {number}
124
- */
125
- get: function () {
126
- return this._temperatureSet;
127
- },
128
- /**
129
- * Setter temperatureSet
130
- * @param {number} value
131
- */
132
- set: function (value) {
133
- this._temperatureSet = value;
134
- },
135
- enumerable: true,
136
- configurable: true
137
- });
138
- Object.defineProperty(Device.prototype, "fanSpeed", {
139
- /**
140
- * Getter fanSpeed
141
- * @return {FanSpeed}
142
- */
143
- get: function () {
144
- return this._fanSpeed;
145
- },
146
- /**
147
- * Setter fanSpeed
148
- * @param {FanSpeed} value
149
- */
150
- set: function (value) {
151
- this._fanSpeed = value;
152
- },
153
- enumerable: true,
154
- configurable: true
155
- });
156
- Object.defineProperty(Device.prototype, "fanAutoMode", {
157
- /**
158
- * Getter fanAutoMode
159
- * @return {FanAutoMode}
160
- */
161
- get: function () {
162
- return this._fanAutoMode;
163
- },
164
- /**
165
- * Setter fanAutoMode
166
- * @param {FanAutoMode} value
167
- */
168
- set: function (value) {
169
- this._fanAutoMode = value;
170
- },
171
- enumerable: true,
172
- configurable: true
173
- });
174
- Object.defineProperty(Device.prototype, "airSwingLR", {
175
- /**
176
- * Getter airSwingLR
177
- * @return {AirSwingLR}
178
- */
179
- get: function () {
180
- return this._airSwingLR;
181
- },
182
- /**
183
- * Setter airSwingLR
184
- * @param {AirSwingLR} value
185
- */
186
- set: function (value) {
187
- this._airSwingLR = value;
188
- },
189
- enumerable: true,
190
- configurable: true
191
- });
192
- Object.defineProperty(Device.prototype, "airSwingUD", {
193
- /**
194
- * Getter airSwingUD
195
- * @return {AirSwingUD}
196
- */
197
- get: function () {
198
- return this._airSwingUD;
199
- },
200
- /**
201
- * Setter airSwingUD
202
- * @param {AirSwingUD} value
203
- */
204
- set: function (value) {
205
- this._airSwingUD = value;
206
- },
207
- enumerable: true,
208
- configurable: true
209
- });
210
- Object.defineProperty(Device.prototype, "ecoMode", {
211
- /**
212
- * Getter ecoMode
213
- * @return {EcoMode}
214
- */
215
- get: function () {
216
- return this._ecoMode;
217
- },
218
- /**
219
- * Setter ecoMode
220
- * @param {EcoMode} value
221
- */
222
- set: function (value) {
223
- this._ecoMode = value;
224
- },
225
- enumerable: true,
226
- configurable: true
227
- });
228
- Object.defineProperty(Device.prototype, "ecoNavi", {
229
- /**
230
- * Getter ecoNavi
231
- * @return {number}
232
- */
233
- get: function () {
234
- return this._ecoNavi;
235
- },
236
- /**
237
- * Setter ecoNavi
238
- * @param {number} value
239
- */
240
- set: function (value) {
241
- this._ecoNavi = value;
242
- },
243
- enumerable: true,
244
- configurable: true
245
- });
246
- Object.defineProperty(Device.prototype, "nanoe", {
247
- /**
248
- * Getter nanoe
249
- * @return {number}
250
- */
251
- get: function () {
252
- return this._nanoe;
253
- },
254
- /**
255
- * Setter nanoe
256
- * @param {number} value
257
- */
258
- set: function (value) {
259
- this._nanoe = value;
260
- },
261
- enumerable: true,
262
- configurable: true
263
- });
264
- Object.defineProperty(Device.prototype, "iAuto", {
265
- /**
266
- * Getter iAuto
267
- * @return {number}
268
- */
269
- get: function () {
270
- return this._iAuto;
271
- },
272
- /**
273
- * Setter iAuto
274
- * @param {number} value
275
- */
276
- set: function (value) {
277
- this._iAuto = value;
278
- },
279
- enumerable: true,
280
- configurable: true
281
- });
282
- Object.defineProperty(Device.prototype, "actualNanoe", {
283
- /**
284
- * Getter actualNanoe
285
- * @return {number}
286
- */
287
- get: function () {
288
- return this._actualNanoe;
289
- },
290
- /**
291
- * Setter actualNanoe
292
- * @param {number} value
293
- */
294
- set: function (value) {
295
- this._actualNanoe = value;
296
- },
297
- enumerable: true,
298
- configurable: true
299
- });
300
- Object.defineProperty(Device.prototype, "airDirection", {
301
- /**
302
- * Getter airDirection
303
- * @return {number}
304
- */
305
- get: function () {
306
- return this._airDirection;
307
- },
308
- /**
309
- * Setter airDirection
310
- * @param {number} value
311
- */
312
- set: function (value) {
313
- this._airDirection = value;
314
- },
315
- enumerable: true,
316
- configurable: true
317
- });
318
- Object.defineProperty(Device.prototype, "ecoFunctionData", {
319
- /**
320
- * Getter ecoFunctionData
321
- * @return {number}
322
- */
323
- get: function () {
324
- return this._ecoFunctionData;
325
- },
326
- /**
327
- * Setter ecoFunctionData
328
- * @param {number} value
329
- */
330
- set: function (value) {
331
- this._ecoFunctionData = value;
332
- },
333
- enumerable: true,
334
- configurable: true
335
- });
336
- Object.defineProperty(Device.prototype, "name", {
337
- /**
338
- * Getter name
339
- * @return {string}
340
- */
341
- get: function () {
342
- return this._name;
343
- },
344
- /**
345
- * setter name
346
- * @param {string} value
347
- */
348
- set: function (value) {
349
- this._name = value;
350
- },
351
- enumerable: true,
352
- configurable: true
353
- });
354
- Object.defineProperty(Device.prototype, "guid", {
355
- /**
356
- * Getter guid
357
- * @return {string}
358
- */
359
- get: function () {
360
- return this._guid;
361
- },
362
- /**
363
- * Setter guid
364
- * @param {string} value
365
- */
366
- set: function (value) {
367
- this._guid = value;
368
- },
369
- enumerable: true,
370
- configurable: true
371
- });
372
- return Device;
373
- }());
374
- exports.Device = Device;
@@ -1,10 +0,0 @@
1
- import { Device } from "./Device";
2
- export declare class Group {
3
- private _id;
4
- private _name;
5
- private _devices;
6
- constructor(id: number, name: string, devices: Array<Device>);
7
- get devices(): Array<Device>;
8
- get id(): number;
9
- get name(): string;
10
- }
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var Group = /** @class */ (function () {
4
- function Group(id, name, devices) {
5
- this._id = id;
6
- this._name = name;
7
- this._devices = devices;
8
- }
9
- Object.defineProperty(Group.prototype, "devices", {
10
- get: function () {
11
- return this._devices;
12
- },
13
- enumerable: true,
14
- configurable: true
15
- });
16
- Object.defineProperty(Group.prototype, "id", {
17
- get: function () {
18
- return this._id;
19
- },
20
- enumerable: true,
21
- configurable: true
22
- });
23
- Object.defineProperty(Group.prototype, "name", {
24
- get: function () {
25
- return this._name;
26
- },
27
- enumerable: true,
28
- configurable: true
29
- });
30
- return Group;
31
- }());
32
- exports.Group = Group;
@@ -1,6 +0,0 @@
1
- export declare class LoginData {
2
- loginId: string;
3
- password: string;
4
- language?: number;
5
- constructor(loginId: string, password: string, language?: number);
6
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var LoginData = /** @class */ (function () {
4
- function LoginData(loginId, password, language) {
5
- this.loginId = loginId;
6
- this.password = password;
7
- this.language = language;
8
- }
9
- return LoginData;
10
- }());
11
- exports.LoginData = LoginData;
@@ -1,12 +0,0 @@
1
- import { Power, OperationMode, EcoMode, AirSwingUD, AirSwingLR, FanAutoMode, FanSpeed } from '../domain/enums';
2
- export interface Parameters {
3
- [key: string]: any;
4
- operate?: Power;
5
- operationMode?: OperationMode;
6
- ecoMode?: EcoMode;
7
- temperatureSet?: number;
8
- airSwingUD?: AirSwingUD;
9
- airSwingLR?: AirSwingLR;
10
- fanAutoMode?: FanAutoMode;
11
- fanSpeed?: FanSpeed;
12
- }
@@ -1,7 +0,0 @@
1
- export declare class ServiceError extends Error {
2
- private _code;
3
- private _httpCode;
4
- constructor(message: string, code: number, httpCode: number);
5
- get code(): number;
6
- get httpCode(): number;
7
- }
@@ -1,41 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- var ServiceError = /** @class */ (function (_super) {
17
- __extends(ServiceError, _super);
18
- function ServiceError(message, code, httpCode) {
19
- var _this = _super.call(this, message) || this;
20
- _this.name = 'ServiceError';
21
- _this._code = code;
22
- _this._httpCode = httpCode;
23
- return _this;
24
- }
25
- Object.defineProperty(ServiceError.prototype, "code", {
26
- get: function () {
27
- return this._code;
28
- },
29
- enumerable: true,
30
- configurable: true
31
- });
32
- Object.defineProperty(ServiceError.prototype, "httpCode", {
33
- get: function () {
34
- return this._httpCode;
35
- },
36
- enumerable: true,
37
- configurable: true
38
- });
39
- return ServiceError;
40
- }(Error));
41
- exports.ServiceError = ServiceError;
@@ -1,4 +0,0 @@
1
- import { ServiceError } from './ServiceError';
2
- export declare class TokenExpiredError extends ServiceError {
3
- constructor(message: string, code: number, httpCode: number);
4
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- var ServiceError_1 = require("./ServiceError");
17
- var TokenExpiredError = /** @class */ (function (_super) {
18
- __extends(TokenExpiredError, _super);
19
- function TokenExpiredError(message, code, httpCode) {
20
- return _super.call(this, message, code, httpCode) || this;
21
- }
22
- return TokenExpiredError;
23
- }(ServiceError_1.ServiceError));
24
- exports.TokenExpiredError = TokenExpiredError;