From f8d042244382722620eed6cc9e34434156f443f0 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Mon, 29 Jan 2024 14:05:17 +0100 Subject: [PATCH] fix: review --- src/asp.js | 4 ++-- src/claim.js | 10 +++++----- src/defaults.js | 1 - src/fetcher/activitypub.js | 1 - src/fetcher/aspe.js | 3 +-- src/fetcher/dns.js | 1 - src/fetcher/graphql.js | 1 - src/fetcher/http.js | 1 - src/fetcher/irc.js | 3 +-- src/fetcher/matrix.js | 1 - src/fetcher/openpgp.js | 1 - src/fetcher/telegram.js | 1 - src/fetcher/xmpp.js | 8 +------- src/index.js | 5 +++++ src/persona.js | 5 ++--- src/profile.js | 3 +-- src/proofs.js | 1 - src/serviceProviders/activitypub.js | 4 +--- src/serviceProviders/aspe.js | 4 +--- src/serviceProviders/discourse.js | 4 +--- src/serviceProviders/dns.js | 4 +--- src/serviceProviders/forem.js | 4 +--- src/serviceProviders/forgejo.js | 4 +--- src/serviceProviders/gitea.js | 4 +--- src/serviceProviders/github.js | 4 +--- src/serviceProviders/gitlab.js | 4 +--- src/serviceProviders/hackernews.js | 4 +--- src/serviceProviders/irc.js | 4 +--- src/serviceProviders/keybase.js | 4 +--- src/serviceProviders/liberapay.js | 4 +--- src/serviceProviders/lichess.js | 4 +--- src/serviceProviders/lobsters.js | 4 +--- src/serviceProviders/matrix.js | 4 +--- src/serviceProviders/opencollective.js | 4 +--- src/serviceProviders/openpgp.js | 4 +--- src/serviceProviders/orcid.js | 4 +--- src/serviceProviders/owncast.js | 4 +--- src/serviceProviders/reddit.js | 4 +--- src/serviceProviders/stackexchange.js | 4 +--- src/serviceProviders/telegram.js | 4 +--- src/serviceProviders/twitter.js | 4 +--- src/serviceProviders/xmpp.js | 4 +--- src/signatures.js | 1 - src/types.js | 6 +++--- src/verifications.js | 5 ++--- 45 files changed, 48 insertions(+), 114 deletions(-) diff --git a/src/asp.js b/src/asp.js index cf16088..226f1a8 100644 --- a/src/asp.js +++ b/src/asp.js @@ -82,7 +82,7 @@ export async function fetchASPE (uri) { * @param {string} uri - The ASPE URI associated with the profile * @returns {Promise} The extracted profile * @example - * const key = await doip.aspe.parseProfileJws('...'); + * const key = await doip.aspe.parseProfileJws('...', 'aspe:domain.example:123'); */ export async function parseProfileJws (profileJws, uri) { const matches = uri.match(/aspe:(.*):(.*)/) @@ -132,7 +132,7 @@ export async function parseProfileJws (profileJws, uri) { const profileDescription = payloadJson['http://ariadne.id/description'] /** @type {string} */ const profileThemeColor = payloadJson['http://ariadne.id/color'] - /** @type {string[]} */ + /** @type {Array} */ const profileClaims = payloadJson['http://ariadne.id/claims'] const profileClaimsParsed = profileClaims.map(x => new Claim(x, uri)) diff --git a/src/claim.js b/src/claim.js index fc6b956..f04f3c6 100644 --- a/src/claim.js +++ b/src/claim.js @@ -70,15 +70,16 @@ export class Claim { */ this._status = ClaimStatus.INIT /** - * @type {ServiceProvider[]} + * @type {Array} */ this._matches = [] } /** * @function - * @param {object} claimObject - JSON representation of a claim - * @returns {Claim | Error} Parsed claim + * @param {*} claimObject - JSON representation of a claim + * @returns {Claim} Parsed claim + * @throws Will throw an error if the JSON object can't be coerced into a Claim * @example * doip.Claim.fromJSON(JSON.stringify(claim)); */ @@ -214,7 +215,6 @@ export class Claim { * checked for the fingerprint. The verification stops when either a positive * result was obtained, or an unambiguous claim definition was processed * regardless of the result. - * @async * @function * @param {import('./types').VerificationConfig} [opts] - Options for proxy, fetchers */ @@ -244,7 +244,7 @@ export class Claim { let claimData = this._matches[index] - /** @type {import('./types').VerificationResult} */ + /** @type {import('./types').VerificationResult | null} */ let verificationResult = null let proofData = null let proofFetchError diff --git a/src/defaults.js b/src/defaults.js index 7bd4465..1d261b7 100644 --- a/src/defaults.js +++ b/src/defaults.js @@ -22,7 +22,6 @@ import { ProxyPolicy } from './enums.js' /** * The default claim verification config used throughout the library - * @constant * @type {import('./types').VerificationConfig} */ export const opts = { diff --git a/src/fetcher/activitypub.js b/src/fetcher/activitypub.js index e747e22..10afc10 100644 --- a/src/fetcher/activitypub.js +++ b/src/fetcher/activitypub.js @@ -38,7 +38,6 @@ export const timeout = 5000 /** * Execute a fetch request * @function - * @async * @param {object} data - Data used in the request * @param {string} data.url - The URL of the account to verify * @param {number} [data.fetcherTimeout] - Optional timeout for the fetcher diff --git a/src/fetcher/aspe.js b/src/fetcher/aspe.js index f60e672..b0d6198 100644 --- a/src/fetcher/aspe.js +++ b/src/fetcher/aspe.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Fetch proofs from {@link module:profile~Profile} obtained through ASPE + * Fetch proofs from Profile obtained through ASPE * @module fetcher/aspe * @example * import { fetcher } from 'doipjs'; @@ -38,7 +38,6 @@ const reURI = /^aspe:([a-zA-Z0-9.\-_]*):([a-zA-Z0-9]*)/ /** * Execute a fetch request * @function - * @async * @param {object} data - Data used in the request * @param {string} data.aspeUri - ASPE URI of the targeted profile * @param {number} [data.fetcherTimeout] - Optional timeout for the fetcher diff --git a/src/fetcher/dns.js b/src/fetcher/dns.js index b7b6908..ff7438b 100644 --- a/src/fetcher/dns.js +++ b/src/fetcher/dns.js @@ -35,7 +35,6 @@ export const timeout = 5000 /** * Execute a fetch request * @function - * @async * @param {object} data - Data used in the request * @param {string} data.domain - The targeted domain * @param {number} [data.fetcherTimeout] - Optional timeout for the fetcher diff --git a/src/fetcher/graphql.js b/src/fetcher/graphql.js index c9d7c5d..01e649f 100644 --- a/src/fetcher/graphql.js +++ b/src/fetcher/graphql.js @@ -35,7 +35,6 @@ export const timeout = 5000 /** * Execute a GraphQL query via HTTP request * @function - * @async * @param {object} data - Data used in the request * @param {string} data.url - The URL pointing at the GraphQL HTTP endpoint * @param {string} data.query - The GraphQL query to fetch the data containing the proof diff --git a/src/fetcher/http.js b/src/fetcher/http.js index 5bee3b1..4122eb4 100644 --- a/src/fetcher/http.js +++ b/src/fetcher/http.js @@ -36,7 +36,6 @@ export const timeout = 5000 /** * Execute a fetch request * @function - * @async * @param {object} data - Data used in the request * @param {string} data.url - The URL pointing at targeted content * @param {string} data.format - The format of the targeted content diff --git a/src/fetcher/irc.js b/src/fetcher/irc.js index 3ae465f..8469698 100644 --- a/src/fetcher/irc.js +++ b/src/fetcher/irc.js @@ -35,13 +35,12 @@ export const timeout = 20000 /** * Execute a fetch request * @function - * @async * @param {object} data - Data used in the request * @param {string} data.nick - The nick of the targeted account * @param {string} data.domain - The domain on which the targeted account is registered * @param {number} [data.fetcherTimeout] - Optional timeout for the fetcher * @param {import('../types').VerificationConfig} [opts] - Options used to enable the request - * @returns {Promise} The fetched proofs from an IRC account + * @returns {Promise>} The fetched proofs from an IRC account */ export async function fn (data, opts) { let timeoutHandle diff --git a/src/fetcher/matrix.js b/src/fetcher/matrix.js index 446542e..ee5d09a 100644 --- a/src/fetcher/matrix.js +++ b/src/fetcher/matrix.js @@ -37,7 +37,6 @@ export const timeout = 5000 /** * Execute a fetch request * @function - * @async * @param {object} data - Data used in the request * @param {string} data.eventId - The identifier of the targeted post * @param {string} data.roomId - The identifier of the room containing the targeted post diff --git a/src/fetcher/openpgp.js b/src/fetcher/openpgp.js index 43badcb..d7b28cc 100644 --- a/src/fetcher/openpgp.js +++ b/src/fetcher/openpgp.js @@ -45,7 +45,6 @@ export const timeout = 5000 /** * Execute a fetch request * @function - * @async * @param {object} data - Data used in the request * @param {string} data.url - The URL pointing at targeted content * @param {OpenPgpQueryProtocol} data.protocol - The protocol used to access the targeted content diff --git a/src/fetcher/telegram.js b/src/fetcher/telegram.js index ede3575..b80845b 100644 --- a/src/fetcher/telegram.js +++ b/src/fetcher/telegram.js @@ -36,7 +36,6 @@ export const timeout = 5000 /** * Execute a fetch request * @function - * @async * @param {object} data - Data used in the request * @param {string} data.chat - Telegram public group name (slug) * @param {string} data.user - Telegram username diff --git a/src/fetcher/xmpp.js b/src/fetcher/xmpp.js index 97184a1..96477cc 100644 --- a/src/fetcher/xmpp.js +++ b/src/fetcher/xmpp.js @@ -41,17 +41,12 @@ let iqCaller = null * Start the XMPP client * @ignore * @function - * @async * @param {import('../types').XmppClaimVerificationConfig} params - XMPP claim verification config * @returns {Promise} The fetched proofs from an XMPP account */ const xmppStart = async (params) => { return new Promise((resolve, reject) => { - const xmpp = client({ - service: params.service, - username: params.username, - password: params.password - }) + const xmpp = client({ ...params }) if (process.env.NODE_ENV !== 'production') { debug(xmpp, true) } @@ -69,7 +64,6 @@ const xmppStart = async (params) => { /** * Execute a fetch request * @function - * @async * @param {object} data - Data used in the request * @param {string} data.id - The identifier of the targeted account * @param {number} [data.fetcherTimeout] - Optional timeout for the fetcher diff --git a/src/index.js b/src/index.js index b932e51..82ae2fb 100644 --- a/src/index.js +++ b/src/index.js @@ -13,6 +13,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ + +/** + * @module doipjs + * @license Apache-2.0 + */ export { Profile } from './profile.js' export { Persona } from './persona.js' export { Claim } from './claim.js' diff --git a/src/persona.js b/src/persona.js index 900d5dd..defd68e 100644 --- a/src/persona.js +++ b/src/persona.js @@ -18,7 +18,6 @@ import { Claim } from './claim.js' /** * @class * @classdesc A persona with identity claims - * @public * @example * const claim = Claim('https://alice.tld', '123'); * const pers = Persona('Alice', 'About Alice', [claim]); @@ -26,7 +25,7 @@ import { Claim } from './claim.js' export class Persona { /** * @param {string} name - Name of the persona - * @param {Claim[]} claims - Claims of the persona + * @param {Array} claims - Claims of the persona */ constructor (name, claims) { /** @@ -67,7 +66,7 @@ export class Persona { this.themeColor = null /** * List of identity claims - * @type {Claim[]} + * @type {Array} * @public */ this.claims = claims diff --git a/src/profile.js b/src/profile.js index 96ebfff..4db0ebd 100644 --- a/src/profile.js +++ b/src/profile.js @@ -20,7 +20,6 @@ import { Persona } from './persona.js' * @class * @classdesc A profile of personas with identity claims * @param {Array} personas - Personas of the profile - * @public * @example * const claim = Claim('https://alice.tld', '123'); * const pers = Persona('Alice', 'About Alice', [claim]); @@ -80,7 +79,7 @@ export class Profile { } /** * List of verifier URLs - * @type {import('./types').ProfileVerifier[]} + * @type {Array} * @public */ this.verifiers = [] diff --git a/src/proofs.js b/src/proofs.js index db9912c..67defb1 100644 --- a/src/proofs.js +++ b/src/proofs.js @@ -29,7 +29,6 @@ import { ServiceProvider } from './serviceProvider.js' * the `data` parameter and the proxy policy set in the `opts` parameter to * choose the right approach to fetch the proof. An error will be thrown if no * approach is possible. - * @async * @param {ServiceProvider} data - Data from a claim definition * @param {import('./types').VerificationConfig} opts - Options to enable the request * @returns {Promise} Fetched proof data diff --git a/src/serviceProviders/activitypub.js b/src/serviceProviders/activitypub.js index 6445fd3..444b2f4 100644 --- a/src/serviceProviders/activitypub.js +++ b/src/serviceProviders/activitypub.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * ActivityPub service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/activitypub/) + * ActivityPub service provider ({@link https://docs.keyoxide.org/service-providers/activitypub/|Keyoxide docs}) * @module serviceProviders/activitypub * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/aspe.js b/src/serviceProviders/aspe.js index ad30b74..58c4a78 100644 --- a/src/serviceProviders/aspe.js +++ b/src/serviceProviders/aspe.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * ASPE service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/aspe/) + * ASPE service provider ({@link https://docs.keyoxide.org/service-providers/aspe/|Keyoxide docs}) * @module serviceProviders/aspe * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/discourse.js b/src/serviceProviders/discourse.js index b74581b..8f9a184 100644 --- a/src/serviceProviders/discourse.js +++ b/src/serviceProviders/discourse.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Discourse service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/discourse/) + * Discourse service provider ({@link https://docs.keyoxide.org/service-providers/discourse/|Keyoxide docs}) * @module serviceProviders/discourse * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/dns.js b/src/serviceProviders/dns.js index 8548d4f..07397ee 100644 --- a/src/serviceProviders/dns.js +++ b/src/serviceProviders/dns.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * DNS service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/dns/) + * DNS service provider ({@link https://docs.keyoxide.org/service-providers/dns/|Keyoxide docs}) * @module serviceProviders/dns * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/forem.js b/src/serviceProviders/forem.js index 563ba36..e62370c 100644 --- a/src/serviceProviders/forem.js +++ b/src/serviceProviders/forem.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Forem service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/forem/) + * Forem service provider ({@link https://docs.keyoxide.org/service-providers/forem/|Keyoxide docs}) * @module serviceProviders/forem * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/forgejo.js b/src/serviceProviders/forgejo.js index ace5e6a..1d09806 100644 --- a/src/serviceProviders/forgejo.js +++ b/src/serviceProviders/forgejo.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Forgejo service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/forgejo/) + * Forgejo service provider ({@link https://docs.keyoxide.org/service-providers/forgejo/|Keyoxide docs}) * @module serviceProviders/forgejo * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/gitea.js b/src/serviceProviders/gitea.js index aa98553..2387ce3 100644 --- a/src/serviceProviders/gitea.js +++ b/src/serviceProviders/gitea.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Gitea service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/gitea/) + * Gitea service provider ({@link https://docs.keyoxide.org/service-providers/gitea/|Keyoxide docs}) * @module serviceProviders/gitea * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/github.js b/src/serviceProviders/github.js index 6fa125c..cb9c444 100644 --- a/src/serviceProviders/github.js +++ b/src/serviceProviders/github.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Github service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/github/) + * Github service provider ({@link https://docs.keyoxide.org/service-providers/github/|Keyoxide docs}) * @module serviceProviders/github * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/gitlab.js b/src/serviceProviders/gitlab.js index f2291e7..e8e2eea 100644 --- a/src/serviceProviders/gitlab.js +++ b/src/serviceProviders/gitlab.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Gitlab service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/gitlab/) + * Gitlab service provider ({@link https://docs.keyoxide.org/service-providers/gitlab/|Keyoxide docs}) * @module serviceProviders/gitlab * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/hackernews.js b/src/serviceProviders/hackernews.js index 607973c..9e96b8a 100644 --- a/src/serviceProviders/hackernews.js +++ b/src/serviceProviders/hackernews.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Hackernews service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/hackernews/) + * Hackernews service provider ({@link https://docs.keyoxide.org/service-providers/hackernews/|Keyoxide docs}) * @module serviceProviders/hackernews * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/irc.js b/src/serviceProviders/irc.js index 031e570..41164a2 100644 --- a/src/serviceProviders/irc.js +++ b/src/serviceProviders/irc.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * IRC service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/irc/) + * IRC service provider ({@link https://docs.keyoxide.org/service-providers/irc/|Keyoxide docs}) * @module serviceProviders/irc * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/keybase.js b/src/serviceProviders/keybase.js index f6233e2..f221cb7 100644 --- a/src/serviceProviders/keybase.js +++ b/src/serviceProviders/keybase.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Keybase service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/keybase/) + * Keybase service provider ({@link https://docs.keyoxide.org/service-providers/keybase/|Keyoxide docs}) * @module serviceProviders/keybase * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/liberapay.js b/src/serviceProviders/liberapay.js index 00c88ca..ac7d32b 100644 --- a/src/serviceProviders/liberapay.js +++ b/src/serviceProviders/liberapay.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Liberapay service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/liberapay/) + * Liberapay service provider ({@link https://docs.keyoxide.org/service-providers/liberapay/|Keyoxide docs}) * @module serviceProviders/liberapay * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/lichess.js b/src/serviceProviders/lichess.js index 1c921df..6db1843 100644 --- a/src/serviceProviders/lichess.js +++ b/src/serviceProviders/lichess.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Lichess service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/lichess/) + * Lichess service provider ({@link https://docs.keyoxide.org/service-providers/lichess/|Keyoxide docs}) * @module serviceProviders/lichess * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/lobsters.js b/src/serviceProviders/lobsters.js index 8e9ac82..98579bb 100644 --- a/src/serviceProviders/lobsters.js +++ b/src/serviceProviders/lobsters.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Lobste.rs service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/lobsters/) + * Lobste.rs service provider ({@link https://docs.keyoxide.org/service-providers/lobsters/|Keyoxide docs}) * @module serviceProviders/lobsters * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/matrix.js b/src/serviceProviders/matrix.js index 4edd058..7e26f27 100644 --- a/src/serviceProviders/matrix.js +++ b/src/serviceProviders/matrix.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Matrix service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/matrix/) + * Matrix service provider ({@link https://docs.keyoxide.org/service-providers/matrix/|Keyoxide docs}) * @module serviceProviders/matrix * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/opencollective.js b/src/serviceProviders/opencollective.js index a0155ae..a73f44c 100644 --- a/src/serviceProviders/opencollective.js +++ b/src/serviceProviders/opencollective.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * OpenCollective service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/opencollective/) + * OpenCollective service provider ({@link https://docs.keyoxide.org/service-providers/opencollective/|Keyoxide docs}) * @module serviceProviders/opencollective * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/openpgp.js b/src/serviceProviders/openpgp.js index dacc667..01e7170 100644 --- a/src/serviceProviders/openpgp.js +++ b/src/serviceProviders/openpgp.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * OpenPGP service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/openpgp/) + * OpenPGP service provider ({@link https://docs.keyoxide.org/service-providers/openpgp/|Keyoxide docs}) * @module serviceProviders/openpgp * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/orcid.js b/src/serviceProviders/orcid.js index 50253c1..a440cd2 100644 --- a/src/serviceProviders/orcid.js +++ b/src/serviceProviders/orcid.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * ORCiD service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/orcid/) + * ORCiD service provider ({@link https://docs.keyoxide.org/service-providers/orcid/|Keyoxide docs}) * @module serviceProviders/orcid * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/owncast.js b/src/serviceProviders/owncast.js index 4817373..9ec5339 100644 --- a/src/serviceProviders/owncast.js +++ b/src/serviceProviders/owncast.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Owncast service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/owncast/) + * Owncast service provider ({@link https://docs.keyoxide.org/service-providers/owncast/|Keyoxide docs}) * @module serviceProviders/owncast * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/reddit.js b/src/serviceProviders/reddit.js index 4847dbb..0bb3be5 100644 --- a/src/serviceProviders/reddit.js +++ b/src/serviceProviders/reddit.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Reddit service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/reddit/) + * Reddit service provider ({@link https://docs.keyoxide.org/service-providers/reddit/|Keyoxide docs}) * @module serviceProviders/reddit * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/stackexchange.js b/src/serviceProviders/stackexchange.js index 27032d9..fc49651 100644 --- a/src/serviceProviders/stackexchange.js +++ b/src/serviceProviders/stackexchange.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * StackExchange service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/stackexchange/) + * StackExchange service provider ({@link https://docs.keyoxide.org/service-providers/stackexchange/|Keyoxide docs}) * @module serviceProviders/stackexchange * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/telegram.js b/src/serviceProviders/telegram.js index 88bb676..be1f635 100644 --- a/src/serviceProviders/telegram.js +++ b/src/serviceProviders/telegram.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Telegram service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/telegram/) + * Telegram service provider ({@link https://docs.keyoxide.org/service-providers/telegram/|Keyoxide docs}) * @module serviceProviders/telegram * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/twitter.js b/src/serviceProviders/twitter.js index 8d466a0..592dac7 100644 --- a/src/serviceProviders/twitter.js +++ b/src/serviceProviders/twitter.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * Twitter service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/twitter/) + * Twitter service provider ({@link https://docs.keyoxide.org/service-providers/twitter/|Keyoxide docs}) * @module serviceProviders/twitter * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/serviceProviders/xmpp.js b/src/serviceProviders/xmpp.js index bfa40d6..db4f88c 100644 --- a/src/serviceProviders/xmpp.js +++ b/src/serviceProviders/xmpp.js @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ /** - * XMPP service provider - * - * Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/xmpp/) + * XMPP service provider ({@link https://docs.keyoxide.org/service-providers/xmpp/|Keyoxide docs}) * @module serviceProviders/xmpp * @example * import { ServiceProviderDefinitions } from 'doipjs'; diff --git a/src/signatures.js b/src/signatures.js index 654a33e..60be4bc 100644 --- a/src/signatures.js +++ b/src/signatures.js @@ -26,7 +26,6 @@ import { Persona } from './persona.js' /** * Extract the profile from a signature and fetch the associated key - * @async * @param {string} signature - The plaintext signature to parse * @returns {Promise} The profile obtained from the signature */ diff --git a/src/types.js b/src/types.js index d50877f..95b330d 100644 --- a/src/types.js +++ b/src/types.js @@ -57,7 +57,7 @@ import { PublicKeyType, PublicKeyEncoding, PublicKeyFetchMethod, ProxyPolicy, Cl * @typedef {object} ServiceProviderProof * @property {ServiceProviderProofRequest} request - Details to request the potential proof * @property {ServiceProviderProofResponse} response - Details about the expected response - * @property {ProofTarget[]} target - Details about the target located in the response + * @property {Array} target - Details about the target located in the response */ /** @@ -175,7 +175,7 @@ import { PublicKeyType, PublicKeyEncoding, PublicKeyFetchMethod, ProxyPolicy, Cl * @property {boolean} result - Whether the proof was found and the claim verified * @property {boolean} completed - Whether the verification process completed without errors * @property {VerificationResultProof} [proof] - Details about the proof and how it was fetched - * @property {any[]} errors - Errors that ocurred during the verification process + * @property {Array} errors - Errors that ocurred during the verification process */ /** @@ -191,7 +191,7 @@ import { PublicKeyType, PublicKeyEncoding, PublicKeyFetchMethod, ProxyPolicy, Cl * @property {ClaimFormat} format - How the response data is formatted * @property {EntityEncodingFormat} encoding - How the response data is encoded * @property {ClaimRelation} relation - How the proof is related to the response data - * @property {string[]} path - Path to the proof inside the response data object + * @property {Array} path - Path to the proof inside the response data object */ export const Types = {} diff --git a/src/verifications.js b/src/verifications.js index 05ddd0a..e6d7aa7 100644 --- a/src/verifications.js +++ b/src/verifications.js @@ -215,8 +215,8 @@ const containsProof = async (data, params) => { /** * Run a JSON object through the verification process * @function - * @param {any} proofData - Data potentially containing the proof - * @param {string[]} checkPath - Paths to check for proof + * @param {*} proofData - Data potentially containing the proof + * @param {Array} checkPath - Paths to check for proof * @param {import('./types').VerificationParams} params - Verification parameters * @returns {Promise} Whether the proof was found in the object */ @@ -266,7 +266,6 @@ const runJSON = async (proofData, checkPath, params) => { /** * Run the verification by searching for the proof in the fetched data - * @async * @param {object} proofData - The proof data * @param {ServiceProvider} claimData - The claim data * @param {string} fingerprint - The fingerprint