ApiCoreFunctions
Function: onePerKey()
function onePerKey(
secret,
collection,
onePer,
record
): Promise<string | null>;Defined in: packages/core/src/records/rules.ts:90
The key a record must have under onePer, or null when something it names
is missing (no such link, no such field). With @author among the parts,
an owned key of the author's (records/key.ts), so no one else can write
its first version; without, a shared one: key.
Parameters
| Parameter | Type |
|---|---|
secret | CryptoKey |
collection | string |
onePer | readonly string[] |
record | { body: unknown; links: readonly Link[]; root: string; } |
record.body | unknown |
record.links | readonly Link[] |
record.root | string |
Returns
Promise<string | null>