@ray-js/api 0.10.0-beta.0 → 0.10.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/@types/BaseKit.d.ts +82 -1
- package/@types/BizKit.d.ts +1 -1
- package/@types/DeviceKit.d.ts +18 -18
- package/@types/PlayNetKit.d.ts +444 -0
- package/lib/PlayNetKit-1.1.3.d.ts +27 -0
- package/lib/PlayNetKit-1.1.3.js +28 -0
- package/lib/all-kits.d.ts +1 -0
- package/lib/all-kits.js +1 -0
- package/lib/cloud/alarm.d.ts +14 -0
- package/lib/cloud/alarm.js +35 -0
- package/lib/cloud/core.d.ts +5 -0
- package/lib/cloud/core.js +16 -0
- package/lib/cloud/device.d.ts +63 -0
- package/lib/cloud/device.js +148 -0
- package/lib/cloud/index.d.ts +6 -0
- package/lib/cloud/index.js +6 -0
- package/lib/cloud/interface.d.ts +960 -0
- package/lib/cloud/interface.js +1 -0
- package/lib/cloud/linkage.d.ts +61 -0
- package/lib/cloud/linkage.js +159 -0
- package/lib/cloud/statistic.d.ts +111 -0
- package/lib/cloud/statistic.js +199 -0
- package/lib/cloud/timer.d.ts +146 -0
- package/lib/cloud/timer.js +275 -0
- package/lib/constants.d.ts +2 -0
- package/lib/constants.js +3 -0
- package/lib/hideTabBar/index.d.ts +1 -7
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/showTabBar/index.d.ts +1 -7
- package/package.json +7 -10
- package/lib/panel/README.md +0 -3
- package/lib/panel/index.d.ts +0 -4
- package/lib/panel/index.js +0 -13
- package/lib/panel/index.thing.d.ts +0 -4
- package/lib/panel/index.thing.js +0 -6
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import { IGetLinkageDeviceList, IBindRule, IGetBindRuleList, IRemoveRule, IGetLinkageDeviceListResponse, IGetSceneListResponse, IGetBindRuleListResponse, IBindRuleResponse } from './interface';
|
2
|
+
/**
|
3
|
+
* 获取家庭下支持联动的设备列表
|
4
|
+
* @param {number} gid 家庭id
|
5
|
+
* @param {string} sourceType 业务范围
|
6
|
+
*/
|
7
|
+
declare const getLinkageDeviceList: (params: IGetLinkageDeviceList) => Promise<IGetLinkageDeviceListResponse>;
|
8
|
+
/**
|
9
|
+
* 查询一键执行场景列表
|
10
|
+
* @param {number} devId 设备id
|
11
|
+
*/
|
12
|
+
declare const getSceneList: ({ devId }: {
|
13
|
+
devId: string;
|
14
|
+
}) => Promise<IGetSceneListResponse>;
|
15
|
+
/**
|
16
|
+
* 查询已绑定的列表
|
17
|
+
* @param {string} bizDomain 业务范围
|
18
|
+
* @param {string} sourceEntityId 设备id
|
19
|
+
* @param {number} entityType 实体类型
|
20
|
+
*/
|
21
|
+
declare const getBindRuleList: (params: IGetBindRuleList) => Promise<IGetBindRuleListResponse>;
|
22
|
+
/**
|
23
|
+
* 绑定联动
|
24
|
+
* @param {string} devId 设备 ID
|
25
|
+
* @param {string} associativeEntityId 关联DP点和DP点值的组合
|
26
|
+
* @param {string} ruleId 关联场景 ID
|
27
|
+
* @param {string} entitySubIds 关联 DP 点
|
28
|
+
* @param {Array} expr 关联DP点、动作组合
|
29
|
+
* @param {string} bizDomain 业务域
|
30
|
+
*/
|
31
|
+
declare const bindRule: ({ devId, associativeEntityId, ruleId, entitySubIds, expr, bizDomain, }: IBindRule) => Promise<IBindRuleResponse>;
|
32
|
+
/**
|
33
|
+
* 解除联动
|
34
|
+
* @param {string} bizDomain 业务范围
|
35
|
+
* @param {string} sourceEntityId 设备id
|
36
|
+
* @param {string} associativeEntityId 关联dp组合
|
37
|
+
* @param {string} associativeEntityValue 规则id
|
38
|
+
*/
|
39
|
+
declare const removeRule: (params: IRemoveRule) => Promise<boolean>;
|
40
|
+
/**
|
41
|
+
* 触发联动
|
42
|
+
* @param {string} ruleId 规则id
|
43
|
+
*/
|
44
|
+
declare const triggerRule: ({ ruleId }: {
|
45
|
+
ruleId: string;
|
46
|
+
}) => Promise<boolean>;
|
47
|
+
/**
|
48
|
+
* 启用联动
|
49
|
+
* @param {string} ruleId 规则id
|
50
|
+
*/
|
51
|
+
declare const enableRule: ({ ruleId }: {
|
52
|
+
ruleId: string;
|
53
|
+
}) => Promise<boolean>;
|
54
|
+
/**
|
55
|
+
* 停用联动
|
56
|
+
* @param {string} ruleId 规则id
|
57
|
+
*/
|
58
|
+
declare const disableRule: ({ ruleId }: {
|
59
|
+
ruleId: string;
|
60
|
+
}) => Promise<boolean>;
|
61
|
+
export { getLinkageDeviceList, getSceneList, getBindRuleList, bindRule, removeRule, triggerRule, enableRule, disableRule, };
|
@@ -0,0 +1,159 @@
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import { requestCloud } from '../';
|
3
|
+
import { THING } from '../constants';
|
4
|
+
|
5
|
+
/**
|
6
|
+
* 获取家庭下支持联动的设备列表
|
7
|
+
* @param {number} gid 家庭id
|
8
|
+
* @param {string} sourceType 业务范围
|
9
|
+
*/
|
10
|
+
var getLinkageDeviceList = function (params) {
|
11
|
+
return requestCloud({
|
12
|
+
api: "".concat(THING, ".m.linkage.dev.list"),
|
13
|
+
version: '3.0',
|
14
|
+
data: _objectSpread({}, params)
|
15
|
+
});
|
16
|
+
};
|
17
|
+
/**
|
18
|
+
* 查询一键执行场景列表
|
19
|
+
* @param {number} devId 设备id
|
20
|
+
*/
|
21
|
+
|
22
|
+
|
23
|
+
var getSceneList = function (_ref) {
|
24
|
+
var devId = _ref.devId;
|
25
|
+
return requestCloud({
|
26
|
+
api: "".concat(THING, ".m.linkage.rule.brief.query"),
|
27
|
+
version: '1.0',
|
28
|
+
data: {
|
29
|
+
devId: devId
|
30
|
+
}
|
31
|
+
});
|
32
|
+
};
|
33
|
+
/**
|
34
|
+
* 查询已绑定的列表
|
35
|
+
* @param {string} bizDomain 业务范围
|
36
|
+
* @param {string} sourceEntityId 设备id
|
37
|
+
* @param {number} entityType 实体类型
|
38
|
+
*/
|
39
|
+
|
40
|
+
|
41
|
+
var getBindRuleList = function (params) {
|
42
|
+
return requestCloud({
|
43
|
+
api: "".concat(THING, ".m.linkage.associative.entity.id.category.query"),
|
44
|
+
version: '1.0',
|
45
|
+
data: _objectSpread({}, params)
|
46
|
+
});
|
47
|
+
};
|
48
|
+
/**
|
49
|
+
* 绑定联动
|
50
|
+
* @param {string} devId 设备 ID
|
51
|
+
* @param {string} associativeEntityId 关联DP点和DP点值的组合
|
52
|
+
* @param {string} ruleId 关联场景 ID
|
53
|
+
* @param {string} entitySubIds 关联 DP 点
|
54
|
+
* @param {Array} expr 关联DP点、动作组合
|
55
|
+
* @param {string} bizDomain 业务域
|
56
|
+
*/
|
57
|
+
|
58
|
+
|
59
|
+
var bindRule = function (_ref2) {
|
60
|
+
var devId = _ref2.devId,
|
61
|
+
associativeEntityId = _ref2.associativeEntityId,
|
62
|
+
ruleId = _ref2.ruleId,
|
63
|
+
entitySubIds = _ref2.entitySubIds,
|
64
|
+
expr = _ref2.expr,
|
65
|
+
bizDomain = _ref2.bizDomain;
|
66
|
+
return requestCloud({
|
67
|
+
api: "".concat(THING, ".m.linkage.associative.entity.bind"),
|
68
|
+
version: '1.0',
|
69
|
+
data: {
|
70
|
+
relationExpr: {
|
71
|
+
sourceEntityId: devId,
|
72
|
+
associativeEntityId: associativeEntityId,
|
73
|
+
associativeEntityValue: ruleId,
|
74
|
+
triggerRuleVO: {
|
75
|
+
conditions: [{
|
76
|
+
entityId: devId,
|
77
|
+
entityType: 1,
|
78
|
+
condType: 1,
|
79
|
+
entitySubIds: entitySubIds,
|
80
|
+
expr: expr
|
81
|
+
}],
|
82
|
+
actions: [{
|
83
|
+
entityId: ruleId,
|
84
|
+
actionStrategy: 'repeat',
|
85
|
+
actionExecutor: 'ruleTrigger'
|
86
|
+
}]
|
87
|
+
},
|
88
|
+
bizDomain: bizDomain,
|
89
|
+
uniqueType: 3
|
90
|
+
}
|
91
|
+
}
|
92
|
+
});
|
93
|
+
};
|
94
|
+
/**
|
95
|
+
* 解除联动
|
96
|
+
* @param {string} bizDomain 业务范围
|
97
|
+
* @param {string} sourceEntityId 设备id
|
98
|
+
* @param {string} associativeEntityId 关联dp组合
|
99
|
+
* @param {string} associativeEntityValue 规则id
|
100
|
+
*/
|
101
|
+
|
102
|
+
|
103
|
+
var removeRule = function (params) {
|
104
|
+
return requestCloud({
|
105
|
+
api: "".concat(THING, ".m.linkage.associative.entity.remove"),
|
106
|
+
version: '1.0',
|
107
|
+
data: _objectSpread({}, params)
|
108
|
+
});
|
109
|
+
};
|
110
|
+
/**
|
111
|
+
* 触发联动
|
112
|
+
* @param {string} ruleId 规则id
|
113
|
+
*/
|
114
|
+
|
115
|
+
|
116
|
+
var triggerRule = function (_ref3) {
|
117
|
+
var ruleId = _ref3.ruleId;
|
118
|
+
return requestCloud({
|
119
|
+
api: "".concat(THING, ".m.linkage.rule.trigger"),
|
120
|
+
version: '1.0',
|
121
|
+
data: {
|
122
|
+
ruleId: ruleId
|
123
|
+
}
|
124
|
+
});
|
125
|
+
};
|
126
|
+
/**
|
127
|
+
* 启用联动
|
128
|
+
* @param {string} ruleId 规则id
|
129
|
+
*/
|
130
|
+
|
131
|
+
|
132
|
+
var enableRule = function (_ref4) {
|
133
|
+
var ruleId = _ref4.ruleId;
|
134
|
+
return requestCloud({
|
135
|
+
api: "".concat(THING, ".m.linkage.rule.enable"),
|
136
|
+
version: '1.0',
|
137
|
+
data: {
|
138
|
+
ruleId: ruleId
|
139
|
+
}
|
140
|
+
});
|
141
|
+
};
|
142
|
+
/**
|
143
|
+
* 停用联动
|
144
|
+
* @param {string} ruleId 规则id
|
145
|
+
*/
|
146
|
+
|
147
|
+
|
148
|
+
var disableRule = function (_ref5) {
|
149
|
+
var ruleId = _ref5.ruleId;
|
150
|
+
return requestCloud({
|
151
|
+
api: "".concat(THING, ".m.linkage.rule.disable"),
|
152
|
+
version: '1.0',
|
153
|
+
data: {
|
154
|
+
ruleId: ruleId
|
155
|
+
}
|
156
|
+
});
|
157
|
+
};
|
158
|
+
|
159
|
+
export { getLinkageDeviceList, getSceneList, getBindRuleList, bindRule, removeRule, triggerRule, enableRule, disableRule };
|
@@ -0,0 +1,111 @@
|
|
1
|
+
import { IGetLogInSpecifiedTime, IGetDpReportLog, IGetDpLogDays, IGetDpResultByMonth, IGetDpResultByHour, IGetDataWithSpecified, IGetWeekWithSpecified, IGetMonthWithSpecified, IGetMultiDpsAllResult, IGetLogInSpecifiedTimeResponse, IGetDpReportLogResponse, IGetDpLogDaysResponse, IGetDpResultByMonthResponse, IGetDpResultByHourResponse, IGetDataWithSpecifiedResponse, IGetWeekWithSpecifiedResponse, IGetMonthWithSpecifiedResponse, IGetMultiDpsAllResultResponse } from './interface';
|
2
|
+
/**
|
3
|
+
* 获取 DP 点指定时间段上报日志
|
4
|
+
* @param {string} devId 设备Id
|
5
|
+
* @param {string} dpIds dpId
|
6
|
+
* @param {number} offset 偏离值
|
7
|
+
* @param {number} limit 最大值, 最大值上限为 1000,
|
8
|
+
* @param {string} startTime 设备上报的时间, 查询起始时间,单位为毫秒
|
9
|
+
* @param {string} endTime 设备上报的时间,查询结束时间,单位为毫秒
|
10
|
+
* @param {string} sortType DESC 倒序 或 ASC 顺序, 默认为 DESC
|
11
|
+
*/
|
12
|
+
declare const getLogInSpecifiedTime: (params: IGetLogInSpecifiedTime) => Promise<IGetLogInSpecifiedTimeResponse>;
|
13
|
+
/**
|
14
|
+
* 获取 DP 点上报日志
|
15
|
+
* @param {string} devId 设备Id
|
16
|
+
* @param {string} dpIds dpId
|
17
|
+
* @param {number} offset 偏离值
|
18
|
+
* @param {number} limit 最大值, 最大值上限为 1000,
|
19
|
+
* @param {string} sortType 'DESC' 倒序 或 'ASC' 顺序, 默认为 'DESC'
|
20
|
+
*/
|
21
|
+
declare const getDpReportLog: (params: IGetDpReportLog) => Promise<IGetDpReportLogResponse>;
|
22
|
+
/**
|
23
|
+
* 获取用户操作的下发日志
|
24
|
+
* @param {string} devId 设备Id
|
25
|
+
* @param {string} dpIds dpId
|
26
|
+
* @param {number} offset 偏离值
|
27
|
+
* @param {number} limit 最大值, 最大值上限为 1000,
|
28
|
+
* @param {string} sortType 'DESC' 倒序 或 'ASC' 顺序, 默认为 'DESC'
|
29
|
+
*/
|
30
|
+
declare const getLogUserAction: (params: IGetDpReportLog) => Promise<IGetDpReportLogResponse>;
|
31
|
+
/**
|
32
|
+
* 获取设备月的每日上报的数据统计
|
33
|
+
* @param {string} devId 设备Id
|
34
|
+
* @param {string} dpId dpId
|
35
|
+
* @param {string} startDay 开始日期,例如20180529
|
36
|
+
* @param {string} endDay 结束日期,例如20180531
|
37
|
+
* @param {string} type 统计的类型,sum、minux 或 max
|
38
|
+
*/
|
39
|
+
declare const getDpLogDays: (params: IGetDpLogDays) => Promise<IGetDpLogDaysResponse>;
|
40
|
+
/**
|
41
|
+
* 按月(一年)获取 DP 点的统计结果
|
42
|
+
* @param {string} devId 设备Id
|
43
|
+
* @param {string} dpId dpId
|
44
|
+
* @param {string} type 统计的类型,sum、minux 或 max
|
45
|
+
*/
|
46
|
+
declare const getDpResultByMonth: (params: IGetDpResultByMonth) => Promise<IGetDpResultByMonthResponse>;
|
47
|
+
/**
|
48
|
+
* 按小时获取 DP 点的统计数据
|
49
|
+
* @param {string} devId 设备Id
|
50
|
+
* @param {string} dpId dpId
|
51
|
+
* @param {string} date 日期
|
52
|
+
* @param {string} type 统计的类型,sum、minux 或 avg
|
53
|
+
* @param {string} uid 用户id
|
54
|
+
* @param {number} auto auto=1 :中间数据缺失时,使用上一时段的数据补充。auto=2 :中间数据缺失时,使用#补充
|
55
|
+
*/
|
56
|
+
declare const getDpResultByHour: (params: IGetDpResultByHour) => Promise<IGetDpResultByHourResponse>;
|
57
|
+
/**
|
58
|
+
* 获取指定天数范围内的数据
|
59
|
+
* @param {string} devId 设备Id
|
60
|
+
* @param {string} dpId dpId
|
61
|
+
* @param {string} startDay 开始日期,例如20180529
|
62
|
+
* @param {string} endDay 结束日期,例如20180531
|
63
|
+
* @param {string} type 统计的类型,sum、minux 或 avg
|
64
|
+
* @param {string} uid 用户id
|
65
|
+
* @param {number} auto auto=1 :中间数据缺失时,使用上一时段的数据补充。auto=2 :中间数据缺失时,使用#补充
|
66
|
+
*/
|
67
|
+
declare const getDataWithSpecified: (params: IGetDataWithSpecified) => Promise<IGetDataWithSpecifiedResponse>;
|
68
|
+
/**
|
69
|
+
* 获取指定周范围内的数据
|
70
|
+
* @param {string} devId 设备Id
|
71
|
+
* @param {string} dpId dpId
|
72
|
+
* @param {string} startWeek 开始周
|
73
|
+
* @param {string} endWeek 结束周
|
74
|
+
* @param {string} type 统计的类型,sum、minux 或 avg
|
75
|
+
*/
|
76
|
+
declare const getWeekWithSpecified: (params: IGetWeekWithSpecified) => Promise<IGetWeekWithSpecifiedResponse>;
|
77
|
+
/**
|
78
|
+
* 获取指定月范围内的数据
|
79
|
+
* @param {string} devId 设备Id
|
80
|
+
* @param {string} dpId dpId
|
81
|
+
* @param {string} startMonth 开始月
|
82
|
+
* @param {string} endMonth 结束月
|
83
|
+
* @param {string} type 统计的类型,sum、minux 或 avg
|
84
|
+
* @param {string} uid 用户id
|
85
|
+
* @param {number} auto auto=1 :中间数据缺失时,使用上一时段的数据补充。auto=2 :中间数据缺失时,使用#补充
|
86
|
+
*/
|
87
|
+
declare const getMonthWithSpecified: (params: IGetMonthWithSpecified) => Promise<IGetMonthWithSpecifiedResponse>;
|
88
|
+
/**
|
89
|
+
* 获取单个 DP 点所有统计结果的聚合
|
90
|
+
* @param {string} devId 设备Id
|
91
|
+
* @param {string} dpId dpId
|
92
|
+
* @param {string} type 统计的类型,sum、minux 或 avg
|
93
|
+
*/
|
94
|
+
declare const getDpAllStatistResult: (params: IGetDpResultByMonth) => Promise<{
|
95
|
+
total: string;
|
96
|
+
time: number;
|
97
|
+
}>;
|
98
|
+
/**
|
99
|
+
* 获取多个 DP 点的统计结果的聚合(不限时长)
|
100
|
+
* @param {string} devId 设备Id
|
101
|
+
* @param {string} dpIds DP 点的 ID,多个 ID 使用逗号(,)分隔
|
102
|
+
* @param {string} startTime 开始时间
|
103
|
+
* @param {string} endTime 结束时间
|
104
|
+
* @param {number} size 一条的页数
|
105
|
+
* @param {number} reverse reverse=1: 正序 reverse=2: 倒序
|
106
|
+
* @param {number} rowType 查询的类型 rowType=1: 下一页 rowType=-1: 上一页
|
107
|
+
* @param {string} startRowKey 开始页索引
|
108
|
+
* @param {string} endRowKey: 结束页索引
|
109
|
+
*/
|
110
|
+
declare const getMultiDpsAllResult: (params: IGetMultiDpsAllResult) => Promise<IGetMultiDpsAllResultResponse>;
|
111
|
+
export { getLogInSpecifiedTime, getDpReportLog, getLogUserAction, getDpLogDays, getDpResultByMonth, getDpResultByHour, getDataWithSpecified, getWeekWithSpecified, getMonthWithSpecified, getDpAllStatistResult, getMultiDpsAllResult, };
|
@@ -0,0 +1,199 @@
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
// 数据统计接口
|
3
|
+
import { requestCloud } from '../';
|
4
|
+
import { THING } from '../constants';
|
5
|
+
|
6
|
+
/**
|
7
|
+
* 获取 DP 点指定时间段上报日志
|
8
|
+
* @param {string} devId 设备Id
|
9
|
+
* @param {string} dpIds dpId
|
10
|
+
* @param {number} offset 偏离值
|
11
|
+
* @param {number} limit 最大值, 最大值上限为 1000,
|
12
|
+
* @param {string} startTime 设备上报的时间, 查询起始时间,单位为毫秒
|
13
|
+
* @param {string} endTime 设备上报的时间,查询结束时间,单位为毫秒
|
14
|
+
* @param {string} sortType DESC 倒序 或 ASC 顺序, 默认为 DESC
|
15
|
+
*/
|
16
|
+
var getLogInSpecifiedTime = function (params) {
|
17
|
+
return requestCloud({
|
18
|
+
api: "".concat(THING, ".m.smart.operate.all.log"),
|
19
|
+
version: '1.0',
|
20
|
+
data: _objectSpread({}, params)
|
21
|
+
});
|
22
|
+
};
|
23
|
+
/**
|
24
|
+
* 获取 DP 点上报日志
|
25
|
+
* @param {string} devId 设备Id
|
26
|
+
* @param {string} dpIds dpId
|
27
|
+
* @param {number} offset 偏离值
|
28
|
+
* @param {number} limit 最大值, 最大值上限为 1000,
|
29
|
+
* @param {string} sortType 'DESC' 倒序 或 'ASC' 顺序, 默认为 'DESC'
|
30
|
+
*/
|
31
|
+
|
32
|
+
|
33
|
+
var getDpReportLog = function (params) {
|
34
|
+
return requestCloud({
|
35
|
+
api: 'm.smart.operate.log',
|
36
|
+
version: '2.0',
|
37
|
+
data: _objectSpread({}, params)
|
38
|
+
});
|
39
|
+
};
|
40
|
+
/**
|
41
|
+
* 获取用户操作的下发日志
|
42
|
+
* @param {string} devId 设备Id
|
43
|
+
* @param {string} dpIds dpId
|
44
|
+
* @param {number} offset 偏离值
|
45
|
+
* @param {number} limit 最大值, 最大值上限为 1000,
|
46
|
+
* @param {string} sortType 'DESC' 倒序 或 'ASC' 顺序, 默认为 'DESC'
|
47
|
+
*/
|
48
|
+
|
49
|
+
|
50
|
+
var getLogUserAction = function (params) {
|
51
|
+
return requestCloud({
|
52
|
+
api: 'm.smart.operate.publish.log',
|
53
|
+
version: '1.0',
|
54
|
+
data: _objectSpread({}, params)
|
55
|
+
});
|
56
|
+
};
|
57
|
+
/**
|
58
|
+
* 获取设备月的每日上报的数据统计
|
59
|
+
* @param {string} devId 设备Id
|
60
|
+
* @param {string} dpId dpId
|
61
|
+
* @param {string} startDay 开始日期,例如20180529
|
62
|
+
* @param {string} endDay 结束日期,例如20180531
|
63
|
+
* @param {string} type 统计的类型,sum、minux 或 max
|
64
|
+
*/
|
65
|
+
|
66
|
+
|
67
|
+
var getDpLogDays = function (params) {
|
68
|
+
return requestCloud({
|
69
|
+
api: "".concat(THING, ".m.dp.stat.days.list"),
|
70
|
+
version: '1.0',
|
71
|
+
data: _objectSpread({}, params)
|
72
|
+
});
|
73
|
+
};
|
74
|
+
/**
|
75
|
+
* 按月(一年)获取 DP 点的统计结果
|
76
|
+
* @param {string} devId 设备Id
|
77
|
+
* @param {string} dpId dpId
|
78
|
+
* @param {string} type 统计的类型,sum、minux 或 max
|
79
|
+
*/
|
80
|
+
|
81
|
+
|
82
|
+
var getDpResultByMonth = function (params) {
|
83
|
+
return requestCloud({
|
84
|
+
api: "".concat(THING, ".m.dp.stat.month.list"),
|
85
|
+
version: '1.0',
|
86
|
+
data: _objectSpread({}, params)
|
87
|
+
});
|
88
|
+
};
|
89
|
+
/**
|
90
|
+
* 按小时获取 DP 点的统计数据
|
91
|
+
* @param {string} devId 设备Id
|
92
|
+
* @param {string} dpId dpId
|
93
|
+
* @param {string} date 日期
|
94
|
+
* @param {string} type 统计的类型,sum、minux 或 avg
|
95
|
+
* @param {string} uid 用户id
|
96
|
+
* @param {number} auto auto=1 :中间数据缺失时,使用上一时段的数据补充。auto=2 :中间数据缺失时,使用#补充
|
97
|
+
*/
|
98
|
+
|
99
|
+
|
100
|
+
var getDpResultByHour = function (params) {
|
101
|
+
return requestCloud({
|
102
|
+
api: "".concat(THING, ".m.dp.rang.stat.hour.list"),
|
103
|
+
version: '1.0',
|
104
|
+
data: _objectSpread({}, params)
|
105
|
+
});
|
106
|
+
};
|
107
|
+
/**
|
108
|
+
* 获取指定天数范围内的数据
|
109
|
+
* @param {string} devId 设备Id
|
110
|
+
* @param {string} dpId dpId
|
111
|
+
* @param {string} startDay 开始日期,例如20180529
|
112
|
+
* @param {string} endDay 结束日期,例如20180531
|
113
|
+
* @param {string} type 统计的类型,sum、minux 或 avg
|
114
|
+
* @param {string} uid 用户id
|
115
|
+
* @param {number} auto auto=1 :中间数据缺失时,使用上一时段的数据补充。auto=2 :中间数据缺失时,使用#补充
|
116
|
+
*/
|
117
|
+
|
118
|
+
|
119
|
+
var getDataWithSpecified = function (params) {
|
120
|
+
return requestCloud({
|
121
|
+
api: "".concat(THING, ".m.dp.rang.stat.day.list"),
|
122
|
+
version: '2.0',
|
123
|
+
data: _objectSpread({}, params)
|
124
|
+
});
|
125
|
+
};
|
126
|
+
/**
|
127
|
+
* 获取指定周范围内的数据
|
128
|
+
* @param {string} devId 设备Id
|
129
|
+
* @param {string} dpId dpId
|
130
|
+
* @param {string} startWeek 开始周
|
131
|
+
* @param {string} endWeek 结束周
|
132
|
+
* @param {string} type 统计的类型,sum、minux 或 avg
|
133
|
+
*/
|
134
|
+
|
135
|
+
|
136
|
+
var getWeekWithSpecified = function (params) {
|
137
|
+
return requestCloud({
|
138
|
+
api: "".concat(THING, ".m.dp.rang.stat.week.list"),
|
139
|
+
version: '1.0',
|
140
|
+
data: _objectSpread({}, params)
|
141
|
+
});
|
142
|
+
};
|
143
|
+
/**
|
144
|
+
* 获取指定月范围内的数据
|
145
|
+
* @param {string} devId 设备Id
|
146
|
+
* @param {string} dpId dpId
|
147
|
+
* @param {string} startMonth 开始月
|
148
|
+
* @param {string} endMonth 结束月
|
149
|
+
* @param {string} type 统计的类型,sum、minux 或 avg
|
150
|
+
* @param {string} uid 用户id
|
151
|
+
* @param {number} auto auto=1 :中间数据缺失时,使用上一时段的数据补充。auto=2 :中间数据缺失时,使用#补充
|
152
|
+
*/
|
153
|
+
|
154
|
+
|
155
|
+
var getMonthWithSpecified = function (params) {
|
156
|
+
return requestCloud({
|
157
|
+
api: "".concat(THING, ".m.dp.rang.stat.month.list"),
|
158
|
+
version: '2.0',
|
159
|
+
data: _objectSpread({}, params)
|
160
|
+
});
|
161
|
+
};
|
162
|
+
/**
|
163
|
+
* 获取单个 DP 点所有统计结果的聚合
|
164
|
+
* @param {string} devId 设备Id
|
165
|
+
* @param {string} dpId dpId
|
166
|
+
* @param {string} type 统计的类型,sum、minux 或 avg
|
167
|
+
*/
|
168
|
+
|
169
|
+
|
170
|
+
var getDpAllStatistResult = function (params) {
|
171
|
+
return requestCloud({
|
172
|
+
api: "".concat(THING, ".m.dp.stat.total"),
|
173
|
+
version: '1.0',
|
174
|
+
data: _objectSpread({}, params)
|
175
|
+
});
|
176
|
+
};
|
177
|
+
/**
|
178
|
+
* 获取多个 DP 点的统计结果的聚合(不限时长)
|
179
|
+
* @param {string} devId 设备Id
|
180
|
+
* @param {string} dpIds DP 点的 ID,多个 ID 使用逗号(,)分隔
|
181
|
+
* @param {string} startTime 开始时间
|
182
|
+
* @param {string} endTime 结束时间
|
183
|
+
* @param {number} size 一条的页数
|
184
|
+
* @param {number} reverse reverse=1: 正序 reverse=2: 倒序
|
185
|
+
* @param {number} rowType 查询的类型 rowType=1: 下一页 rowType=-1: 上一页
|
186
|
+
* @param {string} startRowKey 开始页索引
|
187
|
+
* @param {string} endRowKey: 结束页索引
|
188
|
+
*/
|
189
|
+
|
190
|
+
|
191
|
+
var getMultiDpsAllResult = function (params) {
|
192
|
+
return requestCloud({
|
193
|
+
api: "".concat(THING, ".m.device.query.device.log"),
|
194
|
+
version: '1.0',
|
195
|
+
data: _objectSpread({}, params)
|
196
|
+
});
|
197
|
+
};
|
198
|
+
|
199
|
+
export { getLogInSpecifiedTime, getDpReportLog, getLogUserAction, getDpLogDays, getDpResultByMonth, getDpResultByHour, getDataWithSpecified, getWeekWithSpecified, getMonthWithSpecified, getDpAllStatistResult, getMultiDpsAllResult };
|
@@ -0,0 +1,146 @@
|
|
1
|
+
import { IAndSingleTime, IQueryTimerTasks, IModifySingleTimer, IAndGroupTimer, IModifyGroupTimer, IModDeleteTaskByIds, IModDeleteTaskByCategory, IGetDpLastTimer, IGetLastTimerPeriod, IGetAstronomicalList, IAstronomical, IUpdateAstronomicalStatus, IQueryTimerTasksResponse, IGetDpLastTimerResponse, IGetLastTimerPeriodResponse, IGetAstronomicalListResponse } from './interface';
|
2
|
+
/**
|
3
|
+
* 添加单次定时
|
4
|
+
* @param {string} bizId 单设备 ID(devId) 或者群组设备 ID(groupId)
|
5
|
+
* @param {number} bizType 资源类型。0:单设备;1:群组设备。
|
6
|
+
* @param {string} actions {/“dps/”:{},/“time/”:“”}
|
7
|
+
* @param {string} loops 在0000000基础上,把所选择日期对应位置的 0 改成 1,第一位表示周日。
|
8
|
+
* @param {string} category 分类类别
|
9
|
+
* @param {number} status 初始化状态,0:关闭;1:开启。
|
10
|
+
* @param {boolean} isAppPush 是否发送执行通知
|
11
|
+
* @param {string} aliasName 定时备注
|
12
|
+
*/
|
13
|
+
declare const addSingleTimer: (params: IAndSingleTime) => Promise<number>;
|
14
|
+
/**
|
15
|
+
* 查询定时任务
|
16
|
+
* @param {string} bizId 单设备 ID(devId) 或者群组设备 ID(groupId)
|
17
|
+
* @param {number} bizType 资源类型。0:单设备;1:群组设备。
|
18
|
+
* @param {string} category 定时分类
|
19
|
+
*/
|
20
|
+
declare const queryTimerTasks: (params: IQueryTimerTasks) => Promise<IQueryTimerTasksResponse>;
|
21
|
+
/**
|
22
|
+
* 修改单次定时
|
23
|
+
* @param {string} bizId 单设备 ID(devId) 或者群组设备 ID(groupId)
|
24
|
+
* @param {number} bizType 资源类型。0:单设备;1:群组设备。
|
25
|
+
* @param {string} id 定时任务主键
|
26
|
+
* @param {string} actions {/“dps/”:{},/“time/”:“”}
|
27
|
+
* @param {string} loops 在0000000基础上,把所选择日期对应位置的 0 改成 1,第一位表示周日。
|
28
|
+
* @param {number} status 初始化状态,0:关闭;1:开启。
|
29
|
+
* @param {boolean} isAppPush 是否发送执行通知
|
30
|
+
* @param {string} aliasName 定时备注
|
31
|
+
*/
|
32
|
+
declare const modifySingleTimer: (params: IModifySingleTimer) => Promise<boolean>;
|
33
|
+
/**
|
34
|
+
* 添加分组定时
|
35
|
+
* @param {string} bizId 单设备 ID(devId) 或者群组设备 ID(groupId)
|
36
|
+
* @param {number} bizType 资源类型。0:单设备;1:群组设备。
|
37
|
+
* @param {string} actions [{/“dps/”:{},/“time/”:“”}],JSON 数据格式。
|
38
|
+
* @param {string} loops 在0000000基础上,把所选择日期对应位置的 0 改成 1,第一位表示周日。
|
39
|
+
* @param {string} category 分类类别
|
40
|
+
* @param {number} status 初始化状态,0:关闭;1:开启。
|
41
|
+
* @param {boolean} isAppPush 是否发送执行通知
|
42
|
+
* @param {string} aliasName 定时备注
|
43
|
+
*/
|
44
|
+
declare const addGroupTimer: (params: IAndGroupTimer) => Promise<number>;
|
45
|
+
/**
|
46
|
+
* 分组定时查询
|
47
|
+
* @param {string} bizId 单设备 ID(devId) 或者群组设备 ID(groupId)
|
48
|
+
* @param {number} bizType 资源类型。0:单设备;1:群组设备。
|
49
|
+
* @param {string} category 定时分类
|
50
|
+
*/
|
51
|
+
declare const queryGroupTimerTasks: (params: IQueryTimerTasks) => Promise<IQueryTimerTasksResponse>;
|
52
|
+
/**
|
53
|
+
* 修改分组定时
|
54
|
+
* @param {string} bizId 单设备 ID(devId) 或者群组设备 ID(groupId)
|
55
|
+
* @param {number} bizType 资源类型。0:单设备;1:群组设备。
|
56
|
+
* @param {string} actionsArray [{/“dps/”:{},/“time/”:“”,/“timerId/”:“”}],JSON 数据格式。
|
57
|
+
* @param {string} loops 在0000000基础上,把所选择日期对应位置的 0 改成 1,第一位表示周日。
|
58
|
+
* @param {number} status 初始化状态,0:关闭;1:开启。
|
59
|
+
* @param {boolean} isAppPush 是否发送执行通知
|
60
|
+
* @param {string} aliasName 定时备注
|
61
|
+
*/
|
62
|
+
declare const modifyGroupTimer: (params: IModifyGroupTimer) => Promise<boolean>;
|
63
|
+
/**
|
64
|
+
* 根据 ids 修改( 删除 )任务状态
|
65
|
+
* @param {string} bizId 单设备 ID(devId) 或者群组设备 ID(groupId)
|
66
|
+
* @param {number} bizType 资源类型。0:单设备;1:群组设备。
|
67
|
+
* @param {string} ids 定时任务的 ID。提交多任务时使用逗号(,)分隔。例如"1,2,3,4"。单次提交任务数量不得超过 168。
|
68
|
+
* @param {number} status 初始化状态,0:关闭;1:开启;2:删除。
|
69
|
+
*/
|
70
|
+
declare const modDeleteTaskByIds: (params: IModDeleteTaskByIds) => Promise<boolean>;
|
71
|
+
/**
|
72
|
+
* 根据 category 修改( 删除 )定时任务状态
|
73
|
+
* @param {string} bizId 单设备 ID(devId) 或者群组设备 ID(groupId)
|
74
|
+
* @param {number} bizType 资源类型。0:单设备;1:群组设备。
|
75
|
+
* @param {string} category 定时分类
|
76
|
+
* @param {number} status 初始化状态,0:关闭;1:开启;2:删除。
|
77
|
+
*/
|
78
|
+
declare const modDeleteTaskByCategory: (params: IModDeleteTaskByCategory) => Promise<boolean>;
|
79
|
+
/**
|
80
|
+
* 获取某个DP点最近的定时
|
81
|
+
* @param {string} bizId 单设备 ID(devId) 或者群组设备 ID(groupId)。
|
82
|
+
* @param {string} type device_group 或者 device。
|
83
|
+
* @param {string} instruct 格式为'{devId:"xxx",dpId:"1"}'。
|
84
|
+
*/
|
85
|
+
declare const getDpLastTimer: (params: IGetDpLastTimer) => Promise<IGetDpLastTimerResponse>;
|
86
|
+
/**
|
87
|
+
* 获取多个 DP 点最近的定时
|
88
|
+
* @param {string} bizId 单设备 ID(devId) 或者群组设备 ID(groupId)。
|
89
|
+
* @param {string} type device_group 或者 device。
|
90
|
+
* @param {string} instruct 格式为'{devId:"xxx",dpId:"1"}'。
|
91
|
+
*/
|
92
|
+
declare const getDpsLastTimer: (params: IGetDpLastTimer) => Promise<IGetDpLastTimerResponse>;
|
93
|
+
/**
|
94
|
+
* 获取最近的一条定时(包含时间段判断)
|
95
|
+
* @param {string} devId 设备 ID。
|
96
|
+
* @param {string} instruct 格式为'{devId:"xxx",dpId:"1"}'。
|
97
|
+
*/
|
98
|
+
declare const getLastTimerPeriod: (params: IGetLastTimerPeriod) => Promise<IGetLastTimerPeriodResponse>;
|
99
|
+
/**
|
100
|
+
* 获取天文定时列表
|
101
|
+
*/
|
102
|
+
declare const getAstronomicalList: (params: IGetAstronomicalList) => Promise<IGetAstronomicalListResponse>;
|
103
|
+
/**
|
104
|
+
* 添加天文定时
|
105
|
+
* @param {string} bizId 设备 ID 或群组 ID
|
106
|
+
* @param {number} bizType 0:设备; 1:设备群组
|
107
|
+
* @param {string} loops 周期
|
108
|
+
* @param {any} dps dp 点,json 格式
|
109
|
+
* @param {number} astronomicalType 天文类型, 0:日出; 1:日落
|
110
|
+
* @param {string} timezone 时区
|
111
|
+
* @param {string} date 日期 yyyyMMdd
|
112
|
+
* @param {string} time 偏移时间,“HH:mm” 24 进制
|
113
|
+
* @param {number} offsetType 偏移类型,-1 : 向前; 0 正常; 1 : 向后
|
114
|
+
* @param {number} lat 纬度
|
115
|
+
* @param {number} lon 经度
|
116
|
+
*/
|
117
|
+
declare const addAstronomical: (params: IAstronomical) => Promise<number>;
|
118
|
+
/**
|
119
|
+
* 修改天文定时
|
120
|
+
* @param {string} bizId 设备 ID 或群组 ID
|
121
|
+
* @param {number} bizType 0:设备; 1:设备群组
|
122
|
+
* @param {string} loops 周期
|
123
|
+
* @param {any} dps dp 点,json 格式
|
124
|
+
* @param {number} astronomicalType 天文类型, 0:日出; 1:日落
|
125
|
+
* @param {string} timezone 时区
|
126
|
+
* @param {string} date 日期 yyyyMMdd
|
127
|
+
* @param {string} time 偏移时间,“HH:mm” 24 进制
|
128
|
+
* @param {number} offsetType 偏移类型,-1 : 向前; 0 正常; 1 : 向后
|
129
|
+
* @param {number} lat 纬度
|
130
|
+
* @param {number} lon 经度
|
131
|
+
*/
|
132
|
+
declare const updateAstronomical: (params: IAstronomical) => Promise<boolean>;
|
133
|
+
/**
|
134
|
+
* 修改天文定时使能
|
135
|
+
* @param {string} id 定时任务id
|
136
|
+
* @param {number} status 0:关闭;1开启
|
137
|
+
*/
|
138
|
+
declare const updateAstronomicalStatus: (params: IUpdateAstronomicalStatus) => Promise<boolean>;
|
139
|
+
/**
|
140
|
+
* 删除天文定时
|
141
|
+
* @param {string} id 定时任务 id
|
142
|
+
*/
|
143
|
+
declare const removeAstronomical: (params: {
|
144
|
+
id: string;
|
145
|
+
}) => Promise<boolean>;
|
146
|
+
export { addSingleTimer, queryTimerTasks, modifySingleTimer, addGroupTimer, queryGroupTimerTasks, modifyGroupTimer, modDeleteTaskByIds, modDeleteTaskByCategory, getDpLastTimer, getDpsLastTimer, getLastTimerPeriod, getAstronomicalList, addAstronomical, updateAstronomical, updateAstronomicalStatus, removeAstronomical, };
|