@kohost/api-client 3.0.0-beta.12 → 3.0.0-beta.18
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.js +329 -712
- package/dist/cjs/Commands.js +49 -1
- package/dist/cjs/Events.js +44 -0
- package/dist/cjs/Models.js +326 -153
- package/dist/cjs/SocketIoClient.js +68 -0
- package/dist/cjs/defs.js +8 -31
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/esm/Client.js +329 -712
- package/dist/esm/Client.js.map +3 -3
- package/dist/esm/Commands.js +49 -1
- package/dist/esm/Commands.js.map +3 -3
- package/dist/esm/Events.js +44 -0
- package/dist/esm/Events.js.map +3 -3
- package/dist/esm/Models.js +319 -147
- package/dist/esm/Models.js.map +4 -4
- package/dist/esm/SocketIoClient.js +4533 -0
- package/dist/esm/SocketIoClient.js.map +7 -0
- package/dist/esm/defs.js +8 -31
- package/dist/esm/defs.js.map +2 -2
- package/dist/esm/index.js +2 -1
- package/dist/useCases/AdminUpdateCustomer.js +1 -1
- package/dist/useCases/{AdminListCustomers.js → CreateOrganization.js} +3 -3
- package/dist/useCases/{AdminLoginUser.js → CreateProperty.js} +2 -2
- package/dist/useCases/{AdminCreateAdminUser.js → DescribeOrganization.js} +4 -4
- package/dist/useCases/{ListIntegrations.js → DescribeProperty.js} +3 -3
- package/dist/useCases/{CreateIntegration.js → ListOrganizations.js} +3 -3
- package/dist/useCases/{AdminListAdminUsers.js → ListProperties.js} +2 -2
- package/dist/useCases/{DeleteIntegration.js → LogoutUser.js} +3 -3
- package/dist/useCases/{CreateIntegrationDeviceMapEntry.js → SendCheckInSMS.js} +2 -2
- package/dist/useCases/{UpdateIntegration.js → UpdateProperty.js} +2 -2
- package/package.json +3 -2
- package/dist/useCases/AdminCreateCustomer.js +0 -32
- package/dist/useCases/AdminCreateProperty.js +0 -32
- package/dist/useCases/AdminDescribeCustomer.js +0 -32
- package/dist/useCases/AdminDescribeProperty.js +0 -32
- package/dist/useCases/AdminListProperties.js +0 -32
- package/dist/useCases/AdminRefreshToken.js +0 -32
- package/dist/useCases/AdminRequestLoginLink.js +0 -32
- package/dist/useCases/AdminUpdateProperty.js +0 -32
- package/dist/useCases/DescribeIntegration.js +0 -32
package/dist/esm/Models.js
CHANGED
|
@@ -8327,7 +8327,7 @@ var require_thermostat = __commonJS({
|
|
|
8327
8327
|
type: "array",
|
|
8328
8328
|
uniqueItems: true,
|
|
8329
8329
|
items: {
|
|
8330
|
-
enum: ["auto", "low", "medium", "high", "off"]
|
|
8330
|
+
enum: ["auto", "low", "medium", "high", "off", "on"]
|
|
8331
8331
|
}
|
|
8332
8332
|
},
|
|
8333
8333
|
setpoints: {
|
|
@@ -8345,6 +8345,9 @@ var require_thermostat = __commonJS({
|
|
|
8345
8345
|
}
|
|
8346
8346
|
}
|
|
8347
8347
|
},
|
|
8348
|
+
minAutoDelta: {
|
|
8349
|
+
type: "number"
|
|
8350
|
+
},
|
|
8348
8351
|
batteryLevel: {
|
|
8349
8352
|
$ref: "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/batteryLevel"
|
|
8350
8353
|
},
|
|
@@ -8654,7 +8657,7 @@ var require_user = __commonJS({
|
|
|
8654
8657
|
$id: "https://api.kohost.app/schemas/v3/user.json",
|
|
8655
8658
|
title: "User",
|
|
8656
8659
|
type: "object",
|
|
8657
|
-
required: ["
|
|
8660
|
+
required: ["firstName", "lastName"],
|
|
8658
8661
|
properties: {
|
|
8659
8662
|
id: {
|
|
8660
8663
|
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
|
|
@@ -8663,10 +8666,6 @@ var require_user = __commonJS({
|
|
|
8663
8666
|
type: "string",
|
|
8664
8667
|
default: "user"
|
|
8665
8668
|
},
|
|
8666
|
-
active: {
|
|
8667
|
-
type: "boolean",
|
|
8668
|
-
default: true
|
|
8669
|
-
},
|
|
8670
8669
|
firstName: {
|
|
8671
8670
|
type: "string"
|
|
8672
8671
|
},
|
|
@@ -8711,32 +8710,44 @@ var require_user = __commonJS({
|
|
|
8711
8710
|
minLength: 2,
|
|
8712
8711
|
maxLength: 2
|
|
8713
8712
|
},
|
|
8714
|
-
|
|
8713
|
+
permissions: {
|
|
8715
8714
|
type: "array",
|
|
8715
|
+
default: [],
|
|
8716
8716
|
items: {
|
|
8717
|
-
type: "
|
|
8717
|
+
type: "object",
|
|
8718
|
+
required: ["organization", "property", "role"],
|
|
8719
|
+
properties: {
|
|
8720
|
+
organization: {
|
|
8721
|
+
type: "string",
|
|
8722
|
+
description: "The ID of the organization the permission is applies to."
|
|
8723
|
+
},
|
|
8724
|
+
property: {
|
|
8725
|
+
type: "string",
|
|
8726
|
+
description: "The ID of the property the permission is applies to."
|
|
8727
|
+
},
|
|
8728
|
+
role: {
|
|
8729
|
+
type: "string",
|
|
8730
|
+
enum: ["Guest", "User", "Manager", "Administrator", "SuperAdmin"]
|
|
8731
|
+
},
|
|
8732
|
+
customPermissions: {
|
|
8733
|
+
type: "array",
|
|
8734
|
+
items: {
|
|
8735
|
+
type: "string"
|
|
8736
|
+
}
|
|
8737
|
+
}
|
|
8738
|
+
}
|
|
8718
8739
|
}
|
|
8719
8740
|
},
|
|
8720
|
-
|
|
8741
|
+
notes: {
|
|
8721
8742
|
type: "array",
|
|
8722
8743
|
items: {
|
|
8723
|
-
|
|
8744
|
+
type: "string"
|
|
8724
8745
|
}
|
|
8725
8746
|
},
|
|
8726
|
-
|
|
8747
|
+
files: {
|
|
8727
8748
|
type: "array",
|
|
8728
8749
|
items: {
|
|
8729
|
-
|
|
8730
|
-
enum: [
|
|
8731
|
-
"Guest",
|
|
8732
|
-
"Staff",
|
|
8733
|
-
"Faculty",
|
|
8734
|
-
"Student",
|
|
8735
|
-
"Visitor",
|
|
8736
|
-
"Manager",
|
|
8737
|
-
"Administrator",
|
|
8738
|
-
"SuperAdmin"
|
|
8739
|
-
]
|
|
8750
|
+
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/file"
|
|
8740
8751
|
}
|
|
8741
8752
|
},
|
|
8742
8753
|
identifications: {
|
|
@@ -8751,25 +8762,6 @@ var require_user = __commonJS({
|
|
|
8751
8762
|
$ref: "https://api.kohost.app/schemas/v3/payment.json#"
|
|
8752
8763
|
}
|
|
8753
8764
|
},
|
|
8754
|
-
preferences: {
|
|
8755
|
-
type: "object",
|
|
8756
|
-
additionalProperties: false,
|
|
8757
|
-
properties: {
|
|
8758
|
-
notifications: {
|
|
8759
|
-
type: "array",
|
|
8760
|
-
items: {
|
|
8761
|
-
type: "string"
|
|
8762
|
-
},
|
|
8763
|
-
examples: [["roomControl", "marketing"]]
|
|
8764
|
-
},
|
|
8765
|
-
location: {
|
|
8766
|
-
title: "The location Schema",
|
|
8767
|
-
type: "boolean",
|
|
8768
|
-
default: false,
|
|
8769
|
-
examples: [true]
|
|
8770
|
-
}
|
|
8771
|
-
}
|
|
8772
|
-
},
|
|
8773
8765
|
location: {
|
|
8774
8766
|
type: "object",
|
|
8775
8767
|
required: ["accuracy", "latitude", "longitude", "timestamp"],
|
|
@@ -8789,31 +8781,6 @@ var require_user = __commonJS({
|
|
|
8789
8781
|
}
|
|
8790
8782
|
}
|
|
8791
8783
|
},
|
|
8792
|
-
registeredDevices: {
|
|
8793
|
-
type: "array",
|
|
8794
|
-
items: {
|
|
8795
|
-
type: "object",
|
|
8796
|
-
properties: {
|
|
8797
|
-
userAgent: {
|
|
8798
|
-
type: "string"
|
|
8799
|
-
},
|
|
8800
|
-
fingerPrint: {
|
|
8801
|
-
type: "string"
|
|
8802
|
-
},
|
|
8803
|
-
ip: {
|
|
8804
|
-
type: "string"
|
|
8805
|
-
},
|
|
8806
|
-
registeredAt: {
|
|
8807
|
-
type: "string",
|
|
8808
|
-
format: "date-time"
|
|
8809
|
-
},
|
|
8810
|
-
expiresAt: {
|
|
8811
|
-
type: "string",
|
|
8812
|
-
format: "date-time"
|
|
8813
|
-
}
|
|
8814
|
-
}
|
|
8815
|
-
}
|
|
8816
|
-
},
|
|
8817
8784
|
createdAt: {
|
|
8818
8785
|
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/createdAt"
|
|
8819
8786
|
},
|
|
@@ -8821,7 +8788,10 @@ var require_user = __commonJS({
|
|
|
8821
8788
|
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/updatedAt"
|
|
8822
8789
|
},
|
|
8823
8790
|
systemData: {
|
|
8824
|
-
|
|
8791
|
+
type: "array",
|
|
8792
|
+
items: {
|
|
8793
|
+
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/systemData"
|
|
8794
|
+
}
|
|
8825
8795
|
}
|
|
8826
8796
|
}
|
|
8827
8797
|
};
|
|
@@ -8857,6 +8827,9 @@ var require_payment = __commonJS({
|
|
|
8857
8827
|
"vpay"
|
|
8858
8828
|
]
|
|
8859
8829
|
},
|
|
8830
|
+
storageData: {
|
|
8831
|
+
type: ["string", "null"]
|
|
8832
|
+
},
|
|
8860
8833
|
maskedNumber: {
|
|
8861
8834
|
string: "string"
|
|
8862
8835
|
},
|
|
@@ -8965,10 +8938,161 @@ var require_user2 = __commonJS({
|
|
|
8965
8938
|
return `${this.firstName} ${this.lastName}`;
|
|
8966
8939
|
}
|
|
8967
8940
|
});
|
|
8941
|
+
Object.defineProperty(User.prototype, "roles", {
|
|
8942
|
+
get: function() {
|
|
8943
|
+
const roles = /* @__PURE__ */ new Set();
|
|
8944
|
+
if (this.permissions) {
|
|
8945
|
+
for (const permission of this.permissions) {
|
|
8946
|
+
roles.add(permission.role);
|
|
8947
|
+
}
|
|
8948
|
+
}
|
|
8949
|
+
return Array.from(roles);
|
|
8950
|
+
}
|
|
8951
|
+
});
|
|
8968
8952
|
module.exports = User;
|
|
8969
8953
|
}
|
|
8970
8954
|
});
|
|
8971
8955
|
|
|
8956
|
+
// src/schemas/systemUser.json
|
|
8957
|
+
var require_systemUser = __commonJS({
|
|
8958
|
+
"src/schemas/systemUser.json"(exports, module) {
|
|
8959
|
+
module.exports = {
|
|
8960
|
+
$schema: "http://json-schema.org/draft-07/schema",
|
|
8961
|
+
$id: "https://api.kohost.app/schemas/v3/systemUser.json",
|
|
8962
|
+
title: "System User",
|
|
8963
|
+
description: "A system user is a user that originated from an external 3rd party system.",
|
|
8964
|
+
type: "object",
|
|
8965
|
+
required: ["firstName", "lastName"],
|
|
8966
|
+
properties: {
|
|
8967
|
+
id: {
|
|
8968
|
+
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
|
|
8969
|
+
},
|
|
8970
|
+
type: {
|
|
8971
|
+
type: "string",
|
|
8972
|
+
default: "systemUser"
|
|
8973
|
+
},
|
|
8974
|
+
firstName: {
|
|
8975
|
+
type: "string"
|
|
8976
|
+
},
|
|
8977
|
+
lastName: {
|
|
8978
|
+
type: "string"
|
|
8979
|
+
},
|
|
8980
|
+
phone: {
|
|
8981
|
+
type: ["string", "null"],
|
|
8982
|
+
pattern: "^\\+[0-9]{1,14}$"
|
|
8983
|
+
},
|
|
8984
|
+
email: {
|
|
8985
|
+
type: ["string", "null"],
|
|
8986
|
+
format: "email"
|
|
8987
|
+
},
|
|
8988
|
+
address: {
|
|
8989
|
+
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/address"
|
|
8990
|
+
},
|
|
8991
|
+
photo: {
|
|
8992
|
+
type: "string"
|
|
8993
|
+
},
|
|
8994
|
+
jobTitle: {
|
|
8995
|
+
type: "string"
|
|
8996
|
+
},
|
|
8997
|
+
dob: {
|
|
8998
|
+
type: "string"
|
|
8999
|
+
},
|
|
9000
|
+
gender: {
|
|
9001
|
+
type: "string",
|
|
9002
|
+
enum: ["male", "female"]
|
|
9003
|
+
},
|
|
9004
|
+
roles: {
|
|
9005
|
+
type: "array",
|
|
9006
|
+
items: {
|
|
9007
|
+
type: "string",
|
|
9008
|
+
enum: ["Guest", "User", "Manager", "Administrator", "SuperAdmin"]
|
|
9009
|
+
}
|
|
9010
|
+
},
|
|
9011
|
+
nationality: {
|
|
9012
|
+
type: "string",
|
|
9013
|
+
minLength: 2,
|
|
9014
|
+
maxLength: 2
|
|
9015
|
+
},
|
|
9016
|
+
notes: {
|
|
9017
|
+
type: "array",
|
|
9018
|
+
items: {
|
|
9019
|
+
type: "string"
|
|
9020
|
+
}
|
|
9021
|
+
},
|
|
9022
|
+
files: {
|
|
9023
|
+
type: "array",
|
|
9024
|
+
items: {
|
|
9025
|
+
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/file"
|
|
9026
|
+
}
|
|
9027
|
+
},
|
|
9028
|
+
identifications: {
|
|
9029
|
+
type: "array",
|
|
9030
|
+
items: {
|
|
9031
|
+
$ref: "https://api.kohost.app/schemas/v3/identification.json#"
|
|
9032
|
+
}
|
|
9033
|
+
},
|
|
9034
|
+
payments: {
|
|
9035
|
+
type: "array",
|
|
9036
|
+
items: {
|
|
9037
|
+
$ref: "https://api.kohost.app/schemas/v3/payment.json#"
|
|
9038
|
+
}
|
|
9039
|
+
},
|
|
9040
|
+
createdAt: {
|
|
9041
|
+
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/createdAt"
|
|
9042
|
+
},
|
|
9043
|
+
updatedAt: {
|
|
9044
|
+
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/updatedAt"
|
|
9045
|
+
},
|
|
9046
|
+
systemData: {
|
|
9047
|
+
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/systemData"
|
|
9048
|
+
}
|
|
9049
|
+
}
|
|
9050
|
+
};
|
|
9051
|
+
}
|
|
9052
|
+
});
|
|
9053
|
+
|
|
9054
|
+
// src/Models/systemUser.js
|
|
9055
|
+
var require_systemUser2 = __commonJS({
|
|
9056
|
+
"src/Models/systemUser.js"(exports, module) {
|
|
9057
|
+
var schemas = require_schema();
|
|
9058
|
+
var schema = require_systemUser();
|
|
9059
|
+
var Kohost = require_kohost();
|
|
9060
|
+
schemas.add(schema);
|
|
9061
|
+
var validator = schemas.compile(schema);
|
|
9062
|
+
var SystemUser = class extends Kohost {
|
|
9063
|
+
constructor(data) {
|
|
9064
|
+
super(data);
|
|
9065
|
+
}
|
|
9066
|
+
static validatePhone(phoneNumber) {
|
|
9067
|
+
const regex = /^\+?[1-9]\d{1,14}$/;
|
|
9068
|
+
return regex.test(phoneNumber);
|
|
9069
|
+
}
|
|
9070
|
+
static validateEmail(email) {
|
|
9071
|
+
const regex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
9072
|
+
return regex.test(email);
|
|
9073
|
+
}
|
|
9074
|
+
};
|
|
9075
|
+
__name(SystemUser, "SystemUser");
|
|
9076
|
+
Object.defineProperty(SystemUser.prototype, "schema", {
|
|
9077
|
+
value: schema
|
|
9078
|
+
});
|
|
9079
|
+
Object.defineProperty(SystemUser.prototype, "validator", {
|
|
9080
|
+
get: function() {
|
|
9081
|
+
return validator;
|
|
9082
|
+
}
|
|
9083
|
+
});
|
|
9084
|
+
Object.defineProperty(SystemUser, "validProperties", {
|
|
9085
|
+
value: Object.keys(schema.properties)
|
|
9086
|
+
});
|
|
9087
|
+
Object.defineProperty(SystemUser.prototype, "fullName", {
|
|
9088
|
+
get: function() {
|
|
9089
|
+
return `${this.firstName} ${this.lastName}`;
|
|
9090
|
+
}
|
|
9091
|
+
});
|
|
9092
|
+
module.exports = SystemUser;
|
|
9093
|
+
}
|
|
9094
|
+
});
|
|
9095
|
+
|
|
8972
9096
|
// src/schemas/courtesy.json
|
|
8973
9097
|
var require_courtesy = __commonJS({
|
|
8974
9098
|
"src/schemas/courtesy.json"(exports, module) {
|
|
@@ -10410,6 +10534,30 @@ var require_room2 = __commonJS({
|
|
|
10410
10534
|
return `${type}s`;
|
|
10411
10535
|
}
|
|
10412
10536
|
}
|
|
10537
|
+
static getDeviceTypeFromPath(path) {
|
|
10538
|
+
const validPaths = [
|
|
10539
|
+
"dimmers",
|
|
10540
|
+
"switches",
|
|
10541
|
+
"thermostats",
|
|
10542
|
+
"locks",
|
|
10543
|
+
"windowCoverings",
|
|
10544
|
+
"courtesy",
|
|
10545
|
+
"cameras",
|
|
10546
|
+
"sources",
|
|
10547
|
+
"motionSensors",
|
|
10548
|
+
"alarms"
|
|
10549
|
+
];
|
|
10550
|
+
if (!validPaths.includes(path))
|
|
10551
|
+
throw new Error("Invalid device path:" + path);
|
|
10552
|
+
switch (path) {
|
|
10553
|
+
case "courtesy":
|
|
10554
|
+
return path;
|
|
10555
|
+
case "switches":
|
|
10556
|
+
return "switch";
|
|
10557
|
+
default:
|
|
10558
|
+
return path.slice(0, -1);
|
|
10559
|
+
}
|
|
10560
|
+
}
|
|
10413
10561
|
get hasDimmer() {
|
|
10414
10562
|
return this.dimmers?.length > 0;
|
|
10415
10563
|
}
|
|
@@ -10419,9 +10567,15 @@ var require_room2 = __commonJS({
|
|
|
10419
10567
|
get hasWindowCovering() {
|
|
10420
10568
|
return this.windowCoverings?.length > 0;
|
|
10421
10569
|
}
|
|
10570
|
+
get hasShade() {
|
|
10571
|
+
return this.hasWindowCovering;
|
|
10572
|
+
}
|
|
10422
10573
|
get hasThermostat() {
|
|
10423
10574
|
return this.thermostats?.length > 0;
|
|
10424
10575
|
}
|
|
10576
|
+
get hasClimate() {
|
|
10577
|
+
return this.hasThermostat;
|
|
10578
|
+
}
|
|
10425
10579
|
get hasLock() {
|
|
10426
10580
|
return this.locks?.length > 0;
|
|
10427
10581
|
}
|
|
@@ -10437,6 +10591,12 @@ var require_room2 = __commonJS({
|
|
|
10437
10591
|
get hasMedia() {
|
|
10438
10592
|
return this.sources?.length > 0;
|
|
10439
10593
|
}
|
|
10594
|
+
get hasLight() {
|
|
10595
|
+
const hasSubTypeLight = this.switches?.some((sw) => {
|
|
10596
|
+
return sw.subType === "light" || sw.subType === "fan";
|
|
10597
|
+
});
|
|
10598
|
+
return this.hasDimmer || hasSubTypeLight;
|
|
10599
|
+
}
|
|
10440
10600
|
get occupied() {
|
|
10441
10601
|
const now = /* @__PURE__ */ new Date();
|
|
10442
10602
|
const lastOccupied = new Date(this.occupiedAt);
|
|
@@ -13362,7 +13522,7 @@ var require_product = __commonJS({
|
|
|
13362
13522
|
$id: "https://api.kohost.app/schemas/v3/product.json",
|
|
13363
13523
|
title: "Product",
|
|
13364
13524
|
type: "object",
|
|
13365
|
-
required: ["name", "
|
|
13525
|
+
required: ["name", "price", "currency"],
|
|
13366
13526
|
properties: {
|
|
13367
13527
|
id: {
|
|
13368
13528
|
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
|
|
@@ -13388,6 +13548,10 @@ var require_product = __commonJS({
|
|
|
13388
13548
|
image: {
|
|
13389
13549
|
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/file"
|
|
13390
13550
|
},
|
|
13551
|
+
imageUrl: {
|
|
13552
|
+
format: "uri",
|
|
13553
|
+
pattern: "^https?://"
|
|
13554
|
+
},
|
|
13391
13555
|
systemData: {
|
|
13392
13556
|
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/systemData"
|
|
13393
13557
|
}
|
|
@@ -13434,7 +13598,7 @@ var require_discoveredDevice = __commonJS({
|
|
|
13434
13598
|
title: "Discovered Device",
|
|
13435
13599
|
description: "A device that has been discovered by Kohost, but not yet added to the Kohost system.",
|
|
13436
13600
|
type: "object",
|
|
13437
|
-
required: ["name", "deviceId", "
|
|
13601
|
+
required: ["name", "deviceId", "deviceData"],
|
|
13438
13602
|
properties: {
|
|
13439
13603
|
id: {
|
|
13440
13604
|
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
|
|
@@ -13631,83 +13795,16 @@ var require_shortLink2 = __commonJS({
|
|
|
13631
13795
|
}
|
|
13632
13796
|
});
|
|
13633
13797
|
|
|
13634
|
-
// src/schemas/
|
|
13635
|
-
var require_customer = __commonJS({
|
|
13636
|
-
"src/schemas/admin/customer.json"(exports, module) {
|
|
13637
|
-
module.exports = {
|
|
13638
|
-
$schema: "http://json-schema.org/draft-07/schema",
|
|
13639
|
-
$id: "https://api.kohost.app/schemas/v3/admin/customer.json",
|
|
13640
|
-
title: "Customer",
|
|
13641
|
-
type: "object",
|
|
13642
|
-
description: "A Kohost customer",
|
|
13643
|
-
required: ["accountNumber", "name"],
|
|
13644
|
-
properties: {
|
|
13645
|
-
id: {
|
|
13646
|
-
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
|
|
13647
|
-
},
|
|
13648
|
-
accountNumber: {
|
|
13649
|
-
type: "number",
|
|
13650
|
-
minimum: 1e4
|
|
13651
|
-
},
|
|
13652
|
-
name: {
|
|
13653
|
-
type: "string"
|
|
13654
|
-
},
|
|
13655
|
-
properties: {
|
|
13656
|
-
type: "array",
|
|
13657
|
-
items: {
|
|
13658
|
-
type: "string"
|
|
13659
|
-
}
|
|
13660
|
-
},
|
|
13661
|
-
createdAt: {
|
|
13662
|
-
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/createdAt"
|
|
13663
|
-
},
|
|
13664
|
-
updatedAt: {
|
|
13665
|
-
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/updatedAt"
|
|
13666
|
-
}
|
|
13667
|
-
}
|
|
13668
|
-
};
|
|
13669
|
-
}
|
|
13670
|
-
});
|
|
13671
|
-
|
|
13672
|
-
// src/Models/admin/customer.js
|
|
13673
|
-
var require_customer2 = __commonJS({
|
|
13674
|
-
"src/Models/admin/customer.js"(exports, module) {
|
|
13675
|
-
var schemas = require_schema();
|
|
13676
|
-
var schema = require_customer();
|
|
13677
|
-
var Kohost = require_kohost();
|
|
13678
|
-
schemas.add(schema);
|
|
13679
|
-
var validator = schemas.compile(schema);
|
|
13680
|
-
var Customer = class extends Kohost {
|
|
13681
|
-
constructor(data) {
|
|
13682
|
-
super(data);
|
|
13683
|
-
}
|
|
13684
|
-
};
|
|
13685
|
-
__name(Customer, "Customer");
|
|
13686
|
-
Object.defineProperty(Customer.prototype, "schema", {
|
|
13687
|
-
value: schema
|
|
13688
|
-
});
|
|
13689
|
-
Object.defineProperty(Customer.prototype, "validator", {
|
|
13690
|
-
get: function() {
|
|
13691
|
-
return validator;
|
|
13692
|
-
}
|
|
13693
|
-
});
|
|
13694
|
-
Object.defineProperty(Customer, "validProperties", {
|
|
13695
|
-
value: Object.keys(schema.properties)
|
|
13696
|
-
});
|
|
13697
|
-
module.exports = Customer;
|
|
13698
|
-
}
|
|
13699
|
-
});
|
|
13700
|
-
|
|
13701
|
-
// src/schemas/admin/property.json
|
|
13798
|
+
// src/schemas/property.json
|
|
13702
13799
|
var require_property = __commonJS({
|
|
13703
|
-
"src/schemas/
|
|
13800
|
+
"src/schemas/property.json"(exports, module) {
|
|
13704
13801
|
module.exports = {
|
|
13705
13802
|
$schema: "http://json-schema.org/draft-07/schema",
|
|
13706
13803
|
$id: "https://api.kohost.app/schemas/v3/admin/property.json",
|
|
13707
13804
|
title: "Property",
|
|
13708
13805
|
type: "object",
|
|
13709
13806
|
description: "A property is a physical asset or building",
|
|
13710
|
-
required: ["id", "name", "type", "hostname"],
|
|
13807
|
+
required: ["id", "name", "type", "hostname", "organization"],
|
|
13711
13808
|
properties: {
|
|
13712
13809
|
id: {
|
|
13713
13810
|
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
|
|
@@ -13728,6 +13825,10 @@ var require_property = __commonJS({
|
|
|
13728
13825
|
hostname: {
|
|
13729
13826
|
type: "string"
|
|
13730
13827
|
},
|
|
13828
|
+
organization: {
|
|
13829
|
+
type: "string",
|
|
13830
|
+
description: "Reference to the organization that owns this property"
|
|
13831
|
+
},
|
|
13731
13832
|
address: {
|
|
13732
13833
|
type: "object",
|
|
13733
13834
|
properties: {
|
|
@@ -13883,9 +13984,9 @@ var require_property = __commonJS({
|
|
|
13883
13984
|
}
|
|
13884
13985
|
});
|
|
13885
13986
|
|
|
13886
|
-
// src/Models/
|
|
13987
|
+
// src/Models/property.js
|
|
13887
13988
|
var require_property2 = __commonJS({
|
|
13888
|
-
"src/Models/
|
|
13989
|
+
"src/Models/property.js"(exports, module) {
|
|
13889
13990
|
var schemas = require_schema();
|
|
13890
13991
|
var schema = require_property();
|
|
13891
13992
|
var Kohost = require_kohost();
|
|
@@ -13912,6 +14013,77 @@ var require_property2 = __commonJS({
|
|
|
13912
14013
|
}
|
|
13913
14014
|
});
|
|
13914
14015
|
|
|
14016
|
+
// src/schemas/organization.json
|
|
14017
|
+
var require_organization = __commonJS({
|
|
14018
|
+
"src/schemas/organization.json"(exports, module) {
|
|
14019
|
+
module.exports = {
|
|
14020
|
+
$schema: "http://json-schema.org/draft-07/schema",
|
|
14021
|
+
$id: "https://api.kohost.app/schemas/v3/admin/organization.json",
|
|
14022
|
+
title: "Organization",
|
|
14023
|
+
type: "object",
|
|
14024
|
+
description: "An organization is a group or entity that subscribes to Kohost software.",
|
|
14025
|
+
required: ["accountNumber", "name"],
|
|
14026
|
+
properties: {
|
|
14027
|
+
id: {
|
|
14028
|
+
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
|
|
14029
|
+
},
|
|
14030
|
+
accountNumber: {
|
|
14031
|
+
type: "number",
|
|
14032
|
+
minimum: 1e4
|
|
14033
|
+
},
|
|
14034
|
+
name: {
|
|
14035
|
+
type: "string"
|
|
14036
|
+
},
|
|
14037
|
+
properties: {
|
|
14038
|
+
type: "array",
|
|
14039
|
+
items: {
|
|
14040
|
+
type: "string"
|
|
14041
|
+
}
|
|
14042
|
+
},
|
|
14043
|
+
credentials: {
|
|
14044
|
+
type: "object",
|
|
14045
|
+
additionalProperties: true
|
|
14046
|
+
},
|
|
14047
|
+
createdAt: {
|
|
14048
|
+
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/createdAt"
|
|
14049
|
+
},
|
|
14050
|
+
updatedAt: {
|
|
14051
|
+
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/updatedAt"
|
|
14052
|
+
}
|
|
14053
|
+
}
|
|
14054
|
+
};
|
|
14055
|
+
}
|
|
14056
|
+
});
|
|
14057
|
+
|
|
14058
|
+
// src/Models/organization.js
|
|
14059
|
+
var require_organization2 = __commonJS({
|
|
14060
|
+
"src/Models/organization.js"(exports, module) {
|
|
14061
|
+
var schemas = require_schema();
|
|
14062
|
+
var schema = require_organization();
|
|
14063
|
+
var Kohost = require_kohost();
|
|
14064
|
+
schemas.add(schema);
|
|
14065
|
+
var validator = schemas.compile(schema);
|
|
14066
|
+
var Organization = class extends Kohost {
|
|
14067
|
+
constructor(data) {
|
|
14068
|
+
super(data);
|
|
14069
|
+
}
|
|
14070
|
+
};
|
|
14071
|
+
__name(Organization, "Organization");
|
|
14072
|
+
Object.defineProperty(Organization.prototype, "schema", {
|
|
14073
|
+
value: schema
|
|
14074
|
+
});
|
|
14075
|
+
Object.defineProperty(Organization.prototype, "validator", {
|
|
14076
|
+
get: function() {
|
|
14077
|
+
return validator;
|
|
14078
|
+
}
|
|
14079
|
+
});
|
|
14080
|
+
Object.defineProperty(Organization, "validProperties", {
|
|
14081
|
+
value: Object.keys(schema.properties)
|
|
14082
|
+
});
|
|
14083
|
+
module.exports = Organization;
|
|
14084
|
+
}
|
|
14085
|
+
});
|
|
14086
|
+
|
|
13915
14087
|
// src/Models/index.js
|
|
13916
14088
|
var require_Models = __commonJS({
|
|
13917
14089
|
"src/Models/index.js"(exports, module) {
|
|
@@ -13923,6 +14095,7 @@ var require_Models = __commonJS({
|
|
|
13923
14095
|
var WindowCovering = require_windowCovering2();
|
|
13924
14096
|
var Identification = require_identification2();
|
|
13925
14097
|
var User = require_user2();
|
|
14098
|
+
var SystemUser = require_systemUser2();
|
|
13926
14099
|
var Courtesy = require_courtesy2();
|
|
13927
14100
|
var Camera = require_camera2();
|
|
13928
14101
|
var MotionSensor = require_motionSensor2();
|
|
@@ -13939,13 +14112,11 @@ var require_Models = __commonJS({
|
|
|
13939
14112
|
var DiscoveredDevice = require_discoveredDevice2();
|
|
13940
14113
|
var Credential = require_credential2();
|
|
13941
14114
|
var ShortLink = require_shortLink2();
|
|
13942
|
-
var
|
|
13943
|
-
var
|
|
14115
|
+
var Property = require_property2();
|
|
14116
|
+
var Organization = require_organization2();
|
|
13944
14117
|
module.exports = {
|
|
13945
|
-
|
|
13946
|
-
|
|
13947
|
-
Property: AdminProperty
|
|
13948
|
-
},
|
|
14118
|
+
Organization,
|
|
14119
|
+
Property,
|
|
13949
14120
|
Gateway,
|
|
13950
14121
|
Switch,
|
|
13951
14122
|
Alarm,
|
|
@@ -13960,6 +14131,7 @@ var require_Models = __commonJS({
|
|
|
13960
14131
|
Identification,
|
|
13961
14132
|
Product,
|
|
13962
14133
|
User,
|
|
14134
|
+
SystemUser,
|
|
13963
14135
|
Room,
|
|
13964
14136
|
Application,
|
|
13965
14137
|
Space,
|