@kohost/api-client 3.0.0-beta.70 → 3.0.0-beta.71

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,17 @@
1
+ const Event = require("./Event");
2
+
3
+ class SystemEntityDeletedEvent extends Event {
4
+ constructor(data) {
5
+ super(data);
6
+ }
7
+
8
+ get name() {
9
+ return "SystemEntityDeleted";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `entity.${this.keyId}.deleted`;
14
+ }
15
+ }
16
+
17
+ module.exports = SystemEntityDeletedEvent;
@@ -0,0 +1,17 @@
1
+ const Event = require("./Event");
2
+
3
+ class SystemOrganizationUpdatedEvent extends Event {
4
+ constructor(organization) {
5
+ super(organization);
6
+ }
7
+
8
+ get name() {
9
+ return "SystemOrganizationUpdated";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `organization.${this.keyId}.updated`;
14
+ }
15
+ }
16
+
17
+ module.exports = SystemOrganizationUpdatedEvent;
@@ -0,0 +1,17 @@
1
+ const Event = require("./Event");
2
+
3
+ class SystemPropertyUpdatedEvent extends Event {
4
+ constructor(property) {
5
+ super(property);
6
+ }
7
+
8
+ get name() {
9
+ return "SystemPropertyUpdated";
10
+ }
11
+
12
+ get routingKey() {
13
+ return `property.${this.keyId}.updated`;
14
+ }
15
+ }
16
+
17
+ module.exports = SystemPropertyUpdatedEvent;
@@ -10,6 +10,8 @@ const SystemMediaSourceUpdatedEvent = require("./SystemMediaSourceUpdatedEvent")
10
10
  const SystemCourtesyUpdatedEvent = require("./SystemCourtesyUpdatedEvent");
11
11
  const SystemAlarmUpdatedEvent = require("./SystemAlarmUpdatedEvent");
12
12
  const SystemMotionSensorUpdatedEvent = require("./SystemMotionSensorUpdatedEvent");
13
+ const SystemPropertyUpdatedEvent = require("./SystemPropertyUpdatedEvent");
14
+ const SystemOrganizationUpdatedEvent = require("./SystemOrganizationUpdatedEvent");
13
15
 
14
16
  const SceneSetEvent = require("./SceneSetEvent");
15
17
 
@@ -27,6 +29,10 @@ const ShortLinkCreatedEvent = require("./ShortLinkCreatedEvent");
27
29
  const ApplicationInUseEvent = require("./ApplicationInUseEvent");
28
30
  const ApplicationOutOfUseEvent = require("./ApplicationOutOfUseEvent");
29
31
 
32
+ // Delete Events
33
+ const SystemEntityDeletedEvent = require("./SystemEntityDeletedEvent");
34
+
35
+
30
36
  module.exports = {
31
37
  SystemAlarmUpdatedEvent,
32
38
  SystemGatewayUpdatedEvent,
@@ -44,7 +50,10 @@ module.exports = {
44
50
  SystemSpaceUpdatedEvent,
45
51
  SystemCategoryUpdatedEvent,
46
52
  SystemProductUpdatedEvent,
53
+ SystemPropertyUpdatedEvent,
54
+ SystemOrganizationUpdatedEvent,
47
55
  SystemReservationUpdatedEvent,
56
+ SystemEntityDeletedEvent,
48
57
  SceneSetEvent,
49
58
  SMSEvent,
50
59
  EmailEvent,
@@ -147,4 +147,5 @@ export interface Alarm {
147
147
  bypassed?: boolean | null;
148
148
  }[];
149
149
  watts?: number;
150
+ [k: string]: unknown;
150
151
  }
@@ -137,4 +137,5 @@ export interface Courtesy {
137
137
  state: "privacy" | "service" | "none";
138
138
  systemId?: string;
139
139
  watts?: number;
140
+ [k: string]: unknown;
140
141
  }
@@ -137,4 +137,5 @@ export interface Dimmer {
137
137
  level: number;
138
138
  systemId?: string;
139
139
  watts?: number;
140
+ [k: string]: unknown;
140
141
  }
@@ -134,4 +134,5 @@ export interface IoTGateway {
134
134
  | "cloudflare-stream"
135
135
  | "insperia-privacy";
136
136
  watts?: number;
137
+ [k: string]: unknown;
137
138
  }
@@ -137,4 +137,5 @@ export interface Lock {
137
137
  batteryLevel?: number;
138
138
  systemId?: string;
139
139
  watts?: number;
140
+ [k: string]: unknown;
140
141
  }
@@ -21,7 +21,8 @@ export type UpdatedAt =
21
21
  */
22
22
  export interface Organization {
23
23
  id?: string;
24
- accountNumber: number;
24
+ type?: string;
25
+ accountNumber: number | null;
25
26
  name: string;
26
27
  properties?: string[];
27
28
  credentials?: {
@@ -11,122 +11,28 @@
11
11
  export interface Property {
12
12
  id: string;
13
13
  name: string;
14
- type: "hospitality" | "education" | "commercial";
14
+ type: string;
15
+ discriminator?: "hospitality" | "education" | "commercial";
15
16
  timezone?: string;
16
17
  smsNumber?: string;
17
- hostname: string;
18
+ hostname: string | null;
18
19
  /**
19
20
  * Reference (id) to the organization that owns this property
20
21
  */
21
- organization: string;
22
+ organization: string | null;
22
23
  checkInTime?: string;
23
24
  checkOutTime?: string;
24
- address?: {
25
- street?: string;
26
- city?: string;
27
- state?: string;
28
- zip?: string;
29
- country?: string;
30
- [k: string]: unknown;
31
- };
32
- latitude?: number;
33
- longitude?: number;
34
- appManifest?: {
35
- name?: string;
36
- short_name?: string;
37
- scope?: string;
38
- start_url?: string;
39
- themeColor?: string;
40
- backgroundColor?: string;
41
- display?: "fullscreen" | "standalone" | "minimal-ui" | "browser";
42
- orientation?: "portrait" | "landscape";
43
- splash?: {
44
- src?: string;
45
- type?: string;
46
- sizes?: string;
47
- [k: string]: unknown;
48
- };
49
- icons?: {
50
- src?: string;
51
- sizes?: string;
52
- type?: string;
53
- [k: string]: unknown;
54
- }[];
55
- logo?: {
56
- src?: string;
57
- type?: string;
58
- sizes?: string;
59
- [k: string]: unknown;
60
- };
61
- [k: string]: unknown;
62
- };
63
- appFeatures?: {
64
- RoomControl?: {
65
- commonAreas?: {
66
- spaces?: string[];
67
- [k: string]: unknown;
68
- };
69
- };
70
- CheckIn?: {
71
- payment?: unknown;
72
- identification?: unknown;
73
- earlyCheckIn?: {
74
- dynamic: boolean;
75
- minimumPrice?: number;
76
- maximumPrice?: number;
77
- priceRatioPerHour?: number;
78
- [k: string]: unknown;
79
- };
80
- roomUpgrades?: unknown;
81
- [k: string]: unknown;
82
- };
83
- CheckOut?: {
84
- lateCheckOut?: {
85
- dynamic: boolean;
86
- minimumPrice?: number;
87
- maximumPrice?: number;
88
- priceRatioPerHour?: number;
89
- [k: string]: unknown;
90
- };
91
- [k: string]: unknown;
92
- };
93
- Concierge?: unknown;
94
- DigitalKey?: {
95
- system?: "salto";
96
- systemOnline?: boolean;
97
- enableApp?: boolean;
98
- branding?: {
99
- logo?: string;
100
- /**
101
- * @minItems 2
102
- * @maxItems 2
103
- */
104
- gradient?: [string, string];
105
- /**
106
- * @minItems 2
107
- * @maxItems 3
108
- */
109
- highlightedGradient?: [string, string] | [string, string, string];
110
- [k: string]: unknown;
111
- };
112
- [k: string]: unknown;
113
- };
114
- Elevator?: unknown;
115
- };
116
- notifications?: {
117
- email?: {
118
- enabled?: boolean;
119
- };
120
- sms?: {
121
- enabled?: boolean;
122
- };
123
- push?: {
124
- enabled?: boolean;
125
- };
126
- };
127
- credentials?: {
128
- [k: string]: unknown;
129
- };
130
- additionalProperties?: never;
25
+ address?: Address;
26
+ [k: string]: unknown;
27
+ }
28
+ export interface Address {
29
+ id?: string;
30
+ line1?: string;
31
+ line2?: string;
32
+ line3?: string;
33
+ city?: string;
34
+ state?: string;
35
+ postalCode?: string;
36
+ countryCode?: string;
131
37
  [k: string]: unknown;
132
38
  }
@@ -168,6 +168,7 @@ export interface Dimmer {
168
168
  level: number;
169
169
  systemId?: string;
170
170
  watts?: number;
171
+ [k: string]: unknown;
171
172
  }
172
173
  /**
173
174
  * Any smart switch
@@ -252,6 +253,7 @@ export interface Switch {
252
253
  state: "on" | "off";
253
254
  systemId?: string;
254
255
  watts?: number;
256
+ [k: string]: unknown;
255
257
  }
256
258
  /**
257
259
  * Any smart thermostat
@@ -449,6 +451,7 @@ export interface Lock {
449
451
  batteryLevel?: number;
450
452
  systemId?: string;
451
453
  watts?: number;
454
+ [k: string]: unknown;
452
455
  }
453
456
  /**
454
457
  * Any smart window covering
@@ -532,6 +535,7 @@ export interface WindowCovering {
532
535
  position: number;
533
536
  systemId?: string;
534
537
  watts?: number;
538
+ [k: string]: unknown;
535
539
  }
536
540
  /**
537
541
  * Any smart courtesy system
@@ -616,6 +620,7 @@ export interface Courtesy {
616
620
  state: "privacy" | "service" | "none";
617
621
  systemId?: string;
618
622
  watts?: number;
623
+ [k: string]: unknown;
619
624
  }
620
625
  /**
621
626
  * Any smart camera
@@ -1057,4 +1062,5 @@ export interface Alarm {
1057
1062
  bypassed?: boolean | null;
1058
1063
  }[];
1059
1064
  watts?: number;
1065
+ [k: string]: unknown;
1060
1066
  }
@@ -137,4 +137,5 @@ export interface Switch {
137
137
  state: "on" | "off";
138
138
  systemId?: string;
139
139
  watts?: number;
140
+ [k: string]: unknown;
140
141
  }
@@ -136,4 +136,5 @@ export interface WindowCovering {
136
136
  position: number;
137
137
  systemId?: string;
138
138
  watts?: number;
139
+ [k: string]: unknown;
139
140
  }
@@ -77,6 +77,5 @@
77
77
  "$ref": "definitions.json#/definitions/watts"
78
78
  }
79
79
  },
80
- "additionalProperties": false,
81
80
  "required": ["id", "type", "areas", "zones", "driver"]
82
81
  }
@@ -44,6 +44,5 @@
44
44
  "$ref": "definitions.json#/definitions/watts"
45
45
  }
46
46
  },
47
- "additionalProperties": false,
48
47
  "required": ["id", "type", "driver", "supportedStates", "state"]
49
48
  }
@@ -41,6 +41,5 @@
41
41
  "$ref": "definitions.json#/definitions/watts"
42
42
  }
43
43
  },
44
- "additionalProperties": false,
45
44
  "required": ["id", "type", "level", "driver"]
46
45
  }
@@ -30,6 +30,5 @@
30
30
  "$ref": "definitions.json#/definitions/watts"
31
31
  }
32
32
  },
33
- "additionalProperties": false,
34
33
  "required": ["id", "type", "status", "driver"]
35
34
  }
@@ -40,6 +40,5 @@
40
40
  "$ref": "definitions.json#/definitions/watts"
41
41
  }
42
42
  },
43
- "additionalProperties": false,
44
43
  "required": ["id", "type", "state", "driver"]
45
44
  }
@@ -9,8 +9,12 @@
9
9
  "id": {
10
10
  "$ref": "definitions.json#/definitions/id"
11
11
  },
12
+ "type": {
13
+ "type": "string",
14
+ "default": "organization"
15
+ },
12
16
  "accountNumber": {
13
- "type": "number",
17
+ "type": ["number", "null"],
14
18
  "minimum": 10000
15
19
  },
16
20
  "name": {
@@ -13,9 +13,14 @@
13
13
  "type": "string"
14
14
  },
15
15
  "type": {
16
+ "type": "string",
17
+ "default": "property"
18
+ },
19
+ "discriminator": {
16
20
  "type": "string",
17
21
  "enum": ["hospitality", "education", "commercial"]
18
22
  },
23
+
19
24
  "timezone": {
20
25
  "type": "string"
21
26
  },
@@ -23,10 +28,10 @@
23
28
  "type": "string"
24
29
  },
25
30
  "hostname": {
26
- "type": "string"
31
+ "type": ["string", "null"]
27
32
  },
28
33
  "organization": {
29
- "type": "string",
34
+ "type": ["string", "null"],
30
35
  "description": "Reference (id) to the organization that owns this property"
31
36
  },
32
37
  "checkInTime": {
@@ -36,24 +41,8 @@
36
41
  "type": "string"
37
42
  },
38
43
  "address": {
39
- "type": "object",
40
- "properties": {
41
- "street": {
42
- "type": "string"
43
- },
44
- "city": {
45
- "type": "string"
46
- },
47
- "state": {
48
- "type": "string"
49
- },
50
- "zip": {
51
- "type": "string"
52
- },
53
- "country": {
54
- "type": "string"
55
- }
56
- }
44
+ "$ref": "definitions.json#/definitions/address"
45
+ }
57
46
  },
58
47
  "latitude": {
59
48
  "type": "number"
@@ -340,7 +329,5 @@
340
329
  "credentials": {
341
330
  "type": "object",
342
331
  "additionalProperties": true
343
- },
344
- "additionalProperties": false
345
- }
332
+ }
346
333
  }
@@ -40,6 +40,5 @@
40
40
  "$ref": "definitions.json#/definitions/watts"
41
41
  }
42
42
  },
43
- "additionalProperties": false,
44
43
  "required": ["id", "type", "state", "driver"]
45
44
  }
@@ -38,6 +38,5 @@
38
38
  "$ref": "definitions.json#/definitions/watts"
39
39
  }
40
40
  },
41
- "additionalProperties": false,
42
41
  "required": ["id", "type", "position", "driver"]
43
42
  }
@@ -331,6 +331,50 @@ var require_SystemMotionSensorUpdatedEvent = __commonJS({
331
331
  }
332
332
  });
333
333
 
334
+ // src/Events/SystemPropertyUpdatedEvent.js
335
+ var require_SystemPropertyUpdatedEvent = __commonJS({
336
+ "src/Events/SystemPropertyUpdatedEvent.js"(exports, module) {
337
+ var Event = require_Event();
338
+ var SystemPropertyUpdatedEvent = class extends Event {
339
+ static {
340
+ __name(this, "SystemPropertyUpdatedEvent");
341
+ }
342
+ constructor(property) {
343
+ super(property);
344
+ }
345
+ get name() {
346
+ return "SystemPropertyUpdated";
347
+ }
348
+ get routingKey() {
349
+ return `property.${this.keyId}.updated`;
350
+ }
351
+ };
352
+ module.exports = SystemPropertyUpdatedEvent;
353
+ }
354
+ });
355
+
356
+ // src/Events/SystemOrganizationUpdatedEvent.js
357
+ var require_SystemOrganizationUpdatedEvent = __commonJS({
358
+ "src/Events/SystemOrganizationUpdatedEvent.js"(exports, module) {
359
+ var Event = require_Event();
360
+ var SystemOrganizationUpdatedEvent = class extends Event {
361
+ static {
362
+ __name(this, "SystemOrganizationUpdatedEvent");
363
+ }
364
+ constructor(organization) {
365
+ super(organization);
366
+ }
367
+ get name() {
368
+ return "SystemOrganizationUpdated";
369
+ }
370
+ get routingKey() {
371
+ return `organization.${this.keyId}.updated`;
372
+ }
373
+ };
374
+ module.exports = SystemOrganizationUpdatedEvent;
375
+ }
376
+ });
377
+
334
378
  // src/Events/SceneSetEvent.js
335
379
  var require_SceneSetEvent = __commonJS({
336
380
  "src/Events/SceneSetEvent.js"(exports, module) {
@@ -581,6 +625,28 @@ var require_ApplicationOutOfUseEvent = __commonJS({
581
625
  }
582
626
  });
583
627
 
628
+ // src/Events/SystemEntityDeletedEvent.js
629
+ var require_SystemEntityDeletedEvent = __commonJS({
630
+ "src/Events/SystemEntityDeletedEvent.js"(exports, module) {
631
+ var Event = require_Event();
632
+ var SystemEntityDeletedEvent = class extends Event {
633
+ static {
634
+ __name(this, "SystemEntityDeletedEvent");
635
+ }
636
+ constructor(data) {
637
+ super(data);
638
+ }
639
+ get name() {
640
+ return "SystemEntityDeleted";
641
+ }
642
+ get routingKey() {
643
+ return `entity.${this.keyId}.deleted`;
644
+ }
645
+ };
646
+ module.exports = SystemEntityDeletedEvent;
647
+ }
648
+ });
649
+
584
650
  // src/Events/index.js
585
651
  var require_Events = __commonJS({
586
652
  "src/Events/index.js"(exports, module) {
@@ -596,6 +662,8 @@ var require_Events = __commonJS({
596
662
  var SystemCourtesyUpdatedEvent = require_SystemCourtesyUpdatedEvent();
597
663
  var SystemAlarmUpdatedEvent = require_SystemAlarmUpdatedEvent();
598
664
  var SystemMotionSensorUpdatedEvent = require_SystemMotionSensorUpdatedEvent();
665
+ var SystemPropertyUpdatedEvent = require_SystemPropertyUpdatedEvent();
666
+ var SystemOrganizationUpdatedEvent = require_SystemOrganizationUpdatedEvent();
599
667
  var SceneSetEvent = require_SceneSetEvent();
600
668
  var SystemUserUpdatedEvent = require_SystemUserUpdatedEvent();
601
669
  var SystemSpaceUpdatedEvent = require_SystemSpaceUpdatedEvent();
@@ -607,6 +675,7 @@ var require_Events = __commonJS({
607
675
  var ShortLinkCreatedEvent = require_ShortLinkCreatedEvent();
608
676
  var ApplicationInUseEvent = require_ApplicationInUseEvent();
609
677
  var ApplicationOutOfUseEvent = require_ApplicationOutOfUseEvent();
678
+ var SystemEntityDeletedEvent = require_SystemEntityDeletedEvent();
610
679
  module.exports = {
611
680
  SystemAlarmUpdatedEvent,
612
681
  SystemGatewayUpdatedEvent,
@@ -624,7 +693,10 @@ var require_Events = __commonJS({
624
693
  SystemSpaceUpdatedEvent,
625
694
  SystemCategoryUpdatedEvent,
626
695
  SystemProductUpdatedEvent,
696
+ SystemPropertyUpdatedEvent,
697
+ SystemOrganizationUpdatedEvent,
627
698
  SystemReservationUpdatedEvent,
699
+ SystemEntityDeletedEvent,
628
700
  SceneSetEvent,
629
701
  SMSEvent,
630
702
  EmailEvent,