@robotbas/robotcloud-client 0.2.0 → 0.2.2
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 +9 -4
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/index.mjs +9 -4
- package/dist/helpers/index.mjs.map +1 -1
- package/dist/index-t7vP2gEL.d.mts +330 -0
- package/dist/index-t7vP2gEL.d.ts +330 -0
- package/dist/index.d.mts +71 -188
- package/dist/index.d.ts +71 -188
- package/dist/index.js +89 -80
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +88 -79
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/index-NoveF7Iq.d.mts +0 -182
- package/dist/index-NoveF7Iq.d.ts +0 -182
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as axios from 'axios';
|
|
2
2
|
import { AxiosResponse } from 'axios';
|
|
3
|
-
import { S as
|
|
4
|
-
export {
|
|
3
|
+
import { R as RegimState, T as TemperatureUnit, S as ServiceInstanceConfigClient, a as ServiceTypeClient, b as RoomClime1AlertEventValue, c as ServiceDataRequestParams, d as ServiceDataMeasurement, e as ServiceInstanceDataRequestParams, f as ServiceInstanceHistoricParams, H as HistoricAggregateFunction, g as ServiceInstanceHistoricAggregateParams, h as RoomGuestStatus1AlertEventValue, A as AirQuality1AlertEventValue, i as AirQuality1DataEventValue, j as RoomConsumes1AlertEventValue, P as ProjectClassifiersRequestParams, k as RobotCloudDeviceDetails, l as RobotCloudNamedItem, m as RobotCloudServiceType, L as LocationServiceInstancesRequestParams, n as ProjectLocationsRequestParams, o as ProjectsRequestParams, p as RobotCloudProject, q as ProjectDetailsRequestParams, r as RobotCloudProjectDetails, s as SubsystemRequestParams, t as RobotCloudServiceTypeDetails, u as ServiceInstancesRequestParams, v as AlertLogsListRequestParams, w as RobotCloudUserSimple, x as RobotCloudOrganizationDetails, y as RobotCloudUserDetails, z as RobotCloudUserProject } from './index-t7vP2gEL.js';
|
|
4
|
+
export { K as AppAccessLevel, M as FancoilSpeedState, Q as MeasurementStatus, O as OrganizationAccessLevel, J as ProjectAccessLevel, I as ProjectTag, F as ProjectTagTreeNode, G as ProjectTagsTree, E as RobotCloudPermissionsHelper, N as RobotCloudUserAppAccess, U as ServiceInstanceRead, D as robotCloudPermissionsHelper, B as tagsClient, C as tagsHelper } from './index-t7vP2gEL.js';
|
|
5
5
|
|
|
6
6
|
declare const robotcloudApi: axios.AxiosInstance;
|
|
7
7
|
|
|
@@ -47,151 +47,6 @@ declare namespace robotCloudToken {
|
|
|
47
47
|
export { type robotCloudToken_RobotCloudNewTokenResponse as RobotCloudNewTokenResponse, robotCloudToken_decodeToken as decodeToken, robotCloudToken_needRenew as needRenew, robotCloudToken_renewToken as renewToken, robotCloudToken_validateToken as validateToken };
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
interface ServiceInstanceRead<T> {
|
|
51
|
-
instance: string;
|
|
52
|
-
time_mark: string;
|
|
53
|
-
value: T;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
type MeasurementStatus =
|
|
57
|
-
| "GOOD"
|
|
58
|
-
| "NOT_MEASURED"
|
|
59
|
-
| "INVALID_VALUE"
|
|
60
|
-
| "DEVICE_ERROR";
|
|
61
|
-
|
|
62
|
-
interface ServiceDataMeasurement<T> extends ServiceInstanceRead<T> {
|
|
63
|
-
status: MeasurementStatus;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
interface ServiceDataRequestParams extends SubsystemRequestParams {
|
|
67
|
-
tag_id?: string | string[];
|
|
68
|
-
}
|
|
69
|
-
interface ServiceInstanceHistoricAggregateParams {
|
|
70
|
-
offset?: string;
|
|
71
|
-
property?: any[];
|
|
72
|
-
maxSize?: number;
|
|
73
|
-
}
|
|
74
|
-
interface ServiceInstanceHistoricParams {
|
|
75
|
-
status?: MeasurementStatus;
|
|
76
|
-
property?: any[];
|
|
77
|
-
maxSize?: number;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
interface AirQuality1DataEventValue {
|
|
81
|
-
co2: number;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
interface AirQuality1AlertEventValue {
|
|
85
|
-
high_co2: boolean;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
interface RoomGuestStatus1AlertEventValue {
|
|
89
|
-
door_open_overtime: boolean;
|
|
90
|
-
window_open_overtime: boolean;
|
|
91
|
-
medical_alarm: boolean;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
////
|
|
95
|
-
// Alert status interfaces
|
|
96
|
-
////
|
|
97
|
-
|
|
98
|
-
interface ServiceTypeAlertStatusResponse<T extends string> {
|
|
99
|
-
instance: string;
|
|
100
|
-
time_mark: string;
|
|
101
|
-
alert_status: Record<T, ServiceTypeAlertStatus>;
|
|
102
|
-
}
|
|
103
|
-
interface ServiceTypeAlertStatus {
|
|
104
|
-
acknowledged: boolean;
|
|
105
|
-
ack_time: string;
|
|
106
|
-
ack_user: string; // username
|
|
107
|
-
active_time: string;
|
|
108
|
-
deactive_time: string;
|
|
109
|
-
activation_count: number;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
interface ServiceTypeAlertStatusClient<T extends string> {
|
|
113
|
-
getAll(
|
|
114
|
-
projectId: string,
|
|
115
|
-
params?: SubsystemTagsRequestParams
|
|
116
|
-
): Promise<AxiosResponse<ServiceTypeAlertStatusResponse<T>[]>>;
|
|
117
|
-
get(
|
|
118
|
-
projectId: string,
|
|
119
|
-
instanceId: string
|
|
120
|
-
): Promise<AxiosResponse<ServiceTypeAlertStatusResponse<T>>>;
|
|
121
|
-
put(
|
|
122
|
-
projectId: string,
|
|
123
|
-
instanceId: string,
|
|
124
|
-
status: Record<T, boolean>
|
|
125
|
-
): Promise<AxiosResponse<ServiceTypeAlertStatusResponse<T>>>;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
////
|
|
129
|
-
// Generic interface types
|
|
130
|
-
////
|
|
131
|
-
|
|
132
|
-
type HistoricAggregateFunction =
|
|
133
|
-
| "count"
|
|
134
|
-
| "increase"
|
|
135
|
-
| "mean"
|
|
136
|
-
| "first"
|
|
137
|
-
| "last"
|
|
138
|
-
| "max"
|
|
139
|
-
| "min"
|
|
140
|
-
| "amax"
|
|
141
|
-
| "amin"
|
|
142
|
-
| "pmax"
|
|
143
|
-
| "pmin"
|
|
144
|
-
| "nmax"
|
|
145
|
-
| "nmin";
|
|
146
|
-
|
|
147
|
-
interface ServiceTypeClient<T_ALERTS, T_DATA, T_CONFIG> {
|
|
148
|
-
get alertStatus(): ServiceTypeAlertStatusClient<any>;
|
|
149
|
-
getAlerts(
|
|
150
|
-
prjId: string,
|
|
151
|
-
params?: ServiceDataRequestParams
|
|
152
|
-
): Promise<AxiosResponse<ServiceDataMeasurement<T_ALERTS>[]>>;
|
|
153
|
-
|
|
154
|
-
getData(
|
|
155
|
-
prjId: string,
|
|
156
|
-
params?: ServiceDataRequestParams
|
|
157
|
-
): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
|
|
158
|
-
|
|
159
|
-
getInstanceConfiguration(
|
|
160
|
-
prjId: string,
|
|
161
|
-
instanceId: string
|
|
162
|
-
): Promise<AxiosResponse<T_CONFIG>>;
|
|
163
|
-
|
|
164
|
-
putInstanceConfiguration(
|
|
165
|
-
prjId: string,
|
|
166
|
-
instanceId: string,
|
|
167
|
-
data: T_CONFIG
|
|
168
|
-
): Promise<AxiosResponse<T_CONFIG>>;
|
|
169
|
-
|
|
170
|
-
getInstanceData(
|
|
171
|
-
prjId: string,
|
|
172
|
-
instanceId: string,
|
|
173
|
-
params?: ServiceInstanceDataRequestParams
|
|
174
|
-
): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>>>;
|
|
175
|
-
|
|
176
|
-
getInstanceHistoric(
|
|
177
|
-
prjId: string,
|
|
178
|
-
instanceId: string,
|
|
179
|
-
startTime: Date,
|
|
180
|
-
endTime: Date,
|
|
181
|
-
params: ServiceInstanceHistoricParams
|
|
182
|
-
): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
|
|
183
|
-
|
|
184
|
-
getInstanceHistoricAggregate(
|
|
185
|
-
prjId: string,
|
|
186
|
-
instanceId: string,
|
|
187
|
-
startTime: Date,
|
|
188
|
-
endTime: Date,
|
|
189
|
-
aggFunction: HistoricAggregateFunction,
|
|
190
|
-
periode: string,
|
|
191
|
-
params: ServiceInstanceHistoricAggregateParams
|
|
192
|
-
): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
50
|
interface RoomClime1Data {
|
|
196
51
|
demandRF: boolean;
|
|
197
52
|
eco_mode: "STANDBY"|"ECO"|"VIP";
|
|
@@ -291,72 +146,74 @@ interface RoomGuestStatusConfigurationParams {
|
|
|
291
146
|
medical_alarm?: boolean;
|
|
292
147
|
}
|
|
293
148
|
|
|
294
|
-
declare class
|
|
149
|
+
declare class GenericInstanceConfigClient<T> implements ServiceInstanceConfigClient<T> {
|
|
295
150
|
private readonly serviceName;
|
|
296
151
|
constructor(serviceName: string);
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
put(projectId: string, instanceId: string, status: Record<T, boolean>): Promise<AxiosResponse<ServiceTypeAlertStatusResponse<T>>>;
|
|
152
|
+
get(project_id: string, instance_id: string): Promise<AxiosResponse<T>>;
|
|
153
|
+
put(project_id: string, instance_id: string, new_config: T): Promise<AxiosResponse<T>>;
|
|
300
154
|
}
|
|
301
155
|
|
|
302
156
|
type RoomClimeAlertsKeys = "high_temperature" | "low_temperature" | "high_humidity" | "fancoil_on_overtime";
|
|
303
|
-
declare class
|
|
157
|
+
declare class RoomClimeConfigClient extends GenericInstanceConfigClient<RoomClimeConfigurationParams> {
|
|
304
158
|
constructor();
|
|
305
159
|
}
|
|
306
|
-
declare class RoomClimeClient implements ServiceTypeClient<RoomClime1AlertEventValue, RoomClime1Data
|
|
307
|
-
private
|
|
308
|
-
get
|
|
160
|
+
declare class RoomClimeClient implements ServiceTypeClient<RoomClime1AlertEventValue, RoomClime1Data> {
|
|
161
|
+
private _configurationClient;
|
|
162
|
+
get configuration(): RoomClimeConfigClient;
|
|
309
163
|
constructor();
|
|
310
164
|
getAlerts(prjId: string, params?: ServiceDataRequestParams): Promise<AxiosResponse<ServiceDataMeasurement<RoomClime1AlertEventValue>[]>>;
|
|
311
165
|
getData(prjId: string, params?: ServiceDataRequestParams): Promise<AxiosResponse<ServiceDataMeasurement<RoomClime1Data>[]>>;
|
|
312
|
-
getInstanceConfiguration(prjId: string, instanceId: string): Promise<AxiosResponse<RoomClimeConfigurationParams>>;
|
|
313
|
-
putInstanceConfiguration(prjId: string, instanceId: string, data: RoomClimeConfigurationParams): Promise<AxiosResponse<RoomClimeConfigurationParams>>;
|
|
314
166
|
getInstanceData(prjId: string, instanceId: string, params?: ServiceInstanceDataRequestParams): Promise<AxiosResponse<ServiceDataMeasurement<RoomClime1Data>>>;
|
|
315
167
|
getInstanceHistoric(prjId: string, instanceId: string, startTime: Date, endTime: Date, params: ServiceInstanceHistoricParams): Promise<AxiosResponse<ServiceDataMeasurement<RoomClime1Data>[]>>;
|
|
316
168
|
getInstanceHistoricAggregate(prjId: string, instanceId: string, startTime: Date, endTime: Date, aggFunction: HistoricAggregateFunction, periode: string, params: ServiceInstanceHistoricAggregateParams): Promise<AxiosResponse<ServiceDataMeasurement<RoomClime1Data>[]>>;
|
|
317
169
|
}
|
|
318
170
|
declare const roomClimeClient: RoomClimeClient;
|
|
319
171
|
|
|
320
|
-
declare class
|
|
321
|
-
|
|
172
|
+
declare class RoomGuestStatusConfigClient extends GenericInstanceConfigClient<RoomGuestStatusConfigurationParams> {
|
|
173
|
+
constructor();
|
|
174
|
+
}
|
|
175
|
+
declare class RoomGuestStatusClient implements ServiceTypeClient<RoomGuestStatus1AlertEventValue, RoomGuestStatus1Data> {
|
|
176
|
+
private _configurationClient;
|
|
177
|
+
get configuration(): RoomGuestStatusConfigClient;
|
|
178
|
+
constructor();
|
|
322
179
|
getAlerts(prjId: string, params?: ServiceDataRequestParams): Promise<AxiosResponse<ServiceDataMeasurement<RoomGuestStatus1AlertEventValue>[]>>;
|
|
323
180
|
getData(prjId: string, params?: ServiceDataRequestParams): Promise<AxiosResponse<ServiceDataMeasurement<RoomGuestStatus1Data>[]>>;
|
|
324
|
-
getInstanceConfiguration(prjId: string, instanceId: string): Promise<AxiosResponse<RoomGuestStatusConfigurationParams>>;
|
|
325
|
-
putInstanceConfiguration(prjId: string, instanceId: string, data: RoomGuestStatusConfigurationParams): Promise<AxiosResponse<RoomGuestStatusConfigurationParams>>;
|
|
326
181
|
getInstanceData: (prjId: string, instanceId: string, params?: ServiceInstanceDataRequestParams) => Promise<AxiosResponse<ServiceDataMeasurement<RoomGuestStatus1Data>>>;
|
|
327
182
|
getInstanceHistoric(prjId: string, instanceId: string, startTime: Date, endTime: Date, params: ServiceInstanceHistoricParams): Promise<AxiosResponse<ServiceDataMeasurement<RoomGuestStatus1Data>[]>>;
|
|
328
183
|
getInstanceHistoricAggregate(prjId: string, instanceId: string, startTime: Date, endTime: Date, aggFunction: HistoricAggregateFunction, periode: string, params: ServiceInstanceHistoricAggregateParams): Promise<AxiosResponse<ServiceDataMeasurement<RoomGuestStatus1Data>[]>>;
|
|
329
184
|
}
|
|
330
185
|
declare const roomGuestStatusClient: RoomGuestStatusClient;
|
|
331
186
|
|
|
332
|
-
declare class
|
|
333
|
-
|
|
187
|
+
declare class AirQualityConfigClient extends GenericInstanceConfigClient<any> {
|
|
188
|
+
constructor();
|
|
189
|
+
}
|
|
190
|
+
declare class AirQualityClient implements ServiceTypeClient<AirQuality1AlertEventValue, AirQuality1DataEventValue> {
|
|
191
|
+
private _configurationClient;
|
|
192
|
+
get configuration(): AirQualityConfigClient;
|
|
193
|
+
constructor();
|
|
334
194
|
getAlerts(prjId: string, params?: ServiceDataRequestParams): Promise<AxiosResponse<ServiceDataMeasurement<AirQuality1AlertEventValue>[]>>;
|
|
335
195
|
getData(prjId: string, params?: ServiceDataRequestParams): Promise<AxiosResponse<ServiceDataMeasurement<AirQuality1DataEventValue>[]>>;
|
|
336
|
-
getInstanceConfiguration<T>(prjId: string, instanceId: string): Promise<AxiosResponse<T>>;
|
|
337
|
-
putInstanceConfiguration<T>(prjId: string, instanceId: string, data: T): Promise<AxiosResponse<T>>;
|
|
338
196
|
getInstanceData(prjId: string, instanceId: string, params?: ServiceInstanceDataRequestParams): Promise<AxiosResponse<ServiceDataMeasurement<AirQuality1DataEventValue>>>;
|
|
339
197
|
getInstanceHistoric(prjId: string, instanceId: string, startTime: Date, endTime: Date, params: ServiceInstanceHistoricParams): Promise<AxiosResponse<ServiceDataMeasurement<AirQuality1DataEventValue>[]>>;
|
|
340
198
|
getInstanceHistoricAggregate(prjId: string, instanceId: string, startTime: Date, endTime: Date, aggFunction: HistoricAggregateFunction, periode: string, params: ServiceInstanceHistoricAggregateParams): Promise<AxiosResponse<ServiceDataMeasurement<AirQuality1DataEventValue>[]>>;
|
|
341
199
|
}
|
|
342
200
|
declare const airQualityClient: AirQualityClient;
|
|
343
201
|
|
|
344
|
-
declare class
|
|
345
|
-
|
|
202
|
+
declare class RoomConsumesConfigClient extends GenericInstanceConfigClient<any> {
|
|
203
|
+
constructor();
|
|
204
|
+
}
|
|
205
|
+
declare class RoomConsumesClient implements ServiceTypeClient<RoomConsumes1AlertEventValue, RoomConsumes1Data> {
|
|
206
|
+
private _configurationClient;
|
|
207
|
+
get configuration(): RoomConsumesConfigClient;
|
|
208
|
+
constructor();
|
|
346
209
|
getAlerts(prjId: string, params?: ServiceDataRequestParams): Promise<AxiosResponse<ServiceDataMeasurement<RoomConsumes1AlertEventValue>[]>>;
|
|
347
210
|
getData(prjId: string, params?: ServiceDataRequestParams): Promise<AxiosResponse<ServiceDataMeasurement<RoomConsumes1Data>[]>>;
|
|
348
|
-
getInstanceConfiguration<T>(prjId: string, instanceId: string): Promise<AxiosResponse<T>>;
|
|
349
|
-
putInstanceConfiguration<T>(prjId: string, instanceId: string, data: T): Promise<AxiosResponse<T>>;
|
|
350
211
|
getInstanceData: (prjId: string, instanceId: string, params?: ServiceInstanceDataRequestParams) => Promise<AxiosResponse<ServiceDataMeasurement<RoomConsumes1Data>>>;
|
|
351
212
|
getInstanceHistoric(prjId: string, instanceId: string, startTime: Date, endTime: Date, params: ServiceInstanceHistoricParams): Promise<AxiosResponse<ServiceDataMeasurement<RoomConsumes1Data>[]>>;
|
|
352
213
|
getInstanceHistoricAggregate(prjId: string, instanceId: string, startTime: Date, endTime: Date, aggFunction: HistoricAggregateFunction, periode: string, params: ServiceInstanceHistoricAggregateParams): Promise<AxiosResponse<ServiceDataMeasurement<RoomConsumes1Data>[]>>;
|
|
353
214
|
}
|
|
354
215
|
declare const roomConsumesClient: RoomConsumesClient;
|
|
355
216
|
|
|
356
|
-
interface ProjectClassifiersRequestParams extends PaginableRequestParams {
|
|
357
|
-
|
|
358
|
-
}
|
|
359
|
-
|
|
360
217
|
interface Classifier {
|
|
361
218
|
id: string;
|
|
362
219
|
name: string;
|
|
@@ -388,15 +245,6 @@ interface ServiceInstanceDetails extends RobotCloudServiceInstance {
|
|
|
388
245
|
classifier: string;
|
|
389
246
|
}
|
|
390
247
|
|
|
391
|
-
interface ServiceInstancesRequestParams extends SubsystemRequestParams,
|
|
392
|
-
PaginableRequestParams {
|
|
393
|
-
id?: string;
|
|
394
|
-
name?: string;
|
|
395
|
-
location_id?: string;
|
|
396
|
-
device_id?: string;
|
|
397
|
-
tag_id?: string[];
|
|
398
|
-
}
|
|
399
|
-
|
|
400
248
|
interface RobotCloudLocationDetails {
|
|
401
249
|
id: string;
|
|
402
250
|
name: string;
|
|
@@ -412,7 +260,7 @@ declare class LocationsClient {
|
|
|
412
260
|
declare const locationsClient: LocationsClient;
|
|
413
261
|
|
|
414
262
|
declare class ProjectsClient {
|
|
415
|
-
getProjects: (params?:
|
|
263
|
+
getProjects: (params?: ProjectsRequestParams) => Promise<AxiosResponse<RobotCloudProject[]>>;
|
|
416
264
|
getProjectDetails: (prjId: string, params?: ProjectDetailsRequestParams) => Promise<AxiosResponse<RobotCloudProjectDetails>>;
|
|
417
265
|
getProjectServiceTypes: (prjId: string, params?: SubsystemRequestParams) => Promise<AxiosResponse<RobotCloudServiceTypeDetails[]>>;
|
|
418
266
|
}
|
|
@@ -429,11 +277,40 @@ declare class SubsystemsClient {
|
|
|
429
277
|
}
|
|
430
278
|
declare const subsystemsClient: SubsystemsClient;
|
|
431
279
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
280
|
+
interface AlertsLogsStats {
|
|
281
|
+
total: number;
|
|
282
|
+
active: number;
|
|
283
|
+
noack: number;
|
|
284
|
+
active_noack: number;
|
|
435
285
|
}
|
|
436
|
-
|
|
286
|
+
interface AlertLogLine {
|
|
287
|
+
id: string;
|
|
288
|
+
service: string;
|
|
289
|
+
instance: string;
|
|
290
|
+
location: RobotCloudNamedItem;
|
|
291
|
+
classifier: RobotCloudNamedItem;
|
|
292
|
+
alert_name: string;
|
|
293
|
+
acknowledged: boolean;
|
|
294
|
+
ack_time: string;
|
|
295
|
+
ack_user: RobotCloudUserSimple;
|
|
296
|
+
active_time: string;
|
|
297
|
+
deactive_time: string;
|
|
298
|
+
}
|
|
299
|
+
interface AlertsLogsList {
|
|
300
|
+
total_size: number;
|
|
301
|
+
initial_index: number;
|
|
302
|
+
alerts: AlertLogLine;
|
|
303
|
+
}
|
|
304
|
+
interface AlertLogAckItem {
|
|
305
|
+
id: string;
|
|
306
|
+
acknowledged: boolean;
|
|
307
|
+
}
|
|
308
|
+
interface AlertsClient {
|
|
309
|
+
getProjectStats(projectId: string): Promise<AxiosResponse<AlertsLogsStats>>;
|
|
310
|
+
getProjectLog(projectId: string, params: AlertLogsListRequestParams): Promise<AxiosResponse<AlertsLogsList>>;
|
|
311
|
+
acknowledge(projectId: string, data: AlertLogAckItem[]): Promise<AxiosResponse<AlertsLogsList>>;
|
|
312
|
+
}
|
|
313
|
+
declare const alertsClient: AlertsClient;
|
|
437
314
|
|
|
438
315
|
declare class OrganizationsClient {
|
|
439
316
|
getOrganization: (organizationId: string) => Promise<AxiosResponse<RobotCloudOrganizationDetails>>;
|
|
@@ -441,4 +318,10 @@ declare class OrganizationsClient {
|
|
|
441
318
|
}
|
|
442
319
|
declare const organizationsClient: OrganizationsClient;
|
|
443
320
|
|
|
444
|
-
|
|
321
|
+
declare class UsersClient {
|
|
322
|
+
getUser: (username: string) => Promise<AxiosResponse<RobotCloudUserDetails>>;
|
|
323
|
+
getUserProjects: (username: string) => Promise<AxiosResponse<RobotCloudUserProject[]>>;
|
|
324
|
+
}
|
|
325
|
+
declare const usersClient: UsersClient;
|
|
326
|
+
|
|
327
|
+
export { AirQuality1AlertEventValue, AirQuality1DataEventValue, type CheckTokenResponse, type Classifier, type ClassifierDetails, HistoricAggregateFunction, RegimState, RobotCloudClientConfig, RobotCloudDeviceDetails, type RobotCloudJWTPayload, RobotCloudNamedItem, RobotCloudOrganizationDetails, RobotCloudProject, RobotCloudProjectDetails, type RobotCloudServiceInstance, RobotCloudServiceType, RobotCloudServiceTypeDetails, RobotCloudUserDetails, RobotCloudUserProject, RobotCloudUserSimple, RoomClime1AlertEventValue, type RoomClime1Data, type RoomClimeAlertsKeys, RoomClimeClient, type RoomClimeConfigurationParams, RoomConsumes1AlertEventValue, type RoomConsumes1Data, type RoomGrouping1DataEventValue, type RoomGrouping1InstanceDeviceConfig, RoomGuestStatus1AlertEventValue, type RoomGuestStatus1Data, type RoomGuestStatusConfigurationParams, ServiceDataMeasurement, ServiceInstanceConfigClient, type ServiceInstanceDetails, type ServiceInstanceDeviceConfig, ServiceTypeClient, TemperatureUnit, airQualityClient, alertsClient, classifiersClient, clientConfig, devicesClient, locationsClient, organizationsClient, projectsClient, robotCloudToken, robotcloudApi, roomClimeClient, roomConsumesClient, roomGuestStatusClient, serviceInstancesClient, subsystemsClient, usersClient };
|
package/dist/index.js
CHANGED
|
@@ -31,9 +31,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
RobotCloudClientConfig: () => RobotCloudClientConfig,
|
|
34
|
-
RoomClientAlertStatusClient: () => RoomClientAlertStatusClient,
|
|
35
34
|
RoomClimeClient: () => RoomClimeClient,
|
|
36
35
|
airQualityClient: () => airQualityClient,
|
|
36
|
+
alertsClient: () => alertsClient,
|
|
37
37
|
classifiersClient: () => classifiersClient,
|
|
38
38
|
clientConfig: () => config_default,
|
|
39
39
|
devicesClient: () => devicesClient,
|
|
@@ -191,43 +191,35 @@ var validateToken = async (access_token) => {
|
|
|
191
191
|
};
|
|
192
192
|
|
|
193
193
|
// src/client/services/generics.ts
|
|
194
|
-
var
|
|
194
|
+
var GenericInstanceConfigClient = class {
|
|
195
195
|
constructor(serviceName) {
|
|
196
196
|
this.serviceName = serviceName;
|
|
197
197
|
}
|
|
198
|
-
|
|
198
|
+
get(project_id, instance_id) {
|
|
199
199
|
return robotCloudApi_default.get(
|
|
200
|
-
`/projects/${
|
|
201
|
-
{
|
|
202
|
-
params
|
|
203
|
-
}
|
|
204
|
-
);
|
|
205
|
-
}
|
|
206
|
-
get(projectId, instanceId) {
|
|
207
|
-
return robotCloudApi_default.get(
|
|
208
|
-
`/projects/${projectId}/services/${this.serviceName}/instances/${instanceId}/alertstatus`
|
|
200
|
+
`/projects/${project_id}/services/${this.serviceName}/instances/${instance_id}/configuration`
|
|
209
201
|
);
|
|
210
202
|
}
|
|
211
|
-
put(
|
|
203
|
+
put(project_id, instance_id, new_config) {
|
|
212
204
|
return robotCloudApi_default.put(
|
|
213
|
-
`/projects/${
|
|
214
|
-
{
|
|
205
|
+
`/projects/${project_id}/services/${this.serviceName}/instances/${instance_id}/configuration`,
|
|
206
|
+
{ new_config }
|
|
215
207
|
);
|
|
216
208
|
}
|
|
217
209
|
};
|
|
218
210
|
|
|
219
211
|
// src/client/services/room-clime-1.ts
|
|
220
|
-
var
|
|
212
|
+
var RoomClimeConfigClient = class extends GenericInstanceConfigClient {
|
|
221
213
|
constructor() {
|
|
222
214
|
super("RoomClime_1");
|
|
223
215
|
}
|
|
224
216
|
};
|
|
225
217
|
var RoomClimeClient = class {
|
|
226
|
-
get
|
|
227
|
-
return this.
|
|
218
|
+
get configuration() {
|
|
219
|
+
return this._configurationClient;
|
|
228
220
|
}
|
|
229
221
|
constructor() {
|
|
230
|
-
this.
|
|
222
|
+
this._configurationClient = new RoomClimeConfigClient();
|
|
231
223
|
}
|
|
232
224
|
getAlerts(prjId, params) {
|
|
233
225
|
return robotCloudApi_default.get(`/projects/${prjId}/services/RoomClime_1/alert`, {
|
|
@@ -248,17 +240,6 @@ var RoomClimeClient = class {
|
|
|
248
240
|
}
|
|
249
241
|
);
|
|
250
242
|
}
|
|
251
|
-
getInstanceConfiguration(prjId, instanceId) {
|
|
252
|
-
return robotCloudApi_default.get(
|
|
253
|
-
`/projects/${prjId}/services/RoomClime_1/instances/${instanceId}/configuration`
|
|
254
|
-
);
|
|
255
|
-
}
|
|
256
|
-
putInstanceConfiguration(prjId, instanceId, data) {
|
|
257
|
-
return robotCloudApi_default.put(
|
|
258
|
-
`/projects/${prjId}/services/RoomClime_1/instances/${instanceId}/configuration`,
|
|
259
|
-
data
|
|
260
|
-
);
|
|
261
|
-
}
|
|
262
243
|
getInstanceData(prjId, instanceId, params) {
|
|
263
244
|
return robotCloudApi_default.get(
|
|
264
245
|
`/projects/${prjId}/services/RoomClime_1/instances/${instanceId}/data`,
|
|
@@ -297,11 +278,16 @@ var RoomClimeClient = class {
|
|
|
297
278
|
var roomClimeClient = new RoomClimeClient();
|
|
298
279
|
|
|
299
280
|
// src/client/services/room-guest-status-1.ts
|
|
281
|
+
var RoomGuestStatusConfigClient = class extends GenericInstanceConfigClient {
|
|
282
|
+
constructor() {
|
|
283
|
+
super("RoomGuestStatus_1");
|
|
284
|
+
}
|
|
285
|
+
};
|
|
300
286
|
var RoomGuestStatusClient = class {
|
|
301
287
|
constructor() {
|
|
302
288
|
this.getInstanceData = (prjId, instanceId, params) => {
|
|
303
289
|
return robotCloudApi_default.get(
|
|
304
|
-
`/projects/${prjId}/services/
|
|
290
|
+
`/projects/${prjId}/services/RoomGuestStatus_1/instances/${instanceId}/data`,
|
|
305
291
|
{
|
|
306
292
|
params,
|
|
307
293
|
headers: {
|
|
@@ -310,10 +296,10 @@ var RoomGuestStatusClient = class {
|
|
|
310
296
|
}
|
|
311
297
|
);
|
|
312
298
|
};
|
|
299
|
+
this._configurationClient = new RoomGuestStatusConfigClient();
|
|
313
300
|
}
|
|
314
|
-
get
|
|
315
|
-
|
|
316
|
-
return null;
|
|
301
|
+
get configuration() {
|
|
302
|
+
return this._configurationClient;
|
|
317
303
|
}
|
|
318
304
|
getAlerts(prjId, params) {
|
|
319
305
|
return robotCloudApi_default.get(`/projects/${prjId}/services/RoomGuestStatus_1/alert`, {
|
|
@@ -334,17 +320,6 @@ var RoomGuestStatusClient = class {
|
|
|
334
320
|
}
|
|
335
321
|
);
|
|
336
322
|
}
|
|
337
|
-
getInstanceConfiguration(prjId, instanceId) {
|
|
338
|
-
return robotCloudApi_default.get(
|
|
339
|
-
`/projects/${prjId}/services/RoomGuestStatus_1/instances/${instanceId}/configuration`
|
|
340
|
-
);
|
|
341
|
-
}
|
|
342
|
-
putInstanceConfiguration(prjId, instanceId, data) {
|
|
343
|
-
return robotCloudApi_default.put(
|
|
344
|
-
`/projects/${prjId}/services/RoomGuestStatus_1/instances/${instanceId}/configuration`,
|
|
345
|
-
data
|
|
346
|
-
);
|
|
347
|
-
}
|
|
348
323
|
getInstanceHistoric(prjId, instanceId, startTime, endTime, params) {
|
|
349
324
|
return robotCloudApi_default.get(
|
|
350
325
|
`/projects/${prjId}/services/RoomGuestStatus_1/instances/${instanceId}/historic/data`,
|
|
@@ -375,10 +350,17 @@ var RoomGuestStatusClient = class {
|
|
|
375
350
|
var roomGuestStatusClient = new RoomGuestStatusClient();
|
|
376
351
|
|
|
377
352
|
// src/client/services/air-quality-1.ts
|
|
353
|
+
var AirQualityConfigClient = class extends GenericInstanceConfigClient {
|
|
354
|
+
constructor() {
|
|
355
|
+
super("AirQuality_1");
|
|
356
|
+
}
|
|
357
|
+
};
|
|
378
358
|
var AirQualityClient = class {
|
|
379
|
-
get
|
|
380
|
-
|
|
381
|
-
|
|
359
|
+
get configuration() {
|
|
360
|
+
return this._configurationClient;
|
|
361
|
+
}
|
|
362
|
+
constructor() {
|
|
363
|
+
this._configurationClient = new AirQualityConfigClient();
|
|
382
364
|
}
|
|
383
365
|
getAlerts(prjId, params) {
|
|
384
366
|
return robotCloudApi_default.get(`/projects/${prjId}/services/AirQuality_1/alert`, {
|
|
@@ -396,12 +378,6 @@ var AirQualityClient = class {
|
|
|
396
378
|
}
|
|
397
379
|
});
|
|
398
380
|
}
|
|
399
|
-
getInstanceConfiguration(prjId, instanceId) {
|
|
400
|
-
throw Error("Not implemented method");
|
|
401
|
-
}
|
|
402
|
-
putInstanceConfiguration(prjId, instanceId, data) {
|
|
403
|
-
throw Error("Not implemented method");
|
|
404
|
-
}
|
|
405
381
|
getInstanceData(prjId, instanceId, params) {
|
|
406
382
|
return robotCloudApi_default.get(
|
|
407
383
|
`/projects/${prjId}/services/AirQuality_1/instances/${instanceId}/data`,
|
|
@@ -443,6 +419,11 @@ var AirQualityClient = class {
|
|
|
443
419
|
var airQualityClient = new AirQualityClient();
|
|
444
420
|
|
|
445
421
|
// src/client/services/room-consumes-1.ts
|
|
422
|
+
var RoomConsumesConfigClient = class extends GenericInstanceConfigClient {
|
|
423
|
+
constructor() {
|
|
424
|
+
super("RoomConsumes_1");
|
|
425
|
+
}
|
|
426
|
+
};
|
|
446
427
|
var RoomConsumesClient = class {
|
|
447
428
|
constructor() {
|
|
448
429
|
this.getInstanceData = (prjId, instanceId, params) => {
|
|
@@ -456,10 +437,10 @@ var RoomConsumesClient = class {
|
|
|
456
437
|
}
|
|
457
438
|
);
|
|
458
439
|
};
|
|
440
|
+
this._configurationClient = new RoomConsumesConfigClient();
|
|
459
441
|
}
|
|
460
|
-
get
|
|
461
|
-
|
|
462
|
-
return null;
|
|
442
|
+
get configuration() {
|
|
443
|
+
return this._configurationClient;
|
|
463
444
|
}
|
|
464
445
|
getAlerts(prjId, params) {
|
|
465
446
|
return robotCloudApi_default.get(`/projects/${prjId}/services/RoomConsumes_1/alert`, {
|
|
@@ -480,12 +461,6 @@ var RoomConsumesClient = class {
|
|
|
480
461
|
}
|
|
481
462
|
);
|
|
482
463
|
}
|
|
483
|
-
getInstanceConfiguration(prjId, instanceId) {
|
|
484
|
-
throw Error("Not implemented method");
|
|
485
|
-
}
|
|
486
|
-
putInstanceConfiguration(prjId, instanceId, data) {
|
|
487
|
-
throw Error("Not implemented method");
|
|
488
|
-
}
|
|
489
464
|
getInstanceHistoric(prjId, instanceId, startTime, endTime, params) {
|
|
490
465
|
return robotCloudApi_default.get(
|
|
491
466
|
`/projects/${prjId}/services/RoomConsumes_1/instances/${instanceId}/configuration`,
|
|
@@ -591,12 +566,17 @@ var logger5 = useLogger("service-instances-client");
|
|
|
591
566
|
var ServiceInstancesClient = class {
|
|
592
567
|
constructor() {
|
|
593
568
|
this.getServiceInstances = (prjId, service_type, params) => {
|
|
594
|
-
return robotCloudApi_default.get(
|
|
595
|
-
|
|
596
|
-
|
|
569
|
+
return robotCloudApi_default.get(
|
|
570
|
+
`projects/${prjId}/services/${service_type}/instances`,
|
|
571
|
+
{
|
|
572
|
+
params
|
|
573
|
+
}
|
|
574
|
+
);
|
|
597
575
|
};
|
|
598
576
|
this.getServiceInstance = (prjId, service_type, service_id) => {
|
|
599
|
-
return robotCloudApi_default.get(
|
|
577
|
+
return robotCloudApi_default.get(
|
|
578
|
+
`projects/${prjId}/services/${service_type}/instances/${service_id}`
|
|
579
|
+
);
|
|
600
580
|
};
|
|
601
581
|
}
|
|
602
582
|
};
|
|
@@ -628,20 +608,34 @@ var TagsClient = class {
|
|
|
628
608
|
};
|
|
629
609
|
var tagsClient = new TagsClient();
|
|
630
610
|
|
|
631
|
-
// src/client/
|
|
632
|
-
var
|
|
633
|
-
constructor() {
|
|
634
|
-
this.
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
this.
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
611
|
+
// src/client/alerts.ts
|
|
612
|
+
var AlertsClientImpl = class {
|
|
613
|
+
constructor(robotcloudApi2) {
|
|
614
|
+
this.robotcloudApi = robotcloudApi2;
|
|
615
|
+
}
|
|
616
|
+
getProjectStats(projectId) {
|
|
617
|
+
return this.robotcloudApi.get(
|
|
618
|
+
`projects/${projectId}/alerts/stats`
|
|
619
|
+
);
|
|
620
|
+
}
|
|
621
|
+
getProjectLog(projectId, params) {
|
|
622
|
+
return this.robotcloudApi.get(
|
|
623
|
+
`projects/${projectId}/alerts/log`,
|
|
624
|
+
{
|
|
625
|
+
params
|
|
626
|
+
}
|
|
627
|
+
);
|
|
628
|
+
}
|
|
629
|
+
acknowledge(projectId, data) {
|
|
630
|
+
return this.robotcloudApi.put(
|
|
631
|
+
`projects/${projectId}/alerts/log`,
|
|
632
|
+
{
|
|
633
|
+
data
|
|
634
|
+
}
|
|
635
|
+
);
|
|
642
636
|
}
|
|
643
637
|
};
|
|
644
|
-
var
|
|
638
|
+
var alertsClient = new AlertsClientImpl(robotCloudApi_default);
|
|
645
639
|
|
|
646
640
|
// src/client/organizations.ts
|
|
647
641
|
var OrganizationsClient = class {
|
|
@@ -660,6 +654,21 @@ var OrganizationsClient = class {
|
|
|
660
654
|
};
|
|
661
655
|
var organizationsClient = new OrganizationsClient();
|
|
662
656
|
|
|
657
|
+
// src/client/users.ts
|
|
658
|
+
var UsersClient = class {
|
|
659
|
+
constructor() {
|
|
660
|
+
this.getUser = (username) => {
|
|
661
|
+
return robotCloudApi_default.get(`users/${username}`);
|
|
662
|
+
};
|
|
663
|
+
this.getUserProjects = (username) => {
|
|
664
|
+
return robotCloudApi_default.get(
|
|
665
|
+
`users/${username}/projects`
|
|
666
|
+
);
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
var usersClient = new UsersClient();
|
|
671
|
+
|
|
663
672
|
// src/helpers/tags.ts
|
|
664
673
|
var logger7 = useLogger("tags-helper");
|
|
665
674
|
var TagsHelper = class {
|
|
@@ -761,9 +770,9 @@ var tagsHelper = new TagsHelper(tagsClient);
|
|
|
761
770
|
// Annotate the CommonJS export names for ESM import in node:
|
|
762
771
|
0 && (module.exports = {
|
|
763
772
|
RobotCloudClientConfig,
|
|
764
|
-
RoomClientAlertStatusClient,
|
|
765
773
|
RoomClimeClient,
|
|
766
774
|
airQualityClient,
|
|
775
|
+
alertsClient,
|
|
767
776
|
classifiersClient,
|
|
768
777
|
clientConfig,
|
|
769
778
|
devicesClient,
|