@arekstasko/plantcare-api-client 1.1.1 → 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 +462 -342
- package/dist/index.d.cts +37 -113
- package/dist/index.d.ts +37 -113
- package/dist/index.js +450 -342
- 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,31 +336,30 @@ 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
|
}
|
|
@@ -344,7 +370,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
344
370
|
* @param toDate (optional)
|
|
345
371
|
* @return OK
|
|
346
372
|
*/ key: "average",
|
|
347
|
-
value: function average(id, fromDate, toDate) {
|
|
373
|
+
value: function average(id, fromDate, toDate, cancelToken) {
|
|
348
374
|
var _this = this;
|
|
349
375
|
var url_ = this.baseUrl + "/api/humidity-measurements/{id}/average?";
|
|
350
376
|
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
@@ -356,11 +382,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
356
382
|
url_ = url_.replace(/[?&]$/, "");
|
|
357
383
|
var options_ = {
|
|
358
384
|
method: "GET",
|
|
385
|
+
url: url_,
|
|
359
386
|
headers: {
|
|
360
387
|
"Accept": "application/json"
|
|
361
|
-
}
|
|
388
|
+
},
|
|
389
|
+
cancelToken: cancelToken
|
|
362
390
|
};
|
|
363
|
-
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) {
|
|
364
398
|
return _this.processAverage(_response);
|
|
365
399
|
});
|
|
366
400
|
}
|
|
@@ -368,31 +402,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
368
402
|
{
|
|
369
403
|
key: "processAverage",
|
|
370
404
|
value: function processAverage(response) {
|
|
371
|
-
var _this = this;
|
|
372
405
|
var status = response.status;
|
|
373
406
|
var _headers = {};
|
|
374
|
-
if (response.headers && response.headers
|
|
375
|
-
response.headers
|
|
376
|
-
|
|
377
|
-
|
|
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
|
+
}
|
|
378
413
|
}
|
|
379
|
-
;
|
|
380
414
|
if (status === 200) {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
415
|
+
var _responseText = response.data;
|
|
416
|
+
var result200 = null;
|
|
417
|
+
var resultData200 = _responseText;
|
|
418
|
+
result200 = JSON.parse(resultData200);
|
|
419
|
+
return Promise.resolve(result200);
|
|
386
420
|
} else if (status === 500) {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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);
|
|
392
426
|
} else if (status !== 200 && status !== 204) {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
});
|
|
427
|
+
var _responseText2 = response.data;
|
|
428
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
396
429
|
}
|
|
397
430
|
return Promise.resolve(null);
|
|
398
431
|
}
|
|
@@ -402,20 +435,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
402
435
|
* @param body (optional)
|
|
403
436
|
* @return OK
|
|
404
437
|
*/ key: "modulesPOST",
|
|
405
|
-
value: function modulesPOST(body) {
|
|
438
|
+
value: function modulesPOST(body, cancelToken) {
|
|
406
439
|
var _this = this;
|
|
407
440
|
var url_ = this.baseUrl + "/api/modules";
|
|
408
441
|
url_ = url_.replace(/[?&]$/, "");
|
|
409
442
|
var content_ = JSON.stringify(body);
|
|
410
443
|
var options_ = {
|
|
411
|
-
|
|
444
|
+
data: content_,
|
|
412
445
|
method: "POST",
|
|
446
|
+
url: url_,
|
|
413
447
|
headers: {
|
|
414
448
|
"Content-Type": "application/json",
|
|
415
449
|
"Accept": "application/json"
|
|
416
|
-
}
|
|
450
|
+
},
|
|
451
|
+
cancelToken: cancelToken
|
|
417
452
|
};
|
|
418
|
-
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) {
|
|
419
460
|
return _this.processModulesPOST(_response);
|
|
420
461
|
});
|
|
421
462
|
}
|
|
@@ -423,31 +464,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
423
464
|
{
|
|
424
465
|
key: "processModulesPOST",
|
|
425
466
|
value: function processModulesPOST(response) {
|
|
426
|
-
var _this = this;
|
|
427
467
|
var status = response.status;
|
|
428
468
|
var _headers = {};
|
|
429
|
-
if (response.headers && response.headers
|
|
430
|
-
response.headers
|
|
431
|
-
|
|
432
|
-
|
|
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
|
+
}
|
|
433
475
|
}
|
|
434
|
-
;
|
|
435
476
|
if (status === 200) {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
477
|
+
var _responseText = response.data;
|
|
478
|
+
var result200 = null;
|
|
479
|
+
var resultData200 = _responseText;
|
|
480
|
+
result200 = JSON.parse(resultData200);
|
|
481
|
+
return Promise.resolve(result200);
|
|
441
482
|
} else if (status === 500) {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
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);
|
|
447
488
|
} else if (status !== 200 && status !== 204) {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
});
|
|
489
|
+
var _responseText2 = response.data;
|
|
490
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
451
491
|
}
|
|
452
492
|
return Promise.resolve(null);
|
|
453
493
|
}
|
|
@@ -456,17 +496,25 @@ var Client = /*#__PURE__*/ function() {
|
|
|
456
496
|
/**
|
|
457
497
|
* @return OK
|
|
458
498
|
*/ key: "modulesAll",
|
|
459
|
-
value: function modulesAll() {
|
|
499
|
+
value: function modulesAll(cancelToken) {
|
|
460
500
|
var _this = this;
|
|
461
501
|
var url_ = this.baseUrl + "/api/modules";
|
|
462
502
|
url_ = url_.replace(/[?&]$/, "");
|
|
463
503
|
var options_ = {
|
|
464
504
|
method: "GET",
|
|
505
|
+
url: url_,
|
|
465
506
|
headers: {
|
|
466
507
|
"Accept": "application/json"
|
|
467
|
-
}
|
|
508
|
+
},
|
|
509
|
+
cancelToken: cancelToken
|
|
468
510
|
};
|
|
469
|
-
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) {
|
|
470
518
|
return _this.processModulesAll(_response);
|
|
471
519
|
});
|
|
472
520
|
}
|
|
@@ -474,31 +522,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
474
522
|
{
|
|
475
523
|
key: "processModulesAll",
|
|
476
524
|
value: function processModulesAll(response) {
|
|
477
|
-
var _this = this;
|
|
478
525
|
var status = response.status;
|
|
479
526
|
var _headers = {};
|
|
480
|
-
if (response.headers && response.headers
|
|
481
|
-
response.headers
|
|
482
|
-
|
|
483
|
-
|
|
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
|
+
}
|
|
484
533
|
}
|
|
485
|
-
;
|
|
486
534
|
if (status === 200) {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
535
|
+
var _responseText = response.data;
|
|
536
|
+
var result200 = null;
|
|
537
|
+
var resultData200 = _responseText;
|
|
538
|
+
result200 = JSON.parse(resultData200);
|
|
539
|
+
return Promise.resolve(result200);
|
|
492
540
|
} else if (status === 500) {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
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);
|
|
498
546
|
} else if (status !== 200 && status !== 204) {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
});
|
|
547
|
+
var _responseText2 = response.data;
|
|
548
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
502
549
|
}
|
|
503
550
|
return Promise.resolve(null);
|
|
504
551
|
}
|
|
@@ -507,7 +554,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
507
554
|
/**
|
|
508
555
|
* @return OK
|
|
509
556
|
*/ key: "modulesGET",
|
|
510
|
-
value: function modulesGET(id) {
|
|
557
|
+
value: function modulesGET(id, cancelToken) {
|
|
511
558
|
var _this = this;
|
|
512
559
|
var url_ = this.baseUrl + "/api/modules/{id}";
|
|
513
560
|
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
@@ -515,11 +562,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
515
562
|
url_ = url_.replace(/[?&]$/, "");
|
|
516
563
|
var options_ = {
|
|
517
564
|
method: "GET",
|
|
565
|
+
url: url_,
|
|
518
566
|
headers: {
|
|
519
567
|
"Accept": "application/json"
|
|
520
|
-
}
|
|
568
|
+
},
|
|
569
|
+
cancelToken: cancelToken
|
|
521
570
|
};
|
|
522
|
-
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) {
|
|
523
578
|
return _this.processModulesGET(_response);
|
|
524
579
|
});
|
|
525
580
|
}
|
|
@@ -527,31 +582,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
527
582
|
{
|
|
528
583
|
key: "processModulesGET",
|
|
529
584
|
value: function processModulesGET(response) {
|
|
530
|
-
var _this = this;
|
|
531
585
|
var status = response.status;
|
|
532
586
|
var _headers = {};
|
|
533
|
-
if (response.headers && response.headers
|
|
534
|
-
response.headers
|
|
535
|
-
|
|
536
|
-
|
|
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
|
+
}
|
|
537
593
|
}
|
|
538
|
-
;
|
|
539
594
|
if (status === 200) {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
595
|
+
var _responseText = response.data;
|
|
596
|
+
var result200 = null;
|
|
597
|
+
var resultData200 = _responseText;
|
|
598
|
+
result200 = JSON.parse(resultData200);
|
|
599
|
+
return Promise.resolve(result200);
|
|
545
600
|
} else if (status === 500) {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
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);
|
|
551
606
|
} else if (status !== 200 && status !== 204) {
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
});
|
|
607
|
+
var _responseText2 = response.data;
|
|
608
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
555
609
|
}
|
|
556
610
|
return Promise.resolve(null);
|
|
557
611
|
}
|
|
@@ -561,20 +615,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
561
615
|
* @param body (optional)
|
|
562
616
|
* @return OK
|
|
563
617
|
*/ key: "placesPOST",
|
|
564
|
-
value: function placesPOST(body) {
|
|
618
|
+
value: function placesPOST(body, cancelToken) {
|
|
565
619
|
var _this = this;
|
|
566
620
|
var url_ = this.baseUrl + "/api/places";
|
|
567
621
|
url_ = url_.replace(/[?&]$/, "");
|
|
568
622
|
var content_ = JSON.stringify(body);
|
|
569
623
|
var options_ = {
|
|
570
|
-
|
|
624
|
+
data: content_,
|
|
571
625
|
method: "POST",
|
|
626
|
+
url: url_,
|
|
572
627
|
headers: {
|
|
573
628
|
"Content-Type": "application/json",
|
|
574
629
|
"Accept": "application/json"
|
|
575
|
-
}
|
|
630
|
+
},
|
|
631
|
+
cancelToken: cancelToken
|
|
576
632
|
};
|
|
577
|
-
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) {
|
|
578
640
|
return _this.processPlacesPOST(_response);
|
|
579
641
|
});
|
|
580
642
|
}
|
|
@@ -582,31 +644,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
582
644
|
{
|
|
583
645
|
key: "processPlacesPOST",
|
|
584
646
|
value: function processPlacesPOST(response) {
|
|
585
|
-
var _this = this;
|
|
586
647
|
var status = response.status;
|
|
587
648
|
var _headers = {};
|
|
588
|
-
if (response.headers && response.headers
|
|
589
|
-
response.headers
|
|
590
|
-
|
|
591
|
-
|
|
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
|
+
}
|
|
592
655
|
}
|
|
593
|
-
;
|
|
594
656
|
if (status === 200) {
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
657
|
+
var _responseText = response.data;
|
|
658
|
+
var result200 = null;
|
|
659
|
+
var resultData200 = _responseText;
|
|
660
|
+
result200 = JSON.parse(resultData200);
|
|
661
|
+
return Promise.resolve(result200);
|
|
600
662
|
} else if (status === 500) {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
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);
|
|
606
668
|
} else if (status !== 200 && status !== 204) {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
});
|
|
669
|
+
var _responseText2 = response.data;
|
|
670
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
610
671
|
}
|
|
611
672
|
return Promise.resolve(null);
|
|
612
673
|
}
|
|
@@ -616,7 +677,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
616
677
|
* @param id (optional)
|
|
617
678
|
* @return OK
|
|
618
679
|
*/ key: "placesDELETE",
|
|
619
|
-
value: function placesDELETE(id) {
|
|
680
|
+
value: function placesDELETE(id, cancelToken) {
|
|
620
681
|
var _this = this;
|
|
621
682
|
var url_ = this.baseUrl + "/api/places?";
|
|
622
683
|
if (id === null) throw new globalThis.Error("The parameter 'id' cannot be null.");
|
|
@@ -624,11 +685,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
624
685
|
url_ = url_.replace(/[?&]$/, "");
|
|
625
686
|
var options_ = {
|
|
626
687
|
method: "DELETE",
|
|
688
|
+
url: url_,
|
|
627
689
|
headers: {
|
|
628
690
|
"Accept": "application/json"
|
|
629
|
-
}
|
|
691
|
+
},
|
|
692
|
+
cancelToken: cancelToken
|
|
630
693
|
};
|
|
631
|
-
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) {
|
|
632
701
|
return _this.processPlacesDELETE(_response);
|
|
633
702
|
});
|
|
634
703
|
}
|
|
@@ -636,31 +705,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
636
705
|
{
|
|
637
706
|
key: "processPlacesDELETE",
|
|
638
707
|
value: function processPlacesDELETE(response) {
|
|
639
|
-
var _this = this;
|
|
640
708
|
var status = response.status;
|
|
641
709
|
var _headers = {};
|
|
642
|
-
if (response.headers && response.headers
|
|
643
|
-
response.headers
|
|
644
|
-
|
|
645
|
-
|
|
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
|
+
}
|
|
646
716
|
}
|
|
647
|
-
;
|
|
648
717
|
if (status === 200) {
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
718
|
+
var _responseText = response.data;
|
|
719
|
+
var result200 = null;
|
|
720
|
+
var resultData200 = _responseText;
|
|
721
|
+
result200 = JSON.parse(resultData200);
|
|
722
|
+
return Promise.resolve(result200);
|
|
654
723
|
} else if (status === 500) {
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
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);
|
|
660
729
|
} else if (status !== 200 && status !== 204) {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
});
|
|
730
|
+
var _responseText2 = response.data;
|
|
731
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
664
732
|
}
|
|
665
733
|
return Promise.resolve(null);
|
|
666
734
|
}
|
|
@@ -670,20 +738,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
670
738
|
* @param body (optional)
|
|
671
739
|
* @return OK
|
|
672
740
|
*/ key: "placesPUT",
|
|
673
|
-
value: function placesPUT(body) {
|
|
741
|
+
value: function placesPUT(body, cancelToken) {
|
|
674
742
|
var _this = this;
|
|
675
743
|
var url_ = this.baseUrl + "/api/places";
|
|
676
744
|
url_ = url_.replace(/[?&]$/, "");
|
|
677
745
|
var content_ = JSON.stringify(body);
|
|
678
746
|
var options_ = {
|
|
679
|
-
|
|
747
|
+
data: content_,
|
|
680
748
|
method: "PUT",
|
|
749
|
+
url: url_,
|
|
681
750
|
headers: {
|
|
682
751
|
"Content-Type": "application/json",
|
|
683
752
|
"Accept": "application/json"
|
|
684
|
-
}
|
|
753
|
+
},
|
|
754
|
+
cancelToken: cancelToken
|
|
685
755
|
};
|
|
686
|
-
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) {
|
|
687
763
|
return _this.processPlacesPUT(_response);
|
|
688
764
|
});
|
|
689
765
|
}
|
|
@@ -691,31 +767,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
691
767
|
{
|
|
692
768
|
key: "processPlacesPUT",
|
|
693
769
|
value: function processPlacesPUT(response) {
|
|
694
|
-
var _this = this;
|
|
695
770
|
var status = response.status;
|
|
696
771
|
var _headers = {};
|
|
697
|
-
if (response.headers && response.headers
|
|
698
|
-
response.headers
|
|
699
|
-
|
|
700
|
-
|
|
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
|
+
}
|
|
701
778
|
}
|
|
702
|
-
;
|
|
703
779
|
if (status === 200) {
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
780
|
+
var _responseText = response.data;
|
|
781
|
+
var result200 = null;
|
|
782
|
+
var resultData200 = _responseText;
|
|
783
|
+
result200 = JSON.parse(resultData200);
|
|
784
|
+
return Promise.resolve(result200);
|
|
709
785
|
} else if (status === 500) {
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
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);
|
|
715
791
|
} else if (status !== 200 && status !== 204) {
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
});
|
|
792
|
+
var _responseText2 = response.data;
|
|
793
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
719
794
|
}
|
|
720
795
|
return Promise.resolve(null);
|
|
721
796
|
}
|
|
@@ -724,17 +799,25 @@ var Client = /*#__PURE__*/ function() {
|
|
|
724
799
|
/**
|
|
725
800
|
* @return OK
|
|
726
801
|
*/ key: "placesAll",
|
|
727
|
-
value: function placesAll() {
|
|
802
|
+
value: function placesAll(cancelToken) {
|
|
728
803
|
var _this = this;
|
|
729
804
|
var url_ = this.baseUrl + "/api/places";
|
|
730
805
|
url_ = url_.replace(/[?&]$/, "");
|
|
731
806
|
var options_ = {
|
|
732
807
|
method: "GET",
|
|
808
|
+
url: url_,
|
|
733
809
|
headers: {
|
|
734
810
|
"Accept": "application/json"
|
|
735
|
-
}
|
|
811
|
+
},
|
|
812
|
+
cancelToken: cancelToken
|
|
736
813
|
};
|
|
737
|
-
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) {
|
|
738
821
|
return _this.processPlacesAll(_response);
|
|
739
822
|
});
|
|
740
823
|
}
|
|
@@ -742,31 +825,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
742
825
|
{
|
|
743
826
|
key: "processPlacesAll",
|
|
744
827
|
value: function processPlacesAll(response) {
|
|
745
|
-
var _this = this;
|
|
746
828
|
var status = response.status;
|
|
747
829
|
var _headers = {};
|
|
748
|
-
if (response.headers && response.headers
|
|
749
|
-
response.headers
|
|
750
|
-
|
|
751
|
-
|
|
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
|
+
}
|
|
752
836
|
}
|
|
753
|
-
;
|
|
754
837
|
if (status === 200) {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
838
|
+
var _responseText = response.data;
|
|
839
|
+
var result200 = null;
|
|
840
|
+
var resultData200 = _responseText;
|
|
841
|
+
result200 = JSON.parse(resultData200);
|
|
842
|
+
return Promise.resolve(result200);
|
|
760
843
|
} else if (status === 500) {
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
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);
|
|
766
849
|
} else if (status !== 200 && status !== 204) {
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
});
|
|
850
|
+
var _responseText2 = response.data;
|
|
851
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
770
852
|
}
|
|
771
853
|
return Promise.resolve(null);
|
|
772
854
|
}
|
|
@@ -776,20 +858,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
776
858
|
* @param body (optional)
|
|
777
859
|
* @return OK
|
|
778
860
|
*/ key: "plantsPOST",
|
|
779
|
-
value: function plantsPOST(body) {
|
|
861
|
+
value: function plantsPOST(body, cancelToken) {
|
|
780
862
|
var _this = this;
|
|
781
863
|
var url_ = this.baseUrl + "/api/plants";
|
|
782
864
|
url_ = url_.replace(/[?&]$/, "");
|
|
783
865
|
var content_ = JSON.stringify(body);
|
|
784
866
|
var options_ = {
|
|
785
|
-
|
|
867
|
+
data: content_,
|
|
786
868
|
method: "POST",
|
|
869
|
+
url: url_,
|
|
787
870
|
headers: {
|
|
788
871
|
"Content-Type": "application/json",
|
|
789
872
|
"Accept": "application/json"
|
|
790
|
-
}
|
|
873
|
+
},
|
|
874
|
+
cancelToken: cancelToken
|
|
791
875
|
};
|
|
792
|
-
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) {
|
|
793
883
|
return _this.processPlantsPOST(_response);
|
|
794
884
|
});
|
|
795
885
|
}
|
|
@@ -797,31 +887,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
797
887
|
{
|
|
798
888
|
key: "processPlantsPOST",
|
|
799
889
|
value: function processPlantsPOST(response) {
|
|
800
|
-
var _this = this;
|
|
801
890
|
var status = response.status;
|
|
802
891
|
var _headers = {};
|
|
803
|
-
if (response.headers && response.headers
|
|
804
|
-
response.headers
|
|
805
|
-
|
|
806
|
-
|
|
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
|
+
}
|
|
807
898
|
}
|
|
808
|
-
;
|
|
809
899
|
if (status === 200) {
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
900
|
+
var _responseText = response.data;
|
|
901
|
+
var result200 = null;
|
|
902
|
+
var resultData200 = _responseText;
|
|
903
|
+
result200 = JSON.parse(resultData200);
|
|
904
|
+
return Promise.resolve(result200);
|
|
815
905
|
} else if (status === 500) {
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
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);
|
|
821
911
|
} else if (status !== 200 && status !== 204) {
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
});
|
|
912
|
+
var _responseText2 = response.data;
|
|
913
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
825
914
|
}
|
|
826
915
|
return Promise.resolve(null);
|
|
827
916
|
}
|
|
@@ -831,7 +920,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
831
920
|
* @param id (optional)
|
|
832
921
|
* @return OK
|
|
833
922
|
*/ key: "plantsDELETE",
|
|
834
|
-
value: function plantsDELETE(id) {
|
|
923
|
+
value: function plantsDELETE(id, cancelToken) {
|
|
835
924
|
var _this = this;
|
|
836
925
|
var url_ = this.baseUrl + "/api/plants?";
|
|
837
926
|
if (id === null) throw new globalThis.Error("The parameter 'id' cannot be null.");
|
|
@@ -839,11 +928,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
839
928
|
url_ = url_.replace(/[?&]$/, "");
|
|
840
929
|
var options_ = {
|
|
841
930
|
method: "DELETE",
|
|
931
|
+
url: url_,
|
|
842
932
|
headers: {
|
|
843
933
|
"Accept": "application/json"
|
|
844
|
-
}
|
|
934
|
+
},
|
|
935
|
+
cancelToken: cancelToken
|
|
845
936
|
};
|
|
846
|
-
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) {
|
|
847
944
|
return _this.processPlantsDELETE(_response);
|
|
848
945
|
});
|
|
849
946
|
}
|
|
@@ -851,31 +948,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
851
948
|
{
|
|
852
949
|
key: "processPlantsDELETE",
|
|
853
950
|
value: function processPlantsDELETE(response) {
|
|
854
|
-
var _this = this;
|
|
855
951
|
var status = response.status;
|
|
856
952
|
var _headers = {};
|
|
857
|
-
if (response.headers && response.headers
|
|
858
|
-
response.headers
|
|
859
|
-
|
|
860
|
-
|
|
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
|
+
}
|
|
861
959
|
}
|
|
862
|
-
;
|
|
863
960
|
if (status === 200) {
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
961
|
+
var _responseText = response.data;
|
|
962
|
+
var result200 = null;
|
|
963
|
+
var resultData200 = _responseText;
|
|
964
|
+
result200 = JSON.parse(resultData200);
|
|
965
|
+
return Promise.resolve(result200);
|
|
869
966
|
} else if (status === 500) {
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
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);
|
|
875
972
|
} else if (status !== 200 && status !== 204) {
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
});
|
|
973
|
+
var _responseText2 = response.data;
|
|
974
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
879
975
|
}
|
|
880
976
|
return Promise.resolve(null);
|
|
881
977
|
}
|
|
@@ -885,20 +981,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
885
981
|
* @param body (optional)
|
|
886
982
|
* @return OK
|
|
887
983
|
*/ key: "plantsPUT",
|
|
888
|
-
value: function plantsPUT(body) {
|
|
984
|
+
value: function plantsPUT(body, cancelToken) {
|
|
889
985
|
var _this = this;
|
|
890
986
|
var url_ = this.baseUrl + "/api/plants";
|
|
891
987
|
url_ = url_.replace(/[?&]$/, "");
|
|
892
988
|
var content_ = JSON.stringify(body);
|
|
893
989
|
var options_ = {
|
|
894
|
-
|
|
990
|
+
data: content_,
|
|
895
991
|
method: "PUT",
|
|
992
|
+
url: url_,
|
|
896
993
|
headers: {
|
|
897
994
|
"Content-Type": "application/json",
|
|
898
995
|
"Accept": "application/json"
|
|
899
|
-
}
|
|
996
|
+
},
|
|
997
|
+
cancelToken: cancelToken
|
|
900
998
|
};
|
|
901
|
-
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) {
|
|
902
1006
|
return _this.processPlantsPUT(_response);
|
|
903
1007
|
});
|
|
904
1008
|
}
|
|
@@ -906,31 +1010,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
906
1010
|
{
|
|
907
1011
|
key: "processPlantsPUT",
|
|
908
1012
|
value: function processPlantsPUT(response) {
|
|
909
|
-
var _this = this;
|
|
910
1013
|
var status = response.status;
|
|
911
1014
|
var _headers = {};
|
|
912
|
-
if (response.headers && response.headers
|
|
913
|
-
response.headers
|
|
914
|
-
|
|
915
|
-
|
|
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
|
+
}
|
|
916
1021
|
}
|
|
917
|
-
;
|
|
918
1022
|
if (status === 200) {
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
1023
|
+
var _responseText = response.data;
|
|
1024
|
+
var result200 = null;
|
|
1025
|
+
var resultData200 = _responseText;
|
|
1026
|
+
result200 = JSON.parse(resultData200);
|
|
1027
|
+
return Promise.resolve(result200);
|
|
924
1028
|
} else if (status === 500) {
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
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);
|
|
930
1034
|
} else if (status !== 200 && status !== 204) {
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
});
|
|
1035
|
+
var _responseText2 = response.data;
|
|
1036
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
934
1037
|
}
|
|
935
1038
|
return Promise.resolve(null);
|
|
936
1039
|
}
|
|
@@ -939,17 +1042,25 @@ var Client = /*#__PURE__*/ function() {
|
|
|
939
1042
|
/**
|
|
940
1043
|
* @return OK
|
|
941
1044
|
*/ key: "plantsAll",
|
|
942
|
-
value: function plantsAll() {
|
|
1045
|
+
value: function plantsAll(cancelToken) {
|
|
943
1046
|
var _this = this;
|
|
944
1047
|
var url_ = this.baseUrl + "/api/plants";
|
|
945
1048
|
url_ = url_.replace(/[?&]$/, "");
|
|
946
1049
|
var options_ = {
|
|
947
1050
|
method: "GET",
|
|
1051
|
+
url: url_,
|
|
948
1052
|
headers: {
|
|
949
1053
|
"Accept": "application/json"
|
|
950
|
-
}
|
|
1054
|
+
},
|
|
1055
|
+
cancelToken: cancelToken
|
|
951
1056
|
};
|
|
952
|
-
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) {
|
|
953
1064
|
return _this.processPlantsAll(_response);
|
|
954
1065
|
});
|
|
955
1066
|
}
|
|
@@ -957,31 +1068,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
957
1068
|
{
|
|
958
1069
|
key: "processPlantsAll",
|
|
959
1070
|
value: function processPlantsAll(response) {
|
|
960
|
-
var _this = this;
|
|
961
1071
|
var status = response.status;
|
|
962
1072
|
var _headers = {};
|
|
963
|
-
if (response.headers && response.headers
|
|
964
|
-
response.headers
|
|
965
|
-
|
|
966
|
-
|
|
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
|
+
}
|
|
967
1079
|
}
|
|
968
|
-
;
|
|
969
1080
|
if (status === 200) {
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
1081
|
+
var _responseText = response.data;
|
|
1082
|
+
var result200 = null;
|
|
1083
|
+
var resultData200 = _responseText;
|
|
1084
|
+
result200 = JSON.parse(resultData200);
|
|
1085
|
+
return Promise.resolve(result200);
|
|
975
1086
|
} else if (status === 500) {
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
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);
|
|
981
1092
|
} else if (status !== 200 && status !== 204) {
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
});
|
|
1093
|
+
var _responseText2 = response.data;
|
|
1094
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
985
1095
|
}
|
|
986
1096
|
return Promise.resolve(null);
|
|
987
1097
|
}
|
|
@@ -990,7 +1100,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
990
1100
|
/**
|
|
991
1101
|
* @return OK
|
|
992
1102
|
*/ key: "plantsGET",
|
|
993
|
-
value: function plantsGET(id) {
|
|
1103
|
+
value: function plantsGET(id, cancelToken) {
|
|
994
1104
|
var _this = this;
|
|
995
1105
|
var url_ = this.baseUrl + "/api/plants/{id}";
|
|
996
1106
|
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
@@ -998,11 +1108,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
998
1108
|
url_ = url_.replace(/[?&]$/, "");
|
|
999
1109
|
var options_ = {
|
|
1000
1110
|
method: "GET",
|
|
1111
|
+
url: url_,
|
|
1001
1112
|
headers: {
|
|
1002
1113
|
"Accept": "application/json"
|
|
1003
|
-
}
|
|
1114
|
+
},
|
|
1115
|
+
cancelToken: cancelToken
|
|
1004
1116
|
};
|
|
1005
|
-
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) {
|
|
1006
1124
|
return _this.processPlantsGET(_response);
|
|
1007
1125
|
});
|
|
1008
1126
|
}
|
|
@@ -1010,31 +1128,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
1010
1128
|
{
|
|
1011
1129
|
key: "processPlantsGET",
|
|
1012
1130
|
value: function processPlantsGET(response) {
|
|
1013
|
-
var _this = this;
|
|
1014
1131
|
var status = response.status;
|
|
1015
1132
|
var _headers = {};
|
|
1016
|
-
if (response.headers && response.headers
|
|
1017
|
-
response.headers
|
|
1018
|
-
|
|
1019
|
-
|
|
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
|
+
}
|
|
1020
1139
|
}
|
|
1021
|
-
;
|
|
1022
1140
|
if (status === 200) {
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1141
|
+
var _responseText = response.data;
|
|
1142
|
+
var result200 = null;
|
|
1143
|
+
var resultData200 = _responseText;
|
|
1144
|
+
result200 = JSON.parse(resultData200);
|
|
1145
|
+
return Promise.resolve(result200);
|
|
1028
1146
|
} else if (status === 500) {
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
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);
|
|
1034
1152
|
} else if (status !== 200 && status !== 204) {
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
});
|
|
1153
|
+
var _responseText2 = response.data;
|
|
1154
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
1038
1155
|
}
|
|
1039
1156
|
return Promise.resolve(null);
|
|
1040
1157
|
}
|
|
@@ -1243,6 +1360,9 @@ function throwException(message, status, response, headers, result) {
|
|
|
1243
1360
|
if (result !== null && result !== void 0) throw result;
|
|
1244
1361
|
else throw new ApiException(message, status, response, headers, null);
|
|
1245
1362
|
}
|
|
1363
|
+
function isAxiosError(obj) {
|
|
1364
|
+
return obj && obj.isAxiosError === true;
|
|
1365
|
+
}
|
|
1246
1366
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1247
1367
|
0 && (module.exports = {
|
|
1248
1368
|
ApiException: ApiException,
|