From d6c23301226fd85e6ca237de01b2b3dfcd45a041 Mon Sep 17 00:00:00 2001 From: Hayden Young Date: Tue, 27 Jun 2023 21:51:00 +0100 Subject: [PATCH] docs: Do not generate API docs for internal functionality. --- src/access-controllers/index.js | 9 +++------ src/access-controllers/ipfs.js | 1 + src/access-controllers/orbitdb.js | 1 + src/identities/providers/publickey.js | 11 +++++------ src/manifest-store.js | 1 + src/oplog/clock.js | 1 + src/oplog/conflict-resolution.js | 4 ++++ src/oplog/entry.js | 1 + src/oplog/heads.js | 7 +++++++ src/oplog/log.js | 2 ++ 10 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/access-controllers/index.js b/src/access-controllers/index.js index 2301bdc..bd0bb31 100644 --- a/src/access-controllers/index.js +++ b/src/access-controllers/index.js @@ -8,12 +8,6 @@ import IPFSAccessController from './ipfs.js' import OrbitDBAccessController from './orbitdb.js' -/** - * An array of available access controllers. - * @name accessControllers - * @†ype [] - * @return [] An array of access controllers. - */ const accessControllers = { ipfs: IPFSAccessController, orbitdb: OrbitDBAccessController @@ -23,6 +17,7 @@ const accessControllers = { * Gets an access controller module specified by type. * @param {string} type A valid access controller type. * @return {AccessController} The access controller module. + * @private */ const getAccessController = (type) => { if (!accessControllers[type]) { @@ -39,6 +34,7 @@ const getAccessController = (type) => { * already supported. * @throws Given AccessController class needs to implement: type if the access * controller module does not implement a type property. + * @static */ const addAccessController = (accessController) => { if (!accessController.type) { @@ -55,6 +51,7 @@ const addAccessController = (accessController) => { /** * Removes an access controller from the list. * @param {string} type A valid access controller type. + * @static */ const removeAccessController = type => { delete accessControllers[type] diff --git a/src/access-controllers/ipfs.js b/src/access-controllers/ipfs.js index 5e3ff66..e811a18 100644 --- a/src/access-controllers/ipfs.js +++ b/src/access-controllers/ipfs.js @@ -38,6 +38,7 @@ const type = 'ipfs' * @instance * @async * @memberof module:AccessControllers.AccessControllers-IPFS + * @private */ /** diff --git a/src/access-controllers/orbitdb.js b/src/access-controllers/orbitdb.js index e47fac0..c8f5b28 100644 --- a/src/access-controllers/orbitdb.js +++ b/src/access-controllers/orbitdb.js @@ -19,6 +19,7 @@ const type = 'orbitdb' * @instance * @async * @memberof module:AccessControllers.AccessControllers-OrbitDB + * @private */ /** diff --git a/src/identities/providers/publickey.js b/src/identities/providers/publickey.js index b9ad475..9d05573 100644 --- a/src/identities/providers/publickey.js +++ b/src/identities/providers/publickey.js @@ -7,11 +7,6 @@ import { toString as uint8ArrayToString } from 'uint8arrays/to-string' import { signMessage, verifyMessage } from '../../key-store.js' -/** - * The type of identity provider. - * @return string - * @const - */ const type = 'publickey' /** @@ -19,6 +14,7 @@ const type = 'publickey' * @param {module:Identity} identity * @return {boolean} True if the identity is valid, false otherwise. * @static + * @private */ const verifyIdentity = identity => { const { id, publicKey, signatures } = identity @@ -27,13 +23,16 @@ const verifyIdentity = identity => { /** * Instantiates the publickey identity provider. - * @return {module:IdentityProviders.IdentityProvider-PublicKey} A public key identity provider function. + * @return {module:IdentityProviders.IdentityProvider-PublicKey} A public key + * identity provider function. + * @private */ const PublicKeyIdentityProvider = ({ keystore }) => { /** * @namespace module:IdentityProviders.IdentityProvider-PublicKey * @memberof module:IdentityProviders * @description The instance returned by {@link module:IdentityProviders.IdentityProvider-PublicKey}. + * @private */ if (!keystore) { diff --git a/src/manifest-store.js b/src/manifest-store.js index 352dc1f..129b4d8 100644 --- a/src/manifest-store.js +++ b/src/manifest-store.js @@ -12,6 +12,7 @@ const ManifestStore = async ({ ipfs, storage } = {}) => { /** * @namespace module:Manifest~Manifest * @description The instance returned by {@link module:Manifest~Manifest}. + * @private */ storage = storage || await ComposedStorage( diff --git a/src/oplog/clock.js b/src/oplog/clock.js index b315ac4..84c4592 100644 --- a/src/oplog/clock.js +++ b/src/oplog/clock.js @@ -3,6 +3,7 @@ * @memberof module:Log * @description * The lamport clock. + * @private */ /** diff --git a/src/oplog/conflict-resolution.js b/src/oplog/conflict-resolution.js index 51e75e7..d01c302 100644 --- a/src/oplog/conflict-resolution.js +++ b/src/oplog/conflict-resolution.js @@ -9,6 +9,7 @@ import { compareClocks } from './clock.js' * @param {Entry} a First entry * @param {Entry} b Second entry * @return {number} 1 if a is latest, -1 if b is latest + * @private */ function LastWriteWins (a, b) { // Ultimate conflict resolution (take the first/left arg) @@ -31,6 +32,7 @@ function LastWriteWins (a, b) { * entries and return 1 if the first entry should be chosen and -1 if the * second entry should be chosen. * @return {number} 1 if a is greater, -1 if b is greater + * @private */ function SortByClocks (a, b, resolveConflict) { // Compare the clocks @@ -48,6 +50,7 @@ function SortByClocks (a, b, resolveConflict) { * are the same. The function should take in two entries and return 1 if the * first entry should be chosen and -1 if the second entry should be chosen. * @return {number} 1 if a is greater, -1 if b is greater + * @private */ function SortByClockId (a, b, resolveConflict) { // Sort by ID if clocks are concurrent, @@ -63,6 +66,7 @@ function SortByClockId (a, b, resolveConflict) { * @param {function(a, b)} [tiebreaker] The tiebreaker function to validate. * @return {function(a, b)} 1 if a is greater, -1 if b is greater * @throws {Error} if func ever returns 0 + * @private */ function NoZeroes (func) { const msg = `Your log's tiebreaker function, ${func.name}, has returned zero and therefore cannot be` diff --git a/src/oplog/entry.js b/src/oplog/entry.js index 87dd825..55768d8 100644 --- a/src/oplog/entry.js +++ b/src/oplog/entry.js @@ -2,6 +2,7 @@ * @namespace module:Log~Entry * @memberof module:Log * @description A log entry. + * @private */ import Clock from './clock.js' import * as Block from 'multiformats/block' diff --git a/src/oplog/heads.js b/src/oplog/heads.js index df908ba..e5e0c56 100644 --- a/src/oplog/heads.js +++ b/src/oplog/heads.js @@ -1,3 +1,9 @@ +/** + * @namespace module:Log~Heads + * @memberof module:Log + * @description The log's heads. + * @private + */ import Entry from './entry.js' import MemoryStorage from '../storage/memory.js' @@ -77,6 +83,7 @@ const Heads = async ({ storage, heads }) => { * * @param {Array} entries Entries to search heads from * @return {Array} + * @private */ const findHeads = (entries) => { entries = new Set(entries) diff --git a/src/oplog/log.js b/src/oplog/log.js index a2d7e80..cd22f99 100644 --- a/src/oplog/log.js +++ b/src/oplog/log.js @@ -6,6 +6,7 @@ * Implemented as a Merkle-CRDT as per the paper: * "Merkle-CRDTs: Merkle-DAGs meet CRDTs" * https://arxiv.org/abs/2004.00107 + * @private */ import LRU from 'lru' import Entry from './entry.js' @@ -55,6 +56,7 @@ const Log = async (identity, { logId, logHeads, access, entryStorage, headsStora /** * @namespace Log * @description The instance returned by {@link module:Log}. + * @private */ if (identity == null) {