@robotbas/robotcloud-client 0.1.15 → 0.2.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/package.json +1 -1
- package/types/ProjectClassifer.d.ts +0 -6
- package/types/RobotCloudClient.d.ts +5 -39
- package/types/ServiceInstance.d.ts +1 -10
- package/types/request-params.d.ts +87 -0
- package/types/services.d.ts +11 -65
package/package.json
CHANGED
|
@@ -10,45 +10,6 @@ export type RobotCloudServiceType = "RoomClime_1"|"RoomGuestStatus_1"|"AirQualit
|
|
|
10
10
|
// Desired fancoil speed (0 = Auto, 1..3 = Manual Speed)
|
|
11
11
|
export type FancoilSpeedState = 0|1|2|3;
|
|
12
12
|
|
|
13
|
-
export interface ProjectRequestParams {
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface ProjectDetailsRequestParams {
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
export interface SubsystemRequestParams {
|
|
21
|
-
subsystem_id?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface PaginableRequestParams {
|
|
25
|
-
startIndex?: number;
|
|
26
|
-
maxSize?: number;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface SubsystemTagsRequestParams extends SubsystemRequestParams {
|
|
30
|
-
tag_id?: string | string[];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface ProjectLocationsRequestParams extends SubsystemTagsRequestParams, PaginableRequestParams {
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export interface ServiceInstanceDataRequestParams {
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface ProjectTagRequestParams extends PaginableRequestParams {
|
|
43
|
-
parent_tag?: string;
|
|
44
|
-
no_parent?: boolean;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
export interface LocationServiceInstancesRequestParams extends SubsystemRequestParams, PaginableRequestParams {
|
|
49
|
-
tag_id?: string[];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
13
|
|
|
53
14
|
/** RESPONSE **/
|
|
54
15
|
|
|
@@ -70,6 +31,11 @@ export interface RobotCloudUserAppAccess {
|
|
|
70
31
|
access_level: AppAccessLevel;
|
|
71
32
|
}
|
|
72
33
|
|
|
34
|
+
export interface RobotCloudUserSimple {
|
|
35
|
+
username: string;
|
|
36
|
+
name: string;
|
|
37
|
+
last_name: string;
|
|
38
|
+
}
|
|
73
39
|
export interface RobotCloudUserDetails {
|
|
74
40
|
username: string;
|
|
75
41
|
name: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RobotCloudNamedItem } from "./RobotCloudClient";
|
|
2
2
|
|
|
3
3
|
export interface RobotCloudServiceInstance extends RobotCloudNamedItem {
|
|
4
4
|
service: string;
|
|
@@ -10,12 +10,3 @@ export interface ServiceInstanceDetails extends RobotCloudServiceInstance {
|
|
|
10
10
|
subsystems: string[];
|
|
11
11
|
classifier: string;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
export interface ServiceInstancesRequestParams extends SubsystemRequestParams,
|
|
15
|
-
PaginableRequestParams {
|
|
16
|
-
id?: string;
|
|
17
|
-
name?: string;
|
|
18
|
-
location_id?: string;
|
|
19
|
-
device_id?: string;
|
|
20
|
-
tag_id?: string[];
|
|
21
|
-
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { MeasurementStatus } from "./services";
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* GENERIC REQUEST PARAMS INTERFACES
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export interface SubsystemRequestParams {
|
|
12
|
+
subsystem_id?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface PaginableRequestParams {
|
|
16
|
+
startIndex?: number;
|
|
17
|
+
maxSize?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface SubsystemTagsRequestParams extends SubsystemRequestParams {
|
|
21
|
+
tag_id?: string | string[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface BaseFullPaginableRequestParams extends SubsystemTagsRequestParams, PaginableRequestParams {
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/*
|
|
29
|
+
* CONCRETE INTERFACES
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
export interface ProjectClassifiersRequestParams extends PaginableRequestParams {
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ProjectsRequestParams extends PaginableRequestParams {
|
|
37
|
+
"organization-id": string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ProjectDetailsRequestParams {
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface ProjectLocationsRequestParams extends BaseFullPaginableRequestParams {
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
export interface ServiceInstanceDataRequestParams {
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ProjectTagRequestParams extends PaginableRequestParams {
|
|
54
|
+
parent_tag?: string;
|
|
55
|
+
no_parent?: boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface LocationServiceInstancesRequestParams extends BaseFullPaginableRequestParams {
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface AlertLogsListRequestParams extends BaseFullPaginableRequestParams {
|
|
63
|
+
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
export interface ServiceInstancesRequestParams extends BaseFullPaginableRequestParams {
|
|
68
|
+
id?: string;
|
|
69
|
+
name?: string;
|
|
70
|
+
location_id?: string;
|
|
71
|
+
device_id?: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
export interface ServiceDataRequestParams extends SubsystemTagsRequestParams {
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface ServiceInstanceHistoricAggregateParams {
|
|
79
|
+
offset?: string;
|
|
80
|
+
property?: any[];
|
|
81
|
+
maxSize?: number;
|
|
82
|
+
}
|
|
83
|
+
export interface ServiceInstanceHistoricParams {
|
|
84
|
+
status?: MeasurementStatus;
|
|
85
|
+
property?: any[];
|
|
86
|
+
maxSize?: number;
|
|
87
|
+
}
|
package/types/services.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { AxiosResponse } from "axios";
|
|
2
2
|
import { ServiceInstanceRead } from "./ServiceInstanceRead";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
SubsystemRequestParams,
|
|
6
|
-
SubsystemTagsRequestParams,
|
|
7
|
-
} from "./RobotCloudClient";
|
|
3
|
+
import { ServiceDataRequestParams, ServiceInstanceDataRequestParams, ServiceInstanceHistoricAggregateParams, ServiceInstanceHistoricParams } from "./request-params";
|
|
4
|
+
|
|
8
5
|
|
|
9
6
|
export type MeasurementStatus =
|
|
10
7
|
| "GOOD"
|
|
@@ -16,20 +13,6 @@ export interface ServiceDataMeasurement<T> extends ServiceInstanceRead<T> {
|
|
|
16
13
|
status: MeasurementStatus;
|
|
17
14
|
}
|
|
18
15
|
|
|
19
|
-
export interface ServiceDataRequestParams extends SubsystemRequestParams {
|
|
20
|
-
tag_id?: string | string[];
|
|
21
|
-
}
|
|
22
|
-
export interface ServiceInstanceHistoricAggregateParams {
|
|
23
|
-
offset?: string;
|
|
24
|
-
property?: any[];
|
|
25
|
-
maxSize?: number;
|
|
26
|
-
}
|
|
27
|
-
export interface ServiceInstanceHistoricParams {
|
|
28
|
-
status?: MeasurementStatus;
|
|
29
|
-
property?: any[];
|
|
30
|
-
maxSize?: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
16
|
export interface AirQuality1DataEventValue {
|
|
34
17
|
co2: number;
|
|
35
18
|
}
|
|
@@ -44,39 +27,6 @@ export interface RoomGuestStatus1AlertEventValue {
|
|
|
44
27
|
medical_alarm: boolean;
|
|
45
28
|
}
|
|
46
29
|
|
|
47
|
-
////
|
|
48
|
-
// Alert status interfaces
|
|
49
|
-
////
|
|
50
|
-
|
|
51
|
-
export interface ServiceTypeAlertStatusResponse<T extends string> {
|
|
52
|
-
instance: string;
|
|
53
|
-
time_mark: string;
|
|
54
|
-
alert_status: Record<T, ServiceTypeAlertStatus>;
|
|
55
|
-
}
|
|
56
|
-
export interface ServiceTypeAlertStatus {
|
|
57
|
-
acknowledged: boolean;
|
|
58
|
-
ack_time: string;
|
|
59
|
-
ack_user: string; // username
|
|
60
|
-
active_time: string;
|
|
61
|
-
deactive_time: string;
|
|
62
|
-
activation_count: number;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface ServiceTypeAlertStatusClient<T extends string> {
|
|
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>>>;
|
|
79
|
-
}
|
|
80
30
|
|
|
81
31
|
////
|
|
82
32
|
// Generic interface types
|
|
@@ -97,8 +47,15 @@ export type HistoricAggregateFunction =
|
|
|
97
47
|
| "nmax"
|
|
98
48
|
| "nmin";
|
|
99
49
|
|
|
100
|
-
|
|
101
|
-
|
|
50
|
+
|
|
51
|
+
export interface ServiceInstanceConfigClient<T> {
|
|
52
|
+
get(project_id: string, instance_id: string): Promise<AxiosResponse<T>>;
|
|
53
|
+
put(project_id: string, instance_id: string, configuration: T): Promise<AxiosResponse<T>>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface ServiceTypeClient<T_ALERTS, T_DATA> {
|
|
57
|
+
|
|
58
|
+
get configuration(): ServiceInstanceConfigClient<any>;
|
|
102
59
|
getAlerts(
|
|
103
60
|
prjId: string,
|
|
104
61
|
params?: ServiceDataRequestParams
|
|
@@ -109,17 +66,6 @@ export interface ServiceTypeClient<T_ALERTS, T_DATA, T_CONFIG> {
|
|
|
109
66
|
params?: ServiceDataRequestParams
|
|
110
67
|
): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
|
|
111
68
|
|
|
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
69
|
getInstanceData(
|
|
124
70
|
prjId: string,
|
|
125
71
|
instanceId: string,
|