@credo-ts/anoncreds 0.6.1-pr-2091-20241119140918 → 0.6.1
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 @@
|
|
|
1
|
+
{"version":3,"file":"LegacyIndyDidCommCredentialFormatService.mjs","names":[],"sources":["../../src/formats/LegacyIndyDidCommCredentialFormatService.ts"],"sourcesContent":["import type { AgentContext } from '@credo-ts/core'\nimport { CredoError, JsonEncoder, JsonTransformer, MessageValidator } from '@credo-ts/core'\nimport type {\n DidCommCredentialExchangeRecord,\n DidCommCredentialFormatAcceptOfferOptions,\n DidCommCredentialFormatAcceptProposalOptions,\n DidCommCredentialFormatAcceptRequestOptions,\n DidCommCredentialFormatAutoRespondCredentialOptions,\n DidCommCredentialFormatAutoRespondOfferOptions,\n DidCommCredentialFormatAutoRespondProposalOptions,\n DidCommCredentialFormatAutoRespondRequestOptions,\n DidCommCredentialFormatCreateOfferOptions,\n DidCommCredentialFormatCreateOfferReturn,\n DidCommCredentialFormatCreateProposalOptions,\n DidCommCredentialFormatCreateProposalReturn,\n DidCommCredentialFormatCreateReturn,\n DidCommCredentialFormatProcessCredentialOptions,\n DidCommCredentialFormatProcessOptions,\n DidCommCredentialFormatService,\n DidCommCredentialPreviewAttributeOptions,\n} from '@credo-ts/didcomm'\nimport {\n DidCommAttachment,\n DidCommCredentialFormatSpec,\n DidCommCredentialProblemReportReason,\n DidCommProblemReportError,\n} from '@credo-ts/didcomm'\nimport type { AnonCredsCredential, AnonCredsCredentialOffer, AnonCredsCredentialRequest } from '../models'\nimport { AnonCredsCredentialProposal } from '../models/AnonCredsCredentialProposal'\nimport type { AnonCredsHolderService, AnonCredsIssuerService } from '../services'\nimport { AnonCredsHolderServiceSymbol, AnonCredsIssuerServiceSymbol } from '../services'\nimport { fetchCredentialDefinition, fetchRevocationRegistryDefinition, fetchSchema } from '../utils'\nimport {\n assertAttributesMatch,\n assertCredentialValuesMatch,\n checkCredentialValuesMatch,\n convertAttributesToCredentialValues,\n} from '../utils/credential'\nimport { isUnqualifiedCredentialDefinitionId, isUnqualifiedSchemaId } from '../utils/indyIdentifiers'\nimport type { AnonCredsCredentialMetadata, AnonCredsCredentialRequestMetadata } from '../utils/metadata'\nimport { AnonCredsCredentialMetadataKey, AnonCredsCredentialRequestMetadataKey } from '../utils/metadata'\nimport { generateLegacyProverDidLikeString } from '../utils/proverDid'\nimport { getStoreCredentialOptions } from '../utils/w3cAnonCredsUtils'\nimport type {\n LegacyIndyCredentialFormat,\n LegacyIndyDidCommCredentialProposalFormat,\n} from './LegacyIndyDidCommCredentialFormat'\n\nconst INDY_CRED_ABSTRACT = 'hlindy/cred-abstract@v2.0'\nconst INDY_CRED_REQUEST = 'hlindy/cred-req@v2.0'\nconst INDY_CRED_FILTER = 'hlindy/cred-filter@v2.0'\nconst INDY_CRED = 'hlindy/cred@v2.0'\n\nexport class LegacyIndyDidCommCredentialFormatService\n implements DidCommCredentialFormatService<LegacyIndyCredentialFormat>\n{\n /** formatKey is the key used when calling agent.credentials.xxx with credentialFormats.indy */\n public readonly formatKey = 'indy' as const\n\n /**\n * credentialRecordType is the type of record that stores the credential. It is stored in the credential\n * record binding in the credential exchange record.\n */\n public readonly credentialRecordType = 'w3c' as const\n\n private hasLoggedWarning = false\n private ensureWarningLoggedOnce(agentContext: AgentContext) {\n if (this.hasLoggedWarning) return\n\n agentContext.config.logger.debug(\n \"The 'LegacyIndyDidCommCredentialFormatService' is deprecated and will be removed in version 0.7 of Credo. You should upgrade to the 'AnonCredsDidCommCredentialFormatService' instead.\"\n )\n this.hasLoggedWarning = true\n }\n\n /**\n * Create a {@link AttachmentFormats} object dependent on the message type.\n *\n * @param options The object containing all the options for the proposed credential\n * @returns object containing associated attachment, format and optionally the credential preview\n *\n */\n public async createProposal(\n agentContext: AgentContext,\n {\n credentialFormats,\n credentialExchangeRecord,\n }: DidCommCredentialFormatCreateProposalOptions<LegacyIndyCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateProposalReturn> {\n this.ensureWarningLoggedOnce(agentContext)\n const format = new DidCommCredentialFormatSpec({\n format: INDY_CRED_FILTER,\n })\n\n const indyFormat = credentialFormats.indy\n\n if (!indyFormat) {\n throw new CredoError('Missing indy payload in createProposal')\n }\n\n const { attributes, ...indyCredentialProposal } = indyFormat\n const proposal = new AnonCredsCredentialProposal(indyCredentialProposal)\n\n try {\n MessageValidator.validateSync(proposal)\n } catch (_error) {\n throw new CredoError(`Invalid proposal supplied: ${indyCredentialProposal} in Indy Format Service`)\n }\n\n const attachment = this.getFormatData(JsonTransformer.toJSON(proposal), format.attachmentId)\n\n // Set the metadata\n credentialExchangeRecord.metadata.set<AnonCredsCredentialMetadata>(AnonCredsCredentialMetadataKey, {\n schemaId: proposal.schemaId,\n credentialDefinitionId: proposal.credentialDefinitionId,\n })\n\n return { format, attachment, previewAttributes: attributes }\n }\n\n public async processProposal(\n agentContext: AgentContext,\n { attachment }: DidCommCredentialFormatProcessOptions\n ): Promise<void> {\n this.ensureWarningLoggedOnce(agentContext)\n const proposalJson = attachment.getDataAsJson()\n\n JsonTransformer.fromJSON(proposalJson, AnonCredsCredentialProposal)\n }\n\n public async acceptProposal(\n agentContext: AgentContext,\n {\n attachmentId,\n credentialFormats,\n credentialExchangeRecord,\n proposalAttachment,\n }: DidCommCredentialFormatAcceptProposalOptions<LegacyIndyCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateOfferReturn> {\n this.ensureWarningLoggedOnce(agentContext)\n const indyFormat = credentialFormats?.indy\n\n const proposalJson = proposalAttachment.getDataAsJson<LegacyIndyDidCommCredentialProposalFormat>()\n const credentialDefinitionId = indyFormat?.credentialDefinitionId ?? proposalJson.cred_def_id\n\n const attributes = indyFormat?.attributes ?? credentialExchangeRecord.credentialAttributes\n\n if (!credentialDefinitionId) {\n throw new CredoError('No credential definition id in proposal or provided as input to accept proposal method.')\n }\n\n if (!isUnqualifiedCredentialDefinitionId(credentialDefinitionId)) {\n throw new CredoError(`${credentialDefinitionId} is not a valid legacy indy credential definition id`)\n }\n\n if (!attributes) {\n throw new CredoError('No attributes in proposal or provided as input to accept proposal method.')\n }\n\n const { format, attachment, previewAttributes } = await this.createIndyOffer(agentContext, {\n credentialExchangeRecord,\n attachmentId,\n attributes,\n credentialDefinitionId,\n })\n\n return { format, attachment, previewAttributes }\n }\n\n /**\n * Create a credential attachment format for a credential request.\n *\n * @param options The object containing all the options for the credential offer\n * @returns object containing associated attachment, formats and offersAttach elements\n *\n */\n public async createOffer(\n agentContext: AgentContext,\n {\n credentialFormats,\n credentialExchangeRecord,\n attachmentId,\n }: DidCommCredentialFormatCreateOfferOptions<LegacyIndyCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateOfferReturn> {\n this.ensureWarningLoggedOnce(agentContext)\n const indyFormat = credentialFormats.indy\n\n if (!indyFormat) {\n throw new CredoError('Missing indy credentialFormat data')\n }\n\n const { format, attachment, previewAttributes } = await this.createIndyOffer(agentContext, {\n credentialExchangeRecord,\n attachmentId,\n attributes: indyFormat.attributes,\n credentialDefinitionId: indyFormat.credentialDefinitionId,\n })\n\n return { format, attachment, previewAttributes }\n }\n\n public async processOffer(\n agentContext: AgentContext,\n { attachment, credentialExchangeRecord }: DidCommCredentialFormatProcessOptions\n ) {\n this.ensureWarningLoggedOnce(agentContext)\n agentContext.config.logger.debug(\n `Processing indy credential offer for credential record ${credentialExchangeRecord.id}`\n )\n\n const credOffer = attachment.getDataAsJson<AnonCredsCredentialOffer>()\n\n if (!isUnqualifiedSchemaId(credOffer.schema_id) || !isUnqualifiedCredentialDefinitionId(credOffer.cred_def_id)) {\n throw new DidCommProblemReportError('Invalid credential offer', {\n problemCode: DidCommCredentialProblemReportReason.IssuanceAbandoned,\n })\n }\n }\n\n public async acceptOffer(\n agentContext: AgentContext,\n {\n credentialExchangeRecord,\n attachmentId,\n offerAttachment,\n credentialFormats,\n }: DidCommCredentialFormatAcceptOfferOptions<LegacyIndyCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateReturn> {\n this.ensureWarningLoggedOnce(agentContext)\n const holderService = agentContext.dependencyManager.resolve<AnonCredsHolderService>(AnonCredsHolderServiceSymbol)\n\n const credentialOffer = offerAttachment.getDataAsJson<AnonCredsCredentialOffer>()\n\n if (!isUnqualifiedCredentialDefinitionId(credentialOffer.cred_def_id)) {\n throw new CredoError(`${credentialOffer.cred_def_id} is not a valid legacy indy credential definition id`)\n }\n // Get credential definition\n const { credentialDefinition } = await fetchCredentialDefinition(agentContext, credentialOffer.cred_def_id)\n\n const { credentialRequest, credentialRequestMetadata } = await holderService.createCredentialRequest(agentContext, {\n credentialOffer,\n credentialDefinition,\n linkSecretId: credentialFormats?.indy?.linkSecretId,\n useLegacyProverDid: true,\n })\n\n if (!credentialRequest.prover_did) {\n // We just generate a prover did like string, as it's not used for anything and we don't need\n // to prove ownership of the did. It's deprecated in AnonCreds v1, but kept for backwards compatibility\n credentialRequest.prover_did = generateLegacyProverDidLikeString()\n }\n\n credentialExchangeRecord.metadata.set<AnonCredsCredentialRequestMetadata>(\n AnonCredsCredentialRequestMetadataKey,\n credentialRequestMetadata\n )\n credentialExchangeRecord.metadata.set<AnonCredsCredentialMetadata>(AnonCredsCredentialMetadataKey, {\n credentialDefinitionId: credentialOffer.cred_def_id,\n schemaId: credentialOffer.schema_id,\n })\n\n const format = new DidCommCredentialFormatSpec({\n attachmentId,\n format: INDY_CRED_REQUEST,\n })\n\n const attachment = this.getFormatData(credentialRequest, format.attachmentId)\n return { format, attachment }\n }\n\n /**\n * Starting from a request is not supported for indy credentials, this method only throws an error.\n */\n public async createRequest(): Promise<DidCommCredentialFormatCreateReturn> {\n throw new CredoError('Starting from a request is not supported for indy credentials')\n }\n\n /**\n * We don't have any models to validate an indy request object, for now this method does nothing\n */\n public async processRequest(\n agentContext: AgentContext,\n _options: DidCommCredentialFormatProcessOptions\n ): Promise<void> {\n this.ensureWarningLoggedOnce(agentContext)\n // not needed for Indy\n }\n\n public async acceptRequest(\n agentContext: AgentContext,\n {\n credentialExchangeRecord,\n attachmentId,\n offerAttachment,\n requestAttachment,\n }: DidCommCredentialFormatAcceptRequestOptions<LegacyIndyCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateReturn> {\n this.ensureWarningLoggedOnce(agentContext)\n // Assert credential attributes\n const credentialAttributes = credentialExchangeRecord.credentialAttributes\n if (!credentialAttributes) {\n throw new CredoError(\n `Missing required credential attribute values on credential record with id ${credentialExchangeRecord.id}`\n )\n }\n\n const anonCredsIssuerService =\n agentContext.dependencyManager.resolve<AnonCredsIssuerService>(AnonCredsIssuerServiceSymbol)\n\n const credentialOffer = offerAttachment?.getDataAsJson<AnonCredsCredentialOffer>()\n if (!credentialOffer) throw new CredoError('Missing indy credential offer in createCredential')\n\n const credentialRequest = requestAttachment.getDataAsJson<AnonCredsCredentialRequest>()\n if (!credentialRequest) throw new CredoError('Missing indy credential request in createCredential')\n\n const { credential } = await anonCredsIssuerService.createCredential(agentContext, {\n credentialOffer,\n credentialRequest,\n credentialValues: convertAttributesToCredentialValues(credentialAttributes),\n })\n\n const format = new DidCommCredentialFormatSpec({\n attachmentId,\n format: INDY_CRED,\n })\n\n const attachment = this.getFormatData(credential, format.attachmentId)\n return { format, attachment }\n }\n\n /**\n * Processes an incoming credential - retrieve metadata, retrieve payload and store it in the Indy wallet\n * @param options the issue credential message wrapped inside this object\n * @param credentialExchangeRecord the credential exchange record for this credential\n */\n public async processCredential(\n agentContext: AgentContext,\n { credentialExchangeRecord, attachment }: DidCommCredentialFormatProcessCredentialOptions\n ): Promise<void> {\n this.ensureWarningLoggedOnce(agentContext)\n const credentialRequestMetadata = credentialExchangeRecord.metadata.get<AnonCredsCredentialRequestMetadata>(\n AnonCredsCredentialRequestMetadataKey\n )\n\n const anonCredsHolderService =\n agentContext.dependencyManager.resolve<AnonCredsHolderService>(AnonCredsHolderServiceSymbol)\n\n if (!credentialRequestMetadata) {\n throw new CredoError(\n `Missing required request metadata for credential exchange with thread id with id ${credentialExchangeRecord.id}`\n )\n }\n\n if (!credentialExchangeRecord.credentialAttributes) {\n throw new CredoError('Missing credential attributes on credential record. Unable to check credential attributes')\n }\n\n const anonCredsCredential = attachment.getDataAsJson<AnonCredsCredential>()\n\n const { credentialDefinition, credentialDefinitionId } = await fetchCredentialDefinition(\n agentContext,\n anonCredsCredential.cred_def_id\n )\n\n const { schema, indyNamespace } = await fetchSchema(agentContext, anonCredsCredential.schema_id)\n\n // Resolve revocation registry if credential is revocable\n const revocationRegistryResult = anonCredsCredential.rev_reg_id\n ? await fetchRevocationRegistryDefinition(agentContext, anonCredsCredential.rev_reg_id)\n : undefined\n\n // assert the credential values match the offer values\n const recordCredentialValues = convertAttributesToCredentialValues(credentialExchangeRecord.credentialAttributes)\n assertCredentialValuesMatch(anonCredsCredential.values, recordCredentialValues)\n\n const storeCredentialOptions = getStoreCredentialOptions(\n {\n credential: anonCredsCredential,\n credentialRequestMetadata,\n credentialDefinition,\n schema,\n credentialDefinitionId,\n revocationRegistry: revocationRegistryResult?.revocationRegistryDefinition\n ? {\n id: revocationRegistryResult.revocationRegistryDefinitionId,\n definition: revocationRegistryResult.revocationRegistryDefinition,\n }\n : undefined,\n },\n indyNamespace\n )\n\n const credentialId = await anonCredsHolderService.storeCredential(agentContext, storeCredentialOptions)\n\n // If the credential is revocable, store the revocation identifiers in the credential record\n if (anonCredsCredential.rev_reg_id) {\n const credential = await anonCredsHolderService.getCredential(agentContext, { id: credentialId })\n\n credentialExchangeRecord.metadata.add<AnonCredsCredentialMetadata>(AnonCredsCredentialMetadataKey, {\n credentialRevocationId: credential.credentialRevocationId ?? undefined,\n revocationRegistryId: credential.revocationRegistryId ?? undefined,\n })\n credentialExchangeRecord.setTags({\n anonCredsRevocationRegistryId: credential.revocationRegistryId,\n anonCredsUnqualifiedRevocationRegistryId: anonCredsCredential.rev_reg_id,\n anonCredsCredentialRevocationId: credential.credentialRevocationId,\n })\n }\n\n credentialExchangeRecord.credentials.push({\n credentialRecordType: this.credentialRecordType,\n credentialRecordId: credentialId,\n })\n }\n\n public supportsFormat(format: string): boolean {\n const supportedFormats = [INDY_CRED_ABSTRACT, INDY_CRED_REQUEST, INDY_CRED_FILTER, INDY_CRED]\n\n return supportedFormats.includes(format)\n }\n\n /**\n * Gets the attachment object for a given attachmentId. We need to get out the correct attachmentId for\n * indy and then find the corresponding attachment (if there is one)\n * @param formats the formats object containing the attachmentId\n * @param messageAttachments the attachments containing the payload\n * @returns The DidCommAttachment if found or undefined\n *\n */\n public getAttachment(\n formats: DidCommCredentialFormatSpec[],\n messageAttachments: DidCommAttachment[]\n ): DidCommAttachment | undefined {\n const supportedAttachmentIds = formats.filter((f) => this.supportsFormat(f.format)).map((f) => f.attachmentId)\n const supportedAttachment = messageAttachments.find((attachment) => supportedAttachmentIds.includes(attachment.id))\n\n return supportedAttachment\n }\n\n public async deleteCredentialById(agentContext: AgentContext, credentialRecordId: string): Promise<void> {\n const anonCredsHolderService =\n agentContext.dependencyManager.resolve<AnonCredsHolderService>(AnonCredsHolderServiceSymbol)\n\n await anonCredsHolderService.deleteCredential(agentContext, credentialRecordId)\n }\n\n public async shouldAutoRespondToProposal(\n _agentContext: AgentContext,\n { offerAttachment, proposalAttachment }: DidCommCredentialFormatAutoRespondProposalOptions\n ) {\n const proposalJson = proposalAttachment.getDataAsJson<LegacyIndyDidCommCredentialProposalFormat>()\n const offerJson = offerAttachment.getDataAsJson<AnonCredsCredentialOffer>()\n\n // We want to make sure the credential definition matches.\n // TODO: If no credential definition is present on the proposal, we could check whether the other fields\n // of the proposal match with the credential definition id.\n return proposalJson.cred_def_id === offerJson.cred_def_id\n }\n\n public async shouldAutoRespondToOffer(\n _agentContext: AgentContext,\n { offerAttachment, proposalAttachment }: DidCommCredentialFormatAutoRespondOfferOptions\n ) {\n const proposalJson = proposalAttachment.getDataAsJson<LegacyIndyDidCommCredentialProposalFormat>()\n const offerJson = offerAttachment.getDataAsJson<AnonCredsCredentialOffer>()\n\n // We want to make sure the credential definition matches.\n // TODO: If no credential definition is present on the proposal, we could check whether the other fields\n // of the proposal match with the credential definition id.\n return proposalJson.cred_def_id === offerJson.cred_def_id\n }\n\n public async shouldAutoRespondToRequest(\n _agentContext: AgentContext,\n { offerAttachment, requestAttachment }: DidCommCredentialFormatAutoRespondRequestOptions\n ) {\n const credentialOfferJson = offerAttachment.getDataAsJson<AnonCredsCredentialOffer>()\n const credentialRequestJson = requestAttachment.getDataAsJson<AnonCredsCredentialRequest>()\n\n return credentialOfferJson.cred_def_id === credentialRequestJson.cred_def_id\n }\n\n public async shouldAutoRespondToCredential(\n _agentContext: AgentContext,\n {\n credentialExchangeRecord,\n requestAttachment,\n credentialAttachment,\n }: DidCommCredentialFormatAutoRespondCredentialOptions\n ) {\n const credentialJson = credentialAttachment.getDataAsJson<AnonCredsCredential>()\n const credentialRequestJson = requestAttachment.getDataAsJson<AnonCredsCredentialRequest>()\n\n // make sure the credential definition matches\n if (credentialJson.cred_def_id !== credentialRequestJson.cred_def_id) return false\n\n // If we don't have any attributes stored we can't compare so always return false.\n if (!credentialExchangeRecord.credentialAttributes) return false\n const attributeValues = convertAttributesToCredentialValues(credentialExchangeRecord.credentialAttributes)\n\n // check whether the values match the values in the record\n return checkCredentialValuesMatch(attributeValues, credentialJson.values)\n }\n\n private async createIndyOffer(\n agentContext: AgentContext,\n {\n credentialExchangeRecord,\n attachmentId,\n credentialDefinitionId,\n attributes,\n }: {\n credentialDefinitionId: string\n credentialExchangeRecord: DidCommCredentialExchangeRecord\n attachmentId?: string\n attributes: DidCommCredentialPreviewAttributeOptions[]\n }\n ): Promise<DidCommCredentialFormatCreateOfferReturn> {\n const anonCredsIssuerService =\n agentContext.dependencyManager.resolve<AnonCredsIssuerService>(AnonCredsIssuerServiceSymbol)\n\n // if the proposal has an attachment Id use that, otherwise the generated id of the formats object\n const format = new DidCommCredentialFormatSpec({\n attachmentId: attachmentId,\n format: INDY_CRED_ABSTRACT,\n })\n\n const offer = await anonCredsIssuerService.createCredentialOffer(agentContext, {\n credentialDefinitionId,\n })\n\n await this.assertPreviewAttributesMatchSchemaAttributes(agentContext, offer, attributes)\n\n credentialExchangeRecord.metadata.set<AnonCredsCredentialMetadata>(AnonCredsCredentialMetadataKey, {\n schemaId: offer.schema_id,\n credentialDefinitionId: offer.cred_def_id,\n })\n\n const attachment = this.getFormatData(offer, format.attachmentId)\n\n return { format, attachment, previewAttributes: attributes }\n }\n\n private async assertPreviewAttributesMatchSchemaAttributes(\n agentContext: AgentContext,\n offer: AnonCredsCredentialOffer,\n attributes: DidCommCredentialPreviewAttributeOptions[]\n ): Promise<void> {\n const { schema } = await fetchSchema(agentContext, offer.schema_id)\n assertAttributesMatch(schema, attributes)\n }\n\n /**\n * Returns an object of type {@link DidCommAttachment} for use in credential exchange messages.\n * It looks up the correct format identifier and encodes the data as a base64 attachment.\n *\n * @param data The data to include in the attach object\n * @param id the attach id from the formats component of the message\n */\n public getFormatData(data: unknown, id: string): DidCommAttachment {\n const attachment = new DidCommAttachment({\n id,\n mimeType: 'application/json',\n data: {\n base64: JsonEncoder.toBase64(data),\n },\n })\n\n return attachment\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgDA,MAAM,qBAAqB;AAC3B,MAAM,oBAAoB;AAC1B,MAAM,mBAAmB;AACzB,MAAM,YAAY;AAElB,IAAa,2CAAb,MAEA;;OAEkB,YAAY;OAMZ,uBAAuB;OAE/B,mBAAmB;;CAC3B,AAAQ,wBAAwB,cAA4B;AAC1D,MAAI,KAAK,iBAAkB;AAE3B,eAAa,OAAO,OAAO,MACzB,yLACD;AACD,OAAK,mBAAmB;;;;;;;;;CAU1B,MAAa,eACX,cACA,EACE,mBACA,4BAEoD;AACtD,OAAK,wBAAwB,aAAa;EAC1C,MAAM,SAAS,IAAI,4BAA4B,EAC7C,QAAQ,kBACT,CAAC;EAEF,MAAM,aAAa,kBAAkB;AAErC,MAAI,CAAC,WACH,OAAM,IAAI,WAAW,yCAAyC;EAGhE,MAAM,EAAE,YAAY,GAAG,2BAA2B;EAClD,MAAM,WAAW,IAAI,4BAA4B,uBAAuB;AAExE,MAAI;AACF,oBAAiB,aAAa,SAAS;WAChC,QAAQ;AACf,SAAM,IAAI,WAAW,8BAA8B,uBAAuB,yBAAyB;;EAGrG,MAAM,aAAa,KAAK,cAAc,gBAAgB,OAAO,SAAS,EAAE,OAAO,aAAa;AAG5F,2BAAyB,SAAS,IAAiC,gCAAgC;GACjG,UAAU,SAAS;GACnB,wBAAwB,SAAS;GA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kB,eAA2C;AAE3F,SAAO,oBAAoB,gBAAgB,sBAAsB;;CAGnE,MAAa,8BACX,eACA,EACE,0BACA,mBACA,wBAEF;EACA,MAAM,iBAAiB,qBAAqB,eAAoC;EAChF,MAAM,wBAAwB,kBAAkB,eAA2C;AAG3F,MAAI,eAAe,gBAAgB,sBAAsB,YAAa,QAAO;AAG7E,MAAI,CAAC,yBAAyB,qBAAsB,QAAO;AAI3D,SAAO,2BAHiB,oCAAoC,yBAAyB,qBAAqB,EAGvD,eAAe,OAAO;;CAG3E,MAAc,gBACZ,cACA,EACE,0BACA,cACA,wBACA,cAOiD;EACnD,MAAM,yBACJ,aAAa,kBAAkB,QAAgC,6BAA6B;EAG9F,MAAM,SAAS,IAAI,4BAA4B;GAC/B;GACd,QAAQ;GACT,CAAC;EAEF,MAAM,QAAQ,MAAM,uBAAuB,sBAAsB,cAAc,EAC7E,wBACD,CAAC;AAEF,QAAM,KAAK,6CAA6C,cAAc,OAAO,WAAW;AAExF,2BAAyB,SAAS,IAAiC,gCAAgC;GACjG,UAAU,MAAM;GAChB,wBAAwB,MAAM;GAC/B,CAAC;AAIF,SAAO;GAAE;GAAQ,YAFE,KAAK,cAAc,OAAO,OAAO,aAAa;GAEpC,mBAAmB;GAAY;;CAG9D,MAAc,6CACZ,cACA,OACA,YACe;EACf,MAAM,EAAE,WAAW,MAAM,YAAY,cAAc,MAAM,UAAU;AACnE,wBAAsB,QAAQ,WAAW;;;;;;;;;CAU3C,AAAO,cAAc,MAAe,IAA+B;AASjE,SARmB,IAAI,kBAAkB;GACvC;GACA,UAAU;GACV,MAAM,EACJ,QAAQ,YAAY,SAAS,KAAK,EACnC;GACF,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AnonCredsProof, AnonCredsProofRequest } from "../models/exchange.mjs";
|
|
2
|
+
import { AnonCredsSelectedCredentials } from "../models/internal.mjs";
|
|
3
|
+
import "../models/index.mjs";
|
|
4
|
+
import { AnonCredsCredentialsForProofRequest, AnonCredsGetCredentialsForProofRequestOptions, AnonCredsProposeProofFormat, AnonCredsRequestProofFormat } from "./AnonCredsDidCommProofFormat.mjs";
|
|
5
|
+
import { DidCommProofFormat } from "@credo-ts/didcomm";
|
|
6
|
+
|
|
7
|
+
//#region src/formats/LegacyIndyDidCommProofFormat.d.ts
|
|
8
|
+
type LegacyIndyProofRequest = AnonCredsProofRequest;
|
|
9
|
+
interface LegacyIndyDidCommProofFormat extends DidCommProofFormat {
|
|
10
|
+
formatKey: 'indy';
|
|
11
|
+
proofFormats: {
|
|
12
|
+
createProposal: AnonCredsProposeProofFormat;
|
|
13
|
+
acceptProposal: {
|
|
14
|
+
name?: string;
|
|
15
|
+
version?: string;
|
|
16
|
+
};
|
|
17
|
+
createRequest: AnonCredsRequestProofFormat;
|
|
18
|
+
acceptRequest: AnonCredsSelectedCredentials;
|
|
19
|
+
getCredentialsForRequest: {
|
|
20
|
+
input: AnonCredsGetCredentialsForProofRequestOptions;
|
|
21
|
+
output: AnonCredsCredentialsForProofRequest;
|
|
22
|
+
};
|
|
23
|
+
selectCredentialsForRequest: {
|
|
24
|
+
input: AnonCredsGetCredentialsForProofRequestOptions;
|
|
25
|
+
output: AnonCredsSelectedCredentials;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
formatData: {
|
|
29
|
+
proposal: LegacyIndyProofRequest;
|
|
30
|
+
request: LegacyIndyProofRequest;
|
|
31
|
+
presentation: AnonCredsProof;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { LegacyIndyDidCommProofFormat, LegacyIndyProofRequest };
|
|
36
|
+
//# sourceMappingURL=LegacyIndyDidCommProofFormat.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegacyIndyDidCommProofFormat.d.mts","names":[],"sources":["../../src/formats/LegacyIndyDidCommProofFormat.ts"],"sourcesContent":[],"mappings":";;;;;;;KAUY,sBAAA,GAAyB;UAEpB,4BAAA,SAAqC;;;IAF1C,cAAA,EAMQ,2BANiB;IAEpB,cAAA,EAAA;MAIG,IAAA,CAAA,EAAA,MAAA;MAKD,OAAA,CAAA,EAAA,MAAA;IACA,CAAA;IAGN,aAAA,EAJM,2BAIN;IACC,aAAA,EAJK,4BAIL;IAGD,wBAAA,EAAA;MACC,KAAA,EALD,6CAKC;MAKA,MAAA,EATA,mCASA;IACD,CAAA;IACK,2BAAA,EAAA;MAzBoC,KAAA,EAiBzC,6CAjByC;MAAkB,MAAA,EAkB1D,4BAlB0D;;;;cAuB1D;aACD;kBACK"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { LegacyIndyDidCommProofFormat } from "./LegacyIndyDidCommProofFormat.mjs";
|
|
2
|
+
import { AgentContext } from "@credo-ts/core";
|
|
3
|
+
import { DidCommFormatCreateRequestOptions, DidCommProofFormatAcceptProposalOptions, DidCommProofFormatAcceptRequestOptions, DidCommProofFormatAutoRespondPresentationOptions, DidCommProofFormatAutoRespondProposalOptions, DidCommProofFormatAutoRespondRequestOptions, DidCommProofFormatCreateProposalOptions, DidCommProofFormatCreateReturn, DidCommProofFormatGetCredentialsForRequestOptions, DidCommProofFormatGetCredentialsForRequestReturn, DidCommProofFormatProcessOptions, DidCommProofFormatProcessPresentationOptions, DidCommProofFormatSelectCredentialsForRequestOptions, DidCommProofFormatSelectCredentialsForRequestReturn, DidCommProofFormatService } from "@credo-ts/didcomm";
|
|
4
|
+
|
|
5
|
+
//#region src/formats/LegacyIndyDidCommProofFormatService.d.ts
|
|
6
|
+
declare class LegacyIndyDidCommProofFormatService implements DidCommProofFormatService<LegacyIndyDidCommProofFormat> {
|
|
7
|
+
readonly formatKey: "indy";
|
|
8
|
+
private hasLoggedWarning;
|
|
9
|
+
private ensureWarningLoggedOnce;
|
|
10
|
+
createProposal(agentContext: AgentContext, {
|
|
11
|
+
attachmentId,
|
|
12
|
+
proofFormats
|
|
13
|
+
}: DidCommProofFormatCreateProposalOptions<LegacyIndyDidCommProofFormat>): Promise<DidCommProofFormatCreateReturn>;
|
|
14
|
+
processProposal(agentContext: AgentContext, {
|
|
15
|
+
attachment
|
|
16
|
+
}: DidCommProofFormatProcessOptions): Promise<void>;
|
|
17
|
+
acceptProposal(agentContext: AgentContext, {
|
|
18
|
+
proposalAttachment,
|
|
19
|
+
attachmentId
|
|
20
|
+
}: DidCommProofFormatAcceptProposalOptions<LegacyIndyDidCommProofFormat>): Promise<DidCommProofFormatCreateReturn>;
|
|
21
|
+
createRequest(agentContext: AgentContext, {
|
|
22
|
+
attachmentId,
|
|
23
|
+
proofFormats
|
|
24
|
+
}: DidCommFormatCreateRequestOptions<LegacyIndyDidCommProofFormat>): Promise<DidCommProofFormatCreateReturn>;
|
|
25
|
+
processRequest(agentContext: AgentContext, {
|
|
26
|
+
attachment
|
|
27
|
+
}: DidCommProofFormatProcessOptions): Promise<void>;
|
|
28
|
+
acceptRequest(agentContext: AgentContext, {
|
|
29
|
+
proofFormats,
|
|
30
|
+
requestAttachment,
|
|
31
|
+
attachmentId
|
|
32
|
+
}: DidCommProofFormatAcceptRequestOptions<LegacyIndyDidCommProofFormat>): Promise<DidCommProofFormatCreateReturn>;
|
|
33
|
+
processPresentation(agentContext: AgentContext, {
|
|
34
|
+
requestAttachment,
|
|
35
|
+
attachment
|
|
36
|
+
}: DidCommProofFormatProcessPresentationOptions): Promise<boolean>;
|
|
37
|
+
getCredentialsForRequest(agentContext: AgentContext, {
|
|
38
|
+
requestAttachment,
|
|
39
|
+
proofFormats
|
|
40
|
+
}: DidCommProofFormatGetCredentialsForRequestOptions<LegacyIndyDidCommProofFormat>): Promise<DidCommProofFormatGetCredentialsForRequestReturn<LegacyIndyDidCommProofFormat>>;
|
|
41
|
+
selectCredentialsForRequest(agentContext: AgentContext, {
|
|
42
|
+
requestAttachment,
|
|
43
|
+
proofFormats
|
|
44
|
+
}: DidCommProofFormatSelectCredentialsForRequestOptions<LegacyIndyDidCommProofFormat>): Promise<DidCommProofFormatSelectCredentialsForRequestReturn<LegacyIndyDidCommProofFormat>>;
|
|
45
|
+
shouldAutoRespondToProposal(agentContext: AgentContext, {
|
|
46
|
+
proposalAttachment,
|
|
47
|
+
requestAttachment
|
|
48
|
+
}: DidCommProofFormatAutoRespondProposalOptions): Promise<boolean>;
|
|
49
|
+
shouldAutoRespondToRequest(_agentContext: AgentContext, {
|
|
50
|
+
proposalAttachment,
|
|
51
|
+
requestAttachment
|
|
52
|
+
}: DidCommProofFormatAutoRespondRequestOptions): Promise<boolean>;
|
|
53
|
+
shouldAutoRespondToPresentation(_agentContext: AgentContext, _options: DidCommProofFormatAutoRespondPresentationOptions): Promise<boolean>;
|
|
54
|
+
supportsFormat(formatIdentifier: string): boolean;
|
|
55
|
+
private _getCredentialsForRequest;
|
|
56
|
+
private _selectCredentialsForRequest;
|
|
57
|
+
private getCredentialsForProofRequestReferent;
|
|
58
|
+
/**
|
|
59
|
+
* Build schemas object needed to create and verify proof objects.
|
|
60
|
+
*
|
|
61
|
+
* Creates object with `{ schemaId: AnonCredsSchema }` mapping
|
|
62
|
+
*
|
|
63
|
+
* @param schemaIds List of schema ids
|
|
64
|
+
* @returns Object containing schemas for specified schema ids
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
private getSchemas;
|
|
68
|
+
/**
|
|
69
|
+
* Build credential definitions object needed to create and verify proof objects.
|
|
70
|
+
*
|
|
71
|
+
* Creates object with `{ credentialDefinitionId: AnonCredsCredentialDefinition }` mapping
|
|
72
|
+
*
|
|
73
|
+
* @param credentialDefinitionIds List of credential definition ids
|
|
74
|
+
* @returns Object containing credential definitions for specified credential definition ids
|
|
75
|
+
*
|
|
76
|
+
*/
|
|
77
|
+
private getCredentialDefinitions;
|
|
78
|
+
private getRevocationStatus;
|
|
79
|
+
/**
|
|
80
|
+
* Create indy proof from a given proof request and requested credential object.
|
|
81
|
+
*
|
|
82
|
+
* @param proofRequest The proof request to create the proof for
|
|
83
|
+
* @param requestedCredentials The requested credentials object specifying which credentials to use for the proof
|
|
84
|
+
* @returns indy proof object
|
|
85
|
+
*/
|
|
86
|
+
private createProof;
|
|
87
|
+
/**
|
|
88
|
+
* Returns an object of type {@link DidCommAttachment} for use in credential exchange messages.
|
|
89
|
+
* It looks up the correct format identifier and encodes the data as a base64 attachment.
|
|
90
|
+
*
|
|
91
|
+
* @param data The data to include in the attach object
|
|
92
|
+
* @param id the attach id from the formats component of the message
|
|
93
|
+
*/
|
|
94
|
+
private getFormatData;
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { LegacyIndyDidCommProofFormatService };
|
|
98
|
+
//# sourceMappingURL=LegacyIndyDidCommProofFormatService.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegacyIndyDidCommProofFormatService.d.mts","names":[],"sources":["../../src/formats/LegacyIndyDidCommProofFormatService.ts"],"sourcesContent":[],"mappings":";;;;;cAmEa,mCAAA,YAA+C,0BAA0B;;EAAzE,QAAA,gBAAA;EAAyE,QAAA,uBAAA;EAcpE,cAAA,CAAA,YAAA,EAAA,YAAA,EAAA;IAAA,YAAA;IAAA;EAAA,CAAA,EACkB,uCADlB,CAC0D,4BAD1D,CAAA,CAAA,EAEb,OAFa,CAEL,8BAFK,CAAA;EACZ,eAAA,CAAA,YAAA,EA2BY,YA3BZ,EAAA;IAAA;EAAA,CAAA,EA4Bc,gCA5Bd,CAAA,EA6BD,OA7BC,CAAA,IAAA,CAAA;EAAc,cAAA,CAAA,YAAA,EAyCF,YAzCE,EAAA;IAAA,kBAAA;IAAA;EAAA,CAAA,EA0CsB,uCA1CtB,CA0C8D,4BA1C9D,CAAA,CAAA,EA2Cf,OA3Ce,CA2CP,8BA3CO,CAAA;EAAwD,aAAA,CAAA,YAAA,EAiE1D,YAjE0D,EAAA;IAAA,YAAA;IAAA;EAAA,CAAA,EAkExC,iCAlEwC,CAkEN,4BAlEM,CAAA,CAAA,EAmEvE,OAnEuE,CAmE/D,8BAnE+D,CAAA;EAAxC,cA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D,QAAA,4BAAA;EAAxC,QAAA,qCAAA;EAC7B;;;;;;;;;EAuDK,QAAA,UAAA;EACZ;;;;;;;;;EAmBO,QAAA,wBAAA;EAAR,QAAA,mBAAA;EA0Ba;;;;;;;EA4DO,QAAA,WAAA;EAAkE;;;;;;;EAmBrF,QAAA,aAAA"}
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { getUnQualifiedDidIndyDid, getUnqualifiedDidIndyCredentialDefinition, getUnqualifiedDidIndySchema, isUnqualifiedCredentialDefinitionId, isUnqualifiedSchemaId } from "../utils/indyIdentifiers.mjs";
|
|
2
|
+
import { AnonCredsHolderServiceSymbol } from "../services/AnonCredsHolderService.mjs";
|
|
3
|
+
import { AnonCredsVerifierServiceSymbol } from "../services/AnonCredsVerifierService.mjs";
|
|
4
|
+
import "../services/index.mjs";
|
|
5
|
+
import { fetchCredentialDefinition, fetchRevocationStatusList, fetchSchema } from "../utils/anonCredsObjects.mjs";
|
|
6
|
+
import { areAnonCredsProofRequestsEqual } from "../utils/areRequestsEqual.mjs";
|
|
7
|
+
import { createRequestFromPreview } from "../utils/createRequestFromPreview.mjs";
|
|
8
|
+
import { checkValidCredentialValueEncoding, encodeCredentialValue } from "../utils/credential.mjs";
|
|
9
|
+
import { assertBestPracticeRevocationInterval } from "../utils/revocationInterval.mjs";
|
|
10
|
+
import { sortRequestedCredentialsMatches } from "../utils/sortRequestedCredentialsMatches.mjs";
|
|
11
|
+
import { dateToTimestamp } from "../utils/timestamp.mjs";
|
|
12
|
+
import { getRevocationRegistriesForProof, getRevocationRegistriesForRequest } from "../utils/getRevocationRegistries.mjs";
|
|
13
|
+
import { assertNoDuplicateGroupsNamesInProofRequest } from "../utils/hasDuplicateGroupNames.mjs";
|
|
14
|
+
import "../utils/index.mjs";
|
|
15
|
+
import { AnonCredsProofRequest } from "../models/AnonCredsProofRequest.mjs";
|
|
16
|
+
import { CredoError, JsonEncoder, JsonTransformer } from "@credo-ts/core";
|
|
17
|
+
import { DidCommAttachment, DidCommAttachmentData, DidCommProofFormatSpec } from "@credo-ts/didcomm";
|
|
18
|
+
|
|
19
|
+
//#region src/formats/LegacyIndyDidCommProofFormatService.ts
|
|
20
|
+
const V2_INDY_PRESENTATION_PROPOSAL = "hlindy/proof-req@v2.0";
|
|
21
|
+
const V2_INDY_PRESENTATION_REQUEST = "hlindy/proof-req@v2.0";
|
|
22
|
+
const V2_INDY_PRESENTATION = "hlindy/proof@v2.0";
|
|
23
|
+
var LegacyIndyDidCommProofFormatService = class {
|
|
24
|
+
constructor() {
|
|
25
|
+
this.formatKey = "indy";
|
|
26
|
+
this.hasLoggedWarning = false;
|
|
27
|
+
}
|
|
28
|
+
ensureWarningLoggedOnce(agentContext) {
|
|
29
|
+
if (this.hasLoggedWarning) return;
|
|
30
|
+
agentContext.config.logger.debug("The 'LegacyIndyDidCommCredentialFormatService' is deprecated and will be removed in version 0.7 of Credo. You should upgrade to the 'AnonCredsDidCommCredentialFormatService' instead.");
|
|
31
|
+
this.hasLoggedWarning = true;
|
|
32
|
+
}
|
|
33
|
+
async createProposal(agentContext, { attachmentId, proofFormats }) {
|
|
34
|
+
this.ensureWarningLoggedOnce(agentContext);
|
|
35
|
+
const holderService = agentContext.dependencyManager.resolve(AnonCredsHolderServiceSymbol);
|
|
36
|
+
const format = new DidCommProofFormatSpec({
|
|
37
|
+
format: V2_INDY_PRESENTATION_PROPOSAL,
|
|
38
|
+
attachmentId
|
|
39
|
+
});
|
|
40
|
+
const indyFormat = proofFormats.indy;
|
|
41
|
+
if (!indyFormat) throw Error("Missing indy format to create proposal attachment format");
|
|
42
|
+
const proofRequest = createRequestFromPreview({
|
|
43
|
+
attributes: indyFormat.attributes ?? [],
|
|
44
|
+
predicates: indyFormat.predicates ?? [],
|
|
45
|
+
name: indyFormat.name ?? "Proof request",
|
|
46
|
+
version: indyFormat.version ?? "1.0",
|
|
47
|
+
nonce: holderService.generateNonce(agentContext)
|
|
48
|
+
});
|
|
49
|
+
return {
|
|
50
|
+
attachment: this.getFormatData(proofRequest, format.attachmentId),
|
|
51
|
+
format
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
async processProposal(agentContext, { attachment }) {
|
|
55
|
+
this.ensureWarningLoggedOnce(agentContext);
|
|
56
|
+
const proposalJson = attachment.getDataAsJson();
|
|
57
|
+
JsonTransformer.fromJSON(proposalJson, AnonCredsProofRequest);
|
|
58
|
+
assertNoDuplicateGroupsNamesInProofRequest(proposalJson);
|
|
59
|
+
}
|
|
60
|
+
async acceptProposal(agentContext, { proposalAttachment, attachmentId }) {
|
|
61
|
+
this.ensureWarningLoggedOnce(agentContext);
|
|
62
|
+
const holderService = agentContext.dependencyManager.resolve(AnonCredsHolderServiceSymbol);
|
|
63
|
+
const format = new DidCommProofFormatSpec({
|
|
64
|
+
format: V2_INDY_PRESENTATION_REQUEST,
|
|
65
|
+
attachmentId
|
|
66
|
+
});
|
|
67
|
+
const request = {
|
|
68
|
+
...proposalAttachment.getDataAsJson(),
|
|
69
|
+
nonce: holderService.generateNonce(agentContext)
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
attachment: this.getFormatData(request, format.attachmentId),
|
|
73
|
+
format
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
async createRequest(agentContext, { attachmentId, proofFormats }) {
|
|
77
|
+
this.ensureWarningLoggedOnce(agentContext);
|
|
78
|
+
const holderService = agentContext.dependencyManager.resolve(AnonCredsHolderServiceSymbol);
|
|
79
|
+
const format = new DidCommProofFormatSpec({
|
|
80
|
+
format: V2_INDY_PRESENTATION_REQUEST,
|
|
81
|
+
attachmentId
|
|
82
|
+
});
|
|
83
|
+
const indyFormat = proofFormats.indy;
|
|
84
|
+
if (!indyFormat) throw Error("Missing indy format in create request attachment format");
|
|
85
|
+
const request = {
|
|
86
|
+
name: indyFormat.name,
|
|
87
|
+
version: indyFormat.version,
|
|
88
|
+
nonce: holderService.generateNonce(agentContext),
|
|
89
|
+
requested_attributes: indyFormat.requested_attributes ?? {},
|
|
90
|
+
requested_predicates: indyFormat.requested_predicates ?? {},
|
|
91
|
+
non_revoked: indyFormat.non_revoked
|
|
92
|
+
};
|
|
93
|
+
assertNoDuplicateGroupsNamesInProofRequest(request);
|
|
94
|
+
return {
|
|
95
|
+
attachment: this.getFormatData(request, format.attachmentId),
|
|
96
|
+
format
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
async processRequest(agentContext, { attachment }) {
|
|
100
|
+
this.ensureWarningLoggedOnce(agentContext);
|
|
101
|
+
const requestJson = attachment.getDataAsJson();
|
|
102
|
+
JsonTransformer.fromJSON(requestJson, AnonCredsProofRequest);
|
|
103
|
+
assertNoDuplicateGroupsNamesInProofRequest(requestJson);
|
|
104
|
+
}
|
|
105
|
+
async acceptRequest(agentContext, { proofFormats, requestAttachment, attachmentId }) {
|
|
106
|
+
this.ensureWarningLoggedOnce(agentContext);
|
|
107
|
+
const format = new DidCommProofFormatSpec({
|
|
108
|
+
format: V2_INDY_PRESENTATION,
|
|
109
|
+
attachmentId
|
|
110
|
+
});
|
|
111
|
+
const requestJson = requestAttachment.getDataAsJson();
|
|
112
|
+
const selectedCredentials = proofFormats?.indy ?? await this._selectCredentialsForRequest(agentContext, requestJson, { filterByNonRevocationRequirements: true });
|
|
113
|
+
const proof = await this.createProof(agentContext, requestJson, selectedCredentials);
|
|
114
|
+
return {
|
|
115
|
+
attachment: this.getFormatData(proof, format.attachmentId),
|
|
116
|
+
format
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
async processPresentation(agentContext, { requestAttachment, attachment }) {
|
|
120
|
+
this.ensureWarningLoggedOnce(agentContext);
|
|
121
|
+
const verifierService = agentContext.dependencyManager.resolve(AnonCredsVerifierServiceSymbol);
|
|
122
|
+
const proofRequestJson = requestAttachment.getDataAsJson();
|
|
123
|
+
const proofJson = attachment.getDataAsJson();
|
|
124
|
+
for (const [referent, attribute] of Object.entries(proofJson.requested_proof.revealed_attrs)) if (!checkValidCredentialValueEncoding(attribute.raw, attribute.encoded)) throw new CredoError(`The encoded value for '${referent}' is invalid. Expected '${encodeCredentialValue(attribute.raw)}'. Actual '${attribute.encoded}'`);
|
|
125
|
+
for (const [, attributeGroup] of Object.entries(proofJson.requested_proof.revealed_attr_groups ?? {})) for (const [attributeName, attribute] of Object.entries(attributeGroup.values)) if (!checkValidCredentialValueEncoding(attribute.raw, attribute.encoded)) throw new CredoError(`The encoded value for '${attributeName}' is invalid. Expected '${encodeCredentialValue(attribute.raw)}'. Actual '${attribute.encoded}'`);
|
|
126
|
+
const schemas = await this.getSchemas(agentContext, new Set(proofJson.identifiers.map((i) => i.schema_id)));
|
|
127
|
+
const credentialDefinitions = await this.getCredentialDefinitions(agentContext, new Set(proofJson.identifiers.map((i) => i.cred_def_id)));
|
|
128
|
+
const revocationRegistries = await getRevocationRegistriesForProof(agentContext, proofJson);
|
|
129
|
+
return await verifierService.verifyProof(agentContext, {
|
|
130
|
+
proofRequest: proofRequestJson,
|
|
131
|
+
proof: proofJson,
|
|
132
|
+
schemas,
|
|
133
|
+
credentialDefinitions,
|
|
134
|
+
revocationRegistries
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
async getCredentialsForRequest(agentContext, { requestAttachment, proofFormats }) {
|
|
138
|
+
this.ensureWarningLoggedOnce(agentContext);
|
|
139
|
+
const proofRequestJson = requestAttachment.getDataAsJson();
|
|
140
|
+
const { filterByNonRevocationRequirements = true } = proofFormats?.indy ?? {};
|
|
141
|
+
return await this._getCredentialsForRequest(agentContext, proofRequestJson, { filterByNonRevocationRequirements });
|
|
142
|
+
}
|
|
143
|
+
async selectCredentialsForRequest(agentContext, { requestAttachment, proofFormats }) {
|
|
144
|
+
const proofRequestJson = requestAttachment.getDataAsJson();
|
|
145
|
+
const { filterByNonRevocationRequirements = true } = proofFormats?.indy ?? {};
|
|
146
|
+
return this._selectCredentialsForRequest(agentContext, proofRequestJson, { filterByNonRevocationRequirements });
|
|
147
|
+
}
|
|
148
|
+
async shouldAutoRespondToProposal(agentContext, { proposalAttachment, requestAttachment }) {
|
|
149
|
+
const proposalJson = proposalAttachment.getDataAsJson();
|
|
150
|
+
const requestJson = requestAttachment.getDataAsJson();
|
|
151
|
+
const areRequestsEqual = areAnonCredsProofRequestsEqual(proposalJson, requestJson);
|
|
152
|
+
agentContext.config.logger.debug(`AnonCreds request and proposal are are equal: ${areRequestsEqual}`, {
|
|
153
|
+
proposalJson,
|
|
154
|
+
requestJson
|
|
155
|
+
});
|
|
156
|
+
return areRequestsEqual;
|
|
157
|
+
}
|
|
158
|
+
async shouldAutoRespondToRequest(_agentContext, { proposalAttachment, requestAttachment }) {
|
|
159
|
+
return areAnonCredsProofRequestsEqual(proposalAttachment.getDataAsJson(), requestAttachment.getDataAsJson());
|
|
160
|
+
}
|
|
161
|
+
async shouldAutoRespondToPresentation(_agentContext, _options) {
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
supportsFormat(formatIdentifier) {
|
|
165
|
+
return [
|
|
166
|
+
V2_INDY_PRESENTATION_PROPOSAL,
|
|
167
|
+
V2_INDY_PRESENTATION_REQUEST,
|
|
168
|
+
V2_INDY_PRESENTATION
|
|
169
|
+
].includes(formatIdentifier);
|
|
170
|
+
}
|
|
171
|
+
async _getCredentialsForRequest(agentContext, proofRequest, options) {
|
|
172
|
+
const credentialsForProofRequest = {
|
|
173
|
+
attributes: {},
|
|
174
|
+
predicates: {}
|
|
175
|
+
};
|
|
176
|
+
for (const [referent, requestedAttribute] of Object.entries(proofRequest.requested_attributes)) {
|
|
177
|
+
const credentials = await this.getCredentialsForProofRequestReferent(agentContext, proofRequest, referent);
|
|
178
|
+
credentialsForProofRequest.attributes[referent] = sortRequestedCredentialsMatches(await Promise.all(credentials.map(async (credential) => {
|
|
179
|
+
const { isRevoked, timestamp } = await this.getRevocationStatus(agentContext, proofRequest, requestedAttribute, credential.credentialInfo);
|
|
180
|
+
return {
|
|
181
|
+
credentialId: credential.credentialInfo.credentialId,
|
|
182
|
+
revealed: true,
|
|
183
|
+
credentialInfo: credential.credentialInfo,
|
|
184
|
+
timestamp,
|
|
185
|
+
revoked: isRevoked
|
|
186
|
+
};
|
|
187
|
+
})));
|
|
188
|
+
if (options.filterByNonRevocationRequirements) credentialsForProofRequest.attributes[referent] = credentialsForProofRequest.attributes[referent].filter((r) => !r.revoked);
|
|
189
|
+
}
|
|
190
|
+
for (const [referent, requestedPredicate] of Object.entries(proofRequest.requested_predicates)) {
|
|
191
|
+
const credentials = await this.getCredentialsForProofRequestReferent(agentContext, proofRequest, referent);
|
|
192
|
+
credentialsForProofRequest.predicates[referent] = sortRequestedCredentialsMatches(await Promise.all(credentials.map(async (credential) => {
|
|
193
|
+
const { isRevoked, timestamp } = await this.getRevocationStatus(agentContext, proofRequest, requestedPredicate, credential.credentialInfo);
|
|
194
|
+
return {
|
|
195
|
+
credentialId: credential.credentialInfo.credentialId,
|
|
196
|
+
credentialInfo: credential.credentialInfo,
|
|
197
|
+
timestamp,
|
|
198
|
+
revoked: isRevoked
|
|
199
|
+
};
|
|
200
|
+
})));
|
|
201
|
+
if (options.filterByNonRevocationRequirements) credentialsForProofRequest.predicates[referent] = credentialsForProofRequest.predicates[referent].filter((r) => !r.revoked);
|
|
202
|
+
}
|
|
203
|
+
return credentialsForProofRequest;
|
|
204
|
+
}
|
|
205
|
+
async _selectCredentialsForRequest(agentContext, proofRequest, options) {
|
|
206
|
+
const credentialsForRequest = await this._getCredentialsForRequest(agentContext, proofRequest, options);
|
|
207
|
+
const selectedCredentials = {
|
|
208
|
+
attributes: {},
|
|
209
|
+
predicates: {},
|
|
210
|
+
selfAttestedAttributes: {}
|
|
211
|
+
};
|
|
212
|
+
for (const attributeName of Object.keys(credentialsForRequest.attributes)) {
|
|
213
|
+
const attributeArray = credentialsForRequest.attributes[attributeName];
|
|
214
|
+
if (attributeArray.length === 0) throw new CredoError("Unable to automatically select requested attributes.");
|
|
215
|
+
selectedCredentials.attributes[attributeName] = attributeArray[0];
|
|
216
|
+
}
|
|
217
|
+
for (const attributeName of Object.keys(credentialsForRequest.predicates)) {
|
|
218
|
+
if (credentialsForRequest.predicates[attributeName].length === 0) throw new CredoError("Unable to automatically select requested predicates.");
|
|
219
|
+
selectedCredentials.predicates[attributeName] = credentialsForRequest.predicates[attributeName][0];
|
|
220
|
+
}
|
|
221
|
+
return selectedCredentials;
|
|
222
|
+
}
|
|
223
|
+
async getCredentialsForProofRequestReferent(agentContext, proofRequest, attributeReferent) {
|
|
224
|
+
return await agentContext.dependencyManager.resolve(AnonCredsHolderServiceSymbol).getCredentialsForProofRequest(agentContext, {
|
|
225
|
+
proofRequest,
|
|
226
|
+
attributeReferent
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Build schemas object needed to create and verify proof objects.
|
|
231
|
+
*
|
|
232
|
+
* Creates object with `{ schemaId: AnonCredsSchema }` mapping
|
|
233
|
+
*
|
|
234
|
+
* @param schemaIds List of schema ids
|
|
235
|
+
* @returns Object containing schemas for specified schema ids
|
|
236
|
+
*
|
|
237
|
+
*/
|
|
238
|
+
async getSchemas(agentContext, schemaIds) {
|
|
239
|
+
const schemas = {};
|
|
240
|
+
for (const schemaId of schemaIds) {
|
|
241
|
+
const schemaResult = await fetchSchema(agentContext, schemaId);
|
|
242
|
+
if (isUnqualifiedSchemaId(schemaResult.schemaId)) schemas[schemaId] = schemaResult.schema;
|
|
243
|
+
else schemas[getUnQualifiedDidIndyDid(schemaId)] = getUnqualifiedDidIndySchema(schemaResult.schema);
|
|
244
|
+
}
|
|
245
|
+
return schemas;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Build credential definitions object needed to create and verify proof objects.
|
|
249
|
+
*
|
|
250
|
+
* Creates object with `{ credentialDefinitionId: AnonCredsCredentialDefinition }` mapping
|
|
251
|
+
*
|
|
252
|
+
* @param credentialDefinitionIds List of credential definition ids
|
|
253
|
+
* @returns Object containing credential definitions for specified credential definition ids
|
|
254
|
+
*
|
|
255
|
+
*/
|
|
256
|
+
async getCredentialDefinitions(agentContext, credentialDefinitionIds) {
|
|
257
|
+
const credentialDefinitions = {};
|
|
258
|
+
for (const credentialDefinitionId of credentialDefinitionIds) {
|
|
259
|
+
const credentialDefinitionResult = await fetchCredentialDefinition(agentContext, credentialDefinitionId);
|
|
260
|
+
if (isUnqualifiedCredentialDefinitionId(credentialDefinitionResult.credentialDefinitionId)) credentialDefinitions[credentialDefinitionId] = credentialDefinitionResult.credentialDefinition;
|
|
261
|
+
else credentialDefinitions[getUnQualifiedDidIndyDid(credentialDefinitionId)] = getUnqualifiedDidIndyCredentialDefinition(credentialDefinitionResult.credentialDefinition);
|
|
262
|
+
}
|
|
263
|
+
return credentialDefinitions;
|
|
264
|
+
}
|
|
265
|
+
async getRevocationStatus(agentContext, proofRequest, requestedItem, credentialInfo) {
|
|
266
|
+
const requestNonRevoked = requestedItem.non_revoked ?? proofRequest.non_revoked;
|
|
267
|
+
const credentialRevocationId = credentialInfo.credentialRevocationId;
|
|
268
|
+
const revocationRegistryId = credentialInfo.revocationRegistryId;
|
|
269
|
+
if (!requestNonRevoked || credentialRevocationId === null || !revocationRegistryId) return {
|
|
270
|
+
isRevoked: void 0,
|
|
271
|
+
timestamp: void 0
|
|
272
|
+
};
|
|
273
|
+
agentContext.config.logger.trace(`Fetching credential revocation status for credential revocation id '${credentialRevocationId}' with revocation interval with from '${requestNonRevoked.from}' and to '${requestNonRevoked.to}'`);
|
|
274
|
+
assertBestPracticeRevocationInterval(requestNonRevoked);
|
|
275
|
+
const { revocationStatusList } = await fetchRevocationStatusList(agentContext, revocationRegistryId, requestNonRevoked.to ?? dateToTimestamp(/* @__PURE__ */ new Date()));
|
|
276
|
+
const isRevoked = revocationStatusList.revocationList[Number.parseInt(credentialRevocationId, 10)] === 1;
|
|
277
|
+
agentContext.config.logger.trace(`Credential with credential revocation index '${credentialRevocationId}' is ${isRevoked ? "" : "not "}revoked with revocation interval with to '${requestNonRevoked.to}' & from '${requestNonRevoked.from}'`);
|
|
278
|
+
return {
|
|
279
|
+
isRevoked,
|
|
280
|
+
timestamp: revocationStatusList.timestamp
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Create indy proof from a given proof request and requested credential object.
|
|
285
|
+
*
|
|
286
|
+
* @param proofRequest The proof request to create the proof for
|
|
287
|
+
* @param requestedCredentials The requested credentials object specifying which credentials to use for the proof
|
|
288
|
+
* @returns indy proof object
|
|
289
|
+
*/
|
|
290
|
+
async createProof(agentContext, proofRequest, selectedCredentials) {
|
|
291
|
+
const holderService = agentContext.dependencyManager.resolve(AnonCredsHolderServiceSymbol);
|
|
292
|
+
const credentialObjects = await Promise.all([...Object.values(selectedCredentials.attributes), ...Object.values(selectedCredentials.predicates)].map(async (c) => c.credentialInfo ?? holderService.getCredential(agentContext, { id: c.credentialId })));
|
|
293
|
+
const schemas = await this.getSchemas(agentContext, new Set(credentialObjects.map((c) => c.schemaId)));
|
|
294
|
+
const credentialDefinitions = await this.getCredentialDefinitions(agentContext, new Set(credentialObjects.map((c) => c.credentialDefinitionId)));
|
|
295
|
+
const { revocationRegistries, updatedSelectedCredentials } = await getRevocationRegistriesForRequest(agentContext, proofRequest, selectedCredentials);
|
|
296
|
+
return await holderService.createProof(agentContext, {
|
|
297
|
+
proofRequest,
|
|
298
|
+
selectedCredentials: updatedSelectedCredentials,
|
|
299
|
+
schemas,
|
|
300
|
+
credentialDefinitions,
|
|
301
|
+
revocationRegistries
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Returns an object of type {@link DidCommAttachment} for use in credential exchange messages.
|
|
306
|
+
* It looks up the correct format identifier and encodes the data as a base64 attachment.
|
|
307
|
+
*
|
|
308
|
+
* @param data The data to include in the attach object
|
|
309
|
+
* @param id the attach id from the formats component of the message
|
|
310
|
+
*/
|
|
311
|
+
getFormatData(data, id) {
|
|
312
|
+
return new DidCommAttachment({
|
|
313
|
+
id,
|
|
314
|
+
mimeType: "application/json",
|
|
315
|
+
data: new DidCommAttachmentData({ base64: JsonEncoder.toBase64(data) })
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
//#endregion
|
|
321
|
+
export { LegacyIndyDidCommProofFormatService };
|
|
322
|
+
//# sourceMappingURL=LegacyIndyDidCommProofFormatService.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegacyIndyDidCommProofFormatService.mjs","names":["AnonCredsProofRequestClass","credentialsForProofRequest: AnonCredsCredentialsForProofRequest","selectedCredentials: AnonCredsSelectedCredentials","schemas: { [key: string]: AnonCredsSchema }","credentialDefinitions: { [key: string]: AnonCredsCredentialDefinition }"],"sources":["../../src/formats/LegacyIndyDidCommProofFormatService.ts"],"sourcesContent":["import type { AgentContext } from '@credo-ts/core'\nimport { CredoError, JsonEncoder, JsonTransformer } from '@credo-ts/core'\nimport type {\n DidCommFormatCreateRequestOptions,\n DidCommProofFormatAcceptProposalOptions,\n DidCommProofFormatAcceptRequestOptions,\n DidCommProofFormatAutoRespondPresentationOptions,\n DidCommProofFormatAutoRespondProposalOptions,\n DidCommProofFormatAutoRespondRequestOptions,\n DidCommProofFormatCreateProposalOptions,\n DidCommProofFormatCreateReturn,\n DidCommProofFormatGetCredentialsForRequestOptions,\n DidCommProofFormatGetCredentialsForRequestReturn,\n DidCommProofFormatProcessOptions,\n DidCommProofFormatProcessPresentationOptions,\n DidCommProofFormatSelectCredentialsForRequestOptions,\n DidCommProofFormatSelectCredentialsForRequestReturn,\n DidCommProofFormatService,\n} from '@credo-ts/didcomm'\nimport { DidCommAttachment, DidCommAttachmentData, DidCommProofFormatSpec } from '@credo-ts/didcomm'\nimport type {\n AnonCredsCredentialDefinition,\n AnonCredsCredentialInfo,\n AnonCredsProof,\n AnonCredsProofRequest,\n AnonCredsRequestedAttribute,\n AnonCredsRequestedAttributeMatch,\n AnonCredsRequestedPredicate,\n AnonCredsRequestedPredicateMatch,\n AnonCredsSchema,\n AnonCredsSelectedCredentials,\n} from '../models'\nimport { AnonCredsProofRequest as AnonCredsProofRequestClass } from '../models/AnonCredsProofRequest'\nimport type { AnonCredsHolderService, AnonCredsVerifierService, GetCredentialsForProofRequestReturn } from '../services'\nimport { AnonCredsHolderServiceSymbol, AnonCredsVerifierServiceSymbol } from '../services'\nimport {\n areAnonCredsProofRequestsEqual,\n assertBestPracticeRevocationInterval,\n assertNoDuplicateGroupsNamesInProofRequest,\n checkValidCredentialValueEncoding,\n createRequestFromPreview,\n fetchCredentialDefinition,\n fetchRevocationStatusList,\n fetchSchema,\n getRevocationRegistriesForProof,\n getRevocationRegistriesForRequest,\n sortRequestedCredentialsMatches,\n} from '../utils'\nimport { encodeCredentialValue } from '../utils/credential'\nimport {\n getUnQualifiedDidIndyDid,\n getUnqualifiedDidIndyCredentialDefinition,\n getUnqualifiedDidIndySchema,\n isUnqualifiedCredentialDefinitionId,\n isUnqualifiedSchemaId,\n} from '../utils/indyIdentifiers'\nimport { dateToTimestamp } from '../utils/timestamp'\nimport type {\n AnonCredsCredentialsForProofRequest,\n AnonCredsGetCredentialsForProofRequestOptions,\n} from './AnonCredsDidCommProofFormat'\nimport type { LegacyIndyDidCommProofFormat } from './LegacyIndyDidCommProofFormat'\n\nconst V2_INDY_PRESENTATION_PROPOSAL = 'hlindy/proof-req@v2.0'\nconst V2_INDY_PRESENTATION_REQUEST = 'hlindy/proof-req@v2.0'\nconst V2_INDY_PRESENTATION = 'hlindy/proof@v2.0'\n\nexport class LegacyIndyDidCommProofFormatService implements DidCommProofFormatService<LegacyIndyDidCommProofFormat> {\n public readonly formatKey = 'indy' as const\n\n private hasLoggedWarning = false\n private ensureWarningLoggedOnce(agentContext: AgentContext) {\n if (this.hasLoggedWarning) return\n\n agentContext.config.logger.debug(\n \"The 'LegacyIndyDidCommCredentialFormatService' is deprecated and will be removed in version 0.7 of Credo. You should upgrade to the 'AnonCredsDidCommCredentialFormatService' instead.\"\n )\n this.hasLoggedWarning = true\n }\n\n public async createProposal(\n agentContext: AgentContext,\n { attachmentId, proofFormats }: DidCommProofFormatCreateProposalOptions<LegacyIndyDidCommProofFormat>\n ): Promise<DidCommProofFormatCreateReturn> {\n this.ensureWarningLoggedOnce(agentContext)\n const holderService = agentContext.dependencyManager.resolve<AnonCredsHolderService>(AnonCredsHolderServiceSymbol)\n const format = new DidCommProofFormatSpec({\n format: V2_INDY_PRESENTATION_PROPOSAL,\n attachmentId,\n })\n\n const indyFormat = proofFormats.indy\n if (!indyFormat) {\n throw Error('Missing indy format to create proposal attachment format')\n }\n\n const proofRequest = createRequestFromPreview({\n attributes: indyFormat.attributes ?? [],\n predicates: indyFormat.predicates ?? [],\n name: indyFormat.name ?? 'Proof request',\n version: indyFormat.version ?? '1.0',\n nonce: holderService.generateNonce(agentContext),\n })\n const attachment = this.getFormatData(proofRequest, format.attachmentId)\n\n return { attachment, format }\n }\n\n public async processProposal(\n agentContext: AgentContext,\n { attachment }: DidCommProofFormatProcessOptions\n ): Promise<void> {\n this.ensureWarningLoggedOnce(agentContext)\n const proposalJson = attachment.getDataAsJson<AnonCredsProofRequest>()\n\n // fromJson also validates\n JsonTransformer.fromJSON(proposalJson, AnonCredsProofRequestClass)\n\n // Assert attribute and predicate (group) names do not match\n assertNoDuplicateGroupsNamesInProofRequest(proposalJson)\n }\n\n public async acceptProposal(\n agentContext: AgentContext,\n { proposalAttachment, attachmentId }: DidCommProofFormatAcceptProposalOptions<LegacyIndyDidCommProofFormat>\n ): Promise<DidCommProofFormatCreateReturn> {\n this.ensureWarningLoggedOnce(agentContext)\n const holderService = agentContext.dependencyManager.resolve<AnonCredsHolderService>(AnonCredsHolderServiceSymbol)\n const format = new DidCommProofFormatSpec({\n format: V2_INDY_PRESENTATION_REQUEST,\n attachmentId,\n })\n\n const proposalJson = proposalAttachment.getDataAsJson<AnonCredsProofRequest>()\n\n const request = {\n ...proposalJson,\n // We never want to reuse the nonce from the proposal, as this will allow replay attacks\n nonce: holderService.generateNonce(agentContext),\n }\n\n const attachment = this.getFormatData(request, format.attachmentId)\n\n return { attachment, format }\n }\n\n public async createRequest(\n agentContext: AgentContext,\n { attachmentId, proofFormats }: DidCommFormatCreateRequestOptions<LegacyIndyDidCommProofFormat>\n ): Promise<DidCommProofFormatCreateReturn> {\n this.ensureWarningLoggedOnce(agentContext)\n const holderService = agentContext.dependencyManager.resolve<AnonCredsHolderService>(AnonCredsHolderServiceSymbol)\n const format = new DidCommProofFormatSpec({\n format: V2_INDY_PRESENTATION_REQUEST,\n attachmentId,\n })\n\n const indyFormat = proofFormats.indy\n if (!indyFormat) {\n throw Error('Missing indy format in create request attachment format')\n }\n\n const request = {\n name: indyFormat.name,\n version: indyFormat.version,\n nonce: holderService.generateNonce(agentContext),\n requested_attributes: indyFormat.requested_attributes ?? {},\n requested_predicates: indyFormat.requested_predicates ?? {},\n non_revoked: indyFormat.non_revoked,\n } satisfies AnonCredsProofRequest\n\n // Assert attribute and predicate (group) names do not match\n assertNoDuplicateGroupsNamesInProofRequest(request)\n\n const attachment = this.getFormatData(request, format.attachmentId)\n\n return { attachment, format }\n }\n\n public async processRequest(\n agentContext: AgentContext,\n { attachment }: DidCommProofFormatProcessOptions\n ): Promise<void> {\n this.ensureWarningLoggedOnce(agentContext)\n const requestJson = attachment.getDataAsJson<AnonCredsProofRequest>()\n\n // fromJson also validates\n JsonTransformer.fromJSON(requestJson, AnonCredsProofRequestClass)\n\n // Assert attribute and predicate (group) names do not match\n assertNoDuplicateGroupsNamesInProofRequest(requestJson)\n }\n\n public async acceptRequest(\n agentContext: AgentContext,\n {\n proofFormats,\n requestAttachment,\n attachmentId,\n }: DidCommProofFormatAcceptRequestOptions<LegacyIndyDidCommProofFormat>\n ): Promise<DidCommProofFormatCreateReturn> {\n this.ensureWarningLoggedOnce(agentContext)\n const format = new DidCommProofFormatSpec({\n format: V2_INDY_PRESENTATION,\n attachmentId,\n })\n const requestJson = requestAttachment.getDataAsJson<AnonCredsProofRequest>()\n\n const indyFormat = proofFormats?.indy\n\n const selectedCredentials =\n indyFormat ??\n (await this._selectCredentialsForRequest(agentContext, requestJson, {\n filterByNonRevocationRequirements: true,\n }))\n\n const proof = await this.createProof(agentContext, requestJson, selectedCredentials)\n const attachment = this.getFormatData(proof, format.attachmentId)\n\n return {\n attachment,\n format,\n }\n }\n\n public async processPresentation(\n agentContext: AgentContext,\n { requestAttachment, attachment }: DidCommProofFormatProcessPresentationOptions\n ): Promise<boolean> {\n this.ensureWarningLoggedOnce(agentContext)\n const verifierService =\n agentContext.dependencyManager.resolve<AnonCredsVerifierService>(AnonCredsVerifierServiceSymbol)\n\n const proofRequestJson = requestAttachment.getDataAsJson<AnonCredsProofRequest>()\n\n // NOTE: we don't do validation here, as this is handled by the AnonCreds implementation, however\n // this can lead to confusing error messages. We should consider doing validation here as well.\n // Defining a class-transformer/class-validator class seems a bit overkill, and the usage of interfaces\n // for the anoncreds package keeps things simple. Maybe we can try to use something like zod to validate\n const proofJson = attachment.getDataAsJson<AnonCredsProof>()\n\n for (const [referent, attribute] of Object.entries(proofJson.requested_proof.revealed_attrs)) {\n if (!checkValidCredentialValueEncoding(attribute.raw, attribute.encoded)) {\n throw new CredoError(\n `The encoded value for '${referent}' is invalid. ` +\n `Expected '${encodeCredentialValue(attribute.raw)}'. ` +\n `Actual '${attribute.encoded}'`\n )\n }\n }\n\n for (const [, attributeGroup] of Object.entries(proofJson.requested_proof.revealed_attr_groups ?? {})) {\n for (const [attributeName, attribute] of Object.entries(attributeGroup.values)) {\n if (!checkValidCredentialValueEncoding(attribute.raw, attribute.encoded)) {\n throw new CredoError(\n `The encoded value for '${attributeName}' is invalid. ` +\n `Expected '${encodeCredentialValue(attribute.raw)}'. ` +\n `Actual '${attribute.encoded}'`\n )\n }\n }\n }\n\n // TODO: pre verify proof json\n // I'm not 100% sure how much indy does. Also if it checks whether the proof requests matches the proof\n // @see https://github.com/hyperledger/aries-cloudagent-python/blob/master/aries_cloudagent/indy/sdk/verifier.py#L79-L164\n\n const schemas = await this.getSchemas(agentContext, new Set(proofJson.identifiers.map((i) => i.schema_id)))\n const credentialDefinitions = await this.getCredentialDefinitions(\n agentContext,\n new Set(proofJson.identifiers.map((i) => i.cred_def_id))\n )\n\n const revocationRegistries = await getRevocationRegistriesForProof(agentContext, proofJson)\n\n return await verifierService.verifyProof(agentContext, {\n proofRequest: proofRequestJson,\n proof: proofJson,\n schemas,\n credentialDefinitions,\n revocationRegistries,\n })\n }\n\n public async getCredentialsForRequest(\n agentContext: AgentContext,\n { requestAttachment, proofFormats }: DidCommProofFormatGetCredentialsForRequestOptions<LegacyIndyDidCommProofFormat>\n ): Promise<DidCommProofFormatGetCredentialsForRequestReturn<LegacyIndyDidCommProofFormat>> {\n this.ensureWarningLoggedOnce(agentContext)\n const proofRequestJson = requestAttachment.getDataAsJson<AnonCredsProofRequest>()\n\n // Set default values\n const { filterByNonRevocationRequirements = true } = proofFormats?.indy ?? {}\n\n const credentialsForRequest = await this._getCredentialsForRequest(agentContext, proofRequestJson, {\n filterByNonRevocationRequirements,\n })\n\n return credentialsForRequest\n }\n\n public async selectCredentialsForRequest(\n agentContext: AgentContext,\n {\n requestAttachment,\n proofFormats,\n }: DidCommProofFormatSelectCredentialsForRequestOptions<LegacyIndyDidCommProofFormat>\n ): Promise<DidCommProofFormatSelectCredentialsForRequestReturn<LegacyIndyDidCommProofFormat>> {\n const proofRequestJson = requestAttachment.getDataAsJson<AnonCredsProofRequest>()\n\n // Set default values\n const { filterByNonRevocationRequirements = true } = proofFormats?.indy ?? {}\n\n const selectedCredentials = this._selectCredentialsForRequest(agentContext, proofRequestJson, {\n filterByNonRevocationRequirements,\n })\n\n return selectedCredentials\n }\n\n public async shouldAutoRespondToProposal(\n agentContext: AgentContext,\n { proposalAttachment, requestAttachment }: DidCommProofFormatAutoRespondProposalOptions\n ): Promise<boolean> {\n const proposalJson = proposalAttachment.getDataAsJson<AnonCredsProofRequest>()\n const requestJson = requestAttachment.getDataAsJson<AnonCredsProofRequest>()\n\n const areRequestsEqual = areAnonCredsProofRequestsEqual(proposalJson, requestJson)\n agentContext.config.logger.debug(`AnonCreds request and proposal are are equal: ${areRequestsEqual}`, {\n proposalJson,\n requestJson,\n })\n\n return areRequestsEqual\n }\n\n public async shouldAutoRespondToRequest(\n _agentContext: AgentContext,\n { proposalAttachment, requestAttachment }: DidCommProofFormatAutoRespondRequestOptions\n ): Promise<boolean> {\n const proposalJson = proposalAttachment.getDataAsJson<AnonCredsProofRequest>()\n const requestJson = requestAttachment.getDataAsJson<AnonCredsProofRequest>()\n\n return areAnonCredsProofRequestsEqual(proposalJson, requestJson)\n }\n\n public async shouldAutoRespondToPresentation(\n _agentContext: AgentContext,\n _options: DidCommProofFormatAutoRespondPresentationOptions\n ): Promise<boolean> {\n // The presentation is already verified in processPresentation, so we can just return true here.\n // It's only an ack, so it's just that we received the presentation.\n return true\n }\n\n public supportsFormat(formatIdentifier: string): boolean {\n const supportedFormats = [V2_INDY_PRESENTATION_PROPOSAL, V2_INDY_PRESENTATION_REQUEST, V2_INDY_PRESENTATION]\n return supportedFormats.includes(formatIdentifier)\n }\n\n private async _getCredentialsForRequest(\n agentContext: AgentContext,\n proofRequest: AnonCredsProofRequest,\n options: AnonCredsGetCredentialsForProofRequestOptions\n ): Promise<AnonCredsCredentialsForProofRequest> {\n const credentialsForProofRequest: AnonCredsCredentialsForProofRequest = {\n attributes: {},\n predicates: {},\n }\n\n for (const [referent, requestedAttribute] of Object.entries(proofRequest.requested_attributes)) {\n const credentials = await this.getCredentialsForProofRequestReferent(agentContext, proofRequest, referent)\n\n credentialsForProofRequest.attributes[referent] = sortRequestedCredentialsMatches(\n await Promise.all(\n credentials.map(async (credential) => {\n const { isRevoked, timestamp } = await this.getRevocationStatus(\n agentContext,\n proofRequest,\n requestedAttribute,\n credential.credentialInfo\n )\n\n return {\n credentialId: credential.credentialInfo.credentialId,\n revealed: true,\n credentialInfo: credential.credentialInfo,\n timestamp,\n revoked: isRevoked,\n } satisfies AnonCredsRequestedAttributeMatch\n })\n )\n )\n\n // We only attach revoked state if non-revocation is requested. So if revoked is true it means\n // the credential is not applicable to the proof request\n if (options.filterByNonRevocationRequirements) {\n credentialsForProofRequest.attributes[referent] = credentialsForProofRequest.attributes[referent].filter(\n (r) => !r.revoked\n )\n }\n }\n\n for (const [referent, requestedPredicate] of Object.entries(proofRequest.requested_predicates)) {\n const credentials = await this.getCredentialsForProofRequestReferent(agentContext, proofRequest, referent)\n\n credentialsForProofRequest.predicates[referent] = sortRequestedCredentialsMatches(\n await Promise.all(\n credentials.map(async (credential) => {\n const { isRevoked, timestamp } = await this.getRevocationStatus(\n agentContext,\n proofRequest,\n requestedPredicate,\n credential.credentialInfo\n )\n\n return {\n credentialId: credential.credentialInfo.credentialId,\n credentialInfo: credential.credentialInfo,\n timestamp,\n revoked: isRevoked,\n } satisfies AnonCredsRequestedPredicateMatch\n })\n )\n )\n\n // We only attach revoked state if non-revocation is requested. So if revoked is true it means\n // the credential is not applicable to the proof request\n if (options.filterByNonRevocationRequirements) {\n credentialsForProofRequest.predicates[referent] = credentialsForProofRequest.predicates[referent].filter(\n (r) => !r.revoked\n )\n }\n }\n\n return credentialsForProofRequest\n }\n\n private async _selectCredentialsForRequest(\n agentContext: AgentContext,\n proofRequest: AnonCredsProofRequest,\n options: AnonCredsGetCredentialsForProofRequestOptions\n ): Promise<AnonCredsSelectedCredentials> {\n const credentialsForRequest = await this._getCredentialsForRequest(agentContext, proofRequest, options)\n\n const selectedCredentials: AnonCredsSelectedCredentials = {\n attributes: {},\n predicates: {},\n selfAttestedAttributes: {},\n }\n\n for (const attributeName of Object.keys(credentialsForRequest.attributes)) {\n const attributeArray = credentialsForRequest.attributes[attributeName]\n\n if (attributeArray.length === 0) {\n throw new CredoError('Unable to automatically select requested attributes.')\n }\n\n selectedCredentials.attributes[attributeName] = attributeArray[0]\n }\n\n for (const attributeName of Object.keys(credentialsForRequest.predicates)) {\n if (credentialsForRequest.predicates[attributeName].length === 0) {\n throw new CredoError('Unable to automatically select requested predicates.')\n }\n selectedCredentials.predicates[attributeName] = credentialsForRequest.predicates[attributeName][0]\n }\n\n return selectedCredentials\n }\n\n private async getCredentialsForProofRequestReferent(\n agentContext: AgentContext,\n proofRequest: AnonCredsProofRequest,\n attributeReferent: string\n ): Promise<GetCredentialsForProofRequestReturn> {\n const holderService = agentContext.dependencyManager.resolve<AnonCredsHolderService>(AnonCredsHolderServiceSymbol)\n\n const credentials = await holderService.getCredentialsForProofRequest(agentContext, {\n proofRequest,\n attributeReferent,\n })\n\n return credentials\n }\n\n /**\n * Build schemas object needed to create and verify proof objects.\n *\n * Creates object with `{ schemaId: AnonCredsSchema }` mapping\n *\n * @param schemaIds List of schema ids\n * @returns Object containing schemas for specified schema ids\n *\n */\n private async getSchemas(agentContext: AgentContext, schemaIds: Set<string>) {\n const schemas: { [key: string]: AnonCredsSchema } = {}\n\n for (const schemaId of schemaIds) {\n const schemaResult = await fetchSchema(agentContext, schemaId)\n if (isUnqualifiedSchemaId(schemaResult.schemaId)) {\n schemas[schemaId] = schemaResult.schema\n } else {\n schemas[getUnQualifiedDidIndyDid(schemaId)] = getUnqualifiedDidIndySchema(schemaResult.schema)\n }\n }\n\n return schemas\n }\n\n /**\n * Build credential definitions object needed to create and verify proof objects.\n *\n * Creates object with `{ credentialDefinitionId: AnonCredsCredentialDefinition }` mapping\n *\n * @param credentialDefinitionIds List of credential definition ids\n * @returns Object containing credential definitions for specified credential definition ids\n *\n */\n private async getCredentialDefinitions(agentContext: AgentContext, credentialDefinitionIds: Set<string>) {\n const credentialDefinitions: { [key: string]: AnonCredsCredentialDefinition } = {}\n\n for (const credentialDefinitionId of credentialDefinitionIds) {\n const credentialDefinitionResult = await fetchCredentialDefinition(agentContext, credentialDefinitionId)\n if (isUnqualifiedCredentialDefinitionId(credentialDefinitionResult.credentialDefinitionId)) {\n credentialDefinitions[credentialDefinitionId] = credentialDefinitionResult.credentialDefinition\n } else {\n credentialDefinitions[getUnQualifiedDidIndyDid(credentialDefinitionId)] =\n getUnqualifiedDidIndyCredentialDefinition(credentialDefinitionResult.credentialDefinition)\n }\n }\n\n return credentialDefinitions\n }\n\n private async getRevocationStatus(\n agentContext: AgentContext,\n proofRequest: AnonCredsProofRequest,\n requestedItem: AnonCredsRequestedAttribute | AnonCredsRequestedPredicate,\n credentialInfo: AnonCredsCredentialInfo\n ) {\n const requestNonRevoked = requestedItem.non_revoked ?? proofRequest.non_revoked\n const credentialRevocationId = credentialInfo.credentialRevocationId\n const revocationRegistryId = credentialInfo.revocationRegistryId\n\n // If revocation interval is not present or the credential is not revocable then we\n // don't need to fetch the revocation status\n if (!requestNonRevoked || credentialRevocationId === null || !revocationRegistryId) {\n return { isRevoked: undefined, timestamp: undefined }\n }\n\n agentContext.config.logger.trace(\n `Fetching credential revocation status for credential revocation id '${credentialRevocationId}' with revocation interval with from '${requestNonRevoked.from}' and to '${requestNonRevoked.to}'`\n )\n\n // Make sure the revocation interval follows best practices from Aries RFC 0441\n assertBestPracticeRevocationInterval(requestNonRevoked)\n\n const { revocationStatusList } = await fetchRevocationStatusList(\n agentContext,\n revocationRegistryId,\n requestNonRevoked.to ?? dateToTimestamp(new Date())\n )\n\n // Item is revoked when the value at the index is 1\n const isRevoked = revocationStatusList.revocationList[Number.parseInt(credentialRevocationId, 10)] === 1\n\n agentContext.config.logger.trace(\n `Credential with credential revocation index '${credentialRevocationId}' is ${\n isRevoked ? '' : 'not '\n }revoked with revocation interval with to '${requestNonRevoked.to}' & from '${requestNonRevoked.from}'`\n )\n\n return {\n isRevoked,\n timestamp: revocationStatusList.timestamp,\n }\n }\n\n /**\n * Create indy proof from a given proof request and requested credential object.\n *\n * @param proofRequest The proof request to create the proof for\n * @param requestedCredentials The requested credentials object specifying which credentials to use for the proof\n * @returns indy proof object\n */\n private async createProof(\n agentContext: AgentContext,\n proofRequest: AnonCredsProofRequest,\n selectedCredentials: AnonCredsSelectedCredentials\n ): Promise<AnonCredsProof> {\n const holderService = agentContext.dependencyManager.resolve<AnonCredsHolderService>(AnonCredsHolderServiceSymbol)\n\n const credentialObjects = await Promise.all(\n [...Object.values(selectedCredentials.attributes), ...Object.values(selectedCredentials.predicates)].map(\n async (c) => c.credentialInfo ?? holderService.getCredential(agentContext, { id: c.credentialId })\n )\n )\n\n const schemas = await this.getSchemas(agentContext, new Set(credentialObjects.map((c) => c.schemaId)))\n const credentialDefinitions = await this.getCredentialDefinitions(\n agentContext,\n new Set(credentialObjects.map((c) => c.credentialDefinitionId))\n )\n\n // selectedCredentials are overridden with specified timestamps of the revocation status list that\n // should be used for the selected credentials.\n const { revocationRegistries, updatedSelectedCredentials } = await getRevocationRegistriesForRequest(\n agentContext,\n proofRequest,\n selectedCredentials\n )\n\n return await holderService.createProof(agentContext, {\n proofRequest,\n selectedCredentials: updatedSelectedCredentials,\n schemas,\n credentialDefinitions,\n revocationRegistries,\n })\n }\n\n /**\n * Returns an object of type {@link DidCommAttachment} for use in credential exchange messages.\n * It looks up the correct format identifier and encodes the data as a base64 attachment.\n *\n * @param data The data to include in the attach object\n * @param id the attach id from the formats component of the message\n */\n private getFormatData(data: unknown, id: string): DidCommAttachment {\n const attachment = new DidCommAttachment({\n id,\n mimeType: 'application/json',\n data: new DidCommAttachmentData({\n base64: JsonEncoder.toBase64(data),\n }),\n })\n\n return attachment\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+DA,MAAM,gCAAgC;AACtC,MAAM,+BAA+B;AACrC,MAAM,uBAAuB;AAE7B,IAAa,sCAAb,MAAoH;;OAClG,YAAY;OAEpB,mBAAmB;;CAC3B,AAAQ,wBAAwB,cAA4B;AAC1D,MAAI,KAAK,iBAAkB;AAE3B,eAAa,OAAO,OAAO,MACzB,yLACD;AACD,OAAK,mBAAmB;;CAG1B,MAAa,eACX,cACA,EAAE,cAAc,gBACyB;AACzC,OAAK,wBAAwB,aAAa;EAC1C,MAAM,gBAAgB,aAAa,kBAAkB,QAAgC,6BAA6B;EAClH,MAAM,SAAS,IAAI,uBAAuB;GACxC,QAAQ;GACR;GACD,C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sB,+BAA+B,MAAM,kCACjE,cACA,cACA,oBACD;AAED,SAAO,MAAM,cAAc,YAAY,cAAc;GACnD;GACA,qBAAqB;GACrB;GACA;GACA;GACD,CAAC;;;;;;;;;CAUJ,AAAQ,cAAc,MAAe,IAA+B;AASlE,SARmB,IAAI,kBAAkB;GACvC;GACA,UAAU;GACV,MAAM,IAAI,sBAAsB,EAC9B,QAAQ,YAAY,SAAS,KAAK,EACnC,CAAC;GACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AnonCredsDidCommAcceptOfferFormat, AnonCredsDidCommAcceptProposalFormat, AnonCredsDidCommAcceptRequestFormat, AnonCredsDidCommCredentialFormat, AnonCredsDidCommCredentialProposalFormat, AnonCredsDidCommOfferCredentialFormat, AnonCredsDidCommProposeCredentialFormat } from "./AnonCredsDidCommCredentialFormat.mjs";
|
|
2
|
+
import { AnonCredsDidCommCredentialFormatService } from "./AnonCredsDidCommCredentialFormatService.mjs";
|
|
3
|
+
import { AnonCredsCredentialsForProofRequest, AnonCredsDidCommProofFormat, AnonCredsGetCredentialsForProofRequestOptions, AnonCredsPresentationPreviewAttribute, AnonCredsPresentationPreviewPredicate, AnonCredsProposeProofFormat, AnonCredsRequestProofFormat } from "./AnonCredsDidCommProofFormat.mjs";
|
|
4
|
+
import { AnonCredsDidCommProofFormatService } from "./AnonCredsDidCommProofFormatService.mjs";
|
|
5
|
+
import { DataIntegrityDidCommCredentialFormatService } from "./DataIntegrityDidCommCredentialFormatService.mjs";
|
|
6
|
+
import { LegacyIndyCredentialFormat, LegacyIndyCredentialRequest, LegacyIndyDidCommCredentialProposalFormat, LegacyIndyDidCommProposeCredentialFormat } from "./LegacyIndyDidCommCredentialFormat.mjs";
|
|
7
|
+
import { LegacyIndyDidCommCredentialFormatService } from "./LegacyIndyDidCommCredentialFormatService.mjs";
|
|
8
|
+
import { LegacyIndyDidCommProofFormat, LegacyIndyProofRequest } from "./LegacyIndyDidCommProofFormat.mjs";
|
|
9
|
+
import { LegacyIndyDidCommProofFormatService } from "./LegacyIndyDidCommProofFormatService.mjs";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AnonCredsDidCommCredentialFormatService } from "./AnonCredsDidCommCredentialFormatService.mjs";
|
|
2
|
+
import { AnonCredsDidCommProofFormatService } from "./AnonCredsDidCommProofFormatService.mjs";
|
|
3
|
+
import { DataIntegrityDidCommCredentialFormatService } from "./DataIntegrityDidCommCredentialFormatService.mjs";
|
|
4
|
+
import { LegacyIndyDidCommCredentialFormatService } from "./LegacyIndyDidCommCredentialFormatService.mjs";
|
|
5
|
+
import { LegacyIndyDidCommProofFormatService } from "./LegacyIndyDidCommProofFormatService.mjs";
|