did-resolver
- Version 6.0.0
- Published
- 74.5 kB
- No dependencies
- Apache-2.0 license
Install
npm i did-resolveryarn add did-resolverpnpm add did-resolverOverview
Resolve DID documents
Index
Variables
variable VerificationRelationship
const VerificationRelationship: { readonly authentication: 'authentication'; readonly assertionMethod: 'assertionMethod'; readonly keyAgreement: 'keyAgreement'; readonly capabilityInvocation: 'capabilityInvocation'; readonly capabilityDelegation: 'capabilityDelegation';};Represents the Verification Relationship between a DID subject and a Verification Method.
See Also
Functions
function inMemoryCache
inMemoryCache: () => DIDCache;function noCache
noCache: ( parsed: ParsedDID, resolve: WrappedResolver) => Promise<DIDResolutionResult>;function parse
parse: (didUrl: string) => ParsedDID | null;Parses a DID URL strictly according to the DID Core v1.0 specification ABNF (§3.1 DID Syntax, §3.2 DID URL Syntax). Unlike parse, this method does not accept legacy DID parameters (
;key=value) and enforces the RFC 3986 character sets for path, query, and fragment components.Parameter didUrl
the DID URL string to be parsed
Returns
a ParsedDID object, or null if the input does not conform to the spec
function wrapLegacyResolver
wrapLegacyResolver: (resolve: LegacyDIDResolver) => DIDResolver;Classes
class Resolver
class Resolver implements Resolvable {}This implementation of Resolvable bundles together multiple implementations of DIDResolver and presents a single function call to users.
constructor
constructor(registry?: ResolverRegistry, options?: ResolverOptions);method resolve
resolve: ( didUrl: string, options?: DIDResolutionOptions) => Promise<DIDResolutionResult>;Interfaces
interface ConditionWeightedThreshold
interface ConditionWeightedThreshold {}interface DIDDocumentMetadata
interface DIDDocumentMetadata extends Extensible {}Represents metadata about the DID document resulting from a Resolvable.resolve operation.
See Also
property canonicalId
canonicalId?: string;property created
created?: string;property deactivated
deactivated?: boolean;property equivalentId
equivalentId?: string | string[];property nextUpdate
nextUpdate?: string;property nextVersionId
nextVersionId?: string;property updated
updated?: string;property versionId
versionId?: string;interface DIDResolutionMetadata
interface DIDResolutionMetadata extends Extensible {}Encapsulates the resolution metadata resulting from a Resolvable.resolve operation.
See Also
property contentType
contentType?: string;property error
error?: | 'invalidDid' | 'notFound' | 'representationNotSupported' | 'unsupportedDidMethod' | (string & {});interface DIDResolutionOptions
interface DIDResolutionOptions extends Extensible {}Describes the options forwarded to the resolver when executing a Resolvable.resolve operation.
See Also
interface DIDResolutionResult
interface DIDResolutionResult {}Defines the result of a DID resolution operation.
See Also
property '@context'
'@context'?: | 'https://w3id.org/did-resolution/v1' | ContextEntry | ContextEntry[];property didDocument
didDocument: DIDDocument | null;property didDocumentMetadata
didDocumentMetadata: DIDDocumentMetadata;property didResolutionMetadata
didResolutionMetadata: DIDResolutionMetadata;interface DIDResolver
interface DIDResolver {}The DID resolution function that DID Resolver implementations must implement. Can optionally have a
.parserproperty for method-specific DID validation.
property parser
parser?: DIDParser;call signature
( did: string, parsed: ParsedDID, resolver: Resolvable, options: DIDResolutionOptions): Promise<DIDResolutionResult>;interface JsonWebKey
interface JsonWebKey extends Extensible {}Encapsulates a JSON web key type that includes only the public properties that can be used in DID documents.
The private properties are intentionally omitted to discourage the use (and accidental disclosure) of private keys in DID documents.
See Also
interface LegacyResolverRegistry
interface LegacyResolverRegistry {}index signature
[index: string]: LegacyDIDResolver;interface Params
interface Params {}URI params resulting from parsing a DID URI
index signature
[index: string]: string;interface ParsedDID
interface ParsedDID {}An object containing the results of parsing a DID URI string.
This is forwarded to implementations of particular DID resolvers when calling the
resolvemethod.See Also
interface Resolvable
interface Resolvable {}The method signature implemented by this resolver.
property resolve
resolve: ( didUrl: string, options?: DIDResolutionOptions) => Promise<DIDResolutionResult>;interface ResolverOptions
interface ResolverOptions {}property cache
cache?: DIDCache | boolean | undefined;property legacyResolvers
legacyResolvers?: LegacyResolverRegistry;interface Service
interface Service {}Represents a Service entry in a DID document.
See Also
property id
id: string;property serviceEndpoint
serviceEndpoint: ServiceEndpoint | ServiceEndpoint[];property type
type: string;index signature
[x: string]: any;interface VerificationMethod
interface VerificationMethod {}Represents the properties of a Verification Method listed in a DID document.
This data type includes public key representations that are no longer present in the spec but are still used by several DID methods / resolvers and kept for backward compatibility.
See Also
property blockchainAccountId
blockchainAccountId?: string;property conditionAnd
conditionAnd?: VerificationMethod[];property conditionDelegated
conditionDelegated?: string;property conditionOr
conditionOr?: VerificationMethod[];property conditionThreshold
conditionThreshold?: VerificationMethod[];property conditionWeightedThreshold
conditionWeightedThreshold?: ConditionWeightedThreshold[];property controller
controller: string;property ethereumAddress
ethereumAddress?: string;Deprecated
property id
id: string;property publicKeyBase58
publicKeyBase58?: string;Deprecated
property publicKeyBase64
publicKeyBase64?: string;Deprecated
property publicKeyHex
publicKeyHex?: string;Deprecated
property publicKeyJwk
publicKeyJwk?: JsonWebKey;property publicKeyMultibase
publicKeyMultibase?: string;property publicKeyPem
publicKeyPem?: string;Deprecated
property relationshipChild
relationshipChild?: string[];property relationshipParent
relationshipParent?: string[];property relationshipSibling
relationshipSibling?: string[];property threshold
threshold?: number;property type
type: string;Type Aliases
type ContextEntry
type ContextEntry = (string & {}) | Extensible;Defines a JSON-LD context entry.
type DIDCache
type DIDCache = ( parsed: ParsedDID, resolve: WrappedResolver, options?: DIDResolutionOptions) => Promise<DIDResolutionResult>;type DIDDocument
type DIDDocument = { '@context'?: 'https://www.w3.org/ns/did/v1' | ContextEntry | ContextEntry[]; id: string; alsoKnownAs?: string[]; controller?: string | string[]; verificationMethod?: VerificationMethod[]; service?: Service[]; /** * @deprecated */ publicKey?: VerificationMethod[];} & { [x in VerificationRelationship]?: (string | VerificationMethod)[];};Represents a DID document.
See Also
type DIDParser
type DIDParser = (parsed: ParsedDID) => ParsedDID | null;Optional parser function that can be attached to a DIDResolver to provide method-specific validation of the ParsedDID before resolution.
type Extensible
type Extensible = Record<string, any>;Defines an object type that can be extended with other properties.
type KeyCapabilitySection
type KeyCapabilitySection = VerificationRelationship;Backwards-compatibility alias
type LegacyDIDResolver
type LegacyDIDResolver = ( did: string, parsed: ParsedDID, resolver: Resolvable) => Promise<DIDDocument>;type ResolverRegistry
type ResolverRegistry = Record<string, DIDResolver>;type ServiceEndpoint
type ServiceEndpoint = string | Record<string, any>;Represents an endpoint of a Service entry in a DID document.
See Also
type VerificationRelationship
type VerificationRelationship = keyof typeof VerificationRelationship;type WrappedResolver
type WrappedResolver = () => Promise<DIDResolutionResult>;Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (12)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/did-resolver.
- Markdown[](https://www.jsdocs.io/package/did-resolver)
- HTML<a href="https://www.jsdocs.io/package/did-resolver"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 1123 ms. - Missing or incorrect documentation? Open an issue for this package.
