@inrupt/solid-client-vc / lookup/query
Module: lookup/query#
Type Aliases#
MinimalPresentation#
Ƭ MinimalPresentation: { verifiableCredential
: DatasetWithId
[] } & DatasetCore
Defined in#
src/lookup/query.ts:87
QueryByExample#
Ƭ QueryByExample: Object
Based on https://w3c-ccg.github.io/vp-request-spec/#query-by-example.
Type declaration#
Name |
Type |
---|---|
|
{ |
|
|
Defined in#
src/lookup/query.ts:47
VerifiablePresentationRequest#
Ƭ VerifiablePresentationRequest: Object
A VP request is a standard way of getting a Verifiable Presentation matching the requestor’s needs.
Note: Currently, only the QueryByExample type is implemented, but support for other query types may be added in the future.
Type declaration#
Name |
Type |
---|---|
|
|
|
|
|
Defined in#
src/lookup/query.ts:72
Functions#
query#
▸ query(queryEndpoint
, vpRequest
, options
): Promise
<MinimalPresentation
>
Send a Verifiable Presentation Request to a query endpoint in order to retrieve all Verifiable Credentials matching the query, wrapped in a single Presentation.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
URL of the query endpoint. |
|
VP Request object, compliant with https://w3c-ccg.github.io/vp-request-spec |
|
|
|
Options object, including an authenticated |
Returns#
Promise
<MinimalPresentation
>
The resulting Verifiable Presentation wrapping all the Credentials matching the query.
Example
a reason to the request is helpful when interacting with a user. The resulting Verifiable Presentation will wrap zero or more Verifiable Credentials.
const verifiablePresentation = await query(
"https://example.org/query", {
query: [{
type: "QueryByExample",
credentialQuery: [
{
reason: "Some reason",
example: {
type: ["SomeCredentialType"],
},
},
],
}]
},
{ fetch: session.fetch }
);
Defined in#
src/lookup/query.ts:123
▸ query(queryEndpoint
, vpRequest
, options?
): Promise
<ParsedVerifiablePresentation
>
Parameters#
Name |
Type |
---|---|
|
|
|
|
|
|
Returns#
Promise
<ParsedVerifiablePresentation
>
Deprecated
Use RDFJS API instead of relying on the JSON structure by setting returnLegacyJsonld
to false
Defined in#
src/lookup/query.ts:135
▸ query(queryEndpoint
, vpRequest
, options?
): Promise
<ParsedVerifiablePresentation
| MinimalPresentation
>
Parameters#
Name |
Type |
---|---|
|
|
|
|
|
|
Returns#
Promise
<ParsedVerifiablePresentation
| MinimalPresentation
>
Deprecated
Use RDFJS API instead of relying on the JSON structure by setting returnLegacyJsonld
to false
Defined in#
src/lookup/query.ts:147