@ray-js/api 1.7.79 → 1.7.80
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/@types/AIKit.d.ts +1140 -1009
- package/@types/AVideoKit.d.ts +26 -101
- package/@types/BaseKit.d.ts +234 -210
- package/@types/BizKit.d.ts +271 -296
- package/@types/DeviceKit.d.ts +57 -88
- package/@types/GroupCITestKit.d.ts +1 -3
- package/@types/HealthKit.d.ts +273 -230
- package/@types/HomeKit.d.ts +1062 -891
- package/@types/IPCKit.d.ts +23 -50
- package/@types/LightKit.d.ts +2 -2
- package/@types/MapKit.d.ts +592 -381
- package/@types/MediaPlayerKit.d.ts +4 -28
- package/@types/MiniKit.d.ts +198 -375
- package/@types/P2PKit.d.ts +139 -205
- package/@types/PayKit.d.ts +10 -79
- package/@types/SweeperKit.d.ts +10 -10
- package/@types/ThirdAuthKit.d.ts +28 -252
- package/@types/WearKit.d.ts +630 -1593
- package/@types/api-extend.d.ts +0 -63
- package/lib/AIKit-1.6.0.d.ts +732 -35
- package/lib/AIKit-1.6.0.js +732 -51
- package/lib/BaseKit-3.17.7.d.ts +0 -214
- package/lib/BaseKit-3.17.7.js +1 -227
- package/lib/DeviceKit-4.13.1.d.ts +3666 -0
- package/lib/DeviceKit-4.13.1.js +3666 -0
- package/lib/HealthKit-6.5.0.d.ts +603 -0
- package/lib/HealthKit-6.5.0.js +603 -0
- package/lib/HomeKit-3.1.4.d.ts +4 -0
- package/lib/HomeKit-3.1.4.js +4 -0
- package/lib/IPCKit-6.4.5.d.ts +0 -1
- package/lib/IPCKit-6.4.5.js +0 -1
- package/lib/MapKit-3.4.13.d.ts +251 -0
- package/lib/MapKit-3.4.13.js +251 -0
- package/lib/MediaKit-3.4.1.d.ts +16 -0
- package/lib/MediaKit-3.4.1.js +16 -0
- package/lib/PlayNetKit-1.3.30.d.ts +930 -0
- package/lib/PlayNetKit-1.3.30.js +930 -0
- package/lib/cloud/alarm.d.ts +38 -5
- package/lib/cloud/alarm.js +38 -5
- package/lib/cloud/device.d.ts +42 -6
- package/lib/cloud/device.js +42 -6
- package/lib/cloud/gateway.d.ts +16 -0
- package/lib/cloud/gateway.js +16 -0
- package/lib/cloud/health.d.ts +1 -0
- package/lib/cloud/health.js +272 -0
- package/lib/cloud/interface.d.ts +161 -0
- package/lib/cloud/interface.js +18 -0
- package/lib/cloud/statistic.d.ts +112 -26
- package/lib/cloud/statistic.js +112 -26
- package/lib/cloud/timer.d.ts +2 -4
- package/lib/nativeRouters/outdoors.d.ts +2 -0
- package/lib/nativeRouters/outdoors.js +2 -0
- package/lib/nativeRouters/remoteGroup.d.ts +2 -0
- package/lib/nativeRouters/remoteGroup.js +2 -0
- package/lib/panel/publishDps.js +1 -1
- package/package.json +5 -5
package/lib/cloud/alarm.d.ts
CHANGED
|
@@ -1,14 +1,47 @@
|
|
|
1
1
|
import { AlarmList, ISetAlarmSwitch } from './interface';
|
|
2
2
|
/**
|
|
3
3
|
* 根据设备 ID 查询告警列表信息
|
|
4
|
-
*
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
* @since @ray-js/ray 1.5.2
|
|
7
|
+
* @param devId - 设备 ID
|
|
8
|
+
* @returns 告警规则列表,包含告警 ID、名称、启用状态、绑定信息等
|
|
9
|
+
* @example 基础用法
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { getDevAlarmList } from '@ray-js/ray';
|
|
12
|
+
*
|
|
13
|
+
* getDevAlarmList('vdevo169477319679442').then((res) => {
|
|
14
|
+
* console.log('告警列表:', res);
|
|
15
|
+
* }).catch((error) => {
|
|
16
|
+
* console.error(error);
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
5
19
|
*/
|
|
6
20
|
declare const getDevAlarmList: (devId: string) => Promise<AlarmList[]>;
|
|
7
21
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @
|
|
11
|
-
* @
|
|
22
|
+
* 启用或者禁用设备的告警开关
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
* @since @ray-js/ray 1.5.2
|
|
26
|
+
* @param params - 请求参数
|
|
27
|
+
* @param params.devId - 设备 ID
|
|
28
|
+
* @param params.ruleIds - 要开启或关闭的告警规则 ID,多个 ID 用英文逗号隔开
|
|
29
|
+
* @param params.disabled - 是否禁用告警,'true' 表示禁用,'false' 表示启用
|
|
30
|
+
* @returns 是否设置成功
|
|
31
|
+
* @example 基础用法
|
|
32
|
+
* ```ts
|
|
33
|
+
* import { setAlarmSwitch } from '@ray-js/ray';
|
|
34
|
+
*
|
|
35
|
+
* setAlarmSwitch({
|
|
36
|
+
* devId: 'vdevo169477319679442',
|
|
37
|
+
* ruleIds: '123456,789012',
|
|
38
|
+
* disabled: 'false',
|
|
39
|
+
* }).then((res) => {
|
|
40
|
+
* console.log('设置结果:', res);
|
|
41
|
+
* }).catch((error) => {
|
|
42
|
+
* console.error(error);
|
|
43
|
+
* });
|
|
44
|
+
* ```
|
|
12
45
|
*/
|
|
13
46
|
declare const setAlarmSwitch: (params: ISetAlarmSwitch) => Promise<boolean>;
|
|
14
47
|
export { getDevAlarmList, setAlarmSwitch };
|
package/lib/cloud/alarm.js
CHANGED
|
@@ -4,7 +4,21 @@ import { requestCloud } from '../';
|
|
|
4
4
|
import { THING } from '../constants';
|
|
5
5
|
/**
|
|
6
6
|
* 根据设备 ID 查询告警列表信息
|
|
7
|
-
*
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
* @since @ray-js/ray 1.5.2
|
|
10
|
+
* @param devId - 设备 ID
|
|
11
|
+
* @returns 告警规则列表,包含告警 ID、名称、启用状态、绑定信息等
|
|
12
|
+
* @example 基础用法
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { getDevAlarmList } from '@ray-js/ray';
|
|
15
|
+
*
|
|
16
|
+
* getDevAlarmList('vdevo169477319679442').then((res) => {
|
|
17
|
+
* console.log('告警列表:', res);
|
|
18
|
+
* }).catch((error) => {
|
|
19
|
+
* console.error(error);
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
8
22
|
*/
|
|
9
23
|
const getDevAlarmList = devId => {
|
|
10
24
|
return requestCloud({
|
|
@@ -17,10 +31,29 @@ const getDevAlarmList = devId => {
|
|
|
17
31
|
};
|
|
18
32
|
|
|
19
33
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* @
|
|
23
|
-
* @
|
|
34
|
+
* 启用或者禁用设备的告警开关
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
* @since @ray-js/ray 1.5.2
|
|
38
|
+
* @param params - 请求参数
|
|
39
|
+
* @param params.devId - 设备 ID
|
|
40
|
+
* @param params.ruleIds - 要开启或关闭的告警规则 ID,多个 ID 用英文逗号隔开
|
|
41
|
+
* @param params.disabled - 是否禁用告警,'true' 表示禁用,'false' 表示启用
|
|
42
|
+
* @returns 是否设置成功
|
|
43
|
+
* @example 基础用法
|
|
44
|
+
* ```ts
|
|
45
|
+
* import { setAlarmSwitch } from '@ray-js/ray';
|
|
46
|
+
*
|
|
47
|
+
* setAlarmSwitch({
|
|
48
|
+
* devId: 'vdevo169477319679442',
|
|
49
|
+
* ruleIds: '123456,789012',
|
|
50
|
+
* disabled: 'false',
|
|
51
|
+
* }).then((res) => {
|
|
52
|
+
* console.log('设置结果:', res);
|
|
53
|
+
* }).catch((error) => {
|
|
54
|
+
* console.error(error);
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
24
57
|
*/
|
|
25
58
|
const setAlarmSwitch = params => {
|
|
26
59
|
return requestCloud({
|
package/lib/cloud/device.d.ts
CHANGED
|
@@ -87,15 +87,51 @@ declare const getGroupDpsInfos: (groupId: string) => Promise<IGetGroupDpsInfosRe
|
|
|
87
87
|
*/
|
|
88
88
|
declare const updateGroupDpName: (params: IUpdateGroupDpName) => Promise<boolean>;
|
|
89
89
|
/**
|
|
90
|
-
* 通过设备 ID
|
|
91
|
-
*
|
|
92
|
-
* @
|
|
90
|
+
* 通过设备 ID 获取当天天气及空气质量
|
|
91
|
+
*
|
|
92
|
+
* @public
|
|
93
|
+
* @since @ray-js/ray 1.5.2
|
|
94
|
+
* @param params - 请求参数
|
|
95
|
+
* @param params.devId - 设备 ID
|
|
96
|
+
* @param params.isLocal - 是否查询本地天气
|
|
97
|
+
* @returns 天气及空气质量信息,包含城市信息、温度、湿度、风向、风速、空气质量指数等
|
|
98
|
+
* @example 基础用法
|
|
99
|
+
* ```ts
|
|
100
|
+
* import { getWeatherQuality } from '@ray-js/ray';
|
|
101
|
+
*
|
|
102
|
+
* getWeatherQuality({
|
|
103
|
+
* devId: 'vdevo169477319679442',
|
|
104
|
+
* isLocal: true,
|
|
105
|
+
* }).then((res) => {
|
|
106
|
+
* console.log('天气信息:', res);
|
|
107
|
+
* }).catch((error) => {
|
|
108
|
+
* console.error(error);
|
|
109
|
+
* });
|
|
110
|
+
* ```
|
|
93
111
|
*/
|
|
94
112
|
declare const getWeatherQuality: (params: IGetWeatherQuality) => Promise<IGetWeatherQualityResponse>;
|
|
95
113
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* @
|
|
114
|
+
* 获取天气预报信息
|
|
115
|
+
*
|
|
116
|
+
* @public
|
|
117
|
+
* @since @ray-js/ray 1.5.2
|
|
118
|
+
* @param params - 请求参数
|
|
119
|
+
* @param params.devId - 设备 ID
|
|
120
|
+
* @param params.dataRange - 预报天数(默认值为 7,最大可预报天数为 7)
|
|
121
|
+
* @returns 天气预报信息,包含城市信息及未来多日的天气数据(温度、湿度、风向、风速、日出日落时间等)
|
|
122
|
+
* @example 基础用法
|
|
123
|
+
* ```ts
|
|
124
|
+
* import { getWeathers } from '@ray-js/ray';
|
|
125
|
+
*
|
|
126
|
+
* getWeathers({
|
|
127
|
+
* devId: 'vdevo169477319679442',
|
|
128
|
+
* dataRange: 7,
|
|
129
|
+
* }).then((res) => {
|
|
130
|
+
* console.log('天气预报:', res);
|
|
131
|
+
* }).catch((error) => {
|
|
132
|
+
* console.error(error);
|
|
133
|
+
* });
|
|
134
|
+
* ```
|
|
99
135
|
*/
|
|
100
136
|
declare const getWeathers: (params: IGetWeathers) => Promise<IGetWeathersResponse>;
|
|
101
137
|
/**
|
package/lib/cloud/device.js
CHANGED
|
@@ -120,9 +120,27 @@ const updateGroupDpName = params => {
|
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
|
-
* 通过设备 ID
|
|
124
|
-
*
|
|
125
|
-
* @
|
|
123
|
+
* 通过设备 ID 获取当天天气及空气质量
|
|
124
|
+
*
|
|
125
|
+
* @public
|
|
126
|
+
* @since @ray-js/ray 1.5.2
|
|
127
|
+
* @param params - 请求参数
|
|
128
|
+
* @param params.devId - 设备 ID
|
|
129
|
+
* @param params.isLocal - 是否查询本地天气
|
|
130
|
+
* @returns 天气及空气质量信息,包含城市信息、温度、湿度、风向、风速、空气质量指数等
|
|
131
|
+
* @example 基础用法
|
|
132
|
+
* ```ts
|
|
133
|
+
* import { getWeatherQuality } from '@ray-js/ray';
|
|
134
|
+
*
|
|
135
|
+
* getWeatherQuality({
|
|
136
|
+
* devId: 'vdevo169477319679442',
|
|
137
|
+
* isLocal: true,
|
|
138
|
+
* }).then((res) => {
|
|
139
|
+
* console.log('天气信息:', res);
|
|
140
|
+
* }).catch((error) => {
|
|
141
|
+
* console.error(error);
|
|
142
|
+
* });
|
|
143
|
+
* ```
|
|
126
144
|
*/
|
|
127
145
|
const getWeatherQuality = params => {
|
|
128
146
|
return requestCloud({
|
|
@@ -133,9 +151,27 @@ const getWeatherQuality = params => {
|
|
|
133
151
|
};
|
|
134
152
|
|
|
135
153
|
/**
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
* @
|
|
154
|
+
* 获取天气预报信息
|
|
155
|
+
*
|
|
156
|
+
* @public
|
|
157
|
+
* @since @ray-js/ray 1.5.2
|
|
158
|
+
* @param params - 请求参数
|
|
159
|
+
* @param params.devId - 设备 ID
|
|
160
|
+
* @param params.dataRange - 预报天数(默认值为 7,最大可预报天数为 7)
|
|
161
|
+
* @returns 天气预报信息,包含城市信息及未来多日的天气数据(温度、湿度、风向、风速、日出日落时间等)
|
|
162
|
+
* @example 基础用法
|
|
163
|
+
* ```ts
|
|
164
|
+
* import { getWeathers } from '@ray-js/ray';
|
|
165
|
+
*
|
|
166
|
+
* getWeathers({
|
|
167
|
+
* devId: 'vdevo169477319679442',
|
|
168
|
+
* dataRange: 7,
|
|
169
|
+
* }).then((res) => {
|
|
170
|
+
* console.log('天气预报:', res);
|
|
171
|
+
* }).catch((error) => {
|
|
172
|
+
* console.error(error);
|
|
173
|
+
* });
|
|
174
|
+
* ```
|
|
139
175
|
*/
|
|
140
176
|
const getWeathers = params => {
|
|
141
177
|
return requestCloud({
|
package/lib/cloud/gateway.d.ts
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
/// <reference path="../../@types/gateway.d.ts" />
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
|
+
* @example
|
|
6
|
+
* ```tsx
|
|
7
|
+
* import { gateway } from '@ray-js/ray';
|
|
8
|
+
*
|
|
9
|
+
* const { hasParamsMethod } = gateway;
|
|
10
|
+
*
|
|
11
|
+
* hasParamsMethod({
|
|
12
|
+
* testDeviceID: 0,
|
|
13
|
+
* success: (result) => {
|
|
14
|
+
* console.log('hasParamsMethod success', result);
|
|
15
|
+
* },
|
|
16
|
+
* fail: (error) => {
|
|
17
|
+
* console.log('hasParamsMethod fail', error.errorMsg);
|
|
18
|
+
* },
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
5
21
|
*/
|
|
6
22
|
export declare const hasParamsMethod: typeof ty.groupcitest.hasParamsMethod;
|
|
7
23
|
/**
|
package/lib/cloud/gateway.js
CHANGED
|
@@ -4,6 +4,22 @@ import { factory } from '../utils';
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @public
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { gateway } from '@ray-js/ray';
|
|
10
|
+
*
|
|
11
|
+
* const { hasParamsMethod } = gateway;
|
|
12
|
+
*
|
|
13
|
+
* hasParamsMethod({
|
|
14
|
+
* testDeviceID: 0,
|
|
15
|
+
* success: (result) => {
|
|
16
|
+
* console.log('hasParamsMethod success', result);
|
|
17
|
+
* },
|
|
18
|
+
* fail: (error) => {
|
|
19
|
+
* console.log('hasParamsMethod fail', error.errorMsg);
|
|
20
|
+
* },
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
7
23
|
*/
|
|
8
24
|
export const hasParamsMethod = factory('hasParamsMethod', {
|
|
9
25
|
namespace: 'groupcitest'
|
package/lib/cloud/health.d.ts
CHANGED
package/lib/cloud/health.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference path="../../@types/health.d.ts" />
|
|
2
2
|
|
|
3
|
+
/// <reference path="../../@types/health.d.ts" />
|
|
4
|
+
|
|
3
5
|
import { factory } from '../utils';
|
|
4
6
|
|
|
5
7
|
/**
|
|
@@ -7,6 +9,29 @@ import { factory } from '../utils';
|
|
|
7
9
|
*
|
|
8
10
|
* @public
|
|
9
11
|
* @since @ray-js/ray 1.5.40
|
|
12
|
+
* @example 基础用法
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { health } from '@ray-js/ray';
|
|
15
|
+
*
|
|
16
|
+
* health.addPanelUser({
|
|
17
|
+
* userInfo: {
|
|
18
|
+
* devId: 'vdevo169477319679442',
|
|
19
|
+
* type: 1,
|
|
20
|
+
* userName: '张三',
|
|
21
|
+
* sex: 0,
|
|
22
|
+
* birthday: 946656000000,
|
|
23
|
+
* height: 175,
|
|
24
|
+
* heightUnit: 'cm',
|
|
25
|
+
* weight: 70,
|
|
26
|
+
* weightUnit: 'kg',
|
|
27
|
+
* userType: 1,
|
|
28
|
+
* },
|
|
29
|
+
* }).then((userId) => {
|
|
30
|
+
* console.log('添加成功,用户ID:', userId);
|
|
31
|
+
* }).catch((error) => {
|
|
32
|
+
* console.error(error);
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
10
35
|
*/
|
|
11
36
|
const addPanelUser = factory('addPanelUser', {
|
|
12
37
|
namespace: 'health'
|
|
@@ -17,6 +42,30 @@ const addPanelUser = factory('addPanelUser', {
|
|
|
17
42
|
*
|
|
18
43
|
* @public
|
|
19
44
|
* @since @ray-js/ray 1.5.40
|
|
45
|
+
* @example 基础用法
|
|
46
|
+
* ```ts
|
|
47
|
+
* import { health } from '@ray-js/ray';
|
|
48
|
+
*
|
|
49
|
+
* health.updatePanelUser({
|
|
50
|
+
* userInfo: {
|
|
51
|
+
* userId: 'user123',
|
|
52
|
+
* devId: 'vdevo169477319679442',
|
|
53
|
+
* type: 1,
|
|
54
|
+
* userName: '张三',
|
|
55
|
+
* sex: 0,
|
|
56
|
+
* birthday: 946656000000,
|
|
57
|
+
* height: 178,
|
|
58
|
+
* heightUnit: 'cm',
|
|
59
|
+
* weight: 72,
|
|
60
|
+
* weightUnit: 'kg',
|
|
61
|
+
* userType: 1,
|
|
62
|
+
* },
|
|
63
|
+
* }).then((success) => {
|
|
64
|
+
* console.log('更新结果:', success);
|
|
65
|
+
* }).catch((error) => {
|
|
66
|
+
* console.error(error);
|
|
67
|
+
* });
|
|
68
|
+
* ```
|
|
20
69
|
*/
|
|
21
70
|
const updatePanelUser = factory('updatePanelUser', {
|
|
22
71
|
namespace: 'health'
|
|
@@ -27,6 +76,18 @@ const updatePanelUser = factory('updatePanelUser', {
|
|
|
27
76
|
*
|
|
28
77
|
* @public
|
|
29
78
|
* @since @ray-js/ray 1.5.40
|
|
79
|
+
* @example 基础用法
|
|
80
|
+
* ```ts
|
|
81
|
+
* import { health } from '@ray-js/ray';
|
|
82
|
+
*
|
|
83
|
+
* health.deletePanelUser({
|
|
84
|
+
* userId: 'user123',
|
|
85
|
+
* }).then((success) => {
|
|
86
|
+
* console.log('删除结果:', success);
|
|
87
|
+
* }).catch((error) => {
|
|
88
|
+
* console.error(error);
|
|
89
|
+
* });
|
|
90
|
+
* ```
|
|
30
91
|
*/
|
|
31
92
|
const deletePanelUser = factory('deletePanelUser', {
|
|
32
93
|
namespace: 'health'
|
|
@@ -37,6 +98,18 @@ const deletePanelUser = factory('deletePanelUser', {
|
|
|
37
98
|
*
|
|
38
99
|
* @public
|
|
39
100
|
* @since @ray-js/ray 1.5.40
|
|
101
|
+
* @example 基础用法
|
|
102
|
+
* ```ts
|
|
103
|
+
* import { health } from '@ray-js/ray';
|
|
104
|
+
*
|
|
105
|
+
* health.getPanelUserList({
|
|
106
|
+
* devId: 'vdevo169477319679442',
|
|
107
|
+
* }).then((userList) => {
|
|
108
|
+
* console.log('用户列表:', userList);
|
|
109
|
+
* }).catch((error) => {
|
|
110
|
+
* console.error(error);
|
|
111
|
+
* });
|
|
112
|
+
* ```
|
|
40
113
|
*/
|
|
41
114
|
const getPanelUserList = factory('getPanelUserList', {
|
|
42
115
|
namespace: 'health'
|
|
@@ -47,6 +120,18 @@ const getPanelUserList = factory('getPanelUserList', {
|
|
|
47
120
|
*
|
|
48
121
|
* @public
|
|
49
122
|
* @since @ray-js/ray 1.5.40
|
|
123
|
+
* @example 基础用法
|
|
124
|
+
* ```ts
|
|
125
|
+
* import { health } from '@ray-js/ray';
|
|
126
|
+
*
|
|
127
|
+
* health.getDefaultAvatarList({
|
|
128
|
+
* bizCode: 'default_avatar',
|
|
129
|
+
* }).then((avatarList) => {
|
|
130
|
+
* console.log('头像列表:', avatarList);
|
|
131
|
+
* }).catch((error) => {
|
|
132
|
+
* console.error(error);
|
|
133
|
+
* });
|
|
134
|
+
* ```
|
|
50
135
|
*/
|
|
51
136
|
const getDefaultAvatarList = factory('getDefaultAvatarList', {
|
|
52
137
|
namespace: 'health'
|
|
@@ -57,6 +142,29 @@ const getDefaultAvatarList = factory('getDefaultAvatarList', {
|
|
|
57
142
|
*
|
|
58
143
|
* @public
|
|
59
144
|
* @since @ray-js/ray 1.5.40
|
|
145
|
+
* @example 基础用法
|
|
146
|
+
* ```ts
|
|
147
|
+
* import { health } from '@ray-js/ray';
|
|
148
|
+
*
|
|
149
|
+
* health.reportPanelBpgData({
|
|
150
|
+
* devId: 'vdevo169477319679442',
|
|
151
|
+
* userId: 'user123',
|
|
152
|
+
* dataJson: [{
|
|
153
|
+
* dps: {
|
|
154
|
+
* 1: 120,
|
|
155
|
+
* 2: 80,
|
|
156
|
+
* 3: 72,
|
|
157
|
+
* 4: false,
|
|
158
|
+
* 9: 'user123',
|
|
159
|
+
* },
|
|
160
|
+
* dpsTime: Date.now(),
|
|
161
|
+
* }],
|
|
162
|
+
* }).then((res) => {
|
|
163
|
+
* console.log('上传结果:', res);
|
|
164
|
+
* }).catch((error) => {
|
|
165
|
+
* console.error(error);
|
|
166
|
+
* });
|
|
167
|
+
* ```
|
|
60
168
|
*/
|
|
61
169
|
const reportPanelBpgData = factory('reportPanelBpgData', {
|
|
62
170
|
namespace: 'health'
|
|
@@ -67,6 +175,26 @@ const reportPanelBpgData = factory('reportPanelBpgData', {
|
|
|
67
175
|
*
|
|
68
176
|
* @public
|
|
69
177
|
* @since @ray-js/ray 1.5.40
|
|
178
|
+
* @example 基础用法
|
|
179
|
+
* ```ts
|
|
180
|
+
* import { health } from '@ray-js/ray';
|
|
181
|
+
*
|
|
182
|
+
* health.reportSingleBpgData({
|
|
183
|
+
* dataInfo: {
|
|
184
|
+
* devId: 'vdevo169477319679442',
|
|
185
|
+
* userId: 'user123',
|
|
186
|
+
* sys: 120,
|
|
187
|
+
* dia: 80,
|
|
188
|
+
* pulse: 72,
|
|
189
|
+
* time: Date.now(),
|
|
190
|
+
* remark: '早晨测量',
|
|
191
|
+
* },
|
|
192
|
+
* }).then((res) => {
|
|
193
|
+
* console.log('上传结果:', res);
|
|
194
|
+
* }).catch((error) => {
|
|
195
|
+
* console.error(error);
|
|
196
|
+
* });
|
|
197
|
+
* ```
|
|
70
198
|
*/
|
|
71
199
|
const reportSingleBpgData = factory('reportSingleBpgData', {
|
|
72
200
|
namespace: 'health'
|
|
@@ -77,6 +205,19 @@ const reportSingleBpgData = factory('reportSingleBpgData', {
|
|
|
77
205
|
*
|
|
78
206
|
* @public
|
|
79
207
|
* @since @ray-js/ray 1.5.40
|
|
208
|
+
* @example 基础用法
|
|
209
|
+
* ```ts
|
|
210
|
+
* import { health } from '@ray-js/ray';
|
|
211
|
+
*
|
|
212
|
+
* health.updateBpgDataRemark({
|
|
213
|
+
* uuid: 'bpg123',
|
|
214
|
+
* remark: '饭后测量',
|
|
215
|
+
* }).then((success) => {
|
|
216
|
+
* console.log('更新结果:', success);
|
|
217
|
+
* }).catch((error) => {
|
|
218
|
+
* console.error(error);
|
|
219
|
+
* });
|
|
220
|
+
* ```
|
|
80
221
|
*/
|
|
81
222
|
const updateBpgDataRemark = factory('updateBpgDataRemark', {
|
|
82
223
|
namespace: 'health'
|
|
@@ -87,6 +228,19 @@ const updateBpgDataRemark = factory('updateBpgDataRemark', {
|
|
|
87
228
|
*
|
|
88
229
|
* @public
|
|
89
230
|
* @since @ray-js/ray 1.5.40
|
|
231
|
+
* @example 基础用法
|
|
232
|
+
* ```ts
|
|
233
|
+
* import { health } from '@ray-js/ray';
|
|
234
|
+
*
|
|
235
|
+
* health.deleteBpgData({
|
|
236
|
+
* userId: 'user123',
|
|
237
|
+
* uuids: 'bpg123,bpg456',
|
|
238
|
+
* }).then((success) => {
|
|
239
|
+
* console.log('删除结果:', success);
|
|
240
|
+
* }).catch((error) => {
|
|
241
|
+
* console.error(error);
|
|
242
|
+
* });
|
|
243
|
+
* ```
|
|
90
244
|
*/
|
|
91
245
|
const deleteBpgData = factory('deleteBpgData', {
|
|
92
246
|
namespace: 'health'
|
|
@@ -97,6 +251,25 @@ const deleteBpgData = factory('deleteBpgData', {
|
|
|
97
251
|
*
|
|
98
252
|
* @public
|
|
99
253
|
* @since @ray-js/ray 1.5.40
|
|
254
|
+
* @example 基础用法
|
|
255
|
+
* ```ts
|
|
256
|
+
* import { health } from '@ray-js/ray';
|
|
257
|
+
*
|
|
258
|
+
* health.getBpgDataHistory({
|
|
259
|
+
* devId: 'vdevo169477319679442',
|
|
260
|
+
* userId: 'user123',
|
|
261
|
+
* startTime: Date.now() - 30 * 24 * 60 * 60 * 1000,
|
|
262
|
+
* endTime: Date.now(),
|
|
263
|
+
* bpLevels: '',
|
|
264
|
+
* existRemark: '',
|
|
265
|
+
* offset: 0,
|
|
266
|
+
* limit: 20,
|
|
267
|
+
* }).then((res) => {
|
|
268
|
+
* console.log('历史数据:', res);
|
|
269
|
+
* }).catch((error) => {
|
|
270
|
+
* console.error(error);
|
|
271
|
+
* });
|
|
272
|
+
* ```
|
|
100
273
|
*/
|
|
101
274
|
const getBpgDataHistory = factory('getBpgDataHistory', {
|
|
102
275
|
namespace: 'health'
|
|
@@ -107,6 +280,19 @@ const getBpgDataHistory = factory('getBpgDataHistory', {
|
|
|
107
280
|
*
|
|
108
281
|
* @public
|
|
109
282
|
* @since @ray-js/ray 1.5.40
|
|
283
|
+
* @example 基础用法
|
|
284
|
+
* ```ts
|
|
285
|
+
* import { health } from '@ray-js/ray';
|
|
286
|
+
*
|
|
287
|
+
* health.getBpgDataTrendLatest({
|
|
288
|
+
* devId: 'vdevo169477319679442',
|
|
289
|
+
* userId: 'user123',
|
|
290
|
+
* }).then((res) => {
|
|
291
|
+
* console.log('最新统计:', res);
|
|
292
|
+
* }).catch((error) => {
|
|
293
|
+
* console.error(error);
|
|
294
|
+
* });
|
|
295
|
+
* ```
|
|
110
296
|
*/
|
|
111
297
|
const getBpgDataTrendLatest = factory('getBpgDataTrendLatest', {
|
|
112
298
|
namespace: 'health'
|
|
@@ -117,6 +303,21 @@ const getBpgDataTrendLatest = factory('getBpgDataTrendLatest', {
|
|
|
117
303
|
*
|
|
118
304
|
* @public
|
|
119
305
|
* @since @ray-js/ray 1.5.40
|
|
306
|
+
* @example 基础用法
|
|
307
|
+
* ```ts
|
|
308
|
+
* import { health } from '@ray-js/ray';
|
|
309
|
+
*
|
|
310
|
+
* health.getBpgDataLevnum({
|
|
311
|
+
* devId: 'vdevo169477319679442',
|
|
312
|
+
* userId: 'user123',
|
|
313
|
+
* startTime: Date.now() - 30 * 24 * 60 * 60 * 1000,
|
|
314
|
+
* endTime: Date.now(),
|
|
315
|
+
* }).then((res) => {
|
|
316
|
+
* console.log('等级统计:', res);
|
|
317
|
+
* }).catch((error) => {
|
|
318
|
+
* console.error(error);
|
|
319
|
+
* });
|
|
320
|
+
* ```
|
|
120
321
|
*/
|
|
121
322
|
const getBpgDataLevnum = factory('getBpgDataLevnum', {
|
|
122
323
|
namespace: 'health'
|
|
@@ -127,6 +328,22 @@ const getBpgDataLevnum = factory('getBpgDataLevnum', {
|
|
|
127
328
|
*
|
|
128
329
|
* @public
|
|
129
330
|
* @since @ray-js/ray 1.5.40
|
|
331
|
+
* @example 基础用法
|
|
332
|
+
* ```ts
|
|
333
|
+
* import { health } from '@ray-js/ray';
|
|
334
|
+
*
|
|
335
|
+
* health.getBpgDataTrend({
|
|
336
|
+
* dataType: 'week',
|
|
337
|
+
* devId: 'vdevo169477319679442',
|
|
338
|
+
* userId: 'user123',
|
|
339
|
+
* startTime: Date.now() - 7 * 24 * 60 * 60 * 1000,
|
|
340
|
+
* endTime: Date.now(),
|
|
341
|
+
* }).then((res) => {
|
|
342
|
+
* console.log('统计趋势:', res);
|
|
343
|
+
* }).catch((error) => {
|
|
344
|
+
* console.error(error);
|
|
345
|
+
* });
|
|
346
|
+
* ```
|
|
130
347
|
*/
|
|
131
348
|
const getBpgDataTrend = factory('getBpgDataTrend', {
|
|
132
349
|
namespace: 'health'
|
|
@@ -137,6 +354,21 @@ const getBpgDataTrend = factory('getBpgDataTrend', {
|
|
|
137
354
|
*
|
|
138
355
|
* @public
|
|
139
356
|
* @since @ray-js/ray 1.5.40
|
|
357
|
+
* @example 基础用法
|
|
358
|
+
* ```ts
|
|
359
|
+
* import { health } from '@ray-js/ray';
|
|
360
|
+
*
|
|
361
|
+
* health.getBpgDataDays({
|
|
362
|
+
* devId: 'vdevo169477319679442',
|
|
363
|
+
* userId: 'user123',
|
|
364
|
+
* startTime: Date.now() - 30 * 24 * 60 * 60 * 1000,
|
|
365
|
+
* endTime: Date.now(),
|
|
366
|
+
* }).then((days) => {
|
|
367
|
+
* console.log('有数据的日期:', days);
|
|
368
|
+
* }).catch((error) => {
|
|
369
|
+
* console.error(error);
|
|
370
|
+
* });
|
|
371
|
+
* ```
|
|
140
372
|
*/
|
|
141
373
|
const getBpgDataDays = factory('getBpgDataDays', {
|
|
142
374
|
namespace: 'health'
|
|
@@ -147,6 +379,20 @@ const getBpgDataDays = factory('getBpgDataDays', {
|
|
|
147
379
|
*
|
|
148
380
|
* @public
|
|
149
381
|
* @since @ray-js/ray 1.5.40
|
|
382
|
+
* @example 基础用法
|
|
383
|
+
* ```ts
|
|
384
|
+
* import { health } from '@ray-js/ray';
|
|
385
|
+
*
|
|
386
|
+
* health.getBpgDataUnallocated({
|
|
387
|
+
* devId: 'vdevo169477319679442',
|
|
388
|
+
* offset: 0,
|
|
389
|
+
* limit: 20,
|
|
390
|
+
* }).then((res) => {
|
|
391
|
+
* console.log('未分配数据:', res);
|
|
392
|
+
* }).catch((error) => {
|
|
393
|
+
* console.error(error);
|
|
394
|
+
* });
|
|
395
|
+
* ```
|
|
150
396
|
*/
|
|
151
397
|
const getBpgDataUnallocated = factory('getBpgDataUnallocated', {
|
|
152
398
|
namespace: 'health'
|
|
@@ -157,6 +403,20 @@ const getBpgDataUnallocated = factory('getBpgDataUnallocated', {
|
|
|
157
403
|
*
|
|
158
404
|
* @public
|
|
159
405
|
* @since @ray-js/ray 1.5.40
|
|
406
|
+
* @example 基础用法
|
|
407
|
+
* ```ts
|
|
408
|
+
* import { health } from '@ray-js/ray';
|
|
409
|
+
*
|
|
410
|
+
* health.updateBpgDataUnallocated({
|
|
411
|
+
* userId: 'user123',
|
|
412
|
+
* uuids: 'bpg123,bpg456',
|
|
413
|
+
* devId: 'vdevo169477319679442',
|
|
414
|
+
* }).then((success) => {
|
|
415
|
+
* console.log('分配结果:', success);
|
|
416
|
+
* }).catch((error) => {
|
|
417
|
+
* console.error(error);
|
|
418
|
+
* });
|
|
419
|
+
* ```
|
|
160
420
|
*/
|
|
161
421
|
const updateBpgDataUnallocated = factory('updateBpgDataUnallocated', {
|
|
162
422
|
namespace: 'health'
|
|
@@ -167,6 +427,18 @@ const updateBpgDataUnallocated = factory('updateBpgDataUnallocated', {
|
|
|
167
427
|
*
|
|
168
428
|
* @public
|
|
169
429
|
* @since @ray-js/ray 1.5.40
|
|
430
|
+
* @example 基础用法
|
|
431
|
+
* ```ts
|
|
432
|
+
* import { health } from '@ray-js/ray';
|
|
433
|
+
*
|
|
434
|
+
* health.deleteBpgDataUnallocated({
|
|
435
|
+
* uuids: 'bpg123,bpg456',
|
|
436
|
+
* }).then((success) => {
|
|
437
|
+
* console.log('删除结果:', success);
|
|
438
|
+
* }).catch((error) => {
|
|
439
|
+
* console.error(error);
|
|
440
|
+
* });
|
|
441
|
+
* ```
|
|
170
442
|
*/
|
|
171
443
|
const deleteBpgDataUnallocated = factory('deleteBpgDataUnallocated', {
|
|
172
444
|
namespace: 'health'
|