@robotbas/robotcloud-client 0.2.22 → 0.3.1

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