@arekstasko/plantcare-api-client 1.2.0 → 1.2.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 +139 -1
- package/dist/index.d.cts +31 -3
- package/dist/index.d.ts +31 -3
- package/dist/index.js +136 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -197,6 +197,9 @@ __export(index_exports, {
|
|
|
197
197
|
GenericParameterAttributes: function() {
|
|
198
198
|
return GenericParameterAttributes;
|
|
199
199
|
},
|
|
200
|
+
HumidityStatus: function() {
|
|
201
|
+
return HumidityStatus;
|
|
202
|
+
},
|
|
200
203
|
LayoutKind: function() {
|
|
201
204
|
return LayoutKind;
|
|
202
205
|
},
|
|
@@ -915,6 +918,66 @@ var Client = /*#__PURE__*/ function() {
|
|
|
915
918
|
},
|
|
916
919
|
{
|
|
917
920
|
/**
|
|
921
|
+
* @return OK
|
|
922
|
+
*/ key: "humidityStatus",
|
|
923
|
+
value: function humidityStatus(id, cancelToken) {
|
|
924
|
+
var _this = this;
|
|
925
|
+
var url_ = this.baseUrl + "/api/places/{id}/plants/humidity-status";
|
|
926
|
+
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
927
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
928
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
929
|
+
var options_ = {
|
|
930
|
+
method: "GET",
|
|
931
|
+
url: url_,
|
|
932
|
+
headers: {
|
|
933
|
+
"Accept": "application/json"
|
|
934
|
+
},
|
|
935
|
+
cancelToken: cancelToken
|
|
936
|
+
};
|
|
937
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
938
|
+
if (isAxiosError(_error) && _error.response) {
|
|
939
|
+
return _error.response;
|
|
940
|
+
} else {
|
|
941
|
+
throw _error;
|
|
942
|
+
}
|
|
943
|
+
}).then(function(_response) {
|
|
944
|
+
return _this.processHumidityStatus(_response);
|
|
945
|
+
});
|
|
946
|
+
}
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
key: "processHumidityStatus",
|
|
950
|
+
value: function processHumidityStatus(response) {
|
|
951
|
+
var status = response.status;
|
|
952
|
+
var _headers = {};
|
|
953
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
954
|
+
for(var k in response.headers){
|
|
955
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
956
|
+
_headers[k] = response.headers[k];
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
if (status === 200) {
|
|
961
|
+
var _responseText = response.data;
|
|
962
|
+
var result200 = null;
|
|
963
|
+
var resultData200 = _responseText;
|
|
964
|
+
result200 = JSON.parse(resultData200);
|
|
965
|
+
return Promise.resolve(result200);
|
|
966
|
+
} else if (status === 500) {
|
|
967
|
+
var _responseText1 = response.data;
|
|
968
|
+
var result500 = null;
|
|
969
|
+
var resultData500 = _responseText1;
|
|
970
|
+
result500 = JSON.parse(resultData500);
|
|
971
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
972
|
+
} else if (status !== 200 && status !== 204) {
|
|
973
|
+
var _responseText2 = response.data;
|
|
974
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
975
|
+
}
|
|
976
|
+
return Promise.resolve(null);
|
|
977
|
+
}
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
/**
|
|
918
981
|
* @param body (optional)
|
|
919
982
|
* @return OK
|
|
920
983
|
*/ key: "plantsPOST",
|
|
@@ -1158,6 +1221,73 @@ var Client = /*#__PURE__*/ function() {
|
|
|
1158
1221
|
},
|
|
1159
1222
|
{
|
|
1160
1223
|
/**
|
|
1224
|
+
* @param idQuery (optional)
|
|
1225
|
+
* @param body (optional)
|
|
1226
|
+
* @return OK
|
|
1227
|
+
*/ key: "setHumidityValues",
|
|
1228
|
+
value: function setHumidityValues(idQuery, idPath, body, cancelToken) {
|
|
1229
|
+
var _this = this;
|
|
1230
|
+
var url_ = this.baseUrl + "/api/plants/{id}/set-humidity-values?";
|
|
1231
|
+
if (idPath === void 0 || idPath === null) throw new globalThis.Error("The parameter 'idPath' must be defined.");
|
|
1232
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + idPath));
|
|
1233
|
+
if (idQuery === null) throw new globalThis.Error("The parameter 'idQuery' cannot be null.");
|
|
1234
|
+
else if (idQuery !== void 0) url_ += "id=" + encodeURIComponent("" + idQuery) + "&";
|
|
1235
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1236
|
+
var content_ = JSON.stringify(body);
|
|
1237
|
+
var options_ = {
|
|
1238
|
+
data: content_,
|
|
1239
|
+
method: "PUT",
|
|
1240
|
+
url: url_,
|
|
1241
|
+
headers: {
|
|
1242
|
+
"Content-Type": "application/json",
|
|
1243
|
+
"Accept": "application/json"
|
|
1244
|
+
},
|
|
1245
|
+
cancelToken: cancelToken
|
|
1246
|
+
};
|
|
1247
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
1248
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1249
|
+
return _error.response;
|
|
1250
|
+
} else {
|
|
1251
|
+
throw _error;
|
|
1252
|
+
}
|
|
1253
|
+
}).then(function(_response) {
|
|
1254
|
+
return _this.processSetHumidityValues(_response);
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
},
|
|
1258
|
+
{
|
|
1259
|
+
key: "processSetHumidityValues",
|
|
1260
|
+
value: function processSetHumidityValues(response) {
|
|
1261
|
+
var status = response.status;
|
|
1262
|
+
var _headers = {};
|
|
1263
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
1264
|
+
for(var k in response.headers){
|
|
1265
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1266
|
+
_headers[k] = response.headers[k];
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
if (status === 200) {
|
|
1271
|
+
var _responseText = response.data;
|
|
1272
|
+
var result200 = null;
|
|
1273
|
+
var resultData200 = _responseText;
|
|
1274
|
+
result200 = JSON.parse(resultData200);
|
|
1275
|
+
return Promise.resolve(result200);
|
|
1276
|
+
} else if (status === 500) {
|
|
1277
|
+
var _responseText1 = response.data;
|
|
1278
|
+
var result500 = null;
|
|
1279
|
+
var resultData500 = _responseText1;
|
|
1280
|
+
result500 = JSON.parse(resultData500);
|
|
1281
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
1282
|
+
} else if (status !== 200 && status !== 204) {
|
|
1283
|
+
var _responseText2 = response.data;
|
|
1284
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
1285
|
+
}
|
|
1286
|
+
return Promise.resolve(null);
|
|
1287
|
+
}
|
|
1288
|
+
},
|
|
1289
|
+
{
|
|
1290
|
+
/**
|
|
1161
1291
|
* @return OK
|
|
1162
1292
|
*/ key: "plantsGET",
|
|
1163
1293
|
value: function plantsGET(id, cancelToken) {
|
|
@@ -1219,10 +1349,17 @@ var Client = /*#__PURE__*/ function() {
|
|
|
1219
1349
|
]);
|
|
1220
1350
|
return Client;
|
|
1221
1351
|
}();
|
|
1352
|
+
var HumidityStatus = /* @__PURE__ */ function(HumidityStatus2) {
|
|
1353
|
+
HumidityStatus2[HumidityStatus2["_1"] = 1] = "_1";
|
|
1354
|
+
HumidityStatus2[HumidityStatus2["_2"] = 2] = "_2";
|
|
1355
|
+
HumidityStatus2[HumidityStatus2["_3"] = 3] = "_3";
|
|
1356
|
+
HumidityStatus2[HumidityStatus2["_4"] = 4] = "_4";
|
|
1357
|
+
return HumidityStatus2;
|
|
1358
|
+
}(HumidityStatus || {});
|
|
1222
1359
|
var PlantType = /* @__PURE__ */ function(PlantType2) {
|
|
1223
|
-
PlantType2[PlantType2["_0"] = 0] = "_0";
|
|
1224
1360
|
PlantType2[PlantType2["_1"] = 1] = "_1";
|
|
1225
1361
|
PlantType2[PlantType2["_2"] = 2] = "_2";
|
|
1362
|
+
PlantType2[PlantType2["_3"] = 3] = "_3";
|
|
1226
1363
|
return PlantType2;
|
|
1227
1364
|
}(PlantType || {});
|
|
1228
1365
|
var CallingConventions = /* @__PURE__ */ function(CallingConventions2) {
|
|
@@ -1431,6 +1568,7 @@ function isAxiosError(obj) {
|
|
|
1431
1568
|
EventAttributes: EventAttributes,
|
|
1432
1569
|
FieldAttributes: FieldAttributes,
|
|
1433
1570
|
GenericParameterAttributes: GenericParameterAttributes,
|
|
1571
|
+
HumidityStatus: HumidityStatus,
|
|
1434
1572
|
LayoutKind: LayoutKind,
|
|
1435
1573
|
MemberTypes: MemberTypes,
|
|
1436
1574
|
MethodAttributes: MethodAttributes,
|
package/dist/index.d.cts
CHANGED
|
@@ -69,6 +69,11 @@ declare class Client {
|
|
|
69
69
|
*/
|
|
70
70
|
placesAll(cancelToken?: CancelToken): Promise<Place[]>;
|
|
71
71
|
protected processPlacesAll(response: AxiosResponse): Promise<Place[]>;
|
|
72
|
+
/**
|
|
73
|
+
* @return OK
|
|
74
|
+
*/
|
|
75
|
+
humidityStatus(id: number, cancelToken?: CancelToken): Promise<PlantHumidityStatus[]>;
|
|
76
|
+
protected processHumidityStatus(response: AxiosResponse): Promise<PlantHumidityStatus[]>;
|
|
72
77
|
/**
|
|
73
78
|
* @param body (optional)
|
|
74
79
|
* @return OK
|
|
@@ -92,6 +97,13 @@ declare class Client {
|
|
|
92
97
|
*/
|
|
93
98
|
plantsAll(cancelToken?: CancelToken): Promise<Plant[]>;
|
|
94
99
|
protected processPlantsAll(response: AxiosResponse): Promise<Plant[]>;
|
|
100
|
+
/**
|
|
101
|
+
* @param idQuery (optional)
|
|
102
|
+
* @param body (optional)
|
|
103
|
+
* @return OK
|
|
104
|
+
*/
|
|
105
|
+
setHumidityValues(idQuery: number | undefined, idPath: string, body: UpdatePlantHumidityValues | undefined, cancelToken?: CancelToken): Promise<boolean>;
|
|
106
|
+
protected processSetHumidityValues(response: AxiosResponse): Promise<boolean>;
|
|
95
107
|
/**
|
|
96
108
|
* @return OK
|
|
97
109
|
*/
|
|
@@ -131,6 +143,12 @@ interface UpdatePlantCommand {
|
|
|
131
143
|
type?: PlantType;
|
|
132
144
|
moduleId?: number | undefined;
|
|
133
145
|
}
|
|
146
|
+
interface UpdatePlantHumidityValues {
|
|
147
|
+
userId?: number;
|
|
148
|
+
plantId?: number;
|
|
149
|
+
minHumidity?: number;
|
|
150
|
+
maxHumidity?: number;
|
|
151
|
+
}
|
|
134
152
|
interface AverageHumidity {
|
|
135
153
|
date?: string | undefined;
|
|
136
154
|
humidity?: number;
|
|
@@ -138,16 +156,26 @@ interface AverageHumidity {
|
|
|
138
156
|
interface CreateModuleRequest {
|
|
139
157
|
name?: string | undefined;
|
|
140
158
|
}
|
|
159
|
+
declare enum HumidityStatus {
|
|
160
|
+
_1 = 1,
|
|
161
|
+
_2 = 2,
|
|
162
|
+
_3 = 3,
|
|
163
|
+
_4 = 4
|
|
164
|
+
}
|
|
141
165
|
declare enum PlantType {
|
|
142
|
-
_0 = 0,
|
|
143
166
|
_1 = 1,
|
|
144
|
-
_2 = 2
|
|
167
|
+
_2 = 2,
|
|
168
|
+
_3 = 3
|
|
145
169
|
}
|
|
146
170
|
interface HumidityMeasurement {
|
|
147
171
|
humidity?: number;
|
|
148
172
|
batteryLevel?: number;
|
|
149
173
|
date?: Date;
|
|
150
174
|
}
|
|
175
|
+
interface PlantHumidityStatus {
|
|
176
|
+
plantId?: number;
|
|
177
|
+
status?: HumidityStatus;
|
|
178
|
+
}
|
|
151
179
|
interface Module {
|
|
152
180
|
id?: number;
|
|
153
181
|
isAvailable?: boolean;
|
|
@@ -769,4 +797,4 @@ declare class ApiException extends Error {
|
|
|
769
797
|
static isApiException(obj: any): obj is ApiException;
|
|
770
798
|
}
|
|
771
799
|
|
|
772
|
-
export { type AddHumidityMeasurementCommand, ApiException, type Assembly, type AverageHumidity, CallingConventions, Client, type ConstructorInfo, type CreateModuleRequest, type CreatePlaceCommand, type CreatePlantCommand, type CustomAttributeData, type CustomAttributeNamedArgument, type CustomAttributeTypedArgument, EventAttributes, type EventInfo, type Exception, FieldAttributes, type FieldInfo, GenericParameterAttributes, type HumidityMeasurement, type ICustomAttributeProvider, type IntPtr, LayoutKind, type MemberInfo, MemberTypes, MethodAttributes, type MethodBase, MethodImplAttributes, type MethodInfo, type Module, type Module2, type ModuleHandle, ParameterAttributes, type ParameterInfo, type Place, type Plant, PlantType, PropertyAttributes, type PropertyInfo, type RuntimeFieldHandle, type RuntimeMethodHandle, type RuntimeTypeHandle, SecurityRuleSet, type StructLayoutAttribute, type Type, TypeAttributes, type TypeInfo, type UpdatePlaceCommand, type UpdatePlantCommand };
|
|
800
|
+
export { type AddHumidityMeasurementCommand, ApiException, type Assembly, type AverageHumidity, CallingConventions, Client, type ConstructorInfo, type CreateModuleRequest, type CreatePlaceCommand, type CreatePlantCommand, type CustomAttributeData, type CustomAttributeNamedArgument, type CustomAttributeTypedArgument, EventAttributes, type EventInfo, type Exception, FieldAttributes, type FieldInfo, GenericParameterAttributes, type HumidityMeasurement, HumidityStatus, type ICustomAttributeProvider, type IntPtr, LayoutKind, type MemberInfo, MemberTypes, MethodAttributes, type MethodBase, MethodImplAttributes, type MethodInfo, type Module, type Module2, type ModuleHandle, ParameterAttributes, type ParameterInfo, type Place, type Plant, type PlantHumidityStatus, PlantType, PropertyAttributes, type PropertyInfo, type RuntimeFieldHandle, type RuntimeMethodHandle, type RuntimeTypeHandle, SecurityRuleSet, type StructLayoutAttribute, type Type, TypeAttributes, type TypeInfo, type UpdatePlaceCommand, type UpdatePlantCommand, type UpdatePlantHumidityValues };
|
package/dist/index.d.ts
CHANGED
|
@@ -69,6 +69,11 @@ declare class Client {
|
|
|
69
69
|
*/
|
|
70
70
|
placesAll(cancelToken?: CancelToken): Promise<Place[]>;
|
|
71
71
|
protected processPlacesAll(response: AxiosResponse): Promise<Place[]>;
|
|
72
|
+
/**
|
|
73
|
+
* @return OK
|
|
74
|
+
*/
|
|
75
|
+
humidityStatus(id: number, cancelToken?: CancelToken): Promise<PlantHumidityStatus[]>;
|
|
76
|
+
protected processHumidityStatus(response: AxiosResponse): Promise<PlantHumidityStatus[]>;
|
|
72
77
|
/**
|
|
73
78
|
* @param body (optional)
|
|
74
79
|
* @return OK
|
|
@@ -92,6 +97,13 @@ declare class Client {
|
|
|
92
97
|
*/
|
|
93
98
|
plantsAll(cancelToken?: CancelToken): Promise<Plant[]>;
|
|
94
99
|
protected processPlantsAll(response: AxiosResponse): Promise<Plant[]>;
|
|
100
|
+
/**
|
|
101
|
+
* @param idQuery (optional)
|
|
102
|
+
* @param body (optional)
|
|
103
|
+
* @return OK
|
|
104
|
+
*/
|
|
105
|
+
setHumidityValues(idQuery: number | undefined, idPath: string, body: UpdatePlantHumidityValues | undefined, cancelToken?: CancelToken): Promise<boolean>;
|
|
106
|
+
protected processSetHumidityValues(response: AxiosResponse): Promise<boolean>;
|
|
95
107
|
/**
|
|
96
108
|
* @return OK
|
|
97
109
|
*/
|
|
@@ -131,6 +143,12 @@ interface UpdatePlantCommand {
|
|
|
131
143
|
type?: PlantType;
|
|
132
144
|
moduleId?: number | undefined;
|
|
133
145
|
}
|
|
146
|
+
interface UpdatePlantHumidityValues {
|
|
147
|
+
userId?: number;
|
|
148
|
+
plantId?: number;
|
|
149
|
+
minHumidity?: number;
|
|
150
|
+
maxHumidity?: number;
|
|
151
|
+
}
|
|
134
152
|
interface AverageHumidity {
|
|
135
153
|
date?: string | undefined;
|
|
136
154
|
humidity?: number;
|
|
@@ -138,16 +156,26 @@ interface AverageHumidity {
|
|
|
138
156
|
interface CreateModuleRequest {
|
|
139
157
|
name?: string | undefined;
|
|
140
158
|
}
|
|
159
|
+
declare enum HumidityStatus {
|
|
160
|
+
_1 = 1,
|
|
161
|
+
_2 = 2,
|
|
162
|
+
_3 = 3,
|
|
163
|
+
_4 = 4
|
|
164
|
+
}
|
|
141
165
|
declare enum PlantType {
|
|
142
|
-
_0 = 0,
|
|
143
166
|
_1 = 1,
|
|
144
|
-
_2 = 2
|
|
167
|
+
_2 = 2,
|
|
168
|
+
_3 = 3
|
|
145
169
|
}
|
|
146
170
|
interface HumidityMeasurement {
|
|
147
171
|
humidity?: number;
|
|
148
172
|
batteryLevel?: number;
|
|
149
173
|
date?: Date;
|
|
150
174
|
}
|
|
175
|
+
interface PlantHumidityStatus {
|
|
176
|
+
plantId?: number;
|
|
177
|
+
status?: HumidityStatus;
|
|
178
|
+
}
|
|
151
179
|
interface Module {
|
|
152
180
|
id?: number;
|
|
153
181
|
isAvailable?: boolean;
|
|
@@ -769,4 +797,4 @@ declare class ApiException extends Error {
|
|
|
769
797
|
static isApiException(obj: any): obj is ApiException;
|
|
770
798
|
}
|
|
771
799
|
|
|
772
|
-
export { type AddHumidityMeasurementCommand, ApiException, type Assembly, type AverageHumidity, CallingConventions, Client, type ConstructorInfo, type CreateModuleRequest, type CreatePlaceCommand, type CreatePlantCommand, type CustomAttributeData, type CustomAttributeNamedArgument, type CustomAttributeTypedArgument, EventAttributes, type EventInfo, type Exception, FieldAttributes, type FieldInfo, GenericParameterAttributes, type HumidityMeasurement, type ICustomAttributeProvider, type IntPtr, LayoutKind, type MemberInfo, MemberTypes, MethodAttributes, type MethodBase, MethodImplAttributes, type MethodInfo, type Module, type Module2, type ModuleHandle, ParameterAttributes, type ParameterInfo, type Place, type Plant, PlantType, PropertyAttributes, type PropertyInfo, type RuntimeFieldHandle, type RuntimeMethodHandle, type RuntimeTypeHandle, SecurityRuleSet, type StructLayoutAttribute, type Type, TypeAttributes, type TypeInfo, type UpdatePlaceCommand, type UpdatePlantCommand };
|
|
800
|
+
export { type AddHumidityMeasurementCommand, ApiException, type Assembly, type AverageHumidity, CallingConventions, Client, type ConstructorInfo, type CreateModuleRequest, type CreatePlaceCommand, type CreatePlantCommand, type CustomAttributeData, type CustomAttributeNamedArgument, type CustomAttributeTypedArgument, EventAttributes, type EventInfo, type Exception, FieldAttributes, type FieldInfo, GenericParameterAttributes, type HumidityMeasurement, HumidityStatus, type ICustomAttributeProvider, type IntPtr, LayoutKind, type MemberInfo, MemberTypes, MethodAttributes, type MethodBase, MethodImplAttributes, type MethodInfo, type Module, type Module2, type ModuleHandle, ParameterAttributes, type ParameterInfo, type Place, type Plant, type PlantHumidityStatus, PlantType, PropertyAttributes, type PropertyInfo, type RuntimeFieldHandle, type RuntimeMethodHandle, type RuntimeTypeHandle, SecurityRuleSet, type StructLayoutAttribute, type Type, TypeAttributes, type TypeInfo, type UpdatePlaceCommand, type UpdatePlantCommand, type UpdatePlantHumidityValues };
|
package/dist/index.js
CHANGED
|
@@ -807,6 +807,66 @@ var Client = /*#__PURE__*/ function() {
|
|
|
807
807
|
},
|
|
808
808
|
{
|
|
809
809
|
/**
|
|
810
|
+
* @return OK
|
|
811
|
+
*/ key: "humidityStatus",
|
|
812
|
+
value: function humidityStatus(id, cancelToken) {
|
|
813
|
+
var _this = this;
|
|
814
|
+
var url_ = this.baseUrl + "/api/places/{id}/plants/humidity-status";
|
|
815
|
+
if (id === void 0 || id === null) throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
816
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
817
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
818
|
+
var options_ = {
|
|
819
|
+
method: "GET",
|
|
820
|
+
url: url_,
|
|
821
|
+
headers: {
|
|
822
|
+
"Accept": "application/json"
|
|
823
|
+
},
|
|
824
|
+
cancelToken: cancelToken
|
|
825
|
+
};
|
|
826
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
827
|
+
if (isAxiosError(_error) && _error.response) {
|
|
828
|
+
return _error.response;
|
|
829
|
+
} else {
|
|
830
|
+
throw _error;
|
|
831
|
+
}
|
|
832
|
+
}).then(function(_response) {
|
|
833
|
+
return _this.processHumidityStatus(_response);
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
key: "processHumidityStatus",
|
|
839
|
+
value: function processHumidityStatus(response) {
|
|
840
|
+
var status = response.status;
|
|
841
|
+
var _headers = {};
|
|
842
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
843
|
+
for(var k in response.headers){
|
|
844
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
845
|
+
_headers[k] = response.headers[k];
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
if (status === 200) {
|
|
850
|
+
var _responseText = response.data;
|
|
851
|
+
var result200 = null;
|
|
852
|
+
var resultData200 = _responseText;
|
|
853
|
+
result200 = JSON.parse(resultData200);
|
|
854
|
+
return Promise.resolve(result200);
|
|
855
|
+
} else if (status === 500) {
|
|
856
|
+
var _responseText1 = response.data;
|
|
857
|
+
var result500 = null;
|
|
858
|
+
var resultData500 = _responseText1;
|
|
859
|
+
result500 = JSON.parse(resultData500);
|
|
860
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
861
|
+
} else if (status !== 200 && status !== 204) {
|
|
862
|
+
var _responseText2 = response.data;
|
|
863
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
864
|
+
}
|
|
865
|
+
return Promise.resolve(null);
|
|
866
|
+
}
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
/**
|
|
810
870
|
* @param body (optional)
|
|
811
871
|
* @return OK
|
|
812
872
|
*/ key: "plantsPOST",
|
|
@@ -1050,6 +1110,73 @@ var Client = /*#__PURE__*/ function() {
|
|
|
1050
1110
|
},
|
|
1051
1111
|
{
|
|
1052
1112
|
/**
|
|
1113
|
+
* @param idQuery (optional)
|
|
1114
|
+
* @param body (optional)
|
|
1115
|
+
* @return OK
|
|
1116
|
+
*/ key: "setHumidityValues",
|
|
1117
|
+
value: function setHumidityValues(idQuery, idPath, body, cancelToken) {
|
|
1118
|
+
var _this = this;
|
|
1119
|
+
var url_ = this.baseUrl + "/api/plants/{id}/set-humidity-values?";
|
|
1120
|
+
if (idPath === void 0 || idPath === null) throw new globalThis.Error("The parameter 'idPath' must be defined.");
|
|
1121
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + idPath));
|
|
1122
|
+
if (idQuery === null) throw new globalThis.Error("The parameter 'idQuery' cannot be null.");
|
|
1123
|
+
else if (idQuery !== void 0) url_ += "id=" + encodeURIComponent("" + idQuery) + "&";
|
|
1124
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1125
|
+
var content_ = JSON.stringify(body);
|
|
1126
|
+
var options_ = {
|
|
1127
|
+
data: content_,
|
|
1128
|
+
method: "PUT",
|
|
1129
|
+
url: url_,
|
|
1130
|
+
headers: {
|
|
1131
|
+
"Content-Type": "application/json",
|
|
1132
|
+
"Accept": "application/json"
|
|
1133
|
+
},
|
|
1134
|
+
cancelToken: cancelToken
|
|
1135
|
+
};
|
|
1136
|
+
return this.instance.request(options_).catch(function(_error) {
|
|
1137
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1138
|
+
return _error.response;
|
|
1139
|
+
} else {
|
|
1140
|
+
throw _error;
|
|
1141
|
+
}
|
|
1142
|
+
}).then(function(_response) {
|
|
1143
|
+
return _this.processSetHumidityValues(_response);
|
|
1144
|
+
});
|
|
1145
|
+
}
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
key: "processSetHumidityValues",
|
|
1149
|
+
value: function processSetHumidityValues(response) {
|
|
1150
|
+
var status = response.status;
|
|
1151
|
+
var _headers = {};
|
|
1152
|
+
if (response.headers && _type_of(response.headers) === "object") {
|
|
1153
|
+
for(var k in response.headers){
|
|
1154
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1155
|
+
_headers[k] = response.headers[k];
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
if (status === 200) {
|
|
1160
|
+
var _responseText = response.data;
|
|
1161
|
+
var result200 = null;
|
|
1162
|
+
var resultData200 = _responseText;
|
|
1163
|
+
result200 = JSON.parse(resultData200);
|
|
1164
|
+
return Promise.resolve(result200);
|
|
1165
|
+
} else if (status === 500) {
|
|
1166
|
+
var _responseText1 = response.data;
|
|
1167
|
+
var result500 = null;
|
|
1168
|
+
var resultData500 = _responseText1;
|
|
1169
|
+
result500 = JSON.parse(resultData500);
|
|
1170
|
+
return throwException("Internal Server Error", status, _responseText1, _headers, result500);
|
|
1171
|
+
} else if (status !== 200 && status !== 204) {
|
|
1172
|
+
var _responseText2 = response.data;
|
|
1173
|
+
return throwException("An unexpected server error occurred.", status, _responseText2, _headers);
|
|
1174
|
+
}
|
|
1175
|
+
return Promise.resolve(null);
|
|
1176
|
+
}
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
/**
|
|
1053
1180
|
* @return OK
|
|
1054
1181
|
*/ key: "plantsGET",
|
|
1055
1182
|
value: function plantsGET(id, cancelToken) {
|
|
@@ -1111,10 +1238,17 @@ var Client = /*#__PURE__*/ function() {
|
|
|
1111
1238
|
]);
|
|
1112
1239
|
return Client;
|
|
1113
1240
|
}();
|
|
1241
|
+
var HumidityStatus = /* @__PURE__ */ function(HumidityStatus2) {
|
|
1242
|
+
HumidityStatus2[HumidityStatus2["_1"] = 1] = "_1";
|
|
1243
|
+
HumidityStatus2[HumidityStatus2["_2"] = 2] = "_2";
|
|
1244
|
+
HumidityStatus2[HumidityStatus2["_3"] = 3] = "_3";
|
|
1245
|
+
HumidityStatus2[HumidityStatus2["_4"] = 4] = "_4";
|
|
1246
|
+
return HumidityStatus2;
|
|
1247
|
+
}(HumidityStatus || {});
|
|
1114
1248
|
var PlantType = /* @__PURE__ */ function(PlantType2) {
|
|
1115
|
-
PlantType2[PlantType2["_0"] = 0] = "_0";
|
|
1116
1249
|
PlantType2[PlantType2["_1"] = 1] = "_1";
|
|
1117
1250
|
PlantType2[PlantType2["_2"] = 2] = "_2";
|
|
1251
|
+
PlantType2[PlantType2["_3"] = 3] = "_3";
|
|
1118
1252
|
return PlantType2;
|
|
1119
1253
|
}(PlantType || {});
|
|
1120
1254
|
var CallingConventions = /* @__PURE__ */ function(CallingConventions2) {
|
|
@@ -1316,4 +1450,4 @@ function throwException(message, status, response, headers, result) {
|
|
|
1316
1450
|
function isAxiosError(obj) {
|
|
1317
1451
|
return obj && obj.isAxiosError === true;
|
|
1318
1452
|
}
|
|
1319
|
-
export { ApiException, CallingConventions, Client, EventAttributes, FieldAttributes, GenericParameterAttributes, LayoutKind, MemberTypes, MethodAttributes, MethodImplAttributes, ParameterAttributes, PlantType, PropertyAttributes, SecurityRuleSet, TypeAttributes };
|
|
1453
|
+
export { ApiException, CallingConventions, Client, EventAttributes, FieldAttributes, GenericParameterAttributes, HumidityStatus, LayoutKind, MemberTypes, MethodAttributes, MethodImplAttributes, ParameterAttributes, PlantType, PropertyAttributes, SecurityRuleSet, TypeAttributes };
|