@arekstasko/plantcare-api-client 1.1.1 → 1.1.3
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 +38 -113
- package/dist/index.d.ts +38 -113
- package/dist/index.js +450 -342
- package/package.json +4 -1
package/dist/index.js
CHANGED
|
@@ -118,12 +118,13 @@ function _is_native_reflect_construct() {
|
|
|
118
118
|
})();
|
|
119
119
|
}
|
|
120
120
|
// ApiClient.ts
|
|
121
|
+
import axios from "axios";
|
|
121
122
|
var Client = /*#__PURE__*/ function() {
|
|
122
123
|
"use strict";
|
|
123
|
-
function Client(baseUrl,
|
|
124
|
+
function Client(baseUrl, instance) {
|
|
124
125
|
_class_call_check(this, Client);
|
|
125
126
|
this.jsonParseReviver = void 0;
|
|
126
|
-
this.
|
|
127
|
+
this.instance = instance || axios.create();
|
|
127
128
|
this.baseUrl = baseUrl !== null && baseUrl !== void 0 ? baseUrl : "";
|
|
128
129
|
}
|
|
129
130
|
_create_class(Client, [
|
|
@@ -132,20 +133,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
132
133
|
* @param body (optional)
|
|
133
134
|
* @return OK
|
|
134
135
|
*/ key: "humidityMeasurements",
|
|
135
|
-
value: function humidityMeasurements(body) {
|
|
136
|
+
value: function humidityMeasurements(body, cancelToken) {
|
|
136
137
|
var _this = this;
|
|
137
138
|
var url_ = this.baseUrl + "/api/humidity-measurements";
|
|
138
139
|
url_ = url_.replace(/[?&]$/, "");
|
|
139
140
|
var content_ = JSON.stringify(body);
|
|
140
141
|
var options_ = {
|
|
141
|
-
|
|
142
|
+
data: content_,
|
|
142
143
|
method: "POST",
|
|
144
|
+
url: url_,
|
|
143
145
|
headers: {
|
|
144
146
|
"Content-Type": "application/json",
|
|
145
147
|
"Accept": "application/json"
|
|
146
|
-
}
|
|
148
|
+
},
|
|
149
|
+
cancelToken: cancelToken
|
|
147
150
|
};
|
|
148
|
-
return this.
|
|
151
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
152
|
+
if (isAxiosError(_error) && _error.response) {
|
|
153
|
+
return _error.response;
|
|
154
|
+
} else {
|
|
155
|
+
throw _error;
|
|
156
|
+
}
|
|
157
|
+
}).then(function(_response) {
|
|
149
158
|
return _this.processHumidityMeasurements(_response);
|
|
150
159
|
});
|
|
151
160
|
}
|
|
@@ -153,47 +162,45 @@ var Client = /*#__PURE__*/ function() {
|
|
|
153
162
|
{
|
|
154
163
|
key: "processHumidityMeasurements",
|
|
155
164
|
value: function processHumidityMeasurements(response) {
|
|
156
|
-
var _this = this;
|
|
157
165
|
var status = response.status;
|
|
158
166
|
var _headers = {};
|
|
159
|
-
if (response.headers && response.headers
|
|
160
|
-
response.headers
|
|
161
|
-
|
|
162
|
-
|
|
167
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
168
|
+
for(var k in response.headers){
|
|
169
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
170
|
+
_headers[k] = response.headers[k];
|
|
171
|
+
}
|
|
172
|
+
}
|
|
163
173
|
}
|
|
164
|
-
;
|
|
165
174
|
if (status === 200) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
175
|
+
var _responseText = response.data;
|
|
176
|
+
var result200 = null;
|
|
177
|
+
var resultData200 = _responseText;
|
|
178
|
+
result200 = JSON.parse(resultData200);
|
|
179
|
+
return Promise.resolve(result200);
|
|
171
180
|
} else if (status === 500) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
181
|
+
var _responseText1 = response.data;
|
|
182
|
+
var result500 = null;
|
|
183
|
+
var resultData500 = _responseText1;
|
|
184
|
+
result500 = JSON.parse(resultData500);
|
|
185
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
177
186
|
} else if (status !== 200 && status !== 204) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
});
|
|
187
|
+
var _responseText2 = response.data;
|
|
188
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
181
189
|
}
|
|
182
190
|
return Promise.resolve(null);
|
|
183
191
|
}
|
|
184
192
|
},
|
|
185
193
|
{
|
|
186
194
|
/**
|
|
187
|
-
* @param id (optional)
|
|
188
195
|
* @param fromDate (optional)
|
|
189
196
|
* @param toDate (optional)
|
|
190
197
|
* @return OK
|
|
191
198
|
*/ key: "humidityMeasurementsAll",
|
|
192
|
-
value: function humidityMeasurementsAll(id, fromDate, toDate) {
|
|
199
|
+
value: function humidityMeasurementsAll(id, fromDate, toDate, cancelToken) {
|
|
193
200
|
var _this = this;
|
|
194
|
-
var url_ = this.baseUrl + "/api/humidity-measurements?";
|
|
195
|
-
if (id === null) throw new globalThis.Error("The parameter 'id'
|
|
196
|
-
|
|
201
|
+
var url_ = this.baseUrl + "/api/humidity-measurements/{id}?";
|
|
202
|
+
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
203
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
197
204
|
if (fromDate === null) throw new globalThis.Error("The parameter 'fromDate' cannot be null.");
|
|
198
205
|
else if (fromDate !== void 0) url_ += "fromDate=" + encodeURIComponent(fromDate ? "" + fromDate.toISOString() : "") + "&";
|
|
199
206
|
if (toDate === null) throw new globalThis.Error("The parameter 'toDate' cannot be null.");
|
|
@@ -201,11 +208,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
201
208
|
url_ = url_.replace(/[?&]$/, "");
|
|
202
209
|
var options_ = {
|
|
203
210
|
method: "GET",
|
|
211
|
+
url: url_,
|
|
204
212
|
headers: {
|
|
205
213
|
"Accept": "application/json"
|
|
206
|
-
}
|
|
214
|
+
},
|
|
215
|
+
cancelToken: cancelToken
|
|
207
216
|
};
|
|
208
|
-
return this.
|
|
217
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
218
|
+
if (isAxiosError(_error) && _error.response) {
|
|
219
|
+
return _error.response;
|
|
220
|
+
} else {
|
|
221
|
+
throw _error;
|
|
222
|
+
}
|
|
223
|
+
}).then(function(_response) {
|
|
209
224
|
return _this.processHumidityMeasurementsAll(_response);
|
|
210
225
|
});
|
|
211
226
|
}
|
|
@@ -213,31 +228,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
213
228
|
{
|
|
214
229
|
key: "processHumidityMeasurementsAll",
|
|
215
230
|
value: function processHumidityMeasurementsAll(response) {
|
|
216
|
-
var _this = this;
|
|
217
231
|
var status = response.status;
|
|
218
232
|
var _headers = {};
|
|
219
|
-
if (response.headers && response.headers
|
|
220
|
-
response.headers
|
|
221
|
-
|
|
222
|
-
|
|
233
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
234
|
+
for(var k in response.headers){
|
|
235
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
236
|
+
_headers[k] = response.headers[k];
|
|
237
|
+
}
|
|
238
|
+
}
|
|
223
239
|
}
|
|
224
|
-
;
|
|
225
240
|
if (status === 200) {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
241
|
+
var _responseText = response.data;
|
|
242
|
+
var result200 = null;
|
|
243
|
+
var resultData200 = _responseText;
|
|
244
|
+
result200 = JSON.parse(resultData200);
|
|
245
|
+
return Promise.resolve(result200);
|
|
231
246
|
} else if (status === 500) {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
247
|
+
var _responseText1 = response.data;
|
|
248
|
+
var result500 = null;
|
|
249
|
+
var resultData500 = _responseText1;
|
|
250
|
+
result500 = JSON.parse(resultData500);
|
|
251
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
237
252
|
} else if (status !== 200 && status !== 204) {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
});
|
|
253
|
+
var _responseText2 = response.data;
|
|
254
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
241
255
|
}
|
|
242
256
|
return Promise.resolve(null);
|
|
243
257
|
}
|
|
@@ -248,7 +262,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
248
262
|
* @param toDate (optional)
|
|
249
263
|
* @return OK
|
|
250
264
|
*/ key: "average",
|
|
251
|
-
value: function average(id, fromDate, toDate) {
|
|
265
|
+
value: function average(id, fromDate, toDate, cancelToken) {
|
|
252
266
|
var _this = this;
|
|
253
267
|
var url_ = this.baseUrl + "/api/humidity-measurements/{id}/average?";
|
|
254
268
|
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
@@ -260,11 +274,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
260
274
|
url_ = url_.replace(/[?&]$/, "");
|
|
261
275
|
var options_ = {
|
|
262
276
|
method: "GET",
|
|
277
|
+
url: url_,
|
|
263
278
|
headers: {
|
|
264
279
|
"Accept": "application/json"
|
|
265
|
-
}
|
|
280
|
+
},
|
|
281
|
+
cancelToken: cancelToken
|
|
266
282
|
};
|
|
267
|
-
return this.
|
|
283
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
284
|
+
if (isAxiosError(_error) && _error.response) {
|
|
285
|
+
return _error.response;
|
|
286
|
+
} else {
|
|
287
|
+
throw _error;
|
|
288
|
+
}
|
|
289
|
+
}).then(function(_response) {
|
|
268
290
|
return _this.processAverage(_response);
|
|
269
291
|
});
|
|
270
292
|
}
|
|
@@ -272,31 +294,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
272
294
|
{
|
|
273
295
|
key: "processAverage",
|
|
274
296
|
value: function processAverage(response) {
|
|
275
|
-
var _this = this;
|
|
276
297
|
var status = response.status;
|
|
277
298
|
var _headers = {};
|
|
278
|
-
if (response.headers && response.headers
|
|
279
|
-
response.headers
|
|
280
|
-
|
|
281
|
-
|
|
299
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
300
|
+
for(var k in response.headers){
|
|
301
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
302
|
+
_headers[k] = response.headers[k];
|
|
303
|
+
}
|
|
304
|
+
}
|
|
282
305
|
}
|
|
283
|
-
;
|
|
284
306
|
if (status === 200) {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
307
|
+
var _responseText = response.data;
|
|
308
|
+
var result200 = null;
|
|
309
|
+
var resultData200 = _responseText;
|
|
310
|
+
result200 = JSON.parse(resultData200);
|
|
311
|
+
return Promise.resolve(result200);
|
|
290
312
|
} else if (status === 500) {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
313
|
+
var _responseText1 = response.data;
|
|
314
|
+
var result500 = null;
|
|
315
|
+
var resultData500 = _responseText1;
|
|
316
|
+
result500 = JSON.parse(resultData500);
|
|
317
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
296
318
|
} else if (status !== 200 && status !== 204) {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
});
|
|
319
|
+
var _responseText2 = response.data;
|
|
320
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
300
321
|
}
|
|
301
322
|
return Promise.resolve(null);
|
|
302
323
|
}
|
|
@@ -306,20 +327,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
306
327
|
* @param body (optional)
|
|
307
328
|
* @return OK
|
|
308
329
|
*/ key: "modulesPOST",
|
|
309
|
-
value: function modulesPOST(body) {
|
|
330
|
+
value: function modulesPOST(body, cancelToken) {
|
|
310
331
|
var _this = this;
|
|
311
332
|
var url_ = this.baseUrl + "/api/modules";
|
|
312
333
|
url_ = url_.replace(/[?&]$/, "");
|
|
313
334
|
var content_ = JSON.stringify(body);
|
|
314
335
|
var options_ = {
|
|
315
|
-
|
|
336
|
+
data: content_,
|
|
316
337
|
method: "POST",
|
|
338
|
+
url: url_,
|
|
317
339
|
headers: {
|
|
318
340
|
"Content-Type": "application/json",
|
|
319
341
|
"Accept": "application/json"
|
|
320
|
-
}
|
|
342
|
+
},
|
|
343
|
+
cancelToken: cancelToken
|
|
321
344
|
};
|
|
322
|
-
return this.
|
|
345
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
346
|
+
if (isAxiosError(_error) && _error.response) {
|
|
347
|
+
return _error.response;
|
|
348
|
+
} else {
|
|
349
|
+
throw _error;
|
|
350
|
+
}
|
|
351
|
+
}).then(function(_response) {
|
|
323
352
|
return _this.processModulesPOST(_response);
|
|
324
353
|
});
|
|
325
354
|
}
|
|
@@ -327,31 +356,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
327
356
|
{
|
|
328
357
|
key: "processModulesPOST",
|
|
329
358
|
value: function processModulesPOST(response) {
|
|
330
|
-
var _this = this;
|
|
331
359
|
var status = response.status;
|
|
332
360
|
var _headers = {};
|
|
333
|
-
if (response.headers && response.headers
|
|
334
|
-
response.headers
|
|
335
|
-
|
|
336
|
-
|
|
361
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
362
|
+
for(var k in response.headers){
|
|
363
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
364
|
+
_headers[k] = response.headers[k];
|
|
365
|
+
}
|
|
366
|
+
}
|
|
337
367
|
}
|
|
338
|
-
;
|
|
339
368
|
if (status === 200) {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
369
|
+
var _responseText = response.data;
|
|
370
|
+
var result200 = null;
|
|
371
|
+
var resultData200 = _responseText;
|
|
372
|
+
result200 = JSON.parse(resultData200);
|
|
373
|
+
return Promise.resolve(result200);
|
|
345
374
|
} else if (status === 500) {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
375
|
+
var _responseText1 = response.data;
|
|
376
|
+
var result500 = null;
|
|
377
|
+
var resultData500 = _responseText1;
|
|
378
|
+
result500 = JSON.parse(resultData500);
|
|
379
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
351
380
|
} else if (status !== 200 && status !== 204) {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
});
|
|
381
|
+
var _responseText2 = response.data;
|
|
382
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
355
383
|
}
|
|
356
384
|
return Promise.resolve(null);
|
|
357
385
|
}
|
|
@@ -360,17 +388,25 @@ var Client = /*#__PURE__*/ function() {
|
|
|
360
388
|
/**
|
|
361
389
|
* @return OK
|
|
362
390
|
*/ key: "modulesAll",
|
|
363
|
-
value: function modulesAll() {
|
|
391
|
+
value: function modulesAll(cancelToken) {
|
|
364
392
|
var _this = this;
|
|
365
393
|
var url_ = this.baseUrl + "/api/modules";
|
|
366
394
|
url_ = url_.replace(/[?&]$/, "");
|
|
367
395
|
var options_ = {
|
|
368
396
|
method: "GET",
|
|
397
|
+
url: url_,
|
|
369
398
|
headers: {
|
|
370
399
|
"Accept": "application/json"
|
|
371
|
-
}
|
|
400
|
+
},
|
|
401
|
+
cancelToken: cancelToken
|
|
372
402
|
};
|
|
373
|
-
return this.
|
|
403
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
404
|
+
if (isAxiosError(_error) && _error.response) {
|
|
405
|
+
return _error.response;
|
|
406
|
+
} else {
|
|
407
|
+
throw _error;
|
|
408
|
+
}
|
|
409
|
+
}).then(function(_response) {
|
|
374
410
|
return _this.processModulesAll(_response);
|
|
375
411
|
});
|
|
376
412
|
}
|
|
@@ -378,31 +414,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
378
414
|
{
|
|
379
415
|
key: "processModulesAll",
|
|
380
416
|
value: function processModulesAll(response) {
|
|
381
|
-
var _this = this;
|
|
382
417
|
var status = response.status;
|
|
383
418
|
var _headers = {};
|
|
384
|
-
if (response.headers && response.headers
|
|
385
|
-
response.headers
|
|
386
|
-
|
|
387
|
-
|
|
419
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
420
|
+
for(var k in response.headers){
|
|
421
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
422
|
+
_headers[k] = response.headers[k];
|
|
423
|
+
}
|
|
424
|
+
}
|
|
388
425
|
}
|
|
389
|
-
;
|
|
390
426
|
if (status === 200) {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
427
|
+
var _responseText = response.data;
|
|
428
|
+
var result200 = null;
|
|
429
|
+
var resultData200 = _responseText;
|
|
430
|
+
result200 = JSON.parse(resultData200);
|
|
431
|
+
return Promise.resolve(result200);
|
|
396
432
|
} else if (status === 500) {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
433
|
+
var _responseText1 = response.data;
|
|
434
|
+
var result500 = null;
|
|
435
|
+
var resultData500 = _responseText1;
|
|
436
|
+
result500 = JSON.parse(resultData500);
|
|
437
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
402
438
|
} else if (status !== 200 && status !== 204) {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
});
|
|
439
|
+
var _responseText2 = response.data;
|
|
440
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
406
441
|
}
|
|
407
442
|
return Promise.resolve(null);
|
|
408
443
|
}
|
|
@@ -411,7 +446,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
411
446
|
/**
|
|
412
447
|
* @return OK
|
|
413
448
|
*/ key: "modulesGET",
|
|
414
|
-
value: function modulesGET(id) {
|
|
449
|
+
value: function modulesGET(id, cancelToken) {
|
|
415
450
|
var _this = this;
|
|
416
451
|
var url_ = this.baseUrl + "/api/modules/{id}";
|
|
417
452
|
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
@@ -419,11 +454,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
419
454
|
url_ = url_.replace(/[?&]$/, "");
|
|
420
455
|
var options_ = {
|
|
421
456
|
method: "GET",
|
|
457
|
+
url: url_,
|
|
422
458
|
headers: {
|
|
423
459
|
"Accept": "application/json"
|
|
424
|
-
}
|
|
460
|
+
},
|
|
461
|
+
cancelToken: cancelToken
|
|
425
462
|
};
|
|
426
|
-
return this.
|
|
463
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
464
|
+
if (isAxiosError(_error) && _error.response) {
|
|
465
|
+
return _error.response;
|
|
466
|
+
} else {
|
|
467
|
+
throw _error;
|
|
468
|
+
}
|
|
469
|
+
}).then(function(_response) {
|
|
427
470
|
return _this.processModulesGET(_response);
|
|
428
471
|
});
|
|
429
472
|
}
|
|
@@ -431,31 +474,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
431
474
|
{
|
|
432
475
|
key: "processModulesGET",
|
|
433
476
|
value: function processModulesGET(response) {
|
|
434
|
-
var _this = this;
|
|
435
477
|
var status = response.status;
|
|
436
478
|
var _headers = {};
|
|
437
|
-
if (response.headers && response.headers
|
|
438
|
-
response.headers
|
|
439
|
-
|
|
440
|
-
|
|
479
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
480
|
+
for(var k in response.headers){
|
|
481
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
482
|
+
_headers[k] = response.headers[k];
|
|
483
|
+
}
|
|
484
|
+
}
|
|
441
485
|
}
|
|
442
|
-
;
|
|
443
486
|
if (status === 200) {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
487
|
+
var _responseText = response.data;
|
|
488
|
+
var result200 = null;
|
|
489
|
+
var resultData200 = _responseText;
|
|
490
|
+
result200 = JSON.parse(resultData200);
|
|
491
|
+
return Promise.resolve(result200);
|
|
449
492
|
} else if (status === 500) {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
493
|
+
var _responseText1 = response.data;
|
|
494
|
+
var result500 = null;
|
|
495
|
+
var resultData500 = _responseText1;
|
|
496
|
+
result500 = JSON.parse(resultData500);
|
|
497
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
455
498
|
} else if (status !== 200 && status !== 204) {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
});
|
|
499
|
+
var _responseText2 = response.data;
|
|
500
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
459
501
|
}
|
|
460
502
|
return Promise.resolve(null);
|
|
461
503
|
}
|
|
@@ -465,20 +507,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
465
507
|
* @param body (optional)
|
|
466
508
|
* @return OK
|
|
467
509
|
*/ key: "placesPOST",
|
|
468
|
-
value: function placesPOST(body) {
|
|
510
|
+
value: function placesPOST(body, cancelToken) {
|
|
469
511
|
var _this = this;
|
|
470
512
|
var url_ = this.baseUrl + "/api/places";
|
|
471
513
|
url_ = url_.replace(/[?&]$/, "");
|
|
472
514
|
var content_ = JSON.stringify(body);
|
|
473
515
|
var options_ = {
|
|
474
|
-
|
|
516
|
+
data: content_,
|
|
475
517
|
method: "POST",
|
|
518
|
+
url: url_,
|
|
476
519
|
headers: {
|
|
477
520
|
"Content-Type": "application/json",
|
|
478
521
|
"Accept": "application/json"
|
|
479
|
-
}
|
|
522
|
+
},
|
|
523
|
+
cancelToken: cancelToken
|
|
480
524
|
};
|
|
481
|
-
return this.
|
|
525
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
526
|
+
if (isAxiosError(_error) && _error.response) {
|
|
527
|
+
return _error.response;
|
|
528
|
+
} else {
|
|
529
|
+
throw _error;
|
|
530
|
+
}
|
|
531
|
+
}).then(function(_response) {
|
|
482
532
|
return _this.processPlacesPOST(_response);
|
|
483
533
|
});
|
|
484
534
|
}
|
|
@@ -486,31 +536,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
486
536
|
{
|
|
487
537
|
key: "processPlacesPOST",
|
|
488
538
|
value: function processPlacesPOST(response) {
|
|
489
|
-
var _this = this;
|
|
490
539
|
var status = response.status;
|
|
491
540
|
var _headers = {};
|
|
492
|
-
if (response.headers && response.headers
|
|
493
|
-
response.headers
|
|
494
|
-
|
|
495
|
-
|
|
541
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
542
|
+
for(var k in response.headers){
|
|
543
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
544
|
+
_headers[k] = response.headers[k];
|
|
545
|
+
}
|
|
546
|
+
}
|
|
496
547
|
}
|
|
497
|
-
;
|
|
498
548
|
if (status === 200) {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
549
|
+
var _responseText = response.data;
|
|
550
|
+
var result200 = null;
|
|
551
|
+
var resultData200 = _responseText;
|
|
552
|
+
result200 = JSON.parse(resultData200);
|
|
553
|
+
return Promise.resolve(result200);
|
|
504
554
|
} else if (status === 500) {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
555
|
+
var _responseText1 = response.data;
|
|
556
|
+
var result500 = null;
|
|
557
|
+
var resultData500 = _responseText1;
|
|
558
|
+
result500 = JSON.parse(resultData500);
|
|
559
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
510
560
|
} else if (status !== 200 && status !== 204) {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
});
|
|
561
|
+
var _responseText2 = response.data;
|
|
562
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
514
563
|
}
|
|
515
564
|
return Promise.resolve(null);
|
|
516
565
|
}
|
|
@@ -520,7 +569,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
520
569
|
* @param id (optional)
|
|
521
570
|
* @return OK
|
|
522
571
|
*/ key: "placesDELETE",
|
|
523
|
-
value: function placesDELETE(id) {
|
|
572
|
+
value: function placesDELETE(id, cancelToken) {
|
|
524
573
|
var _this = this;
|
|
525
574
|
var url_ = this.baseUrl + "/api/places?";
|
|
526
575
|
if (id === null) throw new globalThis.Error("The parameter 'id' cannot be null.");
|
|
@@ -528,11 +577,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
528
577
|
url_ = url_.replace(/[?&]$/, "");
|
|
529
578
|
var options_ = {
|
|
530
579
|
method: "DELETE",
|
|
580
|
+
url: url_,
|
|
531
581
|
headers: {
|
|
532
582
|
"Accept": "application/json"
|
|
533
|
-
}
|
|
583
|
+
},
|
|
584
|
+
cancelToken: cancelToken
|
|
534
585
|
};
|
|
535
|
-
return this.
|
|
586
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
587
|
+
if (isAxiosError(_error) && _error.response) {
|
|
588
|
+
return _error.response;
|
|
589
|
+
} else {
|
|
590
|
+
throw _error;
|
|
591
|
+
}
|
|
592
|
+
}).then(function(_response) {
|
|
536
593
|
return _this.processPlacesDELETE(_response);
|
|
537
594
|
});
|
|
538
595
|
}
|
|
@@ -540,31 +597,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
540
597
|
{
|
|
541
598
|
key: "processPlacesDELETE",
|
|
542
599
|
value: function processPlacesDELETE(response) {
|
|
543
|
-
var _this = this;
|
|
544
600
|
var status = response.status;
|
|
545
601
|
var _headers = {};
|
|
546
|
-
if (response.headers && response.headers
|
|
547
|
-
response.headers
|
|
548
|
-
|
|
549
|
-
|
|
602
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
603
|
+
for(var k in response.headers){
|
|
604
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
605
|
+
_headers[k] = response.headers[k];
|
|
606
|
+
}
|
|
607
|
+
}
|
|
550
608
|
}
|
|
551
|
-
;
|
|
552
609
|
if (status === 200) {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
610
|
+
var _responseText = response.data;
|
|
611
|
+
var result200 = null;
|
|
612
|
+
var resultData200 = _responseText;
|
|
613
|
+
result200 = JSON.parse(resultData200);
|
|
614
|
+
return Promise.resolve(result200);
|
|
558
615
|
} else if (status === 500) {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
616
|
+
var _responseText1 = response.data;
|
|
617
|
+
var result500 = null;
|
|
618
|
+
var resultData500 = _responseText1;
|
|
619
|
+
result500 = JSON.parse(resultData500);
|
|
620
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
564
621
|
} else if (status !== 200 && status !== 204) {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
});
|
|
622
|
+
var _responseText2 = response.data;
|
|
623
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
568
624
|
}
|
|
569
625
|
return Promise.resolve(null);
|
|
570
626
|
}
|
|
@@ -574,20 +630,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
574
630
|
* @param body (optional)
|
|
575
631
|
* @return OK
|
|
576
632
|
*/ key: "placesPUT",
|
|
577
|
-
value: function placesPUT(body) {
|
|
633
|
+
value: function placesPUT(body, cancelToken) {
|
|
578
634
|
var _this = this;
|
|
579
635
|
var url_ = this.baseUrl + "/api/places";
|
|
580
636
|
url_ = url_.replace(/[?&]$/, "");
|
|
581
637
|
var content_ = JSON.stringify(body);
|
|
582
638
|
var options_ = {
|
|
583
|
-
|
|
639
|
+
data: content_,
|
|
584
640
|
method: "PUT",
|
|
641
|
+
url: url_,
|
|
585
642
|
headers: {
|
|
586
643
|
"Content-Type": "application/json",
|
|
587
644
|
"Accept": "application/json"
|
|
588
|
-
}
|
|
645
|
+
},
|
|
646
|
+
cancelToken: cancelToken
|
|
589
647
|
};
|
|
590
|
-
return this.
|
|
648
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
649
|
+
if (isAxiosError(_error) && _error.response) {
|
|
650
|
+
return _error.response;
|
|
651
|
+
} else {
|
|
652
|
+
throw _error;
|
|
653
|
+
}
|
|
654
|
+
}).then(function(_response) {
|
|
591
655
|
return _this.processPlacesPUT(_response);
|
|
592
656
|
});
|
|
593
657
|
}
|
|
@@ -595,31 +659,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
595
659
|
{
|
|
596
660
|
key: "processPlacesPUT",
|
|
597
661
|
value: function processPlacesPUT(response) {
|
|
598
|
-
var _this = this;
|
|
599
662
|
var status = response.status;
|
|
600
663
|
var _headers = {};
|
|
601
|
-
if (response.headers && response.headers
|
|
602
|
-
response.headers
|
|
603
|
-
|
|
604
|
-
|
|
664
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
665
|
+
for(var k in response.headers){
|
|
666
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
667
|
+
_headers[k] = response.headers[k];
|
|
668
|
+
}
|
|
669
|
+
}
|
|
605
670
|
}
|
|
606
|
-
;
|
|
607
671
|
if (status === 200) {
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
672
|
+
var _responseText = response.data;
|
|
673
|
+
var result200 = null;
|
|
674
|
+
var resultData200 = _responseText;
|
|
675
|
+
result200 = JSON.parse(resultData200);
|
|
676
|
+
return Promise.resolve(result200);
|
|
613
677
|
} else if (status === 500) {
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
678
|
+
var _responseText1 = response.data;
|
|
679
|
+
var result500 = null;
|
|
680
|
+
var resultData500 = _responseText1;
|
|
681
|
+
result500 = JSON.parse(resultData500);
|
|
682
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
619
683
|
} else if (status !== 200 && status !== 204) {
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
});
|
|
684
|
+
var _responseText2 = response.data;
|
|
685
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
623
686
|
}
|
|
624
687
|
return Promise.resolve(null);
|
|
625
688
|
}
|
|
@@ -628,17 +691,25 @@ var Client = /*#__PURE__*/ function() {
|
|
|
628
691
|
/**
|
|
629
692
|
* @return OK
|
|
630
693
|
*/ key: "placesAll",
|
|
631
|
-
value: function placesAll() {
|
|
694
|
+
value: function placesAll(cancelToken) {
|
|
632
695
|
var _this = this;
|
|
633
696
|
var url_ = this.baseUrl + "/api/places";
|
|
634
697
|
url_ = url_.replace(/[?&]$/, "");
|
|
635
698
|
var options_ = {
|
|
636
699
|
method: "GET",
|
|
700
|
+
url: url_,
|
|
637
701
|
headers: {
|
|
638
702
|
"Accept": "application/json"
|
|
639
|
-
}
|
|
703
|
+
},
|
|
704
|
+
cancelToken: cancelToken
|
|
640
705
|
};
|
|
641
|
-
return this.
|
|
706
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
707
|
+
if (isAxiosError(_error) && _error.response) {
|
|
708
|
+
return _error.response;
|
|
709
|
+
} else {
|
|
710
|
+
throw _error;
|
|
711
|
+
}
|
|
712
|
+
}).then(function(_response) {
|
|
642
713
|
return _this.processPlacesAll(_response);
|
|
643
714
|
});
|
|
644
715
|
}
|
|
@@ -646,31 +717,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
646
717
|
{
|
|
647
718
|
key: "processPlacesAll",
|
|
648
719
|
value: function processPlacesAll(response) {
|
|
649
|
-
var _this = this;
|
|
650
720
|
var status = response.status;
|
|
651
721
|
var _headers = {};
|
|
652
|
-
if (response.headers && response.headers
|
|
653
|
-
response.headers
|
|
654
|
-
|
|
655
|
-
|
|
722
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
723
|
+
for(var k in response.headers){
|
|
724
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
725
|
+
_headers[k] = response.headers[k];
|
|
726
|
+
}
|
|
727
|
+
}
|
|
656
728
|
}
|
|
657
|
-
;
|
|
658
729
|
if (status === 200) {
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
730
|
+
var _responseText = response.data;
|
|
731
|
+
var result200 = null;
|
|
732
|
+
var resultData200 = _responseText;
|
|
733
|
+
result200 = JSON.parse(resultData200);
|
|
734
|
+
return Promise.resolve(result200);
|
|
664
735
|
} else if (status === 500) {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
736
|
+
var _responseText1 = response.data;
|
|
737
|
+
var result500 = null;
|
|
738
|
+
var resultData500 = _responseText1;
|
|
739
|
+
result500 = JSON.parse(resultData500);
|
|
740
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
670
741
|
} else if (status !== 200 && status !== 204) {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
});
|
|
742
|
+
var _responseText2 = response.data;
|
|
743
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
674
744
|
}
|
|
675
745
|
return Promise.resolve(null);
|
|
676
746
|
}
|
|
@@ -680,20 +750,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
680
750
|
* @param body (optional)
|
|
681
751
|
* @return OK
|
|
682
752
|
*/ key: "plantsPOST",
|
|
683
|
-
value: function plantsPOST(body) {
|
|
753
|
+
value: function plantsPOST(body, cancelToken) {
|
|
684
754
|
var _this = this;
|
|
685
755
|
var url_ = this.baseUrl + "/api/plants";
|
|
686
756
|
url_ = url_.replace(/[?&]$/, "");
|
|
687
757
|
var content_ = JSON.stringify(body);
|
|
688
758
|
var options_ = {
|
|
689
|
-
|
|
759
|
+
data: content_,
|
|
690
760
|
method: "POST",
|
|
761
|
+
url: url_,
|
|
691
762
|
headers: {
|
|
692
763
|
"Content-Type": "application/json",
|
|
693
764
|
"Accept": "application/json"
|
|
694
|
-
}
|
|
765
|
+
},
|
|
766
|
+
cancelToken: cancelToken
|
|
695
767
|
};
|
|
696
|
-
return this.
|
|
768
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
769
|
+
if (isAxiosError(_error) && _error.response) {
|
|
770
|
+
return _error.response;
|
|
771
|
+
} else {
|
|
772
|
+
throw _error;
|
|
773
|
+
}
|
|
774
|
+
}).then(function(_response) {
|
|
697
775
|
return _this.processPlantsPOST(_response);
|
|
698
776
|
});
|
|
699
777
|
}
|
|
@@ -701,31 +779,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
701
779
|
{
|
|
702
780
|
key: "processPlantsPOST",
|
|
703
781
|
value: function processPlantsPOST(response) {
|
|
704
|
-
var _this = this;
|
|
705
782
|
var status = response.status;
|
|
706
783
|
var _headers = {};
|
|
707
|
-
if (response.headers && response.headers
|
|
708
|
-
response.headers
|
|
709
|
-
|
|
710
|
-
|
|
784
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
785
|
+
for(var k in response.headers){
|
|
786
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
787
|
+
_headers[k] = response.headers[k];
|
|
788
|
+
}
|
|
789
|
+
}
|
|
711
790
|
}
|
|
712
|
-
;
|
|
713
791
|
if (status === 200) {
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
792
|
+
var _responseText = response.data;
|
|
793
|
+
var result200 = null;
|
|
794
|
+
var resultData200 = _responseText;
|
|
795
|
+
result200 = JSON.parse(resultData200);
|
|
796
|
+
return Promise.resolve(result200);
|
|
719
797
|
} else if (status === 500) {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
798
|
+
var _responseText1 = response.data;
|
|
799
|
+
var result500 = null;
|
|
800
|
+
var resultData500 = _responseText1;
|
|
801
|
+
result500 = JSON.parse(resultData500);
|
|
802
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
725
803
|
} else if (status !== 200 && status !== 204) {
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
});
|
|
804
|
+
var _responseText2 = response.data;
|
|
805
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
729
806
|
}
|
|
730
807
|
return Promise.resolve(null);
|
|
731
808
|
}
|
|
@@ -735,7 +812,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
735
812
|
* @param id (optional)
|
|
736
813
|
* @return OK
|
|
737
814
|
*/ key: "plantsDELETE",
|
|
738
|
-
value: function plantsDELETE(id) {
|
|
815
|
+
value: function plantsDELETE(id, cancelToken) {
|
|
739
816
|
var _this = this;
|
|
740
817
|
var url_ = this.baseUrl + "/api/plants?";
|
|
741
818
|
if (id === null) throw new globalThis.Error("The parameter 'id' cannot be null.");
|
|
@@ -743,11 +820,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
743
820
|
url_ = url_.replace(/[?&]$/, "");
|
|
744
821
|
var options_ = {
|
|
745
822
|
method: "DELETE",
|
|
823
|
+
url: url_,
|
|
746
824
|
headers: {
|
|
747
825
|
"Accept": "application/json"
|
|
748
|
-
}
|
|
826
|
+
},
|
|
827
|
+
cancelToken: cancelToken
|
|
749
828
|
};
|
|
750
|
-
return this.
|
|
829
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
830
|
+
if (isAxiosError(_error) && _error.response) {
|
|
831
|
+
return _error.response;
|
|
832
|
+
} else {
|
|
833
|
+
throw _error;
|
|
834
|
+
}
|
|
835
|
+
}).then(function(_response) {
|
|
751
836
|
return _this.processPlantsDELETE(_response);
|
|
752
837
|
});
|
|
753
838
|
}
|
|
@@ -755,31 +840,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
755
840
|
{
|
|
756
841
|
key: "processPlantsDELETE",
|
|
757
842
|
value: function processPlantsDELETE(response) {
|
|
758
|
-
var _this = this;
|
|
759
843
|
var status = response.status;
|
|
760
844
|
var _headers = {};
|
|
761
|
-
if (response.headers && response.headers
|
|
762
|
-
response.headers
|
|
763
|
-
|
|
764
|
-
|
|
845
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
846
|
+
for(var k in response.headers){
|
|
847
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
848
|
+
_headers[k] = response.headers[k];
|
|
849
|
+
}
|
|
850
|
+
}
|
|
765
851
|
}
|
|
766
|
-
;
|
|
767
852
|
if (status === 200) {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
853
|
+
var _responseText = response.data;
|
|
854
|
+
var result200 = null;
|
|
855
|
+
var resultData200 = _responseText;
|
|
856
|
+
result200 = JSON.parse(resultData200);
|
|
857
|
+
return Promise.resolve(result200);
|
|
773
858
|
} else if (status === 500) {
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
859
|
+
var _responseText1 = response.data;
|
|
860
|
+
var result500 = null;
|
|
861
|
+
var resultData500 = _responseText1;
|
|
862
|
+
result500 = JSON.parse(resultData500);
|
|
863
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
779
864
|
} else if (status !== 200 && status !== 204) {
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
});
|
|
865
|
+
var _responseText2 = response.data;
|
|
866
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
783
867
|
}
|
|
784
868
|
return Promise.resolve(null);
|
|
785
869
|
}
|
|
@@ -789,20 +873,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
789
873
|
* @param body (optional)
|
|
790
874
|
* @return OK
|
|
791
875
|
*/ key: "plantsPUT",
|
|
792
|
-
value: function plantsPUT(body) {
|
|
876
|
+
value: function plantsPUT(body, cancelToken) {
|
|
793
877
|
var _this = this;
|
|
794
878
|
var url_ = this.baseUrl + "/api/plants";
|
|
795
879
|
url_ = url_.replace(/[?&]$/, "");
|
|
796
880
|
var content_ = JSON.stringify(body);
|
|
797
881
|
var options_ = {
|
|
798
|
-
|
|
882
|
+
data: content_,
|
|
799
883
|
method: "PUT",
|
|
884
|
+
url: url_,
|
|
800
885
|
headers: {
|
|
801
886
|
"Content-Type": "application/json",
|
|
802
887
|
"Accept": "application/json"
|
|
803
|
-
}
|
|
888
|
+
},
|
|
889
|
+
cancelToken: cancelToken
|
|
804
890
|
};
|
|
805
|
-
return this.
|
|
891
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
892
|
+
if (isAxiosError(_error) && _error.response) {
|
|
893
|
+
return _error.response;
|
|
894
|
+
} else {
|
|
895
|
+
throw _error;
|
|
896
|
+
}
|
|
897
|
+
}).then(function(_response) {
|
|
806
898
|
return _this.processPlantsPUT(_response);
|
|
807
899
|
});
|
|
808
900
|
}
|
|
@@ -810,31 +902,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
810
902
|
{
|
|
811
903
|
key: "processPlantsPUT",
|
|
812
904
|
value: function processPlantsPUT(response) {
|
|
813
|
-
var _this = this;
|
|
814
905
|
var status = response.status;
|
|
815
906
|
var _headers = {};
|
|
816
|
-
if (response.headers && response.headers
|
|
817
|
-
response.headers
|
|
818
|
-
|
|
819
|
-
|
|
907
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
908
|
+
for(var k in response.headers){
|
|
909
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
910
|
+
_headers[k] = response.headers[k];
|
|
911
|
+
}
|
|
912
|
+
}
|
|
820
913
|
}
|
|
821
|
-
;
|
|
822
914
|
if (status === 200) {
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
915
|
+
var _responseText = response.data;
|
|
916
|
+
var result200 = null;
|
|
917
|
+
var resultData200 = _responseText;
|
|
918
|
+
result200 = JSON.parse(resultData200);
|
|
919
|
+
return Promise.resolve(result200);
|
|
828
920
|
} else if (status === 500) {
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
921
|
+
var _responseText1 = response.data;
|
|
922
|
+
var result500 = null;
|
|
923
|
+
var resultData500 = _responseText1;
|
|
924
|
+
result500 = JSON.parse(resultData500);
|
|
925
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
834
926
|
} else if (status !== 200 && status !== 204) {
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
});
|
|
927
|
+
var _responseText2 = response.data;
|
|
928
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
838
929
|
}
|
|
839
930
|
return Promise.resolve(null);
|
|
840
931
|
}
|
|
@@ -843,17 +934,25 @@ var Client = /*#__PURE__*/ function() {
|
|
|
843
934
|
/**
|
|
844
935
|
* @return OK
|
|
845
936
|
*/ key: "plantsAll",
|
|
846
|
-
value: function plantsAll() {
|
|
937
|
+
value: function plantsAll(cancelToken) {
|
|
847
938
|
var _this = this;
|
|
848
939
|
var url_ = this.baseUrl + "/api/plants";
|
|
849
940
|
url_ = url_.replace(/[?&]$/, "");
|
|
850
941
|
var options_ = {
|
|
851
942
|
method: "GET",
|
|
943
|
+
url: url_,
|
|
852
944
|
headers: {
|
|
853
945
|
"Accept": "application/json"
|
|
854
|
-
}
|
|
946
|
+
},
|
|
947
|
+
cancelToken: cancelToken
|
|
855
948
|
};
|
|
856
|
-
return this.
|
|
949
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
950
|
+
if (isAxiosError(_error) && _error.response) {
|
|
951
|
+
return _error.response;
|
|
952
|
+
} else {
|
|
953
|
+
throw _error;
|
|
954
|
+
}
|
|
955
|
+
}).then(function(_response) {
|
|
857
956
|
return _this.processPlantsAll(_response);
|
|
858
957
|
});
|
|
859
958
|
}
|
|
@@ -861,31 +960,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
861
960
|
{
|
|
862
961
|
key: "processPlantsAll",
|
|
863
962
|
value: function processPlantsAll(response) {
|
|
864
|
-
var _this = this;
|
|
865
963
|
var status = response.status;
|
|
866
964
|
var _headers = {};
|
|
867
|
-
if (response.headers && response.headers
|
|
868
|
-
response.headers
|
|
869
|
-
|
|
870
|
-
|
|
965
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
966
|
+
for(var k in response.headers){
|
|
967
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
968
|
+
_headers[k] = response.headers[k];
|
|
969
|
+
}
|
|
970
|
+
}
|
|
871
971
|
}
|
|
872
|
-
;
|
|
873
972
|
if (status === 200) {
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
973
|
+
var _responseText = response.data;
|
|
974
|
+
var result200 = null;
|
|
975
|
+
var resultData200 = _responseText;
|
|
976
|
+
result200 = JSON.parse(resultData200);
|
|
977
|
+
return Promise.resolve(result200);
|
|
879
978
|
} else if (status === 500) {
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
979
|
+
var _responseText1 = response.data;
|
|
980
|
+
var result500 = null;
|
|
981
|
+
var resultData500 = _responseText1;
|
|
982
|
+
result500 = JSON.parse(resultData500);
|
|
983
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
885
984
|
} else if (status !== 200 && status !== 204) {
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
});
|
|
985
|
+
var _responseText2 = response.data;
|
|
986
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
889
987
|
}
|
|
890
988
|
return Promise.resolve(null);
|
|
891
989
|
}
|
|
@@ -894,7 +992,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
894
992
|
/**
|
|
895
993
|
* @return OK
|
|
896
994
|
*/ key: "plantsGET",
|
|
897
|
-
value: function plantsGET(id) {
|
|
995
|
+
value: function plantsGET(id, cancelToken) {
|
|
898
996
|
var _this = this;
|
|
899
997
|
var url_ = this.baseUrl + "/api/plants/{id}";
|
|
900
998
|
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
@@ -902,11 +1000,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
902
1000
|
url_ = url_.replace(/[?&]$/, "");
|
|
903
1001
|
var options_ = {
|
|
904
1002
|
method: "GET",
|
|
1003
|
+
url: url_,
|
|
905
1004
|
headers: {
|
|
906
1005
|
"Accept": "application/json"
|
|
907
|
-
}
|
|
1006
|
+
},
|
|
1007
|
+
cancelToken: cancelToken
|
|
908
1008
|
};
|
|
909
|
-
return this.
|
|
1009
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
1010
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1011
|
+
return _error.response;
|
|
1012
|
+
} else {
|
|
1013
|
+
throw _error;
|
|
1014
|
+
}
|
|
1015
|
+
}).then(function(_response) {
|
|
910
1016
|
return _this.processPlantsGET(_response);
|
|
911
1017
|
});
|
|
912
1018
|
}
|
|
@@ -914,31 +1020,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
914
1020
|
{
|
|
915
1021
|
key: "processPlantsGET",
|
|
916
1022
|
value: function processPlantsGET(response) {
|
|
917
|
-
var _this = this;
|
|
918
1023
|
var status = response.status;
|
|
919
1024
|
var _headers = {};
|
|
920
|
-
if (response.headers && response.headers
|
|
921
|
-
response.headers
|
|
922
|
-
|
|
923
|
-
|
|
1025
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
1026
|
+
for(var k in response.headers){
|
|
1027
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1028
|
+
_headers[k] = response.headers[k];
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
924
1031
|
}
|
|
925
|
-
;
|
|
926
1032
|
if (status === 200) {
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
1033
|
+
var _responseText = response.data;
|
|
1034
|
+
var result200 = null;
|
|
1035
|
+
var resultData200 = _responseText;
|
|
1036
|
+
result200 = JSON.parse(resultData200);
|
|
1037
|
+
return Promise.resolve(result200);
|
|
932
1038
|
} else if (status === 500) {
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
1039
|
+
var _responseText1 = response.data;
|
|
1040
|
+
var result500 = null;
|
|
1041
|
+
var resultData500 = _responseText1;
|
|
1042
|
+
result500 = JSON.parse(resultData500);
|
|
1043
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
938
1044
|
} else if (status !== 200 && status !== 204) {
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
});
|
|
1045
|
+
var _responseText2 = response.data;
|
|
1046
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
942
1047
|
}
|
|
943
1048
|
return Promise.resolve(null);
|
|
944
1049
|
}
|
|
@@ -1148,4 +1253,7 @@ function throwException(message, status, response, headers, result) {
|
|
|
1148
1253
|
if (result !== null && result !== void 0) throw result;
|
|
1149
1254
|
else throw new ApiException(message, status, response, headers, null);
|
|
1150
1255
|
}
|
|
1256
|
+
function isAxiosError(obj) {
|
|
1257
|
+
return obj && obj.isAxiosError === true;
|
|
1258
|
+
}
|
|
1151
1259
|
export { ApiException, CallingConventions, Client, EventAttributes, FieldAttributes, GenericParameterAttributes, LayoutKind, MemberTypes, MethodAttributes, MethodImplAttributes, ParameterAttributes, PlantType, PropertyAttributes, SecurityRuleSet, TypeAttributes };
|