{"version":3,"file":"w3cCredentialRecord.mjs","names":[],"sources":["../../../../../src/storage/migration/updates/0.3.1-0.4/w3cCredentialRecord.ts"],"sourcesContent":["import type { BaseAgent } from '../../../../agent/BaseAgent'\n\nimport { W3cCredentialRepository } from '../../../../modules/vc/repository'\n\n/**\n * Re-saves the w3c credential records to add the new claimFormat tag.\n */\nexport async function migrateW3cCredentialRecordToV0_4<Agent extends BaseAgent>(agent: Agent) {\n  agent.config.logger.info('Migration w3c credential records records to storage version 0.4')\n\n  const w3cCredentialRepository = agent.dependencyManager.resolve(W3cCredentialRepository)\n\n  agent.config.logger.debug('Fetching all w3c credential records from storage')\n  const records = await w3cCredentialRepository.getAll(agent.context)\n\n  agent.config.logger.debug(`Found a total of ${records.length} w3c credential records to update.`)\n\n  for (const record of records) {\n    agent.config.logger.debug(\n      `Re-saving w3c credential record with id ${record.id} to add claimFormat tag for storage version 0.4`\n    )\n\n    // Save updated record\n    await w3cCredentialRepository.update(agent.context, record)\n\n    agent.config.logger.debug(`Successfully migrated w3c credential record with id ${record.id} to storage version 0.4`)\n  }\n}\n"],"mappings":";;;;;;AAOA,eAAsB,iCAA0D,OAAc;CAC5F,MAAM,OAAO,OAAO,KAAK,iEAAiE;CAE1F,MAAM,0BAA0B,MAAM,kBAAkB,QAAQ,uBAAuB;CAEvF,MAAM,OAAO,OAAO,MAAM,kDAAkD;CAC5E,MAAM,UAAU,MAAM,wBAAwB,OAAO,MAAM,OAAO;CAElE,MAAM,OAAO,OAAO,MAAM,oBAAoB,QAAQ,OAAO,mCAAmC;CAEhG,KAAK,MAAM,UAAU,SAAS;EAC5B,MAAM,OAAO,OAAO,MAClB,2CAA2C,OAAO,GAAG,gDACvD;EAGA,MAAM,wBAAwB,OAAO,MAAM,SAAS,MAAM;EAE1D,MAAM,OAAO,OAAO,MAAM,uDAAuD,OAAO,GAAG,wBAAwB;CACrH;AACF"}