{"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,AAAO,YAAY,SAAwC;AACzD,QAAM;GAAE,GAAG;GAAS,MAAM,uBAAuB;GAAM,CAAC;AAExD,MAAI,SAAS;AACX,QAAK,kBAAkB,QAAQ;AAC/B,QAAK,SAAS,QAAQ;AACtB,QAAK,cAAc,QAAQ;;;CAkB/B,AAAO,iBAAmC;AACxC,SAAO,IAAI,iBAAiB;GAC1B,IAAI,KAAK;GACT,iBAAiB,IAAI,yBAAyB;IAC5C,KAAK,KAAK;IACV,QAAQ,KAAK;IACb,aAAa,KAAK;IACnB,CAAC;GACH,CAAC;;;uBAtBU,OAAO;;CAEpB,SAAS,EAAE,MAAM,MAAM,CAAC;CACxB,YAAY;;;;CAGZ,SAAS,EAAE,MAAM,MAAM,CAAC;CACxB,YAAY;;;;CAGZ,OAAO;CACP,UAAU"}