@robotbas/robotcloud-client 0.1.13 → 0.1.15

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.
@@ -1,43 +1,49 @@
1
1
  import { AxiosResponse } from "axios";
2
2
  import { ServiceInstanceRead } from "./ServiceInstanceRead";
3
- import { ServiceInstanceDataRequestParams, SubsystemRequestParams } from "./RobotCloudClient";
4
-
5
- export type MeasurementStatus = "GOOD"|"NOT_MEASURED"|"INVALID_VALUE"|"DEVICE_ERROR";
3
+ import {
4
+ ServiceInstanceDataRequestParams,
5
+ SubsystemRequestParams,
6
+ SubsystemTagsRequestParams,
7
+ } from "./RobotCloudClient";
8
+
9
+ export type MeasurementStatus =
10
+ | "GOOD"
11
+ | "NOT_MEASURED"
12
+ | "INVALID_VALUE"
13
+ | "DEVICE_ERROR";
6
14
 
7
15
  export interface ServiceDataMeasurement<T> extends ServiceInstanceRead<T> {
8
- status: MeasurementStatus;
16
+ status: MeasurementStatus;
9
17
  }
10
18
 
11
19
  export interface ServiceDataRequestParams extends SubsystemRequestParams {
12
- tag_id?: string | string[];
20
+ tag_id?: string | string[];
13
21
  }
14
22
  export interface ServiceInstanceHistoricAggregateParams {
15
- offset?: string;
16
- property?: any[];
17
- maxSize?: number;
18
- }
23
+ offset?: string;
24
+ property?: any[];
25
+ maxSize?: number;
26
+ }
19
27
  export interface ServiceInstanceHistoricParams {
20
- status?: MeasurementStatus;
21
- property?: any[];
22
- maxSize?: number;
23
- }
28
+ status?: MeasurementStatus;
29
+ property?: any[];
30
+ maxSize?: number;
31
+ }
24
32
 
25
33
  export interface AirQuality1DataEventValue {
26
- co2: number;
34
+ co2: number;
27
35
  }
28
36
 
29
37
  export interface AirQuality1AlertEventValue {
30
- high_co2: boolean;
38
+ high_co2: boolean;
31
39
  }
32
40
 
33
-
34
41
  export interface RoomGuestStatus1AlertEventValue {
35
- door_open_overtime: boolean;
36
- window_open_overtime: boolean;
37
- medical_alarm: boolean;
42
+ door_open_overtime: boolean;
43
+ window_open_overtime: boolean;
44
+ medical_alarm: boolean;
38
45
  }
39
46
 
40
-
41
47
  ////
42
48
  // Alert status interfaces
43
49
  ////
@@ -57,61 +63,84 @@ export interface ServiceTypeAlertStatus {
57
63
  }
58
64
 
59
65
  export interface ServiceTypeAlertStatusClient<T extends string> {
60
- getAll(projectId: string): Promise<AxiosResponse<ServiceTypeAlertStatusResponse<T>[]>>;
61
- get(projectId: string, instanceId: string): Promise<AxiosResponse<ServiceTypeAlertStatusResponse<T>>>;
62
- put(projectId: string, instanceId: string, status: Record<T, boolean>): Promise<AxiosResponse<ServiceTypeAlertStatusResponse<T>>>;
66
+ getAll(
67
+ projectId: string,
68
+ params?: SubsystemTagsRequestParams
69
+ ): Promise<AxiosResponse<ServiceTypeAlertStatusResponse<T>[]>>;
70
+ get(
71
+ projectId: string,
72
+ instanceId: string
73
+ ): Promise<AxiosResponse<ServiceTypeAlertStatusResponse<T>>>;
74
+ put(
75
+ projectId: string,
76
+ instanceId: string,
77
+ status: Record<T, boolean>
78
+ ): Promise<AxiosResponse<ServiceTypeAlertStatusResponse<T>>>;
63
79
  }
64
80
 
65
81
  ////
66
82
  // Generic interface types
67
83
  ////
68
84
 
69
- export type HistoricAggregateFunction = "count"|"increase"|"mean"|"first"|"last"|"max"|"min"|"amax"|"amin"|"pmax"|"pmin"|"nmax"|"nmin";
85
+ export type HistoricAggregateFunction =
86
+ | "count"
87
+ | "increase"
88
+ | "mean"
89
+ | "first"
90
+ | "last"
91
+ | "max"
92
+ | "min"
93
+ | "amax"
94
+ | "amin"
95
+ | "pmax"
96
+ | "pmin"
97
+ | "nmax"
98
+ | "nmin";
70
99
 
71
100
  export interface ServiceTypeClient<T_ALERTS, T_DATA, T_CONFIG> {
72
- get alertStatus(): ServiceTypeAlertStatusClient<any>;
101
+ get alertStatus(): ServiceTypeAlertStatusClient<any>;
73
102
  getAlerts(
74
- prjId: string,
75
- params?: ServiceDataRequestParams
76
- ): Promise<AxiosResponse<ServiceDataMeasurement<T_ALERTS>[]>>;
77
-
78
- getData (
79
- prjId: string,
80
- params?: ServiceDataRequestParams
81
- ): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
82
-
83
- getInstanceConfiguration (
84
- prjId: string,
85
- instanceId: string
86
- ): Promise<AxiosResponse<T_CONFIG>>;
87
-
88
- putInstanceConfiguration (
89
- prjId: string,
90
- instanceId: string,
91
- data: T_CONFIG
92
- ): Promise<AxiosResponse<T_CONFIG>>;
93
-
94
- getInstanceData (
95
- prjId: string,
96
- instanceId: string,
97
- params?: ServiceInstanceDataRequestParams
98
- ): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>>>;
99
-
100
- getInstanceHistoric (
101
- prjId: string,
102
- instanceId: string,
103
- startTime: Date,
104
- endTime: Date,
105
- params: ServiceInstanceHistoricParams
106
- ): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
107
-
108
- getInstanceHistoricAggregate(
109
- prjId: string,
110
- instanceId: string,
111
- startTime: Date,
112
- endTime: Date,
113
- aggFunction: HistoricAggregateFunction,
114
- periode: string,
115
- params: ServiceInstanceHistoricAggregateParams
116
- ): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
117
- }
103
+ prjId: string,
104
+ params?: ServiceDataRequestParams
105
+ ): Promise<AxiosResponse<ServiceDataMeasurement<T_ALERTS>[]>>;
106
+
107
+ getData(
108
+ prjId: string,
109
+ params?: ServiceDataRequestParams
110
+ ): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
111
+
112
+ getInstanceConfiguration(
113
+ prjId: string,
114
+ instanceId: string
115
+ ): Promise<AxiosResponse<T_CONFIG>>;
116
+
117
+ putInstanceConfiguration(
118
+ prjId: string,
119
+ instanceId: string,
120
+ data: T_CONFIG
121
+ ): Promise<AxiosResponse<T_CONFIG>>;
122
+
123
+ getInstanceData(
124
+ prjId: string,
125
+ instanceId: string,
126
+ params?: ServiceInstanceDataRequestParams
127
+ ): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>>>;
128
+
129
+ getInstanceHistoric(
130
+ prjId: string,
131
+ instanceId: string,
132
+ startTime: Date,
133
+ endTime: Date,
134
+ params: ServiceInstanceHistoricParams
135
+ ): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
136
+
137
+ getInstanceHistoricAggregate(
138
+ prjId: string,
139
+ instanceId: string,
140
+ startTime: Date,
141
+ endTime: Date,
142
+ aggFunction: HistoricAggregateFunction,
143
+ periode: string,
144
+ params: ServiceInstanceHistoricAggregateParams
145
+ ): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
146
+ }