fix: review

This commit is contained in:
Yarmo Mackenbach 2024-01-29 14:05:17 +01:00
parent fe6588dcbb
commit f8d0422443
No known key found for this signature in database
GPG key ID: C248C28D432560ED
45 changed files with 48 additions and 114 deletions

View file

@ -82,7 +82,7 @@ export async function fetchASPE (uri) {
* @param {string} uri - The ASPE URI associated with the profile * @param {string} uri - The ASPE URI associated with the profile
* @returns {Promise<Profile>} The extracted profile * @returns {Promise<Profile>} The extracted profile
* @example * @example
* const key = await doip.aspe.parseProfileJws('...'); * const key = await doip.aspe.parseProfileJws('...', 'aspe:domain.example:123');
*/ */
export async function parseProfileJws (profileJws, uri) { export async function parseProfileJws (profileJws, uri) {
const matches = uri.match(/aspe:(.*):(.*)/) const matches = uri.match(/aspe:(.*):(.*)/)
@ -132,7 +132,7 @@ export async function parseProfileJws (profileJws, uri) {
const profileDescription = payloadJson['http://ariadne.id/description'] const profileDescription = payloadJson['http://ariadne.id/description']
/** @type {string} */ /** @type {string} */
const profileThemeColor = payloadJson['http://ariadne.id/color'] const profileThemeColor = payloadJson['http://ariadne.id/color']
/** @type {string[]} */ /** @type {Array<string>} */
const profileClaims = payloadJson['http://ariadne.id/claims'] const profileClaims = payloadJson['http://ariadne.id/claims']
const profileClaimsParsed = profileClaims.map(x => new Claim(x, uri)) const profileClaimsParsed = profileClaims.map(x => new Claim(x, uri))

View file

@ -70,15 +70,16 @@ export class Claim {
*/ */
this._status = ClaimStatus.INIT this._status = ClaimStatus.INIT
/** /**
* @type {ServiceProvider[]} * @type {Array<ServiceProvider>}
*/ */
this._matches = [] this._matches = []
} }
/** /**
* @function * @function
* @param {object} claimObject - JSON representation of a claim * @param {*} claimObject - JSON representation of a claim
* @returns {Claim | Error} Parsed claim * @returns {Claim} Parsed claim
* @throws Will throw an error if the JSON object can't be coerced into a Claim
* @example * @example
* doip.Claim.fromJSON(JSON.stringify(claim)); * doip.Claim.fromJSON(JSON.stringify(claim));
*/ */
@ -214,7 +215,6 @@ export class Claim {
* checked for the fingerprint. The verification stops when either a positive * checked for the fingerprint. The verification stops when either a positive
* result was obtained, or an unambiguous claim definition was processed * result was obtained, or an unambiguous claim definition was processed
* regardless of the result. * regardless of the result.
* @async
* @function * @function
* @param {import('./types').VerificationConfig} [opts] - Options for proxy, fetchers * @param {import('./types').VerificationConfig} [opts] - Options for proxy, fetchers
*/ */
@ -244,7 +244,7 @@ export class Claim {
let claimData = this._matches[index] let claimData = this._matches[index]
/** @type {import('./types').VerificationResult} */ /** @type {import('./types').VerificationResult | null} */
let verificationResult = null let verificationResult = null
let proofData = null let proofData = null
let proofFetchError let proofFetchError

View file

@ -22,7 +22,6 @@ import { ProxyPolicy } from './enums.js'
/** /**
* The default claim verification config used throughout the library * The default claim verification config used throughout the library
* @constant
* @type {import('./types').VerificationConfig} * @type {import('./types').VerificationConfig}
*/ */
export const opts = { export const opts = {

View file

@ -38,7 +38,6 @@ export const timeout = 5000
/** /**
* Execute a fetch request * Execute a fetch request
* @function * @function
* @async
* @param {object} data - Data used in the request * @param {object} data - Data used in the request
* @param {string} data.url - The URL of the account to verify * @param {string} data.url - The URL of the account to verify
* @param {number} [data.fetcherTimeout] - Optional timeout for the fetcher * @param {number} [data.fetcherTimeout] - Optional timeout for the fetcher

View file

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Fetch proofs from {@link module:profile~Profile} obtained through ASPE * Fetch proofs from Profile obtained through ASPE
* @module fetcher/aspe * @module fetcher/aspe
* @example * @example
* import { fetcher } from 'doipjs'; * import { fetcher } from 'doipjs';
@ -38,7 +38,6 @@ const reURI = /^aspe:([a-zA-Z0-9.\-_]*):([a-zA-Z0-9]*)/
/** /**
* Execute a fetch request * Execute a fetch request
* @function * @function
* @async
* @param {object} data - Data used in the request * @param {object} data - Data used in the request
* @param {string} data.aspeUri - ASPE URI of the targeted profile * @param {string} data.aspeUri - ASPE URI of the targeted profile
* @param {number} [data.fetcherTimeout] - Optional timeout for the fetcher * @param {number} [data.fetcherTimeout] - Optional timeout for the fetcher

View file

@ -35,7 +35,6 @@ export const timeout = 5000
/** /**
* Execute a fetch request * Execute a fetch request
* @function * @function
* @async
* @param {object} data - Data used in the request * @param {object} data - Data used in the request
* @param {string} data.domain - The targeted domain * @param {string} data.domain - The targeted domain
* @param {number} [data.fetcherTimeout] - Optional timeout for the fetcher * @param {number} [data.fetcherTimeout] - Optional timeout for the fetcher

View file

@ -35,7 +35,6 @@ export const timeout = 5000
/** /**
* Execute a GraphQL query via HTTP request * Execute a GraphQL query via HTTP request
* @function * @function
* @async
* @param {object} data - Data used in the request * @param {object} data - Data used in the request
* @param {string} data.url - The URL pointing at the GraphQL HTTP endpoint * @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 * @param {string} data.query - The GraphQL query to fetch the data containing the proof

View file

@ -36,7 +36,6 @@ export const timeout = 5000
/** /**
* Execute a fetch request * Execute a fetch request
* @function * @function
* @async
* @param {object} data - Data used in the request * @param {object} data - Data used in the request
* @param {string} data.url - The URL pointing at targeted content * @param {string} data.url - The URL pointing at targeted content
* @param {string} data.format - The format of the targeted content * @param {string} data.format - The format of the targeted content

View file

@ -35,13 +35,12 @@ export const timeout = 20000
/** /**
* Execute a fetch request * Execute a fetch request
* @function * @function
* @async
* @param {object} data - Data used in the request * @param {object} data - Data used in the request
* @param {string} data.nick - The nick of the targeted account * @param {string} data.nick - The nick of the targeted account
* @param {string} data.domain - The domain on which the targeted account is registered * @param {string} data.domain - The domain on which the targeted account is registered
* @param {number} [data.fetcherTimeout] - Optional timeout for the fetcher * @param {number} [data.fetcherTimeout] - Optional timeout for the fetcher
* @param {import('../types').VerificationConfig} [opts] - Options used to enable the request * @param {import('../types').VerificationConfig} [opts] - Options used to enable the request
* @returns {Promise<string[]>} The fetched proofs from an IRC account * @returns {Promise<Array<string>>} The fetched proofs from an IRC account
*/ */
export async function fn (data, opts) { export async function fn (data, opts) {
let timeoutHandle let timeoutHandle

View file

@ -37,7 +37,6 @@ export const timeout = 5000
/** /**
* Execute a fetch request * Execute a fetch request
* @function * @function
* @async
* @param {object} data - Data used in the request * @param {object} data - Data used in the request
* @param {string} data.eventId - The identifier of the targeted post * @param {string} data.eventId - The identifier of the targeted post
* @param {string} data.roomId - The identifier of the room containing the targeted post * @param {string} data.roomId - The identifier of the room containing the targeted post

View file

@ -45,7 +45,6 @@ export const timeout = 5000
/** /**
* Execute a fetch request * Execute a fetch request
* @function * @function
* @async
* @param {object} data - Data used in the request * @param {object} data - Data used in the request
* @param {string} data.url - The URL pointing at targeted content * @param {string} data.url - The URL pointing at targeted content
* @param {OpenPgpQueryProtocol} data.protocol - The protocol used to access the targeted content * @param {OpenPgpQueryProtocol} data.protocol - The protocol used to access the targeted content

View file

@ -36,7 +36,6 @@ export const timeout = 5000
/** /**
* Execute a fetch request * Execute a fetch request
* @function * @function
* @async
* @param {object} data - Data used in the request * @param {object} data - Data used in the request
* @param {string} data.chat - Telegram public group name (slug) * @param {string} data.chat - Telegram public group name (slug)
* @param {string} data.user - Telegram username * @param {string} data.user - Telegram username

View file

@ -41,17 +41,12 @@ let iqCaller = null
* Start the XMPP client * Start the XMPP client
* @ignore * @ignore
* @function * @function
* @async
* @param {import('../types').XmppClaimVerificationConfig} params - XMPP claim verification config * @param {import('../types').XmppClaimVerificationConfig} params - XMPP claim verification config
* @returns {Promise<object>} The fetched proofs from an XMPP account * @returns {Promise<object>} The fetched proofs from an XMPP account
*/ */
const xmppStart = async (params) => { const xmppStart = async (params) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const xmpp = client({ const xmpp = client({ ...params })
service: params.service,
username: params.username,
password: params.password
})
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
debug(xmpp, true) debug(xmpp, true)
} }
@ -69,7 +64,6 @@ const xmppStart = async (params) => {
/** /**
* Execute a fetch request * Execute a fetch request
* @function * @function
* @async
* @param {object} data - Data used in the request * @param {object} data - Data used in the request
* @param {string} data.id - The identifier of the targeted account * @param {string} data.id - The identifier of the targeted account
* @param {number} [data.fetcherTimeout] - Optional timeout for the fetcher * @param {number} [data.fetcherTimeout] - Optional timeout for the fetcher

View file

@ -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 See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/**
* @module doipjs
* @license Apache-2.0
*/
export { Profile } from './profile.js' export { Profile } from './profile.js'
export { Persona } from './persona.js' export { Persona } from './persona.js'
export { Claim } from './claim.js' export { Claim } from './claim.js'

View file

@ -18,7 +18,6 @@ import { Claim } from './claim.js'
/** /**
* @class * @class
* @classdesc A persona with identity claims * @classdesc A persona with identity claims
* @public
* @example * @example
* const claim = Claim('https://alice.tld', '123'); * const claim = Claim('https://alice.tld', '123');
* const pers = Persona('Alice', 'About Alice', [claim]); * const pers = Persona('Alice', 'About Alice', [claim]);
@ -26,7 +25,7 @@ import { Claim } from './claim.js'
export class Persona { export class Persona {
/** /**
* @param {string} name - Name of the persona * @param {string} name - Name of the persona
* @param {Claim[]} claims - Claims of the persona * @param {Array<Claim>} claims - Claims of the persona
*/ */
constructor (name, claims) { constructor (name, claims) {
/** /**
@ -67,7 +66,7 @@ export class Persona {
this.themeColor = null this.themeColor = null
/** /**
* List of identity claims * List of identity claims
* @type {Claim[]} * @type {Array<Claim>}
* @public * @public
*/ */
this.claims = claims this.claims = claims

View file

@ -20,7 +20,6 @@ import { Persona } from './persona.js'
* @class * @class
* @classdesc A profile of personas with identity claims * @classdesc A profile of personas with identity claims
* @param {Array<Persona>} personas - Personas of the profile * @param {Array<Persona>} personas - Personas of the profile
* @public
* @example * @example
* const claim = Claim('https://alice.tld', '123'); * const claim = Claim('https://alice.tld', '123');
* const pers = Persona('Alice', 'About Alice', [claim]); * const pers = Persona('Alice', 'About Alice', [claim]);
@ -80,7 +79,7 @@ export class Profile {
} }
/** /**
* List of verifier URLs * List of verifier URLs
* @type {import('./types').ProfileVerifier[]} * @type {Array<import('./types').ProfileVerifier>}
* @public * @public
*/ */
this.verifiers = [] this.verifiers = []

View file

@ -29,7 +29,6 @@ import { ServiceProvider } from './serviceProvider.js'
* the `data` parameter and the proxy policy set in the `opts` parameter to * 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 * choose the right approach to fetch the proof. An error will be thrown if no
* approach is possible. * approach is possible.
* @async
* @param {ServiceProvider} data - Data from a claim definition * @param {ServiceProvider} data - Data from a claim definition
* @param {import('./types').VerificationConfig} opts - Options to enable the request * @param {import('./types').VerificationConfig} opts - Options to enable the request
* @returns {Promise<object|string>} Fetched proof data * @returns {Promise<object|string>} Fetched proof data

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* ActivityPub service provider * ActivityPub service provider ({@link https://docs.keyoxide.org/service-providers/activitypub/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/activitypub/)
* @module serviceProviders/activitypub * @module serviceProviders/activitypub
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* ASPE service provider * ASPE service provider ({@link https://docs.keyoxide.org/service-providers/aspe/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/aspe/)
* @module serviceProviders/aspe * @module serviceProviders/aspe
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Discourse service provider * Discourse service provider ({@link https://docs.keyoxide.org/service-providers/discourse/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/discourse/)
* @module serviceProviders/discourse * @module serviceProviders/discourse
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* DNS service provider * DNS service provider ({@link https://docs.keyoxide.org/service-providers/dns/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/dns/)
* @module serviceProviders/dns * @module serviceProviders/dns
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Forem service provider * Forem service provider ({@link https://docs.keyoxide.org/service-providers/forem/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/forem/)
* @module serviceProviders/forem * @module serviceProviders/forem
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Forgejo service provider * Forgejo service provider ({@link https://docs.keyoxide.org/service-providers/forgejo/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/forgejo/)
* @module serviceProviders/forgejo * @module serviceProviders/forgejo
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Gitea service provider * Gitea service provider ({@link https://docs.keyoxide.org/service-providers/gitea/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/gitea/)
* @module serviceProviders/gitea * @module serviceProviders/gitea
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Github service provider * Github service provider ({@link https://docs.keyoxide.org/service-providers/github/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/github/)
* @module serviceProviders/github * @module serviceProviders/github
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Gitlab service provider * Gitlab service provider ({@link https://docs.keyoxide.org/service-providers/gitlab/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/gitlab/)
* @module serviceProviders/gitlab * @module serviceProviders/gitlab
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Hackernews service provider * Hackernews service provider ({@link https://docs.keyoxide.org/service-providers/hackernews/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/hackernews/)
* @module serviceProviders/hackernews * @module serviceProviders/hackernews
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* IRC service provider * IRC service provider ({@link https://docs.keyoxide.org/service-providers/irc/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/irc/)
* @module serviceProviders/irc * @module serviceProviders/irc
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Keybase service provider * Keybase service provider ({@link https://docs.keyoxide.org/service-providers/keybase/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/keybase/)
* @module serviceProviders/keybase * @module serviceProviders/keybase
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Liberapay service provider * Liberapay service provider ({@link https://docs.keyoxide.org/service-providers/liberapay/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/liberapay/)
* @module serviceProviders/liberapay * @module serviceProviders/liberapay
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Lichess service provider * Lichess service provider ({@link https://docs.keyoxide.org/service-providers/lichess/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/lichess/)
* @module serviceProviders/lichess * @module serviceProviders/lichess
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Lobste.rs service provider * Lobste.rs service provider ({@link https://docs.keyoxide.org/service-providers/lobsters/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/lobsters/)
* @module serviceProviders/lobsters * @module serviceProviders/lobsters
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Matrix service provider * Matrix service provider ({@link https://docs.keyoxide.org/service-providers/matrix/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/matrix/)
* @module serviceProviders/matrix * @module serviceProviders/matrix
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* OpenCollective service provider * OpenCollective service provider ({@link https://docs.keyoxide.org/service-providers/opencollective/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/opencollective/)
* @module serviceProviders/opencollective * @module serviceProviders/opencollective
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* OpenPGP service provider * OpenPGP service provider ({@link https://docs.keyoxide.org/service-providers/openpgp/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/openpgp/)
* @module serviceProviders/openpgp * @module serviceProviders/openpgp
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* ORCiD service provider * ORCiD service provider ({@link https://docs.keyoxide.org/service-providers/orcid/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/orcid/)
* @module serviceProviders/orcid * @module serviceProviders/orcid
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Owncast service provider * Owncast service provider ({@link https://docs.keyoxide.org/service-providers/owncast/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/owncast/)
* @module serviceProviders/owncast * @module serviceProviders/owncast
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Reddit service provider * Reddit service provider ({@link https://docs.keyoxide.org/service-providers/reddit/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/reddit/)
* @module serviceProviders/reddit * @module serviceProviders/reddit
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* StackExchange service provider * StackExchange service provider ({@link https://docs.keyoxide.org/service-providers/stackexchange/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/stackexchange/)
* @module serviceProviders/stackexchange * @module serviceProviders/stackexchange
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Telegram service provider * Telegram service provider ({@link https://docs.keyoxide.org/service-providers/telegram/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/telegram/)
* @module serviceProviders/telegram * @module serviceProviders/telegram
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* Twitter service provider * Twitter service provider ({@link https://docs.keyoxide.org/service-providers/twitter/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/twitter/)
* @module serviceProviders/twitter * @module serviceProviders/twitter
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -14,9 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/** /**
* XMPP service provider * XMPP service provider ({@link https://docs.keyoxide.org/service-providers/xmpp/|Keyoxide docs})
*
* Link: [Keyoxide documentation](https://docs.keyoxide.org/service-providers/xmpp/)
* @module serviceProviders/xmpp * @module serviceProviders/xmpp
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';

View file

@ -26,7 +26,6 @@ import { Persona } from './persona.js'
/** /**
* Extract the profile from a signature and fetch the associated key * Extract the profile from a signature and fetch the associated key
* @async
* @param {string} signature - The plaintext signature to parse * @param {string} signature - The plaintext signature to parse
* @returns {Promise<Profile>} The profile obtained from the signature * @returns {Promise<Profile>} The profile obtained from the signature
*/ */

View file

@ -57,7 +57,7 @@ import { PublicKeyType, PublicKeyEncoding, PublicKeyFetchMethod, ProxyPolicy, Cl
* @typedef {object} ServiceProviderProof * @typedef {object} ServiceProviderProof
* @property {ServiceProviderProofRequest} request - Details to request the potential proof * @property {ServiceProviderProofRequest} request - Details to request the potential proof
* @property {ServiceProviderProofResponse} response - Details about the expected response * @property {ServiceProviderProofResponse} response - Details about the expected response
* @property {ProofTarget[]} target - Details about the target located in the response * @property {Array<ProofTarget>} 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} result - Whether the proof was found and the claim verified
* @property {boolean} completed - Whether the verification process completed without errors * @property {boolean} completed - Whether the verification process completed without errors
* @property {VerificationResultProof} [proof] - Details about the proof and how it was fetched * @property {VerificationResultProof} [proof] - Details about the proof and how it was fetched
* @property {any[]} errors - Errors that ocurred during the verification process * @property {Array<any>} 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 {ClaimFormat} format - How the response data is formatted
* @property {EntityEncodingFormat} encoding - How the response data is encoded * @property {EntityEncodingFormat} encoding - How the response data is encoded
* @property {ClaimRelation} relation - How the proof is related to the response data * @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<string>} path - Path to the proof inside the response data object
*/ */
export const Types = {} export const Types = {}

View file

@ -215,8 +215,8 @@ const containsProof = async (data, params) => {
/** /**
* Run a JSON object through the verification process * Run a JSON object through the verification process
* @function * @function
* @param {any} proofData - Data potentially containing the proof * @param {*} proofData - Data potentially containing the proof
* @param {string[]} checkPath - Paths to check for proof * @param {Array<string>} checkPath - Paths to check for proof
* @param {import('./types').VerificationParams} params - Verification parameters * @param {import('./types').VerificationParams} params - Verification parameters
* @returns {Promise<boolean>} Whether the proof was found in the object * @returns {Promise<boolean>} 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 * Run the verification by searching for the proof in the fetched data
* @async
* @param {object} proofData - The proof data * @param {object} proofData - The proof data
* @param {ServiceProvider} claimData - The claim data * @param {ServiceProvider} claimData - The claim data
* @param {string} fingerprint - The fingerprint * @param {string} fingerprint - The fingerprint