@robotbas/robotcloud-client 0.0.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/README.md +30 -0
- package/dist/RobotCloudClient.d-L7OLs5ZS.d.mts +180 -0
- package/dist/RobotCloudClient.d-L7OLs5ZS.d.ts +180 -0
- package/dist/helpers/index.d.mts +9 -0
- package/dist/helpers/index.d.ts +9 -0
- package/dist/helpers/index.js +110 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/index.mjs +73 -0
- package/dist/helpers/index.mjs.map +1 -0
- package/dist/index.d.mts +272 -0
- package/dist/index.d.ts +272 -0
- package/dist/index.js +560 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +522 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +49 -0
- package/types/ProjectClassifer.d.ts +5 -0
- package/types/ProjectTag.d.ts +14 -0
- package/types/RobotCloudClient.d.ts +179 -0
- package/types/ServiceInstance.d.ts +12 -0
- package/types/ServiceInstanceRead.d.ts +5 -0
- package/types/Token.d.ts +12 -0
- package/types/helpers.d.ts +5 -0
- package/types/services.d.ts +108 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
|
|
2
|
+
export type TemperatureUnit = "CELSIUS" | "FAHRENHEIT"
|
|
3
|
+
export type RegimState = "COLD"|"HEAT"|"AUTO"
|
|
4
|
+
|
|
5
|
+
export type ProjectAccessLevel = "BLOCKED" | "RESTRICTED" | "BASIC" | "ADVANCED"
|
|
6
|
+
export type AppAccessLevel = "BLOCKED" | "STANDARD" | "ADVANCED" | "ADMIN"
|
|
7
|
+
|
|
8
|
+
export type RobotCloudServiceType = "RoomClime_1"|"RoomGuestStatus_1"|"AirQuality_1"
|
|
9
|
+
|
|
10
|
+
// Desired fancoil speed (0 = Auto, 1..3 = Manual Speed)
|
|
11
|
+
export type FancoilSpeedState = 0|1|2|3;
|
|
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 ProjectLocationsRequestParams extends SubsystemRequestParams, PaginableRequestParams {
|
|
30
|
+
tag_id?: string | string[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export interface ServiceInstanceDataRequestParams {
|
|
35
|
+
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ProjectTagRequestParams extends PaginableRequestParams {
|
|
39
|
+
parent_tag?: string;
|
|
40
|
+
no_parent?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface ServiceInstancesRequestParams extends SubsystemRequestParams, PaginableRequestParams {
|
|
44
|
+
id?: string;
|
|
45
|
+
name?: string;
|
|
46
|
+
location_id?: string;
|
|
47
|
+
device_id?: string;
|
|
48
|
+
tag_id?: string[];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface LocationServiceInstancesRequestParams extends SubsystemRequestParams, PaginableRequestParams {
|
|
52
|
+
tag_id?: string[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface RoomClimeInstanceConfigParams {
|
|
56
|
+
temperature_set_point?: number;
|
|
57
|
+
humidity_set_point?: number;
|
|
58
|
+
regim?: RegimState;
|
|
59
|
+
eco_mode?: "STANDBY" | "ECO" | "VIP";
|
|
60
|
+
fancoil_speed?: 0 | 1 | 2 | 3;
|
|
61
|
+
on?: boolean;
|
|
62
|
+
high_temperature_level?: number;
|
|
63
|
+
low_temperature_level?: number;
|
|
64
|
+
high_humidity_level?: number;
|
|
65
|
+
fancoil_on_time_limit?: number;
|
|
66
|
+
temperature_units?: TemperatureUnit;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
/** RESPONSE **/
|
|
71
|
+
|
|
72
|
+
export interface RobotCloudNamedItem {
|
|
73
|
+
id: string;
|
|
74
|
+
name: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface RobotCloudProject {
|
|
78
|
+
id: string;
|
|
79
|
+
name: string;
|
|
80
|
+
organization: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** USERS */
|
|
84
|
+
export interface RobotCloudUserDetails {
|
|
85
|
+
username: string;
|
|
86
|
+
name: string;
|
|
87
|
+
last_name: string;
|
|
88
|
+
email: string;
|
|
89
|
+
org_id: string;
|
|
90
|
+
org_access: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
export interface RobotCloudProjectDetails extends RobotCloudProject {
|
|
95
|
+
version: number;
|
|
96
|
+
description?: string;
|
|
97
|
+
country?: string;
|
|
98
|
+
timezone?: string;
|
|
99
|
+
image_url?: string;
|
|
100
|
+
longitude?: number;
|
|
101
|
+
latitude?: number;
|
|
102
|
+
application_enabled?: boolean;
|
|
103
|
+
access_level?: ProjectAccessLevel;
|
|
104
|
+
app_access_level?: AppAccessLevel;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface RobotCloudDeviceDetails extends RobotCloudNamedItem {
|
|
108
|
+
description?: string;
|
|
109
|
+
location: string;
|
|
110
|
+
address: {
|
|
111
|
+
domain: number;
|
|
112
|
+
zone: number;
|
|
113
|
+
id: number;
|
|
114
|
+
};
|
|
115
|
+
type: number;
|
|
116
|
+
configuration_type: string;
|
|
117
|
+
tags: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface RobotCloudServiceTypeDetails {
|
|
121
|
+
description: string;
|
|
122
|
+
name: RobotCloudServiceType
|
|
123
|
+
}
|
|
124
|
+
/** SERVICE EVENTS VALUES **/
|
|
125
|
+
export interface RoomClime1AlertEventValue {
|
|
126
|
+
high_temperature: boolean;
|
|
127
|
+
low_temperature: boolean;
|
|
128
|
+
high_humidity: boolean;
|
|
129
|
+
fancoil_on_overtime: boolean;
|
|
130
|
+
}
|
|
131
|
+
export interface RoomClime1EventValue {
|
|
132
|
+
temperature: number;
|
|
133
|
+
humidity: number;
|
|
134
|
+
fancoil_speed: number;
|
|
135
|
+
fancoil_manual: boolean;
|
|
136
|
+
on: boolean;
|
|
137
|
+
temperature_set_point: number;
|
|
138
|
+
humidity_set_point: number;
|
|
139
|
+
regim: RegimState;
|
|
140
|
+
eco_mode: "STANDBY"|"ECO"|"VIP";
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface RoomConsumes1AlertEventValue {
|
|
144
|
+
high_daily_energy_electric: boolean;
|
|
145
|
+
high_daily_energy_thermal: boolean;
|
|
146
|
+
high_daily_hot_water: boolean;
|
|
147
|
+
high_daily_cold_water: boolean;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface RoomGrouping1DataEventValue {
|
|
151
|
+
replica_1_active: boolean;
|
|
152
|
+
replica_2_active: boolean;
|
|
153
|
+
replica_3_active: boolean;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface RoomConsumes1DataEventValue {
|
|
157
|
+
energy_electric: number;
|
|
158
|
+
energy_thermal: number;
|
|
159
|
+
hot_water: number;
|
|
160
|
+
cold_water: number;
|
|
161
|
+
daily_energy_electric: number;
|
|
162
|
+
daily_energy_thermal: number;
|
|
163
|
+
daily_hot_water: number;
|
|
164
|
+
daily_cold_water: number;
|
|
165
|
+
daily_co2_footprint: number;
|
|
166
|
+
daily_tree_equivalent: number;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** SERVICE INSTANCES DEVICE CONFIG */
|
|
170
|
+
export interface ServiceInstanceDeviceConfig {
|
|
171
|
+
device: string;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface RoomGrouping1InstanceDeviceConfig {
|
|
175
|
+
Main: ServiceInstanceDeviceConfig;
|
|
176
|
+
Replica_1: ServiceInstanceDeviceConfig;
|
|
177
|
+
Replica_2: ServiceInstanceDeviceConfig;
|
|
178
|
+
Replica_3: ServiceInstanceDeviceConfig;
|
|
179
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RobotCloudNamedItem } from "./RobotCloudClient";
|
|
2
|
+
|
|
3
|
+
export interface RobotCloudServiceInstance extends RobotCloudNamedItem {
|
|
4
|
+
service: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface ServiceInstanceDetails extends RobotCloudServiceInstance {
|
|
8
|
+
description: string;
|
|
9
|
+
tags: string[];
|
|
10
|
+
subsystems: string[];
|
|
11
|
+
classifier: string;
|
|
12
|
+
}
|
package/types/Token.d.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { AxiosResponse } from "axios";
|
|
2
|
+
import { ServiceInstanceRead } from "./ServiceInstanceRead";
|
|
3
|
+
import { SubsystemRequestParams } from "./RobotCloudClient";
|
|
4
|
+
|
|
5
|
+
export type MeasurementStatus = "GOOD"|"NOT_MEASURED"|"INVALID_VALUE"|"DEVICE_ERROR";
|
|
6
|
+
|
|
7
|
+
export interface ServiceDataMeasurement<T> extends ServiceInstanceRead<T> {
|
|
8
|
+
status: MeasurementStatus;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ServiceDataRequestParams extends SubsystemRequestParams {
|
|
12
|
+
tag_id?: string | string[];
|
|
13
|
+
}
|
|
14
|
+
export interface ServiceInstanceHistoricAggregateParams {
|
|
15
|
+
offset?: string;
|
|
16
|
+
property?: any[];
|
|
17
|
+
maxSize?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface ServiceInstanceHistoricParams {
|
|
20
|
+
status?: MeasurementStatus;
|
|
21
|
+
property?: any[];
|
|
22
|
+
maxSize?: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface AirQuality1DataEventValue {
|
|
26
|
+
co2: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface AirQuality1AlertEventValue {
|
|
30
|
+
high_co2: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export interface RoomGuestStatus1AlertEventValue {
|
|
35
|
+
door_open_overtime: boolean;
|
|
36
|
+
window_open_overtime: boolean;
|
|
37
|
+
medical_alarm: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface RoomGuestStatus1EventValue {
|
|
41
|
+
sold: boolean;
|
|
42
|
+
occupied: boolean;
|
|
43
|
+
do_not_disturb: boolean;
|
|
44
|
+
make_up_room: boolean;
|
|
45
|
+
tray_status: "IDLE"|'READY'|'FINISH';
|
|
46
|
+
remote_occupation: boolean;
|
|
47
|
+
door_open: boolean;
|
|
48
|
+
window_open: boolean;
|
|
49
|
+
medical_alarm: boolean; // TODO: ???
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface RoomGuestStatusInstanceConfigParams {
|
|
53
|
+
sold?: boolean;
|
|
54
|
+
do_not_disturb?: boolean;
|
|
55
|
+
make_up_room?: boolean;
|
|
56
|
+
remote_occupation?: boolean;
|
|
57
|
+
door_open_time_limit?: number;
|
|
58
|
+
window_open_time_limit?: number;
|
|
59
|
+
medical_alarm?: boolean;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
////
|
|
64
|
+
// Generic interface types
|
|
65
|
+
////
|
|
66
|
+
|
|
67
|
+
export type HistoricAggregateFunction = "count"|"increase"|"mean"|"first"|"last"|"max"|"min"|"amax"|"amin"|"pmax"|"pmin"|"nmax"|"nmin";
|
|
68
|
+
|
|
69
|
+
export interface ServiceTypeClient<T_ALERTS, T_DATA, T_CONFIG> {
|
|
70
|
+
getAlerts(
|
|
71
|
+
prjId: string,
|
|
72
|
+
params?: ServiceDataRequestParams
|
|
73
|
+
): Promise<AxiosResponse<ServiceDataMeasurement<T_ALERTS>[]>>;
|
|
74
|
+
|
|
75
|
+
getData (
|
|
76
|
+
prjId: string,
|
|
77
|
+
params?: ServiceDataRequestParams
|
|
78
|
+
): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
|
|
79
|
+
|
|
80
|
+
getInstanceConfiguration (
|
|
81
|
+
prjId: string,
|
|
82
|
+
instanceId: string
|
|
83
|
+
): Promise<AxiosResponse<T_CONFIG>>;
|
|
84
|
+
|
|
85
|
+
putInstanceConfiguration (
|
|
86
|
+
prjId: string,
|
|
87
|
+
instanceId: string,
|
|
88
|
+
data: T_CONFIG
|
|
89
|
+
): Promise<AxiosResponse<T_CONFIG>>;
|
|
90
|
+
|
|
91
|
+
getInstanceHistoric (
|
|
92
|
+
prjId: string,
|
|
93
|
+
instanceId: string,
|
|
94
|
+
startTime: Date,
|
|
95
|
+
endTime: Date,
|
|
96
|
+
params: ServiceInstanceHistoricParams
|
|
97
|
+
): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
|
|
98
|
+
|
|
99
|
+
getInstanceHistoricAggregate(
|
|
100
|
+
prjId: string,
|
|
101
|
+
instanceId: string,
|
|
102
|
+
startTime: Date,
|
|
103
|
+
endTime: Date,
|
|
104
|
+
aggFunction: HistoricAggregateFunction,
|
|
105
|
+
periode: string,
|
|
106
|
+
params: ServiceInstanceHistoricAggregateParams
|
|
107
|
+
): Promise<AxiosResponse<ServiceDataMeasurement<T_DATA>[]>>;
|
|
108
|
+
}
|