minca
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

ParameterType
secretCryptoKey
collectionstring
onePerreadonly string[]
record{ body: unknown; links: readonly Link[]; root: string; }
record.bodyunknown
record.linksreadonly Link[]
record.rootstring

Returns

Promise<string | null>

On this page