@kohost/api-client 3.0.0-beta.96 → 3.0.0-beta.98

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 (45) hide show
  1. package/dist/cjs/Events/ApplicationInUseEvent.js +10 -3
  2. package/dist/cjs/Events/ApplicationOutOfUseEvent.js +10 -3
  3. package/dist/cjs/Models/Alarm.js +2 -2
  4. package/dist/cjs/Models/Announcement.js +2 -2
  5. package/dist/cjs/Models/Camera.js +2 -2
  6. package/dist/cjs/Models/Category.js +2 -2
  7. package/dist/cjs/Models/Courtesy.js +2 -2
  8. package/dist/cjs/Models/Credential.js +2 -2
  9. package/dist/cjs/Models/DeviceRouter.js +2 -2
  10. package/dist/cjs/Models/Dimmer.js +3 -3
  11. package/dist/cjs/Models/DiscoveredDevice.js +2 -2
  12. package/dist/cjs/Models/EmailMessage.js +2 -2
  13. package/dist/cjs/Models/EnergyReport.js +2 -2
  14. package/dist/cjs/Models/EnergyReportShard.js +2 -2
  15. package/dist/cjs/Models/{Kohost.js → Entity.js} +2 -2
  16. package/dist/cjs/Models/Gateway.js +2 -2
  17. package/dist/cjs/Models/Identification.js +2 -2
  18. package/dist/cjs/Models/Lock.js +2 -2
  19. package/dist/cjs/Models/MediaFile.js +2 -2
  20. package/dist/cjs/Models/MediaSource.js +2 -2
  21. package/dist/cjs/Models/MotionSensor.js +2 -2
  22. package/dist/cjs/Models/Order.js +2 -2
  23. package/dist/cjs/Models/Organization.js +2 -2
  24. package/dist/cjs/Models/Product.js +2 -2
  25. package/dist/cjs/Models/Property.js +2 -2
  26. package/dist/cjs/Models/Reservation.js +2 -2
  27. package/dist/cjs/Models/Room.js +2 -2
  28. package/dist/cjs/Models/Scene.js +2 -2
  29. package/dist/cjs/Models/ShortLink.js +2 -2
  30. package/dist/cjs/Models/SmsMessage.js +2 -2
  31. package/dist/cjs/Models/Space.js +2 -2
  32. package/dist/cjs/Models/Switch.js +2 -2
  33. package/dist/cjs/Models/SystemUser.js +2 -2
  34. package/dist/cjs/Models/Thermostat.js +2 -2
  35. package/dist/cjs/Models/Ticket.js +2 -2
  36. package/dist/cjs/Models/User.js +2 -2
  37. package/dist/cjs/Models/WindowCovering.js +2 -2
  38. package/dist/cjs/Models/index.js +3 -0
  39. package/dist/cjs/schemas/CredentialSchema.d.ts +1 -1
  40. package/dist/cjs/schemas/credential.json +8 -1
  41. package/dist/esm/Events.js +24 -6
  42. package/dist/esm/Events.js.map +2 -2
  43. package/dist/esm/Models.js +84 -75
  44. package/dist/esm/Models.js.map +3 -3
  45. package/package.json +1 -1
@@ -1,8 +1,14 @@
1
1
  const Event = require("./Event");
2
2
 
3
3
  class ApplicationInUseEvent extends Event {
4
- constructor({ propertyId }) {
5
- super({ propertyId });
4
+ constructor({ propertyId, organizationId, ...rest }) {
5
+ if (!propertyId && !organizationId)
6
+ throw new Error(
7
+ "propertyId or organizationId required for ApplicationInUseEvent"
8
+ );
9
+ super({ propertyId, organizationId, ...rest });
10
+ this._propertyId = propertyId;
11
+ this._organizationId = organizationId;
6
12
  }
7
13
 
8
14
  get name() {
@@ -14,7 +20,8 @@ class ApplicationInUseEvent extends Event {
14
20
  }
15
21
 
16
22
  get routingKey() {
17
- return `app.${this.data[0].propertyId}.inUse`;
23
+ if (this._propertyId) return `app.${this._propertyId}.inUse`;
24
+ else return `app.org.${this._organizationId}.inUse`;
18
25
  }
19
26
  }
20
27
 
@@ -1,8 +1,14 @@
1
1
  const Event = require("./Event");
2
2
 
3
3
  class ApplicationOutOfUseEvent extends Event {
4
- constructor({ propertyId }) {
5
- super({ propertyId });
4
+ constructor({ propertyId, organizationId, ...rest }) {
5
+ if (!propertyId && !organizationId)
6
+ throw new Error(
7
+ "propertyId or organizationId required for ApplicationOutOfUseEvent"
8
+ );
9
+ super({ propertyId, organizationId, ...rest });
10
+ this._propertyId = propertyId;
11
+ this._organizationId = organizationId;
6
12
  }
7
13
 
8
14
  get name() {
@@ -14,7 +20,8 @@ class ApplicationOutOfUseEvent extends Event {
14
20
  }
15
21
 
16
22
  get routingKey() {
17
- return `app.${this.data[0].propertyId}.notInUse`;
23
+ if (this._propertyId) return `app.${this._propertyId}.outOfUse`;
24
+ else return `app.org.${this._organizationId}.outOfUse`;
18
25
  }
19
26
  }
20
27
 
@@ -1,12 +1,12 @@
1
1
  // create the Alarm Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/alarm.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class Alarm extends Kohost {
9
+ class Alarm extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/AlarmSchema").Alarm} AlarmType
12
12
  * Create a Alarm instance.
@@ -1,11 +1,11 @@
1
1
  const schemas = require("../utils/schema");
2
2
  const schema = require("../schemas/announcement.json");
3
- const Kohost = require("./Kohost");
3
+ const Entity = require("./Entity");
4
4
 
5
5
  schemas.add(schema);
6
6
  const validator = schemas.compile(schema);
7
7
 
8
- class Announcement extends Kohost {
8
+ class Announcement extends Entity {
9
9
  /**
10
10
  * @typedef {import("../schemas/AnnouncementSchema").Announcement} AnnouncementType
11
11
  * Create a Announcement instance.
@@ -1,12 +1,12 @@
1
1
  // create the Camera Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/camera.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class Camera extends Kohost {
9
+ class Camera extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/CameraSchema").Camera} CameraType
12
12
  * Create a Camera instance.
@@ -2,12 +2,12 @@
2
2
  // Originally used for hotel room category e.g. Double Queen
3
3
  const schemas = require("../utils/schema");
4
4
  const schema = require("../schemas/category.json");
5
- const Kohost = require("./Kohost");
5
+ const Entity = require("./Entity");
6
6
 
7
7
  schemas.add(schema);
8
8
  const validator = schemas.compile(schema);
9
9
 
10
- class Category extends Kohost {
10
+ class Category extends Entity {
11
11
  /**
12
12
  * @typedef {import("../schemas/CategorySchema").Category} CategoryType
13
13
  * Create a Category instance.
@@ -1,12 +1,12 @@
1
1
  // create the Courtesy Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/courtesy.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class Courtesy extends Kohost {
9
+ class Courtesy extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/CourtesySchema").Courtesy} CourtesyType
12
12
  * Create a Courtesy instance.
@@ -1,12 +1,12 @@
1
1
  // create the Credential Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/credential.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class Credential extends Kohost {
9
+ class Credential extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/CredentialSchema").Credential} CredentialType
12
12
  * Create a Credential instance.
@@ -2,12 +2,12 @@
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/deviceRouter.json");
4
4
 
5
- const Kohost = require("./Kohost");
5
+ const Entity = require("./Entity");
6
6
 
7
7
  schemas.add(schema);
8
8
  const validator = schemas.compile(schema);
9
9
 
10
- class DeviceRouter extends Kohost {
10
+ class DeviceRouter extends Entity {
11
11
  /**
12
12
  * @typedef {import("../schemas/DeviceRouterSchema").DeviceRouter} DeviceRouterType
13
13
  * Create a DeviceRouter instance.
@@ -1,7 +1,7 @@
1
1
  // Create the Dimmer Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/dimmer.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
@@ -9,10 +9,10 @@ const validator = schemas.compile(schema);
9
9
  /**
10
10
  * Represents a Dimmer device.
11
11
  * @class
12
- * @extends Kohost
12
+ * @extends Entity
13
13
  */
14
14
 
15
- class Dimmer extends Kohost {
15
+ class Dimmer extends Entity {
16
16
  /**
17
17
  * @typedef {import("../schemas/DimmerSchema").Dimmer} DimmerType
18
18
  * Create a Dimmer instance.
@@ -2,12 +2,12 @@
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/discoveredDevice.json");
4
4
 
5
- const Kohost = require("./Kohost");
5
+ const Entity = require("./Entity");
6
6
 
7
7
  schemas.add(schema);
8
8
  const validator = schemas.compile(schema);
9
9
 
10
- class DiscoveredDevice extends Kohost {
10
+ class DiscoveredDevice extends Entity {
11
11
  /**
12
12
  * @typedef {import("../schemas/DiscoveredDeviceSchema").DiscoveredDevice} DiscoveredDeviceType
13
13
  * Create a DiscoveredDevice instance.
@@ -1,12 +1,12 @@
1
1
  // Create the SMS Message Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/emailMessage.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class EmailMessage extends Kohost {
9
+ class EmailMessage extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/EmailMessageSchema").EmailMessage} EmailMessageType
12
12
  * Create a EmailMessage instance.
@@ -1,12 +1,12 @@
1
1
  // create the energyReportDaily Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/energyReport.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class EnergyReport extends Kohost {
9
+ class EnergyReport extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/EnergyReportSchema").EnergyReport} EnergyReportType
12
12
  * Create a EnergyReport instance.
@@ -1,12 +1,12 @@
1
1
  // create the energyReportShard Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/energyReportShard.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class EnergyReportShard extends Kohost {
9
+ class EnergyReportShard extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/EnergyReportShardSchema").EnergyReportShard} EnergyReportShardType
12
12
  * Create a EnergyReportShard instance.
@@ -1,7 +1,7 @@
1
1
  const { ValidationError } = require("../Errors");
2
2
  const { customAlphabet: generate } = require("nanoid");
3
3
 
4
- class Kohost {
4
+ class Entity {
5
5
  constructor(data) {
6
6
  if (!this.schema) {
7
7
  throw new Error("Schema is not defined");
@@ -93,4 +93,4 @@ class Kohost {
93
93
  }
94
94
  }
95
95
 
96
- module.exports = Kohost;
96
+ module.exports = Entity;
@@ -1,12 +1,12 @@
1
1
  // Create the Gateway Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/gateway.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class Gateway extends Kohost {
9
+ class Gateway extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/GatewaySchema").Gateway} GatewayType
12
12
  * Create a Gateway instance.
@@ -1,11 +1,11 @@
1
1
  const schemas = require("../utils/schema");
2
2
  const schema = require("../schemas/identification.json");
3
- const Kohost = require("./Kohost");
3
+ const Entity = require("./Entity");
4
4
 
5
5
  schemas.add(schema);
6
6
  const validator = schemas.compile(schema);
7
7
 
8
- class Identification extends Kohost {
8
+ class Identification extends Entity {
9
9
  /**
10
10
  * @typedef {import("../schemas/IdentificationSchema").Identification} IdentificationType
11
11
  * Create a Identification instance.
@@ -1,12 +1,12 @@
1
1
  // Create the Lock Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/lock.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class Lock extends Kohost {
9
+ class Lock extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/LockSchema").Lock} LockType
12
12
  * Create a Lock instance.
@@ -1,12 +1,12 @@
1
1
  const schemas = require("../utils/schema");
2
2
  const schema = require("../schemas/mediaFile.json");
3
- const Kohost = require("./Kohost");
3
+ const Entity = require("./Entity");
4
4
  const { RequestError } = require("../Errors");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class MediaFile extends Kohost {
9
+ class MediaFile extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/MediaFileSchema").MediaFile} MediaFileType
12
12
  * Create a MediaFile instance.
@@ -1,12 +1,12 @@
1
1
  // create the Media Source Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/mediaSource.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class MediaSource extends Kohost {
9
+ class MediaSource extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/MediaSourceSchema").MediaSource} MediaSourceType
12
12
  * Create a MediaSource instance.
@@ -1,12 +1,12 @@
1
1
  // create the Motion Sensor Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/motionSensor.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class MotionSensor extends Kohost {
9
+ class MotionSensor extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/MotionSensorSchema").MotionSensor} MotionSensorType
12
12
  * Create a MotionSensor instance.
@@ -1,11 +1,11 @@
1
1
  const schemas = require("../utils/schema");
2
2
  const schema = require("../schemas/order.json");
3
- const Kohost = require("./Kohost");
3
+ const Entity = require("./Entity");
4
4
 
5
5
  schemas.add(schema);
6
6
  const validator = schemas.compile(schema);
7
7
 
8
- class Order extends Kohost {
8
+ class Order extends Entity {
9
9
  /**
10
10
  * @typedef {import("../schemas/OrderSchema").Order} OrderType
11
11
  * Create a Order instance.
@@ -1,11 +1,11 @@
1
1
  const schemas = require("../utils/schema");
2
2
  const schema = require("../schemas/organization.json");
3
- const Kohost = require("./Kohost");
3
+ const Entity = require("./Entity");
4
4
 
5
5
  schemas.add(schema);
6
6
  const validator = schemas.compile(schema);
7
7
 
8
- class Organization extends Kohost {
8
+ class Organization extends Entity {
9
9
  /**
10
10
  * @typedef {import("../schemas/OrganizationSchema").Organization} OrganizationType
11
11
  * Create a Organization instance.
@@ -1,12 +1,12 @@
1
1
  // Create the Product Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/product.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class Product extends Kohost {
9
+ class Product extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/ProductSchema").Product} ProductType
12
12
  * Create a Product instance.
@@ -1,11 +1,11 @@
1
1
  const schemas = require("../utils/schema");
2
2
  const schema = require("../schemas/property.json");
3
- const Kohost = require("./Kohost");
3
+ const Entity = require("./Entity");
4
4
 
5
5
  schemas.add(schema);
6
6
  const validator = schemas.compile(schema);
7
7
 
8
- class Property extends Kohost {
8
+ class Property extends Entity {
9
9
  /**
10
10
  * @typedef {import("../schemas/PropertySchema").Property} PropertyType
11
11
  * Create a Property instance.
@@ -1,11 +1,11 @@
1
1
  const schemas = require("../utils/schema");
2
2
  const schema = require("../schemas/reservation.json");
3
- const Kohost = require("./Kohost");
3
+ const Entity = require("./Entity");
4
4
 
5
5
  schemas.add(schema);
6
6
  const validator = schemas.compile(schema);
7
7
 
8
- class Reservation extends Kohost {
8
+ class Reservation extends Entity {
9
9
  /**
10
10
  * @typedef {import("../schemas/ReservationSchema").Reservation} ReservationType
11
11
  * Create a Reservation instance.
@@ -2,7 +2,7 @@
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/room.json");
4
4
  const deviceSchema = require("../schemas/definitions.json");
5
- const Kohost = require("./Kohost");
5
+ const Entity = require("./Entity");
6
6
 
7
7
  // device dependencies
8
8
  const Switch = require("./Switch");
@@ -22,7 +22,7 @@ const Scene = require("./Scene");
22
22
  schemas.add(schema);
23
23
  const validator = schemas.compile(schema);
24
24
 
25
- class Room extends Kohost {
25
+ class Room extends Entity {
26
26
  /**
27
27
  * @typedef {import("../schemas/RoomSchema").Room} RoomType
28
28
  * Create a Room instance.
@@ -1,11 +1,11 @@
1
1
  const schemas = require("../utils/schema");
2
2
  const schema = require("../schemas/scene.json");
3
- const Kohost = require("./Kohost");
3
+ const Entity = require("./Entity");
4
4
 
5
5
  schemas.add(schema);
6
6
  const validator = schemas.compile(schema);
7
7
 
8
- class Scene extends Kohost {
8
+ class Scene extends Entity {
9
9
  /**
10
10
  * @typedef {import("../schemas/SceneSchema").Scene} SceneType
11
11
  * Create a Scene instance.
@@ -1,12 +1,12 @@
1
1
  // Create the Lock Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/shortLink.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class ShortLink extends Kohost {
9
+ class ShortLink extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/ShortLinkSchema").ShortLink} ShortLinkType
12
12
  * Create a ShortLink instance.
@@ -1,12 +1,12 @@
1
1
  // Create the SMS Message Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/smsMessage.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class SMSMessage extends Kohost {
9
+ class SMSMessage extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/SmsMessageSchema").SmsMessage} SmsMessageType
12
12
  * Create a SmsMessage instance.
@@ -2,14 +2,14 @@
2
2
  // A group of rooms -> rooms could become a space later...
3
3
  const schemas = require("../utils/schema");
4
4
  const schema = require("../schemas/space.json");
5
- const Kohost = require("./Kohost");
5
+ const Entity = require("./Entity");
6
6
 
7
7
  const Room = require("./Room");
8
8
 
9
9
  schemas.add(schema);
10
10
  const validator = schemas.compile(schema);
11
11
 
12
- class Space extends Kohost {
12
+ class Space extends Entity {
13
13
  /**
14
14
  * @typedef {import("../schemas/SpaceSchema").Space} SpaceType
15
15
  * Create a Space instance.
@@ -1,12 +1,12 @@
1
1
  // create the Switch model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/switch.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class Switch extends Kohost {
9
+ class Switch extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/SwitchSchema").Switch} SwitchType
12
12
  * Create a Switch instance.
@@ -1,13 +1,13 @@
1
1
  // Create the User Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/systemUser.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
 
8
8
  const validator = schemas.compile(schema);
9
9
 
10
- class SystemUser extends Kohost {
10
+ class SystemUser extends Entity {
11
11
  /**
12
12
  * @typedef {import("../schemas/SystemUserSchema").SystemUser} SystemUserType
13
13
  * Create a SystemUser instance.
@@ -1,11 +1,11 @@
1
1
  const schemas = require("../utils/schema");
2
2
  const schema = require("../schemas/thermostat.json");
3
- const Kohost = require("./Kohost");
3
+ const Entity = require("./Entity");
4
4
 
5
5
  schemas.add(schema);
6
6
  const validator = schemas.compile(schema);
7
7
 
8
- class Thermostat extends Kohost {
8
+ class Thermostat extends Entity {
9
9
  /**
10
10
  * @typedef {import("../schemas/ThermostatSchema").Thermostat} ThermostatType
11
11
  * Create a Thermostat instance.
@@ -1,7 +1,7 @@
1
1
  // Create the User Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/ticket.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
  const MediaFile = require("./MediaFile");
6
6
 
7
7
  const { nanoid } = require("nanoid");
@@ -9,7 +9,7 @@ const { nanoid } = require("nanoid");
9
9
  schemas.add(schema);
10
10
  const validator = schemas.compile(schema);
11
11
 
12
- class Ticket extends Kohost {
12
+ class Ticket extends Entity {
13
13
  /**
14
14
  * @typedef {import("../schemas/TicketSchema").Ticket} TicketType
15
15
  * Create a Ticket instance.
@@ -2,7 +2,7 @@
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/user.json");
4
4
  const paymentSchema = require("../schemas/payment.json");
5
- const Kohost = require("./Kohost");
5
+ const Entity = require("./Entity");
6
6
  const MediaFile = require("./MediaFile");
7
7
  const Reservation = require("./Reservation");
8
8
  const Identification = require("./Identification");
@@ -14,7 +14,7 @@ schemas.add(schema);
14
14
 
15
15
  const validator = schemas.compile(schema);
16
16
 
17
- class User extends Kohost {
17
+ class User extends Entity {
18
18
  /**
19
19
  * @typedef {import("../schemas/UserSchema").User} UserType
20
20
  * Create a User instance.
@@ -1,12 +1,12 @@
1
1
  // Create the WindowCovering Model
2
2
  const schemas = require("../utils/schema");
3
3
  const schema = require("../schemas/windowCovering.json");
4
- const Kohost = require("./Kohost");
4
+ const Entity = require("./Entity");
5
5
 
6
6
  schemas.add(schema);
7
7
  const validator = schemas.compile(schema);
8
8
 
9
- class WindowCovering extends Kohost {
9
+ class WindowCovering extends Entity {
10
10
  /**
11
11
  * @typedef {import("../schemas/WindowCoveringSchema").WindowCovering} WindowCoveringType
12
12
  * Create a WindowCovering instance.
@@ -36,7 +36,10 @@ const Announcement = require("./Announcement");
36
36
  const Property = require("./Property");
37
37
  const Organization = require("./Organization");
38
38
 
39
+ const Entity = require("./Entity");
40
+
39
41
  module.exports = {
42
+ Entity,
40
43
  Organization,
41
44
  Property,
42
45
  MediaFile,
@@ -36,7 +36,7 @@ export interface Credential {
36
36
  | "cloudflare-images"
37
37
  | "cloudflare-stream"
38
38
  | "insperia-privacy";
39
- discriminator?: "verificationCode" | "token" | "mobileKey" | "pin";
39
+ discriminator?: "verificationCode" | "token" | "mobileKey" | "pin" | "publicKey" | "id";
40
40
  credential: string;
41
41
  user?: string;
42
42
  organization?: string;