@kohost/api-client 3.0.0-beta.46 → 3.0.0-beta.47
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/cjs/AMQPClient.js +61 -24
- package/dist/cjs/Client.js +126 -4
- package/dist/cjs/Commands.js +161 -50
- package/dist/cjs/Errors.js +55 -22
- package/dist/cjs/Events.js +66 -22
- package/dist/cjs/Models.js +860 -568
- package/dist/cjs/SocketIoClient.js +5 -2
- package/dist/cjs/defs.js +6 -4
- package/dist/cjs/index.cjs.js +6744 -10
- package/dist/cjs/utils.js +55 -22
- package/dist/esm/Client.js +140 -10
- package/dist/esm/Client.js.map +3 -3
- package/dist/esm/Commands.js +161 -50
- package/dist/esm/Commands.js.map +3 -3
- package/dist/esm/Errors.js +55 -22
- package/dist/esm/Errors.js.map +1 -1
- package/dist/esm/Events.js +66 -22
- package/dist/esm/Events.js.map +1 -1
- package/dist/esm/Models.js +938 -574
- package/dist/esm/Models.js.map +4 -4
- package/dist/esm/SocketIoClient.js +53 -26
- package/dist/esm/SocketIoClient.js.map +1 -1
- package/dist/esm/defs.js +20 -10
- package/dist/esm/defs.js.map +1 -1
- package/dist/esm/index.js +17 -11
- package/dist/esm/utils.js +166 -61
- package/dist/esm/utils.js.map +1 -1
- package/dist/useCases/ListScenes.js +32 -0
- package/dist/useCases/SetRoomScene.js +32 -0
- package/dist/useCases/SetSpaceScene.js +32 -0
- package/package.json +2 -2
package/dist/esm/Commands.js
CHANGED
|
@@ -9,6 +9,9 @@ var __commonJS = (cb, mod) => function __require() {
|
|
|
9
9
|
var require_Command = __commonJS({
|
|
10
10
|
"src/Commands/Command.js"(exports, module) {
|
|
11
11
|
var Command = class {
|
|
12
|
+
static {
|
|
13
|
+
__name(this, "Command");
|
|
14
|
+
}
|
|
12
15
|
constructor(data) {
|
|
13
16
|
this.data = {};
|
|
14
17
|
if (!data)
|
|
@@ -35,16 +38,40 @@ var require_Command = __commonJS({
|
|
|
35
38
|
return { data: { ...this.data } };
|
|
36
39
|
}
|
|
37
40
|
};
|
|
38
|
-
__name(Command, "Command");
|
|
39
41
|
module.exports = Command;
|
|
40
42
|
}
|
|
41
43
|
});
|
|
42
44
|
|
|
45
|
+
// src/Commands/SetSceneCommand.js
|
|
46
|
+
var require_SetSceneCommand = __commonJS({
|
|
47
|
+
"src/Commands/SetSceneCommand.js"(exports, module) {
|
|
48
|
+
var Command = require_Command();
|
|
49
|
+
var SetSceneCommand = class extends Command {
|
|
50
|
+
static {
|
|
51
|
+
__name(this, "SetSceneCommand");
|
|
52
|
+
}
|
|
53
|
+
constructor({ id, devices, ...rest }) {
|
|
54
|
+
super({ id, devices, ...rest });
|
|
55
|
+
}
|
|
56
|
+
get name() {
|
|
57
|
+
return "SetScene";
|
|
58
|
+
}
|
|
59
|
+
get routingKey() {
|
|
60
|
+
return `scene.${this.data.id}.set`;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
module.exports = SetSceneCommand;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
43
67
|
// src/Commands/SetAlarmCommand.js
|
|
44
68
|
var require_SetAlarmCommand = __commonJS({
|
|
45
69
|
"src/Commands/SetAlarmCommand.js"(exports, module) {
|
|
46
70
|
var Command = require_Command();
|
|
47
71
|
var SetAlarmCommand = class extends Command {
|
|
72
|
+
static {
|
|
73
|
+
__name(this, "SetAlarmCommand");
|
|
74
|
+
}
|
|
48
75
|
constructor({ id, zones, areas }) {
|
|
49
76
|
super({ id, zones, areas });
|
|
50
77
|
}
|
|
@@ -55,7 +82,6 @@ var require_SetAlarmCommand = __commonJS({
|
|
|
55
82
|
return `alarm.${this.data.id}.set`;
|
|
56
83
|
}
|
|
57
84
|
};
|
|
58
|
-
__name(SetAlarmCommand, "SetAlarmCommand");
|
|
59
85
|
module.exports = SetAlarmCommand;
|
|
60
86
|
}
|
|
61
87
|
});
|
|
@@ -65,6 +91,9 @@ var require_SetDimmerCommand = __commonJS({
|
|
|
65
91
|
"src/Commands/SetDimmerCommand.js"(exports, module) {
|
|
66
92
|
var Command = require_Command();
|
|
67
93
|
var SetDimmerCommand = class extends Command {
|
|
94
|
+
static {
|
|
95
|
+
__name(this, "SetDimmerCommand");
|
|
96
|
+
}
|
|
68
97
|
constructor({ id, level }) {
|
|
69
98
|
super({ id, level });
|
|
70
99
|
}
|
|
@@ -75,7 +104,6 @@ var require_SetDimmerCommand = __commonJS({
|
|
|
75
104
|
return `dimmer.${this.data.id}.set`;
|
|
76
105
|
}
|
|
77
106
|
};
|
|
78
|
-
__name(SetDimmerCommand, "SetDimmerCommand");
|
|
79
107
|
module.exports = SetDimmerCommand;
|
|
80
108
|
}
|
|
81
109
|
});
|
|
@@ -85,6 +113,9 @@ var require_SetSwitchCommand = __commonJS({
|
|
|
85
113
|
"src/Commands/SetSwitchCommand.js"(exports, module) {
|
|
86
114
|
var Command = require_Command();
|
|
87
115
|
var SetSwitchCommand = class extends Command {
|
|
116
|
+
static {
|
|
117
|
+
__name(this, "SetSwitchCommand");
|
|
118
|
+
}
|
|
88
119
|
constructor({ id, state }) {
|
|
89
120
|
super({ id, state });
|
|
90
121
|
}
|
|
@@ -95,7 +126,6 @@ var require_SetSwitchCommand = __commonJS({
|
|
|
95
126
|
return `switch.${this.data.id}.set`;
|
|
96
127
|
}
|
|
97
128
|
};
|
|
98
|
-
__name(SetSwitchCommand, "SetSwitchCommand");
|
|
99
129
|
module.exports = SetSwitchCommand;
|
|
100
130
|
}
|
|
101
131
|
});
|
|
@@ -105,6 +135,9 @@ var require_SetThermostatCommand = __commonJS({
|
|
|
105
135
|
"src/Commands/SetThermostatCommand.js"(exports, module) {
|
|
106
136
|
var Command = require_Command();
|
|
107
137
|
var SetThermostatCommand = class extends Command {
|
|
138
|
+
static {
|
|
139
|
+
__name(this, "SetThermostatCommand");
|
|
140
|
+
}
|
|
108
141
|
constructor({ id, setpoints, hvacMode, fanMode }) {
|
|
109
142
|
super({ id, setpoints, hvacMode, fanMode });
|
|
110
143
|
}
|
|
@@ -115,7 +148,6 @@ var require_SetThermostatCommand = __commonJS({
|
|
|
115
148
|
return `thermostat.${this.data.id}.set`;
|
|
116
149
|
}
|
|
117
150
|
};
|
|
118
|
-
__name(SetThermostatCommand, "SetThermostatCommand");
|
|
119
151
|
module.exports = SetThermostatCommand;
|
|
120
152
|
}
|
|
121
153
|
});
|
|
@@ -125,6 +157,9 @@ var require_SetLockCommand = __commonJS({
|
|
|
125
157
|
"src/Commands/SetLockCommand.js"(exports, module) {
|
|
126
158
|
var Command = require_Command();
|
|
127
159
|
var SetLockCommand = class extends Command {
|
|
160
|
+
static {
|
|
161
|
+
__name(this, "SetLockCommand");
|
|
162
|
+
}
|
|
128
163
|
constructor({ id, state }) {
|
|
129
164
|
super({ id, state });
|
|
130
165
|
}
|
|
@@ -135,7 +170,6 @@ var require_SetLockCommand = __commonJS({
|
|
|
135
170
|
return `lock.${this.data.id}.set`;
|
|
136
171
|
}
|
|
137
172
|
};
|
|
138
|
-
__name(SetLockCommand, "SetLockCommand");
|
|
139
173
|
module.exports = SetLockCommand;
|
|
140
174
|
}
|
|
141
175
|
});
|
|
@@ -145,6 +179,9 @@ var require_SetWindowCoveringCommand = __commonJS({
|
|
|
145
179
|
"src/Commands/SetWindowCoveringCommand.js"(exports, module) {
|
|
146
180
|
var Command = require_Command();
|
|
147
181
|
var SetWindowCoveringCommand = class extends Command {
|
|
182
|
+
static {
|
|
183
|
+
__name(this, "SetWindowCoveringCommand");
|
|
184
|
+
}
|
|
148
185
|
constructor({ id, position }) {
|
|
149
186
|
super({ id, position });
|
|
150
187
|
}
|
|
@@ -155,7 +192,6 @@ var require_SetWindowCoveringCommand = __commonJS({
|
|
|
155
192
|
return `windowCovering.${this.data.id}.set`;
|
|
156
193
|
}
|
|
157
194
|
};
|
|
158
|
-
__name(SetWindowCoveringCommand, "SetWindowCoveringCommand");
|
|
159
195
|
module.exports = SetWindowCoveringCommand;
|
|
160
196
|
}
|
|
161
197
|
});
|
|
@@ -165,6 +201,9 @@ var require_SetCourtesyCommand = __commonJS({
|
|
|
165
201
|
"src/Commands/SetCourtesyCommand.js"(exports, module) {
|
|
166
202
|
var Command = require_Command();
|
|
167
203
|
var SetCourtesyCommand = class extends Command {
|
|
204
|
+
static {
|
|
205
|
+
__name(this, "SetCourtesyCommand");
|
|
206
|
+
}
|
|
168
207
|
constructor({ id, state }) {
|
|
169
208
|
super({ id, state });
|
|
170
209
|
}
|
|
@@ -175,7 +214,6 @@ var require_SetCourtesyCommand = __commonJS({
|
|
|
175
214
|
return `courtesy.${this.data.id}.set`;
|
|
176
215
|
}
|
|
177
216
|
};
|
|
178
|
-
__name(SetCourtesyCommand, "SetCourtesyCommand");
|
|
179
217
|
module.exports = SetCourtesyCommand;
|
|
180
218
|
}
|
|
181
219
|
});
|
|
@@ -185,6 +223,9 @@ var require_SetMediaCommand = __commonJS({
|
|
|
185
223
|
"src/Commands/SetMediaCommand.js"(exports, module) {
|
|
186
224
|
var Command = require_Command();
|
|
187
225
|
var SetMediaCommand = class extends Command {
|
|
226
|
+
static {
|
|
227
|
+
__name(this, "SetMediaCommand");
|
|
228
|
+
}
|
|
188
229
|
constructor({ id, command, ...rest }) {
|
|
189
230
|
super({ id, command, ...rest });
|
|
190
231
|
}
|
|
@@ -195,7 +236,6 @@ var require_SetMediaCommand = __commonJS({
|
|
|
195
236
|
return `mediaSource.${this.data.id}.set`;
|
|
196
237
|
}
|
|
197
238
|
};
|
|
198
|
-
__name(SetMediaCommand, "SetMediaCommand");
|
|
199
239
|
module.exports = SetMediaCommand;
|
|
200
240
|
}
|
|
201
241
|
});
|
|
@@ -205,6 +245,9 @@ var require_DiscoverUsersCommand = __commonJS({
|
|
|
205
245
|
"src/Commands/DiscoverUsersCommand.js"(exports, module) {
|
|
206
246
|
var Command = require_Command();
|
|
207
247
|
var DiscoverUsersCommand = class extends Command {
|
|
248
|
+
static {
|
|
249
|
+
__name(this, "DiscoverUsersCommand");
|
|
250
|
+
}
|
|
208
251
|
constructor({ id }) {
|
|
209
252
|
super({ id });
|
|
210
253
|
}
|
|
@@ -219,7 +262,6 @@ var require_DiscoverUsersCommand = __commonJS({
|
|
|
219
262
|
return "users.get";
|
|
220
263
|
}
|
|
221
264
|
};
|
|
222
|
-
__name(DiscoverUsersCommand, "DiscoverUsersCommand");
|
|
223
265
|
module.exports = DiscoverUsersCommand;
|
|
224
266
|
}
|
|
225
267
|
});
|
|
@@ -227,14 +269,17 @@ var require_DiscoverUsersCommand = __commonJS({
|
|
|
227
269
|
// src/Errors/AppError.js
|
|
228
270
|
var require_AppError = __commonJS({
|
|
229
271
|
"src/Errors/AppError.js"(exports, module) {
|
|
230
|
-
module.exports =
|
|
272
|
+
module.exports = class AppError extends Error {
|
|
273
|
+
static {
|
|
274
|
+
__name(this, "AppError");
|
|
275
|
+
}
|
|
231
276
|
constructor(message = "Internal Server Error", options) {
|
|
232
277
|
super(message, options);
|
|
233
278
|
this.type = this.constructor.name;
|
|
234
279
|
this.statusCode = 500;
|
|
235
280
|
Object.setPrototypeOf(this, AppError.prototype);
|
|
236
281
|
}
|
|
237
|
-
}
|
|
282
|
+
};
|
|
238
283
|
}
|
|
239
284
|
});
|
|
240
285
|
|
|
@@ -242,13 +287,16 @@ var require_AppError = __commonJS({
|
|
|
242
287
|
var require_RequestError = __commonJS({
|
|
243
288
|
"src/Errors/RequestError.js"(exports, module) {
|
|
244
289
|
var AppError = require_AppError();
|
|
245
|
-
module.exports =
|
|
290
|
+
module.exports = class RequestError extends AppError {
|
|
291
|
+
static {
|
|
292
|
+
__name(this, "RequestError");
|
|
293
|
+
}
|
|
246
294
|
constructor(message = "Bad Request", options = {}) {
|
|
247
295
|
super(message, options);
|
|
248
296
|
this.statusCode = 400;
|
|
249
297
|
Object.setPrototypeOf(this, RequestError.prototype);
|
|
250
298
|
}
|
|
251
|
-
}
|
|
299
|
+
};
|
|
252
300
|
}
|
|
253
301
|
});
|
|
254
302
|
|
|
@@ -258,6 +306,9 @@ var require_OCRDocumentCommand = __commonJS({
|
|
|
258
306
|
var Command = require_Command();
|
|
259
307
|
var RequestError = require_RequestError();
|
|
260
308
|
var OCRDocumentCommand = class extends Command {
|
|
309
|
+
static {
|
|
310
|
+
__name(this, "OCRDocumentCommand");
|
|
311
|
+
}
|
|
261
312
|
constructor({ type, image }) {
|
|
262
313
|
if (!image)
|
|
263
314
|
throw new RequestError("document image is required");
|
|
@@ -267,7 +318,6 @@ var require_OCRDocumentCommand = __commonJS({
|
|
|
267
318
|
return "OCRDocument";
|
|
268
319
|
}
|
|
269
320
|
};
|
|
270
|
-
__name(OCRDocumentCommand, "OCRDocumentCommand");
|
|
271
321
|
module.exports = OCRDocumentCommand;
|
|
272
322
|
}
|
|
273
323
|
});
|
|
@@ -278,6 +328,9 @@ var require_CheckInReservationCommand = __commonJS({
|
|
|
278
328
|
var Command = require_Command();
|
|
279
329
|
var RequestError = require_RequestError();
|
|
280
330
|
var CheckInReservationCommand = class extends Command {
|
|
331
|
+
static {
|
|
332
|
+
__name(this, "CheckInReservationCommand");
|
|
333
|
+
}
|
|
281
334
|
constructor({ id }) {
|
|
282
335
|
if (!id)
|
|
283
336
|
throw new RequestError("document type is required");
|
|
@@ -290,7 +343,6 @@ var require_CheckInReservationCommand = __commonJS({
|
|
|
290
343
|
return `reservation.${this.data.id}.checkin`;
|
|
291
344
|
}
|
|
292
345
|
};
|
|
293
|
-
__name(CheckInReservationCommand, "CheckInReservationCommand");
|
|
294
346
|
module.exports = CheckInReservationCommand;
|
|
295
347
|
}
|
|
296
348
|
});
|
|
@@ -301,6 +353,9 @@ var require_SendEmailCommand = __commonJS({
|
|
|
301
353
|
var Command = require_Command();
|
|
302
354
|
var RequestError = require_RequestError();
|
|
303
355
|
var SendEmailCommand = class extends Command {
|
|
356
|
+
static {
|
|
357
|
+
__name(this, "SendEmailCommand");
|
|
358
|
+
}
|
|
304
359
|
constructor({ text, html, to, from, subject, ...rest }) {
|
|
305
360
|
if (!to)
|
|
306
361
|
throw new RequestError("email to is required");
|
|
@@ -319,7 +374,6 @@ var require_SendEmailCommand = __commonJS({
|
|
|
319
374
|
return "comm.email.send";
|
|
320
375
|
}
|
|
321
376
|
};
|
|
322
|
-
__name(SendEmailCommand, "SendEmailCommand");
|
|
323
377
|
module.exports = SendEmailCommand;
|
|
324
378
|
}
|
|
325
379
|
});
|
|
@@ -330,6 +384,9 @@ var require_SendSMSCommand = __commonJS({
|
|
|
330
384
|
var Command = require_Command();
|
|
331
385
|
var RequestError = require_RequestError();
|
|
332
386
|
var SendSMSCommand = class extends Command {
|
|
387
|
+
static {
|
|
388
|
+
__name(this, "SendSMSCommand");
|
|
389
|
+
}
|
|
333
390
|
constructor({ id, body, to, from, ...rest }) {
|
|
334
391
|
if (!body)
|
|
335
392
|
throw new RequestError("sms body is required");
|
|
@@ -346,7 +403,6 @@ var require_SendSMSCommand = __commonJS({
|
|
|
346
403
|
return "comm.sms.send";
|
|
347
404
|
}
|
|
348
405
|
};
|
|
349
|
-
__name(SendSMSCommand, "SendSMSCommand");
|
|
350
406
|
module.exports = SendSMSCommand;
|
|
351
407
|
}
|
|
352
408
|
});
|
|
@@ -355,13 +411,16 @@ var require_SendSMSCommand = __commonJS({
|
|
|
355
411
|
var require_AuthenticationError = __commonJS({
|
|
356
412
|
"src/Errors/AuthenticationError.js"(exports, module) {
|
|
357
413
|
var AppError = require_AppError();
|
|
358
|
-
module.exports =
|
|
414
|
+
module.exports = class AuthenticationError extends AppError {
|
|
415
|
+
static {
|
|
416
|
+
__name(this, "AuthenticationError");
|
|
417
|
+
}
|
|
359
418
|
constructor(message = "Authentication Error", options = {}) {
|
|
360
419
|
super(message, options);
|
|
361
420
|
this.statusCode = 401;
|
|
362
421
|
Object.setPrototypeOf(this, AuthenticationError.prototype);
|
|
363
422
|
}
|
|
364
|
-
}
|
|
423
|
+
};
|
|
365
424
|
}
|
|
366
425
|
});
|
|
367
426
|
|
|
@@ -369,13 +428,16 @@ var require_AuthenticationError = __commonJS({
|
|
|
369
428
|
var require_AuthorizationError = __commonJS({
|
|
370
429
|
"src/Errors/AuthorizationError.js"(exports, module) {
|
|
371
430
|
var AppError = require_AppError();
|
|
372
|
-
module.exports =
|
|
431
|
+
module.exports = class AuthorizationError extends AppError {
|
|
432
|
+
static {
|
|
433
|
+
__name(this, "AuthorizationError");
|
|
434
|
+
}
|
|
373
435
|
constructor(message = "Authorization Error", options = {}) {
|
|
374
436
|
super(message, options);
|
|
375
437
|
this.statusCode = 403;
|
|
376
438
|
Object.setPrototypeOf(this, AuthorizationError.prototype);
|
|
377
439
|
}
|
|
378
|
-
}
|
|
440
|
+
};
|
|
379
441
|
}
|
|
380
442
|
});
|
|
381
443
|
|
|
@@ -383,13 +445,16 @@ var require_AuthorizationError = __commonJS({
|
|
|
383
445
|
var require_DeviceCommError = __commonJS({
|
|
384
446
|
"src/Errors/DeviceCommError.js"(exports, module) {
|
|
385
447
|
var AppError = require_AppError();
|
|
386
|
-
module.exports =
|
|
448
|
+
module.exports = class DeviceCommError extends AppError {
|
|
449
|
+
static {
|
|
450
|
+
__name(this, "DeviceCommError");
|
|
451
|
+
}
|
|
387
452
|
constructor(message = "Device Communication Error", options = {}) {
|
|
388
453
|
super(message, options);
|
|
389
454
|
this.statusCode = 503;
|
|
390
455
|
Object.setPrototypeOf(this, DeviceCommError.prototype);
|
|
391
456
|
}
|
|
392
|
-
}
|
|
457
|
+
};
|
|
393
458
|
}
|
|
394
459
|
});
|
|
395
460
|
|
|
@@ -397,13 +462,16 @@ var require_DeviceCommError = __commonJS({
|
|
|
397
462
|
var require_LoginError = __commonJS({
|
|
398
463
|
"src/Errors/LoginError.js"(exports, module) {
|
|
399
464
|
var AppError = require_AppError();
|
|
400
|
-
module.exports =
|
|
465
|
+
module.exports = class LoginError extends AppError {
|
|
466
|
+
static {
|
|
467
|
+
__name(this, "LoginError");
|
|
468
|
+
}
|
|
401
469
|
constructor(message = "Invalid Login information provided", options = {}) {
|
|
402
470
|
super(message, options);
|
|
403
471
|
this.statusCode = 401;
|
|
404
472
|
Object.setPrototypeOf(this, LoginError.prototype);
|
|
405
473
|
}
|
|
406
|
-
}
|
|
474
|
+
};
|
|
407
475
|
}
|
|
408
476
|
});
|
|
409
477
|
|
|
@@ -411,13 +479,16 @@ var require_LoginError = __commonJS({
|
|
|
411
479
|
var require_NotFoundError = __commonJS({
|
|
412
480
|
"src/Errors/NotFoundError.js"(exports, module) {
|
|
413
481
|
var AppError = require_AppError();
|
|
414
|
-
module.exports =
|
|
482
|
+
module.exports = class NotFoundError extends AppError {
|
|
483
|
+
static {
|
|
484
|
+
__name(this, "NotFoundError");
|
|
485
|
+
}
|
|
415
486
|
constructor(message = "Resource Not Found", options = {}) {
|
|
416
487
|
super(message, options);
|
|
417
488
|
this.statusCode = 404;
|
|
418
489
|
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
419
490
|
}
|
|
420
|
-
}
|
|
491
|
+
};
|
|
421
492
|
}
|
|
422
493
|
});
|
|
423
494
|
|
|
@@ -425,13 +496,16 @@ var require_NotFoundError = __commonJS({
|
|
|
425
496
|
var require_SystemCommError = __commonJS({
|
|
426
497
|
"src/Errors/SystemCommError.js"(exports, module) {
|
|
427
498
|
var AppError = require_AppError();
|
|
428
|
-
module.exports =
|
|
499
|
+
module.exports = class SystemCommError extends AppError {
|
|
500
|
+
static {
|
|
501
|
+
__name(this, "SystemCommError");
|
|
502
|
+
}
|
|
429
503
|
constructor(message = "System Communication Error", options = {}) {
|
|
430
504
|
super(message, options);
|
|
431
505
|
this.statusCode = 503;
|
|
432
506
|
Object.setPrototypeOf(this, SystemCommError.prototype);
|
|
433
507
|
}
|
|
434
|
-
}
|
|
508
|
+
};
|
|
435
509
|
}
|
|
436
510
|
});
|
|
437
511
|
|
|
@@ -439,13 +513,16 @@ var require_SystemCommError = __commonJS({
|
|
|
439
513
|
var require_TokenExpiredError = __commonJS({
|
|
440
514
|
"src/Errors/TokenExpiredError.js"(exports, module) {
|
|
441
515
|
var AppError = require_AppError();
|
|
442
|
-
module.exports =
|
|
516
|
+
module.exports = class TokenExpiredError extends AppError {
|
|
517
|
+
static {
|
|
518
|
+
__name(this, "TokenExpiredError");
|
|
519
|
+
}
|
|
443
520
|
constructor(message = "Token Expired", options = {}) {
|
|
444
521
|
super(message, options);
|
|
445
522
|
this.statusCode = 401;
|
|
446
523
|
Object.setPrototypeOf(this, TokenExpiredError.prototype);
|
|
447
524
|
}
|
|
448
|
-
}
|
|
525
|
+
};
|
|
449
526
|
}
|
|
450
527
|
});
|
|
451
528
|
|
|
@@ -453,13 +530,16 @@ var require_TokenExpiredError = __commonJS({
|
|
|
453
530
|
var require_UnprocessableRequestError = __commonJS({
|
|
454
531
|
"src/Errors/UnprocessableRequestError.js"(exports, module) {
|
|
455
532
|
var AppError = require_AppError();
|
|
456
|
-
module.exports =
|
|
533
|
+
module.exports = class UnprocessableRequestError extends AppError {
|
|
534
|
+
static {
|
|
535
|
+
__name(this, "UnprocessableRequestError");
|
|
536
|
+
}
|
|
457
537
|
constructor(message = "Unprocessable Request Error", options = {}) {
|
|
458
538
|
super(message, options);
|
|
459
539
|
this.statusCode = 422;
|
|
460
540
|
Object.setPrototypeOf(this, UnprocessableRequestError.prototype);
|
|
461
541
|
}
|
|
462
|
-
}
|
|
542
|
+
};
|
|
463
543
|
}
|
|
464
544
|
});
|
|
465
545
|
|
|
@@ -467,13 +547,16 @@ var require_UnprocessableRequestError = __commonJS({
|
|
|
467
547
|
var require_ValidationError = __commonJS({
|
|
468
548
|
"src/Errors/ValidationError.js"(exports, module) {
|
|
469
549
|
var AppError = require_AppError();
|
|
470
|
-
module.exports =
|
|
550
|
+
module.exports = class ValidationError extends AppError {
|
|
551
|
+
static {
|
|
552
|
+
__name(this, "ValidationError");
|
|
553
|
+
}
|
|
471
554
|
constructor(message = "Validation Error", options = {}) {
|
|
472
555
|
super(message, options);
|
|
473
556
|
this.statusCode = 400;
|
|
474
557
|
Object.setPrototypeOf(this, ValidationError.prototype);
|
|
475
558
|
}
|
|
476
|
-
}
|
|
559
|
+
};
|
|
477
560
|
}
|
|
478
561
|
});
|
|
479
562
|
|
|
@@ -503,6 +586,9 @@ var require_DiscoverReservationsCommand = __commonJS({
|
|
|
503
586
|
var { RequestError } = require_Errors();
|
|
504
587
|
var Command = require_Command();
|
|
505
588
|
var DiscoverReservationsCommand = class extends Command {
|
|
589
|
+
static {
|
|
590
|
+
__name(this, "DiscoverReservationsCommand");
|
|
591
|
+
}
|
|
506
592
|
constructor(options) {
|
|
507
593
|
if (!options)
|
|
508
594
|
throw new RequestError("options are required");
|
|
@@ -516,7 +602,6 @@ var require_DiscoverReservationsCommand = __commonJS({
|
|
|
516
602
|
return "reservation.discover";
|
|
517
603
|
}
|
|
518
604
|
};
|
|
519
|
-
__name(DiscoverReservationsCommand, "DiscoverReservationsCommand");
|
|
520
605
|
module.exports = DiscoverReservationsCommand;
|
|
521
606
|
}
|
|
522
607
|
});
|
|
@@ -527,6 +612,9 @@ var require_DiscoverReservationRoomTypeUpsellOptionsCommand = __commonJS({
|
|
|
527
612
|
var { RequestError } = require_Errors();
|
|
528
613
|
var Command = require_Command();
|
|
529
614
|
var DiscoverReservationRoomTypeUpsellOptionsCommand = class extends Command {
|
|
615
|
+
static {
|
|
616
|
+
__name(this, "DiscoverReservationRoomTypeUpsellOptionsCommand");
|
|
617
|
+
}
|
|
530
618
|
constructor(options) {
|
|
531
619
|
if (!options)
|
|
532
620
|
throw new RequestError("options are required");
|
|
@@ -540,7 +628,6 @@ var require_DiscoverReservationRoomTypeUpsellOptionsCommand = __commonJS({
|
|
|
540
628
|
return "reservation.discoverRoomUpsells";
|
|
541
629
|
}
|
|
542
630
|
};
|
|
543
|
-
__name(DiscoverReservationRoomTypeUpsellOptionsCommand, "DiscoverReservationRoomTypeUpsellOptionsCommand");
|
|
544
631
|
module.exports = DiscoverReservationRoomTypeUpsellOptionsCommand;
|
|
545
632
|
}
|
|
546
633
|
});
|
|
@@ -550,6 +637,9 @@ var require_DiscoverRoomsCommand = __commonJS({
|
|
|
550
637
|
"src/Commands/DiscoverRoomsCommand.js"(exports, module) {
|
|
551
638
|
var Command = require_Command();
|
|
552
639
|
var DiscoverRoomsCommand = class extends Command {
|
|
640
|
+
static {
|
|
641
|
+
__name(this, "DiscoverRoomsCommand");
|
|
642
|
+
}
|
|
553
643
|
constructor({
|
|
554
644
|
id,
|
|
555
645
|
types,
|
|
@@ -580,7 +670,6 @@ var require_DiscoverRoomsCommand = __commonJS({
|
|
|
580
670
|
return "rooms.get";
|
|
581
671
|
}
|
|
582
672
|
};
|
|
583
|
-
__name(DiscoverRoomsCommand, "DiscoverRoomsCommand");
|
|
584
673
|
module.exports = DiscoverRoomsCommand;
|
|
585
674
|
}
|
|
586
675
|
});
|
|
@@ -590,6 +679,9 @@ var require_DiscoverRoomTypesCommand = __commonJS({
|
|
|
590
679
|
"src/Commands/DiscoverRoomTypesCommand.js"(exports, module) {
|
|
591
680
|
var Command = require_Command();
|
|
592
681
|
var DiscoverRoomTypesCommand = class extends Command {
|
|
682
|
+
static {
|
|
683
|
+
__name(this, "DiscoverRoomTypesCommand");
|
|
684
|
+
}
|
|
593
685
|
constructor({ id }) {
|
|
594
686
|
super({ id });
|
|
595
687
|
}
|
|
@@ -604,7 +696,6 @@ var require_DiscoverRoomTypesCommand = __commonJS({
|
|
|
604
696
|
return "rooms.get";
|
|
605
697
|
}
|
|
606
698
|
};
|
|
607
|
-
__name(DiscoverRoomTypesCommand, "DiscoverRoomTypesCommand");
|
|
608
699
|
module.exports = DiscoverRoomTypesCommand;
|
|
609
700
|
}
|
|
610
701
|
});
|
|
@@ -615,6 +706,9 @@ var require_CreateShortLinkCommand = __commonJS({
|
|
|
615
706
|
var Command = require_Command();
|
|
616
707
|
var RequestError = require_RequestError();
|
|
617
708
|
var CreateShortLinkCommand = class extends Command {
|
|
709
|
+
static {
|
|
710
|
+
__name(this, "CreateShortLinkCommand");
|
|
711
|
+
}
|
|
618
712
|
constructor({ title, destination }) {
|
|
619
713
|
if (!title)
|
|
620
714
|
throw new RequestError("title is required");
|
|
@@ -629,7 +723,6 @@ var require_CreateShortLinkCommand = __commonJS({
|
|
|
629
723
|
return "comm.shortlink.create";
|
|
630
724
|
}
|
|
631
725
|
};
|
|
632
|
-
__name(CreateShortLinkCommand, "CreateShortLinkCommand");
|
|
633
726
|
module.exports = CreateShortLinkCommand;
|
|
634
727
|
}
|
|
635
728
|
});
|
|
@@ -640,6 +733,9 @@ var require_UpdateReservationCommand = __commonJS({
|
|
|
640
733
|
var Command = require_Command();
|
|
641
734
|
var RequestError = require_RequestError();
|
|
642
735
|
var UpdateReservationCommand = class extends Command {
|
|
736
|
+
static {
|
|
737
|
+
__name(this, "UpdateReservationCommand");
|
|
738
|
+
}
|
|
643
739
|
constructor({ id, ...rest }) {
|
|
644
740
|
if (!id)
|
|
645
741
|
throw new RequestError("document type is required");
|
|
@@ -652,7 +748,6 @@ var require_UpdateReservationCommand = __commonJS({
|
|
|
652
748
|
return `reservation.${this.data.id}.update`;
|
|
653
749
|
}
|
|
654
750
|
};
|
|
655
|
-
__name(UpdateReservationCommand, "UpdateReservationCommand");
|
|
656
751
|
module.exports = UpdateReservationCommand;
|
|
657
752
|
}
|
|
658
753
|
});
|
|
@@ -663,6 +758,9 @@ var require_UpdateUserCommand = __commonJS({
|
|
|
663
758
|
var Command = require_Command();
|
|
664
759
|
var RequestError = require_RequestError();
|
|
665
760
|
var UpdateUserCommand = class extends Command {
|
|
761
|
+
static {
|
|
762
|
+
__name(this, "UpdateUserCommand");
|
|
763
|
+
}
|
|
666
764
|
constructor({
|
|
667
765
|
id,
|
|
668
766
|
email,
|
|
@@ -672,7 +770,8 @@ var require_UpdateUserCommand = __commonJS({
|
|
|
672
770
|
note,
|
|
673
771
|
nationality,
|
|
674
772
|
file,
|
|
675
|
-
payment
|
|
773
|
+
payment,
|
|
774
|
+
...rest
|
|
676
775
|
}) {
|
|
677
776
|
if (!id)
|
|
678
777
|
throw new RequestError("document type is required");
|
|
@@ -685,7 +784,8 @@ var require_UpdateUserCommand = __commonJS({
|
|
|
685
784
|
note,
|
|
686
785
|
nationality,
|
|
687
786
|
file,
|
|
688
|
-
payment
|
|
787
|
+
payment,
|
|
788
|
+
...rest
|
|
689
789
|
});
|
|
690
790
|
}
|
|
691
791
|
get name() {
|
|
@@ -695,7 +795,6 @@ var require_UpdateUserCommand = __commonJS({
|
|
|
695
795
|
return `user.${this.data.id}.update`;
|
|
696
796
|
}
|
|
697
797
|
};
|
|
698
|
-
__name(UpdateUserCommand, "UpdateUserCommand");
|
|
699
798
|
module.exports = UpdateUserCommand;
|
|
700
799
|
}
|
|
701
800
|
});
|
|
@@ -705,6 +804,9 @@ var require_GetMobileKeyCommand = __commonJS({
|
|
|
705
804
|
"src/Commands/GetMobileKeyCommand.js"(exports, module) {
|
|
706
805
|
var Command = require_Command();
|
|
707
806
|
var GetMobileKeyCommand = class extends Command {
|
|
807
|
+
static {
|
|
808
|
+
__name(this, "GetMobileKeyCommand");
|
|
809
|
+
}
|
|
708
810
|
constructor({
|
|
709
811
|
id,
|
|
710
812
|
phone,
|
|
@@ -722,7 +824,6 @@ var require_GetMobileKeyCommand = __commonJS({
|
|
|
722
824
|
return `lock.${this.data.id}.set`;
|
|
723
825
|
}
|
|
724
826
|
};
|
|
725
|
-
__name(GetMobileKeyCommand, "GetMobileKeyCommand");
|
|
726
827
|
module.exports = GetMobileKeyCommand;
|
|
727
828
|
}
|
|
728
829
|
});
|
|
@@ -732,6 +833,9 @@ var require_CreateImageUploadEndpointCommand = __commonJS({
|
|
|
732
833
|
"src/Commands/CreateImageUploadEndpointCommand.js"(exports, module) {
|
|
733
834
|
var Command = require_Command();
|
|
734
835
|
var CreateImageUploadEndpointCommand = class extends Command {
|
|
836
|
+
static {
|
|
837
|
+
__name(this, "CreateImageUploadEndpointCommand");
|
|
838
|
+
}
|
|
735
839
|
constructor({ id, expires, ...rest }) {
|
|
736
840
|
super({ id, expires, ...rest });
|
|
737
841
|
}
|
|
@@ -742,7 +846,6 @@ var require_CreateImageUploadEndpointCommand = __commonJS({
|
|
|
742
846
|
return "image.createUploadEndpoint";
|
|
743
847
|
}
|
|
744
848
|
};
|
|
745
|
-
__name(CreateImageUploadEndpointCommand, "CreateImageUploadEndpointCommand");
|
|
746
849
|
module.exports = CreateImageUploadEndpointCommand;
|
|
747
850
|
}
|
|
748
851
|
});
|
|
@@ -752,6 +855,9 @@ var require_UploadImageCommand = __commonJS({
|
|
|
752
855
|
"src/Commands/UploadImageCommand.js"(exports, module) {
|
|
753
856
|
var Command = require_Command();
|
|
754
857
|
var UploadImageCommand = class extends Command {
|
|
858
|
+
static {
|
|
859
|
+
__name(this, "UploadImageCommand");
|
|
860
|
+
}
|
|
755
861
|
constructor({ id, url, file, ...rest }) {
|
|
756
862
|
super({ id, url, file, ...rest });
|
|
757
863
|
}
|
|
@@ -762,7 +868,6 @@ var require_UploadImageCommand = __commonJS({
|
|
|
762
868
|
return `image.${this.data.id}.upload`;
|
|
763
869
|
}
|
|
764
870
|
};
|
|
765
|
-
__name(UploadImageCommand, "UploadImageCommand");
|
|
766
871
|
module.exports = UploadImageCommand;
|
|
767
872
|
}
|
|
768
873
|
});
|
|
@@ -772,6 +877,9 @@ var require_GetProductsCommand = __commonJS({
|
|
|
772
877
|
"src/Commands/GetProductsCommand.js"(exports, module) {
|
|
773
878
|
var Command = require_Command();
|
|
774
879
|
var GetProductsCommand = class extends Command {
|
|
880
|
+
static {
|
|
881
|
+
__name(this, "GetProductsCommand");
|
|
882
|
+
}
|
|
775
883
|
constructor({ id, externalSystemId, ...rest }) {
|
|
776
884
|
super({ id, externalSystemId, ...rest });
|
|
777
885
|
}
|
|
@@ -782,7 +890,6 @@ var require_GetProductsCommand = __commonJS({
|
|
|
782
890
|
return `product.${this.data.id}.get`;
|
|
783
891
|
}
|
|
784
892
|
};
|
|
785
|
-
__name(GetProductsCommand, "GetProductsCommand");
|
|
786
893
|
module.exports = GetProductsCommand;
|
|
787
894
|
}
|
|
788
895
|
});
|
|
@@ -792,6 +899,9 @@ var require_SellProductsCommand = __commonJS({
|
|
|
792
899
|
"src/Commands/SellProductsCommand.js"(exports, module) {
|
|
793
900
|
var Command = require_Command();
|
|
794
901
|
var SellProductsCommand = class extends Command {
|
|
902
|
+
static {
|
|
903
|
+
__name(this, "SellProductsCommand");
|
|
904
|
+
}
|
|
795
905
|
constructor({ reservationId, userId, products, ...rest }) {
|
|
796
906
|
super({ reservationId, userId, products, ...rest });
|
|
797
907
|
}
|
|
@@ -802,7 +912,6 @@ var require_SellProductsCommand = __commonJS({
|
|
|
802
912
|
return `product.${this.data.id}.sell`;
|
|
803
913
|
}
|
|
804
914
|
};
|
|
805
|
-
__name(SellProductsCommand, "SellProductsCommand");
|
|
806
915
|
module.exports = SellProductsCommand;
|
|
807
916
|
}
|
|
808
917
|
});
|
|
@@ -810,6 +919,7 @@ var require_SellProductsCommand = __commonJS({
|
|
|
810
919
|
// src/Commands/index.js
|
|
811
920
|
var require_Commands = __commonJS({
|
|
812
921
|
"src/Commands/index.js"(exports, module) {
|
|
922
|
+
var SetSceneCommand = require_SetSceneCommand();
|
|
813
923
|
var SetAlarmCommand = require_SetAlarmCommand();
|
|
814
924
|
var SetDimmerCommand = require_SetDimmerCommand();
|
|
815
925
|
var SetSwitchCommand = require_SetSwitchCommand();
|
|
@@ -836,6 +946,7 @@ var require_Commands = __commonJS({
|
|
|
836
946
|
var GetProductsCommand = require_GetProductsCommand();
|
|
837
947
|
var SellProductsCommand = require_SellProductsCommand();
|
|
838
948
|
module.exports = {
|
|
949
|
+
SetSceneCommand,
|
|
839
950
|
SetAlarmCommand,
|
|
840
951
|
SetDimmerCommand,
|
|
841
952
|
SetSwitchCommand,
|