@kohost/api-client 3.0.0-beta.93 → 3.0.0-beta.95

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.
@@ -0,0 +1,36 @@
1
+ // Create the Device Router Model
2
+ const schemas = require("../utils/schema");
3
+ const schema = require("../schemas/deviceRouter.json");
4
+
5
+ const Kohost = require("./Kohost");
6
+
7
+ schemas.add(schema);
8
+ const validator = schemas.compile(schema);
9
+
10
+ class DeviceRouter extends Kohost {
11
+ /**
12
+ * @typedef {import("../schemas/DeviceRouterSchema").DeviceRouter} DeviceRouterType
13
+ * Create a DeviceRouter instance.
14
+ * @constructor
15
+ * @param {DeviceRouterType} device - The device object of type DeviceRouter.
16
+ */
17
+ constructor(device) {
18
+ super(device);
19
+ }
20
+ }
21
+
22
+ Object.defineProperty(DeviceRouter.prototype, "schema", {
23
+ value: schema,
24
+ });
25
+
26
+ Object.defineProperty(DeviceRouter.prototype, "validator", {
27
+ get: function () {
28
+ return validator;
29
+ },
30
+ });
31
+
32
+ Object.defineProperty(DeviceRouter, "validProperties", {
33
+ value: Object.keys(schema.properties),
34
+ });
35
+
36
+ module.exports = DeviceRouter;
@@ -24,6 +24,7 @@ const Gateway = require("./Gateway");
24
24
  const Product = require("./Product");
25
25
  const Order = require("./Order");
26
26
  const DiscoveredDevice = require("./DiscoveredDevice");
27
+ const DeviceRouter = require("./DeviceRouter");
27
28
  const Credential = require("./Credential");
28
29
  const ShortLink = require("./ShortLink");
29
30
  const EnergyReportShard = require("./EnergyReportShard");
@@ -60,6 +61,7 @@ module.exports = {
60
61
  Ticket,
61
62
  Scene,
62
63
  DiscoveredDevice,
64
+ DeviceRouter,
63
65
  Reservation,
64
66
  Credential,
65
67
  ShortLink,
@@ -0,0 +1,23 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ /**
9
+ * A device router contains instructions on where to route devices based on their organization and driver.
10
+ */
11
+ export interface DeviceRouter {
12
+ id?: string;
13
+ type?: string;
14
+ driver?: string;
15
+ /**
16
+ * Reference (id) to the organization that owns this router
17
+ */
18
+ organization?: string | null;
19
+ devices?: {
20
+ [k: string]: unknown;
21
+ };
22
+ [k: string]: unknown;
23
+ }
@@ -35,5 +35,9 @@ export interface DiscoveredDevice {
35
35
  [k: string]: unknown;
36
36
  };
37
37
  ignore?: boolean;
38
+ /**
39
+ * Reference (id) to the organization that owns this device
40
+ */
41
+ organization?: string | null;
38
42
  [k: string]: unknown;
39
43
  }
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "deviceRouter.json",
4
+ "title": "Device Router",
5
+ "description": "A device router contains instructions on where to route devices based on their organization and driver.",
6
+ "type": "object",
7
+ "required": ["name", "deviceId", "deviceData"],
8
+ "properties": {
9
+ "id": {
10
+ "$ref": "definitions.json#/definitions/id"
11
+ },
12
+ "type": {
13
+ "type": "string",
14
+ "default": "deviceRouter"
15
+ },
16
+ "driver": {
17
+ "type": "string"
18
+ },
19
+ "organization": {
20
+ "type": ["string", "null"],
21
+ "description": "Reference (id) to the organization that owns this router"
22
+ },
23
+ "devices": {
24
+ "type": "object",
25
+ "additionalProperties": true
26
+ }
27
+ }
28
+ }
@@ -26,6 +26,10 @@
26
26
  },
27
27
  "ignore": {
28
28
  "type": "boolean"
29
+ },
30
+ "organization": {
31
+ "type": ["string", "null"],
32
+ "description": "Reference (id) to the organization that owns this device"
29
33
  }
30
34
  }
31
35
  }
@@ -11938,6 +11938,10 @@ var require_discoveredDevice = __commonJS({
11938
11938
  },
11939
11939
  ignore: {
11940
11940
  type: "boolean"
11941
+ },
11942
+ organization: {
11943
+ type: ["string", "null"],
11944
+ description: "Reference (id) to the organization that owns this device"
11941
11945
  }
11942
11946
  }
11943
11947
  };
@@ -11981,6 +11985,77 @@ var require_DiscoveredDevice = __commonJS({
11981
11985
  }
11982
11986
  });
11983
11987
 
11988
+ // src/schemas/deviceRouter.json
11989
+ var require_deviceRouter = __commonJS({
11990
+ "src/schemas/deviceRouter.json"(exports, module) {
11991
+ module.exports = {
11992
+ $schema: "http://json-schema.org/draft-07/schema",
11993
+ $id: "deviceRouter.json",
11994
+ title: "Device Router",
11995
+ description: "A device router contains instructions on where to route devices based on their organization and driver.",
11996
+ type: "object",
11997
+ required: ["name", "deviceId", "deviceData"],
11998
+ properties: {
11999
+ id: {
12000
+ $ref: "definitions.json#/definitions/id"
12001
+ },
12002
+ type: {
12003
+ type: "string",
12004
+ default: "deviceRouter"
12005
+ },
12006
+ driver: {
12007
+ type: "string"
12008
+ },
12009
+ organization: {
12010
+ type: ["string", "null"],
12011
+ description: "Reference (id) to the organization that owns this router"
12012
+ },
12013
+ devices: {
12014
+ type: "object",
12015
+ additionalProperties: true
12016
+ }
12017
+ }
12018
+ };
12019
+ }
12020
+ });
12021
+
12022
+ // src/Models/DeviceRouter.js
12023
+ var require_DeviceRouter = __commonJS({
12024
+ "src/Models/DeviceRouter.js"(exports, module) {
12025
+ var schemas = require_schema();
12026
+ var schema = require_deviceRouter();
12027
+ var Kohost = require_Kohost();
12028
+ schemas.add(schema);
12029
+ var validator = schemas.compile(schema);
12030
+ var DeviceRouter = class extends Kohost {
12031
+ static {
12032
+ __name(this, "DeviceRouter");
12033
+ }
12034
+ /**
12035
+ * @typedef {import("../schemas/DeviceRouterSchema").DeviceRouter} DeviceRouterType
12036
+ * Create a DeviceRouter instance.
12037
+ * @constructor
12038
+ * @param {DeviceRouterType} device - The device object of type DeviceRouter.
12039
+ */
12040
+ constructor(device) {
12041
+ super(device);
12042
+ }
12043
+ };
12044
+ Object.defineProperty(DeviceRouter.prototype, "schema", {
12045
+ value: schema
12046
+ });
12047
+ Object.defineProperty(DeviceRouter.prototype, "validator", {
12048
+ get: function() {
12049
+ return validator;
12050
+ }
12051
+ });
12052
+ Object.defineProperty(DeviceRouter, "validProperties", {
12053
+ value: Object.keys(schema.properties)
12054
+ });
12055
+ module.exports = DeviceRouter;
12056
+ }
12057
+ });
12058
+
11984
12059
  // src/schemas/credential.json
11985
12060
  var require_credential = __commonJS({
11986
12061
  "src/schemas/credential.json"(exports, module) {
@@ -13195,6 +13270,7 @@ var require_Models = __commonJS({
13195
13270
  var Product = require_Product();
13196
13271
  var Order = require_Order();
13197
13272
  var DiscoveredDevice = require_DiscoveredDevice();
13273
+ var DeviceRouter = require_DeviceRouter();
13198
13274
  var Credential = require_Credential();
13199
13275
  var ShortLink = require_ShortLink();
13200
13276
  var EnergyReportShard = require_EnergyReportShard();
@@ -13229,6 +13305,7 @@ var require_Models = __commonJS({
13229
13305
  Ticket,
13230
13306
  Scene,
13231
13307
  DiscoveredDevice,
13308
+ DeviceRouter,
13232
13309
  Reservation,
13233
13310
  Credential,
13234
13311
  ShortLink,