@ray-js/api 1.6.0-beta.9 → 1.6.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.
Files changed (81) hide show
  1. package/@types/BaseKit.d.ts +837 -37
  2. package/@types/BizKit.d.ts +1831 -85
  3. package/@types/DeviceKit.d.ts +581 -58
  4. package/@types/HomeKit.d.ts +0 -74
  5. package/@types/MiniKit.d.ts +411 -8
  6. package/@types/api-cloud.d.ts +145 -0
  7. package/@types/api-extend.d.ts +42 -10
  8. package/@types/api.d.ts +3 -0
  9. package/@types/gateway.d.ts +146 -0
  10. package/@types/health.d.ts +309 -0
  11. package/lib/{BaseKit-3.11.0.d.ts → BaseKit-3.14.3.d.ts} +29 -1
  12. package/lib/{BaseKit-3.11.0.js → BaseKit-3.14.3.js} +32 -1
  13. package/lib/BizKit-4.10.4.d.ts +84 -0
  14. package/lib/{BizKit-3.2.7.js → BizKit-4.10.4.js} +46 -5
  15. package/lib/{DeviceKit-3.3.1.d.ts → DeviceKit-4.9.0.d.ts} +22 -1
  16. package/lib/{DeviceKit-3.3.1.js → DeviceKit-4.9.0.js} +66 -0
  17. package/lib/HomeKit-3.1.4.d.ts +0 -1
  18. package/lib/MapKit-3.4.13.d.ts +0 -1
  19. package/lib/{MiniKit-3.1.0.d.ts → MiniKit-3.12.1.d.ts} +11 -1
  20. package/lib/{MiniKit-3.1.0.js → MiniKit-3.12.1.js} +12 -1
  21. package/lib/OutdoorKit-1.0.4.d.ts +0 -1
  22. package/lib/P2PKit-2.0.3.d.ts +0 -1
  23. package/lib/PlayNetKit-1.1.3.d.ts +24 -24
  24. package/lib/all-kits.d.ts +5 -5
  25. package/lib/all-kits.js +5 -5
  26. package/lib/cloud/device.d.ts +3 -3
  27. package/lib/cloud/gateway.d.ts +11 -0
  28. package/lib/cloud/gateway.js +39 -0
  29. package/lib/cloud/health.d.ts +19 -0
  30. package/lib/cloud/health.js +71 -0
  31. package/lib/cloud/index.d.ts +3 -0
  32. package/lib/cloud/index.js +6 -1
  33. package/lib/cloud/interface.d.ts +40 -1
  34. package/lib/cloud/laser-clean/index.d.ts +3 -0
  35. package/lib/cloud/laser-clean/index.js +3 -0
  36. package/lib/cloud/laser-clean/map.d.ts +3 -0
  37. package/lib/cloud/laser-clean/map.js +4 -0
  38. package/lib/cloud/laser-clean/record.d.ts +3 -0
  39. package/lib/cloud/laser-clean/record.js +4 -0
  40. package/lib/cloud/laser-clean/voice.d.ts +2 -0
  41. package/lib/cloud/laser-clean/voice.js +3 -0
  42. package/lib/cloud/recipe/basket.js +1 -0
  43. package/lib/cloud/recipe/custom.js +1 -0
  44. package/lib/cloud/recipe/menu.js +1 -0
  45. package/lib/cloud/recipe/query.js +1 -0
  46. package/lib/cloud/recipe/score.js +1 -0
  47. package/lib/cloud/recipe/star.js +1 -0
  48. package/lib/getBoundingClientRect/index.thing.js +1 -0
  49. package/lib/getBoundingClientRect/index.wechat.js +1 -0
  50. package/lib/getCdnUrl/index.thing.js +13 -8
  51. package/lib/hideTabBar/index.d.ts +4 -5
  52. package/lib/index.d.ts +0 -1
  53. package/lib/navigateBack/index.d.ts +0 -1
  54. package/lib/navigateTo/index.d.ts +0 -1
  55. package/lib/panel/devInfo/index.js +7 -1
  56. package/lib/panel/i18n/index.js +4 -0
  57. package/lib/panel/i18n/index.wechat.js +4 -0
  58. package/lib/panel/publishDps.js +2 -0
  59. package/lib/reLaunch/index.d.ts +0 -1
  60. package/lib/redirectTo/index.d.ts +0 -1
  61. package/lib/redirectTo/index.js +1 -0
  62. package/lib/requestCloud/index.d.ts +0 -1
  63. package/lib/setNavigationBarColor/index.d.ts +0 -1
  64. package/lib/setNavigationBarTitle/index.d.ts +0 -1
  65. package/lib/showTabBar/index.d.ts +4 -5
  66. package/lib/switchTab/index.d.ts +0 -1
  67. package/lib/utils.wechat.js +1 -0
  68. package/lib/viewAPI.d.ts +1 -1
  69. package/lib/viewAPI.js +2 -1
  70. package/package.json +8 -8
  71. package/lib/BizKit-3.2.7.d.ts +0 -46
  72. package/lib/cloud/doorlock/README.md +0 -62
  73. package/lib/cloud/doorlock/auth.md +0 -323
  74. package/lib/cloud/doorlock/device.md +0 -265
  75. package/lib/cloud/doorlock/log.md +0 -153
  76. package/lib/cloud/doorlock/member-opmode.md +0 -279
  77. package/lib/cloud/doorlock/member.md +0 -276
  78. package/lib/cloud/doorlock/offline-pwd.md +0 -155
  79. package/lib/cloud/doorlock/temp-pwd.md +0 -362
  80. package/lib/cloud/doorlock/unlock-method.md +0 -121
  81. package/lib/cloud/doorlock/unlock.md +0 -222
@@ -0,0 +1,145 @@
1
+ // api云能力扩展
2
+ declare namespace ty {
3
+ // #region 获取云存储配置
4
+ type GetSweeperStorageConfigParams = {
5
+ // 设备id
6
+ devId: string
7
+ // 类型
8
+ type?: string
9
+ }
10
+
11
+ // 获取云存储配置返回值
12
+ type GetSweeperStorageConfigResponse = {
13
+ // ak
14
+ ak: string
15
+ // bucket
16
+ bucket: string
17
+ // sk
18
+ sk: string
19
+ // token
20
+ token: string
21
+ // endpoint
22
+ endpoint: string
23
+ // 过期时间
24
+ expiration: string
25
+ // 生命周期
26
+ lifeCycle: number
27
+ // 区域
28
+ region: string
29
+ }
30
+
31
+ /**
32
+ * 获取云存储配置
33
+ * @returns 获取云存储配置结果的 Promise
34
+ */
35
+ function getSweeperStorageConfig(
36
+ params: GetSweeperStorageConfigParams
37
+ ): Promise<GetSweeperStorageConfigResponse>
38
+
39
+ // #region 获取扫地机的历史地图
40
+ type GetMultipleMapFilesParams = {
41
+ //设备id
42
+ devId: string
43
+ }
44
+
45
+ type GetMultipleMapFilesResponse = {
46
+ datas: {
47
+ bucket: string // 存储文件的存储桶
48
+ extend: string // 文件的附加信息
49
+ time: number // 文件的时间戳
50
+ id: number // 文件的唯一标识符
51
+ file: string // 文件路径或路径
52
+ devId: string // 与文件关联的设备ID
53
+ fileType: string // 文件类型
54
+ }[] // 历史地图列表
55
+ totalCount: number // 数据总数
56
+ }
57
+
58
+ /**
59
+ * 获取扫地机的历史地图
60
+ * @returns 获取扫地机的历史地图结果的 Promise
61
+ */
62
+ export function getMultipleMapFiles(
63
+ params: GetMultipleMapFilesParams
64
+ ): Promise<GetMultipleMapFilesResponse>
65
+
66
+ // #region 获取清扫记录列表
67
+ type GetCleaningRecordsParams = {
68
+ startTime: string // 开始时间
69
+ endTime: string // 结束时间
70
+ limit: number // 返回的数据长度限制
71
+ offset: number // 偏移量
72
+ devId: string // 设备Id
73
+ fileType?: string // 可选参数,默认'pic'
74
+ }
75
+
76
+ type GetCleaningRecordsResponse = {
77
+ datas: {
78
+ bucket: string
79
+ extend: string // 清扫信息
80
+ devId: string
81
+ file: string
82
+ time: number
83
+ id: number // 清扫记录的唯一ID
84
+ fileType: string
85
+ }[]
86
+ totalCount: number // 清扫记录总长度
87
+ }
88
+
89
+ export function getCleaningRecords(
90
+ params: GetCleaningRecordsParams
91
+ ): Promise<GetCleaningRecordsResponse>
92
+
93
+ // #region 删除清扫记录
94
+ type DeleteCleaningRecordParams = {
95
+ devId: string // 设备id
96
+ fileIds: number[] // 要删除的记录id
97
+ }
98
+
99
+ type DeleteCleaningRecordResponse = boolean
100
+
101
+ /**
102
+ * 删除清扫记录
103
+ * @returns 删除清扫记录结果的 Promise
104
+ */
105
+ function deleteCleaningRecord(
106
+ params: DeleteCleaningRecordParams
107
+ ): Promise<DeleteCleaningRecordResponse>
108
+
109
+ // #region 获取扫地机的语音包列表
110
+ type GetVoiceListParams = {
111
+ //设备id
112
+ devId: string
113
+ //设备id - 兼容
114
+ deviceId?: string
115
+ // 分页参数,一般配置的语言包不多,可以不是用分页查询,直接使用0
116
+ offset: number
117
+ // 每页大小,可以传入100
118
+ limit: number
119
+ }
120
+
121
+ type GetVoiceListResponse = {
122
+ datas: {
123
+ auditionUrl: string // 试听链接
124
+ desc?: string // 描述
125
+ extendData: {
126
+ extendId: number // 扩展ID,通过这个id与设备上报的语言包id进行对比,判断语音包是否使用中
127
+ version: string // 版本
128
+ }
129
+ id: number // ID
130
+ imgUrl: string // 图片链接
131
+ name: string // 名称
132
+ officialUrl: string // 官方链接
133
+ productId: string // 产品ID
134
+ region: string[] // 区域代码
135
+ }[] // 语音数据数组
136
+ pageNo: number // 页码
137
+ totalCount: number // 数据总数
138
+ }
139
+
140
+ /**
141
+ * 获取扫地机的语音包列表
142
+ * @returns 获取扫地机的语音包列表结果的 Promise
143
+ */
144
+ function getVoiceList(params: GetVoiceListParams): Promise<GetVoiceListResponse>
145
+ }
@@ -122,20 +122,20 @@ interface setNavigationBarBackParam {
122
122
 
123
123
  interface CanvasGetImageDataProps extends Callback {
124
124
  canvasId: string
125
- x: string
126
- y: string
127
- width: string
128
- height: string
129
- success(res: { width: string; height: string; data: Uint8ClampedArray }): void
125
+ x: number
126
+ y: number
127
+ width: number
128
+ height: number
129
+ success(res: { width: number; height: number; data: Array }): void
130
130
  }
131
131
 
132
132
  interface CanvasPutImageDataProps extends Callback {
133
133
  canvasId: string
134
- x: string
135
- y: string
136
- width: string
137
- height: string
138
- data: Uint8ClampedArray
134
+ x: number
135
+ y: number
136
+ width: number
137
+ height: number
138
+ data: Array
139
139
  }
140
140
 
141
141
  interface VideoContext {
@@ -226,6 +226,29 @@ interface WebviewContext {
226
226
  postMessage(options: { data: Record<string, any> }): void
227
227
  reload(options: Callback): void
228
228
  }
229
+
230
+ interface SocketTask {
231
+ send(option: { data: string | ArrayBuffer; success?: () => void; fail?: () => void; complete?: () => void }): void
232
+ close(option: { code?: number; reason?: string; success?: () => void; fail?: () => void; complete?: () => void }): void
233
+ onOpen(callback: () => void): void
234
+ onClose(callback: () => void): void
235
+ onError(callback: () => void): void
236
+ onMessage(callback: (res: { data: string | ArrayBuffer }) => void): void
237
+ }
238
+
239
+ interface ConnectSocketProps {
240
+ url: string;
241
+ protocols?: string[];
242
+ header?: Record<string, string>;
243
+ timeout?: number;
244
+ tcpNoDelay?: boolean;
245
+ perMessageDeflate?: boolean;
246
+ forceCellularNetwork?: boolean;
247
+ success?: () => void;
248
+ fail?: () => void;
249
+ complete?: () => void
250
+ }
251
+
229
252
  declare namespace ty {
230
253
  /**
231
254
  * 小程序云能力
@@ -284,7 +307,16 @@ declare namespace ty {
284
307
  export type env = {
285
308
  USER_DATA_PATH: string
286
309
  }
310
+ export function connectSocket(param: ConnectSocketProps): SocketTask
311
+
312
+ /**
313
+ * 判断小程序的API,回调,组件等是否可用 (BaseKit 需要 3.15.1 及以上版本)
314
+ * @param schema 使用 ${API}.${method}.${param}.${option} 或者 ${component}.${attribute}.${option} 方式来调用
315
+ * @returns 是否可用
316
+ */
317
+ export function canIUse(schema: string): boolean
287
318
  }
319
+
288
320
  declare namespace WechatMiniprogram {
289
321
  interface Wx {
290
322
  requestCloud(params: RequestCloudParams): RequestCloudReturn
package/@types/api.d.ts CHANGED
@@ -1,2 +1,5 @@
1
1
  /// <reference path="./all-kits.d.ts" />
2
2
  /// <reference path="./api-extend.d.ts" />
3
+ /// <reference path="./api-cloud.d.ts" />
4
+ /// <reference path="./gateway.d.ts" />
5
+ /// <reference path="./health.d.ts" />
@@ -0,0 +1,146 @@
1
+ declare namespace ty.gateway {
2
+ // 1. 下发更新LQI指令
3
+ type SendCmdForRefreshDeviceLQIParams = {
4
+ devId: string; // 子设备id
5
+ };
6
+
7
+ type SendCmdForRefreshDeviceLQIResponse = boolean; // 是否下发成功
8
+
9
+ function sendCmdForRefreshDeviceLQI(params: SendCmdForRefreshDeviceLQIParams): Promise<SendCmdForRefreshDeviceLQIResponse>;
10
+
11
+ // 2. 获取设备最新LQI
12
+ type GetLastDeviceLQIParams = {
13
+ devId: string; //子设备id
14
+ offsetTime: number; //时间偏移量,单位为毫秒
15
+ };
16
+
17
+ type DeviceLQI = {
18
+ deviceId: string; //设备id
19
+ deviceName: string; //设备名称
20
+ isGateway: boolean; //是否是网关
21
+ lqi: number; // 子设备lqi值
22
+ }
23
+
24
+ type GetLastDeviceLQIResponse = DeviceLQI[];
25
+
26
+ function getLastDeviceLQI(params: GetLastDeviceLQIParams): Promise<GetLastDeviceLQIResponse>;
27
+
28
+ // 3. 查询设备高级能力
29
+ type GetSeniorAbilityParams = {
30
+ devId: string; // 设备id
31
+ };
32
+
33
+ type GetSeniorAbilityResponse = {
34
+ [key: string]: string;
35
+ };
36
+
37
+ function getSeniorAbility(params: GetSeniorAbilityParams): Promise<GetSeniorAbilityResponse>;
38
+
39
+ // 4. 获取网关子设备数量限制
40
+ type GetGatewaySubDevLimitParams = {
41
+ devId: string; // 设备id
42
+ };
43
+
44
+ type GetGatewaySubDevLimitResponse = {
45
+ max?: number; // 子设备数量上限
46
+ blu?: number; // 蓝牙子设备数量上限
47
+ zig?: number; // zigbee子设备数量上限
48
+ ver?: number; // 版本,嵌入式端上报
49
+ };
50
+
51
+ function getGatewaySubDevLimit(params: GetGatewaySubDevLimitParams): Promise<GetGatewaySubDevLimitResponse>;
52
+
53
+ // 5. mesh类设备拖拽
54
+ type UpdateRelationMeshParams = {
55
+ nodeIds: string[]; // 需要拖拽的子设备id列表
56
+ sourceMeshId?: string; // 原meshId或者网关Id
57
+ targetMeshId?: string; // 目标meshId或者网关Id
58
+ };
59
+
60
+ type UpdateRelationMeshResponse = {
61
+ repeatNodeIds: string[]; //已在网关下的设备列表
62
+ };
63
+
64
+ function updateRelationMesh(params: UpdateRelationMeshParams): Promise<UpdateRelationMeshResponse>;
65
+
66
+ // 6. 蓝牙单点类设备拖拽
67
+ type UpdateRelationBlueParams = {
68
+ nodes: {
69
+ devId: string;
70
+ uuid: string;
71
+ }[]; // 需要拖拽的子设备id与uuid列表
72
+ sourceMeshId?: string; // 原网关Id
73
+ targetMeshId?: string; // 目标网关Id
74
+ };
75
+
76
+ type UpdateRelationBlueResponse = {
77
+ repeatNodeIds: string[]; //已在网关下的设备列表
78
+ };
79
+
80
+ function updateRelationBlue(params: UpdateRelationBlueParams): Promise<UpdateRelationBlueResponse>;
81
+
82
+ // 7. beacon类设备拖拽
83
+ type UpdateRelationBeaconParams = {
84
+ nodes: {
85
+ devId: string;
86
+ mac: string;
87
+ }[]; // 需要拖拽的子设备id与mac列表
88
+ sourceMeshId?: string; // 原网关Id
89
+ targetMeshId?: string; // 目标网关Id
90
+ };
91
+
92
+ type UpdateRelationBeaconResponse = {
93
+ repeatNodeIds: string[]; //已在网关下的设备列表
94
+ };
95
+
96
+ function updateRelationBeacon(params: UpdateRelationBeaconParams): Promise<UpdateRelationBeaconResponse>;
97
+
98
+ // 8. 获取网关的能力
99
+ type GetGatewayAbilityParams = {
100
+ devIds: string; // 设备id拼成的字符串,以逗号分隔
101
+ };
102
+
103
+ type GatewayAbility = {
104
+ capability: number; // 能力值
105
+ devId: string; // 设备id
106
+ lqi: number; // 设备信号质量
107
+ performance?: number; // 网关性能指标
108
+ subMaximum?: { // 子设备数量上线
109
+ data?: { // 各类型子设备数量上线
110
+ [key: string]: number;
111
+ },
112
+ version?: number; // 版本
113
+ };
114
+ }
115
+
116
+ type GetGatewayAbilityResponse = GatewayAbility[];
117
+
118
+ function getGatewayAbility(params: GetGatewayAbilityParams): Promise<GetGatewayAbilityResponse>;
119
+
120
+ // 9. 获取设备日志
121
+ type GetSecurityDeviceLogParams = {
122
+ queryStr: string;
123
+ };
124
+
125
+ type DeviceLogData = {
126
+ rowkey: string; // key
127
+ dpName: string; // dp名称
128
+ createTime: number; // 创建时间
129
+ eventTime: number; // 上报时间
130
+ dpId: string; // dpId
131
+ eventType: string; // 事件类型
132
+ value: string; // dp值
133
+ deviceId: string; // 设备id
134
+ }
135
+
136
+ type GetSecurityDeviceLogResponse = {
137
+ devId: string; // 设备id
138
+ datas: DeviceLogData[];
139
+ hasNext: boolean; // 是否还有下一页
140
+ totalCount: number; // 总数
141
+ currentPageStartRowKey?: string; // 当前页起始key
142
+ };
143
+
144
+ function getSecurityDeviceLog(params: GetSecurityDeviceLogParams): Promise<GetSecurityDeviceLogResponse>;
145
+ }
146
+
@@ -0,0 +1,309 @@
1
+ declare namespace ty.health {
2
+ // 新增用户
3
+ type AddPanelUserParams = {
4
+ userInfo: {
5
+ devId: string; // 设备id
6
+ type: 1 | 2 | 3 | 6; // 业务类型:1-血压计;2-厨房秤;3-体脂称;6-血氧仪
7
+ userName: string; // 用户名
8
+ sex: 0 | 1; // 性别 0-男 1-女
9
+ birthday: number; // 生日 时间戳
10
+ height: number; // 身高
11
+ heightUnit: 'cm' | 'inch'; // 身高单位
12
+ weight: number; // 体重
13
+ weightUnit: 'kg' | 'lb' | 'st' | 'jin'; // 体重单位
14
+ userType: number; // 用户类型, 1-主用户,2-临时用户,其他-dp配置用户
15
+ avatar?: string; // 头像
16
+ extInfo?: string | { weightScale: number }; // 扩大10倍保存体重,因为云端不支持小数存储
17
+ },
18
+ };
19
+
20
+ type AddPanelUserResponse = string; // 新增用户 id
21
+
22
+ function addPanelUser(params: AddPanelUserParams): Promise<AddPanelUserResponse>;
23
+
24
+ // 更新用户
25
+ type UpdatePanelUserParams = {
26
+ userInfo: {
27
+ userId: string; // 用户id
28
+ devId: string; // 设备id
29
+ type: 1 | 2 | 3 | 6; // 业务类型:1-血压计;2-厨房秤;3-体脂称;6-血氧仪
30
+ userName: string; // 用户名
31
+ sex: 0 | 1; // 性别 0-男 1-女
32
+ birthday: number; // 生日 时间戳
33
+ height: number; // 身高
34
+ heightUnit: 'cm' | 'inch'; // 身高单位
35
+ weight: number; // 体重
36
+ weightUnit: 'kg' | 'lb' | 'st' | 'jin'; // 体重单位
37
+ userType: number; // 用户类型, 1-主用户,2-临时用户,其他-dp配置用户
38
+ avatar?: string; // 头像
39
+ extInfo?: string | { weightScale: number }; // 扩大10倍保存体重,因为云端不支持小数存储
40
+ },
41
+ };
42
+
43
+ type UpdatePanelUserResponse = boolean; // 是否调用成功
44
+
45
+ function updatePanelUser(params: UpdatePanelUserParams): Promise<UpdatePanelUserResponse>;
46
+
47
+ // 删除用户
48
+ type DeletePanelUserParams = {
49
+ userId: string; // 用户id
50
+ };
51
+
52
+ type DeletePanelUserResponse = boolean; // 是否调用成功
53
+
54
+ function deletePanelUser(params: DeletePanelUserParams): Promise<DeletePanelUserResponse>;
55
+
56
+ // 获取用户列表
57
+ type GetPanelUserListParams = {
58
+ devId: string; // 设备id
59
+ };
60
+
61
+ type User = {
62
+ userId: string; // 用户id
63
+ devId: string; // 设备id
64
+ type: 1 | 2 | 3 | 6; // 业务类型:1-血压计;2-厨房秤;3-体脂称;6-血氧仪
65
+ userName: string; // 用户名
66
+ sex: 0 | 1; // 性别 0-男 1-女
67
+ birthday: number; // 生日 时间戳
68
+ height: number; // 身高
69
+ heightUnit: 'cm' | 'inch'; // 身高单位
70
+ weight: number; // 体重
71
+ weightUnit: 'kg' | 'lb' | 'st' | 'jin'; // 体重单位
72
+ userType: number; // 用户类型, 1-主用户,2-临时用户,其他-dp配置用户
73
+ avatar?: string; // 头像
74
+ extInfo?: string | { weightScale: number }; // 扩大10倍保存体重,因为云端不支持小数存储
75
+ }
76
+
77
+ type GetPanelUserListResponse = User[]; // 用户列表
78
+
79
+ function getPanelUserList(params: GetPanelUserListParams): Promise<GetPanelUserListResponse>;
80
+
81
+ // 获取默认头像列表
82
+ type GetDefaultAvatarListParams = {
83
+ bizCode: 'default_avatar'
84
+ };
85
+
86
+ type Avatar = {
87
+ key: string; // 头像名
88
+ path: string; // 头像地址
89
+ }
90
+
91
+ type GetDefaultAvatarListResponse = Avatar[]; // 头像列表
92
+
93
+ function getDefaultAvatarList(params: GetDefaultAvatarListParams): Promise<GetDefaultAvatarListResponse>;
94
+
95
+ // 血压数据相关API定义
96
+
97
+ // 1. 面板上传血压数据
98
+ type BpgData = {
99
+ dps: {
100
+ 1: number, // 收缩压
101
+ 2: number, // 舒张压
102
+ 3: number, // 脉搏
103
+ 4: boolean, // 是否心率不齐
104
+ 9: string, // 用户标识
105
+ },
106
+ dpsTime: number // dp 上报时间戳
107
+ }
108
+
109
+ type ReportPanelBpgDataParams = {
110
+ devId: string; // 设备id
111
+ userId: string; // 用户id
112
+ dataJson: BpgData[]
113
+ };
114
+
115
+ type ReportPanelBpgDataResponse = {
116
+ allocate: boolean, // 是否已成功上传
117
+ uuid: number, // 血压数据id
118
+ };
119
+
120
+ function reportPanelBpgData(params: ReportPanelBpgDataParams): Promise<ReportPanelBpgDataResponse>;
121
+
122
+ // 2. 手动上传血压数据
123
+ type ReportSingleBpgDataParams = {
124
+ dataInfo: {
125
+ devId: string, // 设备id
126
+ userId: string, // 用户id
127
+ sys: number, // 收缩压
128
+ dia: number, // 舒张压
129
+ pulse: number, // 脉搏
130
+ time: number, // 时间戳
131
+ remark: string, // 备注
132
+ }
133
+ };
134
+
135
+ type ReportSingleBpgDataResponse = {
136
+ allocate: boolean, // 是否已成功上传
137
+ uuid: number, // 血压数据id
138
+ };
139
+
140
+ function reportSingleBpgData(params: ReportSingleBpgDataParams): Promise<ReportSingleBpgDataResponse>;
141
+
142
+ // 3. 更新血压数据备注
143
+ type UpdateBpgDataRemarkParams = {
144
+ remark: string; // 备注
145
+ uuid: string; // 血压数据id
146
+ };
147
+
148
+ type UpdateBpgDataRemarkResponse = boolean; // 是否调用成功
149
+
150
+ function updateBpgDataRemark(params: UpdateBpgDataRemarkParams): Promise<UpdateBpgDataRemarkResponse>;
151
+
152
+ // 4. 删除血压数据
153
+ type DeleteBpgDataParams = {
154
+ userId: string; // 用户id
155
+ uuids: string; // 血压数据id
156
+ };
157
+
158
+ type DeleteBpgDataResponse = boolean; // 是否调用成功
159
+
160
+ function deleteBpgData(params: DeleteBpgDataParams): Promise<DeleteBpgDataResponse>;
161
+
162
+ // 5. 获取历史血压数据
163
+ type GetBpgDataHistoryParams = {
164
+ devId: string; // 设备id
165
+ userId: string; // 用户id
166
+ startTime: number; // 开始时间
167
+ endTime: number; // 结束时间
168
+ bpLevels: string; // 血压等级
169
+ existRemark: string; // 备注
170
+ offset: number; // 页数
171
+ limit: number; // 每页几条数据
172
+ };
173
+
174
+ type BpgHistoryData = {
175
+ arr: boolean; // 是否心率不齐
176
+ bpLevel: 'WHO_LV0' | 'WHO_LV1' | 'WHO_LV2' | 'WHO_LV3' | 'WHO_LV4' | 'WHO_LV5'; // 血压等级
177
+ devId: string; // 设备id
178
+ dia: string; // 舒张压
179
+ pulse: string; // 脉搏
180
+ remark: string; // 备注
181
+ reportType: 1 | 2; // 数据类型 1-面板上报 2-手动添加
182
+ sys: string; // 收缩压
183
+ time: number; // 时间戳
184
+ userId: string; // 用户id
185
+ uuid: string; // 血压id
186
+ }
187
+
188
+ type GetBpgDataHistoryResponse = {
189
+ datas: BpgHistoryData[]; // 血压数据列表
190
+ hasNext: boolean; // 是否有下一页
191
+ totalCount: number; // 血压数据总数
192
+ }
193
+
194
+ function getBpgDataHistory(params: GetBpgDataHistoryParams): Promise<GetBpgDataHistoryResponse>;
195
+
196
+ // 6. 获取最新一天血压统计数据
197
+ type GetBpgDataTrendLatestParams = {
198
+ devId: string; // 设备id
199
+ userId: string; // 用户id
200
+ };
201
+
202
+ type BpgTrendData = {
203
+ avgDia: string; // 舒张压
204
+ avgPulse: string; // 脉搏
205
+ avgSys: string; // 收缩压
206
+ time: number; // 时间戳
207
+ }
208
+
209
+ type GetBpgDataTrendLatestResponse = {
210
+ avgTotalDia: string; // 平均舒张压
211
+ avgTotalPulse: string; // 平均脉搏
212
+ avgTotalSys: string; // 平均收缩压
213
+ list: BpgTrendData[]
214
+ }
215
+
216
+ function getBpgDataTrendLatest(params: GetBpgDataTrendLatestParams): Promise<GetBpgDataTrendLatestResponse>;
217
+
218
+ // 7. 获取血压等级统计数据
219
+ type GetBpgDataLevnumParams = {
220
+ devId: string; // 设备id
221
+ userId: string; // 用户id
222
+ startTime: number; // 开始时间戳
223
+ endTime: number; // 结束时间戳
224
+ };
225
+
226
+ type GetBpgDataLevnumResponse = {
227
+ lv0Num: number; // 理想血压数量
228
+ lv0Ratio: number; // 理想血压占比
229
+ lv1Num: number; // 正常血压数量
230
+ lv1Ratio: number; // 正常血压占比
231
+ lv2Num: number; // 正常高压数量
232
+ lv2Ratio: number; // 正常高压占比
233
+ lv3Num: number; // 轻度高血压数量
234
+ lv3Ratio: number; // 轻度高血压占比
235
+ lv4Num: number; // 中度高血压数量
236
+ lv4Ratio: number; // 中度高血压占比
237
+ lv5Num: number; // 高度高血压数量
238
+ lv5Ratio: number; // 高度高血压占比
239
+ totalNum: number; // 数据总条数
240
+ userId: string; // 用户id
241
+ }
242
+
243
+ function getBpgDataLevnum(params: GetBpgDataLevnumParams): Promise<GetBpgDataLevnumResponse>;
244
+
245
+ // 8. 获取血压数据统计信息
246
+ type GetBpgDataTrendParams = {
247
+ dataType: 'year' | 'month' | 'week' // 数据类型
248
+ devId: string; // 设备id
249
+ userId: string; // 用户id
250
+ startTime: number; // 开始时间戳
251
+ endTime: number; // 结束时间戳
252
+ };
253
+
254
+ type GetBpgDataTrendResponse = {
255
+ avgTotalDia: string; // 平均舒张压
256
+ avgTotalPulse: string; // 平均脉搏
257
+ avgTotalSys: string; // 平均收缩压
258
+ list: BpgTrendData[]
259
+ }
260
+
261
+ function getBpgDataTrend(params: GetBpgDataTrendParams): Promise<GetBpgDataTrendResponse>;
262
+
263
+ // 9. 获取有血压数据的日期
264
+ type GetBpgDataDaysParams = {
265
+ devId: string; // 设备id
266
+ userId: string; // 用户id
267
+ startTime: number; // 开始时间戳
268
+ endTime: number; // 结束时间戳
269
+ };
270
+
271
+ type GetBpgDataDaysResponse = number[]; // 日期时间戳
272
+
273
+ function getBpgDataDays(params: GetBpgDataDaysParams): Promise<GetBpgDataDaysResponse>;
274
+
275
+ // 10. 获取未分配血压数据
276
+ type GetBpgDataUnallocatedParams = {
277
+ devId: string; // 设备id
278
+ limit: number; // 每页数量
279
+ offset: number; // 页码
280
+ };
281
+
282
+ type GetBpgDataUnallocatedResponse = {
283
+ datas: BpgHistoryData[]; // 血压数据列表
284
+ hasNext: boolean; // 是否有下一页
285
+ totalCount: number; // 血压数据总数
286
+ }
287
+
288
+ function getBpgDataUnallocated(params: GetBpgDataUnallocatedParams): Promise<GetBpgDataUnallocatedResponse>;
289
+
290
+ // 11. 分配未分配血压数据
291
+ type UpdateBpgDataUnallocatedParams = {
292
+ userId: string; // 用户id
293
+ uuids: string; // 血压数据id,用,分隔多个uuid
294
+ devId: string; // 设备id
295
+ };
296
+
297
+ type UpdateBpgDataUnallocatedResponse = boolean; // 是否调用成功
298
+
299
+ function updateBpgDataUnallocated(params: UpdateBpgDataUnallocatedParams): Promise<UpdateBpgDataUnallocatedResponse>;
300
+
301
+ // 12. 删除未分配血压数据
302
+ type DeleteBpgDataUnallocatedParams = {
303
+ uuids: string; // 血压数据id,用,分隔多个uuid
304
+ };
305
+
306
+ type DeleteBpgDataUnallocatedResponse = boolean; // 是否调用成功
307
+
308
+ function deleteBpgDataUnallocated(params: DeleteBpgDataUnallocatedParams): Promise<DeleteBpgDataUnallocatedResponse>;
309
+ }