@kohost/api-client 1.0.0-alpha.4 → 1.0.0-beta.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 (59) hide show
  1. package/bitbucket-pipelines.yml +18 -8
  2. package/commands/CheckInReservationCommand.js +23 -0
  3. package/commands/DiscoverReservationsCommand.js +24 -0
  4. package/commands/DiscoverRoomsCommand.js +21 -0
  5. package/commands/DiscoverUsersCommand.js +2 -2
  6. package/commands/{VerifyDocumentCommand.js → OCRDocumentCommand.js} +4 -8
  7. package/commands/SendEmailCommand.js +24 -0
  8. package/commands/SendSMSCommand.js +21 -0
  9. package/commands/index.js +10 -4
  10. package/defs/http.js +1 -1
  11. package/events/EmailSentEvent.js +17 -0
  12. package/events/Event.js +20 -1
  13. package/events/SMSSentEvent.js +17 -0
  14. package/events/ShortLinkCreatedEvent.js +17 -0
  15. package/events/index.js +7 -0
  16. package/http/handleResponseError.js +9 -29
  17. package/http/index.js +12 -8
  18. package/models/credential.js +29 -0
  19. package/models/gateway.js +0 -8
  20. package/models/identification.js +32 -0
  21. package/models/index.js +9 -9
  22. package/models/kohost.js +4 -3
  23. package/models/product.js +30 -0
  24. package/models/reservation.js +47 -0
  25. package/models/room.js +1 -12
  26. package/models/shortLink.js +29 -0
  27. package/models/space.js +1 -1
  28. package/models/thermostat.js +3 -3
  29. package/models/user.js +0 -2
  30. package/models/windowCovering.js +1 -1
  31. package/package.json +1 -1
  32. package/schemas/admin/property.json +7 -1
  33. package/schemas/camera.json +3 -3
  34. package/schemas/courtesy.json +3 -3
  35. package/schemas/credential.json +28 -0
  36. package/schemas/definitions/common.json +53 -0
  37. package/schemas/definitions/device.json +13 -2
  38. package/schemas/dimmer.json +3 -3
  39. package/schemas/gateway.json +16 -47
  40. package/schemas/identification.json +18 -4
  41. package/schemas/lock.json +6 -3
  42. package/schemas/mediaSource.json +3 -3
  43. package/schemas/motionSensor.json +3 -3
  44. package/schemas/payment.json +3 -1
  45. package/schemas/product.json +36 -0
  46. package/schemas/reservation.json +8 -3
  47. package/schemas/room.json +1 -8
  48. package/schemas/shortLink.json +30 -0
  49. package/schemas/switch.json +3 -3
  50. package/schemas/thermostat.json +11 -10
  51. package/schemas/user.json +57 -5
  52. package/schemas/windowCovering.json +3 -3
  53. package/useCases/http.json +152 -44
  54. package/utils/schema.js +2 -2
  55. package/models/iotGateway.js +0 -29
  56. package/models/sceneController.js +0 -29
  57. package/schemas/iotGateway.json +0 -29
  58. package/schemas/sceneController.json +0 -58
  59. package/vite.config.js +0 -22
@@ -1,29 +0,0 @@
1
- // Create the Gateway Model
2
- const schemas = require("../utils/schema");
3
- const schema = require("../schemas/iotGateway.json");
4
- const Kohost = require("./kohost");
5
-
6
- schemas.add(schema);
7
- const validator = schemas.compile(schema);
8
-
9
- class IotGateway extends Kohost {
10
- constructor(data) {
11
- super(data);
12
- }
13
- }
14
-
15
- Object.defineProperty(IotGateway.prototype, "schema", {
16
- value: schema,
17
- });
18
-
19
- Object.defineProperty(IotGateway.prototype, "validator", {
20
- get: function () {
21
- return validator;
22
- },
23
- });
24
-
25
- Object.defineProperty(IotGateway, "validProperties", {
26
- value: Object.keys(schema.properties),
27
- });
28
-
29
- module.exports = IotGateway;
@@ -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
- }
package/vite.config.js DELETED
@@ -1,22 +0,0 @@
1
- /** @type {import('vite').UserConfig} */
2
-
3
- import { resolve } from "path";
4
- import { defineConfig } from "vite";
5
-
6
- export default defineConfig({
7
- build: {
8
- lib: {
9
- // Could also be a dictionary or array of multiple entry points
10
- entry: resolve(__dirname, "index.js"),
11
- name: "Kohost",
12
- // the proper extensions will be added
13
- fileName: "kohost",
14
- },
15
- // commonjsOptions: {
16
- // include: "**/*.js",
17
- // transformMixedEsModules: true,
18
- // esmExternals: true,
19
- // requireReturnsDefault: false,
20
- // },
21
- },
22
- });