@kohost/api-client 1.0.0-alpha.2 → 1.0.0-alpha.4

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 (115) hide show
  1. package/.eslintrc.js +10 -0
  2. package/bitbucket-pipelines.yml +39 -0
  3. package/commands/Command.js +38 -0
  4. package/commands/DiscoverUsersCommand.js +21 -0
  5. package/commands/SetAlarmCommand.js +21 -0
  6. package/commands/SetCourtesyCommand.js +21 -0
  7. package/commands/SetDimmerCommand.js +21 -0
  8. package/commands/SetLockCommand.js +21 -0
  9. package/commands/SetSceneControllerCommand.js +21 -0
  10. package/commands/SetSwitchCommand.js +21 -0
  11. package/commands/SetThermostatCommand.js +21 -0
  12. package/commands/SetWindowCoveringCommand.js +21 -0
  13. package/commands/VerifyDocumentCommand.js +24 -0
  14. package/commands/index.js +25 -0
  15. package/defs/deviceTypes.js +15 -0
  16. package/defs/formalDeviceTypes.js +6 -0
  17. package/defs/http.js +7 -0
  18. package/defs/index.js +11 -0
  19. package/errors/AppError.js +8 -0
  20. package/errors/AuthenticationError.js +9 -0
  21. package/errors/AuthorizationError.js +9 -0
  22. package/errors/DeviceCommError.js +9 -0
  23. package/errors/LoginError.js +9 -0
  24. package/errors/NotFoundError.js +9 -0
  25. package/errors/RequestError.js +9 -0
  26. package/errors/SystemCommError.js +9 -0
  27. package/errors/TokenExpiredError.js +9 -0
  28. package/errors/UnprocessableRequestError.js +9 -0
  29. package/errors/ValidationError.js +9 -0
  30. package/errors/index.js +15 -0
  31. package/events/Event.js +33 -0
  32. package/events/SystemCameraUpdatedEvent.js +17 -0
  33. package/events/SystemCourtesyUpdatedEvent.js +17 -0
  34. package/events/SystemDimmerUpdatedEvent.js +17 -0
  35. package/events/SystemLockUpdatedEvent.js +17 -0
  36. package/events/SystemReservationUpdatedEvent.js +17 -0
  37. package/events/SystemSceneControllerUpdatedEvent.js +17 -0
  38. package/events/SystemSourceUpdatedEvent.js +17 -0
  39. package/events/SystemSpaceUpdatedEvent.js +17 -0
  40. package/events/SystemSwitchUpdatedEvent.js +17 -0
  41. package/events/SystemThermostatUpdatedEvent.js +17 -0
  42. package/events/SystemUserUpdatedEvent.js +17 -0
  43. package/events/SystemWindowCoveringUpdatedEvent.js +17 -0
  44. package/events/index.js +28 -0
  45. package/http/handleResponseError.js +53 -0
  46. package/http/handleResponseSuccess.js +15 -0
  47. package/http/index.js +165 -0
  48. package/index.js +19 -2
  49. package/models/acl.js +29 -0
  50. package/models/admin/customer.js +28 -0
  51. package/models/admin/property.js +28 -0
  52. package/models/alarm.js +25 -3
  53. package/models/application.js +28 -0
  54. package/models/camera.js +29 -0
  55. package/models/courtesy.js +29 -3
  56. package/models/dimmer.js +45 -3
  57. package/models/discoveredDevice.js +30 -0
  58. package/models/gateway.js +33 -3
  59. package/models/index.js +38 -1
  60. package/models/integration.js +76 -0
  61. package/models/iotGateway.js +29 -0
  62. package/models/kohost.js +95 -0
  63. package/models/lock.js +29 -3
  64. package/models/mediaSource.js +29 -0
  65. package/models/motionSensor.js +29 -0
  66. package/models/reservation.js +36 -0
  67. package/models/room.js +185 -0
  68. package/models/scene.js +28 -0
  69. package/models/sceneController.js +24 -5
  70. package/models/space.js +99 -0
  71. package/models/switch.js +29 -3
  72. package/models/thermostat.js +71 -31
  73. package/models/ticket.js +91 -0
  74. package/models/user.js +58 -0
  75. package/models/windowCovering.js +44 -5
  76. package/package.json +30 -7
  77. package/prepare.js +4 -0
  78. package/schemas/acl.json +111 -0
  79. package/schemas/admin/customer.json +32 -0
  80. package/schemas/admin/property.json +174 -0
  81. package/schemas/alarm.json +5 -5
  82. package/schemas/application.json +24 -0
  83. package/schemas/camera.json +41 -0
  84. package/schemas/courtesy.json +5 -6
  85. package/schemas/definitions/common.json +21 -0
  86. package/schemas/definitions/device.json +21 -3
  87. package/schemas/dimmer.json +8 -5
  88. package/schemas/discoveredDevice.json +43 -0
  89. package/schemas/gateway.json +45 -13
  90. package/schemas/identification.json +35 -0
  91. package/schemas/integration.json +94 -0
  92. package/schemas/iotGateway.json +29 -0
  93. package/schemas/lock.json +8 -5
  94. package/schemas/mediaSource.json +151 -0
  95. package/schemas/motionSensor.json +26 -0
  96. package/schemas/payment.json +38 -0
  97. package/schemas/reservation.json +66 -0
  98. package/schemas/room.json +138 -0
  99. package/schemas/scene.json +118 -0
  100. package/schemas/sceneController.json +9 -9
  101. package/schemas/space.json +111 -0
  102. package/schemas/switch.json +8 -5
  103. package/schemas/thermostat.json +19 -10
  104. package/schemas/ticket.json +82 -0
  105. package/schemas/user.json +124 -0
  106. package/schemas/windowCovering.json +8 -5
  107. package/tests/unit/models/space.test.js +31 -0
  108. package/tests/unit/models/thermostat.test.js +146 -0
  109. package/tests/unit/models/user.test.js +28 -0
  110. package/useCases/http.json +1098 -0
  111. package/utils/getDeviceTypes.js +7 -0
  112. package/utils/getFormalDeviceType.js +5 -0
  113. package/utils/schema.js +28 -0
  114. package/vite.config.js +22 -0
  115. package/utils/compiler.js +0 -40
package/.eslintrc.js ADDED
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ env: {
3
+ "jest/globals": true,
4
+ },
5
+ plugins: ["jest"],
6
+ extends: ["@kohost"],
7
+ parserOptions: {
8
+ ecmaVersion: 2020,
9
+ },
10
+ };
@@ -0,0 +1,39 @@
1
+ image: node:14
2
+
3
+ pipelines:
4
+ pull-requests:
5
+ "**":
6
+ - step:
7
+ name: Install dependencies and build
8
+ caches:
9
+ - node
10
+ script:
11
+ - npm install
12
+ - npm version prerelease --preid=alpha -m "Upgrade to %s [skip ci]"
13
+ - git push && git push --tags
14
+ - pipe: atlassian/npm-publish:0.2.6
15
+ variables:
16
+ NPM_TOKEN: $NPM_TOKEN
17
+ branches:
18
+ master:
19
+ - step:
20
+ name: Build and publish to NPM
21
+ caches:
22
+ - node
23
+ script:
24
+ - npm install
25
+ - pipe: atlassian/npm-publish:0.2.6
26
+ variables:
27
+ NPM_TOKEN: $NPM_TOKEN
28
+ dev:
29
+ - step:
30
+ name: Build and publish to NPM
31
+ caches:
32
+ - node
33
+ script:
34
+ - npm install
35
+ - npm version prerelease --preid=beta -m "Upgrade to %s [skip ci]"
36
+ - git push && git push --tags
37
+ - pipe: atlassian/npm-publish:0.2.6
38
+ variables:
39
+ NPM_TOKEN: $NPM_TOKEN
@@ -0,0 +1,38 @@
1
+ class Command {
2
+ constructor(data) {
3
+ this.data = {};
4
+ if (!data) throw new Error("Command data is required");
5
+ if (typeof data !== "object")
6
+ throw new Error("Command data must be an object");
7
+
8
+ for (const key in data) {
9
+ this.data[key] = data[key];
10
+ }
11
+ }
12
+
13
+ get name() {
14
+ throw new Error("Command name is required");
15
+ }
16
+
17
+ get type() {
18
+ return "Command";
19
+ }
20
+
21
+ get routingKey() {
22
+ return "";
23
+ }
24
+
25
+ get exchange() {
26
+ return "Commands";
27
+ }
28
+
29
+ get replyTo() {
30
+ return "amq.rabbitmq.reply-to";
31
+ }
32
+
33
+ build() {
34
+ return { data: { ...this.data } };
35
+ }
36
+ }
37
+
38
+ module.exports = Command;
@@ -0,0 +1,21 @@
1
+ const Command = require("./Command");
2
+
3
+ class SetAlarmCommand extends Command {
4
+ constructor({ id }) {
5
+ super({ id });
6
+ }
7
+
8
+ get name() {
9
+ return "DiscoverUsers";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `users.${this.data.id}.get`;
14
+ }
15
+
16
+ get replyTo() {
17
+ return "system.response.users";
18
+ }
19
+ }
20
+
21
+ module.exports = SetAlarmCommand;
@@ -0,0 +1,21 @@
1
+ const Command = require("./Command");
2
+
3
+ class SetAlarmCommand extends Command {
4
+ constructor({ id, zones, areas }) {
5
+ super({ id, zones, areas });
6
+ }
7
+
8
+ get name() {
9
+ return "SetAlarm";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `alarm.${this.data.id}.set`;
14
+ }
15
+
16
+ get replyTo() {
17
+ return "system.response.devices";
18
+ }
19
+ }
20
+
21
+ module.exports = SetAlarmCommand;
@@ -0,0 +1,21 @@
1
+ const Command = require("./Command");
2
+
3
+ class SetCourtesyCommand extends Command {
4
+ constructor({ id, state }) {
5
+ super({ id, state });
6
+ }
7
+
8
+ get name() {
9
+ return "SetCourtesy";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `courtesy.${this.data.id}.set`;
14
+ }
15
+
16
+ get replyTo() {
17
+ return "system.response.devices";
18
+ }
19
+ }
20
+
21
+ module.exports = SetCourtesyCommand;
@@ -0,0 +1,21 @@
1
+ const Command = require("./Command");
2
+
3
+ class SetDimmerCommand extends Command {
4
+ constructor({ id, level }) {
5
+ super({ id, level });
6
+ }
7
+
8
+ get name() {
9
+ return "SetDimmer";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `dimmer.${this.data.id}.set`;
14
+ }
15
+
16
+ get replyTo() {
17
+ return "system.response.devices";
18
+ }
19
+ }
20
+
21
+ module.exports = SetDimmerCommand;
@@ -0,0 +1,21 @@
1
+ const Command = require("./Command");
2
+
3
+ class SetLockCommand extends Command {
4
+ constructor({ id, state }) {
5
+ super({ id, state });
6
+ }
7
+
8
+ get name() {
9
+ return "SetLock";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `lock.${this.data.id}.set`;
14
+ }
15
+
16
+ get replyTo() {
17
+ return "system.response.devices";
18
+ }
19
+ }
20
+
21
+ module.exports = SetLockCommand;
@@ -0,0 +1,21 @@
1
+ const Command = require("./Command");
2
+
3
+ class SetSceneControllerCommand extends Command {
4
+ constructor({ id, scene }) {
5
+ super({ id, scene });
6
+ }
7
+
8
+ get name() {
9
+ return "SetSceneController";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `sceneController.${this.data.id}.set`;
14
+ }
15
+
16
+ get replyTo() {
17
+ return "system.response.devices";
18
+ }
19
+ }
20
+
21
+ module.exports = SetSceneControllerCommand;
@@ -0,0 +1,21 @@
1
+ const Command = require("./Command");
2
+
3
+ class SetSwitchCommand extends Command {
4
+ constructor({ id, state }) {
5
+ super({ id, state });
6
+ }
7
+
8
+ get name() {
9
+ return "SetSwitch";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `switch.${this.data.id}.set`;
14
+ }
15
+
16
+ get replyTo() {
17
+ return "system.response.devices";
18
+ }
19
+ }
20
+
21
+ module.exports = SetSwitchCommand;
@@ -0,0 +1,21 @@
1
+ const Command = require("./Command");
2
+
3
+ class SetThermostatCommand extends Command {
4
+ constructor({ id, setpoints, hvacMode, fanMode }) {
5
+ super({ id, setpoints, hvacMode, fanMode });
6
+ }
7
+
8
+ get name() {
9
+ return "SetThermostat";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `thermostat.${this.data.id}.set`;
14
+ }
15
+
16
+ get replyTo() {
17
+ return "system.response.devices";
18
+ }
19
+ }
20
+
21
+ module.exports = SetThermostatCommand;
@@ -0,0 +1,21 @@
1
+ const Command = require("./Command");
2
+
3
+ class SetWindowCoveringCommand extends Command {
4
+ constructor({ id, position }) {
5
+ super({ id, position });
6
+ }
7
+
8
+ get name() {
9
+ return "SetWindowCovering";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `windowCovering.${this.data.id}.set`;
14
+ }
15
+
16
+ get replyTo() {
17
+ return "system.response.devices";
18
+ }
19
+ }
20
+
21
+ module.exports = SetWindowCoveringCommand;
@@ -0,0 +1,24 @@
1
+ const Command = require("./Command");
2
+ const RequestError = require("../errors/RequestError");
3
+
4
+ class VerifyDocumentCommand extends Command {
5
+ constructor({ type, image }) {
6
+ if (!type) throw new RequestError("document type is required");
7
+ if (!image) throw new RequestError("document image is required");
8
+ super({ type, image });
9
+ }
10
+
11
+ get name() {
12
+ return "VerifyDocument";
13
+ }
14
+
15
+ get routingKey() {
16
+ return `document.${this.data.type}.verify`;
17
+ }
18
+
19
+ get replyTo() {
20
+ return "system.response.documents";
21
+ }
22
+ }
23
+
24
+ module.exports = VerifyDocumentCommand;
@@ -0,0 +1,25 @@
1
+ const SetAlarmCommand = require("./SetAlarmCommand");
2
+ const SetDimmerCommand = require("./SetDimmerCommand");
3
+ const SetSwitchCommand = require("./SetSwitchCommand");
4
+ const SetThermostatCommand = require("./SetThermostatCommand");
5
+ const SetLockCommand = require("./SetLockCommand");
6
+ const SetSceneControllerCommand = require("./SetSceneControllerCommand");
7
+ const SetWindowCoveringCommand = require("./SetWindowCoveringCommand");
8
+ const SetCourtesyCommand = require("./SetCourtesyCommand");
9
+
10
+ const DiscoverUsersCommand = require("./DiscoverUsersCommand");
11
+
12
+ const VerifyDocumentCommand = require("./VerifyDocumentCommand");
13
+
14
+ module.exports = {
15
+ SetAlarmCommand,
16
+ SetDimmerCommand,
17
+ SetSwitchCommand,
18
+ SetThermostatCommand,
19
+ SetLockCommand,
20
+ SetSceneControllerCommand,
21
+ SetWindowCoveringCommand,
22
+ SetCourtesyCommand,
23
+ VerifyDocumentCommand,
24
+ DiscoverUsersCommand,
25
+ };
@@ -0,0 +1,15 @@
1
+ const types = [
2
+ "dimmer",
3
+ "switch",
4
+ "thermostat",
5
+ "lock",
6
+ "windowCovering",
7
+ "sceneController",
8
+ "courtesy",
9
+ "alarm",
10
+ "camera",
11
+ "source",
12
+ "motionSensor",
13
+ ];
14
+
15
+ module.exports = types;
@@ -0,0 +1,6 @@
1
+ const deviceTypes = require("./deviceTypes");
2
+ const formalDeviceTypes = deviceTypes.map(
3
+ (type) => type.charAt(0).toUpperCase() + type.slice(1)
4
+ );
5
+
6
+ module.exports = formalDeviceTypes;
package/defs/http.js ADDED
@@ -0,0 +1,7 @@
1
+ const http = {
2
+ authTokenHeader: "X-Auth-Token",
3
+ refreshTokenHeader: "X-Refresh-Token",
4
+ tenantHeader: "X-Tenant-Id",
5
+ };
6
+
7
+ module.exports = http;
package/defs/index.js ADDED
@@ -0,0 +1,11 @@
1
+ const http = require("./http");
2
+ const deviceTypes = require("./deviceTypes");
3
+ const formalDeviceTypes = require("./formalDeviceTypes");
4
+
5
+ const defs = {
6
+ http,
7
+ deviceTypes,
8
+ formalDeviceTypes,
9
+ };
10
+
11
+ module.exports = defs;
@@ -0,0 +1,8 @@
1
+ module.exports = class AppError extends Error {
2
+ constructor(message = "Internal Server Error", options) {
3
+ super(message, options);
4
+ this.type = this.constructor.name;
5
+ this.statusCode = 500;
6
+ Object.setPrototypeOf(this, AppError.prototype);
7
+ }
8
+ };
@@ -0,0 +1,9 @@
1
+ const AppError = require("./AppError");
2
+
3
+ module.exports = class AuthenticationError extends AppError {
4
+ constructor(message = "Authentication Error", options = {}) {
5
+ super(message, options);
6
+ this.statusCode = 401;
7
+ Object.setPrototypeOf(this, AuthenticationError.prototype);
8
+ }
9
+ };
@@ -0,0 +1,9 @@
1
+ const AppError = require("./AppError");
2
+
3
+ module.exports = class AuthorizationError extends AppError {
4
+ constructor(message = "Authorization Error", options = {}) {
5
+ super(message, options);
6
+ this.statusCode = 403;
7
+ Object.setPrototypeOf(this, AuthorizationError.prototype);
8
+ }
9
+ };
@@ -0,0 +1,9 @@
1
+ const AppError = require("./AppError");
2
+
3
+ module.exports = class DeviceCommError extends AppError {
4
+ constructor(message = "Device Communication Error", options = {}) {
5
+ super(message, options);
6
+ this.statusCode = 503;
7
+ Object.setPrototypeOf(this, DeviceCommError.prototype);
8
+ }
9
+ };
@@ -0,0 +1,9 @@
1
+ const AppError = require("./AppError");
2
+
3
+ module.exports = class LoginError extends AppError {
4
+ constructor(message = "Invalid Login information provided", options = {}) {
5
+ super(message, options);
6
+ this.statusCode = 401;
7
+ Object.setPrototypeOf(this, LoginError.prototype);
8
+ }
9
+ };
@@ -0,0 +1,9 @@
1
+ const AppError = require("./AppError");
2
+
3
+ module.exports = class NotFoundError extends AppError {
4
+ constructor(message = "Resource Not Found", options = {}) {
5
+ super(message, options);
6
+ this.statusCode = 404;
7
+ Object.setPrototypeOf(this, NotFoundError.prototype);
8
+ }
9
+ };
@@ -0,0 +1,9 @@
1
+ const AppError = require("./AppError");
2
+
3
+ module.exports = class RequestError extends AppError {
4
+ constructor(message = "Bad Request", options = {}) {
5
+ super(message, options);
6
+ this.statusCode = 400;
7
+ Object.setPrototypeOf(this, RequestError.prototype);
8
+ }
9
+ };
@@ -0,0 +1,9 @@
1
+ const AppError = require("./AppError");
2
+
3
+ module.exports = class SystemCommError extends AppError {
4
+ constructor(message = "System Communication Error", options = {}) {
5
+ super(message, options);
6
+ this.statusCode = 503;
7
+ Object.setPrototypeOf(this, SystemCommError.prototype);
8
+ }
9
+ };
@@ -0,0 +1,9 @@
1
+ const AppError = require("./AppError");
2
+
3
+ module.exports = class TokenExpiredError extends AppError {
4
+ constructor(message = "Token Expired", options = {}) {
5
+ super(message, options);
6
+ this.statusCode = 401;
7
+ Object.setPrototypeOf(this, TokenExpiredError.prototype);
8
+ }
9
+ };
@@ -0,0 +1,9 @@
1
+ const AppError = require("./AppError");
2
+
3
+ module.exports = class UnprocessableRequestError extends AppError {
4
+ constructor(message = "Unprocessable Request Error", options = {}) {
5
+ super(message, options);
6
+ this.statusCode = 422;
7
+ Object.setPrototypeOf(this, UnprocessableRequestError.prototype);
8
+ }
9
+ };
@@ -0,0 +1,9 @@
1
+ const AppError = require("./AppError");
2
+
3
+ module.exports = class ValidationError extends AppError {
4
+ constructor(message = "Validation Error", options = {}) {
5
+ super(message, options);
6
+ this.statusCode = 400;
7
+ Object.setPrototypeOf(this, ValidationError.prototype);
8
+ }
9
+ };
@@ -0,0 +1,15 @@
1
+ const Errors = {
2
+ AppError: require("./AppError"),
3
+ AuthenticationError: require("./AuthenticationError"),
4
+ AuthorizationError: require("./AuthorizationError"),
5
+ DeviceCommError: require("./DeviceCommError"),
6
+ LoginError: require("./LoginError"),
7
+ NotFoundError: require("./NotFoundError"),
8
+ RequestError: require("./RequestError"),
9
+ SystemCommError: require("./SystemCommError"),
10
+ TokenExpiredError: require("./TokenExpiredError"),
11
+ UnprocessableRequestError: require("./UnprocessableRequestError"),
12
+ ValidationError: require("./ValidationError"),
13
+ };
14
+
15
+ module.exports = Errors;
@@ -0,0 +1,33 @@
1
+ class Event {
2
+ constructor(data) {
3
+ this.data = {};
4
+ if (!data) throw new Error("Event data is required");
5
+ if (typeof data !== "object")
6
+ throw new Error("Event data must be an object");
7
+
8
+ for (const key in data) {
9
+ this.data[key] = data[key];
10
+ }
11
+ }
12
+ get name() {
13
+ throw new Error("Event name is required");
14
+ }
15
+
16
+ get type() {
17
+ return "Event";
18
+ }
19
+
20
+ get routingKey() {
21
+ return "";
22
+ }
23
+
24
+ get exchange() {
25
+ return "Events";
26
+ }
27
+
28
+ build() {
29
+ return { data: { ...this.data } };
30
+ }
31
+ }
32
+
33
+ module.exports = Event;
@@ -0,0 +1,17 @@
1
+ const Event = require("./Event");
2
+
3
+ class SystemCameraUpdatedEvent extends Event {
4
+ constructor(camera) {
5
+ super(camera);
6
+ }
7
+
8
+ get name() {
9
+ return "SystemCameraUpdated";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `camera.${this.data.id}.updated`;
14
+ }
15
+ }
16
+
17
+ module.exports = SystemCameraUpdatedEvent;
@@ -0,0 +1,17 @@
1
+ const Event = require("./Event");
2
+
3
+ class SystemCourtesyUpdatedEvent extends Event {
4
+ constructor(courtesy) {
5
+ super(courtesy);
6
+ }
7
+
8
+ get name() {
9
+ return "SystemCourtesyUpdated";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `courtesy.${this.data.id}.updated`;
14
+ }
15
+ }
16
+
17
+ module.exports = SystemCourtesyUpdatedEvent;
@@ -0,0 +1,17 @@
1
+ const Event = require("./Event");
2
+
3
+ class SystemDimmerUpdatedEvent extends Event {
4
+ constructor(dimmer) {
5
+ super(dimmer);
6
+ }
7
+
8
+ get name() {
9
+ return "SystemDimmerUpdated";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `dimmer.${this.data.id}.updated`;
14
+ }
15
+ }
16
+
17
+ module.exports = SystemDimmerUpdatedEvent;
@@ -0,0 +1,17 @@
1
+ const Event = require("./Event");
2
+
3
+ class SystemLockUpdatedEvent extends Event {
4
+ constructor(lock) {
5
+ super(lock);
6
+ }
7
+
8
+ get name() {
9
+ return "SystemLockUpdated";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `lock.${this.data.id}.updated`;
14
+ }
15
+ }
16
+
17
+ module.exports = SystemLockUpdatedEvent;
@@ -0,0 +1,17 @@
1
+ const Event = require("./Event");
2
+
3
+ class SystemReservationUpdatedEvent extends Event {
4
+ constructor(reservation) {
5
+ super(reservation);
6
+ }
7
+
8
+ get name() {
9
+ return "SystemReservationUpdated";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `reservation.${this.data.id}.updated`;
14
+ }
15
+ }
16
+
17
+ module.exports = SystemReservationUpdatedEvent;
@@ -0,0 +1,17 @@
1
+ const Event = require("./Event");
2
+
3
+ class SystemSceneControllerUpdatedEvent extends Event {
4
+ constructor(sceneController) {
5
+ super(sceneController);
6
+ }
7
+
8
+ get name() {
9
+ return "SystemSceneControllerUpdated";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `sceneController.${this.data.id}.updated`;
14
+ }
15
+ }
16
+
17
+ module.exports = SystemSceneControllerUpdatedEvent;