@kohost/api-client 3.0.0-beta.99 → 3.0.1

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 (74) hide show
  1. package/dist/cjs/Client/index.js +374 -67
  2. package/dist/cjs/Commands/CreateShortLinkCommand.js +2 -2
  3. package/dist/cjs/Commands/OCRDocumentCommand.js +2 -2
  4. package/dist/cjs/Commands/SetAlarmCommand.js +2 -2
  5. package/dist/cjs/Commands/SetCourtesyCommand.js +2 -2
  6. package/dist/cjs/Commands/SetDimmerCommand.js +2 -2
  7. package/dist/cjs/Commands/SetLockCommand.js +2 -2
  8. package/dist/cjs/Commands/SetSwitchCommand.js +2 -2
  9. package/dist/cjs/Commands/SetThermostatCommand.js +2 -2
  10. package/dist/cjs/Commands/SetWindowCoveringCommand.js +2 -2
  11. package/dist/cjs/Events/ReservationCheckInEvent.js +23 -0
  12. package/dist/cjs/Events/ReservationCheckOutEvent.js +23 -0
  13. package/dist/cjs/Events/index.js +6 -0
  14. package/dist/cjs/SocketIoClient/index.js +23 -4
  15. package/dist/cjs/schemas/AlarmSchema.d.ts +14 -2
  16. package/dist/cjs/schemas/CameraSchema.d.ts +1 -0
  17. package/dist/cjs/schemas/CategorySchema.d.ts +1 -0
  18. package/dist/cjs/schemas/CourtesySchema.d.ts +1 -0
  19. package/dist/cjs/schemas/CredentialSchema.d.ts +2 -1
  20. package/dist/cjs/schemas/DimmerSchema.d.ts +1 -0
  21. package/dist/cjs/schemas/DiscoveredDeviceSchema.d.ts +4 -0
  22. package/dist/cjs/schemas/GatewaySchema.d.ts +1 -0
  23. package/dist/cjs/schemas/LockSchema.d.ts +1 -0
  24. package/dist/cjs/schemas/MediaSourceSchema.d.ts +4 -1
  25. package/dist/cjs/schemas/MotionSensorSchema.d.ts +1 -0
  26. package/dist/cjs/schemas/OrganizationSchema.d.ts +30 -0
  27. package/dist/cjs/schemas/ProductSchema.d.ts +1 -0
  28. package/dist/cjs/schemas/PropertySchema.d.ts +26 -35
  29. package/dist/cjs/schemas/ReservationSchema.d.ts +2 -0
  30. package/dist/cjs/schemas/RoomSchema.d.ts +28 -4
  31. package/dist/cjs/schemas/SceneSchema.d.ts +2 -1
  32. package/dist/cjs/schemas/SpaceSchema.d.ts +1 -0
  33. package/dist/cjs/schemas/SwitchSchema.d.ts +1 -0
  34. package/dist/cjs/schemas/SystemUserSchema.d.ts +1 -0
  35. package/dist/cjs/schemas/ThermostatSchema.d.ts +1 -0
  36. package/dist/cjs/schemas/UserSchema.d.ts +2 -0
  37. package/dist/cjs/schemas/WindowCoveringSchema.d.ts +3 -1
  38. package/dist/cjs/schemas/alarm.json +4 -4
  39. package/dist/cjs/schemas/credential.json +1 -0
  40. package/dist/cjs/schemas/definitions.json +1 -0
  41. package/dist/cjs/schemas/discoveredDevice.json +4 -0
  42. package/dist/cjs/schemas/mediaSource.json +11 -1
  43. package/dist/cjs/schemas/organization.json +109 -0
  44. package/dist/cjs/schemas/property.json +39 -116
  45. package/dist/cjs/schemas/reservation.json +3 -0
  46. package/dist/cjs/schemas/scene.json +3 -0
  47. package/dist/cjs/schemas/windowCovering.json +8 -2
  48. package/dist/esm/Client.js +504 -193
  49. package/dist/esm/Client.js.map +4 -4
  50. package/dist/esm/Commands.js +18 -18
  51. package/dist/esm/Commands.js.map +2 -2
  52. package/dist/esm/Events.js +55 -1
  53. package/dist/esm/Events.js.map +3 -3
  54. package/dist/esm/Models.js +182 -122
  55. package/dist/esm/Models.js.map +2 -2
  56. package/dist/esm/SocketIoClient.js +26 -7
  57. package/dist/esm/SocketIoClient.js.map +2 -2
  58. package/dist/esm/defs.js +162 -131
  59. package/dist/esm/defs.js.map +4 -4
  60. package/dist/esm/utils.js +1 -0
  61. package/dist/esm/utils.js.map +2 -2
  62. package/dist/useCases/{LoginUser.js → CreateScene.js} +2 -2
  63. package/dist/useCases/DescribeAlarmConfig.js +32 -0
  64. package/dist/useCases/{DescribeMyProperty.js → DescribeMyOrganization.js} +2 -2
  65. package/dist/useCases/DescribeMyPasskeyRegistrations.js +32 -0
  66. package/dist/useCases/FinishRegisterPasskey.js +32 -0
  67. package/dist/useCases/{RequestLoginLink.js → ListMyProperties.js} +3 -3
  68. package/dist/useCases/{RequestPWAToken.js → LoginFinish.js} +3 -3
  69. package/dist/useCases/LoginStart.js +32 -0
  70. package/dist/useCases/{RequestMyKeyToken.js → RequestLoginToken.js} +3 -3
  71. package/dist/useCases/SetAlarm.js +32 -0
  72. package/dist/useCases/SetCustomScene.js +32 -0
  73. package/dist/useCases/StartRegisterPasskey.js +32 -0
  74. package/package.json +3 -4
@@ -11,6 +11,7 @@
11
11
  export interface Scene {
12
12
  id?: string;
13
13
  name?: string;
14
+ description?: string;
14
15
  devices?: {
15
16
  switches?: {
16
17
  id?: string;
@@ -24,7 +25,7 @@ export interface Scene {
24
25
  }[];
25
26
  windowCoverings?: {
26
27
  id?: string;
27
- position?: number;
28
+ position?: number | null;
28
29
  [k: string]: unknown;
29
30
  }[];
30
31
  thermostats?: {
@@ -38,6 +38,7 @@ export interface Space {
38
38
  | "mht"
39
39
  | "paxton"
40
40
  | "pelican-wireless"
41
+ | "power-shades"
41
42
  | "rebrandly"
42
43
  | "salto"
43
44
  | "salto-irn"
@@ -130,6 +130,7 @@ export interface Switch {
130
130
  | "mht"
131
131
  | "paxton"
132
132
  | "pelican-wireless"
133
+ | "power-shades"
133
134
  | "rebrandly"
134
135
  | "salto"
135
136
  | "salto-irn"
@@ -61,6 +61,7 @@ export interface SystemUser {
61
61
  | "mht"
62
62
  | "paxton"
63
63
  | "pelican-wireless"
64
+ | "power-shades"
64
65
  | "rebrandly"
65
66
  | "salto"
66
67
  | "salto-irn"
@@ -129,6 +129,7 @@ export interface Thermostat {
129
129
  | "mht"
130
130
  | "paxton"
131
131
  | "pelican-wireless"
132
+ | "power-shades"
132
133
  | "rebrandly"
133
134
  | "salto"
134
135
  | "salto-irn"
@@ -207,6 +207,7 @@ export interface Reservation {
207
207
  | "mht"
208
208
  | "paxton"
209
209
  | "pelican-wireless"
210
+ | "power-shades"
210
211
  | "rebrandly"
211
212
  | "salto"
212
213
  | "salto-irn"
@@ -271,6 +272,7 @@ export interface Reservation {
271
272
  id?: string;
272
273
  price?: number;
273
274
  unit?: "night" | "stay" | "hour";
275
+ isUpgrade?: boolean;
274
276
  [k: string]: unknown;
275
277
  }[];
276
278
  revenue?: Revenue;
@@ -109,6 +109,7 @@ export interface WindowCovering {
109
109
  | "discPlayer"
110
110
  | "mediaPlayer"
111
111
  | "uncontrolledDevice";
112
+ discriminator?: "basic" | "variable";
112
113
  supportedNotifications?: SupportedNotifications;
113
114
  notification?: Notification;
114
115
  driver:
@@ -129,6 +130,7 @@ export interface WindowCovering {
129
130
  | "mht"
130
131
  | "paxton"
131
132
  | "pelican-wireless"
133
+ | "power-shades"
132
134
  | "rebrandly"
133
135
  | "salto"
134
136
  | "salto-irn"
@@ -140,7 +142,7 @@ export interface WindowCovering {
140
142
  | "cloudflare-stream"
141
143
  | "insperia-privacy";
142
144
  offline?: boolean;
143
- position: number;
145
+ position: number | null;
144
146
  systemId?: string;
145
147
  watts?: number;
146
148
  [k: string]: unknown;
@@ -43,9 +43,6 @@
43
43
  "securityMode": {
44
44
  "type": ["string", "null"],
45
45
  "enum": ["arming", "disarming", "armed", "disarmed", "alarm", null]
46
- },
47
- "readyToArm": {
48
- "type": ["boolean", "null"]
49
46
  }
50
47
  },
51
48
  "additionalProperties": false
@@ -64,7 +61,7 @@
64
61
  "type": "string"
65
62
  },
66
63
  "secure": {
67
- "type": "boolean"
64
+ "type": ["boolean", "null"]
68
65
  },
69
66
  "bypassed": {
70
67
  "type": ["boolean", "null"]
@@ -75,6 +72,9 @@
75
72
  },
76
73
  "watts": {
77
74
  "$ref": "definitions.json#/definitions/watts"
75
+ },
76
+ "address": {
77
+ "$ref": "definitions.json#/definitions/address"
78
78
  }
79
79
  },
80
80
  "required": ["id", "type", "areas", "zones", "driver"]
@@ -23,6 +23,7 @@
23
23
  "mobileKey",
24
24
  "pin",
25
25
  "publicKey",
26
+ "passkeyChallenge",
26
27
  "id"
27
28
  ]
28
29
  },
@@ -100,6 +100,7 @@
100
100
  "mht",
101
101
  "paxton",
102
102
  "pelican-wireless",
103
+ "power-shades",
103
104
  "rebrandly",
104
105
  "salto",
105
106
  "salto-irn",
@@ -30,6 +30,10 @@
30
30
  "organization": {
31
31
  "type": ["string", "null"],
32
32
  "description": "Reference (id) to the organization that owns this device"
33
+ },
34
+ "property": {
35
+ "type": ["string", "null"],
36
+ "description": "Reference (id) to the property that this device belongs to"
33
37
  }
34
38
  }
35
39
  }
@@ -4,12 +4,16 @@
4
4
  "title": "Media Source",
5
5
  "description": "Any media source",
6
6
  "type": "object",
7
- "required": ["id", "type", "audio", "video", "driver"],
7
+ "required": ["id", "type", "discriminator", "audio", "video", "driver"],
8
8
  "properties": {
9
9
  "id": {
10
10
  "$ref": "definitions.json#/definitions/id"
11
11
  },
12
12
  "type": {
13
+ "type": "string",
14
+ "default": "mediaSource"
15
+ },
16
+ "discriminator": {
13
17
  "type": "string",
14
18
  "enum": [
15
19
  "tv",
@@ -20,6 +24,12 @@
20
24
  "uncontrolledDevice"
21
25
  ]
22
26
  },
27
+ "remote": {
28
+ "type": "string",
29
+ "enum": [
30
+ "MR22GA"
31
+ ]
32
+ },
23
33
  "name": {
24
34
  "$ref": "definitions.json#/definitions/name"
25
35
  },
@@ -26,6 +26,115 @@
26
26
  "type": "string"
27
27
  }
28
28
  },
29
+ "hostname": {
30
+ "type": ["string", "null"]
31
+ },
32
+ "appManifest": {
33
+ "type": "object",
34
+
35
+ "properties": {
36
+ "name": {
37
+ "type": "string"
38
+ },
39
+ "short_name": {
40
+ "type": "string"
41
+ },
42
+ "scope": {
43
+ "type": "string"
44
+ },
45
+ "start_url": {
46
+ "type": "string"
47
+ },
48
+ "themeColor": {
49
+ "type": "string"
50
+ },
51
+ "backgroundColor": {
52
+ "type": "string"
53
+ },
54
+ "display": {
55
+ "type": "string",
56
+ "enum": ["fullscreen", "standalone", "minimal-ui", "browser"],
57
+ "default": "fullscreen"
58
+ },
59
+ "orientation": {
60
+ "type": "string",
61
+ "enum": ["portrait", "landscape"],
62
+ "default": "portrait"
63
+ },
64
+ "splash": {
65
+ "type": "object",
66
+ "properties": {
67
+ "src": {
68
+ "type": "string"
69
+ },
70
+ "type": {
71
+ "type": "string"
72
+ },
73
+ "sizes": {
74
+ "type": "string"
75
+ }
76
+ }
77
+ },
78
+ "icons": {
79
+ "type": "array",
80
+ "items": {
81
+ "type": "object",
82
+ "properties": {
83
+ "src": {
84
+ "type": "string"
85
+ },
86
+ "sizes": {
87
+ "type": "string"
88
+ },
89
+ "type": {
90
+ "type": "string"
91
+ }
92
+ }
93
+ }
94
+ },
95
+ "logo": {
96
+ "type": "object",
97
+ "properties": {
98
+ "src": {
99
+ "type": "string"
100
+ },
101
+ "type": {
102
+ "type": "string"
103
+ },
104
+ "sizes": {
105
+ "type": "string"
106
+ }
107
+ }
108
+ }
109
+ },
110
+ "default": {
111
+ "name": "Kohost",
112
+ "short_name": "Kohost",
113
+ "start_url": "/",
114
+ "scope": "/",
115
+ "display": "fullscreen",
116
+ "orientation": "portrait",
117
+ "theme_color": "#1d1f22",
118
+ "background_color": "#1d1f22",
119
+ "icons": [
120
+ {
121
+ "src": "https://images.kohost.io/cdn-cgi/imagedelivery/vcVX2aBwdFSYr66spcFKaA/9c85047f-ccba-4b1c-3070-5463fbe93b00/w=512",
122
+ "sizes": "512x512",
123
+ "type": "image/png"
124
+ }
125
+ ],
126
+ "splash": {
127
+ "src": "https://images.kohost.io/cdn-cgi/imagedelivery/vcVX2aBwdFSYr66spcFKaA/034fb112-5326-4d37-373e-d1cc2a4d0400/w=1500",
128
+ "sizes": "1500x800",
129
+ "type": "image/jpg"
130
+ },
131
+ "logo": {
132
+ "src": "https://images.kohost.io/cdn-cgi/imagedelivery/vcVX2aBwdFSYr66spcFKaA/1e54c54d-3bac-4745-f46f-c2f98036af00/h=75",
133
+ "sizes": "300x75",
134
+ "type": "image/png"
135
+ }
136
+ }
137
+ },
29
138
  "credentials": {
30
139
  "type": "object",
31
140
  "additionalProperties": true
@@ -4,7 +4,7 @@
4
4
  "title": "Property",
5
5
  "type": "object",
6
6
  "description": "A property is a physical asset or building",
7
- "required": ["id", "name", "type", "hostname", "organization"],
7
+ "required": ["id", "name", "type", "organization"],
8
8
  "properties": {
9
9
  "id": {
10
10
  "$ref": "definitions.json#/definitions/id"
@@ -20,6 +20,10 @@
20
20
  "type": "string",
21
21
  "enum": ["hospitality", "education", "commercial"]
22
22
  },
23
+ "organization": {
24
+ "type": ["string", "null"],
25
+ "description": "Reference (id) to the organization that owns this property"
26
+ },
23
27
  "testModeEnabled": {
24
28
  "type": "boolean"
25
29
  },
@@ -41,13 +45,6 @@
41
45
  "smsNumber": {
42
46
  "type": "string"
43
47
  },
44
- "hostname": {
45
- "type": ["string", "null"]
46
- },
47
- "organization": {
48
- "type": ["string", "null"],
49
- "description": "Reference (id) to the organization that owns this property"
50
- },
51
48
  "checkInTime": {
52
49
  "type": "string"
53
50
  },
@@ -63,112 +60,6 @@
63
60
  "longitude": {
64
61
  "type": "number"
65
62
  },
66
- "appManifest": {
67
- "type": "object",
68
-
69
- "properties": {
70
- "name": {
71
- "type": "string"
72
- },
73
- "short_name": {
74
- "type": "string"
75
- },
76
- "scope": {
77
- "type": "string"
78
- },
79
- "start_url": {
80
- "type": "string"
81
- },
82
- "themeColor": {
83
- "type": "string"
84
- },
85
- "backgroundColor": {
86
- "type": "string"
87
- },
88
- "display": {
89
- "type": "string",
90
- "enum": ["fullscreen", "standalone", "minimal-ui", "browser"],
91
- "default": "fullscreen"
92
- },
93
- "orientation": {
94
- "type": "string",
95
- "enum": ["portrait", "landscape"],
96
- "default": "portrait"
97
- },
98
- "splash": {
99
- "type": "object",
100
- "properties": {
101
- "src": {
102
- "type": "string"
103
- },
104
- "type": {
105
- "type": "string"
106
- },
107
- "sizes": {
108
- "type": "string"
109
- }
110
- }
111
- },
112
- "icons": {
113
- "type": "array",
114
- "items": {
115
- "type": "object",
116
- "properties": {
117
- "src": {
118
- "type": "string"
119
- },
120
- "sizes": {
121
- "type": "string"
122
- },
123
- "type": {
124
- "type": "string"
125
- }
126
- }
127
- }
128
- },
129
- "logo": {
130
- "type": "object",
131
- "properties": {
132
- "src": {
133
- "type": "string"
134
- },
135
- "type": {
136
- "type": "string"
137
- },
138
- "sizes": {
139
- "type": "string"
140
- }
141
- }
142
- }
143
- },
144
- "default": {
145
- "name": "Kohost",
146
- "short_name": "Kohost",
147
- "start_url": "/",
148
- "scope": "/",
149
- "display": "fullscreen",
150
- "orientation": "portrait",
151
- "theme_color": "#1d1f22",
152
- "background_color": "#1d1f22",
153
- "icons": [
154
- {
155
- "src": "https://cdn.kohost.app/defaultIcon.png",
156
- "sizes": "512x512",
157
- "type": "image/png"
158
- }
159
- ],
160
- "splash": {
161
- "src": "https://cdn.kohost.app/defaultSplash.jpg",
162
- "sizes": "1500x800",
163
- "type": "image/jpg"
164
- },
165
- "logo": {
166
- "src": "https://cdn.kohost.app/defaultLogo.png",
167
- "sizes": "300x75",
168
- "type": "image/png"
169
- }
170
- }
171
- },
172
63
  "appFeatures": {
173
64
  "type": "object",
174
65
  "properties": {
@@ -185,6 +76,32 @@
185
76
  }
186
77
  }
187
78
  }
79
+ },
80
+ "alarmConfig": {
81
+ "type": "object",
82
+ "patternProperties": {
83
+ "^[a-zA-Z0-9]+$": {
84
+ "type": "object",
85
+ "properties": {
86
+ "zoneLockMap": {
87
+ "type": "object",
88
+ "description": "Maps zone numbers to lock ids",
89
+ "additionalProperties": { "type": "string" }
90
+ }
91
+ }
92
+ }
93
+ },
94
+ "examples": [
95
+ {
96
+ "wZz7hucY": {
97
+ "zoneLockMap": {
98
+ "1": "wc87hucc",
99
+ "2": "bc86hzxc",
100
+ "3": "zv5ah5jv"
101
+ }
102
+ }
103
+ }
104
+ ]
188
105
  }
189
106
  },
190
107
  "additionalProperties": false
@@ -250,7 +167,7 @@
250
167
  "properties": {
251
168
  "system": {
252
169
  "type": "string",
253
- "enum": ["salto"]
170
+ "enum": ["salto", "legic"]
254
171
  },
255
172
  "systemOnline": {
256
173
  "type": "boolean",
@@ -288,7 +205,13 @@
288
205
  }
289
206
  }
290
207
  },
291
- "Elevator": {}
208
+ "Elevator": {},
209
+ "Experiences": {},
210
+ "Dining": {},
211
+ "Rentals": {},
212
+ "Shop": {},
213
+ "Spa": {},
214
+ "Valet": {}
292
215
  },
293
216
  "additionalProperties": false,
294
217
  "default": {
@@ -105,6 +105,9 @@
105
105
  "unit": {
106
106
  "type": "string",
107
107
  "enum": ["night", "stay", "hour"]
108
+ },
109
+ "isUpgrade": {
110
+ "type": "boolean"
108
111
  }
109
112
  }
110
113
  }
@@ -11,6 +11,9 @@
11
11
  "name": {
12
12
  "type": "string"
13
13
  },
14
+ "description": {
15
+ "type": "string"
16
+ },
14
17
  "devices": {
15
18
  "type": "object",
16
19
  "properties": {
@@ -12,7 +12,13 @@
12
12
  "type": "string"
13
13
  },
14
14
  "type": {
15
- "$ref": "definitions.json#/definitions/type"
15
+ "$ref": "definitions.json#/definitions/type",
16
+ "default": "windowCovering"
17
+ },
18
+ "discriminator": {
19
+ "type": "string",
20
+ "enum": ["basic", "variable"],
21
+ "default": "variable"
16
22
  },
17
23
  "supportedNotifications": {
18
24
  "$ref": "definitions.json#/definitions/supportedNotifications"
@@ -27,7 +33,7 @@
27
33
  "type": "boolean"
28
34
  },
29
35
  "position": {
30
- "type": "number",
36
+ "type": ["number", "null"],
31
37
  "minimum": 0,
32
38
  "maximum": 100
33
39
  },