@kohost/api-client 3.0.0-beta.102 → 3.0.0-beta.103
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/Client/index.js +88 -4
- package/dist/cjs/Events/ReservationCheckInEvent.js +23 -0
- package/dist/cjs/Events/ReservationCheckOutEvent.js +23 -0
- package/dist/cjs/Events/index.js +6 -0
- package/dist/cjs/SocketIoClient/index.js +0 -1
- package/dist/cjs/schemas/AlarmSchema.d.ts +12 -0
- package/dist/cjs/schemas/CredentialSchema.d.ts +1 -1
- package/dist/cjs/schemas/RoomSchema.d.ts +14 -1
- package/dist/cjs/schemas/SceneSchema.d.ts +2 -1
- package/dist/cjs/schemas/WindowCoveringSchema.d.ts +2 -1
- package/dist/cjs/schemas/alarm.json +3 -0
- package/dist/cjs/schemas/credential.json +1 -0
- package/dist/cjs/schemas/scene.json +3 -0
- package/dist/cjs/schemas/windowCovering.json +8 -2
- package/dist/esm/Client.js +88 -4
- package/dist/esm/Client.js.map +3 -3
- package/dist/esm/Events.js +55 -1
- package/dist/esm/Events.js.map +3 -3
- package/dist/esm/Models.js +15 -2
- package/dist/esm/Models.js.map +2 -2
- package/dist/esm/SocketIoClient.js +0 -2
- package/dist/esm/SocketIoClient.js.map +2 -2
- package/dist/esm/defs.js +8 -4
- package/dist/esm/defs.js.map +2 -2
- package/dist/useCases/CreateScene.js +32 -0
- package/dist/useCases/SetCustomScene.js +32 -0
- package/package.json +1 -1
package/dist/cjs/Client/index.js
CHANGED
|
@@ -3691,6 +3691,44 @@ var require_SetRoomScene = __commonJS({
|
|
|
3691
3691
|
}
|
|
3692
3692
|
});
|
|
3693
3693
|
|
|
3694
|
+
// dist/useCases/SetCustomScene.js
|
|
3695
|
+
var require_SetCustomScene = __commonJS({
|
|
3696
|
+
"dist/useCases/SetCustomScene.js"(exports2, module2) {
|
|
3697
|
+
module2.exports = /* @__PURE__ */ __name(function SetCustomScene2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
3698
|
+
if (!requestData)
|
|
3699
|
+
requestData = {};
|
|
3700
|
+
const pathParams = [":id"];
|
|
3701
|
+
const { data, query, headers } = requestData;
|
|
3702
|
+
let url = "/scenes/:id";
|
|
3703
|
+
if (pathParams && data) {
|
|
3704
|
+
for (const param of pathParams) {
|
|
3705
|
+
const paramName = param.replace(":", "");
|
|
3706
|
+
url = url.replace(param, data[paramName]);
|
|
3707
|
+
}
|
|
3708
|
+
}
|
|
3709
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
3710
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
3711
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
3712
|
+
return Promise.reject(
|
|
3713
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
3714
|
+
);
|
|
3715
|
+
}
|
|
3716
|
+
const config = {
|
|
3717
|
+
method: "post",
|
|
3718
|
+
url,
|
|
3719
|
+
...httpConfigOptions
|
|
3720
|
+
};
|
|
3721
|
+
if (data)
|
|
3722
|
+
config.data = data;
|
|
3723
|
+
if (query)
|
|
3724
|
+
config.params = query;
|
|
3725
|
+
if (headers)
|
|
3726
|
+
config.headers = headers;
|
|
3727
|
+
return this._http.request(config);
|
|
3728
|
+
}, "SetCustomScene");
|
|
3729
|
+
}
|
|
3730
|
+
});
|
|
3731
|
+
|
|
3694
3732
|
// dist/useCases/AddScenesToRoom.js
|
|
3695
3733
|
var require_AddScenesToRoom = __commonJS({
|
|
3696
3734
|
"dist/useCases/AddScenesToRoom.js"(exports2, module2) {
|
|
@@ -4147,6 +4185,44 @@ var require_ListScenes = __commonJS({
|
|
|
4147
4185
|
}
|
|
4148
4186
|
});
|
|
4149
4187
|
|
|
4188
|
+
// dist/useCases/CreateScene.js
|
|
4189
|
+
var require_CreateScene = __commonJS({
|
|
4190
|
+
"dist/useCases/CreateScene.js"(exports2, module2) {
|
|
4191
|
+
module2.exports = /* @__PURE__ */ __name(function CreateScene2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
4192
|
+
if (!requestData)
|
|
4193
|
+
requestData = {};
|
|
4194
|
+
const pathParams = null;
|
|
4195
|
+
const { data, query, headers } = requestData;
|
|
4196
|
+
let url = "/scenes";
|
|
4197
|
+
if (pathParams && data) {
|
|
4198
|
+
for (const param of pathParams) {
|
|
4199
|
+
const paramName = param.replace(":", "");
|
|
4200
|
+
url = url.replace(param, data[paramName]);
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4203
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
4204
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
4205
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
4206
|
+
return Promise.reject(
|
|
4207
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
4208
|
+
);
|
|
4209
|
+
}
|
|
4210
|
+
const config = {
|
|
4211
|
+
method: "post",
|
|
4212
|
+
url,
|
|
4213
|
+
...httpConfigOptions
|
|
4214
|
+
};
|
|
4215
|
+
if (data)
|
|
4216
|
+
config.data = data;
|
|
4217
|
+
if (query)
|
|
4218
|
+
config.params = query;
|
|
4219
|
+
if (headers)
|
|
4220
|
+
config.headers = headers;
|
|
4221
|
+
return this._http.request(config);
|
|
4222
|
+
}, "CreateScene");
|
|
4223
|
+
}
|
|
4224
|
+
});
|
|
4225
|
+
|
|
4150
4226
|
// dist/useCases/CreateDefaultScenes.js
|
|
4151
4227
|
var require_CreateDefaultScenes = __commonJS({
|
|
4152
4228
|
"dist/useCases/CreateDefaultScenes.js"(exports2, module2) {
|
|
@@ -6373,6 +6449,7 @@ var DeleteWindowCovering = require_DeleteWindowCovering();
|
|
|
6373
6449
|
var DescribeWindowCovering = require_DescribeWindowCovering();
|
|
6374
6450
|
var SetWindowCovering = require_SetWindowCovering();
|
|
6375
6451
|
var SetRoomScene = require_SetRoomScene();
|
|
6452
|
+
var SetCustomScene = require_SetCustomScene();
|
|
6376
6453
|
var AddScenesToRoom = require_AddScenesToRoom();
|
|
6377
6454
|
var AddDefaultScenesToRooms = require_AddDefaultScenesToRooms();
|
|
6378
6455
|
var CreateTicket = require_CreateTicket();
|
|
@@ -6385,6 +6462,7 @@ var UpdateMessageReadStatus = require_UpdateMessageReadStatus();
|
|
|
6385
6462
|
var UpdateTicket = require_UpdateTicket();
|
|
6386
6463
|
var UpdateTicketStatus = require_UpdateTicketStatus();
|
|
6387
6464
|
var ListScenes = require_ListScenes();
|
|
6465
|
+
var CreateScene = require_CreateScene();
|
|
6388
6466
|
var CreateDefaultScenes = require_CreateDefaultScenes();
|
|
6389
6467
|
var CreateDiscoveredDevice = require_CreateDiscoveredDevice();
|
|
6390
6468
|
var ListDiscoveredDevices = require_ListDiscoveredDevices();
|
|
@@ -6464,8 +6542,6 @@ var KohostApiClient = class _KohostApiClient extends EventEmitter {
|
|
|
6464
6542
|
super();
|
|
6465
6543
|
if (!options.url)
|
|
6466
6544
|
throw new Error("options.url is required");
|
|
6467
|
-
if (!options.propertyId)
|
|
6468
|
-
throw new Error("options.property is required");
|
|
6469
6545
|
this.options = options;
|
|
6470
6546
|
this.isBrowser = typeof window !== "undefined";
|
|
6471
6547
|
this.isRefreshingToken = false;
|
|
@@ -6476,13 +6552,18 @@ var KohostApiClient = class _KohostApiClient extends EventEmitter {
|
|
|
6476
6552
|
headers: {
|
|
6477
6553
|
"Content-Type": "application/json",
|
|
6478
6554
|
Accept: "application/json",
|
|
6479
|
-
[_KohostApiClient.defs.propertyHeader]: options.propertyId,
|
|
6480
6555
|
...options.headers
|
|
6481
6556
|
}
|
|
6482
6557
|
};
|
|
6483
6558
|
if (options.apiKey) {
|
|
6484
6559
|
config.headers[_KohostApiClient.defs.apiKeyHeader] = options.apiKey;
|
|
6485
6560
|
}
|
|
6561
|
+
if (options.propertyId) {
|
|
6562
|
+
config.headers[_KohostApiClient.defs.propertyHeader] = options.propertyId;
|
|
6563
|
+
}
|
|
6564
|
+
if (options.organizationId) {
|
|
6565
|
+
config.headers[_KohostApiClient.defs.organizationHeader] = options.organizationId;
|
|
6566
|
+
}
|
|
6486
6567
|
this._http = axios.create(config);
|
|
6487
6568
|
this._http.interceptors.response.use(
|
|
6488
6569
|
this._handleResponse.bind(this),
|
|
@@ -6492,7 +6573,8 @@ var KohostApiClient = class _KohostApiClient extends EventEmitter {
|
|
|
6492
6573
|
static get defs() {
|
|
6493
6574
|
return {
|
|
6494
6575
|
apiKeyHeader: "X-Api-Key",
|
|
6495
|
-
propertyHeader: "X-Property-Id"
|
|
6576
|
+
propertyHeader: "X-Property-Id",
|
|
6577
|
+
organizationHeader: "X-Organization-Id"
|
|
6496
6578
|
};
|
|
6497
6579
|
}
|
|
6498
6580
|
_handleResponse(response) {
|
|
@@ -6650,6 +6732,7 @@ KohostApiClient.prototype.DeleteWindowCovering = DeleteWindowCovering;
|
|
|
6650
6732
|
KohostApiClient.prototype.DescribeWindowCovering = DescribeWindowCovering;
|
|
6651
6733
|
KohostApiClient.prototype.SetWindowCovering = SetWindowCovering;
|
|
6652
6734
|
KohostApiClient.prototype.SetRoomScene = SetRoomScene;
|
|
6735
|
+
KohostApiClient.prototype.SetCustomScene = SetCustomScene;
|
|
6653
6736
|
KohostApiClient.prototype.AddScenesToRoom = AddScenesToRoom;
|
|
6654
6737
|
KohostApiClient.prototype.AddDefaultScenesToRooms = AddDefaultScenesToRooms;
|
|
6655
6738
|
KohostApiClient.prototype.CreateTicket = CreateTicket;
|
|
@@ -6662,6 +6745,7 @@ KohostApiClient.prototype.UpdateMessageReadStatus = UpdateMessageReadStatus;
|
|
|
6662
6745
|
KohostApiClient.prototype.UpdateTicket = UpdateTicket;
|
|
6663
6746
|
KohostApiClient.prototype.UpdateTicketStatus = UpdateTicketStatus;
|
|
6664
6747
|
KohostApiClient.prototype.ListScenes = ListScenes;
|
|
6748
|
+
KohostApiClient.prototype.CreateScene = CreateScene;
|
|
6665
6749
|
KohostApiClient.prototype.CreateDefaultScenes = CreateDefaultScenes;
|
|
6666
6750
|
KohostApiClient.prototype.CreateDiscoveredDevice = CreateDiscoveredDevice;
|
|
6667
6751
|
KohostApiClient.prototype.ListDiscoveredDevices = ListDiscoveredDevices;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const Event = require("./Event");
|
|
2
|
+
|
|
3
|
+
class ReservationCheckInEvent extends Event {
|
|
4
|
+
constructor(reservation) {
|
|
5
|
+
super(reservation);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
get name() {
|
|
9
|
+
return "ReservationCheckIn";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
get routingKey() {
|
|
13
|
+
return `${this.data[0].organizationId || "#"}.${
|
|
14
|
+
this.data[0].propertyId || "#"
|
|
15
|
+
}.reservation.ReservationCheckIn`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static get entity() {
|
|
19
|
+
return "reservation";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
module.exports = ReservationCheckInEvent;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const Event = require("./Event");
|
|
2
|
+
|
|
3
|
+
class ReservationCheckOutEvent extends Event {
|
|
4
|
+
constructor(reservation) {
|
|
5
|
+
super(reservation);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
get name() {
|
|
9
|
+
return "ReservationCheckIn";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
get routingKey() {
|
|
13
|
+
return `${this.data[0].organizationId || "#"}.${
|
|
14
|
+
this.data[0].propertyId || "#"
|
|
15
|
+
}.reservation.ReservationCheckOut`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static get entity() {
|
|
19
|
+
return "reservation";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
module.exports = ReservationCheckOutEvent;
|
package/dist/cjs/Events/index.js
CHANGED
|
@@ -30,6 +30,10 @@ const ShortLinkCreatedEvent = require("./ShortLinkCreatedEvent");
|
|
|
30
30
|
const ApplicationInUseEvent = require("./ApplicationInUseEvent");
|
|
31
31
|
const ApplicationOutOfUseEvent = require("./ApplicationOutOfUseEvent");
|
|
32
32
|
|
|
33
|
+
const ReservationCheckInEvent = require("./ReservationCheckInEvent");
|
|
34
|
+
const ReservationCheckOutEvent = require("./ReservationCheckOutEvent");
|
|
35
|
+
|
|
36
|
+
|
|
33
37
|
// Delete Events
|
|
34
38
|
const SystemEntityDeletedEvent = require("./SystemEntityDeletedEvent");
|
|
35
39
|
|
|
@@ -62,4 +66,6 @@ module.exports = {
|
|
|
62
66
|
ShortLinkCreatedEvent,
|
|
63
67
|
ApplicationInUseEvent,
|
|
64
68
|
ApplicationOutOfUseEvent,
|
|
69
|
+
ReservationCheckInEvent,
|
|
70
|
+
ReservationCheckOutEvent
|
|
65
71
|
};
|
|
@@ -5,7 +5,6 @@ module.exports = class SocketIoClient extends EventEmitter {
|
|
|
5
5
|
constructor(config = { url: null, propertyId: null, options: {} }) {
|
|
6
6
|
super();
|
|
7
7
|
if (!config.url) throw new Error("Websocket URL / endpoint not provided");
|
|
8
|
-
if (!config.propertyId) throw new Error("Property ID not provided");
|
|
9
8
|
this.url = config.url;
|
|
10
9
|
this.propertyId = config.propertyId;
|
|
11
10
|
this.options = {
|
|
@@ -154,5 +154,17 @@ export interface Alarm {
|
|
|
154
154
|
bypassed?: boolean | null;
|
|
155
155
|
}[];
|
|
156
156
|
watts?: number;
|
|
157
|
+
address?: Address;
|
|
158
|
+
[k: string]: unknown;
|
|
159
|
+
}
|
|
160
|
+
export interface Address {
|
|
161
|
+
id?: string;
|
|
162
|
+
line1?: string;
|
|
163
|
+
line2?: string;
|
|
164
|
+
line3?: string;
|
|
165
|
+
city?: string;
|
|
166
|
+
state?: string;
|
|
167
|
+
postalCode?: string;
|
|
168
|
+
countryCode?: string;
|
|
157
169
|
[k: string]: unknown;
|
|
158
170
|
}
|
|
@@ -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" | "publicKey" | "id";
|
|
39
|
+
discriminator?: "verificationCode" | "token" | "mobileKey" | "pin" | "publicKey" | "passkeyChallenge" | "id";
|
|
40
40
|
credential: string;
|
|
41
41
|
user?: string;
|
|
42
42
|
organization?: string;
|
|
@@ -496,6 +496,7 @@ export interface WindowCovering {
|
|
|
496
496
|
| "discPlayer"
|
|
497
497
|
| "mediaPlayer"
|
|
498
498
|
| "uncontrolledDevice";
|
|
499
|
+
discriminator?: "basic" | "variable";
|
|
499
500
|
supportedNotifications?: SupportedNotifications;
|
|
500
501
|
notification?: {
|
|
501
502
|
name?:
|
|
@@ -554,7 +555,7 @@ export interface WindowCovering {
|
|
|
554
555
|
| "cloudflare-stream"
|
|
555
556
|
| "insperia-privacy";
|
|
556
557
|
offline?: boolean;
|
|
557
|
-
position: number;
|
|
558
|
+
position: number | null;
|
|
558
559
|
systemId?: string;
|
|
559
560
|
watts?: number;
|
|
560
561
|
[k: string]: unknown;
|
|
@@ -1099,5 +1100,17 @@ export interface Alarm {
|
|
|
1099
1100
|
bypassed?: boolean | null;
|
|
1100
1101
|
}[];
|
|
1101
1102
|
watts?: number;
|
|
1103
|
+
address?: Address;
|
|
1104
|
+
[k: string]: unknown;
|
|
1105
|
+
}
|
|
1106
|
+
export interface Address {
|
|
1107
|
+
id?: string;
|
|
1108
|
+
line1?: string;
|
|
1109
|
+
line2?: string;
|
|
1110
|
+
line3?: string;
|
|
1111
|
+
city?: string;
|
|
1112
|
+
state?: string;
|
|
1113
|
+
postalCode?: string;
|
|
1114
|
+
countryCode?: string;
|
|
1102
1115
|
[k: string]: unknown;
|
|
1103
1116
|
}
|
|
@@ -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?: {
|
|
@@ -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:
|
|
@@ -140,7 +141,7 @@ export interface WindowCovering {
|
|
|
140
141
|
| "cloudflare-stream"
|
|
141
142
|
| "insperia-privacy";
|
|
142
143
|
offline?: boolean;
|
|
143
|
-
position: number;
|
|
144
|
+
position: number | null;
|
|
144
145
|
systemId?: string;
|
|
145
146
|
watts?: number;
|
|
146
147
|
[k: string]: unknown;
|
|
@@ -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
|
},
|
package/dist/esm/Client.js
CHANGED
|
@@ -3691,6 +3691,44 @@ var require_SetRoomScene = __commonJS({
|
|
|
3691
3691
|
}
|
|
3692
3692
|
});
|
|
3693
3693
|
|
|
3694
|
+
// dist/useCases/SetCustomScene.js
|
|
3695
|
+
var require_SetCustomScene = __commonJS({
|
|
3696
|
+
"dist/useCases/SetCustomScene.js"(exports, module) {
|
|
3697
|
+
module.exports = /* @__PURE__ */ __name(function SetCustomScene(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
3698
|
+
if (!requestData)
|
|
3699
|
+
requestData = {};
|
|
3700
|
+
const pathParams = [":id"];
|
|
3701
|
+
const { data, query, headers } = requestData;
|
|
3702
|
+
let url = "/scenes/:id";
|
|
3703
|
+
if (pathParams && data) {
|
|
3704
|
+
for (const param of pathParams) {
|
|
3705
|
+
const paramName = param.replace(":", "");
|
|
3706
|
+
url = url.replace(param, data[paramName]);
|
|
3707
|
+
}
|
|
3708
|
+
}
|
|
3709
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
3710
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
3711
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
3712
|
+
return Promise.reject(
|
|
3713
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
3714
|
+
);
|
|
3715
|
+
}
|
|
3716
|
+
const config = {
|
|
3717
|
+
method: "post",
|
|
3718
|
+
url,
|
|
3719
|
+
...httpConfigOptions
|
|
3720
|
+
};
|
|
3721
|
+
if (data)
|
|
3722
|
+
config.data = data;
|
|
3723
|
+
if (query)
|
|
3724
|
+
config.params = query;
|
|
3725
|
+
if (headers)
|
|
3726
|
+
config.headers = headers;
|
|
3727
|
+
return this._http.request(config);
|
|
3728
|
+
}, "SetCustomScene");
|
|
3729
|
+
}
|
|
3730
|
+
});
|
|
3731
|
+
|
|
3694
3732
|
// dist/useCases/AddScenesToRoom.js
|
|
3695
3733
|
var require_AddScenesToRoom = __commonJS({
|
|
3696
3734
|
"dist/useCases/AddScenesToRoom.js"(exports, module) {
|
|
@@ -4147,6 +4185,44 @@ var require_ListScenes = __commonJS({
|
|
|
4147
4185
|
}
|
|
4148
4186
|
});
|
|
4149
4187
|
|
|
4188
|
+
// dist/useCases/CreateScene.js
|
|
4189
|
+
var require_CreateScene = __commonJS({
|
|
4190
|
+
"dist/useCases/CreateScene.js"(exports, module) {
|
|
4191
|
+
module.exports = /* @__PURE__ */ __name(function CreateScene(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
4192
|
+
if (!requestData)
|
|
4193
|
+
requestData = {};
|
|
4194
|
+
const pathParams = null;
|
|
4195
|
+
const { data, query, headers } = requestData;
|
|
4196
|
+
let url = "/scenes";
|
|
4197
|
+
if (pathParams && data) {
|
|
4198
|
+
for (const param of pathParams) {
|
|
4199
|
+
const paramName = param.replace(":", "");
|
|
4200
|
+
url = url.replace(param, data[paramName]);
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4203
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
4204
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
4205
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
4206
|
+
return Promise.reject(
|
|
4207
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
4208
|
+
);
|
|
4209
|
+
}
|
|
4210
|
+
const config = {
|
|
4211
|
+
method: "post",
|
|
4212
|
+
url,
|
|
4213
|
+
...httpConfigOptions
|
|
4214
|
+
};
|
|
4215
|
+
if (data)
|
|
4216
|
+
config.data = data;
|
|
4217
|
+
if (query)
|
|
4218
|
+
config.params = query;
|
|
4219
|
+
if (headers)
|
|
4220
|
+
config.headers = headers;
|
|
4221
|
+
return this._http.request(config);
|
|
4222
|
+
}, "CreateScene");
|
|
4223
|
+
}
|
|
4224
|
+
});
|
|
4225
|
+
|
|
4150
4226
|
// dist/useCases/CreateDefaultScenes.js
|
|
4151
4227
|
var require_CreateDefaultScenes = __commonJS({
|
|
4152
4228
|
"dist/useCases/CreateDefaultScenes.js"(exports, module) {
|
|
@@ -8859,6 +8935,7 @@ var require_Client = __commonJS({
|
|
|
8859
8935
|
var DescribeWindowCovering = require_DescribeWindowCovering();
|
|
8860
8936
|
var SetWindowCovering = require_SetWindowCovering();
|
|
8861
8937
|
var SetRoomScene = require_SetRoomScene();
|
|
8938
|
+
var SetCustomScene = require_SetCustomScene();
|
|
8862
8939
|
var AddScenesToRoom = require_AddScenesToRoom();
|
|
8863
8940
|
var AddDefaultScenesToRooms = require_AddDefaultScenesToRooms();
|
|
8864
8941
|
var CreateTicket = require_CreateTicket();
|
|
@@ -8871,6 +8948,7 @@ var require_Client = __commonJS({
|
|
|
8871
8948
|
var UpdateTicket = require_UpdateTicket();
|
|
8872
8949
|
var UpdateTicketStatus = require_UpdateTicketStatus();
|
|
8873
8950
|
var ListScenes = require_ListScenes();
|
|
8951
|
+
var CreateScene = require_CreateScene();
|
|
8874
8952
|
var CreateDefaultScenes = require_CreateDefaultScenes();
|
|
8875
8953
|
var CreateDiscoveredDevice = require_CreateDiscoveredDevice();
|
|
8876
8954
|
var ListDiscoveredDevices = require_ListDiscoveredDevices();
|
|
@@ -8950,8 +9028,6 @@ var require_Client = __commonJS({
|
|
|
8950
9028
|
super();
|
|
8951
9029
|
if (!options.url)
|
|
8952
9030
|
throw new Error("options.url is required");
|
|
8953
|
-
if (!options.propertyId)
|
|
8954
|
-
throw new Error("options.property is required");
|
|
8955
9031
|
this.options = options;
|
|
8956
9032
|
this.isBrowser = typeof window !== "undefined";
|
|
8957
9033
|
this.isRefreshingToken = false;
|
|
@@ -8962,13 +9038,18 @@ var require_Client = __commonJS({
|
|
|
8962
9038
|
headers: {
|
|
8963
9039
|
"Content-Type": "application/json",
|
|
8964
9040
|
Accept: "application/json",
|
|
8965
|
-
[_KohostApiClient.defs.propertyHeader]: options.propertyId,
|
|
8966
9041
|
...options.headers
|
|
8967
9042
|
}
|
|
8968
9043
|
};
|
|
8969
9044
|
if (options.apiKey) {
|
|
8970
9045
|
config.headers[_KohostApiClient.defs.apiKeyHeader] = options.apiKey;
|
|
8971
9046
|
}
|
|
9047
|
+
if (options.propertyId) {
|
|
9048
|
+
config.headers[_KohostApiClient.defs.propertyHeader] = options.propertyId;
|
|
9049
|
+
}
|
|
9050
|
+
if (options.organizationId) {
|
|
9051
|
+
config.headers[_KohostApiClient.defs.organizationHeader] = options.organizationId;
|
|
9052
|
+
}
|
|
8972
9053
|
this._http = axios.create(config);
|
|
8973
9054
|
this._http.interceptors.response.use(
|
|
8974
9055
|
this._handleResponse.bind(this),
|
|
@@ -8978,7 +9059,8 @@ var require_Client = __commonJS({
|
|
|
8978
9059
|
static get defs() {
|
|
8979
9060
|
return {
|
|
8980
9061
|
apiKeyHeader: "X-Api-Key",
|
|
8981
|
-
propertyHeader: "X-Property-Id"
|
|
9062
|
+
propertyHeader: "X-Property-Id",
|
|
9063
|
+
organizationHeader: "X-Organization-Id"
|
|
8982
9064
|
};
|
|
8983
9065
|
}
|
|
8984
9066
|
_handleResponse(response) {
|
|
@@ -9136,6 +9218,7 @@ var require_Client = __commonJS({
|
|
|
9136
9218
|
KohostApiClient.prototype.DescribeWindowCovering = DescribeWindowCovering;
|
|
9137
9219
|
KohostApiClient.prototype.SetWindowCovering = SetWindowCovering;
|
|
9138
9220
|
KohostApiClient.prototype.SetRoomScene = SetRoomScene;
|
|
9221
|
+
KohostApiClient.prototype.SetCustomScene = SetCustomScene;
|
|
9139
9222
|
KohostApiClient.prototype.AddScenesToRoom = AddScenesToRoom;
|
|
9140
9223
|
KohostApiClient.prototype.AddDefaultScenesToRooms = AddDefaultScenesToRooms;
|
|
9141
9224
|
KohostApiClient.prototype.CreateTicket = CreateTicket;
|
|
@@ -9148,6 +9231,7 @@ var require_Client = __commonJS({
|
|
|
9148
9231
|
KohostApiClient.prototype.UpdateTicket = UpdateTicket;
|
|
9149
9232
|
KohostApiClient.prototype.UpdateTicketStatus = UpdateTicketStatus;
|
|
9150
9233
|
KohostApiClient.prototype.ListScenes = ListScenes;
|
|
9234
|
+
KohostApiClient.prototype.CreateScene = CreateScene;
|
|
9151
9235
|
KohostApiClient.prototype.CreateDefaultScenes = CreateDefaultScenes;
|
|
9152
9236
|
KohostApiClient.prototype.CreateDiscoveredDevice = CreateDiscoveredDevice;
|
|
9153
9237
|
KohostApiClient.prototype.ListDiscoveredDevices = ListDiscoveredDevices;
|