@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,827 @@
|
|
|
1
|
+
import { composeCredentialAutoAccept } from "../../../utils/composeAutoAccept.mjs";
|
|
2
|
+
import { areCredentialPreviewAttributesEqual } from "../../../utils/credentialPreviewAttributes.mjs";
|
|
3
|
+
import "../../../utils/index.mjs";
|
|
4
|
+
import { AnonCredsCredentialProposal } from "../../../models/AnonCredsCredentialProposal.mjs";
|
|
5
|
+
import { DidCommCredentialV1AckMessage } from "./messages/DidCommCredentialV1AckMessage.mjs";
|
|
6
|
+
import { DidCommCredentialV1Preview } from "./messages/DidCommCredentialV1Preview.mjs";
|
|
7
|
+
import { DidCommCredentialV1ProblemReportMessage } from "./messages/DidCommCredentialV1ProblemReportMessage.mjs";
|
|
8
|
+
import { DidCommIssueCredentialV1Message, INDY_CREDENTIAL_ATTACHMENT_ID } from "./messages/DidCommIssueCredentialV1Message.mjs";
|
|
9
|
+
import { INDY_CREDENTIAL_OFFER_ATTACHMENT_ID, V1OfferCredentialMessage } from "./messages/DidCommOfferCredentialV1Message.mjs";
|
|
10
|
+
import { DidCommProposeCredentialV1Message } from "./messages/DidCommProposeCredentialV1Message.mjs";
|
|
11
|
+
import { DidCommRequestCredentialV1Message, INDY_CREDENTIAL_REQUEST_ATTACHMENT_ID } from "./messages/DidCommRequestCredentialV1Message.mjs";
|
|
12
|
+
import "./messages/index.mjs";
|
|
13
|
+
import { DidCommCredentialV1AckHandler } from "./handlers/DidCommCredentialV1AckHandler.mjs";
|
|
14
|
+
import { DidCommCredentialV1ProblemReportHandler } from "./handlers/DidCommCredentialV1ProblemReportHandler.mjs";
|
|
15
|
+
import { DidCommIssueCredentialV1Handler } from "./handlers/DidCommIssueCredentialV1Handler.mjs";
|
|
16
|
+
import { DidCommOfferCredentialV1Handler } from "./handlers/DidCommOfferCredentialV1Handler.mjs";
|
|
17
|
+
import { DidCommProposeCredentialV1Handler } from "./handlers/DidCommProposeCredentialV1Handler.mjs";
|
|
18
|
+
import { DidCommRequestCredentialV1Handler } from "./handlers/DidCommRequestCredentialV1Handler.mjs";
|
|
19
|
+
import "./handlers/index.mjs";
|
|
20
|
+
import { CredoError, JsonTransformer, utils } from "@credo-ts/core";
|
|
21
|
+
import { AckStatus, BaseDidCommCredentialProtocol, DidCommAttachment, DidCommAttachmentData, DidCommAutoAcceptCredential, DidCommConnectionService, DidCommCredentialExchangeRecord, DidCommCredentialExchangeRepository, DidCommCredentialProblemReportReason, DidCommCredentialRole, DidCommCredentialState, DidCommCredentialsModuleConfig, DidCommMessageRepository, DidCommMessageRole, DidCommProtocol } from "@credo-ts/didcomm";
|
|
22
|
+
|
|
23
|
+
//#region src/protocols/credentials/v1/DidCommCredentialV1Protocol.ts
|
|
24
|
+
var DidCommCredentialV1Protocol = class extends BaseDidCommCredentialProtocol {
|
|
25
|
+
constructor({ indyCredentialFormat }) {
|
|
26
|
+
super();
|
|
27
|
+
this.version = "v1";
|
|
28
|
+
this.indyCredentialFormat = indyCredentialFormat;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Registers the protocol implementation (handlers, feature registry) on the agent.
|
|
32
|
+
*/
|
|
33
|
+
register(messageHandlerRegistry, featureRegistry) {
|
|
34
|
+
messageHandlerRegistry.registerMessageHandlers([
|
|
35
|
+
new DidCommProposeCredentialV1Handler(this),
|
|
36
|
+
new DidCommOfferCredentialV1Handler(this),
|
|
37
|
+
new DidCommRequestCredentialV1Handler(this),
|
|
38
|
+
new DidCommIssueCredentialV1Handler(this),
|
|
39
|
+
new DidCommCredentialV1AckHandler(this),
|
|
40
|
+
new DidCommCredentialV1ProblemReportHandler(this)
|
|
41
|
+
]);
|
|
42
|
+
featureRegistry.register(new DidCommProtocol({
|
|
43
|
+
id: "https://didcomm.org/issue-credential/1.0",
|
|
44
|
+
roles: ["holder", "issuer"]
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Create a {@link ProposeCredentialMessage} not bound to an existing credential exchange.
|
|
49
|
+
* To create a proposal as response to an existing credential exchange, use {@link createProposalAsResponse}.
|
|
50
|
+
*
|
|
51
|
+
* @param options The object containing config options
|
|
52
|
+
* @returns Object containing proposal message and associated credential record
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
async createProposal(agentContext, { connectionRecord, credentialFormats, comment, autoAcceptCredential }) {
|
|
56
|
+
this.assertOnlyIndyFormat(credentialFormats);
|
|
57
|
+
const credentialRepository = agentContext.dependencyManager.resolve(DidCommCredentialExchangeRepository);
|
|
58
|
+
const didCommMessageRepository = agentContext.dependencyManager.resolve(DidCommMessageRepository);
|
|
59
|
+
if (!credentialFormats.indy) throw new CredoError("Missing indy credential format in v1 create proposal call.");
|
|
60
|
+
const credentialExchangeRecord = new DidCommCredentialExchangeRecord({
|
|
61
|
+
connectionId: connectionRecord.id,
|
|
62
|
+
threadId: utils.uuid(),
|
|
63
|
+
state: DidCommCredentialState.ProposalSent,
|
|
64
|
+
role: DidCommCredentialRole.Holder,
|
|
65
|
+
autoAcceptCredential,
|
|
66
|
+
protocolVersion: "v1"
|
|
67
|
+
});
|
|
68
|
+
const { previewAttributes, attachment } = await this.indyCredentialFormat.createProposal(agentContext, {
|
|
69
|
+
credentialFormats,
|
|
70
|
+
credentialExchangeRecord
|
|
71
|
+
});
|
|
72
|
+
const indyCredentialProposal = JsonTransformer.fromJSON(attachment.getDataAsJson(), AnonCredsCredentialProposal);
|
|
73
|
+
const credentialProposal = previewAttributes ? new DidCommCredentialV1Preview({ attributes: previewAttributes }) : void 0;
|
|
74
|
+
const message = new DidCommProposeCredentialV1Message({
|
|
75
|
+
...indyCredentialProposal,
|
|
76
|
+
id: credentialExchangeRecord.threadId,
|
|
77
|
+
credentialPreview: credentialProposal,
|
|
78
|
+
comment
|
|
79
|
+
});
|
|
80
|
+
await didCommMessageRepository.saveAgentMessage(agentContext, {
|
|
81
|
+
agentMessage: message,
|
|
82
|
+
role: DidCommMessageRole.Sender,
|
|
83
|
+
associatedRecordId: credentialExchangeRecord.id
|
|
84
|
+
});
|
|
85
|
+
credentialExchangeRecord.credentialAttributes = credentialProposal?.attributes;
|
|
86
|
+
await credentialRepository.save(agentContext, credentialExchangeRecord);
|
|
87
|
+
this.emitStateChangedEvent(agentContext, credentialExchangeRecord, null);
|
|
88
|
+
return {
|
|
89
|
+
credentialExchangeRecord,
|
|
90
|
+
message
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Process a received {@link ProposeCredentialMessage}. This will not accept the credential proposal
|
|
95
|
+
* or send a credential offer. It will only create a new, or update the existing credential record with
|
|
96
|
+
* the information from the credential proposal message. Use {@link createOfferAsResponse}
|
|
97
|
+
* after calling this method to create a credential offer.
|
|
98
|
+
*
|
|
99
|
+
* @param messageContext The message context containing a credential proposal message
|
|
100
|
+
* @returns credential record associated with the credential proposal message
|
|
101
|
+
*
|
|
102
|
+
*/
|
|
103
|
+
async processProposal(messageContext) {
|
|
104
|
+
const { message: proposalMessage, connection, agentContext } = messageContext;
|
|
105
|
+
const credentialRepository = agentContext.dependencyManager.resolve(DidCommCredentialExchangeRepository);
|
|
106
|
+
const didCommMessageRepository = agentContext.dependencyManager.resolve(DidCommMessageRepository);
|
|
107
|
+
const connectionService = agentContext.dependencyManager.resolve(DidCommConnectionService);
|
|
108
|
+
agentContext.config.logger.debug(`Processing credential proposal with message id ${proposalMessage.id}`);
|
|
109
|
+
let credentialExchangeRecord = await this.findByProperties(messageContext.agentContext, {
|
|
110
|
+
threadId: proposalMessage.threadId,
|
|
111
|
+
role: DidCommCredentialRole.Issuer,
|
|
112
|
+
connectionId: connection?.id
|
|
113
|
+
});
|
|
114
|
+
if (credentialExchangeRecord) {
|
|
115
|
+
agentContext.config.logger.debug("Credential record already exists for incoming proposal");
|
|
116
|
+
credentialExchangeRecord.assertProtocolVersion("v1");
|
|
117
|
+
credentialExchangeRecord.assertState(DidCommCredentialState.OfferSent);
|
|
118
|
+
const lastReceivedMessage = await didCommMessageRepository.findAgentMessage(messageContext.agentContext, {
|
|
119
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
120
|
+
messageClass: DidCommProposeCredentialV1Message,
|
|
121
|
+
role: DidCommMessageRole.Receiver
|
|
122
|
+
});
|
|
123
|
+
const lastSentMessage = await didCommMessageRepository.getAgentMessage(messageContext.agentContext, {
|
|
124
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
125
|
+
messageClass: V1OfferCredentialMessage,
|
|
126
|
+
role: DidCommMessageRole.Sender
|
|
127
|
+
});
|
|
128
|
+
await connectionService.assertConnectionOrOutOfBandExchange(messageContext, {
|
|
129
|
+
lastReceivedMessage,
|
|
130
|
+
lastSentMessage,
|
|
131
|
+
expectedConnectionId: credentialExchangeRecord.connectionId
|
|
132
|
+
});
|
|
133
|
+
await this.indyCredentialFormat.processProposal(messageContext.agentContext, {
|
|
134
|
+
credentialExchangeRecord,
|
|
135
|
+
attachment: new DidCommAttachment({ data: new DidCommAttachmentData({ json: JsonTransformer.toJSON(this.rfc0592ProposalFromV1ProposeMessage(proposalMessage)) }) })
|
|
136
|
+
});
|
|
137
|
+
await this.updateState(messageContext.agentContext, credentialExchangeRecord, DidCommCredentialState.ProposalReceived);
|
|
138
|
+
await didCommMessageRepository.saveOrUpdateAgentMessage(messageContext.agentContext, {
|
|
139
|
+
agentMessage: proposalMessage,
|
|
140
|
+
role: DidCommMessageRole.Receiver,
|
|
141
|
+
associatedRecordId: credentialExchangeRecord.id
|
|
142
|
+
});
|
|
143
|
+
} else {
|
|
144
|
+
agentContext.config.logger.debug("Credential record does not exists yet for incoming proposal");
|
|
145
|
+
await connectionService.assertConnectionOrOutOfBandExchange(messageContext);
|
|
146
|
+
credentialExchangeRecord = new DidCommCredentialExchangeRecord({
|
|
147
|
+
connectionId: connection?.id,
|
|
148
|
+
threadId: proposalMessage.threadId,
|
|
149
|
+
state: DidCommCredentialState.ProposalReceived,
|
|
150
|
+
role: DidCommCredentialRole.Issuer,
|
|
151
|
+
protocolVersion: "v1"
|
|
152
|
+
});
|
|
153
|
+
await credentialRepository.save(messageContext.agentContext, credentialExchangeRecord);
|
|
154
|
+
this.emitStateChangedEvent(messageContext.agentContext, credentialExchangeRecord, null);
|
|
155
|
+
await didCommMessageRepository.saveAgentMessage(messageContext.agentContext, {
|
|
156
|
+
agentMessage: proposalMessage,
|
|
157
|
+
role: DidCommMessageRole.Receiver,
|
|
158
|
+
associatedRecordId: credentialExchangeRecord.id
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
return credentialExchangeRecord;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Processing an incoming credential message and create a credential offer as a response
|
|
165
|
+
* @param options The object containing config options
|
|
166
|
+
* @returns Object containing proposal message and associated credential record
|
|
167
|
+
*/
|
|
168
|
+
async acceptProposal(agentContext, { credentialExchangeRecord, credentialFormats, comment, autoAcceptCredential }) {
|
|
169
|
+
credentialExchangeRecord.assertProtocolVersion("v1");
|
|
170
|
+
credentialExchangeRecord.assertState(DidCommCredentialState.ProposalReceived);
|
|
171
|
+
if (credentialFormats) this.assertOnlyIndyFormat(credentialFormats);
|
|
172
|
+
const didCommMessageRepository = agentContext.dependencyManager.resolve(DidCommMessageRepository);
|
|
173
|
+
const proposalMessage = await didCommMessageRepository.getAgentMessage(agentContext, {
|
|
174
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
175
|
+
messageClass: DidCommProposeCredentialV1Message,
|
|
176
|
+
role: DidCommMessageRole.Receiver
|
|
177
|
+
});
|
|
178
|
+
credentialExchangeRecord.credentialAttributes = proposalMessage.credentialPreview?.attributes;
|
|
179
|
+
const { attachment, previewAttributes } = await this.indyCredentialFormat.acceptProposal(agentContext, {
|
|
180
|
+
attachmentId: INDY_CREDENTIAL_OFFER_ATTACHMENT_ID,
|
|
181
|
+
credentialFormats,
|
|
182
|
+
credentialExchangeRecord,
|
|
183
|
+
proposalAttachment: new DidCommAttachment({ data: new DidCommAttachmentData({ json: JsonTransformer.toJSON(this.rfc0592ProposalFromV1ProposeMessage(proposalMessage)) }) })
|
|
184
|
+
});
|
|
185
|
+
if (!previewAttributes) throw new CredoError("Missing required credential preview attributes from indy format service");
|
|
186
|
+
const message = new V1OfferCredentialMessage({
|
|
187
|
+
comment,
|
|
188
|
+
offerAttachments: [attachment],
|
|
189
|
+
credentialPreview: new DidCommCredentialV1Preview({ attributes: previewAttributes })
|
|
190
|
+
});
|
|
191
|
+
message.setThread({
|
|
192
|
+
threadId: credentialExchangeRecord.threadId,
|
|
193
|
+
parentThreadId: credentialExchangeRecord.parentThreadId
|
|
194
|
+
});
|
|
195
|
+
credentialExchangeRecord.credentialAttributes = message.credentialPreview.attributes;
|
|
196
|
+
credentialExchangeRecord.autoAcceptCredential = autoAcceptCredential ?? credentialExchangeRecord.autoAcceptCredential;
|
|
197
|
+
await this.updateState(agentContext, credentialExchangeRecord, DidCommCredentialState.OfferSent);
|
|
198
|
+
await didCommMessageRepository.saveOrUpdateAgentMessage(agentContext, {
|
|
199
|
+
agentMessage: message,
|
|
200
|
+
role: DidCommMessageRole.Sender,
|
|
201
|
+
associatedRecordId: credentialExchangeRecord.id
|
|
202
|
+
});
|
|
203
|
+
return {
|
|
204
|
+
credentialExchangeRecord,
|
|
205
|
+
message
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Negotiate a credential proposal as issuer (by sending a credential offer message) to the connection
|
|
210
|
+
* associated with the credential record.
|
|
211
|
+
*
|
|
212
|
+
* @param options configuration for the offer see {@link NegotiateCredentialProposalOptions}
|
|
213
|
+
* @returns Credential record associated with the credential offer and the corresponding new offer message
|
|
214
|
+
*
|
|
215
|
+
*/
|
|
216
|
+
async negotiateProposal(agentContext, { credentialFormats, credentialExchangeRecord, comment, autoAcceptCredential }) {
|
|
217
|
+
credentialExchangeRecord.assertProtocolVersion("v1");
|
|
218
|
+
credentialExchangeRecord.assertState(DidCommCredentialState.ProposalReceived);
|
|
219
|
+
this.assertOnlyIndyFormat(credentialFormats);
|
|
220
|
+
const didCommMessageRepository = agentContext.dependencyManager.resolve(DidCommMessageRepository);
|
|
221
|
+
const { attachment, previewAttributes } = await this.indyCredentialFormat.createOffer(agentContext, {
|
|
222
|
+
attachmentId: INDY_CREDENTIAL_OFFER_ATTACHMENT_ID,
|
|
223
|
+
credentialFormats,
|
|
224
|
+
credentialExchangeRecord
|
|
225
|
+
});
|
|
226
|
+
if (!previewAttributes) throw new CredoError("Missing required credential preview attributes from indy format service");
|
|
227
|
+
const message = new V1OfferCredentialMessage({
|
|
228
|
+
comment,
|
|
229
|
+
offerAttachments: [attachment],
|
|
230
|
+
credentialPreview: new DidCommCredentialV1Preview({ attributes: previewAttributes })
|
|
231
|
+
});
|
|
232
|
+
message.setThread({
|
|
233
|
+
threadId: credentialExchangeRecord.threadId,
|
|
234
|
+
parentThreadId: credentialExchangeRecord.parentThreadId
|
|
235
|
+
});
|
|
236
|
+
credentialExchangeRecord.credentialAttributes = message.credentialPreview.attributes;
|
|
237
|
+
credentialExchangeRecord.autoAcceptCredential = autoAcceptCredential ?? credentialExchangeRecord.autoAcceptCredential;
|
|
238
|
+
await this.updateState(agentContext, credentialExchangeRecord, DidCommCredentialState.OfferSent);
|
|
239
|
+
await didCommMessageRepository.saveOrUpdateAgentMessage(agentContext, {
|
|
240
|
+
agentMessage: message,
|
|
241
|
+
role: DidCommMessageRole.Sender,
|
|
242
|
+
associatedRecordId: credentialExchangeRecord.id
|
|
243
|
+
});
|
|
244
|
+
return {
|
|
245
|
+
credentialExchangeRecord,
|
|
246
|
+
message
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Create a {@link OfferCredentialMessage} not bound to an existing credential exchange.
|
|
251
|
+
* To create an offer as response to an existing credential exchange, use {@link DidCommCredentialV1Protocol#createOfferAsResponse}.
|
|
252
|
+
*
|
|
253
|
+
* @param options The options containing config params for creating the credential offer
|
|
254
|
+
* @returns Object containing offer message and associated credential record
|
|
255
|
+
*
|
|
256
|
+
*/
|
|
257
|
+
async createOffer(agentContext, { credentialFormats, autoAcceptCredential, comment, connectionRecord }) {
|
|
258
|
+
this.assertOnlyIndyFormat(credentialFormats);
|
|
259
|
+
const credentialRepository = agentContext.dependencyManager.resolve(DidCommCredentialExchangeRepository);
|
|
260
|
+
const didCommMessageRepository = agentContext.dependencyManager.resolve(DidCommMessageRepository);
|
|
261
|
+
if (!credentialFormats.indy) throw new CredoError("Missing indy credential format data for v1 create offer");
|
|
262
|
+
const credentialExchangeRecord = new DidCommCredentialExchangeRecord({
|
|
263
|
+
connectionId: connectionRecord?.id,
|
|
264
|
+
threadId: utils.uuid(),
|
|
265
|
+
state: DidCommCredentialState.OfferSent,
|
|
266
|
+
role: DidCommCredentialRole.Issuer,
|
|
267
|
+
autoAcceptCredential,
|
|
268
|
+
protocolVersion: "v1"
|
|
269
|
+
});
|
|
270
|
+
const { attachment, previewAttributes } = await this.indyCredentialFormat.createOffer(agentContext, {
|
|
271
|
+
attachmentId: INDY_CREDENTIAL_OFFER_ATTACHMENT_ID,
|
|
272
|
+
credentialFormats,
|
|
273
|
+
credentialExchangeRecord
|
|
274
|
+
});
|
|
275
|
+
if (!previewAttributes) throw new CredoError("Missing required credential preview from indy format service");
|
|
276
|
+
const message = new V1OfferCredentialMessage({
|
|
277
|
+
id: credentialExchangeRecord.threadId,
|
|
278
|
+
credentialPreview: new DidCommCredentialV1Preview({ attributes: previewAttributes }),
|
|
279
|
+
comment,
|
|
280
|
+
offerAttachments: [attachment]
|
|
281
|
+
});
|
|
282
|
+
await didCommMessageRepository.saveAgentMessage(agentContext, {
|
|
283
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
284
|
+
agentMessage: message,
|
|
285
|
+
role: DidCommMessageRole.Sender
|
|
286
|
+
});
|
|
287
|
+
credentialExchangeRecord.credentialAttributes = message.credentialPreview.attributes;
|
|
288
|
+
await credentialRepository.save(agentContext, credentialExchangeRecord);
|
|
289
|
+
this.emitStateChangedEvent(agentContext, credentialExchangeRecord, null);
|
|
290
|
+
return {
|
|
291
|
+
message,
|
|
292
|
+
credentialExchangeRecord
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Process a received {@link OfferCredentialMessage}. This will not accept the credential offer
|
|
297
|
+
* or send a credential request. It will only create a new credential record with
|
|
298
|
+
* the information from the credential offer message. Use {@link createRequest}
|
|
299
|
+
* after calling this method to create a credential request.
|
|
300
|
+
*
|
|
301
|
+
* @param messageContext The message context containing a credential request message
|
|
302
|
+
* @returns credential record associated with the credential offer message
|
|
303
|
+
*
|
|
304
|
+
*/
|
|
305
|
+
async processOffer(messageContext) {
|
|
306
|
+
const { message: offerMessage, connection, agentContext } = messageContext;
|
|
307
|
+
const credentialRepository = agentContext.dependencyManager.resolve(DidCommCredentialExchangeRepository);
|
|
308
|
+
const didCommMessageRepository = agentContext.dependencyManager.resolve(DidCommMessageRepository);
|
|
309
|
+
const connectionService = agentContext.dependencyManager.resolve(DidCommConnectionService);
|
|
310
|
+
agentContext.config.logger.debug(`Processing credential offer with id ${offerMessage.id}`);
|
|
311
|
+
let credentialExchangeRecord = await this.findByProperties(agentContext, {
|
|
312
|
+
threadId: offerMessage.threadId,
|
|
313
|
+
role: DidCommCredentialRole.Holder,
|
|
314
|
+
connectionId: connection?.id
|
|
315
|
+
});
|
|
316
|
+
const offerAttachment = offerMessage.getOfferAttachmentById(INDY_CREDENTIAL_OFFER_ATTACHMENT_ID);
|
|
317
|
+
if (!offerAttachment) throw new CredoError(`Indy attachment with id ${INDY_CREDENTIAL_OFFER_ATTACHMENT_ID} not found in offer message`);
|
|
318
|
+
if (credentialExchangeRecord) {
|
|
319
|
+
const lastSentMessage = await didCommMessageRepository.getAgentMessage(messageContext.agentContext, {
|
|
320
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
321
|
+
messageClass: DidCommProposeCredentialV1Message,
|
|
322
|
+
role: DidCommMessageRole.Sender
|
|
323
|
+
});
|
|
324
|
+
const lastReceivedMessage = await didCommMessageRepository.findAgentMessage(messageContext.agentContext, {
|
|
325
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
326
|
+
messageClass: V1OfferCredentialMessage,
|
|
327
|
+
role: DidCommMessageRole.Receiver
|
|
328
|
+
});
|
|
329
|
+
credentialExchangeRecord.assertProtocolVersion("v1");
|
|
330
|
+
credentialExchangeRecord.assertState(DidCommCredentialState.ProposalSent);
|
|
331
|
+
await connectionService.assertConnectionOrOutOfBandExchange(messageContext, {
|
|
332
|
+
lastReceivedMessage,
|
|
333
|
+
lastSentMessage,
|
|
334
|
+
expectedConnectionId: credentialExchangeRecord.connectionId
|
|
335
|
+
});
|
|
336
|
+
await this.indyCredentialFormat.processOffer(messageContext.agentContext, {
|
|
337
|
+
credentialExchangeRecord,
|
|
338
|
+
attachment: offerAttachment
|
|
339
|
+
});
|
|
340
|
+
await didCommMessageRepository.saveOrUpdateAgentMessage(messageContext.agentContext, {
|
|
341
|
+
agentMessage: offerMessage,
|
|
342
|
+
role: DidCommMessageRole.Receiver,
|
|
343
|
+
associatedRecordId: credentialExchangeRecord.id
|
|
344
|
+
});
|
|
345
|
+
await this.updateState(messageContext.agentContext, credentialExchangeRecord, DidCommCredentialState.OfferReceived);
|
|
346
|
+
return credentialExchangeRecord;
|
|
347
|
+
}
|
|
348
|
+
await connectionService.assertConnectionOrOutOfBandExchange(messageContext);
|
|
349
|
+
credentialExchangeRecord = new DidCommCredentialExchangeRecord({
|
|
350
|
+
connectionId: connection?.id,
|
|
351
|
+
threadId: offerMessage.threadId,
|
|
352
|
+
parentThreadId: offerMessage.thread?.parentThreadId,
|
|
353
|
+
state: DidCommCredentialState.OfferReceived,
|
|
354
|
+
role: DidCommCredentialRole.Holder,
|
|
355
|
+
protocolVersion: "v1"
|
|
356
|
+
});
|
|
357
|
+
await this.indyCredentialFormat.processOffer(messageContext.agentContext, {
|
|
358
|
+
credentialExchangeRecord,
|
|
359
|
+
attachment: offerAttachment
|
|
360
|
+
});
|
|
361
|
+
await didCommMessageRepository.saveAgentMessage(messageContext.agentContext, {
|
|
362
|
+
agentMessage: offerMessage,
|
|
363
|
+
role: DidCommMessageRole.Receiver,
|
|
364
|
+
associatedRecordId: credentialExchangeRecord.id
|
|
365
|
+
});
|
|
366
|
+
await credentialRepository.save(messageContext.agentContext, credentialExchangeRecord);
|
|
367
|
+
this.emitStateChangedEvent(messageContext.agentContext, credentialExchangeRecord, null);
|
|
368
|
+
return credentialExchangeRecord;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Create a {@link RequestCredentialMessage} as response to a received credential offer.
|
|
372
|
+
*
|
|
373
|
+
* @param options configuration to use for the credential request
|
|
374
|
+
* @returns Object containing request message and associated credential record
|
|
375
|
+
*
|
|
376
|
+
*/
|
|
377
|
+
async acceptOffer(agentContext, { credentialExchangeRecord, credentialFormats, comment, autoAcceptCredential }) {
|
|
378
|
+
credentialExchangeRecord.assertProtocolVersion("v1");
|
|
379
|
+
credentialExchangeRecord.assertState(DidCommCredentialState.OfferReceived);
|
|
380
|
+
const didCommMessageRepository = agentContext.dependencyManager.resolve(DidCommMessageRepository);
|
|
381
|
+
const offerMessage = await didCommMessageRepository.getAgentMessage(agentContext, {
|
|
382
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
383
|
+
messageClass: V1OfferCredentialMessage,
|
|
384
|
+
role: DidCommMessageRole.Receiver
|
|
385
|
+
});
|
|
386
|
+
const offerAttachment = offerMessage.getOfferAttachmentById(INDY_CREDENTIAL_OFFER_ATTACHMENT_ID);
|
|
387
|
+
if (!offerAttachment) throw new CredoError(`Indy attachment with id ${INDY_CREDENTIAL_OFFER_ATTACHMENT_ID} not found in offer message`);
|
|
388
|
+
const { attachment } = await this.indyCredentialFormat.acceptOffer(agentContext, {
|
|
389
|
+
credentialExchangeRecord,
|
|
390
|
+
credentialFormats,
|
|
391
|
+
attachmentId: INDY_CREDENTIAL_REQUEST_ATTACHMENT_ID,
|
|
392
|
+
offerAttachment
|
|
393
|
+
});
|
|
394
|
+
const requestMessage = new DidCommRequestCredentialV1Message({
|
|
395
|
+
comment,
|
|
396
|
+
requestAttachments: [attachment]
|
|
397
|
+
});
|
|
398
|
+
requestMessage.setThread({
|
|
399
|
+
threadId: credentialExchangeRecord.threadId,
|
|
400
|
+
parentThreadId: credentialExchangeRecord.parentThreadId
|
|
401
|
+
});
|
|
402
|
+
credentialExchangeRecord.credentialAttributes = offerMessage.credentialPreview.attributes;
|
|
403
|
+
credentialExchangeRecord.autoAcceptCredential = autoAcceptCredential ?? credentialExchangeRecord.autoAcceptCredential;
|
|
404
|
+
await didCommMessageRepository.saveOrUpdateAgentMessage(agentContext, {
|
|
405
|
+
agentMessage: requestMessage,
|
|
406
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
407
|
+
role: DidCommMessageRole.Sender
|
|
408
|
+
});
|
|
409
|
+
await this.updateState(agentContext, credentialExchangeRecord, DidCommCredentialState.RequestSent);
|
|
410
|
+
return {
|
|
411
|
+
message: requestMessage,
|
|
412
|
+
credentialExchangeRecord
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Process a received {@link RequestCredentialMessage}. This will not accept the credential request
|
|
417
|
+
* or send a credential. It will only update the existing credential record with
|
|
418
|
+
* the information from the credential request message. Use {@link createCredential}
|
|
419
|
+
* after calling this method to create a credential.
|
|
420
|
+
*
|
|
421
|
+
* @param messageContext The message context containing a credential request message
|
|
422
|
+
* @returns credential record associated with the credential request message
|
|
423
|
+
*
|
|
424
|
+
*/
|
|
425
|
+
async negotiateOffer(agentContext, { credentialFormats, credentialExchangeRecord, autoAcceptCredential, comment }) {
|
|
426
|
+
credentialExchangeRecord.assertProtocolVersion("v1");
|
|
427
|
+
credentialExchangeRecord.assertState(DidCommCredentialState.OfferReceived);
|
|
428
|
+
this.assertOnlyIndyFormat(credentialFormats);
|
|
429
|
+
const didCommMessageRepository = agentContext.dependencyManager.resolve(DidCommMessageRepository);
|
|
430
|
+
if (!credentialExchangeRecord.connectionId) throw new CredoError(`No connectionId found for credential record '${credentialExchangeRecord.id}'. Connection-less issuance does not support negotiation.`);
|
|
431
|
+
if (!credentialFormats.indy) throw new CredoError("Missing indy credential format in v1 negotiate proposal call.");
|
|
432
|
+
const { previewAttributes, attachment } = await this.indyCredentialFormat.createProposal(agentContext, {
|
|
433
|
+
credentialFormats,
|
|
434
|
+
credentialExchangeRecord
|
|
435
|
+
});
|
|
436
|
+
const indyCredentialProposal = JsonTransformer.fromJSON(attachment.getDataAsJson(), AnonCredsCredentialProposal);
|
|
437
|
+
const credentialProposal = previewAttributes ? new DidCommCredentialV1Preview({ attributes: previewAttributes }) : void 0;
|
|
438
|
+
const message = new DidCommProposeCredentialV1Message({
|
|
439
|
+
...indyCredentialProposal,
|
|
440
|
+
credentialPreview: credentialProposal,
|
|
441
|
+
comment
|
|
442
|
+
});
|
|
443
|
+
message.setThread({
|
|
444
|
+
threadId: credentialExchangeRecord.threadId,
|
|
445
|
+
parentThreadId: credentialExchangeRecord.parentThreadId
|
|
446
|
+
});
|
|
447
|
+
await didCommMessageRepository.saveOrUpdateAgentMessage(agentContext, {
|
|
448
|
+
agentMessage: message,
|
|
449
|
+
role: DidCommMessageRole.Sender,
|
|
450
|
+
associatedRecordId: credentialExchangeRecord.id
|
|
451
|
+
});
|
|
452
|
+
credentialExchangeRecord.credentialAttributes = message.credentialPreview?.attributes;
|
|
453
|
+
credentialExchangeRecord.autoAcceptCredential = autoAcceptCredential ?? credentialExchangeRecord.autoAcceptCredential;
|
|
454
|
+
await this.updateState(agentContext, credentialExchangeRecord, DidCommCredentialState.ProposalSent);
|
|
455
|
+
return {
|
|
456
|
+
credentialExchangeRecord,
|
|
457
|
+
message
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Starting from a request is not supported in v1 of the issue credential protocol
|
|
462
|
+
* because indy doesn't allow to start from a request
|
|
463
|
+
*/
|
|
464
|
+
async createRequest() {
|
|
465
|
+
throw new CredoError("Starting from a request is not supported for v1 issue credential protocol");
|
|
466
|
+
}
|
|
467
|
+
async processRequest(messageContext) {
|
|
468
|
+
const { message: requestMessage, connection, agentContext } = messageContext;
|
|
469
|
+
const didCommMessageRepository = agentContext.dependencyManager.resolve(DidCommMessageRepository);
|
|
470
|
+
const connectionService = agentContext.dependencyManager.resolve(DidCommConnectionService);
|
|
471
|
+
agentContext.config.logger.debug(`Processing credential request with id ${requestMessage.id}`);
|
|
472
|
+
const credentialExchangeRecord = await this.getByProperties(messageContext.agentContext, {
|
|
473
|
+
threadId: requestMessage.threadId,
|
|
474
|
+
role: DidCommCredentialRole.Issuer
|
|
475
|
+
});
|
|
476
|
+
agentContext.config.logger.trace("Credential record found when processing credential request", credentialExchangeRecord);
|
|
477
|
+
const proposalMessage = await didCommMessageRepository.findAgentMessage(messageContext.agentContext, {
|
|
478
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
479
|
+
messageClass: DidCommProposeCredentialV1Message,
|
|
480
|
+
role: DidCommMessageRole.Receiver
|
|
481
|
+
});
|
|
482
|
+
const offerMessage = await didCommMessageRepository.findAgentMessage(messageContext.agentContext, {
|
|
483
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
484
|
+
messageClass: V1OfferCredentialMessage,
|
|
485
|
+
role: DidCommMessageRole.Sender
|
|
486
|
+
});
|
|
487
|
+
credentialExchangeRecord.assertProtocolVersion("v1");
|
|
488
|
+
credentialExchangeRecord.assertState(DidCommCredentialState.OfferSent);
|
|
489
|
+
await connectionService.assertConnectionOrOutOfBandExchange(messageContext, {
|
|
490
|
+
lastReceivedMessage: proposalMessage ?? void 0,
|
|
491
|
+
lastSentMessage: offerMessage ?? void 0,
|
|
492
|
+
expectedConnectionId: credentialExchangeRecord.connectionId
|
|
493
|
+
});
|
|
494
|
+
if (!credentialExchangeRecord.connectionId) {
|
|
495
|
+
await connectionService.matchIncomingMessageToRequestMessageInOutOfBandExchange(messageContext, { expectedConnectionId: credentialExchangeRecord.connectionId });
|
|
496
|
+
credentialExchangeRecord.connectionId = connection?.id;
|
|
497
|
+
}
|
|
498
|
+
const requestAttachment = requestMessage.getRequestAttachmentById(INDY_CREDENTIAL_REQUEST_ATTACHMENT_ID);
|
|
499
|
+
if (!requestAttachment) throw new CredoError(`Indy attachment with id ${INDY_CREDENTIAL_REQUEST_ATTACHMENT_ID} not found in request message`);
|
|
500
|
+
await this.indyCredentialFormat.processRequest(messageContext.agentContext, {
|
|
501
|
+
credentialExchangeRecord,
|
|
502
|
+
attachment: requestAttachment
|
|
503
|
+
});
|
|
504
|
+
await didCommMessageRepository.saveAgentMessage(messageContext.agentContext, {
|
|
505
|
+
agentMessage: requestMessage,
|
|
506
|
+
role: DidCommMessageRole.Receiver,
|
|
507
|
+
associatedRecordId: credentialExchangeRecord.id
|
|
508
|
+
});
|
|
509
|
+
await this.updateState(messageContext.agentContext, credentialExchangeRecord, DidCommCredentialState.RequestReceived);
|
|
510
|
+
return credentialExchangeRecord;
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Create a {@link DidCommIssueCredentialV1Message} as response to a received credential request.
|
|
514
|
+
*
|
|
515
|
+
* @returns Object containing issue credential message and associated credential record
|
|
516
|
+
*
|
|
517
|
+
*/
|
|
518
|
+
async acceptRequest(agentContext, { credentialExchangeRecord, credentialFormats, comment, autoAcceptCredential }) {
|
|
519
|
+
credentialExchangeRecord.assertProtocolVersion("v1");
|
|
520
|
+
credentialExchangeRecord.assertState(DidCommCredentialState.RequestReceived);
|
|
521
|
+
if (credentialFormats) this.assertOnlyIndyFormat(credentialFormats);
|
|
522
|
+
const didCommMessageRepository = agentContext.dependencyManager.resolve(DidCommMessageRepository);
|
|
523
|
+
const offerMessage = await didCommMessageRepository.getAgentMessage(agentContext, {
|
|
524
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
525
|
+
messageClass: V1OfferCredentialMessage,
|
|
526
|
+
role: DidCommMessageRole.Sender
|
|
527
|
+
});
|
|
528
|
+
const requestMessage = await didCommMessageRepository.getAgentMessage(agentContext, {
|
|
529
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
530
|
+
messageClass: DidCommRequestCredentialV1Message,
|
|
531
|
+
role: DidCommMessageRole.Receiver
|
|
532
|
+
});
|
|
533
|
+
const offerAttachment = offerMessage.getOfferAttachmentById(INDY_CREDENTIAL_OFFER_ATTACHMENT_ID);
|
|
534
|
+
const requestAttachment = requestMessage.getRequestAttachmentById(INDY_CREDENTIAL_REQUEST_ATTACHMENT_ID);
|
|
535
|
+
if (!offerAttachment || !requestAttachment) throw new CredoError(`Missing data payload in offer or request attachment in credential Record ${credentialExchangeRecord.id}`);
|
|
536
|
+
const { attachment } = await this.indyCredentialFormat.acceptRequest(agentContext, {
|
|
537
|
+
credentialExchangeRecord,
|
|
538
|
+
requestAttachment,
|
|
539
|
+
offerAttachment,
|
|
540
|
+
attachmentId: INDY_CREDENTIAL_ATTACHMENT_ID,
|
|
541
|
+
credentialFormats
|
|
542
|
+
});
|
|
543
|
+
const issueMessage = new DidCommIssueCredentialV1Message({
|
|
544
|
+
comment,
|
|
545
|
+
credentialAttachments: [attachment]
|
|
546
|
+
});
|
|
547
|
+
issueMessage.setThread({
|
|
548
|
+
threadId: credentialExchangeRecord.threadId,
|
|
549
|
+
parentThreadId: credentialExchangeRecord.parentThreadId
|
|
550
|
+
});
|
|
551
|
+
issueMessage.setPleaseAck();
|
|
552
|
+
await didCommMessageRepository.saveAgentMessage(agentContext, {
|
|
553
|
+
agentMessage: issueMessage,
|
|
554
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
555
|
+
role: DidCommMessageRole.Sender
|
|
556
|
+
});
|
|
557
|
+
credentialExchangeRecord.autoAcceptCredential = autoAcceptCredential ?? credentialExchangeRecord.autoAcceptCredential;
|
|
558
|
+
await this.updateState(agentContext, credentialExchangeRecord, DidCommCredentialState.CredentialIssued);
|
|
559
|
+
return {
|
|
560
|
+
message: issueMessage,
|
|
561
|
+
credentialExchangeRecord
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Process an incoming {@link DidCommIssueCredentialV1Message}
|
|
566
|
+
*
|
|
567
|
+
* @param messageContext The message context containing a credential acknowledgement message
|
|
568
|
+
* @returns credential record associated with the credential acknowledgement message
|
|
569
|
+
*
|
|
570
|
+
*/
|
|
571
|
+
async processCredential(messageContext) {
|
|
572
|
+
const { message: issueMessage, connection, agentContext } = messageContext;
|
|
573
|
+
agentContext.config.logger.debug(`Processing credential with id ${issueMessage.id}`);
|
|
574
|
+
const didCommMessageRepository = agentContext.dependencyManager.resolve(DidCommMessageRepository);
|
|
575
|
+
const connectionService = agentContext.dependencyManager.resolve(DidCommConnectionService);
|
|
576
|
+
const credentialExchangeRecord = await this.getByProperties(messageContext.agentContext, {
|
|
577
|
+
threadId: issueMessage.threadId,
|
|
578
|
+
role: DidCommCredentialRole.Holder,
|
|
579
|
+
connectionId: connection?.id
|
|
580
|
+
});
|
|
581
|
+
const requestCredentialMessage = await didCommMessageRepository.findAgentMessage(messageContext.agentContext, {
|
|
582
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
583
|
+
messageClass: DidCommRequestCredentialV1Message,
|
|
584
|
+
role: DidCommMessageRole.Sender
|
|
585
|
+
});
|
|
586
|
+
const offerCredentialMessage = await didCommMessageRepository.findAgentMessage(messageContext.agentContext, {
|
|
587
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
588
|
+
messageClass: V1OfferCredentialMessage,
|
|
589
|
+
role: DidCommMessageRole.Receiver
|
|
590
|
+
});
|
|
591
|
+
credentialExchangeRecord.assertProtocolVersion("v1");
|
|
592
|
+
credentialExchangeRecord.assertState(DidCommCredentialState.RequestSent);
|
|
593
|
+
await connectionService.assertConnectionOrOutOfBandExchange(messageContext, {
|
|
594
|
+
lastReceivedMessage: offerCredentialMessage,
|
|
595
|
+
lastSentMessage: requestCredentialMessage,
|
|
596
|
+
expectedConnectionId: credentialExchangeRecord.connectionId
|
|
597
|
+
});
|
|
598
|
+
const issueAttachment = issueMessage.getCredentialAttachmentById(INDY_CREDENTIAL_ATTACHMENT_ID);
|
|
599
|
+
if (!issueAttachment) throw new CredoError("Missing indy credential attachment in processCredential");
|
|
600
|
+
const requestAttachment = requestCredentialMessage?.getRequestAttachmentById(INDY_CREDENTIAL_REQUEST_ATTACHMENT_ID);
|
|
601
|
+
if (!requestAttachment) throw new CredoError("Missing indy credential request attachment in processCredential");
|
|
602
|
+
const offerAttachment = offerCredentialMessage?.getOfferAttachmentById(INDY_CREDENTIAL_OFFER_ATTACHMENT_ID);
|
|
603
|
+
if (!offerAttachment) throw new CredoError("Missing indy credential request attachment in processCredential");
|
|
604
|
+
await this.indyCredentialFormat.processCredential(messageContext.agentContext, {
|
|
605
|
+
offerAttachment,
|
|
606
|
+
attachment: issueAttachment,
|
|
607
|
+
credentialExchangeRecord,
|
|
608
|
+
requestAttachment
|
|
609
|
+
});
|
|
610
|
+
await didCommMessageRepository.saveAgentMessage(messageContext.agentContext, {
|
|
611
|
+
agentMessage: issueMessage,
|
|
612
|
+
role: DidCommMessageRole.Receiver,
|
|
613
|
+
associatedRecordId: credentialExchangeRecord.id
|
|
614
|
+
});
|
|
615
|
+
await this.updateState(messageContext.agentContext, credentialExchangeRecord, DidCommCredentialState.CredentialReceived);
|
|
616
|
+
return credentialExchangeRecord;
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Create a {@link CredentialAckMessage} as response to a received credential.
|
|
620
|
+
*
|
|
621
|
+
* @param credentialExchangeRecord The credential record for which to create the credential acknowledgement
|
|
622
|
+
* @returns Object containing credential acknowledgement message and associated credential record
|
|
623
|
+
*
|
|
624
|
+
*/
|
|
625
|
+
async acceptCredential(agentContext, { credentialExchangeRecord }) {
|
|
626
|
+
credentialExchangeRecord.assertProtocolVersion("v1");
|
|
627
|
+
credentialExchangeRecord.assertState(DidCommCredentialState.CredentialReceived);
|
|
628
|
+
const ackMessage = new DidCommCredentialV1AckMessage({
|
|
629
|
+
status: AckStatus.OK,
|
|
630
|
+
threadId: credentialExchangeRecord.threadId
|
|
631
|
+
});
|
|
632
|
+
ackMessage.setThread({
|
|
633
|
+
threadId: credentialExchangeRecord.threadId,
|
|
634
|
+
parentThreadId: credentialExchangeRecord.parentThreadId
|
|
635
|
+
});
|
|
636
|
+
await this.updateState(agentContext, credentialExchangeRecord, DidCommCredentialState.Done);
|
|
637
|
+
return {
|
|
638
|
+
message: ackMessage,
|
|
639
|
+
credentialExchangeRecord
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Process a received {@link CredentialAckMessage}.
|
|
644
|
+
*
|
|
645
|
+
* @param messageContext The message context containing a credential acknowledgement message
|
|
646
|
+
* @returns credential record associated with the credential acknowledgement message
|
|
647
|
+
*
|
|
648
|
+
*/
|
|
649
|
+
async processAck(messageContext) {
|
|
650
|
+
const { message: ackMessage, connection, agentContext } = messageContext;
|
|
651
|
+
agentContext.config.logger.debug(`Processing credential ack with id ${ackMessage.id}`);
|
|
652
|
+
const didCommMessageRepository = agentContext.dependencyManager.resolve(DidCommMessageRepository);
|
|
653
|
+
const connectionService = agentContext.dependencyManager.resolve(DidCommConnectionService);
|
|
654
|
+
const credentialExchangeRecord = await this.getByProperties(messageContext.agentContext, {
|
|
655
|
+
threadId: ackMessage.threadId,
|
|
656
|
+
role: DidCommCredentialRole.Issuer,
|
|
657
|
+
connectionId: connection?.id
|
|
658
|
+
});
|
|
659
|
+
const requestCredentialMessage = await didCommMessageRepository.getAgentMessage(messageContext.agentContext, {
|
|
660
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
661
|
+
messageClass: DidCommRequestCredentialV1Message,
|
|
662
|
+
role: DidCommMessageRole.Receiver
|
|
663
|
+
});
|
|
664
|
+
const issueCredentialMessage = await didCommMessageRepository.getAgentMessage(messageContext.agentContext, {
|
|
665
|
+
associatedRecordId: credentialExchangeRecord.id,
|
|
666
|
+
messageClass: DidCommIssueCredentialV1Message,
|
|
667
|
+
role: DidCommMessageRole.Sender
|
|
668
|
+
});
|
|
669
|
+
credentialExchangeRecord.assertProtocolVersion("v1");
|
|
670
|
+
credentialExchangeRecord.assertState(DidCommCredentialState.CredentialIssued);
|
|
671
|
+
await connectionService.assertConnectionOrOutOfBandExchange(messageContext, {
|
|
672
|
+
lastReceivedMessage: requestCredentialMessage,
|
|
673
|
+
lastSentMessage: issueCredentialMessage,
|
|
674
|
+
expectedConnectionId: credentialExchangeRecord.connectionId
|
|
675
|
+
});
|
|
676
|
+
await this.updateState(messageContext.agentContext, credentialExchangeRecord, DidCommCredentialState.Done);
|
|
677
|
+
return credentialExchangeRecord;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Create a {@link DidCommCredentialV1ProblemReportMessage} to be sent.
|
|
681
|
+
*
|
|
682
|
+
* @param message message to send
|
|
683
|
+
* @returns a {@link DidCommCredentialV1ProblemReportMessage}
|
|
684
|
+
*
|
|
685
|
+
*/
|
|
686
|
+
async createProblemReport(_agentContext, { credentialExchangeRecord, description }) {
|
|
687
|
+
return {
|
|
688
|
+
message: new DidCommCredentialV1ProblemReportMessage({ description: {
|
|
689
|
+
en: description,
|
|
690
|
+
code: DidCommCredentialProblemReportReason.IssuanceAbandoned
|
|
691
|
+
} }),
|
|
692
|
+
credentialExchangeRecord
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
async shouldAutoRespondToProposal(agentContext, options) {
|
|
696
|
+
const { credentialExchangeRecord, proposalMessage } = options;
|
|
697
|
+
const credentialsModuleConfig = agentContext.dependencyManager.resolve(DidCommCredentialsModuleConfig);
|
|
698
|
+
const autoAccept = composeCredentialAutoAccept(credentialExchangeRecord.autoAcceptCredential, credentialsModuleConfig.autoAcceptCredentials);
|
|
699
|
+
if (autoAccept === DidCommAutoAcceptCredential.Always) return true;
|
|
700
|
+
if (autoAccept === DidCommAutoAcceptCredential.Never) return false;
|
|
701
|
+
const offerMessage = await this.findOfferMessage(agentContext, credentialExchangeRecord.id);
|
|
702
|
+
if (!offerMessage || !offerMessage.credentialPreview) return false;
|
|
703
|
+
if (!proposalMessage.credentialPreview || !proposalMessage.credentialDefinitionId) return false;
|
|
704
|
+
const credentialOfferJson = offerMessage.indyCredentialOffer;
|
|
705
|
+
if (!credentialOfferJson) return false;
|
|
706
|
+
if (credentialOfferJson.cred_def_id !== proposalMessage.credentialDefinitionId) return false;
|
|
707
|
+
return areCredentialPreviewAttributesEqual(proposalMessage.credentialPreview.attributes, offerMessage.credentialPreview.attributes);
|
|
708
|
+
}
|
|
709
|
+
async shouldAutoRespondToOffer(agentContext, options) {
|
|
710
|
+
const { credentialExchangeRecord, offerMessage } = options;
|
|
711
|
+
const credentialsModuleConfig = agentContext.dependencyManager.resolve(DidCommCredentialsModuleConfig);
|
|
712
|
+
const autoAccept = composeCredentialAutoAccept(credentialExchangeRecord.autoAcceptCredential, credentialsModuleConfig.autoAcceptCredentials);
|
|
713
|
+
if (autoAccept === DidCommAutoAcceptCredential.Always) return true;
|
|
714
|
+
if (autoAccept === DidCommAutoAcceptCredential.Never) return false;
|
|
715
|
+
const proposalMessage = await this.findProposalMessage(agentContext, credentialExchangeRecord.id);
|
|
716
|
+
if (!offerMessage.credentialPreview) return false;
|
|
717
|
+
if (!proposalMessage || !proposalMessage.credentialPreview || !proposalMessage.credentialDefinitionId) return false;
|
|
718
|
+
const credentialOfferJson = offerMessage.indyCredentialOffer;
|
|
719
|
+
if (!credentialOfferJson) return false;
|
|
720
|
+
if (credentialOfferJson.cred_def_id !== proposalMessage.credentialDefinitionId) return false;
|
|
721
|
+
return areCredentialPreviewAttributesEqual(proposalMessage.credentialPreview.attributes, offerMessage.credentialPreview.attributes);
|
|
722
|
+
}
|
|
723
|
+
async shouldAutoRespondToRequest(agentContext, options) {
|
|
724
|
+
const { credentialExchangeRecord, requestMessage } = options;
|
|
725
|
+
const credentialsModuleConfig = agentContext.dependencyManager.resolve(DidCommCredentialsModuleConfig);
|
|
726
|
+
const autoAccept = composeCredentialAutoAccept(credentialExchangeRecord.autoAcceptCredential, credentialsModuleConfig.autoAcceptCredentials);
|
|
727
|
+
if (autoAccept === DidCommAutoAcceptCredential.Always) return true;
|
|
728
|
+
if (autoAccept === DidCommAutoAcceptCredential.Never) return false;
|
|
729
|
+
const offerMessage = await this.findOfferMessage(agentContext, credentialExchangeRecord.id);
|
|
730
|
+
if (!offerMessage) return false;
|
|
731
|
+
const offerAttachment = offerMessage.getOfferAttachmentById(INDY_CREDENTIAL_OFFER_ATTACHMENT_ID);
|
|
732
|
+
const requestAttachment = requestMessage.getRequestAttachmentById(INDY_CREDENTIAL_REQUEST_ATTACHMENT_ID);
|
|
733
|
+
if (!offerAttachment || !requestAttachment) return false;
|
|
734
|
+
return this.indyCredentialFormat.shouldAutoRespondToRequest(agentContext, {
|
|
735
|
+
credentialExchangeRecord,
|
|
736
|
+
offerAttachment,
|
|
737
|
+
requestAttachment
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
async shouldAutoRespondToCredential(agentContext, options) {
|
|
741
|
+
const { credentialExchangeRecord, credentialMessage } = options;
|
|
742
|
+
const credentialsModuleConfig = agentContext.dependencyManager.resolve(DidCommCredentialsModuleConfig);
|
|
743
|
+
const autoAccept = composeCredentialAutoAccept(credentialExchangeRecord.autoAcceptCredential, credentialsModuleConfig.autoAcceptCredentials);
|
|
744
|
+
if (autoAccept === DidCommAutoAcceptCredential.Always) return true;
|
|
745
|
+
if (autoAccept === DidCommAutoAcceptCredential.Never) return false;
|
|
746
|
+
const requestMessage = await this.findRequestMessage(agentContext, credentialExchangeRecord.id);
|
|
747
|
+
const offerMessage = await this.findOfferMessage(agentContext, credentialExchangeRecord.id);
|
|
748
|
+
const credentialAttachment = credentialMessage.getCredentialAttachmentById(INDY_CREDENTIAL_ATTACHMENT_ID);
|
|
749
|
+
if (!credentialAttachment) return false;
|
|
750
|
+
const requestAttachment = requestMessage?.getRequestAttachmentById(INDY_CREDENTIAL_REQUEST_ATTACHMENT_ID);
|
|
751
|
+
if (!requestAttachment) return false;
|
|
752
|
+
const offerAttachment = offerMessage?.getOfferAttachmentById(INDY_CREDENTIAL_OFFER_ATTACHMENT_ID);
|
|
753
|
+
return this.indyCredentialFormat.shouldAutoRespondToCredential(agentContext, {
|
|
754
|
+
credentialExchangeRecord,
|
|
755
|
+
credentialAttachment,
|
|
756
|
+
requestAttachment,
|
|
757
|
+
offerAttachment
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
async findProposalMessage(agentContext, credentialExchangeId) {
|
|
761
|
+
return await agentContext.dependencyManager.resolve(DidCommMessageRepository).findAgentMessage(agentContext, {
|
|
762
|
+
associatedRecordId: credentialExchangeId,
|
|
763
|
+
messageClass: DidCommProposeCredentialV1Message
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
async findOfferMessage(agentContext, credentialExchangeId) {
|
|
767
|
+
return await agentContext.dependencyManager.resolve(DidCommMessageRepository).findAgentMessage(agentContext, {
|
|
768
|
+
associatedRecordId: credentialExchangeId,
|
|
769
|
+
messageClass: V1OfferCredentialMessage
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
async findRequestMessage(agentContext, credentialExchangeId) {
|
|
773
|
+
return await agentContext.dependencyManager.resolve(DidCommMessageRepository).findAgentMessage(agentContext, {
|
|
774
|
+
associatedRecordId: credentialExchangeId,
|
|
775
|
+
messageClass: DidCommRequestCredentialV1Message
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
async findCredentialMessage(agentContext, credentialExchangeId) {
|
|
779
|
+
return await agentContext.dependencyManager.resolve(DidCommMessageRepository).findAgentMessage(agentContext, {
|
|
780
|
+
associatedRecordId: credentialExchangeId,
|
|
781
|
+
messageClass: DidCommIssueCredentialV1Message
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
async getFormatData(agentContext, credentialExchangeId) {
|
|
785
|
+
const [proposalMessage, offerMessage, requestMessage, credentialMessage] = await Promise.all([
|
|
786
|
+
this.findProposalMessage(agentContext, credentialExchangeId),
|
|
787
|
+
this.findOfferMessage(agentContext, credentialExchangeId),
|
|
788
|
+
this.findRequestMessage(agentContext, credentialExchangeId),
|
|
789
|
+
this.findCredentialMessage(agentContext, credentialExchangeId)
|
|
790
|
+
]);
|
|
791
|
+
const indyProposal = proposalMessage ? JsonTransformer.toJSON(this.rfc0592ProposalFromV1ProposeMessage(proposalMessage)) : void 0;
|
|
792
|
+
const indyOffer = offerMessage?.indyCredentialOffer ?? void 0;
|
|
793
|
+
const indyRequest = requestMessage?.indyCredentialRequest ?? void 0;
|
|
794
|
+
const indyCredential = credentialMessage?.indyCredential ?? void 0;
|
|
795
|
+
return {
|
|
796
|
+
proposalAttributes: proposalMessage?.credentialPreview?.attributes,
|
|
797
|
+
proposal: proposalMessage ? { indy: indyProposal } : void 0,
|
|
798
|
+
offerAttributes: offerMessage?.credentialPreview?.attributes,
|
|
799
|
+
offer: offerMessage ? { indy: indyOffer } : void 0,
|
|
800
|
+
request: requestMessage ? { indy: indyRequest } : void 0,
|
|
801
|
+
credential: credentialMessage ? { indy: indyCredential } : void 0
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
rfc0592ProposalFromV1ProposeMessage(proposalMessage) {
|
|
805
|
+
return new AnonCredsCredentialProposal({
|
|
806
|
+
credentialDefinitionId: proposalMessage.credentialDefinitionId,
|
|
807
|
+
schemaId: proposalMessage.schemaId,
|
|
808
|
+
issuerDid: proposalMessage.issuerDid,
|
|
809
|
+
schemaIssuerDid: proposalMessage.schemaIssuerDid,
|
|
810
|
+
schemaName: proposalMessage.schemaName,
|
|
811
|
+
schemaVersion: proposalMessage.schemaVersion
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
assertOnlyIndyFormat(credentialFormats) {
|
|
815
|
+
const formatKeys = Object.keys(credentialFormats);
|
|
816
|
+
if (formatKeys.length === 0) return;
|
|
817
|
+
if (formatKeys.length !== 1 || !formatKeys.includes("indy")) throw new CredoError("Only indy credential format is supported for issue credential v1 protocol");
|
|
818
|
+
}
|
|
819
|
+
getFormatServiceForRecordType(credentialRecordType) {
|
|
820
|
+
if (credentialRecordType !== this.indyCredentialFormat.credentialRecordType) throw new CredoError(`Unsupported credential record type ${credentialRecordType} for v1 issue credential protocol (need ${this.indyCredentialFormat.credentialRecordType})`);
|
|
821
|
+
return this.indyCredentialFormat;
|
|
822
|
+
}
|
|
823
|
+
};
|
|
824
|
+
|
|
825
|
+
//#endregion
|
|
826
|
+
export { DidCommCredentialV1Protocol };
|
|
827
|
+
//# sourceMappingURL=DidCommCredentialV1Protocol.mjs.map
|