@kohost/api-client 3.0.0-beta.50 → 3.0.0-beta.51
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/Events/SystemAlarmUpdatedEvent.js +17 -0
- package/dist/cjs/Events/index.js +2 -1
- package/dist/cjs/Models/Alarm.js +8 -2
- package/dist/cjs/Models/Camera.js +9 -3
- package/dist/cjs/Models/Courtesy.js +8 -2
- package/dist/cjs/Models/Credential.js +8 -2
- package/dist/cjs/Models/DiscoveredDevice.js +8 -2
- package/dist/cjs/Models/EmailMessage.js +8 -2
- package/dist/cjs/Models/EnergyReport.js +8 -2
- package/dist/cjs/Models/EnergyReportShard.js +8 -2
- package/dist/cjs/Models/Gateway.js +8 -2
- package/dist/cjs/Models/Identification.js +8 -2
- package/dist/cjs/Models/Lock.js +8 -2
- package/dist/cjs/Models/MediaFile.js +8 -2
- package/dist/cjs/Models/MediaSource.js +8 -2
- package/dist/cjs/Models/MotionSensor.js +8 -2
- package/dist/cjs/Models/Organization.js +8 -2
- package/dist/cjs/Models/Product.js +8 -2
- package/dist/cjs/Models/Property.js +8 -2
- package/dist/cjs/Models/Reservation.js +11 -5
- package/dist/cjs/Models/Room.js +8 -2
- package/dist/cjs/Models/Scene.js +8 -2
- package/dist/cjs/Models/ShortLink.js +8 -2
- package/dist/cjs/Models/SmsMessage.js +8 -2
- package/dist/cjs/Models/Space.js +3 -3
- package/dist/cjs/Models/SpaceType.js +8 -2
- package/dist/cjs/Models/Switch.js +8 -2
- package/dist/cjs/Models/SystemUser.js +9 -2
- package/dist/cjs/Models/Thermostat.js +8 -2
- package/dist/cjs/Models/Ticket.js +8 -2
- package/dist/cjs/Models/User.js +11 -5
- package/dist/cjs/Models/WindowCovering.js +8 -2
- package/dist/esm/Events.js +24 -0
- package/dist/esm/Events.js.map +3 -3
- package/dist/esm/Models.js +242 -68
- package/dist/esm/Models.js.map +2 -2
- package/package.json +13 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const Event = require("./Event");
|
|
2
|
+
|
|
3
|
+
class SystemAlarmUpdatedEvent extends Event {
|
|
4
|
+
constructor(alarm) {
|
|
5
|
+
super(alarm);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
get name() {
|
|
9
|
+
return "SystemAlarmUpdated";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
get routingKey() {
|
|
13
|
+
return `alarm.${this.keyId}.updated`;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
module.exports = SystemAlarmUpdatedEvent;
|
package/dist/cjs/Events/index.js
CHANGED
|
@@ -8,7 +8,7 @@ const SystemSceneControllerUpdatedEvent = require("./SystemSceneControllerUpdate
|
|
|
8
8
|
const SystemWindowCoveringUpdatedEvent = require("./SystemWindowCoveringUpdatedEvent");
|
|
9
9
|
const SystemMediaSourceUpdatedEvent = require("./SystemMediaSourceUpdatedEvent");
|
|
10
10
|
const SystemCourtesyUpdatedEvent = require("./SystemCourtesyUpdatedEvent");
|
|
11
|
-
|
|
11
|
+
const SystemAlarmUpdatedEvent = require("./SystemAlarmUpdatedEvent");
|
|
12
12
|
const SystemMotionSensorUpdatedEvent = require("./SystemMotionSensorUpdatedEvent");
|
|
13
13
|
|
|
14
14
|
const SystemUserUpdatedEvent = require("./SystemUserUpdatedEvent");
|
|
@@ -26,6 +26,7 @@ const ApplicationInUseEvent = require("./ApplicationInUseEvent");
|
|
|
26
26
|
const ApplicationOutOfUseEvent = require("./ApplicationOutOfUseEvent");
|
|
27
27
|
|
|
28
28
|
module.exports = {
|
|
29
|
+
SystemAlarmUpdatedEvent,
|
|
29
30
|
SystemGatewayUpdatedEvent,
|
|
30
31
|
SystemThermostatUpdatedEvent,
|
|
31
32
|
SystemDimmerUpdatedEvent,
|
package/dist/cjs/Models/Alarm.js
CHANGED
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class Alarm extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/AlarmSchema").Alarm} AlarmType
|
|
12
|
+
* Create a Alarm instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {AlarmType} alarm - The alarm object of type Alarm.
|
|
15
|
+
*/
|
|
16
|
+
constructor(alarm) {
|
|
17
|
+
super(alarm);
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// create the
|
|
1
|
+
// create the Camera Model
|
|
2
2
|
const schemas = require("../utils/schema");
|
|
3
3
|
const schema = require("../schemas/camera.json");
|
|
4
4
|
const Kohost = require("./Kohost");
|
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class Camera extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/CameraSchema").Camera} CameraType
|
|
12
|
+
* Create a Camera instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {CameraType} camera - The camera object of type Camera.
|
|
15
|
+
*/
|
|
16
|
+
constructor(camera) {
|
|
17
|
+
super(camera);
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class Courtesy extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/CourtesySchema").Courtesy} CourtesyType
|
|
12
|
+
* Create a Courtesy instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {CourtesyType} courtesy - The courtesy object of type Courtesy.
|
|
15
|
+
*/
|
|
16
|
+
constructor(courtesy) {
|
|
17
|
+
super(courtesy);
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class Credential extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/CredentialSchema").Credential} CredentialType
|
|
12
|
+
* Create a Credential instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {CredentialType} credential - The credential object of type Credential.
|
|
15
|
+
*/
|
|
16
|
+
constructor(credential) {
|
|
17
|
+
super(credential);
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -8,8 +8,14 @@ schemas.add(schema);
|
|
|
8
8
|
const validator = schemas.compile(schema);
|
|
9
9
|
|
|
10
10
|
class DiscoveredDevice extends Kohost {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {import("../schemas/DiscoveredDeviceSchema").DiscoveredDevice} DiscoveredDeviceType
|
|
13
|
+
* Create a DiscoveredDevice instance.
|
|
14
|
+
* @constructor
|
|
15
|
+
* @param {DiscoveredDeviceType} device - The dd object of type DiscoveredDevice.
|
|
16
|
+
*/
|
|
17
|
+
constructor(device) {
|
|
18
|
+
super(device);
|
|
13
19
|
}
|
|
14
20
|
}
|
|
15
21
|
|
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class EmailMessage extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/EmailMessageSchema").EmailMessage} EmailMessageType
|
|
12
|
+
* Create a EmailMessage instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {EmailMessageType} message - The message object of type EmailMessage.
|
|
15
|
+
*/
|
|
16
|
+
constructor(message) {
|
|
17
|
+
super(message);
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class EnergyReport extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/EnergyReportSchema").EnergyReport} EnergyReportType
|
|
12
|
+
* Create a EnergyReport instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {EnergyReportType} energyReport - The energyReport object of type EnergyReport.
|
|
15
|
+
*/
|
|
16
|
+
constructor(energyReport) {
|
|
17
|
+
super(energyReport);
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class EnergyReportShard extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/EnergyReportShardSchema").EnergyReportShard} EnergyReportShardType
|
|
12
|
+
* Create a EnergyReportShard instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {EnergyReportShardType} energyReportShard - The energyReportShard object of type EnergyReportShard.
|
|
15
|
+
*/
|
|
16
|
+
constructor(energyReportShard) {
|
|
17
|
+
super(energyReportShard);
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class Gateway extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/GatewaySchema").Gateway} GatewayType
|
|
12
|
+
* Create a Gateway instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {GatewayType} gateway - The gateway object of type Gateway.
|
|
15
|
+
*/
|
|
16
|
+
constructor(gateway) {
|
|
17
|
+
super(gateway);
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -6,8 +6,14 @@ schemas.add(schema);
|
|
|
6
6
|
const validator = schemas.compile(schema);
|
|
7
7
|
|
|
8
8
|
class Identification extends Kohost {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {import("../schemas/IdentificationSchema").Identification} IdentificationType
|
|
11
|
+
* Create a Identification instance.
|
|
12
|
+
* @constructor
|
|
13
|
+
* @param {IdentificationType} identification - The identification object of type Identification.
|
|
14
|
+
*/
|
|
15
|
+
constructor(identification) {
|
|
16
|
+
super(identification);
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
get isExpired() {
|
package/dist/cjs/Models/Lock.js
CHANGED
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class Lock extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/LockSchema").Lock} LockType
|
|
12
|
+
* Create a Lock instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {LockType} lock - The lock object of type Lock.
|
|
15
|
+
*/
|
|
16
|
+
constructor(lock) {
|
|
17
|
+
super(lock);
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class MediaFile extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/MediaFileSchema").MediaFile} MediaFileType
|
|
12
|
+
* Create a MediaFile instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {MediaFileType} mediaFile - The mediaFile object of type MediaFile.
|
|
15
|
+
*/
|
|
16
|
+
constructor(mediaFile) {
|
|
17
|
+
super(mediaFile);
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
createImageVariant(params) {
|
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class MediaSource extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/MediaSourceSchema").MediaSource} MediaSourceType
|
|
12
|
+
* Create a MediaSource instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {MediaSourceType} mediaSource - The mediaSource object of type MediaSource.
|
|
15
|
+
*/
|
|
16
|
+
constructor(mediaSource) {
|
|
17
|
+
super(mediaSource);
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class MotionSensor extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/MotionSensorSchema").MotionSensor} MotionSensorType
|
|
12
|
+
* Create a MotionSensor instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {MotionSensorType} motionSensor - The motionSensor object of type MotionSensor.
|
|
15
|
+
*/
|
|
16
|
+
constructor(motionSensor) {
|
|
17
|
+
super(motionSensor);
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -6,8 +6,14 @@ schemas.add(schema);
|
|
|
6
6
|
const validator = schemas.compile(schema);
|
|
7
7
|
|
|
8
8
|
class Organization extends Kohost {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {import("../schemas/OrganizationSchema").Organization} OrganizationType
|
|
11
|
+
* Create a Organization instance.
|
|
12
|
+
* @constructor
|
|
13
|
+
* @param {OrganizationType} organization - The organization object of type Organization.
|
|
14
|
+
*/
|
|
15
|
+
constructor(organization) {
|
|
16
|
+
super(organization);
|
|
11
17
|
}
|
|
12
18
|
}
|
|
13
19
|
|
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class Product extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/ProductSchema").Product} ProductType
|
|
12
|
+
* Create a Product instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {ProductType} product - The product object of type Product.
|
|
15
|
+
*/
|
|
16
|
+
constructor(product) {
|
|
17
|
+
super(product);
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -6,8 +6,14 @@ schemas.add(schema);
|
|
|
6
6
|
const validator = schemas.compile(schema);
|
|
7
7
|
|
|
8
8
|
class Property extends Kohost {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {import("../schemas/PropertySchema").Property} PropertyType
|
|
11
|
+
* Create a Property instance.
|
|
12
|
+
* @constructor
|
|
13
|
+
* @param {PropertyType} property - The property object of type Property.
|
|
14
|
+
*/
|
|
15
|
+
constructor(property) {
|
|
16
|
+
super(property);
|
|
11
17
|
}
|
|
12
18
|
}
|
|
13
19
|
|
|
@@ -6,8 +6,14 @@ schemas.add(schema);
|
|
|
6
6
|
const validator = schemas.compile(schema);
|
|
7
7
|
|
|
8
8
|
class Reservation extends Kohost {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {import("../schemas/ReservationSchema").Reservation} ReservationType
|
|
11
|
+
* Create a Reservation instance.
|
|
12
|
+
* @constructor
|
|
13
|
+
* @param {ReservationType} reservation - The reservation object of type Reservation.
|
|
14
|
+
*/
|
|
15
|
+
constructor(reservation) {
|
|
16
|
+
super(reservation);
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
get peopleCount() {
|
|
@@ -81,17 +87,17 @@ class Reservation extends Kohost {
|
|
|
81
87
|
}
|
|
82
88
|
}
|
|
83
89
|
|
|
84
|
-
Object.
|
|
90
|
+
Object.defineReservation(Reservation.prototype, "schema", {
|
|
85
91
|
value: schema,
|
|
86
92
|
});
|
|
87
93
|
|
|
88
|
-
Object.
|
|
94
|
+
Object.defineReservation(Reservation.prototype, "validator", {
|
|
89
95
|
get: function () {
|
|
90
96
|
return validator;
|
|
91
97
|
},
|
|
92
98
|
});
|
|
93
99
|
|
|
94
|
-
Object.
|
|
100
|
+
Object.defineReservation(Reservation, "validProperties", {
|
|
95
101
|
value: Object.keys(schema.properties),
|
|
96
102
|
});
|
|
97
103
|
|
package/dist/cjs/Models/Room.js
CHANGED
|
@@ -24,8 +24,14 @@ schemas.add(schema);
|
|
|
24
24
|
const validator = schemas.compile(schema);
|
|
25
25
|
|
|
26
26
|
class Room extends Kohost {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
/**
|
|
28
|
+
* @typedef {import("../schemas/RoomSchema").Room} RoomType
|
|
29
|
+
* Create a Room instance.
|
|
30
|
+
* @constructor
|
|
31
|
+
* @param {RoomType} room - The room object of type Room.
|
|
32
|
+
*/
|
|
33
|
+
constructor(room) {
|
|
34
|
+
const roomData = mapRoomData(room);
|
|
29
35
|
super(roomData);
|
|
30
36
|
}
|
|
31
37
|
|
package/dist/cjs/Models/Scene.js
CHANGED
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class Scene extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/SceneSchema").Scene} SceneType
|
|
12
|
+
* Create a Scene instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {SceneType} scene - The scene object of type Scene.
|
|
15
|
+
*/
|
|
16
|
+
constructor(scene) {
|
|
17
|
+
super(scene);
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
static createSceneCommandPayload(room, scene, restore) {
|
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class ShortLink extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/ShortLinkSchema").ShortLink} ShortLinkType
|
|
12
|
+
* Create a ShortLink instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {ShortLinkType} shortlink - The shortlink object of type ShortLink.
|
|
15
|
+
*/
|
|
16
|
+
constructor(shortlink) {
|
|
17
|
+
super(shortlink);
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class SMSMessage extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/SmsMessageSchema").SmsMessage} SmsMessageType
|
|
12
|
+
* Create a SmsMessage instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {SmsMessageType} message - The message object of type SmsMessage.
|
|
15
|
+
*/
|
|
16
|
+
constructor(message) {
|
|
17
|
+
super(message);
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
|
package/dist/cjs/Models/Space.js
CHANGED
|
@@ -11,10 +11,10 @@ const validator = schemas.compile(schema);
|
|
|
11
11
|
|
|
12
12
|
class Space extends Kohost {
|
|
13
13
|
/**
|
|
14
|
-
* @typedef {import("../schemas/SpaceSchema").Space}
|
|
15
|
-
* Create a
|
|
14
|
+
* @typedef {import("../schemas/SpaceSchema").Space} SpaceType
|
|
15
|
+
* Create a Space instance.
|
|
16
16
|
* @constructor
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {SpaceType} space - The space object of type Space.
|
|
18
18
|
*/
|
|
19
19
|
constructor(space) {
|
|
20
20
|
const spaceData = mapSpaceData(space);
|
|
@@ -8,8 +8,14 @@ schemas.add(schema);
|
|
|
8
8
|
const validator = schemas.compile(schema);
|
|
9
9
|
|
|
10
10
|
class SpaceType extends Kohost {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {import("../schemas/SpaceTypeSchema").SpaceType} SpaceTypeType
|
|
13
|
+
* Create a SpaceType instance.
|
|
14
|
+
* @constructor
|
|
15
|
+
* @param {SpaceTypeType} spaceType - The spaceType object of type SpaceType.
|
|
16
|
+
*/
|
|
17
|
+
constructor(spaceType) {
|
|
18
|
+
super(spaceType);
|
|
13
19
|
}
|
|
14
20
|
}
|
|
15
21
|
|
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class Switch extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/SwitchSchema").Switch} SwitchType
|
|
12
|
+
* Create a Switch instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {SwitchType} _switch - The _switch object of type Switch.
|
|
15
|
+
*/
|
|
16
|
+
constructor(_switch) {
|
|
17
|
+
super(_switch);
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -8,8 +8,15 @@ schemas.add(schema);
|
|
|
8
8
|
const validator = schemas.compile(schema);
|
|
9
9
|
|
|
10
10
|
class SystemUser extends Kohost {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {import("../schemas/SystemUserSchema").SystemUser} SystemUserType
|
|
13
|
+
* Create a SystemUser instance.
|
|
14
|
+
* @constructor
|
|
15
|
+
* @param {SystemUserType} user - The user object of type SystemUser.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
constructor(user) {
|
|
19
|
+
super(user);
|
|
13
20
|
}
|
|
14
21
|
|
|
15
22
|
static validatePhone(phoneNumber) {
|
|
@@ -6,8 +6,14 @@ schemas.add(schema);
|
|
|
6
6
|
const validator = schemas.compile(schema);
|
|
7
7
|
|
|
8
8
|
class Thermostat extends Kohost {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {import("../schemas/ThermostatSchema").Thermostat} ThermostatType
|
|
11
|
+
* Create a Thermostat instance.
|
|
12
|
+
* @constructor
|
|
13
|
+
* @param {ThermostatType} thermostat - The thermostat object of type Thermostat.
|
|
14
|
+
*/
|
|
15
|
+
constructor(thermostat) {
|
|
16
|
+
super(thermostat);
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
toCelsius() {
|
|
@@ -14,8 +14,14 @@ schemas.add(schema);
|
|
|
14
14
|
const validator = schemas.compile(schema);
|
|
15
15
|
|
|
16
16
|
class Ticket extends Kohost {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* @typedef {import("../schemas/TicketSchema").Ticket} TicketType
|
|
19
|
+
* Create a Ticket instance.
|
|
20
|
+
* @constructor
|
|
21
|
+
* @param {TicketType} ticket - The ticket object of type Ticket.
|
|
22
|
+
*/
|
|
23
|
+
constructor(ticket) {
|
|
24
|
+
const ticketData = mapConversationData(ticket);
|
|
19
25
|
super(ticketData);
|
|
20
26
|
}
|
|
21
27
|
|
package/dist/cjs/Models/User.js
CHANGED
|
@@ -14,11 +14,17 @@ schemas.add(schema);
|
|
|
14
14
|
const validator = schemas.compile(schema);
|
|
15
15
|
|
|
16
16
|
class User extends Kohost {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
/**
|
|
18
|
+
* @typedef {import("../schemas/UserSchema").User} UserType
|
|
19
|
+
* Create a User instance.
|
|
20
|
+
* @constructor
|
|
21
|
+
* @param {UserType} user - The user object of type User.
|
|
22
|
+
*/
|
|
23
|
+
constructor(user) {
|
|
24
|
+
if (user.photo) user.photo = new MediaFile(user.photo);
|
|
25
|
+
if (user.reservations)
|
|
26
|
+
user.reservations = user.reservations.map((res) => new Reservation(res));
|
|
27
|
+
super(user);
|
|
22
28
|
}
|
|
23
29
|
|
|
24
30
|
static validatePhone(phoneNumber) {
|
|
@@ -7,8 +7,14 @@ schemas.add(schema);
|
|
|
7
7
|
const validator = schemas.compile(schema);
|
|
8
8
|
|
|
9
9
|
class WindowCovering extends Kohost {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("../schemas/WindowCoveringSchema").WindowCovering} WindowCoveringType
|
|
12
|
+
* Create a WindowCovering instance.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {WindowCoveringType} windowCovering - The windowCovering object of type WindowCovering.
|
|
15
|
+
*/
|
|
16
|
+
constructor(windowCovering) {
|
|
17
|
+
super(windowCovering);
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
static getActionDelta(old, _new) {
|
package/dist/esm/Events.js
CHANGED
|
@@ -287,6 +287,28 @@ var require_SystemCourtesyUpdatedEvent = __commonJS({
|
|
|
287
287
|
}
|
|
288
288
|
});
|
|
289
289
|
|
|
290
|
+
// src/Events/SystemAlarmUpdatedEvent.js
|
|
291
|
+
var require_SystemAlarmUpdatedEvent = __commonJS({
|
|
292
|
+
"src/Events/SystemAlarmUpdatedEvent.js"(exports, module) {
|
|
293
|
+
var Event = require_Event();
|
|
294
|
+
var SystemAlarmUpdatedEvent = class extends Event {
|
|
295
|
+
static {
|
|
296
|
+
__name(this, "SystemAlarmUpdatedEvent");
|
|
297
|
+
}
|
|
298
|
+
constructor(alarm) {
|
|
299
|
+
super(alarm);
|
|
300
|
+
}
|
|
301
|
+
get name() {
|
|
302
|
+
return "SystemAlarmUpdated";
|
|
303
|
+
}
|
|
304
|
+
get routingKey() {
|
|
305
|
+
return `alarm.${this.keyId}.updated`;
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
module.exports = SystemAlarmUpdatedEvent;
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
|
|
290
312
|
// src/Events/SystemMotionSensorUpdatedEvent.js
|
|
291
313
|
var require_SystemMotionSensorUpdatedEvent = __commonJS({
|
|
292
314
|
"src/Events/SystemMotionSensorUpdatedEvent.js"(exports, module) {
|
|
@@ -544,6 +566,7 @@ var require_Events = __commonJS({
|
|
|
544
566
|
var SystemWindowCoveringUpdatedEvent = require_SystemWindowCoveringUpdatedEvent();
|
|
545
567
|
var SystemMediaSourceUpdatedEvent = require_SystemMediaSourceUpdatedEvent();
|
|
546
568
|
var SystemCourtesyUpdatedEvent = require_SystemCourtesyUpdatedEvent();
|
|
569
|
+
var SystemAlarmUpdatedEvent = require_SystemAlarmUpdatedEvent();
|
|
547
570
|
var SystemMotionSensorUpdatedEvent = require_SystemMotionSensorUpdatedEvent();
|
|
548
571
|
var SystemUserUpdatedEvent = require_SystemUserUpdatedEvent();
|
|
549
572
|
var SystemSpaceUpdatedEvent = require_SystemSpaceUpdatedEvent();
|
|
@@ -556,6 +579,7 @@ var require_Events = __commonJS({
|
|
|
556
579
|
var ApplicationInUseEvent = require_ApplicationInUseEvent();
|
|
557
580
|
var ApplicationOutOfUseEvent = require_ApplicationOutOfUseEvent();
|
|
558
581
|
module.exports = {
|
|
582
|
+
SystemAlarmUpdatedEvent,
|
|
559
583
|
SystemGatewayUpdatedEvent,
|
|
560
584
|
SystemThermostatUpdatedEvent,
|
|
561
585
|
SystemDimmerUpdatedEvent,
|