This is an Alpha release of this package, it is only intended to be used by @inrupt/solid-client-access-grants for now.

@inrupt/solid-client-vc / lookup/derive

Module: lookup/derive#

References#

default#

Renames and re-exports getVerifiableCredentialAllFromShape

Functions#

getVerifiableCredentialAllFromShape#

getVerifiableCredentialAllFromShape(holderEndpoint, vcShape, options): Promise<DatasetWithId[]>

Look up VCs from a given holder according to a subset of their claims, such as the VC type, or any property associated to the subject in the VC. The holder is expected to implement the W3C VC Holder HTTP API.

Parameters#

Name

Type

Description

holderEndpoint

string

The /derive endpoint of the holder.

vcShape

Partial<VerifiableCredentialBase>

The subset of claims you expect the matching VCs to contain.

options

Object

Optional parameter: - options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API. This can be typically used for authentication. Note that if it is omitted, and @inrupt/solid-client-authn-browser is in your dependencies, the default session is picked up. - options.includeExpiredVc: include expired VC matching the shape in the result set. - options.returnLegacyJsonld: : Include the normalized JSON-LD in the response

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>(input: string | Request | URL, init?: RequestInit) => Promise<Response>

MDN Reference

options.includeExpiredVc?

boolean

-

options.returnLegacyJsonld

false

-

Returns#

Promise<DatasetWithId[]>

A list of VCs matching the given VC shape. The list may be empty if the holder does not hold any matching VC.

Since

0.1.0

Defined in#

src/lookup/derive.ts:101

getVerifiableCredentialAllFromShape(holderEndpoint, vcShape, options?): Promise<VerifiableCredential[]>

Look up VCs from a given holder according to a subset of their claims, such as the VC type, or any property associated to the subject in the VC. The holder is expected to implement the W3C VC Holder HTTP API.

Parameters#

Name

Type

Description

holderEndpoint

string

The /derive endpoint of the holder.

vcShape

Partial<VerifiableCredentialBase>

The subset of claims you expect the matching VCs to contain.

options?

Object

Optional parameter: - options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API. This can be typically used for authentication. Note that if it is omitted, and @inrupt/solid-client-authn-browser is in your dependencies, the default session is picked up. - options.includeExpiredVc: include expired VC matching the shape in the result set. - options.returnLegacyJsonld: : Include the normalized JSON-LD in the response

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>(input: string | Request | URL, init?: RequestInit) => Promise<Response>

MDN Reference

options.includeExpiredVc?

boolean

-

options.normalize?

(vc: VerifiableCredentialBase) => VerifiableCredentialBase

-

options.returnLegacyJsonld?

true

-

Returns#

Promise<VerifiableCredential[]>

A list of VCs matching the given VC shape. The list may be empty if the holder does not hold any matching VC.

Since

0.1.0

Deprecated

Deprecated in favour of setting returnLegacyJsonld: false. This will be the default value in future versions of this library.

Defined in#

src/lookup/derive.ts:131

getVerifiableCredentialAllFromShape(holderEndpoint, vcShape, options?): Promise<DatasetWithId[]>

Look up VCs from a given holder according to a subset of their claims, such as the VC type, or any property associated to the subject in the VC. The holder is expected to implement the W3C VC Holder HTTP API.

Parameters#

Name

Type

Description

holderEndpoint

string

The /derive endpoint of the holder.

vcShape

Partial<VerifiableCredentialBase>

The subset of claims you expect the matching VCs to contain.

options?

Object

Optional parameter: - options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API. This can be typically used for authentication. Note that if it is omitted, and @inrupt/solid-client-authn-browser is in your dependencies, the default session is picked up. - options.includeExpiredVc: include expired VC matching the shape in the result set. - options.returnLegacyJsonld: : Include the normalized JSON-LD in the response

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>(input: string | Request | URL, init?: RequestInit) => Promise<Response>

MDN Reference

options.includeExpiredVc?

boolean

-

options.normalize?

(vc: VerifiableCredentialBase) => VerifiableCredentialBase

-

options.returnLegacyJsonld?

boolean

-

Returns#

Promise<DatasetWithId[]>

A list of VCs matching the given VC shape. The list may be empty if the holder does not hold any matching VC.

Since

0.1.0

Deprecated

Deprecated in favour of setting returnLegacyJsonld: false. This will be the default value in future versions of this library.

Defined in#

src/lookup/derive.ts:162