@verana-labs/vs-agent-sdk 2.0.0-dev.6 → 2.0.0-dev.61

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.
Files changed (148) hide show
  1. package/README.md +0 -2
  2. package/build/adminApi/AdminApiError.d.ts +25 -0
  3. package/build/adminApi/AdminApiError.js +57 -0
  4. package/build/adminApi/AdminApiError.js.map +1 -0
  5. package/build/adminApi/didcommModules.d.ts +2 -0
  6. package/build/adminApi/didcommModules.js +8 -0
  7. package/build/adminApi/didcommModules.js.map +1 -0
  8. package/build/adminApi/index.d.ts +3 -0
  9. package/build/adminApi/index.js +20 -0
  10. package/build/adminApi/index.js.map +1 -0
  11. package/build/adminApi/moduleEndpoint.d.ts +8 -0
  12. package/build/adminApi/moduleEndpoint.js +28 -0
  13. package/build/adminApi/moduleEndpoint.js.map +1 -0
  14. package/build/agent/VsAgent.d.ts +15 -33
  15. package/build/agent/VsAgent.js +75 -205
  16. package/build/agent/VsAgent.js.map +1 -1
  17. package/build/agent/createVsAgent.d.ts +5 -5
  18. package/build/agent/createVsAgent.js +3 -5
  19. package/build/agent/createVsAgent.js.map +1 -1
  20. package/build/blockchain/AnonCredsTrustService.d.ts +62 -0
  21. package/build/blockchain/AnonCredsTrustService.js +256 -0
  22. package/build/blockchain/AnonCredsTrustService.js.map +1 -0
  23. package/build/blockchain/AuthorizationService.d.ts +5 -3
  24. package/build/blockchain/AuthorizationService.js +17 -29
  25. package/build/blockchain/AuthorizationService.js.map +1 -1
  26. package/build/blockchain/IndexerWebSocketService.d.ts +7 -1
  27. package/build/blockchain/IndexerWebSocketService.js +68 -36
  28. package/build/blockchain/IndexerWebSocketService.js.map +1 -1
  29. package/build/blockchain/VeranaChainService.d.ts +2 -13
  30. package/build/blockchain/VeranaChainService.js +8 -113
  31. package/build/blockchain/VeranaChainService.js.map +1 -1
  32. package/build/blockchain/VeranaIndexerService.d.ts +14 -1
  33. package/build/blockchain/VeranaIndexerService.js +122 -8
  34. package/build/blockchain/VeranaIndexerService.js.map +1 -1
  35. package/build/blockchain/handlers/authorizationHandlers.js +2 -2
  36. package/build/blockchain/handlers/authorizationHandlers.js.map +1 -1
  37. package/build/blockchain/handlers/defaultHandlers.js +2 -0
  38. package/build/blockchain/handlers/defaultHandlers.js.map +1 -1
  39. package/build/blockchain/handlers/index.d.ts +1 -0
  40. package/build/blockchain/handlers/index.js +1 -0
  41. package/build/blockchain/handlers/index.js.map +1 -1
  42. package/build/blockchain/handlers/selfIssuanceHandlers.d.ts +13 -0
  43. package/build/blockchain/handlers/selfIssuanceHandlers.js +71 -0
  44. package/build/blockchain/handlers/selfIssuanceHandlers.js.map +1 -0
  45. package/build/blockchain/handlers/stateMutations.d.ts +21 -2
  46. package/build/blockchain/handlers/stateMutations.js +280 -34
  47. package/build/blockchain/handlers/stateMutations.js.map +1 -1
  48. package/build/blockchain/index.d.ts +2 -0
  49. package/build/blockchain/index.js +2 -0
  50. package/build/blockchain/index.js.map +1 -1
  51. package/build/blockchain/indexerMappers.d.ts +3 -0
  52. package/build/blockchain/indexerMappers.js +53 -0
  53. package/build/blockchain/indexerMappers.js.map +1 -0
  54. package/build/blockchain/types.d.ts +5 -57
  55. package/build/blockchain/types.js.map +1 -1
  56. package/build/bootstrap/EcsBootstrapService.d.ts +14 -3
  57. package/build/bootstrap/EcsBootstrapService.js +155 -76
  58. package/build/bootstrap/EcsBootstrapService.js.map +1 -1
  59. package/build/credentials/FullTailsFileService.d.ts +0 -1
  60. package/build/credentials/FullTailsFileService.js +0 -49
  61. package/build/credentials/FullTailsFileService.js.map +1 -1
  62. package/build/did/CachedDocumentLoader.d.ts +3 -0
  63. package/build/did/CachedDocumentLoader.js +7 -1
  64. package/build/did/CachedDocumentLoader.js.map +1 -1
  65. package/build/did/CachedWebDidResolver.d.ts +0 -4
  66. package/build/did/CachedWebDidResolver.js +1 -5
  67. package/build/did/CachedWebDidResolver.js.map +1 -1
  68. package/build/did/artifactServices.d.ts +12 -0
  69. package/build/did/artifactServices.js +48 -0
  70. package/build/did/artifactServices.js.map +1 -0
  71. package/build/did/legacyDidWeb.d.ts +6 -4
  72. package/build/did/legacyDidWeb.js +17 -14
  73. package/build/did/legacyDidWeb.js.map +1 -1
  74. package/build/did/publicDid.d.ts +4 -0
  75. package/build/did/publicDid.js +19 -0
  76. package/build/did/publicDid.js.map +1 -0
  77. package/build/events/BaseMessageEvents.js +139 -5
  78. package/build/events/BaseMessageEvents.js.map +1 -1
  79. package/build/events/ConnectionEvents.js +110 -82
  80. package/build/events/ConnectionEvents.js.map +1 -1
  81. package/build/events/VsAgentEvents.d.ts +11 -9
  82. package/build/events/VsAgentEvents.js +8 -1
  83. package/build/events/VsAgentEvents.js.map +1 -1
  84. package/build/events/VtFlowEvents.d.ts +1 -1
  85. package/build/events/VtFlowEvents.js +2 -19
  86. package/build/events/VtFlowEvents.js.map +1 -1
  87. package/build/index.d.ts +6 -1
  88. package/build/index.js +10 -2
  89. package/build/index.js.map +1 -1
  90. package/build/plugins/setupBaseDidComm.js +6 -12
  91. package/build/plugins/setupBaseDidComm.js.map +1 -1
  92. package/build/transports/VsAgentWsInboundTransport.d.ts +1 -1
  93. package/build/transports/VsAgentWsInboundTransport.js +20 -14
  94. package/build/transports/VsAgentWsInboundTransport.js.map +1 -1
  95. package/build/types.d.ts +5 -0
  96. package/build/types.js.map +1 -1
  97. package/build/utils/agent.d.ts +29 -4
  98. package/build/utils/agent.js +91 -22
  99. package/build/utils/agent.js.map +1 -1
  100. package/build/utils/didReadiness.d.ts +9 -0
  101. package/build/utils/didReadiness.js +42 -0
  102. package/build/utils/didReadiness.js.map +1 -0
  103. package/build/utils/ecsClaims.d.ts +47 -0
  104. package/build/utils/ecsClaims.js +120 -0
  105. package/build/utils/ecsClaims.js.map +1 -0
  106. package/build/utils/ecsService.d.ts +8 -0
  107. package/build/utils/ecsService.js +23 -0
  108. package/build/utils/ecsService.js.map +1 -0
  109. package/build/utils/index.d.ts +4 -0
  110. package/build/utils/index.js +4 -0
  111. package/build/utils/index.js.map +1 -1
  112. package/build/utils/selfIssuedEcsCredential.d.ts +8 -0
  113. package/build/utils/selfIssuedEcsCredential.js +151 -0
  114. package/build/utils/selfIssuedEcsCredential.js.map +1 -0
  115. package/build/utils/setupSelfTr.d.ts +29 -66
  116. package/build/utils/setupSelfTr.js +78 -282
  117. package/build/utils/setupSelfTr.js.map +1 -1
  118. package/build/utils/trustCredentialStore.d.ts +67 -9
  119. package/build/utils/trustCredentialStore.js +296 -109
  120. package/build/utils/trustCredentialStore.js.map +1 -1
  121. package/build/utils/util.d.ts +10 -0
  122. package/build/utils/util.js +16 -0
  123. package/build/utils/util.js.map +1 -1
  124. package/build/utils/vcdm2.d.ts +34 -0
  125. package/build/utils/vcdm2.js +62 -0
  126. package/build/utils/vcdm2.js.map +1 -0
  127. package/build/utils/vtjscResolver.d.ts +18 -0
  128. package/build/utils/vtjscResolver.js +54 -0
  129. package/build/utils/vtjscResolver.js.map +1 -0
  130. package/build/vtFlow/VtFlowOrchestrator.d.ts +59 -13
  131. package/build/vtFlow/VtFlowOrchestrator.js +140 -92
  132. package/build/vtFlow/VtFlowOrchestrator.js.map +1 -1
  133. package/build/vtFlow/assertVerifiableService.d.ts +1 -0
  134. package/build/vtFlow/assertVerifiableService.js +45 -5
  135. package/build/vtFlow/assertVerifiableService.js.map +1 -1
  136. package/build/vtFlow/ecsIssuanceExemption.d.ts +12 -0
  137. package/build/vtFlow/ecsIssuanceExemption.js +84 -0
  138. package/build/vtFlow/ecsIssuanceExemption.js.map +1 -0
  139. package/build/vtFlow/index.d.ts +1 -0
  140. package/build/vtFlow/index.js +1 -0
  141. package/build/vtFlow/index.js.map +1 -1
  142. package/package.json +12 -12
  143. package/build/did/migrateWebVhLog.d.ts +0 -34
  144. package/build/did/migrateWebVhLog.js +0 -230
  145. package/build/did/migrateWebVhLog.js.map +0 -1
  146. package/build/did/migrateWebVhVersionTime.d.ts +0 -9
  147. package/build/did/migrateWebVhVersionTime.js +0 -191
  148. package/build/did/migrateWebVhVersionTime.js.map +0 -1
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.LINKED_VP_V1 = exports.DATA_INTEGRITY_V2 = exports.VC_REVOCATION_LIST_2020 = exports.PURL_OB_V3P0 = exports.PRESENTATION_SUBMISSION = exports.SCHEMA_ORG = exports.ODRL = exports.DID_V1 = exports.CREDENTIALS_EXAMPLE_V1 = exports.CREDENTIALS_V1 = exports.SECP256K1_2019_V1 = exports.ED25519_2020_V1 = exports.ED25519_2018_V1 = exports.MULTIKEY_V1 = exports.X25519_V1 = exports.SECURITY_V2 = exports.SECURITY_V1 = void 0;
39
+ exports.LINKED_VP_V1 = exports.DATA_INTEGRITY_V2 = exports.VC_REVOCATION_LIST_2020 = exports.PURL_OB_V3P0 = exports.PRESENTATION_SUBMISSION = exports.SCHEMA_ORG = exports.ODRL = exports.DID_V1 = exports.CREDENTIALS_EXAMPLE_V1 = exports.CREDENTIALS_UNDEFINED_TERMS_V2 = exports.CREDENTIALS_EXAMPLE_V2 = exports.CREDENTIALS_V2 = exports.CREDENTIALS_V1 = exports.SECP256K1_2019_V1 = exports.ED25519_2020_V1 = exports.ED25519_2018_V1 = exports.MULTIKEY_V1 = exports.X25519_V1 = exports.SECURITY_V2 = exports.SECURITY_V1 = void 0;
40
40
  exports.defaultDocumentLoader = defaultDocumentLoader;
41
41
  /* eslint-disable import/order */
42
42
  const core_1 = require("@credo-ts/core");
@@ -48,6 +48,9 @@ exports.ED25519_2018_V1 = JSON.parse('{"@context":{"id":"@id","type":"@type","@p
48
48
  exports.ED25519_2020_V1 = JSON.parse('{"@context":{"id":"@id","type":"@type","@protected":true,"proof":{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},"Ed25519VerificationKey2020":{"@id":"https://w3id.org/security#Ed25519VerificationKey2020","@context":{"@protected":true,"id":"@id","type":"@type","controller":{"@id":"https://w3id.org/security#controller","@type":"@id"},"revoked":{"@id":"https://w3id.org/security#revoked","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"publicKeyMultibase":{"@id":"https://w3id.org/security#publicKeyMultibase","@type":"https://w3id.org/security#multibase"}}},"Ed25519Signature2020":{"@id":"https://w3id.org/security#Ed25519Signature2020","@context":{"@protected":true,"id":"@id","type":"@type","challenge":"https://w3id.org/security#challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"domain":"https://w3id.org/security#domain","expires":{"@id":"https://w3id.org/security#expiration","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"nonce":"https://w3id.org/security#nonce","proofPurpose":{"@id":"https://w3id.org/security#proofPurpose","@type":"@vocab","@context":{"@protected":true,"id":"@id","type":"@type","assertionMethod":{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},"capabilityInvocation":{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},"capabilityDelegation":{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},"keyAgreement":{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"}}},"proofValue":{"@id":"https://w3id.org/security#proofValue","@type":"https://w3id.org/security#multibase"},"verificationMethod":{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}}}}');
49
49
  exports.SECP256K1_2019_V1 = JSON.parse('{"@context":{"id":"@id","type":"@type","@protected":true,"proof":{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},"EcdsaSecp256k1VerificationKey2019":{"@id":"https://w3id.org/security#EcdsaSecp256k1VerificationKey2019","@context":{"@protected":true,"id":"@id","type":"@type","controller":{"@id":"https://w3id.org/security#controller","@type":"@id"},"revoked":{"@id":"https://w3id.org/security#revoked","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"blockchainAccountId":{"@id":"https://w3id.org/security#blockchainAccountId"},"publicKeyJwk":{"@id":"https://w3id.org/security#publicKeyJwk","@type":"@json"},"publicKeyBase58":{"@id":"https://w3id.org/security#publicKeyBase58"},"publicKeyMultibase":{"@id":"https://w3id.org/security#publicKeyMultibase","@type":"https://w3id.org/security#multibase"}}},"EcdsaSecp256k1Signature2019":{"@id":"https://w3id.org/security#EcdsaSecp256k1Signature2019","@context":{"@protected":true,"id":"@id","type":"@type","challenge":"https://w3id.org/security#challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"domain":"https://w3id.org/security#domain","expires":{"@id":"https://w3id.org/security#expiration","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"nonce":"https://w3id.org/security#nonce","proofPurpose":{"@id":"https://w3id.org/security#proofPurpose","@type":"@vocab","@context":{"@protected":true,"id":"@id","type":"@type","assertionMethod":{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},"capabilityInvocation":{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},"capabilityDelegation":{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},"keyAgreement":{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"}}},"jws":{"@id":"https://w3id.org/security#jws"},"verificationMethod":{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}}}}');
50
50
  exports.CREDENTIALS_V1 = JSON.parse('{"@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","VerifiableCredential":{"@id":"https://www.w3.org/2018/credentials#VerifiableCredential","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","cred":"https://www.w3.org/2018/credentials#","sec":"https://w3id.org/security#","xsd":"http://www.w3.org/2001/XMLSchema#","credentialSchema":{"@id":"cred:credentialSchema","@type":"@id","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","cred":"https://www.w3.org/2018/credentials#","JsonSchemaValidator2018":"cred:JsonSchemaValidator2018"}},"credentialStatus":{"@id":"cred:credentialStatus","@type":"@id"},"credentialSubject":{"@id":"cred:credentialSubject","@type":"@id"},"evidence":{"@id":"cred:evidence","@type":"@id"},"expirationDate":{"@id":"cred:expirationDate","@type":"xsd:dateTime"},"holder":{"@id":"cred:holder","@type":"@id"},"issued":{"@id":"cred:issued","@type":"xsd:dateTime"},"issuer":{"@id":"cred:issuer","@type":"@id"},"issuanceDate":{"@id":"cred:issuanceDate","@type":"xsd:dateTime"},"proof":{"@id":"sec:proof","@type":"@id","@container":"@graph"},"refreshService":{"@id":"cred:refreshService","@type":"@id","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","cred":"https://www.w3.org/2018/credentials#","ManualRefreshService2018":"cred:ManualRefreshService2018"}},"termsOfUse":{"@id":"cred:termsOfUse","@type":"@id"},"validFrom":{"@id":"cred:validFrom","@type":"xsd:dateTime"},"validUntil":{"@id":"cred:validUntil","@type":"xsd:dateTime"}}},"VerifiablePresentation":{"@id":"https://www.w3.org/2018/credentials#VerifiablePresentation","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","cred":"https://www.w3.org/2018/credentials#","sec":"https://w3id.org/security#","holder":{"@id":"cred:holder","@type":"@id"},"proof":{"@id":"sec:proof","@type":"@id","@container":"@graph"},"verifiableCredential":{"@id":"cred:verifiableCredential","@type":"@id","@container":"@graph"}}},"EcdsaSecp256k1Signature2019":{"@id":"https://w3id.org/security#EcdsaSecp256k1Signature2019","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","xsd":"http://www.w3.org/2001/XMLSchema#","challenge":"sec:challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},"domain":"sec:domain","expires":{"@id":"sec:expiration","@type":"xsd:dateTime"},"jws":"sec:jws","nonce":"sec:nonce","proofPurpose":{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","assertionMethod":{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},"proofValue":"sec:proofValue","verificationMethod":{"@id":"sec:verificationMethod","@type":"@id"}}},"EcdsaSecp256r1Signature2019":{"@id":"https://w3id.org/security#EcdsaSecp256r1Signature2019","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","xsd":"http://www.w3.org/2001/XMLSchema#","challenge":"sec:challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},"domain":"sec:domain","expires":{"@id":"sec:expiration","@type":"xsd:dateTime"},"jws":"sec:jws","nonce":"sec:nonce","proofPurpose":{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","assertionMethod":{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},"proofValue":"sec:proofValue","verificationMethod":{"@id":"sec:verificationMethod","@type":"@id"}}},"Ed25519Signature2018":{"@id":"https://w3id.org/security#Ed25519Signature2018","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","xsd":"http://www.w3.org/2001/XMLSchema#","challenge":"sec:challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},"domain":"sec:domain","expires":{"@id":"sec:expiration","@type":"xsd:dateTime"},"jws":"sec:jws","nonce":"sec:nonce","proofPurpose":{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","assertionMethod":{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},"proofValue":"sec:proofValue","verificationMethod":{"@id":"sec:verificationMethod","@type":"@id"}}},"RsaSignature2018":{"@id":"https://w3id.org/security#RsaSignature2018","@context":{"@version":1.1,"@protected":true,"challenge":"sec:challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},"domain":"sec:domain","expires":{"@id":"sec:expiration","@type":"xsd:dateTime"},"jws":"sec:jws","nonce":"sec:nonce","proofPurpose":{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","assertionMethod":{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},"proofValue":"sec:proofValue","verificationMethod":{"@id":"sec:verificationMethod","@type":"@id"}}},"proof":{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"}}}');
51
+ exports.CREDENTIALS_V2 = JSON.parse('{"@context":{"@protected":true,"id":"@id","type":"@type","description":"https://schema.org/description","digestMultibase":{"@id":"https://w3id.org/security#digestMultibase","@type":"https://w3id.org/security#multibase"},"digestSRI":{"@id":"https://www.w3.org/2018/credentials#digestSRI","@type":"https://www.w3.org/2018/credentials#sriString"},"mediaType":{"@id":"https://schema.org/encodingFormat"},"name":"https://schema.org/name","VerifiableCredential":{"@id":"https://www.w3.org/2018/credentials#VerifiableCredential","@context":{"@protected":true,"id":"@id","type":"@type","confidenceMethod":{"@id":"https://www.w3.org/2018/credentials#confidenceMethod","@type":"@id"},"credentialSchema":{"@id":"https://www.w3.org/2018/credentials#credentialSchema","@type":"@id"},"credentialStatus":{"@id":"https://www.w3.org/2018/credentials#credentialStatus","@type":"@id"},"credentialSubject":{"@id":"https://www.w3.org/2018/credentials#credentialSubject","@type":"@id"},"description":"https://schema.org/description","evidence":{"@id":"https://www.w3.org/2018/credentials#evidence","@type":"@id"},"issuer":{"@id":"https://www.w3.org/2018/credentials#issuer","@type":"@id"},"name":"https://schema.org/name","proof":{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},"refreshService":{"@id":"https://www.w3.org/2018/credentials#refreshService","@type":"@id"},"relatedResource":{"@id":"https://www.w3.org/2018/credentials#relatedResource","@type":"@id"},"renderMethod":{"@id":"https://www.w3.org/2018/credentials#renderMethod","@type":"@id"},"termsOfUse":{"@id":"https://www.w3.org/2018/credentials#termsOfUse","@type":"@id"},"validFrom":{"@id":"https://www.w3.org/2018/credentials#validFrom","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"validUntil":{"@id":"https://www.w3.org/2018/credentials#validUntil","@type":"http://www.w3.org/2001/XMLSchema#dateTime"}}},"EnvelopedVerifiableCredential":"https://www.w3.org/2018/credentials#EnvelopedVerifiableCredential","VerifiablePresentation":{"@id":"https://www.w3.org/2018/credentials#VerifiablePresentation","@context":{"@protected":true,"id":"@id","type":"@type","holder":{"@id":"https://www.w3.org/2018/credentials#holder","@type":"@id"},"proof":{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},"termsOfUse":{"@id":"https://www.w3.org/2018/credentials#termsOfUse","@type":"@id"},"verifiableCredential":{"@id":"https://www.w3.org/2018/credentials#verifiableCredential","@type":"@id","@container":"@graph","@context":null}}},"EnvelopedVerifiablePresentation":"https://www.w3.org/2018/credentials#EnvelopedVerifiablePresentation","JsonSchemaCredential":"https://www.w3.org/2018/credentials#JsonSchemaCredential","JsonSchema":{"@id":"https://www.w3.org/2018/credentials#JsonSchema","@context":{"@protected":true,"id":"@id","type":"@type","jsonSchema":{"@id":"https://www.w3.org/2018/credentials#jsonSchema","@type":"@json"}}},"BitstringStatusListCredential":"https://www.w3.org/ns/credentials/status#BitstringStatusListCredential","BitstringStatusList":{"@id":"https://www.w3.org/ns/credentials/status#BitstringStatusList","@context":{"@protected":true,"id":"@id","type":"@type","encodedList":{"@id":"https://www.w3.org/ns/credentials/status#encodedList","@type":"https://w3id.org/security#multibase"},"statusPurpose":"https://www.w3.org/ns/credentials/status#statusPurpose","ttl":"https://www.w3.org/ns/credentials/status#ttl"}},"BitstringStatusListEntry":{"@id":"https://www.w3.org/ns/credentials/status#BitstringStatusListEntry","@context":{"@protected":true,"id":"@id","type":"@type","statusListCredential":{"@id":"https://www.w3.org/ns/credentials/status#statusListCredential","@type":"@id"},"statusListIndex":"https://www.w3.org/ns/credentials/status#statusListIndex","statusPurpose":"https://www.w3.org/ns/credentials/status#statusPurpose","statusMessage":{"@id":"https://www.w3.org/ns/credentials/status#statusMessage","@context":{"@protected":true,"id":"@id","type":"@type","message":"https://www.w3.org/ns/credentials/status#message","status":"https://www.w3.org/ns/credentials/status#status"}},"statusReference":{"@id":"https://www.w3.org/ns/credentials/status#statusReference","@type":"@id"},"statusSize":{"@id":"https://www.w3.org/ns/credentials/status#statusSize","@type":"https://www.w3.org/2001/XMLSchema#integer"}}},"DataIntegrityProof":{"@id":"https://w3id.org/security#DataIntegrityProof","@context":{"@protected":true,"id":"@id","type":"@type","challenge":"https://w3id.org/security#challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"cryptosuite":{"@id":"https://w3id.org/security#cryptosuite","@type":"https://w3id.org/security#cryptosuiteString"},"domain":"https://w3id.org/security#domain","expires":{"@id":"https://w3id.org/security#expiration","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"nonce":"https://w3id.org/security#nonce","previousProof":{"@id":"https://w3id.org/security#previousProof","@type":"@id"},"proofPurpose":{"@id":"https://w3id.org/security#proofPurpose","@type":"@vocab","@context":{"@protected":true,"id":"@id","type":"@type","assertionMethod":{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},"capabilityDelegation":{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},"capabilityInvocation":{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},"keyAgreement":{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"}}},"proofValue":{"@id":"https://w3id.org/security#proofValue","@type":"https://w3id.org/security#multibase"},"verificationMethod":{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}},"...":{"@id":"https://www.iana.org/assignments/jwt#..."},"_sd":{"@id":"https://www.iana.org/assignments/jwt#_sd","@type":"@json"},"_sd_alg":{"@id":"https://www.iana.org/assignments/jwt#_sd_alg"},"aud":{"@id":"https://www.iana.org/assignments/jwt#aud","@type":"@id"},"cnf":{"@id":"https://www.iana.org/assignments/jwt#cnf","@context":{"@protected":true,"kid":{"@id":"https://www.iana.org/assignments/jwt#kid","@type":"@id"},"jwk":{"@id":"https://www.iana.org/assignments/jwt#jwk","@type":"@json"}}},"exp":{"@id":"https://www.iana.org/assignments/jwt#exp","@type":"https://www.w3.org/2001/XMLSchema#nonNegativeInteger"},"iat":{"@id":"https://www.iana.org/assignments/jwt#iat","@type":"https://www.w3.org/2001/XMLSchema#nonNegativeInteger"},"iss":{"@id":"https://www.iana.org/assignments/jose#iss","@type":"@id"},"jku":{"@id":"https://www.iana.org/assignments/jose#jku","@type":"@id"},"kid":{"@id":"https://www.iana.org/assignments/jose#kid","@type":"@id"},"nbf":{"@id":"https://www.iana.org/assignments/jwt#nbf","@type":"https://www.w3.org/2001/XMLSchema#nonNegativeInteger"},"sub":{"@id":"https://www.iana.org/assignments/jose#sub","@type":"@id"},"x5u":{"@id":"https://www.iana.org/assignments/jose#x5u","@type":"@id"}}}');
52
+ exports.CREDENTIALS_EXAMPLE_V2 = JSON.parse('{"@context":{"@vocab":"https://www.w3.org/ns/credentials/examples#"}}');
53
+ exports.CREDENTIALS_UNDEFINED_TERMS_V2 = JSON.parse('{"@context":{"@vocab":"https://www.w3.org/ns/credentials/undefined-term#"}}');
51
54
  exports.CREDENTIALS_EXAMPLE_V1 = JSON.parse('{"@context":[{"@version":1.1},"https://www.w3.org/ns/odrl.jsonld",{"ex":"https://example.org/examples#","schema":"http://schema.org/","rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#","3rdPartyCorrelation":"ex:3rdPartyCorrelation","AllVerifiers":"ex:AllVerifiers","Archival":"ex:Archival","BachelorDegree":"ex:BachelorDegree","Child":"ex:Child","CLCredentialDefinition2019":"ex:CLCredentialDefinition2019","CLSignature2019":"ex:CLSignature2019","IssuerPolicy":"ex:IssuerPolicy","HolderPolicy":"ex:HolderPolicy","Mother":"ex:Mother","RelationshipCredential":"ex:RelationshipCredential","UniversityDegreeCredential":"ex:UniversityDegreeCredential","AlumniCredential":"ex:AlumniCredential","DisputeCredential":"ex:DisputeCredential","PrescriptionCredential":"ex:PrescriptionCredential","ZkpExampleSchema2018":"ex:ZkpExampleSchema2018","issuerData":"ex:issuerData","attributes":"ex:attributes","signature":"ex:signature","signatureCorrectnessProof":"ex:signatureCorrectnessProof","primaryProof":"ex:primaryProof","nonRevocationProof":"ex:nonRevocationProof","alumniOf":{"@id":"schema:alumniOf","@type":"rdf:HTML"},"child":{"@id":"ex:child","@type":"@id"},"degree":"ex:degree","degreeType":"ex:degreeType","degreeSchool":"ex:degreeSchool","college":"ex:college","name":{"@id":"schema:name","@type":"rdf:HTML"},"givenName":"schema:givenName","familyName":"schema:familyName","parent":{"@id":"ex:parent","@type":"@id"},"referenceId":"ex:referenceId","documentPresence":"ex:documentPresence","evidenceDocument":"ex:evidenceDocument","spouse":"schema:spouse","subjectPresence":"ex:subjectPresence","verifier":{"@id":"ex:verifier","@type":"@id"},"currentStatus":"ex:currentStatus","statusReason":"ex:statusReason","prescription":"ex:prescription"}]}');
52
55
  exports.DID_V1 = JSON.parse('{"@context":{"@protected":true,"id":"@id","type":"@type","alsoKnownAs":{"@id":"https://www.w3.org/ns/activitystreams#alsoKnownAs","@type":"@id"},"assertionMethod":{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},"capabilityDelegation":{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},"capabilityInvocation":{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},"controller":{"@id":"https://w3id.org/security#controller","@type":"@id"},"keyAgreement":{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"},"service":{"@id":"https://www.w3.org/ns/did#service","@type":"@id","@context":{"@protected":true,"id":"@id","type":"@type","serviceEndpoint":{"@id":"https://www.w3.org/ns/did#serviceEndpoint","@type":"@id"}}},"verificationMethod":{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}}');
53
56
  exports.ODRL = JSON.parse('{"@context":{"odrl":"http://www.w3.org/ns/odrl/2/","rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#","rdfs":"http://www.w3.org/2000/01/rdf-schema#","owl":"http://www.w3.org/2002/07/owl#","skos":"http://www.w3.org/2004/02/skos/core#","dct":"http://purl.org/dc/terms/","xsd":"http://www.w3.org/2001/XMLSchema#","vcard":"http://www.w3.org/2006/vcard/ns#","foaf":"http://xmlns.com/foaf/0.1/","schema":"http://schema.org/","cc":"http://creativecommons.org/ns#","uid":"@id","type":"@type","Policy":"odrl:Policy","Rule":"odrl:Rule","profile":{"@type":"@id","@id":"odrl:profile"},"inheritFrom":{"@type":"@id","@id":"odrl:inheritFrom"},"ConflictTerm":"odrl:ConflictTerm","conflict":{"@type":"@vocab","@id":"odrl:conflict"},"perm":"odrl:perm","prohibit":"odrl:prohibit","invalid":"odrl:invalid","Agreement":"odrl:Agreement","Assertion":"odrl:Assertion","Offer":"odrl:Offer","Privacy":"odrl:Privacy","Request":"odrl:Request","Set":"odrl:Set","Ticket":"odrl:Ticket","Asset":"odrl:Asset","AssetCollection":"odrl:AssetCollection","relation":{"@type":"@id","@id":"odrl:relation"},"hasPolicy":{"@type":"@id","@id":"odrl:hasPolicy"},"target":{"@type":"@id","@id":"odrl:target"},"output":{"@type":"@id","@id":"odrl:output"},"partOf":{"@type":"@id","@id":"odrl:partOf"},"source":{"@type":"@id","@id":"odrl:source"},"Party":"odrl:Party","PartyCollection":"odrl:PartyCollection","function":{"@type":"@vocab","@id":"odrl:function"},"PartyScope":"odrl:PartyScope","assignee":{"@type":"@id","@id":"odrl:assignee"},"assigner":{"@type":"@id","@id":"odrl:assigner"},"assigneeOf":{"@type":"@id","@id":"odrl:assigneeOf"},"assignerOf":{"@type":"@id","@id":"odrl:assignerOf"},"attributedParty":{"@type":"@id","@id":"odrl:attributedParty"},"attributingParty":{"@type":"@id","@id":"odrl:attributingParty"},"compensatedParty":{"@type":"@id","@id":"odrl:compensatedParty"},"compensatingParty":{"@type":"@id","@id":"odrl:compensatingParty"},"consentingParty":{"@type":"@id","@id":"odrl:consentingParty"},"consentedParty":{"@type":"@id","@id":"odrl:consentedParty"},"informedParty":{"@type":"@id","@id":"odrl:informedParty"},"informingParty":{"@type":"@id","@id":"odrl:informingParty"},"trackingParty":{"@type":"@id","@id":"odrl:trackingParty"},"trackedParty":{"@type":"@id","@id":"odrl:trackedParty"},"contractingParty":{"@type":"@id","@id":"odrl:contractingParty"},"contractedParty":{"@type":"@id","@id":"odrl:contractedParty"},"Action":"odrl:Action","action":{"@type":"@vocab","@id":"odrl:action"},"includedIn":{"@type":"@id","@id":"odrl:includedIn"},"implies":{"@type":"@id","@id":"odrl:implies"},"Permission":"odrl:Permission","permission":{"@type":"@id","@id":"odrl:permission"},"Prohibition":"odrl:Prohibition","prohibition":{"@type":"@id","@id":"odrl:prohibition"},"obligation":{"@type":"@id","@id":"odrl:obligation"},"use":"odrl:use","grantUse":"odrl:grantUse","aggregate":"odrl:aggregate","annotate":"odrl:annotate","anonymize":"odrl:anonymize","archive":"odrl:archive","concurrentUse":"odrl:concurrentUse","derive":"odrl:derive","digitize":"odrl:digitize","display":"odrl:display","distribute":"odrl:distribute","execute":"odrl:execute","extract":"odrl:extract","give":"odrl:give","index":"odrl:index","install":"odrl:install","modify":"odrl:modify","move":"odrl:move","play":"odrl:play","present":"odrl:present","print":"odrl:print","read":"odrl:read","reproduce":"odrl:reproduce","sell":"odrl:sell","stream":"odrl:stream","textToSpeech":"odrl:textToSpeech","transfer":"odrl:transfer","transform":"odrl:transform","translate":"odrl:translate","Duty":"odrl:Duty","duty":{"@type":"@id","@id":"odrl:duty"},"consequence":{"@type":"@id","@id":"odrl:consequence"},"remedy":{"@type":"@id","@id":"odrl:remedy"},"acceptTracking":"odrl:acceptTracking","attribute":"odrl:attribute","compensate":"odrl:compensate","delete":"odrl:delete","ensureExclusivity":"odrl:ensureExclusivity","include":"odrl:include","inform":"odrl:inform","nextPolicy":"odrl:nextPolicy","obtainConsent":"odrl:obtainConsent","reviewPolicy":"odrl:reviewPolicy","uninstall":"odrl:uninstall","watermark":"odrl:watermark","Constraint":"odrl:Constraint","LogicalConstraint":"odrl:LogicalConstraint","constraint":{"@type":"@id","@id":"odrl:constraint"},"refinement":{"@type":"@id","@id":"odrl:refinement"},"Operator":"odrl:Operator","operator":{"@type":"@vocab","@id":"odrl:operator"},"RightOperand":"odrl:RightOperand","rightOperand":"odrl:rightOperand","rightOperandReference":{"@type":"xsd:anyURI","@id":"odrl:rightOperandReference"},"LeftOperand":"odrl:LeftOperand","leftOperand":{"@type":"@vocab","@id":"odrl:leftOperand"},"unit":"odrl:unit","dataType":{"@type":"xsd:anyType","@id":"odrl:datatype"},"status":"odrl:status","absolutePosition":"odrl:absolutePosition","absoluteSpatialPosition":"odrl:absoluteSpatialPosition","absoluteTemporalPosition":"odrl:absoluteTemporalPosition","absoluteSize":"odrl:absoluteSize","count":"odrl:count","dateTime":"odrl:dateTime","delayPeriod":"odrl:delayPeriod","deliveryChannel":"odrl:deliveryChannel","elapsedTime":"odrl:elapsedTime","event":"odrl:event","fileFormat":"odrl:fileFormat","industry":"odrl:industry:","language":"odrl:language","media":"odrl:media","meteredTime":"odrl:meteredTime","payAmount":"odrl:payAmount","percentage":"odrl:percentage","product":"odrl:product","purpose":"odrl:purpose","recipient":"odrl:recipient","relativePosition":"odrl:relativePosition","relativeSpatialPosition":"odrl:relativeSpatialPosition","relativeTemporalPosition":"odrl:relativeTemporalPosition","relativeSize":"odrl:relativeSize","resolution":"odrl:resolution","spatial":"odrl:spatial","spatialCoordinates":"odrl:spatialCoordinates","systemDevice":"odrl:systemDevice","timeInterval":"odrl:timeInterval","unitOfCount":"odrl:unitOfCount","version":"odrl:version","virtualLocation":"odrl:virtualLocation","eq":"odrl:eq","gt":"odrl:gt","gteq":"odrl:gteq","lt":"odrl:lt","lteq":"odrl:lteq","neq":"odrl:neq","isA":"odrl:isA","hasPart":"odrl:hasPart","isPartOf":"odrl:isPartOf","isAllOf":"odrl:isAllOf","isAnyOf":"odrl:isAnyOf","isNoneOf":"odrl:isNoneOf","or":"odrl:or","xone":"odrl:xone","and":"odrl:and","andSequence":"odrl:andSequence","policyUsage":"odrl:policyUsage"}}');
@@ -66,7 +69,10 @@ const DEFAULT_CONTEXTS = {
66
69
  'https://w3id.org/security/suites/ed25519-2020/v1': exports.ED25519_2020_V1,
67
70
  'https://w3id.org/security/suites/secp256k1-2019/v1': exports.SECP256K1_2019_V1,
68
71
  'https://www.w3.org/2018/credentials/v1': exports.CREDENTIALS_V1,
72
+ 'https://www.w3.org/ns/credentials/v2': exports.CREDENTIALS_V2,
69
73
  'https://www.w3.org/2018/credentials/examples/v1': exports.CREDENTIALS_EXAMPLE_V1,
74
+ 'https://www.w3.org/ns/credentials/examples/v2': exports.CREDENTIALS_EXAMPLE_V2,
75
+ 'https://www.w3.org/ns/credentials/undefined-terms/v2': exports.CREDENTIALS_UNDEFINED_TERMS_V2,
70
76
  'https://w3id.org/did/v1': exports.DID_V1,
71
77
  'https://www.w3.org/ns/did/v1': exports.DID_V1,
72
78
  'https://w3.org/ns/did/v1': exports.DID_V1,
@@ -1 +1 @@
1
- {"version":3,"file":"CachedDocumentLoader.js","sourceRoot":"","sources":["../../src/did/CachedDocumentLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA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,MAAM,CAAC,OAAO,CAAA;IAE7F,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAA;AACnG,CAAC;AAED,iEAAiE;AACjE,wEAA+C;AAyB/C,kBAAe,gBAA2B,CAAA"}
1
+ {"version":3,"file":"CachedDocumentLoader.js","sourceRoot":"","sources":["../../src/did/CachedDocumentLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,sDAuDC;AAjJD,iCAAiC;AACjC,yCAAoG;AAEvF,QAAA,WAAW,GAAG,IAAI,CAAC,KAAK,CACnC,ouDAAouD,CACruD,CAAA;AACY,QAAA,WAAW,GAAG,IAAI,CAAC,KAAK,CACnC,4wFAA4wF,CAC7wF,CAAA;AACY,QAAA,SAAS,GAAG,IAAI,CAAC,KAAK,CACjC,ycAAyc,CAC1c,CAAA;AACY,QAAA,WAAW,GAAG,IAAI,CAAC,KAAK,CACnC,ksBAAksB,CACnsB,CAAA;AACY,QAAA,eAAe,GAAG,IAAI,CAAC,KAAK,CACvC,s0DAAs0D,CACv0D,CAAA;AACY,QAAA,eAAe,GAAG,IAAI,CAAC,KAAK,CACvC,s7DAAs7D,CACv7D,CAAA;AACY,QAAA,iBAAiB,GAAG,IAAI,CAAC,KAAK,CACzC,0nEAA0nE,CAC3nE,CAAA;AACY,QAAA,cAAc,GAAG,IAAI,CAAC,KAAK,CACtC,44KAA44K,CAC74K,CAAA;AACY,QAAA,cAAc,GAAG,IAAI,CAAC,KAAK,CACtC,m9NAAm9N,CACp9N,CAAA;AACY,QAAA,sBAAsB,GAAG,IAAI,CAAC,KAAK,CAC9C,uEAAuE,CACxE,CAAA;AACY,QAAA,8BAA8B,GAAG,IAAI,CAAC,KAAK,CACtD,6EAA6E,CAC9E,CAAA;AACY,QAAA,sBAAsB,GAAG,IAAI,CAAC,KAAK,CAC9C,+sDAA+sD,CAChtD,CAAA;AACY,QAAA,MAAM,GAAG,IAAI,CAAC,KAAK,CAC9B,qj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ED,yHAAyH;QACzH,MAAM,cAAc,GAAG,MAAM,uBAAuB,EAAE,CAAA;QACtD,MAAM,YAAY,GAAG,cAAc,CAAC,KAAK,CAAC,gBAAM,EAAE,EAAE,CAAC,CAAA;QAErD,OAAO,MAAM,YAAY,CAAC,GAAG,CAAC,CAAA;IAChC,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAC5B,CAAC;AAED,KAAK,UAAU,uBAAuB;IACpC,8CAA8C;IAC9C,MAAM,MAAM,GAAG,wDAAa,qDAAqD,GAAC,CAAA;IAElF,IAAI,CAAC,MAAM;QACT,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAA;IAClG,IAAI,OAAO,MAAM,KAAK,UAAU;QAAE,OAAO,MAAM,CAAA;IAC/C,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,UAAU;QAAE,OAAO,MAAM,CAAC,OAAO,CAAA;IAE7F,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAA;AACnG,CAAC;AAED,iEAAiE;AACjE,wEAA+C;AAyB/C,kBAAe,gBAA2B,CAAA"}
@@ -1,9 +1,5 @@
1
1
  import { AgentContext, DidResolutionOptions, DidResolutionResult, WebDidResolver } from '@credo-ts/core';
2
2
  import { ParsedDID } from 'did-resolver';
3
3
  export declare class CachedWebDidResolver extends WebDidResolver {
4
- private publicApiBaseUrl;
5
- constructor(options: {
6
- publicApiBaseUrl: string;
7
- });
8
4
  resolve(agentContext: AgentContext, did: string, parsed: ParsedDID, didResolutionOptions: DidResolutionOptions): Promise<DidResolutionResult>;
9
5
  }
@@ -4,10 +4,6 @@ exports.CachedWebDidResolver = void 0;
4
4
  const core_1 = require("@credo-ts/core");
5
5
  const legacyDidWeb_1 = require("./legacyDidWeb");
6
6
  class CachedWebDidResolver extends core_1.WebDidResolver {
7
- constructor(options) {
8
- super();
9
- this.publicApiBaseUrl = options.publicApiBaseUrl;
10
- }
11
7
  async resolve(agentContext, did, parsed, didResolutionOptions) {
12
8
  // First check within our own public dids, as there is no need to resolve it through HTTPS
13
9
  const didRepository = agentContext.dependencyManager.resolve(core_1.DidRepository);
@@ -28,7 +24,7 @@ class CachedWebDidResolver extends core_1.WebDidResolver {
28
24
  method: 'webvh',
29
25
  });
30
26
  if (webVhdDidRecord === null || webVhdDidRecord === void 0 ? void 0 : webVhdDidRecord.didDocument) {
31
- const legacyDidDocument = (0, legacyDidWeb_1.getLegacyDidDocument)(webVhdDidRecord.didDocument, this.publicApiBaseUrl);
27
+ const legacyDidDocument = (0, legacyDidWeb_1.getLegacyDidDocument)(webVhdDidRecord.didDocument);
32
28
  if (legacyDidDocument) {
33
29
  return {
34
30
  didDocument: legacyDidDocument,
@@ -1 +1 @@
1
- {"version":3,"file":"CachedWebDidResolver.js","sourceRoot":"","sources":["../../src/did/CachedWebDidResolver.ts"],"names":[],"mappings":";;;AAAA,yCAMuB;AAGvB,iDAAqD;AAErD,MAAa,oBAAqB,SAAQ,qBAAc;IAGtD,YAAmB,OAAqC;QACtD,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAA;IAClD,CAAC;IAEM,KAAK,CAAC,OAAO,CAClB,YAA0B,EAC1B,GAAW,EACX,MAAiB,EACjB,oBAA0C;QAE1C,0FAA0F;QAC1F,MAAM,aAAa,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,oBAAa,CAAC,CAAA;QAC3E,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC,iBAAiB,CAAC,YAAY,EAAE;YACpE,GAAG;YACH,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QAEF,IAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,WAAW,EAAE,CAAC;YAC3B,OAAO;gBACL,WAAW,EAAE,SAAS,CAAC,WAAW;gBAClC,mBAAmB,EAAE,EAAE;gBACvB,qBAAqB,EAAE,EAAE;aA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AE,EAAE;gBACvB,qBAAqB,EAAE,EAAE;aAC1B,CAAA;QACH,CAAC;QAED,gEAAgE;QAChE,MAAM,eAAe,GAAG,MAAM,aAAa,CAAC,iBAAiB,CAAC,YAAY,EAAE;YAC1E,MAAM,EAAE,MAAM,CAAC,EAAE;YACjB,MAAM,EAAE,OAAO;SAChB,CAAC,CAAA;QAEF,IAAI,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,WAAW,EAAE,CAAC;YACjC,MAAM,iBAAiB,GAAG,IAAA,mCAAoB,EAAC,eAAe,CAAC,WAAW,CAAC,CAAA;YAC3E,IAAI,iBAAiB,EAAE,CAAC;gBACtB,OAAO;oBACL,WAAW,EAAE,iBAAiB;oBAC9B,mBAAmB,EAAE,EAAE;oBACvB,qBAAqB,EAAE,EAAE;iBAC1B,CAAA;YACH,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,oBAAoB,CAAC,CAAA;IACvE,CAAC;CACF;AAzCD,oDAyCC"}
@@ -0,0 +1,12 @@
1
+ import { DidDocument } from '@credo-ts/core';
2
+ import type { SupportedPublicDidMethod } from './publicDid';
3
+ export type ArtifactServiceMethod = SupportedPublicDidMethod;
4
+ export interface ArtifactServiceOptions {
5
+ method: ArtifactServiceMethod;
6
+ publicApiBaseUrl: string;
7
+ }
8
+ /** Declares the artifact service of the given method, and only that one. */
9
+ export declare function applyArtifactServices(didDocument: DidDocument, options: ArtifactServiceOptions): void;
10
+ /** Strips every artifact service: the parallel did:web document advertises none. */
11
+ export declare function removeArtifactServices(didDocument: DidDocument): void;
12
+ export declare function artifactServicesMatch(didDocument: DidDocument, options: ArtifactServiceOptions): boolean;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyArtifactServices = applyArtifactServices;
4
+ exports.removeArtifactServices = removeArtifactServices;
5
+ exports.artifactServicesMatch = artifactServicesMatch;
6
+ const core_1 = require("@credo-ts/core");
7
+ const ANONCREDS_REGISTRY_SERVICE_TYPE = 'AnonCredsRegistry';
8
+ const RELATIVE_REF_SERVICE_TYPE = 'relativeRef';
9
+ const ARTIFACT_SERVICE_TYPES = [ANONCREDS_REGISTRY_SERVICE_TYPE, RELATIVE_REF_SERVICE_TYPE];
10
+ /** Declares the artifact service of the given method, and only that one. */
11
+ function applyArtifactServices(didDocument, options) {
12
+ var _a;
13
+ removeArtifactServices(didDocument);
14
+ didDocument.service = [...((_a = didDocument.service) !== null && _a !== void 0 ? _a : []), ...expectedArtifactServices(didDocument.id, options)];
15
+ }
16
+ /** Strips every artifact service: the parallel did:web document advertises none. */
17
+ function removeArtifactServices(didDocument) {
18
+ var _a;
19
+ didDocument.service = ((_a = didDocument.service) !== null && _a !== void 0 ? _a : []).filter(service => !ARTIFACT_SERVICE_TYPES.includes(service.type));
20
+ }
21
+ function artifactServicesMatch(didDocument, options) {
22
+ var _a;
23
+ const current = ((_a = didDocument.service) !== null && _a !== void 0 ? _a : []).filter(service => ARTIFACT_SERVICE_TYPES.includes(service.type));
24
+ const expected = expectedArtifactServices(didDocument.id, options);
25
+ return (current.length === expected.length &&
26
+ expected.every(service => current.some(entry => entry.id === service.id &&
27
+ entry.type === service.type &&
28
+ entry.serviceEndpoint === service.serviceEndpoint)));
29
+ }
30
+ function expectedArtifactServices(did, options) {
31
+ const { method, publicApiBaseUrl } = options;
32
+ return method === 'web'
33
+ ? [
34
+ new core_1.DidDocumentService({
35
+ id: `${did}#anoncreds`,
36
+ serviceEndpoint: `${publicApiBaseUrl}/anoncreds/v1`,
37
+ type: ANONCREDS_REGISTRY_SERVICE_TYPE,
38
+ }),
39
+ ]
40
+ : [
41
+ new core_1.DidDocumentService({
42
+ id: `${did}#files`,
43
+ serviceEndpoint: publicApiBaseUrl,
44
+ type: RELATIVE_REF_SERVICE_TYPE,
45
+ }),
46
+ ];
47
+ }
48
+ //# sourceMappingURL=artifactServices.js.map
@@ -0,0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,OAAO,CAAC,EAAE,CACvB,OAAO,CAAC,IAAI,CACV,KAAK,CAAC,EAAE,CACN,KAAK,CAAC,EAAE,KAAK,OAAO,CAAC,EAAE;YACvB,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI;YAC3B,KAAK,CAAC,eAAe,KAAK,OAAO,CAAC,eAAe,CACpD,CACF,CACF,CAAA;AACH,CAAC;AAED,SAAS,wBAAwB,CAAC,GAAW,EAAE,OAA+B;IAC5E,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAA;IAE5C,OAAO,MAAM,KAAK,KAAK;QACrB,CAAC,CAAC;YACE,IAAI,yBAAkB,CAAC;gBACrB,EAAE,EAAE,GAAG,GAAG,YAAY;gBACtB,eAAe,EAAE,GAAG,gBAAgB,eAAe;gBACnD,IAAI,EAAE,+BAA+B;aACtC,CAAC;SACH;QACH,CAAC,CAAC;YACE,IAAI,yBAAkB,CAAC;gBACrB,EAAE,EAAE,GAAG,GAAG,QAAQ;gBAClB,eAAe,EAAE,gBAAgB;gBACjC,IAAI,EAAE,yBAAyB;aAChC,CAAC;SACH,CAAA;AACP,CAAC"}
@@ -1,10 +1,12 @@
1
1
  import { DidDocument } from '@credo-ts/core';
2
+ /**
3
+ * Returns the legacy did:web form of a DID: the DID itself when it is already a did:web, and the
4
+ * SCID-less did:web of a did:webvh. Returns undefined for any other method.
5
+ */
6
+ export declare function getLegacyDidWeb(did: string): string | undefined;
2
7
  /**
3
8
  * Returns a Legacy did:web document, based on an input document. If it is already a did:web,
4
9
  * it returns the same document.
5
10
  * If it isn't supported (i.e. it is not a did:webvh DID Document), it returns undefined
6
- * @param didDocument
7
- * @param publicApiBaseUrl
8
- * @returns
9
11
  */
10
- export declare function getLegacyDidDocument(didDocument: DidDocument, publicApiBaseUrl: string): DidDocument | undefined;
12
+ export declare function getLegacyDidDocument(didDocument: DidDocument): DidDocument | undefined;
@@ -1,17 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLegacyDidWeb = getLegacyDidWeb;
3
4
  exports.getLegacyDidDocument = getLegacyDidDocument;
4
5
  const core_1 = require("@credo-ts/core");
6
+ const artifactServices_1 = require("./artifactServices");
7
+ /**
8
+ * Returns the legacy did:web form of a DID: the DID itself when it is already a did:web, and the
9
+ * SCID-less did:web of a did:webvh. Returns undefined for any other method.
10
+ */
11
+ function getLegacyDidWeb(did) {
12
+ const parsedDid = (0, core_1.parseDid)(did);
13
+ if (parsedDid.method === 'web')
14
+ return did;
15
+ if (parsedDid.method === 'webvh' && parsedDid.id.includes(':')) {
16
+ return `did:web:${parsedDid.id.split(':').slice(1).join(':')}`;
17
+ }
18
+ }
5
19
  /**
6
20
  * Returns a Legacy did:web document, based on an input document. If it is already a did:web,
7
21
  * it returns the same document.
8
22
  * If it isn't supported (i.e. it is not a did:webvh DID Document), it returns undefined
9
- * @param didDocument
10
- * @param publicApiBaseUrl
11
- * @returns
12
23
  */
13
- function getLegacyDidDocument(didDocument, publicApiBaseUrl) {
14
- var _a;
24
+ function getLegacyDidDocument(didDocument) {
15
25
  const parsedDid = (0, core_1.parseDid)(didDocument.id);
16
26
  if (parsedDid.method === 'web')
17
27
  return didDocument;
@@ -21,15 +31,8 @@ function getLegacyDidDocument(didDocument, publicApiBaseUrl) {
21
31
  const scid = parsedDid.id.split(':')[0];
22
32
  // Start with resolved version of the DIDDoc from did:webvh
23
33
  const legacyDidDocument = new core_1.DidDocument(didDocument);
24
- // We add the legacy did:web AnonCreds service (important in case the agent had previously did:web objects)
25
- legacyDidDocument.service = [
26
- ...((_a = legacyDidDocument.service) !== null && _a !== void 0 ? _a : []),
27
- new core_1.DidDocumentService({
28
- id: `${didDocument.id}#anoncreds`,
29
- serviceEndpoint: `${publicApiBaseUrl}/anoncreds/v1`,
30
- type: 'AnonCredsRegistry',
31
- }),
32
- ];
34
+ // The parallel document is for DIDComm only: it advertises no artifact service
35
+ (0, artifactServices_1.removeArtifactServices)(legacyDidDocument);
33
36
  // Execute text replacement: did:webvh:<scid> by did:web
34
37
  const stringified = JSON.stringify(legacyDidDocument.toJSON());
35
38
  const replaced = stringified.replace(new RegExp(`did:webvh:${scid}`, 'g'), 'did:web');
@@ -1 +1 @@
1
- {"version":3,"file":"legacyDidWeb.js","sourceRoot":"","sources":["../../src/did/legacyDidWeb.ts"],"names":[],"mappings":";;AAUA,oDAiCC;AA3CD,yCAA2F;AAE3F;;;;;;;GAOG;AACH,SAAgB,oBAAoB,CAAC,WAAwB,EAAE,gBAAwB;;IACrF,MAAM,SAAS,GAAG,IAAA,eAAQ,EAAC,WAAW,CAAC,EAAE,CAAC,CAAA;IAE1C,IAAI,SAAS,CAAC,MAAM,KAAK,KAAK;QAAE,OAAO,WAAW,CAAA;IAElD,kFAAkF;IAClF,8EAA8E;IAC9E,IAAI,SAAS,CAAC,MAAM,KAAK,OAAO,IAAI,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/D,MAAM,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;QAEvC,2DAA2D;QAC3D,MAAM,iBAAiB,GAAG,IAAI,kBAAW,CAAC,WAAW,CAAC,CAAA;QAEtD,2GAA2G;QAC3G,iBAAiB,CAAC,OAAO,GAAG;YAC1B,GAAG,CAAC,MAAA,iBAAiB,CAAC,OAAO,mCAAI,EAAE,CAAC;YACpC,IAAI,yBAAkB,CAAC;gBACrB,EAAE,EAAE,GAAG,WAAW,CAAC,EAAE,YAAY;gBACjC,eAAe,EAAE,GAAG,gBAAgB,eAAe;gBACnD,IAAI,EAAE,mBAAmB;aAC1B,CAAC;SACH,CAAA;QAED,wDAAwD;QACxD,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC,CAAA;QAC9D,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,IA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GAAG,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;QAEvC,2DAA2D;QAC3D,MAAM,iBAAiB,GAAG,IAAI,kBAAW,CAAC,WAAW,CAAC,CAAA;QAEtD,+EAA+E;QAC/E,IAAA,yCAAsB,EAAC,iBAAiB,CAAC,CAAA;QAEzC,wDAAwD;QACxD,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC,CAAA;QAC9D,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,aAAa,IAAI,EAAE,EAAE,GAAG,CAAC,EAAE,SAAS,CAAC,CAAA;QAErF,OAAO,IAAI,kBAAW,iCACjB,sBAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,kBAAW,CAAC;YAC9D,qBAAqB;YACrB,WAAW,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,IAC5B,CAAA;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const SUPPORTED_PUBLIC_DID_METHODS: readonly ["web", "webvh"];
2
+ export type SupportedPublicDidMethod = (typeof SUPPORTED_PUBLIC_DID_METHODS)[number];
3
+ export declare function isSupportedPublicDidMethod(method: string): method is SupportedPublicDidMethod;
4
+ export declare function isSupportedPublicDid(did: string): boolean;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SUPPORTED_PUBLIC_DID_METHODS = void 0;
4
+ exports.isSupportedPublicDidMethod = isSupportedPublicDidMethod;
5
+ exports.isSupportedPublicDid = isSupportedPublicDid;
6
+ const core_1 = require("@credo-ts/core");
7
+ exports.SUPPORTED_PUBLIC_DID_METHODS = ['web', 'webvh'];
8
+ function isSupportedPublicDidMethod(method) {
9
+ return exports.SUPPORTED_PUBLIC_DID_METHODS.includes(method);
10
+ }
11
+ function isSupportedPublicDid(did) {
12
+ try {
13
+ return isSupportedPublicDidMethod((0, core_1.parseDid)(did).method);
14
+ }
15
+ catch (_a) {
16
+ return false;
17
+ }
18
+ }
19
+ //# sourceMappingURL=publicDid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publicDid.js","sourceRoot":"","sources":["../../src/did/publicDid.ts"],"names":[],"mappings":";;;AAKA,gEAEC;AAED,oDAMC;AAfD,yCAAyC;AAE5B,QAAA,4BAA4B,GAAG,CAAC,KAAK,EAAE,OAAO,CAAU,CAAA;AAGrE,SAAgB,0BAA0B,CAAC,MAAc;IACvD,OAAQ,oCAAkD,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AAC7E,CAAC;AAED,SAAgB,oBAAoB,CAAC,GAAW;IAC9C,IAAI,CAAC;QACH,OAAO,0BAA0B,CAAC,IAAA,eAAQ,EAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAA;IACzD,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC"}
@@ -2,14 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.baseMessageEvents = void 0;
4
4
  const anoncreds_1 = require("@credo-ts/anoncreds");
5
+ const core_1 = require("@credo-ts/core");
5
6
  const didcomm_1 = require("@credo-ts/didcomm");
6
7
  const vs_agent_model_1 = require("@verana-labs/vs-agent-model");
8
+ const AnonCredsTrustService_1 = require("../blockchain/AnonCredsTrustService");
9
+ const types_1 = require("../blockchain/types");
7
10
  const agent_1 = require("../utils/agent");
8
11
  const VsAgentEvents_1 = require("./VsAgentEvents");
9
12
  const baseMessageEvents = async (agent, logger) => {
13
+ registerAnonCredsTrustDecision(agent, logger);
10
14
  // Proofs protocol messages (proof presentation and problem reports)
11
15
  agent.events.on(didcomm_1.DidCommEventTypes.DidCommMessageProcessed, async ({ payload }) => {
12
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
16
+ var _a, _b, _c, _d, _e, _f, _g, _h;
13
17
  const { message, connection } = payload;
14
18
  if (!connection)
15
19
  return;
@@ -61,8 +65,8 @@ const baseMessageEvents = async (agent, logger) => {
61
65
  try {
62
66
  const record = await agent.didcomm.proofs.getByThreadAndConnectionId(message.threadId, connection.id);
63
67
  const formatData = await agent.didcomm.proofs.getFormatData(record.id);
64
- const revealedAttributes = (_e = (_d = (_c = formatData.presentation) === null || _c === void 0 ? void 0 : _c.anoncreds) === null || _d === void 0 ? void 0 : _d.requested_proof.revealed_attrs) !== null && _e !== void 0 ? _e : (_g = (_f = formatData.presentation) === null || _f === void 0 ? void 0 : _f.indy) === null || _g === void 0 ? void 0 : _g.requested_proof.revealed_attrs;
65
- const revealedAttributeGroups = (_l = (_k = (_j = (_h = formatData.presentation) === null || _h === void 0 ? void 0 : _h.anoncreds) === null || _j === void 0 ? void 0 : _j.requested_proof) === null || _k === void 0 ? void 0 : _k.revealed_attr_groups) !== null && _l !== void 0 ? _l : (_o = (_m = formatData.presentation) === null || _m === void 0 ? void 0 : _m.indy) === null || _o === void 0 ? void 0 : _o.requested_proof.revealed_attr_groups;
68
+ const revealedAttributes = (_d = (_c = formatData.presentation) === null || _c === void 0 ? void 0 : _c.anoncreds) === null || _d === void 0 ? void 0 : _d.requested_proof.revealed_attrs;
69
+ const revealedAttributeGroups = (_f = (_e = formatData.presentation) === null || _e === void 0 ? void 0 : _e.anoncreds) === null || _f === void 0 ? void 0 : _f.requested_proof.revealed_attr_groups;
66
70
  const claims = [];
67
71
  if (revealedAttributes) {
68
72
  for (const [name, value] of Object.entries(revealedAttributes)) {
@@ -83,7 +87,7 @@ const baseMessageEvents = async (agent, logger) => {
83
87
  callbackUrl: callbackParameters.callbackUrl,
84
88
  claims,
85
89
  state: record.isVerified ? vs_agent_model_1.PresentationState.OK : vs_agent_model_1.PresentationState.VERIFICATION_ERROR,
86
- verified: (_p = record.isVerified) !== null && _p !== void 0 ? _p : false,
90
+ verified: (_g = record.isVerified) !== null && _g !== void 0 ? _g : false,
87
91
  ref: callbackParameters.ref,
88
92
  }));
89
93
  }
@@ -93,7 +97,7 @@ const baseMessageEvents = async (agent, logger) => {
93
97
  id: record.threadId,
94
98
  proofExchangeId: record.id,
95
99
  claims,
96
- verified: (_q = record.isVerified) !== null && _q !== void 0 ? _q : false,
100
+ verified: (_h = record.isVerified) !== null && _h !== void 0 ? _h : false,
97
101
  }),
98
102
  ],
99
103
  connectionId: record.connectionId,
@@ -145,4 +149,134 @@ const baseMessageEvents = async (agent, logger) => {
145
149
  });
146
150
  };
147
151
  exports.baseMessageEvents = baseMessageEvents;
152
+ function registerAnonCredsTrustDecision(agent, logger) {
153
+ agent.didcomm.registerMessageHandlerMiddleware(async (messageContext, next) => {
154
+ var _a;
155
+ await next();
156
+ const { connection, message } = messageContext;
157
+ const isPresentation = [
158
+ anoncreds_1.DidCommPresentationV1Message.type.messageTypeUri,
159
+ didcomm_1.DidCommPresentationV2Message.type.messageTypeUri,
160
+ ].includes(message.type);
161
+ if (!isPresentation || !connection)
162
+ return;
163
+ let record;
164
+ let presentation;
165
+ try {
166
+ record = await agent.didcomm.proofs.getByThreadAndConnectionId(message.threadId, connection.id);
167
+ const formatData = await agent.didcomm.proofs.getFormatData(record.id);
168
+ presentation = (_a = formatData.presentation) === null || _a === void 0 ? void 0 : _a.anoncreds;
169
+ }
170
+ catch (error) {
171
+ logger.error(`The agent cannot read the presentation of ${message.threadId}: ${error}`);
172
+ messageContext.responseMessage = undefined;
173
+ // The check did not run, so the exchange ends here, per [VSA-VTI-FLOW-VERIFY-AC-8]
174
+ if ((record === null || record === void 0 ? void 0 : record.role) === didcomm_1.DidCommProofRole.Verifier) {
175
+ await abandonPresentation(agent, record, connection, AnonCredsTrustService_1.AnonCredsTrustProblemCode.TrustResolutionUnavailable, `the agent cannot read the presentation: ${error}`, logger);
176
+ }
177
+ return;
178
+ }
179
+ if (await applyAnonCredsTrustDecision(agent, record, connection, presentation, logger)) {
180
+ messageContext.responseMessage = undefined;
181
+ return;
182
+ }
183
+ // The proof and the trust decision both succeeded, so the agent acknowledges the presentation.
184
+ const policy = record.metadata.get(AnonCredsTrustService_1.AUTO_ACCEPT_PRESENTATION_METADATA);
185
+ if (!(policy === null || policy === void 0 ? void 0 : policy.autoAccept) || record.state !== didcomm_1.DidCommProofState.PresentationReceived)
186
+ return;
187
+ try {
188
+ await agent.didcomm.proofs.acceptPresentation({ proofExchangeRecordId: record.id });
189
+ }
190
+ catch (error) {
191
+ logger.error(`The agent cannot acknowledge the presentation ${record.id}: ${error}`);
192
+ }
193
+ });
194
+ }
195
+ async function applyAnonCredsTrustDecision(agent, record, connection, presentation, logger) {
196
+ var _a, _b, _c, _d, _e, _f, _g, _h;
197
+ if (record.role !== didcomm_1.DidCommProofRole.Verifier || !presentation)
198
+ return false;
199
+ const identifiers = (_a = presentation.identifiers) !== null && _a !== void 0 ? _a : [];
200
+ const stored = record.metadata.get(AnonCredsTrustService_1.REQUESTED_CREDENTIAL_SCHEMAS_METADATA);
201
+ const requestedCredentialSchemas = Object.entries(Array.isArray(stored) ? {} : (stored !== null && stored !== void 0 ? stored : {}));
202
+ // A request whose creator recorded no CredentialSchema cannot be checked against what it asked
203
+ // for, so it abandons rather than accepting any schema.
204
+ if (requestedCredentialSchemas.length === 0) {
205
+ await abandonPresentation(agent, record, connection, AnonCredsTrustService_1.AnonCredsTrustProblemCode.TrustResolutionUnavailable, 'the exchange records no CredentialSchema of its requested credentials', logger);
206
+ return true;
207
+ }
208
+ const answered = Object.assign(Object.assign(Object.assign(Object.assign({}, (_b = presentation.requested_proof) === null || _b === void 0 ? void 0 : _b.revealed_attrs), (_c = presentation.requested_proof) === null || _c === void 0 ? void 0 : _c.revealed_attr_groups), (_d = presentation.requested_proof) === null || _d === void 0 ? void 0 : _d.unrevealed_attrs), (_e = presentation.requested_proof) === null || _e === void 0 ? void 0 : _e.predicates);
209
+ const issuersByCredentialSchema = new Map();
210
+ const unaccredited = [];
211
+ const unchecked = [];
212
+ for (const [group, requested] of requestedCredentialSchemas) {
213
+ const subProofIndex = (_f = answered[group]) === null || _f === void 0 ? void 0 : _f.sub_proof_index;
214
+ const credentialDefinitionId = subProofIndex === undefined ? undefined : (_g = identifiers[subProofIndex]) === null || _g === void 0 ? void 0 : _g.cred_def_id;
215
+ if (!credentialDefinitionId) {
216
+ unaccredited.push(`no sub-proof answers the requested group "${group}"`);
217
+ continue;
218
+ }
219
+ try {
220
+ const derived = await agent.anonCredsTrust.deriveCredentialSchema({ credentialDefinitionId });
221
+ if (derived.credentialSchemaId !== requested.credentialSchemaId) {
222
+ unaccredited.push(`${credentialDefinitionId} presents the CredentialSchema ${derived.credentialSchemaId} for the group "${group}", which asks for the CredentialSchema ${requested.credentialSchemaId}`);
223
+ continue;
224
+ }
225
+ if (!derived.issuerId) {
226
+ unaccredited.push(`${credentialDefinitionId} names no issuer`);
227
+ continue;
228
+ }
229
+ const issuers = (_h = issuersByCredentialSchema.get(derived.credentialSchemaId)) !== null && _h !== void 0 ? _h : [];
230
+ issuers.push(derived.issuerId);
231
+ issuersByCredentialSchema.set(derived.credentialSchemaId, issuers);
232
+ }
233
+ catch (error) {
234
+ const cannotCheck = !(error instanceof AnonCredsTrustService_1.AnonCredsTrustError) || error.reason === AnonCredsTrustService_1.AnonCredsTrustErrorReason.Unavailable;
235
+ if (cannotCheck)
236
+ unchecked.push(`${error}`);
237
+ else
238
+ unaccredited.push(`${error}`);
239
+ }
240
+ }
241
+ for (const [credentialSchemaId, issuers] of issuersByCredentialSchema) {
242
+ const result = await agent.anonCredsTrust.findUnaccreditedDids(issuers, types_1.ParticipantRole.Issuer, credentialSchemaId);
243
+ unaccredited.push(...result.unaccredited.map(did => `${did} holds no active ISSUER Participant for the CredentialSchema ${credentialSchemaId}`));
244
+ unchecked.push(...result.unchecked.map(did => `the agent cannot check the ISSUER Participant of ${did} for the CredentialSchema ${credentialSchemaId}`));
245
+ }
246
+ if (unaccredited.length === 0 && unchecked.length === 0)
247
+ return false;
248
+ const code = unaccredited.length > 0
249
+ ? AnonCredsTrustService_1.AnonCredsTrustProblemCode.IssuerNotAuthorized
250
+ : AnonCredsTrustService_1.AnonCredsTrustProblemCode.TrustResolutionUnavailable;
251
+ await abandonPresentation(agent, record, connection, code, [...unaccredited, ...unchecked].join('; '), logger);
252
+ return true;
253
+ }
254
+ async function abandonPresentation(agent, record, connection, code, description, logger) {
255
+ logger.warn(`The presentation ${record.id} fails the AnonCreds trust decision (${code}): ${description}`);
256
+ record.isVerified = false;
257
+ record.errorMessage = `${code}: ${description}`;
258
+ // `updateState` emits the state change with `previousState`, per [VSA-VTI-FLOW-VERIFY-AC-7]
259
+ const protocol = agent.dependencyManager
260
+ .resolve(didcomm_1.DidCommProofsModuleConfig)
261
+ .proofProtocols.find(candidate => candidate.version === record.protocolVersion);
262
+ if (!protocol) {
263
+ throw new core_1.CredoError(`No proof protocol registered for protocol version ${record.protocolVersion}, so the presentation ${record.id} cannot end in abandoned`);
264
+ }
265
+ const problemReport = record.protocolVersion === 'v1'
266
+ ? new anoncreds_1.DidCommPresentationV1ProblemReportMessage({ description: { code, en: description } })
267
+ : new didcomm_1.DidCommPresentationV2ProblemReportMessage({ description: { code, en: description } });
268
+ problemReport.setThread({ threadId: record.threadId, parentThreadId: record.parentThreadId });
269
+ try {
270
+ const outboundMessageContext = await (0, didcomm_1.getOutboundDidCommMessageContext)(agent.context, {
271
+ message: problemReport,
272
+ associatedRecord: record,
273
+ connectionRecord: connection,
274
+ });
275
+ await agent.dependencyManager.resolve(didcomm_1.DidCommMessageSender).sendMessage(outboundMessageContext);
276
+ }
277
+ catch (error) {
278
+ logger.error(`The agent cannot send the problem report of presentation ${record.id}: ${error}`);
279
+ }
280
+ await protocol.updateState(agent.context, record, didcomm_1.DidCommProofState.Abandoned);
281
+ }
148
282
  //# sourceMappingURL=BaseMessageEvents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseMessageEvents.js","sourceRoot":"","sources":["../../src/events/BaseMessageEv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