@credo-ts/core 0.6.0-pr-2392-20251010173905 → 0.6.0-pr-2457-20251016083534
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/agent/Agent.d.mts +1 -1
- package/build/agent/Agent.d.mts.map +1 -1
- package/build/agent/Agent.d.ts +1 -1
- package/build/agent/Agent.d.ts.map +1 -1
- package/build/agent/Agent.js +2 -2
- package/build/agent/Agent.mjs +2 -2
- package/build/agent/Agent.mjs.map +1 -1
- package/build/agent/AgentConfig.d.mts +1 -1
- package/build/agent/AgentConfig.d.mts.map +1 -1
- package/build/agent/AgentConfig.d.ts +1 -1
- package/build/agent/AgentConfig.d.ts.map +1 -1
- package/build/agent/AgentConfig.mjs.map +1 -1
- package/build/agent/AgentModules.d.mts +4 -4
- package/build/agent/AgentModules.d.mts.map +1 -1
- package/build/agent/AgentModules.d.ts +4 -4
- package/build/agent/AgentModules.d.ts.map +1 -1
- package/build/agent/AgentModules.mjs.map +1 -1
- package/build/agent/BaseAgent.d.mts +4 -4
- package/build/agent/BaseAgent.d.ts +4 -4
- package/build/agent/BaseAgent.mjs.map +1 -1
- package/build/agent/EventEmitter.d.mts +1 -1
- package/build/agent/EventEmitter.d.mts.map +1 -1
- package/build/agent/EventEmitter.d.ts +1 -1
- package/build/agent/EventEmitter.d.ts.map +1 -1
- package/build/agent/EventEmitter.mjs.map +1 -1
- package/build/agent/context/AgentContext.d.mts.map +1 -1
- package/build/agent/context/AgentContext.d.ts.map +1 -1
- package/build/agent/context/AgentContext.mjs.map +1 -1
- package/build/agent/context/DefaultAgentContextProvider.d.mts.map +1 -1
- package/build/agent/context/DefaultAgentContextProvider.d.ts.map +1 -1
- package/build/agent/context/DefaultAgentContextProvider.js +1 -1
- package/build/agent/context/DefaultAgentContextProvider.mjs +1 -1
- package/build/agent/context/DefaultAgentContextProvider.mjs.map +1 -1
- package/build/crypto/JwsService.d.mts +5 -5
- package/build/crypto/JwsService.d.mts.map +1 -1
- package/build/crypto/JwsService.d.ts +5 -5
- package/build/crypto/JwsService.d.ts.map +1 -1
- package/build/crypto/JwsService.js +3 -3
- package/build/crypto/JwsService.mjs +3 -3
- package/build/crypto/JwsService.mjs.map +1 -1
- package/build/crypto/KmsKeyPair.js +1 -5
- package/build/crypto/KmsKeyPair.mjs +1 -2
- package/build/crypto/KmsKeyPair.mjs.map +1 -1
- package/build/crypto/hashes/Hasher.d.mts +4 -2
- package/build/crypto/hashes/Hasher.d.mts.map +1 -1
- package/build/crypto/hashes/Hasher.d.ts +4 -2
- package/build/crypto/hashes/Hasher.d.ts.map +1 -1
- package/build/crypto/hashes/Hasher.js +8 -3
- package/build/crypto/hashes/Hasher.mjs +8 -3
- package/build/crypto/hashes/Hasher.mjs.map +1 -1
- package/build/crypto/hashes/IHash.d.mts +3 -1
- package/build/crypto/hashes/IHash.d.mts.map +1 -1
- package/build/crypto/hashes/IHash.d.ts +3 -1
- package/build/crypto/hashes/IHash.d.ts.map +1 -1
- package/build/crypto/hashes/Sha1.d.mts +2 -1
- package/build/crypto/hashes/Sha1.d.mts.map +1 -1
- package/build/crypto/hashes/Sha1.d.ts +2 -1
- package/build/crypto/hashes/Sha1.d.ts.map +1 -1
- package/build/crypto/hashes/Sha1.js +3 -3
- package/build/crypto/hashes/Sha1.mjs +1 -1
- package/build/crypto/hashes/Sha1.mjs.map +1 -1
- package/build/crypto/hashes/Sha256.d.mts +2 -1
- package/build/crypto/hashes/Sha256.d.mts.map +1 -1
- package/build/crypto/hashes/Sha256.d.ts +2 -1
- package/build/crypto/hashes/Sha256.d.ts.map +1 -1
- package/build/crypto/hashes/Sha256.js +3 -3
- package/build/crypto/hashes/Sha256.mjs +1 -1
- package/build/crypto/hashes/Sha256.mjs.map +1 -1
- package/build/crypto/hashes/Sha384.d.mts +10 -0
- package/build/crypto/hashes/Sha384.d.mts.map +1 -0
- package/build/crypto/hashes/Sha384.d.ts +10 -0
- package/build/crypto/hashes/Sha384.d.ts.map +1 -0
- package/build/crypto/hashes/Sha384.js +15 -0
- package/build/crypto/hashes/Sha384.mjs +14 -0
- package/build/crypto/hashes/Sha384.mjs.map +1 -0
- package/build/crypto/hashes/Sha512.d.mts +2 -1
- package/build/crypto/hashes/Sha512.d.mts.map +1 -1
- package/build/crypto/hashes/Sha512.d.ts +2 -1
- package/build/crypto/hashes/Sha512.d.ts.map +1 -1
- package/build/crypto/hashes/Sha512.js +3 -3
- package/build/crypto/hashes/Sha512.mjs +1 -1
- package/build/crypto/hashes/Sha512.mjs.map +1 -1
- package/build/crypto/hashes/index.js +1 -0
- package/build/crypto/hashes/index.mjs +1 -0
- package/build/crypto/index.js +1 -0
- package/build/crypto/index.mjs +1 -0
- package/build/crypto/jose/jwt/Jwt.d.mts.map +1 -1
- package/build/crypto/jose/jwt/Jwt.d.ts.map +1 -1
- package/build/crypto/jose/jwt/Jwt.js +1 -1
- package/build/crypto/jose/jwt/Jwt.mjs +1 -1
- package/build/crypto/jose/jwt/Jwt.mjs.map +1 -1
- package/build/crypto/webcrypto/CredoSubtle.d.mts.map +1 -1
- package/build/crypto/webcrypto/CredoSubtle.d.ts.map +1 -1
- package/build/crypto/webcrypto/CredoSubtle.js +1 -1
- package/build/crypto/webcrypto/CredoSubtle.mjs +1 -1
- package/build/crypto/webcrypto/CredoSubtle.mjs.map +1 -1
- package/build/crypto/webcrypto/CredoWalletWebCrypto.d.mts +7 -7
- package/build/crypto/webcrypto/CredoWalletWebCrypto.d.mts.map +1 -1
- package/build/crypto/webcrypto/CredoWalletWebCrypto.d.ts +7 -7
- package/build/crypto/webcrypto/CredoWalletWebCrypto.d.ts.map +1 -1
- package/build/crypto/webcrypto/CredoWalletWebCrypto.js +6 -9
- package/build/crypto/webcrypto/CredoWalletWebCrypto.mjs +5 -6
- package/build/crypto/webcrypto/CredoWalletWebCrypto.mjs.map +1 -1
- package/build/crypto/webcrypto/CredoWebCrypto.d.mts.map +1 -1
- package/build/crypto/webcrypto/CredoWebCrypto.d.ts.map +1 -1
- package/build/crypto/webcrypto/CredoWebCrypto.js +1 -1
- package/build/crypto/webcrypto/CredoWebCrypto.mjs +1 -1
- package/build/crypto/webcrypto/CredoWebCrypto.mjs.map +1 -1
- package/build/crypto/webcrypto/CredoWebCryptoKey.d.mts.map +1 -1
- package/build/crypto/webcrypto/CredoWebCryptoKey.d.ts.map +1 -1
- package/build/crypto/webcrypto/CredoWebCryptoKey.mjs.map +1 -1
- package/build/crypto/webcrypto/providers/CredoEcdsaProvider.js +4 -2
- package/build/crypto/webcrypto/providers/CredoEcdsaProvider.mjs +4 -2
- package/build/crypto/webcrypto/providers/CredoEcdsaProvider.mjs.map +1 -1
- package/build/crypto/webcrypto/providers/CredoEd25519Provider.js +4 -2
- package/build/crypto/webcrypto/providers/CredoEd25519Provider.mjs +4 -2
- package/build/crypto/webcrypto/providers/CredoEd25519Provider.mjs.map +1 -1
- package/build/crypto/webcrypto/providers/CredoSha1Provider.mjs.map +1 -1
- package/build/crypto/webcrypto/providers/CredoSha256Provider.mjs.map +1 -1
- package/build/crypto/webcrypto/providers/index.js +1 -1
- package/build/crypto/webcrypto/providers/index.mjs +1 -1
- package/build/crypto/webcrypto/types.d.mts +2 -1
- package/build/crypto/webcrypto/types.d.mts.map +1 -1
- package/build/crypto/webcrypto/types.d.ts +2 -1
- package/build/crypto/webcrypto/types.d.ts.map +1 -1
- package/build/crypto/webcrypto/types.mjs.map +1 -1
- package/build/crypto/webcrypto/utils/keyAlgorithmConversion.js +4 -4
- package/build/crypto/webcrypto/utils/keyAlgorithmConversion.mjs +4 -4
- package/build/crypto/webcrypto/utils/keyAlgorithmConversion.mjs.map +1 -1
- package/build/error/index.js +2 -2
- package/build/error/index.mjs +2 -2
- package/build/index.d.mts +161 -157
- package/build/index.d.mts.map +1 -1
- package/build/index.d.ts +161 -157
- package/build/index.d.ts.map +1 -1
- package/build/index.js +67 -62
- package/build/index.mjs +66 -62
- package/build/index.mjs.map +1 -1
- package/build/logger/BaseLogger.mjs.map +1 -1
- package/build/logger/ConsoleLogger.mjs.map +1 -1
- package/build/logger/Logger.mjs.map +1 -1
- package/build/modules/cache/CacheModule.mjs.map +1 -1
- package/build/modules/cache/CachedStorageService.mjs.map +1 -1
- package/build/modules/cache/InMemoryLruCache.d.mts.map +1 -1
- package/build/modules/cache/InMemoryLruCache.d.ts.map +1 -1
- package/build/modules/cache/InMemoryLruCache.js +1 -1
- package/build/modules/cache/InMemoryLruCache.mjs +1 -1
- package/build/modules/cache/InMemoryLruCache.mjs.map +1 -1
- package/build/modules/cache/singleContextLruCache/SingleContextLruCacheRecord.d.mts.map +1 -1
- package/build/modules/cache/singleContextLruCache/SingleContextLruCacheRecord.d.ts.map +1 -1
- package/build/modules/cache/singleContextLruCache/SingleContextLruCacheRecord.mjs.map +1 -1
- package/build/modules/cache/singleContextLruCache/SingleContextStorageLruCache.d.mts.map +1 -1
- package/build/modules/cache/singleContextLruCache/SingleContextStorageLruCache.d.ts.map +1 -1
- package/build/modules/cache/singleContextLruCache/SingleContextStorageLruCache.js +1 -1
- package/build/modules/cache/singleContextLruCache/SingleContextStorageLruCache.mjs +1 -1
- package/build/modules/cache/singleContextLruCache/SingleContextStorageLruCache.mjs.map +1 -1
- package/build/modules/dcql/DcqlModule.d.mts.map +1 -1
- package/build/modules/dcql/DcqlModule.d.ts.map +1 -1
- package/build/modules/dcql/DcqlModule.mjs.map +1 -1
- package/build/modules/dcql/DcqlService.d.mts.map +1 -1
- package/build/modules/dcql/DcqlService.d.ts.map +1 -1
- package/build/modules/dcql/DcqlService.js +2 -2
- package/build/modules/dcql/DcqlService.mjs +2 -2
- package/build/modules/dcql/DcqlService.mjs.map +1 -1
- package/build/modules/dcql/models/DcqlCredentialsForRequest.d.mts +3 -3
- package/build/modules/dcql/models/DcqlCredentialsForRequest.d.ts +3 -3
- package/build/modules/dcql/models/index.d.mts +2 -2
- package/build/modules/dcql/models/index.d.mts.map +1 -1
- package/build/modules/dcql/models/index.d.ts +2 -2
- package/build/modules/dcql/models/index.d.ts.map +1 -1
- package/build/modules/dcql/utils/DcqlPresentationsToCreate.d.mts +2 -2
- package/build/modules/dcql/utils/DcqlPresentationsToCreate.d.ts +2 -2
- package/build/modules/dids/DidsApi.d.mts +2 -2
- package/build/modules/dids/DidsApi.d.mts.map +1 -1
- package/build/modules/dids/DidsApi.d.ts +2 -2
- package/build/modules/dids/DidsApi.d.ts.map +1 -1
- package/build/modules/dids/DidsApi.js +1 -1
- package/build/modules/dids/DidsApi.mjs +1 -1
- package/build/modules/dids/DidsApi.mjs.map +1 -1
- package/build/modules/dids/DidsModule.d.mts.map +1 -1
- package/build/modules/dids/DidsModule.d.ts.map +1 -1
- package/build/modules/dids/DidsModule.mjs.map +1 -1
- package/build/modules/dids/DidsModuleConfig.js +2 -2
- package/build/modules/dids/DidsModuleConfig.mjs +2 -2
- package/build/modules/dids/domain/DidDocument.d.mts +1 -1
- package/build/modules/dids/domain/DidDocument.d.mts.map +1 -1
- package/build/modules/dids/domain/DidDocument.d.ts +1 -1
- package/build/modules/dids/domain/DidDocument.d.ts.map +1 -1
- package/build/modules/dids/domain/DidDocument.js +6 -6
- package/build/modules/dids/domain/DidDocument.mjs +6 -6
- package/build/modules/dids/domain/DidDocument.mjs.map +1 -1
- package/build/modules/dids/domain/DidDocumentBuilder.d.mts.map +1 -1
- package/build/modules/dids/domain/DidDocumentBuilder.d.ts.map +1 -1
- package/build/modules/dids/domain/DidDocumentBuilder.mjs.map +1 -1
- package/build/modules/dids/domain/index.js +11 -11
- package/build/modules/dids/domain/index.mjs +11 -11
- package/build/modules/dids/domain/key-type/ed25519.mjs.map +1 -1
- package/build/modules/dids/domain/key-type/keyDidJsonWebKey.mjs.map +1 -1
- package/build/modules/dids/domain/key-type/keyDidMapping.d.mts +1 -1
- package/build/modules/dids/domain/key-type/keyDidMapping.d.mts.map +1 -1
- package/build/modules/dids/domain/key-type/keyDidMapping.d.ts +1 -1
- package/build/modules/dids/domain/key-type/keyDidMapping.d.ts.map +1 -1
- package/build/modules/dids/domain/key-type/keyDidMapping.mjs.map +1 -1
- package/build/modules/dids/domain/key-type/secp256k1.js +1 -1
- package/build/modules/dids/domain/key-type/secp256k1.mjs +1 -1
- package/build/modules/dids/domain/key-type/secp256k1.mjs.map +1 -1
- package/build/modules/dids/domain/key-type/x25519.js +1 -1
- package/build/modules/dids/domain/key-type/x25519.mjs +1 -1
- package/build/modules/dids/domain/key-type/x25519.mjs.map +1 -1
- package/build/modules/dids/domain/keyDidDocument.js +1 -1
- package/build/modules/dids/domain/keyDidDocument.mjs +1 -1
- package/build/modules/dids/domain/keyDidDocument.mjs.map +1 -1
- package/build/modules/dids/domain/parse.d.mts.map +1 -1
- package/build/modules/dids/domain/parse.d.ts.map +1 -1
- package/build/modules/dids/domain/parse.mjs.map +1 -1
- package/build/modules/dids/domain/service/DidCommV2Service.d.mts +1 -1
- package/build/modules/dids/domain/service/DidCommV2Service.d.mts.map +1 -1
- package/build/modules/dids/domain/service/DidCommV2Service.d.ts +1 -1
- package/build/modules/dids/domain/service/DidCommV2Service.d.ts.map +1 -1
- package/build/modules/dids/domain/service/DidCommV2Service.mjs.map +1 -1
- package/build/modules/dids/domain/service/DidDocumentService.mjs.map +1 -1
- package/build/modules/dids/domain/verificationMethod/EcdsaSecp256k1VerificationKey2019.d.mts +1 -1
- package/build/modules/dids/domain/verificationMethod/EcdsaSecp256k1VerificationKey2019.d.ts +1 -1
- package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2018.d.mts +1 -1
- package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2018.d.mts.map +1 -1
- package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2018.d.ts +1 -1
- package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2018.d.ts.map +1 -1
- package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2018.mjs.map +1 -1
- package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2020.d.mts +1 -1
- package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2020.d.mts.map +1 -1
- package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2020.d.ts +1 -1
- package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2020.d.ts.map +1 -1
- package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2020.mjs.map +1 -1
- package/build/modules/dids/domain/verificationMethod/JsonWebKey2020.d.mts +1 -1
- package/build/modules/dids/domain/verificationMethod/JsonWebKey2020.d.mts.map +1 -1
- package/build/modules/dids/domain/verificationMethod/JsonWebKey2020.d.ts +1 -1
- package/build/modules/dids/domain/verificationMethod/JsonWebKey2020.d.ts.map +1 -1
- package/build/modules/dids/domain/verificationMethod/JsonWebKey2020.mjs.map +1 -1
- package/build/modules/dids/domain/verificationMethod/Multikey.d.mts +1 -1
- package/build/modules/dids/domain/verificationMethod/Multikey.d.mts.map +1 -1
- package/build/modules/dids/domain/verificationMethod/Multikey.d.ts +1 -1
- package/build/modules/dids/domain/verificationMethod/Multikey.d.ts.map +1 -1
- package/build/modules/dids/domain/verificationMethod/Multikey.mjs.map +1 -1
- package/build/modules/dids/domain/verificationMethod/VerificationMethodTransformer.d.mts.map +1 -1
- package/build/modules/dids/domain/verificationMethod/VerificationMethodTransformer.d.ts.map +1 -1
- package/build/modules/dids/domain/verificationMethod/VerificationMethodTransformer.mjs.map +1 -1
- package/build/modules/dids/domain/verificationMethod/X25519KeyAgreementKey2019.d.mts +1 -1
- package/build/modules/dids/domain/verificationMethod/X25519KeyAgreementKey2019.d.mts.map +1 -1
- package/build/modules/dids/domain/verificationMethod/X25519KeyAgreementKey2019.d.ts +1 -1
- package/build/modules/dids/domain/verificationMethod/X25519KeyAgreementKey2019.d.ts.map +1 -1
- package/build/modules/dids/domain/verificationMethod/X25519KeyAgreementKey2019.mjs.map +1 -1
- package/build/modules/dids/domain/verificationMethod/index.js +3 -3
- package/build/modules/dids/domain/verificationMethod/index.mjs +3 -3
- package/build/modules/dids/findMatchingEd25519Key.d.mts +1 -1
- package/build/modules/dids/findMatchingEd25519Key.d.ts +1 -1
- package/build/modules/dids/findMatchingEd25519Key.js +1 -1
- package/build/modules/dids/findMatchingEd25519Key.mjs +1 -1
- package/build/modules/dids/findMatchingEd25519Key.mjs.map +1 -1
- package/build/modules/dids/helpers.mjs.map +1 -1
- package/build/modules/dids/index.js +15 -15
- package/build/modules/dids/index.mjs +15 -15
- package/build/modules/dids/methods/index.js +5 -5
- package/build/modules/dids/methods/index.mjs +5 -5
- package/build/modules/dids/methods/jwk/DidJwk.d.mts +1 -1
- package/build/modules/dids/methods/jwk/DidJwk.d.ts +1 -1
- package/build/modules/dids/methods/jwk/JwkDidRegistrar.d.mts +2 -2
- package/build/modules/dids/methods/jwk/JwkDidRegistrar.d.mts.map +1 -1
- package/build/modules/dids/methods/jwk/JwkDidRegistrar.d.ts +2 -2
- package/build/modules/dids/methods/jwk/JwkDidRegistrar.d.ts.map +1 -1
- package/build/modules/dids/methods/jwk/JwkDidRegistrar.js +1 -1
- package/build/modules/dids/methods/jwk/JwkDidRegistrar.mjs +1 -1
- package/build/modules/dids/methods/jwk/JwkDidRegistrar.mjs.map +1 -1
- package/build/modules/dids/methods/jwk/didJwkDidDocument.js +1 -1
- package/build/modules/dids/methods/jwk/didJwkDidDocument.mjs +1 -1
- package/build/modules/dids/methods/jwk/didJwkDidDocument.mjs.map +1 -1
- package/build/modules/dids/methods/key/DidKey.d.mts +1 -1
- package/build/modules/dids/methods/key/DidKey.d.ts +1 -1
- package/build/modules/dids/methods/key/KeyDidRegistrar.d.mts +2 -2
- package/build/modules/dids/methods/key/KeyDidRegistrar.d.mts.map +1 -1
- package/build/modules/dids/methods/key/KeyDidRegistrar.d.ts +2 -2
- package/build/modules/dids/methods/key/KeyDidRegistrar.d.ts.map +1 -1
- package/build/modules/dids/methods/key/KeyDidRegistrar.js +1 -1
- package/build/modules/dids/methods/key/KeyDidRegistrar.mjs +1 -1
- package/build/modules/dids/methods/key/KeyDidRegistrar.mjs.map +1 -1
- package/build/modules/dids/methods/peer/PeerDidRegistrar.d.mts +2 -2
- package/build/modules/dids/methods/peer/PeerDidRegistrar.d.mts.map +1 -1
- package/build/modules/dids/methods/peer/PeerDidRegistrar.d.ts +2 -2
- package/build/modules/dids/methods/peer/PeerDidRegistrar.d.ts.map +1 -1
- package/build/modules/dids/methods/peer/PeerDidRegistrar.mjs.map +1 -1
- package/build/modules/dids/methods/peer/PeerDidResolver.d.mts.map +1 -1
- package/build/modules/dids/methods/peer/PeerDidResolver.d.ts.map +1 -1
- package/build/modules/dids/methods/peer/PeerDidResolver.mjs.map +1 -1
- package/build/modules/dids/methods/peer/createPeerDidDocumentFromServices.d.mts +1 -1
- package/build/modules/dids/methods/peer/createPeerDidDocumentFromServices.d.mts.map +1 -1
- package/build/modules/dids/methods/peer/createPeerDidDocumentFromServices.d.ts +1 -1
- package/build/modules/dids/methods/peer/createPeerDidDocumentFromServices.d.ts.map +1 -1
- package/build/modules/dids/methods/peer/createPeerDidDocumentFromServices.js +1 -1
- package/build/modules/dids/methods/peer/createPeerDidDocumentFromServices.mjs +1 -1
- package/build/modules/dids/methods/peer/createPeerDidDocumentFromServices.mjs.map +1 -1
- package/build/modules/dids/methods/peer/index.js +1 -1
- package/build/modules/dids/methods/peer/index.mjs +1 -1
- package/build/modules/dids/methods/peer/peerDidNumAlgo0.mjs.map +1 -1
- package/build/modules/dids/methods/peer/peerDidNumAlgo1.js +1 -1
- package/build/modules/dids/methods/peer/peerDidNumAlgo1.mjs +1 -1
- package/build/modules/dids/methods/peer/peerDidNumAlgo2.js +2 -2
- package/build/modules/dids/methods/peer/peerDidNumAlgo2.mjs +2 -2
- package/build/modules/dids/methods/peer/peerDidNumAlgo2.mjs.map +1 -1
- package/build/modules/dids/methods/peer/peerDidNumAlgo4.js +7 -8
- package/build/modules/dids/methods/peer/peerDidNumAlgo4.mjs +4 -4
- package/build/modules/dids/methods/peer/peerDidNumAlgo4.mjs.map +1 -1
- package/build/modules/dids/methods/web/WebDidResolver.d.mts.map +1 -1
- package/build/modules/dids/methods/web/WebDidResolver.d.ts.map +1 -1
- package/build/modules/dids/methods/web/WebDidResolver.mjs.map +1 -1
- package/build/modules/dids/repository/DidRecord.d.mts.map +1 -1
- package/build/modules/dids/repository/DidRecord.d.ts.map +1 -1
- package/build/modules/dids/repository/DidRecord.js +1 -1
- package/build/modules/dids/repository/DidRecord.mjs +1 -1
- package/build/modules/dids/repository/DidRecord.mjs.map +1 -1
- package/build/modules/dids/repository/DidRepository.d.mts +3 -3
- package/build/modules/dids/repository/DidRepository.d.mts.map +1 -1
- package/build/modules/dids/repository/DidRepository.d.ts +3 -3
- package/build/modules/dids/repository/DidRepository.d.ts.map +1 -1
- package/build/modules/dids/repository/DidRepository.js +1 -1
- package/build/modules/dids/repository/DidRepository.mjs +1 -1
- package/build/modules/dids/repository/DidRepository.mjs.map +1 -1
- package/build/modules/dids/services/DidRegistrarService.d.mts.map +1 -1
- package/build/modules/dids/services/DidRegistrarService.d.ts.map +1 -1
- package/build/modules/dids/services/DidRegistrarService.mjs.map +1 -1
- package/build/modules/dids/services/DidResolverService.d.mts.map +1 -1
- package/build/modules/dids/services/DidResolverService.d.ts.map +1 -1
- package/build/modules/dids/services/DidResolverService.js +1 -1
- package/build/modules/dids/services/DidResolverService.mjs +1 -1
- package/build/modules/dids/services/DidResolverService.mjs.map +1 -1
- package/build/modules/dif-presentation-exchange/DifPresentationExchangeModule.d.mts.map +1 -1
- package/build/modules/dif-presentation-exchange/DifPresentationExchangeModule.d.ts.map +1 -1
- package/build/modules/dif-presentation-exchange/DifPresentationExchangeModule.mjs.map +1 -1
- package/build/modules/dif-presentation-exchange/DifPresentationExchangeService.d.mts +5 -5
- package/build/modules/dif-presentation-exchange/DifPresentationExchangeService.d.mts.map +1 -1
- package/build/modules/dif-presentation-exchange/DifPresentationExchangeService.d.ts +5 -5
- package/build/modules/dif-presentation-exchange/DifPresentationExchangeService.d.ts.map +1 -1
- package/build/modules/dif-presentation-exchange/DifPresentationExchangeService.js +9 -5
- package/build/modules/dif-presentation-exchange/DifPresentationExchangeService.mjs +9 -5
- package/build/modules/dif-presentation-exchange/DifPresentationExchangeService.mjs.map +1 -1
- package/build/modules/dif-presentation-exchange/models/DifPexCredentialsForRequest.d.mts +3 -3
- package/build/modules/dif-presentation-exchange/models/DifPexCredentialsForRequest.d.ts +3 -3
- package/build/modules/dif-presentation-exchange/models/index.d.mts +4 -4
- package/build/modules/dif-presentation-exchange/models/index.d.ts +4 -4
- package/build/modules/dif-presentation-exchange/utils/credentialSelection.mjs.map +1 -1
- package/build/modules/dif-presentation-exchange/utils/index.js +1 -1
- package/build/modules/dif-presentation-exchange/utils/index.mjs +1 -1
- package/build/modules/dif-presentation-exchange/utils/presentationSelection.d.mts +5 -5
- package/build/modules/dif-presentation-exchange/utils/presentationSelection.d.mts.map +1 -1
- package/build/modules/dif-presentation-exchange/utils/presentationSelection.d.ts +5 -5
- package/build/modules/dif-presentation-exchange/utils/presentationSelection.d.ts.map +1 -1
- package/build/modules/dif-presentation-exchange/utils/presentationSelection.js +1 -1
- package/build/modules/dif-presentation-exchange/utils/presentationSelection.mjs +1 -1
- package/build/modules/dif-presentation-exchange/utils/presentationSelection.mjs.map +1 -1
- package/build/modules/dif-presentation-exchange/utils/presentationsToCreate.mjs.map +1 -1
- package/build/modules/dif-presentation-exchange/utils/transform.mjs.map +1 -1
- package/build/modules/generic-records/GenericRecordsApi.d.mts +1 -1
- package/build/modules/generic-records/GenericRecordsApi.d.mts.map +1 -1
- package/build/modules/generic-records/GenericRecordsApi.d.ts +1 -1
- package/build/modules/generic-records/GenericRecordsApi.d.ts.map +1 -1
- package/build/modules/generic-records/GenericRecordsApi.mjs.map +1 -1
- package/build/modules/generic-records/services/GenericRecordService.d.mts.map +1 -1
- package/build/modules/generic-records/services/GenericRecordService.d.ts.map +1 -1
- package/build/modules/generic-records/services/GenericRecordService.mjs.map +1 -1
- package/build/modules/kms/KeyManagementApi.d.mts +7 -7
- package/build/modules/kms/KeyManagementApi.d.mts.map +1 -1
- package/build/modules/kms/KeyManagementApi.d.ts +7 -7
- package/build/modules/kms/KeyManagementApi.d.ts.map +1 -1
- package/build/modules/kms/KeyManagementApi.js +7 -7
- package/build/modules/kms/KeyManagementApi.mjs +7 -7
- package/build/modules/kms/KeyManagementApi.mjs.map +1 -1
- package/build/modules/kms/KeyManagementModule.d.mts +2 -2
- package/build/modules/kms/KeyManagementModule.d.mts.map +1 -1
- package/build/modules/kms/KeyManagementModule.d.ts +2 -2
- package/build/modules/kms/KeyManagementModule.d.ts.map +1 -1
- package/build/modules/kms/KeyManagementModule.mjs.map +1 -1
- package/build/modules/kms/KeyManagementModuleConfig.d.mts +0 -1
- package/build/modules/kms/KeyManagementModuleConfig.d.mts.map +1 -1
- package/build/modules/kms/KeyManagementModuleConfig.d.ts +0 -1
- package/build/modules/kms/KeyManagementModuleConfig.d.ts.map +1 -1
- package/build/modules/kms/KeyManagementModuleConfig.js +0 -6
- package/build/modules/kms/KeyManagementModuleConfig.mjs +0 -6
- package/build/modules/kms/KeyManagementModuleConfig.mjs.map +1 -1
- package/build/modules/kms/KeyManagementService.d.mts +6 -6
- package/build/modules/kms/KeyManagementService.d.ts +6 -6
- package/build/modules/kms/error/KeyManagementKeyNotFoundError.d.mts +1 -1
- package/build/modules/kms/error/KeyManagementKeyNotFoundError.d.ts +1 -1
- package/build/modules/kms/error/KeyManagementKeyNotFoundError.js +5 -2
- package/build/modules/kms/error/KeyManagementKeyNotFoundError.mjs +5 -2
- package/build/modules/kms/error/KeyManagementKeyNotFoundError.mjs.map +1 -1
- package/build/modules/kms/index.d.mts +25 -25
- package/build/modules/kms/index.d.ts +25 -25
- package/build/modules/kms/index.js +10 -10
- package/build/modules/kms/index.mjs +10 -10
- package/build/modules/kms/index.mjs.map +1 -1
- package/build/modules/kms/jwk/PublicJwk.d.mts +3 -4
- package/build/modules/kms/jwk/PublicJwk.d.mts.map +1 -1
- package/build/modules/kms/jwk/PublicJwk.d.ts +3 -4
- package/build/modules/kms/jwk/PublicJwk.d.ts.map +1 -1
- package/build/modules/kms/jwk/PublicJwk.js +2 -5
- package/build/modules/kms/jwk/PublicJwk.mjs +2 -5
- package/build/modules/kms/jwk/PublicJwk.mjs.map +1 -1
- package/build/modules/kms/jwk/alg/encryption.d.mts +1 -1
- package/build/modules/kms/jwk/alg/encryption.d.mts.map +1 -1
- package/build/modules/kms/jwk/alg/encryption.d.ts +1 -1
- package/build/modules/kms/jwk/alg/encryption.d.ts.map +1 -1
- package/build/modules/kms/jwk/alg/encryption.mjs.map +1 -1
- package/build/modules/kms/jwk/alg/index.js +1 -1
- package/build/modules/kms/jwk/alg/index.mjs +1 -1
- package/build/modules/kms/jwk/alg/keyDerivation.d.mts +1 -1
- package/build/modules/kms/jwk/alg/keyDerivation.d.mts.map +1 -1
- package/build/modules/kms/jwk/alg/keyDerivation.d.ts +1 -1
- package/build/modules/kms/jwk/alg/keyDerivation.d.ts.map +1 -1
- package/build/modules/kms/jwk/alg/keyDerivation.mjs.map +1 -1
- package/build/modules/kms/jwk/alg/signing.d.mts +1 -1
- package/build/modules/kms/jwk/alg/signing.d.mts.map +1 -1
- package/build/modules/kms/jwk/alg/signing.d.ts +1 -1
- package/build/modules/kms/jwk/alg/signing.d.ts.map +1 -1
- package/build/modules/kms/jwk/alg/signing.mjs.map +1 -1
- package/build/modules/kms/jwk/assertSupported.d.mts +2 -2
- package/build/modules/kms/jwk/assertSupported.d.ts +2 -2
- package/build/modules/kms/jwk/humanDescription.d.mts.map +1 -1
- package/build/modules/kms/jwk/humanDescription.d.ts.map +1 -1
- package/build/modules/kms/jwk/humanDescription.mjs.map +1 -1
- package/build/modules/kms/jwk/index.js +8 -8
- package/build/modules/kms/jwk/index.mjs +8 -8
- package/build/modules/kms/jwk/jwkThumbprint.js +2 -2
- package/build/modules/kms/jwk/jwkThumbprint.mjs +2 -2
- package/build/modules/kms/jwk/jwkThumbprint.mjs.map +1 -1
- package/build/modules/kms/jwk/keyOps.d.mts.map +1 -1
- package/build/modules/kms/jwk/keyOps.d.ts.map +1 -1
- package/build/modules/kms/jwk/keyOps.js +1 -1
- package/build/modules/kms/jwk/keyOps.mjs +1 -1
- package/build/modules/kms/jwk/keyOps.mjs.map +1 -1
- package/build/modules/kms/jwk/knownJwk.d.mts +1 -1
- package/build/modules/kms/jwk/knownJwk.d.mts.map +1 -1
- package/build/modules/kms/jwk/knownJwk.d.ts +1 -1
- package/build/modules/kms/jwk/knownJwk.d.ts.map +1 -1
- package/build/modules/kms/jwk/knownJwk.js +1 -1
- package/build/modules/kms/jwk/knownJwk.mjs +1 -1
- package/build/modules/kms/jwk/knownJwk.mjs.map +1 -1
- package/build/modules/kms/jwk/kty/PublicJwk.d.mts +3 -2
- package/build/modules/kms/jwk/kty/PublicJwk.d.mts.map +1 -1
- package/build/modules/kms/jwk/kty/PublicJwk.d.ts +3 -2
- package/build/modules/kms/jwk/kty/PublicJwk.d.ts.map +1 -1
- package/build/modules/kms/jwk/kty/ec/P256PublicJwk.d.mts +7 -6
- package/build/modules/kms/jwk/kty/ec/P256PublicJwk.d.mts.map +1 -1
- package/build/modules/kms/jwk/kty/ec/P256PublicJwk.d.ts +7 -6
- package/build/modules/kms/jwk/kty/ec/P256PublicJwk.d.ts.map +1 -1
- package/build/modules/kms/jwk/kty/ec/P256PublicJwk.mjs.map +1 -1
- package/build/modules/kms/jwk/kty/ec/P384PublicJwk.d.mts +7 -6
- package/build/modules/kms/jwk/kty/ec/P384PublicJwk.d.mts.map +1 -1
- package/build/modules/kms/jwk/kty/ec/P384PublicJwk.d.ts +7 -6
- package/build/modules/kms/jwk/kty/ec/P384PublicJwk.d.ts.map +1 -1
- package/build/modules/kms/jwk/kty/ec/P384PublicJwk.mjs.map +1 -1
- package/build/modules/kms/jwk/kty/ec/P521PublicJwk.d.mts +7 -6
- package/build/modules/kms/jwk/kty/ec/P521PublicJwk.d.mts.map +1 -1
- package/build/modules/kms/jwk/kty/ec/P521PublicJwk.d.ts +7 -6
- package/build/modules/kms/jwk/kty/ec/P521PublicJwk.d.ts.map +1 -1
- package/build/modules/kms/jwk/kty/ec/P521PublicJwk.mjs.map +1 -1
- package/build/modules/kms/jwk/kty/ec/Secp256k1PublicJwk.d.mts +7 -6
- package/build/modules/kms/jwk/kty/ec/Secp256k1PublicJwk.d.mts.map +1 -1
- package/build/modules/kms/jwk/kty/ec/Secp256k1PublicJwk.d.ts +7 -6
- package/build/modules/kms/jwk/kty/ec/Secp256k1PublicJwk.d.ts.map +1 -1
- package/build/modules/kms/jwk/kty/ec/Secp256k1PublicJwk.mjs.map +1 -1
- package/build/modules/kms/jwk/kty/ec/ecPublicKey.mjs.map +1 -1
- package/build/modules/kms/jwk/kty/ec/ecSignature.d.mts +3 -2
- package/build/modules/kms/jwk/kty/ec/ecSignature.d.mts.map +1 -1
- package/build/modules/kms/jwk/kty/ec/ecSignature.d.ts +3 -2
- package/build/modules/kms/jwk/kty/ec/ecSignature.d.ts.map +1 -1
- package/build/modules/kms/jwk/kty/ec/ecSignature.js +2 -2
- package/build/modules/kms/jwk/kty/ec/ecSignature.mjs +2 -2
- package/build/modules/kms/jwk/kty/ec/ecSignature.mjs.map +1 -1
- package/build/modules/kms/jwk/kty/index.js +1 -1
- package/build/modules/kms/jwk/kty/index.mjs +1 -1
- package/build/modules/kms/jwk/kty/okp/Ed25519PublicJwk.d.mts +6 -5
- package/build/modules/kms/jwk/kty/okp/Ed25519PublicJwk.d.mts.map +1 -1
- package/build/modules/kms/jwk/kty/okp/Ed25519PublicJwk.d.ts +6 -5
- package/build/modules/kms/jwk/kty/okp/Ed25519PublicJwk.d.ts.map +1 -1
- package/build/modules/kms/jwk/kty/okp/Ed25519PublicJwk.mjs.map +1 -1
- package/build/modules/kms/jwk/kty/okp/X25519PublicJwk.d.mts +6 -5
- package/build/modules/kms/jwk/kty/okp/X25519PublicJwk.d.mts.map +1 -1
- package/build/modules/kms/jwk/kty/okp/X25519PublicJwk.d.ts +6 -5
- package/build/modules/kms/jwk/kty/okp/X25519PublicJwk.d.ts.map +1 -1
- package/build/modules/kms/jwk/kty/okp/X25519PublicJwk.mjs.map +1 -1
- package/build/modules/kms/jwk/kty/okp/okpPublicKey.mjs.map +1 -1
- package/build/modules/kms/jwk/kty/rsa/RsaPublicJwk.d.mts +8 -7
- package/build/modules/kms/jwk/kty/rsa/RsaPublicJwk.d.mts.map +1 -1
- package/build/modules/kms/jwk/kty/rsa/RsaPublicJwk.d.ts +8 -7
- package/build/modules/kms/jwk/kty/rsa/RsaPublicJwk.d.ts.map +1 -1
- package/build/modules/kms/jwk/kty/rsa/RsaPublicJwk.mjs.map +1 -1
- package/build/modules/kms/jwk/kty/rsa/rsaPublicKey.mjs.map +1 -1
- package/build/modules/kms/options/KmsCreateKeyOptions.d.mts +1 -1
- package/build/modules/kms/options/KmsCreateKeyOptions.d.mts.map +1 -1
- package/build/modules/kms/options/KmsCreateKeyOptions.d.ts +1 -1
- package/build/modules/kms/options/KmsCreateKeyOptions.d.ts.map +1 -1
- package/build/modules/kms/options/KmsCreateKeyOptions.mjs.map +1 -1
- package/build/modules/kms/options/KmsDecryptOptions.d.mts +169 -168
- package/build/modules/kms/options/KmsDecryptOptions.d.mts.map +1 -1
- package/build/modules/kms/options/KmsDecryptOptions.d.ts +169 -168
- package/build/modules/kms/options/KmsDecryptOptions.d.ts.map +1 -1
- package/build/modules/kms/options/KmsDecryptOptions.js +13 -12
- package/build/modules/kms/options/KmsDecryptOptions.mjs +13 -12
- package/build/modules/kms/options/KmsDecryptOptions.mjs.map +1 -1
- package/build/modules/kms/options/KmsEncryptOptions.d.mts +123 -122
- package/build/modules/kms/options/KmsEncryptOptions.d.mts.map +1 -1
- package/build/modules/kms/options/KmsEncryptOptions.d.ts +123 -122
- package/build/modules/kms/options/KmsEncryptOptions.d.ts.map +1 -1
- package/build/modules/kms/options/KmsEncryptOptions.js +13 -12
- package/build/modules/kms/options/KmsEncryptOptions.mjs +13 -12
- package/build/modules/kms/options/KmsEncryptOptions.mjs.map +1 -1
- package/build/modules/kms/options/KmsKeyAgreementDecryptOptions.d.mts +49 -48
- package/build/modules/kms/options/KmsKeyAgreementDecryptOptions.d.mts.map +1 -1
- package/build/modules/kms/options/KmsKeyAgreementDecryptOptions.d.ts +49 -48
- package/build/modules/kms/options/KmsKeyAgreementDecryptOptions.d.ts.map +1 -1
- package/build/modules/kms/options/KmsKeyAgreementDecryptOptions.js +3 -2
- package/build/modules/kms/options/KmsKeyAgreementDecryptOptions.mjs +3 -2
- package/build/modules/kms/options/KmsKeyAgreementDecryptOptions.mjs.map +1 -1
- package/build/modules/kms/options/KmsKeyAgreementEncryptOptions.d.mts +25 -24
- package/build/modules/kms/options/KmsKeyAgreementEncryptOptions.d.mts.map +1 -1
- package/build/modules/kms/options/KmsKeyAgreementEncryptOptions.d.ts +25 -24
- package/build/modules/kms/options/KmsKeyAgreementEncryptOptions.d.ts.map +1 -1
- package/build/modules/kms/options/KmsKeyAgreementEncryptOptions.js +5 -4
- package/build/modules/kms/options/KmsKeyAgreementEncryptOptions.mjs +5 -4
- package/build/modules/kms/options/KmsKeyAgreementEncryptOptions.mjs.map +1 -1
- package/build/modules/kms/options/KmsOperation.d.mts +3 -3
- package/build/modules/kms/options/KmsOperation.d.ts +3 -3
- package/build/modules/kms/options/KmsOperation.mjs.map +1 -1
- package/build/modules/kms/options/KmsSignOptions.d.mts +5 -4
- package/build/modules/kms/options/KmsSignOptions.d.mts.map +1 -1
- package/build/modules/kms/options/KmsSignOptions.d.ts +5 -4
- package/build/modules/kms/options/KmsSignOptions.d.ts.map +1 -1
- package/build/modules/kms/options/KmsSignOptions.js +2 -1
- package/build/modules/kms/options/KmsSignOptions.mjs +2 -1
- package/build/modules/kms/options/KmsSignOptions.mjs.map +1 -1
- package/build/modules/kms/options/KmsVerifyOptions.d.mts +7 -6
- package/build/modules/kms/options/KmsVerifyOptions.d.mts.map +1 -1
- package/build/modules/kms/options/KmsVerifyOptions.d.ts +7 -6
- package/build/modules/kms/options/KmsVerifyOptions.d.ts.map +1 -1
- package/build/modules/kms/options/KmsVerifyOptions.js +3 -2
- package/build/modules/kms/options/KmsVerifyOptions.mjs +3 -2
- package/build/modules/kms/options/KmsVerifyOptions.mjs.map +1 -1
- package/build/modules/mdoc/Mdoc.d.mts +1 -3
- package/build/modules/mdoc/Mdoc.d.mts.map +1 -1
- package/build/modules/mdoc/Mdoc.d.ts +1 -3
- package/build/modules/mdoc/Mdoc.d.ts.map +1 -1
- package/build/modules/mdoc/Mdoc.js +1 -7
- package/build/modules/mdoc/Mdoc.mjs +1 -7
- package/build/modules/mdoc/Mdoc.mjs.map +1 -1
- package/build/modules/mdoc/MdocApi.d.mts +1 -1
- package/build/modules/mdoc/MdocApi.d.mts.map +1 -1
- package/build/modules/mdoc/MdocApi.d.ts +1 -1
- package/build/modules/mdoc/MdocApi.d.ts.map +1 -1
- package/build/modules/mdoc/MdocApi.mjs.map +1 -1
- package/build/modules/mdoc/MdocContext.js +9 -11
- package/build/modules/mdoc/MdocContext.mjs +6 -7
- package/build/modules/mdoc/MdocContext.mjs.map +1 -1
- package/build/modules/mdoc/MdocDeviceResponse.d.mts +1 -1
- package/build/modules/mdoc/MdocDeviceResponse.d.mts.map +1 -1
- package/build/modules/mdoc/MdocDeviceResponse.d.ts +1 -1
- package/build/modules/mdoc/MdocDeviceResponse.d.ts.map +1 -1
- package/build/modules/mdoc/MdocDeviceResponse.mjs.map +1 -1
- package/build/modules/mdoc/MdocModule.d.mts.map +1 -1
- package/build/modules/mdoc/MdocModule.d.ts.map +1 -1
- package/build/modules/mdoc/MdocModule.mjs.map +1 -1
- package/build/modules/mdoc/MdocOptions.d.mts +4 -3
- package/build/modules/mdoc/MdocOptions.d.mts.map +1 -1
- package/build/modules/mdoc/MdocOptions.d.ts +4 -3
- package/build/modules/mdoc/MdocOptions.d.ts.map +1 -1
- package/build/modules/mdoc/MdocService.d.mts +1 -1
- package/build/modules/mdoc/MdocService.d.mts.map +1 -1
- package/build/modules/mdoc/MdocService.d.ts +1 -2
- package/build/modules/mdoc/MdocService.d.ts.map +1 -1
- package/build/modules/mdoc/MdocService.mjs.map +1 -1
- package/build/modules/mdoc/index.d.mts +3 -3
- package/build/modules/mdoc/index.d.ts +3 -3
- package/build/modules/mdoc/repository/MdocRecord.d.mts +1 -1
- package/build/modules/mdoc/repository/MdocRecord.d.mts.map +1 -1
- package/build/modules/mdoc/repository/MdocRecord.d.ts +1 -1
- package/build/modules/mdoc/repository/MdocRecord.d.ts.map +1 -1
- package/build/modules/mdoc/repository/MdocRecord.mjs.map +1 -1
- package/build/modules/sd-jwt-vc/SdJwtVcApi.d.mts +2 -4
- package/build/modules/sd-jwt-vc/SdJwtVcApi.d.mts.map +1 -1
- package/build/modules/sd-jwt-vc/SdJwtVcApi.d.ts +2 -4
- package/build/modules/sd-jwt-vc/SdJwtVcApi.d.ts.map +1 -1
- package/build/modules/sd-jwt-vc/SdJwtVcApi.mjs.map +1 -1
- package/build/modules/sd-jwt-vc/SdJwtVcModule.d.mts.map +1 -1
- package/build/modules/sd-jwt-vc/SdJwtVcModule.d.ts.map +1 -1
- package/build/modules/sd-jwt-vc/SdJwtVcModule.mjs.map +1 -1
- package/build/modules/sd-jwt-vc/SdJwtVcOptions.d.mts +5 -1
- package/build/modules/sd-jwt-vc/SdJwtVcOptions.d.mts.map +1 -1
- package/build/modules/sd-jwt-vc/SdJwtVcOptions.d.ts +5 -1
- package/build/modules/sd-jwt-vc/SdJwtVcOptions.d.ts.map +1 -1
- package/build/modules/sd-jwt-vc/SdJwtVcService.d.mts +4 -5
- package/build/modules/sd-jwt-vc/SdJwtVcService.d.mts.map +1 -1
- package/build/modules/sd-jwt-vc/SdJwtVcService.d.ts +4 -5
- package/build/modules/sd-jwt-vc/SdJwtVcService.d.ts.map +1 -1
- package/build/modules/sd-jwt-vc/SdJwtVcService.js +40 -48
- package/build/modules/sd-jwt-vc/SdJwtVcService.mjs +41 -49
- package/build/modules/sd-jwt-vc/SdJwtVcService.mjs.map +1 -1
- package/build/modules/sd-jwt-vc/decodeSdJwtVc.mjs.map +1 -1
- package/build/modules/sd-jwt-vc/disclosureFrame.mjs.map +1 -1
- package/build/modules/sd-jwt-vc/index.js +1 -1
- package/build/modules/sd-jwt-vc/index.mjs +1 -1
- package/build/modules/sd-jwt-vc/repository/SdJwtVcRecord.d.mts +1 -1
- package/build/modules/sd-jwt-vc/repository/SdJwtVcRecord.d.mts.map +1 -1
- package/build/modules/sd-jwt-vc/repository/SdJwtVcRecord.d.ts +1 -1
- package/build/modules/sd-jwt-vc/repository/SdJwtVcRecord.d.ts.map +1 -1
- package/build/modules/sd-jwt-vc/repository/SdJwtVcRecord.mjs.map +1 -1
- package/build/modules/sd-jwt-vc/repository/SdJwtVcRepository.d.mts +1 -1
- package/build/modules/sd-jwt-vc/repository/SdJwtVcRepository.d.ts +1 -1
- package/build/modules/sd-jwt-vc/utils.js +1 -1
- package/build/modules/sd-jwt-vc/utils.mjs +1 -1
- package/build/modules/sd-jwt-vc/utils.mjs.map +1 -1
- package/build/modules/vc/W3cCredentialService.d.mts +2 -2
- package/build/modules/vc/W3cCredentialService.d.mts.map +1 -1
- package/build/modules/vc/W3cCredentialService.d.ts +2 -2
- package/build/modules/vc/W3cCredentialService.d.ts.map +1 -1
- package/build/modules/vc/W3cCredentialService.mjs.map +1 -1
- package/build/modules/vc/W3cCredentialServiceOptions.d.mts +2 -2
- package/build/modules/vc/W3cCredentialServiceOptions.d.ts +2 -2
- package/build/modules/vc/W3cCredentialsApi.d.mts +1 -1
- package/build/modules/vc/W3cCredentialsApi.d.mts.map +1 -1
- package/build/modules/vc/W3cCredentialsApi.d.ts +1 -1
- package/build/modules/vc/W3cCredentialsApi.d.ts.map +1 -1
- package/build/modules/vc/W3cCredentialsApi.mjs.map +1 -1
- package/build/modules/vc/W3cCredentialsModule.d.mts.map +1 -1
- package/build/modules/vc/W3cCredentialsModule.d.ts.map +1 -1
- package/build/modules/vc/W3cCredentialsModule.mjs.map +1 -1
- package/build/modules/vc/W3cV2CredentialService.d.mts +3 -3
- package/build/modules/vc/W3cV2CredentialService.d.ts +3 -3
- package/build/modules/vc/W3cV2CredentialService.js +1 -1
- package/build/modules/vc/W3cV2CredentialService.mjs +1 -1
- package/build/modules/vc/W3cV2CredentialService.mjs.map +1 -1
- package/build/modules/vc/W3cV2CredentialServiceOptions.d.mts +3 -3
- package/build/modules/vc/W3cV2CredentialServiceOptions.d.mts.map +1 -1
- package/build/modules/vc/W3cV2CredentialServiceOptions.d.ts +3 -3
- package/build/modules/vc/W3cV2CredentialServiceOptions.d.ts.map +1 -1
- package/build/modules/vc/W3cV2CredentialsApi.d.mts +1 -1
- package/build/modules/vc/W3cV2CredentialsApi.d.mts.map +1 -1
- package/build/modules/vc/W3cV2CredentialsApi.d.ts +1 -1
- package/build/modules/vc/W3cV2CredentialsApi.d.ts.map +1 -1
- package/build/modules/vc/W3cV2CredentialsApi.mjs.map +1 -1
- package/build/modules/vc/W3cV2CredentialsModule.mjs.map +1 -1
- package/build/modules/vc/data-integrity/W3cJsonLdCredentialService.d.mts +2 -2
- package/build/modules/vc/data-integrity/W3cJsonLdCredentialService.d.mts.map +1 -1
- package/build/modules/vc/data-integrity/W3cJsonLdCredentialService.d.ts +2 -2
- package/build/modules/vc/data-integrity/W3cJsonLdCredentialService.d.ts.map +1 -1
- package/build/modules/vc/data-integrity/W3cJsonLdCredentialService.js +6 -6
- package/build/modules/vc/data-integrity/W3cJsonLdCredentialService.mjs +6 -6
- package/build/modules/vc/data-integrity/W3cJsonLdCredentialService.mjs.map +1 -1
- package/build/modules/vc/data-integrity/deriveProof.d.mts +1 -1
- package/build/modules/vc/data-integrity/deriveProof.d.ts +1 -1
- package/build/modules/vc/data-integrity/deriveProof.js +1 -1
- package/build/modules/vc/data-integrity/deriveProof.mjs +1 -1
- package/build/modules/vc/data-integrity/deriveProof.mjs.map +1 -1
- package/build/modules/vc/data-integrity/index.js +8 -8
- package/build/modules/vc/data-integrity/index.mjs +8 -8
- package/build/modules/vc/data-integrity/jsonldUtil.d.mts.map +1 -1
- package/build/modules/vc/data-integrity/jsonldUtil.d.ts.map +1 -1
- package/build/modules/vc/data-integrity/jsonldUtil.js +1 -1
- package/build/modules/vc/data-integrity/jsonldUtil.mjs +1 -1
- package/build/modules/vc/data-integrity/jsonldUtil.mjs.map +1 -1
- package/build/modules/vc/data-integrity/libraries/contexts/defaultContexts.js +1 -1
- package/build/modules/vc/data-integrity/libraries/contexts/defaultContexts.mjs +1 -1
- package/build/modules/vc/data-integrity/libraries/contexts/defaultContexts.mjs.map +1 -1
- package/build/modules/vc/data-integrity/libraries/documentLoader.d.mts.map +1 -1
- package/build/modules/vc/data-integrity/libraries/documentLoader.d.ts.map +1 -1
- package/build/modules/vc/data-integrity/libraries/documentLoader.mjs.map +1 -1
- package/build/modules/vc/data-integrity/libraries/index.js +1 -1
- package/build/modules/vc/data-integrity/libraries/index.mjs +1 -1
- package/build/modules/vc/data-integrity/libraries/jsonld-signatures.d.mts.map +1 -1
- package/build/modules/vc/data-integrity/libraries/jsonld-signatures.d.ts.map +1 -1
- package/build/modules/vc/data-integrity/libraries/jsonld-signatures.mjs.map +1 -1
- package/build/modules/vc/data-integrity/libraries/jsonld.mjs.map +1 -1
- package/build/modules/vc/data-integrity/libraries/nativeDocumentLoader.mjs.map +1 -1
- package/build/modules/vc/data-integrity/libraries/vc.d.mts.map +1 -1
- package/build/modules/vc/data-integrity/libraries/vc.d.ts.map +1 -1
- package/build/modules/vc/data-integrity/libraries/vc.js +1 -1
- package/build/modules/vc/data-integrity/libraries/vc.mjs +1 -1
- package/build/modules/vc/data-integrity/libraries/vc.mjs.map +1 -1
- package/build/modules/vc/data-integrity/models/IAnonCredsDataIntegrityService.d.mts +2 -2
- package/build/modules/vc/data-integrity/models/IAnonCredsDataIntegrityService.d.ts +2 -2
- package/build/modules/vc/data-integrity/models/LdKeyPair.d.mts +5 -4
- package/build/modules/vc/data-integrity/models/LdKeyPair.d.mts.map +1 -1
- package/build/modules/vc/data-integrity/models/LdKeyPair.d.ts +5 -4
- package/build/modules/vc/data-integrity/models/LdKeyPair.d.ts.map +1 -1
- package/build/modules/vc/data-integrity/models/LdKeyPair.mjs.map +1 -1
- package/build/modules/vc/data-integrity/models/ProofTransformer.mjs.map +1 -1
- package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiableCredential.d.mts +2 -2
- package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiableCredential.d.mts.map +1 -1
- package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiableCredential.d.ts +2 -2
- package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiableCredential.d.ts.map +1 -1
- package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiableCredential.js +1 -1
- package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiableCredential.mjs +1 -1
- package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiableCredential.mjs.map +1 -1
- package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiablePresentation.d.mts +2 -2
- package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiablePresentation.d.mts.map +1 -1
- package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiablePresentation.d.ts +2 -2
- package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiablePresentation.d.ts.map +1 -1
- package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiablePresentation.js +1 -1
- package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiablePresentation.mjs +1 -1
- package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiablePresentation.mjs.map +1 -1
- package/build/modules/vc/data-integrity/models/index.js +2 -2
- package/build/modules/vc/data-integrity/models/index.mjs +2 -2
- package/build/modules/vc/data-integrity/proof-purposes/CredentialIssuancePurpose.d.mts +1 -1
- package/build/modules/vc/data-integrity/proof-purposes/CredentialIssuancePurpose.d.ts +1 -1
- package/build/modules/vc/data-integrity/proof-purposes/CredentialIssuancePurpose.mjs.map +1 -1
- package/build/modules/vc/data-integrity/signature-suites/JwsLinkedDataSignature.d.mts +3 -2
- package/build/modules/vc/data-integrity/signature-suites/JwsLinkedDataSignature.d.mts.map +1 -1
- package/build/modules/vc/data-integrity/signature-suites/JwsLinkedDataSignature.d.ts +3 -2
- package/build/modules/vc/data-integrity/signature-suites/JwsLinkedDataSignature.d.ts.map +1 -1
- package/build/modules/vc/data-integrity/signature-suites/JwsLinkedDataSignature.mjs.map +1 -1
- package/build/modules/vc/data-integrity/signature-suites/ed25519/Ed25519Signature2018.d.mts.map +1 -1
- package/build/modules/vc/data-integrity/signature-suites/ed25519/Ed25519Signature2018.d.ts.map +1 -1
- package/build/modules/vc/data-integrity/signature-suites/ed25519/Ed25519Signature2018.mjs.map +1 -1
- package/build/modules/vc/data-integrity/signature-suites/ed25519/Ed25519Signature2020.d.mts +3 -2
- package/build/modules/vc/data-integrity/signature-suites/ed25519/Ed25519Signature2020.d.mts.map +1 -1
- package/build/modules/vc/data-integrity/signature-suites/ed25519/Ed25519Signature2020.d.ts +3 -2
- package/build/modules/vc/data-integrity/signature-suites/ed25519/Ed25519Signature2020.d.ts.map +1 -1
- package/build/modules/vc/data-integrity/signature-suites/ed25519/Ed25519Signature2020.mjs.map +1 -1
- package/build/modules/vc/index.js +14 -14
- package/build/modules/vc/index.mjs +14 -14
- package/build/modules/vc/jwt-vc/W3cJwtCredentialService.d.mts +2 -2
- package/build/modules/vc/jwt-vc/W3cJwtCredentialService.d.mts.map +1 -1
- package/build/modules/vc/jwt-vc/W3cJwtCredentialService.d.ts +2 -2
- package/build/modules/vc/jwt-vc/W3cJwtCredentialService.d.ts.map +1 -1
- package/build/modules/vc/jwt-vc/W3cJwtCredentialService.js +4 -4
- package/build/modules/vc/jwt-vc/W3cJwtCredentialService.mjs +4 -4
- package/build/modules/vc/jwt-vc/W3cJwtCredentialService.mjs.map +1 -1
- package/build/modules/vc/jwt-vc/W3cJwtVerifiableCredential.d.mts +4 -4
- package/build/modules/vc/jwt-vc/W3cJwtVerifiableCredential.d.mts.map +1 -1
- package/build/modules/vc/jwt-vc/W3cJwtVerifiableCredential.d.ts +4 -4
- package/build/modules/vc/jwt-vc/W3cJwtVerifiableCredential.d.ts.map +1 -1
- package/build/modules/vc/jwt-vc/W3cJwtVerifiableCredential.mjs.map +1 -1
- package/build/modules/vc/jwt-vc/W3cJwtVerifiablePresentation.d.mts +1 -1
- package/build/modules/vc/jwt-vc/W3cJwtVerifiablePresentation.d.mts.map +1 -1
- package/build/modules/vc/jwt-vc/W3cJwtVerifiablePresentation.d.ts +1 -1
- package/build/modules/vc/jwt-vc/W3cJwtVerifiablePresentation.d.ts.map +1 -1
- package/build/modules/vc/jwt-vc/W3cJwtVerifiablePresentation.mjs.map +1 -1
- package/build/modules/vc/jwt-vc/W3cV2JwtCredentialService.d.mts +2 -2
- package/build/modules/vc/jwt-vc/W3cV2JwtCredentialService.d.ts +2 -2
- package/build/modules/vc/jwt-vc/W3cV2JwtCredentialService.js +4 -4
- package/build/modules/vc/jwt-vc/W3cV2JwtCredentialService.mjs +4 -4
- package/build/modules/vc/jwt-vc/W3cV2JwtCredentialService.mjs.map +1 -1
- package/build/modules/vc/jwt-vc/W3cV2JwtVerifiableCredential.d.mts +1 -1
- package/build/modules/vc/jwt-vc/W3cV2JwtVerifiableCredential.d.ts +1 -1
- package/build/modules/vc/jwt-vc/credentialTransformer.mjs.map +1 -1
- package/build/modules/vc/jwt-vc/index.js +1 -1
- package/build/modules/vc/jwt-vc/index.mjs +1 -1
- package/build/modules/vc/jwt-vc/presentationTransformer.mjs.map +1 -1
- package/build/modules/vc/models/credential/W3cCredential.d.mts +3 -3
- package/build/modules/vc/models/credential/W3cCredential.d.mts.map +1 -1
- package/build/modules/vc/models/credential/W3cCredential.d.ts +3 -3
- package/build/modules/vc/models/credential/W3cCredential.d.ts.map +1 -1
- package/build/modules/vc/models/credential/W3cCredential.js +1 -1
- package/build/modules/vc/models/credential/W3cCredential.mjs +1 -1
- package/build/modules/vc/models/credential/W3cCredential.mjs.map +1 -1
- package/build/modules/vc/models/credential/W3cCredentialSubject.d.mts.map +1 -1
- package/build/modules/vc/models/credential/W3cCredentialSubject.d.ts.map +1 -1
- package/build/modules/vc/models/credential/W3cCredentialSubject.mjs.map +1 -1
- package/build/modules/vc/models/credential/W3cIssuer.d.mts.map +1 -1
- package/build/modules/vc/models/credential/W3cIssuer.d.ts.map +1 -1
- package/build/modules/vc/models/credential/W3cIssuer.mjs.map +1 -1
- package/build/modules/vc/models/credential/W3cV2Credential.d.mts +1 -1
- package/build/modules/vc/models/credential/W3cV2Credential.d.ts +1 -1
- package/build/modules/vc/models/credential/W3cV2Credential.js +1 -1
- package/build/modules/vc/models/credential/W3cV2Credential.mjs +1 -1
- package/build/modules/vc/models/credential/W3cV2Credential.mjs.map +1 -1
- package/build/modules/vc/models/credential/W3cV2CredentialSchema.js +2 -2
- package/build/modules/vc/models/credential/W3cV2CredentialSchema.mjs +2 -2
- package/build/modules/vc/models/credential/W3cV2CredentialSchema.mjs.map +1 -1
- package/build/modules/vc/models/credential/W3cV2EnvelopedVerifiableCredential.d.mts +1 -1
- package/build/modules/vc/models/credential/W3cV2EnvelopedVerifiableCredential.d.ts +1 -1
- package/build/modules/vc/models/credential/W3cV2EnvelopedVerifiableCredential.mjs.map +1 -1
- package/build/modules/vc/models/credential/W3cV2Evidence.js +2 -2
- package/build/modules/vc/models/credential/W3cV2Evidence.mjs +2 -2
- package/build/modules/vc/models/credential/W3cV2Evidence.mjs.map +1 -1
- package/build/modules/vc/models/credential/W3cV2Issuer.mjs.map +1 -1
- package/build/modules/vc/models/credential/W3cV2LocalizedValue.mjs.map +1 -1
- package/build/modules/vc/models/credential/W3cVerifiableCredential.d.mts.map +1 -1
- package/build/modules/vc/models/credential/W3cVerifiableCredential.d.ts.map +1 -1
- package/build/modules/vc/models/credential/W3cVerifiableCredential.mjs.map +1 -1
- package/build/modules/vc/models/credential/index.js +1 -1
- package/build/modules/vc/models/credential/index.mjs +1 -1
- package/build/modules/vc/models/index.js +1 -1
- package/build/modules/vc/models/index.mjs +1 -1
- package/build/modules/vc/models/presentation/W3cHolder.d.mts.map +1 -1
- package/build/modules/vc/models/presentation/W3cHolder.d.ts.map +1 -1
- package/build/modules/vc/models/presentation/W3cHolder.mjs.map +1 -1
- package/build/modules/vc/models/presentation/W3cJsonPresentation.d.mts +1 -1
- package/build/modules/vc/models/presentation/W3cJsonPresentation.d.ts +1 -1
- package/build/modules/vc/models/presentation/W3cPresentation.d.mts +2 -2
- package/build/modules/vc/models/presentation/W3cPresentation.d.mts.map +1 -1
- package/build/modules/vc/models/presentation/W3cPresentation.d.ts +2 -2
- package/build/modules/vc/models/presentation/W3cPresentation.d.ts.map +1 -1
- package/build/modules/vc/models/presentation/W3cPresentation.mjs.map +1 -1
- package/build/modules/vc/models/presentation/W3cV2EnvelopedVerifiablePresentation.d.mts +2 -2
- package/build/modules/vc/models/presentation/W3cV2EnvelopedVerifiablePresentation.d.ts +2 -2
- package/build/modules/vc/models/presentation/W3cV2EnvelopedVerifiablePresentation.js +1 -1
- package/build/modules/vc/models/presentation/W3cV2EnvelopedVerifiablePresentation.mjs +1 -1
- package/build/modules/vc/models/presentation/W3cV2EnvelopedVerifiablePresentation.mjs.map +1 -1
- package/build/modules/vc/models/presentation/W3cV2Holder.mjs.map +1 -1
- package/build/modules/vc/models/presentation/W3cV2JsonPresentation.d.mts +1 -1
- package/build/modules/vc/models/presentation/W3cV2JsonPresentation.d.ts +1 -1
- package/build/modules/vc/models/presentation/W3cV2Presentation.d.mts +1 -1
- package/build/modules/vc/models/presentation/W3cV2Presentation.d.ts +1 -1
- package/build/modules/vc/models/presentation/W3cV2Presentation.js +1 -1
- package/build/modules/vc/models/presentation/W3cV2Presentation.mjs +1 -1
- package/build/modules/vc/models/presentation/W3cV2VerifiablePresentation.d.mts +1 -1
- package/build/modules/vc/models/presentation/W3cV2VerifiablePresentation.d.ts +1 -1
- package/build/modules/vc/repository/W3cCredentialRecord.d.mts.map +1 -1
- package/build/modules/vc/repository/W3cCredentialRecord.d.ts.map +1 -1
- package/build/modules/vc/repository/W3cCredentialRecord.mjs.map +1 -1
- package/build/modules/vc/repository/W3cV2CredentialRecord.js +1 -1
- package/build/modules/vc/repository/W3cV2CredentialRecord.mjs +1 -1
- package/build/modules/vc/repository/W3cV2CredentialRecord.mjs.map +1 -1
- package/build/modules/vc/sd-jwt-vc/W3cV2SdJwt.d.mts +2 -2
- package/build/modules/vc/sd-jwt-vc/W3cV2SdJwt.d.mts.map +1 -1
- package/build/modules/vc/sd-jwt-vc/W3cV2SdJwt.d.ts +2 -2
- package/build/modules/vc/sd-jwt-vc/W3cV2SdJwt.d.ts.map +1 -1
- package/build/modules/vc/sd-jwt-vc/W3cV2SdJwt.mjs.map +1 -1
- package/build/modules/vc/sd-jwt-vc/W3cV2SdJwtCredentialService.d.mts +1 -1
- package/build/modules/vc/sd-jwt-vc/W3cV2SdJwtCredentialService.d.ts +1 -1
- package/build/modules/vc/sd-jwt-vc/W3cV2SdJwtCredentialService.js +3 -3
- package/build/modules/vc/sd-jwt-vc/W3cV2SdJwtCredentialService.mjs +3 -3
- package/build/modules/vc/sd-jwt-vc/W3cV2SdJwtCredentialService.mjs.map +1 -1
- package/build/modules/vc/sd-jwt-vc/W3cV2SdJwtVerifiableCredential.mjs.map +1 -1
- package/build/modules/vc/sd-jwt-vc/W3cV2SdJwtVerifiablePresentation.mjs.map +1 -1
- package/build/modules/vc/v2-jwt-utils.js +2 -2
- package/build/modules/vc/v2-jwt-utils.mjs +2 -2
- package/build/modules/vc/v2-jwt-utils.mjs.map +1 -1
- package/build/modules/vc/validators.mjs.map +1 -1
- package/build/modules/x509/X509Api.d.mts +1 -1
- package/build/modules/x509/X509Api.d.ts +1 -1
- package/build/modules/x509/X509Api.js +1 -1
- package/build/modules/x509/X509Api.mjs +1 -1
- package/build/modules/x509/X509Certificate.d.mts +5 -5
- package/build/modules/x509/X509Certificate.d.mts.map +1 -1
- package/build/modules/x509/X509Certificate.d.ts +5 -5
- package/build/modules/x509/X509Certificate.d.ts.map +1 -1
- package/build/modules/x509/X509Certificate.js +4 -7
- package/build/modules/x509/X509Certificate.mjs +3 -6
- package/build/modules/x509/X509Certificate.mjs.map +1 -1
- package/build/modules/x509/X509Module.d.mts.map +1 -1
- package/build/modules/x509/X509Module.d.ts.map +1 -1
- package/build/modules/x509/X509Module.js +1 -1
- package/build/modules/x509/X509Module.mjs +1 -1
- package/build/modules/x509/X509Module.mjs.map +1 -1
- package/build/modules/x509/X509ModuleConfig.d.mts +2 -2
- package/build/modules/x509/X509ModuleConfig.d.ts +2 -2
- package/build/modules/x509/X509Service.d.mts +1 -1
- package/build/modules/x509/X509Service.d.mts.map +1 -1
- package/build/modules/x509/X509Service.d.ts +1 -1
- package/build/modules/x509/X509Service.d.ts.map +1 -1
- package/build/modules/x509/X509Service.js +4 -4
- package/build/modules/x509/X509Service.mjs +3 -3
- package/build/modules/x509/X509Service.mjs.map +1 -1
- package/build/modules/x509/extraction.d.mts +1 -1
- package/build/modules/x509/extraction.d.ts +1 -1
- package/build/modules/x509/index.js +3 -3
- package/build/modules/x509/index.mjs +3 -3
- package/build/modules/x509/utils/extensions.d.mts.map +1 -1
- package/build/modules/x509/utils/extensions.d.ts.map +1 -1
- package/build/modules/x509/utils/extensions.js +1 -1
- package/build/modules/x509/utils/extensions.mjs +1 -1
- package/build/modules/x509/utils/extensions.mjs.map +1 -1
- package/build/modules/x509/utils/index.js +1 -1
- package/build/modules/x509/utils/index.mjs +1 -1
- package/build/modules/x509/utils/nameConversion.d.mts.map +1 -1
- package/build/modules/x509/utils/nameConversion.d.ts.map +1 -1
- package/build/modules/x509/utils/nameConversion.mjs.map +1 -1
- package/build/plugins/DependencyManager.d.mts.map +1 -1
- package/build/plugins/DependencyManager.d.ts.map +1 -1
- package/build/plugins/DependencyManager.mjs.map +1 -1
- package/build/storage/BaseRecord.mjs.map +1 -1
- package/build/storage/Metadata.mjs.map +1 -1
- package/build/storage/Repository.d.mts.map +1 -1
- package/build/storage/Repository.d.ts.map +1 -1
- package/build/storage/Repository.js +1 -1
- package/build/storage/Repository.mjs +1 -1
- package/build/storage/Repository.mjs.map +1 -1
- package/build/storage/RepositoryEvents.mjs.map +1 -1
- package/build/storage/StorageService.d.mts +1 -1
- package/build/storage/StorageService.d.ts +1 -1
- package/build/storage/index.js +1 -1
- package/build/storage/index.mjs +1 -1
- package/build/storage/migration/StorageUpdateService.d.mts.map +1 -1
- package/build/storage/migration/StorageUpdateService.d.ts.map +1 -1
- package/build/storage/migration/StorageUpdateService.js +1 -1
- package/build/storage/migration/StorageUpdateService.mjs +1 -1
- package/build/storage/migration/StorageUpdateService.mjs.map +1 -1
- package/build/storage/migration/UpdateAssistant.d.mts +1 -1
- package/build/storage/migration/UpdateAssistant.d.mts.map +1 -1
- package/build/storage/migration/UpdateAssistant.d.ts +1 -1
- package/build/storage/migration/UpdateAssistant.d.ts.map +1 -1
- package/build/storage/migration/UpdateAssistant.js +1 -1
- package/build/storage/migration/UpdateAssistant.mjs +1 -1
- package/build/storage/migration/UpdateAssistant.mjs.map +1 -1
- package/build/storage/migration/index.js +1 -1
- package/build/storage/migration/index.mjs +1 -1
- package/build/storage/migration/isUpToDate.d.mts.map +1 -1
- package/build/storage/migration/isUpToDate.d.ts.map +1 -1
- package/build/storage/migration/isUpToDate.js +1 -1
- package/build/storage/migration/isUpToDate.mjs +1 -1
- package/build/storage/migration/isUpToDate.mjs.map +1 -1
- package/build/storage/migration/updates/0.3.1-0.4/cache.mjs.map +1 -1
- package/build/storage/migration/updates/0.4-0.5/w3cCredentialRecord.mjs.map +1 -1
- package/build/storage/migration/updates.d.mts +1 -1
- package/build/storage/migration/updates.d.mts.map +1 -1
- package/build/storage/migration/updates.d.ts +1 -1
- package/build/storage/migration/updates.d.ts.map +1 -1
- package/build/storage/migration/updates.js +4 -4
- package/build/storage/migration/updates.mjs +1 -1
- package/build/storage/migration/updates.mjs.map +1 -1
- package/build/types.d.mts +12 -1
- package/build/types.d.mts.map +1 -1
- package/build/types.d.ts +12 -1
- package/build/types.d.ts.map +1 -1
- package/build/types.mjs.map +1 -1
- package/build/utils/HashlinkEncoder.d.mts +1 -1
- package/build/utils/HashlinkEncoder.d.mts.map +1 -1
- package/build/utils/HashlinkEncoder.d.ts +1 -1
- package/build/utils/HashlinkEncoder.d.ts.map +1 -1
- package/build/utils/HashlinkEncoder.mjs.map +1 -1
- package/build/utils/JsonEncoder.d.mts +3 -2
- package/build/utils/JsonEncoder.d.mts.map +1 -1
- package/build/utils/JsonEncoder.d.ts +3 -2
- package/build/utils/JsonEncoder.d.ts.map +1 -1
- package/build/utils/JsonEncoder.js +8 -8
- package/build/utils/JsonEncoder.mjs +4 -3
- package/build/utils/JsonEncoder.mjs.map +1 -1
- package/build/utils/JsonTransformer.mjs.map +1 -1
- package/build/utils/MessageValidator.mjs.map +1 -1
- package/build/utils/MultiBaseEncoder.d.mts +4 -2
- package/build/utils/MultiBaseEncoder.d.mts.map +1 -1
- package/build/utils/MultiBaseEncoder.d.ts +4 -2
- package/build/utils/MultiBaseEncoder.d.ts.map +1 -1
- package/build/utils/MultiBaseEncoder.mjs.map +1 -1
- package/build/utils/MultiHashEncoder.d.mts +5 -5
- package/build/utils/MultiHashEncoder.d.mts.map +1 -1
- package/build/utils/MultiHashEncoder.d.ts +5 -5
- package/build/utils/MultiHashEncoder.d.ts.map +1 -1
- package/build/utils/MultiHashEncoder.js +5 -7
- package/build/utils/MultiHashEncoder.mjs +5 -4
- package/build/utils/MultiHashEncoder.mjs.map +1 -1
- package/build/utils/TypedArrayEncoder.d.mts +12 -9
- package/build/utils/TypedArrayEncoder.d.mts.map +1 -1
- package/build/utils/TypedArrayEncoder.d.ts +12 -9
- package/build/utils/TypedArrayEncoder.d.ts.map +1 -1
- package/build/utils/TypedArrayEncoder.js +22 -17
- package/build/utils/TypedArrayEncoder.mjs +7 -1
- package/build/utils/TypedArrayEncoder.mjs.map +1 -1
- package/build/utils/VarintEncoder.js +1 -4
- package/build/utils/VarintEncoder.mjs +1 -2
- package/build/utils/VarintEncoder.mjs.map +1 -1
- package/build/utils/base58.mjs.map +1 -1
- package/build/utils/buffer.d.mts +1 -1
- package/build/utils/buffer.d.ts +1 -1
- package/build/utils/buffer.mjs +1 -1
- package/build/utils/deepEquality.mjs.map +1 -1
- package/build/utils/index.js +10 -11
- package/build/utils/index.mjs +9 -9
- package/build/utils/objectEquality.mjs.map +1 -1
- package/build/utils/timestamp.d.mts +10 -2
- package/build/utils/timestamp.d.mts.map +1 -1
- package/build/utils/timestamp.d.ts +10 -2
- package/build/utils/timestamp.d.ts.map +1 -1
- package/build/utils/timestamp.js +9 -1
- package/build/utils/timestamp.mjs +8 -2
- package/build/utils/timestamp.mjs.map +1 -1
- package/build/utils/transformers.d.mts.map +1 -1
- package/build/utils/transformers.d.ts.map +1 -1
- package/build/utils/transformers.mjs.map +1 -1
- package/build/utils/validators.d.mts.map +1 -1
- package/build/utils/validators.d.ts.map +1 -1
- package/build/utils/validators.mjs.map +1 -1
- package/build/utils/zod.js +2 -0
- package/build/utils/zod.mjs +2 -1
- package/build/utils/zod.mjs.map +1 -1
- package/package.json +25 -25
- package/build/utils/buffer.js +0 -5
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { W3cJsonPresentation } from "../vc/models/presentation/W3cJsonPresentation.js";
|
|
2
|
-
import { W3cJwtVerifiablePresentation } from "../vc/jwt-vc/W3cJwtVerifiablePresentation.js";
|
|
3
|
-
import { MdocSessionTranscriptOptions } from "../mdoc/MdocOptions.js";
|
|
4
1
|
import { SdJwtVcHeader, SdJwtVcPayload } from "../sd-jwt-vc/SdJwtVcOptions.js";
|
|
5
2
|
import { SdJwtVc } from "../sd-jwt-vc/SdJwtVcService.js";
|
|
6
|
-
import {
|
|
7
|
-
import { W3cCredentialService } from "../vc/W3cCredentialService.js";
|
|
3
|
+
import { MdocSessionTranscriptOptions } from "../mdoc/MdocOptions.js";
|
|
8
4
|
import { MdocDeviceResponse } from "../mdoc/MdocDeviceResponse.js";
|
|
9
5
|
import { DifPexCredentialsForRequest, DifPexInputDescriptorToCredentials } from "./models/DifPexCredentialsForRequest.js";
|
|
6
|
+
import { W3cJsonPresentation } from "../vc/models/presentation/W3cJsonPresentation.js";
|
|
7
|
+
import { W3cJwtVerifiablePresentation } from "../vc/jwt-vc/W3cJwtVerifiablePresentation.js";
|
|
10
8
|
import { DifPresentationExchangeDefinition, DifPresentationExchangeSubmission, PresentationSubmissionLocation, VerifiablePresentation } from "./models/index.js";
|
|
9
|
+
import { W3cJsonLdVerifiablePresentation } from "../vc/data-integrity/models/W3cJsonLdVerifiablePresentation.js";
|
|
10
|
+
import { W3cCredentialService } from "../vc/W3cCredentialService.js";
|
|
11
11
|
import { AgentContext } from "../../agent/context/AgentContext.js";
|
|
12
12
|
import * as _sphereon_pex_models0 from "@sphereon/pex-models";
|
|
13
13
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DifPresentationExchangeService.d.ts","names":[],"sources":["../../../src/modules/dif-presentation-exchange/DifPresentationExchangeService.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"DifPresentationExchangeService.d.ts","names":[],"sources":["../../../src/modules/dif-presentation-exchange/DifPresentationExchangeService.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;cA2Da,8BAAA;;;oCAGsC;EAHtC,wBAAA,CAAA,YAA8B,EAMzB,YANyB,EAAA,sBAAA,EAOf,iCAPe,CAAA,EAQtC,OARsC,CAQ9B,2BAR8B,CAAA;EAAA;;;;6BAQ9B,CAAA,qBAAA,EAUc,2BAVd,CAAA,EAWR,kCAXQ;gCAAR,CAAA,sBAAA,EAiC2D,iCAjC3D,CAAA,EAAA,IAAA;gCAUsB,CAAA,sBAAA,EAgCqC,iCAhCrC,CAAA,EAAA,IAAA;sBACtB,CAAA,sBAAA,EAwCuB,iCAxCvB,EAAA,aAAA,EAyCc,sBAzCd,GAyCuC,sBAzCvC,EAAA,EAAA,sBAAA,CAAA,EA0CwB,iCA1CxB,CAAA,EAAA,IAAA;UAsB2D,eAAA;oBASA,CAAA,YAAA,EAuC9C,YAvC8C,EAAA,OAAA,EAAA;IASpC,6BAAA,EAgCS,kCAhCT;IACT,sBAAA,EAgCW,iCAhCX;IAAyB;;;IA+BP,8BAAA,CAAA,EAKE,8BALF;IACP;;;IAkB4B,SAAA,EAAA,MAAA;;;;;;;;4BAA5B;MACzB,OAAA,CAAA;IAAA,uBAAA,EAAA,CADqD,4BAAA,4CACrD,+BAAA,qBAAA,CAAA,EAAA"}
|
|
@@ -14,9 +14,9 @@ const require_DidsApi = require('../dids/DidsApi.js');
|
|
|
14
14
|
require('../dids/index.js');
|
|
15
15
|
const require_ClaimFormat = require('../vc/models/ClaimFormat.js');
|
|
16
16
|
const require_jsonld_signatures = require('../vc/data-integrity/libraries/jsonld-signatures.js');
|
|
17
|
-
const require_SignatureSuiteRegistry = require('../vc/data-integrity/SignatureSuiteRegistry.js');
|
|
18
|
-
const require_W3cPresentation = require('../vc/models/presentation/W3cPresentation.js');
|
|
19
17
|
const require_IAnonCredsDataIntegrityService = require('../vc/data-integrity/models/IAnonCredsDataIntegrityService.js');
|
|
18
|
+
const require_W3cPresentation = require('../vc/models/presentation/W3cPresentation.js');
|
|
19
|
+
const require_SignatureSuiteRegistry = require('../vc/data-integrity/SignatureSuiteRegistry.js');
|
|
20
20
|
const require_W3cCredentialRepository = require('../vc/repository/W3cCredentialRepository.js');
|
|
21
21
|
const require_W3cCredentialService = require('../vc/W3cCredentialService.js');
|
|
22
22
|
require('../vc/index.js');
|
|
@@ -116,12 +116,16 @@ let DifPresentationExchangeService = class DifPresentationExchangeService$1 {
|
|
|
116
116
|
});
|
|
117
117
|
} else {
|
|
118
118
|
const credentialsForPresentation = presentationToCreate.verifiableCredentials.map((c) => require_transform.getSphereonOriginalVerifiableCredential(c.credential));
|
|
119
|
+
const extraProofOptions = this.shouldSignUsingAnonCredsDataIntegrity(presentationToCreate) ? {
|
|
120
|
+
typeSupportsSelectiveDisclosure: true,
|
|
121
|
+
type: `DataIntegrityProof.${require_IAnonCredsDataIntegrityService.ANONCREDS_DATA_INTEGRITY_CRYPTOSUITE}`
|
|
122
|
+
} : {};
|
|
119
123
|
const verifiablePresentationResult = await this.pex.verifiablePresentationFrom(presentationDefinitionForSubject, credentialsForPresentation, this.getPresentationSignCallback(agentContext, presentationToCreate), {
|
|
120
124
|
proofOptions: {
|
|
121
125
|
challenge,
|
|
122
|
-
domain
|
|
126
|
+
domain,
|
|
127
|
+
...extraProofOptions
|
|
123
128
|
},
|
|
124
|
-
signatureOptions: {},
|
|
125
129
|
presentationSubmissionLocation
|
|
126
130
|
});
|
|
127
131
|
verifiablePresentationResultsWithFormat.push({
|
|
@@ -210,7 +214,7 @@ let DifPresentationExchangeService = class DifPresentationExchangeService$1 {
|
|
|
210
214
|
*/
|
|
211
215
|
shouldSignUsingAnonCredsDataIntegrity(presentationToCreate, presentationSubmission) {
|
|
212
216
|
if (presentationToCreate.claimFormat !== require_ClaimFormat.ClaimFormat.LdpVp) return void 0;
|
|
213
|
-
const validDescriptorFormat = presentationSubmission.descriptor_map.every((descriptor) => [
|
|
217
|
+
const validDescriptorFormat = !presentationSubmission || presentationSubmission.descriptor_map.every((descriptor) => [
|
|
214
218
|
require_ClaimFormat.ClaimFormat.DiVc,
|
|
215
219
|
require_ClaimFormat.ClaimFormat.DiVp,
|
|
216
220
|
require_ClaimFormat.ClaimFormat.LdpVc,
|
|
@@ -13,9 +13,9 @@ import { DidsApi } from "../dids/DidsApi.mjs";
|
|
|
13
13
|
import "../dids/index.mjs";
|
|
14
14
|
import { ClaimFormat } from "../vc/models/ClaimFormat.mjs";
|
|
15
15
|
import { purposes } from "../vc/data-integrity/libraries/jsonld-signatures.mjs";
|
|
16
|
-
import { SignatureSuiteRegistry } from "../vc/data-integrity/SignatureSuiteRegistry.mjs";
|
|
17
|
-
import { W3cPresentation } from "../vc/models/presentation/W3cPresentation.mjs";
|
|
18
16
|
import { ANONCREDS_DATA_INTEGRITY_CRYPTOSUITE, AnonCredsDataIntegrityServiceSymbol } from "../vc/data-integrity/models/IAnonCredsDataIntegrityService.mjs";
|
|
17
|
+
import { W3cPresentation } from "../vc/models/presentation/W3cPresentation.mjs";
|
|
18
|
+
import { SignatureSuiteRegistry } from "../vc/data-integrity/SignatureSuiteRegistry.mjs";
|
|
19
19
|
import { W3cCredentialRepository } from "../vc/repository/W3cCredentialRepository.mjs";
|
|
20
20
|
import { W3cCredentialService } from "../vc/W3cCredentialService.mjs";
|
|
21
21
|
import "../vc/index.mjs";
|
|
@@ -112,12 +112,16 @@ let DifPresentationExchangeService = class DifPresentationExchangeService$1 {
|
|
|
112
112
|
});
|
|
113
113
|
} else {
|
|
114
114
|
const credentialsForPresentation = presentationToCreate.verifiableCredentials.map((c) => getSphereonOriginalVerifiableCredential(c.credential));
|
|
115
|
+
const extraProofOptions = this.shouldSignUsingAnonCredsDataIntegrity(presentationToCreate) ? {
|
|
116
|
+
typeSupportsSelectiveDisclosure: true,
|
|
117
|
+
type: `DataIntegrityProof.${ANONCREDS_DATA_INTEGRITY_CRYPTOSUITE}`
|
|
118
|
+
} : {};
|
|
115
119
|
const verifiablePresentationResult = await this.pex.verifiablePresentationFrom(presentationDefinitionForSubject, credentialsForPresentation, this.getPresentationSignCallback(agentContext, presentationToCreate), {
|
|
116
120
|
proofOptions: {
|
|
117
121
|
challenge,
|
|
118
|
-
domain
|
|
122
|
+
domain,
|
|
123
|
+
...extraProofOptions
|
|
119
124
|
},
|
|
120
|
-
signatureOptions: {},
|
|
121
125
|
presentationSubmissionLocation
|
|
122
126
|
});
|
|
123
127
|
verifiablePresentationResultsWithFormat.push({
|
|
@@ -206,7 +210,7 @@ let DifPresentationExchangeService = class DifPresentationExchangeService$1 {
|
|
|
206
210
|
*/
|
|
207
211
|
shouldSignUsingAnonCredsDataIntegrity(presentationToCreate, presentationSubmission) {
|
|
208
212
|
if (presentationToCreate.claimFormat !== ClaimFormat.LdpVp) return void 0;
|
|
209
|
-
const validDescriptorFormat = presentationSubmission.descriptor_map.every((descriptor) => [
|
|
213
|
+
const validDescriptorFormat = !presentationSubmission || presentationSubmission.descriptor_map.every((descriptor) => [
|
|
210
214
|
ClaimFormat.DiVc,
|
|
211
215
|
ClaimFormat.DiVp,
|
|
212
216
|
ClaimFormat.LdpVc,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DifPresentationExchangeService.mjs","names":["DifPresentationExchangeService","w3cCredentialService: W3cCredentialService","credentials: DifPexInputDescriptorToCredentials","DifPresentationExchangeSubmissionLocation","verifiablePresentationResultsWithFormat: Array<{\n verifiablePresentationResult: VerifiablePresentationResult\n claimFormat: PresentationToCreate['claimFormat']\n }>","presentationDefinitionForSubject: DifPresentationExchangeDefinition","presentationSubmission","presentationSubmission: DifPresentationExchangeSubmission","suitableAlgorithms: Array<string> | undefined","inputDescriptorAlgorithms: Array<Array<string>>","w3cQuery: Array<Query<W3cCredentialRecord>>","sdJwtVcQuery: Array<Query<SdJwtVcRecord>>","mdocQuery: Array<Query<MdocRecord>>","allRecords: Array<SdJwtVcRecord | W3cCredentialRecord | MdocRecord>"],"sources":["../../../src/modules/dif-presentation-exchange/DifPresentationExchangeService.ts"],"sourcesContent":["import type { Checked, PresentationSignCallBackParams, Validated, VerifiablePresentationResult } from '@animo-id/pex'\nimport { PEX, Status } from '@animo-id/pex'\nimport type { InputDescriptorV2 } from '@sphereon/pex-models'\nimport type {\n SdJwtDecodedVerifiableCredential,\n W3CVerifiablePresentation as SphereonW3cVerifiablePresentation,\n W3CVerifiablePresentation,\n} from '@sphereon/ssi-types'\nimport type { AgentContext } from '../../agent'\nimport type { Query } from '../../storage/StorageService'\nimport type { VerificationMethod } from '../dids'\nimport type { SdJwtVcRecord } from '../sd-jwt-vc'\nimport type { W3cCredentialRecord, W3cJsonPresentation } from '../vc'\nimport type { IAnonCredsDataIntegrityService } from '../vc/data-integrity/models/IAnonCredsDataIntegrityService'\nimport type {\n DifPexCredentialsForRequest,\n DifPexInputDescriptorToCredentials,\n DifPresentationExchangeDefinition,\n DifPresentationExchangeDefinitionV1,\n DifPresentationExchangeDefinitionV2,\n DifPresentationExchangeSubmission,\n VerifiablePresentation,\n} from './models'\nimport type { PresentationToCreate } from './utils'\n\nimport { injectable } from 'tsyringe'\n\nimport { CredoError } from '../../error'\nimport { JsonTransformer } from '../../utils'\nimport { DidsApi, getPublicJwkFromVerificationMethod } from '../dids'\nimport { Mdoc, MdocApi, MdocRecord, type MdocSessionTranscriptOptions } from '../mdoc'\nimport { MdocDeviceResponse } from '../mdoc/MdocDeviceResponse'\nimport { SdJwtVcApi } from '../sd-jwt-vc'\nimport {\n ClaimFormat,\n SignatureSuiteRegistry,\n W3cCredentialRepository,\n W3cCredentialService,\n W3cPresentation,\n} from '../vc'\nimport {\n ANONCREDS_DATA_INTEGRITY_CRYPTOSUITE,\n AnonCredsDataIntegrityServiceSymbol,\n} from '../vc/data-integrity/models/IAnonCredsDataIntegrityService'\n\nimport { PEVersion, type PartialSdJwtDecodedVerifiableCredential } from '@animo-id/pex/dist/main/lib/index.js'\nimport { getJwkHumanDescription } from '../kms'\nimport { purposes } from '../vc/data-integrity/libraries/jsonld-signatures'\nimport { DifPresentationExchangeError } from './DifPresentationExchangeError'\nimport { DifPresentationExchangeSubmissionLocation } from './models'\nimport {\n getCredentialsForRequest,\n getPresentationsToCreate,\n getSphereonOriginalVerifiableCredential,\n getSphereonOriginalVerifiablePresentation,\n getVerifiablePresentationFromEncoded,\n} from './utils'\n\n/**\n * @todo create a public api for using dif presentation exchange\n */\n@injectable()\nexport class DifPresentationExchangeService {\n private pex = new PEX()\n\n public constructor(private w3cCredentialService: W3cCredentialService) {}\n\n public async getCredentialsForRequest(\n agentContext: AgentContext,\n presentationDefinition: DifPresentationExchangeDefinition\n ): Promise<DifPexCredentialsForRequest> {\n const credentialRecords = await this.queryCredentialForPresentationDefinition(agentContext, presentationDefinition)\n return getCredentialsForRequest(this.pex, presentationDefinition, credentialRecords)\n }\n\n /**\n * Selects the credentials to use based on the output from `getCredentialsForRequest`\n * Use this method if you don't want to manually select the credentials yourself.\n */\n public selectCredentialsForRequest(\n credentialsForRequest: DifPexCredentialsForRequest\n ): DifPexInputDescriptorToCredentials {\n if (!credentialsForRequest.areRequirementsSatisfied) {\n throw new CredoError('Could not find the required credentials for the presentation submission')\n }\n\n const credentials: DifPexInputDescriptorToCredentials = {}\n\n for (const requirement of credentialsForRequest.requirements) {\n // Take needsCount entries from the submission entry\n for (const submission of requirement.submissionEntry.slice(0, requirement.needsCount)) {\n if (!credentials[submission.inputDescriptorId]) {\n credentials[submission.inputDescriptorId] = []\n }\n\n // We pick the first matching VC if we are auto-selecting\n credentials[submission.inputDescriptorId].push(submission.verifiableCredentials[0])\n }\n }\n\n return credentials\n }\n\n public validatePresentationDefinition(presentationDefinition: DifPresentationExchangeDefinition) {\n const validation = PEX.validateDefinition(presentationDefinition)\n const errorMessages = this.formatValidated(validation)\n\n if (errorMessages.length > 0) {\n throw new DifPresentationExchangeError('Invalid presentation definition', { additionalMessages: errorMessages })\n }\n }\n\n public validatePresentationSubmission(presentationSubmission: DifPresentationExchangeSubmission) {\n const validation = PEX.validateSubmission(presentationSubmission)\n const errorMessages = this.formatValidated(validation)\n if (errorMessages.length > 0) {\n throw new DifPresentationExchangeError('Invalid presentation submission', { additionalMessages: errorMessages })\n }\n }\n\n public validatePresentation(\n presentationDefinition: DifPresentationExchangeDefinition,\n presentations: VerifiablePresentation | VerifiablePresentation[],\n presentationSubmission?: DifPresentationExchangeSubmission\n ) {\n const result = this.pex.evaluatePresentation(\n presentationDefinition,\n Array.isArray(presentations)\n ? presentations.map(getSphereonOriginalVerifiablePresentation)\n : getSphereonOriginalVerifiablePresentation(presentations),\n {\n limitDisclosureSignatureSuites: ['DataIntegrityProof.anoncreds-2023'],\n presentationSubmission,\n }\n )\n\n if (result.areRequiredCredentialsPresent === Status.ERROR) {\n const errorMessages = this.formatValidated(result.errors)\n throw new DifPresentationExchangeError('Invalid presentation', { additionalMessages: errorMessages })\n }\n }\n\n private formatValidated(v?: Checked[] | Validated) {\n const validated = Array.isArray(v) ? v : v ? [v] : []\n return validated\n .filter((r) => r.status === Status.ERROR)\n .map((r) => r.message)\n .filter((r): r is string => Boolean(r))\n }\n\n public async createPresentation(\n agentContext: AgentContext,\n options: {\n credentialsForInputDescriptor: DifPexInputDescriptorToCredentials\n presentationDefinition: DifPresentationExchangeDefinition\n /**\n * Defaults to {@link DifPresentationExchangeSubmissionLocation.PRESENTATION}\n */\n presentationSubmissionLocation?: DifPresentationExchangeSubmissionLocation\n /**\n * Also known as `nonce`\n */\n challenge: string\n\n /**\n * Also known as `audience`\n */\n domain?: string\n\n /**\n * Mdoc openid4vp specific options\n */\n mdocSessionTranscript?: MdocSessionTranscriptOptions\n }\n ) {\n const { presentationDefinition, domain, challenge, mdocSessionTranscript } = options\n const presentationSubmissionLocation =\n options.presentationSubmissionLocation ?? DifPresentationExchangeSubmissionLocation.PRESENTATION\n\n const verifiablePresentationResultsWithFormat: Array<{\n verifiablePresentationResult: VerifiablePresentationResult\n claimFormat: PresentationToCreate['claimFormat']\n }> = []\n\n const presentationsToCreate = getPresentationsToCreate(options.credentialsForInputDescriptor)\n for (const presentationToCreate of presentationsToCreate) {\n // We create a presentation for each subject\n // Thus for each subject we need to filter all the related input descriptors and credentials\n // FIXME: cast to V1, as tsc errors for strange reasons if not\n const inputDescriptorIds = presentationToCreate.verifiableCredentials.map((c) => c.inputDescriptorId)\n const inputDescriptorsForPresentation = (\n presentationDefinition as DifPresentationExchangeDefinitionV1\n ).input_descriptors.filter((inputDescriptor) => inputDescriptorIds.includes(inputDescriptor.id))\n\n const presentationDefinitionForSubject: DifPresentationExchangeDefinition = {\n ...presentationDefinition,\n input_descriptors: inputDescriptorsForPresentation,\n\n // We remove the submission requirements, as it will otherwise fail to create the VP\n submission_requirements: undefined,\n }\n\n if (presentationToCreate.claimFormat === ClaimFormat.MsoMdoc) {\n if (presentationToCreate.verifiableCredentials.length !== 1) {\n throw new DifPresentationExchangeError(\n 'Currently a Mdoc presentation can only be created from a single credential'\n )\n }\n const mdocRecord = presentationToCreate.verifiableCredentials[0].credential\n if (!mdocSessionTranscript) {\n throw new DifPresentationExchangeError(\n 'Missing mdoc session transcript options for creating MDOC presentation.'\n )\n }\n\n const { deviceResponseBase64Url, presentationSubmission } =\n await MdocDeviceResponse.createPresentationDefinitionDeviceResponse(agentContext, {\n mdocs: [Mdoc.fromBase64Url(mdocRecord.base64Url)],\n presentationDefinition: presentationDefinition,\n sessionTranscriptOptions: mdocSessionTranscript,\n })\n\n if (presentationSubmissionLocation !== DifPresentationExchangeSubmissionLocation.EXTERNAL) {\n throw new DifPresentationExchangeError(\n 'Only EXTERNAL DifPresentationExchangeSubmissionLocation supported for mdoc presentations'\n )\n }\n\n verifiablePresentationResultsWithFormat.push({\n verifiablePresentationResult: {\n presentationSubmission: presentationSubmission,\n verifiablePresentations: [deviceResponseBase64Url],\n presentationSubmissionLocation,\n },\n claimFormat: presentationToCreate.claimFormat,\n })\n } else {\n // Get all the credentials for the presentation\n const credentialsForPresentation = presentationToCreate.verifiableCredentials.map((c) =>\n getSphereonOriginalVerifiableCredential(c.credential)\n )\n\n const verifiablePresentationResult = await this.pex.verifiablePresentationFrom(\n presentationDefinitionForSubject,\n credentialsForPresentation,\n this.getPresentationSignCallback(agentContext, presentationToCreate),\n {\n proofOptions: {\n challenge,\n domain,\n },\n signatureOptions: {},\n presentationSubmissionLocation,\n }\n )\n\n verifiablePresentationResultsWithFormat.push({\n verifiablePresentationResult,\n claimFormat: presentationToCreate.claimFormat,\n })\n }\n }\n\n if (verifiablePresentationResultsWithFormat.length === 0) {\n throw new DifPresentationExchangeError('No verifiable presentations created')\n }\n\n if (presentationsToCreate.length !== verifiablePresentationResultsWithFormat.length) {\n throw new DifPresentationExchangeError('Invalid amount of verifiable presentations created')\n }\n\n const presentationSubmission: DifPresentationExchangeSubmission = {\n id: verifiablePresentationResultsWithFormat[0].verifiablePresentationResult.presentationSubmission.id,\n definition_id:\n verifiablePresentationResultsWithFormat[0].verifiablePresentationResult.presentationSubmission.definition_id,\n descriptor_map: [],\n }\n\n verifiablePresentationResultsWithFormat.forEach(({ verifiablePresentationResult }, index) => {\n const descriptorMap = verifiablePresentationResult.presentationSubmission.descriptor_map.map((d) => {\n const descriptor = { ...d }\n\n // when multiple presentations are submitted, path should be $[0], $[1]\n // FIXME: this should be addressed in the PEX/OID4VP lib.\n // See https://github.com/Sphereon-Opensource/SIOP-OID4VP/issues/62\n if (\n presentationSubmissionLocation === DifPresentationExchangeSubmissionLocation.EXTERNAL &&\n verifiablePresentationResultsWithFormat.length > 1\n ) {\n descriptor.path = `$[${index}]`\n }\n\n return descriptor\n })\n\n presentationSubmission.descriptor_map.push(...descriptorMap)\n })\n\n return {\n verifiablePresentations: verifiablePresentationResultsWithFormat.flatMap((resultWithFormat) =>\n resultWithFormat.verifiablePresentationResult.verifiablePresentations.map((vp) =>\n getVerifiablePresentationFromEncoded(agentContext, vp)\n )\n ),\n encodedVerifiablePresentations: verifiablePresentationResultsWithFormat.flatMap(\n (resultWithFormat) =>\n resultWithFormat.verifiablePresentationResult.verifiablePresentations as unknown as (\n | string\n | W3cJsonPresentation\n )[]\n ),\n presentationSubmission,\n presentationSubmissionLocation:\n verifiablePresentationResultsWithFormat[0].verifiablePresentationResult.presentationSubmissionLocation,\n }\n }\n\n private getSigningAlgorithmFromVerificationMethod(\n verificationMethod: VerificationMethod,\n suitableAlgorithms?: Array<string>\n ) {\n const publicJwk = getPublicJwkFromVerificationMethod(verificationMethod)\n\n if (suitableAlgorithms) {\n const possibleAlgorithms = publicJwk.supportedSignatureAlgorithms.filter((alg) =>\n suitableAlgorithms?.includes(alg)\n )\n if (!possibleAlgorithms || possibleAlgorithms.length === 0) {\n throw new DifPresentationExchangeError(\n [\n 'Found no suitable signing algorithm.',\n `Algorithms supported by Verification method: ${publicJwk.supportedSignatureAlgorithms.join(', ')}`,\n `Suitable algorithms: ${suitableAlgorithms.join(', ')}`,\n ].join('\\n')\n )\n }\n\n return possibleAlgorithms[0]\n }\n\n return publicJwk.signatureAlgorithm\n }\n\n private getSigningAlgorithmsForPresentationDefinitionAndInputDescriptors(\n algorithmsSatisfyingDefinition: Array<string>,\n inputDescriptorAlgorithms: Array<Array<string>>\n ) {\n const allDescriptorAlgorithms = inputDescriptorAlgorithms.flat()\n const algorithmsSatisfyingDescriptors = allDescriptorAlgorithms.filter((alg) =>\n inputDescriptorAlgorithms.every((descriptorAlgorithmSet) => descriptorAlgorithmSet.includes(alg))\n )\n\n const algorithmsSatisfyingPdAndDescriptorRestrictions = algorithmsSatisfyingDefinition.filter((alg) =>\n algorithmsSatisfyingDescriptors.includes(alg)\n )\n\n if (\n algorithmsSatisfyingDefinition.length > 0 &&\n algorithmsSatisfyingDescriptors.length > 0 &&\n algorithmsSatisfyingPdAndDescriptorRestrictions.length === 0\n ) {\n throw new DifPresentationExchangeError(\n 'No signature algorithm found for satisfying restrictions of the presentation definition and input descriptors'\n )\n }\n\n if (allDescriptorAlgorithms.length > 0 && algorithmsSatisfyingDescriptors.length === 0) {\n throw new DifPresentationExchangeError(\n 'No signature algorithm found for satisfying restrictions of the input descriptors'\n )\n }\n\n let suitableAlgorithms: Array<string> | undefined\n if (algorithmsSatisfyingPdAndDescriptorRestrictions.length > 0) {\n suitableAlgorithms = algorithmsSatisfyingPdAndDescriptorRestrictions\n } else if (algorithmsSatisfyingDescriptors.length > 0) {\n suitableAlgorithms = algorithmsSatisfyingDescriptors\n } else if (algorithmsSatisfyingDefinition.length > 0) {\n suitableAlgorithms = algorithmsSatisfyingDefinition\n }\n\n return suitableAlgorithms\n }\n\n private getSigningAlgorithmForJwtVc(\n presentationDefinition: DifPresentationExchangeDefinitionV1 | DifPresentationExchangeDefinitionV2,\n verificationMethod: VerificationMethod\n ) {\n const algorithmsSatisfyingDefinition = presentationDefinition.format?.jwt_vc?.alg ?? []\n\n const inputDescriptorAlgorithms: Array<Array<string>> = presentationDefinition.input_descriptors\n .map((descriptor) => (descriptor as InputDescriptorV2).format?.jwt_vc?.alg ?? [])\n .filter((alg) => alg.length > 0)\n\n const suitableAlgorithms = this.getSigningAlgorithmsForPresentationDefinitionAndInputDescriptors(\n algorithmsSatisfyingDefinition,\n inputDescriptorAlgorithms\n )\n\n return this.getSigningAlgorithmFromVerificationMethod(verificationMethod, suitableAlgorithms)\n }\n\n private getProofTypeForLdpVc(\n agentContext: AgentContext,\n presentationDefinition: DifPresentationExchangeDefinitionV1 | DifPresentationExchangeDefinitionV2,\n verificationMethod: VerificationMethod\n ) {\n const algorithmsSatisfyingDefinition = presentationDefinition.format?.ldp_vc?.proof_type ?? []\n\n const inputDescriptorAlgorithms: Array<Array<string>> = presentationDefinition.input_descriptors\n .map((descriptor) => (descriptor as InputDescriptorV2).format?.ldp_vc?.proof_type ?? [])\n .filter((alg) => alg.length > 0)\n\n const suitableSignatureSuites = this.getSigningAlgorithmsForPresentationDefinitionAndInputDescriptors(\n algorithmsSatisfyingDefinition,\n inputDescriptorAlgorithms\n )\n\n // For each of the supported algs, find the key types, then find the proof types\n const signatureSuiteRegistry = agentContext.dependencyManager.resolve(SignatureSuiteRegistry)\n\n const publicJwk = getPublicJwkFromVerificationMethod(verificationMethod)\n const supportedSignatureSuites = signatureSuiteRegistry.getAllByPublicJwkType(publicJwk)\n if (supportedSignatureSuites.length === 0) {\n throw new DifPresentationExchangeError(\n `Couldn't find a supported signature suite for the given jwk ${getJwkHumanDescription(publicJwk.toJson())}`\n )\n }\n\n if (suitableSignatureSuites) {\n const foundSignatureSuite = supportedSignatureSuites.find((suite) =>\n suitableSignatureSuites.includes(suite.proofType)\n )\n\n if (!foundSignatureSuite) {\n throw new DifPresentationExchangeError(\n [\n 'No possible signature suite found for the given verification method.',\n `Verification method type: ${verificationMethod.type}`,\n `jwk type: ${getJwkHumanDescription(publicJwk.toJson())}`,\n `SupportedSignatureSuites: '${supportedSignatureSuites.map((s) => s.proofType).join(', ')}'`,\n `SuitableSignatureSuites: ${suitableSignatureSuites.join(', ')}`,\n ].join('\\n')\n )\n }\n\n return supportedSignatureSuites[0].proofType\n }\n\n return supportedSignatureSuites[0].proofType\n }\n\n /**\n * if all submission descriptors have a format of di | ldp,\n * and all credentials have an ANONCREDS_DATA_INTEGRITY proof we default to\n * signing the presentation using the ANONCREDS_DATA_INTEGRITY_CRYPTOSUITE\n */\n private shouldSignUsingAnonCredsDataIntegrity(\n presentationToCreate: PresentationToCreate,\n presentationSubmission: DifPresentationExchangeSubmission\n ) {\n if (presentationToCreate.claimFormat !== ClaimFormat.LdpVp) return undefined\n\n const validDescriptorFormat = presentationSubmission.descriptor_map.every((descriptor) =>\n [ClaimFormat.DiVc, ClaimFormat.DiVp, ClaimFormat.LdpVc, ClaimFormat.LdpVp].includes(\n descriptor.format as ClaimFormat\n )\n )\n\n const credentialAreSignedUsingAnonCredsDataIntegrity = presentationToCreate.verifiableCredentials.every(\n ({ credential }) => {\n if (credential.credential.claimFormat !== ClaimFormat.LdpVc) return false\n return credential.credential.dataIntegrityCryptosuites.includes(ANONCREDS_DATA_INTEGRITY_CRYPTOSUITE)\n }\n )\n\n return validDescriptorFormat && credentialAreSignedUsingAnonCredsDataIntegrity\n }\n\n private getPresentationSignCallback(agentContext: AgentContext, presentationToCreate: PresentationToCreate) {\n return async (callBackParams: PresentationSignCallBackParams) => {\n // The created partial proof and presentation, as well as original supplied options\n const {\n presentation: presentationInput,\n options,\n presentationDefinition,\n presentationSubmission,\n } = callBackParams\n const { challenge, domain } = options.proofOptions ?? {}\n\n if (!challenge) {\n throw new CredoError('challenge MUST be provided when signing a Verifiable Presentation')\n }\n\n if (presentationToCreate.claimFormat === ClaimFormat.JwtVp) {\n if (!presentationToCreate.subjectIds) {\n throw new DifPresentationExchangeError('Cannot create presentation for credentials without subject id')\n }\n\n // Determine a suitable verification method for the presentation\n const verificationMethod = await this.getVerificationMethodForSubjectId(\n agentContext,\n presentationToCreate.subjectIds[0]\n )\n\n const w3cPresentation = JsonTransformer.fromJSON(presentationInput, W3cPresentation)\n w3cPresentation.holder = verificationMethod.controller\n\n const signedPresentation = await this.w3cCredentialService.signPresentation<ClaimFormat.JwtVp>(agentContext, {\n format: ClaimFormat.JwtVp,\n alg: this.getSigningAlgorithmForJwtVc(presentationDefinition, verificationMethod),\n verificationMethod: verificationMethod.id,\n presentation: w3cPresentation,\n challenge,\n domain,\n })\n\n return signedPresentation.encoded as W3CVerifiablePresentation\n }\n if (presentationToCreate.claimFormat === ClaimFormat.LdpVp) {\n if (this.shouldSignUsingAnonCredsDataIntegrity(presentationToCreate, presentationSubmission)) {\n // make sure the descriptors format properties are set correctly\n presentationSubmission.descriptor_map = presentationSubmission.descriptor_map.map((descriptor) => ({\n ...descriptor,\n format: 'di_vp',\n }))\n const anoncredsDataIntegrityService = agentContext.dependencyManager.resolve<IAnonCredsDataIntegrityService>(\n AnonCredsDataIntegrityServiceSymbol\n )\n const presentation = await anoncredsDataIntegrityService.createPresentation(agentContext, {\n presentationDefinition,\n presentationSubmission,\n selectedCredentialRecords: presentationToCreate.verifiableCredentials.map((vc) => vc.credential),\n challenge,\n })\n return {\n ...presentation.toJSON(),\n presentation_submission: presentationSubmission,\n } as unknown as SphereonW3cVerifiablePresentation\n }\n\n if (!presentationToCreate.subjectIds) {\n throw new DifPresentationExchangeError('Cannot create presentation for credentials without subject id')\n }\n // Determine a suitable verification method for the presentation\n const verificationMethod = await this.getVerificationMethodForSubjectId(\n agentContext,\n presentationToCreate.subjectIds[0]\n )\n\n const w3cPresentation = JsonTransformer.fromJSON(presentationInput, W3cPresentation)\n w3cPresentation.holder = verificationMethod.controller\n\n const signedPresentation = await this.w3cCredentialService.signPresentation(agentContext, {\n format: ClaimFormat.LdpVp,\n // TODO: we should move the check for which proof to use for a presentation to earlier\n // as then we know when determining which VPs to submit already if the proof types are supported\n // by the verifier, and we can then just add this to the vpToCreate interface\n proofType: this.getProofTypeForLdpVc(agentContext, presentationDefinition, verificationMethod),\n proofPurpose: new purposes.AuthenticationProofPurpose({ challenge, domain }),\n verificationMethod: verificationMethod.id,\n presentation: w3cPresentation,\n challenge,\n domain,\n })\n\n return signedPresentation.encoded as W3CVerifiablePresentation\n }\n if (presentationToCreate.claimFormat === ClaimFormat.SdJwtDc) {\n const sdJwtInput = presentationInput as\n | SdJwtDecodedVerifiableCredential\n | PartialSdJwtDecodedVerifiableCredential\n\n if (!domain) {\n throw new CredoError(\"Missing 'domain' property, unable to set required 'aud' property in SD-JWT KB-JWT\")\n }\n\n const sdJwtVcApi = this.getSdJwtVcApi(agentContext)\n const sdJwtVc = await sdJwtVcApi.present({\n compactSdJwtVc: sdJwtInput.compactSdJwtVc,\n // SD is already handled by PEX, so we presents all keys\n presentationFrame: undefined,\n verifierMetadata: {\n audience: domain,\n nonce: challenge,\n // TODO: we should make this optional\n issuedAt: Math.floor(Date.now() / 1000),\n },\n additionalPayload: presentationToCreate.verifiableCredentials[0].additionalPayload,\n })\n\n return sdJwtVc\n }\n throw new DifPresentationExchangeError(\n 'Only JWT, SD-JWT-VC, JSONLD credentials are supported for a single presentation'\n )\n }\n }\n\n private async getVerificationMethodForSubjectId(agentContext: AgentContext, subjectId: string) {\n const didsApi = agentContext.dependencyManager.resolve(DidsApi)\n\n if (!subjectId.startsWith('did:')) {\n throw new DifPresentationExchangeError(\n `Only dids are supported as credentialSubject id. ${subjectId} is not a valid did`\n )\n }\n\n const didDocument = await didsApi.resolveDidDocument(subjectId)\n\n if (!didDocument.authentication || didDocument.authentication.length === 0) {\n throw new DifPresentationExchangeError(\n `No authentication verificationMethods found for did ${subjectId} in did document`\n )\n }\n\n // the signature suite to use for the presentation is dependant on the credentials we share.\n // 1. Get the verification method for this given proof purpose in this DID document\n let [verificationMethod] = didDocument.authentication\n if (typeof verificationMethod === 'string') {\n verificationMethod = didDocument.dereferenceKey(verificationMethod, ['authentication'])\n }\n\n return verificationMethod\n }\n\n /**\n * Queries the wallet for credentials that match the given presentation definition. This only does an initial query based on the\n * schema of the input descriptors. It does not do any further filtering based on the constraints in the input descriptors.\n */\n private async queryCredentialForPresentationDefinition(\n agentContext: AgentContext,\n presentationDefinition: DifPresentationExchangeDefinition\n ): Promise<Array<SdJwtVcRecord | W3cCredentialRecord | MdocRecord>> {\n const w3cCredentialRepository = agentContext.dependencyManager.resolve(W3cCredentialRepository)\n const w3cQuery: Array<Query<W3cCredentialRecord>> = []\n const sdJwtVcQuery: Array<Query<SdJwtVcRecord>> = []\n const mdocQuery: Array<Query<MdocRecord>> = []\n\n const presentationDefinitionVersion = PEX.definitionVersionDiscovery(presentationDefinition)\n\n if (!presentationDefinitionVersion.version) {\n throw new DifPresentationExchangeError(\n 'Unable to determine the Presentation Exchange version from the presentation definition',\n presentationDefinitionVersion.error ? { additionalMessages: [presentationDefinitionVersion.error] } : {}\n )\n }\n\n // FIXME: in the query we should take into account the supported proof types of the verifier\n // this could help enormously in the amount of credentials we have to retrieve from storage.\n if (presentationDefinitionVersion.version === PEVersion.v1) {\n const pd = presentationDefinition as DifPresentationExchangeDefinitionV1\n\n // The schema.uri can contain either an expanded type, or a context uri\n for (const inputDescriptor of pd.input_descriptors) {\n for (const schema of inputDescriptor.schema) {\n sdJwtVcQuery.push({\n vct: schema.uri,\n })\n w3cQuery.push({\n $or: [{ expandedTypes: [schema.uri] }, { contexts: [schema.uri] }, { types: [schema.uri] }],\n })\n mdocQuery.push({\n docType: inputDescriptor.id,\n })\n }\n }\n } else if (presentationDefinitionVersion.version === PEVersion.v2) {\n // FIXME: As PE version 2 does not have the `schema` anymore, we can't query by schema anymore.\n // We probably need\n // to find some way to do initial filtering, hopefully if there's a filter on the `type` field or something.\n } else {\n throw new DifPresentationExchangeError(\n `Unsupported presentation definition version ${presentationDefinitionVersion.version as unknown as string}`\n )\n }\n\n const allRecords: Array<SdJwtVcRecord | W3cCredentialRecord | MdocRecord> = []\n\n // query the wallet ourselves first to avoid the need to query the pex library for all\n // credentials for every proof request\n const w3cCredentialRecords =\n w3cQuery.length > 0\n ? await w3cCredentialRepository.findByQuery(agentContext, { $or: w3cQuery })\n : await w3cCredentialRepository.getAll(agentContext)\n allRecords.push(...w3cCredentialRecords)\n\n const sdJwtVcApi = this.getSdJwtVcApi(agentContext)\n const sdJwtVcRecords =\n sdJwtVcQuery.length > 0 ? await sdJwtVcApi.findAllByQuery({ $or: sdJwtVcQuery }) : await sdJwtVcApi.getAll()\n allRecords.push(...sdJwtVcRecords)\n\n const mdocApi = this.getMdocApi(agentContext)\n const mdocRecords = mdocQuery.length > 0 ? await mdocApi.findAllByQuery({ $or: mdocQuery }) : await mdocApi.getAll()\n allRecords.push(...mdocRecords)\n\n return allRecords\n }\n\n private getSdJwtVcApi(agentContext: AgentContext) {\n return agentContext.dependencyManager.resolve(SdJwtVcApi)\n }\n\n private getMdocApi(agentContext: AgentContext) {\n return agentContext.dependencyManager.resolve(MdocApi)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DO,2CAAMA,iCAA+B;CAG1C,AAAO,YAAY,AAAQC,sBAA4C;EAA5C;OAFnB,MAAM,IAAI,KAAK;;CAIvB,MAAa,yBACX,cACA,wBACsC;EACtC,MAAM,oBAAoB,MAAM,KAAK,yCAAyC,cAAc,uBAAuB;AACnH,SAAO,yBAAyB,KAAK,KAAK,wBAAwB,kBAAkB;;;;;;CAOtF,AAAO,4BACL,uBACoC;AACpC,MAAI,CAAC,sBAAsB,yBACzB,OAAM,IAAI,WAAW,0EAA0E;EAGjG,MAAMC,cAAkD,EAAE;AAE1D,OAAK,MAAM,eAAe,sBAAsB,aAE9C,MAAK,MAAM,cAAc,YAAY,gBAAgB,MAAM,GAAG,YAAY,WAAW,EAAE;AACrF,OAAI,CAAC,YAAY,WAAW,mBAC1B,aAAY,WAAW,qBAAqB,EAAE;AAIhD,eAAY,WAAW,mBAAmB,KAAK,WAAW,sBAAsB,GAAG;;AAIvF,SAAO;;CAGT,AAAO,+BAA+B,wBAA2D;EAC/F,MAAM,aAAa,IAAI,mBAAmB,uBAAuB;EACjE,MAAM,gBAAgB,KAAK,gBAAgB,WAAW;AAEtD,MA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aAAW,KAAK,GAAG,qBAAqB;EAExC,MAAM,aAAa,KAAK,cAAc,aAAa;EACnD,MAAM,iBACJ,aAAa,SAAS,IAAI,MAAM,WAAW,eAAe,EAAE,KAAK,cAAc,CAAC,GAAG,MAAM,WAAW,QAAQ;AAC9G,aAAW,KAAK,GAAG,eAAe;EAElC,MAAM,UAAU,KAAK,WAAW,aAAa;EAC7C,MAAM,cAAc,UAAU,SAAS,IAAI,MAAM,QAAQ,eAAe,EAAE,KAAK,WAAW,CAAC,GAAG,MAAM,QAAQ,QAAQ;AACpH,aAAW,KAAK,GAAG,YAAY;AAE/B,SAAO;;CAGT,AAAQ,cAAc,cAA4B;AAChD,SAAO,aAAa,kBAAkB,QAAQ,WAAW;;CAG3D,AAAQ,WAAW,cAA4B;AAC7C,SAAO,aAAa,kBAAkB,QAAQ,QAAQ;;;6CAnoBzD,YAAY"}
|
|
1
|
+
{"version":3,"file":"DifPresentationExchangeService.mjs","names":["DifPresentationExchangeService","w3cCredentialService: W3cCredentialService","credentials: DifPexInputDescriptorToCredentials","DifPresentationExchangeSubmissionLocation","verifiablePresentationResultsWithFormat: Array<{\n verifiablePresentationResult: VerifiablePresentationResult\n claimFormat: PresentationToCreate['claimFormat']\n }>","presentationDefinitionForSubject: DifPresentationExchangeDefinition","presentationSubmission","presentationSubmission: DifPresentationExchangeSubmission","suitableAlgorithms: Array<string> | undefined","inputDescriptorAlgorithms: Array<Array<string>>","w3cQuery: Array<Query<W3cCredentialRecord>>","sdJwtVcQuery: Array<Query<SdJwtVcRecord>>","mdocQuery: Array<Query<MdocRecord>>","allRecords: Array<SdJwtVcRecord | W3cCredentialRecord | MdocRecord>"],"sources":["../../../src/modules/dif-presentation-exchange/DifPresentationExchangeService.ts"],"sourcesContent":["import type { Checked, PresentationSignCallBackParams, Validated, VerifiablePresentationResult } from '@animo-id/pex'\nimport { PEX, Status } from '@animo-id/pex'\nimport { type PartialSdJwtDecodedVerifiableCredential, PEVersion } from '@animo-id/pex/dist/main/lib/index.js'\nimport type { InputDescriptorV2 } from '@sphereon/pex-models'\nimport type {\n SdJwtDecodedVerifiableCredential,\n W3CVerifiablePresentation as SphereonW3cVerifiablePresentation,\n W3CVerifiablePresentation,\n} from '@sphereon/ssi-types'\nimport { injectable } from 'tsyringe'\nimport type { AgentContext } from '../../agent'\nimport { CredoError } from '../../error'\nimport type { Query } from '../../storage/StorageService'\nimport { JsonTransformer } from '../../utils'\nimport type { VerificationMethod } from '../dids'\nimport { DidsApi, getPublicJwkFromVerificationMethod } from '../dids'\nimport { getJwkHumanDescription } from '../kms'\nimport { Mdoc, MdocApi, MdocRecord, type MdocSessionTranscriptOptions } from '../mdoc'\nimport { MdocDeviceResponse } from '../mdoc/MdocDeviceResponse'\nimport type { SdJwtVcRecord } from '../sd-jwt-vc'\nimport { SdJwtVcApi } from '../sd-jwt-vc'\nimport type { W3cCredentialRecord, W3cJsonPresentation } from '../vc'\nimport {\n ClaimFormat,\n SignatureSuiteRegistry,\n W3cCredentialRepository,\n W3cCredentialService,\n W3cPresentation,\n} from '../vc'\nimport { purposes } from '../vc/data-integrity/libraries/jsonld-signatures'\nimport type { IAnonCredsDataIntegrityService } from '../vc/data-integrity/models/IAnonCredsDataIntegrityService'\nimport {\n ANONCREDS_DATA_INTEGRITY_CRYPTOSUITE,\n AnonCredsDataIntegrityServiceSymbol,\n} from '../vc/data-integrity/models/IAnonCredsDataIntegrityService'\nimport { DifPresentationExchangeError } from './DifPresentationExchangeError'\nimport type {\n DifPexCredentialsForRequest,\n DifPexInputDescriptorToCredentials,\n DifPresentationExchangeDefinition,\n DifPresentationExchangeDefinitionV1,\n DifPresentationExchangeDefinitionV2,\n DifPresentationExchangeSubmission,\n VerifiablePresentation,\n} from './models'\nimport { DifPresentationExchangeSubmissionLocation } from './models'\nimport type { PresentationToCreate } from './utils'\nimport {\n getCredentialsForRequest,\n getPresentationsToCreate,\n getSphereonOriginalVerifiableCredential,\n getSphereonOriginalVerifiablePresentation,\n getVerifiablePresentationFromEncoded,\n} from './utils'\n\n/**\n * @todo create a public api for using dif presentation exchange\n */\n@injectable()\nexport class DifPresentationExchangeService {\n private pex = new PEX()\n\n public constructor(private w3cCredentialService: W3cCredentialService) {}\n\n public async getCredentialsForRequest(\n agentContext: AgentContext,\n presentationDefinition: DifPresentationExchangeDefinition\n ): Promise<DifPexCredentialsForRequest> {\n const credentialRecords = await this.queryCredentialForPresentationDefinition(agentContext, presentationDefinition)\n return getCredentialsForRequest(this.pex, presentationDefinition, credentialRecords)\n }\n\n /**\n * Selects the credentials to use based on the output from `getCredentialsForRequest`\n * Use this method if you don't want to manually select the credentials yourself.\n */\n public selectCredentialsForRequest(\n credentialsForRequest: DifPexCredentialsForRequest\n ): DifPexInputDescriptorToCredentials {\n if (!credentialsForRequest.areRequirementsSatisfied) {\n throw new CredoError('Could not find the required credentials for the presentation submission')\n }\n\n const credentials: DifPexInputDescriptorToCredentials = {}\n\n for (const requirement of credentialsForRequest.requirements) {\n // Take needsCount entries from the submission entry\n for (const submission of requirement.submissionEntry.slice(0, requirement.needsCount)) {\n if (!credentials[submission.inputDescriptorId]) {\n credentials[submission.inputDescriptorId] = []\n }\n\n // We pick the first matching VC if we are auto-selecting\n credentials[submission.inputDescriptorId].push(submission.verifiableCredentials[0])\n }\n }\n\n return credentials\n }\n\n public validatePresentationDefinition(presentationDefinition: DifPresentationExchangeDefinition) {\n const validation = PEX.validateDefinition(presentationDefinition)\n const errorMessages = this.formatValidated(validation)\n\n if (errorMessages.length > 0) {\n throw new DifPresentationExchangeError('Invalid presentation definition', { additionalMessages: errorMessages })\n }\n }\n\n public validatePresentationSubmission(presentationSubmission: DifPresentationExchangeSubmission) {\n const validation = PEX.validateSubmission(presentationSubmission)\n const errorMessages = this.formatValidated(validation)\n if (errorMessages.length > 0) {\n throw new DifPresentationExchangeError('Invalid presentation submission', { additionalMessages: errorMessages })\n }\n }\n\n public validatePresentation(\n presentationDefinition: DifPresentationExchangeDefinition,\n presentations: VerifiablePresentation | VerifiablePresentation[],\n presentationSubmission?: DifPresentationExchangeSubmission\n ) {\n const result = this.pex.evaluatePresentation(\n presentationDefinition,\n Array.isArray(presentations)\n ? presentations.map(getSphereonOriginalVerifiablePresentation)\n : getSphereonOriginalVerifiablePresentation(presentations),\n {\n limitDisclosureSignatureSuites: ['DataIntegrityProof.anoncreds-2023'],\n presentationSubmission,\n }\n )\n\n if (result.areRequiredCredentialsPresent === Status.ERROR) {\n const errorMessages = this.formatValidated(result.errors)\n throw new DifPresentationExchangeError('Invalid presentation', { additionalMessages: errorMessages })\n }\n }\n\n private formatValidated(v?: Checked[] | Validated) {\n const validated = Array.isArray(v) ? v : v ? [v] : []\n return validated\n .filter((r) => r.status === Status.ERROR)\n .map((r) => r.message)\n .filter((r): r is string => Boolean(r))\n }\n\n public async createPresentation(\n agentContext: AgentContext,\n options: {\n credentialsForInputDescriptor: DifPexInputDescriptorToCredentials\n presentationDefinition: DifPresentationExchangeDefinition\n /**\n * Defaults to {@link DifPresentationExchangeSubmissionLocation.PRESENTATION}\n */\n presentationSubmissionLocation?: DifPresentationExchangeSubmissionLocation\n /**\n * Also known as `nonce`\n */\n challenge: string\n\n /**\n * Also known as `audience`\n */\n domain?: string\n\n /**\n * Mdoc openid4vp specific options\n */\n mdocSessionTranscript?: MdocSessionTranscriptOptions\n }\n ) {\n const { presentationDefinition, domain, challenge, mdocSessionTranscript } = options\n const presentationSubmissionLocation =\n options.presentationSubmissionLocation ?? DifPresentationExchangeSubmissionLocation.PRESENTATION\n\n const verifiablePresentationResultsWithFormat: Array<{\n verifiablePresentationResult: VerifiablePresentationResult\n claimFormat: PresentationToCreate['claimFormat']\n }> = []\n\n const presentationsToCreate = getPresentationsToCreate(options.credentialsForInputDescriptor)\n for (const presentationToCreate of presentationsToCreate) {\n // We create a presentation for each subject\n // Thus for each subject we need to filter all the related input descriptors and credentials\n // FIXME: cast to V1, as tsc errors for strange reasons if not\n const inputDescriptorIds = presentationToCreate.verifiableCredentials.map((c) => c.inputDescriptorId)\n const inputDescriptorsForPresentation = (\n presentationDefinition as DifPresentationExchangeDefinitionV1\n ).input_descriptors.filter((inputDescriptor) => inputDescriptorIds.includes(inputDescriptor.id))\n\n const presentationDefinitionForSubject: DifPresentationExchangeDefinition = {\n ...presentationDefinition,\n input_descriptors: inputDescriptorsForPresentation,\n\n // We remove the submission requirements, as it will otherwise fail to create the VP\n submission_requirements: undefined,\n }\n\n if (presentationToCreate.claimFormat === ClaimFormat.MsoMdoc) {\n if (presentationToCreate.verifiableCredentials.length !== 1) {\n throw new DifPresentationExchangeError(\n 'Currently a Mdoc presentation can only be created from a single credential'\n )\n }\n const mdocRecord = presentationToCreate.verifiableCredentials[0].credential\n if (!mdocSessionTranscript) {\n throw new DifPresentationExchangeError(\n 'Missing mdoc session transcript options for creating MDOC presentation.'\n )\n }\n\n const { deviceResponseBase64Url, presentationSubmission } =\n await MdocDeviceResponse.createPresentationDefinitionDeviceResponse(agentContext, {\n mdocs: [Mdoc.fromBase64Url(mdocRecord.base64Url)],\n presentationDefinition: presentationDefinition,\n sessionTranscriptOptions: mdocSessionTranscript,\n })\n\n if (presentationSubmissionLocation !== DifPresentationExchangeSubmissionLocation.EXTERNAL) {\n throw new DifPresentationExchangeError(\n 'Only EXTERNAL DifPresentationExchangeSubmissionLocation supported for mdoc presentations'\n )\n }\n\n verifiablePresentationResultsWithFormat.push({\n verifiablePresentationResult: {\n presentationSubmission: presentationSubmission,\n verifiablePresentations: [deviceResponseBase64Url],\n presentationSubmissionLocation,\n },\n claimFormat: presentationToCreate.claimFormat,\n })\n } else {\n // Get all the credentials for the presentation\n const credentialsForPresentation = presentationToCreate.verifiableCredentials.map((c) =>\n getSphereonOriginalVerifiableCredential(c.credential)\n )\n\n const extraProofOptions = this.shouldSignUsingAnonCredsDataIntegrity(presentationToCreate)\n ? {\n typeSupportsSelectiveDisclosure: true,\n type: `DataIntegrityProof.${ANONCREDS_DATA_INTEGRITY_CRYPTOSUITE}`,\n }\n : {}\n\n const verifiablePresentationResult = await this.pex.verifiablePresentationFrom(\n presentationDefinitionForSubject,\n credentialsForPresentation,\n this.getPresentationSignCallback(agentContext, presentationToCreate),\n {\n proofOptions: {\n challenge,\n domain,\n\n ...extraProofOptions,\n },\n presentationSubmissionLocation,\n }\n )\n\n verifiablePresentationResultsWithFormat.push({\n verifiablePresentationResult,\n claimFormat: presentationToCreate.claimFormat,\n })\n }\n }\n\n if (verifiablePresentationResultsWithFormat.length === 0) {\n throw new DifPresentationExchangeError('No verifiable presentations created')\n }\n\n if (presentationsToCreate.length !== verifiablePresentationResultsWithFormat.length) {\n throw new DifPresentationExchangeError('Invalid amount of verifiable presentations created')\n }\n\n const presentationSubmission: DifPresentationExchangeSubmission = {\n id: verifiablePresentationResultsWithFormat[0].verifiablePresentationResult.presentationSubmission.id,\n definition_id:\n verifiablePresentationResultsWithFormat[0].verifiablePresentationResult.presentationSubmission.definition_id,\n descriptor_map: [],\n }\n\n verifiablePresentationResultsWithFormat.forEach(({ verifiablePresentationResult }, index) => {\n const descriptorMap = verifiablePresentationResult.presentationSubmission.descriptor_map.map((d) => {\n const descriptor = { ...d }\n\n // when multiple presentations are submitted, path should be $[0], $[1]\n // FIXME: this should be addressed in the PEX/OID4VP lib.\n // See https://github.com/Sphereon-Opensource/SIOP-OID4VP/issues/62\n if (\n presentationSubmissionLocation === DifPresentationExchangeSubmissionLocation.EXTERNAL &&\n verifiablePresentationResultsWithFormat.length > 1\n ) {\n descriptor.path = `$[${index}]`\n }\n\n return descriptor\n })\n\n presentationSubmission.descriptor_map.push(...descriptorMap)\n })\n\n return {\n verifiablePresentations: verifiablePresentationResultsWithFormat.flatMap((resultWithFormat) =>\n resultWithFormat.verifiablePresentationResult.verifiablePresentations.map((vp) =>\n getVerifiablePresentationFromEncoded(agentContext, vp)\n )\n ),\n encodedVerifiablePresentations: verifiablePresentationResultsWithFormat.flatMap(\n (resultWithFormat) =>\n resultWithFormat.verifiablePresentationResult.verifiablePresentations as unknown as (\n | string\n | W3cJsonPresentation\n )[]\n ),\n presentationSubmission,\n presentationSubmissionLocation:\n verifiablePresentationResultsWithFormat[0].verifiablePresentationResult.presentationSubmissionLocation,\n }\n }\n\n private getSigningAlgorithmFromVerificationMethod(\n verificationMethod: VerificationMethod,\n suitableAlgorithms?: Array<string>\n ) {\n const publicJwk = getPublicJwkFromVerificationMethod(verificationMethod)\n\n if (suitableAlgorithms) {\n const possibleAlgorithms = publicJwk.supportedSignatureAlgorithms.filter((alg) =>\n suitableAlgorithms?.includes(alg)\n )\n if (!possibleAlgorithms || possibleAlgorithms.length === 0) {\n throw new DifPresentationExchangeError(\n [\n 'Found no suitable signing algorithm.',\n `Algorithms supported by Verification method: ${publicJwk.supportedSignatureAlgorithms.join(', ')}`,\n `Suitable algorithms: ${suitableAlgorithms.join(', ')}`,\n ].join('\\n')\n )\n }\n\n return possibleAlgorithms[0]\n }\n\n return publicJwk.signatureAlgorithm\n }\n\n private getSigningAlgorithmsForPresentationDefinitionAndInputDescriptors(\n algorithmsSatisfyingDefinition: Array<string>,\n inputDescriptorAlgorithms: Array<Array<string>>\n ) {\n const allDescriptorAlgorithms = inputDescriptorAlgorithms.flat()\n const algorithmsSatisfyingDescriptors = allDescriptorAlgorithms.filter((alg) =>\n inputDescriptorAlgorithms.every((descriptorAlgorithmSet) => descriptorAlgorithmSet.includes(alg))\n )\n\n const algorithmsSatisfyingPdAndDescriptorRestrictions = algorithmsSatisfyingDefinition.filter((alg) =>\n algorithmsSatisfyingDescriptors.includes(alg)\n )\n\n if (\n algorithmsSatisfyingDefinition.length > 0 &&\n algorithmsSatisfyingDescriptors.length > 0 &&\n algorithmsSatisfyingPdAndDescriptorRestrictions.length === 0\n ) {\n throw new DifPresentationExchangeError(\n 'No signature algorithm found for satisfying restrictions of the presentation definition and input descriptors'\n )\n }\n\n if (allDescriptorAlgorithms.length > 0 && algorithmsSatisfyingDescriptors.length === 0) {\n throw new DifPresentationExchangeError(\n 'No signature algorithm found for satisfying restrictions of the input descriptors'\n )\n }\n\n let suitableAlgorithms: Array<string> | undefined\n if (algorithmsSatisfyingPdAndDescriptorRestrictions.length > 0) {\n suitableAlgorithms = algorithmsSatisfyingPdAndDescriptorRestrictions\n } else if (algorithmsSatisfyingDescriptors.length > 0) {\n suitableAlgorithms = algorithmsSatisfyingDescriptors\n } else if (algorithmsSatisfyingDefinition.length > 0) {\n suitableAlgorithms = algorithmsSatisfyingDefinition\n }\n\n return suitableAlgorithms\n }\n\n private getSigningAlgorithmForJwtVc(\n presentationDefinition: DifPresentationExchangeDefinitionV1 | DifPresentationExchangeDefinitionV2,\n verificationMethod: VerificationMethod\n ) {\n const algorithmsSatisfyingDefinition = presentationDefinition.format?.jwt_vc?.alg ?? []\n\n const inputDescriptorAlgorithms: Array<Array<string>> = presentationDefinition.input_descriptors\n .map((descriptor) => (descriptor as InputDescriptorV2).format?.jwt_vc?.alg ?? [])\n .filter((alg) => alg.length > 0)\n\n const suitableAlgorithms = this.getSigningAlgorithmsForPresentationDefinitionAndInputDescriptors(\n algorithmsSatisfyingDefinition,\n inputDescriptorAlgorithms\n )\n\n return this.getSigningAlgorithmFromVerificationMethod(verificationMethod, suitableAlgorithms)\n }\n\n private getProofTypeForLdpVc(\n agentContext: AgentContext,\n presentationDefinition: DifPresentationExchangeDefinitionV1 | DifPresentationExchangeDefinitionV2,\n verificationMethod: VerificationMethod\n ) {\n const algorithmsSatisfyingDefinition = presentationDefinition.format?.ldp_vc?.proof_type ?? []\n\n const inputDescriptorAlgorithms: Array<Array<string>> = presentationDefinition.input_descriptors\n .map((descriptor) => (descriptor as InputDescriptorV2).format?.ldp_vc?.proof_type ?? [])\n .filter((alg) => alg.length > 0)\n\n const suitableSignatureSuites = this.getSigningAlgorithmsForPresentationDefinitionAndInputDescriptors(\n algorithmsSatisfyingDefinition,\n inputDescriptorAlgorithms\n )\n\n // For each of the supported algs, find the key types, then find the proof types\n const signatureSuiteRegistry = agentContext.dependencyManager.resolve(SignatureSuiteRegistry)\n\n const publicJwk = getPublicJwkFromVerificationMethod(verificationMethod)\n const supportedSignatureSuites = signatureSuiteRegistry.getAllByPublicJwkType(publicJwk)\n if (supportedSignatureSuites.length === 0) {\n throw new DifPresentationExchangeError(\n `Couldn't find a supported signature suite for the given jwk ${getJwkHumanDescription(publicJwk.toJson())}`\n )\n }\n\n if (suitableSignatureSuites) {\n const foundSignatureSuite = supportedSignatureSuites.find((suite) =>\n suitableSignatureSuites.includes(suite.proofType)\n )\n\n if (!foundSignatureSuite) {\n throw new DifPresentationExchangeError(\n [\n 'No possible signature suite found for the given verification method.',\n `Verification method type: ${verificationMethod.type}`,\n `jwk type: ${getJwkHumanDescription(publicJwk.toJson())}`,\n `SupportedSignatureSuites: '${supportedSignatureSuites.map((s) => s.proofType).join(', ')}'`,\n `SuitableSignatureSuites: ${suitableSignatureSuites.join(', ')}`,\n ].join('\\n')\n )\n }\n\n return supportedSignatureSuites[0].proofType\n }\n\n return supportedSignatureSuites[0].proofType\n }\n\n /**\n * if all submission descriptors have a format of di | ldp,\n * and all credentials have an ANONCREDS_DATA_INTEGRITY proof we default to\n * signing the presentation using the ANONCREDS_DATA_INTEGRITY_CRYPTOSUITE\n */\n private shouldSignUsingAnonCredsDataIntegrity(\n presentationToCreate: PresentationToCreate,\n presentationSubmission?: DifPresentationExchangeSubmission\n ) {\n if (presentationToCreate.claimFormat !== ClaimFormat.LdpVp) return undefined\n\n const validDescriptorFormat =\n !presentationSubmission ||\n presentationSubmission.descriptor_map.every((descriptor) =>\n [ClaimFormat.DiVc, ClaimFormat.DiVp, ClaimFormat.LdpVc, ClaimFormat.LdpVp].includes(\n descriptor.format as ClaimFormat\n )\n )\n\n const credentialAreSignedUsingAnonCredsDataIntegrity = presentationToCreate.verifiableCredentials.every(\n ({ credential }) => {\n if (credential.credential.claimFormat !== ClaimFormat.LdpVc) return false\n return credential.credential.dataIntegrityCryptosuites.includes(ANONCREDS_DATA_INTEGRITY_CRYPTOSUITE)\n }\n )\n\n return validDescriptorFormat && credentialAreSignedUsingAnonCredsDataIntegrity\n }\n\n private getPresentationSignCallback(agentContext: AgentContext, presentationToCreate: PresentationToCreate) {\n return async (callBackParams: PresentationSignCallBackParams) => {\n // The created partial proof and presentation, as well as original supplied options\n const {\n presentation: presentationInput,\n options,\n presentationDefinition,\n presentationSubmission,\n } = callBackParams\n const { challenge, domain } = options.proofOptions ?? {}\n\n if (!challenge) {\n throw new CredoError('challenge MUST be provided when signing a Verifiable Presentation')\n }\n\n if (presentationToCreate.claimFormat === ClaimFormat.JwtVp) {\n if (!presentationToCreate.subjectIds) {\n throw new DifPresentationExchangeError('Cannot create presentation for credentials without subject id')\n }\n\n // Determine a suitable verification method for the presentation\n const verificationMethod = await this.getVerificationMethodForSubjectId(\n agentContext,\n presentationToCreate.subjectIds[0]\n )\n\n const w3cPresentation = JsonTransformer.fromJSON(presentationInput, W3cPresentation)\n w3cPresentation.holder = verificationMethod.controller\n\n const signedPresentation = await this.w3cCredentialService.signPresentation<ClaimFormat.JwtVp>(agentContext, {\n format: ClaimFormat.JwtVp,\n alg: this.getSigningAlgorithmForJwtVc(presentationDefinition, verificationMethod),\n verificationMethod: verificationMethod.id,\n presentation: w3cPresentation,\n challenge,\n domain,\n })\n\n return signedPresentation.encoded as W3CVerifiablePresentation\n }\n if (presentationToCreate.claimFormat === ClaimFormat.LdpVp) {\n if (this.shouldSignUsingAnonCredsDataIntegrity(presentationToCreate, presentationSubmission)) {\n // make sure the descriptors format properties are set correctly\n presentationSubmission.descriptor_map = presentationSubmission.descriptor_map.map((descriptor) => ({\n ...descriptor,\n format: 'di_vp',\n }))\n const anoncredsDataIntegrityService = agentContext.dependencyManager.resolve<IAnonCredsDataIntegrityService>(\n AnonCredsDataIntegrityServiceSymbol\n )\n const presentation = await anoncredsDataIntegrityService.createPresentation(agentContext, {\n presentationDefinition,\n presentationSubmission,\n selectedCredentialRecords: presentationToCreate.verifiableCredentials.map((vc) => vc.credential),\n challenge,\n })\n return {\n ...presentation.toJSON(),\n presentation_submission: presentationSubmission,\n } as unknown as SphereonW3cVerifiablePresentation\n }\n\n if (!presentationToCreate.subjectIds) {\n throw new DifPresentationExchangeError('Cannot create presentation for credentials without subject id')\n }\n // Determine a suitable verification method for the presentation\n const verificationMethod = await this.getVerificationMethodForSubjectId(\n agentContext,\n presentationToCreate.subjectIds[0]\n )\n\n const w3cPresentation = JsonTransformer.fromJSON(presentationInput, W3cPresentation)\n w3cPresentation.holder = verificationMethod.controller\n\n const signedPresentation = await this.w3cCredentialService.signPresentation(agentContext, {\n format: ClaimFormat.LdpVp,\n // TODO: we should move the check for which proof to use for a presentation to earlier\n // as then we know when determining which VPs to submit already if the proof types are supported\n // by the verifier, and we can then just add this to the vpToCreate interface\n proofType: this.getProofTypeForLdpVc(agentContext, presentationDefinition, verificationMethod),\n proofPurpose: new purposes.AuthenticationProofPurpose({ challenge, domain }),\n verificationMethod: verificationMethod.id,\n presentation: w3cPresentation,\n challenge,\n domain,\n })\n\n return signedPresentation.encoded as W3CVerifiablePresentation\n }\n if (presentationToCreate.claimFormat === ClaimFormat.SdJwtDc) {\n const sdJwtInput = presentationInput as\n | SdJwtDecodedVerifiableCredential\n | PartialSdJwtDecodedVerifiableCredential\n\n if (!domain) {\n throw new CredoError(\"Missing 'domain' property, unable to set required 'aud' property in SD-JWT KB-JWT\")\n }\n\n const sdJwtVcApi = this.getSdJwtVcApi(agentContext)\n const sdJwtVc = await sdJwtVcApi.present({\n compactSdJwtVc: sdJwtInput.compactSdJwtVc,\n // SD is already handled by PEX, so we presents all keys\n presentationFrame: undefined,\n verifierMetadata: {\n audience: domain,\n nonce: challenge,\n // TODO: we should make this optional\n issuedAt: Math.floor(Date.now() / 1000),\n },\n additionalPayload: presentationToCreate.verifiableCredentials[0].additionalPayload,\n })\n\n return sdJwtVc\n }\n throw new DifPresentationExchangeError(\n 'Only JWT, SD-JWT-VC, JSONLD credentials are supported for a single presentation'\n )\n }\n }\n\n private async getVerificationMethodForSubjectId(agentContext: AgentContext, subjectId: string) {\n const didsApi = agentContext.dependencyManager.resolve(DidsApi)\n\n if (!subjectId.startsWith('did:')) {\n throw new DifPresentationExchangeError(\n `Only dids are supported as credentialSubject id. ${subjectId} is not a valid did`\n )\n }\n\n const didDocument = await didsApi.resolveDidDocument(subjectId)\n\n if (!didDocument.authentication || didDocument.authentication.length === 0) {\n throw new DifPresentationExchangeError(\n `No authentication verificationMethods found for did ${subjectId} in did document`\n )\n }\n\n // the signature suite to use for the presentation is dependant on the credentials we share.\n // 1. Get the verification method for this given proof purpose in this DID document\n let [verificationMethod] = didDocument.authentication\n if (typeof verificationMethod === 'string') {\n verificationMethod = didDocument.dereferenceKey(verificationMethod, ['authentication'])\n }\n\n return verificationMethod\n }\n\n /**\n * Queries the wallet for credentials that match the given presentation definition. This only does an initial query based on the\n * schema of the input descriptors. It does not do any further filtering based on the constraints in the input descriptors.\n */\n private async queryCredentialForPresentationDefinition(\n agentContext: AgentContext,\n presentationDefinition: DifPresentationExchangeDefinition\n ): Promise<Array<SdJwtVcRecord | W3cCredentialRecord | MdocRecord>> {\n const w3cCredentialRepository = agentContext.dependencyManager.resolve(W3cCredentialRepository)\n const w3cQuery: Array<Query<W3cCredentialRecord>> = []\n const sdJwtVcQuery: Array<Query<SdJwtVcRecord>> = []\n const mdocQuery: Array<Query<MdocRecord>> = []\n\n const presentationDefinitionVersion = PEX.definitionVersionDiscovery(presentationDefinition)\n\n if (!presentationDefinitionVersion.version) {\n throw new DifPresentationExchangeError(\n 'Unable to determine the Presentation Exchange version from the presentation definition',\n presentationDefinitionVersion.error ? { additionalMessages: [presentationDefinitionVersion.error] } : {}\n )\n }\n\n // FIXME: in the query we should take into account the supported proof types of the verifier\n // this could help enormously in the amount of credentials we have to retrieve from storage.\n if (presentationDefinitionVersion.version === PEVersion.v1) {\n const pd = presentationDefinition as DifPresentationExchangeDefinitionV1\n\n // The schema.uri can contain either an expanded type, or a context uri\n for (const inputDescriptor of pd.input_descriptors) {\n for (const schema of inputDescriptor.schema) {\n sdJwtVcQuery.push({\n vct: schema.uri,\n })\n w3cQuery.push({\n $or: [{ expandedTypes: [schema.uri] }, { contexts: [schema.uri] }, { types: [schema.uri] }],\n })\n mdocQuery.push({\n docType: inputDescriptor.id,\n })\n }\n }\n } else if (presentationDefinitionVersion.version === PEVersion.v2) {\n // FIXME: As PE version 2 does not have the `schema` anymore, we can't query by schema anymore.\n // We probably need\n // to find some way to do initial filtering, hopefully if there's a filter on the `type` field or something.\n } else {\n throw new DifPresentationExchangeError(\n `Unsupported presentation definition version ${presentationDefinitionVersion.version as unknown as string}`\n )\n }\n\n const allRecords: Array<SdJwtVcRecord | W3cCredentialRecord | MdocRecord> = []\n\n // query the wallet ourselves first to avoid the need to query the pex library for all\n // credentials for every proof request\n const w3cCredentialRecords =\n w3cQuery.length > 0\n ? await w3cCredentialRepository.findByQuery(agentContext, { $or: w3cQuery })\n : await w3cCredentialRepository.getAll(agentContext)\n allRecords.push(...w3cCredentialRecords)\n\n const sdJwtVcApi = this.getSdJwtVcApi(agentContext)\n const sdJwtVcRecords =\n sdJwtVcQuery.length > 0 ? await sdJwtVcApi.findAllByQuery({ $or: sdJwtVcQuery }) : await sdJwtVcApi.getAll()\n allRecords.push(...sdJwtVcRecords)\n\n const mdocApi = this.getMdocApi(agentContext)\n const mdocRecords = mdocQuery.length > 0 ? await mdocApi.findAllByQuery({ $or: mdocQuery }) : await mdocApi.getAll()\n allRecords.push(...mdocRecords)\n\n return allRecords\n }\n\n private getSdJwtVcApi(agentContext: AgentContext) {\n return agentContext.dependencyManager.resolve(SdJwtVcApi)\n }\n\n private getMdocApi(agentContext: AgentContext) {\n return agentContext.dependencyManager.resolve(MdocApi)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DO,2CAAMA,iCAA+B;CAG1C,AAAO,YAAY,AAAQC,sBAA4C;EAA5C;OAFnB,MAAM,IAAI,KAAK;;CAIvB,MAAa,yBACX,cACA,wBACsC;EACtC,MAAM,oBAAoB,MAAM,KAAK,y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|
1
|
+
import { JsonObject } from "../../../types.mjs";
|
|
1
2
|
import { ClaimFormat } from "../../vc/models/ClaimFormat.mjs";
|
|
2
|
-
import { MdocNameSpaces } from "../../mdoc/MdocOptions.mjs";
|
|
3
3
|
import { SdJwtVcRecord } from "../../sd-jwt-vc/repository/SdJwtVcRecord.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { MdocNameSpaces } from "../../mdoc/MdocOptions.mjs";
|
|
5
5
|
import { MdocRecord } from "../../mdoc/repository/MdocRecord.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { W3cCredentialRecord } from "../../vc/repository/W3cCredentialRecord.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/modules/dif-presentation-exchange/models/DifPexCredentialsForRequest.d.ts
|
|
9
9
|
interface DifPexCredentialsForRequest {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { JsonObject } from "../../../types.js";
|
|
1
2
|
import { ClaimFormat } from "../../vc/models/ClaimFormat.js";
|
|
2
|
-
import { MdocNameSpaces } from "../../mdoc/MdocOptions.js";
|
|
3
3
|
import { SdJwtVcRecord } from "../../sd-jwt-vc/repository/SdJwtVcRecord.js";
|
|
4
|
-
import {
|
|
4
|
+
import { MdocNameSpaces } from "../../mdoc/MdocOptions.js";
|
|
5
5
|
import { MdocRecord } from "../../mdoc/repository/MdocRecord.js";
|
|
6
|
-
import {
|
|
6
|
+
import { W3cCredentialRecord } from "../../vc/repository/W3cCredentialRecord.js";
|
|
7
7
|
|
|
8
8
|
//#region src/modules/dif-presentation-exchange/models/DifPexCredentialsForRequest.d.ts
|
|
9
9
|
interface DifPexCredentialsForRequest {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { W3cVerifiableCredential } from "../../vc/models/credential/W3cVerifiableCredential.mjs";
|
|
2
|
-
import { Mdoc } from "../../mdoc/Mdoc.mjs";
|
|
3
1
|
import { SdJwtVc } from "../../sd-jwt-vc/SdJwtVcService.mjs";
|
|
2
|
+
import { MdocDeviceResponse } from "../../mdoc/MdocDeviceResponse.mjs";
|
|
3
|
+
import { DifPexCredentialsForRequest, DifPexCredentialsForRequestRequirement, DifPexCredentialsForRequestSubmissionEntry, DifPexInputDescriptorToCredentials, SubmissionEntryCredential } from "./DifPexCredentialsForRequest.mjs";
|
|
4
4
|
import { W3cV2VerifiableCredential } from "../../vc/models/credential/W3cV2VerifiableCredential.mjs";
|
|
5
|
+
import { W3cVerifiableCredential } from "../../vc/models/credential/W3cVerifiableCredential.mjs";
|
|
5
6
|
import { W3cVerifiablePresentation } from "../../vc/models/presentation/W3cVerifiablePresentation.mjs";
|
|
6
7
|
import { W3cV2VerifiablePresentation } from "../../vc/models/presentation/W3cV2VerifiablePresentation.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import { DifPexCredentialsForRequest, DifPexCredentialsForRequestRequirement, DifPexCredentialsForRequestSubmissionEntry, DifPexInputDescriptorToCredentials, SubmissionEntryCredential } from "./DifPexCredentialsForRequest.mjs";
|
|
8
|
+
import { Mdoc } from "../../mdoc/Mdoc.mjs";
|
|
9
9
|
import { PresentationSubmissionLocation } from "@animo-id/pex";
|
|
10
10
|
import { PresentationDefinitionV1, PresentationDefinitionV2, PresentationSubmission } from "@sphereon/pex-models";
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { W3cVerifiableCredential } from "../../vc/models/credential/W3cVerifiableCredential.js";
|
|
2
|
-
import { Mdoc } from "../../mdoc/Mdoc.js";
|
|
3
1
|
import { SdJwtVc } from "../../sd-jwt-vc/SdJwtVcService.js";
|
|
2
|
+
import { MdocDeviceResponse } from "../../mdoc/MdocDeviceResponse.js";
|
|
3
|
+
import { DifPexCredentialsForRequest, DifPexCredentialsForRequestRequirement, DifPexCredentialsForRequestSubmissionEntry, DifPexInputDescriptorToCredentials, SubmissionEntryCredential } from "./DifPexCredentialsForRequest.js";
|
|
4
4
|
import { W3cV2VerifiableCredential } from "../../vc/models/credential/W3cV2VerifiableCredential.js";
|
|
5
|
+
import { W3cVerifiableCredential } from "../../vc/models/credential/W3cVerifiableCredential.js";
|
|
5
6
|
import { W3cVerifiablePresentation } from "../../vc/models/presentation/W3cVerifiablePresentation.js";
|
|
6
7
|
import { W3cV2VerifiablePresentation } from "../../vc/models/presentation/W3cV2VerifiablePresentation.js";
|
|
7
|
-
import {
|
|
8
|
-
import { DifPexCredentialsForRequest, DifPexCredentialsForRequestRequirement, DifPexCredentialsForRequestSubmissionEntry, DifPexInputDescriptorToCredentials, SubmissionEntryCredential } from "./DifPexCredentialsForRequest.js";
|
|
8
|
+
import { Mdoc } from "../../mdoc/Mdoc.js";
|
|
9
9
|
import { PresentationDefinitionV1, PresentationDefinitionV2, PresentationSubmission } from "@sphereon/pex-models";
|
|
10
10
|
import { PresentationSubmissionLocation } from "@animo-id/pex";
|
|
11
11
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentialSelection.mjs","names":["selectResults: CredentialRecordSelectResults","presentationSubmission: DifPexCredentialsForRequest","submissionRequirements: Array<DifPexCredentialsForRequestRequirement>","match","selectedSubmission: DifPexCredentialsForRequestRequirement","satisfiedSubmissions: Array<DifPexCredentialsForRequestSubmissionEntry>","unsatisfiedSubmissions: Array<DifPexCredentialsForRequestSubmissionEntry>","submissionEntry: DifPexCredentialsForRequestSubmissionEntry","verifiableCredentials: SubmissionEntryCredential[]"],"sources":["../../../../src/modules/dif-presentation-exchange/utils/credentialSelection.ts"],"sourcesContent":["import {\n type IPresentationDefinition,\n type PEX,\n type SelectResults,\n Status,\n type SubmissionRequirementMatch,\n} from '@animo-id/pex'\nimport type {\n SubmissionRequirementMatchFrom,\n SubmissionRequirementMatchInputDescriptor,\n} from '@animo-id/pex/dist/main/lib/evaluation/core'\nimport type { InputDescriptorV1, InputDescriptorV2, SubmissionRequirement } from '@sphereon/pex-models'\nimport type {\n DifPexCredentialsForRequest,\n DifPexCredentialsForRequestRequirement,\n DifPexCredentialsForRequestSubmissionEntry,\n SubmissionEntryCredential,\n} from '../models'\n\nimport { SubmissionRequirementMatchType } from '@animo-id/pex/dist/main/lib/evaluation/core/index.js'\nimport { JSONPath } from '@astronautlabs/jsonpath'\nimport { decodeSdJwtSync, getClaimsSync } from '@sd-jwt/decode'\nimport { Rules } from '@sphereon/pex-models'\n\nimport { Hasher } from '../../../crypto'\nimport { CredoError } from '../../../error'\nimport { MdocRecord } from '../../mdoc'\nimport { Mdoc } from '../../mdoc/Mdoc'\nimport { MdocDeviceResponse } from '../../mdoc/MdocDeviceResponse'\nimport { SdJwtVcRecord } from '../../sd-jwt-vc'\nimport { ClaimFormat, W3cCredentialRecord } from '../../vc'\nimport { DifPresentationExchangeError } from '../DifPresentationExchangeError'\n\nimport type { JsonObject } from '../../../types'\nimport { getSphereonOriginalVerifiableCredential } from './transform'\n\nexport async function getCredentialsForRequest(\n // PEX instance with hasher defined\n pex: PEX,\n presentationDefinition: IPresentationDefinition,\n credentialRecords: Array<W3cCredentialRecord | SdJwtVcRecord | MdocRecord>\n): Promise<DifPexCredentialsForRequest> {\n const encodedCredentials = credentialRecords.map(getSphereonOriginalVerifiableCredential)\n const selectResultsRaw = pex.selectFrom(presentationDefinition, encodedCredentials)\n\n const selectResults: CredentialRecordSelectResults = {\n ...selectResultsRaw,\n matches: selectResultsRaw.matches ?? [],\n // Map the encoded credential to their respective credential record\n verifiableCredential:\n selectResultsRaw.verifiableCredential?.map((selectedEncoded, index): SubmissionEntryCredential => {\n const credentialRecordIndex = selectResultsRaw.vcIndexes?.[index]\n if (credentialRecordIndex === undefined || credentialRecordIndex === -1) {\n throw new DifPresentationExchangeError('Unable to find credential in credential records.')\n }\n const credentialRecord = credentialRecords[credentialRecordIndex]\n if (credentialRecord instanceof SdJwtVcRecord) {\n // selectedEncoded always string when SdJwtVcRecord\n // Get the decoded payload from the the selected credential, this already has SD applied\n const { jwt, disclosures } = decodeSdJwtSync(selectedEncoded as string, Hasher.hash)\n const prettyClaims = getClaimsSync(jwt.payload, disclosures, Hasher.hash)\n\n return {\n claimFormat: ClaimFormat.SdJwtDc,\n credentialRecord,\n disclosedPayload: prettyClaims as JsonObject,\n }\n }\n if (credentialRecord instanceof MdocRecord) {\n return {\n claimFormat: ClaimFormat.MsoMdoc,\n credentialRecord,\n disclosedPayload: {},\n }\n }\n if (credentialRecord instanceof W3cCredentialRecord) {\n return {\n claimFormat: credentialRecord.credential.claimFormat,\n credentialRecord,\n }\n }\n throw new CredoError('Unrecognized credential record type')\n }) ?? [],\n }\n\n const presentationSubmission: DifPexCredentialsForRequest = {\n requirements: [],\n areRequirementsSatisfied: false,\n name: presentationDefinition.name,\n purpose: presentationDefinition.purpose,\n }\n\n // If there's no submission requirements, ALL input descriptors MUST be satisfied\n if (!presentationDefinition.submission_requirements || presentationDefinition.submission_requirements.length === 0) {\n presentationSubmission.requirements = getSubmissionRequirementsForAllInputDescriptors(\n presentationDefinition.input_descriptors,\n selectResults\n )\n } else {\n presentationSubmission.requirements = getSubmissionRequirements(presentationDefinition, selectResults)\n }\n\n const allEntries = presentationSubmission.requirements.flatMap((requirement) => requirement.submissionEntry)\n\n const inputDescriptorsForMdocCredential = new Map<SubmissionEntryCredential, Set<string>>()\n for (const entry of allEntries)\n for (const verifiableCredential of entry.verifiableCredentials) {\n if (verifiableCredential.claimFormat !== ClaimFormat.MsoMdoc) continue\n\n const set = inputDescriptorsForMdocCredential.get(verifiableCredential) ?? new Set()\n set.add(entry.inputDescriptorId)\n inputDescriptorsForMdocCredential.set(verifiableCredential, set)\n }\n\n // NOTE: it might be better to apply disclosure per credential/match (as that's also how mdoc does this)\n // however this doesn't work very well in wallets, as you usually won't show the same credential twice with\n // different disclosed attributes\n // Apply limit disclosure for all mdocs\n for (const [verifiableCredential, inputDescriptorIds] of inputDescriptorsForMdocCredential.entries()) {\n if (verifiableCredential.claimFormat !== ClaimFormat.MsoMdoc) continue\n\n const inputDescriptorsForCredential = presentationDefinition.input_descriptors.filter(({ id }) =>\n inputDescriptorIds.has(id)\n )\n\n const mdoc = Mdoc.fromBase64Url(verifiableCredential.credentialRecord.base64Url)\n verifiableCredential.disclosedPayload = MdocDeviceResponse.limitDisclosureToInputDescriptor({\n inputDescriptor: {\n id: mdoc.docType,\n format: {\n mso_mdoc: {\n alg: [],\n },\n },\n constraints: {\n limit_disclosure: 'required',\n fields: inputDescriptorsForCredential.flatMap((i) => i.constraints?.fields ?? []),\n },\n },\n mdoc: Mdoc.fromBase64Url(verifiableCredential.credentialRecord.base64Url),\n })\n }\n\n // There may be no requirements if we filter out all optional ones. To not makes things too complicated, we see it as an error\n // for now if a request is made that has no required requirements (but only e.g. min: 0, which means we don't need to disclose anything)\n // I see this more as the fault of the presentation definition, as it should have at least some requirements.\n if (presentationSubmission.requirements.length === 0) {\n throw new DifPresentationExchangeError(\n 'Presentation Definition does not require any credentials. Optional credentials are not included in the presentation submission.'\n )\n }\n\n if (selectResults.areRequiredCredentialsPresent === Status.ERROR) {\n return presentationSubmission\n }\n\n return {\n ...presentationSubmission,\n\n // If all requirements are satisfied, the presentation submission is satisfied\n areRequirementsSatisfied: presentationSubmission.requirements.every(\n (requirement) => requirement.isRequirementSatisfied\n ),\n }\n}\n\nfunction getSubmissionRequirements(\n presentationDefinition: IPresentationDefinition,\n selectResults: CredentialRecordSelectResults\n): Array<DifPexCredentialsForRequestRequirement> {\n const submissionRequirements: Array<DifPexCredentialsForRequestRequirement> = []\n\n const matches = selectResults.matches as SubmissionRequirementMatchFrom[]\n if (!matches.every((match) => match.type === SubmissionRequirementMatchType.SubmissionRequirement && match.from)) {\n throw new DifPresentationExchangeError(\n `Expected all matches to be of type '${SubmissionRequirementMatchType.SubmissionRequirement}' with 'from' key.`\n )\n }\n\n // There are submission requirements, so we need to select the input_descriptors\n // based on the submission requirements\n presentationDefinition.submission_requirements?.forEach((submissionRequirement, submissionRequirementIndex) => {\n // Check: if the submissionRequirement uses `from_nested`, as we don't support this yet\n if (submissionRequirement.from_nested) {\n throw new DifPresentationExchangeError(\n \"Presentation definition contains requirement using 'from_nested', which is not supported yet.\"\n )\n }\n\n // Check if there's a 'from'. If not the structure is not as we expect it\n if (!submissionRequirement.from) {\n throw new DifPresentationExchangeError(\"Missing 'from' in submission requirement match\")\n }\n\n const match = matches.find((match) => match.id === submissionRequirementIndex)\n if (!match) {\n throw new Error(`Unable to find a match for submission requirement with index '${submissionRequirementIndex}'`)\n }\n\n if (submissionRequirement.rule === Rules.All) {\n const selectedSubmission = getSubmissionRequirementRuleAll(\n submissionRequirement,\n presentationDefinition,\n selectResults.verifiableCredential,\n match\n )\n submissionRequirements.push(selectedSubmission)\n } else {\n const selectedSubmission = getSubmissionRequirementRulePick(\n submissionRequirement,\n presentationDefinition,\n selectResults.verifiableCredential,\n match\n )\n\n submissionRequirements.push(selectedSubmission)\n }\n })\n\n // Submission may have requirement that doesn't require a credential to be submitted (e.g. min: 0)\n // We use minimization strategy, and thus only disclose the minimum amount of information\n const requirementsWithCredentials = submissionRequirements.filter((requirement) => requirement.needsCount > 0)\n\n return requirementsWithCredentials\n}\n\nfunction getSubmissionRequirementsForAllInputDescriptors(\n inputDescriptors: Array<InputDescriptorV1> | Array<InputDescriptorV2>,\n selectResults: CredentialRecordSelectResults\n): Array<DifPexCredentialsForRequestRequirement> {\n const submissionRequirements: Array<DifPexCredentialsForRequestRequirement> = []\n\n const matches = selectResults.matches as SubmissionRequirementMatchInputDescriptor[]\n if (!matches.every((match) => match.type === SubmissionRequirementMatchType.InputDescriptor)) {\n throw new DifPresentationExchangeError(\n `Expected all matches to be of type '${SubmissionRequirementMatchType.InputDescriptor}' when.`\n )\n }\n\n for (const inputDescriptor of inputDescriptors) {\n const submission = getSubmissionForInputDescriptor(inputDescriptor, selectResults.verifiableCredential, matches)\n submissionRequirements.push({\n rule: Rules.Pick,\n needsCount: 1, // Every input descriptor is a distinct requirement, so the count is always 1,\n submissionEntry: [submission],\n isRequirementSatisfied: submission.verifiableCredentials.length >= 1,\n })\n }\n\n return submissionRequirements\n}\n\nfunction getSubmissionRequirementRuleAll(\n submissionRequirement: SubmissionRequirement,\n presentationDefinition: IPresentationDefinition,\n verifiableCredentials: SubmissionEntryCredential[],\n match: SubmissionRequirementMatchFrom\n) {\n // Check if there's a 'from'. If not the structure is not as we expect it\n if (!submissionRequirement.from)\n throw new DifPresentationExchangeError(\"Missing 'from' in submission requirement match.\")\n\n const selectedSubmission: DifPexCredentialsForRequestRequirement = {\n rule: Rules.All,\n needsCount: 0,\n name: submissionRequirement.name,\n purpose: submissionRequirement.purpose,\n submissionEntry: [],\n isRequirementSatisfied: false,\n }\n\n for (const inputDescriptor of presentationDefinition.input_descriptors) {\n // We only want to get the submission if the input descriptor belongs to the group\n if (!inputDescriptor.group?.includes(match.from)) continue\n\n const submission = getSubmissionForInputDescriptor(inputDescriptor, verifiableCredentials, match.input_descriptors)\n\n // Rule ALL, so for every input descriptor that matches in this group, we need to add it\n selectedSubmission.needsCount += 1\n selectedSubmission.submissionEntry.push(submission)\n }\n\n return {\n ...selectedSubmission,\n\n // If all submissions have a credential, the requirement is satisfied\n isRequirementSatisfied: selectedSubmission.submissionEntry.every(\n (submission) => submission.verifiableCredentials.length >= 1\n ),\n }\n}\n\nfunction getSubmissionRequirementRulePick(\n submissionRequirement: SubmissionRequirement,\n presentationDefinition: IPresentationDefinition,\n verifiableCredentials: SubmissionEntryCredential[],\n match: SubmissionRequirementMatchFrom\n) {\n // Check if there's a 'from'. If not the structure is not as we expect it\n if (!submissionRequirement.from) {\n throw new DifPresentationExchangeError(\"Missing 'from' in submission requirement match.\")\n }\n\n const selectedSubmission: DifPexCredentialsForRequestRequirement = {\n rule: Rules.Pick,\n needsCount: submissionRequirement.count ?? submissionRequirement.min ?? 1,\n name: submissionRequirement.name,\n purpose: submissionRequirement.purpose,\n // If there's no count, min, or max we assume one credential is required for submission\n // however, the exact behavior is not specified in the spec\n submissionEntry: [],\n isRequirementSatisfied: false,\n }\n\n const satisfiedSubmissions: Array<DifPexCredentialsForRequestSubmissionEntry> = []\n const unsatisfiedSubmissions: Array<DifPexCredentialsForRequestSubmissionEntry> = []\n\n for (const inputDescriptor of presentationDefinition.input_descriptors) {\n // We only want to get the submission if the input descriptor belongs to the group\n if (!inputDescriptor.group?.includes(match.from)) continue\n\n const submission = getSubmissionForInputDescriptor(inputDescriptor, verifiableCredentials, match.input_descriptors)\n\n if (submission.verifiableCredentials.length >= 1) {\n satisfiedSubmissions.push(submission)\n } else {\n unsatisfiedSubmissions.push(submission)\n }\n\n // If we have found enough credentials to satisfy the requirement, we could stop\n // but the user may not want the first x that match, so we continue and return all matches\n // if (satisfiedSubmissions.length === selectedSubmission.needsCount) break\n }\n\n return {\n ...selectedSubmission,\n\n // If there are enough satisfied submissions, the requirement is satisfied\n isRequirementSatisfied: satisfiedSubmissions.length >= selectedSubmission.needsCount,\n\n // if the requirement is satisfied, we only need to return the satisfied submissions\n // however if the requirement is not satisfied, we include all entries so the wallet could\n // render which credentials are missing.\n submissionEntry:\n satisfiedSubmissions.length >= selectedSubmission.needsCount\n ? satisfiedSubmissions\n : [...satisfiedSubmissions, ...unsatisfiedSubmissions],\n }\n}\n\nfunction getSubmissionForInputDescriptor(\n inputDescriptor: InputDescriptorV1 | InputDescriptorV2,\n verifiableCredentials: SubmissionEntryCredential[],\n matches: SubmissionRequirementMatchInputDescriptor[]\n): DifPexCredentialsForRequestSubmissionEntry {\n const matchesForInputDescriptor = matches.filter((m) => m.id === inputDescriptor.id)\n\n const submissionEntry: DifPexCredentialsForRequestSubmissionEntry = {\n inputDescriptorId: inputDescriptor.id,\n name: inputDescriptor.name,\n purpose: inputDescriptor.purpose,\n verifiableCredentials: matchesForInputDescriptor.flatMap((matchForInputDescriptor) =>\n extractCredentialsFromInputDescriptorMatch(matchForInputDescriptor, verifiableCredentials)\n ),\n }\n\n // return early if no matches.\n if (!matchesForInputDescriptor?.length) return submissionEntry\n\n return submissionEntry\n}\n\nfunction extractCredentialsFromInputDescriptorMatch(\n match: SubmissionRequirementMatchInputDescriptor,\n availableCredentials: SubmissionEntryCredential[]\n) {\n const verifiableCredentials: SubmissionEntryCredential[] = []\n\n for (const vcPath of match.vc_path) {\n const [verifiableCredential] = JSONPath.query(\n { verifiableCredential: availableCredentials },\n vcPath\n ) as SubmissionEntryCredential[]\n verifiableCredentials.push(verifiableCredential)\n }\n\n return verifiableCredentials\n}\n\n/**\n * Custom SelectResults that includes the Credo records instead of the encoded verifiable credential\n */\ntype CredentialRecordSelectResults = Omit<SelectResults, 'verifiableCredential'> & {\n verifiableCredential: SubmissionEntryCredential[]\n matches: SubmissionRequirementMatch[]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoCA,eAAsB,yBAEpB,KACA,wBACA,mBACsC;CACtC,MAAM,qBAAqB,kBAAkB,IAAI,wCAAwC;CACzF,MAAM,mBAAmB,IAAI,WAAW,wBAAwB,mBAAmB;CAEnF,MAAMA,gBAA+C;EACnD,GAAG;EACH,SAAS,iBAAiB,WAAW,EAAE;EAEvC,sBACE,iBAAiB,sBAAsB,KAAK,iBAAiB,UAAqC;GAChG,MAAM,wBAAwB,iBAAiB,YAAY;AAC3D,OAAI,0BAA0B,UAAa,0BAA0B,GACnE,OAAM,IAAI,6BAA6B,mDAAmD;GAE5F,MAAM,mBAAmB,kBAAkB;AAC3C,OAAI,4BAA4B,eAAe;IAG7C,MAAM,EAAE,KAAK,gBAAgB,gBAAgB,iBAA2B,OAAO,KAAK;IACpF,MAAM,eAAe,cAAc,IAAI,SAAS,aAAa,OAAO,KAAK;AAEzE,WAAO;KACL,aAAa,YAAY;KACzB;KACA,kBAAkB;KACnB;;AAEH,OAAI,4BAA4B,WAC9B,QAAO;IACL,aAAa,YAAY;IACzB;IACA,kBAAkB,EAAE;IACrB;AAEH,OAAI,4BAA4B,oBAC9B,QAAO;IACL,aAAa,iBAAiB,WAAW;IACzC;IACD;AAEH,SAAM,IAAI,WAAW,sCAAsC;IAC3D,IAAI,EAAE;EACX;CAED,MAAMC,yBAAsD;EAC1D,cAAc,EAAE;EAChB,0BAA0B;EAC1B,MAAM,uBAA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9C,uBACA,CAAC,GAAG,sBAAsB,GAAG,uBAAuB;EAC3D;;AAGH,SAAS,gCACP,iBACA,uBACA,SAC4C;CAC5C,MAAM,4BAA4B,QAAQ,QAAQ,MAAM,EAAE,OAAO,gBAAgB,GAAG;CAEpF,MAAMC,kBAA8D;EAClE,mBAAmB,gBAAgB;EACnC,MAAM,gBAAgB;EACtB,SAAS,gBAAgB;EACzB,uBAAuB,0BAA0B,SAAS,4BACxD,2CAA2C,yBAAyB,sBAAsB,CAC3F;EACF;AAGD,KAAI,CAAC,2BAA2B,OAAQ,QAAO;AAE/C,QAAO;;AAGT,SAAS,2CACP,OACA,sBACA;CACA,MAAMC,wBAAqD,EAAE;AAE7D,MAAK,MAAM,UAAU,MAAM,SAAS;EAClC,MAAM,CAAC,wBAAwB,SAAS,MACtC,EAAE,sBAAsB,sBAAsB,EAC9C,OACD;AACD,wBAAsB,KAAK,qBAAqB;;AAGlD,QAAO"}
|
|
1
|
+
{"version":3,"file":"credentialSelection.mjs","names":["selectResults: CredentialRecordSelectResults","presentationSubmission: DifPexCredentialsForRequest","submissionRequirements: Array<DifPexCredentialsForRequestRequirement>","match","selectedSubmission: DifPexCredentialsForRequestRequirement","satisfiedSubmissions: Array<DifPexCredentialsForRequestSubmissionEntry>","unsatisfiedSubmissions: Array<DifPexCredentialsForRequestSubmissionEntry>","submissionEntry: DifPexCredentialsForRequestSubmissionEntry","verifiableCredentials: SubmissionEntryCredential[]"],"sources":["../../../../src/modules/dif-presentation-exchange/utils/credentialSelection.ts"],"sourcesContent":["import {\n type IPresentationDefinition,\n type PEX,\n type SelectResults,\n Status,\n type SubmissionRequirementMatch,\n} from '@animo-id/pex'\nimport type {\n SubmissionRequirementMatchFrom,\n SubmissionRequirementMatchInputDescriptor,\n} from '@animo-id/pex/dist/main/lib/evaluation/core'\nimport { SubmissionRequirementMatchType } from '@animo-id/pex/dist/main/lib/evaluation/core/index.js'\nimport { JSONPath } from '@astronautlabs/jsonpath'\nimport { decodeSdJwtSync, getClaimsSync } from '@sd-jwt/decode'\nimport type { InputDescriptorV1, InputDescriptorV2, SubmissionRequirement } from '@sphereon/pex-models'\nimport { Rules } from '@sphereon/pex-models'\nimport { Hasher } from '../../../crypto'\nimport { CredoError } from '../../../error'\nimport type { JsonObject } from '../../../types'\nimport { MdocRecord } from '../../mdoc'\nimport { Mdoc } from '../../mdoc/Mdoc'\nimport { MdocDeviceResponse } from '../../mdoc/MdocDeviceResponse'\nimport { SdJwtVcRecord } from '../../sd-jwt-vc'\nimport { ClaimFormat, W3cCredentialRecord } from '../../vc'\nimport { DifPresentationExchangeError } from '../DifPresentationExchangeError'\nimport type {\n DifPexCredentialsForRequest,\n DifPexCredentialsForRequestRequirement,\n DifPexCredentialsForRequestSubmissionEntry,\n SubmissionEntryCredential,\n} from '../models'\nimport { getSphereonOriginalVerifiableCredential } from './transform'\n\nexport async function getCredentialsForRequest(\n // PEX instance with hasher defined\n pex: PEX,\n presentationDefinition: IPresentationDefinition,\n credentialRecords: Array<W3cCredentialRecord | SdJwtVcRecord | MdocRecord>\n): Promise<DifPexCredentialsForRequest> {\n const encodedCredentials = credentialRecords.map(getSphereonOriginalVerifiableCredential)\n const selectResultsRaw = pex.selectFrom(presentationDefinition, encodedCredentials)\n\n const selectResults: CredentialRecordSelectResults = {\n ...selectResultsRaw,\n matches: selectResultsRaw.matches ?? [],\n // Map the encoded credential to their respective credential record\n verifiableCredential:\n selectResultsRaw.verifiableCredential?.map((selectedEncoded, index): SubmissionEntryCredential => {\n const credentialRecordIndex = selectResultsRaw.vcIndexes?.[index]\n if (credentialRecordIndex === undefined || credentialRecordIndex === -1) {\n throw new DifPresentationExchangeError('Unable to find credential in credential records.')\n }\n const credentialRecord = credentialRecords[credentialRecordIndex]\n if (credentialRecord instanceof SdJwtVcRecord) {\n // selectedEncoded always string when SdJwtVcRecord\n // Get the decoded payload from the the selected credential, this already has SD applied\n const { jwt, disclosures } = decodeSdJwtSync(selectedEncoded as string, Hasher.hash)\n const prettyClaims = getClaimsSync(jwt.payload, disclosures, Hasher.hash)\n\n return {\n claimFormat: ClaimFormat.SdJwtDc,\n credentialRecord,\n disclosedPayload: prettyClaims as JsonObject,\n }\n }\n if (credentialRecord instanceof MdocRecord) {\n return {\n claimFormat: ClaimFormat.MsoMdoc,\n credentialRecord,\n disclosedPayload: {},\n }\n }\n if (credentialRecord instanceof W3cCredentialRecord) {\n return {\n claimFormat: credentialRecord.credential.claimFormat,\n credentialRecord,\n }\n }\n throw new CredoError('Unrecognized credential record type')\n }) ?? [],\n }\n\n const presentationSubmission: DifPexCredentialsForRequest = {\n requirements: [],\n areRequirementsSatisfied: false,\n name: presentationDefinition.name,\n purpose: presentationDefinition.purpose,\n }\n\n // If there's no submission requirements, ALL input descriptors MUST be satisfied\n if (!presentationDefinition.submission_requirements || presentationDefinition.submission_requirements.length === 0) {\n presentationSubmission.requirements = getSubmissionRequirementsForAllInputDescriptors(\n presentationDefinition.input_descriptors,\n selectResults\n )\n } else {\n presentationSubmission.requirements = getSubmissionRequirements(presentationDefinition, selectResults)\n }\n\n const allEntries = presentationSubmission.requirements.flatMap((requirement) => requirement.submissionEntry)\n\n const inputDescriptorsForMdocCredential = new Map<SubmissionEntryCredential, Set<string>>()\n for (const entry of allEntries)\n for (const verifiableCredential of entry.verifiableCredentials) {\n if (verifiableCredential.claimFormat !== ClaimFormat.MsoMdoc) continue\n\n const set = inputDescriptorsForMdocCredential.get(verifiableCredential) ?? new Set()\n set.add(entry.inputDescriptorId)\n inputDescriptorsForMdocCredential.set(verifiableCredential, set)\n }\n\n // NOTE: it might be better to apply disclosure per credential/match (as that's also how mdoc does this)\n // however this doesn't work very well in wallets, as you usually won't show the same credential twice with\n // different disclosed attributes\n // Apply limit disclosure for all mdocs\n for (const [verifiableCredential, inputDescriptorIds] of inputDescriptorsForMdocCredential.entries()) {\n if (verifiableCredential.claimFormat !== ClaimFormat.MsoMdoc) continue\n\n const inputDescriptorsForCredential = presentationDefinition.input_descriptors.filter(({ id }) =>\n inputDescriptorIds.has(id)\n )\n\n const mdoc = Mdoc.fromBase64Url(verifiableCredential.credentialRecord.base64Url)\n verifiableCredential.disclosedPayload = MdocDeviceResponse.limitDisclosureToInputDescriptor({\n inputDescriptor: {\n id: mdoc.docType,\n format: {\n mso_mdoc: {\n alg: [],\n },\n },\n constraints: {\n limit_disclosure: 'required',\n fields: inputDescriptorsForCredential.flatMap((i) => i.constraints?.fields ?? []),\n },\n },\n mdoc: Mdoc.fromBase64Url(verifiableCredential.credentialRecord.base64Url),\n })\n }\n\n // There may be no requirements if we filter out all optional ones. To not makes things too complicated, we see it as an error\n // for now if a request is made that has no required requirements (but only e.g. min: 0, which means we don't need to disclose anything)\n // I see this more as the fault of the presentation definition, as it should have at least some requirements.\n if (presentationSubmission.requirements.length === 0) {\n throw new DifPresentationExchangeError(\n 'Presentation Definition does not require any credentials. Optional credentials are not included in the presentation submission.'\n )\n }\n\n if (selectResults.areRequiredCredentialsPresent === Status.ERROR) {\n return presentationSubmission\n }\n\n return {\n ...presentationSubmission,\n\n // If all requirements are satisfied, the presentation submission is satisfied\n areRequirementsSatisfied: presentationSubmission.requirements.every(\n (requirement) => requirement.isRequirementSatisfied\n ),\n }\n}\n\nfunction getSubmissionRequirements(\n presentationDefinition: IPresentationDefinition,\n selectResults: CredentialRecordSelectResults\n): Array<DifPexCredentialsForRequestRequirement> {\n const submissionRequirements: Array<DifPexCredentialsForRequestRequirement> = []\n\n const matches = selectResults.matches as SubmissionRequirementMatchFrom[]\n if (!matches.every((match) => match.type === SubmissionRequirementMatchType.SubmissionRequirement && match.from)) {\n throw new DifPresentationExchangeError(\n `Expected all matches to be of type '${SubmissionRequirementMatchType.SubmissionRequirement}' with 'from' key.`\n )\n }\n\n // There are submission requirements, so we need to select the input_descriptors\n // based on the submission requirements\n presentationDefinition.submission_requirements?.forEach((submissionRequirement, submissionRequirementIndex) => {\n // Check: if the submissionRequirement uses `from_nested`, as we don't support this yet\n if (submissionRequirement.from_nested) {\n throw new DifPresentationExchangeError(\n \"Presentation definition contains requirement using 'from_nested', which is not supported yet.\"\n )\n }\n\n // Check if there's a 'from'. If not the structure is not as we expect it\n if (!submissionRequirement.from) {\n throw new DifPresentationExchangeError(\"Missing 'from' in submission requirement match\")\n }\n\n const match = matches.find((match) => match.id === submissionRequirementIndex)\n if (!match) {\n throw new Error(`Unable to find a match for submission requirement with index '${submissionRequirementIndex}'`)\n }\n\n if (submissionRequirement.rule === Rules.All) {\n const selectedSubmission = getSubmissionRequirementRuleAll(\n submissionRequirement,\n presentationDefinition,\n selectResults.verifiableCredential,\n match\n )\n submissionRequirements.push(selectedSubmission)\n } else {\n const selectedSubmission = getSubmissionRequirementRulePick(\n submissionRequirement,\n presentationDefinition,\n selectResults.verifiableCredential,\n match\n )\n\n submissionRequirements.push(selectedSubmission)\n }\n })\n\n // Submission may have requirement that doesn't require a credential to be submitted (e.g. min: 0)\n // We use minimization strategy, and thus only disclose the minimum amount of information\n const requirementsWithCredentials = submissionRequirements.filter((requirement) => requirement.needsCount > 0)\n\n return requirementsWithCredentials\n}\n\nfunction getSubmissionRequirementsForAllInputDescriptors(\n inputDescriptors: Array<InputDescriptorV1> | Array<InputDescriptorV2>,\n selectResults: CredentialRecordSelectResults\n): Array<DifPexCredentialsForRequestRequirement> {\n const submissionRequirements: Array<DifPexCredentialsForRequestRequirement> = []\n\n const matches = selectResults.matches as SubmissionRequirementMatchInputDescriptor[]\n if (!matches.every((match) => match.type === SubmissionRequirementMatchType.InputDescriptor)) {\n throw new DifPresentationExchangeError(\n `Expected all matches to be of type '${SubmissionRequirementMatchType.InputDescriptor}' when.`\n )\n }\n\n for (const inputDescriptor of inputDescriptors) {\n const submission = getSubmissionForInputDescriptor(inputDescriptor, selectResults.verifiableCredential, matches)\n submissionRequirements.push({\n rule: Rules.Pick,\n needsCount: 1, // Every input descriptor is a distinct requirement, so the count is always 1,\n submissionEntry: [submission],\n isRequirementSatisfied: submission.verifiableCredentials.length >= 1,\n })\n }\n\n return submissionRequirements\n}\n\nfunction getSubmissionRequirementRuleAll(\n submissionRequirement: SubmissionRequirement,\n presentationDefinition: IPresentationDefinition,\n verifiableCredentials: SubmissionEntryCredential[],\n match: SubmissionRequirementMatchFrom\n) {\n // Check if there's a 'from'. If not the structure is not as we expect it\n if (!submissionRequirement.from)\n throw new DifPresentationExchangeError(\"Missing 'from' in submission requirement match.\")\n\n const selectedSubmission: DifPexCredentialsForRequestRequirement = {\n rule: Rules.All,\n needsCount: 0,\n name: submissionRequirement.name,\n purpose: submissionRequirement.purpose,\n submissionEntry: [],\n isRequirementSatisfied: false,\n }\n\n for (const inputDescriptor of presentationDefinition.input_descriptors) {\n // We only want to get the submission if the input descriptor belongs to the group\n if (!inputDescriptor.group?.includes(match.from)) continue\n\n const submission = getSubmissionForInputDescriptor(inputDescriptor, verifiableCredentials, match.input_descriptors)\n\n // Rule ALL, so for every input descriptor that matches in this group, we need to add it\n selectedSubmission.needsCount += 1\n selectedSubmission.submissionEntry.push(submission)\n }\n\n return {\n ...selectedSubmission,\n\n // If all submissions have a credential, the requirement is satisfied\n isRequirementSatisfied: selectedSubmission.submissionEntry.every(\n (submission) => submission.verifiableCredentials.length >= 1\n ),\n }\n}\n\nfunction getSubmissionRequirementRulePick(\n submissionRequirement: SubmissionRequirement,\n presentationDefinition: IPresentationDefinition,\n verifiableCredentials: SubmissionEntryCredential[],\n match: SubmissionRequirementMatchFrom\n) {\n // Check if there's a 'from'. If not the structure is not as we expect it\n if (!submissionRequirement.from) {\n throw new DifPresentationExchangeError(\"Missing 'from' in submission requirement match.\")\n }\n\n const selectedSubmission: DifPexCredentialsForRequestRequirement = {\n rule: Rules.Pick,\n needsCount: submissionRequirement.count ?? submissionRequirement.min ?? 1,\n name: submissionRequirement.name,\n purpose: submissionRequirement.purpose,\n // If there's no count, min, or max we assume one credential is required for submission\n // however, the exact behavior is not specified in the spec\n submissionEntry: [],\n isRequirementSatisfied: false,\n }\n\n const satisfiedSubmissions: Array<DifPexCredentialsForRequestSubmissionEntry> = []\n const unsatisfiedSubmissions: Array<DifPexCredentialsForRequestSubmissionEntry> = []\n\n for (const inputDescriptor of presentationDefinition.input_descriptors) {\n // We only want to get the submission if the input descriptor belongs to the group\n if (!inputDescriptor.group?.includes(match.from)) continue\n\n const submission = getSubmissionForInputDescriptor(inputDescriptor, verifiableCredentials, match.input_descriptors)\n\n if (submission.verifiableCredentials.length >= 1) {\n satisfiedSubmissions.push(submission)\n } else {\n unsatisfiedSubmissions.push(submission)\n }\n\n // If we have found enough credentials to satisfy the requirement, we could stop\n // but the user may not want the first x that match, so we continue and return all matches\n // if (satisfiedSubmissions.length === selectedSubmission.needsCount) break\n }\n\n return {\n ...selectedSubmission,\n\n // If there are enough satisfied submissions, the requirement is satisfied\n isRequirementSatisfied: satisfiedSubmissions.length >= selectedSubmission.needsCount,\n\n // if the requirement is satisfied, we only need to return the satisfied submissions\n // however if the requirement is not satisfied, we include all entries so the wallet could\n // render which credentials are missing.\n submissionEntry:\n satisfiedSubmissions.length >= selectedSubmission.needsCount\n ? satisfiedSubmissions\n : [...satisfiedSubmissions, ...unsatisfiedSubmissions],\n }\n}\n\nfunction getSubmissionForInputDescriptor(\n inputDescriptor: InputDescriptorV1 | InputDescriptorV2,\n verifiableCredentials: SubmissionEntryCredential[],\n matches: SubmissionRequirementMatchInputDescriptor[]\n): DifPexCredentialsForRequestSubmissionEntry {\n const matchesForInputDescriptor = matches.filter((m) => m.id === inputDescriptor.id)\n\n const submissionEntry: DifPexCredentialsForRequestSubmissionEntry = {\n inputDescriptorId: inputDescriptor.id,\n name: inputDescriptor.name,\n purpose: inputDescriptor.purpose,\n verifiableCredentials: matchesForInputDescriptor.flatMap((matchForInputDescriptor) =>\n extractCredentialsFromInputDescriptorMatch(matchForInputDescriptor, verifiableCredentials)\n ),\n }\n\n // return early if no matches.\n if (!matchesForInputDescriptor?.length) return submissionEntry\n\n return submissionEntry\n}\n\nfunction extractCredentialsFromInputDescriptorMatch(\n match: SubmissionRequirementMatchInputDescriptor,\n availableCredentials: SubmissionEntryCredential[]\n) {\n const verifiableCredentials: SubmissionEntryCredential[] = []\n\n for (const vcPath of match.vc_path) {\n const [verifiableCredential] = JSONPath.query(\n { verifiableCredential: availableCredentials },\n vcPath\n ) as SubmissionEntryCredential[]\n verifiableCredentials.push(verifiableCredential)\n }\n\n return verifiableCredentials\n}\n\n/**\n * Custom SelectResults that includes the Credo records instead of the encoded verifiable credential\n */\ntype CredentialRecordSelectResults = Omit<SelectResults, 'verifiableCredential'> & {\n verifiableCredential: SubmissionEntryCredential[]\n matches: SubmissionRequirementMatch[]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAiCA,eAAsB,yBAEpB,KACA,wBACA,mBACsC;CACtC,MAAM,qBAAqB,kBAAkB,IAAI,wCAAwC;CACzF,MAAM,mBAAmB,IAAI,WAAW,wBAAwB,mBAAmB;CAEnF,MAAMA,gBAA+C;EACnD,GAAG;EACH,SAAS,iBAAiB,WAAW,EAAE;EAEvC,sBACE,iBAAiB,sBAAsB,KAAK,iBAAiB,UAAqC;GAChG,MAAM,wBAAwB,iBAAiB,YAAY;AAC3D,OAAI,0BAA0B,UAAa,0BAA0B,GACnE,OAAM,IAAI,6BAA6B,mDAAmD;GAE5F,MAAM,mBAAmB,kBAAkB;AAC3C,OAAI,4BAA4B,eAAe;IAG7C,MAAM,EAAE,KAAK,gBAAgB,gBAAgB,iBAA2B,OAAO,KAAK;IACpF,MAAM,eAAe,cAAc,IAAI,SAAS,aAAa,OAAO,KAAK;AAEzE,WAAO;KACL,aAAa,YAAY;KACzB;KACA,kBAAkB;KACnB;;AAEH,OAAI,4BAA4B,WAC9B,QAAO;IACL,aAAa,YAAY;IACzB;IACA,kBAAkB,EAAE;IACrB;AAEH,OAAI,4BAA4B,oBAC9B,QAAO;IACL,aAAa,iBAAiB,WAAW;IACzC;IACD;AAEH,SAAM,IAAI,WAAW,sCAAsC;IAC3D,IAAI,EAAE;EACX;CAED,MAAMC,yBAAsD;EAC1D,cA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B;EAK1E,iBACE,qBAAqB,UAAU,mBAAmB,aAC9C,uBACA,CAAC,GAAG,sBAAsB,GAAG,uBAAuB;EAC3D;;AAGH,SAAS,gCACP,iBACA,uBACA,SAC4C;CAC5C,MAAM,4BAA4B,QAAQ,QAAQ,MAAM,EAAE,OAAO,gBAAgB,GAAG;CAEpF,MAAMC,kBAA8D;EAClE,mBAAmB,gBAAgB;EACnC,MAAM,gBAAgB;EACtB,SAAS,gBAAgB;EACzB,uBAAuB,0BAA0B,SAAS,4BACxD,2CAA2C,yBAAyB,sBAAsB,CAC3F;EACF;AAGD,KAAI,CAAC,2BAA2B,OAAQ,QAAO;AAE/C,QAAO;;AAGT,SAAS,2CACP,OACA,sBACA;CACA,MAAMC,wBAAqD,EAAE;AAE7D,MAAK,MAAM,UAAU,MAAM,SAAS;EAClC,MAAM,CAAC,wBAAwB,SAAS,MACtC,EAAE,sBAAsB,sBAAsB,EAC9C,OACD;AACD,wBAAsB,KAAK,qBAAqB;;AAGlD,QAAO"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
const require_transform = require('./transform.js');
|
|
4
4
|
const require_credentialSelection = require('./credentialSelection.js');
|
|
5
|
-
const require_presentationsToCreate = require('./presentationsToCreate.js');
|
|
6
5
|
const require_presentationSelection = require('./presentationSelection.js');
|
|
6
|
+
const require_presentationsToCreate = require('./presentationsToCreate.js');
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
import { getSphereonOriginalVerifiableCredential, getSphereonOriginalVerifiablePresentation, getVerifiablePresentationFromEncoded } from "./transform.mjs";
|
|
4
4
|
import { getCredentialsForRequest } from "./credentialSelection.mjs";
|
|
5
|
-
import { getPresentationsToCreate } from "./presentationsToCreate.mjs";
|
|
6
5
|
import { extractPresentationsWithDescriptorsFromSubmission } from "./presentationSelection.mjs";
|
|
6
|
+
import { getPresentationsToCreate } from "./presentationsToCreate.mjs";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { SingleOrArray } from "../../../types.mjs";
|
|
1
2
|
import { ClaimFormat } from "../../vc/models/ClaimFormat.mjs";
|
|
2
3
|
import { W3cJsonLdVerifiableCredential } from "../../vc/data-integrity/models/W3cJsonLdVerifiableCredential.mjs";
|
|
3
|
-
import { W3cJwtVerifiableCredential } from "../../vc/jwt-vc/W3cJwtVerifiableCredential.mjs";
|
|
4
|
-
import { W3cJwtVerifiablePresentation } from "../../vc/jwt-vc/W3cJwtVerifiablePresentation.mjs";
|
|
5
|
-
import { Mdoc } from "../../mdoc/Mdoc.mjs";
|
|
6
4
|
import { SdJwtVcHeader, SdJwtVcPayload } from "../../sd-jwt-vc/SdJwtVcOptions.mjs";
|
|
7
5
|
import { SdJwtVc } from "../../sd-jwt-vc/SdJwtVcService.mjs";
|
|
8
|
-
import { W3cJsonLdVerifiablePresentation } from "../../vc/data-integrity/models/W3cJsonLdVerifiablePresentation.mjs";
|
|
9
6
|
import { MdocDeviceResponse } from "../../mdoc/MdocDeviceResponse.mjs";
|
|
7
|
+
import { W3cJwtVerifiableCredential } from "../../vc/jwt-vc/W3cJwtVerifiableCredential.mjs";
|
|
8
|
+
import { W3cJwtVerifiablePresentation } from "../../vc/jwt-vc/W3cJwtVerifiablePresentation.mjs";
|
|
10
9
|
import { DifPresentationExchangeDefinition, DifPresentationExchangeSubmission, VerifiablePresentation } from "../models/index.mjs";
|
|
11
|
-
import {
|
|
10
|
+
import { W3cJsonLdVerifiablePresentation } from "../../vc/data-integrity/models/W3cJsonLdVerifiablePresentation.mjs";
|
|
11
|
+
import { Mdoc } from "../../mdoc/Mdoc.mjs";
|
|
12
12
|
import * as _sphereon_pex_models20 from "@sphereon/pex-models";
|
|
13
13
|
|
|
14
14
|
//#region src/modules/dif-presentation-exchange/utils/presentationSelection.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentationSelection.d.mts","names":[],"sources":["../../../../src/modules/dif-presentation-exchange/utils/presentationSelection.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"presentationSelection.d.mts","names":[],"sources":["../../../../src/modules/dif-presentation-exchange/utils/presentationSelection.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;KAkBY,gCAAA,GAAmC,kBACtC;iBAEO,iDAAA,gBACC,cAAc,qCACjB,+CACA;;;;;;;;;;EANF,SAAA,UAAA,4BAAgC,gCAAA;EAAA,SAAA,eAAA,qFAAA;;WAAG,WAAA,qBAAA;EAAU,SAAA,UAAA,mCAAA;EAGzC,SAAA,YAAA,SAAiD,+BAAA;EAAA,SAAA,UAAA,SAAA,+BAAA;WAClC,eAAA,qFAAA"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { SingleOrArray } from "../../../types.js";
|
|
1
2
|
import { ClaimFormat } from "../../vc/models/ClaimFormat.js";
|
|
2
3
|
import { W3cJsonLdVerifiableCredential } from "../../vc/data-integrity/models/W3cJsonLdVerifiableCredential.js";
|
|
3
|
-
import { W3cJwtVerifiableCredential } from "../../vc/jwt-vc/W3cJwtVerifiableCredential.js";
|
|
4
|
-
import { W3cJwtVerifiablePresentation } from "../../vc/jwt-vc/W3cJwtVerifiablePresentation.js";
|
|
5
|
-
import { Mdoc } from "../../mdoc/Mdoc.js";
|
|
6
4
|
import { SdJwtVcHeader, SdJwtVcPayload } from "../../sd-jwt-vc/SdJwtVcOptions.js";
|
|
7
5
|
import { SdJwtVc } from "../../sd-jwt-vc/SdJwtVcService.js";
|
|
8
|
-
import { W3cJsonLdVerifiablePresentation } from "../../vc/data-integrity/models/W3cJsonLdVerifiablePresentation.js";
|
|
9
6
|
import { MdocDeviceResponse } from "../../mdoc/MdocDeviceResponse.js";
|
|
7
|
+
import { W3cJwtVerifiableCredential } from "../../vc/jwt-vc/W3cJwtVerifiableCredential.js";
|
|
8
|
+
import { W3cJwtVerifiablePresentation } from "../../vc/jwt-vc/W3cJwtVerifiablePresentation.js";
|
|
10
9
|
import { DifPresentationExchangeDefinition, DifPresentationExchangeSubmission, VerifiablePresentation } from "../models/index.js";
|
|
11
|
-
import {
|
|
10
|
+
import { W3cJsonLdVerifiablePresentation } from "../../vc/data-integrity/models/W3cJsonLdVerifiablePresentation.js";
|
|
11
|
+
import { Mdoc } from "../../mdoc/Mdoc.js";
|
|
12
12
|
import * as _sphereon_pex_models20 from "@sphereon/pex-models";
|
|
13
13
|
|
|
14
14
|
//#region src/modules/dif-presentation-exchange/utils/presentationSelection.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentationSelection.d.ts","names":[],"sources":["../../../../src/modules/dif-presentation-exchange/utils/presentationSelection.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"presentationSelection.d.ts","names":[],"sources":["../../../../src/modules/dif-presentation-exchange/utils/presentationSelection.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;KAkBY,gCAAA,GAAmC,kBACtC;iBAEO,iDAAA,gBACC,cAAc,qCACjB,+CACA;;;;;;;;EANF,SAAA,UAAA,mCAAgC;EAAA,SAAA,YAAA,8BAAA,kCAAA;WACnC,UAAA,4BAAA,gCAAA;WADsC,eAAA,qFAAA;CAAU,GAAA;EAGzC,SAAA,WAAA,qBAAA;EAAiD,SAAA,UAAA,mCAAA;WAClC,YAAA,SAAA,+BAAA;WAAd,UAAA,SAAA,+BAAA;WACH,eAAA,qFAAA"}
|
|
@@ -6,9 +6,9 @@ require('../../../error/index.js');
|
|
|
6
6
|
const require_ClaimFormat = require('../../vc/models/ClaimFormat.js');
|
|
7
7
|
const require_W3cJsonLdVerifiablePresentation = require('../../vc/data-integrity/models/W3cJsonLdVerifiablePresentation.js');
|
|
8
8
|
const require_W3cJwtVerifiablePresentation = require('../../vc/jwt-vc/W3cJwtVerifiablePresentation.js');
|
|
9
|
-
const require_W3cV2JwtVerifiablePresentation = require('../../vc/jwt-vc/W3cV2JwtVerifiablePresentation.js');
|
|
10
9
|
const require_W3cV2SdJwtVerifiablePresentation = require('../../vc/sd-jwt-vc/W3cV2SdJwtVerifiablePresentation.js');
|
|
11
10
|
require('../../vc/sd-jwt-vc/index.js');
|
|
11
|
+
const require_W3cV2JwtVerifiablePresentation = require('../../vc/jwt-vc/W3cV2JwtVerifiablePresentation.js');
|
|
12
12
|
require('../../vc/index.js');
|
|
13
13
|
const require_MdocDeviceResponse = require('../../mdoc/MdocDeviceResponse.js');
|
|
14
14
|
require('../../mdoc/index.js');
|
|
@@ -5,9 +5,9 @@ import "../../../error/index.mjs";
|
|
|
5
5
|
import { ClaimFormat } from "../../vc/models/ClaimFormat.mjs";
|
|
6
6
|
import { W3cJsonLdVerifiablePresentation } from "../../vc/data-integrity/models/W3cJsonLdVerifiablePresentation.mjs";
|
|
7
7
|
import { W3cJwtVerifiablePresentation } from "../../vc/jwt-vc/W3cJwtVerifiablePresentation.mjs";
|
|
8
|
-
import { W3cV2JwtVerifiablePresentation } from "../../vc/jwt-vc/W3cV2JwtVerifiablePresentation.mjs";
|
|
9
8
|
import { W3cV2SdJwtVerifiablePresentation } from "../../vc/sd-jwt-vc/W3cV2SdJwtVerifiablePresentation.mjs";
|
|
10
9
|
import "../../vc/sd-jwt-vc/index.mjs";
|
|
10
|
+
import { W3cV2JwtVerifiablePresentation } from "../../vc/jwt-vc/W3cV2JwtVerifiablePresentation.mjs";
|
|
11
11
|
import "../../vc/index.mjs";
|
|
12
12
|
import { MdocDeviceResponse } from "../../mdoc/MdocDeviceResponse.mjs";
|
|
13
13
|
import "../../mdoc/index.mjs";
|