{"version":3,"file":"KemKeypairRepository.mjs","names":["KemKeypairRepository","storageService: StorageService<KemKeypairRecord>"],"sources":["../../src/repository/KemKeypairRepository.ts"],"sourcesContent":["import type { AgentContext } from '@credo-ts/core'\r\n\r\nimport type { StorageService } from \"@credo-ts/core\"\nimport { EventEmitter, inject, injectable, InjectionSymbols, Repository,  } from \"@credo-ts/core\"\r\n\r\nimport { KemKeypairRecord } from './KemKeypairRecord'\r\n\r\n@injectable()\r\nexport class KemKeypairRepository extends Repository<KemKeypairRecord> {\r\n  public constructor(\r\n    @inject(InjectionSymbols.StorageService) storageService: StorageService<KemKeypairRecord>,\r\n    eventEmitter: EventEmitter\r\n  ) {\r\n    super(KemKeypairRecord, storageService, eventEmitter)\r\n  }\r\n\r\n  /**\r\n   * Find keypair by connection ID (returns first match)\r\n   */\r\n  public async findByConnectionId(\r\n    agentContext: AgentContext,\r\n    connectionId: string\r\n  ): Promise<KemKeypairRecord | null> {\r\n    return this.findSingleByQuery(agentContext, { connectionId })\r\n  }\r\n\r\n  /**\r\n   * Find keypair by key identifier (kid)\r\n   */\r\n  public async findByKid(agentContext: AgentContext, kid: string): Promise<KemKeypairRecord | null> {\r\n    return this.findSingleByQuery(agentContext, { kid })\r\n  }\r\n\r\n  /**\r\n   * Delete all keypairs for a connection\r\n   */\r\n  public async deleteByConnectionId(agentContext: AgentContext, connectionId: string): Promise<void> {\r\n    const records = await this.findByQuery(agentContext, { connectionId })\r\n    for (const record of records) {\r\n      await this.delete(agentContext, record)\r\n    }\r\n  }\r\n}\r\n"],"mappings":";;;;;;;;AAQO,iCAAMA,+BAA6B,WAA6B;CACrE,AAAO,YACL,AAAyCC,gBACzC,cACA;AACA,QAAM,kBAAkB,gBAAgB,aAAa;;;;;CAMvD,MAAa,mBACX,cACA,cACkC;AAClC,SAAO,KAAK,kBAAkB,cAAc,EAAE,cAAc,CAAC;;;;;CAM/D,MAAa,UAAU,cAA4B,KAA+C;AAChG,SAAO,KAAK,kBAAkB,cAAc,EAAE,KAAK,CAAC;;;;;CAMtD,MAAa,qBAAqB,cAA4B,cAAqC;EACjG,MAAM,UAAU,MAAM,KAAK,YAAY,cAAc,EAAE,cAAc,CAAC;AACtE,OAAK,MAAM,UAAU,QACnB,OAAM,KAAK,OAAO,cAAc,OAAO;;;;CAhC5C,YAAY;oBAGR,OAAO,iBAAiB,eAAe"}