@credo-ts/anoncreds 0.6.1-pr-2091-20241119140918 → 0.6.2-alpha-20251210145840
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/AnonCredsApi.d.mts +113 -0
- package/build/AnonCredsApi.d.mts.map +1 -0
- package/build/AnonCredsApi.mjs +439 -0
- package/build/AnonCredsApi.mjs.map +1 -0
- package/build/AnonCredsApiOptions.d.mts +28 -0
- package/build/AnonCredsApiOptions.d.mts.map +1 -0
- package/build/AnonCredsModule.d.mts +29 -0
- package/build/AnonCredsModule.d.mts.map +1 -0
- package/build/AnonCredsModule.mjs +62 -0
- package/build/AnonCredsModule.mjs.map +1 -0
- package/build/AnonCredsModuleConfig.d.mts +79 -0
- package/build/AnonCredsModuleConfig.d.mts.map +1 -0
- package/build/AnonCredsModuleConfig.mjs +31 -0
- package/build/AnonCredsModuleConfig.mjs.map +1 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs +10 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs +7 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs +9 -0
- package/build/anoncreds-rs/AnonCredsDataIntegrityService.mjs +203 -0
- package/build/anoncreds-rs/AnonCredsDataIntegrityService.mjs.map +1 -0
- package/build/anoncreds-rs/AnonCredsRsHolderService.mjs +488 -0
- package/build/anoncreds-rs/AnonCredsRsHolderService.mjs.map +1 -0
- package/build/anoncreds-rs/AnonCredsRsIssuerService.mjs +213 -0
- package/build/anoncreds-rs/AnonCredsRsIssuerService.mjs.map +1 -0
- package/build/anoncreds-rs/AnonCredsRsVerifierService.mjs +122 -0
- package/build/anoncreds-rs/AnonCredsRsVerifierService.mjs.map +1 -0
- package/build/anoncreds-rs/index.mjs +3 -0
- package/build/anoncreds-rs/utils.mjs +60 -0
- package/build/anoncreds-rs/utils.mjs.map +1 -0
- package/build/error/AnonCredsError.d.mts +13 -0
- package/build/error/AnonCredsError.d.mts.map +1 -0
- package/build/error/AnonCredsError.mjs +12 -0
- package/build/error/AnonCredsError.mjs.map +1 -0
- package/build/error/AnonCredsRsError.d.mts +13 -0
- package/build/error/AnonCredsRsError.d.mts.map +1 -0
- package/build/error/AnonCredsRsError.mjs +12 -0
- package/build/error/AnonCredsRsError.mjs.map +1 -0
- package/build/error/AnonCredsStoreRecordError.d.mts +13 -0
- package/build/error/AnonCredsStoreRecordError.d.mts.map +1 -0
- package/build/error/AnonCredsStoreRecordError.mjs +12 -0
- package/build/error/AnonCredsStoreRecordError.mjs.map +1 -0
- package/build/error/index.d.mts +3 -0
- package/build/error/index.mjs +3 -0
- package/build/formats/AnonCredsDidCommCredentialFormat.d.mts +82 -0
- package/build/formats/AnonCredsDidCommCredentialFormat.d.mts.map +1 -0
- package/build/formats/AnonCredsDidCommCredentialFormatService.d.mts +120 -0
- package/build/formats/AnonCredsDidCommCredentialFormatService.d.mts.map +1 -0
- package/build/formats/AnonCredsDidCommCredentialFormatService.mjs +331 -0
- package/build/formats/AnonCredsDidCommCredentialFormatService.mjs.map +1 -0
- package/build/formats/AnonCredsDidCommProofFormat.d.mts +77 -0
- package/build/formats/AnonCredsDidCommProofFormat.d.mts.map +1 -0
- package/build/formats/AnonCredsDidCommProofFormatService.d.mts +93 -0
- package/build/formats/AnonCredsDidCommProofFormatService.d.mts.map +1 -0
- package/build/formats/AnonCredsDidCommProofFormatService.mjs +250 -0
- package/build/formats/AnonCredsDidCommProofFormatService.mjs.map +1 -0
- package/build/formats/DataIntegrityDidCommCredentialFormatService.d.mts +118 -0
- package/build/formats/DataIntegrityDidCommCredentialFormatService.d.mts.map +1 -0
- package/build/formats/DataIntegrityDidCommCredentialFormatService.mjs +587 -0
- package/build/formats/DataIntegrityDidCommCredentialFormatService.mjs.map +1 -0
- package/build/formats/LegacyIndyDidCommCredentialFormat.d.mts +38 -0
- package/build/formats/LegacyIndyDidCommCredentialFormat.d.mts.map +1 -0
- package/build/formats/LegacyIndyDidCommCredentialFormatService.d.mts +122 -0
- package/build/formats/LegacyIndyDidCommCredentialFormatService.d.mts.map +1 -0
- package/build/formats/LegacyIndyDidCommCredentialFormatService.mjs +309 -0
- package/build/formats/LegacyIndyDidCommCredentialFormatService.mjs.map +1 -0
- package/build/formats/LegacyIndyDidCommProofFormat.d.mts +36 -0
- package/build/formats/LegacyIndyDidCommProofFormat.d.mts.map +1 -0
- package/build/formats/LegacyIndyDidCommProofFormatService.d.mts +98 -0
- package/build/formats/LegacyIndyDidCommProofFormatService.d.mts.map +1 -0
- package/build/formats/LegacyIndyDidCommProofFormatService.mjs +322 -0
- package/build/formats/LegacyIndyDidCommProofFormatService.mjs.map +1 -0
- package/build/formats/index.d.mts +9 -0
- package/build/formats/index.mjs +5 -0
- package/build/index.d.mts +86 -0
- package/build/index.mjs +69 -0
- package/build/models/AnonCredsCredentialProposal.mjs +75 -0
- package/build/models/AnonCredsCredentialProposal.mjs.map +1 -0
- package/build/models/AnonCredsProofRequest.mjs +62 -0
- package/build/models/AnonCredsProofRequest.mjs.map +1 -0
- package/build/models/AnonCredsRequestedAttribute.mjs +50 -0
- package/build/models/AnonCredsRequestedAttribute.mjs.map +1 -0
- package/build/models/AnonCredsRequestedPredicate.mjs +53 -0
- package/build/models/AnonCredsRequestedPredicate.mjs.map +1 -0
- package/build/models/AnonCredsRestriction.d.mts +29 -0
- package/build/models/AnonCredsRestriction.d.mts.map +1 -0
- package/build/models/AnonCredsRestriction.mjs +137 -0
- package/build/models/AnonCredsRestriction.mjs.map +1 -0
- package/build/models/AnonCredsRestrictionWrapper.d.mts +9 -0
- package/build/models/AnonCredsRestrictionWrapper.d.mts.map +1 -0
- package/build/models/AnonCredsRestrictionWrapper.mjs +18 -0
- package/build/models/AnonCredsRestrictionWrapper.mjs.map +1 -0
- package/build/models/AnonCredsRevocationInterval.mjs +27 -0
- package/build/models/AnonCredsRevocationInterval.mjs.map +1 -0
- package/build/models/exchange.d.mts +104 -0
- package/build/models/exchange.d.mts.map +1 -0
- package/build/models/exchange.mjs +11 -0
- package/build/models/exchange.mjs.map +1 -0
- package/build/models/index.d.mts +4 -0
- package/build/models/index.mjs +2 -0
- package/build/models/internal.d.mts +40 -0
- package/build/models/internal.d.mts.map +1 -0
- package/build/models/registry.d.mts +44 -0
- package/build/models/registry.d.mts.map +1 -0
- package/build/models/utils.d.mts +27 -0
- package/build/models/utils.d.mts.map +1 -0
- package/build/protocols/credentials/v1/DidCommCredentialV1Protocol.d.mts +215 -0
- package/build/protocols/credentials/v1/DidCommCredentialV1Protocol.d.mts.map +1 -0
- package/build/protocols/credentials/v1/DidCommCredentialV1Protocol.mjs +827 -0
- package/build/protocols/credentials/v1/DidCommCredentialV1Protocol.mjs.map +1 -0
- package/build/protocols/credentials/v1/handlers/DidCommCredentialV1AckHandler.mjs +17 -0
- package/build/protocols/credentials/v1/handlers/DidCommCredentialV1AckHandler.mjs.map +1 -0
- package/build/protocols/credentials/v1/handlers/DidCommCredentialV1ProblemReportHandler.mjs +17 -0
- package/build/protocols/credentials/v1/handlers/DidCommCredentialV1ProblemReportHandler.mjs.map +1 -0
- package/build/protocols/credentials/v1/handlers/DidCommIssueCredentialV1Handler.mjs +36 -0
- package/build/protocols/credentials/v1/handlers/DidCommIssueCredentialV1Handler.mjs.map +1 -0
- package/build/protocols/credentials/v1/handlers/DidCommOfferCredentialV1Handler.mjs +32 -0
- package/build/protocols/credentials/v1/handlers/DidCommOfferCredentialV1Handler.mjs.map +1 -0
- package/build/protocols/credentials/v1/handlers/DidCommProposeCredentialV1Handler.mjs +35 -0
- package/build/protocols/credentials/v1/handlers/DidCommProposeCredentialV1Handler.mjs.map +1 -0
- package/build/protocols/credentials/v1/handlers/DidCommRequestCredentialV1Handler.mjs +36 -0
- package/build/protocols/credentials/v1/handlers/DidCommRequestCredentialV1Handler.mjs.map +1 -0
- package/build/protocols/credentials/v1/handlers/index.mjs +6 -0
- package/build/protocols/credentials/v1/index.d.mts +9 -0
- package/build/protocols/credentials/v1/index.mjs +9 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1AckMessage.d.mts +16 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1AckMessage.d.mts.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1AckMessage.mjs +21 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1AckMessage.mjs.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1Preview.d.mts +32 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1Preview.d.mts.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1Preview.mjs +57 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1Preview.mjs.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1ProblemReportMessage.d.mts +16 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1ProblemReportMessage.d.mts.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1ProblemReportMessage.mjs +21 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1ProblemReportMessage.mjs.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommIssueCredentialV1Message.d.mts +26 -0
- package/build/protocols/credentials/v1/messages/DidCommIssueCredentialV1Message.d.mts.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommIssueCredentialV1Message.mjs +46 -0
- package/build/protocols/credentials/v1/messages/DidCommIssueCredentialV1Message.mjs.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommOfferCredentialV1Message.d.mts +34 -0
- package/build/protocols/credentials/v1/messages/DidCommOfferCredentialV1Message.d.mts.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommOfferCredentialV1Message.mjs +61 -0
- package/build/protocols/credentials/v1/messages/DidCommOfferCredentialV1Message.mjs.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommProposeCredentialV1Message.d.mts +64 -0
- package/build/protocols/credentials/v1/messages/DidCommProposeCredentialV1Message.d.mts.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommProposeCredentialV1Message.mjs +95 -0
- package/build/protocols/credentials/v1/messages/DidCommProposeCredentialV1Message.mjs.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommRequestCredentialV1Message.d.mts +26 -0
- package/build/protocols/credentials/v1/messages/DidCommRequestCredentialV1Message.d.mts.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommRequestCredentialV1Message.mjs +46 -0
- package/build/protocols/credentials/v1/messages/DidCommRequestCredentialV1Message.mjs.map +1 -0
- package/build/protocols/credentials/v1/messages/index.d.mts +7 -0
- package/build/protocols/credentials/v1/messages/index.mjs +7 -0
- package/build/protocols/index.d.mts +18 -0
- package/build/protocols/index.mjs +18 -0
- package/build/protocols/proofs/v1/DidCommProofV1Protocol.d.mts +105 -0
- package/build/protocols/proofs/v1/DidCommProofV1Protocol.d.mts.map +1 -0
- package/build/protocols/proofs/v1/DidCommProofV1Protocol.mjs +723 -0
- package/build/protocols/proofs/v1/DidCommProofV1Protocol.mjs.map +1 -0
- package/build/protocols/proofs/v1/errors/DidCommPresentationV1ProblemReportError.d.mts +18 -0
- package/build/protocols/proofs/v1/errors/DidCommPresentationV1ProblemReportError.d.mts.map +1 -0
- package/build/protocols/proofs/v1/errors/DidCommPresentationV1ProblemReportError.mjs +19 -0
- package/build/protocols/proofs/v1/errors/DidCommPresentationV1ProblemReportError.mjs.map +1 -0
- package/build/protocols/proofs/v1/errors/index.d.mts +1 -0
- package/build/protocols/proofs/v1/errors/index.mjs +1 -0
- package/build/protocols/proofs/v1/handlers/DidCommPresentationV1AckHandler.mjs +17 -0
- package/build/protocols/proofs/v1/handlers/DidCommPresentationV1AckHandler.mjs.map +1 -0
- package/build/protocols/proofs/v1/handlers/DidCommPresentationV1Handler.mjs +36 -0
- package/build/protocols/proofs/v1/handlers/DidCommPresentationV1Handler.mjs.map +1 -0
- package/build/protocols/proofs/v1/handlers/DidCommPresentationV1ProblemReportHandler.mjs +16 -0
- package/build/protocols/proofs/v1/handlers/DidCommPresentationV1ProblemReportHandler.mjs.map +1 -0
- package/build/protocols/proofs/v1/handlers/DidCommProposePresentationV1Handler.mjs +35 -0
- package/build/protocols/proofs/v1/handlers/DidCommProposePresentationV1Handler.mjs.map +1 -0
- package/build/protocols/proofs/v1/handlers/DidCommRequestPresentationV1Handler.mjs +32 -0
- package/build/protocols/proofs/v1/handlers/DidCommRequestPresentationV1Handler.mjs.map +1 -0
- package/build/protocols/proofs/v1/handlers/index.mjs +5 -0
- package/build/protocols/proofs/v1/index.d.mts +11 -0
- package/build/protocols/proofs/v1/index.mjs +11 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1AckMessage.d.mts +12 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1AckMessage.d.mts.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1AckMessage.mjs +18 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1AckMessage.mjs.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1Message.d.mts +38 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1Message.d.mts.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1Message.mjs +52 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1Message.mjs.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1ProblemReportMessage.d.mts +16 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1ProblemReportMessage.d.mts.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1ProblemReportMessage.mjs +21 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1ProblemReportMessage.mjs.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommProposePresentationV1Message.d.mts +32 -0
- package/build/protocols/proofs/v1/messages/DidCommProposePresentationV1Message.d.mts.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommProposePresentationV1Message.mjs +44 -0
- package/build/protocols/proofs/v1/messages/DidCommProposePresentationV1Message.mjs.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommRequestPresentationV1Message.d.mts +36 -0
- package/build/protocols/proofs/v1/messages/DidCommRequestPresentationV1Message.d.mts.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommRequestPresentationV1Message.mjs +50 -0
- package/build/protocols/proofs/v1/messages/DidCommRequestPresentationV1Message.mjs.map +1 -0
- package/build/protocols/proofs/v1/messages/index.d.mts +5 -0
- package/build/protocols/proofs/v1/messages/index.mjs +5 -0
- package/build/protocols/proofs/v1/models/DidCommPresentationV1Preview.d.mts +57 -0
- package/build/protocols/proofs/v1/models/DidCommPresentationV1Preview.d.mts.map +1 -0
- package/build/protocols/proofs/v1/models/DidCommPresentationV1Preview.mjs +113 -0
- package/build/protocols/proofs/v1/models/DidCommPresentationV1Preview.mjs.map +1 -0
- package/build/protocols/proofs/v1/models/index.d.mts +1 -0
- package/build/protocols/proofs/v1/models/index.mjs +1 -0
- package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.d.mts +25 -0
- package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.d.mts.map +1 -0
- package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.mjs +26 -0
- package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.mjs.map +1 -0
- package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.d.mts +12 -0
- package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.d.mts.map +1 -0
- package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.mjs +28 -0
- package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.mjs.map +1 -0
- package/build/repository/AnonCredsCredentialDefinitionRecord.d.mts +44 -0
- package/build/repository/AnonCredsCredentialDefinitionRecord.d.mts.map +1 -0
- package/build/repository/AnonCredsCredentialDefinitionRecord.mjs +38 -0
- package/build/repository/AnonCredsCredentialDefinitionRecord.mjs.map +1 -0
- package/build/repository/AnonCredsCredentialDefinitionRepository.d.mts +12 -0
- package/build/repository/AnonCredsCredentialDefinitionRepository.d.mts.map +1 -0
- package/build/repository/AnonCredsCredentialDefinitionRepository.mjs +28 -0
- package/build/repository/AnonCredsCredentialDefinitionRepository.mjs.map +1 -0
- package/build/repository/AnonCredsCredentialRecord.d.mts +53 -0
- package/build/repository/AnonCredsCredentialRecord.d.mts.map +1 -0
- package/build/repository/AnonCredsCredentialRecord.mjs +46 -0
- package/build/repository/AnonCredsCredentialRecord.mjs.map +1 -0
- package/build/repository/AnonCredsCredentialRepository.d.mts +14 -0
- package/build/repository/AnonCredsCredentialRepository.d.mts.map +1 -0
- package/build/repository/AnonCredsCredentialRepository.mjs +34 -0
- package/build/repository/AnonCredsCredentialRepository.mjs.map +1 -0
- package/build/repository/AnonCredsKeyCorrectnessProofRecord.d.mts +25 -0
- package/build/repository/AnonCredsKeyCorrectnessProofRecord.d.mts.map +1 -0
- package/build/repository/AnonCredsKeyCorrectnessProofRecord.mjs +26 -0
- package/build/repository/AnonCredsKeyCorrectnessProofRecord.mjs.map +1 -0
- package/build/repository/AnonCredsKeyCorrectnessProofRepository.d.mts +12 -0
- package/build/repository/AnonCredsKeyCorrectnessProofRepository.d.mts.map +1 -0
- package/build/repository/AnonCredsKeyCorrectnessProofRepository.mjs +28 -0
- package/build/repository/AnonCredsKeyCorrectnessProofRepository.mjs.map +1 -0
- package/build/repository/AnonCredsLinkSecretRecord.d.mts +28 -0
- package/build/repository/AnonCredsLinkSecretRecord.d.mts.map +1 -0
- package/build/repository/AnonCredsLinkSecretRecord.mjs +25 -0
- package/build/repository/AnonCredsLinkSecretRecord.mjs.map +1 -0
- package/build/repository/AnonCredsLinkSecretRepository.d.mts +14 -0
- package/build/repository/AnonCredsLinkSecretRepository.d.mts.map +1 -0
- package/build/repository/AnonCredsLinkSecretRepository.mjs +34 -0
- package/build/repository/AnonCredsLinkSecretRepository.mjs.map +1 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.d.mts +37 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.d.mts.map +1 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.mjs +35 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.mjs.map +1 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.d.mts +13 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.d.mts.map +1 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.mjs +34 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.mjs.map +1 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.d.mts +30 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.d.mts.map +1 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.mjs +27 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.mjs.map +1 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.d.mts +13 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.d.mts.map +1 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.mjs +31 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.mjs.map +1 -0
- package/build/repository/AnonCredsSchemaRecord.d.mts +44 -0
- package/build/repository/AnonCredsSchemaRecord.d.mts.map +1 -0
- package/build/repository/AnonCredsSchemaRecord.mjs +38 -0
- package/build/repository/AnonCredsSchemaRecord.mjs.map +1 -0
- package/build/repository/AnonCredsSchemaRepository.d.mts +12 -0
- package/build/repository/AnonCredsSchemaRepository.d.mts.map +1 -0
- package/build/repository/AnonCredsSchemaRepository.mjs +28 -0
- package/build/repository/AnonCredsSchemaRepository.mjs.map +1 -0
- package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.d.mts +14 -0
- package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.d.mts.map +1 -0
- package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.mjs +10 -0
- package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.mjs.map +1 -0
- package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.d.mts +14 -0
- package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.d.mts.map +1 -0
- package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.mjs +10 -0
- package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.mjs.map +1 -0
- package/build/repository/anonCredsSchemaRecordMetadataTypes.d.mts +14 -0
- package/build/repository/anonCredsSchemaRecordMetadataTypes.d.mts.map +1 -0
- package/build/repository/index.d.mts +16 -0
- package/build/repository/index.mjs +16 -0
- package/build/services/AnonCredsHolderService.d.mts +28 -0
- package/build/services/AnonCredsHolderService.d.mts.map +1 -0
- package/build/services/AnonCredsHolderService.mjs +6 -0
- package/build/services/AnonCredsHolderService.mjs.map +1 -0
- package/build/services/AnonCredsHolderServiceOptions.d.mts +107 -0
- package/build/services/AnonCredsHolderServiceOptions.d.mts.map +1 -0
- package/build/services/AnonCredsIssuerService.d.mts +19 -0
- package/build/services/AnonCredsIssuerService.d.mts.map +1 -0
- package/build/services/AnonCredsIssuerService.mjs +6 -0
- package/build/services/AnonCredsIssuerService.mjs.map +1 -0
- package/build/services/AnonCredsIssuerServiceOptions.d.mts +66 -0
- package/build/services/AnonCredsIssuerServiceOptions.d.mts.map +1 -0
- package/build/services/AnonCredsVerifierService.d.mts +12 -0
- package/build/services/AnonCredsVerifierService.d.mts.map +1 -0
- package/build/services/AnonCredsVerifierService.mjs +6 -0
- package/build/services/AnonCredsVerifierService.mjs.map +1 -0
- package/build/services/AnonCredsVerifierServiceOptions.d.mts +30 -0
- package/build/services/AnonCredsVerifierServiceOptions.d.mts.map +1 -0
- package/build/services/index.d.mts +17 -0
- package/build/services/index.mjs +7 -0
- package/build/services/registry/AnonCredsRegistry.d.mts +43 -0
- package/build/services/registry/AnonCredsRegistry.d.mts.map +1 -0
- package/build/services/registry/AnonCredsRegistryService.d.mts +27 -0
- package/build/services/registry/AnonCredsRegistryService.d.mts.map +1 -0
- package/build/services/registry/AnonCredsRegistryService.mjs +226 -0
- package/build/services/registry/AnonCredsRegistryService.mjs.map +1 -0
- package/build/services/registry/CredentialDefinitionOptions.d.mts +39 -0
- package/build/services/registry/CredentialDefinitionOptions.d.mts.map +1 -0
- package/build/services/registry/RevocationRegistryDefinitionOptions.d.mts +39 -0
- package/build/services/registry/RevocationRegistryDefinitionOptions.d.mts.map +1 -0
- package/build/services/registry/RevocationStatusListOptions.d.mts +37 -0
- package/build/services/registry/RevocationStatusListOptions.d.mts.map +1 -0
- package/build/services/registry/SchemaOptions.d.mts +39 -0
- package/build/services/registry/SchemaOptions.d.mts.map +1 -0
- package/build/services/registry/base.d.mts +65 -0
- package/build/services/registry/base.d.mts.map +1 -0
- package/build/services/registry/index.d.mts +7 -0
- package/build/services/registry/index.mjs +1 -0
- package/build/services/tails/BasicTailsFileService.d.mts +29 -0
- package/build/services/tails/BasicTailsFileService.d.mts.map +1 -0
- package/build/services/tails/BasicTailsFileService.mjs +52 -0
- package/build/services/tails/BasicTailsFileService.mjs.map +1 -0
- package/build/services/tails/TailsFileService.d.mts +48 -0
- package/build/services/tails/TailsFileService.d.mts.map +1 -0
- package/build/services/tails/index.d.mts +2 -0
- package/build/services/tails/index.mjs +1 -0
- package/build/updates/0.3.1-0.4/credentialDefinition.mjs +49 -0
- package/build/updates/0.3.1-0.4/credentialDefinition.mjs.map +1 -0
- package/build/updates/0.3.1-0.4/credentialExchangeRecord.mjs +118 -0
- package/build/updates/0.3.1-0.4/credentialExchangeRecord.mjs.map +1 -0
- package/build/updates/0.3.1-0.4/index.d.mts +7 -0
- package/build/updates/0.3.1-0.4/index.d.mts.map +1 -0
- package/build/updates/0.3.1-0.4/index.mjs +16 -0
- package/build/updates/0.3.1-0.4/index.mjs.map +1 -0
- package/build/updates/0.3.1-0.4/linkSecret.mjs +21 -0
- package/build/updates/0.3.1-0.4/linkSecret.mjs.map +1 -0
- package/build/updates/0.3.1-0.4/schema.mjs +39 -0
- package/build/updates/0.3.1-0.4/schema.mjs.map +1 -0
- package/build/updates/0.4-0.5/anonCredsCredentialRecord.mjs +126 -0
- package/build/updates/0.4-0.5/anonCredsCredentialRecord.mjs.map +1 -0
- package/build/updates/0.4-0.5/index.d.mts +7 -0
- package/build/updates/0.4-0.5/index.d.mts.map +1 -0
- package/build/updates/0.4-0.5/index.mjs +10 -0
- package/build/updates/0.4-0.5/index.mjs.map +1 -0
- package/build/utils/anonCredsObjects.d.mts +27 -0
- package/build/utils/anonCredsObjects.d.mts.map +1 -0
- package/build/utils/anonCredsObjects.mjs +57 -0
- package/build/utils/anonCredsObjects.mjs.map +1 -0
- package/build/utils/areRequestsEqual.d.mts +1 -0
- package/build/utils/areRequestsEqual.mjs +86 -0
- package/build/utils/areRequestsEqual.mjs.map +1 -0
- package/build/utils/bytesToBigint.mjs +11 -0
- package/build/utils/bytesToBigint.mjs.map +1 -0
- package/build/utils/composeAutoAccept.d.mts +1 -0
- package/build/utils/composeAutoAccept.mjs +25 -0
- package/build/utils/composeAutoAccept.mjs.map +1 -0
- package/build/utils/createRequestFromPreview.d.mts +2 -0
- package/build/utils/createRequestFromPreview.mjs +50 -0
- package/build/utils/createRequestFromPreview.mjs.map +1 -0
- package/build/utils/credential.d.mts +12 -0
- package/build/utils/credential.d.mts.map +1 -0
- package/build/utils/credential.mjs +119 -0
- package/build/utils/credential.mjs.map +1 -0
- package/build/utils/credentialPreviewAttributes.d.mts +1 -0
- package/build/utils/credentialPreviewAttributes.mjs +21 -0
- package/build/utils/credentialPreviewAttributes.mjs.map +1 -0
- package/build/utils/getCredentialsForAnonCredsRequest.d.mts +11 -0
- package/build/utils/getCredentialsForAnonCredsRequest.d.mts.map +1 -0
- package/build/utils/getCredentialsForAnonCredsRequest.mjs +70 -0
- package/build/utils/getCredentialsForAnonCredsRequest.mjs.map +1 -0
- package/build/utils/getRevocationRegistries.d.mts +4 -0
- package/build/utils/getRevocationRegistries.mjs +121 -0
- package/build/utils/getRevocationRegistries.mjs.map +1 -0
- package/build/utils/hasDuplicateGroupNames.d.mts +1 -0
- package/build/utils/hasDuplicateGroupNames.mjs +22 -0
- package/build/utils/hasDuplicateGroupNames.mjs.map +1 -0
- package/build/utils/index.d.mts +17 -0
- package/build/utils/index.mjs +17 -0
- package/build/utils/indyIdentifiers.d.mts +71 -0
- package/build/utils/indyIdentifiers.d.mts.map +1 -0
- package/build/utils/indyIdentifiers.mjs +249 -0
- package/build/utils/indyIdentifiers.mjs.map +1 -0
- package/build/utils/isMap.d.mts +1 -0
- package/build/utils/isMap.mjs +19 -0
- package/build/utils/isMap.mjs.map +1 -0
- package/build/utils/linkSecret.d.mts +13 -0
- package/build/utils/linkSecret.d.mts.map +1 -0
- package/build/utils/linkSecret.mjs +35 -0
- package/build/utils/linkSecret.mjs.map +1 -0
- package/build/utils/metadata.d.mts +30 -0
- package/build/utils/metadata.d.mts.map +1 -0
- package/build/utils/metadata.mjs +23 -0
- package/build/utils/metadata.mjs.map +1 -0
- package/build/utils/proofRequest.mjs +10 -0
- package/build/utils/proofRequest.mjs.map +1 -0
- package/build/utils/proverDid.d.mts +12 -0
- package/build/utils/proverDid.d.mts.map +1 -0
- package/build/utils/proverDid.mjs +17 -0
- package/build/utils/proverDid.mjs.map +1 -0
- package/build/utils/revocationInterval.d.mts +12 -0
- package/build/utils/revocationInterval.d.mts.map +1 -0
- package/build/utils/revocationInterval.mjs +11 -0
- package/build/utils/revocationInterval.mjs.map +1 -0
- package/build/utils/sortRequestedCredentialsMatches.d.mts +1 -0
- package/build/utils/sortRequestedCredentialsMatches.mjs +22 -0
- package/build/utils/sortRequestedCredentialsMatches.mjs.map +1 -0
- package/build/utils/timestamp.d.mts +5 -0
- package/build/utils/timestamp.d.mts.map +1 -0
- package/build/utils/timestamp.mjs +6 -0
- package/build/utils/timestamp.mjs.map +1 -0
- package/build/utils/w3cAnonCredsUtils.d.mts +28 -0
- package/build/utils/w3cAnonCredsUtils.d.mts.map +1 -0
- package/build/utils/w3cAnonCredsUtils.mjs +101 -0
- package/build/utils/w3cAnonCredsUtils.mjs.map +1 -0
- package/package.json +20 -21
- package/build/AnonCredsApi.d.ts +0 -97
- package/build/AnonCredsApi.js +0 -582
- package/build/AnonCredsApi.js.map +0 -1
- package/build/AnonCredsApiOptions.d.ts +0 -24
- package/build/AnonCredsApiOptions.js +0 -3
- package/build/AnonCredsApiOptions.js.map +0 -1
- package/build/AnonCredsModule.d.ts +0 -24
- package/build/AnonCredsModule.js +0 -56
- package/build/AnonCredsModule.js.map +0 -1
- package/build/AnonCredsModuleConfig.d.ts +0 -72
- package/build/AnonCredsModuleConfig.js +0 -31
- package/build/AnonCredsModuleConfig.js.map +0 -1
- package/build/anoncreds-rs/AnonCredsDataIntegrityService.d.ts +0 -27
- package/build/anoncreds-rs/AnonCredsDataIntegrityService.js +0 -241
- package/build/anoncreds-rs/AnonCredsDataIntegrityService.js.map +0 -1
- package/build/anoncreds-rs/AnonCredsRsHolderService.d.ts +0 -38
- package/build/anoncreds-rs/AnonCredsRsHolderService.js +0 -622
- package/build/anoncreds-rs/AnonCredsRsHolderService.js.map +0 -1
- package/build/anoncreds-rs/AnonCredsRsIssuerService.d.ts +0 -12
- package/build/anoncreds-rs/AnonCredsRsIssuerService.js +0 -253
- package/build/anoncreds-rs/AnonCredsRsIssuerService.js.map +0 -1
- package/build/anoncreds-rs/AnonCredsRsVerifierService.d.ts +0 -8
- package/build/anoncreds-rs/AnonCredsRsVerifierService.js +0 -157
- package/build/anoncreds-rs/AnonCredsRsVerifierService.js.map +0 -1
- package/build/anoncreds-rs/index.d.ts +0 -3
- package/build/anoncreds-rs/index.js +0 -10
- package/build/anoncreds-rs/index.js.map +0 -1
- package/build/anoncreds-rs/utils.d.ts +0 -23
- package/build/anoncreds-rs/utils.js +0 -71
- package/build/anoncreds-rs/utils.js.map +0 -1
- package/build/error/AnonCredsError.d.ts +0 -6
- package/build/error/AnonCredsError.js +0 -11
- package/build/error/AnonCredsError.js.map +0 -1
- package/build/error/AnonCredsRsError.d.ts +0 -6
- package/build/error/AnonCredsRsError.js +0 -11
- package/build/error/AnonCredsRsError.js.map +0 -1
- package/build/error/AnonCredsStoreRecordError.d.ts +0 -6
- package/build/error/AnonCredsStoreRecordError.js +0 -11
- package/build/error/AnonCredsStoreRecordError.js.map +0 -1
- package/build/error/index.d.ts +0 -3
- package/build/error/index.js +0 -20
- package/build/error/index.js.map +0 -1
- package/build/formats/AnonCredsCredentialFormat.d.ts +0 -79
- package/build/formats/AnonCredsCredentialFormat.js +0 -3
- package/build/formats/AnonCredsCredentialFormat.js.map +0 -1
- package/build/formats/AnonCredsCredentialFormatService.d.ts +0 -80
- package/build/formats/AnonCredsCredentialFormatService.js +0 -433
- package/build/formats/AnonCredsCredentialFormatService.js.map +0 -1
- package/build/formats/AnonCredsProofFormat.d.ts +0 -70
- package/build/formats/AnonCredsProofFormat.js +0 -3
- package/build/formats/AnonCredsProofFormat.js.map +0 -1
- package/build/formats/AnonCredsProofFormatService.d.ts +0 -55
- package/build/formats/AnonCredsProofFormatService.js +0 -289
- package/build/formats/AnonCredsProofFormatService.js.map +0 -1
- package/build/formats/DataIntegrityCredentialFormatService.d.ts +0 -89
- package/build/formats/DataIntegrityCredentialFormatService.js +0 -773
- package/build/formats/DataIntegrityCredentialFormatService.js.map +0 -1
- package/build/formats/LegacyIndyCredentialFormat.d.ts +0 -32
- package/build/formats/LegacyIndyCredentialFormat.js +0 -3
- package/build/formats/LegacyIndyCredentialFormat.js.map +0 -1
- package/build/formats/LegacyIndyCredentialFormatService.d.ts +0 -80
- package/build/formats/LegacyIndyCredentialFormatService.js +0 -379
- package/build/formats/LegacyIndyCredentialFormatService.js.map +0 -1
- package/build/formats/LegacyIndyProofFormat.d.ts +0 -29
- package/build/formats/LegacyIndyProofFormat.js +0 -3
- package/build/formats/LegacyIndyProofFormat.js.map +0 -1
- package/build/formats/LegacyIndyProofFormatService.d.ts +0 -58
- package/build/formats/LegacyIndyProofFormatService.js +0 -374
- package/build/formats/LegacyIndyProofFormatService.js.map +0 -1
- package/build/formats/index.d.ts +0 -9
- package/build/formats/index.js +0 -32
- package/build/formats/index.js.map +0 -1
- package/build/index.d.ts +0 -21
- package/build/index.js +0 -54
- package/build/index.js.map +0 -1
- package/build/models/AnonCredsCredentialProposal.d.ts +0 -62
- package/build/models/AnonCredsCredentialProposal.js +0 -81
- package/build/models/AnonCredsCredentialProposal.js.map +0 -1
- package/build/models/AnonCredsProofRequest.d.ts +0 -27
- package/build/models/AnonCredsProofRequest.js +0 -82
- package/build/models/AnonCredsProofRequest.js.map +0 -1
- package/build/models/AnonCredsRequestedAttribute.d.ts +0 -16
- package/build/models/AnonCredsRequestedAttribute.js +0 -56
- package/build/models/AnonCredsRequestedAttribute.js.map +0 -1
- package/build/models/AnonCredsRequestedPredicate.d.ts +0 -19
- package/build/models/AnonCredsRequestedPredicate.js +0 -61
- package/build/models/AnonCredsRequestedPredicate.js.map +0 -1
- package/build/models/AnonCredsRestriction.d.ts +0 -55
- package/build/models/AnonCredsRestriction.js +0 -160
- package/build/models/AnonCredsRestriction.js.map +0 -1
- package/build/models/AnonCredsRestrictionWrapper.d.ts +0 -4
- package/build/models/AnonCredsRestrictionWrapper.js +0 -25
- package/build/models/AnonCredsRestrictionWrapper.js.map +0 -1
- package/build/models/AnonCredsRevocationInterval.d.ts +0 -5
- package/build/models/AnonCredsRevocationInterval.js +0 -33
- package/build/models/AnonCredsRevocationInterval.js.map +0 -1
- package/build/models/exchange.d.ts +0 -99
- package/build/models/exchange.js +0 -5
- package/build/models/exchange.js.map +0 -1
- package/build/models/index.d.ts +0 -4
- package/build/models/index.js +0 -21
- package/build/models/index.js.map +0 -1
- package/build/models/internal.d.ts +0 -35
- package/build/models/internal.js +0 -3
- package/build/models/internal.js.map +0 -1
- package/build/models/registry.d.ts +0 -39
- package/build/models/registry.js +0 -3
- package/build/models/registry.js.map +0 -1
- package/build/models/utils.d.ts +0 -22
- package/build/models/utils.js +0 -3
- package/build/models/utils.js.map +0 -1
- package/build/protocols/credentials/v1/V1CredentialProtocol.d.ts +0 -162
- package/build/protocols/credentials/v1/V1CredentialProtocol.js +0 -948
- package/build/protocols/credentials/v1/V1CredentialProtocol.js.map +0 -1
- package/build/protocols/credentials/v1/errors/V1CredentialProblemReportError.d.ts +0 -10
- package/build/protocols/credentials/v1/errors/V1CredentialProblemReportError.js +0 -18
- package/build/protocols/credentials/v1/errors/V1CredentialProblemReportError.js.map +0 -1
- package/build/protocols/credentials/v1/errors/index.d.ts +0 -1
- package/build/protocols/credentials/v1/errors/index.js +0 -6
- package/build/protocols/credentials/v1/errors/index.js.map +0 -1
- package/build/protocols/credentials/v1/handlers/V1CredentialAckHandler.d.ts +0 -9
- package/build/protocols/credentials/v1/handlers/V1CredentialAckHandler.js +0 -15
- package/build/protocols/credentials/v1/handlers/V1CredentialAckHandler.js.map +0 -1
- package/build/protocols/credentials/v1/handlers/V1CredentialProblemReportHandler.d.ts +0 -9
- package/build/protocols/credentials/v1/handlers/V1CredentialProblemReportHandler.js +0 -15
- package/build/protocols/credentials/v1/handlers/V1CredentialProblemReportHandler.js.map +0 -1
- package/build/protocols/credentials/v1/handlers/V1IssueCredentialHandler.d.ts +0 -10
- package/build/protocols/credentials/v1/handlers/V1IssueCredentialHandler.js +0 -40
- package/build/protocols/credentials/v1/handlers/V1IssueCredentialHandler.js.map +0 -1
- package/build/protocols/credentials/v1/handlers/V1OfferCredentialHandler.d.ts +0 -10
- package/build/protocols/credentials/v1/handlers/V1OfferCredentialHandler.js +0 -33
- package/build/protocols/credentials/v1/handlers/V1OfferCredentialHandler.js.map +0 -1
- package/build/protocols/credentials/v1/handlers/V1ProposeCredentialHandler.d.ts +0 -10
- package/build/protocols/credentials/v1/handlers/V1ProposeCredentialHandler.js +0 -38
- package/build/protocols/credentials/v1/handlers/V1ProposeCredentialHandler.js.map +0 -1
- package/build/protocols/credentials/v1/handlers/V1RequestCredentialHandler.d.ts +0 -10
- package/build/protocols/credentials/v1/handlers/V1RequestCredentialHandler.js +0 -40
- package/build/protocols/credentials/v1/handlers/V1RequestCredentialHandler.js.map +0 -1
- package/build/protocols/credentials/v1/handlers/index.d.ts +0 -6
- package/build/protocols/credentials/v1/handlers/index.js +0 -23
- package/build/protocols/credentials/v1/handlers/index.js.map +0 -1
- package/build/protocols/credentials/v1/index.d.ts +0 -2
- package/build/protocols/credentials/v1/index.js +0 -19
- package/build/protocols/credentials/v1/index.js.map +0 -1
- package/build/protocols/credentials/v1/messages/V1CredentialAckMessage.d.ts +0 -16
- package/build/protocols/credentials/v1/messages/V1CredentialAckMessage.js +0 -34
- package/build/protocols/credentials/v1/messages/V1CredentialAckMessage.js.map +0 -1
- package/build/protocols/credentials/v1/messages/V1CredentialPreview.d.ts +0 -26
- package/build/protocols/credentials/v1/messages/V1CredentialPreview.js +0 -69
- package/build/protocols/credentials/v1/messages/V1CredentialPreview.js.map +0 -1
- package/build/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.d.ts +0 -16
- package/build/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.js +0 -34
- package/build/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.js.map +0 -1
- package/build/protocols/credentials/v1/messages/V1IssueCredentialMessage.d.ts +0 -19
- package/build/protocols/credentials/v1/messages/V1IssueCredentialMessage.js +0 -62
- package/build/protocols/credentials/v1/messages/V1IssueCredentialMessage.js.map +0 -1
- package/build/protocols/credentials/v1/messages/V1OfferCredentialMessage.d.ts +0 -27
- package/build/protocols/credentials/v1/messages/V1OfferCredentialMessage.js +0 -75
- package/build/protocols/credentials/v1/messages/V1OfferCredentialMessage.js.map +0 -1
- package/build/protocols/credentials/v1/messages/V1ProposeCredentialMessage.d.ts +0 -59
- package/build/protocols/credentials/v1/messages/V1ProposeCredentialMessage.js +0 -109
- package/build/protocols/credentials/v1/messages/V1ProposeCredentialMessage.js.map +0 -1
- package/build/protocols/credentials/v1/messages/V1RequestCredentialMessage.d.ts +0 -19
- package/build/protocols/credentials/v1/messages/V1RequestCredentialMessage.js +0 -61
- package/build/protocols/credentials/v1/messages/V1RequestCredentialMessage.js.map +0 -1
- package/build/protocols/credentials/v1/messages/index.d.ts +0 -7
- package/build/protocols/credentials/v1/messages/index.js +0 -24
- package/build/protocols/credentials/v1/messages/index.js.map +0 -1
- package/build/protocols/index.d.ts +0 -2
- package/build/protocols/index.js +0 -19
- package/build/protocols/index.js.map +0 -1
- package/build/protocols/proofs/v1/V1ProofProtocol.d.ts +0 -50
- package/build/protocols/proofs/v1/V1ProofProtocol.js +0 -864
- package/build/protocols/proofs/v1/V1ProofProtocol.js.map +0 -1
- package/build/protocols/proofs/v1/errors/V1PresentationProblemReportError.d.ts +0 -12
- package/build/protocols/proofs/v1/errors/V1PresentationProblemReportError.js +0 -19
- package/build/protocols/proofs/v1/errors/V1PresentationProblemReportError.js.map +0 -1
- package/build/protocols/proofs/v1/errors/index.d.ts +0 -1
- package/build/protocols/proofs/v1/errors/index.js +0 -18
- package/build/protocols/proofs/v1/errors/index.js.map +0 -1
- package/build/protocols/proofs/v1/handlers/V1PresentationAckHandler.d.ts +0 -9
- package/build/protocols/proofs/v1/handlers/V1PresentationAckHandler.js +0 -15
- package/build/protocols/proofs/v1/handlers/V1PresentationAckHandler.js.map +0 -1
- package/build/protocols/proofs/v1/handlers/V1PresentationHandler.d.ts +0 -10
- package/build/protocols/proofs/v1/handlers/V1PresentationHandler.js +0 -40
- package/build/protocols/proofs/v1/handlers/V1PresentationHandler.js.map +0 -1
- package/build/protocols/proofs/v1/handlers/V1PresentationProblemReportHandler.d.ts +0 -9
- package/build/protocols/proofs/v1/handlers/V1PresentationProblemReportHandler.js +0 -15
- package/build/protocols/proofs/v1/handlers/V1PresentationProblemReportHandler.js.map +0 -1
- package/build/protocols/proofs/v1/handlers/V1ProposePresentationHandler.d.ts +0 -11
- package/build/protocols/proofs/v1/handlers/V1ProposePresentationHandler.js +0 -38
- package/build/protocols/proofs/v1/handlers/V1ProposePresentationHandler.js.map +0 -1
- package/build/protocols/proofs/v1/handlers/V1RequestPresentationHandler.d.ts +0 -10
- package/build/protocols/proofs/v1/handlers/V1RequestPresentationHandler.js +0 -35
- package/build/protocols/proofs/v1/handlers/V1RequestPresentationHandler.js.map +0 -1
- package/build/protocols/proofs/v1/handlers/index.d.ts +0 -5
- package/build/protocols/proofs/v1/handlers/index.js +0 -22
- package/build/protocols/proofs/v1/handlers/index.js.map +0 -1
- package/build/protocols/proofs/v1/index.d.ts +0 -4
- package/build/protocols/proofs/v1/index.js +0 -21
- package/build/protocols/proofs/v1/index.js.map +0 -1
- package/build/protocols/proofs/v1/messages/V1PresentationAckMessage.d.ts +0 -8
- package/build/protocols/proofs/v1/messages/V1PresentationAckMessage.js +0 -27
- package/build/protocols/proofs/v1/messages/V1PresentationAckMessage.js.map +0 -1
- package/build/protocols/proofs/v1/messages/V1PresentationMessage.d.ts +0 -31
- package/build/protocols/proofs/v1/messages/V1PresentationMessage.js +0 -67
- package/build/protocols/proofs/v1/messages/V1PresentationMessage.js.map +0 -1
- package/build/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.d.ts +0 -16
- package/build/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.js +0 -34
- package/build/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.js.map +0 -1
- package/build/protocols/proofs/v1/messages/V1ProposePresentationMessage.d.ts +0 -26
- package/build/protocols/proofs/v1/messages/V1ProposePresentationMessage.js +0 -53
- package/build/protocols/proofs/v1/messages/V1ProposePresentationMessage.js.map +0 -1
- package/build/protocols/proofs/v1/messages/V1RequestPresentationMessage.d.ts +0 -29
- package/build/protocols/proofs/v1/messages/V1RequestPresentationMessage.js +0 -65
- package/build/protocols/proofs/v1/messages/V1RequestPresentationMessage.js.map +0 -1
- package/build/protocols/proofs/v1/messages/index.d.ts +0 -5
- package/build/protocols/proofs/v1/messages/index.js +0 -22
- package/build/protocols/proofs/v1/messages/index.js.map +0 -1
- package/build/protocols/proofs/v1/models/V1PresentationPreview.d.ts +0 -50
- package/build/protocols/proofs/v1/models/V1PresentationPreview.js +0 -130
- package/build/protocols/proofs/v1/models/V1PresentationPreview.js.map +0 -1
- package/build/protocols/proofs/v1/models/index.d.ts +0 -1
- package/build/protocols/proofs/v1/models/index.js +0 -18
- package/build/protocols/proofs/v1/models/index.js.map +0 -1
- package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.d.ts +0 -21
- package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.js +0 -23
- package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.js.map +0 -1
- package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.d.ts +0 -8
- package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.js +0 -35
- package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.js.map +0 -1
- package/build/repository/AnonCredsCredentialDefinitionRecord.d.ts +0 -39
- package/build/repository/AnonCredsCredentialDefinitionRecord.js +0 -30
- package/build/repository/AnonCredsCredentialDefinitionRecord.js.map +0 -1
- package/build/repository/AnonCredsCredentialDefinitionRepository.d.ts +0 -8
- package/build/repository/AnonCredsCredentialDefinitionRepository.js +0 -53
- package/build/repository/AnonCredsCredentialDefinitionRepository.js.map +0 -1
- package/build/repository/AnonCredsCredentialRecord.d.ts +0 -48
- package/build/repository/AnonCredsCredentialRecord.js +0 -37
- package/build/repository/AnonCredsCredentialRecord.js.map +0 -1
- package/build/repository/AnonCredsCredentialRepository.d.ts +0 -10
- package/build/repository/AnonCredsCredentialRepository.js +0 -41
- package/build/repository/AnonCredsCredentialRepository.js.map +0 -1
- package/build/repository/AnonCredsKeyCorrectnessProofRecord.d.ts +0 -21
- package/build/repository/AnonCredsKeyCorrectnessProofRecord.js +0 -23
- package/build/repository/AnonCredsKeyCorrectnessProofRecord.js.map +0 -1
- package/build/repository/AnonCredsKeyCorrectnessProofRepository.d.ts +0 -8
- package/build/repository/AnonCredsKeyCorrectnessProofRepository.js +0 -35
- package/build/repository/AnonCredsKeyCorrectnessProofRepository.js.map +0 -1
- package/build/repository/AnonCredsLinkSecretRecord.d.ts +0 -23
- package/build/repository/AnonCredsLinkSecretRecord.js +0 -22
- package/build/repository/AnonCredsLinkSecretRecord.js.map +0 -1
- package/build/repository/AnonCredsLinkSecretRepository.d.ts +0 -10
- package/build/repository/AnonCredsLinkSecretRepository.js +0 -41
- package/build/repository/AnonCredsLinkSecretRepository.js.map +0 -1
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.d.ts +0 -34
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.js +0 -30
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.js.map +0 -1
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.d.ts +0 -10
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.js +0 -38
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.js.map +0 -1
- package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.d.ts +0 -25
- package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.js +0 -23
- package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.js.map +0 -1
- package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.d.ts +0 -9
- package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.js +0 -38
- package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.js.map +0 -1
- package/build/repository/AnonCredsSchemaRecord.d.ts +0 -39
- package/build/repository/AnonCredsSchemaRecord.js +0 -30
- package/build/repository/AnonCredsSchemaRecord.js.map +0 -1
- package/build/repository/AnonCredsSchemaRepository.d.ts +0 -8
- package/build/repository/AnonCredsSchemaRepository.js +0 -53
- package/build/repository/AnonCredsSchemaRepository.js.map +0 -1
- package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.d.ts +0 -9
- package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.js +0 -9
- package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.js.map +0 -1
- package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.d.ts +0 -9
- package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.js +0 -9
- package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.js.map +0 -1
- package/build/repository/anonCredsSchemaRecordMetadataTypes.d.ts +0 -9
- package/build/repository/anonCredsSchemaRecordMetadataTypes.js +0 -9
- package/build/repository/anonCredsSchemaRecordMetadataTypes.js.map +0 -1
- package/build/repository/index.d.ts +0 -16
- package/build/repository/index.js +0 -33
- package/build/repository/index.js.map +0 -1
- package/build/services/AnonCredsHolderService.d.ts +0 -18
- package/build/services/AnonCredsHolderService.js +0 -5
- package/build/services/AnonCredsHolderService.js.map +0 -1
- package/build/services/AnonCredsHolderServiceOptions.d.ts +0 -101
- package/build/services/AnonCredsHolderServiceOptions.js +0 -3
- package/build/services/AnonCredsHolderServiceOptions.js.map +0 -1
- package/build/services/AnonCredsIssuerService.d.ts +0 -14
- package/build/services/AnonCredsIssuerService.js +0 -5
- package/build/services/AnonCredsIssuerService.js.map +0 -1
- package/build/services/AnonCredsIssuerServiceOptions.d.ts +0 -61
- package/build/services/AnonCredsIssuerServiceOptions.js +0 -3
- package/build/services/AnonCredsIssuerServiceOptions.js.map +0 -1
- package/build/services/AnonCredsVerifierService.d.ts +0 -7
- package/build/services/AnonCredsVerifierService.js +0 -5
- package/build/services/AnonCredsVerifierService.js.map +0 -1
- package/build/services/AnonCredsVerifierServiceOptions.d.ts +0 -25
- package/build/services/AnonCredsVerifierServiceOptions.js +0 -3
- package/build/services/AnonCredsVerifierServiceOptions.js.map +0 -1
- package/build/services/index.d.ts +0 -8
- package/build/services/index.js +0 -27
- package/build/services/index.js.map +0 -1
- package/build/services/registry/AnonCredsRegistry.d.ts +0 -25
- package/build/services/registry/AnonCredsRegistry.js +0 -3
- package/build/services/registry/AnonCredsRegistry.js.map +0 -1
- package/build/services/registry/AnonCredsRegistryService.d.ts +0 -10
- package/build/services/registry/AnonCredsRegistryService.js +0 -33
- package/build/services/registry/AnonCredsRegistryService.js.map +0 -1
- package/build/services/registry/CredentialDefinitionOptions.d.ts +0 -34
- package/build/services/registry/CredentialDefinitionOptions.js +0 -3
- package/build/services/registry/CredentialDefinitionOptions.js.map +0 -1
- package/build/services/registry/RevocationRegistryDefinitionOptions.d.ts +0 -34
- package/build/services/registry/RevocationRegistryDefinitionOptions.js +0 -3
- package/build/services/registry/RevocationRegistryDefinitionOptions.js.map +0 -1
- package/build/services/registry/RevocationStatusListOptions.d.ts +0 -32
- package/build/services/registry/RevocationStatusListOptions.js +0 -3
- package/build/services/registry/RevocationStatusListOptions.js.map +0 -1
- package/build/services/registry/SchemaOptions.d.ts +0 -34
- package/build/services/registry/SchemaOptions.js +0 -3
- package/build/services/registry/SchemaOptions.js.map +0 -1
- package/build/services/registry/base.d.ts +0 -19
- package/build/services/registry/base.js +0 -3
- package/build/services/registry/base.js.map +0 -1
- package/build/services/registry/index.d.ts +0 -7
- package/build/services/registry/index.js +0 -23
- package/build/services/registry/index.js.map +0 -1
- package/build/services/tails/BasicTailsFileService.d.ts +0 -23
- package/build/services/tails/BasicTailsFileService.js +0 -65
- package/build/services/tails/BasicTailsFileService.js.map +0 -1
- package/build/services/tails/TailsFileService.d.ts +0 -42
- package/build/services/tails/TailsFileService.js +0 -3
- package/build/services/tails/TailsFileService.js.map +0 -1
- package/build/services/tails/index.d.ts +0 -2
- package/build/services/tails/index.js +0 -19
- package/build/services/tails/index.js.map +0 -1
- package/build/updates/0.3.1-0.4/credentialDefinition.d.ts +0 -18
- package/build/updates/0.3.1-0.4/credentialDefinition.js +0 -56
- package/build/updates/0.3.1-0.4/credentialDefinition.js.map +0 -1
- package/build/updates/0.3.1-0.4/credentialExchangeRecord.d.ts +0 -69
- package/build/updates/0.3.1-0.4/credentialExchangeRecord.js +0 -121
- package/build/updates/0.3.1-0.4/credentialExchangeRecord.js.map +0 -1
- package/build/updates/0.3.1-0.4/index.d.ts +0 -2
- package/build/updates/0.3.1-0.4/index.js +0 -14
- package/build/updates/0.3.1-0.4/index.js.map +0 -1
- package/build/updates/0.3.1-0.4/linkSecret.d.ts +0 -6
- package/build/updates/0.3.1-0.4/linkSecret.js +0 -35
- package/build/updates/0.3.1-0.4/linkSecret.js.map +0 -1
- package/build/updates/0.3.1-0.4/schema.d.ts +0 -15
- package/build/updates/0.3.1-0.4/schema.js +0 -41
- package/build/updates/0.3.1-0.4/schema.js.map +0 -1
- package/build/updates/0.4-0.5/anonCredsCredentialRecord.d.ts +0 -5
- package/build/updates/0.4-0.5/anonCredsCredentialRecord.js +0 -149
- package/build/updates/0.4-0.5/anonCredsCredentialRecord.js.map +0 -1
- package/build/updates/0.4-0.5/index.d.ts +0 -2
- package/build/updates/0.4-0.5/index.js +0 -8
- package/build/updates/0.4-0.5/index.js.map +0 -1
- package/build/utils/anonCredsObjects.d.ts +0 -26
- package/build/utils/anonCredsObjects.js +0 -81
- package/build/utils/anonCredsObjects.js.map +0 -1
- package/build/utils/areRequestsEqual.d.ts +0 -6
- package/build/utils/areRequestsEqual.js +0 -135
- package/build/utils/areRequestsEqual.js.map +0 -1
- package/build/utils/composeAutoAccept.d.ts +0 -15
- package/build/utils/composeAutoAccept.js +0 -26
- package/build/utils/composeAutoAccept.js.map +0 -1
- package/build/utils/createRequestFromPreview.d.ts +0 -10
- package/build/utils/createRequestFromPreview.js +0 -71
- package/build/utils/createRequestFromPreview.js.map +0 -1
- package/build/utils/credential.d.ts +0 -68
- package/build/utils/credential.js +0 -188
- package/build/utils/credential.js.map +0 -1
- package/build/utils/credentialPreviewAttributes.d.ts +0 -2
- package/build/utils/credentialPreviewAttributes.js +0 -24
- package/build/utils/credentialPreviewAttributes.js.map +0 -1
- package/build/utils/getCredentialsForAnonCredsRequest.d.ts +0 -4
- package/build/utils/getCredentialsForAnonCredsRequest.js +0 -81
- package/build/utils/getCredentialsForAnonCredsRequest.js.map +0 -1
- package/build/utils/getRevocationRegistries.d.ts +0 -14
- package/build/utils/getRevocationRegistries.js +0 -151
- package/build/utils/getRevocationRegistries.js.map +0 -1
- package/build/utils/hasDuplicateGroupNames.d.ts +0 -2
- package/build/utils/hasDuplicateGroupNames.js +0 -22
- package/build/utils/hasDuplicateGroupNames.js.map +0 -1
- package/build/utils/index.d.ts +0 -17
- package/build/utils/index.js +0 -48
- package/build/utils/index.js.map +0 -1
- package/build/utils/indyIdentifiers.d.ts +0 -66
- package/build/utils/indyIdentifiers.js +0 -298
- package/build/utils/indyIdentifiers.js.map +0 -1
- package/build/utils/isMap.d.ts +0 -5
- package/build/utils/isMap.js +0 -17
- package/build/utils/isMap.js.map +0 -1
- package/build/utils/linkSecret.d.ts +0 -9
- package/build/utils/linkSecret.js +0 -43
- package/build/utils/linkSecret.js.map +0 -1
- package/build/utils/metadata.d.ts +0 -35
- package/build/utils/metadata.js +0 -24
- package/build/utils/metadata.js.map +0 -1
- package/build/utils/proofRequest.d.ts +0 -2
- package/build/utils/proofRequest.js +0 -21
- package/build/utils/proofRequest.js.map +0 -1
- package/build/utils/proverDid.d.ts +0 -8
- package/build/utils/proverDid.js +0 -15
- package/build/utils/proverDid.js.map +0 -1
- package/build/utils/revocationInterval.d.ts +0 -7
- package/build/utils/revocationInterval.js +0 -14
- package/build/utils/revocationInterval.js.map +0 -1
- package/build/utils/sortRequestedCredentialsMatches.d.ts +0 -8
- package/build/utils/sortRequestedCredentialsMatches.js +0 -31
- package/build/utils/sortRequestedCredentialsMatches.js.map +0 -1
- package/build/utils/timestamp.d.ts +0 -1
- package/build/utils/timestamp.js +0 -7
- package/build/utils/timestamp.js.map +0 -1
- package/build/utils/w3cAnonCredsUtils.d.ts +0 -37
- package/build/utils/w3cAnonCredsUtils.js +0 -132
- package/build/utils/w3cAnonCredsUtils.js.map +0 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { DidCommCredentialExchangeRepository } from "@credo-ts/didcomm";
|
|
2
|
+
|
|
3
|
+
//#region src/updates/0.3.1-0.4/credentialExchangeRecord.ts
|
|
4
|
+
/**
|
|
5
|
+
* Migrates the {@link DidCommCredentialExchangeRecord} to 0.4 compatible format. It fetches all credential exchange records from
|
|
6
|
+
* storage and applies the needed updates to the records. After a record has been transformed, it is updated
|
|
7
|
+
* in storage and the next record will be transformed.
|
|
8
|
+
*
|
|
9
|
+
* The following transformations are applied:
|
|
10
|
+
* - {@link migrateIndyCredentialMetadataToAnonCredsMetadata}
|
|
11
|
+
* - {@link migrateIndyCredentialTypeToAnonCredsCredential}
|
|
12
|
+
*/
|
|
13
|
+
async function migrateCredentialExchangeRecordToV0_4(agent) {
|
|
14
|
+
agent.config.logger.info("Migrating credential exchange records to storage version 0.4");
|
|
15
|
+
const credentialRepository = agent.dependencyManager.resolve(DidCommCredentialExchangeRepository);
|
|
16
|
+
agent.config.logger.debug("Fetching all credential records from storage");
|
|
17
|
+
const credentialRecords = await credentialRepository.getAll(agent.context);
|
|
18
|
+
agent.config.logger.debug(`Found a total of ${credentialRecords.length} credential exchange records to update.`);
|
|
19
|
+
for (const credentialRecord of credentialRecords) {
|
|
20
|
+
agent.config.logger.debug(`Migrating credential exchange record with id ${credentialRecord.id} to storage version 0.4`);
|
|
21
|
+
migrateIndyCredentialTypeToAnonCredsCredential(agent, credentialRecord);
|
|
22
|
+
migrateIndyCredentialMetadataToAnonCredsMetadata(agent, credentialRecord);
|
|
23
|
+
await credentialRepository.update(agent.context, credentialRecord);
|
|
24
|
+
agent.config.logger.debug(`Successfully migrated credential exchange record with id ${credentialRecord.id} to storage version 0.4`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Migrates the indy credential record binding to anoncreds credential record binding.
|
|
29
|
+
*
|
|
30
|
+
* The following 0.3.1 credential record structure (unrelated keys omitted):
|
|
31
|
+
*
|
|
32
|
+
* ```json
|
|
33
|
+
* {
|
|
34
|
+
* "credentials": [
|
|
35
|
+
* {
|
|
36
|
+
* "credentialRecordId": "credential-id",
|
|
37
|
+
* "credentialRecordType": "indy"
|
|
38
|
+
* },
|
|
39
|
+
* {
|
|
40
|
+
* "credentialRecordId": "credential-id2",
|
|
41
|
+
* "credentialRecordType": "jsonld"
|
|
42
|
+
* }
|
|
43
|
+
* ]
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* Wil be tranformed into the following 0.4 credential record structure (unrelated keys omitted):
|
|
48
|
+
* ```json
|
|
49
|
+
* {
|
|
50
|
+
* "credentials": [
|
|
51
|
+
* {
|
|
52
|
+
* "credentialRecordId": "credential-id",
|
|
53
|
+
* "credentialRecordType": "anoncreds"
|
|
54
|
+
* },
|
|
55
|
+
* {
|
|
56
|
+
* "credentialRecordId": "credential-id2",
|
|
57
|
+
* "credentialRecordType": "jsonld"
|
|
58
|
+
* }
|
|
59
|
+
* ]
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
function migrateIndyCredentialTypeToAnonCredsCredential(agent, credentialRecord) {
|
|
64
|
+
agent.config.logger.debug(`Migrating credential record with id ${credentialRecord.id} to anoncreds credential binding for version 0.4`);
|
|
65
|
+
const INDY_CREDENTIAL_RECORD_TYPE = "indy";
|
|
66
|
+
const ANONCREDS_CREDENTIAL_RECORD_TYPE = "anoncreds";
|
|
67
|
+
for (const credential of credentialRecord.credentials) if (credential.credentialRecordType === INDY_CREDENTIAL_RECORD_TYPE) {
|
|
68
|
+
agent.config.logger.debug(`Updating credential binding ${credential.credentialRecordId} to anoncreds type`);
|
|
69
|
+
credential.credentialRecordType = ANONCREDS_CREDENTIAL_RECORD_TYPE;
|
|
70
|
+
}
|
|
71
|
+
agent.config.logger.debug(`Successfully migrated credential record with id ${credentialRecord.id} to anoncreds credential binding for version 0.4`);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Migrates the indy credential metadata type to anoncreds credential metadata type.
|
|
75
|
+
*
|
|
76
|
+
* The following 0.3.1 credential metadata structure (unrelated keys omitted):
|
|
77
|
+
*
|
|
78
|
+
* ```json
|
|
79
|
+
* {
|
|
80
|
+
* "_internal/indyRequest": {}
|
|
81
|
+
* "_internal/indyCredential": {}
|
|
82
|
+
* }
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* Wil be tranformed into the following 0.4 credential metadata structure (unrelated keys omitted):
|
|
86
|
+
* ```json
|
|
87
|
+
* {
|
|
88
|
+
* "_anoncreds/credentialRequest": {}
|
|
89
|
+
* "_anoncreds/credential": {}
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
function migrateIndyCredentialMetadataToAnonCredsMetadata(agent, credentialRecord) {
|
|
94
|
+
agent.config.logger.debug(`Migrating credential record with id ${credentialRecord.id} to anoncreds metadata for version 0.4`);
|
|
95
|
+
const indyCredentialRequestMetadataKey = "_internal/indyRequest";
|
|
96
|
+
const indyCredentialMetadataKey = "_internal/indyCredential";
|
|
97
|
+
const ANONCREDS_CREDENTIAL_REQUEST_METADATA = "_anoncreds/credentialRequest";
|
|
98
|
+
const ANONCREDS_CREDENTIAL_METADATA = "_anoncreds/credential";
|
|
99
|
+
const indyCredentialRequestMetadata = credentialRecord.metadata.get(indyCredentialRequestMetadataKey);
|
|
100
|
+
if (indyCredentialRequestMetadata) {
|
|
101
|
+
credentialRecord.metadata.set(ANONCREDS_CREDENTIAL_REQUEST_METADATA, {
|
|
102
|
+
link_secret_blinding_data: indyCredentialRequestMetadata.master_secret_blinding_data,
|
|
103
|
+
link_secret_name: indyCredentialRequestMetadata.master_secret_name,
|
|
104
|
+
nonce: indyCredentialRequestMetadata.nonce
|
|
105
|
+
});
|
|
106
|
+
credentialRecord.metadata.delete(indyCredentialRequestMetadataKey);
|
|
107
|
+
}
|
|
108
|
+
const indyCredentialMetadata = credentialRecord.metadata.get(indyCredentialMetadataKey);
|
|
109
|
+
if (indyCredentialMetadata) {
|
|
110
|
+
credentialRecord.metadata.set(ANONCREDS_CREDENTIAL_METADATA, indyCredentialMetadata);
|
|
111
|
+
credentialRecord.metadata.delete(indyCredentialMetadataKey);
|
|
112
|
+
}
|
|
113
|
+
agent.config.logger.debug(`Successfully migrated credential record with id ${credentialRecord.id} to anoncreds credential metadata for version 0.4`);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
//#endregion
|
|
117
|
+
export { migrateCredentialExchangeRecordToV0_4 };
|
|
118
|
+
//# sourceMappingURL=credentialExchangeRecord.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentialExchangeRecord.mjs","names":[],"sources":["../../../src/updates/0.3.1-0.4/credentialExchangeRecord.ts"],"sourcesContent":["import type { BaseAgent } from '@credo-ts/core'\nimport type { DidCommCredentialExchangeRecord } from '@credo-ts/didcomm'\n\nimport { DidCommCredentialExchangeRepository } from '@credo-ts/didcomm'\n\n/**\n * Migrates the {@link DidCommCredentialExchangeRecord} to 0.4 compatible format. It fetches all credential exchange records from\n * storage and applies the needed updates to the records. After a record has been transformed, it is updated\n * in storage and the next record will be transformed.\n *\n * The following transformations are applied:\n * - {@link migrateIndyCredentialMetadataToAnonCredsMetadata}\n * - {@link migrateIndyCredentialTypeToAnonCredsCredential}\n */\nexport async function migrateCredentialExchangeRecordToV0_4<Agent extends BaseAgent>(agent: Agent) {\n agent.config.logger.info('Migrating credential exchange records to storage version 0.4')\n const credentialRepository = agent.dependencyManager.resolve(DidCommCredentialExchangeRepository)\n\n agent.config.logger.debug('Fetching all credential records from storage')\n const credentialRecords = await credentialRepository.getAll(agent.context)\n\n agent.config.logger.debug(`Found a total of ${credentialRecords.length} credential exchange records to update.`)\n for (const credentialRecord of credentialRecords) {\n agent.config.logger.debug(\n `Migrating credential exchange record with id ${credentialRecord.id} to storage version 0.4`\n )\n\n migrateIndyCredentialTypeToAnonCredsCredential(agent, credentialRecord)\n migrateIndyCredentialMetadataToAnonCredsMetadata(agent, credentialRecord)\n\n // Save updated record\n await credentialRepository.update(agent.context, credentialRecord)\n\n agent.config.logger.debug(\n `Successfully migrated credential exchange record with id ${credentialRecord.id} to storage version 0.4`\n )\n }\n}\n\n/**\n * Migrates the indy credential record binding to anoncreds credential record binding.\n *\n * The following 0.3.1 credential record structure (unrelated keys omitted):\n *\n * ```json\n * {\n * \"credentials\": [\n * {\n * \"credentialRecordId\": \"credential-id\",\n * \"credentialRecordType\": \"indy\"\n * },\n * {\n * \"credentialRecordId\": \"credential-id2\",\n * \"credentialRecordType\": \"jsonld\"\n * }\n * ]\n * }\n * ```\n *\n * Wil be tranformed into the following 0.4 credential record structure (unrelated keys omitted):\n * ```json\n * {\n * \"credentials\": [\n * {\n * \"credentialRecordId\": \"credential-id\",\n * \"credentialRecordType\": \"anoncreds\"\n * },\n * {\n * \"credentialRecordId\": \"credential-id2\",\n * \"credentialRecordType\": \"jsonld\"\n * }\n * ]\n * }\n * ```\n */\nexport function migrateIndyCredentialTypeToAnonCredsCredential<Agent extends BaseAgent>(\n agent: Agent,\n credentialRecord: DidCommCredentialExchangeRecord\n) {\n agent.config.logger.debug(\n `Migrating credential record with id ${credentialRecord.id} to anoncreds credential binding for version 0.4`\n )\n\n const INDY_CREDENTIAL_RECORD_TYPE = 'indy'\n const ANONCREDS_CREDENTIAL_RECORD_TYPE = 'anoncreds'\n\n for (const credential of credentialRecord.credentials) {\n if (credential.credentialRecordType === INDY_CREDENTIAL_RECORD_TYPE) {\n agent.config.logger.debug(`Updating credential binding ${credential.credentialRecordId} to anoncreds type`)\n credential.credentialRecordType = ANONCREDS_CREDENTIAL_RECORD_TYPE\n }\n }\n\n agent.config.logger.debug(\n `Successfully migrated credential record with id ${credentialRecord.id} to anoncreds credential binding for version 0.4`\n )\n}\n\n/**\n * Migrates the indy credential metadata type to anoncreds credential metadata type.\n *\n * The following 0.3.1 credential metadata structure (unrelated keys omitted):\n *\n * ```json\n * {\n * \"_internal/indyRequest\": {}\n * \"_internal/indyCredential\": {}\n * }\n * ```\n *\n * Wil be tranformed into the following 0.4 credential metadata structure (unrelated keys omitted):\n * ```json\n * {\n * \"_anoncreds/credentialRequest\": {}\n * \"_anoncreds/credential\": {}\n * }\n * ```\n */\nexport function migrateIndyCredentialMetadataToAnonCredsMetadata<Agent extends BaseAgent>(\n agent: Agent,\n credentialRecord: DidCommCredentialExchangeRecord\n) {\n agent.config.logger.debug(\n `Migrating credential record with id ${credentialRecord.id} to anoncreds metadata for version 0.4`\n )\n\n const indyCredentialRequestMetadataKey = '_internal/indyRequest'\n const indyCredentialMetadataKey = '_internal/indyCredential'\n\n const ANONCREDS_CREDENTIAL_REQUEST_METADATA = '_anoncreds/credentialRequest'\n const ANONCREDS_CREDENTIAL_METADATA = '_anoncreds/credential'\n\n const indyCredentialRequestMetadata = credentialRecord.metadata.get(indyCredentialRequestMetadataKey)\n if (indyCredentialRequestMetadata) {\n credentialRecord.metadata.set(ANONCREDS_CREDENTIAL_REQUEST_METADATA, {\n link_secret_blinding_data: indyCredentialRequestMetadata.master_secret_blinding_data,\n link_secret_name: indyCredentialRequestMetadata.master_secret_name,\n nonce: indyCredentialRequestMetadata.nonce,\n })\n credentialRecord.metadata.delete(indyCredentialRequestMetadataKey)\n }\n\n const indyCredentialMetadata = credentialRecord.metadata.get(indyCredentialMetadataKey)\n if (indyCredentialMetadata) {\n credentialRecord.metadata.set(ANONCREDS_CREDENTIAL_METADATA, indyCredentialMetadata)\n credentialRecord.metadata.delete(indyCredentialMetadataKey)\n }\n\n agent.config.logger.debug(\n `Successfully migrated credential record with id ${credentialRecord.id} to anoncreds credential metadata for version 0.4`\n )\n}\n"],"mappings":";;;;;;;;;;;;AAcA,eAAsB,sCAA+D,OAAc;AACjG,OAAM,OAAO,OAAO,KAAK,+DAA+D;CACxF,MAAM,uBAAuB,MAAM,kBAAkB,QAAQ,oCAAoC;AAEjG,OAAM,OAAO,OAAO,MAAM,+CAA+C;CACzE,MAAM,oBAAoB,MAAM,qBAAqB,OAAO,MAAM,QAAQ;AAE1E,OAAM,OAAO,OAAO,MAAM,oBAAoB,kBAAkB,OAAO,yCAAyC;AAChH,MAAK,MAAM,oBAAoB,mBAAmB;AAChD,QAAM,OAAO,OAAO,MAClB,gDAAgD,iBAAiB,GAAG,yBACrE;AAED,iDAA+C,OAAO,iBAAiB;AACvE,mDAAiD,OAAO,iBAAiB;AAGzE,QAAM,qBAAqB,OAAO,MAAM,SAAS,iBAAiB;AAElE,QAAM,OAAO,OAAO,MAClB,4DAA4D,iBAAiB,GAAG,yBACjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCL,SAAgB,+CACd,OACA,kBACA;AACA,OAAM,OAAO,OAAO,MAClB,uCAAuC,iBAAiB,GAAG,kDAC5D;CAED,MAAM,8BAA8B;CACpC,MAAM,mCAAmC;AAEzC,MAAK,MAAM,cAAc,iBAAiB,YACxC,KAAI,WAAW,yBAAyB,6BAA6B;AACnE,QAAM,OAAO,OAAO,MAAM,+BAA+B,WAAW,mBAAmB,oBAAoB;AAC3G,aAAW,uBAAuB;;AAItC,OAAM,OAAO,OAAO,MAClB,mDAAmD,iBAAiB,GAAG,kDACxE;;;;;;;;;;;;;;;;;;;;;;AAuBH,SAAgB,iDACd,OACA,kBACA;AACA,OAAM,OAAO,OAAO,MAClB,uCAAuC,iBAAiB,GAAG,wCAC5D;CAED,MAAM,mCAAmC;CACzC,MAAM,4BAA4B;CAElC,MAAM,wCAAwC;CAC9C,MAAM,gCAAgC;CAEtC,MAAM,gCAAgC,iBAAiB,SAAS,IAAI,iCAAiC;AACrG,KAAI,+BAA+B;AACjC,mBAAiB,SAAS,IAAI,uCAAuC;GACnE,2BAA2B,8BAA8B;GACzD,kBAAkB,8BAA8B;GAChD,OAAO,8BAA8B;GACtC,CAAC;AACF,mBAAiB,SAAS,OAAO,iCAAiC;;CAGpE,MAAM,yBAAyB,iBAAiB,SAAS,IAAI,0BAA0B;AACvF,KAAI,wBAAwB;AAC1B,mBAAiB,SAAS,IAAI,+BAA+B,uBAAuB;AACpF,mBAAiB,SAAS,OAAO,0BAA0B;;AAG7D,OAAM,OAAO,OAAO,MAClB,mDAAmD,iBAAiB,GAAG,mDACxE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseAgent } from "@credo-ts/core";
|
|
2
|
+
|
|
3
|
+
//#region src/updates/0.3.1-0.4/index.d.ts
|
|
4
|
+
declare function updateAnonCredsModuleV0_3_1ToV0_4<Agent extends BaseAgent>(agent: Agent): Promise<void>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { updateAnonCredsModuleV0_3_1ToV0_4 };
|
|
7
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/updates/0.3.1-0.4/index.ts"],"sourcesContent":[],"mappings":";;;iBAOsB,gDAAgD,kBAAkB,QAAQ"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { migrateAnonCredsCredentialDefinitionRecordToV0_4 } from "./credentialDefinition.mjs";
|
|
2
|
+
import { migrateCredentialExchangeRecordToV0_4 } from "./credentialExchangeRecord.mjs";
|
|
3
|
+
import { migrateLinkSecretToV0_4 } from "./linkSecret.mjs";
|
|
4
|
+
import { migrateAnonCredsSchemaRecordToV0_4 } from "./schema.mjs";
|
|
5
|
+
|
|
6
|
+
//#region src/updates/0.3.1-0.4/index.ts
|
|
7
|
+
async function updateAnonCredsModuleV0_3_1ToV0_4(agent) {
|
|
8
|
+
await migrateCredentialExchangeRecordToV0_4(agent);
|
|
9
|
+
await migrateLinkSecretToV0_4(agent);
|
|
10
|
+
await migrateAnonCredsCredentialDefinitionRecordToV0_4(agent);
|
|
11
|
+
await migrateAnonCredsSchemaRecordToV0_4(agent);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { updateAnonCredsModuleV0_3_1ToV0_4 };
|
|
16
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/updates/0.3.1-0.4/index.ts"],"sourcesContent":["import type { BaseAgent } from '@credo-ts/core'\n\nimport { migrateAnonCredsCredentialDefinitionRecordToV0_4 } from './credentialDefinition'\nimport { migrateCredentialExchangeRecordToV0_4 } from './credentialExchangeRecord'\nimport { migrateLinkSecretToV0_4 } from './linkSecret'\nimport { migrateAnonCredsSchemaRecordToV0_4 } from './schema'\n\nexport async function updateAnonCredsModuleV0_3_1ToV0_4<Agent extends BaseAgent>(agent: Agent): Promise<void> {\n await migrateCredentialExchangeRecordToV0_4(agent)\n await migrateLinkSecretToV0_4(agent)\n await migrateAnonCredsCredentialDefinitionRecordToV0_4(agent)\n await migrateAnonCredsSchemaRecordToV0_4(agent)\n}\n"],"mappings":";;;;;;AAOA,eAAsB,kCAA2D,OAA6B;AAC5G,OAAM,sCAAsC,MAAM;AAClD,OAAM,wBAAwB,MAAM;AACpC,OAAM,iDAAiD,MAAM;AAC7D,OAAM,mCAAmC,MAAM"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AnonCredsLinkSecretRepository } from "../../repository/AnonCredsLinkSecretRepository.mjs";
|
|
2
|
+
import "../../repository/index.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/updates/0.3.1-0.4/linkSecret.ts
|
|
5
|
+
/**
|
|
6
|
+
* Creates an {@link AnonCredsLinkSecretRecord} based on the wallet id. If an {@link AnonCredsLinkSecretRecord}
|
|
7
|
+
* already exists (which is the case when upgraded to Askar), no link secret record will be created.
|
|
8
|
+
*/
|
|
9
|
+
async function migrateLinkSecretToV0_4(agent) {
|
|
10
|
+
agent.config.logger.info("Migrating link secret to storage version 0.4");
|
|
11
|
+
const linkSecretRepository = agent.dependencyManager.resolve(AnonCredsLinkSecretRepository);
|
|
12
|
+
agent.config.logger.debug("Fetching default link secret record from storage");
|
|
13
|
+
const defaultLinkSecret = await linkSecretRepository.findDefault(agent.context);
|
|
14
|
+
if (!defaultLinkSecret) agent.config.logger.error("No default link secret record found. This should not happen");
|
|
15
|
+
else agent.config.logger.debug(`Default link secret record with record id ${defaultLinkSecret.id} and link secret id ${defaultLinkSecret.linkSecretId} found. Skipping...`);
|
|
16
|
+
agent.config.logger.debug("Successfully migrated link secret to version 0.4");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { migrateLinkSecretToV0_4 };
|
|
21
|
+
//# sourceMappingURL=linkSecret.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkSecret.mjs","names":[],"sources":["../../../src/updates/0.3.1-0.4/linkSecret.ts"],"sourcesContent":["import type { BaseAgent } from '@credo-ts/core'\n\nimport { AnonCredsLinkSecretRepository } from '../../repository'\n\n/**\n * Creates an {@link AnonCredsLinkSecretRecord} based on the wallet id. If an {@link AnonCredsLinkSecretRecord}\n * already exists (which is the case when upgraded to Askar), no link secret record will be created.\n */\nexport async function migrateLinkSecretToV0_4<Agent extends BaseAgent>(agent: Agent) {\n agent.config.logger.info('Migrating link secret to storage version 0.4')\n\n const linkSecretRepository = agent.dependencyManager.resolve(AnonCredsLinkSecretRepository)\n\n agent.config.logger.debug('Fetching default link secret record from storage')\n const defaultLinkSecret = await linkSecretRepository.findDefault(agent.context)\n\n if (!defaultLinkSecret) {\n // NOTE: this migration is not relevant here, but kept for documentation purposes.\n // This migration was relevant if you were upgrading from 0.3 to 0.4 and kept using\n // the indy-sdk over askar. However since 0.5 there is no indy-sdk anymore, and thus\n // you MUST use Askar now, and the Askar migration already handles the link secret migration\n // and also actually sets the value. So there is no flow in which we would need this code.\n // If it would, the previous code would not store the value (only the link secret id) as we couldn't\n // access the value with Indy. So it wouldn't have been usable anyway\n\n // If no default link secret record exists, we create one based on the wallet id and set is as default\n agent.config.logger.error('No default link secret record found. This should not happen')\n } else {\n agent.config.logger.debug(\n `Default link secret record with record id ${defaultLinkSecret.id} and link secret id ${defaultLinkSecret.linkSecretId} found. Skipping...`\n )\n }\n\n agent.config.logger.debug('Successfully migrated link secret to version 0.4')\n}\n"],"mappings":";;;;;;;;AAQA,eAAsB,wBAAiD,OAAc;AACnF,OAAM,OAAO,OAAO,KAAK,+CAA+C;CAExE,MAAM,uBAAuB,MAAM,kBAAkB,QAAQ,8BAA8B;AAE3F,OAAM,OAAO,OAAO,MAAM,mDAAmD;CAC7E,MAAM,oBAAoB,MAAM,qBAAqB,YAAY,MAAM,QAAQ;AAE/E,KAAI,CAAC,kBAUH,OAAM,OAAO,OAAO,MAAM,8DAA8D;KAExF,OAAM,OAAO,OAAO,MAClB,6CAA6C,kBAAkB,GAAG,sBAAsB,kBAAkB,aAAa,qBACxH;AAGH,OAAM,OAAO,OAAO,MAAM,mDAAmD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AnonCredsSchemaRepository } from "../../repository/AnonCredsSchemaRepository.mjs";
|
|
2
|
+
import "../../repository/index.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/updates/0.3.1-0.4/schema.ts
|
|
5
|
+
/**
|
|
6
|
+
* Migrates the {@link AnonCredsSchemaRecord} to 0.4 compatible format. It fetches all schema records from
|
|
7
|
+
* storage and updates the format based on the new ledger agnostic anoncreds models. After a record has been transformed,
|
|
8
|
+
* it is updated in storage and the next record will be transformed.
|
|
9
|
+
*/
|
|
10
|
+
async function migrateAnonCredsSchemaRecordToV0_4(agent) {
|
|
11
|
+
agent.config.logger.info("Migrating AnonCredsSchemaRecord records to storage version 0.4");
|
|
12
|
+
const schemaRepository = agent.dependencyManager.resolve(AnonCredsSchemaRepository);
|
|
13
|
+
agent.config.logger.debug("Fetching all schema records from storage");
|
|
14
|
+
const schemaRecords = await schemaRepository.getAll(agent.context);
|
|
15
|
+
agent.config.logger.debug(`Found a total of ${schemaRecords.length} schema records to update.`);
|
|
16
|
+
for (const schemaRecord of schemaRecords) {
|
|
17
|
+
const oldSchema = schemaRecord.schema;
|
|
18
|
+
if (oldSchema.id === void 0) {
|
|
19
|
+
agent.config.logger.info(`Schema record with id ${schemaRecord.id} and schema id ${schemaRecord.schemaId} is already in storage version 0.4 format. Probably due to Indy SDK to Askar migration. Skipping...`);
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
agent.config.logger.debug(`Migrating anoncreds schema record with id ${schemaRecord.id} and schema id ${oldSchema.id} to storage version 0.4`);
|
|
23
|
+
schemaRecord.schema = {
|
|
24
|
+
attrNames: oldSchema.attrNames,
|
|
25
|
+
name: oldSchema.name,
|
|
26
|
+
version: oldSchema.version,
|
|
27
|
+
issuerId: oldSchema.id.split("/")[0]
|
|
28
|
+
};
|
|
29
|
+
schemaRecord.schemaId = oldSchema.id;
|
|
30
|
+
schemaRecord.methodName = "indy";
|
|
31
|
+
schemaRecord.setTag("schemaIssuerDid", void 0);
|
|
32
|
+
await schemaRepository.update(agent.context, schemaRecord);
|
|
33
|
+
agent.config.logger.debug(`Successfully migrated schema record with id ${schemaRecord.id} to storage version 0.4`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { migrateAnonCredsSchemaRecordToV0_4 };
|
|
39
|
+
//# sourceMappingURL=schema.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.mjs","names":[],"sources":["../../../src/updates/0.3.1-0.4/schema.ts"],"sourcesContent":["import type { BaseAgent } from '@credo-ts/core'\nimport type { AnonCredsSchema } from '../../models'\n\nimport { AnonCredsSchemaRepository } from '../../repository'\n\n/**\n * Migrates the {@link AnonCredsSchemaRecord} to 0.4 compatible format. It fetches all schema records from\n * storage and updates the format based on the new ledger agnostic anoncreds models. After a record has been transformed,\n * it is updated in storage and the next record will be transformed.\n */\nexport async function migrateAnonCredsSchemaRecordToV0_4<Agent extends BaseAgent>(agent: Agent) {\n agent.config.logger.info('Migrating AnonCredsSchemaRecord records to storage version 0.4')\n const schemaRepository = agent.dependencyManager.resolve(AnonCredsSchemaRepository)\n\n agent.config.logger.debug('Fetching all schema records from storage')\n const schemaRecords = await schemaRepository.getAll(agent.context)\n\n agent.config.logger.debug(`Found a total of ${schemaRecords.length} schema records to update.`)\n for (const schemaRecord of schemaRecords) {\n const oldSchema = schemaRecord.schema as unknown as OldSchema\n\n // If askar migration script is ran, it could be that the credential definition record is already in 0.4 format\n if (oldSchema.id === undefined) {\n agent.config.logger.info(\n `Schema record with id ${schemaRecord.id} and schema id ${schemaRecord.schemaId} is already in storage version 0.4 format. Probably due to Indy SDK to Askar migration. Skipping...`\n )\n continue\n }\n\n agent.config.logger.debug(\n `Migrating anoncreds schema record with id ${schemaRecord.id} and schema id ${oldSchema.id} to storage version 0.4`\n )\n\n const newSchema = {\n attrNames: oldSchema.attrNames,\n name: oldSchema.name,\n version: oldSchema.version,\n issuerId: oldSchema.id.split('/')[0],\n } satisfies AnonCredsSchema\n\n schemaRecord.schema = newSchema\n schemaRecord.schemaId = oldSchema.id\n schemaRecord.methodName = 'indy'\n\n // schemaIssuerDid was set as tag, but is now replaced by issuerId. It was also always set\n // to the value `did` as it incorrectly parsed the schemaId.\n schemaRecord.setTag('schemaIssuerDid', undefined)\n\n // Save updated schema record\n await schemaRepository.update(agent.context, schemaRecord)\n\n agent.config.logger.debug(`Successfully migrated schema record with id ${schemaRecord.id} to storage version 0.4`)\n }\n}\n\nexport interface OldSchema {\n id: string\n name: string\n version: string\n attrNames: string[]\n seqNo: number\n ver: string\n}\n"],"mappings":";;;;;;;;;AAUA,eAAsB,mCAA4D,OAAc;AAC9F,OAAM,OAAO,OAAO,KAAK,iEAAiE;CAC1F,MAAM,mBAAmB,MAAM,kBAAkB,QAAQ,0BAA0B;AAEnF,OAAM,OAAO,OAAO,MAAM,2CAA2C;CACrE,MAAM,gBAAgB,MAAM,iBAAiB,OAAO,MAAM,QAAQ;AAElE,OAAM,OAAO,OAAO,MAAM,oBAAoB,cAAc,OAAO,4BAA4B;AAC/F,MAAK,MAAM,gBAAgB,eAAe;EACxC,MAAM,YAAY,aAAa;AAG/B,MAAI,UAAU,OAAO,QAAW;AAC9B,SAAM,OAAO,OAAO,KAClB,yBAAyB,aAAa,GAAG,iBAAiB,aAAa,SAAS,qGACjF;AACD;;AAGF,QAAM,OAAO,OAAO,MAClB,6CAA6C,aAAa,GAAG,iBAAiB,UAAU,GAAG,yBAC5F;AASD,eAAa,SAPK;GAChB,WAAW,UAAU;GACrB,MAAM,UAAU;GAChB,SAAS,UAAU;GACnB,UAAU,UAAU,GAAG,MAAM,IAAI,CAAC;GACnC;AAGD,eAAa,WAAW,UAAU;AAClC,eAAa,aAAa;AAI1B,eAAa,OAAO,mBAAmB,OAAU;AAGjD,QAAM,iBAAiB,OAAO,MAAM,SAAS,aAAa;AAE1D,QAAM,OAAO,OAAO,MAAM,+CAA+C,aAAa,GAAG,yBAAyB"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { getIndyNamespaceFromIndyDid, getQualifiedDidIndyDid, getUnqualifiedRevocationRegistryDefinitionId, isIndyDid, isUnqualifiedCredentialDefinitionId, isUnqualifiedIndyDid, parseIndyRevocationRegistryId } from "../../utils/indyIdentifiers.mjs";
|
|
2
|
+
import { AnonCredsCredentialRepository } from "../../repository/AnonCredsCredentialRepository.mjs";
|
|
3
|
+
import "../../repository/index.mjs";
|
|
4
|
+
import { AnonCredsHolderServiceSymbol } from "../../services/AnonCredsHolderService.mjs";
|
|
5
|
+
import "../../services/index.mjs";
|
|
6
|
+
import { fetchCredentialDefinition } from "../../utils/anonCredsObjects.mjs";
|
|
7
|
+
import { W3cAnonCredsCredentialMetadataKey } from "../../utils/metadata.mjs";
|
|
8
|
+
import { getW3cRecordAnonCredsTags } from "../../utils/w3cAnonCredsUtils.mjs";
|
|
9
|
+
import { CacheModuleConfig, CredoError, W3cCredentialRecord, W3cCredentialService } from "@credo-ts/core";
|
|
10
|
+
import { DidCommCredentialExchangeRepository } from "@credo-ts/didcomm";
|
|
11
|
+
|
|
12
|
+
//#region src/updates/0.4-0.5/anonCredsCredentialRecord.ts
|
|
13
|
+
async function getIndyNamespace(agentContext, legacyCredentialDefinitionId, legacyIssuerId) {
|
|
14
|
+
const cache = agentContext.dependencyManager.resolve(CacheModuleConfig).cache;
|
|
15
|
+
const indyCacheKey = `IndyVdrPoolService:${legacyIssuerId}`;
|
|
16
|
+
const sovCacheKey = `IndySdkPoolService:${legacyIssuerId}`;
|
|
17
|
+
const cachedNymResponse = await cache.get(agentContext, indyCacheKey) ?? await cache.get(agentContext, sovCacheKey);
|
|
18
|
+
if (!cachedNymResponse?.indyNamespace || typeof cachedNymResponse?.indyNamespace !== "string") {
|
|
19
|
+
const namespace = (await fetchCredentialDefinition(agentContext, legacyCredentialDefinitionId)).indyNamespace;
|
|
20
|
+
if (!namespace) throw new CredoError("Could not determine the indyNamespace required for storing anoncreds in the new w3c format.");
|
|
21
|
+
return namespace;
|
|
22
|
+
}
|
|
23
|
+
return cachedNymResponse.indyNamespace;
|
|
24
|
+
}
|
|
25
|
+
async function migrateLegacyToW3cCredential(agentContext, legacyRecord) {
|
|
26
|
+
const legacyTags = legacyRecord.getTags();
|
|
27
|
+
let indyNamespace;
|
|
28
|
+
let qualifiedSchemaId;
|
|
29
|
+
let qualifiedSchemaIssuerId;
|
|
30
|
+
let qualifiedCredentialDefinitionId;
|
|
31
|
+
let qualifiedIssuerId;
|
|
32
|
+
let qualifiedRevocationRegistryId;
|
|
33
|
+
if (!isUnqualifiedCredentialDefinitionId(legacyTags.credentialDefinitionId) && !isUnqualifiedIndyDid(legacyTags.issuerId)) {
|
|
34
|
+
if (isIndyDid(legacyTags.issuerId)) indyNamespace = getIndyNamespaceFromIndyDid(legacyTags.issuerId);
|
|
35
|
+
} else indyNamespace = await getIndyNamespace(agentContext, legacyTags.credentialDefinitionId, legacyTags.issuerId);
|
|
36
|
+
if (indyNamespace) {
|
|
37
|
+
qualifiedCredentialDefinitionId = getQualifiedDidIndyDid(legacyTags.credentialDefinitionId, indyNamespace);
|
|
38
|
+
qualifiedIssuerId = getQualifiedDidIndyDid(legacyTags.issuerId, indyNamespace);
|
|
39
|
+
qualifiedRevocationRegistryId = legacyTags.revocationRegistryId ? getQualifiedDidIndyDid(legacyTags.revocationRegistryId, indyNamespace) : void 0;
|
|
40
|
+
qualifiedSchemaId = getQualifiedDidIndyDid(legacyTags.schemaId, indyNamespace);
|
|
41
|
+
qualifiedSchemaIssuerId = getQualifiedDidIndyDid(legacyTags.schemaIssuerId, indyNamespace);
|
|
42
|
+
} else {
|
|
43
|
+
qualifiedCredentialDefinitionId = legacyTags.credentialDefinitionId;
|
|
44
|
+
qualifiedIssuerId = legacyTags.issuerId;
|
|
45
|
+
qualifiedRevocationRegistryId = legacyTags.revocationRegistryId;
|
|
46
|
+
qualifiedSchemaId = legacyTags.schemaId;
|
|
47
|
+
qualifiedSchemaIssuerId = legacyTags.schemaIssuerId;
|
|
48
|
+
}
|
|
49
|
+
const w3cJsonLdCredential = await agentContext.dependencyManager.resolve(AnonCredsHolderServiceSymbol).legacyToW3cCredential(agentContext, {
|
|
50
|
+
credential: legacyRecord.credential,
|
|
51
|
+
issuerId: qualifiedIssuerId
|
|
52
|
+
});
|
|
53
|
+
if (Array.isArray(w3cJsonLdCredential.credentialSubject)) throw new CredoError("Credential subject must be an object, not an array.");
|
|
54
|
+
const anonCredsTags = getW3cRecordAnonCredsTags({
|
|
55
|
+
credentialSubject: w3cJsonLdCredential.credentialSubject,
|
|
56
|
+
issuerId: w3cJsonLdCredential.issuerId,
|
|
57
|
+
schemaId: qualifiedSchemaId,
|
|
58
|
+
schema: {
|
|
59
|
+
issuerId: qualifiedSchemaIssuerId,
|
|
60
|
+
name: legacyTags.schemaName,
|
|
61
|
+
version: legacyTags.schemaVersion
|
|
62
|
+
},
|
|
63
|
+
credentialRevocationId: legacyTags.credentialRevocationId,
|
|
64
|
+
revocationRegistryId: qualifiedRevocationRegistryId,
|
|
65
|
+
credentialDefinitionId: qualifiedCredentialDefinitionId,
|
|
66
|
+
linkSecretId: legacyTags.linkSecretId,
|
|
67
|
+
methodName: legacyTags.methodName
|
|
68
|
+
});
|
|
69
|
+
const w3cCredentialService = agentContext.dependencyManager.resolve(W3cCredentialService);
|
|
70
|
+
const w3cCredentialRecord = new W3cCredentialRecord({
|
|
71
|
+
credentialInstances: [{ credential: w3cJsonLdCredential.encoded }],
|
|
72
|
+
tags: {}
|
|
73
|
+
});
|
|
74
|
+
for (const [key, meta] of Object.entries(legacyRecord.metadata.data)) w3cCredentialRecord.metadata.set(key, meta);
|
|
75
|
+
const anonCredsCredentialMetadata = {
|
|
76
|
+
credentialRevocationId: anonCredsTags.anonCredsCredentialRevocationId,
|
|
77
|
+
linkSecretId: anonCredsTags.anonCredsLinkSecretId,
|
|
78
|
+
methodName: anonCredsTags.anonCredsMethodName
|
|
79
|
+
};
|
|
80
|
+
w3cCredentialRecord.setTags(anonCredsTags);
|
|
81
|
+
w3cCredentialRecord.metadata.set(W3cAnonCredsCredentialMetadataKey, anonCredsCredentialMetadata);
|
|
82
|
+
await w3cCredentialService.storeCredential(agentContext, { record: w3cCredentialRecord });
|
|
83
|
+
const credentialExchangeRepository = agentContext.dependencyManager.resolve(DidCommCredentialExchangeRepository);
|
|
84
|
+
const [relatedCredentialExchangeRecord] = await credentialExchangeRepository.findByQuery(agentContext, { credentialIds: [legacyRecord.credentialId] });
|
|
85
|
+
if (relatedCredentialExchangeRecord) {
|
|
86
|
+
const credentialBindingIndex = relatedCredentialExchangeRecord.credentials.findIndex((binding) => binding.credentialRecordId === legacyRecord.credentialId);
|
|
87
|
+
if (credentialBindingIndex !== -1) {
|
|
88
|
+
relatedCredentialExchangeRecord.credentials[credentialBindingIndex] = {
|
|
89
|
+
credentialRecordType: "w3c",
|
|
90
|
+
credentialRecordId: w3cCredentialRecord.id
|
|
91
|
+
};
|
|
92
|
+
if (legacyTags.revocationRegistryId && indyNamespace) {
|
|
93
|
+
const { credentialDefinitionTag, namespaceIdentifier, revocationRegistryTag, schemaSeqNo } = parseIndyRevocationRegistryId(legacyTags.revocationRegistryId);
|
|
94
|
+
relatedCredentialExchangeRecord.setTags({
|
|
95
|
+
anonCredsRevocationRegistryId: getQualifiedDidIndyDid(legacyTags.revocationRegistryId, indyNamespace),
|
|
96
|
+
anonCredsUnqualifiedRevocationRegistryId: getUnqualifiedRevocationRegistryDefinitionId(namespaceIdentifier, schemaSeqNo, credentialDefinitionTag, revocationRegistryTag)
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
await credentialExchangeRepository.update(agentContext, relatedCredentialExchangeRecord);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Stores all anoncreds credentials in the new w3c format
|
|
105
|
+
*/
|
|
106
|
+
async function storeAnonCredsInW3cFormatV0_5(agent) {
|
|
107
|
+
agent.config.logger.info("Migration of legacy AnonCreds records to the new W3C format version 0.5");
|
|
108
|
+
const anoncredsRepository = agent.dependencyManager.resolve(AnonCredsCredentialRepository);
|
|
109
|
+
agent.config.logger.debug("Fetching all anoncreds credential records from storage");
|
|
110
|
+
const records = await anoncredsRepository.getAll(agent.context);
|
|
111
|
+
agent.config.logger.debug(`Found a total of ${records.length} legacy anonCreds credential records to update.`);
|
|
112
|
+
for (const record of records) {
|
|
113
|
+
agent.config.logger.debug(`Re-saving anonCreds credential record with id ${record.id} in the new w3c format, and deleting the legacy record`);
|
|
114
|
+
try {
|
|
115
|
+
await migrateLegacyToW3cCredential(agent.context, record);
|
|
116
|
+
await anoncredsRepository.delete(agent.context, record);
|
|
117
|
+
agent.config.logger.debug(`Successfully migrated w3c credential record with id ${record.id} to storage version 0.5`);
|
|
118
|
+
} catch (error) {
|
|
119
|
+
agent.config.logger.error(`Failed to migrate w3c credential record with id ${record.id} to storage version 0.5`, error);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
//#endregion
|
|
125
|
+
export { storeAnonCredsInW3cFormatV0_5 };
|
|
126
|
+
//# sourceMappingURL=anonCredsCredentialRecord.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anonCredsCredentialRecord.mjs","names":["cachedNymResponse: Record<string, string> | null","indyNamespace: string | undefined","qualifiedSchemaId: string","qualifiedSchemaIssuerId: string","qualifiedCredentialDefinitionId: string","qualifiedIssuerId: string","qualifiedRevocationRegistryId: string | undefined","anonCredsCredentialMetadata: W3cAnonCredsCredentialMetadata"],"sources":["../../../src/updates/0.4-0.5/anonCredsCredentialRecord.ts"],"sourcesContent":["import type { AgentContext, BaseAgent } from '@credo-ts/core'\nimport { CacheModuleConfig, CredoError, W3cCredentialRecord, W3cCredentialService } from '@credo-ts/core'\nimport { DidCommCredentialExchangeRepository } from '@credo-ts/didcomm'\nimport { type AnonCredsCredentialRecord, AnonCredsCredentialRepository } from '../../repository'\nimport type { AnonCredsHolderService } from '../../services'\nimport { AnonCredsHolderServiceSymbol } from '../../services'\nimport { fetchCredentialDefinition } from '../../utils/anonCredsObjects'\nimport {\n getIndyNamespaceFromIndyDid,\n getQualifiedDidIndyDid,\n getUnqualifiedRevocationRegistryDefinitionId,\n isIndyDid,\n isUnqualifiedCredentialDefinitionId,\n isUnqualifiedIndyDid,\n parseIndyRevocationRegistryId,\n} from '../../utils/indyIdentifiers'\nimport type { W3cAnonCredsCredentialMetadata } from '../../utils/metadata'\nimport { W3cAnonCredsCredentialMetadataKey } from '../../utils/metadata'\nimport { getW3cRecordAnonCredsTags } from '../../utils/w3cAnonCredsUtils'\n\nasync function getIndyNamespace(\n agentContext: AgentContext,\n legacyCredentialDefinitionId: string,\n legacyIssuerId: string\n) {\n const cacheModuleConfig = agentContext.dependencyManager.resolve(CacheModuleConfig)\n const cache = cacheModuleConfig.cache\n\n const indyCacheKey = `IndyVdrPoolService:${legacyIssuerId}`\n const sovCacheKey = `IndySdkPoolService:${legacyIssuerId}`\n\n const cachedNymResponse: Record<string, string> | null =\n (await cache.get(agentContext, indyCacheKey)) ?? (await cache.get(agentContext, sovCacheKey))\n\n if (!cachedNymResponse?.indyNamespace || typeof cachedNymResponse?.indyNamespace !== 'string') {\n const credentialDefinitionReturn = await fetchCredentialDefinition(agentContext, legacyCredentialDefinitionId)\n const namespace = credentialDefinitionReturn.indyNamespace\n\n if (!namespace) {\n throw new CredoError(\n 'Could not determine the indyNamespace required for storing anoncreds in the new w3c format.'\n )\n }\n\n return namespace\n }\n return cachedNymResponse.indyNamespace\n}\n\nasync function migrateLegacyToW3cCredential(agentContext: AgentContext, legacyRecord: AnonCredsCredentialRecord) {\n const legacyTags = legacyRecord.getTags()\n\n let indyNamespace: string | undefined\n let qualifiedSchemaId: string\n let qualifiedSchemaIssuerId: string\n let qualifiedCredentialDefinitionId: string\n let qualifiedIssuerId: string\n let qualifiedRevocationRegistryId: string | undefined\n\n if (\n !isUnqualifiedCredentialDefinitionId(legacyTags.credentialDefinitionId) &&\n !isUnqualifiedIndyDid(legacyTags.issuerId)\n ) {\n if (isIndyDid(legacyTags.issuerId)) {\n indyNamespace = getIndyNamespaceFromIndyDid(legacyTags.issuerId)\n }\n } else {\n indyNamespace = await getIndyNamespace(agentContext, legacyTags.credentialDefinitionId, legacyTags.issuerId)\n }\n\n if (indyNamespace) {\n qualifiedCredentialDefinitionId = getQualifiedDidIndyDid(legacyTags.credentialDefinitionId, indyNamespace)\n qualifiedIssuerId = getQualifiedDidIndyDid(legacyTags.issuerId, indyNamespace)\n qualifiedRevocationRegistryId = legacyTags.revocationRegistryId\n ? getQualifiedDidIndyDid(legacyTags.revocationRegistryId, indyNamespace)\n : undefined\n qualifiedSchemaId = getQualifiedDidIndyDid(legacyTags.schemaId, indyNamespace)\n qualifiedSchemaIssuerId = getQualifiedDidIndyDid(legacyTags.schemaIssuerId, indyNamespace)\n } else {\n qualifiedCredentialDefinitionId = legacyTags.credentialDefinitionId\n qualifiedIssuerId = legacyTags.issuerId\n qualifiedRevocationRegistryId = legacyTags.revocationRegistryId\n qualifiedSchemaId = legacyTags.schemaId\n qualifiedSchemaIssuerId = legacyTags.schemaIssuerId\n }\n\n const anonCredsHolderService =\n agentContext.dependencyManager.resolve<AnonCredsHolderService>(AnonCredsHolderServiceSymbol)\n const w3cJsonLdCredential = await anonCredsHolderService.legacyToW3cCredential(agentContext, {\n credential: legacyRecord.credential,\n issuerId: qualifiedIssuerId,\n })\n\n if (Array.isArray(w3cJsonLdCredential.credentialSubject)) {\n throw new CredoError('Credential subject must be an object, not an array.')\n }\n\n const anonCredsTags = getW3cRecordAnonCredsTags({\n credentialSubject: w3cJsonLdCredential.credentialSubject,\n issuerId: w3cJsonLdCredential.issuerId,\n schemaId: qualifiedSchemaId,\n schema: {\n issuerId: qualifiedSchemaIssuerId,\n name: legacyTags.schemaName,\n version: legacyTags.schemaVersion,\n },\n credentialRevocationId: legacyTags.credentialRevocationId,\n revocationRegistryId: qualifiedRevocationRegistryId,\n credentialDefinitionId: qualifiedCredentialDefinitionId,\n linkSecretId: legacyTags.linkSecretId,\n methodName: legacyTags.methodName,\n })\n\n const w3cCredentialService = agentContext.dependencyManager.resolve(W3cCredentialService)\n const w3cCredentialRecord = new W3cCredentialRecord({\n credentialInstances: [\n {\n credential: w3cJsonLdCredential.encoded,\n },\n ],\n tags: {},\n })\n for (const [key, meta] of Object.entries(legacyRecord.metadata.data)) {\n w3cCredentialRecord.metadata.set(key, meta)\n }\n\n const anonCredsCredentialMetadata: W3cAnonCredsCredentialMetadata = {\n credentialRevocationId: anonCredsTags.anonCredsCredentialRevocationId,\n linkSecretId: anonCredsTags.anonCredsLinkSecretId,\n methodName: anonCredsTags.anonCredsMethodName,\n }\n\n w3cCredentialRecord.setTags(anonCredsTags)\n w3cCredentialRecord.metadata.set(W3cAnonCredsCredentialMetadataKey, anonCredsCredentialMetadata)\n\n await w3cCredentialService.storeCredential(agentContext, { record: w3cCredentialRecord })\n\n // Find the credential exchange record bound to this anoncreds credential and update it to point to the newly created w3c record\n const credentialExchangeRepository = agentContext.dependencyManager.resolve(DidCommCredentialExchangeRepository)\n const [relatedCredentialExchangeRecord] = await credentialExchangeRepository.findByQuery(agentContext, {\n credentialIds: [legacyRecord.credentialId],\n })\n\n if (relatedCredentialExchangeRecord) {\n // Replace the related binding by the new one\n const credentialBindingIndex = relatedCredentialExchangeRecord.credentials.findIndex(\n (binding) => binding.credentialRecordId === legacyRecord.credentialId\n )\n if (credentialBindingIndex !== -1) {\n relatedCredentialExchangeRecord.credentials[credentialBindingIndex] = {\n credentialRecordType: 'w3c',\n credentialRecordId: w3cCredentialRecord.id,\n }\n\n // If using Indy dids, store both qualified/unqualified revRegId forms\n // to allow retrieving it from revocation notification service\n if (legacyTags.revocationRegistryId && indyNamespace) {\n const { credentialDefinitionTag, namespaceIdentifier, revocationRegistryTag, schemaSeqNo } =\n parseIndyRevocationRegistryId(legacyTags.revocationRegistryId)\n\n relatedCredentialExchangeRecord.setTags({\n anonCredsRevocationRegistryId: getQualifiedDidIndyDid(legacyTags.revocationRegistryId, indyNamespace),\n anonCredsUnqualifiedRevocationRegistryId: getUnqualifiedRevocationRegistryDefinitionId(\n namespaceIdentifier,\n schemaSeqNo,\n credentialDefinitionTag,\n revocationRegistryTag\n ),\n })\n }\n\n await credentialExchangeRepository.update(agentContext, relatedCredentialExchangeRecord)\n }\n }\n}\n\n/**\n * Stores all anoncreds credentials in the new w3c format\n */\nexport async function storeAnonCredsInW3cFormatV0_5<Agent extends BaseAgent>(agent: Agent) {\n agent.config.logger.info('Migration of legacy AnonCreds records to the new W3C format version 0.5')\n\n const anoncredsRepository = agent.dependencyManager.resolve(AnonCredsCredentialRepository)\n\n agent.config.logger.debug('Fetching all anoncreds credential records from storage')\n const records = await anoncredsRepository.getAll(agent.context)\n\n agent.config.logger.debug(`Found a total of ${records.length} legacy anonCreds credential records to update.`)\n\n for (const record of records) {\n agent.config.logger.debug(\n `Re-saving anonCreds credential record with id ${record.id} in the new w3c format, and deleting the legacy record`\n )\n try {\n await migrateLegacyToW3cCredential(agent.context, record)\n await anoncredsRepository.delete(agent.context, record)\n agent.config.logger.debug(\n `Successfully migrated w3c credential record with id ${record.id} to storage version 0.5`\n )\n } catch (error) {\n agent.config.logger.error(\n `Failed to migrate w3c credential record with id ${record.id} to storage version 0.5`,\n error\n )\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,eAAe,iBACb,cACA,8BACA,gBACA;CAEA,MAAM,QADoB,aAAa,kBAAkB,QAAQ,kBAAkB,CACnD;CAEhC,MAAM,eAAe,sBAAsB;CAC3C,MAAM,cAAc,sBAAsB;CAE1C,MAAMA,oBACH,MAAM,MAAM,IAAI,cAAc,aAAa,IAAM,MAAM,MAAM,IAAI,cAAc,YAAY;AAE9F,KAAI,CAAC,mBAAmB,iBAAiB,OAAO,mBAAmB,kBAAkB,UAAU;EAE7F,MAAM,aAD6B,MAAM,0BAA0B,cAAc,6BAA6B,EACjE;AAE7C,MAAI,CAAC,UACH,OAAM,IAAI,WACR,8FACD;AAGH,SAAO;;AAET,QAAO,kBAAkB;;AAG3B,eAAe,6BAA6B,cAA4B,cAAyC;CAC/G,MAAM,aAAa,aAAa,SAAS;CAEzC,IAAIC;CACJ,IAAIC;CACJ,IAAIC;CACJ,IAAIC;CACJ,IAAIC;CACJ,IAAIC;AAEJ,KACE,CAAC,oCAAoC,WAAW,uBAAuB,IACvE,CAAC,qBAAqB,WAAW,SAAS,EAE1C;MAAI,UAAU,WAAW,SAAS,CAChC,iBAAgB,4BAA4B,WAAW,SAAS;OAGlE,iBAAgB,MAAM,iBAAiB,cAAc,WAAW,wBAAwB,WAAW,SAAS;AAG9G,KAAI,eAAe;AACjB,oCAAkC,uBAAuB,WAAW,wBAAwB,cAAc;AAC1G,sBAAoB,uBAAuB,WAAW,UAAU,cAAc;AAC9E,kCAAgC,WAAW,uBACvC,uBAAuB,WAAW,sBAAsB,cAAc,GACtE;AACJ,sBAAoB,uBAAuB,WAAW,UAAU,cAAc;AAC9E,4BAA0B,uBAAuB,WAAW,gBAAgB,cAAc;QACrF;AACL,oCAAkC,WAAW;AAC7C,sBAAoB,WAAW;AAC/B,kCAAgC,WAAW;AAC3C,sBAAoB,WAAW;AAC/B,4BAA0B,WAAW;;CAKvC,MAAM,sBAAsB,MAD1B,aAAa,kBAAkB,QAAgC,6BAA6B,CACrC,sBAAsB,cAAc;EAC3F,YAAY,aAAa;EACzB,UAAU;EACX,CAAC;AAEF,KAAI,MAAM,QAAQ,oBAAoB,kBAAkB,CACtD,OAAM,IAAI,WAAW,sDAAsD;CAG7E,MAAM,gBAAgB,0BAA0B;EAC9C,mBAAmB,oBAAoB;EACvC,UAAU,oBAAoB;EAC9B,UAAU;EACV,QAAQ;GACN,UAAU;GACV,MAAM,WAAW;GACjB,SAAS,WAAW;GACrB;EACD,wBAAwB,WAAW;EACnC,sBAAsB;EACtB,wBAAwB;EACxB,cAAc,WAAW;EACzB,YAAY,WAAW;EACxB,CAAC;CAEF,MAAM,uBAAuB,aAAa,kBAAkB,QAAQ,qBAAqB;CACzF,MAAM,sBAAsB,IAAI,oBAAoB;EAClD,qBAAqB,CACnB,EACE,YAAY,oBAAoB,SACjC,CACF;EACD,MAAM,EAAE;EACT,CAAC;AACF,MAAK,MAAM,CAAC,KAAK,SAAS,OAAO,QAAQ,aAAa,SAAS,KAAK,CAClE,qBAAoB,SAAS,IAAI,KAAK,KAAK;CAG7C,MAAMC,8BAA8D;EAClE,wBAAwB,cAAc;EACtC,cAAc,cAAc;EAC5B,YAAY,cAAc;EAC3B;AAED,qBAAoB,QAAQ,cAAc;AAC1C,qBAAoB,SAAS,IAAI,mCAAmC,4BAA4B;AAEhG,OAAM,qBAAqB,gBAAgB,cAAc,EAAE,QAAQ,qBAAqB,CAAC;CAGzF,MAAM,+BAA+B,aAAa,kBAAkB,QAAQ,oCAAoC;CAChH,MAAM,CAAC,mCAAmC,MAAM,6BAA6B,YAAY,cAAc,EACrG,eAAe,CAAC,aAAa,aAAa,EAC3C,CAAC;AAEF,KAAI,iCAAiC;EAEnC,MAAM,yBAAyB,gCAAgC,YAAY,WACxE,YAAY,QAAQ,uBAAuB,aAAa,aAC1D;AACD,MAAI,2BAA2B,IAAI;AACjC,mCAAgC,YAAY,0BAA0B;IACpE,sBAAsB;IACtB,oBAAoB,oBAAoB;IACzC;AAID,OAAI,WAAW,wBAAwB,eAAe;IACpD,MAAM,EAAE,yBAAyB,qBAAqB,uBAAuB,gBAC3E,8BAA8B,WAAW,qBAAqB;AAEhE,oCAAgC,QAAQ;KACtC,+BAA+B,uBAAuB,WAAW,sBAAsB,cAAc;KACrG,0CAA0C,6CACxC,qBACA,aACA,yBACA,sBACD;KACF,CAAC;;AAGJ,SAAM,6BAA6B,OAAO,cAAc,gCAAgC;;;;;;;AAQ9F,eAAsB,8BAAuD,OAAc;AACzF,OAAM,OAAO,OAAO,KAAK,0EAA0E;CAEnG,MAAM,sBAAsB,MAAM,kBAAkB,QAAQ,8BAA8B;AAE1F,OAAM,OAAO,OAAO,MAAM,yDAAyD;CACnF,MAAM,UAAU,MAAM,oBAAoB,OAAO,MAAM,QAAQ;AAE/D,OAAM,OAAO,OAAO,MAAM,oBAAoB,QAAQ,OAAO,iDAAiD;AAE9G,MAAK,MAAM,UAAU,SAAS;AAC5B,QAAM,OAAO,OAAO,MAClB,iDAAiD,OAAO,GAAG,wDAC5D;AACD,MAAI;AACF,SAAM,6BAA6B,MAAM,SAAS,OAAO;AACzD,SAAM,oBAAoB,OAAO,MAAM,SAAS,OAAO;AACvD,SAAM,OAAO,OAAO,MAClB,uDAAuD,OAAO,GAAG,yBAClE;WACM,OAAO;AACd,SAAM,OAAO,OAAO,MAClB,mDAAmD,OAAO,GAAG,0BAC7D,MACD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseAgent } from "@credo-ts/core";
|
|
2
|
+
|
|
3
|
+
//#region src/updates/0.4-0.5/index.d.ts
|
|
4
|
+
declare function updateAnonCredsModuleV0_4ToV0_5<Agent extends BaseAgent>(agent: Agent): Promise<void>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { updateAnonCredsModuleV0_4ToV0_5 };
|
|
7
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/updates/0.4-0.5/index.ts"],"sourcesContent":[],"mappings":";;;iBAIsB,8CAA8C,kBAAkB,QAAQ"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { storeAnonCredsInW3cFormatV0_5 } from "./anonCredsCredentialRecord.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/updates/0.4-0.5/index.ts
|
|
4
|
+
async function updateAnonCredsModuleV0_4ToV0_5(agent) {
|
|
5
|
+
await storeAnonCredsInW3cFormatV0_5(agent);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { updateAnonCredsModuleV0_4ToV0_5 };
|
|
10
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/updates/0.4-0.5/index.ts"],"sourcesContent":["import type { BaseAgent } from '@credo-ts/core'\n\nimport { storeAnonCredsInW3cFormatV0_5 } from './anonCredsCredentialRecord'\n\nexport async function updateAnonCredsModuleV0_4ToV0_5<Agent extends BaseAgent>(agent: Agent): Promise<void> {\n await storeAnonCredsInW3cFormatV0_5(agent)\n}\n"],"mappings":";;;AAIA,eAAsB,gCAAyD,OAA6B;AAC1G,OAAM,8BAA8B,MAAM"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AnonCredsCredentialDefinition, AnonCredsRevocationRegistryDefinition, AnonCredsRevocationStatusList, AnonCredsSchema } from "../models/registry.mjs";
|
|
2
|
+
import "../models/index.mjs";
|
|
3
|
+
import "../index.mjs";
|
|
4
|
+
import { AgentContext } from "@credo-ts/core";
|
|
5
|
+
|
|
6
|
+
//#region src/utils/anonCredsObjects.d.ts
|
|
7
|
+
declare function fetchSchema(agentContext: AgentContext, schemaId: string): Promise<{
|
|
8
|
+
schema: AnonCredsSchema;
|
|
9
|
+
schemaId: string;
|
|
10
|
+
indyNamespace: string | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
declare function fetchCredentialDefinition(agentContext: AgentContext, credentialDefinitionId: string): Promise<{
|
|
13
|
+
credentialDefinition: AnonCredsCredentialDefinition;
|
|
14
|
+
credentialDefinitionId: string;
|
|
15
|
+
indyNamespace: string | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
declare function fetchRevocationRegistryDefinition(agentContext: AgentContext, revocationRegistryDefinitionId: string): Promise<{
|
|
18
|
+
revocationRegistryDefinition: AnonCredsRevocationRegistryDefinition;
|
|
19
|
+
revocationRegistryDefinitionId: string;
|
|
20
|
+
indyNamespace: string | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
declare function fetchRevocationStatusList(agentContext: AgentContext, revocationRegistryId: string, timestamp: number): Promise<{
|
|
23
|
+
revocationStatusList: AnonCredsRevocationStatusList;
|
|
24
|
+
}>;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { fetchCredentialDefinition, fetchRevocationRegistryDefinition, fetchRevocationStatusList, fetchSchema };
|
|
27
|
+
//# sourceMappingURL=anonCredsObjects.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anonCredsObjects.d.mts","names":[],"sources":["../../src/utils/anonCredsObjects.ts"],"sourcesContent":[],"mappings":";;;;;;iBAMsB,WAAA,eAA0B,iCAA8B;;;;AAA9E,CAAA,CAAA;AAAgD,iBAkB1B,yBAAA,CAlB0B,YAAA,EAkBc,YAlBd,EAAA,sBAAA,EAAA,MAAA,CAAA,EAkB0D,OAlB1D,CAAA;;EAA8B,sBAAA,EAAA,MAAA;EAAA,aAAA,EAAA,MAAA,GAAA,SAAA;AAkB9E,CAAA,CAAA;AAA8D,iBAsBxC,iCAAA,CAtBwC,YAAA,EAuB9C,YAvB8C,EAAA,8BAAA,EAAA,MAAA,CAAA,EAwBtB,OAxBsB,CAAA;gCAuBlC;EAvB8E,8BAAA,EAAA,MAAA;EAAA,aAAA,EAAA,MAAA,GAAA,SAAA;AAsB1G,CAAA,CAAA;AACgB,iBAwBM,yBAAA,CAxBN,YAAA,EAyBA,YAzBA,EAAA,oBAAA,EAAA,MAAA,EAAA,SAAA,EAAA,MAAA,CAAA,EA4Bb,OA5Ba,CAAA;EAAY,oBAAA,EA4BO,6BA5BP;CACY,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AnonCredsRegistryService } from "../services/registry/AnonCredsRegistryService.mjs";
|
|
2
|
+
import "../services/index.mjs";
|
|
3
|
+
import { CredoError } from "@credo-ts/core";
|
|
4
|
+
|
|
5
|
+
//#region src/utils/anonCredsObjects.ts
|
|
6
|
+
async function fetchSchema(agentContext, schemaId) {
|
|
7
|
+
const result = await agentContext.dependencyManager.resolve(AnonCredsRegistryService).getRegistryForIdentifier(agentContext, schemaId).getSchema(agentContext, schemaId);
|
|
8
|
+
if (!result || !result.schema) throw new CredoError(`Schema not found for id ${schemaId}: ${result.resolutionMetadata.message}`);
|
|
9
|
+
return {
|
|
10
|
+
schema: result.schema,
|
|
11
|
+
schemaId: result.schemaId,
|
|
12
|
+
indyNamespace: result.schemaMetadata.didIndyNamespace
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
async function fetchCredentialDefinition(agentContext, credentialDefinitionId) {
|
|
16
|
+
const result = await agentContext.dependencyManager.resolve(AnonCredsRegistryService).getRegistryForIdentifier(agentContext, credentialDefinitionId).getCredentialDefinition(agentContext, credentialDefinitionId);
|
|
17
|
+
if (!result || !result.credentialDefinition) throw new CredoError(`Credential definition not found for id ${credentialDefinitionId}: ${result.resolutionMetadata.message}`);
|
|
18
|
+
const indyNamespace = result.credentialDefinitionMetadata.didIndyNamespace;
|
|
19
|
+
return {
|
|
20
|
+
credentialDefinition: result.credentialDefinition,
|
|
21
|
+
credentialDefinitionId,
|
|
22
|
+
indyNamespace: indyNamespace && typeof indyNamespace === "string" ? indyNamespace : void 0
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
async function fetchRevocationRegistryDefinition(agentContext, revocationRegistryDefinitionId) {
|
|
26
|
+
const result = await agentContext.dependencyManager.resolve(AnonCredsRegistryService).getRegistryForIdentifier(agentContext, revocationRegistryDefinitionId).getRevocationRegistryDefinition(agentContext, revocationRegistryDefinitionId);
|
|
27
|
+
if (!result || !result.revocationRegistryDefinition) throw new CredoError(`RevocationRegistryDefinition not found for id ${revocationRegistryDefinitionId}: ${result.resolutionMetadata.message}`);
|
|
28
|
+
const indyNamespace = result.revocationRegistryDefinitionMetadata.didIndyNamespace;
|
|
29
|
+
return {
|
|
30
|
+
revocationRegistryDefinition: result.revocationRegistryDefinition,
|
|
31
|
+
revocationRegistryDefinitionId,
|
|
32
|
+
indyNamespace: indyNamespace && typeof indyNamespace === "string" ? indyNamespace : void 0
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
async function fetchRevocationStatusList(agentContext, revocationRegistryId, timestamp) {
|
|
36
|
+
const { revocationStatusList, resolutionMetadata } = await agentContext.dependencyManager.resolve(AnonCredsRegistryService).getRegistryForIdentifier(agentContext, revocationRegistryId).getRevocationStatusList(agentContext, revocationRegistryId, timestamp);
|
|
37
|
+
if (!revocationStatusList) throw new CredoError(`Could not retrieve revocation status list for revocation registry ${revocationRegistryId}: ${resolutionMetadata.message}`);
|
|
38
|
+
return { revocationStatusList };
|
|
39
|
+
}
|
|
40
|
+
async function fetchSchemas(agentContext, schemaIds) {
|
|
41
|
+
const schemaFetchPromises = [...schemaIds].map(async (schemaId) => {
|
|
42
|
+
const { schema } = await fetchSchema(agentContext, schemaId);
|
|
43
|
+
return [schemaId, schema];
|
|
44
|
+
});
|
|
45
|
+
return Object.fromEntries(await Promise.all(schemaFetchPromises));
|
|
46
|
+
}
|
|
47
|
+
async function fetchCredentialDefinitions(agentContext, credentialDefinitionIds) {
|
|
48
|
+
const credentialDefinitionEntries = [...credentialDefinitionIds].map(async (credentialDefinitionId) => {
|
|
49
|
+
const { credentialDefinition } = await fetchCredentialDefinition(agentContext, credentialDefinitionId);
|
|
50
|
+
return [credentialDefinitionId, credentialDefinition];
|
|
51
|
+
});
|
|
52
|
+
return Object.fromEntries(await Promise.all(credentialDefinitionEntries));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
export { fetchCredentialDefinition, fetchCredentialDefinitions, fetchRevocationRegistryDefinition, fetchRevocationStatusList, fetchSchema, fetchSchemas };
|
|
57
|
+
//# sourceMappingURL=anonCredsObjects.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anonCredsObjects.mjs","names":[],"sources":["../../src/utils/anonCredsObjects.ts"],"sourcesContent":["import type { AgentContext } from '@credo-ts/core'\nimport { CredoError } from '@credo-ts/core'\nimport type { AnonCredsCredentialDefinition, AnonCredsRevocationStatusList, AnonCredsSchema } from '../models'\n\nimport { AnonCredsRegistryService } from '../services'\n\nexport async function fetchSchema(agentContext: AgentContext, schemaId: string) {\n const registryService = agentContext.dependencyManager.resolve(AnonCredsRegistryService)\n\n const result = await registryService\n .getRegistryForIdentifier(agentContext, schemaId)\n .getSchema(agentContext, schemaId)\n\n if (!result || !result.schema) {\n throw new CredoError(`Schema not found for id ${schemaId}: ${result.resolutionMetadata.message}`)\n }\n\n return {\n schema: result.schema,\n schemaId: result.schemaId,\n indyNamespace: result.schemaMetadata.didIndyNamespace as string | undefined,\n }\n}\n\nexport async function fetchCredentialDefinition(agentContext: AgentContext, credentialDefinitionId: string) {\n const registryService = agentContext.dependencyManager.resolve(AnonCredsRegistryService)\n\n const result = await registryService\n .getRegistryForIdentifier(agentContext, credentialDefinitionId)\n .getCredentialDefinition(agentContext, credentialDefinitionId)\n\n if (!result || !result.credentialDefinition) {\n throw new CredoError(\n `Credential definition not found for id ${credentialDefinitionId}: ${result.resolutionMetadata.message}`\n )\n }\n\n const indyNamespace = result.credentialDefinitionMetadata.didIndyNamespace\n\n return {\n credentialDefinition: result.credentialDefinition,\n credentialDefinitionId,\n indyNamespace: indyNamespace && typeof indyNamespace === 'string' ? indyNamespace : undefined,\n }\n}\n\nexport async function fetchRevocationRegistryDefinition(\n agentContext: AgentContext,\n revocationRegistryDefinitionId: string\n) {\n const registryService = agentContext.dependencyManager.resolve(AnonCredsRegistryService)\n\n const result = await registryService\n .getRegistryForIdentifier(agentContext, revocationRegistryDefinitionId)\n .getRevocationRegistryDefinition(agentContext, revocationRegistryDefinitionId)\n\n if (!result || !result.revocationRegistryDefinition) {\n throw new CredoError(\n `RevocationRegistryDefinition not found for id ${revocationRegistryDefinitionId}: ${result.resolutionMetadata.message}`\n )\n }\n\n const indyNamespace = result.revocationRegistryDefinitionMetadata.didIndyNamespace\n\n return {\n revocationRegistryDefinition: result.revocationRegistryDefinition,\n revocationRegistryDefinitionId,\n indyNamespace: indyNamespace && typeof indyNamespace === 'string' ? indyNamespace : undefined,\n }\n}\n\nexport async function fetchRevocationStatusList(\n agentContext: AgentContext,\n revocationRegistryId: string,\n timestamp: number\n): Promise<{ revocationStatusList: AnonCredsRevocationStatusList }> {\n const registry = agentContext.dependencyManager\n .resolve(AnonCredsRegistryService)\n .getRegistryForIdentifier(agentContext, revocationRegistryId)\n\n const { revocationStatusList, resolutionMetadata } = await registry.getRevocationStatusList(\n agentContext,\n revocationRegistryId,\n timestamp\n )\n\n if (!revocationStatusList) {\n throw new CredoError(\n `Could not retrieve revocation status list for revocation registry ${revocationRegistryId}: ${resolutionMetadata.message}`\n )\n }\n\n return { revocationStatusList }\n}\n\nexport async function fetchSchemas(agentContext: AgentContext, schemaIds: Set<string>) {\n const schemaFetchPromises = [...schemaIds].map(async (schemaId): Promise<[string, AnonCredsSchema]> => {\n const { schema } = await fetchSchema(agentContext, schemaId)\n return [schemaId, schema]\n })\n\n const schemas = Object.fromEntries(await Promise.all(schemaFetchPromises))\n return schemas\n}\n\nexport async function fetchCredentialDefinitions(agentContext: AgentContext, credentialDefinitionIds: Set<string>) {\n const credentialDefinitionEntries = [...credentialDefinitionIds].map(\n async (credentialDefinitionId): Promise<[string, AnonCredsCredentialDefinition]> => {\n const { credentialDefinition } = await fetchCredentialDefinition(agentContext, credentialDefinitionId)\n return [credentialDefinitionId, credentialDefinition]\n }\n )\n\n const credentialDefinitions = Object.fromEntries(await Promise.all(credentialDefinitionEntries))\n return credentialDefinitions\n}\n"],"mappings":";;;;;AAMA,eAAsB,YAAY,cAA4B,UAAkB;CAG9E,MAAM,SAAS,MAFS,aAAa,kBAAkB,QAAQ,yBAAyB,CAGrF,yBAAyB,cAAc,SAAS,CAChD,UAAU,cAAc,SAAS;AAEpC,KAAI,CAAC,UAAU,CAAC,OAAO,OACrB,OAAM,IAAI,WAAW,2BAA2B,SAAS,IAAI,OAAO,mBAAmB,UAAU;AAGnG,QAAO;EACL,QAAQ,OAAO;EACf,UAAU,OAAO;EACjB,eAAe,OAAO,eAAe;EACtC;;AAGH,eAAsB,0BAA0B,cAA4B,wBAAgC;CAG1G,MAAM,SAAS,MAFS,aAAa,kBAAkB,QAAQ,yBAAyB,CAGrF,yBAAyB,cAAc,uBAAuB,CAC9D,wBAAwB,cAAc,uBAAuB;AAEhE,KAAI,CAAC,UAAU,CAAC,OAAO,qBACrB,OAAM,IAAI,WACR,0CAA0C,uBAAuB,IAAI,OAAO,mBAAmB,UAChG;CAGH,MAAM,gBAAgB,OAAO,6BAA6B;AAE1D,QAAO;EACL,sBAAsB,OAAO;EAC7B;EACA,eAAe,iBAAiB,OAAO,kBAAkB,WAAW,gBAAgB;EACrF;;AAGH,eAAsB,kCACpB,cACA,gCACA;CAGA,MAAM,SAAS,MAFS,aAAa,kBAAkB,QAAQ,yBAAyB,CAGrF,yBAAyB,cAAc,+BAA+B,CACtE,gCAAgC,cAAc,+BAA+B;AAEhF,KAAI,CAAC,UAAU,CAAC,OAAO,6BACrB,OAAM,IAAI,WACR,iDAAiD,+BAA+B,IAAI,OAAO,mBAAmB,UAC/G;CAGH,MAAM,gBAAgB,OAAO,qCAAqC;AAElE,QAAO;EACL,8BAA8B,OAAO;EACrC;EACA,eAAe,iBAAiB,OAAO,kBAAkB,WAAW,gBAAgB;EACrF;;AAGH,eAAsB,0BACpB,cACA,sBACA,WACkE;CAKlE,MAAM,EAAE,sBAAsB,uBAAuB,MAJpC,aAAa,kBAC3B,QAAQ,yBAAyB,CACjC,yBAAyB,cAAc,qBAAqB,CAEK,wBAClE,cACA,sBACA,UACD;AAED,KAAI,CAAC,qBACH,OAAM,IAAI,WACR,qEAAqE,qBAAqB,IAAI,mBAAmB,UAClH;AAGH,QAAO,EAAE,sBAAsB;;AAGjC,eAAsB,aAAa,cAA4B,WAAwB;CACrF,MAAM,sBAAsB,CAAC,GAAG,UAAU,CAAC,IAAI,OAAO,aAAiD;EACrG,MAAM,EAAE,WAAW,MAAM,YAAY,cAAc,SAAS;AAC5D,SAAO,CAAC,UAAU,OAAO;GACzB;AAGF,QADgB,OAAO,YAAY,MAAM,QAAQ,IAAI,oBAAoB,CAAC;;AAI5E,eAAsB,2BAA2B,cAA4B,yBAAsC;CACjH,MAAM,8BAA8B,CAAC,GAAG,wBAAwB,CAAC,IAC/D,OAAO,2BAA6E;EAClF,MAAM,EAAE,yBAAyB,MAAM,0BAA0B,cAAc,uBAAuB;AACtG,SAAO,CAAC,wBAAwB,qBAAqB;GAExD;AAGD,QAD8B,OAAO,YAAY,MAAM,QAAQ,IAAI,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../models/index.mjs";
|