@robotbas/robotcloud-client 0.2.21 → 0.3.0
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/helpers/index.d.mts +1 -1
- package/dist/helpers/index.d.ts +1 -1
- package/dist/helpers/index.js +148 -7
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/index.mjs +148 -7
- package/dist/helpers/index.mjs.map +1 -1
- package/dist/{index-DmP793IB.d.mts → index-BsViQoY8.d.mts} +287 -99
- package/dist/{index-DmP793IB.d.ts → index-BsViQoY8.d.ts} +287 -99
- package/dist/index.d.mts +228 -89
- package/dist/index.d.ts +228 -89
- package/dist/index.js +448 -165
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +443 -165
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ProjectClassifer.d.ts +11 -1
- package/types/ProjectLocation.d.ts +24 -0
- package/types/ProjectSubsystem.d.ts +4 -0
- package/types/ProjectTag.d.ts +8 -1
- package/types/RobotCloudClient.d.ts +187 -9
- package/types/ServiceInstance.d.ts +14 -5
- package/types/Token.d.ts +15 -7
- package/types/alerts.d.ts +88 -0
|
@@ -5,7 +5,8 @@ export type OrganizationAccessLevel = "STAFF" | "STANDARD" | "ADMIN" | "SUPERUSE
|
|
|
5
5
|
export type ProjectAccessLevel = "BLOCKED" | "RESTRICTED" | "BASIC" | "ADVANCED"
|
|
6
6
|
export type AppAccessLevel = "BLOCKED" | "STANDARD" | "ADVANCED" | "ADMIN"
|
|
7
7
|
|
|
8
|
-
export type RobotCloudServiceType = "RoomClime_1" | "RoomGuestStatus_1" | "AirQuality_1"
|
|
8
|
+
export type RobotCloudServiceType = "PowerMeter_1" | "CoolHeatProd_1" | "HeatProd_1" | "CoolHeatCons_1" | "OutdoorClime_1" | "WaterCounter_1" | "RoomClime_1" | "RoomGuestStatus_1" | "EnergyProduction_1" | "RoomConsumes_1" | "EnergyCounter_1" | "HeatMeter_1" | "TemporizedOutput_1" | "GasCounter_1" | "ChillerHeatingPump_1" | "AirHandlingUnit_1" | "AirQuality_1" | "RoomDiagnostics_1" | "RoomBLEPairing_1" | "RoomGrouping_1" | "GenericTemperature_1" | "CoolHeatTemperature_1"
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
// Desired fancoil speed (0 = Auto, 1..3 = Manual Speed)
|
|
11
12
|
export type FancoilSpeedState = 0 | 1 | 2 | 3;
|
|
@@ -26,6 +27,86 @@ export interface RobotCloudProject {
|
|
|
26
27
|
organization: string;
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
export interface RobotCloudDelete {
|
|
31
|
+
deleted_id: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface RobotCloudCreateProject {
|
|
35
|
+
name: string
|
|
36
|
+
description?: string
|
|
37
|
+
country?: string
|
|
38
|
+
timezone?: string
|
|
39
|
+
longitude?: number
|
|
40
|
+
latitude?: number
|
|
41
|
+
image_url?: string
|
|
42
|
+
}
|
|
43
|
+
/** APPLICATIONS */
|
|
44
|
+
export interface RobotCloudCreateApplication extends RobotCloudDescribedItem{
|
|
45
|
+
access_level: ProjectAccessLevel;
|
|
46
|
+
api_key: string
|
|
47
|
+
create_time?: string
|
|
48
|
+
create_user?: string
|
|
49
|
+
update_time?: string
|
|
50
|
+
update_user?: string
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface RobotCloudGetApplication extends RobotCloudDescribedItem{
|
|
54
|
+
access_level?: ProjectAccessLevel;
|
|
55
|
+
create_time?: string
|
|
56
|
+
create_user?: string
|
|
57
|
+
update_time?: string
|
|
58
|
+
update_user?: string
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface RobotCloudPutApplication extends RobotCloudDescribedItem{
|
|
62
|
+
access_level?: ProjectAccessLevel;
|
|
63
|
+
create_time?: string
|
|
64
|
+
create_user?: string
|
|
65
|
+
update_time?: string
|
|
66
|
+
update_user?: string
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** ORGANIZATIONS */
|
|
70
|
+
export interface RobotCloudCreateOrganization {
|
|
71
|
+
name: string
|
|
72
|
+
description: string
|
|
73
|
+
address: string
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface RobotCloudPutOrganization {
|
|
77
|
+
name?: string
|
|
78
|
+
description?: string
|
|
79
|
+
address?: string
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface RobotCloudOrganizationDetails extends RobotCloudDescribedItem {
|
|
83
|
+
address: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface RobotCloudOrganizations extends RobotCloudNamedItem {
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface RobotCloudOrganizationUsers {
|
|
90
|
+
username: string
|
|
91
|
+
name: string
|
|
92
|
+
last_name: string
|
|
93
|
+
email?: string
|
|
94
|
+
external?: boolean
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface RobotCloudOrganizationCreateUser {
|
|
98
|
+
username: string;
|
|
99
|
+
password: string;
|
|
100
|
+
name: string;
|
|
101
|
+
last_name: string;
|
|
102
|
+
email?: string;
|
|
103
|
+
org_access: OrganizationAccessLevel;
|
|
104
|
+
default_project_access: ProjectAccessLevel;
|
|
105
|
+
default_app_access?: RobotCloudUserAppAccess[];
|
|
106
|
+
access_all_projects?: boolean;
|
|
107
|
+
blocked?: boolean;
|
|
108
|
+
}
|
|
109
|
+
|
|
29
110
|
/** USERS */
|
|
30
111
|
export interface RobotCloudUserAppAccess {
|
|
31
112
|
app_id: string;
|
|
@@ -38,30 +119,67 @@ export interface RobotCloudUserSimple {
|
|
|
38
119
|
name: string;
|
|
39
120
|
last_name: string;
|
|
40
121
|
}
|
|
122
|
+
|
|
123
|
+
export interface RobotCloudUserOrganization extends RobotCloudNamedItem {
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface RobotCloudUsers {
|
|
127
|
+
username: string;
|
|
128
|
+
name: string;
|
|
129
|
+
last_name: string;
|
|
130
|
+
email?: string;
|
|
131
|
+
external?: boolean;
|
|
132
|
+
}
|
|
133
|
+
|
|
41
134
|
export interface RobotCloudUserDetails {
|
|
42
135
|
username: string;
|
|
43
136
|
name: string;
|
|
44
137
|
last_name: string;
|
|
45
|
-
email
|
|
138
|
+
email?: string;
|
|
46
139
|
org_id: string;
|
|
47
140
|
org_access: OrganizationAccessLevel;
|
|
48
141
|
default_project_access: ProjectAccessLevel;
|
|
49
|
-
default_app_access
|
|
50
|
-
access_all_projects
|
|
51
|
-
blocked
|
|
142
|
+
default_app_access?: RobotCloudUserAppAccess[];
|
|
143
|
+
access_all_projects?: boolean;
|
|
144
|
+
blocked?: boolean;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface RobotCloudPutUserDetails {
|
|
148
|
+
password?: string;
|
|
149
|
+
name?: string;
|
|
150
|
+
last_name?: string;
|
|
151
|
+
email?: string;
|
|
152
|
+
org_id?: string;
|
|
153
|
+
org_access?: OrganizationAccessLevel;
|
|
154
|
+
default_project_access?: ProjectAccessLevel;
|
|
155
|
+
default_app_access?: RobotCloudUserAppAccess[];
|
|
156
|
+
access_all_projects?: boolean;
|
|
157
|
+
blocked?: boolean;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface RobotCloudCreateUser extends RobotCloudUserDetails {
|
|
161
|
+
password?: string
|
|
52
162
|
}
|
|
53
163
|
|
|
54
164
|
export interface RobotCloudUserProject {
|
|
55
165
|
project_id: string;
|
|
56
166
|
project_name: string;
|
|
57
167
|
access_level: ProjectAccessLevel;
|
|
58
|
-
app_access_level
|
|
168
|
+
app_access_level?: { app_id: string, app_name: string, access_level: AppAccessLevel }[]
|
|
59
169
|
}
|
|
60
170
|
|
|
61
|
-
export interface
|
|
62
|
-
|
|
171
|
+
export interface RobotCloudPostUserProject {
|
|
172
|
+
project_id: string;
|
|
173
|
+
access_level: ProjectAccessLevel;
|
|
174
|
+
app_access_level?: { app_id: string, app_name: string, access_level: AppAccessLevel }[]
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface RobotCloudPutProjectUser {
|
|
178
|
+
access_level: ProjectAccessLevel;
|
|
179
|
+
app_access_level?: { app_id: string, app_name: string, access_level: AppAccessLevel }[]
|
|
63
180
|
}
|
|
64
181
|
|
|
182
|
+
/** PROJECTS */
|
|
65
183
|
export interface RobotCloudProjectDetails extends RobotCloudProject {
|
|
66
184
|
version: number;
|
|
67
185
|
description?: string;
|
|
@@ -75,6 +193,60 @@ export interface RobotCloudProjectDetails extends RobotCloudProject {
|
|
|
75
193
|
app_access_level?: AppAccessLevel;
|
|
76
194
|
}
|
|
77
195
|
|
|
196
|
+
export interface RobotCloudProjectApplications {
|
|
197
|
+
application_id: string
|
|
198
|
+
application_name: string
|
|
199
|
+
enabled: string
|
|
200
|
+
expiration?: string
|
|
201
|
+
update_time?: string
|
|
202
|
+
update_user?: string
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export interface RobotCloudApplicationEnable {
|
|
206
|
+
enabled?: string
|
|
207
|
+
expiration?: string
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface RobotCloudPutProject {
|
|
211
|
+
name?: string
|
|
212
|
+
description?: string
|
|
213
|
+
organization?: string
|
|
214
|
+
country?: string
|
|
215
|
+
timezone?: string
|
|
216
|
+
longitude?: number;
|
|
217
|
+
latitude?: number;
|
|
218
|
+
image_url?: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface RobotCloudProjectUsers {
|
|
222
|
+
username: string
|
|
223
|
+
access_level: ProjectAccessLevel
|
|
224
|
+
external?: boolean
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface RobotCloudDeviceConfiguration extends RobotCloudNamedItem {
|
|
228
|
+
description: string
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export interface RobotCloudRobotCloudDeviceCreate {
|
|
232
|
+
name: string
|
|
233
|
+
description?: string
|
|
234
|
+
address: string
|
|
235
|
+
type?: number
|
|
236
|
+
configuration_type?: string;
|
|
237
|
+
tags?: string[];
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export interface RobotCloudRobotCloudDeviceModify {
|
|
241
|
+
name?: string
|
|
242
|
+
description?: string
|
|
243
|
+
address?: string
|
|
244
|
+
location_id?: string
|
|
245
|
+
type?: number
|
|
246
|
+
configuration_type?: string;
|
|
247
|
+
tags?: string[];
|
|
248
|
+
}
|
|
249
|
+
|
|
78
250
|
export interface RobotCloudDeviceDetails extends RobotCloudDescribedItem {
|
|
79
251
|
location: string;
|
|
80
252
|
address: {
|
|
@@ -87,8 +259,14 @@ export interface RobotCloudDeviceDetails extends RobotCloudDescribedItem {
|
|
|
87
259
|
tags: string[];
|
|
88
260
|
}
|
|
89
261
|
|
|
262
|
+
export interface RobotCloudProjectInstances {
|
|
263
|
+
id: string
|
|
264
|
+
name: string;
|
|
265
|
+
service: RobotCloudServiceType
|
|
266
|
+
}
|
|
267
|
+
|
|
90
268
|
export interface RobotCloudServiceTypeDetails {
|
|
91
|
-
description
|
|
269
|
+
description?: string;
|
|
92
270
|
name: RobotCloudServiceType
|
|
93
271
|
}
|
|
94
272
|
/** SERVICE EVENTS VALUES **/
|
|
@@ -9,10 +9,19 @@ export interface RobotCloudServiceInstance extends RobotCloudNamedItem {
|
|
|
9
9
|
service: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
|
|
12
13
|
export interface ServiceInstanceDetails extends RobotCloudServiceInstance {
|
|
13
|
-
description
|
|
14
|
-
location
|
|
15
|
-
tags
|
|
16
|
-
subsystems
|
|
17
|
-
classifier
|
|
14
|
+
description?: string;
|
|
15
|
+
location?: string;
|
|
16
|
+
tags?: string[];
|
|
17
|
+
subsystems?: string[];
|
|
18
|
+
classifier?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface CreateServiceInstance extends RobotCloudServiceInstance {
|
|
22
|
+
description?: string;
|
|
23
|
+
name: string
|
|
24
|
+
tags?: string[];
|
|
25
|
+
subsystems?: string[];
|
|
26
|
+
classifier?: string;
|
|
18
27
|
}
|
package/types/Token.d.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
+
export interface TokenResponse {
|
|
2
|
+
token: string;
|
|
3
|
+
expiration: string; // ISO 8601 date string (YYYY-MM-DDTHH:MM:SS.SSSZ)
|
|
4
|
+
}
|
|
5
|
+
export interface SessionTokenResponse {
|
|
6
|
+
access: TokenResponse;
|
|
7
|
+
renew: TokenResponse;
|
|
8
|
+
}
|
|
1
9
|
export interface CheckTokenResponse {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
10
|
+
renewed: boolean;
|
|
11
|
+
invalid: boolean;
|
|
12
|
+
access: string;
|
|
13
|
+
renew: string;
|
|
6
14
|
}
|
|
7
15
|
|
|
8
16
|
export interface RobotCloudJWTPayload {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
exp: number;
|
|
18
|
+
sub: string; // username
|
|
19
|
+
org: string; // organization
|
|
12
20
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { AxiosResponse } from "axios";
|
|
2
|
+
import {
|
|
3
|
+
AlertAggregatedLogsRequestParams,
|
|
4
|
+
AlertLogsListRequestParams,
|
|
5
|
+
AlertsProjectStatsRequestParams,
|
|
6
|
+
SubsystemRequestParams
|
|
7
|
+
} from "./request-params";
|
|
8
|
+
import { RobotCloudNamedItem, RobotCloudUserSimple } from "./RobotCloudClient";
|
|
9
|
+
|
|
10
|
+
export interface AlertsLogsStats {
|
|
11
|
+
total: number;
|
|
12
|
+
active: number;
|
|
13
|
+
noack: number;
|
|
14
|
+
active_noack: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface AlertLogLine {
|
|
18
|
+
id: string;
|
|
19
|
+
service: string;
|
|
20
|
+
instance: string;
|
|
21
|
+
location: RobotCloudNamedItem;
|
|
22
|
+
classifier: RobotCloudNamedItem;
|
|
23
|
+
alert_name: string;
|
|
24
|
+
acknowledged: boolean;
|
|
25
|
+
ack_time: string;
|
|
26
|
+
ack_user: RobotCloudUserSimple;
|
|
27
|
+
active: boolean;
|
|
28
|
+
active_time: string;
|
|
29
|
+
deactive_time: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface AlertsLogsList {
|
|
33
|
+
total_size: number;
|
|
34
|
+
initial_index: number;
|
|
35
|
+
alerts: AlertLogLine[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface AlertsLogsAggregatedAlertRecord {
|
|
39
|
+
periode_start: string,
|
|
40
|
+
periode_end: string,
|
|
41
|
+
activation_count: number,
|
|
42
|
+
active_seconds: number
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface AlertsLogsAggregatedAlert {
|
|
46
|
+
service: string;
|
|
47
|
+
alert_name: string;
|
|
48
|
+
aggregates: AlertsLogsAggregatedAlertRecord[];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface AlertsLogsAggregated {
|
|
52
|
+
alerts: AlertsLogsAggregatedAlert[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface AlertLogAckItem {
|
|
56
|
+
id: string;
|
|
57
|
+
acknowledged: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface AlertLogAckAlerts {
|
|
61
|
+
alerts: AlertLogAckItem[];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface AlertsClient {
|
|
65
|
+
getProjectStats(
|
|
66
|
+
projectId: string,
|
|
67
|
+
params?: AlertsProjectStatsRequestParams
|
|
68
|
+
): Promise<AxiosResponse<AlertsLogsStats>>;
|
|
69
|
+
|
|
70
|
+
getProjectLog(
|
|
71
|
+
projectId: string,
|
|
72
|
+
params: AlertLogsListRequestParams
|
|
73
|
+
): Promise<AxiosResponse<AlertsLogsList>>;
|
|
74
|
+
|
|
75
|
+
acknowledge(
|
|
76
|
+
projectId: string,
|
|
77
|
+
data: AlertLogAckAlerts
|
|
78
|
+
): Promise<AxiosResponse<AlertsLogsList>>;
|
|
79
|
+
|
|
80
|
+
getAggregatedLogs(
|
|
81
|
+
projectId: string,
|
|
82
|
+
params: AlertAggregatedLogsRequestParams
|
|
83
|
+
): Promise<AxiosResponse<AlertsLogsAggregated>>;
|
|
84
|
+
|
|
85
|
+
getAvailableAlerts(projectId: string, params?: SubsystemRequestParams): Promise<AxiosResponse<string[]>>;
|
|
86
|
+
|
|
87
|
+
getServiceTypeAlertKeys(serviceType: string): string[];
|
|
88
|
+
}
|