@kohost/api-client 1.0.0-alpha.4 → 1.0.0-beta.0

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 (57) hide show
  1. package/commands/CheckInReservationCommand.js +23 -0
  2. package/commands/DiscoverReservationsCommand.js +24 -0
  3. package/commands/DiscoverRoomsCommand.js +21 -0
  4. package/commands/DiscoverUsersCommand.js +2 -2
  5. package/commands/{VerifyDocumentCommand.js → OCRDocumentCommand.js} +4 -8
  6. package/commands/SendEmailCommand.js +24 -0
  7. package/commands/SendSMSCommand.js +21 -0
  8. package/commands/index.js +10 -4
  9. package/defs/http.js +1 -1
  10. package/events/EmailSentEvent.js +17 -0
  11. package/events/Event.js +20 -1
  12. package/events/SMSSentEvent.js +17 -0
  13. package/events/ShortLinkCreatedEvent.js +17 -0
  14. package/events/index.js +7 -0
  15. package/http/handleResponseError.js +9 -29
  16. package/http/index.js +12 -8
  17. package/models/credential.js +29 -0
  18. package/models/gateway.js +0 -8
  19. package/models/identification.js +32 -0
  20. package/models/index.js +9 -9
  21. package/models/kohost.js +4 -3
  22. package/models/product.js +30 -0
  23. package/models/reservation.js +47 -0
  24. package/models/room.js +1 -12
  25. package/models/shortLink.js +29 -0
  26. package/models/space.js +1 -1
  27. package/models/thermostat.js +3 -3
  28. package/models/user.js +0 -2
  29. package/models/windowCovering.js +1 -1
  30. package/package.json +1 -1
  31. package/schemas/admin/property.json +7 -1
  32. package/schemas/camera.json +3 -3
  33. package/schemas/courtesy.json +3 -3
  34. package/schemas/credential.json +28 -0
  35. package/schemas/definitions/common.json +53 -0
  36. package/schemas/definitions/device.json +13 -2
  37. package/schemas/dimmer.json +3 -3
  38. package/schemas/gateway.json +16 -47
  39. package/schemas/identification.json +18 -4
  40. package/schemas/lock.json +6 -3
  41. package/schemas/mediaSource.json +3 -3
  42. package/schemas/motionSensor.json +3 -3
  43. package/schemas/payment.json +3 -1
  44. package/schemas/product.json +36 -0
  45. package/schemas/reservation.json +8 -3
  46. package/schemas/room.json +1 -8
  47. package/schemas/shortLink.json +30 -0
  48. package/schemas/switch.json +3 -3
  49. package/schemas/thermostat.json +11 -10
  50. package/schemas/user.json +57 -5
  51. package/schemas/windowCovering.json +3 -3
  52. package/useCases/http.json +152 -44
  53. package/utils/schema.js +2 -2
  54. package/models/iotGateway.js +0 -29
  55. package/models/sceneController.js +0 -29
  56. package/schemas/iotGateway.json +0 -29
  57. package/schemas/sceneController.json +0 -58
@@ -1,29 +0,0 @@
1
- // Create the SceneController Model
2
- const schemas = require("../utils/schema");
3
- const schema = require("../schemas/sceneController.json");
4
- const Kohost = require("./kohost");
5
-
6
- schemas.add(schema);
7
- const validator = schemas.compile(schema);
8
-
9
- class SceneController extends Kohost {
10
- constructor(data) {
11
- super(data);
12
- }
13
- }
14
-
15
- Object.defineProperty(SceneController.prototype, "schema", {
16
- value: schema,
17
- });
18
-
19
- Object.defineProperty(SceneController.prototype, "validator", {
20
- get: function () {
21
- return validator;
22
- },
23
- });
24
-
25
- Object.defineProperty(SceneController, "validProperties", {
26
- value: Object.keys(schema.properties),
27
- });
28
-
29
- module.exports = SceneController;
@@ -1,29 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "https://api.kohost.app/schemas/v3/iotGateway.json",
4
- "title": "IoT Gateway",
5
- "description": "Any smart gateway that is an entrypoint for controlling devices",
6
- "type": "object",
7
- "properties": {
8
- "id": {
9
- "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/id"
10
- },
11
- "type": {
12
- "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/type"
13
- },
14
- "systemData": {
15
- "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/systemData"
16
- },
17
- "supportedNotifications": {
18
- "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/supportedNotifications"
19
- },
20
- "notification": {
21
- "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/notification"
22
- },
23
- "status": {
24
- "type": "string"
25
- }
26
- },
27
- "additionalProperties": false,
28
- "required": ["id", "type", "systemData", "status"]
29
- }
@@ -1,58 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "https://api.kohost.app/schemas/v3/sceneController.json",
4
- "title": "Scene Controller",
5
- "description": "Any smart scene controller",
6
- "type": "object",
7
- "properties": {
8
- "id": {
9
- "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/id"
10
- },
11
- "type": {
12
- "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/type"
13
- },
14
- "subType": {
15
- "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/subType"
16
- },
17
- "systemData": {
18
- "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/systemData"
19
- },
20
- "supportedNotifications": {
21
- "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/supportedNotifications"
22
- },
23
- "notification": {
24
- "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/notification"
25
- },
26
- "supportedScenes": {
27
- "type": "array",
28
- "uniqueItems": true,
29
- "items": {
30
- "type": "string"
31
- }
32
- },
33
- "scene": {
34
- "type": ["object", "null"],
35
- "properties": {
36
- "name": {
37
- "type": "string",
38
- "$ref": "#/properties/supportedScenes/items"
39
- },
40
- "timestamp": {
41
- "type": "number",
42
- "minimum": 1655907956593
43
- }
44
- }
45
- },
46
- "level": {
47
- "type": "number",
48
- "minimum": 0,
49
- "maximum": 100
50
- },
51
- "state": {
52
- "type": "string",
53
- "enum": ["on", "off"]
54
- }
55
- },
56
- "additionalProperties": false,
57
- "required": ["id", "type", "systemData", "supportedScenes", "scene"]
58
- }