@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.
@@ -7,7 +7,8 @@ type OrganizationAccessLevel = "STAFF" | "STANDARD" | "ADMIN" | "SUPERUSER" | "M
7
7
  type ProjectAccessLevel = "BLOCKED" | "RESTRICTED" | "BASIC" | "ADVANCED"
8
8
  type AppAccessLevel = "BLOCKED" | "STANDARD" | "ADVANCED" | "ADMIN"
9
9
 
10
- type RobotCloudServiceType = "RoomClime_1" | "RoomGuestStatus_1" | "AirQuality_1"
10
+ 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"
11
+
11
12
 
12
13
  // Desired fancoil speed (0 = Auto, 1..3 = Manual Speed)
13
14
  type FancoilSpeedState = 0 | 1 | 2 | 3;
@@ -28,6 +29,86 @@ interface RobotCloudProject {
28
29
  organization: string;
29
30
  }
30
31
 
32
+ interface RobotCloudDelete {
33
+ deleted_id: string
34
+ }
35
+
36
+ interface RobotCloudCreateProject {
37
+ name: string
38
+ description?: string
39
+ country?: string
40
+ timezone?: string
41
+ longitude?: number
42
+ latitude?: number
43
+ image_url?: string
44
+ }
45
+ /** APPLICATIONS */
46
+ interface RobotCloudCreateApplication extends RobotCloudDescribedItem{
47
+ access_level: ProjectAccessLevel;
48
+ api_key: string
49
+ create_time?: string
50
+ create_user?: string
51
+ update_time?: string
52
+ update_user?: string
53
+ }
54
+
55
+ interface RobotCloudGetApplication extends RobotCloudDescribedItem{
56
+ access_level?: ProjectAccessLevel;
57
+ create_time?: string
58
+ create_user?: string
59
+ update_time?: string
60
+ update_user?: string
61
+ }
62
+
63
+ interface RobotCloudPutApplication extends RobotCloudDescribedItem{
64
+ access_level?: ProjectAccessLevel;
65
+ create_time?: string
66
+ create_user?: string
67
+ update_time?: string
68
+ update_user?: string
69
+ }
70
+
71
+ /** ORGANIZATIONS */
72
+ interface RobotCloudCreateOrganization {
73
+ name: string
74
+ description: string
75
+ address: string
76
+ }
77
+
78
+ interface RobotCloudPutOrganization {
79
+ name?: string
80
+ description?: string
81
+ address?: string
82
+ }
83
+
84
+ interface RobotCloudOrganizationDetails extends RobotCloudDescribedItem {
85
+ address: string;
86
+ }
87
+
88
+ interface RobotCloudOrganizations extends RobotCloudNamedItem {
89
+ }
90
+
91
+ interface RobotCloudOrganizationUsers {
92
+ username: string
93
+ name: string
94
+ last_name: string
95
+ email?: string
96
+ external?: boolean
97
+ }
98
+
99
+ interface RobotCloudOrganizationCreateUser {
100
+ username: string;
101
+ password: string;
102
+ name: string;
103
+ last_name: string;
104
+ email?: string;
105
+ org_access: OrganizationAccessLevel;
106
+ default_project_access: ProjectAccessLevel;
107
+ default_app_access?: RobotCloudUserAppAccess[];
108
+ access_all_projects?: boolean;
109
+ blocked?: boolean;
110
+ }
111
+
31
112
  /** USERS */
32
113
  interface RobotCloudUserAppAccess {
33
114
  app_id: string;
@@ -40,30 +121,67 @@ interface RobotCloudUserSimple {
40
121
  name: string;
41
122
  last_name: string;
42
123
  }
124
+
125
+ interface RobotCloudUserOrganization extends RobotCloudNamedItem {
126
+ }
127
+
128
+ interface RobotCloudUsers {
129
+ username: string;
130
+ name: string;
131
+ last_name: string;
132
+ email?: string;
133
+ external?: boolean;
134
+ }
135
+
43
136
  interface RobotCloudUserDetails {
44
137
  username: string;
45
138
  name: string;
46
139
  last_name: string;
47
- email: string;
140
+ email?: string;
48
141
  org_id: string;
49
142
  org_access: OrganizationAccessLevel;
50
143
  default_project_access: ProjectAccessLevel;
51
- default_app_access: RobotCloudUserAppAccess[];
52
- access_all_projects: boolean;
53
- blocked: boolean;
144
+ default_app_access?: RobotCloudUserAppAccess[];
145
+ access_all_projects?: boolean;
146
+ blocked?: boolean;
147
+ }
148
+
149
+ interface RobotCloudPutUserDetails {
150
+ password?: string;
151
+ name?: string;
152
+ last_name?: string;
153
+ email?: string;
154
+ org_id?: string;
155
+ org_access?: OrganizationAccessLevel;
156
+ default_project_access?: ProjectAccessLevel;
157
+ default_app_access?: RobotCloudUserAppAccess[];
158
+ access_all_projects?: boolean;
159
+ blocked?: boolean;
160
+ }
161
+
162
+ interface RobotCloudCreateUser extends RobotCloudUserDetails {
163
+ password?: string
54
164
  }
55
165
 
56
166
  interface RobotCloudUserProject {
57
167
  project_id: string;
58
168
  project_name: string;
59
169
  access_level: ProjectAccessLevel;
60
- app_access_level: { app_id: string, app_name: string, access_level: AppAccessLevel }[]
170
+ app_access_level?: { app_id: string, app_name: string, access_level: AppAccessLevel }[]
61
171
  }
62
172
 
63
- interface RobotCloudOrganizationDetails extends RobotCloudDescribedItem {
64
- address?: string;
173
+ interface RobotCloudPostUserProject {
174
+ project_id: string;
175
+ access_level: ProjectAccessLevel;
176
+ app_access_level?: { app_id: string, app_name: string, access_level: AppAccessLevel }[]
65
177
  }
66
178
 
179
+ interface RobotCloudPutProjectUser {
180
+ access_level: ProjectAccessLevel;
181
+ app_access_level?: { app_id: string, app_name: string, access_level: AppAccessLevel }[]
182
+ }
183
+
184
+ /** PROJECTS */
67
185
  interface RobotCloudProjectDetails extends RobotCloudProject {
68
186
  version: number;
69
187
  description?: string;
@@ -77,6 +195,60 @@ interface RobotCloudProjectDetails extends RobotCloudProject {
77
195
  app_access_level?: AppAccessLevel;
78
196
  }
79
197
 
198
+ interface RobotCloudProjectApplications {
199
+ application_id: string
200
+ application_name: string
201
+ enabled: string
202
+ expiration?: string
203
+ update_time?: string
204
+ update_user?: string
205
+ }
206
+
207
+ interface RobotCloudApplicationEnable {
208
+ enabled?: string
209
+ expiration?: string
210
+ }
211
+
212
+ interface RobotCloudPutProject {
213
+ name?: string
214
+ description?: string
215
+ organization?: string
216
+ country?: string
217
+ timezone?: string
218
+ longitude?: number;
219
+ latitude?: number;
220
+ image_url?: string;
221
+ }
222
+
223
+ interface RobotCloudProjectUsers {
224
+ username: string
225
+ access_level: ProjectAccessLevel
226
+ external?: boolean
227
+ }
228
+
229
+ interface RobotCloudDeviceConfiguration extends RobotCloudNamedItem {
230
+ description: string
231
+ }
232
+
233
+ interface RobotCloudRobotCloudDeviceCreate {
234
+ name: string
235
+ description?: string
236
+ address: string
237
+ type?: number
238
+ configuration_type?: string;
239
+ tags?: string[];
240
+ }
241
+
242
+ interface RobotCloudRobotCloudDeviceModify {
243
+ name?: string
244
+ description?: string
245
+ address?: string
246
+ location_id?: string
247
+ type?: number
248
+ configuration_type?: string;
249
+ tags?: string[];
250
+ }
251
+
80
252
  interface RobotCloudDeviceDetails extends RobotCloudDescribedItem {
81
253
  location: string;
82
254
  address: {
@@ -89,8 +261,14 @@ interface RobotCloudDeviceDetails extends RobotCloudDescribedItem {
89
261
  tags: string[];
90
262
  }
91
263
 
264
+ interface RobotCloudProjectInstances {
265
+ id: string
266
+ name: string;
267
+ service: RobotCloudServiceType
268
+ }
269
+
92
270
  interface RobotCloudServiceTypeDetails {
93
- description: string;
271
+ description?: string;
94
272
  name: RobotCloudServiceType
95
273
  }
96
274
  /** SERVICE EVENTS VALUES **/
@@ -114,6 +292,94 @@ interface ServiceInstanceRead<T> {
114
292
  value: T;
115
293
  }
116
294
 
295
+ type MeasurementStatus =
296
+ | "GOOD"
297
+ | "NOT_MEASURED"
298
+ | "INVALID_VALUE"
299
+ | "DEVICE_ERROR";
300
+
301
+ interface ServiceDataMeasurement<T> extends ServiceInstanceRead<T> {
302
+ status: MeasurementStatus;
303
+ }
304
+
305
+ interface AirQuality1DataEventValue {
306
+ co2: number;
307
+ }
308
+
309
+ interface AirQuality1AlertEventValue {
310
+ high_co2: boolean;
311
+ }
312
+
313
+ interface RoomGuestStatus1AlertEventValue {
314
+ door_open_overtime: boolean;
315
+ window_open_overtime: boolean;
316
+ medical_alarm: boolean;
317
+ }
318
+
319
+
320
+ ////
321
+ // Generic interface types
322
+ ////
323
+
324
+ type HistoricAggregateFunction =
325
+ | "count"
326
+ | "increase"
327
+ | "mean"
328
+ | "first"
329
+ | "last"
330
+ | "max"
331
+ | "min"
332
+ | "amax"
333
+ | "amin"
334
+ | "pmax"
335
+ | "pmin"
336
+ | "nmax"
337
+ | "nmin";
338
+
339
+
340
+ interface ServiceInstanceConfigClient<T> {
341
+ get(project_id: string, instance_id: string): Promise<AxiosResponse<T>>;
342
+ put(project_id: string, instance_id: string, configuration: T): Promise<AxiosResponse<T>>;
343
+ }
344
+
345
+ interface ServiceTypeClient<T_ALERTS, T_DATA> {
346
+
347
+ get configuration(): ServiceInstanceConfigClient<any>;
348
+ getAlerts(
349
+ prjId: string,
350
+ params?: ServiceDataRequestParams
351
+ ): Promise<AxiosResponse<ServiceDataMeasurement<T_ALERTS>[]>>;
352
+
353
+ getData(
354
+ prjId: string,
355
+ params?: ServiceDataRequestParams
356
+ ): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
357
+
358
+ getInstanceData(
359
+ prjId: string,
360
+ instanceId: string,
361
+ params?: ServiceInstanceDataRequestParams
362
+ ): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>>>;
363
+
364
+ getInstanceHistoric(
365
+ prjId: string,
366
+ instanceId: string,
367
+ startTime: Date,
368
+ endTime: Date,
369
+ params: ServiceInstanceHistoricParams
370
+ ): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
371
+
372
+ getInstanceHistoricAggregate(
373
+ prjId: string,
374
+ instanceId: string,
375
+ startTime: Date,
376
+ endTime: Date,
377
+ aggFunction: HistoricAggregateFunction,
378
+ periode: string,
379
+ params: ServiceInstanceHistoricAggregateParams
380
+ ): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
381
+ }
382
+
117
383
  /**
118
384
  *
119
385
  */
@@ -217,94 +483,6 @@ interface ServiceInstanceHistoricParams {
217
483
  maxSize?: number;
218
484
  }
219
485
 
220
- type MeasurementStatus =
221
- | "GOOD"
222
- | "NOT_MEASURED"
223
- | "INVALID_VALUE"
224
- | "DEVICE_ERROR";
225
-
226
- interface ServiceDataMeasurement<T> extends ServiceInstanceRead<T> {
227
- status: MeasurementStatus;
228
- }
229
-
230
- interface AirQuality1DataEventValue {
231
- co2: number;
232
- }
233
-
234
- interface AirQuality1AlertEventValue {
235
- high_co2: boolean;
236
- }
237
-
238
- interface RoomGuestStatus1AlertEventValue {
239
- door_open_overtime: boolean;
240
- window_open_overtime: boolean;
241
- medical_alarm: boolean;
242
- }
243
-
244
-
245
- ////
246
- // Generic interface types
247
- ////
248
-
249
- type HistoricAggregateFunction =
250
- | "count"
251
- | "increase"
252
- | "mean"
253
- | "first"
254
- | "last"
255
- | "max"
256
- | "min"
257
- | "amax"
258
- | "amin"
259
- | "pmax"
260
- | "pmin"
261
- | "nmax"
262
- | "nmin";
263
-
264
-
265
- interface ServiceInstanceConfigClient<T> {
266
- get(project_id: string, instance_id: string): Promise<AxiosResponse<T>>;
267
- put(project_id: string, instance_id: string, configuration: T): Promise<AxiosResponse<T>>;
268
- }
269
-
270
- interface ServiceTypeClient<T_ALERTS, T_DATA> {
271
-
272
- get configuration(): ServiceInstanceConfigClient<any>;
273
- getAlerts(
274
- prjId: string,
275
- params?: ServiceDataRequestParams
276
- ): Promise<AxiosResponse<ServiceDataMeasurement<T_ALERTS>[]>>;
277
-
278
- getData(
279
- prjId: string,
280
- params?: ServiceDataRequestParams
281
- ): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
282
-
283
- getInstanceData(
284
- prjId: string,
285
- instanceId: string,
286
- params?: ServiceInstanceDataRequestParams
287
- ): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>>>;
288
-
289
- getInstanceHistoric(
290
- prjId: string,
291
- instanceId: string,
292
- startTime: Date,
293
- endTime: Date,
294
- params: ServiceInstanceHistoricParams
295
- ): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
296
-
297
- getInstanceHistoricAggregate(
298
- prjId: string,
299
- instanceId: string,
300
- startTime: Date,
301
- endTime: Date,
302
- aggFunction: HistoricAggregateFunction,
303
- periode: string,
304
- params: ServiceInstanceHistoricAggregateParams
305
- ): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
306
- }
307
-
308
486
  interface ProjectTagTreeNode {
309
487
  tag: ProjectTag;
310
488
  children: ProjectTagTreeNode[];
@@ -317,8 +495,15 @@ interface ProjectTagsTree {
317
495
  interface ProjectTag {
318
496
  id: string;
319
497
  name: string;
320
- parent_id: string;
498
+ parent_id?: string;
321
499
  }
500
+
501
+ interface ProjectModifyTag {
502
+ id?: string,
503
+ name?: string,
504
+ parent_id?: string
505
+ }
506
+
322
507
  interface ProjectTagDetails extends ProjectTag {
323
508
  color: string;
324
509
  project: string;
@@ -328,6 +513,9 @@ interface ProjectTagDetails extends ProjectTag {
328
513
  declare class TagsClient {
329
514
  getTags: (prjId: string, params?: ProjectTagRequestParams) => Promise<AxiosResponse<ProjectTag[]>>;
330
515
  getTag: (prjId: string, tagId: string) => Promise<AxiosResponse<ProjectTagDetails>>;
516
+ postTag: (prjId: string) => Promise<AxiosResponse<ProjectTag>>;
517
+ putTag: (prjId: string, tagId: string) => Promise<AxiosResponse<ProjectModifyTag>>;
518
+ deleteTag: (prjId: string, tagId: string) => Promise<AxiosResponse<RobotCloudDelete>>;
331
519
  }
332
520
  declare const tagsClient: TagsClient;
333
521
 
@@ -348,4 +536,4 @@ declare const robotCloudPermissionsHelper: RobotCloudPermissionsHelper;
348
536
 
349
537
  declare const tagsHelper: TagsHelper;
350
538
 
351
- export { type FancoilSpeedState as $, type AirQuality1AlertEventValue as A, type RobotCloudOrganizationDetails as B, type RobotCloudUserDetails as C, type RobotCloudUserProject as D, tagsClient as E, tagsHelper as F, robotCloudPermissionsHelper as G, type HistoricAggregateFunction as H, type RobotCloudPermissionsHelper as I, type ProjectTagTreeNode as J, type ProjectTagsTree as K, type LocationServiceInstancesRequestParams as L, type ProjectTag as M, type ProjectTagDetails as N, type PaginableRequestParams as O, type ProjectClassifiersRequestParams as P, type SortableListRequestParams as Q, type RegimState as R, type ServiceInstanceConfigClient as S, type TemperatureUnit as T, type SubsystemTagsRequestParams as U, type BaseFullPaginableRequestParams as V, type ProjectTagRequestParams as W, type AlertsProjectStatsRequestParams as X, type OrganizationAccessLevel as Y, type ProjectAccessLevel as Z, type AppAccessLevel as _, type ServiceTypeClient as a, type RobotCloudUserAppAccess as a0, type MeasurementStatus as a1, type RoomClime1AlertEventValue as b, type ServiceDataRequestParams as c, type ServiceDataMeasurement as d, type ServiceInstanceDataRequestParams as e, type ServiceInstanceHistoricParams as f, type ServiceInstanceHistoricAggregateParams as g, type RoomGuestStatus1AlertEventValue as h, type AirQuality1DataEventValue as i, type RoomConsumes1AlertEventValue as j, type RobotCloudNamedItem as k, type RobotCloudDeviceDetails as l, type RobotCloudServiceType as m, type ProjectLocationsRequestParams as n, type ProjectsRequestParams as o, type RobotCloudProject as p, type ProjectDetailsRequestParams as q, type RobotCloudProjectDetails as r, type SubsystemRequestParams as s, type RobotCloudServiceTypeDetails as t, type ServiceInstancesRequestParams as u, type ServiceInstanceRead as v, type RobotCloudDescribedItem as w, type RobotCloudUserSimple as x, type AlertLogsListRequestParams as y, type AlertAggregatedLogsRequestParams as z };
539
+ export { type RobotCloudProjectInstances as $, type AlertsProjectStatsRequestParams as A, type ServiceDataRequestParams as B, type ServiceDataMeasurement as C, type ServiceInstanceDataRequestParams as D, type ServiceInstanceHistoricParams as E, type ServiceInstanceHistoricAggregateParams as F, type RoomGuestStatus1AlertEventValue as G, type HistoricAggregateFunction as H, type AirQuality1AlertEventValue as I, type AirQuality1DataEventValue as J, type RoomConsumes1AlertEventValue as K, type RobotCloudRobotCloudDeviceCreate as L, type RobotCloudDeviceDetails as M, type RobotCloudRobotCloudDeviceModify as N, type RobotCloudDeviceConfiguration as O, type ProjectClassifiersRequestParams as P, type RobotCloudServiceType as Q, type RobotCloudOrganizations as R, type SubsystemRequestParams as S, type TemperatureUnit as T, type LocationServiceInstancesRequestParams as U, type ProjectLocationsRequestParams as V, type ProjectsRequestParams as W, type ProjectDetailsRequestParams as X, type RobotCloudProjectDetails as Y, type RobotCloudPutProject as Z, type RobotCloudProjectUsers as _, type RobotCloudCreateOrganization as a, type RobotCloudServiceTypeDetails as a0, type RobotCloudProjectApplications as a1, type RobotCloudApplicationEnable as a2, type ServiceInstancesRequestParams as a3, type ServiceInstanceRead as a4, tagsClient as a5, tagsHelper as a6, robotCloudPermissionsHelper as a7, type RobotCloudPermissionsHelper as a8, type ProjectTagTreeNode as a9, type ProjectTagsTree as aa, type ProjectTag as ab, type ProjectModifyTag as ac, type ProjectTagDetails as ad, type PaginableRequestParams as ae, type SortableListRequestParams as af, type SubsystemTagsRequestParams as ag, type BaseFullPaginableRequestParams as ah, type ProjectTagRequestParams as ai, type OrganizationAccessLevel as aj, type ProjectAccessLevel as ak, type AppAccessLevel as al, type FancoilSpeedState as am, type RobotCloudCreateProject as an, type RobotCloudUserAppAccess as ao, type RobotCloudCreateUser as ap, type MeasurementStatus as aq, type RobotCloudOrganizationDetails as b, type RobotCloudPutOrganization as c, type RobotCloudDelete as d, type RobotCloudProject as e, type RobotCloudOrganizationCreateUser as f, type RobotCloudOrganizationUsers as g, type RobotCloudUsers as h, type RobotCloudUserDetails as i, type RobotCloudPutUserDetails as j, type RobotCloudUserOrganization as k, type RobotCloudUserProject as l, type RobotCloudPostUserProject as m, type RobotCloudPutProjectUser as n, type AlertLogsListRequestParams as o, type RobotCloudNamedItem as p, type RobotCloudUserSimple as q, type AlertAggregatedLogsRequestParams as r, type RobotCloudDescribedItem as s, type RobotCloudCreateApplication as t, type RobotCloudGetApplication as u, type RobotCloudPutApplication as v, type RegimState as w, type ServiceInstanceConfigClient as x, type ServiceTypeClient as y, type RoomClime1AlertEventValue as z };