UNPKG

@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 • 1.96 kB
{"version":3,"file":"LegacyDidCommV2Service.mjs","names":[],"sources":["../../../../../src/modules/dids/domain/service/LegacyDidCommV2Service.ts"],"sourcesContent":["import { IsOptional, IsString } from 'class-validator'\n\nimport { IsUri } from '../../../../utils'\n\nimport { DidCommV2Service, DidCommV2ServiceEndpoint } from './DidCommV2Service'\nimport { DidDocumentService } from './DidDocumentService'\n\nexport interface LegacyDidCommV2ServiceOptions {\n id: string\n serviceEndpoint: string\n routingKeys?: string[]\n accept?: string[]\n}\n\nexport class LegacyDidCommV2Service extends DidDocumentService {\n public constructor(options: LegacyDidCommV2ServiceOptions) {\n super({ ...options, type: LegacyDidCommV2Service.type })\n\n if (options) {\n this.serviceEndpoint = options.serviceEndpoint\n this.accept = options.accept\n this.routingKeys = options.routingKeys\n }\n }\n\n public static type = 'DIDComm'\n\n @IsString({ each: true })\n @IsOptional()\n public routingKeys?: string[]\n\n @IsString({ each: true })\n @IsOptional()\n public accept?: string[]\n\n @IsUri()\n @IsString()\n public serviceEndpoint!: string\n\n public toNewDidCommV2(): DidCommV2Service {\n return new DidCommV2Service({\n id: this.id,\n serviceEndpoint: new DidCommV2ServiceEndpoint({\n uri: this.serviceEndpoint,\n accept: this.accept,\n routingKeys: this.routingKeys,\n }),\n })\n }\n}\n"],"mappings":";;;;;;;;AAcA,IAAa,yBAAb,MAAa,+BAA+B,mBAAmB;CAC7D,YAAmB,SAAwC;EACzD,MAAM;GAAE,GAAG;GAAS,MAAM,uBAAuB;EAAK,CAAC;EAEvD,IAAI,SAAS;GACX,KAAK,kBAAkB,QAAQ;GAC/B,KAAK,SAAS,QAAQ;GACtB,KAAK,cAAc,QAAQ;EAC7B;CACF;CAgBA,iBAA0C;EACxC,OAAO,IAAI,iBAAiB;GAC1B,IAAI,KAAK;GACT,iBAAiB,IAAI,yBAAyB;IAC5C,KAAK,KAAK;IACV,QAAQ,KAAK;IACb,aAAa,KAAK;GACpB,CAAC;EACH,CAAC;CACH;AACF;AAxBE,uBAAc,OAAO;;CAEpB,SAAS,EAAE,MAAM,KAAK,CAAC;CACvB,WAAW;;;;CAGX,SAAS,EAAE,MAAM,KAAK,CAAC;CACvB,WAAW;;;;CAGX,MAAM;CACN,SAAS"}