elero-usb-transmitter-client 1.0.5 → 1.0.6
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.
- package/dist/src/UsbTransmitterClient.d.ts +2 -2
- package/dist/src/UsbTransmitterClient.js +5 -4
- package/package.json +2 -2
- package/src/UsbTransmitterClient.ts +6 -5
- package/dist/src/ComfortCloudClient.d.ts +0 -21
- package/dist/src/ComfortCloudClient.js +0 -215
- package/dist/src/model/Device.d.ts +0 -182
- package/dist/src/model/Device.js +0 -374
- package/dist/src/model/Group.d.ts +0 -10
- package/dist/src/model/Group.js +0 -32
- package/dist/src/model/LoginData.d.ts +0 -6
- package/dist/src/model/LoginData.js +0 -11
- package/dist/src/model/Parameters.d.ts +0 -12
- package/dist/src/model/Parameters.js +0 -2
- package/dist/src/model/ServiceError.d.ts +0 -7
- package/dist/src/model/ServiceError.js +0 -41
- package/dist/src/model/TokenExpiredError.d.ts +0 -4
- package/dist/src/model/TokenExpiredError.js +0 -24
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SerialPort } from 'serialport';
|
|
2
2
|
import { Response } from './model/Response';
|
|
3
3
|
import { ControlCommand } from './domain/enums';
|
|
4
4
|
export declare class UsbTransmitterClient {
|
|
5
|
-
serialPort: SerialPort
|
|
5
|
+
serialPort: SerialPort<any>;
|
|
6
6
|
constructor(devPath: string);
|
|
7
7
|
open(): Promise<void>;
|
|
8
8
|
close(): Promise<void>;
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.UsbTransmitterClient = void 0;
|
|
40
|
-
var
|
|
40
|
+
var serialport_1 = require("serialport");
|
|
41
41
|
var _ = require("lodash");
|
|
42
42
|
var constants_1 = require("./domain/constants");
|
|
43
43
|
var enums_1 = require("./domain/enums");
|
|
@@ -49,7 +49,8 @@ var DEFAULT_STOPBITS = 1;
|
|
|
49
49
|
var mutex = new async_mutex_1.Mutex();
|
|
50
50
|
var UsbTransmitterClient = /** @class */ (function () {
|
|
51
51
|
function UsbTransmitterClient(devPath) {
|
|
52
|
-
this.serialPort = new SerialPort(
|
|
52
|
+
this.serialPort = new serialport_1.SerialPort({
|
|
53
|
+
path: devPath,
|
|
53
54
|
baudRate: DEFAULT_BAUDRATE,
|
|
54
55
|
dataBits: DEFAULT_BYTESIZE,
|
|
55
56
|
parity: DEFAULT_PARITY,
|
|
@@ -201,10 +202,10 @@ var UsbTransmitterClient = /** @class */ (function () {
|
|
|
201
202
|
_this.serialPort.flush(function (error) {
|
|
202
203
|
if (error)
|
|
203
204
|
reject(error);
|
|
204
|
-
_this.serialPort.write(data, function (error
|
|
205
|
+
_this.serialPort.write(data, function (error) {
|
|
205
206
|
if (error)
|
|
206
207
|
reject(error);
|
|
207
|
-
resolve(
|
|
208
|
+
resolve(data.length);
|
|
208
209
|
});
|
|
209
210
|
});
|
|
210
211
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "elero-usb-transmitter-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/src/index.js",
|
|
6
6
|
"types": "./dist/src/index.d.ts",
|
|
@@ -38,6 +38,6 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"async-mutex": "^0.2.4",
|
|
40
40
|
"lodash": "^4.17.15",
|
|
41
|
-
"serialport": "^
|
|
41
|
+
"serialport": "^13.0.0"
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SerialPort } from 'serialport'
|
|
2
2
|
import * as _ from 'lodash'
|
|
3
3
|
import {
|
|
4
4
|
BYTE_HEADER,
|
|
@@ -21,10 +21,11 @@ const DEFAULT_STOPBITS = 1
|
|
|
21
21
|
const mutex = new Mutex()
|
|
22
22
|
|
|
23
23
|
export class UsbTransmitterClient {
|
|
24
|
-
serialPort: SerialPort
|
|
24
|
+
serialPort: SerialPort<any>
|
|
25
25
|
|
|
26
26
|
constructor(devPath: string) {
|
|
27
|
-
this.serialPort = new SerialPort(
|
|
27
|
+
this.serialPort = new SerialPort({
|
|
28
|
+
path: devPath,
|
|
28
29
|
baudRate: DEFAULT_BAUDRATE,
|
|
29
30
|
dataBits: DEFAULT_BYTESIZE,
|
|
30
31
|
parity: DEFAULT_PARITY,
|
|
@@ -142,9 +143,9 @@ export class UsbTransmitterClient {
|
|
|
142
143
|
return new Promise((resolve, reject) => {
|
|
143
144
|
this.serialPort.flush((error) => {
|
|
144
145
|
if (error) reject(error)
|
|
145
|
-
this.serialPort.write(data, (error
|
|
146
|
+
this.serialPort.write(data, (error: Error | null | undefined) => {
|
|
146
147
|
if (error) reject(error)
|
|
147
|
-
resolve(
|
|
148
|
+
resolve(data.length)
|
|
148
149
|
})
|
|
149
150
|
})
|
|
150
151
|
})
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Device } from './model/Device';
|
|
2
|
-
import { Group } from './model/Group';
|
|
3
|
-
import { Parameters } from './model/Parameters';
|
|
4
|
-
export declare class ComfortCloudClient {
|
|
5
|
-
readonly baseUrl = "https://accsmart.panasonic.com";
|
|
6
|
-
readonly urlPartLogin = "/auth/login/";
|
|
7
|
-
readonly urlPartGroup = "/device/group/";
|
|
8
|
-
readonly urlPartDevice = "/deviceStatus/";
|
|
9
|
-
readonly urlPartDeviceControl = "/deviceStatus/control";
|
|
10
|
-
readonly appVersion = "2.0.0";
|
|
11
|
-
private axiosInstance;
|
|
12
|
-
private _token;
|
|
13
|
-
set token(value: string);
|
|
14
|
-
constructor();
|
|
15
|
-
login(username: string, password: string, language?: number): Promise<string>;
|
|
16
|
-
getGroups(): Promise<Array<Group>>;
|
|
17
|
-
getDevice(id: string): Promise<Device | null>;
|
|
18
|
-
private handleError;
|
|
19
|
-
setDevice(device: Device): Promise<any>;
|
|
20
|
-
setParameters(guid: string, parameters: Parameters): Promise<import("axios").AxiosResponse<any> | null>;
|
|
21
|
-
}
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var axios_1 = require("axios");
|
|
40
|
-
var https = require("https");
|
|
41
|
-
var _ = require("lodash");
|
|
42
|
-
var LoginData_1 = require("./model/LoginData");
|
|
43
|
-
var ServiceError_1 = require("./model/ServiceError");
|
|
44
|
-
var Device_1 = require("./model/Device");
|
|
45
|
-
var Group_1 = require("./model/Group");
|
|
46
|
-
var TokenExpiredError_1 = require("./model/TokenExpiredError");
|
|
47
|
-
var ComfortCloudClient = /** @class */ (function () {
|
|
48
|
-
function ComfortCloudClient() {
|
|
49
|
-
this.baseUrl = 'https://accsmart.panasonic.com';
|
|
50
|
-
this.urlPartLogin = '/auth/login/';
|
|
51
|
-
this.urlPartGroup = '/device/group/';
|
|
52
|
-
this.urlPartDevice = '/deviceStatus/';
|
|
53
|
-
this.urlPartDeviceControl = '/deviceStatus/control';
|
|
54
|
-
this.appVersion = '2.0.0';
|
|
55
|
-
this._token = '';
|
|
56
|
-
this.axiosInstance = axios_1.default.create({
|
|
57
|
-
baseURL: this.baseUrl,
|
|
58
|
-
});
|
|
59
|
-
var agent = new https.Agent({
|
|
60
|
-
rejectUnauthorized: false,
|
|
61
|
-
});
|
|
62
|
-
this.axiosInstance.defaults.httpsAgent = agent;
|
|
63
|
-
this.axiosInstance.defaults.headers.common['Accept'] =
|
|
64
|
-
'application/json; charset=UTF-8';
|
|
65
|
-
this.axiosInstance.defaults.headers.common['Content-Type'] =
|
|
66
|
-
'application/json';
|
|
67
|
-
this.axiosInstance.defaults.headers.common['X-APP-TYPE'] = 0;
|
|
68
|
-
this.axiosInstance.defaults.headers.common['X-APP-VERSION'] = this.appVersion;
|
|
69
|
-
}
|
|
70
|
-
Object.defineProperty(ComfortCloudClient.prototype, "token", {
|
|
71
|
-
set: function (value) {
|
|
72
|
-
this._token = value;
|
|
73
|
-
},
|
|
74
|
-
enumerable: true,
|
|
75
|
-
configurable: true
|
|
76
|
-
});
|
|
77
|
-
ComfortCloudClient.prototype.login = function (username, password, language) {
|
|
78
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
79
|
-
var loginData, response, newToken, error_1;
|
|
80
|
-
return __generator(this, function (_a) {
|
|
81
|
-
switch (_a.label) {
|
|
82
|
-
case 0:
|
|
83
|
-
loginData = new LoginData_1.LoginData(username, password, language);
|
|
84
|
-
_a.label = 1;
|
|
85
|
-
case 1:
|
|
86
|
-
_a.trys.push([1, 3, , 4]);
|
|
87
|
-
return [4 /*yield*/, this.axiosInstance.post(this.urlPartLogin, loginData)];
|
|
88
|
-
case 2:
|
|
89
|
-
response = _a.sent();
|
|
90
|
-
if (response.status == 200) {
|
|
91
|
-
newToken = response.data.uToken;
|
|
92
|
-
this._token = newToken;
|
|
93
|
-
return [2 /*return*/, newToken];
|
|
94
|
-
}
|
|
95
|
-
throw new ServiceError_1.ServiceError(response.data.message, 0, response.status);
|
|
96
|
-
case 3:
|
|
97
|
-
error_1 = _a.sent();
|
|
98
|
-
this.handleError(error_1);
|
|
99
|
-
return [3 /*break*/, 4];
|
|
100
|
-
case 4: return [2 /*return*/, ''];
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
ComfortCloudClient.prototype.getGroups = function () {
|
|
106
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
107
|
-
var response, groupsResponse, groups, error_2;
|
|
108
|
-
return __generator(this, function (_a) {
|
|
109
|
-
switch (_a.label) {
|
|
110
|
-
case 0:
|
|
111
|
-
_a.trys.push([0, 2, , 3]);
|
|
112
|
-
return [4 /*yield*/, this.axiosInstance.get(this.urlPartGroup, {
|
|
113
|
-
headers: { 'X-User-Authorization': this._token },
|
|
114
|
-
})];
|
|
115
|
-
case 1:
|
|
116
|
-
response = _a.sent();
|
|
117
|
-
if (response.status == 200) {
|
|
118
|
-
groupsResponse = response.data.groupList;
|
|
119
|
-
groups = _.map(groupsResponse, function (element) {
|
|
120
|
-
var devices = _.map(element.deviceIdList, function (device) {
|
|
121
|
-
var retDevice = device.parameters;
|
|
122
|
-
retDevice.guid = device.deviceGuid;
|
|
123
|
-
retDevice.name = device.deviceName;
|
|
124
|
-
return retDevice;
|
|
125
|
-
});
|
|
126
|
-
return new Group_1.Group(element.groupId, element.groupName, devices);
|
|
127
|
-
});
|
|
128
|
-
return [2 /*return*/, groups];
|
|
129
|
-
}
|
|
130
|
-
return [3 /*break*/, 3];
|
|
131
|
-
case 2:
|
|
132
|
-
error_2 = _a.sent();
|
|
133
|
-
this.handleError(error_2);
|
|
134
|
-
return [3 /*break*/, 3];
|
|
135
|
-
case 3: return [2 /*return*/, []];
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
ComfortCloudClient.prototype.getDevice = function (id) {
|
|
141
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
142
|
-
var response, responseData, retDevice, error_3;
|
|
143
|
-
return __generator(this, function (_a) {
|
|
144
|
-
switch (_a.label) {
|
|
145
|
-
case 0:
|
|
146
|
-
_a.trys.push([0, 2, , 3]);
|
|
147
|
-
return [4 /*yield*/, this.axiosInstance.get(this.urlPartDevice + '/' + id, {
|
|
148
|
-
headers: { 'X-User-Authorization': this._token },
|
|
149
|
-
})];
|
|
150
|
-
case 1:
|
|
151
|
-
response = _a.sent();
|
|
152
|
-
if (response.status == 200) {
|
|
153
|
-
responseData = response.data;
|
|
154
|
-
retDevice = new Device_1.Device('', '');
|
|
155
|
-
_.assign(retDevice, responseData.parameters);
|
|
156
|
-
retDevice.guid = responseData.deviceGuid;
|
|
157
|
-
retDevice.name = responseData.deviceName;
|
|
158
|
-
return [2 /*return*/, retDevice];
|
|
159
|
-
}
|
|
160
|
-
return [3 /*break*/, 3];
|
|
161
|
-
case 2:
|
|
162
|
-
error_3 = _a.sent();
|
|
163
|
-
this.handleError(error_3);
|
|
164
|
-
return [3 /*break*/, 3];
|
|
165
|
-
case 3: return [2 /*return*/, null];
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
};
|
|
170
|
-
ComfortCloudClient.prototype.handleError = function (error) {
|
|
171
|
-
var errorResponse = error.response;
|
|
172
|
-
var responseData = errorResponse.data;
|
|
173
|
-
if (responseData.code === '4100') {
|
|
174
|
-
throw new TokenExpiredError_1.TokenExpiredError(responseData.message, responseData.code, errorResponse.status);
|
|
175
|
-
}
|
|
176
|
-
throw new ServiceError_1.ServiceError(responseData.message, responseData.code, errorResponse.status);
|
|
177
|
-
};
|
|
178
|
-
ComfortCloudClient.prototype.setDevice = function (device) {
|
|
179
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
180
|
-
return __generator(this, function (_a) {
|
|
181
|
-
return [2 /*return*/, this.setParameters(device.guid, device.parameters)];
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
};
|
|
185
|
-
ComfortCloudClient.prototype.setParameters = function (guid, parameters) {
|
|
186
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
187
|
-
var body, response, error_4;
|
|
188
|
-
return __generator(this, function (_a) {
|
|
189
|
-
switch (_a.label) {
|
|
190
|
-
case 0:
|
|
191
|
-
body = {
|
|
192
|
-
deviceGuid: guid,
|
|
193
|
-
parameters: parameters,
|
|
194
|
-
};
|
|
195
|
-
_a.label = 1;
|
|
196
|
-
case 1:
|
|
197
|
-
_a.trys.push([1, 3, , 4]);
|
|
198
|
-
return [4 /*yield*/, this.axiosInstance.post(this.urlPartDeviceControl, body, {
|
|
199
|
-
headers: { 'X-User-Authorization': this._token },
|
|
200
|
-
})];
|
|
201
|
-
case 2:
|
|
202
|
-
response = _a.sent();
|
|
203
|
-
return [2 /*return*/, response];
|
|
204
|
-
case 3:
|
|
205
|
-
error_4 = _a.sent();
|
|
206
|
-
this.handleError(error_4);
|
|
207
|
-
return [3 /*break*/, 4];
|
|
208
|
-
case 4: return [2 /*return*/, null];
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
};
|
|
213
|
-
return ComfortCloudClient;
|
|
214
|
-
}());
|
|
215
|
-
exports.ComfortCloudClient = ComfortCloudClient;
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { Power, OperationMode, FanSpeed, AirSwingLR, AirSwingUD, EcoMode, FanAutoMode } from '../domain/enums';
|
|
2
|
-
import { Parameters } from './Parameters';
|
|
3
|
-
export declare class Device {
|
|
4
|
-
private _guid;
|
|
5
|
-
private _name;
|
|
6
|
-
private _operate;
|
|
7
|
-
private _operationMode;
|
|
8
|
-
private _temperatureSet;
|
|
9
|
-
private _fanSpeed;
|
|
10
|
-
private _fanAutoMode;
|
|
11
|
-
private _airSwingLR;
|
|
12
|
-
private _airSwingUD;
|
|
13
|
-
private _ecoMode;
|
|
14
|
-
private _ecoNavi;
|
|
15
|
-
private _nanoe;
|
|
16
|
-
private _iAuto;
|
|
17
|
-
private _actualNanoe;
|
|
18
|
-
private _airDirection;
|
|
19
|
-
private _ecoFunctionData;
|
|
20
|
-
constructor(guid: string, name: string);
|
|
21
|
-
get parameters(): Parameters;
|
|
22
|
-
/**
|
|
23
|
-
* Getter operate
|
|
24
|
-
* @return {Power}
|
|
25
|
-
*/
|
|
26
|
-
get operate(): Power;
|
|
27
|
-
/**
|
|
28
|
-
* Getter operationMode
|
|
29
|
-
* @return {OperationMode}
|
|
30
|
-
*/
|
|
31
|
-
get operationMode(): OperationMode;
|
|
32
|
-
/**
|
|
33
|
-
* Getter temperatureSet
|
|
34
|
-
* @return {number}
|
|
35
|
-
*/
|
|
36
|
-
get temperatureSet(): number;
|
|
37
|
-
/**
|
|
38
|
-
* Getter fanSpeed
|
|
39
|
-
* @return {FanSpeed}
|
|
40
|
-
*/
|
|
41
|
-
get fanSpeed(): FanSpeed;
|
|
42
|
-
/**
|
|
43
|
-
* Getter fanAutoMode
|
|
44
|
-
* @return {FanAutoMode}
|
|
45
|
-
*/
|
|
46
|
-
get fanAutoMode(): FanAutoMode;
|
|
47
|
-
/**
|
|
48
|
-
* Getter airSwingLR
|
|
49
|
-
* @return {AirSwingLR}
|
|
50
|
-
*/
|
|
51
|
-
get airSwingLR(): AirSwingLR;
|
|
52
|
-
/**
|
|
53
|
-
* Getter airSwingUD
|
|
54
|
-
* @return {AirSwingUD}
|
|
55
|
-
*/
|
|
56
|
-
get airSwingUD(): AirSwingUD;
|
|
57
|
-
/**
|
|
58
|
-
* Getter ecoMode
|
|
59
|
-
* @return {EcoMode}
|
|
60
|
-
*/
|
|
61
|
-
get ecoMode(): EcoMode;
|
|
62
|
-
/**
|
|
63
|
-
* Getter ecoNavi
|
|
64
|
-
* @return {number}
|
|
65
|
-
*/
|
|
66
|
-
get ecoNavi(): number;
|
|
67
|
-
/**
|
|
68
|
-
* Getter nanoe
|
|
69
|
-
* @return {number}
|
|
70
|
-
*/
|
|
71
|
-
get nanoe(): number;
|
|
72
|
-
/**
|
|
73
|
-
* Getter iAuto
|
|
74
|
-
* @return {number}
|
|
75
|
-
*/
|
|
76
|
-
get iAuto(): number;
|
|
77
|
-
/**
|
|
78
|
-
* Getter actualNanoe
|
|
79
|
-
* @return {number}
|
|
80
|
-
*/
|
|
81
|
-
get actualNanoe(): number;
|
|
82
|
-
/**
|
|
83
|
-
* Getter airDirection
|
|
84
|
-
* @return {number}
|
|
85
|
-
*/
|
|
86
|
-
get airDirection(): number;
|
|
87
|
-
/**
|
|
88
|
-
* Getter ecoFunctionData
|
|
89
|
-
* @return {number}
|
|
90
|
-
*/
|
|
91
|
-
get ecoFunctionData(): number;
|
|
92
|
-
/**
|
|
93
|
-
* Setter operate
|
|
94
|
-
* @param {Power} value
|
|
95
|
-
*/
|
|
96
|
-
set operate(value: Power);
|
|
97
|
-
/**
|
|
98
|
-
* Setter operationMode
|
|
99
|
-
* @param {OperationMode} value
|
|
100
|
-
*/
|
|
101
|
-
set operationMode(value: OperationMode);
|
|
102
|
-
/**
|
|
103
|
-
* Setter temperatureSet
|
|
104
|
-
* @param {number} value
|
|
105
|
-
*/
|
|
106
|
-
set temperatureSet(value: number);
|
|
107
|
-
/**
|
|
108
|
-
* Setter fanSpeed
|
|
109
|
-
* @param {FanSpeed} value
|
|
110
|
-
*/
|
|
111
|
-
set fanSpeed(value: FanSpeed);
|
|
112
|
-
/**
|
|
113
|
-
* Setter fanAutoMode
|
|
114
|
-
* @param {FanAutoMode} value
|
|
115
|
-
*/
|
|
116
|
-
set fanAutoMode(value: FanAutoMode);
|
|
117
|
-
/**
|
|
118
|
-
* Setter airSwingLR
|
|
119
|
-
* @param {AirSwingLR} value
|
|
120
|
-
*/
|
|
121
|
-
set airSwingLR(value: AirSwingLR);
|
|
122
|
-
/**
|
|
123
|
-
* Setter airSwingUD
|
|
124
|
-
* @param {AirSwingUD} value
|
|
125
|
-
*/
|
|
126
|
-
set airSwingUD(value: AirSwingUD);
|
|
127
|
-
/**
|
|
128
|
-
* Setter ecoMode
|
|
129
|
-
* @param {EcoMode} value
|
|
130
|
-
*/
|
|
131
|
-
set ecoMode(value: EcoMode);
|
|
132
|
-
/**
|
|
133
|
-
* Setter ecoNavi
|
|
134
|
-
* @param {number} value
|
|
135
|
-
*/
|
|
136
|
-
set ecoNavi(value: number);
|
|
137
|
-
/**
|
|
138
|
-
* Setter nanoe
|
|
139
|
-
* @param {number} value
|
|
140
|
-
*/
|
|
141
|
-
set nanoe(value: number);
|
|
142
|
-
/**
|
|
143
|
-
* Setter iAuto
|
|
144
|
-
* @param {number} value
|
|
145
|
-
*/
|
|
146
|
-
set iAuto(value: number);
|
|
147
|
-
/**
|
|
148
|
-
* Setter actualNanoe
|
|
149
|
-
* @param {number} value
|
|
150
|
-
*/
|
|
151
|
-
set actualNanoe(value: number);
|
|
152
|
-
/**
|
|
153
|
-
* Setter airDirection
|
|
154
|
-
* @param {number} value
|
|
155
|
-
*/
|
|
156
|
-
set airDirection(value: number);
|
|
157
|
-
/**
|
|
158
|
-
* Setter ecoFunctionData
|
|
159
|
-
* @param {number} value
|
|
160
|
-
*/
|
|
161
|
-
set ecoFunctionData(value: number);
|
|
162
|
-
/**
|
|
163
|
-
* Getter name
|
|
164
|
-
* @return {string}
|
|
165
|
-
*/
|
|
166
|
-
get name(): string;
|
|
167
|
-
/**
|
|
168
|
-
* setter name
|
|
169
|
-
* @param {string} value
|
|
170
|
-
*/
|
|
171
|
-
set name(value: string);
|
|
172
|
-
/**
|
|
173
|
-
* Getter guid
|
|
174
|
-
* @return {string}
|
|
175
|
-
*/
|
|
176
|
-
get guid(): string;
|
|
177
|
-
/**
|
|
178
|
-
* Setter guid
|
|
179
|
-
* @param {string} value
|
|
180
|
-
*/
|
|
181
|
-
set guid(value: string);
|
|
182
|
-
}
|
package/dist/src/model/Device.js
DELETED
|
@@ -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
|
-
}
|
package/dist/src/model/Group.js
DELETED
|
@@ -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,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,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,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;
|