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.9 kB
{"version":3,"file":"DidCommV1Service.mjs","names":[],"sources":["../../../../../src/modules/dids/domain/service/DidCommV1Service.ts"],"sourcesContent":["import { ArrayNotEmpty, IsOptional, IsString } from 'class-validator'\n\nimport { IsUri } from '../../../../utils'\nimport { getProtocolScheme } from '../../../../utils/uri'\n\nimport { DidDocumentService } from './DidDocumentService'\n\nexport class DidCommV1Service extends DidDocumentService {\n public constructor(options: {\n id: string\n serviceEndpoint: string\n recipientKeys: string[]\n routingKeys?: string[]\n accept?: string[]\n priority?: number\n }) {\n super({ ...options, type: DidCommV1Service.type })\n\n if (options) {\n this.recipientKeys = options.recipientKeys\n this.routingKeys = options.routingKeys\n this.accept = options.accept\n if (options.priority) this.priority = options.priority\n }\n }\n\n public static type = 'did-communication'\n\n public get protocolScheme(): string {\n return getProtocolScheme(this.serviceEndpoint)\n }\n\n @IsString()\n @IsUri()\n public serviceEndpoint!: string\n\n @ArrayNotEmpty()\n @IsString({ each: true })\n public recipientKeys!: string[]\n\n @IsString({ each: true })\n @IsOptional()\n public routingKeys?: string[]\n\n @IsString({ each: true })\n @IsOptional()\n public accept?: string[]\n\n public priority = 0\n}\n"],"mappings":";;;;;;;;AAOA,IAAa,mBAAb,MAAa,yBAAyB,mBAAmB;CACvD,YAAmB,SAOhB;EACD,MAAM;GAAE,GAAG;GAAS,MAAM,iBAAiB;EAAK,CAAC;EAgCnD,KAAO,WAAW;EA9BhB,IAAI,SAAS;GACX,KAAK,gBAAgB,QAAQ;GAC7B,KAAK,cAAc,QAAQ;GAC3B,KAAK,SAAS,QAAQ;GACtB,IAAI,QAAQ,UAAU,KAAK,WAAW,QAAQ;EAChD;CACF;CAIA,IAAW,iBAAyB;EAClC,OAAO,kBAAkB,KAAK,eAAe;CAC/C;AAmBF;AAvBE,iBAAc,OAAO;;CAMpB,SAAS;CACT,MAAM;;;;CAGN,cAAc;CACd,SAAS,EAAE,MAAM,KAAK,CAAC;;;;CAGvB,SAAS,EAAE,MAAM,KAAK,CAAC;CACvB,WAAW;;;;CAGX,SAAS,EAAE,MAAM,KAAK,CAAC;CACvB,WAAW"}