@ray-js/lock-sdk 1.2.1 → 1.2.2-beta.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/lib/api/log.d.ts +1 -0
- package/lib/constant.d.ts +2 -1
- package/lib/constant.js +1 -0
- package/lib/feature/log/log.js +6 -3
- package/lib/feature/misc/capability.js +10 -1
- package/lib/feature/state/init-state.js +2 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/sdk-log.js +1 -1
- package/package.json +1 -1
package/lib/api/log.d.ts
CHANGED
|
@@ -120,6 +120,7 @@ export interface LockLogListItem {
|
|
|
120
120
|
unionUnlockInfo?: UnionUnlockInfo[];
|
|
121
121
|
mediaInfoList?: MediaInfoRecord[];
|
|
122
122
|
localOperateRecordInfo?: LocalOperateRecordInfo;
|
|
123
|
+
localOperateRecord?: LocalOperateRecordInfo;
|
|
123
124
|
data?: boolean | number | string;
|
|
124
125
|
dpId: number;
|
|
125
126
|
matterRecordInfo?: {
|
package/lib/constant.d.ts
CHANGED
package/lib/constant.js
CHANGED
|
@@ -71,6 +71,7 @@ export var LocalOperateUserType;
|
|
|
71
71
|
LocalOperateUserType[LocalOperateUserType["ADMIN"] = 1] = "ADMIN";
|
|
72
72
|
LocalOperateUserType[LocalOperateUserType["SPECIAL_USER"] = 2] = "SPECIAL_USER";
|
|
73
73
|
LocalOperateUserType[LocalOperateUserType["NORMAL_USER"] = 3] = "NORMAL_USER";
|
|
74
|
+
LocalOperateUserType[LocalOperateUserType["UNKNOW"] = 255] = "UNKNOW";
|
|
74
75
|
})(LocalOperateUserType || (LocalOperateUserType = {}));
|
|
75
76
|
export var LocalOperateCategory;
|
|
76
77
|
(function (LocalOperateCategory) {
|
package/lib/feature/log/log.js
CHANGED
|
@@ -36,6 +36,9 @@ function handleLockLogs(list, cfg) {
|
|
|
36
36
|
catch {
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
+
if (type === "setting" && item.logType === "lock_local_record") {
|
|
40
|
+
type = "local_operation";
|
|
41
|
+
}
|
|
39
42
|
let userName = item.userName;
|
|
40
43
|
let unlockName = item.unlockName;
|
|
41
44
|
let tempPwdInfo = undefined;
|
|
@@ -167,7 +170,7 @@ function handleLockLogs(list, cfg) {
|
|
|
167
170
|
position: item.position,
|
|
168
171
|
};
|
|
169
172
|
}),
|
|
170
|
-
localRecord: handleLocalOperation(item.localOperateRecordInfo, itemData),
|
|
173
|
+
localRecord: handleLocalOperation(item.localOperateRecordInfo || item.localOperateRecord, itemData),
|
|
171
174
|
unionUnlockInfo: item.unionUnlockInfo?.map((item1) => {
|
|
172
175
|
return {
|
|
173
176
|
userId: item1.userId,
|
|
@@ -299,7 +302,7 @@ export async function getLogsForRuntime(rt, params) {
|
|
|
299
302
|
dpCode,
|
|
300
303
|
userName,
|
|
301
304
|
unlockName,
|
|
302
|
-
mediaInfo: record.mediaInfoList?.map?.(item => {
|
|
305
|
+
mediaInfo: record.mediaInfoList?.map?.((item) => {
|
|
303
306
|
return {
|
|
304
307
|
mediaPath: item.mediaPath,
|
|
305
308
|
fileKey: item.fileKey,
|
|
@@ -391,7 +394,7 @@ export async function getAlarmsForRuntime(rt, params) {
|
|
|
391
394
|
dpCode,
|
|
392
395
|
userName: record.userName,
|
|
393
396
|
unlockName: record.unlockName,
|
|
394
|
-
mediaInfo: record.mediaInfoList?.map?.(item => {
|
|
397
|
+
mediaInfo: record.mediaInfoList?.map?.((item) => {
|
|
395
398
|
return {
|
|
396
399
|
mediaPath: item.mediaPath,
|
|
397
400
|
fileKey: item.fileKey,
|
|
@@ -6,6 +6,7 @@ import { getWithLocalCache } from "../storage/swr-cache";
|
|
|
6
6
|
import { getVideoResolutionMark } from "../../api/video";
|
|
7
7
|
import dpCodes from "../../config/dp-code";
|
|
8
8
|
import { hasDpForRuntime } from "../dp/has-dp";
|
|
9
|
+
import { sdkLog } from "../../utils/sdk-log";
|
|
9
10
|
export const hasCapabilityForRuntime = (runtime, capability) => runtime.config.communication.includes(capability);
|
|
10
11
|
export const isBlePureDeviceForRuntime = (rt) => hasCapabilityForRuntime(rt, ProductCommunicationType.BLUETOOTH) &&
|
|
11
12
|
rt.config.communication.length === 1;
|
|
@@ -91,6 +92,10 @@ export const getDeviceAdvancedAbilitiesForRuntime = async (rt) => {
|
|
|
91
92
|
]);
|
|
92
93
|
const productAbilities = productAbilitiesRes.status === "fulfilled" ? productAbilitiesRes.value : [];
|
|
93
94
|
const tttAbList = tttList.status === "fulfilled" ? tttList.value.abilityList : [];
|
|
95
|
+
sdkLog("info", "advancedAbilities", "supportVR", {
|
|
96
|
+
devId,
|
|
97
|
+
data: { tttAbList },
|
|
98
|
+
});
|
|
94
99
|
const videoMark = videoMarkRes.status === "fulfilled"
|
|
95
100
|
? videoMarkRes.value
|
|
96
101
|
: { capability: [], cloudCapability: [] };
|
|
@@ -221,7 +226,11 @@ export const getDeviceAdvancedAbilitiesForRuntime = async (rt) => {
|
|
|
221
226
|
}
|
|
222
227
|
}
|
|
223
228
|
catch (error) {
|
|
224
|
-
|
|
229
|
+
sdkLog("error", "advancedAbilities", "parseCode Error", {
|
|
230
|
+
devId,
|
|
231
|
+
data: { code: item.abilityCode },
|
|
232
|
+
error,
|
|
233
|
+
});
|
|
225
234
|
}
|
|
226
235
|
});
|
|
227
236
|
if (deviceAdvancedAbilityRes.status === "fulfilled") {
|
|
@@ -17,7 +17,7 @@ import { fetchDeviceProperties } from "./remote-permissions";
|
|
|
17
17
|
import { ipc, yuChannelSyncSingleSync } from "../../platform";
|
|
18
18
|
import { sdkLog } from "../../utils/sdk-log";
|
|
19
19
|
import { ProductCommunicationType, RotateType } from "../../constant";
|
|
20
|
-
import { isHarmony } from "../../utils";
|
|
20
|
+
import { isHarmony, isVirtualDevice } from "../../utils";
|
|
21
21
|
import { getError } from "../../utils/errors";
|
|
22
22
|
export const initState = async (runtime) => {
|
|
23
23
|
const { devInfo: { dps, devId, yuNetState }, dpSchema, } = runtime.config;
|
|
@@ -85,6 +85,7 @@ export const initState = async (runtime) => {
|
|
|
85
85
|
},
|
|
86
86
|
});
|
|
87
87
|
if (isSupportVideo &&
|
|
88
|
+
!isVirtualDevice(devId) &&
|
|
88
89
|
!abilities.videoConfig.isHighResolution &&
|
|
89
90
|
!abilities.videoConfig.isLowResolution) {
|
|
90
91
|
throw getError(1107);
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
package/lib/utils/sdk-log.js
CHANGED