@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
25 lines (21 loc) • 1.26 kB
JavaScript
import { W3cCredentialRepository } from "../../../../modules/vc/repository/W3cCredentialRepository.mjs";
import "../../../../modules/vc/repository/index.mjs";
//#region src/storage/migration/updates/0.3.1-0.4/w3cCredentialRecord.ts
/**
* Re-saves the w3c credential records to add the new claimFormat tag.
*/
async function migrateW3cCredentialRecordToV0_4(agent) {
agent.config.logger.info("Migration w3c credential records records to storage version 0.4");
const w3cCredentialRepository = agent.dependencyManager.resolve(W3cCredentialRepository);
agent.config.logger.debug("Fetching all w3c credential records from storage");
const records = await w3cCredentialRepository.getAll(agent.context);
agent.config.logger.debug(`Found a total of ${records.length} w3c credential records to update.`);
for (const record of records) {
agent.config.logger.debug(`Re-saving w3c credential record with id ${record.id} to add claimFormat tag for storage version 0.4`);
await w3cCredentialRepository.update(agent.context, record);
agent.config.logger.debug(`Successfully migrated w3c credential record with id ${record.id} to storage version 0.4`);
}
}
//#endregion
export { migrateW3cCredentialRecordToV0_4 };
//# sourceMappingURL=w3cCredentialRecord.mjs.map