createTempCustom(params: CreateCustomParams)
Requires:
@ray-js/lock-sdk≥1.0.0
Description
Create a custom temporary password.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Yes | Creation parameters |
Return Value
Type: Promise<TempPasswordResult>
Creation result
TempPasswordResult
| Property | Type | Description |
|---|---|---|
type | "custom" | "once" | "limit" | "clear" | "clearOne" | "dynamic" | Password type or dynamic (dynamic code) |
name | string | Display name |
password | string | Password plaintext or display string |
unlockBindingId | string | Cloud binding relationship ID |
| Effective time configuration |
Error Code
| Error Code | Error Message |
|---|---|
1052 | The previous operation on the same device has not completed |
1030 | Invalid password format |
1031 | Password name is too long (exceeds 20 characters) |
1032 | Missing effective time configuration |
1033 | Missing effective date |
1034 | Missing expiration date |
1010 | Effective time is later than expiration time |
1035 | weeks not provided in weekly repeat mode |
1043 | The cloud did not return a sequence number (near-field channel) |
1001 | Device is offline (near-field channel) |
1002 | Operation timed out (near-field channel) |
1041 | Device reported creation failure: duplicate password (near-field channel) |
1042 | Device reported creation failure (near-field channel) |
1037 | Cloud: Password already exists (USER_PWD_ALREADY_EXIST) |
1038 | Cloud: Duplicate password name (LOCK_PWD_NAME_REPEAT) |
1039 | Cloud: Invalid time parameters (START_END_DATE_NOT_RIGHT) |
Referenced Types
interface
EffectiveConfig| Property | Type | Required | Description |
|---|---|---|---|
effectiveDate | number | Yes | Effective date (seconds-level timestamp) |
expiredDate | number | Yes | Expiration date (seconds-level timestamp) |
repeat | "none" | "week" | No | Repeat policy: none or weekly |
weeks | Week | No | Weekly repeat bitmap |
effectiveTime | number | No | Daily start time (minutes) |
expiredTime | number | No | Daily end time (minutes) |
type
WeekWeekly repeat bitmap: indices 0–6 correspond to Sun–Sat; 0 inactive, 1 activeValid Values
EffectiveConfig.repeat
| Value | Description | Since |
|---|---|---|
none | - | - |
week | - | - |
Week
| Value | Description | Since |
|---|---|---|
0 | - | - |
1 | - | - |
return.type
| Value | Description | Since |
|---|---|---|
custom | - | - |
once | - | - |
limit | - | - |
clear | - | - |
clearOne | - | - |