@arekstasko/plantcare-api-client 1.3.2 → 1.3.4
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 +11 -17
- package/dist/index.d.cts +4 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.js +11 -17
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -242,8 +242,8 @@ var Client = /*#__PURE__*/ function() {
|
|
|
242
242
|
{
|
|
243
243
|
/**
|
|
244
244
|
* @return OK
|
|
245
|
-
*/ key: "
|
|
246
|
-
value: function
|
|
245
|
+
*/ key: "distributor",
|
|
246
|
+
value: function distributor(cancelToken) {
|
|
247
247
|
var _this = this;
|
|
248
248
|
var url_ = this.baseUrl + "/api/distributor";
|
|
249
249
|
url_ = url_.replace(/[?&]$/, "");
|
|
@@ -262,13 +262,13 @@ var Client = /*#__PURE__*/ function() {
|
|
|
262
262
|
throw _error;
|
|
263
263
|
}
|
|
264
264
|
}).then(function(_response) {
|
|
265
|
-
return _this.
|
|
265
|
+
return _this.processDistributor(_response);
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
268
|
},
|
|
269
269
|
{
|
|
270
|
-
key: "
|
|
271
|
-
value: function
|
|
270
|
+
key: "processDistributor",
|
|
271
|
+
value: function processDistributor(response) {
|
|
272
272
|
var status = response.status;
|
|
273
273
|
var _headers = {};
|
|
274
274
|
if (response.headers && _type_of(response.headers) === "object") {
|
|
@@ -421,21 +421,15 @@ var Client = /*#__PURE__*/ function() {
|
|
|
421
421
|
},
|
|
422
422
|
{
|
|
423
423
|
/**
|
|
424
|
-
* @param distributorIdQuery (optional)
|
|
425
|
-
* @param plantIdQuery (optional)
|
|
426
424
|
* @return OK
|
|
427
425
|
*/ key: "addPlantToDistributor",
|
|
428
|
-
value: function addPlantToDistributor(
|
|
426
|
+
value: function addPlantToDistributor(distributorId, plantId, cancelToken) {
|
|
429
427
|
var _this = this;
|
|
430
|
-
var url_ = this.baseUrl + "/api/distributor/{distributorId}/{plantId}/add
|
|
431
|
-
if (
|
|
432
|
-
url_ = url_.replace("{distributorId}", encodeURIComponent("" +
|
|
433
|
-
if (
|
|
434
|
-
url_ = url_.replace("{plantId}", encodeURIComponent("" +
|
|
435
|
-
if (distributorIdQuery === null) throw new globalThis.Error("The parameter 'distributorIdQuery' cannot be null.");
|
|
436
|
-
else if (distributorIdQuery !== void 0) url_ += "distributorId=" + encodeURIComponent("" + distributorIdQuery) + "&";
|
|
437
|
-
if (plantIdQuery === null) throw new globalThis.Error("The parameter 'plantIdQuery' cannot be null.");
|
|
438
|
-
else if (plantIdQuery !== void 0) url_ += "plantId=" + encodeURIComponent("" + plantIdQuery) + "&";
|
|
428
|
+
var url_ = this.baseUrl + "/api/distributor/{distributorId}/{plantId}/add";
|
|
429
|
+
if (distributorId === void 0 || distributorId === null) throw new globalThis.Error("The parameter 'distributorId' must be defined.");
|
|
430
|
+
url_ = url_.replace("{distributorId}", encodeURIComponent("" + distributorId));
|
|
431
|
+
if (plantId === void 0 || plantId === null) throw new globalThis.Error("The parameter 'plantId' must be defined.");
|
|
432
|
+
url_ = url_.replace("{plantId}", encodeURIComponent("" + plantId));
|
|
439
433
|
url_ = url_.replace(/[?&]$/, "");
|
|
440
434
|
var options_ = {
|
|
441
435
|
method: "POST",
|
package/dist/index.d.cts
CHANGED
|
@@ -8,8 +8,8 @@ declare class Client {
|
|
|
8
8
|
/**
|
|
9
9
|
* @return OK
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
|
-
protected
|
|
11
|
+
distributor(cancelToken?: CancelToken): Promise<Distributor[]>;
|
|
12
|
+
protected processDistributor(response: AxiosResponse): Promise<Distributor[]>;
|
|
13
13
|
/**
|
|
14
14
|
* @param body (optional)
|
|
15
15
|
* @return OK
|
|
@@ -22,11 +22,9 @@ declare class Client {
|
|
|
22
22
|
getDistributor(id: number, cancelToken?: CancelToken): Promise<Distributor>;
|
|
23
23
|
protected processGetDistributor(response: AxiosResponse): Promise<Distributor>;
|
|
24
24
|
/**
|
|
25
|
-
* @param distributorIdQuery (optional)
|
|
26
|
-
* @param plantIdQuery (optional)
|
|
27
25
|
* @return OK
|
|
28
26
|
*/
|
|
29
|
-
addPlantToDistributor(
|
|
27
|
+
addPlantToDistributor(distributorId: number, plantId: number, cancelToken?: CancelToken): Promise<boolean>;
|
|
30
28
|
protected processAddPlantToDistributor(response: AxiosResponse): Promise<boolean>;
|
|
31
29
|
/**
|
|
32
30
|
* @return OK
|
|
@@ -223,6 +221,7 @@ interface Plant {
|
|
|
223
221
|
id?: number;
|
|
224
222
|
placeId?: number;
|
|
225
223
|
moduleId?: number;
|
|
224
|
+
distributorId?: number;
|
|
226
225
|
name?: string | undefined;
|
|
227
226
|
description?: string | undefined;
|
|
228
227
|
minHumidity?: number | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ declare class Client {
|
|
|
8
8
|
/**
|
|
9
9
|
* @return OK
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
|
-
protected
|
|
11
|
+
distributor(cancelToken?: CancelToken): Promise<Distributor[]>;
|
|
12
|
+
protected processDistributor(response: AxiosResponse): Promise<Distributor[]>;
|
|
13
13
|
/**
|
|
14
14
|
* @param body (optional)
|
|
15
15
|
* @return OK
|
|
@@ -22,11 +22,9 @@ declare class Client {
|
|
|
22
22
|
getDistributor(id: number, cancelToken?: CancelToken): Promise<Distributor>;
|
|
23
23
|
protected processGetDistributor(response: AxiosResponse): Promise<Distributor>;
|
|
24
24
|
/**
|
|
25
|
-
* @param distributorIdQuery (optional)
|
|
26
|
-
* @param plantIdQuery (optional)
|
|
27
25
|
* @return OK
|
|
28
26
|
*/
|
|
29
|
-
addPlantToDistributor(
|
|
27
|
+
addPlantToDistributor(distributorId: number, plantId: number, cancelToken?: CancelToken): Promise<boolean>;
|
|
30
28
|
protected processAddPlantToDistributor(response: AxiosResponse): Promise<boolean>;
|
|
31
29
|
/**
|
|
32
30
|
* @return OK
|
|
@@ -223,6 +221,7 @@ interface Plant {
|
|
|
223
221
|
id?: number;
|
|
224
222
|
placeId?: number;
|
|
225
223
|
moduleId?: number;
|
|
224
|
+
distributorId?: number;
|
|
226
225
|
name?: string | undefined;
|
|
227
226
|
description?: string | undefined;
|
|
228
227
|
minHumidity?: number | undefined;
|
package/dist/index.js
CHANGED
|
@@ -131,8 +131,8 @@ var Client = /*#__PURE__*/ function() {
|
|
|
131
131
|
{
|
|
132
132
|
/**
|
|
133
133
|
* @return OK
|
|
134
|
-
*/ key: "
|
|
135
|
-
value: function
|
|
134
|
+
*/ key: "distributor",
|
|
135
|
+
value: function distributor(cancelToken) {
|
|
136
136
|
var _this = this;
|
|
137
137
|
var url_ = this.baseUrl + "/api/distributor";
|
|
138
138
|
url_ = url_.replace(/[?&]$/, "");
|
|
@@ -151,13 +151,13 @@ var Client = /*#__PURE__*/ function() {
|
|
|
151
151
|
throw _error;
|
|
152
152
|
}
|
|
153
153
|
}).then(function(_response) {
|
|
154
|
-
return _this.
|
|
154
|
+
return _this.processDistributor(_response);
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
},
|
|
158
158
|
{
|
|
159
|
-
key: "
|
|
160
|
-
value: function
|
|
159
|
+
key: "processDistributor",
|
|
160
|
+
value: function processDistributor(response) {
|
|
161
161
|
var status = response.status;
|
|
162
162
|
var _headers = {};
|
|
163
163
|
if (response.headers && _type_of(response.headers) === "object") {
|
|
@@ -310,21 +310,15 @@ var Client = /*#__PURE__*/ function() {
|
|
|
310
310
|
},
|
|
311
311
|
{
|
|
312
312
|
/**
|
|
313
|
-
* @param distributorIdQuery (optional)
|
|
314
|
-
* @param plantIdQuery (optional)
|
|
315
313
|
* @return OK
|
|
316
314
|
*/ key: "addPlantToDistributor",
|
|
317
|
-
value: function addPlantToDistributor(
|
|
315
|
+
value: function addPlantToDistributor(distributorId, plantId, cancelToken) {
|
|
318
316
|
var _this = this;
|
|
319
|
-
var url_ = this.baseUrl + "/api/distributor/{distributorId}/{plantId}/add
|
|
320
|
-
if (
|
|
321
|
-
url_ = url_.replace("{distributorId}", encodeURIComponent("" +
|
|
322
|
-
if (
|
|
323
|
-
url_ = url_.replace("{plantId}", encodeURIComponent("" +
|
|
324
|
-
if (distributorIdQuery === null) throw new globalThis.Error("The parameter 'distributorIdQuery' cannot be null.");
|
|
325
|
-
else if (distributorIdQuery !== void 0) url_ += "distributorId=" + encodeURIComponent("" + distributorIdQuery) + "&";
|
|
326
|
-
if (plantIdQuery === null) throw new globalThis.Error("The parameter 'plantIdQuery' cannot be null.");
|
|
327
|
-
else if (plantIdQuery !== void 0) url_ += "plantId=" + encodeURIComponent("" + plantIdQuery) + "&";
|
|
317
|
+
var url_ = this.baseUrl + "/api/distributor/{distributorId}/{plantId}/add";
|
|
318
|
+
if (distributorId === void 0 || distributorId === null) throw new globalThis.Error("The parameter 'distributorId' must be defined.");
|
|
319
|
+
url_ = url_.replace("{distributorId}", encodeURIComponent("" + distributorId));
|
|
320
|
+
if (plantId === void 0 || plantId === null) throw new globalThis.Error("The parameter 'plantId' must be defined.");
|
|
321
|
+
url_ = url_.replace("{plantId}", encodeURIComponent("" + plantId));
|
|
328
322
|
url_ = url_.replace(/[?&]$/, "");
|
|
329
323
|
var options_ = {
|
|
330
324
|
method: "POST",
|