@arekstasko/plantcare-api-client 1.1.0 → 1.1.2
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 +465 -348
- package/dist/index.d.cts +37 -115
- package/dist/index.d.ts +37 -115
- package/dist/index.js +453 -348
- package/package.json +4 -1
package/dist/index.cjs
CHANGED
|
@@ -118,9 +118,11 @@ function _is_native_reflect_construct() {
|
|
|
118
118
|
return !!result;
|
|
119
119
|
})();
|
|
120
120
|
}
|
|
121
|
+
var __create = Object.create;
|
|
121
122
|
var __defProp = Object.defineProperty;
|
|
122
123
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
123
124
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
125
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
124
126
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
125
127
|
var __export = function(target, all) {
|
|
126
128
|
for(var name in all)__defProp(target, name, {
|
|
@@ -159,6 +161,16 @@ var __copyProps = function(to, from, except, desc) {
|
|
|
159
161
|
}
|
|
160
162
|
return to;
|
|
161
163
|
};
|
|
164
|
+
var __toESM = function(mod, isNodeMode, target) {
|
|
165
|
+
return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
|
|
166
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
167
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
168
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
169
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
170
|
+
value: mod,
|
|
171
|
+
enumerable: true
|
|
172
|
+
}) : target, mod);
|
|
173
|
+
};
|
|
162
174
|
var __toCommonJS = function(mod) {
|
|
163
175
|
return __copyProps(__defProp({}, "__esModule", {
|
|
164
176
|
value: true
|
|
@@ -215,11 +227,12 @@ __export(index_exports, {
|
|
|
215
227
|
});
|
|
216
228
|
module.exports = __toCommonJS(index_exports);
|
|
217
229
|
// ApiClient.ts
|
|
230
|
+
var import_axios = __toESM(require("axios"), 1);
|
|
218
231
|
var Client = /*#__PURE__*/ function() {
|
|
219
|
-
function Client(baseUrl,
|
|
232
|
+
function Client(baseUrl, instance) {
|
|
220
233
|
_class_call_check(this, Client);
|
|
221
234
|
this.jsonParseReviver = void 0;
|
|
222
|
-
this.
|
|
235
|
+
this.instance = instance || import_axios.default.create();
|
|
223
236
|
this.baseUrl = baseUrl !== null && baseUrl !== void 0 ? baseUrl : "";
|
|
224
237
|
}
|
|
225
238
|
_create_class(Client, [
|
|
@@ -228,20 +241,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
228
241
|
* @param body (optional)
|
|
229
242
|
* @return OK
|
|
230
243
|
*/ key: "humidityMeasurements",
|
|
231
|
-
value: function humidityMeasurements(body) {
|
|
244
|
+
value: function humidityMeasurements(body, cancelToken) {
|
|
232
245
|
var _this = this;
|
|
233
246
|
var url_ = this.baseUrl + "/api/humidity-measurements";
|
|
234
247
|
url_ = url_.replace(/[?&]$/, "");
|
|
235
248
|
var content_ = JSON.stringify(body);
|
|
236
249
|
var options_ = {
|
|
237
|
-
|
|
250
|
+
data: content_,
|
|
238
251
|
method: "POST",
|
|
252
|
+
url: url_,
|
|
239
253
|
headers: {
|
|
240
254
|
"Content-Type": "application/json",
|
|
241
255
|
"Accept": "application/json"
|
|
242
|
-
}
|
|
256
|
+
},
|
|
257
|
+
cancelToken: cancelToken
|
|
243
258
|
};
|
|
244
|
-
return this.
|
|
259
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
260
|
+
if (isAxiosError(_error) && _error.response) {
|
|
261
|
+
return _error.response;
|
|
262
|
+
} else {
|
|
263
|
+
throw _error;
|
|
264
|
+
}
|
|
265
|
+
}).then(function(_response) {
|
|
245
266
|
return _this.processHumidityMeasurements(_response);
|
|
246
267
|
});
|
|
247
268
|
}
|
|
@@ -249,47 +270,45 @@ var Client = /*#__PURE__*/ function() {
|
|
|
249
270
|
{
|
|
250
271
|
key: "processHumidityMeasurements",
|
|
251
272
|
value: function processHumidityMeasurements(response) {
|
|
252
|
-
var _this = this;
|
|
253
273
|
var status = response.status;
|
|
254
274
|
var _headers = {};
|
|
255
|
-
if (response.headers && response.headers
|
|
256
|
-
response.headers
|
|
257
|
-
|
|
258
|
-
|
|
275
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
276
|
+
for(var k in response.headers){
|
|
277
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
278
|
+
_headers[k] = response.headers[k];
|
|
279
|
+
}
|
|
280
|
+
}
|
|
259
281
|
}
|
|
260
|
-
;
|
|
261
282
|
if (status === 200) {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
283
|
+
var _responseText = response.data;
|
|
284
|
+
var result200 = null;
|
|
285
|
+
var resultData200 = _responseText;
|
|
286
|
+
result200 = JSON.parse(resultData200);
|
|
287
|
+
return Promise.resolve(result200);
|
|
267
288
|
} else if (status === 500) {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
289
|
+
var _responseText1 = response.data;
|
|
290
|
+
var result500 = null;
|
|
291
|
+
var resultData500 = _responseText1;
|
|
292
|
+
result500 = JSON.parse(resultData500);
|
|
293
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
273
294
|
} else if (status !== 200 && status !== 204) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
});
|
|
295
|
+
var _responseText2 = response.data;
|
|
296
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
277
297
|
}
|
|
278
298
|
return Promise.resolve(null);
|
|
279
299
|
}
|
|
280
300
|
},
|
|
281
301
|
{
|
|
282
302
|
/**
|
|
283
|
-
* @param id (optional)
|
|
284
303
|
* @param fromDate (optional)
|
|
285
304
|
* @param toDate (optional)
|
|
286
305
|
* @return OK
|
|
287
306
|
*/ key: "humidityMeasurementsAll",
|
|
288
|
-
value: function humidityMeasurementsAll(id, fromDate, toDate) {
|
|
307
|
+
value: function humidityMeasurementsAll(id, fromDate, toDate, cancelToken) {
|
|
289
308
|
var _this = this;
|
|
290
|
-
var url_ = this.baseUrl + "/api/humidity-measurements?";
|
|
291
|
-
if (id === null) throw new globalThis.Error("The parameter 'id'
|
|
292
|
-
|
|
309
|
+
var url_ = this.baseUrl + "/api/humidity-measurements/{id}?";
|
|
310
|
+
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
311
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
293
312
|
if (fromDate === null) throw new globalThis.Error("The parameter 'fromDate' cannot be null.");
|
|
294
313
|
else if (fromDate !== void 0) url_ += "fromDate=" + encodeURIComponent(fromDate ? "" + fromDate.toISOString() : "") + "&";
|
|
295
314
|
if (toDate === null) throw new globalThis.Error("The parameter 'toDate' cannot be null.");
|
|
@@ -297,11 +316,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
297
316
|
url_ = url_.replace(/[?&]$/, "");
|
|
298
317
|
var options_ = {
|
|
299
318
|
method: "GET",
|
|
319
|
+
url: url_,
|
|
300
320
|
headers: {
|
|
301
321
|
"Accept": "application/json"
|
|
302
|
-
}
|
|
322
|
+
},
|
|
323
|
+
cancelToken: cancelToken
|
|
303
324
|
};
|
|
304
|
-
return this.
|
|
325
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
326
|
+
if (isAxiosError(_error) && _error.response) {
|
|
327
|
+
return _error.response;
|
|
328
|
+
} else {
|
|
329
|
+
throw _error;
|
|
330
|
+
}
|
|
331
|
+
}).then(function(_response) {
|
|
305
332
|
return _this.processHumidityMeasurementsAll(_response);
|
|
306
333
|
});
|
|
307
334
|
}
|
|
@@ -309,49 +336,45 @@ var Client = /*#__PURE__*/ function() {
|
|
|
309
336
|
{
|
|
310
337
|
key: "processHumidityMeasurementsAll",
|
|
311
338
|
value: function processHumidityMeasurementsAll(response) {
|
|
312
|
-
var _this = this;
|
|
313
339
|
var status = response.status;
|
|
314
340
|
var _headers = {};
|
|
315
|
-
if (response.headers && response.headers
|
|
316
|
-
response.headers
|
|
317
|
-
|
|
318
|
-
|
|
341
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
342
|
+
for(var k in response.headers){
|
|
343
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
344
|
+
_headers[k] = response.headers[k];
|
|
345
|
+
}
|
|
346
|
+
}
|
|
319
347
|
}
|
|
320
|
-
;
|
|
321
348
|
if (status === 200) {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
349
|
+
var _responseText = response.data;
|
|
350
|
+
var result200 = null;
|
|
351
|
+
var resultData200 = _responseText;
|
|
352
|
+
result200 = JSON.parse(resultData200);
|
|
353
|
+
return Promise.resolve(result200);
|
|
327
354
|
} else if (status === 500) {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
355
|
+
var _responseText1 = response.data;
|
|
356
|
+
var result500 = null;
|
|
357
|
+
var resultData500 = _responseText1;
|
|
358
|
+
result500 = JSON.parse(resultData500);
|
|
359
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
333
360
|
} else if (status !== 200 && status !== 204) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
});
|
|
361
|
+
var _responseText2 = response.data;
|
|
362
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
337
363
|
}
|
|
338
364
|
return Promise.resolve(null);
|
|
339
365
|
}
|
|
340
366
|
},
|
|
341
367
|
{
|
|
342
368
|
/**
|
|
343
|
-
* @param id (optional)
|
|
344
369
|
* @param fromDate (optional)
|
|
345
370
|
* @param toDate (optional)
|
|
346
371
|
* @return OK
|
|
347
372
|
*/ key: "average",
|
|
348
|
-
value: function average(
|
|
373
|
+
value: function average(id, fromDate, toDate, cancelToken) {
|
|
349
374
|
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) + "&";
|
|
375
|
+
var url_ = this.baseUrl + "/api/humidity-measurements/{id}/average?";
|
|
376
|
+
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
377
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
355
378
|
if (fromDate === null) throw new globalThis.Error("The parameter 'fromDate' cannot be null.");
|
|
356
379
|
else if (fromDate !== void 0) url_ += "fromDate=" + encodeURIComponent(fromDate ? "" + fromDate.toISOString() : "") + "&";
|
|
357
380
|
if (toDate === null) throw new globalThis.Error("The parameter 'toDate' cannot be null.");
|
|
@@ -359,11 +382,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
359
382
|
url_ = url_.replace(/[?&]$/, "");
|
|
360
383
|
var options_ = {
|
|
361
384
|
method: "GET",
|
|
385
|
+
url: url_,
|
|
362
386
|
headers: {
|
|
363
387
|
"Accept": "application/json"
|
|
364
|
-
}
|
|
388
|
+
},
|
|
389
|
+
cancelToken: cancelToken
|
|
365
390
|
};
|
|
366
|
-
return this.
|
|
391
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
392
|
+
if (isAxiosError(_error) && _error.response) {
|
|
393
|
+
return _error.response;
|
|
394
|
+
} else {
|
|
395
|
+
throw _error;
|
|
396
|
+
}
|
|
397
|
+
}).then(function(_response) {
|
|
367
398
|
return _this.processAverage(_response);
|
|
368
399
|
});
|
|
369
400
|
}
|
|
@@ -371,31 +402,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
371
402
|
{
|
|
372
403
|
key: "processAverage",
|
|
373
404
|
value: function processAverage(response) {
|
|
374
|
-
var _this = this;
|
|
375
405
|
var status = response.status;
|
|
376
406
|
var _headers = {};
|
|
377
|
-
if (response.headers && response.headers
|
|
378
|
-
response.headers
|
|
379
|
-
|
|
380
|
-
|
|
407
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
408
|
+
for(var k in response.headers){
|
|
409
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
410
|
+
_headers[k] = response.headers[k];
|
|
411
|
+
}
|
|
412
|
+
}
|
|
381
413
|
}
|
|
382
|
-
;
|
|
383
414
|
if (status === 200) {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
415
|
+
var _responseText = response.data;
|
|
416
|
+
var result200 = null;
|
|
417
|
+
var resultData200 = _responseText;
|
|
418
|
+
result200 = JSON.parse(resultData200);
|
|
419
|
+
return Promise.resolve(result200);
|
|
389
420
|
} else if (status === 500) {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
421
|
+
var _responseText1 = response.data;
|
|
422
|
+
var result500 = null;
|
|
423
|
+
var resultData500 = _responseText1;
|
|
424
|
+
result500 = JSON.parse(resultData500);
|
|
425
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
395
426
|
} else if (status !== 200 && status !== 204) {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
});
|
|
427
|
+
var _responseText2 = response.data;
|
|
428
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
399
429
|
}
|
|
400
430
|
return Promise.resolve(null);
|
|
401
431
|
}
|
|
@@ -405,20 +435,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
405
435
|
* @param body (optional)
|
|
406
436
|
* @return OK
|
|
407
437
|
*/ key: "modulesPOST",
|
|
408
|
-
value: function modulesPOST(body) {
|
|
438
|
+
value: function modulesPOST(body, cancelToken) {
|
|
409
439
|
var _this = this;
|
|
410
440
|
var url_ = this.baseUrl + "/api/modules";
|
|
411
441
|
url_ = url_.replace(/[?&]$/, "");
|
|
412
442
|
var content_ = JSON.stringify(body);
|
|
413
443
|
var options_ = {
|
|
414
|
-
|
|
444
|
+
data: content_,
|
|
415
445
|
method: "POST",
|
|
446
|
+
url: url_,
|
|
416
447
|
headers: {
|
|
417
448
|
"Content-Type": "application/json",
|
|
418
449
|
"Accept": "application/json"
|
|
419
|
-
}
|
|
450
|
+
},
|
|
451
|
+
cancelToken: cancelToken
|
|
420
452
|
};
|
|
421
|
-
return this.
|
|
453
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
454
|
+
if (isAxiosError(_error) && _error.response) {
|
|
455
|
+
return _error.response;
|
|
456
|
+
} else {
|
|
457
|
+
throw _error;
|
|
458
|
+
}
|
|
459
|
+
}).then(function(_response) {
|
|
422
460
|
return _this.processModulesPOST(_response);
|
|
423
461
|
});
|
|
424
462
|
}
|
|
@@ -426,31 +464,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
426
464
|
{
|
|
427
465
|
key: "processModulesPOST",
|
|
428
466
|
value: function processModulesPOST(response) {
|
|
429
|
-
var _this = this;
|
|
430
467
|
var status = response.status;
|
|
431
468
|
var _headers = {};
|
|
432
|
-
if (response.headers && response.headers
|
|
433
|
-
response.headers
|
|
434
|
-
|
|
435
|
-
|
|
469
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
470
|
+
for(var k in response.headers){
|
|
471
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
472
|
+
_headers[k] = response.headers[k];
|
|
473
|
+
}
|
|
474
|
+
}
|
|
436
475
|
}
|
|
437
|
-
;
|
|
438
476
|
if (status === 200) {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
477
|
+
var _responseText = response.data;
|
|
478
|
+
var result200 = null;
|
|
479
|
+
var resultData200 = _responseText;
|
|
480
|
+
result200 = JSON.parse(resultData200);
|
|
481
|
+
return Promise.resolve(result200);
|
|
444
482
|
} else if (status === 500) {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
483
|
+
var _responseText1 = response.data;
|
|
484
|
+
var result500 = null;
|
|
485
|
+
var resultData500 = _responseText1;
|
|
486
|
+
result500 = JSON.parse(resultData500);
|
|
487
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
450
488
|
} else if (status !== 200 && status !== 204) {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
});
|
|
489
|
+
var _responseText2 = response.data;
|
|
490
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
454
491
|
}
|
|
455
492
|
return Promise.resolve(null);
|
|
456
493
|
}
|
|
@@ -459,17 +496,25 @@ var Client = /*#__PURE__*/ function() {
|
|
|
459
496
|
/**
|
|
460
497
|
* @return OK
|
|
461
498
|
*/ key: "modulesAll",
|
|
462
|
-
value: function modulesAll() {
|
|
499
|
+
value: function modulesAll(cancelToken) {
|
|
463
500
|
var _this = this;
|
|
464
501
|
var url_ = this.baseUrl + "/api/modules";
|
|
465
502
|
url_ = url_.replace(/[?&]$/, "");
|
|
466
503
|
var options_ = {
|
|
467
504
|
method: "GET",
|
|
505
|
+
url: url_,
|
|
468
506
|
headers: {
|
|
469
507
|
"Accept": "application/json"
|
|
470
|
-
}
|
|
508
|
+
},
|
|
509
|
+
cancelToken: cancelToken
|
|
471
510
|
};
|
|
472
|
-
return this.
|
|
511
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
512
|
+
if (isAxiosError(_error) && _error.response) {
|
|
513
|
+
return _error.response;
|
|
514
|
+
} else {
|
|
515
|
+
throw _error;
|
|
516
|
+
}
|
|
517
|
+
}).then(function(_response) {
|
|
473
518
|
return _this.processModulesAll(_response);
|
|
474
519
|
});
|
|
475
520
|
}
|
|
@@ -477,31 +522,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
477
522
|
{
|
|
478
523
|
key: "processModulesAll",
|
|
479
524
|
value: function processModulesAll(response) {
|
|
480
|
-
var _this = this;
|
|
481
525
|
var status = response.status;
|
|
482
526
|
var _headers = {};
|
|
483
|
-
if (response.headers && response.headers
|
|
484
|
-
response.headers
|
|
485
|
-
|
|
486
|
-
|
|
527
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
528
|
+
for(var k in response.headers){
|
|
529
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
530
|
+
_headers[k] = response.headers[k];
|
|
531
|
+
}
|
|
532
|
+
}
|
|
487
533
|
}
|
|
488
|
-
;
|
|
489
534
|
if (status === 200) {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
535
|
+
var _responseText = response.data;
|
|
536
|
+
var result200 = null;
|
|
537
|
+
var resultData200 = _responseText;
|
|
538
|
+
result200 = JSON.parse(resultData200);
|
|
539
|
+
return Promise.resolve(result200);
|
|
495
540
|
} else if (status === 500) {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
541
|
+
var _responseText1 = response.data;
|
|
542
|
+
var result500 = null;
|
|
543
|
+
var resultData500 = _responseText1;
|
|
544
|
+
result500 = JSON.parse(resultData500);
|
|
545
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
501
546
|
} else if (status !== 200 && status !== 204) {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
});
|
|
547
|
+
var _responseText2 = response.data;
|
|
548
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
505
549
|
}
|
|
506
550
|
return Promise.resolve(null);
|
|
507
551
|
}
|
|
@@ -510,7 +554,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
510
554
|
/**
|
|
511
555
|
* @return OK
|
|
512
556
|
*/ key: "modulesGET",
|
|
513
|
-
value: function modulesGET(id) {
|
|
557
|
+
value: function modulesGET(id, cancelToken) {
|
|
514
558
|
var _this = this;
|
|
515
559
|
var url_ = this.baseUrl + "/api/modules/{id}";
|
|
516
560
|
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
@@ -518,11 +562,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
518
562
|
url_ = url_.replace(/[?&]$/, "");
|
|
519
563
|
var options_ = {
|
|
520
564
|
method: "GET",
|
|
565
|
+
url: url_,
|
|
521
566
|
headers: {
|
|
522
567
|
"Accept": "application/json"
|
|
523
|
-
}
|
|
568
|
+
},
|
|
569
|
+
cancelToken: cancelToken
|
|
524
570
|
};
|
|
525
|
-
return this.
|
|
571
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
572
|
+
if (isAxiosError(_error) && _error.response) {
|
|
573
|
+
return _error.response;
|
|
574
|
+
} else {
|
|
575
|
+
throw _error;
|
|
576
|
+
}
|
|
577
|
+
}).then(function(_response) {
|
|
526
578
|
return _this.processModulesGET(_response);
|
|
527
579
|
});
|
|
528
580
|
}
|
|
@@ -530,31 +582,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
530
582
|
{
|
|
531
583
|
key: "processModulesGET",
|
|
532
584
|
value: function processModulesGET(response) {
|
|
533
|
-
var _this = this;
|
|
534
585
|
var status = response.status;
|
|
535
586
|
var _headers = {};
|
|
536
|
-
if (response.headers && response.headers
|
|
537
|
-
response.headers
|
|
538
|
-
|
|
539
|
-
|
|
587
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
588
|
+
for(var k in response.headers){
|
|
589
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
590
|
+
_headers[k] = response.headers[k];
|
|
591
|
+
}
|
|
592
|
+
}
|
|
540
593
|
}
|
|
541
|
-
;
|
|
542
594
|
if (status === 200) {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
595
|
+
var _responseText = response.data;
|
|
596
|
+
var result200 = null;
|
|
597
|
+
var resultData200 = _responseText;
|
|
598
|
+
result200 = JSON.parse(resultData200);
|
|
599
|
+
return Promise.resolve(result200);
|
|
548
600
|
} else if (status === 500) {
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
601
|
+
var _responseText1 = response.data;
|
|
602
|
+
var result500 = null;
|
|
603
|
+
var resultData500 = _responseText1;
|
|
604
|
+
result500 = JSON.parse(resultData500);
|
|
605
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
554
606
|
} else if (status !== 200 && status !== 204) {
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
});
|
|
607
|
+
var _responseText2 = response.data;
|
|
608
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
558
609
|
}
|
|
559
610
|
return Promise.resolve(null);
|
|
560
611
|
}
|
|
@@ -564,20 +615,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
564
615
|
* @param body (optional)
|
|
565
616
|
* @return OK
|
|
566
617
|
*/ key: "placesPOST",
|
|
567
|
-
value: function placesPOST(body) {
|
|
618
|
+
value: function placesPOST(body, cancelToken) {
|
|
568
619
|
var _this = this;
|
|
569
620
|
var url_ = this.baseUrl + "/api/places";
|
|
570
621
|
url_ = url_.replace(/[?&]$/, "");
|
|
571
622
|
var content_ = JSON.stringify(body);
|
|
572
623
|
var options_ = {
|
|
573
|
-
|
|
624
|
+
data: content_,
|
|
574
625
|
method: "POST",
|
|
626
|
+
url: url_,
|
|
575
627
|
headers: {
|
|
576
628
|
"Content-Type": "application/json",
|
|
577
629
|
"Accept": "application/json"
|
|
578
|
-
}
|
|
630
|
+
},
|
|
631
|
+
cancelToken: cancelToken
|
|
579
632
|
};
|
|
580
|
-
return this.
|
|
633
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
634
|
+
if (isAxiosError(_error) && _error.response) {
|
|
635
|
+
return _error.response;
|
|
636
|
+
} else {
|
|
637
|
+
throw _error;
|
|
638
|
+
}
|
|
639
|
+
}).then(function(_response) {
|
|
581
640
|
return _this.processPlacesPOST(_response);
|
|
582
641
|
});
|
|
583
642
|
}
|
|
@@ -585,31 +644,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
585
644
|
{
|
|
586
645
|
key: "processPlacesPOST",
|
|
587
646
|
value: function processPlacesPOST(response) {
|
|
588
|
-
var _this = this;
|
|
589
647
|
var status = response.status;
|
|
590
648
|
var _headers = {};
|
|
591
|
-
if (response.headers && response.headers
|
|
592
|
-
response.headers
|
|
593
|
-
|
|
594
|
-
|
|
649
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
650
|
+
for(var k in response.headers){
|
|
651
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
652
|
+
_headers[k] = response.headers[k];
|
|
653
|
+
}
|
|
654
|
+
}
|
|
595
655
|
}
|
|
596
|
-
;
|
|
597
656
|
if (status === 200) {
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
657
|
+
var _responseText = response.data;
|
|
658
|
+
var result200 = null;
|
|
659
|
+
var resultData200 = _responseText;
|
|
660
|
+
result200 = JSON.parse(resultData200);
|
|
661
|
+
return Promise.resolve(result200);
|
|
603
662
|
} else if (status === 500) {
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
663
|
+
var _responseText1 = response.data;
|
|
664
|
+
var result500 = null;
|
|
665
|
+
var resultData500 = _responseText1;
|
|
666
|
+
result500 = JSON.parse(resultData500);
|
|
667
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
609
668
|
} else if (status !== 200 && status !== 204) {
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
});
|
|
669
|
+
var _responseText2 = response.data;
|
|
670
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
613
671
|
}
|
|
614
672
|
return Promise.resolve(null);
|
|
615
673
|
}
|
|
@@ -619,7 +677,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
619
677
|
* @param id (optional)
|
|
620
678
|
* @return OK
|
|
621
679
|
*/ key: "placesDELETE",
|
|
622
|
-
value: function placesDELETE(id) {
|
|
680
|
+
value: function placesDELETE(id, cancelToken) {
|
|
623
681
|
var _this = this;
|
|
624
682
|
var url_ = this.baseUrl + "/api/places?";
|
|
625
683
|
if (id === null) throw new globalThis.Error("The parameter 'id' cannot be null.");
|
|
@@ -627,11 +685,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
627
685
|
url_ = url_.replace(/[?&]$/, "");
|
|
628
686
|
var options_ = {
|
|
629
687
|
method: "DELETE",
|
|
688
|
+
url: url_,
|
|
630
689
|
headers: {
|
|
631
690
|
"Accept": "application/json"
|
|
632
|
-
}
|
|
691
|
+
},
|
|
692
|
+
cancelToken: cancelToken
|
|
633
693
|
};
|
|
634
|
-
return this.
|
|
694
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
695
|
+
if (isAxiosError(_error) && _error.response) {
|
|
696
|
+
return _error.response;
|
|
697
|
+
} else {
|
|
698
|
+
throw _error;
|
|
699
|
+
}
|
|
700
|
+
}).then(function(_response) {
|
|
635
701
|
return _this.processPlacesDELETE(_response);
|
|
636
702
|
});
|
|
637
703
|
}
|
|
@@ -639,31 +705,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
639
705
|
{
|
|
640
706
|
key: "processPlacesDELETE",
|
|
641
707
|
value: function processPlacesDELETE(response) {
|
|
642
|
-
var _this = this;
|
|
643
708
|
var status = response.status;
|
|
644
709
|
var _headers = {};
|
|
645
|
-
if (response.headers && response.headers
|
|
646
|
-
response.headers
|
|
647
|
-
|
|
648
|
-
|
|
710
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
711
|
+
for(var k in response.headers){
|
|
712
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
713
|
+
_headers[k] = response.headers[k];
|
|
714
|
+
}
|
|
715
|
+
}
|
|
649
716
|
}
|
|
650
|
-
;
|
|
651
717
|
if (status === 200) {
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
718
|
+
var _responseText = response.data;
|
|
719
|
+
var result200 = null;
|
|
720
|
+
var resultData200 = _responseText;
|
|
721
|
+
result200 = JSON.parse(resultData200);
|
|
722
|
+
return Promise.resolve(result200);
|
|
657
723
|
} else if (status === 500) {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
724
|
+
var _responseText1 = response.data;
|
|
725
|
+
var result500 = null;
|
|
726
|
+
var resultData500 = _responseText1;
|
|
727
|
+
result500 = JSON.parse(resultData500);
|
|
728
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
663
729
|
} else if (status !== 200 && status !== 204) {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
});
|
|
730
|
+
var _responseText2 = response.data;
|
|
731
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
667
732
|
}
|
|
668
733
|
return Promise.resolve(null);
|
|
669
734
|
}
|
|
@@ -673,20 +738,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
673
738
|
* @param body (optional)
|
|
674
739
|
* @return OK
|
|
675
740
|
*/ key: "placesPUT",
|
|
676
|
-
value: function placesPUT(body) {
|
|
741
|
+
value: function placesPUT(body, cancelToken) {
|
|
677
742
|
var _this = this;
|
|
678
743
|
var url_ = this.baseUrl + "/api/places";
|
|
679
744
|
url_ = url_.replace(/[?&]$/, "");
|
|
680
745
|
var content_ = JSON.stringify(body);
|
|
681
746
|
var options_ = {
|
|
682
|
-
|
|
747
|
+
data: content_,
|
|
683
748
|
method: "PUT",
|
|
749
|
+
url: url_,
|
|
684
750
|
headers: {
|
|
685
751
|
"Content-Type": "application/json",
|
|
686
752
|
"Accept": "application/json"
|
|
687
|
-
}
|
|
753
|
+
},
|
|
754
|
+
cancelToken: cancelToken
|
|
688
755
|
};
|
|
689
|
-
return this.
|
|
756
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
757
|
+
if (isAxiosError(_error) && _error.response) {
|
|
758
|
+
return _error.response;
|
|
759
|
+
} else {
|
|
760
|
+
throw _error;
|
|
761
|
+
}
|
|
762
|
+
}).then(function(_response) {
|
|
690
763
|
return _this.processPlacesPUT(_response);
|
|
691
764
|
});
|
|
692
765
|
}
|
|
@@ -694,31 +767,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
694
767
|
{
|
|
695
768
|
key: "processPlacesPUT",
|
|
696
769
|
value: function processPlacesPUT(response) {
|
|
697
|
-
var _this = this;
|
|
698
770
|
var status = response.status;
|
|
699
771
|
var _headers = {};
|
|
700
|
-
if (response.headers && response.headers
|
|
701
|
-
response.headers
|
|
702
|
-
|
|
703
|
-
|
|
772
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
773
|
+
for(var k in response.headers){
|
|
774
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
775
|
+
_headers[k] = response.headers[k];
|
|
776
|
+
}
|
|
777
|
+
}
|
|
704
778
|
}
|
|
705
|
-
;
|
|
706
779
|
if (status === 200) {
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
780
|
+
var _responseText = response.data;
|
|
781
|
+
var result200 = null;
|
|
782
|
+
var resultData200 = _responseText;
|
|
783
|
+
result200 = JSON.parse(resultData200);
|
|
784
|
+
return Promise.resolve(result200);
|
|
712
785
|
} else if (status === 500) {
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
786
|
+
var _responseText1 = response.data;
|
|
787
|
+
var result500 = null;
|
|
788
|
+
var resultData500 = _responseText1;
|
|
789
|
+
result500 = JSON.parse(resultData500);
|
|
790
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
718
791
|
} else if (status !== 200 && status !== 204) {
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
});
|
|
792
|
+
var _responseText2 = response.data;
|
|
793
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
722
794
|
}
|
|
723
795
|
return Promise.resolve(null);
|
|
724
796
|
}
|
|
@@ -727,17 +799,25 @@ var Client = /*#__PURE__*/ function() {
|
|
|
727
799
|
/**
|
|
728
800
|
* @return OK
|
|
729
801
|
*/ key: "placesAll",
|
|
730
|
-
value: function placesAll() {
|
|
802
|
+
value: function placesAll(cancelToken) {
|
|
731
803
|
var _this = this;
|
|
732
804
|
var url_ = this.baseUrl + "/api/places";
|
|
733
805
|
url_ = url_.replace(/[?&]$/, "");
|
|
734
806
|
var options_ = {
|
|
735
807
|
method: "GET",
|
|
808
|
+
url: url_,
|
|
736
809
|
headers: {
|
|
737
810
|
"Accept": "application/json"
|
|
738
|
-
}
|
|
811
|
+
},
|
|
812
|
+
cancelToken: cancelToken
|
|
739
813
|
};
|
|
740
|
-
return this.
|
|
814
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
815
|
+
if (isAxiosError(_error) && _error.response) {
|
|
816
|
+
return _error.response;
|
|
817
|
+
} else {
|
|
818
|
+
throw _error;
|
|
819
|
+
}
|
|
820
|
+
}).then(function(_response) {
|
|
741
821
|
return _this.processPlacesAll(_response);
|
|
742
822
|
});
|
|
743
823
|
}
|
|
@@ -745,31 +825,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
745
825
|
{
|
|
746
826
|
key: "processPlacesAll",
|
|
747
827
|
value: function processPlacesAll(response) {
|
|
748
|
-
var _this = this;
|
|
749
828
|
var status = response.status;
|
|
750
829
|
var _headers = {};
|
|
751
|
-
if (response.headers && response.headers
|
|
752
|
-
response.headers
|
|
753
|
-
|
|
754
|
-
|
|
830
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
831
|
+
for(var k in response.headers){
|
|
832
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
833
|
+
_headers[k] = response.headers[k];
|
|
834
|
+
}
|
|
835
|
+
}
|
|
755
836
|
}
|
|
756
|
-
;
|
|
757
837
|
if (status === 200) {
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
838
|
+
var _responseText = response.data;
|
|
839
|
+
var result200 = null;
|
|
840
|
+
var resultData200 = _responseText;
|
|
841
|
+
result200 = JSON.parse(resultData200);
|
|
842
|
+
return Promise.resolve(result200);
|
|
763
843
|
} else if (status === 500) {
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
844
|
+
var _responseText1 = response.data;
|
|
845
|
+
var result500 = null;
|
|
846
|
+
var resultData500 = _responseText1;
|
|
847
|
+
result500 = JSON.parse(resultData500);
|
|
848
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
769
849
|
} else if (status !== 200 && status !== 204) {
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
});
|
|
850
|
+
var _responseText2 = response.data;
|
|
851
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
773
852
|
}
|
|
774
853
|
return Promise.resolve(null);
|
|
775
854
|
}
|
|
@@ -779,20 +858,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
779
858
|
* @param body (optional)
|
|
780
859
|
* @return OK
|
|
781
860
|
*/ key: "plantsPOST",
|
|
782
|
-
value: function plantsPOST(body) {
|
|
861
|
+
value: function plantsPOST(body, cancelToken) {
|
|
783
862
|
var _this = this;
|
|
784
863
|
var url_ = this.baseUrl + "/api/plants";
|
|
785
864
|
url_ = url_.replace(/[?&]$/, "");
|
|
786
865
|
var content_ = JSON.stringify(body);
|
|
787
866
|
var options_ = {
|
|
788
|
-
|
|
867
|
+
data: content_,
|
|
789
868
|
method: "POST",
|
|
869
|
+
url: url_,
|
|
790
870
|
headers: {
|
|
791
871
|
"Content-Type": "application/json",
|
|
792
872
|
"Accept": "application/json"
|
|
793
|
-
}
|
|
873
|
+
},
|
|
874
|
+
cancelToken: cancelToken
|
|
794
875
|
};
|
|
795
|
-
return this.
|
|
876
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
877
|
+
if (isAxiosError(_error) && _error.response) {
|
|
878
|
+
return _error.response;
|
|
879
|
+
} else {
|
|
880
|
+
throw _error;
|
|
881
|
+
}
|
|
882
|
+
}).then(function(_response) {
|
|
796
883
|
return _this.processPlantsPOST(_response);
|
|
797
884
|
});
|
|
798
885
|
}
|
|
@@ -800,31 +887,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
800
887
|
{
|
|
801
888
|
key: "processPlantsPOST",
|
|
802
889
|
value: function processPlantsPOST(response) {
|
|
803
|
-
var _this = this;
|
|
804
890
|
var status = response.status;
|
|
805
891
|
var _headers = {};
|
|
806
|
-
if (response.headers && response.headers
|
|
807
|
-
response.headers
|
|
808
|
-
|
|
809
|
-
|
|
892
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
893
|
+
for(var k in response.headers){
|
|
894
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
895
|
+
_headers[k] = response.headers[k];
|
|
896
|
+
}
|
|
897
|
+
}
|
|
810
898
|
}
|
|
811
|
-
;
|
|
812
899
|
if (status === 200) {
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
900
|
+
var _responseText = response.data;
|
|
901
|
+
var result200 = null;
|
|
902
|
+
var resultData200 = _responseText;
|
|
903
|
+
result200 = JSON.parse(resultData200);
|
|
904
|
+
return Promise.resolve(result200);
|
|
818
905
|
} else if (status === 500) {
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
906
|
+
var _responseText1 = response.data;
|
|
907
|
+
var result500 = null;
|
|
908
|
+
var resultData500 = _responseText1;
|
|
909
|
+
result500 = JSON.parse(resultData500);
|
|
910
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
824
911
|
} else if (status !== 200 && status !== 204) {
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
});
|
|
912
|
+
var _responseText2 = response.data;
|
|
913
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
828
914
|
}
|
|
829
915
|
return Promise.resolve(null);
|
|
830
916
|
}
|
|
@@ -834,7 +920,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
834
920
|
* @param id (optional)
|
|
835
921
|
* @return OK
|
|
836
922
|
*/ key: "plantsDELETE",
|
|
837
|
-
value: function plantsDELETE(id) {
|
|
923
|
+
value: function plantsDELETE(id, cancelToken) {
|
|
838
924
|
var _this = this;
|
|
839
925
|
var url_ = this.baseUrl + "/api/plants?";
|
|
840
926
|
if (id === null) throw new globalThis.Error("The parameter 'id' cannot be null.");
|
|
@@ -842,11 +928,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
842
928
|
url_ = url_.replace(/[?&]$/, "");
|
|
843
929
|
var options_ = {
|
|
844
930
|
method: "DELETE",
|
|
931
|
+
url: url_,
|
|
845
932
|
headers: {
|
|
846
933
|
"Accept": "application/json"
|
|
847
|
-
}
|
|
934
|
+
},
|
|
935
|
+
cancelToken: cancelToken
|
|
848
936
|
};
|
|
849
|
-
return this.
|
|
937
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
938
|
+
if (isAxiosError(_error) && _error.response) {
|
|
939
|
+
return _error.response;
|
|
940
|
+
} else {
|
|
941
|
+
throw _error;
|
|
942
|
+
}
|
|
943
|
+
}).then(function(_response) {
|
|
850
944
|
return _this.processPlantsDELETE(_response);
|
|
851
945
|
});
|
|
852
946
|
}
|
|
@@ -854,31 +948,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
854
948
|
{
|
|
855
949
|
key: "processPlantsDELETE",
|
|
856
950
|
value: function processPlantsDELETE(response) {
|
|
857
|
-
var _this = this;
|
|
858
951
|
var status = response.status;
|
|
859
952
|
var _headers = {};
|
|
860
|
-
if (response.headers && response.headers
|
|
861
|
-
response.headers
|
|
862
|
-
|
|
863
|
-
|
|
953
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
954
|
+
for(var k in response.headers){
|
|
955
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
956
|
+
_headers[k] = response.headers[k];
|
|
957
|
+
}
|
|
958
|
+
}
|
|
864
959
|
}
|
|
865
|
-
;
|
|
866
960
|
if (status === 200) {
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
961
|
+
var _responseText = response.data;
|
|
962
|
+
var result200 = null;
|
|
963
|
+
var resultData200 = _responseText;
|
|
964
|
+
result200 = JSON.parse(resultData200);
|
|
965
|
+
return Promise.resolve(result200);
|
|
872
966
|
} else if (status === 500) {
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
967
|
+
var _responseText1 = response.data;
|
|
968
|
+
var result500 = null;
|
|
969
|
+
var resultData500 = _responseText1;
|
|
970
|
+
result500 = JSON.parse(resultData500);
|
|
971
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
878
972
|
} else if (status !== 200 && status !== 204) {
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
});
|
|
973
|
+
var _responseText2 = response.data;
|
|
974
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
882
975
|
}
|
|
883
976
|
return Promise.resolve(null);
|
|
884
977
|
}
|
|
@@ -888,20 +981,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
888
981
|
* @param body (optional)
|
|
889
982
|
* @return OK
|
|
890
983
|
*/ key: "plantsPUT",
|
|
891
|
-
value: function plantsPUT(body) {
|
|
984
|
+
value: function plantsPUT(body, cancelToken) {
|
|
892
985
|
var _this = this;
|
|
893
986
|
var url_ = this.baseUrl + "/api/plants";
|
|
894
987
|
url_ = url_.replace(/[?&]$/, "");
|
|
895
988
|
var content_ = JSON.stringify(body);
|
|
896
989
|
var options_ = {
|
|
897
|
-
|
|
990
|
+
data: content_,
|
|
898
991
|
method: "PUT",
|
|
992
|
+
url: url_,
|
|
899
993
|
headers: {
|
|
900
994
|
"Content-Type": "application/json",
|
|
901
995
|
"Accept": "application/json"
|
|
902
|
-
}
|
|
996
|
+
},
|
|
997
|
+
cancelToken: cancelToken
|
|
903
998
|
};
|
|
904
|
-
return this.
|
|
999
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
1000
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1001
|
+
return _error.response;
|
|
1002
|
+
} else {
|
|
1003
|
+
throw _error;
|
|
1004
|
+
}
|
|
1005
|
+
}).then(function(_response) {
|
|
905
1006
|
return _this.processPlantsPUT(_response);
|
|
906
1007
|
});
|
|
907
1008
|
}
|
|
@@ -909,31 +1010,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
909
1010
|
{
|
|
910
1011
|
key: "processPlantsPUT",
|
|
911
1012
|
value: function processPlantsPUT(response) {
|
|
912
|
-
var _this = this;
|
|
913
1013
|
var status = response.status;
|
|
914
1014
|
var _headers = {};
|
|
915
|
-
if (response.headers && response.headers
|
|
916
|
-
response.headers
|
|
917
|
-
|
|
918
|
-
|
|
1015
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
1016
|
+
for(var k in response.headers){
|
|
1017
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1018
|
+
_headers[k] = response.headers[k];
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
919
1021
|
}
|
|
920
|
-
;
|
|
921
1022
|
if (status === 200) {
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
1023
|
+
var _responseText = response.data;
|
|
1024
|
+
var result200 = null;
|
|
1025
|
+
var resultData200 = _responseText;
|
|
1026
|
+
result200 = JSON.parse(resultData200);
|
|
1027
|
+
return Promise.resolve(result200);
|
|
927
1028
|
} else if (status === 500) {
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
1029
|
+
var _responseText1 = response.data;
|
|
1030
|
+
var result500 = null;
|
|
1031
|
+
var resultData500 = _responseText1;
|
|
1032
|
+
result500 = JSON.parse(resultData500);
|
|
1033
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
933
1034
|
} else if (status !== 200 && status !== 204) {
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
});
|
|
1035
|
+
var _responseText2 = response.data;
|
|
1036
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
937
1037
|
}
|
|
938
1038
|
return Promise.resolve(null);
|
|
939
1039
|
}
|
|
@@ -942,17 +1042,25 @@ var Client = /*#__PURE__*/ function() {
|
|
|
942
1042
|
/**
|
|
943
1043
|
* @return OK
|
|
944
1044
|
*/ key: "plantsAll",
|
|
945
|
-
value: function plantsAll() {
|
|
1045
|
+
value: function plantsAll(cancelToken) {
|
|
946
1046
|
var _this = this;
|
|
947
1047
|
var url_ = this.baseUrl + "/api/plants";
|
|
948
1048
|
url_ = url_.replace(/[?&]$/, "");
|
|
949
1049
|
var options_ = {
|
|
950
1050
|
method: "GET",
|
|
1051
|
+
url: url_,
|
|
951
1052
|
headers: {
|
|
952
1053
|
"Accept": "application/json"
|
|
953
|
-
}
|
|
1054
|
+
},
|
|
1055
|
+
cancelToken: cancelToken
|
|
954
1056
|
};
|
|
955
|
-
return this.
|
|
1057
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
1058
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1059
|
+
return _error.response;
|
|
1060
|
+
} else {
|
|
1061
|
+
throw _error;
|
|
1062
|
+
}
|
|
1063
|
+
}).then(function(_response) {
|
|
956
1064
|
return _this.processPlantsAll(_response);
|
|
957
1065
|
});
|
|
958
1066
|
}
|
|
@@ -960,31 +1068,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
960
1068
|
{
|
|
961
1069
|
key: "processPlantsAll",
|
|
962
1070
|
value: function processPlantsAll(response) {
|
|
963
|
-
var _this = this;
|
|
964
1071
|
var status = response.status;
|
|
965
1072
|
var _headers = {};
|
|
966
|
-
if (response.headers && response.headers
|
|
967
|
-
response.headers
|
|
968
|
-
|
|
969
|
-
|
|
1073
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
1074
|
+
for(var k in response.headers){
|
|
1075
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1076
|
+
_headers[k] = response.headers[k];
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
970
1079
|
}
|
|
971
|
-
;
|
|
972
1080
|
if (status === 200) {
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
1081
|
+
var _responseText = response.data;
|
|
1082
|
+
var result200 = null;
|
|
1083
|
+
var resultData200 = _responseText;
|
|
1084
|
+
result200 = JSON.parse(resultData200);
|
|
1085
|
+
return Promise.resolve(result200);
|
|
978
1086
|
} else if (status === 500) {
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
1087
|
+
var _responseText1 = response.data;
|
|
1088
|
+
var result500 = null;
|
|
1089
|
+
var resultData500 = _responseText1;
|
|
1090
|
+
result500 = JSON.parse(resultData500);
|
|
1091
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
984
1092
|
} else if (status !== 200 && status !== 204) {
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
});
|
|
1093
|
+
var _responseText2 = response.data;
|
|
1094
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
988
1095
|
}
|
|
989
1096
|
return Promise.resolve(null);
|
|
990
1097
|
}
|
|
@@ -993,7 +1100,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
993
1100
|
/**
|
|
994
1101
|
* @return OK
|
|
995
1102
|
*/ key: "plantsGET",
|
|
996
|
-
value: function plantsGET(id) {
|
|
1103
|
+
value: function plantsGET(id, cancelToken) {
|
|
997
1104
|
var _this = this;
|
|
998
1105
|
var url_ = this.baseUrl + "/api/plants/{id}";
|
|
999
1106
|
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
@@ -1001,11 +1108,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
1001
1108
|
url_ = url_.replace(/[?&]$/, "");
|
|
1002
1109
|
var options_ = {
|
|
1003
1110
|
method: "GET",
|
|
1111
|
+
url: url_,
|
|
1004
1112
|
headers: {
|
|
1005
1113
|
"Accept": "application/json"
|
|
1006
|
-
}
|
|
1114
|
+
},
|
|
1115
|
+
cancelToken: cancelToken
|
|
1007
1116
|
};
|
|
1008
|
-
return this.
|
|
1117
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
1118
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1119
|
+
return _error.response;
|
|
1120
|
+
} else {
|
|
1121
|
+
throw _error;
|
|
1122
|
+
}
|
|
1123
|
+
}).then(function(_response) {
|
|
1009
1124
|
return _this.processPlantsGET(_response);
|
|
1010
1125
|
});
|
|
1011
1126
|
}
|
|
@@ -1013,31 +1128,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
1013
1128
|
{
|
|
1014
1129
|
key: "processPlantsGET",
|
|
1015
1130
|
value: function processPlantsGET(response) {
|
|
1016
|
-
var _this = this;
|
|
1017
1131
|
var status = response.status;
|
|
1018
1132
|
var _headers = {};
|
|
1019
|
-
if (response.headers && response.headers
|
|
1020
|
-
response.headers
|
|
1021
|
-
|
|
1022
|
-
|
|
1133
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
1134
|
+
for(var k in response.headers){
|
|
1135
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1136
|
+
_headers[k] = response.headers[k];
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1023
1139
|
}
|
|
1024
|
-
;
|
|
1025
1140
|
if (status === 200) {
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1141
|
+
var _responseText = response.data;
|
|
1142
|
+
var result200 = null;
|
|
1143
|
+
var resultData200 = _responseText;
|
|
1144
|
+
result200 = JSON.parse(resultData200);
|
|
1145
|
+
return Promise.resolve(result200);
|
|
1031
1146
|
} else if (status === 500) {
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1147
|
+
var _responseText1 = response.data;
|
|
1148
|
+
var result500 = null;
|
|
1149
|
+
var resultData500 = _responseText1;
|
|
1150
|
+
result500 = JSON.parse(resultData500);
|
|
1151
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
1037
1152
|
} else if (status !== 200 && status !== 204) {
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
});
|
|
1153
|
+
var _responseText2 = response.data;
|
|
1154
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
1041
1155
|
}
|
|
1042
1156
|
return Promise.resolve(null);
|
|
1043
1157
|
}
|
|
@@ -1246,6 +1360,9 @@ function throwException(message, status, response, headers, result) {
|
|
|
1246
1360
|
if (result !== null && result !== void 0) throw result;
|
|
1247
1361
|
else throw new ApiException(message, status, response, headers, null);
|
|
1248
1362
|
}
|
|
1363
|
+
function isAxiosError(obj) {
|
|
1364
|
+
return obj && obj.isAxiosError === true;
|
|
1365
|
+
}
|
|
1249
1366
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1250
1367
|
0 && (module.exports = {
|
|
1251
1368
|
ApiException: ApiException,
|