Skip to content

TypeScript API / laikacms/storage / toPublicLock

Function: toPublicLock() ​

ts
function toPublicLock(lock): object;

Strip the bearer token from an owned lock before handing it to a reader.

Parameters ​

ParameterType
lock{ acquiredAt: Utc; expiresAt: Utc; key: string; owner: { id: string; name: string; }; token: string & Brand<"LockToken">; }
lock.acquiredAtUtc
lock.expiresAtUtc
lock.keystring
lock.owner{ id: string; name: string; }
lock.owner.idstring
lock.owner.namestring
lock.tokenstring & Brand<"LockToken">

Returns ​

acquiredAt ​

ts
readonly acquiredAt: Utc = S.DateTimeUtcFromString;

expiresAt ​

ts
readonly expiresAt: Utc = S.DateTimeUtcFromString;

key ​

ts
readonly key: string = S.String;

The document key the lock covers (collection/slug).

owner ​

ts
readonly owner: object;

owner.id ​

ts
readonly id: string = S.String;

owner.name ​

ts
readonly name: string = S.String;

Released under the MIT License.