@kohost/api-client 3.0.0-beta.29 → 3.0.0-beta.30

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.
@@ -3648,16 +3648,23 @@ var require_energyReportShard = __commonJS({
3648
3648
  title: "Energy Report Shard",
3649
3649
  description: "Shard used for Energy Reports",
3650
3650
  type: "object",
3651
- required: ["id", "type", "roomId", "first", "last", "data", "ndata", "expires"],
3651
+ required: [
3652
+ "id",
3653
+ "type",
3654
+ "roomId",
3655
+ "first",
3656
+ "last",
3657
+ "data",
3658
+ "ndata",
3659
+ "expires"
3660
+ ],
3652
3661
  properties: {
3653
3662
  id: {
3654
3663
  $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
3655
3664
  },
3656
3665
  type: {
3657
3666
  type: "string",
3658
- enum: [
3659
- "energyReportShard"
3660
- ],
3667
+ enum: ["energyReportShard"],
3661
3668
  default: "energyReportShard"
3662
3669
  },
3663
3670
  roomId: {
@@ -3742,178 +3749,40 @@ var require_energyReportShard2 = __commonJS({
3742
3749
  value: ["state"]
3743
3750
  });
3744
3751
  module2.exports = EnergyReportShard2;
3745
- var shard = new EnergyReportShard2({
3746
- "id": "ShardId1",
3747
- "type": "energyReportShard",
3748
- "roomId": "TestRoom",
3749
- "first": /* @__PURE__ */ new Date(),
3750
- "last": /* @__PURE__ */ new Date(),
3751
- "data": [{
3752
- "time": /* @__PURE__ */ new Date(),
3753
- "watts": 100,
3754
- "id": "1",
3755
- "type": "dimmer",
3756
- "value": 0.121315
3757
- }],
3758
- "ndata": 1,
3759
- "expires": /* @__PURE__ */ new Date()
3760
- });
3761
- console.log(shard);
3762
3752
  }
3763
3753
  });
3764
3754
 
3765
- // src/schemas/energyReportHourly.json
3766
- var require_energyReportHourly = __commonJS({
3767
- "src/schemas/energyReportHourly.json"(exports2, module2) {
3755
+ // src/schemas/energyReport.json
3756
+ var require_energyReport = __commonJS({
3757
+ "src/schemas/energyReport.json"(exports2, module2) {
3768
3758
  module2.exports = {
3769
3759
  $schema: "http://json-schema.org/draft-07/schema",
3770
- $id: "https://api.kohost.io/schemas/v3/energyReportHourly.json",
3760
+ $id: "https://api.kohost.io/schemas/v3/energyReport.json",
3771
3761
  title: "Energy Report Hourly",
3772
3762
  description: "Hourly Report for Energy based on energy report shards",
3773
3763
  type: "object",
3774
- required: ["id", "type", "roomId", "first", "last", "consumption", "totals", "costPerKw"],
3764
+ required: [
3765
+ "id",
3766
+ "type",
3767
+ "roomId",
3768
+ "first",
3769
+ "last",
3770
+ "consumption",
3771
+ "totals",
3772
+ "costPerKw"
3773
+ ],
3775
3774
  properties: {
3776
3775
  id: {
3777
3776
  $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
3778
3777
  },
3779
3778
  type: {
3780
3779
  type: "string",
3781
- enum: [
3782
- "energyReportHourly"
3783
- ],
3784
- default: "energyReportHourly"
3785
- },
3786
- roomId: {
3787
- $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
3780
+ enum: ["energyReport"],
3781
+ default: "energyReport"
3788
3782
  },
3789
- first: {
3790
- type: ["string", "object"],
3791
- format: "date-time"
3792
- },
3793
- last: {
3794
- type: ["string", "object"],
3795
- format: "date-time"
3796
- },
3797
- consumption: {
3798
- type: "array",
3799
- items: {
3800
- type: "object",
3801
- required: ["id", "type", "kwh"],
3802
- properties: {
3803
- id: {
3804
- $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
3805
- },
3806
- type: {
3807
- $ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/type"
3808
- },
3809
- kwh: {
3810
- type: "number",
3811
- minimum: 0
3812
- }
3813
- }
3814
- }
3815
- },
3816
- totals: {
3817
- type: "array",
3818
- items: {
3819
- type: "object",
3820
- required: ["lights", "climate", "media"],
3821
- properties: {
3822
- lights: {
3823
- type: "number",
3824
- minimum: 0
3825
- },
3826
- climate: {
3827
- type: "number",
3828
- minimum: 0
3829
- },
3830
- media: {
3831
- type: "number",
3832
- minimum: 0
3833
- }
3834
- }
3835
- }
3836
- },
3837
- costPerKw: {
3838
- type: "number",
3839
- minimum: 0
3840
- }
3841
- }
3842
- };
3843
- }
3844
- });
3845
-
3846
- // src/Models/energyReportHourly.js
3847
- var require_energyReportHourly2 = __commonJS({
3848
- "src/Models/energyReportHourly.js"(exports2, module2) {
3849
- var schemas = require_schema();
3850
- var schema = require_energyReportHourly();
3851
- var Kohost = require_kohost();
3852
- schemas.add(schema);
3853
- var validator = schemas.compile(schema);
3854
- var EnergyReportHourly2 = class extends Kohost {
3855
- constructor(data) {
3856
- super(data);
3857
- }
3858
- };
3859
- __name(EnergyReportHourly2, "EnergyReportHourly");
3860
- Object.defineProperty(EnergyReportHourly2.prototype, "schema", {
3861
- value: schema
3862
- });
3863
- Object.defineProperty(EnergyReportHourly2.prototype, "validator", {
3864
- get: function() {
3865
- return validator;
3866
- }
3867
- });
3868
- Object.defineProperty(EnergyReportHourly2, "validProperties", {
3869
- value: Object.keys(schema.properties)
3870
- });
3871
- Object.defineProperty(EnergyReportHourly2, "actionProperties", {
3872
- value: ["state"]
3873
- });
3874
- module2.exports = EnergyReportHourly2;
3875
- var hourlyShardReport = new EnergyReportHourly2({
3876
- "id": "RepIdHr1",
3877
- "type": "energyReportHourly",
3878
- "roomId": "TestRoom",
3879
- "first": /* @__PURE__ */ new Date(),
3880
- "last": /* @__PURE__ */ new Date(),
3881
- "consumption": [{
3882
- "id": "1",
3883
- "type": "dimmer",
3884
- "kwh": 0.121315
3885
- }],
3886
- "totals": [{
3887
- "lights": 10,
3888
- "climate": 10,
3889
- "media": 10
3890
- }],
3891
- "costPerKw": 0.14
3892
- });
3893
- console.log(hourlyShardReport);
3894
- }
3895
- });
3896
-
3897
- // src/schemas/energyReportDaily.json
3898
- var require_energyReportDaily = __commonJS({
3899
- "src/schemas/energyReportDaily.json"(exports2, module2) {
3900
- module2.exports = {
3901
- $schema: "http://json-schema.org/draft-07/schema",
3902
- $id: "https://api.kohost.io/schemas/v3/energyReportDaily.json",
3903
- title: "Energy Report Daily",
3904
- description: "Daily Report for Energy based on energy report shards",
3905
- type: "object",
3906
- required: ["id", "type", "roomId", "first", "last", "consumption", "totals", "costPerKw"],
3907
- properties: {
3908
- id: {
3909
- $ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/id"
3910
- },
3911
- type: {
3912
- type: "string",
3913
- enum: [
3914
- "energyReportDaily"
3915
- ],
3916
- default: "energyReportDaily"
3783
+ reportTime: {
3784
+ time: "string",
3785
+ enum: ["hourly", "daily", "monthly"]
3917
3786
  },
3918
3787
  roomId: {
3919
3788
  $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
@@ -3975,54 +3844,32 @@ var require_energyReportDaily = __commonJS({
3975
3844
  }
3976
3845
  });
3977
3846
 
3978
- // src/Models/energyReportDaily.js
3979
- var require_energyReportDaily2 = __commonJS({
3980
- "src/Models/energyReportDaily.js"(exports2, module2) {
3847
+ // src/Models/energyReport.js
3848
+ var require_energyReport2 = __commonJS({
3849
+ "src/Models/energyReport.js"(exports2, module2) {
3981
3850
  var schemas = require_schema();
3982
- var schema = require_energyReportDaily();
3851
+ var schema = require_energyReport();
3983
3852
  var Kohost = require_kohost();
3984
3853
  schemas.add(schema);
3985
3854
  var validator = schemas.compile(schema);
3986
- var energyReportDaily = class extends Kohost {
3855
+ var EnergyReport2 = class extends Kohost {
3987
3856
  constructor(data) {
3988
3857
  super(data);
3989
3858
  }
3990
3859
  };
3991
- __name(energyReportDaily, "energyReportDaily");
3992
- Object.defineProperty(energyReportDaily.prototype, "schema", {
3860
+ __name(EnergyReport2, "EnergyReport");
3861
+ Object.defineProperty(EnergyReport2.prototype, "schema", {
3993
3862
  value: schema
3994
3863
  });
3995
- Object.defineProperty(energyReportDaily.prototype, "validator", {
3864
+ Object.defineProperty(EnergyReport2.prototype, "validator", {
3996
3865
  get: function() {
3997
3866
  return validator;
3998
3867
  }
3999
3868
  });
4000
- Object.defineProperty(energyReportDaily, "validProperties", {
3869
+ Object.defineProperty(EnergyReport2, "validProperties", {
4001
3870
  value: Object.keys(schema.properties)
4002
3871
  });
4003
- Object.defineProperty(energyReportDaily, "actionProperties", {
4004
- value: ["state"]
4005
- });
4006
- module2.exports = energyReportDaily;
4007
- var dailyShardReport = new energyReportDaily({
4008
- "id": "RepIdHr1",
4009
- "type": "energyReportDaily",
4010
- "roomId": "TestRoom",
4011
- "first": /* @__PURE__ */ new Date(),
4012
- "last": /* @__PURE__ */ new Date(),
4013
- "consumption": [{
4014
- "id": "1",
4015
- "type": "dimmer",
4016
- "kwh": 0.121315
4017
- }],
4018
- "totals": [{
4019
- "lights": 10,
4020
- "climate": 10,
4021
- "media": 10
4022
- }],
4023
- "costPerKw": 0.14
4024
- });
4025
- console.log(dailyShardReport);
3872
+ module2.exports = EnergyReport2;
4026
3873
  }
4027
3874
  });
4028
3875
 
@@ -4377,8 +4224,7 @@ var DiscoveredDevice = require_discoveredDevice2();
4377
4224
  var Credential = require_credential2();
4378
4225
  var ShortLink = require_shortLink2();
4379
4226
  var EnergyReportShard = require_energyReportShard2();
4380
- var EnergyReportHourly = require_energyReportHourly2();
4381
- var EnergyReportDaily = require_energyReportDaily2();
4227
+ var EnergyReport = require_energyReport2();
4382
4228
  var Property = require_property2();
4383
4229
  var Organization = require_organization2();
4384
4230
  module.exports = {
@@ -4409,6 +4255,5 @@ module.exports = {
4409
4255
  Credential,
4410
4256
  ShortLink,
4411
4257
  EnergyReportShard,
4412
- EnergyReportHourly,
4413
- EnergyReportDaily
4258
+ EnergyReport
4414
4259
  };
@@ -13892,16 +13892,23 @@ var require_energyReportShard = __commonJS({
13892
13892
  title: "Energy Report Shard",
13893
13893
  description: "Shard used for Energy Reports",
13894
13894
  type: "object",
13895
- required: ["id", "type", "roomId", "first", "last", "data", "ndata", "expires"],
13895
+ required: [
13896
+ "id",
13897
+ "type",
13898
+ "roomId",
13899
+ "first",
13900
+ "last",
13901
+ "data",
13902
+ "ndata",
13903
+ "expires"
13904
+ ],
13896
13905
  properties: {
13897
13906
  id: {
13898
13907
  $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
13899
13908
  },
13900
13909
  type: {
13901
13910
  type: "string",
13902
- enum: [
13903
- "energyReportShard"
13904
- ],
13911
+ enum: ["energyReportShard"],
13905
13912
  default: "energyReportShard"
13906
13913
  },
13907
13914
  roomId: {
@@ -13986,178 +13993,40 @@ var require_energyReportShard2 = __commonJS({
13986
13993
  value: ["state"]
13987
13994
  });
13988
13995
  module.exports = EnergyReportShard;
13989
- var shard = new EnergyReportShard({
13990
- "id": "ShardId1",
13991
- "type": "energyReportShard",
13992
- "roomId": "TestRoom",
13993
- "first": /* @__PURE__ */ new Date(),
13994
- "last": /* @__PURE__ */ new Date(),
13995
- "data": [{
13996
- "time": /* @__PURE__ */ new Date(),
13997
- "watts": 100,
13998
- "id": "1",
13999
- "type": "dimmer",
14000
- "value": 0.121315
14001
- }],
14002
- "ndata": 1,
14003
- "expires": /* @__PURE__ */ new Date()
14004
- });
14005
- console.log(shard);
14006
13996
  }
14007
13997
  });
14008
13998
 
14009
- // src/schemas/energyReportHourly.json
14010
- var require_energyReportHourly = __commonJS({
14011
- "src/schemas/energyReportHourly.json"(exports, module) {
13999
+ // src/schemas/energyReport.json
14000
+ var require_energyReport = __commonJS({
14001
+ "src/schemas/energyReport.json"(exports, module) {
14012
14002
  module.exports = {
14013
14003
  $schema: "http://json-schema.org/draft-07/schema",
14014
- $id: "https://api.kohost.io/schemas/v3/energyReportHourly.json",
14004
+ $id: "https://api.kohost.io/schemas/v3/energyReport.json",
14015
14005
  title: "Energy Report Hourly",
14016
14006
  description: "Hourly Report for Energy based on energy report shards",
14017
14007
  type: "object",
14018
- required: ["id", "type", "roomId", "first", "last", "consumption", "totals", "costPerKw"],
14008
+ required: [
14009
+ "id",
14010
+ "type",
14011
+ "roomId",
14012
+ "first",
14013
+ "last",
14014
+ "consumption",
14015
+ "totals",
14016
+ "costPerKw"
14017
+ ],
14019
14018
  properties: {
14020
14019
  id: {
14021
14020
  $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
14022
14021
  },
14023
14022
  type: {
14024
14023
  type: "string",
14025
- enum: [
14026
- "energyReportHourly"
14027
- ],
14028
- default: "energyReportHourly"
14029
- },
14030
- roomId: {
14031
- $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
14024
+ enum: ["energyReport"],
14025
+ default: "energyReport"
14032
14026
  },
14033
- first: {
14034
- type: ["string", "object"],
14035
- format: "date-time"
14036
- },
14037
- last: {
14038
- type: ["string", "object"],
14039
- format: "date-time"
14040
- },
14041
- consumption: {
14042
- type: "array",
14043
- items: {
14044
- type: "object",
14045
- required: ["id", "type", "kwh"],
14046
- properties: {
14047
- id: {
14048
- $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
14049
- },
14050
- type: {
14051
- $ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/type"
14052
- },
14053
- kwh: {
14054
- type: "number",
14055
- minimum: 0
14056
- }
14057
- }
14058
- }
14059
- },
14060
- totals: {
14061
- type: "array",
14062
- items: {
14063
- type: "object",
14064
- required: ["lights", "climate", "media"],
14065
- properties: {
14066
- lights: {
14067
- type: "number",
14068
- minimum: 0
14069
- },
14070
- climate: {
14071
- type: "number",
14072
- minimum: 0
14073
- },
14074
- media: {
14075
- type: "number",
14076
- minimum: 0
14077
- }
14078
- }
14079
- }
14080
- },
14081
- costPerKw: {
14082
- type: "number",
14083
- minimum: 0
14084
- }
14085
- }
14086
- };
14087
- }
14088
- });
14089
-
14090
- // src/Models/energyReportHourly.js
14091
- var require_energyReportHourly2 = __commonJS({
14092
- "src/Models/energyReportHourly.js"(exports, module) {
14093
- var schemas = require_schema();
14094
- var schema = require_energyReportHourly();
14095
- var Kohost = require_kohost();
14096
- schemas.add(schema);
14097
- var validator = schemas.compile(schema);
14098
- var EnergyReportHourly = class extends Kohost {
14099
- constructor(data) {
14100
- super(data);
14101
- }
14102
- };
14103
- __name(EnergyReportHourly, "EnergyReportHourly");
14104
- Object.defineProperty(EnergyReportHourly.prototype, "schema", {
14105
- value: schema
14106
- });
14107
- Object.defineProperty(EnergyReportHourly.prototype, "validator", {
14108
- get: function() {
14109
- return validator;
14110
- }
14111
- });
14112
- Object.defineProperty(EnergyReportHourly, "validProperties", {
14113
- value: Object.keys(schema.properties)
14114
- });
14115
- Object.defineProperty(EnergyReportHourly, "actionProperties", {
14116
- value: ["state"]
14117
- });
14118
- module.exports = EnergyReportHourly;
14119
- var hourlyShardReport = new EnergyReportHourly({
14120
- "id": "RepIdHr1",
14121
- "type": "energyReportHourly",
14122
- "roomId": "TestRoom",
14123
- "first": /* @__PURE__ */ new Date(),
14124
- "last": /* @__PURE__ */ new Date(),
14125
- "consumption": [{
14126
- "id": "1",
14127
- "type": "dimmer",
14128
- "kwh": 0.121315
14129
- }],
14130
- "totals": [{
14131
- "lights": 10,
14132
- "climate": 10,
14133
- "media": 10
14134
- }],
14135
- "costPerKw": 0.14
14136
- });
14137
- console.log(hourlyShardReport);
14138
- }
14139
- });
14140
-
14141
- // src/schemas/energyReportDaily.json
14142
- var require_energyReportDaily = __commonJS({
14143
- "src/schemas/energyReportDaily.json"(exports, module) {
14144
- module.exports = {
14145
- $schema: "http://json-schema.org/draft-07/schema",
14146
- $id: "https://api.kohost.io/schemas/v3/energyReportDaily.json",
14147
- title: "Energy Report Daily",
14148
- description: "Daily Report for Energy based on energy report shards",
14149
- type: "object",
14150
- required: ["id", "type", "roomId", "first", "last", "consumption", "totals", "costPerKw"],
14151
- properties: {
14152
- id: {
14153
- $ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/id"
14154
- },
14155
- type: {
14156
- type: "string",
14157
- enum: [
14158
- "energyReportDaily"
14159
- ],
14160
- default: "energyReportDaily"
14027
+ reportTime: {
14028
+ time: "string",
14029
+ enum: ["hourly", "daily", "monthly"]
14161
14030
  },
14162
14031
  roomId: {
14163
14032
  $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
@@ -14219,54 +14088,32 @@ var require_energyReportDaily = __commonJS({
14219
14088
  }
14220
14089
  });
14221
14090
 
14222
- // src/Models/energyReportDaily.js
14223
- var require_energyReportDaily2 = __commonJS({
14224
- "src/Models/energyReportDaily.js"(exports, module) {
14091
+ // src/Models/energyReport.js
14092
+ var require_energyReport2 = __commonJS({
14093
+ "src/Models/energyReport.js"(exports, module) {
14225
14094
  var schemas = require_schema();
14226
- var schema = require_energyReportDaily();
14095
+ var schema = require_energyReport();
14227
14096
  var Kohost = require_kohost();
14228
14097
  schemas.add(schema);
14229
14098
  var validator = schemas.compile(schema);
14230
- var energyReportDaily = class extends Kohost {
14099
+ var EnergyReport = class extends Kohost {
14231
14100
  constructor(data) {
14232
14101
  super(data);
14233
14102
  }
14234
14103
  };
14235
- __name(energyReportDaily, "energyReportDaily");
14236
- Object.defineProperty(energyReportDaily.prototype, "schema", {
14104
+ __name(EnergyReport, "EnergyReport");
14105
+ Object.defineProperty(EnergyReport.prototype, "schema", {
14237
14106
  value: schema
14238
14107
  });
14239
- Object.defineProperty(energyReportDaily.prototype, "validator", {
14108
+ Object.defineProperty(EnergyReport.prototype, "validator", {
14240
14109
  get: function() {
14241
14110
  return validator;
14242
14111
  }
14243
14112
  });
14244
- Object.defineProperty(energyReportDaily, "validProperties", {
14113
+ Object.defineProperty(EnergyReport, "validProperties", {
14245
14114
  value: Object.keys(schema.properties)
14246
14115
  });
14247
- Object.defineProperty(energyReportDaily, "actionProperties", {
14248
- value: ["state"]
14249
- });
14250
- module.exports = energyReportDaily;
14251
- var dailyShardReport = new energyReportDaily({
14252
- "id": "RepIdHr1",
14253
- "type": "energyReportDaily",
14254
- "roomId": "TestRoom",
14255
- "first": /* @__PURE__ */ new Date(),
14256
- "last": /* @__PURE__ */ new Date(),
14257
- "consumption": [{
14258
- "id": "1",
14259
- "type": "dimmer",
14260
- "kwh": 0.121315
14261
- }],
14262
- "totals": [{
14263
- "lights": 10,
14264
- "climate": 10,
14265
- "media": 10
14266
- }],
14267
- "costPerKw": 0.14
14268
- });
14269
- console.log(dailyShardReport);
14116
+ module.exports = EnergyReport;
14270
14117
  }
14271
14118
  });
14272
14119
 
@@ -14623,8 +14470,7 @@ var require_Models = __commonJS({
14623
14470
  var Credential = require_credential2();
14624
14471
  var ShortLink = require_shortLink2();
14625
14472
  var EnergyReportShard = require_energyReportShard2();
14626
- var EnergyReportHourly = require_energyReportHourly2();
14627
- var EnergyReportDaily = require_energyReportDaily2();
14473
+ var EnergyReport = require_energyReport2();
14628
14474
  var Property = require_property2();
14629
14475
  var Organization = require_organization2();
14630
14476
  module.exports = {
@@ -14655,8 +14501,7 @@ var require_Models = __commonJS({
14655
14501
  Credential,
14656
14502
  ShortLink,
14657
14503
  EnergyReportShard,
14658
- EnergyReportHourly,
14659
- EnergyReportDaily
14504
+ EnergyReport
14660
14505
  };
14661
14506
  }
14662
14507
  });