@arekstasko/plantcare-api-client 1.0.2 → 1.0.4

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 CHANGED
@@ -342,61 +342,6 @@ var Client = /*#__PURE__*/ function() {
342
342
  /**
343
343
  * @param body (optional)
344
344
  * @return OK
345
- */ key: "status",
346
- value: function status(body) {
347
- var _this = this;
348
- var url_ = this.baseUrl + "/status";
349
- url_ = url_.replace(/[?&]$/, "");
350
- var content_ = JSON.stringify(body);
351
- var options_ = {
352
- body: content_,
353
- method: "POST",
354
- headers: {
355
- "Content-Type": "application/json",
356
- "Accept": "application/json"
357
- }
358
- };
359
- return this.http.fetch(url_, options_).then(function(_response) {
360
- return _this.processStatus(_response);
361
- });
362
- }
363
- },
364
- {
365
- key: "processStatus",
366
- value: function processStatus(response) {
367
- var _this = this;
368
- var status = response.status;
369
- var _headers = {};
370
- if (response.headers && response.headers.forEach) {
371
- response.headers.forEach(function(v, k) {
372
- return _headers[k] = v;
373
- });
374
- }
375
- ;
376
- if (status === 200) {
377
- return response.text().then(function(_responseText) {
378
- var result200 = null;
379
- result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
380
- return result200;
381
- });
382
- } else if (status === 500) {
383
- return response.text().then(function(_responseText) {
384
- var result500 = null;
385
- result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
386
- return throwException("Internal Server Error", status, _responseText, _headers, result500);
387
- });
388
- } else if (status !== 200 && status !== 204) {
389
- return response.text().then(function(_responseText) {
390
- return throwException("An unexpected server error occurred.", status, _responseText, _headers);
391
- });
392
- }
393
- return Promise.resolve(null);
394
- }
395
- },
396
- {
397
- /**
398
- * @param body (optional)
399
- * @return OK
400
345
  */ key: "modules",
401
346
  value: function modules(body) {
402
347
  var _this = this;
package/dist/index.d.cts CHANGED
@@ -11,11 +11,6 @@ interface IClient {
11
11
  * @return OK
12
12
  */
13
13
  humidityMeasurementsAll(id?: number | undefined, fromDate?: Date | undefined, toDate?: Date | undefined): Promise<IHumidityMeasurement[]>;
14
- /**
15
- * @param body (optional)
16
- * @return OK
17
- */
18
- status(body?: SetModuleStatusCommand | undefined): Promise<boolean>;
19
14
  /**
20
15
  * @param body (optional)
21
16
  * @return OK
@@ -89,12 +84,6 @@ declare class Client implements IClient {
89
84
  */
90
85
  humidityMeasurementsAll(id?: number | undefined, fromDate?: Date | undefined, toDate?: Date | undefined): Promise<IHumidityMeasurement[]>;
91
86
  protected processHumidityMeasurementsAll(response: Response): Promise<IHumidityMeasurement[]>;
92
- /**
93
- * @param body (optional)
94
- * @return OK
95
- */
96
- status(body?: SetModuleStatusCommand | undefined): Promise<boolean>;
97
- protected processStatus(response: Response): Promise<boolean>;
98
87
  /**
99
88
  * @param body (optional)
100
89
  * @return OK
@@ -608,11 +597,6 @@ declare enum SecurityRuleSet {
608
597
  _1 = 1,
609
598
  _2 = 2
610
599
  }
611
- interface SetModuleStatusCommand {
612
- userId?: number | undefined;
613
- moduleId?: number;
614
- status?: boolean;
615
- }
616
600
  interface StructLayoutAttribute {
617
601
  readonly typeId?: any | undefined;
618
602
  value?: LayoutKind;
@@ -833,4 +817,4 @@ declare class ApiException extends Error {
833
817
  static isApiException(obj: any): obj is ApiException;
834
818
  }
835
819
 
836
- export { type AddHumidityMeasurementCommand, ApiException, type Assembly, CallingConventions, Client, type ConstructorInfo, type CreateModuleCommand, type CreatePlaceCommand, type CreatePlantCommand, type CustomAttributeData, type CustomAttributeNamedArgument, type CustomAttributeTypedArgument, EventAttributes, type EventInfo, type Exception, FieldAttributes, type FieldInfo, GenericParameterAttributes, type GetPlacesResponse, type GetPlantResponse, type IClient, type ICustomAttributeProvider, type IHumidityMeasurement, type IPlant, type IntPtr, LayoutKind, type MemberInfo, MemberTypes, MethodAttributes, type MethodBase, MethodImplAttributes, type MethodInfo, type Module, type ModuleHandle, ParameterAttributes, type ParameterInfo, PlantType, PropertyAttributes, type PropertyInfo, type RuntimeFieldHandle, type RuntimeMethodHandle, type RuntimeTypeHandle, SecurityRuleSet, type SetModuleStatusCommand, type StructLayoutAttribute, type Type, TypeAttributes, type TypeInfo, type UpdatePlaceCommand, type UpdatePlantCommand };
820
+ export { type AddHumidityMeasurementCommand, ApiException, type Assembly, CallingConventions, Client, type ConstructorInfo, type CreateModuleCommand, type CreatePlaceCommand, type CreatePlantCommand, type CustomAttributeData, type CustomAttributeNamedArgument, type CustomAttributeTypedArgument, EventAttributes, type EventInfo, type Exception, FieldAttributes, type FieldInfo, GenericParameterAttributes, type GetPlacesResponse, type GetPlantResponse, type IClient, type ICustomAttributeProvider, type IHumidityMeasurement, type IPlant, type IntPtr, LayoutKind, type MemberInfo, MemberTypes, MethodAttributes, type MethodBase, MethodImplAttributes, type MethodInfo, type Module, type ModuleHandle, ParameterAttributes, type ParameterInfo, PlantType, PropertyAttributes, type PropertyInfo, type RuntimeFieldHandle, type RuntimeMethodHandle, type RuntimeTypeHandle, SecurityRuleSet, type StructLayoutAttribute, type Type, TypeAttributes, type TypeInfo, type UpdatePlaceCommand, type UpdatePlantCommand };
package/dist/index.d.ts CHANGED
@@ -11,11 +11,6 @@ interface IClient {
11
11
  * @return OK
12
12
  */
13
13
  humidityMeasurementsAll(id?: number | undefined, fromDate?: Date | undefined, toDate?: Date | undefined): Promise<IHumidityMeasurement[]>;
14
- /**
15
- * @param body (optional)
16
- * @return OK
17
- */
18
- status(body?: SetModuleStatusCommand | undefined): Promise<boolean>;
19
14
  /**
20
15
  * @param body (optional)
21
16
  * @return OK
@@ -89,12 +84,6 @@ declare class Client implements IClient {
89
84
  */
90
85
  humidityMeasurementsAll(id?: number | undefined, fromDate?: Date | undefined, toDate?: Date | undefined): Promise<IHumidityMeasurement[]>;
91
86
  protected processHumidityMeasurementsAll(response: Response): Promise<IHumidityMeasurement[]>;
92
- /**
93
- * @param body (optional)
94
- * @return OK
95
- */
96
- status(body?: SetModuleStatusCommand | undefined): Promise<boolean>;
97
- protected processStatus(response: Response): Promise<boolean>;
98
87
  /**
99
88
  * @param body (optional)
100
89
  * @return OK
@@ -608,11 +597,6 @@ declare enum SecurityRuleSet {
608
597
  _1 = 1,
609
598
  _2 = 2
610
599
  }
611
- interface SetModuleStatusCommand {
612
- userId?: number | undefined;
613
- moduleId?: number;
614
- status?: boolean;
615
- }
616
600
  interface StructLayoutAttribute {
617
601
  readonly typeId?: any | undefined;
618
602
  value?: LayoutKind;
@@ -833,4 +817,4 @@ declare class ApiException extends Error {
833
817
  static isApiException(obj: any): obj is ApiException;
834
818
  }
835
819
 
836
- export { type AddHumidityMeasurementCommand, ApiException, type Assembly, CallingConventions, Client, type ConstructorInfo, type CreateModuleCommand, type CreatePlaceCommand, type CreatePlantCommand, type CustomAttributeData, type CustomAttributeNamedArgument, type CustomAttributeTypedArgument, EventAttributes, type EventInfo, type Exception, FieldAttributes, type FieldInfo, GenericParameterAttributes, type GetPlacesResponse, type GetPlantResponse, type IClient, type ICustomAttributeProvider, type IHumidityMeasurement, type IPlant, type IntPtr, LayoutKind, type MemberInfo, MemberTypes, MethodAttributes, type MethodBase, MethodImplAttributes, type MethodInfo, type Module, type ModuleHandle, ParameterAttributes, type ParameterInfo, PlantType, PropertyAttributes, type PropertyInfo, type RuntimeFieldHandle, type RuntimeMethodHandle, type RuntimeTypeHandle, SecurityRuleSet, type SetModuleStatusCommand, type StructLayoutAttribute, type Type, TypeAttributes, type TypeInfo, type UpdatePlaceCommand, type UpdatePlantCommand };
820
+ export { type AddHumidityMeasurementCommand, ApiException, type Assembly, CallingConventions, Client, type ConstructorInfo, type CreateModuleCommand, type CreatePlaceCommand, type CreatePlantCommand, type CustomAttributeData, type CustomAttributeNamedArgument, type CustomAttributeTypedArgument, EventAttributes, type EventInfo, type Exception, FieldAttributes, type FieldInfo, GenericParameterAttributes, type GetPlacesResponse, type GetPlantResponse, type IClient, type ICustomAttributeProvider, type IHumidityMeasurement, type IPlant, type IntPtr, LayoutKind, type MemberInfo, MemberTypes, MethodAttributes, type MethodBase, MethodImplAttributes, type MethodInfo, type Module, type ModuleHandle, ParameterAttributes, type ParameterInfo, PlantType, PropertyAttributes, type PropertyInfo, type RuntimeFieldHandle, type RuntimeMethodHandle, type RuntimeTypeHandle, SecurityRuleSet, type StructLayoutAttribute, type Type, TypeAttributes, type TypeInfo, type UpdatePlaceCommand, type UpdatePlantCommand };
package/dist/index.js CHANGED
@@ -246,61 +246,6 @@ var Client = /*#__PURE__*/ function() {
246
246
  /**
247
247
  * @param body (optional)
248
248
  * @return OK
249
- */ key: "status",
250
- value: function status(body) {
251
- var _this = this;
252
- var url_ = this.baseUrl + "/status";
253
- url_ = url_.replace(/[?&]$/, "");
254
- var content_ = JSON.stringify(body);
255
- var options_ = {
256
- body: content_,
257
- method: "POST",
258
- headers: {
259
- "Content-Type": "application/json",
260
- "Accept": "application/json"
261
- }
262
- };
263
- return this.http.fetch(url_, options_).then(function(_response) {
264
- return _this.processStatus(_response);
265
- });
266
- }
267
- },
268
- {
269
- key: "processStatus",
270
- value: function processStatus(response) {
271
- var _this = this;
272
- var status = response.status;
273
- var _headers = {};
274
- if (response.headers && response.headers.forEach) {
275
- response.headers.forEach(function(v, k) {
276
- return _headers[k] = v;
277
- });
278
- }
279
- ;
280
- if (status === 200) {
281
- return response.text().then(function(_responseText) {
282
- var result200 = null;
283
- result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
284
- return result200;
285
- });
286
- } else if (status === 500) {
287
- return response.text().then(function(_responseText) {
288
- var result500 = null;
289
- result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
290
- return throwException("Internal Server Error", status, _responseText, _headers, result500);
291
- });
292
- } else if (status !== 200 && status !== 204) {
293
- return response.text().then(function(_responseText) {
294
- return throwException("An unexpected server error occurred.", status, _responseText, _headers);
295
- });
296
- }
297
- return Promise.resolve(null);
298
- }
299
- },
300
- {
301
- /**
302
- * @param body (optional)
303
- * @return OK
304
249
  */ key: "modules",
305
250
  value: function modules(body) {
306
251
  var _this = this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arekstasko/plantcare-api-client",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",