diff --git a/lib/index.js b/lib/index.js index 8ababc8..b6cea27 100644 --- a/lib/index.js +++ b/lib/index.js @@ -331,7 +331,9 @@ function initDB(peer, config) { } /** - * @param {Rec} rec + * Public the identity ID from the given record. + * + * @param {Pick} rec * @returns {string | null} */ function getIdentityId(rec) { @@ -349,6 +351,10 @@ function initDB(peer, config) { } /** + * Find the identity that contains this `keypair` (or the implicit + * config.keypair) under the given `domain`. + * + * @public * @param {{ * keypair?: KeypairPublicSlice; * domain: string; @@ -386,10 +392,14 @@ function initDB(peer, config) { } /** + * Does this `identity` have this `keypair` (or the implicit config.keypair)? + * + * @public * @param {{ * keypair?: KeypairPublicSlice; * identity: string; * }} opts + * @returns {boolean} */ function identityHas(opts) { const keypair = opts?.keypair ?? config.keypair @@ -410,6 +420,10 @@ function initDB(peer, config) { } /** + * Create an identity (root msg) for the given `keypair` (or the implicit + * config.keypair) under this `domain`. + * + * @public * @param {{ * keypair?: Keypair, * domain: string, @@ -441,6 +455,10 @@ function initDB(peer, config) { } /** + * Find or create an identity (root msg) for the given `keypair` (or the + * implicit config.keypair) under this `domain`. + * + * @public * @param {{ * keypair?: Keypair, * domain: string, @@ -461,6 +479,10 @@ function initDB(peer, config) { } /** + * Create a consent signature for the given `keypair` (or the implicit + * config.keypair) to be added to the given `identity`. + * + * @public * @param {{ * keypair?: KeypairPrivateSlice; * identity: string; diff --git a/protospec.md b/protospec.md index 9a767f1..4847a2c 100644 --- a/protospec.md +++ b/protospec.md @@ -34,7 +34,7 @@ interface Msg { } } domain: string // alphanumeric string, at least 3 chars, max 100 chars - v: 2 // hard-coded at 2, indicates the version of the feed format + v: 3 // hard-coded at 3, indicates the version of the feed format } pubkey: Pubkey // base58 encoded string for the author's public key sig: Signature // Signs the `metadata` object @@ -60,7 +60,7 @@ interface Msg { } } domain: string // alphanumeric string, at least 3 chars, max 100 chars - v: 2 + v: 3 } pubkey: Pubkey sig: Signature @@ -86,11 +86,6 @@ type Key = algorithm: 'ed25519' // libsodium crypto_sign_detached bytes: string // base58 encoded string for the public key being added } - | { - purpose: 'subidentity' - algorithm: 'tangle' // PPPPP tangle - bytes: string // subidentity ID - } | { // WIP!! purpose: 'box' // asymmetric encryption