did-resolver
- Version 4.1.0
- Published
- 131 kB
- No dependencies
- Apache-2.0 license
Install
npm i did-resolver
yarn add did-resolver
pnpm add did-resolver
Overview
Resolve DID documents
Index
Functions
Classes
Interfaces
Type Aliases
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 and builds a ParsedDID object
Parameter didUrl
the DID URL string to be parsed
Returns
a ParsedDID object, or null if the input is not a DID URL
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;
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
property accept
accept?: string;
interface DIDResolutionResult
interface DIDResolutionResult {}
Defines the result of a DID resolution operation.
See Also
property '@context'
'@context'?: 'https://w3id.org/did-resolution/v1' | string | string[];
property didDocument
didDocument: DIDDocument | null;
property didDocumentMetadata
didDocumentMetadata: DIDDocumentMetadata;
property didResolutionMetadata
didResolutionMetadata: DIDResolutionMetadata;
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
resolve
method.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;
property id
id: string;
property publicKeyBase58
publicKeyBase58?: string;
property publicKeyBase64
publicKeyBase64?: string;
property publicKeyHex
publicKeyHex?: string;
property publicKeyJwk
publicKeyJwk?: JsonWebKey;
property publicKeyMultibase
publicKeyMultibase?: string;
property relationshipChild
relationshipChild?: string[];
property relationshipParent
relationshipParent?: string[];
property relationshipSibling
relationshipSibling?: string[];
property threshold
threshold?: number;
property type
type: string;
Type Aliases
type DIDCache
type DIDCache = ( parsed: ParsedDID, resolve: WrappedResolver) => Promise<DIDResolutionResult>;
type DIDDocument
type DIDDocument = { '@context'?: 'https://www.w3.org/ns/did/v1' | string | string[]; id: string; alsoKnownAs?: string[]; controller?: string | string[]; verificationMethod?: VerificationMethod[]; service?: Service[]; /** * @deprecated */ publicKey?: VerificationMethod[];} & { [x in KeyCapabilitySection]?: (string | VerificationMethod)[];};
Represents a DID document.
See Also
type DIDResolver
type DIDResolver = ( did: string, parsed: ParsedDID, resolver: Resolvable, options: DIDResolutionOptions) => Promise<DIDResolutionResult>;
The DID resolution function that DID Resolver implementations must implement.
type Extensible
type Extensible = Record<string, any>;
Defines an object type that can be extended with other properties.
type KeyCapabilitySection
type KeyCapabilitySection = | 'authentication' | 'assertionMethod' | 'keyAgreement' | 'capabilityInvocation' | 'capabilityDelegation';
Represents the Verification Relationship between a DID subject and a Verification Method.
See Also
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 WrappedResolver
type WrappedResolver = () => Promise<DIDResolutionResult>;
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (18)
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[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](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 1706 ms. - Missing or incorrect documentation? Open an issue for this package.