diff --git a/agent-alice.yml b/agent-alice.yml new file mode 100644 index 000000000..0e1f734e0 --- /dev/null +++ b/agent-alice.yml @@ -0,0 +1,143 @@ +server: + hostname: localhost + port: 3337 + schemaPath: /open-api.json + apiBasePath: /agent + apiDocsPath: /api-docs + defaultIdentity: + create: true + messagingServiceEndpoint: /messaging + publicProfileServiceEndpoint: /public-profile + publicName: Alice + publicPicture: https://picsum.photos/200 + ngrok: + connect: true + subdomain: alice-did + region: eu + # exposedMethods: + # - resolveDid + # - dataStoreORMGetIdentities +constants: + secretKey: 29739248cad1bd1a0fc4d9b75cd4d2990de535baf5caadfdf8d8f86664aa830c + databaseFile: ./data/alice-database.sqlite +dbConnection: + $require: typeorm?t=function#createConnection + $args: + - type: sqlite + database: + $ref: /constants/databaseFile + synchronize: true + logging: false + entities: + $require: daf-typeorm?t=object#Entities +messageHandler: + $require: daf-message-handler#MessageHandler + $args: + - messageHandlers: + - $require: daf-did-comm#DIDCommMessageHandler + - $require: daf-did-jwt#JwtMessageHandler + - $require: daf-w3c#W3cMessageHandler + - $require: daf-selective-disclosure#SdrMessageHandler +agent: + $require: daf-core#Agent + $args: + - plugins: + - $require: daf-key-manager#KeyManager + $args: + - store: + $require: daf-typeorm#KeyStore + $args: + - $ref: /dbConnection + - $require: daf-libsodium#SecretBox + $args: + - $ref: /constants/secretKey + kms: + local: + $require: daf-libsodium#KeyManagementSystem + - $require: daf-identity-manager#IdentityManager + $args: + - store: + $require: daf-typeorm#IdentityStore + $args: + - $ref: /dbConnection + defaultProvider: did:ethr:rinkeby + providers: + did:ethr: + $require: daf-ethr-did#EthrIdentityProvider + $args: + - defaultKms: local + network: mainnet + rpcUrl: https://mainnet.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c + gas: 10001 + ttl: 31104001 + did:ethr:rinkeby: + $require: daf-ethr-did#EthrIdentityProvider + $args: + - defaultKms: local + network: rinkeby + rpcUrl: https://rinkeby.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c + gas: 10001 + ttl: 31104001 + did:ethr:ropsten: + $require: daf-ethr-did#EthrIdentityProvider + $args: + - defaultKms: local + network: ropsten + rpcUrl: https://ropsten.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c + gas: 10001 + ttl: 31104001 + did:ethr:kovan: + $require: daf-ethr-did#EthrIdentityProvider + $args: + - defaultKms: local + network: kovan + rpcUrl: https://kovan.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c + gas: 10001 + ttl: 31104001 + did:ethr:goerli: + $require: daf-ethr-did#EthrIdentityProvider + $args: + - defaultKms: local + network: goerli + rpcUrl: https://goerli.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c + gas: 10001 + ttl: 31104001 + # did:elem:ropsten: + # $require: daf-elem-did#ElemIdentityProvider + # $args: + # - defaultKms: local + # network: ropsten + # apiUrl: https://element-did.com/api/v1/sidetree + did:web: + $require: daf-web-did#WebIdentityProvider + $args: + - defaultKms: local + - $require: daf-resolver#DafResolver + $args: + - networks: + - name: mainnet + rpcUrl: https://mainnet.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c + - name: rinkeby + rpcUrl: https://rinkeby.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c + - name: ropsten + rpcUrl: https://ropsten.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c + - name: kovan + rpcUrl: https://kovan.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c + - name: goerli + rpcUrl: https://goerli.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c + - name: private + rpcUrl: http://localhost:8545/ + registry: '0x05cc574b19a3c11308f761b3d7263bd8608bc532' + # - $require: daf-resolver-universal#DafUniversalResolver + # $args: + # - url: https://dev.uniresolver.io/1.0/identifiers/ + - $require: daf-typeorm#DataStore + $args: + - $ref: /dbConnection + - $require: daf-typeorm#DataStoreORM + $args: + - $ref: /dbConnection + - $ref: /messageHandler + - $require: daf-did-comm#DIDComm + - $require: daf-w3c#CredentialIssuer + - $require: daf-selective-disclosure#SelectiveDisclosure diff --git a/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.holder.md b/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.holder.md new file mode 100644 index 000000000..a8abbef9b --- /dev/null +++ b/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.holder.md @@ -0,0 +1,16 @@ + + +[Home](./index.md) > [daf-selective-disclosure](./daf-selective-disclosure.md) > [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) > [holder](./daf-selective-disclosure.icreateprofilecredentialsargs.holder.md) + +## ICreateProfileCredentialsArgs.holder property + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Holder DID + +Signature: + +```typescript +holder: string; +``` diff --git a/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.md b/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.md new file mode 100644 index 000000000..fceac8617 --- /dev/null +++ b/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.md @@ -0,0 +1,29 @@ + + +[Home](./index.md) > [daf-selective-disclosure](./daf-selective-disclosure.md) > [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) + +## ICreateProfileCredentialsArgs interface + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Profile data + +Signature: + +```typescript +export interface ICreateProfileCredentialsArgs +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [holder](./daf-selective-disclosure.icreateprofilecredentialsargs.holder.md) | string | (BETA) Holder DID | +| [name](./daf-selective-disclosure.icreateprofilecredentialsargs.name.md) | string | (BETA) Optional. Name | +| [picture](./daf-selective-disclosure.icreateprofilecredentialsargs.picture.md) | string | (BETA) Optional. Picture URL | +| [save](./daf-selective-disclosure.icreateprofilecredentialsargs.save.md) | boolean | (BETA) Save presentation | +| [send](./daf-selective-disclosure.icreateprofilecredentialsargs.send.md) | boolean | (BETA) Send presentation | +| [url](./daf-selective-disclosure.icreateprofilecredentialsargs.url.md) | string | (BETA) Optional. URL | +| [verifier](./daf-selective-disclosure.icreateprofilecredentialsargs.verifier.md) | string | (BETA) Optional. Verifier DID | + diff --git a/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.name.md b/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.name.md new file mode 100644 index 000000000..cc0ba478d --- /dev/null +++ b/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.name.md @@ -0,0 +1,16 @@ + + +[Home](./index.md) > [daf-selective-disclosure](./daf-selective-disclosure.md) > [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) > [name](./daf-selective-disclosure.icreateprofilecredentialsargs.name.md) + +## ICreateProfileCredentialsArgs.name property + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Optional. Name + +Signature: + +```typescript +name?: string; +``` diff --git a/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.picture.md b/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.picture.md new file mode 100644 index 000000000..fb75954f9 --- /dev/null +++ b/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.picture.md @@ -0,0 +1,16 @@ + + +[Home](./index.md) > [daf-selective-disclosure](./daf-selective-disclosure.md) > [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) > [picture](./daf-selective-disclosure.icreateprofilecredentialsargs.picture.md) + +## ICreateProfileCredentialsArgs.picture property + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Optional. Picture URL + +Signature: + +```typescript +picture?: string; +``` diff --git a/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.save.md b/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.save.md new file mode 100644 index 000000000..907db9aa4 --- /dev/null +++ b/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.save.md @@ -0,0 +1,16 @@ + + +[Home](./index.md) > [daf-selective-disclosure](./daf-selective-disclosure.md) > [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) > [save](./daf-selective-disclosure.icreateprofilecredentialsargs.save.md) + +## ICreateProfileCredentialsArgs.save property + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Save presentation + +Signature: + +```typescript +save: boolean; +``` diff --git a/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.send.md b/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.send.md new file mode 100644 index 000000000..b8baf56ee --- /dev/null +++ b/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.send.md @@ -0,0 +1,16 @@ + + +[Home](./index.md) > [daf-selective-disclosure](./daf-selective-disclosure.md) > [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) > [send](./daf-selective-disclosure.icreateprofilecredentialsargs.send.md) + +## ICreateProfileCredentialsArgs.send property + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Send presentation + +Signature: + +```typescript +send: boolean; +``` diff --git a/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.url.md b/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.url.md new file mode 100644 index 000000000..eff2756c6 --- /dev/null +++ b/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.url.md @@ -0,0 +1,16 @@ + + +[Home](./index.md) > [daf-selective-disclosure](./daf-selective-disclosure.md) > [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) > [url](./daf-selective-disclosure.icreateprofilecredentialsargs.url.md) + +## ICreateProfileCredentialsArgs.url property + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Optional. URL + +Signature: + +```typescript +url?: string; +``` diff --git a/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.verifier.md b/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.verifier.md new file mode 100644 index 000000000..17eafe27d --- /dev/null +++ b/docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.verifier.md @@ -0,0 +1,16 @@ + + +[Home](./index.md) > [daf-selective-disclosure](./daf-selective-disclosure.md) > [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) > [verifier](./daf-selective-disclosure.icreateprofilecredentialsargs.verifier.md) + +## ICreateProfileCredentialsArgs.verifier property + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Optional. Verifier DID + +Signature: + +```typescript +verifier?: string; +``` diff --git a/docs/api/daf-selective-disclosure.iselectivedisclosure.createprofilepresentation.md b/docs/api/daf-selective-disclosure.iselectivedisclosure.createprofilepresentation.md new file mode 100644 index 000000000..6b26c51db --- /dev/null +++ b/docs/api/daf-selective-disclosure.iselectivedisclosure.createprofilepresentation.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [daf-selective-disclosure](./daf-selective-disclosure.md) > [ISelectiveDisclosure](./daf-selective-disclosure.iselectivedisclosure.md) > [createProfilePresentation](./daf-selective-disclosure.iselectivedisclosure.createprofilepresentation.md) + +## ISelectiveDisclosure.createProfilePresentation() method + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +createProfilePresentation(args: ICreateProfileCredentialsArgs, context: IAgentContext): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| args | [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) | | +| context | [IAgentContext](./daf-core.iagentcontext.md)<[ICredentialIssuer](./daf-w3c.icredentialissuer.md) & [IIdentityManager](./daf-core.iidentitymanager.md)> | | + +Returns: + +Promise<[VerifiablePresentation](./daf-core.verifiablepresentation.md)> + diff --git a/docs/api/daf-selective-disclosure.iselectivedisclosure.md b/docs/api/daf-selective-disclosure.iselectivedisclosure.md index cc219b311..35383f409 100644 --- a/docs/api/daf-selective-disclosure.iselectivedisclosure.md +++ b/docs/api/daf-selective-disclosure.iselectivedisclosure.md @@ -24,6 +24,7 @@ See [Selective Disclosure Request](https://github.com/uport-project/specs/blob/d | Method | Description | | --- | --- | +| [createProfilePresentation(args, context)](./daf-selective-disclosure.iselectivedisclosure.createprofilepresentation.md) | (BETA) | | [createSelectiveDisclosureRequest(args, context)](./daf-selective-disclosure.iselectivedisclosure.createselectivedisclosurerequest.md) | (BETA) | | [getVerifiableCredentialsForSdr(args, context)](./daf-selective-disclosure.iselectivedisclosure.getverifiablecredentialsforsdr.md) | (BETA) | | [validatePresentationAgainstSdr(args, context)](./daf-selective-disclosure.iselectivedisclosure.validatepresentationagainstsdr.md) | (BETA) | diff --git a/docs/api/daf-selective-disclosure.md b/docs/api/daf-selective-disclosure.md index 568309614..b916aa6ee 100644 --- a/docs/api/daf-selective-disclosure.md +++ b/docs/api/daf-selective-disclosure.md @@ -17,6 +17,7 @@ Provides a [plugin](./daf-selective-disclosure.iselectivedisclosure.md) for the | Interface | Description | | --- | --- | +| [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) | (BETA) Profile data | | [ICreateSelectiveDisclosureRequestArgs](./daf-selective-disclosure.icreateselectivedisclosurerequestargs.md) | (BETA) Contains the parameters of a Selective Disclosure Request. | | [ICredentialRequestInput](./daf-selective-disclosure.icredentialrequestinput.md) | (BETA) Describes a particular credential that is being requested | | [ICredentialsForSdr](./daf-selective-disclosure.icredentialsforsdr.md) | (BETA) The credentials that make up a response of a Selective Disclosure | diff --git a/docs/api/daf-selective-disclosure.selectivedisclosure.createprofilepresentation.md b/docs/api/daf-selective-disclosure.selectivedisclosure.createprofilepresentation.md new file mode 100644 index 000000000..bd0d8224a --- /dev/null +++ b/docs/api/daf-selective-disclosure.selectivedisclosure.createprofilepresentation.md @@ -0,0 +1,28 @@ + + +[Home](./index.md) > [daf-selective-disclosure](./daf-selective-disclosure.md) > [SelectiveDisclosure](./daf-selective-disclosure.selectivedisclosure.md) > [createProfilePresentation](./daf-selective-disclosure.selectivedisclosure.createprofilepresentation.md) + +## SelectiveDisclosure.createProfilePresentation() method + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Creates profile credentials + +Signature: + +```typescript +createProfilePresentation(args: ICreateProfileCredentialsArgs, context: IAgentContext): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| args | [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) | | +| context | [IAgentContext](./daf-core.iagentcontext.md)<[ICredentialIssuer](./daf-w3c.icredentialissuer.md) & [IIdentityManager](./daf-core.iidentitymanager.md)> | | + +Returns: + +Promise<[VerifiablePresentation](./daf-core.verifiablepresentation.md)> + diff --git a/docs/api/daf-selective-disclosure.selectivedisclosure.md b/docs/api/daf-selective-disclosure.selectivedisclosure.md index 064178e7b..f637b9340 100644 --- a/docs/api/daf-selective-disclosure.selectivedisclosure.md +++ b/docs/api/daf-selective-disclosure.selectivedisclosure.md @@ -29,12 +29,13 @@ export declare class SelectiveDisclosure implements IAgentPlugin | Property | Modifiers | Type | Description | | --- | --- | --- | --- | | [methods](./daf-selective-disclosure.selectivedisclosure.methods.md) | | [ISelectiveDisclosure](./daf-selective-disclosure.iselectivedisclosure.md) | (BETA) | -| [schema](./daf-selective-disclosure.selectivedisclosure.schema.md) | | { components: { schemas: { ICreateSelectiveDisclosureRequestArgs: { type: string; properties: { data: { $ref: string; }; }; required: string\[\]; description: string; }; ISelectiveDisclosureRequest: { type: string; properties: { issuer: { type: string; description: string; }; subject: { type: string; description: string; }; replyUrl: { type: string; description: string; }; tag: { type: string; }; claims: { type: string; items: { $ref: string; }; description: string; }; credentials: { type: string; items: { type: string; }; description: string; }; }; required: string\[\]; description: string; }; ICredentialRequestInput: { type: string; properties: { reason: { type: string; description: string; }; essential: { type: string; description: string; }; credentialType: { type: string; description: string; }; credentialContext: { type: string; description: string; }; claimType: { type: string; description: string; }; claimValue: { type: string; description: string; }; issuers: { type: string; items: { $ref: string; }; description: string; }; }; required: string\[\]; description: string; }; Issuer: { type: string; properties: { did: { type: string; description: string; }; url: { type: string; description: string; }; }; required: string\[\]; description: string; }; IGetVerifiableCredentialsForSdrArgs: { type: string; properties: { sdr: { type: string; properties: { subject: { type: string; description: string; }; replyUrl: { type: string; description: string; }; tag: { type: string; }; claims: { type: string; items: { $ref: string; }; description: string; }; credentials: { type: string; items: { type: string; }; description: string; }; }; required: string\[\]; description: string; }; did: { type: string; description: string; }; }; required: string\[\]; description: string; }; ICredentialsForSdr: { type: string; properties: { reason: { type: string; description: string; }; essential: { type: string; description: string; }; credentialType: { type: string; description: string; }; credentialContext: { type: string; description: string; }; claimType: { type: string; description: string; }; claimValue: { type: string; description: string; }; issuers: { type: string; items: { $ref: string; }; description: string; }; credentials: { type: string; items: { $ref: string; }; }; }; required: string\[\]; description: string; }; VerifiableCredential: { type: string; properties: { "@context": { type: string; items: { type: string; }; }; id: { type: string; }; type: { type: string; items: { type: string; }; }; issuer: { type: string; properties: { id: { type: string; }; }; required: string\[\]; }; issuanceDate: { type: string; }; expirationDate: { type: string; }; credentialSubject: { type: string; properties: { id: { type: string; }; }; }; credentialStatus: { type: string; properties: { id: { type: string; }; type: { type: string; }; }; required: string\[\]; }; proof: { type: string; properties: { type: { type: string; }; }; }; }; required: string\[\]; description: string; }; IValidatePresentationAgainstSdrArgs: { type: string; properties: { presentation: { $ref: string; }; sdr: { $ref: string; }; }; required: string\[\]; description: string; }; VerifiablePresentation: { type: string; properties: { id: { type: string; }; holder: { type: string; }; issuanceDate: { type: string; }; expirationDate: { type: string; }; "@context": { type: string; items: { type: string; }; }; type: { type: string; items: { type: string; }; }; verifier: { type: string; items: { type: string; }; }; verifiableCredential: { type: string; items: { $ref: string; }; }; proof: { type: string; properties: { type: { type: string; }; }; }; }; required: string\[\]; description: string; }; IPresentationValidationResult: { type: string; properties: { valid: { type: string; }; claims: { type: string; items: { $ref: string; }; }; }; required: string\[\]; description: string; }; }; methods: { createSelectiveDisclosureRequest: { description: string; arguments: { $ref: string; }; returnType: { type: string; }; }; getVerifiableCredentialsForSdr: { description: string; arguments: { $ref: string; }; returnType: { type: string; items: { $ref: string; }; }; }; validatePresentationAgainstSdr: { description: string; arguments: { $ref: string; }; returnType: { $ref: string; }; }; }; }; } | (BETA) | +| [schema](./daf-selective-disclosure.selectivedisclosure.schema.md) | | { components: { schemas: { ICreateProfileCredentialsArgs: { type: string; properties: { holder: { type: string; }; verifier: { type: string; }; name: { type: string; }; picture: { type: string; }; url: { type: string; }; save: { type: string; }; send: { type: string; }; }; required: string\[\]; description: string; }; VerifiablePresentation: { type: string; properties: { id: { type: string; }; holder: { type: string; }; issuanceDate: { type: string; }; expirationDate: { type: string; }; "@context": { type: string; items: { type: string; }; }; type: { type: string; items: { type: string; }; }; verifier: { type: string; items: { type: string; }; }; verifiableCredential: { type: string; items: { $ref: string; }; }; proof: { type: string; properties: { type: { type: string; }; }; }; }; required: string\[\]; description: string; }; VerifiableCredential: { type: string; properties: { "@context": { type: string; items: { type: string; }; }; id: { type: string; }; type: { type: string; items: { type: string; }; }; issuer: { type: string; properties: { id: { type: string; }; }; required: string\[\]; }; issuanceDate: { type: string; }; expirationDate: { type: string; }; credentialSubject: { type: string; properties: { id: { type: string; }; }; }; credentialStatus: { type: string; properties: { id: { type: string; }; type: { type: string; }; }; required: string\[\]; }; proof: { type: string; properties: { type: { type: string; }; }; }; }; required: string\[\]; description: string; }; ICreateSelectiveDisclosureRequestArgs: { type: string; properties: { data: { $ref: string; }; }; required: string\[\]; description: string; }; ISelectiveDisclosureRequest: { type: string; properties: { issuer: { type: string; description: string; }; subject: { type: string; description: string; }; replyUrl: { type: string; description: string; }; tag: { type: string; }; claims: { type: string; items: { $ref: string; }; description: string; }; credentials: { type: string; items: { type: string; }; description: string; }; }; required: string\[\]; description: string; }; ICredentialRequestInput: { type: string; properties: { reason: { type: string; description: string; }; essential: { type: string; description: string; }; credentialType: { type: string; description: string; }; credentialContext: { type: string; description: string; }; claimType: { type: string; description: string; }; claimValue: { type: string; description: string; }; issuers: { type: string; items: { $ref: string; }; description: string; }; }; required: string\[\]; description: string; }; Issuer: { type: string; properties: { did: { type: string; description: string; }; url: { type: string; description: string; }; }; required: string\[\]; description: string; }; IGetVerifiableCredentialsForSdrArgs: { type: string; properties: { sdr: { type: string; properties: { subject: { type: string; description: string; }; replyUrl: { type: string; description: string; }; tag: { type: string; }; claims: { type: string; items: { $ref: string; }; description: string; }; credentials: { type: string; items: { type: string; }; description: string; }; }; required: string\[\]; description: string; }; did: { type: string; description: string; }; }; required: string\[\]; description: string; }; ICredentialsForSdr: { type: string; properties: { reason: { type: string; description: string; }; essential: { type: string; description: string; }; credentialType: { type: string; description: string; }; credentialContext: { type: string; description: string; }; claimType: { type: string; description: string; }; claimValue: { type: string; description: string; }; issuers: { type: string; items: { $ref: string; }; description: string; }; credentials: { type: string; items: { $ref: string; }; }; }; required: string\[\]; description: string; }; IValidatePresentationAgainstSdrArgs: { type: string; properties: { presentation: { $ref: string; }; sdr: { $ref: string; }; }; required: string\[\]; description: string; }; IPresentationValidationResult: { type: string; properties: { valid: { type: string; }; claims: { type: string; items: { $ref: string; }; }; }; required: string\[\]; description: string; }; }; methods: { createProfilePresentation: { description: string; arguments: { $ref: string; }; returnType: { $ref: string; }; }; createSelectiveDisclosureRequest: { description: string; arguments: { $ref: string; }; returnType: { type: string; }; }; getVerifiableCredentialsForSdr: { description: string; arguments: { $ref: string; }; returnType: { type: string; items: { $ref: string; }; }; }; validatePresentationAgainstSdr: { description: string; arguments: { $ref: string; }; returnType: { $ref: string; }; }; }; }; } | (BETA) | ## Methods | Method | Modifiers | Description | | --- | --- | --- | +| [createProfilePresentation(args, context)](./daf-selective-disclosure.selectivedisclosure.createprofilepresentation.md) | | (BETA) Creates profile credentials | | [createSelectiveDisclosureRequest(args, context)](./daf-selective-disclosure.selectivedisclosure.createselectivedisclosurerequest.md) | | (BETA) Creates a Selective disclosure request, encoded as a JWT. | | [getVerifiableCredentialsForSdr(args, context)](./daf-selective-disclosure.selectivedisclosure.getverifiablecredentialsforsdr.md) | | (BETA) Gathers the required credentials necessary to fulfill a Selective Disclosure Request. It uses the [IDataStoreORM](./daf-typeorm.idatastoreorm.md) plugin to query the local database for the required credentials. | | [validatePresentationAgainstSdr(args, context)](./daf-selective-disclosure.selectivedisclosure.validatepresentationagainstsdr.md) | | (BETA) Validates a [Selective Disclosure response](https://github.com/uport-project/specs/blob/develop/flows/selectivedisclosure.md) encoded as a Presentation | diff --git a/docs/api/daf-selective-disclosure.selectivedisclosure.schema.md b/docs/api/daf-selective-disclosure.selectivedisclosure.schema.md index 083d9cb3e..d6213f020 100644 --- a/docs/api/daf-selective-disclosure.selectivedisclosure.schema.md +++ b/docs/api/daf-selective-disclosure.selectivedisclosure.schema.md @@ -13,6 +13,150 @@ readonly schema: { components: { schemas: { + ICreateProfileCredentialsArgs: { + type: string; + properties: { + holder: { + type: string; + }; + verifier: { + type: string; + }; + name: { + type: string; + }; + picture: { + type: string; + }; + url: { + type: string; + }; + save: { + type: string; + }; + send: { + type: string; + }; + }; + required: string[]; + description: string; + }; + VerifiablePresentation: { + type: string; + properties: { + id: { + type: string; + }; + holder: { + type: string; + }; + issuanceDate: { + type: string; + }; + expirationDate: { + type: string; + }; + "@context": { + type: string; + items: { + type: string; + }; + }; + type: { + type: string; + items: { + type: string; + }; + }; + verifier: { + type: string; + items: { + type: string; + }; + }; + verifiableCredential: { + type: string; + items: { + $ref: string; + }; + }; + proof: { + type: string; + properties: { + type: { + type: string; + }; + }; + }; + }; + required: string[]; + description: string; + }; + VerifiableCredential: { + type: string; + properties: { + "@context": { + type: string; + items: { + type: string; + }; + }; + id: { + type: string; + }; + type: { + type: string; + items: { + type: string; + }; + }; + issuer: { + type: string; + properties: { + id: { + type: string; + }; + }; + required: string[]; + }; + issuanceDate: { + type: string; + }; + expirationDate: { + type: string; + }; + credentialSubject: { + type: string; + properties: { + id: { + type: string; + }; + }; + }; + credentialStatus: { + type: string; + properties: { + id: { + type: string; + }; + type: { + type: string; + }; + }; + required: string[]; + }; + proof: { + type: string; + properties: { + type: { + type: string; + }; + }; + }; + }; + required: string[]; + description: string; + }; ICreateSelectiveDisclosureRequestArgs: { type: string; properties: { @@ -199,71 +343,6 @@ readonly schema: { required: string[]; description: string; }; - VerifiableCredential: { - type: string; - properties: { - "@context": { - type: string; - items: { - type: string; - }; - }; - id: { - type: string; - }; - type: { - type: string; - items: { - type: string; - }; - }; - issuer: { - type: string; - properties: { - id: { - type: string; - }; - }; - required: string[]; - }; - issuanceDate: { - type: string; - }; - expirationDate: { - type: string; - }; - credentialSubject: { - type: string; - properties: { - id: { - type: string; - }; - }; - }; - credentialStatus: { - type: string; - properties: { - id: { - type: string; - }; - type: { - type: string; - }; - }; - required: string[]; - }; - proof: { - type: string; - properties: { - type: { - type: string; - }; - }; - }; - }; - required: string[]; - description: string; - }; IValidatePresentationAgainstSdrArgs: { type: string; properties: { @@ -277,57 +356,6 @@ readonly schema: { required: string[]; description: string; }; - VerifiablePresentation: { - type: string; - properties: { - id: { - type: string; - }; - holder: { - type: string; - }; - issuanceDate: { - type: string; - }; - expirationDate: { - type: string; - }; - "@context": { - type: string; - items: { - type: string; - }; - }; - type: { - type: string; - items: { - type: string; - }; - }; - verifier: { - type: string; - items: { - type: string; - }; - }; - verifiableCredential: { - type: string; - items: { - $ref: string; - }; - }; - proof: { - type: string; - properties: { - type: { - type: string; - }; - }; - }; - }; - required: string[]; - description: string; - }; IPresentationValidationResult: { type: string; properties: { @@ -346,6 +374,15 @@ readonly schema: { }; }; methods: { + createProfilePresentation: { + description: string; + arguments: { + $ref: string; + }; + returnType: { + $ref: string; + }; + }; createSelectiveDisclosureRequest: { description: string; arguments: { diff --git a/packages/daf-selective-disclosure/api/daf-selective-disclosure.api.json b/packages/daf-selective-disclosure/api/daf-selective-disclosure.api.json index 30867dc64..059589a22 100644 --- a/packages/daf-selective-disclosure/api/daf-selective-disclosure.api.json +++ b/packages/daf-selective-disclosure/api/daf-selective-disclosure.api.json @@ -1,1556 +1,1940 @@ -{ - "metadata": { - "toolPackage": "@microsoft/api-extractor", - "toolVersion": "7.9.22", - "schemaVersion": 1003, - "oldestForwardsCompatibleVersion": 1001 - }, - "kind": "Package", - "canonicalReference": "daf-selective-disclosure!", - "docComment": "/**\n * Provides a {@link daf-selective-disclosure#ISelectiveDisclosure | plugin} for the {@link daf-core#Agent} that implements {@link daf-selective-disclosure#SelectiveDisclosure} interface. Provides a {@link daf-selective-disclosure#SdrMessageHandler | plugin} for the {@link daf-message-handler#MessageHandler} that detects Selective Disclosure Request in a message\n *\n * @packageDocumentation\n */\n", - "name": "daf-selective-disclosure", - "members": [ - { - "kind": "EntryPoint", - "canonicalReference": "daf-selective-disclosure!", - "name": "", - "members": [ - { - "kind": "Interface", - "canonicalReference": "daf-selective-disclosure!ICreateSelectiveDisclosureRequestArgs:interface", - "docComment": "/**\n * Contains the parameters of a Selective Disclosure Request.\n *\n * @remarks\n *\n * See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request} specs\n *\n * @beta\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export interface ICreateSelectiveDisclosureRequestArgs " - } - ], - "releaseTag": "Beta", - "name": "ICreateSelectiveDisclosureRequestArgs", - "members": [ - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!ICreateSelectiveDisclosureRequestArgs#data:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "data: " - }, - { - "kind": "Reference", - "text": "ISelectiveDisclosureRequest", - "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest:interface" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "data", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - } - ], - "extendsTokenRanges": [] - }, - { - "kind": "Interface", - "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput:interface", - "docComment": "/**\n * Describes a particular credential that is being requested\n *\n * @remarks\n *\n * See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request}\n *\n * @beta\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export interface ICredentialRequestInput " - } - ], - "releaseTag": "Beta", - "name": "ICredentialRequestInput", - "members": [ - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput#claimType:member", - "docComment": "/**\n * The name of the claim property that the credential should express.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "claimType: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "claimType", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput#claimValue:member", - "docComment": "/**\n * The value of the claim that the credential should express.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "claimValue?: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "claimValue", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput#credentialContext:member", - "docComment": "/**\n * The credential context. See {@link https://www.w3.org/TR/vc-data-model/#contexts | W3C Credential Context}\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "credentialContext?: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "credentialContext", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput#credentialType:member", - "docComment": "/**\n * The credential type. See {@link https://www.w3.org/TR/vc-data-model/#types | W3C Credential Types}\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "credentialType?: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "credentialType", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput#essential:member", - "docComment": "/**\n * If it is essential. A response that does not include this credential is not sufficient.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "essential?: " - }, - { - "kind": "Content", - "text": "boolean" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "essential", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput#issuers:member", - "docComment": "/**\n * A list of accepted Issuers for this credential.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "issuers?: " - }, - { - "kind": "Reference", - "text": "Issuer", - "canonicalReference": "daf-selective-disclosure!Issuer:interface" - }, - { - "kind": "Content", - "text": "[]" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "issuers", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput#reason:member", - "docComment": "/**\n * Motive for requiring this credential.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "reason?: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "reason", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - } - ], - "extendsTokenRanges": [] - }, - { - "kind": "Interface", - "canonicalReference": "daf-selective-disclosure!ICredentialsForSdr:interface", - "docComment": "/**\n * The credentials that make up a response of a Selective Disclosure\n *\n * @remarks\n *\n * See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request}\n *\n * @beta\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export interface ICredentialsForSdr extends " - }, - { - "kind": "Reference", - "text": "ICredentialRequestInput", - "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput:interface" - }, - { - "kind": "Content", - "text": " " - } - ], - "releaseTag": "Beta", - "name": "ICredentialsForSdr", - "members": [ - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!ICredentialsForSdr#credentials:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "credentials: " - }, - { - "kind": "Reference", - "text": "VerifiableCredential", - "canonicalReference": "daf-core!VerifiableCredential:interface" - }, - { - "kind": "Content", - "text": "[]" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "credentials", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - } - ], - "extendsTokenRanges": [ - { - "startIndex": 1, - "endIndex": 3 - } - ] - }, - { - "kind": "Interface", - "canonicalReference": "daf-selective-disclosure!IGetVerifiableCredentialsForSdrArgs:interface", - "docComment": "/**\n * Encapsulates the params needed to gather credentials to fulfill a Selective disclosure request.\n *\n * @remarks\n *\n * See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request} specs\n *\n * @beta\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export interface IGetVerifiableCredentialsForSdrArgs " - } - ], - "releaseTag": "Beta", - "name": "IGetVerifiableCredentialsForSdrArgs", - "members": [ - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!IGetVerifiableCredentialsForSdrArgs#did:member", - "docComment": "/**\n * The DID of the subject\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "did?: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "did", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!IGetVerifiableCredentialsForSdrArgs#sdr:member", - "docComment": "/**\n * The Selective Disclosure Request (issuer is omitted)\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "sdr: " - }, - { - "kind": "Reference", - "text": "Omit", - "canonicalReference": "!Omit:type" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "ISelectiveDisclosureRequest", - "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest:interface" - }, - { - "kind": "Content", - "text": ", 'issuer'>" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "sdr", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 5 - } - } - ], - "extendsTokenRanges": [] - }, - { - "kind": "Interface", - "canonicalReference": "daf-selective-disclosure!IPresentationValidationResult:interface", - "docComment": "/**\n * The result of a selective disclosure response validation.\n *\n * @beta\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export interface IPresentationValidationResult " - } - ], - "releaseTag": "Beta", - "name": "IPresentationValidationResult", - "members": [ - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!IPresentationValidationResult#claims:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "claims: " - }, - { - "kind": "Reference", - "text": "ICredentialsForSdr", - "canonicalReference": "daf-selective-disclosure!ICredentialsForSdr:interface" - }, - { - "kind": "Content", - "text": "[]" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "claims", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!IPresentationValidationResult#valid:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "valid: " - }, - { - "kind": "Content", - "text": "boolean" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "valid", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - } - ], - "extendsTokenRanges": [] - }, - { - "kind": "Interface", - "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosure:interface", - "docComment": "/**\n * Describes the interface of a Selective Disclosure plugin.\n *\n * @remarks\n *\n * See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request}\n *\n * @beta\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export interface ISelectiveDisclosure extends " - }, - { - "kind": "Reference", - "text": "IPluginMethodMap", - "canonicalReference": "daf-core!IPluginMethodMap:interface" - }, - { - "kind": "Content", - "text": " " - } - ], - "releaseTag": "Beta", - "name": "ISelectiveDisclosure", - "members": [ - { - "kind": "MethodSignature", - "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosure#createSelectiveDisclosureRequest:member(1)", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "createSelectiveDisclosureRequest(args: " - }, - { - "kind": "Reference", - "text": "ICreateSelectiveDisclosureRequestArgs", - "canonicalReference": "daf-selective-disclosure!ICreateSelectiveDisclosureRequestArgs:interface" - }, - { - "kind": "Content", - "text": ", context: " - }, - { - "kind": "Reference", - "text": "IAgentContext", - "canonicalReference": "daf-core!IAgentContext:interface" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "IIdentityManager", - "canonicalReference": "daf-core!IIdentityManager:interface" - }, - { - "kind": "Content", - "text": " & " - }, - { - "kind": "Reference", - "text": "IKeyManager", - "canonicalReference": "daf-core!IKeyManager:interface" - }, - { - "kind": "Content", - "text": ">" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Promise", - "canonicalReference": "!Promise:interface" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "returnTypeTokenRange": { - "startIndex": 10, - "endIndex": 12 - }, - "releaseTag": "Beta", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "args", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "parameterName": "context", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 9 - } - } - ], - "name": "createSelectiveDisclosureRequest" - }, - { - "kind": "MethodSignature", - "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosure#getVerifiableCredentialsForSdr:member(1)", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "getVerifiableCredentialsForSdr(args: " - }, - { - "kind": "Reference", - "text": "IGetVerifiableCredentialsForSdrArgs", - "canonicalReference": "daf-selective-disclosure!IGetVerifiableCredentialsForSdrArgs:interface" - }, - { - "kind": "Content", - "text": ", context: " - }, - { - "kind": "Reference", - "text": "IAgentContext", - "canonicalReference": "daf-core!IAgentContext:interface" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "IDataStoreORM", - "canonicalReference": "daf-typeorm!IDataStoreORM:interface" - }, - { - "kind": "Content", - "text": ">" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Promise", - "canonicalReference": "!Promise:interface" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "Array", - "canonicalReference": "!Array:interface" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "ICredentialsForSdr", - "canonicalReference": "daf-selective-disclosure!ICredentialsForSdr:interface" - }, - { - "kind": "Content", - "text": ">>" - }, - { - "kind": "Content", - "text": ";" - } - ], - "returnTypeTokenRange": { - "startIndex": 8, - "endIndex": 14 - }, - "releaseTag": "Beta", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "args", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "parameterName": "context", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 7 - } - } - ], - "name": "getVerifiableCredentialsForSdr" - }, - { - "kind": "MethodSignature", - "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosure#validatePresentationAgainstSdr:member(1)", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "validatePresentationAgainstSdr(args: " - }, - { - "kind": "Reference", - "text": "IValidatePresentationAgainstSdrArgs", - "canonicalReference": "daf-selective-disclosure!IValidatePresentationAgainstSdrArgs:interface" - }, - { - "kind": "Content", - "text": ", context: " - }, - { - "kind": "Reference", - "text": "IAgentContext", - "canonicalReference": "daf-core!IAgentContext:interface" - }, - { - "kind": "Content", - "text": "<{}>" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Promise", - "canonicalReference": "!Promise:interface" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "IPresentationValidationResult", - "canonicalReference": "daf-selective-disclosure!IPresentationValidationResult:interface" - }, - { - "kind": "Content", - "text": ">" - }, - { - "kind": "Content", - "text": ";" - } - ], - "returnTypeTokenRange": { - "startIndex": 6, - "endIndex": 10 - }, - "releaseTag": "Beta", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "args", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "parameterName": "context", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 5 - } - } - ], - "name": "validatePresentationAgainstSdr" - } - ], - "extendsTokenRanges": [ - { - "startIndex": 1, - "endIndex": 3 - } - ] - }, - { - "kind": "Interface", - "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest:interface", - "docComment": "/**\n * Represents the Selective Disclosure request parameters.\n *\n * @remarks\n *\n * See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request}\n *\n * @beta\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export interface ISelectiveDisclosureRequest " - } - ], - "releaseTag": "Beta", - "name": "ISelectiveDisclosureRequest", - "members": [ - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest#claims:member", - "docComment": "/**\n * A list of claims that are being requested\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "claims: " - }, - { - "kind": "Reference", - "text": "ICredentialRequestInput", - "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput:interface" - }, - { - "kind": "Content", - "text": "[]" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "claims", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 3 - } - }, - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest#credentials:member", - "docComment": "/**\n * A list of issuer credentials that the target will use to establish trust\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "credentials?: " - }, - { - "kind": "Content", - "text": "string[]" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "credentials", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest#issuer:member", - "docComment": "/**\n * The issuer of the request\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "issuer: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "issuer", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest#replyUrl:member", - "docComment": "/**\n * The URL where the response should be sent back\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "replyUrl?: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "replyUrl", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest#subject:member", - "docComment": "/**\n * The target of the request\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "subject?: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "subject", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest#tag:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "tag?: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "tag", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - } - ], - "extendsTokenRanges": [] - }, - { - "kind": "Interface", - "canonicalReference": "daf-selective-disclosure!Issuer:interface", - "docComment": "/**\n * Used for requesting Credentials using Selective Disclosure. Represents an accepted issuer of a credential.\n *\n * @beta\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export interface Issuer " - } - ], - "releaseTag": "Beta", - "name": "Issuer", - "members": [ - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!Issuer#did:member", - "docComment": "/**\n * The DID of the issuer of a requested credential.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "did: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "did", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!Issuer#url:member", - "docComment": "/**\n * A URL where a credential of that type can be obtained.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "url: " - }, - { - "kind": "Content", - "text": "string" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "url", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - } - ], - "extendsTokenRanges": [] - }, - { - "kind": "Interface", - "canonicalReference": "daf-selective-disclosure!IValidatePresentationAgainstSdrArgs:interface", - "docComment": "/**\n * A tuple used to verify a Selective Disclosure Response. Encapsulates the response(`presentation`) and the corresponding request (`sdr`) that made it.\n *\n * @beta\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export interface IValidatePresentationAgainstSdrArgs " - } - ], - "releaseTag": "Beta", - "name": "IValidatePresentationAgainstSdrArgs", - "members": [ - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!IValidatePresentationAgainstSdrArgs#presentation:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "presentation: " - }, - { - "kind": "Reference", - "text": "VerifiablePresentation", - "canonicalReference": "daf-core!VerifiablePresentation:interface" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "presentation", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "kind": "PropertySignature", - "canonicalReference": "daf-selective-disclosure!IValidatePresentationAgainstSdrArgs#sdr:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "sdr: " - }, - { - "kind": "Reference", - "text": "ISelectiveDisclosureRequest", - "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest:interface" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "sdr", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - } - ], - "extendsTokenRanges": [] - }, - { - "kind": "Variable", - "canonicalReference": "daf-selective-disclosure!MessageTypes:var", - "docComment": "/**\n * Identifies a {@link daf-core#IMessage} that represents a Selective Disclosure Request\n *\n * @remarks\n *\n * See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request}\n *\n * @beta\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "MessageTypes: " - }, - { - "kind": "Content", - "text": "{\n sdr: string;\n}" - } - ], - "releaseTag": "Beta", - "name": "MessageTypes", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "kind": "Class", - "canonicalReference": "daf-selective-disclosure!SdrMessageHandler:class", - "docComment": "/**\n * A DAF message handler plugin that can decode an incoming Selective Disclosure Response into the internal Message representation.\n *\n * @beta\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare class SdrMessageHandler extends " - }, - { - "kind": "Reference", - "text": "AbstractMessageHandler", - "canonicalReference": "daf-message-handler!AbstractMessageHandler:class" - }, - { - "kind": "Content", - "text": " " - } - ], - "releaseTag": "Beta", - "name": "SdrMessageHandler", - "members": [ - { - "kind": "Method", - "canonicalReference": "daf-selective-disclosure!SdrMessageHandler#handle:member(1)", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "handle(message: " - }, - { - "kind": "Reference", - "text": "Message", - "canonicalReference": "daf-message-handler!Message:class" - }, - { - "kind": "Content", - "text": ", context: " - }, - { - "kind": "Reference", - "text": "IAgentContext", - "canonicalReference": "daf-core!IAgentContext:interface" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "IMessageHandler", - "canonicalReference": "daf-core!IMessageHandler:interface" - }, - { - "kind": "Content", - "text": ">" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Promise", - "canonicalReference": "!Promise:interface" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "Message", - "canonicalReference": "daf-message-handler!Message:class" - }, - { - "kind": "Content", - "text": ">" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 8, - "endIndex": 12 - }, - "releaseTag": "Beta", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "message", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "parameterName": "context", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 7 - } - } - ], - "name": "handle" - } - ], - "extendsTokenRange": { - "startIndex": 1, - "endIndex": 3 - }, - "implementsTokenRanges": [] - }, - { - "kind": "Class", - "canonicalReference": "daf-selective-disclosure!SelectiveDisclosure:class", - "docComment": "/**\n * This class adds support for creating {@link https://github.com/uport-project/specs/blob/develop/flows/selectivedisclosure.md | Selective Disclosure} requests and interpret the responses received.\n *\n * This implementation of the uPort protocol uses {@link https://www.w3.org/TR/vc-data-model/#presentations | W3C Presentation} as the response encoding instead of a `shareReq`.\n *\n * @beta\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export declare class SelectiveDisclosure implements " - }, - { - "kind": "Reference", - "text": "IAgentPlugin", - "canonicalReference": "daf-core!IAgentPlugin:interface" - }, - { - "kind": "Content", - "text": " " - } - ], - "releaseTag": "Beta", - "name": "SelectiveDisclosure", - "members": [ - { - "kind": "Constructor", - "canonicalReference": "daf-selective-disclosure!SelectiveDisclosure:constructor(1)", - "docComment": "/**\n * Constructs a new instance of the `SelectiveDisclosure` class\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "constructor();" - } - ], - "releaseTag": "Beta", - "overloadIndex": 1, - "parameters": [] - }, - { - "kind": "Method", - "canonicalReference": "daf-selective-disclosure!SelectiveDisclosure#createSelectiveDisclosureRequest:member(1)", - "docComment": "/**\n * Creates a Selective disclosure request, encoded as a JWT.\n *\n * @remarks\n *\n * See {@link https://github.com/uport-project/specs/blob/develop/flows/selectivedisclosure.md | Selective Disclosure}\n *\n * @param args - The param object with the properties necessary to create the request. See {@link ISelectiveDisclosureRequest}\n *\n * @param context - *RESERVED* This is filled by the framework when the method is called.\n *\n * @beta\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "createSelectiveDisclosureRequest(args: " - }, - { - "kind": "Reference", - "text": "ICreateSelectiveDisclosureRequestArgs", - "canonicalReference": "daf-selective-disclosure!ICreateSelectiveDisclosureRequestArgs:interface" - }, - { - "kind": "Content", - "text": ", context: " - }, - { - "kind": "Reference", - "text": "IAgentContext", - "canonicalReference": "daf-core!IAgentContext:interface" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "IIdentityManager", - "canonicalReference": "daf-core!IIdentityManager:interface" - }, - { - "kind": "Content", - "text": " & " - }, - { - "kind": "Reference", - "text": "IKeyManager", - "canonicalReference": "daf-core!IKeyManager:interface" - }, - { - "kind": "Content", - "text": ">" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Promise", - "canonicalReference": "!Promise:interface" - }, - { - "kind": "Content", - "text": "" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 10, - "endIndex": 12 - }, - "releaseTag": "Beta", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "args", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "parameterName": "context", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 9 - } - } - ], - "name": "createSelectiveDisclosureRequest" - }, - { - "kind": "Method", - "canonicalReference": "daf-selective-disclosure!SelectiveDisclosure#getVerifiableCredentialsForSdr:member(1)", - "docComment": "/**\n * Gathers the required credentials necessary to fulfill a Selective Disclosure Request. It uses the {@link daf-typeorm#IDataStoreORM} plugin to query the local database for the required credentials.\n *\n * @param args - Contains the Request to be fulfilled and the DID of the subject\n *\n * @param context - *RESERVED* This is filled by the framework when the method is called.\n *\n * @beta\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "getVerifiableCredentialsForSdr(args: " - }, - { - "kind": "Reference", - "text": "IGetVerifiableCredentialsForSdrArgs", - "canonicalReference": "daf-selective-disclosure!IGetVerifiableCredentialsForSdrArgs:interface" - }, - { - "kind": "Content", - "text": ", context: " - }, - { - "kind": "Reference", - "text": "IAgentContext", - "canonicalReference": "daf-core!IAgentContext:interface" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "IDataStoreORM", - "canonicalReference": "daf-typeorm!IDataStoreORM:interface" - }, - { - "kind": "Content", - "text": ">" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Promise", - "canonicalReference": "!Promise:interface" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "ICredentialsForSdr", - "canonicalReference": "daf-selective-disclosure!ICredentialsForSdr:interface" - }, - { - "kind": "Content", - "text": "[]>" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 8, - "endIndex": 12 - }, - "releaseTag": "Beta", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "args", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "parameterName": "context", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 7 - } - } - ], - "name": "getVerifiableCredentialsForSdr" - }, - { - "kind": "Property", - "canonicalReference": "daf-selective-disclosure!SelectiveDisclosure#methods:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "readonly methods: " - }, - { - "kind": "Reference", - "text": "ISelectiveDisclosure", - "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosure:interface" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "methods", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isStatic": false - }, - { - "kind": "Property", - "canonicalReference": "daf-selective-disclosure!SelectiveDisclosure#schema:member", - "docComment": "", - "excerptTokens": [ - { - "kind": "Content", - "text": "readonly schema: " - }, - { - "kind": "Content", - "text": "{\n components: {\n schemas: {\n ICreateSelectiveDisclosureRequestArgs: {\n type: string;\n properties: {\n data: {\n $ref: string;\n };\n };\n required: string[];\n description: string;\n };\n ISelectiveDisclosureRequest: {\n type: string;\n properties: {\n issuer: {\n type: string;\n description: string;\n };\n subject: {\n type: string;\n description: string;\n };\n replyUrl: {\n type: string;\n description: string;\n };\n tag: {\n type: string;\n };\n claims: {\n type: string;\n items: {\n $ref: string;\n };\n description: string;\n };\n credentials: {\n type: string;\n items: {\n type: string;\n };\n description: string;\n };\n };\n required: string[];\n description: string;\n };\n ICredentialRequestInput: {\n type: string;\n properties: {\n reason: {\n type: string;\n description: string;\n };\n essential: {\n type: string;\n description: string;\n };\n credentialType: {\n type: string;\n description: string;\n };\n credentialContext: {\n type: string;\n description: string;\n };\n claimType: {\n type: string;\n description: string;\n };\n claimValue: {\n type: string;\n description: string;\n };\n issuers: {\n type: string;\n items: {\n $ref: string;\n };\n description: string;\n };\n };\n required: string[];\n description: string;\n };\n Issuer: {\n type: string;\n properties: {\n did: {\n type: string;\n description: string;\n };\n url: {\n type: string;\n description: string;\n };\n };\n required: string[];\n description: string;\n };\n IGetVerifiableCredentialsForSdrArgs: {\n type: string;\n properties: {\n sdr: {\n type: string;\n properties: {\n subject: {\n type: string;\n description: string;\n };\n replyUrl: {\n type: string;\n description: string;\n };\n tag: {\n type: string;\n };\n claims: {\n type: string;\n items: {\n $ref: string;\n };\n description: string;\n };\n credentials: {\n type: string;\n items: {\n type: string;\n };\n description: string;\n };\n };\n required: string[];\n description: string;\n };\n did: {\n type: string;\n description: string;\n };\n };\n required: string[];\n description: string;\n };\n ICredentialsForSdr: {\n type: string;\n properties: {\n reason: {\n type: string;\n description: string;\n };\n essential: {\n type: string;\n description: string;\n };\n credentialType: {\n type: string;\n description: string;\n };\n credentialContext: {\n type: string;\n description: string;\n };\n claimType: {\n type: string;\n description: string;\n };\n claimValue: {\n type: string;\n description: string;\n };\n issuers: {\n type: string;\n items: {\n $ref: string;\n };\n description: string;\n };\n credentials: {\n type: string;\n items: {\n $ref: string;\n };\n };\n };\n required: string[];\n description: string;\n };\n VerifiableCredential: {\n type: string;\n properties: {\n \"@context\": {\n type: string;\n items: {\n type: string;\n };\n };\n id: {\n type: string;\n };\n type: {\n type: string;\n items: {\n type: string;\n };\n };\n issuer: {\n type: string;\n properties: {\n id: {\n type: string;\n };\n };\n required: string[];\n };\n issuanceDate: {\n type: string;\n };\n expirationDate: {\n type: string;\n };\n credentialSubject: {\n type: string;\n properties: {\n id: {\n type: string;\n };\n };\n };\n credentialStatus: {\n type: string;\n properties: {\n id: {\n type: string;\n };\n type: {\n type: string;\n };\n };\n required: string[];\n };\n proof: {\n type: string;\n properties: {\n type: {\n type: string;\n };\n };\n };\n };\n required: string[];\n description: string;\n };\n IValidatePresentationAgainstSdrArgs: {\n type: string;\n properties: {\n presentation: {\n $ref: string;\n };\n sdr: {\n $ref: string;\n };\n };\n required: string[];\n description: string;\n };\n VerifiablePresentation: {\n type: string;\n properties: {\n id: {\n type: string;\n };\n holder: {\n type: string;\n };\n issuanceDate: {\n type: string;\n };\n expirationDate: {\n type: string;\n };\n \"@context\": {\n type: string;\n items: {\n type: string;\n };\n };\n type: {\n type: string;\n items: {\n type: string;\n };\n };\n verifier: {\n type: string;\n items: {\n type: string;\n };\n };\n verifiableCredential: {\n type: string;\n items: {\n $ref: string;\n };\n };\n proof: {\n type: string;\n properties: {\n type: {\n type: string;\n };\n };\n };\n };\n required: string[];\n description: string;\n };\n IPresentationValidationResult: {\n type: string;\n properties: {\n valid: {\n type: string;\n };\n claims: {\n type: string;\n items: {\n $ref: string;\n };\n };\n };\n required: string[];\n description: string;\n };\n };\n methods: {\n createSelectiveDisclosureRequest: {\n description: string;\n arguments: {\n $ref: string;\n };\n returnType: {\n type: string;\n };\n };\n getVerifiableCredentialsForSdr: {\n description: string;\n arguments: {\n $ref: string;\n };\n returnType: {\n type: string;\n items: {\n $ref: string;\n };\n };\n };\n validatePresentationAgainstSdr: {\n description: string;\n arguments: {\n $ref: string;\n };\n returnType: {\n $ref: string;\n };\n };\n };\n };\n }" - }, - { - "kind": "Content", - "text": ";" - } - ], - "releaseTag": "Beta", - "name": "schema", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isStatic": false - }, - { - "kind": "Method", - "canonicalReference": "daf-selective-disclosure!SelectiveDisclosure#validatePresentationAgainstSdr:member(1)", - "docComment": "/**\n * Validates a {@link https://github.com/uport-project/specs/blob/develop/flows/selectivedisclosure.md | Selective Disclosure response} encoded as a `Presentation`\n *\n * @param args - Contains the request and the response `Presentation` that needs to be checked.\n *\n * @param context - *RESERVED* This is filled by the framework when the method is called.\n *\n * @beta\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "validatePresentationAgainstSdr(args: " - }, - { - "kind": "Reference", - "text": "IValidatePresentationAgainstSdrArgs", - "canonicalReference": "daf-selective-disclosure!IValidatePresentationAgainstSdrArgs:interface" - }, - { - "kind": "Content", - "text": ", context: " - }, - { - "kind": "Reference", - "text": "IAgentContext", - "canonicalReference": "daf-core!IAgentContext:interface" - }, - { - "kind": "Content", - "text": "<{}>" - }, - { - "kind": "Content", - "text": "): " - }, - { - "kind": "Reference", - "text": "Promise", - "canonicalReference": "!Promise:interface" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "IPresentationValidationResult", - "canonicalReference": "daf-selective-disclosure!IPresentationValidationResult:interface" - }, - { - "kind": "Content", - "text": ">" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isStatic": false, - "returnTypeTokenRange": { - "startIndex": 6, - "endIndex": 10 - }, - "releaseTag": "Beta", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "args", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - }, - { - "parameterName": "context", - "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 5 - } - } - ], - "name": "validatePresentationAgainstSdr" - } - ], - "implementsTokenRanges": [ - { - "startIndex": 1, - "endIndex": 3 - } - ] - } - ] - } - ] -} +{ + "metadata": { + "toolPackage": "@microsoft/api-extractor", + "toolVersion": "7.9.22", + "schemaVersion": 1003, + "oldestForwardsCompatibleVersion": 1001 + }, + "kind": "Package", + "canonicalReference": "daf-selective-disclosure!", + "docComment": "/**\n * Provides a {@link daf-selective-disclosure#ISelectiveDisclosure | plugin} for the {@link daf-core#Agent} that implements {@link daf-selective-disclosure#SelectiveDisclosure} interface. Provides a {@link daf-selective-disclosure#SdrMessageHandler | plugin} for the {@link daf-message-handler#MessageHandler} that detects Selective Disclosure Request in a message\n *\n * @packageDocumentation\n */\n", + "name": "daf-selective-disclosure", + "members": [ + { + "kind": "EntryPoint", + "canonicalReference": "daf-selective-disclosure!", + "name": "", + "members": [ + { + "kind": "Interface", + "canonicalReference": "daf-selective-disclosure!ICreateProfileCredentialsArgs:interface", + "docComment": "/**\n * Profile data\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export interface ICreateProfileCredentialsArgs " + } + ], + "releaseTag": "Beta", + "name": "ICreateProfileCredentialsArgs", + "members": [ + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ICreateProfileCredentialsArgs#holder:member", + "docComment": "/**\n * Holder DID\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "holder: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "holder", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ICreateProfileCredentialsArgs#name:member", + "docComment": "/**\n * Optional. Name\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "name?: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "name", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ICreateProfileCredentialsArgs#picture:member", + "docComment": "/**\n * Optional. Picture URL\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "picture?: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "picture", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ICreateProfileCredentialsArgs#save:member", + "docComment": "/**\n * Save presentation\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "save: " + }, + { + "kind": "Content", + "text": "boolean" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "save", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ICreateProfileCredentialsArgs#send:member", + "docComment": "/**\n * Send presentation\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "send: " + }, + { + "kind": "Content", + "text": "boolean" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "send", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ICreateProfileCredentialsArgs#url:member", + "docComment": "/**\n * Optional. URL\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "url?: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "url", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ICreateProfileCredentialsArgs#verifier:member", + "docComment": "/**\n * Optional. Verifier DID\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "verifier?: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "verifier", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + } + ], + "extendsTokenRanges": [] + }, + { + "kind": "Interface", + "canonicalReference": "daf-selective-disclosure!ICreateSelectiveDisclosureRequestArgs:interface", + "docComment": "/**\n * Contains the parameters of a Selective Disclosure Request.\n *\n * @remarks\n *\n * See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request} specs\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export interface ICreateSelectiveDisclosureRequestArgs " + } + ], + "releaseTag": "Beta", + "name": "ICreateSelectiveDisclosureRequestArgs", + "members": [ + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ICreateSelectiveDisclosureRequestArgs#data:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "data: " + }, + { + "kind": "Reference", + "text": "ISelectiveDisclosureRequest", + "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "data", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + } + ], + "extendsTokenRanges": [] + }, + { + "kind": "Interface", + "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput:interface", + "docComment": "/**\n * Describes a particular credential that is being requested\n *\n * @remarks\n *\n * See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request}\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export interface ICredentialRequestInput " + } + ], + "releaseTag": "Beta", + "name": "ICredentialRequestInput", + "members": [ + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput#claimType:member", + "docComment": "/**\n * The name of the claim property that the credential should express.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "claimType: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "claimType", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput#claimValue:member", + "docComment": "/**\n * The value of the claim that the credential should express.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "claimValue?: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "claimValue", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput#credentialContext:member", + "docComment": "/**\n * The credential context. See {@link https://www.w3.org/TR/vc-data-model/#contexts | W3C Credential Context}\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "credentialContext?: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "credentialContext", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput#credentialType:member", + "docComment": "/**\n * The credential type. See {@link https://www.w3.org/TR/vc-data-model/#types | W3C Credential Types}\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "credentialType?: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "credentialType", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput#essential:member", + "docComment": "/**\n * If it is essential. A response that does not include this credential is not sufficient.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "essential?: " + }, + { + "kind": "Content", + "text": "boolean" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "essential", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput#issuers:member", + "docComment": "/**\n * A list of accepted Issuers for this credential.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "issuers?: " + }, + { + "kind": "Reference", + "text": "Issuer", + "canonicalReference": "daf-selective-disclosure!Issuer:interface" + }, + { + "kind": "Content", + "text": "[]" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "issuers", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput#reason:member", + "docComment": "/**\n * Motive for requiring this credential.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "reason?: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "reason", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + } + ], + "extendsTokenRanges": [] + }, + { + "kind": "Interface", + "canonicalReference": "daf-selective-disclosure!ICredentialsForSdr:interface", + "docComment": "/**\n * The credentials that make up a response of a Selective Disclosure\n *\n * @remarks\n *\n * See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request}\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export interface ICredentialsForSdr extends " + }, + { + "kind": "Reference", + "text": "ICredentialRequestInput", + "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput:interface" + }, + { + "kind": "Content", + "text": " " + } + ], + "releaseTag": "Beta", + "name": "ICredentialsForSdr", + "members": [ + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ICredentialsForSdr#credentials:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "credentials: " + }, + { + "kind": "Reference", + "text": "VerifiableCredential", + "canonicalReference": "daf-core!VerifiableCredential:interface" + }, + { + "kind": "Content", + "text": "[]" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "credentials", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + } + ], + "extendsTokenRanges": [ + { + "startIndex": 1, + "endIndex": 3 + } + ] + }, + { + "kind": "Interface", + "canonicalReference": "daf-selective-disclosure!IGetVerifiableCredentialsForSdrArgs:interface", + "docComment": "/**\n * Encapsulates the params needed to gather credentials to fulfill a Selective disclosure request.\n *\n * @remarks\n *\n * See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request} specs\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export interface IGetVerifiableCredentialsForSdrArgs " + } + ], + "releaseTag": "Beta", + "name": "IGetVerifiableCredentialsForSdrArgs", + "members": [ + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!IGetVerifiableCredentialsForSdrArgs#did:member", + "docComment": "/**\n * The DID of the subject\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "did?: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "did", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!IGetVerifiableCredentialsForSdrArgs#sdr:member", + "docComment": "/**\n * The Selective Disclosure Request (issuer is omitted)\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "sdr: " + }, + { + "kind": "Reference", + "text": "Omit", + "canonicalReference": "!Omit:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "ISelectiveDisclosureRequest", + "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest:interface" + }, + { + "kind": "Content", + "text": ", 'issuer'>" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "sdr", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 5 + } + } + ], + "extendsTokenRanges": [] + }, + { + "kind": "Interface", + "canonicalReference": "daf-selective-disclosure!IPresentationValidationResult:interface", + "docComment": "/**\n * The result of a selective disclosure response validation.\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export interface IPresentationValidationResult " + } + ], + "releaseTag": "Beta", + "name": "IPresentationValidationResult", + "members": [ + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!IPresentationValidationResult#claims:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "claims: " + }, + { + "kind": "Reference", + "text": "ICredentialsForSdr", + "canonicalReference": "daf-selective-disclosure!ICredentialsForSdr:interface" + }, + { + "kind": "Content", + "text": "[]" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "claims", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!IPresentationValidationResult#valid:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "valid: " + }, + { + "kind": "Content", + "text": "boolean" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "valid", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + } + ], + "extendsTokenRanges": [] + }, + { + "kind": "Interface", + "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosure:interface", + "docComment": "/**\n * Describes the interface of a Selective Disclosure plugin.\n *\n * @remarks\n *\n * See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request}\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export interface ISelectiveDisclosure extends " + }, + { + "kind": "Reference", + "text": "IPluginMethodMap", + "canonicalReference": "daf-core!IPluginMethodMap:interface" + }, + { + "kind": "Content", + "text": " " + } + ], + "releaseTag": "Beta", + "name": "ISelectiveDisclosure", + "members": [ + { + "kind": "MethodSignature", + "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosure#createProfilePresentation:member(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "createProfilePresentation(args: " + }, + { + "kind": "Reference", + "text": "ICreateProfileCredentialsArgs", + "canonicalReference": "daf-selective-disclosure!ICreateProfileCredentialsArgs:interface" + }, + { + "kind": "Content", + "text": ", context: " + }, + { + "kind": "Reference", + "text": "IAgentContext", + "canonicalReference": "daf-core!IAgentContext:interface" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "ICredentialIssuer", + "canonicalReference": "daf-w3c!ICredentialIssuer:interface" + }, + { + "kind": "Content", + "text": " & " + }, + { + "kind": "Reference", + "text": "IIdentityManager", + "canonicalReference": "daf-core!IIdentityManager:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Promise", + "canonicalReference": "!Promise:interface" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "VerifiablePresentation", + "canonicalReference": "daf-core!VerifiablePresentation:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "returnTypeTokenRange": { + "startIndex": 10, + "endIndex": 14 + }, + "releaseTag": "Beta", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "args", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "parameterName": "context", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 9 + } + } + ], + "name": "createProfilePresentation" + }, + { + "kind": "MethodSignature", + "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosure#createSelectiveDisclosureRequest:member(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "createSelectiveDisclosureRequest(args: " + }, + { + "kind": "Reference", + "text": "ICreateSelectiveDisclosureRequestArgs", + "canonicalReference": "daf-selective-disclosure!ICreateSelectiveDisclosureRequestArgs:interface" + }, + { + "kind": "Content", + "text": ", context: " + }, + { + "kind": "Reference", + "text": "IAgentContext", + "canonicalReference": "daf-core!IAgentContext:interface" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "IIdentityManager", + "canonicalReference": "daf-core!IIdentityManager:interface" + }, + { + "kind": "Content", + "text": " & " + }, + { + "kind": "Reference", + "text": "IKeyManager", + "canonicalReference": "daf-core!IKeyManager:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Promise", + "canonicalReference": "!Promise:interface" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "returnTypeTokenRange": { + "startIndex": 10, + "endIndex": 12 + }, + "releaseTag": "Beta", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "args", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "parameterName": "context", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 9 + } + } + ], + "name": "createSelectiveDisclosureRequest" + }, + { + "kind": "MethodSignature", + "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosure#getVerifiableCredentialsForSdr:member(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "getVerifiableCredentialsForSdr(args: " + }, + { + "kind": "Reference", + "text": "IGetVerifiableCredentialsForSdrArgs", + "canonicalReference": "daf-selective-disclosure!IGetVerifiableCredentialsForSdrArgs:interface" + }, + { + "kind": "Content", + "text": ", context: " + }, + { + "kind": "Reference", + "text": "IAgentContext", + "canonicalReference": "daf-core!IAgentContext:interface" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "IDataStoreORM", + "canonicalReference": "daf-typeorm!IDataStoreORM:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Promise", + "canonicalReference": "!Promise:interface" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "Array", + "canonicalReference": "!Array:interface" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "ICredentialsForSdr", + "canonicalReference": "daf-selective-disclosure!ICredentialsForSdr:interface" + }, + { + "kind": "Content", + "text": ">>" + }, + { + "kind": "Content", + "text": ";" + } + ], + "returnTypeTokenRange": { + "startIndex": 8, + "endIndex": 14 + }, + "releaseTag": "Beta", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "args", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "parameterName": "context", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 7 + } + } + ], + "name": "getVerifiableCredentialsForSdr" + }, + { + "kind": "MethodSignature", + "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosure#validatePresentationAgainstSdr:member(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "validatePresentationAgainstSdr(args: " + }, + { + "kind": "Reference", + "text": "IValidatePresentationAgainstSdrArgs", + "canonicalReference": "daf-selective-disclosure!IValidatePresentationAgainstSdrArgs:interface" + }, + { + "kind": "Content", + "text": ", context: " + }, + { + "kind": "Reference", + "text": "IAgentContext", + "canonicalReference": "daf-core!IAgentContext:interface" + }, + { + "kind": "Content", + "text": "<{}>" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Promise", + "canonicalReference": "!Promise:interface" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "IPresentationValidationResult", + "canonicalReference": "daf-selective-disclosure!IPresentationValidationResult:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "returnTypeTokenRange": { + "startIndex": 6, + "endIndex": 10 + }, + "releaseTag": "Beta", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "args", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "parameterName": "context", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 5 + } + } + ], + "name": "validatePresentationAgainstSdr" + } + ], + "extendsTokenRanges": [ + { + "startIndex": 1, + "endIndex": 3 + } + ] + }, + { + "kind": "Interface", + "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest:interface", + "docComment": "/**\n * Represents the Selective Disclosure request parameters.\n *\n * @remarks\n *\n * See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request}\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export interface ISelectiveDisclosureRequest " + } + ], + "releaseTag": "Beta", + "name": "ISelectiveDisclosureRequest", + "members": [ + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest#claims:member", + "docComment": "/**\n * A list of claims that are being requested\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "claims: " + }, + { + "kind": "Reference", + "text": "ICredentialRequestInput", + "canonicalReference": "daf-selective-disclosure!ICredentialRequestInput:interface" + }, + { + "kind": "Content", + "text": "[]" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "claims", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest#credentials:member", + "docComment": "/**\n * A list of issuer credentials that the target will use to establish trust\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "credentials?: " + }, + { + "kind": "Content", + "text": "string[]" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "credentials", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest#issuer:member", + "docComment": "/**\n * The issuer of the request\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "issuer: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "issuer", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest#replyUrl:member", + "docComment": "/**\n * The URL where the response should be sent back\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "replyUrl?: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "replyUrl", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest#subject:member", + "docComment": "/**\n * The target of the request\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "subject?: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "subject", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest#tag:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "tag?: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "tag", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + } + ], + "extendsTokenRanges": [] + }, + { + "kind": "Interface", + "canonicalReference": "daf-selective-disclosure!Issuer:interface", + "docComment": "/**\n * Used for requesting Credentials using Selective Disclosure. Represents an accepted issuer of a credential.\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export interface Issuer " + } + ], + "releaseTag": "Beta", + "name": "Issuer", + "members": [ + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!Issuer#did:member", + "docComment": "/**\n * The DID of the issuer of a requested credential.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "did: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "did", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!Issuer#url:member", + "docComment": "/**\n * A URL where a credential of that type can be obtained.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "url: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "url", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + } + ], + "extendsTokenRanges": [] + }, + { + "kind": "Interface", + "canonicalReference": "daf-selective-disclosure!IValidatePresentationAgainstSdrArgs:interface", + "docComment": "/**\n * A tuple used to verify a Selective Disclosure Response. Encapsulates the response(`presentation`) and the corresponding request (`sdr`) that made it.\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export interface IValidatePresentationAgainstSdrArgs " + } + ], + "releaseTag": "Beta", + "name": "IValidatePresentationAgainstSdrArgs", + "members": [ + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!IValidatePresentationAgainstSdrArgs#presentation:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "presentation: " + }, + { + "kind": "Reference", + "text": "VerifiablePresentation", + "canonicalReference": "daf-core!VerifiablePresentation:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "presentation", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "daf-selective-disclosure!IValidatePresentationAgainstSdrArgs#sdr:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "sdr: " + }, + { + "kind": "Reference", + "text": "ISelectiveDisclosureRequest", + "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosureRequest:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "sdr", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + } + ], + "extendsTokenRanges": [] + }, + { + "kind": "Variable", + "canonicalReference": "daf-selective-disclosure!MessageTypes:var", + "docComment": "/**\n * Identifies a {@link daf-core#IMessage} that represents a Selective Disclosure Request\n *\n * @remarks\n *\n * See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request}\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "MessageTypes: " + }, + { + "kind": "Content", + "text": "{\n sdr: string;\n}" + } + ], + "releaseTag": "Beta", + "name": "MessageTypes", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "Class", + "canonicalReference": "daf-selective-disclosure!SdrMessageHandler:class", + "docComment": "/**\n * A DAF message handler plugin that can decode an incoming Selective Disclosure Response into the internal Message representation.\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare class SdrMessageHandler extends " + }, + { + "kind": "Reference", + "text": "AbstractMessageHandler", + "canonicalReference": "daf-message-handler!AbstractMessageHandler:class" + }, + { + "kind": "Content", + "text": " " + } + ], + "releaseTag": "Beta", + "name": "SdrMessageHandler", + "members": [ + { + "kind": "Method", + "canonicalReference": "daf-selective-disclosure!SdrMessageHandler#handle:member(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "handle(message: " + }, + { + "kind": "Reference", + "text": "Message", + "canonicalReference": "daf-message-handler!Message:class" + }, + { + "kind": "Content", + "text": ", context: " + }, + { + "kind": "Reference", + "text": "IAgentContext", + "canonicalReference": "daf-core!IAgentContext:interface" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "IMessageHandler", + "canonicalReference": "daf-core!IMessageHandler:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Promise", + "canonicalReference": "!Promise:interface" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "Message", + "canonicalReference": "daf-message-handler!Message:class" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 8, + "endIndex": 12 + }, + "releaseTag": "Beta", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "message", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "parameterName": "context", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 7 + } + } + ], + "name": "handle" + } + ], + "extendsTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "implementsTokenRanges": [] + }, + { + "kind": "Class", + "canonicalReference": "daf-selective-disclosure!SelectiveDisclosure:class", + "docComment": "/**\n * This class adds support for creating {@link https://github.com/uport-project/specs/blob/develop/flows/selectivedisclosure.md | Selective Disclosure} requests and interpret the responses received.\n *\n * This implementation of the uPort protocol uses {@link https://www.w3.org/TR/vc-data-model/#presentations | W3C Presentation} as the response encoding instead of a `shareReq`.\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare class SelectiveDisclosure implements " + }, + { + "kind": "Reference", + "text": "IAgentPlugin", + "canonicalReference": "daf-core!IAgentPlugin:interface" + }, + { + "kind": "Content", + "text": " " + } + ], + "releaseTag": "Beta", + "name": "SelectiveDisclosure", + "members": [ + { + "kind": "Constructor", + "canonicalReference": "daf-selective-disclosure!SelectiveDisclosure:constructor(1)", + "docComment": "/**\n * Constructs a new instance of the `SelectiveDisclosure` class\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "constructor();" + } + ], + "releaseTag": "Beta", + "overloadIndex": 1, + "parameters": [] + }, + { + "kind": "Method", + "canonicalReference": "daf-selective-disclosure!SelectiveDisclosure#createProfilePresentation:member(1)", + "docComment": "/**\n * Creates profile credentials\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "createProfilePresentation(args: " + }, + { + "kind": "Reference", + "text": "ICreateProfileCredentialsArgs", + "canonicalReference": "daf-selective-disclosure!ICreateProfileCredentialsArgs:interface" + }, + { + "kind": "Content", + "text": ", context: " + }, + { + "kind": "Reference", + "text": "IAgentContext", + "canonicalReference": "daf-core!IAgentContext:interface" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "ICredentialIssuer", + "canonicalReference": "daf-w3c!ICredentialIssuer:interface" + }, + { + "kind": "Content", + "text": " & " + }, + { + "kind": "Reference", + "text": "IIdentityManager", + "canonicalReference": "daf-core!IIdentityManager:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Promise", + "canonicalReference": "!Promise:interface" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "VerifiablePresentation", + "canonicalReference": "daf-core!VerifiablePresentation:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 10, + "endIndex": 14 + }, + "releaseTag": "Beta", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "args", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "parameterName": "context", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 9 + } + } + ], + "name": "createProfilePresentation" + }, + { + "kind": "Method", + "canonicalReference": "daf-selective-disclosure!SelectiveDisclosure#createSelectiveDisclosureRequest:member(1)", + "docComment": "/**\n * Creates a Selective disclosure request, encoded as a JWT.\n *\n * @remarks\n *\n * See {@link https://github.com/uport-project/specs/blob/develop/flows/selectivedisclosure.md | Selective Disclosure}\n *\n * @param args - The param object with the properties necessary to create the request. See {@link ISelectiveDisclosureRequest}\n *\n * @param context - *RESERVED* This is filled by the framework when the method is called.\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "createSelectiveDisclosureRequest(args: " + }, + { + "kind": "Reference", + "text": "ICreateSelectiveDisclosureRequestArgs", + "canonicalReference": "daf-selective-disclosure!ICreateSelectiveDisclosureRequestArgs:interface" + }, + { + "kind": "Content", + "text": ", context: " + }, + { + "kind": "Reference", + "text": "IAgentContext", + "canonicalReference": "daf-core!IAgentContext:interface" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "IIdentityManager", + "canonicalReference": "daf-core!IIdentityManager:interface" + }, + { + "kind": "Content", + "text": " & " + }, + { + "kind": "Reference", + "text": "IKeyManager", + "canonicalReference": "daf-core!IKeyManager:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Promise", + "canonicalReference": "!Promise:interface" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 10, + "endIndex": 12 + }, + "releaseTag": "Beta", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "args", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "parameterName": "context", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 9 + } + } + ], + "name": "createSelectiveDisclosureRequest" + }, + { + "kind": "Method", + "canonicalReference": "daf-selective-disclosure!SelectiveDisclosure#getVerifiableCredentialsForSdr:member(1)", + "docComment": "/**\n * Gathers the required credentials necessary to fulfill a Selective Disclosure Request. It uses the {@link daf-typeorm#IDataStoreORM} plugin to query the local database for the required credentials.\n *\n * @param args - Contains the Request to be fulfilled and the DID of the subject\n *\n * @param context - *RESERVED* This is filled by the framework when the method is called.\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "getVerifiableCredentialsForSdr(args: " + }, + { + "kind": "Reference", + "text": "IGetVerifiableCredentialsForSdrArgs", + "canonicalReference": "daf-selective-disclosure!IGetVerifiableCredentialsForSdrArgs:interface" + }, + { + "kind": "Content", + "text": ", context: " + }, + { + "kind": "Reference", + "text": "IAgentContext", + "canonicalReference": "daf-core!IAgentContext:interface" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "IDataStoreORM", + "canonicalReference": "daf-typeorm!IDataStoreORM:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Promise", + "canonicalReference": "!Promise:interface" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "ICredentialsForSdr", + "canonicalReference": "daf-selective-disclosure!ICredentialsForSdr:interface" + }, + { + "kind": "Content", + "text": "[]>" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 8, + "endIndex": 12 + }, + "releaseTag": "Beta", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "args", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "parameterName": "context", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 7 + } + } + ], + "name": "getVerifiableCredentialsForSdr" + }, + { + "kind": "Property", + "canonicalReference": "daf-selective-disclosure!SelectiveDisclosure#methods:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "readonly methods: " + }, + { + "kind": "Reference", + "text": "ISelectiveDisclosure", + "canonicalReference": "daf-selective-disclosure!ISelectiveDisclosure:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "methods", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isStatic": false + }, + { + "kind": "Property", + "canonicalReference": "daf-selective-disclosure!SelectiveDisclosure#schema:member", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "readonly schema: " + }, + { + "kind": "Content", + "text": "{\n components: {\n schemas: {\n ICreateProfileCredentialsArgs: {\n type: string;\n properties: {\n holder: {\n type: string;\n };\n verifier: {\n type: string;\n };\n name: {\n type: string;\n };\n picture: {\n type: string;\n };\n url: {\n type: string;\n };\n save: {\n type: string;\n };\n send: {\n type: string;\n };\n };\n required: string[];\n description: string;\n };\n VerifiablePresentation: {\n type: string;\n properties: {\n id: {\n type: string;\n };\n holder: {\n type: string;\n };\n issuanceDate: {\n type: string;\n };\n expirationDate: {\n type: string;\n };\n \"@context\": {\n type: string;\n items: {\n type: string;\n };\n };\n type: {\n type: string;\n items: {\n type: string;\n };\n };\n verifier: {\n type: string;\n items: {\n type: string;\n };\n };\n verifiableCredential: {\n type: string;\n items: {\n $ref: string;\n };\n };\n proof: {\n type: string;\n properties: {\n type: {\n type: string;\n };\n };\n };\n };\n required: string[];\n description: string;\n };\n VerifiableCredential: {\n type: string;\n properties: {\n \"@context\": {\n type: string;\n items: {\n type: string;\n };\n };\n id: {\n type: string;\n };\n type: {\n type: string;\n items: {\n type: string;\n };\n };\n issuer: {\n type: string;\n properties: {\n id: {\n type: string;\n };\n };\n required: string[];\n };\n issuanceDate: {\n type: string;\n };\n expirationDate: {\n type: string;\n };\n credentialSubject: {\n type: string;\n properties: {\n id: {\n type: string;\n };\n };\n };\n credentialStatus: {\n type: string;\n properties: {\n id: {\n type: string;\n };\n type: {\n type: string;\n };\n };\n required: string[];\n };\n proof: {\n type: string;\n properties: {\n type: {\n type: string;\n };\n };\n };\n };\n required: string[];\n description: string;\n };\n ICreateSelectiveDisclosureRequestArgs: {\n type: string;\n properties: {\n data: {\n $ref: string;\n };\n };\n required: string[];\n description: string;\n };\n ISelectiveDisclosureRequest: {\n type: string;\n properties: {\n issuer: {\n type: string;\n description: string;\n };\n subject: {\n type: string;\n description: string;\n };\n replyUrl: {\n type: string;\n description: string;\n };\n tag: {\n type: string;\n };\n claims: {\n type: string;\n items: {\n $ref: string;\n };\n description: string;\n };\n credentials: {\n type: string;\n items: {\n type: string;\n };\n description: string;\n };\n };\n required: string[];\n description: string;\n };\n ICredentialRequestInput: {\n type: string;\n properties: {\n reason: {\n type: string;\n description: string;\n };\n essential: {\n type: string;\n description: string;\n };\n credentialType: {\n type: string;\n description: string;\n };\n credentialContext: {\n type: string;\n description: string;\n };\n claimType: {\n type: string;\n description: string;\n };\n claimValue: {\n type: string;\n description: string;\n };\n issuers: {\n type: string;\n items: {\n $ref: string;\n };\n description: string;\n };\n };\n required: string[];\n description: string;\n };\n Issuer: {\n type: string;\n properties: {\n did: {\n type: string;\n description: string;\n };\n url: {\n type: string;\n description: string;\n };\n };\n required: string[];\n description: string;\n };\n IGetVerifiableCredentialsForSdrArgs: {\n type: string;\n properties: {\n sdr: {\n type: string;\n properties: {\n subject: {\n type: string;\n description: string;\n };\n replyUrl: {\n type: string;\n description: string;\n };\n tag: {\n type: string;\n };\n claims: {\n type: string;\n items: {\n $ref: string;\n };\n description: string;\n };\n credentials: {\n type: string;\n items: {\n type: string;\n };\n description: string;\n };\n };\n required: string[];\n description: string;\n };\n did: {\n type: string;\n description: string;\n };\n };\n required: string[];\n description: string;\n };\n ICredentialsForSdr: {\n type: string;\n properties: {\n reason: {\n type: string;\n description: string;\n };\n essential: {\n type: string;\n description: string;\n };\n credentialType: {\n type: string;\n description: string;\n };\n credentialContext: {\n type: string;\n description: string;\n };\n claimType: {\n type: string;\n description: string;\n };\n claimValue: {\n type: string;\n description: string;\n };\n issuers: {\n type: string;\n items: {\n $ref: string;\n };\n description: string;\n };\n credentials: {\n type: string;\n items: {\n $ref: string;\n };\n };\n };\n required: string[];\n description: string;\n };\n IValidatePresentationAgainstSdrArgs: {\n type: string;\n properties: {\n presentation: {\n $ref: string;\n };\n sdr: {\n $ref: string;\n };\n };\n required: string[];\n description: string;\n };\n IPresentationValidationResult: {\n type: string;\n properties: {\n valid: {\n type: string;\n };\n claims: {\n type: string;\n items: {\n $ref: string;\n };\n };\n };\n required: string[];\n description: string;\n };\n };\n methods: {\n createProfilePresentation: {\n description: string;\n arguments: {\n $ref: string;\n };\n returnType: {\n $ref: string;\n };\n };\n createSelectiveDisclosureRequest: {\n description: string;\n arguments: {\n $ref: string;\n };\n returnType: {\n type: string;\n };\n };\n getVerifiableCredentialsForSdr: {\n description: string;\n arguments: {\n $ref: string;\n };\n returnType: {\n type: string;\n items: {\n $ref: string;\n };\n };\n };\n validatePresentationAgainstSdr: {\n description: string;\n arguments: {\n $ref: string;\n };\n returnType: {\n $ref: string;\n };\n };\n };\n };\n }" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Beta", + "name": "schema", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isStatic": false + }, + { + "kind": "Method", + "canonicalReference": "daf-selective-disclosure!SelectiveDisclosure#validatePresentationAgainstSdr:member(1)", + "docComment": "/**\n * Validates a {@link https://github.com/uport-project/specs/blob/develop/flows/selectivedisclosure.md | Selective Disclosure response} encoded as a `Presentation`\n *\n * @param args - Contains the request and the response `Presentation` that needs to be checked.\n *\n * @param context - *RESERVED* This is filled by the framework when the method is called.\n *\n * @beta\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "validatePresentationAgainstSdr(args: " + }, + { + "kind": "Reference", + "text": "IValidatePresentationAgainstSdrArgs", + "canonicalReference": "daf-selective-disclosure!IValidatePresentationAgainstSdrArgs:interface" + }, + { + "kind": "Content", + "text": ", context: " + }, + { + "kind": "Reference", + "text": "IAgentContext", + "canonicalReference": "daf-core!IAgentContext:interface" + }, + { + "kind": "Content", + "text": "<{}>" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Promise", + "canonicalReference": "!Promise:interface" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "IPresentationValidationResult", + "canonicalReference": "daf-selective-disclosure!IPresentationValidationResult:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 6, + "endIndex": 10 + }, + "releaseTag": "Beta", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "args", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "parameterName": "context", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 5 + } + } + ], + "name": "validatePresentationAgainstSdr" + } + ], + "implementsTokenRanges": [ + { + "startIndex": 1, + "endIndex": 3 + } + ] + } + ] + } + ] +} diff --git a/packages/daf-selective-disclosure/api/daf-selective-disclosure.api.md b/packages/daf-selective-disclosure/api/daf-selective-disclosure.api.md index e5c028ba1..79234f355 100644 --- a/packages/daf-selective-disclosure/api/daf-selective-disclosure.api.md +++ b/packages/daf-selective-disclosure/api/daf-selective-disclosure.api.md @@ -1,483 +1,556 @@ -## API Report File for "daf-selective-disclosure" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import { AbstractMessageHandler } from 'daf-message-handler'; -import { IAgentContext } from 'daf-core'; -import { IAgentPlugin } from 'daf-core'; -import { IDataStoreORM } from 'daf-typeorm'; -import { IIdentityManager } from 'daf-core'; -import { IKeyManager } from 'daf-core'; -import { IMessageHandler } from 'daf-core'; -import { IPluginMethodMap } from 'daf-core'; -import { Message } from 'daf-message-handler'; -import { VerifiableCredential } from 'daf-core'; -import { VerifiablePresentation } from 'daf-core'; - -// @beta -export interface ICreateSelectiveDisclosureRequestArgs { - // (undocumented) - data: ISelectiveDisclosureRequest; -} - -// @beta -export interface ICredentialRequestInput { - claimType: string; - claimValue?: string; - credentialContext?: string; - credentialType?: string; - essential?: boolean; - issuers?: Issuer[]; - reason?: string; -} - -// @beta -export interface ICredentialsForSdr extends ICredentialRequestInput { - // (undocumented) - credentials: VerifiableCredential[]; -} - -// @beta -export interface IGetVerifiableCredentialsForSdrArgs { - did?: string; - sdr: Omit; -} - -// @beta -export interface IPresentationValidationResult { - // (undocumented) - claims: ICredentialsForSdr[]; - // (undocumented) - valid: boolean; -} - -// @beta -export interface ISelectiveDisclosure extends IPluginMethodMap { - // (undocumented) - createSelectiveDisclosureRequest(args: ICreateSelectiveDisclosureRequestArgs, context: IAgentContext): Promise; - // (undocumented) - getVerifiableCredentialsForSdr(args: IGetVerifiableCredentialsForSdrArgs, context: IAgentContext): Promise>; - // (undocumented) - validatePresentationAgainstSdr(args: IValidatePresentationAgainstSdrArgs, context: IAgentContext<{}>): Promise; -} - -// @beta -export interface ISelectiveDisclosureRequest { - claims: ICredentialRequestInput[]; - credentials?: string[]; - issuer: string; - replyUrl?: string; - subject?: string; - // (undocumented) - tag?: string; -} - -// @beta -export interface Issuer { - did: string; - url: string; -} - -// @beta -export interface IValidatePresentationAgainstSdrArgs { - // (undocumented) - presentation: VerifiablePresentation; - // (undocumented) - sdr: ISelectiveDisclosureRequest; -} - -// @beta -export const MessageTypes: { - sdr: string; -}; - -// @beta -export class SdrMessageHandler extends AbstractMessageHandler { - // (undocumented) - handle(message: Message, context: IAgentContext): Promise; - } - -// @beta -export class SelectiveDisclosure implements IAgentPlugin { - constructor(); - createSelectiveDisclosureRequest(args: ICreateSelectiveDisclosureRequestArgs, context: IAgentContext): Promise; - getVerifiableCredentialsForSdr(args: IGetVerifiableCredentialsForSdrArgs, context: IAgentContext): Promise; - // (undocumented) - readonly methods: ISelectiveDisclosure; - // (undocumented) - readonly schema: { - components: { - schemas: { - ICreateSelectiveDisclosureRequestArgs: { - type: string; - properties: { - data: { - $ref: string; - }; - }; - required: string[]; - description: string; - }; - ISelectiveDisclosureRequest: { - type: string; - properties: { - issuer: { - type: string; - description: string; - }; - subject: { - type: string; - description: string; - }; - replyUrl: { - type: string; - description: string; - }; - tag: { - type: string; - }; - claims: { - type: string; - items: { - $ref: string; - }; - description: string; - }; - credentials: { - type: string; - items: { - type: string; - }; - description: string; - }; - }; - required: string[]; - description: string; - }; - ICredentialRequestInput: { - type: string; - properties: { - reason: { - type: string; - description: string; - }; - essential: { - type: string; - description: string; - }; - credentialType: { - type: string; - description: string; - }; - credentialContext: { - type: string; - description: string; - }; - claimType: { - type: string; - description: string; - }; - claimValue: { - type: string; - description: string; - }; - issuers: { - type: string; - items: { - $ref: string; - }; - description: string; - }; - }; - required: string[]; - description: string; - }; - Issuer: { - type: string; - properties: { - did: { - type: string; - description: string; - }; - url: { - type: string; - description: string; - }; - }; - required: string[]; - description: string; - }; - IGetVerifiableCredentialsForSdrArgs: { - type: string; - properties: { - sdr: { - type: string; - properties: { - subject: { - type: string; - description: string; - }; - replyUrl: { - type: string; - description: string; - }; - tag: { - type: string; - }; - claims: { - type: string; - items: { - $ref: string; - }; - description: string; - }; - credentials: { - type: string; - items: { - type: string; - }; - description: string; - }; - }; - required: string[]; - description: string; - }; - did: { - type: string; - description: string; - }; - }; - required: string[]; - description: string; - }; - ICredentialsForSdr: { - type: string; - properties: { - reason: { - type: string; - description: string; - }; - essential: { - type: string; - description: string; - }; - credentialType: { - type: string; - description: string; - }; - credentialContext: { - type: string; - description: string; - }; - claimType: { - type: string; - description: string; - }; - claimValue: { - type: string; - description: string; - }; - issuers: { - type: string; - items: { - $ref: string; - }; - description: string; - }; - credentials: { - type: string; - items: { - $ref: string; - }; - }; - }; - required: string[]; - description: string; - }; - VerifiableCredential: { - type: string; - properties: { - "@context": { - type: string; - items: { - type: string; - }; - }; - id: { - type: string; - }; - type: { - type: string; - items: { - type: string; - }; - }; - issuer: { - type: string; - properties: { - id: { - type: string; - }; - }; - required: string[]; - }; - issuanceDate: { - type: string; - }; - expirationDate: { - type: string; - }; - credentialSubject: { - type: string; - properties: { - id: { - type: string; - }; - }; - }; - credentialStatus: { - type: string; - properties: { - id: { - type: string; - }; - type: { - type: string; - }; - }; - required: string[]; - }; - proof: { - type: string; - properties: { - type: { - type: string; - }; - }; - }; - }; - required: string[]; - description: string; - }; - IValidatePresentationAgainstSdrArgs: { - type: string; - properties: { - presentation: { - $ref: string; - }; - sdr: { - $ref: string; - }; - }; - required: string[]; - description: string; - }; - VerifiablePresentation: { - type: string; - properties: { - id: { - type: string; - }; - holder: { - type: string; - }; - issuanceDate: { - type: string; - }; - expirationDate: { - type: string; - }; - "@context": { - type: string; - items: { - type: string; - }; - }; - type: { - type: string; - items: { - type: string; - }; - }; - verifier: { - type: string; - items: { - type: string; - }; - }; - verifiableCredential: { - type: string; - items: { - $ref: string; - }; - }; - proof: { - type: string; - properties: { - type: { - type: string; - }; - }; - }; - }; - required: string[]; - description: string; - }; - IPresentationValidationResult: { - type: string; - properties: { - valid: { - type: string; - }; - claims: { - type: string; - items: { - $ref: string; - }; - }; - }; - required: string[]; - description: string; - }; - }; - methods: { - createSelectiveDisclosureRequest: { - description: string; - arguments: { - $ref: string; - }; - returnType: { - type: string; - }; - }; - getVerifiableCredentialsForSdr: { - description: string; - arguments: { - $ref: string; - }; - returnType: { - type: string; - items: { - $ref: string; - }; - }; - }; - validatePresentationAgainstSdr: { - description: string; - arguments: { - $ref: string; - }; - returnType: { - $ref: string; - }; - }; - }; - }; - }; - validatePresentationAgainstSdr(args: IValidatePresentationAgainstSdrArgs, context: IAgentContext<{}>): Promise; -} - - -``` +## API Report File for "daf-selective-disclosure" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { AbstractMessageHandler } from 'daf-message-handler' +import { IAgentContext } from 'daf-core' +import { IAgentPlugin } from 'daf-core' +import { ICredentialIssuer } from 'daf-w3c' +import { IDataStoreORM } from 'daf-typeorm' +import { IIdentityManager } from 'daf-core' +import { IKeyManager } from 'daf-core' +import { IMessageHandler } from 'daf-core' +import { IPluginMethodMap } from 'daf-core' +import { Message } from 'daf-message-handler' +import { VerifiableCredential } from 'daf-core' +import { VerifiablePresentation } from 'daf-core' + +// @beta +export interface ICreateProfileCredentialsArgs { + holder: string + name?: string + picture?: string + save: boolean + send: boolean + url?: string + verifier?: string +} + +// @beta +export interface ICreateSelectiveDisclosureRequestArgs { + // (undocumented) + data: ISelectiveDisclosureRequest +} + +// @beta +export interface ICredentialRequestInput { + claimType: string + claimValue?: string + credentialContext?: string + credentialType?: string + essential?: boolean + issuers?: Issuer[] + reason?: string +} + +// @beta +export interface ICredentialsForSdr extends ICredentialRequestInput { + // (undocumented) + credentials: VerifiableCredential[] +} + +// @beta +export interface IGetVerifiableCredentialsForSdrArgs { + did?: string + sdr: Omit +} + +// @beta +export interface IPresentationValidationResult { + // (undocumented) + claims: ICredentialsForSdr[] + // (undocumented) + valid: boolean +} + +// @beta +export interface ISelectiveDisclosure extends IPluginMethodMap { + // (undocumented) + createProfilePresentation( + args: ICreateProfileCredentialsArgs, + context: IAgentContext, + ): Promise + // (undocumented) + createSelectiveDisclosureRequest( + args: ICreateSelectiveDisclosureRequestArgs, + context: IAgentContext, + ): Promise + // (undocumented) + getVerifiableCredentialsForSdr( + args: IGetVerifiableCredentialsForSdrArgs, + context: IAgentContext, + ): Promise> + // (undocumented) + validatePresentationAgainstSdr( + args: IValidatePresentationAgainstSdrArgs, + context: IAgentContext<{}>, + ): Promise +} + +// @beta +export interface ISelectiveDisclosureRequest { + claims: ICredentialRequestInput[] + credentials?: string[] + issuer: string + replyUrl?: string + subject?: string + // (undocumented) + tag?: string +} + +// @beta +export interface Issuer { + did: string + url: string +} + +// @beta +export interface IValidatePresentationAgainstSdrArgs { + // (undocumented) + presentation: VerifiablePresentation + // (undocumented) + sdr: ISelectiveDisclosureRequest +} + +// @beta +export const MessageTypes: { + sdr: string +} + +// @beta +export class SdrMessageHandler extends AbstractMessageHandler { + // (undocumented) + handle(message: Message, context: IAgentContext): Promise +} + +// @beta +export class SelectiveDisclosure implements IAgentPlugin { + constructor() + createProfilePresentation( + args: ICreateProfileCredentialsArgs, + context: IAgentContext, + ): Promise + createSelectiveDisclosureRequest( + args: ICreateSelectiveDisclosureRequestArgs, + context: IAgentContext, + ): Promise + getVerifiableCredentialsForSdr( + args: IGetVerifiableCredentialsForSdrArgs, + context: IAgentContext, + ): Promise + // (undocumented) + readonly methods: ISelectiveDisclosure + // (undocumented) + readonly schema: { + components: { + schemas: { + ICreateProfileCredentialsArgs: { + type: string + properties: { + holder: { + type: string + } + verifier: { + type: string + } + name: { + type: string + } + picture: { + type: string + } + url: { + type: string + } + save: { + type: string + } + send: { + type: string + } + } + required: string[] + description: string + } + VerifiablePresentation: { + type: string + properties: { + id: { + type: string + } + holder: { + type: string + } + issuanceDate: { + type: string + } + expirationDate: { + type: string + } + '@context': { + type: string + items: { + type: string + } + } + type: { + type: string + items: { + type: string + } + } + verifier: { + type: string + items: { + type: string + } + } + verifiableCredential: { + type: string + items: { + $ref: string + } + } + proof: { + type: string + properties: { + type: { + type: string + } + } + } + } + required: string[] + description: string + } + VerifiableCredential: { + type: string + properties: { + '@context': { + type: string + items: { + type: string + } + } + id: { + type: string + } + type: { + type: string + items: { + type: string + } + } + issuer: { + type: string + properties: { + id: { + type: string + } + } + required: string[] + } + issuanceDate: { + type: string + } + expirationDate: { + type: string + } + credentialSubject: { + type: string + properties: { + id: { + type: string + } + } + } + credentialStatus: { + type: string + properties: { + id: { + type: string + } + type: { + type: string + } + } + required: string[] + } + proof: { + type: string + properties: { + type: { + type: string + } + } + } + } + required: string[] + description: string + } + ICreateSelectiveDisclosureRequestArgs: { + type: string + properties: { + data: { + $ref: string + } + } + required: string[] + description: string + } + ISelectiveDisclosureRequest: { + type: string + properties: { + issuer: { + type: string + description: string + } + subject: { + type: string + description: string + } + replyUrl: { + type: string + description: string + } + tag: { + type: string + } + claims: { + type: string + items: { + $ref: string + } + description: string + } + credentials: { + type: string + items: { + type: string + } + description: string + } + } + required: string[] + description: string + } + ICredentialRequestInput: { + type: string + properties: { + reason: { + type: string + description: string + } + essential: { + type: string + description: string + } + credentialType: { + type: string + description: string + } + credentialContext: { + type: string + description: string + } + claimType: { + type: string + description: string + } + claimValue: { + type: string + description: string + } + issuers: { + type: string + items: { + $ref: string + } + description: string + } + } + required: string[] + description: string + } + Issuer: { + type: string + properties: { + did: { + type: string + description: string + } + url: { + type: string + description: string + } + } + required: string[] + description: string + } + IGetVerifiableCredentialsForSdrArgs: { + type: string + properties: { + sdr: { + type: string + properties: { + subject: { + type: string + description: string + } + replyUrl: { + type: string + description: string + } + tag: { + type: string + } + claims: { + type: string + items: { + $ref: string + } + description: string + } + credentials: { + type: string + items: { + type: string + } + description: string + } + } + required: string[] + description: string + } + did: { + type: string + description: string + } + } + required: string[] + description: string + } + ICredentialsForSdr: { + type: string + properties: { + reason: { + type: string + description: string + } + essential: { + type: string + description: string + } + credentialType: { + type: string + description: string + } + credentialContext: { + type: string + description: string + } + claimType: { + type: string + description: string + } + claimValue: { + type: string + description: string + } + issuers: { + type: string + items: { + $ref: string + } + description: string + } + credentials: { + type: string + items: { + $ref: string + } + } + } + required: string[] + description: string + } + IValidatePresentationAgainstSdrArgs: { + type: string + properties: { + presentation: { + $ref: string + } + sdr: { + $ref: string + } + } + required: string[] + description: string + } + IPresentationValidationResult: { + type: string + properties: { + valid: { + type: string + } + claims: { + type: string + items: { + $ref: string + } + } + } + required: string[] + description: string + } + } + methods: { + createProfilePresentation: { + description: string + arguments: { + $ref: string + } + returnType: { + $ref: string + } + } + createSelectiveDisclosureRequest: { + description: string + arguments: { + $ref: string + } + returnType: { + type: string + } + } + getVerifiableCredentialsForSdr: { + description: string + arguments: { + $ref: string + } + returnType: { + type: string + items: { + $ref: string + } + } + } + validatePresentationAgainstSdr: { + description: string + arguments: { + $ref: string + } + returnType: { + $ref: string + } + } + } + } + } + validatePresentationAgainstSdr( + args: IValidatePresentationAgainstSdrArgs, + context: IAgentContext<{}>, + ): Promise +} +``` diff --git a/packages/daf-selective-disclosure/src/action-handler.ts b/packages/daf-selective-disclosure/src/action-handler.ts index 448489757..bc4b1adb7 100644 --- a/packages/daf-selective-disclosure/src/action-handler.ts +++ b/packages/daf-selective-disclosure/src/action-handler.ts @@ -1,5 +1,13 @@ -import { IAgentContext, IIdentityManager, IKeyManager, IAgentPlugin } from 'daf-core' +import { + IAgentContext, + IIdentityManager, + IKeyManager, + IAgentPlugin, + VerifiablePresentation, + VerifiableCredential, +} from 'daf-core' import { IDataStoreORM, TClaimsColumns, FindArgs } from 'daf-typeorm' +import { ICredentialIssuer } from 'daf-w3c' import { ICredentialsForSdr, IPresentationValidationResult, @@ -8,6 +16,7 @@ import { IGetVerifiableCredentialsForSdrArgs, IValidatePresentationAgainstSdrArgs, ISelectiveDisclosureRequest, + ICreateProfileCredentialsArgs, } from './types' import schema from './schemas/ISelectiveDisclosure' import { createJWT } from 'did-jwt' @@ -33,6 +42,7 @@ export class SelectiveDisclosure implements IAgentPlugin { createSelectiveDisclosureRequest: this.createSelectiveDisclosureRequest, getVerifiableCredentialsForSdr: this.getVerifiableCredentialsForSdr, validatePresentationAgainstSdr: this.validatePresentationAgainstSdr, + createProfilePresentation: this.createProfilePresentation, } } @@ -200,4 +210,99 @@ export class SelectiveDisclosure implements IAgentPlugin { } return { valid, claims } } + + /** + * Creates profile credentials + * + * @beta + */ + async createProfilePresentation( + args: ICreateProfileCredentialsArgs, + context: IAgentContext, + ): Promise { + const identity = await context.agent.identityManagerGetIdentity({ did: args.holder }) + + const credentials = [] + + if (args.name) { + const credential = await context.agent.createVerifiableCredential({ + credential: { + issuer: { id: identity.did }, + '@context': ['https://www.w3.org/2018/credentials/v1'], + type: ['VerifiableCredential', 'Profile'], + issuanceDate: new Date().toISOString(), + credentialSubject: { + id: identity.did, + name: args.name, + }, + }, + proofFormat: 'jwt', + }) + + credentials.push(credential) + } + + if (args.picture) { + const credential = await context.agent.createVerifiableCredential({ + credential: { + issuer: { id: identity.did }, + '@context': ['https://www.w3.org/2018/credentials/v1'], + type: ['VerifiableCredential', 'Profile'], + issuanceDate: new Date().toISOString(), + credentialSubject: { + id: identity.did, + picture: args.picture, + }, + }, + proofFormat: 'jwt', + }) + + credentials.push(credential) + } + + if (args.url) { + const credential = await context.agent.createVerifiableCredential({ + credential: { + issuer: { id: identity.did }, + '@context': ['https://www.w3.org/2018/credentials/v1'], + type: ['VerifiableCredential', 'Profile'], + issuanceDate: new Date().toISOString(), + credentialSubject: { + id: identity.did, + url: args.url, + }, + }, + proofFormat: 'jwt', + }) + + credentials.push(credential) + } + + const profile = await context.agent.createVerifiablePresentation({ + presentation: { + verifier: args.holder ? [args.holder] : [], + holder: identity.did, + '@context': ['https://www.w3.org/2018/credentials/v1'], + type: ['VerifiablePresentation', 'Profile'], + issuanceDate: new Date().toISOString(), + verifiableCredential: credentials, + }, + proofFormat: 'jwt', + save: args.save, + }) + + if (args.verifier && args.send) { + await context.agent.sendMessageDIDCommAlpha1({ + save: args.save, + data: { + from: identity.did, + to: args.verifier, + type: 'jwt', + body: profile.proof.jwt, + }, + }) + } + + return profile + } } diff --git a/packages/daf-selective-disclosure/src/schemas/ISelectiveDisclosure.ts b/packages/daf-selective-disclosure/src/schemas/ISelectiveDisclosure.ts index b345727f6..9e2260345 100644 --- a/packages/daf-selective-disclosure/src/schemas/ISelectiveDisclosure.ts +++ b/packages/daf-selective-disclosure/src/schemas/ISelectiveDisclosure.ts @@ -1,411 +1,422 @@ export default { - "components": { - "schemas": { - "ICreateSelectiveDisclosureRequestArgs": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/ISelectiveDisclosureRequest" - } + components: { + schemas: { + ICreateProfileCredentialsArgs: { + type: 'object', + properties: { + holder: { + type: 'string', + description: 'Holder DID', + }, + verifier: { + type: 'string', + description: 'Optional. Verifier DID', + }, + name: { + type: 'string', + description: 'Optional. Name', + }, + picture: { + type: 'string', + description: 'Optional. Picture URL', + }, + url: { + type: 'string', + description: 'Optional. URL', + }, + save: { + type: 'boolean', + description: 'Save presentation', + }, + send: { + type: 'boolean', + description: 'Send presentation', + }, + }, + required: ['holder', 'save', 'send'], + description: 'Profile data', + }, + VerifiablePresentation: { + type: 'object', + properties: { + id: { + type: 'string', + }, + holder: { + type: 'string', + }, + issuanceDate: { + type: 'string', + }, + expirationDate: { + type: 'string', + }, + '@context': { + type: 'array', + items: { + type: 'string', + }, + }, + type: { + type: 'array', + items: { + type: 'string', + }, + }, + verifier: { + type: 'array', + items: { + type: 'string', + }, + }, + verifiableCredential: { + type: 'array', + items: { + $ref: '#/components/schemas/VerifiableCredential', + }, + }, + proof: { + type: 'object', + properties: { + type: { + type: 'string', + }, + }, + }, + }, + required: ['holder', '@context', 'type', 'verifier', 'verifiableCredential', 'proof'], + description: 'Verifiable Presentation {@link https://github.com/decentralized-identity/did-jwt-vc}', + }, + VerifiableCredential: { + type: 'object', + properties: { + '@context': { + type: 'array', + items: { + type: 'string', + }, + }, + id: { + type: 'string', + }, + type: { + type: 'array', + items: { + type: 'string', + }, + }, + issuer: { + type: 'object', + properties: { + id: { + type: 'string', + }, + }, + required: ['id'], + }, + issuanceDate: { + type: 'string', + }, + expirationDate: { + type: 'string', + }, + credentialSubject: { + type: 'object', + properties: { + id: { + type: 'string', + }, + }, + }, + credentialStatus: { + type: 'object', + properties: { + id: { + type: 'string', + }, + type: { + type: 'string', + }, + }, + required: ['id', 'type'], + }, + proof: { + type: 'object', + properties: { + type: { + type: 'string', + }, + }, + }, + }, + required: ['@context', 'type', 'issuer', 'issuanceDate', 'credentialSubject', 'proof'], + description: 'Verifiable Credential {@link https://github.com/decentralized-identity/did-jwt-vc}', + }, + ICreateSelectiveDisclosureRequestArgs: { + type: 'object', + properties: { + data: { + $ref: '#/components/schemas/ISelectiveDisclosureRequest', + }, }, - "required": [ - "data" - ], - "description": "Contains the parameters of a Selective Disclosure Request." + required: ['data'], + description: 'Contains the parameters of a Selective Disclosure Request.', }, - "ISelectiveDisclosureRequest": { - "type": "object", - "properties": { - "issuer": { - "type": "string", - "description": "The issuer of the request" - }, - "subject": { - "type": "string", - "description": "The target of the request" - }, - "replyUrl": { - "type": "string", - "description": "The URL where the response should be sent back" - }, - "tag": { - "type": "string" - }, - "claims": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ICredentialRequestInput" + ISelectiveDisclosureRequest: { + type: 'object', + properties: { + issuer: { + type: 'string', + description: 'The issuer of the request', + }, + subject: { + type: 'string', + description: 'The target of the request', + }, + replyUrl: { + type: 'string', + description: 'The URL where the response should be sent back', + }, + tag: { + type: 'string', + }, + claims: { + type: 'array', + items: { + $ref: '#/components/schemas/ICredentialRequestInput', }, - "description": "A list of claims that are being requested" + description: 'A list of claims that are being requested', }, - "credentials": { - "type": "array", - "items": { - "type": "string" + credentials: { + type: 'array', + items: { + type: 'string', }, - "description": "A list of issuer credentials that the target will use to establish trust" - } + description: 'A list of issuer credentials that the target will use to establish trust', + }, }, - "required": [ - "issuer", - "claims" - ], - "description": "Represents the Selective Disclosure request parameters." + required: ['issuer', 'claims'], + description: 'Represents the Selective Disclosure request parameters.', }, - "ICredentialRequestInput": { - "type": "object", - "properties": { - "reason": { - "type": "string", - "description": "Motive for requiring this credential." - }, - "essential": { - "type": "boolean", - "description": "If it is essential. A response that does not include this credential is not sufficient." - }, - "credentialType": { - "type": "string", - "description": "The credential type. See {@link https://www.w3.org/TR/vc-data-model/#types | W3C Credential Types}" - }, - "credentialContext": { - "type": "string", - "description": "The credential context. See {@link https://www.w3.org/TR/vc-data-model/#contexts | W3C Credential Context}" - }, - "claimType": { - "type": "string", - "description": "The name of the claim property that the credential should express." - }, - "claimValue": { - "type": "string", - "description": "The value of the claim that the credential should express." - }, - "issuers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Issuer" + ICredentialRequestInput: { + type: 'object', + properties: { + reason: { + type: 'string', + description: 'Motive for requiring this credential.', + }, + essential: { + type: 'boolean', + description: + 'If it is essential. A response that does not include this credential is not sufficient.', + }, + credentialType: { + type: 'string', + description: + 'The credential type. See {@link https://www.w3.org/TR/vc-data-model/#types | W3C Credential Types}', + }, + credentialContext: { + type: 'string', + description: + 'The credential context. See {@link https://www.w3.org/TR/vc-data-model/#contexts | W3C Credential Context}', + }, + claimType: { + type: 'string', + description: 'The name of the claim property that the credential should express.', + }, + claimValue: { + type: 'string', + description: 'The value of the claim that the credential should express.', + }, + issuers: { + type: 'array', + items: { + $ref: '#/components/schemas/Issuer', }, - "description": "A list of accepted Issuers for this credential." - } + description: 'A list of accepted Issuers for this credential.', + }, }, - "required": [ - "claimType" - ], - "description": "Describes a particular credential that is being requested" + required: ['claimType'], + description: 'Describes a particular credential that is being requested', }, - "Issuer": { - "type": "object", - "properties": { - "did": { - "type": "string", - "description": "The DID of the issuer of a requested credential." - }, - "url": { - "type": "string", - "description": "A URL where a credential of that type can be obtained." - } + Issuer: { + type: 'object', + properties: { + did: { + type: 'string', + description: 'The DID of the issuer of a requested credential.', + }, + url: { + type: 'string', + description: 'A URL where a credential of that type can be obtained.', + }, }, - "required": [ - "did", - "url" - ], - "description": "Used for requesting Credentials using Selective Disclosure. Represents an accepted issuer of a credential." + required: ['did', 'url'], + description: + 'Used for requesting Credentials using Selective Disclosure. Represents an accepted issuer of a credential.', }, - "IGetVerifiableCredentialsForSdrArgs": { - "type": "object", - "properties": { - "sdr": { - "type": "object", - "properties": { - "subject": { - "type": "string", - "description": "The target of the request" + IGetVerifiableCredentialsForSdrArgs: { + type: 'object', + properties: { + sdr: { + type: 'object', + properties: { + subject: { + type: 'string', + description: 'The target of the request', }, - "replyUrl": { - "type": "string", - "description": "The URL where the response should be sent back" + replyUrl: { + type: 'string', + description: 'The URL where the response should be sent back', }, - "tag": { - "type": "string" + tag: { + type: 'string', }, - "claims": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ICredentialRequestInput" + claims: { + type: 'array', + items: { + $ref: '#/components/schemas/ICredentialRequestInput', }, - "description": "A list of claims that are being requested" + description: 'A list of claims that are being requested', }, - "credentials": { - "type": "array", - "items": { - "type": "string" + credentials: { + type: 'array', + items: { + type: 'string', }, - "description": "A list of issuer credentials that the target will use to establish trust" - } + description: 'A list of issuer credentials that the target will use to establish trust', + }, }, - "required": [ - "claims" - ], - "description": "The Selective Disclosure Request (issuer is omitted)" - }, - "did": { - "type": "string", - "description": "The DID of the subject" - } + required: ['claims'], + description: 'The Selective Disclosure Request (issuer is omitted)', + }, + did: { + type: 'string', + description: 'The DID of the subject', + }, }, - "required": [ - "sdr" - ], - "description": "Encapsulates the params needed to gather credentials to fulfill a Selective disclosure request." + required: ['sdr'], + description: + 'Encapsulates the params needed to gather credentials to fulfill a Selective disclosure request.', }, - "ICredentialsForSdr": { - "type": "object", - "properties": { - "reason": { - "type": "string", - "description": "Motive for requiring this credential." - }, - "essential": { - "type": "boolean", - "description": "If it is essential. A response that does not include this credential is not sufficient." - }, - "credentialType": { - "type": "string", - "description": "The credential type. See {@link https://www.w3.org/TR/vc-data-model/#types | W3C Credential Types}" - }, - "credentialContext": { - "type": "string", - "description": "The credential context. See {@link https://www.w3.org/TR/vc-data-model/#contexts | W3C Credential Context}" - }, - "claimType": { - "type": "string", - "description": "The name of the claim property that the credential should express." - }, - "claimValue": { - "type": "string", - "description": "The value of the claim that the credential should express." - }, - "issuers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Issuer" + ICredentialsForSdr: { + type: 'object', + properties: { + reason: { + type: 'string', + description: 'Motive for requiring this credential.', + }, + essential: { + type: 'boolean', + description: + 'If it is essential. A response that does not include this credential is not sufficient.', + }, + credentialType: { + type: 'string', + description: + 'The credential type. See {@link https://www.w3.org/TR/vc-data-model/#types | W3C Credential Types}', + }, + credentialContext: { + type: 'string', + description: + 'The credential context. See {@link https://www.w3.org/TR/vc-data-model/#contexts | W3C Credential Context}', + }, + claimType: { + type: 'string', + description: 'The name of the claim property that the credential should express.', + }, + claimValue: { + type: 'string', + description: 'The value of the claim that the credential should express.', + }, + issuers: { + type: 'array', + items: { + $ref: '#/components/schemas/Issuer', + }, + description: 'A list of accepted Issuers for this credential.', + }, + credentials: { + type: 'array', + items: { + $ref: '#/components/schemas/VerifiableCredential', }, - "description": "A list of accepted Issuers for this credential." - }, - "credentials": { - "type": "array", - "items": { - "$ref": "#/components/schemas/VerifiableCredential" - } - } + }, }, - "required": [ - "claimType", - "credentials" - ], - "description": "The credentials that make up a response of a Selective Disclosure" + required: ['claimType', 'credentials'], + description: 'The credentials that make up a response of a Selective Disclosure', }, - "VerifiableCredential": { - "type": "object", - "properties": { - "@context": { - "type": "array", - "items": { - "type": "string" - } - }, - "id": { - "type": "string" - }, - "type": { - "type": "array", - "items": { - "type": "string" - } - }, - "issuer": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - }, - "required": [ - "id" - ] - }, - "issuanceDate": { - "type": "string" - }, - "expirationDate": { - "type": "string" - }, - "credentialSubject": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - } - }, - "credentialStatus": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ] - }, - "proof": { - "type": "object", - "properties": { - "type": { - "type": "string" - } - } - } + IValidatePresentationAgainstSdrArgs: { + type: 'object', + properties: { + presentation: { + $ref: '#/components/schemas/VerifiablePresentation', + }, + sdr: { + $ref: '#/components/schemas/ISelectiveDisclosureRequest', + }, }, - "required": [ - "@context", - "type", - "issuer", - "issuanceDate", - "credentialSubject", - "proof" - ], - "description": "Verifiable Credential {@link https://github.com/decentralized-identity/did-jwt-vc}" + required: ['presentation', 'sdr'], + description: + 'A tuple used to verify a Selective Disclosure Response. Encapsulates the response(`presentation`) and the corresponding request (`sdr`) that made it.', }, - "IValidatePresentationAgainstSdrArgs": { - "type": "object", - "properties": { - "presentation": { - "$ref": "#/components/schemas/VerifiablePresentation" - }, - "sdr": { - "$ref": "#/components/schemas/ISelectiveDisclosureRequest" - } + IPresentationValidationResult: { + type: 'object', + properties: { + valid: { + type: 'boolean', + }, + claims: { + type: 'array', + items: { + $ref: '#/components/schemas/ICredentialsForSdr', + }, + }, }, - "required": [ - "presentation", - "sdr" - ], - "description": "A tuple used to verify a Selective Disclosure Response. Encapsulates the response(`presentation`) and the corresponding request (`sdr`) that made it." + required: ['valid', 'claims'], + description: 'The result of a selective disclosure response validation.', }, - "VerifiablePresentation": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "holder": { - "type": "string" - }, - "issuanceDate": { - "type": "string" - }, - "expirationDate": { - "type": "string" - }, - "@context": { - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "type": "array", - "items": { - "type": "string" - } - }, - "verifier": { - "type": "array", - "items": { - "type": "string" - } - }, - "verifiableCredential": { - "type": "array", - "items": { - "$ref": "#/components/schemas/VerifiableCredential" - } - }, - "proof": { - "type": "object", - "properties": { - "type": { - "type": "string" - } - } - } + }, + methods: { + createProfilePresentation: { + description: '', + arguments: { + $ref: '#/components/schemas/ICreateProfileCredentialsArgs', + }, + returnType: { + $ref: '#/components/schemas/VerifiablePresentation', }, - "required": [ - "holder", - "@context", - "type", - "verifier", - "verifiableCredential", - "proof" - ], - "description": "Verifiable Presentation {@link https://github.com/decentralized-identity/did-jwt-vc}" }, - "IPresentationValidationResult": { - "type": "object", - "properties": { - "valid": { - "type": "boolean" - }, - "claims": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ICredentialsForSdr" - } - } + createSelectiveDisclosureRequest: { + description: '', + arguments: { + $ref: '#/components/schemas/ICreateSelectiveDisclosureRequestArgs', }, - "required": [ - "valid", - "claims" - ], - "description": "The result of a selective disclosure response validation." - } - }, - "methods": { - "createSelectiveDisclosureRequest": { - "description": "", - "arguments": { - "$ref": "#/components/schemas/ICreateSelectiveDisclosureRequestArgs" + returnType: { + type: 'string', }, - "returnType": { - "type": "string" - } }, - "getVerifiableCredentialsForSdr": { - "description": "", - "arguments": { - "$ref": "#/components/schemas/IGetVerifiableCredentialsForSdrArgs" + getVerifiableCredentialsForSdr: { + description: '', + arguments: { + $ref: '#/components/schemas/IGetVerifiableCredentialsForSdrArgs', + }, + returnType: { + type: 'array', + items: { + $ref: '#/components/schemas/ICredentialsForSdr', + }, }, - "returnType": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ICredentialsForSdr" - } - } }, - "validatePresentationAgainstSdr": { - "description": "", - "arguments": { - "$ref": "#/components/schemas/IValidatePresentationAgainstSdrArgs" + validatePresentationAgainstSdr: { + description: '', + arguments: { + $ref: '#/components/schemas/IValidatePresentationAgainstSdrArgs', + }, + returnType: { + $ref: '#/components/schemas/IPresentationValidationResult', }, - "returnType": { - "$ref": "#/components/schemas/IPresentationValidationResult" - } - } - } - } -} \ No newline at end of file + }, + }, + }, +} diff --git a/packages/daf-selective-disclosure/src/types.ts b/packages/daf-selective-disclosure/src/types.ts index d2707ba0f..ed928b16b 100644 --- a/packages/daf-selective-disclosure/src/types.ts +++ b/packages/daf-selective-disclosure/src/types.ts @@ -7,6 +7,7 @@ import { VerifiablePresentation, } from 'daf-core' import { IDataStoreORM } from 'daf-typeorm' +import { ICredentialIssuer } from 'daf-w3c' /** * Used for requesting Credentials using Selective Disclosure. @@ -168,6 +169,42 @@ export interface IValidatePresentationAgainstSdrArgs { sdr: ISelectiveDisclosureRequest } +/** + * Profile data + * + * @beta + */ +export interface ICreateProfileCredentialsArgs { + /** + * Holder DID + */ + holder: string + /** + * Optional. Verifier DID + */ + verifier?: string + /** + * Optional. Name + */ + name?: string + /** + * Optional. Picture URL + */ + picture?: string + /** + * Optional. URL + */ + url?: string + /** + * Save presentation + */ + save: boolean + /** + * Send presentation + */ + send: boolean +} + /** * Describes the interface of a Selective Disclosure plugin. * @@ -188,4 +225,8 @@ export interface ISelectiveDisclosure extends IPluginMethodMap { args: IValidatePresentationAgainstSdrArgs, context: IAgentContext<{}>, ): Promise + createProfilePresentation( + args: ICreateProfileCredentialsArgs, + context: IAgentContext, + ): Promise }