@ray-js/api 1.7.12 → 1.7.13
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/LICENSE.md +9 -0
- package/lib/cloud/highlights.d.ts +35 -7
- package/lib/cloud/highlights.js +71 -32
- package/lib/cloud/interface.d.ts +80 -0
- package/package.json +5 -5
package/LICENSE.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
Copyright © 2014-2022 Tuya.inc
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
+
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { AiVisualBox, AiVisualNeedCopyQueryParams, AiVisualNeedCopyQueryResult, AlbumSettingEditReq, AlbumSettingSaveReq, CustomEventCheckParams, CustomEventCheckResult, CustomVisionEventCheckParams, CustomVisionEventCheckRet, DeleteAiVisualMessageList, DeviceDetails, DeviceServiceConfigItemDto, GetAiVisualBoxInfoParams, GetAiVisualMessageKey, GetAiVisualMessageKeyRes, GetAiVisualPresetEventParams, GetAlbumSettingReq, GetDeviceConfigParams, GetDeviceConfigResult, GetMessageListRes, GetSmartEventSwitchStateParams, GetSmartEventSwitchStateResult, IAlbumFileDeleteReq, IAlbumFileDeleteRes, IAlbumVideoDateCountReq, IAlbumVideoDateCountRes, IAlbumVideoFileDetailReq, IAlbumVideoFileDetailRes, IAlbumVideoFileListReq, IAlbumVideoFileListRes, Options, PresetEvent, QueryBindDeviceDto, QueryCameraListDto, QueryGetAiVisualList, QueryGetAiVisualReportList, QueryGetDeviceDetailsById, QueryGetMessageList, QueryServiceDetailDto, ResBindDeviceDto, SaveAiVisualBoxInfoParams, ServiceDetailDto, TimeAlbumSettingDto, UpdateDeviceConfigParams, UpdateSwitchStateParams, VisionBoxDto, VisionBoxReport } from './interface';
|
1
|
+
import type { AiVisualBox, AiVisualNeedCopyQueryParams, AiVisualNeedCopyQueryResult, AlbumSettingEditReq, AlbumSettingSaveReq, CustomEventCheckParams, CustomEventCheckResult, CustomVisionEventCheckParams, CustomVisionEventCheckRet, DeleteAiVisualMessageList, DeviceDetails, DeviceServiceConfigItemDto, GetAiVisualBoxInfoParams, GetAiVisualMessageKey, GetAiVisualMessageKeyRes, GetAiVisualPresetEventParams, GetAlbumSettingReq, GetDeviceConfigParams, GetDeviceConfigResult, GetIpcPointList, GetIpcPointListRet, GetIpcRtcConfig, GetIpcRtcConfigRet, GetMessageListRes, GetMovePathList, GetMovePathListRet, GetMovePointDetails, GetMovePointDetailsRet, GetSmartEventSwitchStateParams, GetSmartEventSwitchStateResult, GetVasServiceConfigList, GetVasServiceConfigListRet, GetVasUrlInfo, GetVasUrlInfoRet, IAlbumFileDeleteReq, IAlbumFileDeleteRes, IAlbumVideoDateCountReq, IAlbumVideoDateCountRes, IAlbumVideoFileDetailReq, IAlbumVideoFileDetailRes, IAlbumVideoFileListReq, IAlbumVideoFileListRes, Options, PresetEvent, QueryBindDeviceDto, QueryCameraListDto, QueryGetAiVisualList, QueryGetAiVisualReportList, QueryGetDeviceDetailsById, QueryGetMessageList, QueryServiceDetailDto, ResBindDeviceDto, SaveAiVisualBoxInfoParams, ServiceDetailDto, TimeAlbumSettingDto, UpdateDeviceConfigParams, UpdateIpcPointInfo, UpdateIpcPointInfoRet, UpdateSwitchStateParams, VisionBoxDto, VisionBoxReport } from './interface';
|
2
2
|
/**
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
transError 为 true 的情况下走到
|
4
|
+
apiRequestByAtop 的 fail 回调时
|
5
|
+
会 resolve false
|
6
|
+
为 false 的情况下则 reject 错误信息
|
7
7
|
*/
|
8
|
-
export declare const requestFunc: <T = any>(
|
8
|
+
export declare const requestFunc: <T = any>(api: string, postData: Record<string, any> | undefined, v?: string, options?: Options) => Promise<T>;
|
9
9
|
/**
|
10
10
|
* 获取 App 面板内静态资源地址
|
11
11
|
*/
|
@@ -121,4 +121,32 @@ declare function getPresetEvent(params: GetAiVisualPresetEventParams): Promise<P
|
|
121
121
|
* 视觉魔方自定义语义校验
|
122
122
|
*/
|
123
123
|
declare function visualBoxEventCheck(params: CustomVisionEventCheckParams): Promise<CustomVisionEventCheckRet>;
|
124
|
-
|
124
|
+
/**
|
125
|
+
* 获取摄像头配置信息
|
126
|
+
*/
|
127
|
+
declare function getIpcRtcConfig(params: GetIpcRtcConfig): Promise<GetIpcRtcConfigRet>;
|
128
|
+
/**
|
129
|
+
* 获取摄像头收藏点列表
|
130
|
+
*/
|
131
|
+
declare function getIpcPointList(params: GetIpcPointList): Promise<GetIpcPointListRet>;
|
132
|
+
/**
|
133
|
+
* 更新摄像头收藏点信息
|
134
|
+
*/
|
135
|
+
declare function updateIpcPointInfo(params: UpdateIpcPointInfo): Promise<UpdateIpcPointInfoRet>;
|
136
|
+
/**
|
137
|
+
* 获取增值服务跳转URL接口
|
138
|
+
*/
|
139
|
+
declare function getVasUrlInfo(params: GetVasUrlInfo): Promise<GetVasUrlInfoRet>;
|
140
|
+
/**
|
141
|
+
* 获取增值服务运营列表接口
|
142
|
+
*/
|
143
|
+
declare function getVasServiceConfigList(params: GetVasServiceConfigList): Promise<GetVasServiceConfigListRet>;
|
144
|
+
/**
|
145
|
+
* 获取移动摄像机轨迹路径列表
|
146
|
+
*/
|
147
|
+
declare function getMovePathList(params: GetMovePathList): Promise<GetMovePathListRet>;
|
148
|
+
/**
|
149
|
+
* 获取移动摄像机点位列表
|
150
|
+
*/
|
151
|
+
declare function getMovePointDetails(params: GetMovePointDetails): Promise<GetMovePointDetailsRet>;
|
152
|
+
export { getMessageList, getAiVisualMessageKey, getAiVisualReportList, deleteAiVisualMessage, getAiVisualBoxInfo, saveAiVisualBoxInfo, aiVisualNeedCopyQuery, getStorageSecret, getDeviceDetailsById, getCameraList, bindDevice, customEventCheck, getSmartEventSwitchState, updateSmartEventSwitchState, getDeviceConfig, updateDeviceConfig, getServiceDetail, albumVideoDateCount, albumVideoFileList, albumVideoFileDetail, albumFileDelete, albumSettingSave, albumSettingEdit, getAlbumSetting, getVisualBoxList, getPresetEvent, visualBoxEventCheck, getIpcRtcConfig, getIpcPointList, updateIpcPointInfo, getVasUrlInfo, getVasServiceConfigList, getMovePathList, getMovePointDetails, };
|
package/lib/cloud/highlights.js
CHANGED
@@ -1,45 +1,36 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
2
|
// 通用核心接口
|
3
|
-
|
4
3
|
import { THING } from '../constants';
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
try {
|
13
|
-
// eslint-disable-next-line
|
14
|
-
rst = eval(`(${str})`);
|
15
|
-
} catch (e2) {
|
16
|
-
rst = str;
|
17
|
-
}
|
18
|
-
}
|
19
|
-
} else {
|
20
|
-
rst = typeof str === 'undefined' ? {} : str;
|
4
|
+
const parseJSON = str => {
|
5
|
+
let rst;
|
6
|
+
if (str && 'string' === typeof str) {
|
7
|
+
try {
|
8
|
+
rst = JSON.parse(str);
|
9
|
+
} catch (e) {
|
10
|
+
rst = str;
|
21
11
|
}
|
22
|
-
|
12
|
+
} else {
|
13
|
+
rst = typeof str === 'undefined' ? {} : str;
|
23
14
|
}
|
15
|
+
return rst;
|
24
16
|
};
|
25
17
|
|
26
18
|
/**
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
19
|
+
transError 为 true 的情况下走到
|
20
|
+
apiRequestByAtop 的 fail 回调时
|
21
|
+
会 resolve false
|
22
|
+
为 false 的情况下则 reject 错误信息
|
31
23
|
*/
|
32
|
-
export const requestFunc = function (
|
24
|
+
export const requestFunc = function (api, postData) {
|
33
25
|
let v = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '1.0';
|
34
26
|
let options = arguments.length > 3 ? arguments[3] : undefined;
|
35
27
|
return new Promise((resolve, reject) => {
|
36
|
-
ty.apiRequestByAtop(
|
37
|
-
api:
|
28
|
+
ty.apiRequestByAtop({
|
29
|
+
api: api,
|
38
30
|
postData: postData,
|
39
|
-
version: v
|
40
|
-
}), {}, {
|
31
|
+
version: v,
|
41
32
|
success: d => {
|
42
|
-
const data = typeof d === 'string' ?
|
33
|
+
const data = typeof d === 'string' ? parseJSON(d) : d;
|
43
34
|
resolve(data);
|
44
35
|
},
|
45
36
|
fail: err => {
|
@@ -48,8 +39,7 @@ export const requestFunc = function (a, postData) {
|
|
48
39
|
toastError = true,
|
49
40
|
transError = true
|
50
41
|
} = options || {};
|
51
|
-
console.
|
52
|
-
console.log(a);
|
42
|
+
console.error(`Atop fetch "${api}" fail:`, errObj);
|
53
43
|
if (transError) {
|
54
44
|
resolve(false);
|
55
45
|
} else {
|
@@ -62,7 +52,7 @@ export const requestFunc = function (a, postData) {
|
|
62
52
|
});
|
63
53
|
}
|
64
54
|
}
|
65
|
-
})
|
55
|
+
});
|
66
56
|
});
|
67
57
|
};
|
68
58
|
|
@@ -262,4 +252,53 @@ function getPresetEvent(params) {
|
|
262
252
|
function visualBoxEventCheck(params) {
|
263
253
|
return requestFunc('m.ipc.smart.vision.box.event.check', params, '1.0');
|
264
254
|
}
|
265
|
-
|
255
|
+
|
256
|
+
/**
|
257
|
+
* 获取摄像头配置信息
|
258
|
+
*/
|
259
|
+
function getIpcRtcConfig(params) {
|
260
|
+
return requestFunc('m.ipc.v4.rtc.config.get', params, '1.0');
|
261
|
+
}
|
262
|
+
|
263
|
+
/**
|
264
|
+
* 获取摄像头收藏点列表
|
265
|
+
*/
|
266
|
+
function getIpcPointList(params) {
|
267
|
+
return requestFunc(`${THING}.m.ipc.memory.point.list`, params, '2.0');
|
268
|
+
}
|
269
|
+
|
270
|
+
/**
|
271
|
+
* 更新摄像头收藏点信息
|
272
|
+
*/
|
273
|
+
function updateIpcPointInfo(params) {
|
274
|
+
return requestFunc(`${THING}.m.ipc.memory.point.rename`, params, '1.0');
|
275
|
+
}
|
276
|
+
|
277
|
+
/**
|
278
|
+
* 获取增值服务跳转URL接口
|
279
|
+
*/
|
280
|
+
function getVasUrlInfo(params) {
|
281
|
+
return requestFunc('m.ecm.cvas.basic.url.config.get', params, '1.0');
|
282
|
+
}
|
283
|
+
|
284
|
+
/**
|
285
|
+
* 获取增值服务运营列表接口
|
286
|
+
*/
|
287
|
+
function getVasServiceConfigList(params) {
|
288
|
+
return requestFunc('m.ecm.cvas.service.config.get', params, '3.0');
|
289
|
+
}
|
290
|
+
|
291
|
+
/**
|
292
|
+
* 获取移动摄像机轨迹路径列表
|
293
|
+
*/
|
294
|
+
function getMovePathList(params) {
|
295
|
+
return requestFunc('m.ipc.move.point.by.path.list', params, '3.0');
|
296
|
+
}
|
297
|
+
|
298
|
+
/**
|
299
|
+
* 获取移动摄像机点位列表
|
300
|
+
*/
|
301
|
+
function getMovePointDetails(params) {
|
302
|
+
return requestFunc('m.ipc.move.point.by.mpid.get', params, '1.0');
|
303
|
+
}
|
304
|
+
export { getMessageList, getAiVisualMessageKey, getAiVisualReportList, deleteAiVisualMessage, getAiVisualBoxInfo, saveAiVisualBoxInfo, aiVisualNeedCopyQuery, getStorageSecret, getDeviceDetailsById, getCameraList, bindDevice, customEventCheck, getSmartEventSwitchState, updateSmartEventSwitchState, getDeviceConfig, updateDeviceConfig, getServiceDetail, albumVideoDateCount, albumVideoFileList, albumVideoFileDetail, albumFileDelete, albumSettingSave, albumSettingEdit, getAlbumSetting, getVisualBoxList, getPresetEvent, visualBoxEventCheck, getIpcRtcConfig, getIpcPointList, updateIpcPointInfo, getVasUrlInfo, getVasServiceConfigList, getMovePathList, getMovePointDetails };
|
package/lib/cloud/interface.d.ts
CHANGED
@@ -1916,4 +1916,84 @@ export type UploadState = {
|
|
1916
1916
|
bizUrl?: string;
|
1917
1917
|
pollingToken?: string;
|
1918
1918
|
};
|
1919
|
+
export type GetIpcRtcConfig = {
|
1920
|
+
devId: string;
|
1921
|
+
};
|
1922
|
+
export type GetIpcRtcConfigRet = {
|
1923
|
+
maxZoomInTimes: number;
|
1924
|
+
[key: string]: any;
|
1925
|
+
};
|
1926
|
+
export type GetIpcPointList = {
|
1927
|
+
devId: string;
|
1928
|
+
};
|
1929
|
+
type PointItem = {
|
1930
|
+
devId: string;
|
1931
|
+
encryption: {
|
1932
|
+
key: string;
|
1933
|
+
};
|
1934
|
+
id: string;
|
1935
|
+
mpId: string;
|
1936
|
+
name: string;
|
1937
|
+
pic: string;
|
1938
|
+
pos?: string;
|
1939
|
+
version?: number;
|
1940
|
+
};
|
1941
|
+
export type GetIpcPointListRet = PointItem[];
|
1942
|
+
export type UpdateIpcPointInfo = {
|
1943
|
+
devId: string;
|
1944
|
+
id: string;
|
1945
|
+
name: string;
|
1946
|
+
};
|
1947
|
+
export type UpdateIpcPointInfoRet = boolean;
|
1948
|
+
export type GetVasUrlInfo = {
|
1949
|
+
path: string;
|
1950
|
+
isSupportMini: boolean;
|
1951
|
+
homeId: string;
|
1952
|
+
param: Record<string, any>;
|
1953
|
+
categoryCode: string;
|
1954
|
+
deviceId: string;
|
1955
|
+
serveType: string;
|
1956
|
+
utmRtid?: string;
|
1957
|
+
};
|
1958
|
+
export type GetVasUrlInfoRet = {
|
1959
|
+
type: number;
|
1960
|
+
url: string;
|
1961
|
+
};
|
1962
|
+
export type GetVasServiceConfigList = {
|
1963
|
+
type: number;
|
1964
|
+
instanceId: string;
|
1965
|
+
homeId: string;
|
1966
|
+
};
|
1967
|
+
type ServiceConfigItem = {
|
1968
|
+
categoryCode: string;
|
1969
|
+
configType: number;
|
1970
|
+
[key: string]: any;
|
1971
|
+
};
|
1972
|
+
export type GetVasServiceConfigListRet = ServiceConfigItem[];
|
1973
|
+
export type GetMovePathList = {
|
1974
|
+
devId: string;
|
1975
|
+
};
|
1976
|
+
interface Point {
|
1977
|
+
id: number;
|
1978
|
+
mpId: number;
|
1979
|
+
coords: string;
|
1980
|
+
pic: string;
|
1981
|
+
encryption: {
|
1982
|
+
key: string;
|
1983
|
+
};
|
1984
|
+
}
|
1985
|
+
interface Path {
|
1986
|
+
pathId: number;
|
1987
|
+
name: string;
|
1988
|
+
pointList: Point[];
|
1989
|
+
}
|
1990
|
+
export type GetMovePathListRet = {
|
1991
|
+
devId: string;
|
1992
|
+
pathList: Path[];
|
1993
|
+
};
|
1994
|
+
export type GetMovePointDetails = {
|
1995
|
+
devId: string;
|
1996
|
+
mpId: number;
|
1997
|
+
};
|
1998
|
+
export type GetMovePointDetailsRet = Point;
|
1919
1999
|
export {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/api",
|
3
|
-
"version": "1.7.
|
3
|
+
"version": "1.7.13",
|
4
4
|
"description": "Ray universal api",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -29,14 +29,14 @@
|
|
29
29
|
"watch": "ray start --type=component"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@ray-js/framework": "1.7.
|
33
|
-
"@ray-js/router": "1.7.
|
32
|
+
"@ray-js/framework": "1.7.13",
|
33
|
+
"@ray-js/router": "1.7.13",
|
34
34
|
"@ray-js/wechat": "^0.3.8",
|
35
35
|
"base64-browser": "^1.0.1",
|
36
36
|
"query-string": "^7.1.3"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
|
-
"@ray-js/cli": "1.7.
|
39
|
+
"@ray-js/cli": "1.7.13",
|
40
40
|
"art-template": "^4.13.4",
|
41
41
|
"fs-extra": "^10.1.0",
|
42
42
|
"miniprogram-api-typings": "^3.12.3",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"access": "public",
|
47
47
|
"registry": "https://registry.npmjs.com"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "0a3f037c3cb0cc2f7a5b5adbbce432b0808a4010"
|
50
50
|
}
|