getLatestLogs()
Requires:
@ray-js/lock-sdk≥1.0.0
Description
Get the most recent 2 records
Parameters
None
Return Value
Type: Promise<GetLatestLogsResult>
Most recent log entries and unread count
GetLatestLogsResult
| Property | Type | Description |
|---|---|---|
| Log data | ||
unreadCount | number | Unread count |
Referenced Types
interface
LogData| Property | Type | Description |
|---|---|---|
logId | string | Unique log ID |
time | number | Event time (milliseconds timestamp) |
currentUser | boolean | Whether related to the current logged-in user |
type | "alarm_record" | "close_record" | "unlock_record" | "operation" | "local_operation" | Log type |
operationType | "dev_bind" | "member_schedule_update" | "unlock_add" | "unlock_del" | "temp_pwd_create" | "temp_pwd_del" | "temp_pwd_meta_update" | "temp_pwd_name_update" | "offline_pwd_achieve" | "offline_pwd_clear_achieve" | "offline_pwd_clear_single_achieve" | "offline_pwd_name_update" | "arming_switch" | "unlock_switch" | "automatic_lock" | "auto_lock_time" | "verify_lock_switch" | "do_not_disturb" | "special_control" | "special_function" | "beep_volume" | "remote_unlock_setting" | "remote_voice_pwd_setting" | Only valid when the operation type field type equals operation |
userId | string | Associated user ID |
dpId | number | Associated DP numeric ID |
dpCode | string | Associated DP code |
data | any | Business data (DP value or other structure) |
userName | string | Associated user nickname |
avatarUrl | string | Associated user avatar URL (returned by some devices in history.list 2.0) |
relateDevName | string | Associated sub-device name (returned by some devices in history.list 2.0; sub-device/gateway-attached lock scenario) |
bindable | boolean | Whether bindable (valid for unlock_record) |
unlockName | string | Unlock method name (unlock_record) |
| Attachment media list | ||
| Combination unlock members (unlock_record) | ||
closeValue | "UNDEFINED" | "VOICE_REMOTE" | "APP_REMOTE" | "AUTO" | "LOCAL_MANUAL" | "FITTINGS" | "APP" | "GEO_FENCE" | Lock method (close_record) |
| Local operation details (local_operation) | ||
isHijack | boolean | Duress alarm |
unlockMethod | "finger" | "face" | "password" | "card" | "fingerVein" | "hand" | "eye" | Unlock method type (unlock_record) |
| Matter unlock record | ||
| Temporary password info; valid when operateType is temp_pwd_create/ | ||
| Clear-password info | ||
| Unlock method info Valid when the operation type is unlock_add/unlock_del | ||
| Update user validity info Valid when the operation type is member_schedule_update |
enum
LocalOperateUserType| Value | Actual Value | Description |
|---|---|---|
LocalOperateUserType.SUPER_ADMIN | 0 | Super administrator |
LocalOperateUserType.ADMIN | 1 | Administrator |
LocalOperateUserType.SPECIAL_USER | 2 | Special user |
LocalOperateUserType.NORMAL_USER | 3 | Regular user |
type
WeekWeekly repeat bitmap: indices 0–6 correspond to Sun–Sat; 0 inactive, 1 activeValid Values
LogData.type
| Value | Description | Since |
|---|---|---|
alarm_record | - | - |
close_record | - | - |
unlock_record | - | - |
operation | - | - |
local_operation | - | - |
LogData.operationType
| Value | Description | Since |
|---|---|---|
dev_bind | - | - |
member_schedule_update | - | - |
unlock_add | - | - |
unlock_del | - | - |
temp_pwd_create | - | - |
temp_pwd_del | - | - |
temp_pwd_meta_update | - | - |
temp_pwd_name_update | - | - |
offline_pwd_achieve | - | - |
offline_pwd_clear_achieve | - | - |
offline_pwd_clear_single_achieve | - | - |
offline_pwd_name_update | - | - |
arming_switch | - | - |
unlock_switch | - | - |
automatic_lock | - | - |
auto_lock_time | - | - |
verify_lock_switch | - | - |
do_not_disturb | - | - |
special_control | - | - |
special_function | - | - |
beep_volume | - | - |
remote_unlock_setting | - | - |
remote_voice_pwd_setting | - | - |
LogData.unionUnlockInfo.type
| Value | Description | Since |
|---|---|---|
finger | - | - |
face | - | - |
password | - | - |
card | - | - |
fingerVein | - | - |
hand | - | - |
eye | - | - |
LogData.closeValue
| Value | Description | Since |
|---|---|---|
UNDEFINED | - | - |
VOICE_REMOTE | - | - |
APP_REMOTE | - | - |
AUTO | - | - |
LOCAL_MANUAL | - | - |
FITTINGS | - | - |
APP | - | - |
GEO_FENCE | - | - |
LocalUnlockMethodData.category
| Value | Description | Since |
|---|---|---|
0 | - | - |
1 | - | - |
2 | - | - |
LocalUnlockMethodData.unlockMethod
| Value | Description | Since |
|---|---|---|
finger | - | - |
face | - | - |
password | - | - |
card | - | - |
fingerVein | - | - |
hand | - | - |
eye | - | - |
LocalOperateUserType
| Value | Description | Since |
|---|---|---|
0 | Super administrator | - |
1 | Administrator | - |
2 | Special user | - |
3 | Regular user | - |
LocalAddUserData.category
| Value | Description | Since |
|---|---|---|
16 | - | - |
17 | - | - |
LogData.unlockMethod
| Value | Description | Since |
|---|---|---|
finger | - | - |
face | - | - |
password | - | - |
card | - | - |
fingerVein | - | - |
hand | - | - |
eye | - | - |
EffectiveConfig.repeat
| Value | Description | Since |
|---|---|---|
none | - | - |
week | - | - |
Week
| Value | Description | Since |
|---|---|---|
0 | - | - |
1 | - | - |
LogData.unlockInfo.type
| Value | Description | Since |
|---|---|---|
finger | - | - |
face | - | - |
password | - | - |
card | - | - |
fingerVein | - | - |
hand | - | - |
eye | - | - |