{"version":3,"file":"W3cV2CredentialSubject.mjs","names":[],"sources":["../../../../../src/modules/vc/models/credential/W3cV2CredentialSubject.ts"],"sourcesContent":["import { plainToClassFromExist } from 'class-transformer'\nimport { IsOptional } from 'class-validator'\nimport { IsUri } from '../../../../utils'\n\nexport interface W3cV2CredentialSubjectOptions {\n  id?: string\n  [property: string]: unknown\n}\n\n/**\n * Represents a credential subject.\n *\n * @see https://www.w3.org/TR/vc-data-model-2.0/#credential-subject\n */\nexport class W3cV2CredentialSubject {\n  public constructor(options: W3cV2CredentialSubjectOptions) {\n    if (options) {\n      const { id, ...rest } = options\n\n      plainToClassFromExist(this, rest)\n\n      this.id = id\n    }\n  }\n\n  @IsOptional()\n  @IsUri()\n  public id?: string;\n\n  [property: string]: unknown\n}\n"],"mappings":";;;;;;;;;;;;;;;AAcA,IAAa,yBAAb,MAAoC;CAClC,AAAO,YAAY,SAAwC;AACzD,MAAI,SAAS;GACX,MAAM,EAAE,IAAI,GAAG,SAAS;AAExB,yBAAsB,MAAM,KAAK;AAEjC,QAAK,KAAK;;;;;CAIb,YAAY;CACZ,OAAO"}