@credo-ts/core
Version:
<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1
1 lines • 3.71 kB
Source Map (JSON)
{"version":3,"file":"W3cCredentialsApi.mjs","names":[],"sources":["../../../src/modules/vc/W3cCredentialsApi.ts"],"sourcesContent":["import { AgentContext } from '../../agent'\nimport { injectable } from '../../plugins'\nimport type { Query, QueryOptions } from '../../storage/StorageService'\nimport type { ClaimFormat, W3cVerifiableCredential } from './models'\nimport type { W3cCredentialRecord } from './repository'\nimport { W3cCredentialService } from './W3cCredentialService'\nimport type {\n W3cCreatePresentationOptions,\n W3cSignCredentialOptions,\n W3cSignPresentationOptions,\n W3cStoreCredentialOptions,\n W3cVerifyCredentialOptions,\n W3cVerifyPresentationOptions,\n} from './W3cCredentialServiceOptions'\n\n/**\n * @public\n */\n@injectable()\nexport class W3cCredentialsApi {\n private agentContext: AgentContext\n private w3cCredentialService: W3cCredentialService\n\n public constructor(agentContext: AgentContext, w3cCredentialService: W3cCredentialService) {\n this.agentContext = agentContext\n this.w3cCredentialService = w3cCredentialService\n }\n\n public async store(options: W3cStoreCredentialOptions): Promise<W3cCredentialRecord> {\n return this.w3cCredentialService.storeCredential(this.agentContext, options)\n }\n\n public async deleteById(id: string) {\n return this.w3cCredentialService.removeCredentialRecord(this.agentContext, id)\n }\n\n public async getAll(): Promise<W3cCredentialRecord[]> {\n return this.w3cCredentialService.getAllCredentialRecords(this.agentContext)\n }\n\n public async getById(id: string): Promise<W3cCredentialRecord> {\n return this.w3cCredentialService.getCredentialRecordById(this.agentContext, id)\n }\n\n public async findAllByQuery(\n query: Query<W3cCredentialRecord>,\n queryOptions?: QueryOptions\n ): Promise<W3cVerifiableCredential[]> {\n return this.w3cCredentialService.findCredentialsByQuery(this.agentContext, query, queryOptions)\n }\n\n public async signCredential<Format extends ClaimFormat.JwtVc | ClaimFormat.LdpVc>(\n options: W3cSignCredentialOptions<Format>\n ) {\n return this.w3cCredentialService.signCredential<Format>(this.agentContext, options)\n }\n\n public async verifyCredential(options: W3cVerifyCredentialOptions) {\n return this.w3cCredentialService.verifyCredential(this.agentContext, options)\n }\n\n public async createPresentation(options: W3cCreatePresentationOptions) {\n return this.w3cCredentialService.createPresentation(options)\n }\n\n public async signPresentation<Format extends ClaimFormat.JwtVp | ClaimFormat.LdpVp>(\n options: W3cSignPresentationOptions<Format>\n ) {\n return this.w3cCredentialService.signPresentation<Format>(this.agentContext, options)\n }\n\n public async verifyPresentation(options: W3cVerifyPresentationOptions) {\n return this.w3cCredentialService.verifyPresentation(this.agentContext, options)\n }\n}\n"],"mappings":";;;;;;;;;;;AAmBO,8BAAM,kBAAkB;CAI7B,AAAO,YAAY,cAA4B,sBAA4C;AACzF,OAAK,eAAe;AACpB,OAAK,uBAAuB;;CAG9B,MAAa,MAAM,SAAkE;AACnF,SAAO,KAAK,qBAAqB,gBAAgB,KAAK,cAAc,QAAQ;;CAG9E,MAAa,WAAW,IAAY;AAClC,SAAO,KAAK,qBAAqB,uBAAuB,KAAK,cAAc,GAAG;;CAGhF,MAAa,SAAyC;AACpD,SAAO,KAAK,qBAAqB,wBAAwB,KAAK,aAAa;;CAG7E,MAAa,QAAQ,IAA0C;AAC7D,SAAO,KAAK,qBAAqB,wBAAwB,KAAK,cAAc,GAAG;;CAGjF,MAAa,eACX,OACA,cACoC;AACpC,SAAO,KAAK,qBAAqB,uBAAuB,KAAK,cAAc,OAAO,aAAa;;CAGjG,MAAa,eACX,SACA;AACA,SAAO,KAAK,qBAAqB,eAAuB,KAAK,cAAc,QAAQ;;CAGrF,MAAa,iBAAiB,SAAqC;AACjE,SAAO,KAAK,qBAAqB,iBAAiB,KAAK,cAAc,QAAQ;;CAG/E,MAAa,mBAAmB,SAAuC;AACrE,SAAO,KAAK,qBAAqB,mBAAmB,QAAQ;;CAG9D,MAAa,iBACX,SACA;AACA,SAAO,KAAK,qBAAqB,iBAAyB,KAAK,cAAc,QAAQ;;CAGvF,MAAa,mBAAmB,SAAuC;AACrE,SAAO,KAAK,qBAAqB,mBAAmB,KAAK,cAAc,QAAQ;;;gCAtDlF,YAAY"}