@kohost/api-client 3.0.0-beta.54 → 3.0.0-beta.56
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/AMQPClient/index.js +1 -0
- package/dist/cjs/Client/index.js +40 -0
- package/dist/cjs/Errors/ConflictError.js +9 -0
- package/dist/cjs/Errors/index.js +1 -0
- package/dist/cjs/Events/SceneSetEvent.js +17 -0
- package/dist/cjs/Events/index.js +3 -0
- package/dist/cjs/Models/Identification.js +1 -1
- package/dist/cjs/Models/Notification.js +34 -0
- package/dist/cjs/Models/Order.js +48 -0
- package/dist/cjs/Models/Reservation.js +10 -0
- package/dist/cjs/Models/Scene.js +15 -35
- package/dist/cjs/Models/User.js +36 -0
- package/dist/cjs/Models/index.js +4 -0
- package/dist/cjs/schemas/AlarmSchema.d.ts +150 -0
- package/dist/cjs/schemas/CameraSchema.d.ts +142 -0
- package/dist/cjs/schemas/CourtesySchema.d.ts +140 -0
- package/dist/cjs/schemas/CredentialSchema.d.ts +22 -0
- package/dist/cjs/schemas/DefinitionsSchema.d.ts +10 -0
- package/dist/cjs/schemas/DimmerSchema.d.ts +140 -0
- package/dist/cjs/schemas/DiscoveredDeviceSchema.d.ts +39 -0
- package/dist/cjs/schemas/EmailMessageSchema.d.ts +52 -0
- package/dist/cjs/schemas/EnergyReportSchema.d.ts +57 -0
- package/dist/cjs/schemas/EnergyReportShardSchema.d.ts +61 -0
- package/dist/cjs/schemas/GatewaySchema.d.ts +137 -0
- package/dist/cjs/schemas/IdentificationSchema.d.ts +48 -0
- package/dist/cjs/schemas/LockSchema.d.ts +140 -0
- package/dist/cjs/schemas/MediaFileSchema.d.ts +46 -0
- package/dist/cjs/schemas/MediaSourceSchema.d.ts +237 -0
- package/dist/cjs/schemas/MotionSensorSchema.d.ts +136 -0
- package/dist/cjs/schemas/NotificationSchema.d.ts +57 -0
- package/dist/cjs/schemas/OrderSchema.d.ts +90 -0
- package/dist/cjs/schemas/OrganizationSchema.d.ts +33 -0
- package/dist/cjs/schemas/PaymentSchema.d.ts +36 -0
- package/dist/cjs/schemas/ProductSchema.d.ts +65 -0
- package/dist/cjs/schemas/PropertySchema.d.ts +119 -0
- package/dist/cjs/schemas/ReservationSchema.d.ts +89 -0
- package/dist/cjs/schemas/RoomSchema.d.ts +1035 -0
- package/dist/cjs/schemas/SceneSchema.d.ts +57 -0
- package/dist/cjs/schemas/ShortLinkSchema.d.ts +23 -0
- package/dist/cjs/schemas/SmsMessageSchema.d.ts +43 -0
- package/dist/cjs/schemas/SpaceSchema.d.ts +64 -0
- package/dist/cjs/schemas/SpaceTypeSchema.d.ts +80 -0
- package/dist/cjs/schemas/SwitchSchema.d.ts +140 -0
- package/dist/cjs/schemas/SystemUserSchema.d.ts +184 -0
- package/dist/cjs/schemas/ThermostatSchema.d.ts +170 -0
- package/dist/cjs/schemas/TicketSchema.d.ts +76 -0
- package/dist/cjs/schemas/UserSchema.d.ts +259 -0
- package/dist/cjs/schemas/WindowCoveringSchema.d.ts +139 -0
- package/dist/cjs/schemas/alarm.json +7 -21
- package/dist/cjs/schemas/camera.json +1 -1
- package/dist/cjs/schemas/courtesy.json +3 -0
- package/dist/cjs/schemas/dimmer.json +3 -0
- package/dist/cjs/schemas/mediaSource.json +3 -0
- package/dist/cjs/schemas/notification.json +29 -0
- package/dist/cjs/schemas/order.json +179 -0
- package/dist/cjs/schemas/space.json +5 -1
- package/dist/cjs/schemas/spaceType.json +6 -0
- package/dist/cjs/schemas/switch.json +3 -0
- package/dist/cjs/schemas/windowCovering.json +4 -4
- package/dist/esm/Client.js +40 -0
- package/dist/esm/Client.js.map +3 -3
- package/dist/esm/Commands.js +18 -0
- package/dist/esm/Commands.js.map +3 -3
- package/dist/esm/Errors.js +18 -0
- package/dist/esm/Errors.js.map +3 -3
- package/dist/esm/Events.js +24 -0
- package/dist/esm/Events.js.map +3 -3
- package/dist/esm/Models.js +418 -119
- package/dist/esm/Models.js.map +3 -3
- package/dist/esm/utils.js +18 -0
- package/dist/esm/utils.js.map +3 -3
- package/dist/useCases/RequestPWAToken.js +32 -0
- package/package.json +1 -1
package/dist/cjs/Client/index.js
CHANGED
|
@@ -157,6 +157,44 @@ var require_RequestMyKeyToken = __commonJS({
|
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
159
|
|
|
160
|
+
// dist/useCases/RequestPWAToken.js
|
|
161
|
+
var require_RequestPWAToken = __commonJS({
|
|
162
|
+
"dist/useCases/RequestPWAToken.js"(exports2, module2) {
|
|
163
|
+
module2.exports = /* @__PURE__ */ __name(function RequestPWAToken2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
164
|
+
if (!requestData)
|
|
165
|
+
requestData = {};
|
|
166
|
+
const pathParams = null;
|
|
167
|
+
const { data, query, headers } = requestData;
|
|
168
|
+
let url = "/auth/pwaToken";
|
|
169
|
+
if (pathParams && data) {
|
|
170
|
+
for (const param of pathParams) {
|
|
171
|
+
const paramName = param.replace(":", "");
|
|
172
|
+
url = url.replace(param, data[paramName]);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
176
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
177
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
178
|
+
return Promise.reject(
|
|
179
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
const config = {
|
|
183
|
+
method: "get",
|
|
184
|
+
url,
|
|
185
|
+
...httpConfigOptions
|
|
186
|
+
};
|
|
187
|
+
if (data)
|
|
188
|
+
config.data = data;
|
|
189
|
+
if (query)
|
|
190
|
+
config.params = query;
|
|
191
|
+
if (headers)
|
|
192
|
+
config.headers = headers;
|
|
193
|
+
return this._http.request(config);
|
|
194
|
+
}, "RequestPWAToken");
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
|
|
160
198
|
// dist/useCases/LogoutUser.js
|
|
161
199
|
var require_LogoutUser = __commonJS({
|
|
162
200
|
"dist/useCases/LogoutUser.js"(exports2, module2) {
|
|
@@ -5596,6 +5634,7 @@ var LoginUser = require_LoginUser();
|
|
|
5596
5634
|
var RefreshToken = require_RefreshToken();
|
|
5597
5635
|
var RequestLoginLink = require_RequestLoginLink();
|
|
5598
5636
|
var RequestMyKeyToken = require_RequestMyKeyToken();
|
|
5637
|
+
var RequestPWAToken = require_RequestPWAToken();
|
|
5599
5638
|
var LogoutUser = require_LogoutUser();
|
|
5600
5639
|
var DescribeSelf = require_DescribeSelf();
|
|
5601
5640
|
var DescribeUser = require_DescribeUser();
|
|
@@ -5855,6 +5894,7 @@ KohostApiClient.prototype.LoginUser = LoginUser;
|
|
|
5855
5894
|
KohostApiClient.prototype.RefreshToken = RefreshToken;
|
|
5856
5895
|
KohostApiClient.prototype.RequestLoginLink = RequestLoginLink;
|
|
5857
5896
|
KohostApiClient.prototype.RequestMyKeyToken = RequestMyKeyToken;
|
|
5897
|
+
KohostApiClient.prototype.RequestPWAToken = RequestPWAToken;
|
|
5858
5898
|
KohostApiClient.prototype.LogoutUser = LogoutUser;
|
|
5859
5899
|
KohostApiClient.prototype.DescribeSelf = DescribeSelf;
|
|
5860
5900
|
KohostApiClient.prototype.DescribeUser = DescribeUser;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const AppError = require("./AppError");
|
|
2
|
+
|
|
3
|
+
module.exports = class ConflictError extends AppError {
|
|
4
|
+
constructor(message = "Bad Request", options = {}) {
|
|
5
|
+
super(message, options);
|
|
6
|
+
this.statusCode = 409;
|
|
7
|
+
Object.setPrototypeOf(this, ConflictError.prototype);
|
|
8
|
+
}
|
|
9
|
+
};
|
package/dist/cjs/Errors/index.js
CHANGED
|
@@ -2,6 +2,7 @@ const Errors = {
|
|
|
2
2
|
AppError: require("./AppError"),
|
|
3
3
|
AuthenticationError: require("./AuthenticationError"),
|
|
4
4
|
AuthorizationError: require("./AuthorizationError"),
|
|
5
|
+
ConflictError: require("./ConflictError"),
|
|
5
6
|
DeviceCommError: require("./DeviceCommError"),
|
|
6
7
|
LoginError: require("./LoginError"),
|
|
7
8
|
NotFoundError: require("./NotFoundError"),
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const Event = require("./Event");
|
|
2
|
+
|
|
3
|
+
class SceneSetEvent extends Event {
|
|
4
|
+
constructor(scene) {
|
|
5
|
+
super(scene);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
get name() {
|
|
9
|
+
return "SceneSet";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
get routingKey() {
|
|
13
|
+
return `scene.${this.keyId}.updated`;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
module.exports = SceneSetEvent;
|
package/dist/cjs/Events/index.js
CHANGED
|
@@ -11,6 +11,8 @@ const SystemCourtesyUpdatedEvent = require("./SystemCourtesyUpdatedEvent");
|
|
|
11
11
|
const SystemAlarmUpdatedEvent = require("./SystemAlarmUpdatedEvent");
|
|
12
12
|
const SystemMotionSensorUpdatedEvent = require("./SystemMotionSensorUpdatedEvent");
|
|
13
13
|
|
|
14
|
+
const SceneSetEvent = require("./SceneSetEvent");
|
|
15
|
+
|
|
14
16
|
const SystemUserUpdatedEvent = require("./SystemUserUpdatedEvent");
|
|
15
17
|
const SystemSpaceUpdatedEvent = require("./SystemSpaceUpdatedEvent");
|
|
16
18
|
const SystemSpaceTypeUpdatedEvent = require("./SystemSpaceTypeUpdatedEvent");
|
|
@@ -43,6 +45,7 @@ module.exports = {
|
|
|
43
45
|
SystemSpaceTypeUpdatedEvent,
|
|
44
46
|
SystemProductUpdatedEvent,
|
|
45
47
|
SystemReservationUpdatedEvent,
|
|
48
|
+
SceneSetEvent,
|
|
46
49
|
SMSEvent,
|
|
47
50
|
EmailEvent,
|
|
48
51
|
ShortLinkCreatedEvent,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const schemas = require("../utils/schema");
|
|
2
|
+
const schema = require("../schemas/notification.json");
|
|
3
|
+
const Kohost = require("./Kohost");
|
|
4
|
+
|
|
5
|
+
schemas.add(schema);
|
|
6
|
+
const validator = schemas.compile(schema);
|
|
7
|
+
|
|
8
|
+
class Notification extends Kohost {
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {import("../schemas/NotificationSchema").Notification} NotificationType
|
|
11
|
+
* Create a Notification instance.
|
|
12
|
+
* @constructor
|
|
13
|
+
* @param {NotificationType} property - The property object of type Notification.
|
|
14
|
+
*/
|
|
15
|
+
constructor(notification) {
|
|
16
|
+
super(notification);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Object.defineProperty(Notification.prototype, "schema", {
|
|
21
|
+
value: schema,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
Object.defineProperty(Notification.prototype, "validator", {
|
|
25
|
+
get: function () {
|
|
26
|
+
return validator;
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
Object.defineProperty(Notification, "validProperties", {
|
|
31
|
+
value: Object.keys(schema.properties),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
module.exports = Notification;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const schemas = require("../utils/schema");
|
|
2
|
+
const schema = require("../schemas/order.json");
|
|
3
|
+
const Kohost = require("./Kohost");
|
|
4
|
+
|
|
5
|
+
schemas.add(schema);
|
|
6
|
+
const validator = schemas.compile(schema);
|
|
7
|
+
|
|
8
|
+
class Order extends Kohost {
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {import("../schemas/OrderSchema").Order} OrderType
|
|
11
|
+
* Create a Order instance.
|
|
12
|
+
* @constructor
|
|
13
|
+
* @param {OrderType} order - The order object of type Order.
|
|
14
|
+
*/
|
|
15
|
+
constructor(order) {
|
|
16
|
+
super(order);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
getSubTotal() {
|
|
20
|
+
return this.items.reduce((acc, item) => {
|
|
21
|
+
return acc + item.price;
|
|
22
|
+
}, 0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
getTaxTotal() {}
|
|
26
|
+
|
|
27
|
+
getTotal() {}
|
|
28
|
+
|
|
29
|
+
getDeliveryTotal() {}
|
|
30
|
+
|
|
31
|
+
getFeesTotal() {}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
Object.defineProperty(Order.prototype, "schema", {
|
|
35
|
+
value: schema,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
Object.defineProperty(Order.prototype, "validator", {
|
|
39
|
+
get: function () {
|
|
40
|
+
return validator;
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
Object.defineProperty(Order, "validProperties", {
|
|
45
|
+
value: Object.keys(schema.properties),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
module.exports = Order;
|
|
@@ -24,6 +24,16 @@ class Reservation extends Kohost {
|
|
|
24
24
|
return this.paymentId?.length > 0;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
get nights() {
|
|
28
|
+
const start = new Date(this.checkInDateTime);
|
|
29
|
+
const end = new Date(this.checkOutDateTime);
|
|
30
|
+
let nights = Math.round((end - start) / (1000 * 60 * 60 * 24));
|
|
31
|
+
if (nights <= 0) {
|
|
32
|
+
nights = 1;
|
|
33
|
+
}
|
|
34
|
+
return nights;
|
|
35
|
+
}
|
|
36
|
+
|
|
27
37
|
range(tz) {
|
|
28
38
|
const start = new Date(this.checkInDateTime);
|
|
29
39
|
const end = new Date(this.checkOutDateTime);
|
package/dist/cjs/Models/Scene.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const schemas = require("../utils/schema");
|
|
2
2
|
const schema = require("../schemas/scene.json");
|
|
3
3
|
const Kohost = require("./Kohost");
|
|
4
|
-
const SetSceneCommand = require("../Commands/SetSceneCommand");
|
|
5
4
|
|
|
6
5
|
schemas.add(schema);
|
|
7
6
|
const validator = schemas.compile(schema);
|
|
@@ -17,8 +16,8 @@ class Scene extends Kohost {
|
|
|
17
16
|
super(scene);
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
static
|
|
21
|
-
const
|
|
19
|
+
static getRoomSceneDeviceData(room, scene, restore) {
|
|
20
|
+
const deviceData = [];
|
|
22
21
|
|
|
23
22
|
const sceneDevices = scene?.devices || {};
|
|
24
23
|
const sceneId = scene.id;
|
|
@@ -34,9 +33,12 @@ class Scene extends Kohost {
|
|
|
34
33
|
const { id, ...deviceProps } = data;
|
|
35
34
|
if (id === "*") {
|
|
36
35
|
for (const device of roomDevices) {
|
|
37
|
-
const driver = device.driver;
|
|
38
36
|
const deviceCmd = {
|
|
39
|
-
id: device.
|
|
37
|
+
id: device.id,
|
|
38
|
+
systemId: device.systemData?.id,
|
|
39
|
+
type: device.type,
|
|
40
|
+
driver: device.driver,
|
|
41
|
+
commandData: {},
|
|
40
42
|
};
|
|
41
43
|
for (const prop in deviceProps) {
|
|
42
44
|
if (prop === "setpointDelta") {
|
|
@@ -59,7 +61,7 @@ class Scene extends Kohost {
|
|
|
59
61
|
);
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
deviceCmd.setpoints = {
|
|
64
|
+
deviceCmd.commandData.setpoints = {
|
|
63
65
|
heat: {
|
|
64
66
|
value: setpointValue,
|
|
65
67
|
},
|
|
@@ -77,7 +79,7 @@ class Scene extends Kohost {
|
|
|
77
79
|
currentSetpoint.value - delta
|
|
78
80
|
);
|
|
79
81
|
}
|
|
80
|
-
deviceCmd.setpoints = {
|
|
82
|
+
deviceCmd.commandData.setpoints = {
|
|
81
83
|
cool: {
|
|
82
84
|
value: setpointValue,
|
|
83
85
|
},
|
|
@@ -113,7 +115,7 @@ class Scene extends Kohost {
|
|
|
113
115
|
continue;
|
|
114
116
|
}
|
|
115
117
|
|
|
116
|
-
deviceCmd.setpoints = {
|
|
118
|
+
deviceCmd.commandData.setpoints = {
|
|
117
119
|
heat: {
|
|
118
120
|
value: heatSetpoint,
|
|
119
121
|
},
|
|
@@ -129,29 +131,16 @@ class Scene extends Kohost {
|
|
|
129
131
|
continue;
|
|
130
132
|
}
|
|
131
133
|
} else {
|
|
132
|
-
deviceCmd[prop] = deviceProps[prop];
|
|
134
|
+
deviceCmd.commandData[prop] = deviceProps[prop];
|
|
133
135
|
}
|
|
134
136
|
}
|
|
135
137
|
|
|
136
|
-
// move to next loop if
|
|
137
|
-
if (Object.keys(deviceCmd).length ===
|
|
138
|
+
// move to next loop if no keys in command data
|
|
139
|
+
if (Object.keys(deviceCmd.commandData).length === 0) {
|
|
138
140
|
continue;
|
|
139
141
|
}
|
|
140
142
|
|
|
141
|
-
|
|
142
|
-
(c) => c.driver === driver
|
|
143
|
-
);
|
|
144
|
-
if (driverIndex >= 0) {
|
|
145
|
-
commandsByDriver[driverIndex].command.devices.push(deviceCmd);
|
|
146
|
-
} else {
|
|
147
|
-
commandsByDriver.push({
|
|
148
|
-
driver,
|
|
149
|
-
command: {
|
|
150
|
-
id: sceneId,
|
|
151
|
-
devices: [deviceCmd],
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
}
|
|
143
|
+
deviceData.push(deviceCmd);
|
|
155
144
|
}
|
|
156
145
|
}
|
|
157
146
|
/**
|
|
@@ -159,16 +148,7 @@ class Scene extends Kohost {
|
|
|
159
148
|
*/
|
|
160
149
|
}
|
|
161
150
|
}
|
|
162
|
-
|
|
163
|
-
const commands = commandsByDriver.map((c) => {
|
|
164
|
-
const command = new SetSceneCommand(c.command);
|
|
165
|
-
return {
|
|
166
|
-
driver: c.driver,
|
|
167
|
-
command,
|
|
168
|
-
};
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
return commands;
|
|
151
|
+
return deviceData;
|
|
172
152
|
}
|
|
173
153
|
}
|
|
174
154
|
|
package/dist/cjs/Models/User.js
CHANGED
|
@@ -5,6 +5,7 @@ const paymentSchema = require("../schemas/payment.json");
|
|
|
5
5
|
const Kohost = require("./Kohost");
|
|
6
6
|
const MediaFile = require("./MediaFile");
|
|
7
7
|
const Reservation = require("./Reservation");
|
|
8
|
+
const Identification = require("./Identification");
|
|
8
9
|
|
|
9
10
|
const { nanoid } = require("nanoid/async");
|
|
10
11
|
|
|
@@ -24,6 +25,11 @@ class User extends Kohost {
|
|
|
24
25
|
if (user.photo) user.photo = new MediaFile(user.photo);
|
|
25
26
|
if (user.reservations)
|
|
26
27
|
user.reservations = user.reservations.map((res) => new Reservation(res));
|
|
28
|
+
if (user.identifications)
|
|
29
|
+
user.identifications = user.identifications.map(
|
|
30
|
+
(id) => new Identification(id)
|
|
31
|
+
);
|
|
32
|
+
|
|
27
33
|
super(user);
|
|
28
34
|
}
|
|
29
35
|
|
|
@@ -76,4 +82,34 @@ Object.defineProperty(User.prototype, "roles", {
|
|
|
76
82
|
},
|
|
77
83
|
});
|
|
78
84
|
|
|
85
|
+
Object.defineProperty(User.prototype, "isSuperAdmin", {
|
|
86
|
+
get: function () {
|
|
87
|
+
return this.roles.includes("SuperAdmin");
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
Object.defineProperty(User.prototype, "isAdmin", {
|
|
92
|
+
get: function () {
|
|
93
|
+
return this.roles.includes("Admin") || this.roles.includes("Administrator");
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
Object.defineProperty(User.prototype, "isManager", {
|
|
98
|
+
get: function () {
|
|
99
|
+
return this.roles.includes("Manager");
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
Object.defineProperty(User.prototype, "isUser", {
|
|
104
|
+
get: function () {
|
|
105
|
+
return this.roles.includes("User");
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
Object.defineProperty(User.prototype, "isGuest", {
|
|
110
|
+
get: function () {
|
|
111
|
+
return this.roles.includes("Guest");
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
|
|
79
115
|
module.exports = User;
|
package/dist/cjs/Models/index.js
CHANGED
|
@@ -22,6 +22,7 @@ const Ticket = require("./Ticket");
|
|
|
22
22
|
const Scene = require("./Scene");
|
|
23
23
|
const Gateway = require("./Gateway");
|
|
24
24
|
const Product = require("./Product");
|
|
25
|
+
const Order = require("./Order");
|
|
25
26
|
const DiscoveredDevice = require("./DiscoveredDevice");
|
|
26
27
|
const Credential = require("./Credential");
|
|
27
28
|
const ShortLink = require("./ShortLink");
|
|
@@ -29,6 +30,7 @@ const EnergyReportShard = require("./EnergyReportShard");
|
|
|
29
30
|
const EnergyReport = require("./EnergyReport");
|
|
30
31
|
const SMSMessage = require("./SmsMessage");
|
|
31
32
|
const EmailMessage = require("./EmailMessage");
|
|
33
|
+
const Notification = require("./Notification");
|
|
32
34
|
|
|
33
35
|
const Property = require("./Property");
|
|
34
36
|
const Organization = require("./Organization");
|
|
@@ -65,4 +67,6 @@ module.exports = {
|
|
|
65
67
|
EnergyReport,
|
|
66
68
|
SMSMessage,
|
|
67
69
|
EmailMessage,
|
|
70
|
+
Order,
|
|
71
|
+
Notification,
|
|
68
72
|
};
|
|
@@ -0,0 +1,150 @@
|
|
|
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
|
+
export type SupportedNotifications = (
|
|
9
|
+
| "button 1"
|
|
10
|
+
| "button 2"
|
|
11
|
+
| "button 3"
|
|
12
|
+
| "button 4"
|
|
13
|
+
| "button 5"
|
|
14
|
+
| "idle"
|
|
15
|
+
| "powerHasBeedApplied"
|
|
16
|
+
| "acMainsDisconnected"
|
|
17
|
+
| "acMainsReconnected"
|
|
18
|
+
| "replaceBatterySoon"
|
|
19
|
+
| "replaceBatteryNow"
|
|
20
|
+
| "hardwareFailure"
|
|
21
|
+
| "softwareFailure"
|
|
22
|
+
| "hardwareFailureWithCode"
|
|
23
|
+
| "softwareFailureWithCode"
|
|
24
|
+
| "motionDetection"
|
|
25
|
+
| "airFilterNeedsCleaned"
|
|
26
|
+
| "smokeDetected"
|
|
27
|
+
| "outsideSafeTemperatureRange"
|
|
28
|
+
| "outsideSafeHumidityRange"
|
|
29
|
+
)[];
|
|
30
|
+
export type Notification = {
|
|
31
|
+
name?:
|
|
32
|
+
| "button 1"
|
|
33
|
+
| "button 2"
|
|
34
|
+
| "button 3"
|
|
35
|
+
| "button 4"
|
|
36
|
+
| "button 5"
|
|
37
|
+
| "idle"
|
|
38
|
+
| "powerHasBeedApplied"
|
|
39
|
+
| "acMainsDisconnected"
|
|
40
|
+
| "acMainsReconnected"
|
|
41
|
+
| "replaceBatterySoon"
|
|
42
|
+
| "replaceBatteryNow"
|
|
43
|
+
| "hardwareFailure"
|
|
44
|
+
| "softwareFailure"
|
|
45
|
+
| "hardwareFailureWithCode"
|
|
46
|
+
| "softwareFailureWithCode"
|
|
47
|
+
| "motionDetection"
|
|
48
|
+
| "airFilterNeedsCleaned"
|
|
49
|
+
| "smokeDetected"
|
|
50
|
+
| "outsideSafeTemperatureRange"
|
|
51
|
+
| "outsideSafeHumidityRange";
|
|
52
|
+
timestamp?: number;
|
|
53
|
+
description?: string;
|
|
54
|
+
[k: string]: unknown;
|
|
55
|
+
} & ({
|
|
56
|
+
name?:
|
|
57
|
+
| "button 1"
|
|
58
|
+
| "button 2"
|
|
59
|
+
| "button 3"
|
|
60
|
+
| "button 4"
|
|
61
|
+
| "button 5"
|
|
62
|
+
| "idle"
|
|
63
|
+
| "powerHasBeedApplied"
|
|
64
|
+
| "acMainsDisconnected"
|
|
65
|
+
| "acMainsReconnected"
|
|
66
|
+
| "replaceBatterySoon"
|
|
67
|
+
| "replaceBatteryNow"
|
|
68
|
+
| "hardwareFailure"
|
|
69
|
+
| "softwareFailure"
|
|
70
|
+
| "hardwareFailureWithCode"
|
|
71
|
+
| "softwareFailureWithCode"
|
|
72
|
+
| "motionDetection"
|
|
73
|
+
| "airFilterNeedsCleaned"
|
|
74
|
+
| "smokeDetected"
|
|
75
|
+
| "outsideSafeTemperatureRange"
|
|
76
|
+
| "outsideSafeHumidityRange";
|
|
77
|
+
timestamp?: number;
|
|
78
|
+
description?: string;
|
|
79
|
+
[k: string]: unknown;
|
|
80
|
+
} | null);
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Any smart alarm system
|
|
84
|
+
*/
|
|
85
|
+
export interface Alarm {
|
|
86
|
+
id: string;
|
|
87
|
+
name?: string;
|
|
88
|
+
offline?: boolean;
|
|
89
|
+
type:
|
|
90
|
+
| "alarm"
|
|
91
|
+
| "dimmer"
|
|
92
|
+
| "switch"
|
|
93
|
+
| "motionSensor"
|
|
94
|
+
| "windowCovering"
|
|
95
|
+
| "camera"
|
|
96
|
+
| "mediaSource"
|
|
97
|
+
| "thermostat"
|
|
98
|
+
| "lock"
|
|
99
|
+
| "courtesy"
|
|
100
|
+
| "gateway"
|
|
101
|
+
| "tv"
|
|
102
|
+
| "dvr"
|
|
103
|
+
| "appleTv"
|
|
104
|
+
| "discPlayer"
|
|
105
|
+
| "mediaPlayer"
|
|
106
|
+
| "uncontrolledDevice";
|
|
107
|
+
systemData: SystemData;
|
|
108
|
+
supportedNotifications?: SupportedNotifications;
|
|
109
|
+
notification?: Notification;
|
|
110
|
+
driver:
|
|
111
|
+
| "aws-kinesis"
|
|
112
|
+
| "butler"
|
|
113
|
+
| "crestron"
|
|
114
|
+
| "ecobee"
|
|
115
|
+
| "igor"
|
|
116
|
+
| "inncom"
|
|
117
|
+
| "kohost-k7"
|
|
118
|
+
| "kohost-pms"
|
|
119
|
+
| "lg"
|
|
120
|
+
| "lirc"
|
|
121
|
+
| "mews"
|
|
122
|
+
| "paxton"
|
|
123
|
+
| "pelican-wireless"
|
|
124
|
+
| "rebrandly"
|
|
125
|
+
| "salto"
|
|
126
|
+
| "salto-irn"
|
|
127
|
+
| "se"
|
|
128
|
+
| "sendgrid"
|
|
129
|
+
| "stay-n-touch"
|
|
130
|
+
| "twilio"
|
|
131
|
+
| "cloudflare-images"
|
|
132
|
+
| "cloudflare-stream"
|
|
133
|
+
| "insperia-privacy";
|
|
134
|
+
areas: {
|
|
135
|
+
number?: number;
|
|
136
|
+
name?: string;
|
|
137
|
+
securityMode?: "arming" | "disarming" | "armed" | "disarmed" | "alarm" | null;
|
|
138
|
+
readyToArm?: boolean | null;
|
|
139
|
+
}[];
|
|
140
|
+
zones: {
|
|
141
|
+
number?: number;
|
|
142
|
+
name?: string;
|
|
143
|
+
secure?: boolean;
|
|
144
|
+
bypassed?: boolean | null;
|
|
145
|
+
}[];
|
|
146
|
+
watts?: number;
|
|
147
|
+
}
|
|
148
|
+
export interface SystemData {
|
|
149
|
+
[k: string]: unknown;
|
|
150
|
+
}
|