@arekstasko/plantcare-api-client 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +465 -348
- package/dist/index.d.cts +37 -115
- package/dist/index.d.ts +37 -115
- package/dist/index.js +453 -348
- package/package.json +4 -1
package/dist/index.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,49 +228,45 @@ 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
|
}
|
|
244
258
|
},
|
|
245
259
|
{
|
|
246
260
|
/**
|
|
247
|
-
* @param id (optional)
|
|
248
261
|
* @param fromDate (optional)
|
|
249
262
|
* @param toDate (optional)
|
|
250
263
|
* @return OK
|
|
251
264
|
*/ key: "average",
|
|
252
|
-
value: function average(
|
|
265
|
+
value: function average(id, fromDate, toDate, cancelToken) {
|
|
253
266
|
var _this = this;
|
|
254
|
-
var url_ = this.baseUrl + "/api/humidity-measurements/{
|
|
255
|
-
if (
|
|
256
|
-
url_ = url_.replace("{
|
|
257
|
-
if (id === null) throw new globalThis.Error("The parameter 'id' cannot be null.");
|
|
258
|
-
else if (id !== void 0) url_ += "id=" + encodeURIComponent("" + id) + "&";
|
|
267
|
+
var url_ = this.baseUrl + "/api/humidity-measurements/{id}/average?";
|
|
268
|
+
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
269
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
259
270
|
if (fromDate === null) throw new globalThis.Error("The parameter 'fromDate' cannot be null.");
|
|
260
271
|
else if (fromDate !== void 0) url_ += "fromDate=" + encodeURIComponent(fromDate ? "" + fromDate.toISOString() : "") + "&";
|
|
261
272
|
if (toDate === null) throw new globalThis.Error("The parameter 'toDate' cannot be null.");
|
|
@@ -263,11 +274,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
263
274
|
url_ = url_.replace(/[?&]$/, "");
|
|
264
275
|
var options_ = {
|
|
265
276
|
method: "GET",
|
|
277
|
+
url: url_,
|
|
266
278
|
headers: {
|
|
267
279
|
"Accept": "application/json"
|
|
268
|
-
}
|
|
280
|
+
},
|
|
281
|
+
cancelToken: cancelToken
|
|
269
282
|
};
|
|
270
|
-
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) {
|
|
271
290
|
return _this.processAverage(_response);
|
|
272
291
|
});
|
|
273
292
|
}
|
|
@@ -275,31 +294,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
275
294
|
{
|
|
276
295
|
key: "processAverage",
|
|
277
296
|
value: function processAverage(response) {
|
|
278
|
-
var _this = this;
|
|
279
297
|
var status = response.status;
|
|
280
298
|
var _headers = {};
|
|
281
|
-
if (response.headers && response.headers
|
|
282
|
-
response.headers
|
|
283
|
-
|
|
284
|
-
|
|
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
|
+
}
|
|
285
305
|
}
|
|
286
|
-
;
|
|
287
306
|
if (status === 200) {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
307
|
+
var _responseText = response.data;
|
|
308
|
+
var result200 = null;
|
|
309
|
+
var resultData200 = _responseText;
|
|
310
|
+
result200 = JSON.parse(resultData200);
|
|
311
|
+
return Promise.resolve(result200);
|
|
293
312
|
} else if (status === 500) {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
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);
|
|
299
318
|
} else if (status !== 200 && status !== 204) {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
});
|
|
319
|
+
var _responseText2 = response.data;
|
|
320
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
303
321
|
}
|
|
304
322
|
return Promise.resolve(null);
|
|
305
323
|
}
|
|
@@ -309,20 +327,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
309
327
|
* @param body (optional)
|
|
310
328
|
* @return OK
|
|
311
329
|
*/ key: "modulesPOST",
|
|
312
|
-
value: function modulesPOST(body) {
|
|
330
|
+
value: function modulesPOST(body, cancelToken) {
|
|
313
331
|
var _this = this;
|
|
314
332
|
var url_ = this.baseUrl + "/api/modules";
|
|
315
333
|
url_ = url_.replace(/[?&]$/, "");
|
|
316
334
|
var content_ = JSON.stringify(body);
|
|
317
335
|
var options_ = {
|
|
318
|
-
|
|
336
|
+
data: content_,
|
|
319
337
|
method: "POST",
|
|
338
|
+
url: url_,
|
|
320
339
|
headers: {
|
|
321
340
|
"Content-Type": "application/json",
|
|
322
341
|
"Accept": "application/json"
|
|
323
|
-
}
|
|
342
|
+
},
|
|
343
|
+
cancelToken: cancelToken
|
|
324
344
|
};
|
|
325
|
-
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) {
|
|
326
352
|
return _this.processModulesPOST(_response);
|
|
327
353
|
});
|
|
328
354
|
}
|
|
@@ -330,31 +356,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
330
356
|
{
|
|
331
357
|
key: "processModulesPOST",
|
|
332
358
|
value: function processModulesPOST(response) {
|
|
333
|
-
var _this = this;
|
|
334
359
|
var status = response.status;
|
|
335
360
|
var _headers = {};
|
|
336
|
-
if (response.headers && response.headers
|
|
337
|
-
response.headers
|
|
338
|
-
|
|
339
|
-
|
|
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
|
+
}
|
|
340
367
|
}
|
|
341
|
-
;
|
|
342
368
|
if (status === 200) {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
369
|
+
var _responseText = response.data;
|
|
370
|
+
var result200 = null;
|
|
371
|
+
var resultData200 = _responseText;
|
|
372
|
+
result200 = JSON.parse(resultData200);
|
|
373
|
+
return Promise.resolve(result200);
|
|
348
374
|
} else if (status === 500) {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
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);
|
|
354
380
|
} else if (status !== 200 && status !== 204) {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
});
|
|
381
|
+
var _responseText2 = response.data;
|
|
382
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
358
383
|
}
|
|
359
384
|
return Promise.resolve(null);
|
|
360
385
|
}
|
|
@@ -363,17 +388,25 @@ var Client = /*#__PURE__*/ function() {
|
|
|
363
388
|
/**
|
|
364
389
|
* @return OK
|
|
365
390
|
*/ key: "modulesAll",
|
|
366
|
-
value: function modulesAll() {
|
|
391
|
+
value: function modulesAll(cancelToken) {
|
|
367
392
|
var _this = this;
|
|
368
393
|
var url_ = this.baseUrl + "/api/modules";
|
|
369
394
|
url_ = url_.replace(/[?&]$/, "");
|
|
370
395
|
var options_ = {
|
|
371
396
|
method: "GET",
|
|
397
|
+
url: url_,
|
|
372
398
|
headers: {
|
|
373
399
|
"Accept": "application/json"
|
|
374
|
-
}
|
|
400
|
+
},
|
|
401
|
+
cancelToken: cancelToken
|
|
375
402
|
};
|
|
376
|
-
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) {
|
|
377
410
|
return _this.processModulesAll(_response);
|
|
378
411
|
});
|
|
379
412
|
}
|
|
@@ -381,31 +414,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
381
414
|
{
|
|
382
415
|
key: "processModulesAll",
|
|
383
416
|
value: function processModulesAll(response) {
|
|
384
|
-
var _this = this;
|
|
385
417
|
var status = response.status;
|
|
386
418
|
var _headers = {};
|
|
387
|
-
if (response.headers && response.headers
|
|
388
|
-
response.headers
|
|
389
|
-
|
|
390
|
-
|
|
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
|
+
}
|
|
391
425
|
}
|
|
392
|
-
;
|
|
393
426
|
if (status === 200) {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
427
|
+
var _responseText = response.data;
|
|
428
|
+
var result200 = null;
|
|
429
|
+
var resultData200 = _responseText;
|
|
430
|
+
result200 = JSON.parse(resultData200);
|
|
431
|
+
return Promise.resolve(result200);
|
|
399
432
|
} else if (status === 500) {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
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);
|
|
405
438
|
} else if (status !== 200 && status !== 204) {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
});
|
|
439
|
+
var _responseText2 = response.data;
|
|
440
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
409
441
|
}
|
|
410
442
|
return Promise.resolve(null);
|
|
411
443
|
}
|
|
@@ -414,7 +446,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
414
446
|
/**
|
|
415
447
|
* @return OK
|
|
416
448
|
*/ key: "modulesGET",
|
|
417
|
-
value: function modulesGET(id) {
|
|
449
|
+
value: function modulesGET(id, cancelToken) {
|
|
418
450
|
var _this = this;
|
|
419
451
|
var url_ = this.baseUrl + "/api/modules/{id}";
|
|
420
452
|
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
@@ -422,11 +454,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
422
454
|
url_ = url_.replace(/[?&]$/, "");
|
|
423
455
|
var options_ = {
|
|
424
456
|
method: "GET",
|
|
457
|
+
url: url_,
|
|
425
458
|
headers: {
|
|
426
459
|
"Accept": "application/json"
|
|
427
|
-
}
|
|
460
|
+
},
|
|
461
|
+
cancelToken: cancelToken
|
|
428
462
|
};
|
|
429
|
-
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) {
|
|
430
470
|
return _this.processModulesGET(_response);
|
|
431
471
|
});
|
|
432
472
|
}
|
|
@@ -434,31 +474,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
434
474
|
{
|
|
435
475
|
key: "processModulesGET",
|
|
436
476
|
value: function processModulesGET(response) {
|
|
437
|
-
var _this = this;
|
|
438
477
|
var status = response.status;
|
|
439
478
|
var _headers = {};
|
|
440
|
-
if (response.headers && response.headers
|
|
441
|
-
response.headers
|
|
442
|
-
|
|
443
|
-
|
|
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
|
+
}
|
|
444
485
|
}
|
|
445
|
-
;
|
|
446
486
|
if (status === 200) {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
487
|
+
var _responseText = response.data;
|
|
488
|
+
var result200 = null;
|
|
489
|
+
var resultData200 = _responseText;
|
|
490
|
+
result200 = JSON.parse(resultData200);
|
|
491
|
+
return Promise.resolve(result200);
|
|
452
492
|
} else if (status === 500) {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
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);
|
|
458
498
|
} else if (status !== 200 && status !== 204) {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
});
|
|
499
|
+
var _responseText2 = response.data;
|
|
500
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
462
501
|
}
|
|
463
502
|
return Promise.resolve(null);
|
|
464
503
|
}
|
|
@@ -468,20 +507,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
468
507
|
* @param body (optional)
|
|
469
508
|
* @return OK
|
|
470
509
|
*/ key: "placesPOST",
|
|
471
|
-
value: function placesPOST(body) {
|
|
510
|
+
value: function placesPOST(body, cancelToken) {
|
|
472
511
|
var _this = this;
|
|
473
512
|
var url_ = this.baseUrl + "/api/places";
|
|
474
513
|
url_ = url_.replace(/[?&]$/, "");
|
|
475
514
|
var content_ = JSON.stringify(body);
|
|
476
515
|
var options_ = {
|
|
477
|
-
|
|
516
|
+
data: content_,
|
|
478
517
|
method: "POST",
|
|
518
|
+
url: url_,
|
|
479
519
|
headers: {
|
|
480
520
|
"Content-Type": "application/json",
|
|
481
521
|
"Accept": "application/json"
|
|
482
|
-
}
|
|
522
|
+
},
|
|
523
|
+
cancelToken: cancelToken
|
|
483
524
|
};
|
|
484
|
-
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) {
|
|
485
532
|
return _this.processPlacesPOST(_response);
|
|
486
533
|
});
|
|
487
534
|
}
|
|
@@ -489,31 +536,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
489
536
|
{
|
|
490
537
|
key: "processPlacesPOST",
|
|
491
538
|
value: function processPlacesPOST(response) {
|
|
492
|
-
var _this = this;
|
|
493
539
|
var status = response.status;
|
|
494
540
|
var _headers = {};
|
|
495
|
-
if (response.headers && response.headers
|
|
496
|
-
response.headers
|
|
497
|
-
|
|
498
|
-
|
|
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
|
+
}
|
|
499
547
|
}
|
|
500
|
-
;
|
|
501
548
|
if (status === 200) {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
549
|
+
var _responseText = response.data;
|
|
550
|
+
var result200 = null;
|
|
551
|
+
var resultData200 = _responseText;
|
|
552
|
+
result200 = JSON.parse(resultData200);
|
|
553
|
+
return Promise.resolve(result200);
|
|
507
554
|
} else if (status === 500) {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
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);
|
|
513
560
|
} else if (status !== 200 && status !== 204) {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
});
|
|
561
|
+
var _responseText2 = response.data;
|
|
562
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
517
563
|
}
|
|
518
564
|
return Promise.resolve(null);
|
|
519
565
|
}
|
|
@@ -523,7 +569,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
523
569
|
* @param id (optional)
|
|
524
570
|
* @return OK
|
|
525
571
|
*/ key: "placesDELETE",
|
|
526
|
-
value: function placesDELETE(id) {
|
|
572
|
+
value: function placesDELETE(id, cancelToken) {
|
|
527
573
|
var _this = this;
|
|
528
574
|
var url_ = this.baseUrl + "/api/places?";
|
|
529
575
|
if (id === null) throw new globalThis.Error("The parameter 'id' cannot be null.");
|
|
@@ -531,11 +577,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
531
577
|
url_ = url_.replace(/[?&]$/, "");
|
|
532
578
|
var options_ = {
|
|
533
579
|
method: "DELETE",
|
|
580
|
+
url: url_,
|
|
534
581
|
headers: {
|
|
535
582
|
"Accept": "application/json"
|
|
536
|
-
}
|
|
583
|
+
},
|
|
584
|
+
cancelToken: cancelToken
|
|
537
585
|
};
|
|
538
|
-
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) {
|
|
539
593
|
return _this.processPlacesDELETE(_response);
|
|
540
594
|
});
|
|
541
595
|
}
|
|
@@ -543,31 +597,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
543
597
|
{
|
|
544
598
|
key: "processPlacesDELETE",
|
|
545
599
|
value: function processPlacesDELETE(response) {
|
|
546
|
-
var _this = this;
|
|
547
600
|
var status = response.status;
|
|
548
601
|
var _headers = {};
|
|
549
|
-
if (response.headers && response.headers
|
|
550
|
-
response.headers
|
|
551
|
-
|
|
552
|
-
|
|
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
|
+
}
|
|
553
608
|
}
|
|
554
|
-
;
|
|
555
609
|
if (status === 200) {
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
610
|
+
var _responseText = response.data;
|
|
611
|
+
var result200 = null;
|
|
612
|
+
var resultData200 = _responseText;
|
|
613
|
+
result200 = JSON.parse(resultData200);
|
|
614
|
+
return Promise.resolve(result200);
|
|
561
615
|
} else if (status === 500) {
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
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);
|
|
567
621
|
} else if (status !== 200 && status !== 204) {
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
});
|
|
622
|
+
var _responseText2 = response.data;
|
|
623
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
571
624
|
}
|
|
572
625
|
return Promise.resolve(null);
|
|
573
626
|
}
|
|
@@ -577,20 +630,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
577
630
|
* @param body (optional)
|
|
578
631
|
* @return OK
|
|
579
632
|
*/ key: "placesPUT",
|
|
580
|
-
value: function placesPUT(body) {
|
|
633
|
+
value: function placesPUT(body, cancelToken) {
|
|
581
634
|
var _this = this;
|
|
582
635
|
var url_ = this.baseUrl + "/api/places";
|
|
583
636
|
url_ = url_.replace(/[?&]$/, "");
|
|
584
637
|
var content_ = JSON.stringify(body);
|
|
585
638
|
var options_ = {
|
|
586
|
-
|
|
639
|
+
data: content_,
|
|
587
640
|
method: "PUT",
|
|
641
|
+
url: url_,
|
|
588
642
|
headers: {
|
|
589
643
|
"Content-Type": "application/json",
|
|
590
644
|
"Accept": "application/json"
|
|
591
|
-
}
|
|
645
|
+
},
|
|
646
|
+
cancelToken: cancelToken
|
|
592
647
|
};
|
|
593
|
-
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) {
|
|
594
655
|
return _this.processPlacesPUT(_response);
|
|
595
656
|
});
|
|
596
657
|
}
|
|
@@ -598,31 +659,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
598
659
|
{
|
|
599
660
|
key: "processPlacesPUT",
|
|
600
661
|
value: function processPlacesPUT(response) {
|
|
601
|
-
var _this = this;
|
|
602
662
|
var status = response.status;
|
|
603
663
|
var _headers = {};
|
|
604
|
-
if (response.headers && response.headers
|
|
605
|
-
response.headers
|
|
606
|
-
|
|
607
|
-
|
|
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
|
+
}
|
|
608
670
|
}
|
|
609
|
-
;
|
|
610
671
|
if (status === 200) {
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
672
|
+
var _responseText = response.data;
|
|
673
|
+
var result200 = null;
|
|
674
|
+
var resultData200 = _responseText;
|
|
675
|
+
result200 = JSON.parse(resultData200);
|
|
676
|
+
return Promise.resolve(result200);
|
|
616
677
|
} else if (status === 500) {
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
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);
|
|
622
683
|
} else if (status !== 200 && status !== 204) {
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
});
|
|
684
|
+
var _responseText2 = response.data;
|
|
685
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
626
686
|
}
|
|
627
687
|
return Promise.resolve(null);
|
|
628
688
|
}
|
|
@@ -631,17 +691,25 @@ var Client = /*#__PURE__*/ function() {
|
|
|
631
691
|
/**
|
|
632
692
|
* @return OK
|
|
633
693
|
*/ key: "placesAll",
|
|
634
|
-
value: function placesAll() {
|
|
694
|
+
value: function placesAll(cancelToken) {
|
|
635
695
|
var _this = this;
|
|
636
696
|
var url_ = this.baseUrl + "/api/places";
|
|
637
697
|
url_ = url_.replace(/[?&]$/, "");
|
|
638
698
|
var options_ = {
|
|
639
699
|
method: "GET",
|
|
700
|
+
url: url_,
|
|
640
701
|
headers: {
|
|
641
702
|
"Accept": "application/json"
|
|
642
|
-
}
|
|
703
|
+
},
|
|
704
|
+
cancelToken: cancelToken
|
|
643
705
|
};
|
|
644
|
-
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) {
|
|
645
713
|
return _this.processPlacesAll(_response);
|
|
646
714
|
});
|
|
647
715
|
}
|
|
@@ -649,31 +717,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
649
717
|
{
|
|
650
718
|
key: "processPlacesAll",
|
|
651
719
|
value: function processPlacesAll(response) {
|
|
652
|
-
var _this = this;
|
|
653
720
|
var status = response.status;
|
|
654
721
|
var _headers = {};
|
|
655
|
-
if (response.headers && response.headers
|
|
656
|
-
response.headers
|
|
657
|
-
|
|
658
|
-
|
|
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
|
+
}
|
|
659
728
|
}
|
|
660
|
-
;
|
|
661
729
|
if (status === 200) {
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
730
|
+
var _responseText = response.data;
|
|
731
|
+
var result200 = null;
|
|
732
|
+
var resultData200 = _responseText;
|
|
733
|
+
result200 = JSON.parse(resultData200);
|
|
734
|
+
return Promise.resolve(result200);
|
|
667
735
|
} else if (status === 500) {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
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);
|
|
673
741
|
} else if (status !== 200 && status !== 204) {
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
});
|
|
742
|
+
var _responseText2 = response.data;
|
|
743
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
677
744
|
}
|
|
678
745
|
return Promise.resolve(null);
|
|
679
746
|
}
|
|
@@ -683,20 +750,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
683
750
|
* @param body (optional)
|
|
684
751
|
* @return OK
|
|
685
752
|
*/ key: "plantsPOST",
|
|
686
|
-
value: function plantsPOST(body) {
|
|
753
|
+
value: function plantsPOST(body, cancelToken) {
|
|
687
754
|
var _this = this;
|
|
688
755
|
var url_ = this.baseUrl + "/api/plants";
|
|
689
756
|
url_ = url_.replace(/[?&]$/, "");
|
|
690
757
|
var content_ = JSON.stringify(body);
|
|
691
758
|
var options_ = {
|
|
692
|
-
|
|
759
|
+
data: content_,
|
|
693
760
|
method: "POST",
|
|
761
|
+
url: url_,
|
|
694
762
|
headers: {
|
|
695
763
|
"Content-Type": "application/json",
|
|
696
764
|
"Accept": "application/json"
|
|
697
|
-
}
|
|
765
|
+
},
|
|
766
|
+
cancelToken: cancelToken
|
|
698
767
|
};
|
|
699
|
-
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) {
|
|
700
775
|
return _this.processPlantsPOST(_response);
|
|
701
776
|
});
|
|
702
777
|
}
|
|
@@ -704,31 +779,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
704
779
|
{
|
|
705
780
|
key: "processPlantsPOST",
|
|
706
781
|
value: function processPlantsPOST(response) {
|
|
707
|
-
var _this = this;
|
|
708
782
|
var status = response.status;
|
|
709
783
|
var _headers = {};
|
|
710
|
-
if (response.headers && response.headers
|
|
711
|
-
response.headers
|
|
712
|
-
|
|
713
|
-
|
|
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
|
+
}
|
|
714
790
|
}
|
|
715
|
-
;
|
|
716
791
|
if (status === 200) {
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
792
|
+
var _responseText = response.data;
|
|
793
|
+
var result200 = null;
|
|
794
|
+
var resultData200 = _responseText;
|
|
795
|
+
result200 = JSON.parse(resultData200);
|
|
796
|
+
return Promise.resolve(result200);
|
|
722
797
|
} else if (status === 500) {
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
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);
|
|
728
803
|
} else if (status !== 200 && status !== 204) {
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
});
|
|
804
|
+
var _responseText2 = response.data;
|
|
805
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
732
806
|
}
|
|
733
807
|
return Promise.resolve(null);
|
|
734
808
|
}
|
|
@@ -738,7 +812,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
738
812
|
* @param id (optional)
|
|
739
813
|
* @return OK
|
|
740
814
|
*/ key: "plantsDELETE",
|
|
741
|
-
value: function plantsDELETE(id) {
|
|
815
|
+
value: function plantsDELETE(id, cancelToken) {
|
|
742
816
|
var _this = this;
|
|
743
817
|
var url_ = this.baseUrl + "/api/plants?";
|
|
744
818
|
if (id === null) throw new globalThis.Error("The parameter 'id' cannot be null.");
|
|
@@ -746,11 +820,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
746
820
|
url_ = url_.replace(/[?&]$/, "");
|
|
747
821
|
var options_ = {
|
|
748
822
|
method: "DELETE",
|
|
823
|
+
url: url_,
|
|
749
824
|
headers: {
|
|
750
825
|
"Accept": "application/json"
|
|
751
|
-
}
|
|
826
|
+
},
|
|
827
|
+
cancelToken: cancelToken
|
|
752
828
|
};
|
|
753
|
-
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) {
|
|
754
836
|
return _this.processPlantsDELETE(_response);
|
|
755
837
|
});
|
|
756
838
|
}
|
|
@@ -758,31 +840,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
758
840
|
{
|
|
759
841
|
key: "processPlantsDELETE",
|
|
760
842
|
value: function processPlantsDELETE(response) {
|
|
761
|
-
var _this = this;
|
|
762
843
|
var status = response.status;
|
|
763
844
|
var _headers = {};
|
|
764
|
-
if (response.headers && response.headers
|
|
765
|
-
response.headers
|
|
766
|
-
|
|
767
|
-
|
|
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
|
+
}
|
|
768
851
|
}
|
|
769
|
-
;
|
|
770
852
|
if (status === 200) {
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
853
|
+
var _responseText = response.data;
|
|
854
|
+
var result200 = null;
|
|
855
|
+
var resultData200 = _responseText;
|
|
856
|
+
result200 = JSON.parse(resultData200);
|
|
857
|
+
return Promise.resolve(result200);
|
|
776
858
|
} else if (status === 500) {
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
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);
|
|
782
864
|
} else if (status !== 200 && status !== 204) {
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
});
|
|
865
|
+
var _responseText2 = response.data;
|
|
866
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
786
867
|
}
|
|
787
868
|
return Promise.resolve(null);
|
|
788
869
|
}
|
|
@@ -792,20 +873,28 @@ var Client = /*#__PURE__*/ function() {
|
|
|
792
873
|
* @param body (optional)
|
|
793
874
|
* @return OK
|
|
794
875
|
*/ key: "plantsPUT",
|
|
795
|
-
value: function plantsPUT(body) {
|
|
876
|
+
value: function plantsPUT(body, cancelToken) {
|
|
796
877
|
var _this = this;
|
|
797
878
|
var url_ = this.baseUrl + "/api/plants";
|
|
798
879
|
url_ = url_.replace(/[?&]$/, "");
|
|
799
880
|
var content_ = JSON.stringify(body);
|
|
800
881
|
var options_ = {
|
|
801
|
-
|
|
882
|
+
data: content_,
|
|
802
883
|
method: "PUT",
|
|
884
|
+
url: url_,
|
|
803
885
|
headers: {
|
|
804
886
|
"Content-Type": "application/json",
|
|
805
887
|
"Accept": "application/json"
|
|
806
|
-
}
|
|
888
|
+
},
|
|
889
|
+
cancelToken: cancelToken
|
|
807
890
|
};
|
|
808
|
-
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) {
|
|
809
898
|
return _this.processPlantsPUT(_response);
|
|
810
899
|
});
|
|
811
900
|
}
|
|
@@ -813,31 +902,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
813
902
|
{
|
|
814
903
|
key: "processPlantsPUT",
|
|
815
904
|
value: function processPlantsPUT(response) {
|
|
816
|
-
var _this = this;
|
|
817
905
|
var status = response.status;
|
|
818
906
|
var _headers = {};
|
|
819
|
-
if (response.headers && response.headers
|
|
820
|
-
response.headers
|
|
821
|
-
|
|
822
|
-
|
|
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
|
+
}
|
|
823
913
|
}
|
|
824
|
-
;
|
|
825
914
|
if (status === 200) {
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
915
|
+
var _responseText = response.data;
|
|
916
|
+
var result200 = null;
|
|
917
|
+
var resultData200 = _responseText;
|
|
918
|
+
result200 = JSON.parse(resultData200);
|
|
919
|
+
return Promise.resolve(result200);
|
|
831
920
|
} else if (status === 500) {
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
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);
|
|
837
926
|
} else if (status !== 200 && status !== 204) {
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
});
|
|
927
|
+
var _responseText2 = response.data;
|
|
928
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
841
929
|
}
|
|
842
930
|
return Promise.resolve(null);
|
|
843
931
|
}
|
|
@@ -846,17 +934,25 @@ var Client = /*#__PURE__*/ function() {
|
|
|
846
934
|
/**
|
|
847
935
|
* @return OK
|
|
848
936
|
*/ key: "plantsAll",
|
|
849
|
-
value: function plantsAll() {
|
|
937
|
+
value: function plantsAll(cancelToken) {
|
|
850
938
|
var _this = this;
|
|
851
939
|
var url_ = this.baseUrl + "/api/plants";
|
|
852
940
|
url_ = url_.replace(/[?&]$/, "");
|
|
853
941
|
var options_ = {
|
|
854
942
|
method: "GET",
|
|
943
|
+
url: url_,
|
|
855
944
|
headers: {
|
|
856
945
|
"Accept": "application/json"
|
|
857
|
-
}
|
|
946
|
+
},
|
|
947
|
+
cancelToken: cancelToken
|
|
858
948
|
};
|
|
859
|
-
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) {
|
|
860
956
|
return _this.processPlantsAll(_response);
|
|
861
957
|
});
|
|
862
958
|
}
|
|
@@ -864,31 +960,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
864
960
|
{
|
|
865
961
|
key: "processPlantsAll",
|
|
866
962
|
value: function processPlantsAll(response) {
|
|
867
|
-
var _this = this;
|
|
868
963
|
var status = response.status;
|
|
869
964
|
var _headers = {};
|
|
870
|
-
if (response.headers && response.headers
|
|
871
|
-
response.headers
|
|
872
|
-
|
|
873
|
-
|
|
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
|
+
}
|
|
874
971
|
}
|
|
875
|
-
;
|
|
876
972
|
if (status === 200) {
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
973
|
+
var _responseText = response.data;
|
|
974
|
+
var result200 = null;
|
|
975
|
+
var resultData200 = _responseText;
|
|
976
|
+
result200 = JSON.parse(resultData200);
|
|
977
|
+
return Promise.resolve(result200);
|
|
882
978
|
} else if (status === 500) {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
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);
|
|
888
984
|
} else if (status !== 200 && status !== 204) {
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
});
|
|
985
|
+
var _responseText2 = response.data;
|
|
986
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
892
987
|
}
|
|
893
988
|
return Promise.resolve(null);
|
|
894
989
|
}
|
|
@@ -897,7 +992,7 @@ var Client = /*#__PURE__*/ function() {
|
|
|
897
992
|
/**
|
|
898
993
|
* @return OK
|
|
899
994
|
*/ key: "plantsGET",
|
|
900
|
-
value: function plantsGET(id) {
|
|
995
|
+
value: function plantsGET(id, cancelToken) {
|
|
901
996
|
var _this = this;
|
|
902
997
|
var url_ = this.baseUrl + "/api/plants/{id}";
|
|
903
998
|
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
@@ -905,11 +1000,19 @@ var Client = /*#__PURE__*/ function() {
|
|
|
905
1000
|
url_ = url_.replace(/[?&]$/, "");
|
|
906
1001
|
var options_ = {
|
|
907
1002
|
method: "GET",
|
|
1003
|
+
url: url_,
|
|
908
1004
|
headers: {
|
|
909
1005
|
"Accept": "application/json"
|
|
910
|
-
}
|
|
1006
|
+
},
|
|
1007
|
+
cancelToken: cancelToken
|
|
911
1008
|
};
|
|
912
|
-
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) {
|
|
913
1016
|
return _this.processPlantsGET(_response);
|
|
914
1017
|
});
|
|
915
1018
|
}
|
|
@@ -917,31 +1020,30 @@ var Client = /*#__PURE__*/ function() {
|
|
|
917
1020
|
{
|
|
918
1021
|
key: "processPlantsGET",
|
|
919
1022
|
value: function processPlantsGET(response) {
|
|
920
|
-
var _this = this;
|
|
921
1023
|
var status = response.status;
|
|
922
1024
|
var _headers = {};
|
|
923
|
-
if (response.headers && response.headers
|
|
924
|
-
response.headers
|
|
925
|
-
|
|
926
|
-
|
|
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
|
+
}
|
|
927
1031
|
}
|
|
928
|
-
;
|
|
929
1032
|
if (status === 200) {
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
1033
|
+
var _responseText = response.data;
|
|
1034
|
+
var result200 = null;
|
|
1035
|
+
var resultData200 = _responseText;
|
|
1036
|
+
result200 = JSON.parse(resultData200);
|
|
1037
|
+
return Promise.resolve(result200);
|
|
935
1038
|
} else if (status === 500) {
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
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);
|
|
941
1044
|
} else if (status !== 200 && status !== 204) {
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
});
|
|
1045
|
+
var _responseText2 = response.data;
|
|
1046
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
945
1047
|
}
|
|
946
1048
|
return Promise.resolve(null);
|
|
947
1049
|
}
|
|
@@ -1151,4 +1253,7 @@ function throwException(message, status, response, headers, result) {
|
|
|
1151
1253
|
if (result !== null && result !== void 0) throw result;
|
|
1152
1254
|
else throw new ApiException(message, status, response, headers, null);
|
|
1153
1255
|
}
|
|
1256
|
+
function isAxiosError(obj) {
|
|
1257
|
+
return obj && obj.isAxiosError === true;
|
|
1258
|
+
}
|
|
1154
1259
|
export { ApiException, CallingConventions, Client, EventAttributes, FieldAttributes, GenericParameterAttributes, LayoutKind, MemberTypes, MethodAttributes, MethodImplAttributes, ParameterAttributes, PlantType, PropertyAttributes, SecurityRuleSet, TypeAttributes };
|