@arekstasko/plantcare-api-client 1.1.0 → 1.1.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.
- package/dist/index.cjs +4 -7
- package/dist/index.d.cts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +4 -7
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -340,18 +340,15 @@ var Client = /*#__PURE__*/ function() {
|
|
|
340
340
|
},
|
|
341
341
|
{
|
|
342
342
|
/**
|
|
343
|
-
* @param id (optional)
|
|
344
343
|
* @param fromDate (optional)
|
|
345
344
|
* @param toDate (optional)
|
|
346
345
|
* @return OK
|
|
347
346
|
*/ key: "average",
|
|
348
|
-
value: function average(
|
|
347
|
+
value: function average(id, fromDate, toDate) {
|
|
349
348
|
var _this = this;
|
|
350
|
-
var url_ = this.baseUrl + "/api/humidity-measurements/{
|
|
351
|
-
if (
|
|
352
|
-
url_ = url_.replace("{
|
|
353
|
-
if (id === null) throw new globalThis.Error("The parameter 'id' cannot be null.");
|
|
354
|
-
else if (id !== void 0) url_ += "id=" + encodeURIComponent("" + id) + "&";
|
|
349
|
+
var url_ = this.baseUrl + "/api/humidity-measurements/{id}/average?";
|
|
350
|
+
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
351
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
355
352
|
if (fromDate === null) throw new globalThis.Error("The parameter 'fromDate' cannot be null.");
|
|
356
353
|
else if (fromDate !== void 0) url_ += "fromDate=" + encodeURIComponent(fromDate ? "" + fromDate.toISOString() : "") + "&";
|
|
357
354
|
if (toDate === null) throw new globalThis.Error("The parameter 'toDate' cannot be null.");
|
package/dist/index.d.cts
CHANGED
|
@@ -12,12 +12,11 @@ interface IClient {
|
|
|
12
12
|
*/
|
|
13
13
|
humidityMeasurementsAll(id?: number | undefined, fromDate?: Date | undefined, toDate?: Date | undefined): Promise<IHumidityMeasurement[]>;
|
|
14
14
|
/**
|
|
15
|
-
* @param id (optional)
|
|
16
15
|
* @param fromDate (optional)
|
|
17
16
|
* @param toDate (optional)
|
|
18
17
|
* @return OK
|
|
19
18
|
*/
|
|
20
|
-
average(
|
|
19
|
+
average(id: number, fromDate?: Date | undefined, toDate?: Date | undefined): Promise<AverageHumidity[]>;
|
|
21
20
|
/**
|
|
22
21
|
* @param body (optional)
|
|
23
22
|
* @return OK
|
|
@@ -96,12 +95,11 @@ declare class Client implements IClient {
|
|
|
96
95
|
humidityMeasurementsAll(id?: number | undefined, fromDate?: Date | undefined, toDate?: Date | undefined): Promise<IHumidityMeasurement[]>;
|
|
97
96
|
protected processHumidityMeasurementsAll(response: Response): Promise<IHumidityMeasurement[]>;
|
|
98
97
|
/**
|
|
99
|
-
* @param id (optional)
|
|
100
98
|
* @param fromDate (optional)
|
|
101
99
|
* @param toDate (optional)
|
|
102
100
|
* @return OK
|
|
103
101
|
*/
|
|
104
|
-
average(
|
|
102
|
+
average(id: number, fromDate?: Date | undefined, toDate?: Date | undefined): Promise<AverageHumidity[]>;
|
|
105
103
|
protected processAverage(response: Response): Promise<AverageHumidity[]>;
|
|
106
104
|
/**
|
|
107
105
|
* @param body (optional)
|
package/dist/index.d.ts
CHANGED
|
@@ -12,12 +12,11 @@ interface IClient {
|
|
|
12
12
|
*/
|
|
13
13
|
humidityMeasurementsAll(id?: number | undefined, fromDate?: Date | undefined, toDate?: Date | undefined): Promise<IHumidityMeasurement[]>;
|
|
14
14
|
/**
|
|
15
|
-
* @param id (optional)
|
|
16
15
|
* @param fromDate (optional)
|
|
17
16
|
* @param toDate (optional)
|
|
18
17
|
* @return OK
|
|
19
18
|
*/
|
|
20
|
-
average(
|
|
19
|
+
average(id: number, fromDate?: Date | undefined, toDate?: Date | undefined): Promise<AverageHumidity[]>;
|
|
21
20
|
/**
|
|
22
21
|
* @param body (optional)
|
|
23
22
|
* @return OK
|
|
@@ -96,12 +95,11 @@ declare class Client implements IClient {
|
|
|
96
95
|
humidityMeasurementsAll(id?: number | undefined, fromDate?: Date | undefined, toDate?: Date | undefined): Promise<IHumidityMeasurement[]>;
|
|
97
96
|
protected processHumidityMeasurementsAll(response: Response): Promise<IHumidityMeasurement[]>;
|
|
98
97
|
/**
|
|
99
|
-
* @param id (optional)
|
|
100
98
|
* @param fromDate (optional)
|
|
101
99
|
* @param toDate (optional)
|
|
102
100
|
* @return OK
|
|
103
101
|
*/
|
|
104
|
-
average(
|
|
102
|
+
average(id: number, fromDate?: Date | undefined, toDate?: Date | undefined): Promise<AverageHumidity[]>;
|
|
105
103
|
protected processAverage(response: Response): Promise<AverageHumidity[]>;
|
|
106
104
|
/**
|
|
107
105
|
* @param body (optional)
|
package/dist/index.js
CHANGED
|
@@ -244,18 +244,15 @@ var Client = /*#__PURE__*/ function() {
|
|
|
244
244
|
},
|
|
245
245
|
{
|
|
246
246
|
/**
|
|
247
|
-
* @param id (optional)
|
|
248
247
|
* @param fromDate (optional)
|
|
249
248
|
* @param toDate (optional)
|
|
250
249
|
* @return OK
|
|
251
250
|
*/ key: "average",
|
|
252
|
-
value: function average(
|
|
251
|
+
value: function average(id, fromDate, toDate) {
|
|
253
252
|
var _this = this;
|
|
254
|
-
var url_ = this.baseUrl + "/api/humidity-measurements/{
|
|
255
|
-
if (
|
|
256
|
-
url_ = url_.replace("{
|
|
257
|
-
if (id === null) throw new globalThis.Error("The parameter 'id' cannot be null.");
|
|
258
|
-
else if (id !== void 0) url_ += "id=" + encodeURIComponent("" + id) + "&";
|
|
253
|
+
var url_ = this.baseUrl + "/api/humidity-measurements/{id}/average?";
|
|
254
|
+
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
255
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
259
256
|
if (fromDate === null) throw new globalThis.Error("The parameter 'fromDate' cannot be null.");
|
|
260
257
|
else if (fromDate !== void 0) url_ += "fromDate=" + encodeURIComponent(fromDate ? "" + fromDate.toISOString() : "") + "&";
|
|
261
258
|
if (toDate === null) throw new globalThis.Error("The parameter 'toDate' cannot be null.");
|