@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":"AnonCredsDataIntegrityService.mjs","names":["AnonCredsDataIntegrityService","credentialsProve: AnonCredsCredentialProve[]","credentialsWithMetadata: CredentialWithRevocationMetadata[]","anonCredsProofRequest: AnonCredsProofRequest","descriptor: InputDescriptorV1 | InputDescriptorV2 | undefined","descriptor","proof","result: { value: unknown; path: PathComponent[] }[]","predicates: {\n predicateType: AnonCredsRequestedPredicate['p_type']\n predicateValue: AnonCredsRequestedPredicate['p_value']\n }[]","supportedJsonSchemaNumericRangeProperties: Record<string, AnonCredsRequestedPredicate['p_type']>","linkSecretId","createPresentationOptions: CreateW3cPresentationOptions"],"sources":["../../src/anoncreds-rs/AnonCredsDataIntegrityService.ts"],"sourcesContent":["import { JSONPath } from '@astronautlabs/jsonpath'\nimport type {\n AgentContext,\n AnoncredsDataIntegrityVerifyPresentation,\n DifPresentationExchangeDefinition,\n DifPresentationExchangeSubmission,\n IAnonCredsDataIntegrityService,\n W3cCredentialRecord,\n W3cJsonLdVerifiableCredential,\n} from '@credo-ts/core'\nimport {\n ANONCREDS_DATA_INTEGRITY_CRYPTOSUITE,\n ClaimFormat,\n CredoError,\n deepEquality,\n Hasher,\n injectable,\n JsonTransformer,\n TypedArrayEncoder,\n} from '@credo-ts/core'\nimport type { Descriptor, FieldV2, InputDescriptorV1, InputDescriptorV2 } from '@sphereon/pex-models'\nimport type { AnonCredsProofRequest, AnonCredsRequestedPredicate } from '../models'\nimport type { CredentialWithRevocationMetadata } from '../models/utils'\nimport type { AnonCredsCredentialProve, AnonCredsHolderService, CreateW3cPresentationOptions } from '../services'\nimport { AnonCredsHolderServiceSymbol, AnonCredsVerifierServiceSymbol } from '../services'\nimport { fetchCredentialDefinitions, fetchSchemas } from '../utils/anonCredsObjects'\nimport { bytesToBigint } from '../utils/bytesToBigint'\nimport { assertLinkSecretsMatch } from '../utils/linkSecret'\nimport { getAnonCredsTagsFromRecord } from '../utils/w3cAnonCredsUtils'\nimport type { AnonCredsRsVerifierService } from './AnonCredsRsVerifierService'\n\nimport { getW3cAnonCredsCredentialMetadata } from './utils'\n\nexport type PathComponent = string | number\n\n@injectable()\nexport class AnonCredsDataIntegrityService implements IAnonCredsDataIntegrityService {\n private getDataIntegrityProof(credential: W3cJsonLdVerifiableCredential) {\n const cryptosuite = ANONCREDS_DATA_INTEGRITY_CRYPTOSUITE\n if (Array.isArray(credential.proof)) {\n const proof = credential.proof.find(\n (proof) => proof.type === 'DataIntegrityProof' && 'cryptosuite' in proof && proof.cryptosuite === cryptosuite\n )\n if (!proof) throw new CredoError(`Could not find ${ANONCREDS_DATA_INTEGRITY_CRYPTOSUITE} proof`)\n return proof\n }\n\n if (\n credential.proof.type !== 'DataIntegrityProof' ||\n !('cryptosuite' in credential.proof && credential.proof.cryptosuite === cryptosuite)\n ) {\n throw new CredoError(`Could not find ${ANONCREDS_DATA_INTEGRITY_CRYPTOSUITE} proof`)\n }\n\n return credential.proof\n }\n private extractPathNodes(obj: unknown, paths: string[]): { value: unknown; path: PathComponent[] }[] {\n let result: { value: unknown; path: PathComponent[] }[] = []\n if (paths) {\n for (const path of paths) {\n result = JSONPath.nodes(obj, path)\n if (result.length) break\n }\n }\n return result\n }\n\n private async getCredentialMetadataForDescriptor(\n _agentContext: AgentContext,\n descriptorMapObject: Descriptor,\n selectedCredentials: W3cJsonLdVerifiableCredential[]\n ) {\n const credentialExtractionResult = this.extractPathNodes({ verifiableCredential: selectedCredentials }, [\n descriptorMapObject.path,\n ])\n\n if (credentialExtractionResult.length === 0 || credentialExtractionResult.length > 1) {\n throw new Error('Could not extract credential from presentation submission')\n }\n\n const w3cJsonLdVerifiableCredential = credentialExtractionResult[0].value as W3cJsonLdVerifiableCredential\n const w3cJsonLdVerifiableCredentialJson = JsonTransformer.toJSON(w3cJsonLdVerifiableCredential)\n\n const entryIndex = selectedCredentials.findIndex((credential) =>\n deepEquality(JsonTransformer.toJSON(credential), w3cJsonLdVerifiableCredentialJson)\n )\n if (entryIndex === -1) throw new CredoError('Could not find selected credential')\n\n return {\n entryIndex,\n credential: selectedCredentials[entryIndex],\n ...getW3cAnonCredsCredentialMetadata(w3cJsonLdVerifiableCredential),\n }\n }\n\n private descriptorRequiresRevocationStatus(descriptor: InputDescriptorV1 | InputDescriptorV2) {\n const statuses = descriptor.constraints?.statuses\n if (!statuses) return false\n if (\n statuses?.active?.directive &&\n (statuses.active.directive === 'allowed' || statuses.active.directive === 'required')\n ) {\n return true\n }\n throw new CredoError('Unsupported status directive')\n }\n\n private getPredicateTypeAndValues(predicateFilter: NonNullable<FieldV2['filter']>) {\n const predicates: {\n predicateType: AnonCredsRequestedPredicate['p_type']\n predicateValue: AnonCredsRequestedPredicate['p_value']\n }[] = []\n\n const supportedJsonSchemaNumericRangeProperties: Record<string, AnonCredsRequestedPredicate['p_type']> = {\n exclusiveMinimum: '>',\n exclusiveMaximum: '<',\n minimum: '>=',\n maximum: '<=',\n }\n\n for (const [key, value] of Object.entries(predicateFilter)) {\n if (key === 'type') continue\n\n const predicateType = supportedJsonSchemaNumericRangeProperties[key]\n if (!predicateType) throw new CredoError(`Unsupported predicate filter property '${key}'`)\n predicates.push({\n predicateType,\n predicateValue: value,\n })\n }\n\n return predicates\n }\n\n private getClaimNameForField(field: FieldV2) {\n if (!field.path) throw new CredoError('Field path is required')\n // fixme: could the path start otherwise?\n const baseClaimPath = '$.credentialSubject.'\n const claimPaths = field.path.filter((path) => path.startsWith(baseClaimPath))\n if (claimPaths.length === 0) return undefined\n\n // FIXME: we should iterate over all attributes of the schema here and check if the path is valid\n // see https://identity.foundation/presentation-exchange/#presentation-definition\n const claimNames = claimPaths.map((path) => path.slice(baseClaimPath.length))\n const propertyName = claimNames[0]\n\n return propertyName\n }\n\n public createAnonCredsProofRequestAndMetadata = async (\n agentContext: AgentContext,\n presentationDefinition: DifPresentationExchangeDefinition,\n presentationSubmission: DifPresentationExchangeSubmission,\n credentials: W3cJsonLdVerifiableCredential[],\n challenge: string\n ) => {\n const credentialsProve: AnonCredsCredentialProve[] = []\n const schemaIds = new Set<string>()\n const credentialDefinitionIds = new Set<string>()\n const credentialsWithMetadata: CredentialWithRevocationMetadata[] = []\n\n const hash = Hasher.hash(TypedArrayEncoder.fromString(challenge), 'sha-256')\n const nonce = bytesToBigint(hash).toString().slice(0, 20)\n\n const anonCredsProofRequest: AnonCredsProofRequest = {\n version: '1.0',\n name: presentationDefinition.name ?? 'Proof request',\n nonce,\n requested_attributes: {},\n requested_predicates: {},\n }\n\n const nonRevoked = Math.floor(Date.now() / 1000)\n const nonRevokedInterval = { from: nonRevoked, to: nonRevoked }\n\n for (const descriptorMapObject of presentationSubmission.descriptor_map) {\n const descriptor: InputDescriptorV1 | InputDescriptorV2 | undefined = (\n presentationDefinition.input_descriptors as InputDescriptorV2[]\n ).find((descriptor) => descriptor.id === descriptorMapObject.id)\n\n if (!descriptor) {\n throw new Error(`Descriptor with id ${descriptorMapObject.id} not found in presentation definition`)\n }\n\n const referent = descriptorMapObject.id\n const attributeReferent = `${referent}_attribute`\n const predicateReferentBase = `${referent}_predicate`\n let predicateReferentIndex = 0\n\n const fields = descriptor.constraints?.fields\n if (!fields) throw new CredoError('Unclear mapping of constraint with no fields.')\n\n const { entryIndex, schemaId, credentialDefinitionId, revocationRegistryId, credential } =\n await this.getCredentialMetadataForDescriptor(agentContext, descriptorMapObject, credentials)\n\n schemaIds.add(schemaId)\n credentialDefinitionIds.add(credentialDefinitionId)\n\n const requiresRevocationStatus = this.descriptorRequiresRevocationStatus(descriptor)\n if (requiresRevocationStatus && !revocationRegistryId) {\n throw new CredoError('Selected credentials must be revocable but are not')\n }\n\n credentialsWithMetadata.push({\n credential,\n nonRevoked: requiresRevocationStatus ? nonRevokedInterval : undefined,\n })\n\n for (const field of fields) {\n const propertyName = this.getClaimNameForField(field)\n if (!propertyName) continue\n\n if (field.predicate) {\n if (!field.filter) throw new CredoError('Missing required predicate filter property.')\n const predicateTypeAndValues = this.getPredicateTypeAndValues(field.filter)\n for (const { predicateType, predicateValue } of predicateTypeAndValues) {\n const predicateReferent = `${predicateReferentBase}_${predicateReferentIndex++}`\n anonCredsProofRequest.requested_predicates[predicateReferent] = {\n name: propertyName,\n p_type: predicateType,\n p_value: predicateValue,\n restrictions: [{ cred_def_id: credentialDefinitionId }],\n non_revoked: requiresRevocationStatus ? nonRevokedInterval : undefined,\n }\n\n credentialsProve.push({ entryIndex, referent: predicateReferent, isPredicate: true, reveal: true })\n }\n } else {\n if (!anonCredsProofRequest.requested_attributes[attributeReferent]) {\n anonCredsProofRequest.requested_attributes[attributeReferent] = {\n names: [propertyName],\n restrictions: [{ cred_def_id: credentialDefinitionId }],\n non_revoked: requiresRevocationStatus ? nonRevokedInterval : undefined,\n }\n } else {\n const names = anonCredsProofRequest.requested_attributes[attributeReferent].names ?? []\n anonCredsProofRequest.requested_attributes[attributeReferent].names = [...names, propertyName]\n }\n\n credentialsProve.push({ entryIndex, referent: attributeReferent, isPredicate: false, reveal: true })\n }\n }\n }\n\n return { anonCredsProofRequest, credentialsWithMetadata, credentialsProve, schemaIds, credentialDefinitionIds }\n }\n\n public async createPresentation(\n agentContext: AgentContext,\n options: {\n presentationDefinition: DifPresentationExchangeDefinition\n presentationSubmission: DifPresentationExchangeSubmission\n selectedCredentialRecords: W3cCredentialRecord[]\n challenge: string\n }\n ) {\n const { presentationDefinition, presentationSubmission, selectedCredentialRecords, challenge } = options\n\n const linkSecrets = selectedCredentialRecords\n .map((record) => getAnonCredsTagsFromRecord(record)?.anonCredsLinkSecretId)\n .filter((linkSecretId): linkSecretId is string => linkSecretId !== undefined)\n\n const linkSecretId = assertLinkSecretsMatch(agentContext, linkSecrets)\n\n const { anonCredsProofRequest, credentialDefinitionIds, schemaIds, credentialsProve, credentialsWithMetadata } =\n await this.createAnonCredsProofRequestAndMetadata(\n agentContext,\n presentationDefinition,\n presentationSubmission,\n selectedCredentialRecords.map((record) => record.firstCredential) as W3cJsonLdVerifiableCredential[],\n challenge\n )\n\n const createPresentationOptions: CreateW3cPresentationOptions = {\n linkSecretId,\n proofRequest: anonCredsProofRequest,\n credentialsProve,\n credentialsWithRevocationMetadata: credentialsWithMetadata,\n schemas: await fetchSchemas(agentContext, schemaIds),\n credentialDefinitions: await fetchCredentialDefinitions(agentContext, credentialDefinitionIds),\n }\n\n const anonCredsHolderService =\n agentContext.dependencyManager.resolve<AnonCredsHolderService>(AnonCredsHolderServiceSymbol)\n const w3cPresentation = await anonCredsHolderService.createW3cPresentation(agentContext, createPresentationOptions)\n return w3cPresentation\n }\n\n public async verifyPresentation(agentContext: AgentContext, options: AnoncredsDataIntegrityVerifyPresentation) {\n const { presentation, presentationDefinition, presentationSubmission, challenge } = options\n\n const credentialDefinitionIds = new Set<string>()\n\n const verifiableCredentials = Array.isArray(presentation.verifiableCredential)\n ? presentation.verifiableCredential\n : [presentation.verifiableCredential]\n\n for (const verifiableCredential of verifiableCredentials) {\n if (verifiableCredential.claimFormat === ClaimFormat.LdpVc) {\n const proof = this.getDataIntegrityProof(verifiableCredential)\n credentialDefinitionIds.add(proof.verificationMethod)\n } else {\n throw new CredoError('Unsupported credential type')\n }\n }\n\n const { anonCredsProofRequest, credentialsWithMetadata } = await this.createAnonCredsProofRequestAndMetadata(\n agentContext,\n presentationDefinition,\n presentationSubmission,\n verifiableCredentials as W3cJsonLdVerifiableCredential[],\n challenge\n )\n\n const credentialDefinitions = await fetchCredentialDefinitions(agentContext, credentialDefinitionIds)\n const schemaIds = new Set(Object.values(credentialDefinitions).map((cd) => cd.schemaId))\n const schemas = await fetchSchemas(agentContext, schemaIds)\n\n const anonCredsVerifierService =\n agentContext.dependencyManager.resolve<AnonCredsRsVerifierService>(AnonCredsVerifierServiceSymbol)\n\n return await anonCredsVerifierService.verifyW3cPresentation(agentContext, {\n credentialsWithRevocationMetadata: credentialsWithMetadata,\n presentation,\n proofRequest: anonCredsProofRequest,\n schemas,\n credentialDefinitions,\n })\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
import { AnonCredsModuleConfig } from "../AnonCredsModuleConfig.mjs";
|
|
2
|
+
import { AnonCredsRsError } from "../error/AnonCredsRsError.mjs";
|
|
3
|
+
import "../error/index.mjs";
|
|
4
|
+
import { __decorate } from "../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
|
|
5
|
+
import { isUnqualifiedCredentialDefinitionId, isUnqualifiedIndyDid, isUnqualifiedSchemaId, unqualifiedCredentialDefinitionIdRegex } from "../utils/indyIdentifiers.mjs";
|
|
6
|
+
import { AnonCredsCredentialRepository } from "../repository/AnonCredsCredentialRepository.mjs";
|
|
7
|
+
import { AnonCredsLinkSecretRepository } from "../repository/AnonCredsLinkSecretRepository.mjs";
|
|
8
|
+
import "../repository/index.mjs";
|
|
9
|
+
import { AnonCredsRegistryService } from "../services/registry/AnonCredsRegistryService.mjs";
|
|
10
|
+
import "../services/index.mjs";
|
|
11
|
+
import { assertLinkSecretsMatch, getLinkSecret, storeLinkSecret } from "../utils/linkSecret.mjs";
|
|
12
|
+
import { W3cAnonCredsCredentialMetadataKey } from "../utils/metadata.mjs";
|
|
13
|
+
import { getAnoncredsCredentialInfoFromRecord, getW3cRecordAnonCredsTags } from "../utils/w3cAnonCredsUtils.mjs";
|
|
14
|
+
import "../utils/index.mjs";
|
|
15
|
+
import { AnonCredsRestrictionWrapper } from "../models/AnonCredsRestrictionWrapper.mjs";
|
|
16
|
+
import "../models/index.mjs";
|
|
17
|
+
import { proofRequestUsesUnqualifiedIdentifiers } from "../utils/proofRequest.mjs";
|
|
18
|
+
import { getRevocationMetadata } from "./utils.mjs";
|
|
19
|
+
import { CredoError, JsonTransformer, Kms, TypedArrayEncoder, W3cCredentialRecord, W3cCredentialRepository, W3cCredentialService, W3cJsonLdVerifiableCredential, W3cJsonLdVerifiablePresentation, injectable, utils } from "@credo-ts/core";
|
|
20
|
+
import { Credential, CredentialRequest, CredentialRevocationState, LinkSecret, Presentation, RevocationRegistryDefinition, RevocationStatusList, W3cCredential as W3cCredential$1, W3cPresentation, anoncreds } from "@hyperledger/anoncreds-shared";
|
|
21
|
+
|
|
22
|
+
//#region src/anoncreds-rs/AnonCredsRsHolderService.ts
|
|
23
|
+
let AnonCredsRsHolderService = class AnonCredsRsHolderService$1 {
|
|
24
|
+
constructor() {
|
|
25
|
+
this.getPresentationMetadata = async (agentContext, options) => {
|
|
26
|
+
const { credentialsWithMetadata, credentialsProve } = options;
|
|
27
|
+
return {
|
|
28
|
+
credentialsProve,
|
|
29
|
+
credentials: await Promise.all(credentialsWithMetadata.map(async ({ credential, nonRevoked }) => {
|
|
30
|
+
const credentialJson = JsonTransformer.toJSON(credential);
|
|
31
|
+
const { revocationRegistryIndex, revocationRegistryId, timestamp } = W3cCredential$1.fromJson(credentialJson);
|
|
32
|
+
if (!nonRevoked) return {
|
|
33
|
+
credential: credentialJson,
|
|
34
|
+
revocationState: void 0,
|
|
35
|
+
timestamp: void 0
|
|
36
|
+
};
|
|
37
|
+
if (!revocationRegistryId || !revocationRegistryIndex) throw new CredoError("Missing revocation metadata");
|
|
38
|
+
const { revocationState, updatedTimestamp } = await getRevocationMetadata(agentContext, {
|
|
39
|
+
nonRevokedInterval: nonRevoked,
|
|
40
|
+
timestamp,
|
|
41
|
+
revocationRegistryIndex,
|
|
42
|
+
revocationRegistryId
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
credential: credentialJson,
|
|
46
|
+
revocationState,
|
|
47
|
+
timestamp: updatedTimestamp
|
|
48
|
+
};
|
|
49
|
+
}))
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
async createLinkSecret(_agentContext, options) {
|
|
54
|
+
return {
|
|
55
|
+
linkSecretId: options?.linkSecretId ?? utils.uuid(),
|
|
56
|
+
linkSecretValue: LinkSecret.create()
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* generate an 80-bit nonce suitable for AnonCreds proofs
|
|
61
|
+
*/
|
|
62
|
+
generateNonce(agentContext) {
|
|
63
|
+
return agentContext.resolve(Kms.KeyManagementApi).randomBytes({ length: 10 }).reduce((acc, byte) => acc << 8n | BigInt(byte), 0n).toString();
|
|
64
|
+
}
|
|
65
|
+
async createProof(agentContext, options) {
|
|
66
|
+
const { credentialDefinitions, proofRequest, selectedCredentials, schemas } = options;
|
|
67
|
+
let presentation;
|
|
68
|
+
try {
|
|
69
|
+
const rsCredentialDefinitions = {};
|
|
70
|
+
for (const credDefId in credentialDefinitions) rsCredentialDefinitions[credDefId] = credentialDefinitions[credDefId];
|
|
71
|
+
const rsSchemas = {};
|
|
72
|
+
for (const schemaId in schemas) rsSchemas[schemaId] = schemas[schemaId];
|
|
73
|
+
const w3cCredentialRepository = agentContext.dependencyManager.resolve(W3cCredentialRepository);
|
|
74
|
+
const anoncredsCredentialRepository = agentContext.dependencyManager.resolve(AnonCredsCredentialRepository);
|
|
75
|
+
const retrievedCredentials = /* @__PURE__ */ new Map();
|
|
76
|
+
const credentialEntryFromAttribute = async (attribute) => {
|
|
77
|
+
let credentialRecord = retrievedCredentials.get(attribute.credentialId);
|
|
78
|
+
if (!credentialRecord) {
|
|
79
|
+
const w3cCredentialRecord = await w3cCredentialRepository.findById(agentContext, attribute.credentialId);
|
|
80
|
+
if (w3cCredentialRecord) {
|
|
81
|
+
credentialRecord = w3cCredentialRecord;
|
|
82
|
+
retrievedCredentials.set(attribute.credentialId, w3cCredentialRecord);
|
|
83
|
+
} else {
|
|
84
|
+
credentialRecord = await anoncredsCredentialRepository.getByCredentialId(agentContext, attribute.credentialId);
|
|
85
|
+
agentContext.config.logger.warn([`Creating AnonCreds proof with legacy credential ${attribute.credentialId}.`, "Please run the migration script to migrate credentials to the new w3c format. See https://credo.js.org/guides/updating/versions/0.4-to-0.5 for information on how to migrate."].join("\n"));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const proofUsesUnqualifiedIdentifiers = proofRequestUsesUnqualifiedIdentifiers(proofRequest);
|
|
89
|
+
const { linkSecretId, schemaId, credentialDefinitionId, revocationRegistryId, credentialRevocationId } = getAnoncredsCredentialInfoFromRecord(credentialRecord, proofUsesUnqualifiedIdentifiers);
|
|
90
|
+
const timestamp = attribute.timestamp;
|
|
91
|
+
let revocationState;
|
|
92
|
+
let revocationRegistryDefinition;
|
|
93
|
+
try {
|
|
94
|
+
if (timestamp && credentialRevocationId && revocationRegistryId) {
|
|
95
|
+
if (!options.revocationRegistries[revocationRegistryId]) throw new AnonCredsRsError(`Revocation Registry ${revocationRegistryId} not found`);
|
|
96
|
+
const { definition, revocationStatusLists, tailsFilePath } = options.revocationRegistries[revocationRegistryId];
|
|
97
|
+
const revocationStatusList = revocationStatusLists[timestamp];
|
|
98
|
+
if (!revocationStatusList) throw new CredoError(`Revocation status list for revocation registry ${revocationRegistryId} and timestamp ${timestamp} not found in revocation status lists. All revocation status lists must be present.`);
|
|
99
|
+
revocationRegistryDefinition = RevocationRegistryDefinition.fromJson(definition);
|
|
100
|
+
revocationState = CredentialRevocationState.create({
|
|
101
|
+
revocationRegistryIndex: Number(credentialRevocationId),
|
|
102
|
+
revocationRegistryDefinition,
|
|
103
|
+
tailsPath: tailsFilePath,
|
|
104
|
+
revocationStatusList: RevocationStatusList.fromJson(revocationStatusList)
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
const credential = credentialRecord instanceof W3cCredentialRecord ? await this.w3cToLegacyCredential(agentContext, { credential: credentialRecord.firstCredential }) : credentialRecord.credential;
|
|
108
|
+
if (proofUsesUnqualifiedIdentifiers) {
|
|
109
|
+
credential.schema_id = schemaId;
|
|
110
|
+
credential.cred_def_id = credentialDefinitionId;
|
|
111
|
+
credential.rev_reg_id = revocationRegistryId != null ? revocationRegistryId : void 0;
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
linkSecretId,
|
|
115
|
+
credentialId: attribute.credentialId,
|
|
116
|
+
credentialEntry: {
|
|
117
|
+
credential,
|
|
118
|
+
revocationState: revocationState?.toJson(),
|
|
119
|
+
timestamp
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
} finally {
|
|
123
|
+
revocationState?.handle.clear();
|
|
124
|
+
revocationRegistryDefinition?.handle.clear();
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const credentialsProve = [];
|
|
128
|
+
const credentials = [];
|
|
129
|
+
let entryIndex = 0;
|
|
130
|
+
for (const referent in selectedCredentials.attributes) {
|
|
131
|
+
const attribute = selectedCredentials.attributes[referent];
|
|
132
|
+
const existingCredentialIndex = credentials.findIndex((credential) => credential.credentialId === attribute.credentialId && attribute.timestamp === credential.credentialEntry.timestamp);
|
|
133
|
+
if (existingCredentialIndex !== -1) credentialsProve.push({
|
|
134
|
+
entryIndex: existingCredentialIndex,
|
|
135
|
+
isPredicate: false,
|
|
136
|
+
referent,
|
|
137
|
+
reveal: attribute.revealed
|
|
138
|
+
});
|
|
139
|
+
else {
|
|
140
|
+
credentials.push(await credentialEntryFromAttribute(attribute));
|
|
141
|
+
credentialsProve.push({
|
|
142
|
+
entryIndex,
|
|
143
|
+
isPredicate: false,
|
|
144
|
+
referent,
|
|
145
|
+
reveal: attribute.revealed
|
|
146
|
+
});
|
|
147
|
+
entryIndex = entryIndex + 1;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
for (const referent in selectedCredentials.predicates) {
|
|
151
|
+
const predicate = selectedCredentials.predicates[referent];
|
|
152
|
+
const existingCredentialIndex = credentials.findIndex((credential) => credential.credentialId === predicate.credentialId && predicate.timestamp === credential.credentialEntry.timestamp);
|
|
153
|
+
if (existingCredentialIndex !== -1) credentialsProve.push({
|
|
154
|
+
entryIndex: existingCredentialIndex,
|
|
155
|
+
isPredicate: true,
|
|
156
|
+
referent,
|
|
157
|
+
reveal: true
|
|
158
|
+
});
|
|
159
|
+
else {
|
|
160
|
+
credentials.push(await credentialEntryFromAttribute(predicate));
|
|
161
|
+
credentialsProve.push({
|
|
162
|
+
entryIndex,
|
|
163
|
+
isPredicate: true,
|
|
164
|
+
referent,
|
|
165
|
+
reveal: true
|
|
166
|
+
});
|
|
167
|
+
entryIndex = entryIndex + 1;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
const linkSecret = await getLinkSecret(agentContext, assertLinkSecretsMatch(agentContext, credentials.map((item) => item.linkSecretId)));
|
|
171
|
+
presentation = Presentation.create({
|
|
172
|
+
credentialDefinitions: rsCredentialDefinitions,
|
|
173
|
+
schemas: rsSchemas,
|
|
174
|
+
presentationRequest: proofRequest,
|
|
175
|
+
credentials: credentials.map((entry) => entry.credentialEntry),
|
|
176
|
+
credentialsProve,
|
|
177
|
+
selfAttest: selectedCredentials.selfAttestedAttributes,
|
|
178
|
+
linkSecret
|
|
179
|
+
});
|
|
180
|
+
return presentation.toJson();
|
|
181
|
+
} finally {
|
|
182
|
+
presentation?.handle.clear();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
async createCredentialRequest(agentContext, options) {
|
|
186
|
+
const { useLegacyProverDid, credentialDefinition, credentialOffer } = options;
|
|
187
|
+
let createReturnObj;
|
|
188
|
+
try {
|
|
189
|
+
const linkSecretRepository = agentContext.dependencyManager.resolve(AnonCredsLinkSecretRepository);
|
|
190
|
+
let linkSecretRecord = options.linkSecretId ? await linkSecretRepository.getByLinkSecretId(agentContext, options.linkSecretId) : await linkSecretRepository.findDefault(agentContext);
|
|
191
|
+
if (!linkSecretRecord) {
|
|
192
|
+
if (!agentContext.dependencyManager.resolve(AnonCredsModuleConfig).autoCreateLinkSecret) throw new AnonCredsRsError("No link secret provided to createCredentialRequest and no default link secret has been found");
|
|
193
|
+
const { linkSecretId, linkSecretValue } = await this.createLinkSecret(agentContext, {});
|
|
194
|
+
linkSecretRecord = await storeLinkSecret(agentContext, {
|
|
195
|
+
linkSecretId,
|
|
196
|
+
linkSecretValue,
|
|
197
|
+
setAsDefault: true
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
if (!linkSecretRecord.value) throw new AnonCredsRsError("Link Secret value not stored");
|
|
201
|
+
const isLegacyIdentifier = credentialOffer.cred_def_id.match(unqualifiedCredentialDefinitionIdRegex);
|
|
202
|
+
if (!isLegacyIdentifier && useLegacyProverDid) throw new CredoError("Cannot use legacy prover_did with non-legacy identifiers");
|
|
203
|
+
createReturnObj = CredentialRequest.create({
|
|
204
|
+
entropy: !useLegacyProverDid || !isLegacyIdentifier ? anoncreds.generateNonce() : void 0,
|
|
205
|
+
proverDid: useLegacyProverDid ? TypedArrayEncoder.toBase58(TypedArrayEncoder.fromString(anoncreds.generateNonce().slice(0, 16))) : void 0,
|
|
206
|
+
credentialDefinition,
|
|
207
|
+
credentialOffer,
|
|
208
|
+
linkSecret: linkSecretRecord.value,
|
|
209
|
+
linkSecretId: linkSecretRecord.linkSecretId
|
|
210
|
+
});
|
|
211
|
+
return {
|
|
212
|
+
credentialRequest: createReturnObj.credentialRequest.toJson(),
|
|
213
|
+
credentialRequestMetadata: createReturnObj.credentialRequestMetadata.toJson()
|
|
214
|
+
};
|
|
215
|
+
} finally {
|
|
216
|
+
createReturnObj?.credentialRequest.handle.clear();
|
|
217
|
+
createReturnObj?.credentialRequestMetadata.handle.clear();
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
async w3cToLegacyCredential(_agentContext, options) {
|
|
221
|
+
const credentialJson = JsonTransformer.toJSON(options.credential);
|
|
222
|
+
return W3cCredential$1.fromJson(credentialJson).toLegacy().toJson();
|
|
223
|
+
}
|
|
224
|
+
async processW3cCredential(agentContext, credential, processOptions) {
|
|
225
|
+
const { credentialRequestMetadata, revocationRegistryDefinition, credentialDefinition } = processOptions;
|
|
226
|
+
const processCredentialOptions = {
|
|
227
|
+
credentialRequestMetadata,
|
|
228
|
+
linkSecret: await getLinkSecret(agentContext, credentialRequestMetadata.link_secret_name),
|
|
229
|
+
revocationRegistryDefinition,
|
|
230
|
+
credentialDefinition
|
|
231
|
+
};
|
|
232
|
+
const credentialJson = JsonTransformer.toJSON(credential);
|
|
233
|
+
const processedW3cAnonCredsCredential = W3cCredential$1.fromJson(credentialJson).process(processCredentialOptions);
|
|
234
|
+
return JsonTransformer.fromJSON(processedW3cAnonCredsCredential.toJson(), W3cJsonLdVerifiableCredential);
|
|
235
|
+
}
|
|
236
|
+
async legacyToW3cCredential(agentContext, options) {
|
|
237
|
+
const { credential, issuerId, processOptions } = options;
|
|
238
|
+
let w3cCredential;
|
|
239
|
+
let anonCredsCredential;
|
|
240
|
+
let w3cCredentialObj;
|
|
241
|
+
try {
|
|
242
|
+
anonCredsCredential = Credential.fromJson(credential);
|
|
243
|
+
w3cCredentialObj = anonCredsCredential.toW3c({
|
|
244
|
+
issuerId,
|
|
245
|
+
w3cVersion: "1.1"
|
|
246
|
+
});
|
|
247
|
+
const w3cJsonLdVerifiableCredential = JsonTransformer.fromJSON(w3cCredentialObj.toJson(), W3cJsonLdVerifiableCredential);
|
|
248
|
+
w3cCredential = processOptions ? await this.processW3cCredential(agentContext, w3cJsonLdVerifiableCredential, processOptions) : w3cJsonLdVerifiableCredential;
|
|
249
|
+
} finally {
|
|
250
|
+
anonCredsCredential?.handle?.clear();
|
|
251
|
+
w3cCredentialObj?.handle?.clear();
|
|
252
|
+
}
|
|
253
|
+
return w3cCredential;
|
|
254
|
+
}
|
|
255
|
+
async storeW3cCredential(agentContext, options) {
|
|
256
|
+
const { credential, credentialRequestMetadata, schema, credentialDefinition, credentialDefinitionId, revocationRegistryId } = options;
|
|
257
|
+
const methodName = agentContext.dependencyManager.resolve(AnonCredsRegistryService).getRegistryForIdentifier(agentContext, credential.issuerId).methodName;
|
|
258
|
+
await getLinkSecret(agentContext, credentialRequestMetadata.link_secret_name);
|
|
259
|
+
const { revocationRegistryIndex } = W3cCredential$1.fromJson(JsonTransformer.toJSON(credential));
|
|
260
|
+
if (Array.isArray(credential.credentialSubject)) throw new CredoError("Credential subject must be an object, not an array.");
|
|
261
|
+
const anonCredsTags = getW3cRecordAnonCredsTags({
|
|
262
|
+
credentialSubject: credential.credentialSubject,
|
|
263
|
+
issuerId: credential.issuerId,
|
|
264
|
+
schema,
|
|
265
|
+
schemaId: credentialDefinition.schemaId,
|
|
266
|
+
credentialDefinitionId,
|
|
267
|
+
revocationRegistryId,
|
|
268
|
+
credentialRevocationId: revocationRegistryIndex?.toString(),
|
|
269
|
+
linkSecretId: credentialRequestMetadata.link_secret_name,
|
|
270
|
+
methodName
|
|
271
|
+
});
|
|
272
|
+
const w3cCredentialService = agentContext.dependencyManager.resolve(W3cCredentialService);
|
|
273
|
+
const w3cCredentialRecord = W3cCredentialRecord.fromCredential(credential);
|
|
274
|
+
const anonCredsCredentialMetadata = {
|
|
275
|
+
credentialRevocationId: anonCredsTags.anonCredsCredentialRevocationId,
|
|
276
|
+
linkSecretId: anonCredsTags.anonCredsLinkSecretId,
|
|
277
|
+
methodName: anonCredsTags.anonCredsMethodName
|
|
278
|
+
};
|
|
279
|
+
w3cCredentialRecord.setTags(anonCredsTags);
|
|
280
|
+
w3cCredentialRecord.metadata.set(W3cAnonCredsCredentialMetadataKey, anonCredsCredentialMetadata);
|
|
281
|
+
await w3cCredentialService.storeCredential(agentContext, { record: w3cCredentialRecord });
|
|
282
|
+
return w3cCredentialRecord;
|
|
283
|
+
}
|
|
284
|
+
async storeCredential(agentContext, options) {
|
|
285
|
+
const { credential, credentialDefinition, credentialDefinitionId, credentialRequestMetadata, schema, revocationRegistry } = options;
|
|
286
|
+
const w3cJsonLdCredential = credential instanceof W3cJsonLdVerifiableCredential ? credential : await this.legacyToW3cCredential(agentContext, {
|
|
287
|
+
credential,
|
|
288
|
+
issuerId: credentialDefinition.issuerId,
|
|
289
|
+
processOptions: {
|
|
290
|
+
credentialRequestMetadata,
|
|
291
|
+
credentialDefinition,
|
|
292
|
+
revocationRegistryDefinition: revocationRegistry?.definition
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
return (await this.storeW3cCredential(agentContext, {
|
|
296
|
+
credentialRequestMetadata,
|
|
297
|
+
credential: w3cJsonLdCredential,
|
|
298
|
+
credentialDefinitionId,
|
|
299
|
+
schema,
|
|
300
|
+
credentialDefinition,
|
|
301
|
+
revocationRegistryDefinition: revocationRegistry?.definition,
|
|
302
|
+
revocationRegistryId: revocationRegistry?.id
|
|
303
|
+
})).id;
|
|
304
|
+
}
|
|
305
|
+
async getCredential(agentContext, options) {
|
|
306
|
+
const w3cCredentialRecord = await agentContext.dependencyManager.resolve(W3cCredentialRepository).findById(agentContext, options.id);
|
|
307
|
+
if (w3cCredentialRecord) return getAnoncredsCredentialInfoFromRecord(w3cCredentialRecord, options.useUnqualifiedIdentifiersIfPresent);
|
|
308
|
+
const anonCredsCredentialRecord = await agentContext.dependencyManager.resolve(AnonCredsCredentialRepository).getByCredentialId(agentContext, options.id);
|
|
309
|
+
agentContext.config.logger.warn([`Querying legacy credential repository for credential with id ${options.id}.`, "Please run the migration script to migrate credentials to the new w3c format."].join("\n"));
|
|
310
|
+
return getAnoncredsCredentialInfoFromRecord(anonCredsCredentialRecord);
|
|
311
|
+
}
|
|
312
|
+
async getLegacyCredentials(agentContext, options) {
|
|
313
|
+
return (await agentContext.dependencyManager.resolve(AnonCredsCredentialRepository).findByQuery(agentContext, {
|
|
314
|
+
credentialDefinitionId: options.credentialDefinitionId,
|
|
315
|
+
schemaId: options.schemaId,
|
|
316
|
+
issuerId: options.issuerId,
|
|
317
|
+
schemaName: options.schemaName,
|
|
318
|
+
schemaVersion: options.schemaVersion,
|
|
319
|
+
schemaIssuerId: options.schemaIssuerId,
|
|
320
|
+
methodName: options.methodName
|
|
321
|
+
})).map((credentialRecord) => getAnoncredsCredentialInfoFromRecord(credentialRecord));
|
|
322
|
+
}
|
|
323
|
+
async getCredentials(agentContext, options) {
|
|
324
|
+
const credentials = (await agentContext.dependencyManager.resolve(W3cCredentialRepository).findByQuery(agentContext, {
|
|
325
|
+
issuerId: !options.issuerId || isUnqualifiedIndyDid(options.issuerId) ? void 0 : options.issuerId,
|
|
326
|
+
anonCredsCredentialDefinitionId: !options.credentialDefinitionId || isUnqualifiedCredentialDefinitionId(options.credentialDefinitionId) ? void 0 : options.credentialDefinitionId,
|
|
327
|
+
anonCredsSchemaId: !options.schemaId || isUnqualifiedSchemaId(options.schemaId) ? void 0 : options.schemaId,
|
|
328
|
+
anonCredsSchemaName: options.schemaName,
|
|
329
|
+
anonCredsSchemaVersion: options.schemaVersion,
|
|
330
|
+
anonCredsSchemaIssuerId: !options.schemaIssuerId || isUnqualifiedIndyDid(options.schemaIssuerId) ? void 0 : options.schemaIssuerId,
|
|
331
|
+
anonCredsMethodName: options.methodName,
|
|
332
|
+
anonCredsUnqualifiedSchemaId: options.schemaId && isUnqualifiedSchemaId(options.schemaId) ? options.schemaId : void 0,
|
|
333
|
+
anonCredsUnqualifiedIssuerId: options.issuerId && isUnqualifiedIndyDid(options.issuerId) ? options.issuerId : void 0,
|
|
334
|
+
anonCredsUnqualifiedSchemaIssuerId: options.schemaIssuerId && isUnqualifiedIndyDid(options.schemaIssuerId) ? options.schemaIssuerId : void 0,
|
|
335
|
+
anonCredsUnqualifiedCredentialDefinitionId: options.credentialDefinitionId && isUnqualifiedCredentialDefinitionId(options.credentialDefinitionId) ? options.credentialDefinitionId : void 0
|
|
336
|
+
})).map((credentialRecord) => getAnoncredsCredentialInfoFromRecord(credentialRecord));
|
|
337
|
+
const legacyCredentials = await this.getLegacyCredentials(agentContext, options);
|
|
338
|
+
if (legacyCredentials.length > 0) agentContext.config.logger.warn("Queried credentials include legacy credentials. Please run the migration script to migrate credentials to the new w3c format.");
|
|
339
|
+
return [...legacyCredentials, ...credentials];
|
|
340
|
+
}
|
|
341
|
+
async deleteCredential(agentContext, id) {
|
|
342
|
+
const w3cCredentialRepository = agentContext.dependencyManager.resolve(W3cCredentialRepository);
|
|
343
|
+
const w3cCredentialRecord = await w3cCredentialRepository.findById(agentContext, id);
|
|
344
|
+
if (w3cCredentialRecord) {
|
|
345
|
+
await w3cCredentialRepository.delete(agentContext, w3cCredentialRecord);
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
const anoncredsCredentialRepository = agentContext.dependencyManager.resolve(AnonCredsCredentialRepository);
|
|
349
|
+
const anoncredsCredentialRecord = await anoncredsCredentialRepository.getByCredentialId(agentContext, id);
|
|
350
|
+
await anoncredsCredentialRepository.delete(agentContext, anoncredsCredentialRecord);
|
|
351
|
+
}
|
|
352
|
+
async getLegacyCredentialsForProofRequest(agentContext, options) {
|
|
353
|
+
const proofRequest = options.proofRequest;
|
|
354
|
+
const referent = options.attributeReferent;
|
|
355
|
+
const requestedAttribute = proofRequest.requested_attributes[referent] ?? proofRequest.requested_predicates[referent];
|
|
356
|
+
if (!requestedAttribute) throw new AnonCredsRsError("Referent not found in proof request");
|
|
357
|
+
const $and = [];
|
|
358
|
+
const attributes = requestedAttribute.names ?? [requestedAttribute.name];
|
|
359
|
+
const attributeQuery = {};
|
|
360
|
+
for (const attribute of attributes) attributeQuery[`anonCredsAttr::${attribute}::marker`] = true;
|
|
361
|
+
$and.push(attributeQuery);
|
|
362
|
+
if (requestedAttribute.restrictions) {
|
|
363
|
+
const restrictionQuery = this.queryLegacyFromRestrictions(requestedAttribute.restrictions);
|
|
364
|
+
$and.push(restrictionQuery);
|
|
365
|
+
}
|
|
366
|
+
if (options.extraQuery) $and.push(options.extraQuery);
|
|
367
|
+
return (await agentContext.dependencyManager.resolve(AnonCredsCredentialRepository).findByQuery(agentContext, { $and })).map((credentialRecord) => {
|
|
368
|
+
return {
|
|
369
|
+
credentialInfo: getAnoncredsCredentialInfoFromRecord(credentialRecord),
|
|
370
|
+
interval: proofRequest.non_revoked
|
|
371
|
+
};
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
async getCredentialsForProofRequest(agentContext, options) {
|
|
375
|
+
const proofRequest = options.proofRequest;
|
|
376
|
+
const referent = options.attributeReferent;
|
|
377
|
+
const requestedAttribute = proofRequest.requested_attributes[referent] ?? proofRequest.requested_predicates[referent];
|
|
378
|
+
if (!requestedAttribute) throw new AnonCredsRsError("Referent not found in proof request");
|
|
379
|
+
const $and = [];
|
|
380
|
+
const useUnqualifiedIdentifiers = proofRequestUsesUnqualifiedIdentifiers(proofRequest);
|
|
381
|
+
const attributes = requestedAttribute.names ?? [requestedAttribute.name];
|
|
382
|
+
const attributeQuery = {};
|
|
383
|
+
for (const attribute of attributes) attributeQuery[`anonCredsAttr::${attribute}::marker`] = true;
|
|
384
|
+
$and.push(attributeQuery);
|
|
385
|
+
if (requestedAttribute.restrictions) {
|
|
386
|
+
const restrictionQuery = this.queryFromRestrictions(requestedAttribute.restrictions);
|
|
387
|
+
$and.push(restrictionQuery);
|
|
388
|
+
}
|
|
389
|
+
if (options.extraQuery) $and.push(options.extraQuery);
|
|
390
|
+
const credentials = await agentContext.dependencyManager.resolve(W3cCredentialRepository).findByQuery(agentContext, { $and });
|
|
391
|
+
const legacyCredentialWithMetadata = await this.getLegacyCredentialsForProofRequest(agentContext, options);
|
|
392
|
+
if (legacyCredentialWithMetadata.length > 0) agentContext.config.logger.warn(["Including legacy credentials in proof request.", "Please run the migration script to migrate credentials to the new w3c format."].join("\n"));
|
|
393
|
+
return [...credentials.map((credentialRecord) => {
|
|
394
|
+
return {
|
|
395
|
+
credentialInfo: getAnoncredsCredentialInfoFromRecord(credentialRecord, useUnqualifiedIdentifiers),
|
|
396
|
+
interval: proofRequest.non_revoked
|
|
397
|
+
};
|
|
398
|
+
}), ...legacyCredentialWithMetadata];
|
|
399
|
+
}
|
|
400
|
+
queryFromRestrictions(restrictions) {
|
|
401
|
+
const query = [];
|
|
402
|
+
const { restrictions: parsedRestrictions } = JsonTransformer.fromJSON({ restrictions }, AnonCredsRestrictionWrapper);
|
|
403
|
+
for (const restriction of parsedRestrictions) {
|
|
404
|
+
const queryElements = {};
|
|
405
|
+
if (restriction.credentialDefinitionId) if (isUnqualifiedCredentialDefinitionId(restriction.credentialDefinitionId)) queryElements.anonCredsUnqualifiedCredentialDefinitionId = restriction.credentialDefinitionId;
|
|
406
|
+
else queryElements.anonCredsCredentialDefinitionId = restriction.credentialDefinitionId;
|
|
407
|
+
if (restriction.issuerId || restriction.issuerDid) {
|
|
408
|
+
const issuerId = restriction.issuerId ?? restriction.issuerDid;
|
|
409
|
+
if (isUnqualifiedIndyDid(issuerId)) queryElements.anonCredsUnqualifiedIssuerId = issuerId;
|
|
410
|
+
else queryElements.issuerId = issuerId;
|
|
411
|
+
}
|
|
412
|
+
if (restriction.schemaId) if (isUnqualifiedSchemaId(restriction.schemaId)) queryElements.anonCredsUnqualifiedSchemaId = restriction.schemaId;
|
|
413
|
+
else queryElements.anonCredsSchemaId = restriction.schemaId;
|
|
414
|
+
if (restriction.schemaIssuerId || restriction.schemaIssuerDid) {
|
|
415
|
+
const schemaIssuerId = restriction.schemaIssuerId ?? restriction.schemaIssuerDid;
|
|
416
|
+
if (isUnqualifiedIndyDid(schemaIssuerId)) queryElements.anonCredsUnqualifiedSchemaIssuerId = schemaIssuerId;
|
|
417
|
+
else queryElements.anonCredsSchemaIssuerId = schemaIssuerId;
|
|
418
|
+
}
|
|
419
|
+
if (restriction.schemaName) queryElements.anonCredsSchemaName = restriction.schemaName;
|
|
420
|
+
if (restriction.schemaVersion) queryElements.anonCredsSchemaVersion = restriction.schemaVersion;
|
|
421
|
+
for (const [attributeName, attributeValue] of Object.entries(restriction.attributeValues)) queryElements[`anonCredsAttr::${attributeName}::value`] = attributeValue;
|
|
422
|
+
for (const [attributeName, isAvailable] of Object.entries(restriction.attributeMarkers)) if (isAvailable) queryElements[`anonCredsAttr::${attributeName}::marker`] = isAvailable;
|
|
423
|
+
query.push(queryElements);
|
|
424
|
+
}
|
|
425
|
+
return query.length === 1 ? query[0] : { $or: query };
|
|
426
|
+
}
|
|
427
|
+
queryLegacyFromRestrictions(restrictions) {
|
|
428
|
+
const query = [];
|
|
429
|
+
const { restrictions: parsedRestrictions } = JsonTransformer.fromJSON({ restrictions }, AnonCredsRestrictionWrapper);
|
|
430
|
+
for (const restriction of parsedRestrictions) {
|
|
431
|
+
const queryElements = {};
|
|
432
|
+
const additionalQueryElements = {};
|
|
433
|
+
if (restriction.credentialDefinitionId) {
|
|
434
|
+
queryElements.credentialDefinitionId = restriction.credentialDefinitionId;
|
|
435
|
+
if (isUnqualifiedCredentialDefinitionId(restriction.credentialDefinitionId)) additionalQueryElements.credentialDefinitionId = restriction.credentialDefinitionId;
|
|
436
|
+
}
|
|
437
|
+
if (restriction.issuerId || restriction.issuerDid) {
|
|
438
|
+
const issuerId = restriction.issuerId ?? restriction.issuerDid;
|
|
439
|
+
queryElements.issuerId = issuerId;
|
|
440
|
+
if (isUnqualifiedIndyDid(issuerId)) additionalQueryElements.issuerId = issuerId;
|
|
441
|
+
}
|
|
442
|
+
if (restriction.schemaId) {
|
|
443
|
+
queryElements.schemaId = restriction.schemaId;
|
|
444
|
+
if (isUnqualifiedSchemaId(restriction.schemaId)) additionalQueryElements.schemaId = restriction.schemaId;
|
|
445
|
+
}
|
|
446
|
+
if (restriction.schemaIssuerId || restriction.schemaIssuerDid) {
|
|
447
|
+
const issuerId = restriction.schemaIssuerId ?? restriction.schemaIssuerDid;
|
|
448
|
+
queryElements.schemaIssuerId = issuerId;
|
|
449
|
+
if (isUnqualifiedIndyDid(issuerId)) additionalQueryElements.schemaIssuerId = issuerId;
|
|
450
|
+
}
|
|
451
|
+
if (restriction.schemaName) queryElements.schemaName = restriction.schemaName;
|
|
452
|
+
if (restriction.schemaVersion) queryElements.schemaVersion = restriction.schemaVersion;
|
|
453
|
+
for (const [attributeName, attributeValue] of Object.entries(restriction.attributeValues)) queryElements[`attr::${attributeName}::value`] = attributeValue;
|
|
454
|
+
for (const [attributeName, isAvailable] of Object.entries(restriction.attributeMarkers)) if (isAvailable) queryElements[`attr::${attributeName}::marker`] = isAvailable;
|
|
455
|
+
query.push(queryElements);
|
|
456
|
+
if (Object.keys(additionalQueryElements).length > 0) query.push(additionalQueryElements);
|
|
457
|
+
}
|
|
458
|
+
return query.length === 1 ? query[0] : { $or: query };
|
|
459
|
+
}
|
|
460
|
+
async createW3cPresentation(agentContext, options) {
|
|
461
|
+
const { credentialsProve, credentials } = await this.getPresentationMetadata(agentContext, {
|
|
462
|
+
credentialsWithMetadata: options.credentialsWithRevocationMetadata,
|
|
463
|
+
credentialsProve: options.credentialsProve
|
|
464
|
+
});
|
|
465
|
+
let w3cAnonCredsPresentation;
|
|
466
|
+
let w3cPresentation;
|
|
467
|
+
try {
|
|
468
|
+
w3cAnonCredsPresentation = W3cPresentation.create({
|
|
469
|
+
credentials,
|
|
470
|
+
credentialsProve,
|
|
471
|
+
schemas: options.schemas,
|
|
472
|
+
credentialDefinitions: options.credentialDefinitions,
|
|
473
|
+
presentationRequest: options.proofRequest,
|
|
474
|
+
linkSecret: await getLinkSecret(agentContext, options.linkSecretId)
|
|
475
|
+
});
|
|
476
|
+
const presentationJson = w3cAnonCredsPresentation.toJson();
|
|
477
|
+
w3cPresentation = JsonTransformer.fromJSON(presentationJson, W3cJsonLdVerifiablePresentation);
|
|
478
|
+
} finally {
|
|
479
|
+
w3cAnonCredsPresentation?.handle.clear();
|
|
480
|
+
}
|
|
481
|
+
return w3cPresentation;
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
AnonCredsRsHolderService = __decorate([injectable()], AnonCredsRsHolderService);
|
|
485
|
+
|
|
486
|
+
//#endregion
|
|
487
|
+
export { AnonCredsRsHolderService };
|
|
488
|
+
//# sourceMappingURL=AnonCredsRsHolderService.mjs.map
|