@credo-ts/didcomm 0.6.0-pr-2539-20251127090105 → 0.6.0

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 (149) hide show
  1. package/build/BaseDidCommMessage.mjs +2 -2
  2. package/build/DidCommApi.mjs +2 -2
  3. package/build/DidCommDispatcher.mjs +3 -3
  4. package/build/DidCommEnvelopeService.mjs +3 -3
  5. package/build/DidCommFeatureRegistry.mjs +1 -1
  6. package/build/DidCommMessage.mjs +2 -2
  7. package/build/DidCommMessageHandlerRegistry.mjs +1 -1
  8. package/build/DidCommMessageReceiver.mjs +3 -3
  9. package/build/DidCommMessageSender.mjs +2 -2
  10. package/build/DidCommTransportService.mjs +2 -2
  11. package/build/_virtual/{_@oxc-project_runtime@0.97.0 → _@oxc-project_runtime@0.99.0}/helpers/assertClassBrand.mjs +1 -1
  12. package/build/_virtual/{_@oxc-project_runtime@0.97.0 → _@oxc-project_runtime@0.99.0}/helpers/checkPrivateRedeclaration.mjs +1 -1
  13. package/build/_virtual/{_@oxc-project_runtime@0.97.0 → _@oxc-project_runtime@0.99.0}/helpers/classPrivateFieldGet2.mjs +1 -1
  14. package/build/_virtual/{_@oxc-project_runtime@0.97.0 → _@oxc-project_runtime@0.99.0}/helpers/classPrivateFieldInitSpec.mjs +1 -1
  15. package/build/_virtual/{_@oxc-project_runtime@0.97.0 → _@oxc-project_runtime@0.99.0}/helpers/classPrivateFieldSet2.mjs +1 -1
  16. package/build/_virtual/{_@oxc-project_runtime@0.97.0 → _@oxc-project_runtime@0.99.0}/helpers/decorate.mjs +1 -1
  17. package/build/_virtual/{_@oxc-project_runtime@0.97.0 → _@oxc-project_runtime@0.99.0}/helpers/decorateMetadata.mjs +1 -1
  18. package/build/_virtual/{_@oxc-project_runtime@0.97.0 → _@oxc-project_runtime@0.99.0}/helpers/decorateParam.mjs +1 -1
  19. package/build/_virtual/rolldown_runtime.mjs +10 -5
  20. package/build/decorators/ack/AckDecorator.mjs +2 -2
  21. package/build/decorators/ack/AckDecoratorExtension.mjs +2 -2
  22. package/build/decorators/attachment/AttachmentExtension.mjs +2 -2
  23. package/build/decorators/attachment/DidCommAttachment.mjs +2 -2
  24. package/build/decorators/l10n/L10nDecoratorExtension.mjs +2 -2
  25. package/build/decorators/service/ServiceDecorator.mjs +2 -2
  26. package/build/decorators/service/ServiceDecoratorExtension.mjs +2 -2
  27. package/build/decorators/signature/SignatureDecorator.mjs +2 -2
  28. package/build/decorators/thread/ThreadDecorator.mjs +2 -2
  29. package/build/decorators/thread/ThreadDecoratorExtension.mjs +2 -2
  30. package/build/decorators/timing/TimingDecorator.mjs +2 -2
  31. package/build/decorators/timing/TimingDecoratorExtension.mjs +2 -2
  32. package/build/decorators/transport/TransportDecorator.mjs +2 -2
  33. package/build/decorators/transport/TransportDecoratorExtension.mjs +2 -2
  34. package/build/messages/common/DidCommAckMessage.mjs +2 -2
  35. package/build/messages/problem-reports/DidCommProblemReportMessage.mjs +2 -2
  36. package/build/models/features/DidCommFeature.mjs +2 -2
  37. package/build/models/features/DidCommFeatureQuery.mjs +2 -2
  38. package/build/models/features/DidCommProtocol.mjs +2 -2
  39. package/build/modules/basic-messages/DidCommBasicMessagesApi.mjs +2 -2
  40. package/build/modules/basic-messages/messages/DidCommBasicMessage.mjs +2 -2
  41. package/build/modules/basic-messages/repository/DidCommBasicMessageRepository.mjs +3 -3
  42. package/build/modules/basic-messages/services/DidCommBasicMessageService.mjs +2 -2
  43. package/build/modules/connections/DidCommConnectionsApi.mjs +2 -2
  44. package/build/modules/connections/DidCommConnectionsModuleConfig.mjs +3 -3
  45. package/build/modules/connections/DidExchangeProtocol.mjs +3 -3
  46. package/build/modules/connections/messages/DidCommConnectionInvitationMessage.mjs +2 -2
  47. package/build/modules/connections/messages/DidCommConnectionProblemReportMessage.mjs +2 -2
  48. package/build/modules/connections/messages/DidCommConnectionRequestMessage.mjs +2 -2
  49. package/build/modules/connections/messages/DidCommConnectionResponseMessage.mjs +2 -2
  50. package/build/modules/connections/messages/DidCommDidExchangeCompleteMessage.mjs +2 -2
  51. package/build/modules/connections/messages/DidCommDidExchangeProblemReportMessage.mjs +2 -2
  52. package/build/modules/connections/messages/DidCommDidExchangeRequestMessage.mjs +2 -2
  53. package/build/modules/connections/messages/DidCommDidExchangeResponseMessage.mjs +2 -2
  54. package/build/modules/connections/messages/DidCommDidRotateAckMessage.mjs +2 -2
  55. package/build/modules/connections/messages/DidCommDidRotateMessage.mjs +2 -2
  56. package/build/modules/connections/messages/DidCommDidRotateProblemReportMessage.mjs +2 -2
  57. package/build/modules/connections/messages/DidCommHangupMessage.mjs +2 -2
  58. package/build/modules/connections/messages/DidCommTrustPingMessage.mjs +2 -2
  59. package/build/modules/connections/messages/DidCommTrustPingResponseMessage.mjs +2 -2
  60. package/build/modules/connections/models/DidCommConnection.mjs +2 -2
  61. package/build/modules/connections/models/did/DidDoc.mjs +2 -2
  62. package/build/modules/connections/models/did/authentication/EmbeddedAuthentication.mjs +2 -2
  63. package/build/modules/connections/models/did/authentication/ReferencedAuthentication.mjs +2 -2
  64. package/build/modules/connections/models/did/publicKey/Ed25119Sig2018.mjs +2 -2
  65. package/build/modules/connections/models/did/publicKey/EddsaSaSigSecp256k1.mjs +2 -2
  66. package/build/modules/connections/models/did/publicKey/PublicKey.mjs +2 -2
  67. package/build/modules/connections/models/did/publicKey/RsaSig2018.mjs +2 -2
  68. package/build/modules/connections/repository/DidCommConnectionRecord.mjs +2 -2
  69. package/build/modules/connections/repository/DidCommConnectionRepository.mjs +3 -3
  70. package/build/modules/connections/services/DidCommConnectionService.mjs +4 -4
  71. package/build/modules/connections/services/DidCommConnectionService.mjs.map +1 -1
  72. package/build/modules/connections/services/DidCommDidRotateService.mjs +3 -3
  73. package/build/modules/connections/services/DidCommTrustPingService.mjs +2 -2
  74. package/build/modules/credentials/DidCommCredentialsApi.mjs +3 -3
  75. package/build/modules/credentials/formats/DidCommCredentialFormatServiceOptions.d.mts.map +1 -1
  76. package/build/modules/credentials/formats/dataIntegrity/dataIntegrityExchange.mjs +2 -2
  77. package/build/modules/credentials/formats/jsonld/DidCommJsonLdCredentialDetail.mjs +2 -2
  78. package/build/modules/credentials/formats/jsonld/DidCommJsonLdCredentialDetailOptions.mjs +2 -2
  79. package/build/modules/credentials/models/DidCommCredentialFormatSpec.mjs +2 -2
  80. package/build/modules/credentials/models/DidCommCredentialPreviewAttribute.mjs +2 -2
  81. package/build/modules/credentials/models/DidCommRevocationNotification.mjs +2 -2
  82. package/build/modules/credentials/protocol/revocation-notification/messages/DidCommRevocationNotificationV1Message.mjs +2 -2
  83. package/build/modules/credentials/protocol/revocation-notification/messages/DidCommRevocationNotificationV2Message.mjs +2 -2
  84. package/build/modules/credentials/protocol/revocation-notification/services/DidCommRevocationNotificationService.mjs +3 -3
  85. package/build/modules/credentials/protocol/v2/messages/DidCommCredentialV2AckMessage.mjs +2 -2
  86. package/build/modules/credentials/protocol/v2/messages/DidCommCredentialV2Preview.mjs +2 -2
  87. package/build/modules/credentials/protocol/v2/messages/DidCommCredentialV2ProblemReportMessage.mjs +2 -2
  88. package/build/modules/credentials/protocol/v2/messages/DidCommIssueCredentialV2Message.mjs +2 -2
  89. package/build/modules/credentials/protocol/v2/messages/DidCommOfferCredentialV2Message.mjs +2 -2
  90. package/build/modules/credentials/protocol/v2/messages/DidCommProposeCredentialV2Message.mjs +2 -2
  91. package/build/modules/credentials/protocol/v2/messages/DidCommRequestCredentialV2Message.mjs +2 -2
  92. package/build/modules/credentials/repository/DidCommCredentialExchangeRecord.mjs +2 -2
  93. package/build/modules/credentials/repository/DidCommCredentialExchangeRepository.mjs +3 -3
  94. package/build/modules/discover-features/DidCommDiscoverFeaturesApi.mjs +3 -3
  95. package/build/modules/discover-features/protocol/v1/DidCommDiscoverFeaturesV1Service.mjs +3 -3
  96. package/build/modules/discover-features/protocol/v1/messages/DidCommFeaturesDiscloseMessage.mjs +2 -2
  97. package/build/modules/discover-features/protocol/v1/messages/DidCommFeaturesQueryMessage.mjs +2 -2
  98. package/build/modules/discover-features/protocol/v2/DidCommDiscoverFeaturesV2Service.mjs +3 -3
  99. package/build/modules/discover-features/protocol/v2/messages/DidCommFeaturesDisclosuresMessage.mjs +2 -2
  100. package/build/modules/discover-features/protocol/v2/messages/DidCommFeaturesQueriesMessage.mjs +2 -2
  101. package/build/modules/message-pickup/DidCommMessagePickupApi.mjs +3 -3
  102. package/build/modules/message-pickup/protocol/v1/DidCommMessagePickupV1Protocol.mjs +1 -1
  103. package/build/modules/message-pickup/protocol/v1/messages/DidCommBatchMessage.mjs +2 -2
  104. package/build/modules/message-pickup/protocol/v1/messages/DidCommBatchPickupMessage.mjs +2 -2
  105. package/build/modules/message-pickup/protocol/v2/DidCommMessagePickupV2Protocol.mjs +1 -1
  106. package/build/modules/message-pickup/protocol/v2/messages/DidCommDeliveryRequestV2Message.mjs +2 -2
  107. package/build/modules/message-pickup/protocol/v2/messages/DidCommLiveDeliveryChangeV2Message.mjs +2 -2
  108. package/build/modules/message-pickup/protocol/v2/messages/DidCommMessageDeliveryV2Message.mjs +2 -2
  109. package/build/modules/message-pickup/protocol/v2/messages/DidCommMessagesReceivedV2Message.mjs +2 -2
  110. package/build/modules/message-pickup/protocol/v2/messages/DidCommStatusRequestV2Message.mjs +2 -2
  111. package/build/modules/message-pickup/protocol/v2/messages/DidCommStatusV2Message.mjs +2 -2
  112. package/build/modules/message-pickup/services/DidCommMessagePickupSessionService.mjs +2 -2
  113. package/build/modules/oob/DidCommOutOfBandApi.mjs +3 -3
  114. package/build/modules/oob/DidCommOutOfBandService.mjs +2 -2
  115. package/build/modules/oob/domain/OutOfBandDidCommService.mjs +2 -2
  116. package/build/modules/oob/messages/DidCommHandshakeReuseAcceptedMessage.mjs +2 -2
  117. package/build/modules/oob/messages/DidCommHandshakeReuseMessage.mjs +2 -2
  118. package/build/modules/oob/messages/DidCommOutOfBandInvitation.mjs +2 -2
  119. package/build/modules/oob/repository/DidCommOutOfBandRecord.mjs +2 -2
  120. package/build/modules/oob/repository/DidCommOutOfBandRepository.mjs +3 -3
  121. package/build/modules/proofs/DidCommProofsApi.mjs +2 -2
  122. package/build/modules/proofs/models/DidCommProofFormatSpec.mjs +2 -2
  123. package/build/modules/proofs/protocol/DidCommProofProtocolOptions.d.mts.map +1 -1
  124. package/build/modules/proofs/protocol/DidCommProofProtocolOptions.mjs.map +1 -1
  125. package/build/modules/proofs/protocol/v2/messages/DidCommPresentationV2AckMessage.mjs +2 -2
  126. package/build/modules/proofs/protocol/v2/messages/DidCommPresentationV2Message.mjs +2 -2
  127. package/build/modules/proofs/protocol/v2/messages/DidCommPresentationV2ProblemReportMessage.mjs +2 -2
  128. package/build/modules/proofs/protocol/v2/messages/DidCommProposePresentationV2Message.mjs +2 -2
  129. package/build/modules/proofs/protocol/v2/messages/DidCommRequestPresentationV2Message.mjs +2 -2
  130. package/build/modules/proofs/repository/DidCommProofExchangeRepository.mjs +3 -3
  131. package/build/modules/routing/DidCommMediationRecipientApi.mjs +3 -3
  132. package/build/modules/routing/DidCommMediatorApi.mjs +2 -2
  133. package/build/modules/routing/messages/DidCommForwardMessage.mjs +2 -2
  134. package/build/modules/routing/messages/DidCommKeylistUpdateMessage.mjs +2 -2
  135. package/build/modules/routing/messages/DidCommKeylistUpdateResponseMessage.mjs +2 -2
  136. package/build/modules/routing/messages/DidCommMediationDenyMessage.mjs +2 -2
  137. package/build/modules/routing/messages/DidCommMediationGrantMessage.mjs +2 -2
  138. package/build/modules/routing/messages/DidCommMediationRequestMessage.mjs +2 -2
  139. package/build/modules/routing/repository/DidCommMediationRecord.mjs +2 -2
  140. package/build/modules/routing/repository/DidCommMediationRepository.mjs +3 -3
  141. package/build/modules/routing/repository/DidCommMediatorRoutingRepository.mjs +3 -3
  142. package/build/modules/routing/services/DidCommMediationRecipientService.mjs +2 -2
  143. package/build/modules/routing/services/DidCommMediatorService.mjs +3 -3
  144. package/build/modules/routing/services/DidCommRoutingService.mjs +2 -2
  145. package/build/repository/DidCommMessageRepository.mjs +3 -3
  146. package/build/services/DidCommDocumentService.mjs +8 -4
  147. package/build/services/DidCommDocumentService.mjs.map +1 -1
  148. package/build/transport/queue/InMemoryQueueTransportRepository.mjs +2 -2
  149. package/package.json +4 -8
@@ -1,6 +1,6 @@
1
- import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
1
+ import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
2
  import { IsValidMessageType, parseMessageType } from "../../../util/messageType.mjs";
3
- import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
3
+ import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
4
4
  import { DidCommProblemReportMessage } from "../../../messages/problem-reports/DidCommProblemReportMessage.mjs";
5
5
  import "../../../messages/index.mjs";
6
6
 
@@ -1,6 +1,6 @@
1
- import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
1
+ import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
2
  import { IsValidMessageType, parseMessageType } from "../../../util/messageType.mjs";
3
- import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
3
+ import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
4
4
  import { DidCommMessage } from "../../../DidCommMessage.mjs";
5
5
 
6
6
  //#region src/modules/connections/messages/DidCommHangupMessage.ts
@@ -1,6 +1,6 @@
1
- import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
1
+ import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
2
  import { IsValidMessageType, parseMessageType } from "../../../util/messageType.mjs";
3
- import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
3
+ import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
4
4
  import { DidCommMessage } from "../../../DidCommMessage.mjs";
5
5
  import { IsBoolean, IsOptional, IsString } from "class-validator";
6
6
  import { Expose } from "class-transformer";
@@ -1,6 +1,6 @@
1
- import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
1
+ import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
2
  import { IsValidMessageType, parseMessageType } from "../../../util/messageType.mjs";
3
- import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
3
+ import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
4
4
  import { DidCommMessage } from "../../../DidCommMessage.mjs";
5
5
  import { IsOptional, IsString } from "class-validator";
6
6
 
@@ -1,5 +1,5 @@
1
- import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { DidDoc } from "./did/DidDoc.mjs";
4
4
  import { IsInstance, IsOptional, IsString, ValidateNested } from "class-validator";
5
5
  import { Expose, Type } from "class-transformer";
@@ -1,5 +1,5 @@
1
- import { __decorate } from "../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { PublicKeyTransformer } from "./publicKey/index.mjs";
4
4
  import { AuthenticationTransformer } from "./authentication/index.mjs";
5
5
  import { DID_V1_CONTEXT_URL, DidCommV1Service, IndyAgentService, ServiceTransformer } from "@credo-ts/core";
@@ -1,5 +1,5 @@
1
- import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { PublicKey } from "../publicKey/PublicKey.mjs";
4
4
  import { Authentication } from "./Authentication.mjs";
5
5
  import { IsInstance, IsNotEmpty, ValidateNested } from "class-validator";
@@ -1,5 +1,5 @@
1
- import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { PublicKey } from "../publicKey/PublicKey.mjs";
4
4
  import { Authentication } from "./Authentication.mjs";
5
5
  import { IsString } from "class-validator";
@@ -1,5 +1,5 @@
1
- import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { PublicKey } from "./PublicKey.mjs";
4
4
  import { Equals, IsString } from "class-validator";
5
5
  import { Expose } from "class-transformer";
@@ -1,5 +1,5 @@
1
- import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { PublicKey } from "./PublicKey.mjs";
4
4
  import { Equals, IsString } from "class-validator";
5
5
  import { Expose } from "class-transformer";
@@ -1,5 +1,5 @@
1
- import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { IsOptional, IsString } from "class-validator";
4
4
 
5
5
  //#region src/modules/connections/models/did/publicKey/PublicKey.ts
@@ -1,5 +1,5 @@
1
- import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { PublicKey } from "./PublicKey.mjs";
4
4
  import { Equals, IsString } from "class-validator";
5
5
  import { Expose } from "class-transformer";
@@ -1,5 +1,5 @@
1
- import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { DidCommDidExchangeState } from "../models/DidCommDidExchangeState.mjs";
4
4
  import { rfc0160StateFromDidExchangeState } from "../models/DidCommConnectionState.mjs";
5
5
  import { DidCommDidExchangeRole } from "../models/DidCommDidExchangeRole.mjs";
@@ -1,7 +1,7 @@
1
- import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import "../models/index.mjs";
4
- import { __decorateParam } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateParam.mjs";
4
+ import { __decorateParam } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs";
5
5
  import { DidCommConnectionRecord } from "./DidCommConnectionRecord.mjs";
6
6
  import { EventEmitter, InjectionSymbols, Repository, inject, injectable } from "@credo-ts/core";
7
7
 
@@ -1,5 +1,5 @@
1
- import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { Ed25119Sig2018 } from "../models/did/publicKey/Ed25119Sig2018.mjs";
4
4
  import { ReferencedAuthentication } from "../models/did/authentication/ReferencedAuthentication.mjs";
5
5
  import { authenticationTypes } from "../models/did/authentication/index.mjs";
@@ -13,7 +13,7 @@ import { assertNoCreatedDidExistsForKeys, convertToNewDidDocument, getResolvedDi
13
13
  import { DidCommOutOfBandRole } from "../../oob/domain/DidCommOutOfBandRole.mjs";
14
14
  import { DidCommInvitationType } from "../../oob/messages/DidCommOutOfBandInvitation.mjs";
15
15
  import "../../oob/messages/index.mjs";
16
- import { __decorateParam } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateParam.mjs";
16
+ import { __decorateParam } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs";
17
17
  import { DidCommOutOfBandRepository } from "../../oob/repository/DidCommOutOfBandRepository.mjs";
18
18
  import { DidCommOutOfBandRecordMetadataKeys } from "../../oob/repository/outOfBandRecordMetadataTypes.mjs";
19
19
  import { signData, unpackAndVerifySignatureDecorator } from "../../../decorators/signature/SignatureDecoratorUtils.mjs";
@@ -215,7 +215,7 @@ let DidCommConnectionService = class DidCommConnectionService$1 {
215
215
  const connection = JsonTransformer.fromJSON(connectionJson, DidCommConnection);
216
216
  const signerVerkey = message.connectionSig.signer;
217
217
  const invitationKey = Kms.PublicJwk.fromFingerprint(outOfBandRecord.getTags().recipientKeyFingerprints[0]);
218
- if (!invitationKey.is(Kms.Ed25519PublicJwk)) throw new ConnectionProblemReportError(`Expected invitation key to be an Ed25519 key, found ${invitationKey.jwkTypehumanDescription}`, { problemCode: ConnectionProblemReportReason.ResponseNotAccepted });
218
+ if (!invitationKey.is(Kms.Ed25519PublicJwk)) throw new ConnectionProblemReportError(`Expected invitation key to be an Ed25519 key, found ${invitationKey.jwkTypeHumanDescription}`, { problemCode: ConnectionProblemReportReason.ResponseNotAccepted });
219
219
  if (signerVerkey !== TypedArrayEncoder.toBase58(invitationKey.publicKey.publicKey)) throw new ConnectionProblemReportError(`Connection object in connection response message is not signed with same key as recipient key in invitation expected='${invitationKey}' received='${signerVerkey}'`, { problemCode: ConnectionProblemReportReason.ResponseNotAccepted });
220
220
  if (!connection.didDoc) throw new CredoError("DID Document is missing.");
221
221
  const { did: peerDid } = await this.createDid(messageContext.agentContext, {
@@ -1 +1 @@
1
- {"version":3,"file":"DidCommConnectionService.mjs","names":["DidCommConnectionService","logger: Logger","didDoc: DidDoc","keys: DidDocumentKey[]","signingKey: Kms.PublicJwk<Kms.Ed25519PublicJwk>","service","connection","map","first","timeout"],"sources":["../../../../src/modules/connections/services/DidCommConnectionService.ts"],"sourcesContent":["import type { AgentContext, DidDocumentKey, Query, QueryOptions } from '@credo-ts/core'\nimport {\n CredoError,\n DidDocumentRole,\n DidRecord,\n DidRecordMetadataKeys,\n DidRepository,\n DidsApi,\n didDocumentJsonToNumAlgo1Did,\n EventEmitter,\n filterContextCorrelationId,\n IndyAgentService,\n InjectionSymbols,\n inject,\n injectable,\n JsonTransformer,\n Kms,\n type Logger,\n parseDid,\n TypedArrayEncoder,\n utils,\n} from '@credo-ts/core'\nimport { firstValueFrom, ReplaySubject } from 'rxjs'\nimport { first, map, timeout } from 'rxjs/operators'\nimport type { DidCommMessage } from '../../../DidCommMessage'\nimport { signData, unpackAndVerifySignatureDecorator } from '../../../decorators/signature/SignatureDecoratorUtils'\nimport type { DidCommAckMessage } from '../../../messages'\nimport type { DidCommInboundMessageContext, DidCommRouting } from '../../../models'\nimport { DidCommOutOfBandService } from '../../oob/DidCommOutOfBandService'\nimport { DidCommOutOfBandRole } from '../../oob/domain/DidCommOutOfBandRole'\nimport { DidCommOutOfBandState } from '../../oob/domain/DidCommOutOfBandState'\nimport { DidCommInvitationType } from '../../oob/messages'\nimport type { DidCommOutOfBandRecord } from '../../oob/repository'\nimport { DidCommOutOfBandRepository } from '../../oob/repository'\nimport { DidCommOutOfBandRecordMetadataKeys } from '../../oob/repository/outOfBandRecordMetadataTypes'\nimport type { DidCommConnectionStateChangedEvent } from '../DidCommConnectionEvents'\nimport { DidCommConnectionEventTypes } from '../DidCommConnectionEvents'\nimport { ConnectionProblemReportError, ConnectionProblemReportReason } from '../errors'\nimport type { DidCommConnectionProblemReportMessage } from '../messages'\nimport { DidCommConnectionRequestMessage, DidCommConnectionResponseMessage, DidCommTrustPingMessage } from '../messages'\nimport type { DidCommConnectionType } from '../models'\nimport {\n authenticationTypes,\n DidCommConnection,\n DidCommDidExchangeRole,\n DidCommDidExchangeState,\n DidCommHandshakeProtocol,\n DidDoc,\n Ed25119Sig2018,\n ReferencedAuthentication,\n} from '../models'\nimport type { DidCommConnectionRecordProps } from '../repository'\nimport { DidCommConnectionRecord, DidCommConnectionRepository } from '../repository'\n\nimport {\n assertNoCreatedDidExistsForKeys,\n convertToNewDidDocument,\n getResolvedDidcommServiceWithSigningKeyId,\n} from './helpers'\n\nexport interface ConnectionRequestParams {\n label: string\n imageUrl?: string\n alias?: string\n routing: DidCommRouting\n autoAcceptConnection?: boolean\n}\n\n@injectable()\nexport class DidCommConnectionService {\n private connectionRepository: DidCommConnectionRepository\n private didRepository: DidRepository\n private eventEmitter: EventEmitter\n private logger: Logger\n\n private hasLoggedWarning = false\n\n public constructor(\n @inject(InjectionSymbols.Logger) logger: Logger,\n connectionRepository: DidCommConnectionRepository,\n didRepository: DidRepository,\n eventEmitter: EventEmitter\n ) {\n this.connectionRepository = connectionRepository\n this.didRepository = didRepository\n this.eventEmitter = eventEmitter\n this.logger = logger\n }\n\n private ensureWarningLoggedOnce() {\n if (this.hasLoggedWarning) return\n\n this.logger.debug(\n 'The v1 connection protocol is deprecated and will be removed in version 0.7 of Credo. You should upgrade to the did exchange protocol instead.'\n )\n this.hasLoggedWarning = true\n }\n\n /**\n * Create a connection request message for a given out-of-band.\n *\n * @param outOfBandRecord out-of-band record for which to create a connection request\n * @param config config for creation of connection request\n * @returns outbound message containing connection request\n */\n public async createRequest(\n agentContext: AgentContext,\n outOfBandRecord: DidCommOutOfBandRecord,\n config: ConnectionRequestParams\n ): Promise<ConnectionProtocolMsgReturnType<DidCommConnectionRequestMessage>> {\n this.ensureWarningLoggedOnce()\n this.logger.debug(`Create message ${DidCommConnectionRequestMessage.type.messageTypeUri} start`, outOfBandRecord)\n outOfBandRecord.assertRole(DidCommOutOfBandRole.Receiver)\n outOfBandRecord.assertState(DidCommOutOfBandState.PrepareResponse)\n\n // TODO check there is no connection record for particular oob record\n\n const { outOfBandInvitation } = outOfBandRecord\n\n const { mediatorId } = config.routing\n const { didDoc, keys } = this.createDidDoc(config.routing)\n\n // TODO: We should store only one did that we'll use to send the request message with success.\n // We take just the first one for now.\n const [invitationDid] = outOfBandInvitation.invitationDids\n\n const { did: peerDid } = await this.createDid(agentContext, {\n role: DidDocumentRole.Created,\n didDoc,\n keys,\n })\n\n const { label, imageUrl } = config\n\n const connectionRequest = new DidCommConnectionRequestMessage({\n label,\n did: didDoc.id,\n didDoc,\n imageUrl,\n })\n\n connectionRequest.setThread({\n threadId: connectionRequest.threadId,\n parentThreadId: outOfBandRecord.outOfBandInvitation.id,\n })\n\n const connectionRecord = await this.createConnection(agentContext, {\n protocol: DidCommHandshakeProtocol.Connections,\n role: DidCommDidExchangeRole.Requester,\n state: DidCommDidExchangeState.InvitationReceived,\n theirLabel: outOfBandInvitation.label,\n alias: config?.alias,\n did: peerDid,\n mediatorId,\n autoAcceptConnection: config?.autoAcceptConnection,\n outOfBandId: outOfBandRecord.id,\n invitationDid,\n imageUrl: outOfBandInvitation.imageUrl,\n threadId: connectionRequest.threadId,\n })\n\n await this.updateState(agentContext, connectionRecord, DidCommDidExchangeState.RequestSent)\n\n return {\n connectionRecord,\n message: connectionRequest,\n }\n }\n\n public async processRequest(\n messageContext: DidCommInboundMessageContext<DidCommConnectionRequestMessage>,\n outOfBandRecord: DidCommOutOfBandRecord\n ): Promise<DidCommConnectionRecord> {\n this.ensureWarningLoggedOnce()\n this.logger.debug(`Process message ${DidCommConnectionRequestMessage.type.messageTypeUri} start`, {\n message: messageContext.message,\n })\n outOfBandRecord.assertRole(DidCommOutOfBandRole.Sender)\n outOfBandRecord.assertState(DidCommOutOfBandState.AwaitResponse)\n\n // TODO check there is no connection record for particular oob record\n\n const { message } = messageContext\n if (!message.connection.didDoc) {\n throw new ConnectionProblemReportError('Public DIDs are not supported yet', {\n problemCode: ConnectionProblemReportReason.RequestNotAccepted,\n })\n }\n\n const { did: peerDid } = await this.createDid(messageContext.agentContext, {\n role: DidDocumentRole.Received,\n didDoc: message.connection.didDoc,\n })\n\n const connectionRecord = await this.createConnection(messageContext.agentContext, {\n protocol: DidCommHandshakeProtocol.Connections,\n role: DidCommDidExchangeRole.Responder,\n state: DidCommDidExchangeState.RequestReceived,\n alias: outOfBandRecord.alias,\n theirLabel: message.label,\n imageUrl: message.imageUrl,\n outOfBandId: outOfBandRecord.id,\n theirDid: peerDid,\n threadId: message.threadId,\n mediatorId: outOfBandRecord.mediatorId,\n autoAcceptConnection: outOfBandRecord.autoAcceptConnection,\n })\n\n await this.connectionRepository.update(messageContext.agentContext, connectionRecord)\n this.emitStateChangedEvent(messageContext.agentContext, connectionRecord, null)\n\n this.logger.debug(`Process message ${DidCommConnectionRequestMessage.type.messageTypeUri} end`, connectionRecord)\n return connectionRecord\n }\n\n /**\n * Create a connection response message for the connection with the specified connection id.\n *\n * @param connectionRecord the connection for which to create a connection response\n * @returns outbound message containing connection response\n */\n public async createResponse(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n outOfBandRecord: DidCommOutOfBandRecord,\n routing?: DidCommRouting\n ): Promise<ConnectionProtocolMsgReturnType<DidCommConnectionResponseMessage>> {\n this.ensureWarningLoggedOnce()\n this.logger.debug(`Create message ${DidCommConnectionResponseMessage.type.messageTypeUri} start`, connectionRecord)\n connectionRecord.assertState(DidCommDidExchangeState.RequestReceived)\n connectionRecord.assertRole(DidCommDidExchangeRole.Responder)\n\n let didDoc: DidDoc\n let keys: DidDocumentKey[]\n if (routing) {\n const result = this.createDidDoc(routing)\n didDoc = result.didDoc\n keys = result.keys\n } else if (outOfBandRecord.outOfBandInvitation.getInlineServices().length > 0) {\n const result = this.createDidDocFromOutOfBandDidCommServices(outOfBandRecord)\n didDoc = result.didDoc\n keys = result.keys\n } else {\n // We don't support using a did from the OOB invitation services currently, in this case we always pass routing to this method\n throw new CredoError(\n 'No routing provided, and no inline services found in out of band invitation. When using did services in out of band invitation, make sure to provide routing information for rotation.'\n )\n }\n\n const { did: peerDid } = await this.createDid(agentContext, {\n role: DidDocumentRole.Created,\n didDoc,\n keys,\n })\n\n const connection = new DidCommConnection({\n did: didDoc.id,\n didDoc,\n })\n\n const connectionJson = JsonTransformer.toJSON(connection)\n\n if (!connectionRecord.threadId) {\n throw new CredoError(`Connection record with id ${connectionRecord.id} does not have a thread id`)\n }\n\n let signingKey: Kms.PublicJwk<Kms.Ed25519PublicJwk>\n const firstService = outOfBandRecord.outOfBandInvitation.getServices()[0]\n if (typeof firstService === 'string') {\n const dids = agentContext.resolve(DidsApi)\n const resolved = await dids.resolveCreatedDidDocumentWithKeys(parseDid(firstService).did)\n\n const recipientKeys = resolved.didDocument.getRecipientKeysWithVerificationMethod({ mapX25519ToEd25519: true })\n if (recipientKeys.length === 0) {\n throw new CredoError(`Unable to extract signing key for connection response from did '${firstService}'`)\n }\n\n signingKey = recipientKeys[0].publicJwk\n // TOOD: we probably need an util: addKeyIdToVerificationMethodKey\n signingKey.keyId =\n resolved.keys?.find(({ didDocumentRelativeKeyId }) =>\n recipientKeys[0].verificationMethod.id.endsWith(didDocumentRelativeKeyId)\n )?.kmsKeyId ?? signingKey.legacyKeyId\n } else {\n const service = getResolvedDidcommServiceWithSigningKeyId(\n firstService,\n outOfBandRecord.invitationInlineServiceKeys\n )\n signingKey = service.recipientKeys[0]\n }\n\n const connectionResponse = new DidCommConnectionResponseMessage({\n threadId: connectionRecord.threadId,\n connectionSig: await signData(agentContext, connectionJson, signingKey),\n })\n\n connectionRecord.did = peerDid\n await this.updateState(agentContext, connectionRecord, DidCommDidExchangeState.ResponseSent)\n\n this.logger.debug(`Create message ${DidCommConnectionResponseMessage.type.messageTypeUri} end`, {\n connectionRecord,\n message: connectionResponse,\n })\n return {\n connectionRecord,\n message: connectionResponse,\n }\n }\n\n /**\n * Process a received connection response message. This will not accept the connection request\n * or send a connection acknowledgement message. It will only update the existing connection record\n * with all the new information from the connection response message. Use {@link DidCommConnectionService.createTrustPing}\n * after calling this function to create a trust ping message.\n *\n * @param messageContext the message context containing a connection response message\n * @returns updated connection record\n */\n public async processResponse(\n messageContext: DidCommInboundMessageContext<DidCommConnectionResponseMessage>,\n outOfBandRecord: DidCommOutOfBandRecord\n ): Promise<DidCommConnectionRecord> {\n this.ensureWarningLoggedOnce()\n this.logger.debug(`Process message ${DidCommConnectionResponseMessage.type.messageTypeUri} start`, {\n message: messageContext.message,\n })\n const { connection: connectionRecord, message, recipientKey, senderKey } = messageContext\n\n if (!recipientKey || !senderKey) {\n throw new CredoError('Unable to process connection request without senderKey or recipientKey')\n }\n\n if (!connectionRecord) {\n throw new CredoError('No connection record in message context.')\n }\n\n connectionRecord.assertState(DidCommDidExchangeState.RequestSent)\n connectionRecord.assertRole(DidCommDidExchangeRole.Requester)\n\n let connectionJson = null\n try {\n connectionJson = await unpackAndVerifySignatureDecorator(messageContext.agentContext, message.connectionSig)\n } catch (error) {\n if (error instanceof CredoError) {\n throw new ConnectionProblemReportError(error.message, {\n problemCode: ConnectionProblemReportReason.ResponseProcessingError,\n })\n }\n throw error\n }\n\n const connection = JsonTransformer.fromJSON(connectionJson, DidCommConnection)\n\n // Per the Connection RFC we must check if the key used to sign the connection~sig is the same key\n // as the recipient key(s) in the connection invitation message\n const signerVerkey = message.connectionSig.signer\n\n const invitationKey = Kms.PublicJwk.fromFingerprint(outOfBandRecord.getTags().recipientKeyFingerprints[0])\n if (!invitationKey.is(Kms.Ed25519PublicJwk)) {\n throw new ConnectionProblemReportError(\n `Expected invitation key to be an Ed25519 key, found ${invitationKey.jwkTypehumanDescription}`,\n { problemCode: ConnectionProblemReportReason.ResponseNotAccepted }\n )\n }\n\n const invitationKeyBase58 = TypedArrayEncoder.toBase58(invitationKey.publicKey.publicKey)\n\n if (signerVerkey !== invitationKeyBase58) {\n throw new ConnectionProblemReportError(\n `Connection object in connection response message is not signed with same key as recipient key in invitation expected='${invitationKey}' received='${signerVerkey}'`,\n { problemCode: ConnectionProblemReportReason.ResponseNotAccepted }\n )\n }\n\n if (!connection.didDoc) {\n throw new CredoError('DID Document is missing.')\n }\n\n const { did: peerDid } = await this.createDid(messageContext.agentContext, {\n role: DidDocumentRole.Received,\n didDoc: connection.didDoc,\n })\n\n connectionRecord.theirDid = peerDid\n connectionRecord.threadId = message.threadId\n\n await this.updateState(messageContext.agentContext, connectionRecord, DidCommDidExchangeState.ResponseReceived)\n return connectionRecord\n }\n\n /**\n * Create a trust ping message for the connection with the specified connection id.\n *\n * By default a trust ping message should elicit a response. If this is not desired the\n * `config.responseRequested` property can be set to `false`.\n *\n * @param connectionRecord the connection for which to create a trust ping message\n * @param config the config for the trust ping message\n * @returns outbound message containing trust ping message\n */\n public async createTrustPing(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n config: { responseRequested?: boolean; comment?: string } = {}\n ): Promise<ConnectionProtocolMsgReturnType<DidCommTrustPingMessage>> {\n connectionRecord.assertState([DidCommDidExchangeState.ResponseReceived, DidCommDidExchangeState.Completed])\n\n // TODO:\n // - create ack message\n // - maybe this shouldn't be in the connection service?\n const trustPing = new DidCommTrustPingMessage(config)\n\n // Only update connection record and emit an event if the state is not already 'Complete'\n if (connectionRecord.state !== DidCommDidExchangeState.Completed) {\n await this.updateState(agentContext, connectionRecord, DidCommDidExchangeState.Completed)\n }\n\n return {\n connectionRecord,\n message: trustPing,\n }\n }\n\n /**\n * Process a received ack message. This will update the state of the connection\n * to Completed if this is not already the case.\n *\n * @param messageContext the message context containing an ack message\n * @returns updated connection record\n */\n public async processAck(\n messageContext: DidCommInboundMessageContext<DidCommAckMessage>\n ): Promise<DidCommConnectionRecord> {\n const { connection, recipientKey } = messageContext\n\n if (!connection) {\n throw new CredoError(\n `Unable to process connection ack: connection for recipient key ${recipientKey?.fingerprint} not found`\n )\n }\n\n // TODO: This is better addressed in a middleware of some kind because\n // any message can transition the state to complete, not just an ack or trust ping\n if (\n connection.state === DidCommDidExchangeState.ResponseSent &&\n connection.role === DidCommDidExchangeRole.Responder\n ) {\n await this.updateState(messageContext.agentContext, connection, DidCommDidExchangeState.Completed)\n }\n\n return connection\n }\n\n /**\n * Process a received {@link DidCommProblemReportMessage}.\n *\n * @param messageContext The message context containing a connection problem report message\n * @returns connection record associated with the connection problem report message\n *\n */\n public async processProblemReport(\n messageContext: DidCommInboundMessageContext<DidCommConnectionProblemReportMessage>\n ): Promise<DidCommConnectionRecord> {\n this.ensureWarningLoggedOnce()\n const { message: connectionProblemReportMessage, recipientKey, senderKey } = messageContext\n\n this.logger.debug(`Processing connection problem report for verkey ${recipientKey?.fingerprint}`)\n\n if (!recipientKey) {\n throw new CredoError('Unable to process connection problem report without recipientKey')\n }\n\n const ourDidRecord = await this.didRepository.findCreatedDidByRecipientKey(\n messageContext.agentContext,\n recipientKey\n )\n if (!ourDidRecord) {\n throw new CredoError(\n `Unable to process connection problem report: created did record for recipient key ${recipientKey.fingerprint} not found`\n )\n }\n\n const connectionRecord = await this.findByOurDid(messageContext.agentContext, ourDidRecord.did)\n if (!connectionRecord) {\n throw new CredoError(\n `Unable to process connection problem report: connection for recipient key ${recipientKey.fingerprint} not found`\n )\n }\n\n const theirDidRecord =\n connectionRecord.theirDid &&\n (await this.didRepository.findReceivedDid(messageContext.agentContext, connectionRecord.theirDid))\n if (!theirDidRecord) {\n throw new CredoError(`Received did record for did ${connectionRecord.theirDid} not found.`)\n }\n\n if (senderKey) {\n if (!theirDidRecord?.getTags().recipientKeyFingerprints?.includes(senderKey.fingerprint)) {\n throw new CredoError(\"Sender key doesn't match key of connection record\")\n }\n }\n\n connectionRecord.errorMessage = `${connectionProblemReportMessage.description.code} : ${connectionProblemReportMessage.description.en}`\n await this.update(messageContext.agentContext, connectionRecord)\n\n // Marking connection as abandoned in case of problem report from issuer agent\n // TODO: Can be conditionally abandoned - Like if another user is scanning already used connection invite where issuer will send invite-already-used problem code.\n await this.updateState(messageContext.agentContext, connectionRecord, DidCommDidExchangeState.Abandoned)\n\n return connectionRecord\n }\n\n /**\n * Assert that an inbound message either has a connection associated with it,\n * or has everything correctly set up for connection-less exchange (optionally with out of band)\n *\n * @param messageContext - the inbound message context\n */\n public async assertConnectionOrOutOfBandExchange(\n messageContext: DidCommInboundMessageContext,\n {\n lastSentMessage,\n lastReceivedMessage,\n expectedConnectionId,\n }: {\n lastSentMessage?: DidCommMessage | null\n lastReceivedMessage?: DidCommMessage | null\n expectedConnectionId?: string\n } = {}\n ) {\n const { connection, message } = messageContext\n\n if (expectedConnectionId && !connection) {\n throw new CredoError(\n `Expected incoming message to be from connection ${expectedConnectionId} but no connection found.`\n )\n }\n if (expectedConnectionId && connection?.id !== expectedConnectionId) {\n throw new CredoError(\n `Expected incoming message to be from connection ${expectedConnectionId} but connection is ${connection?.id}.`\n )\n }\n\n // Check if we have a ready connection. Verification is already done somewhere else. Return\n if (connection) {\n connection.assertReady()\n this.logger.debug(`Processing message with id ${message.id} and connection id ${connection.id}`, {\n type: message.type,\n })\n } else {\n this.logger.debug(`Processing connection-less message with id ${message.id}`, {\n type: message.type,\n })\n\n const recipientKey = messageContext.recipientKey\n const senderKey = messageContext.senderKey\n\n // set theirService to the value of lastReceivedMessage.service\n let theirService =\n messageContext.message?.service?.resolvedDidCommService ?? lastReceivedMessage?.service?.resolvedDidCommService\n let ourService = lastSentMessage?.service?.resolvedDidCommService\n\n // FIXME: we should remove support for the flow where no out of band record is used.\n // Users have had enough time to update to the OOB API which supports legacy connectionsless\n // invitations as well\n // 1. check if there's an oob record associated.\n const outOfBandRepository = messageContext.agentContext.dependencyManager.resolve(DidCommOutOfBandRepository)\n const outOfBandService = messageContext.agentContext.dependencyManager.resolve(DidCommOutOfBandService)\n const outOfBandRecord = await outOfBandRepository.findSingleByQuery(messageContext.agentContext, {\n invitationRequestsThreadIds: [message.threadId],\n })\n\n // If we have an out of band record, we can extract the service for our/the other party from the oob record\n if (outOfBandRecord?.role === DidCommOutOfBandRole.Sender) {\n ourService = await outOfBandService.getResolvedServiceForOutOfBandServices(\n messageContext.agentContext,\n outOfBandRecord.outOfBandInvitation.getServices(),\n outOfBandRecord.invitationInlineServiceKeys\n )\n } else if (outOfBandRecord?.role === DidCommOutOfBandRole.Receiver) {\n theirService = await outOfBandService.getResolvedServiceForOutOfBandServices(\n messageContext.agentContext,\n outOfBandRecord.outOfBandInvitation.getServices()\n )\n }\n\n // theirService can be null when we receive an oob invitation and process the message.\n // In this case there MUST be an oob record, otherwise there is no way for us to reply\n // to the message\n if (!theirService && !outOfBandRecord) {\n throw new CredoError(\n 'No service for incoming connection-less message and no associated out of band record found.'\n )\n }\n\n // ourService can be null when we receive an oob invitation or legacy connectionless message and process the message.\n // In this case lastSentMessage and lastReceivedMessage MUST be null, because there shouldn't be any previous exchange\n if (!ourService && (lastReceivedMessage || lastSentMessage)) {\n throw new CredoError(\n 'No keys on our side to use for encrypting messages, and previous messages found (in which case our keys MUST also be present).'\n )\n }\n\n // If the message is unpacked or AuthCrypt, there cannot be any previous exchange (this must be the first message).\n // All exchange after the first unpacked oob exchange MUST be encrypted.\n if ((!senderKey || !recipientKey) && (lastSentMessage || lastReceivedMessage)) {\n throw new CredoError(\n 'Incoming message must have recipientKey and senderKey (so cannot be AuthCrypt or unpacked) if there are lastSentMessage or lastReceivedMessage.'\n )\n }\n\n // Check if recipientKey is in ourService\n if (recipientKey && ourService) {\n const recipientKeyFound = ourService.recipientKeys.some((key) => recipientKey.equals(key))\n if (!recipientKeyFound) {\n throw new CredoError(`Recipient key ${recipientKey.fingerprint} not found in our service`)\n }\n }\n\n // Check if senderKey is in theirService\n if (senderKey && theirService) {\n const senderKeyFound = theirService.recipientKeys.some((key) => senderKey.equals(key))\n if (!senderKeyFound) {\n throw new CredoError(`Sender key ${senderKey.fingerprint} not found in their service.`)\n }\n }\n }\n }\n\n /**\n * If knownConnectionId is passed, it will compare the incoming connection id with the knownConnectionId, and skip the other validation.\n *\n * If no known connection id is passed, it asserts that the incoming message is in response to an attached request message to an out of band invitation.\n * If is the case, and the state of the out of band record is still await response, the state will be updated to done\n *\n */\n public async matchIncomingMessageToRequestMessageInOutOfBandExchange(\n messageContext: DidCommInboundMessageContext,\n { expectedConnectionId }: { expectedConnectionId?: string }\n ) {\n if (expectedConnectionId && messageContext.connection?.id !== expectedConnectionId) {\n throw new CredoError(\n `Expecting incoming message to have connection ${expectedConnectionId}, but incoming connection is ${\n messageContext.connection?.id ?? 'undefined'\n }`\n )\n }\n\n const outOfBandRepository = messageContext.agentContext.dependencyManager.resolve(DidCommOutOfBandRepository)\n const outOfBandInvitationId = messageContext.message.thread?.parentThreadId\n\n // Find the out of band record that is associated with this request\n const outOfBandRecord = await outOfBandRepository.findSingleByQuery(messageContext.agentContext, {\n invitationId: outOfBandInvitationId,\n role: DidCommOutOfBandRole.Sender,\n invitationRequestsThreadIds: [messageContext.message.threadId],\n })\n\n // There is no out of band record\n if (!outOfBandRecord) {\n throw new CredoError(\n `No out of band record found for credential request message with thread ${messageContext.message.threadId}, out of band invitation id ${outOfBandInvitationId} and role ${DidCommOutOfBandRole.Sender}`\n )\n }\n\n const legacyInvitationMetadata = outOfBandRecord.metadata.get(DidCommOutOfBandRecordMetadataKeys.LegacyInvitation)\n\n // If the original invitation was a legacy connectionless invitation, it's okay if the message does not have a pthid.\n if (\n legacyInvitationMetadata?.legacyInvitationType !== DidCommInvitationType.Connectionless &&\n outOfBandRecord.outOfBandInvitation.id !== outOfBandInvitationId\n ) {\n throw new CredoError(\n 'Response messages to out of band invitation requests MUST have a parent thread id that matches the out of band invitation id.'\n )\n }\n\n // This should not happen, as it is not allowed to create reusable out of band invitations with attached messages\n // But should that implementation change, we at least cover it here.\n if (outOfBandRecord.reusable) {\n throw new CredoError('Receiving messages in response to reusable out of band invitations is not supported.')\n }\n\n if (outOfBandRecord.state === DidCommOutOfBandState.Done) {\n if (!messageContext.connection) {\n throw new CredoError(\n \"Can't find connection associated with incoming message, while out of band state is done. State must be await response if no connection has been created\"\n )\n }\n if (messageContext.connection.outOfBandId !== outOfBandRecord.id) {\n throw new CredoError(\n 'Connection associated with incoming message is not associated with the out of band invitation containing the attached message.'\n )\n }\n\n // We're good to go. Connection was created and points to the correct out of band record. And the message is in response to an attached request message from the oob invitation.\n } else if (outOfBandRecord.state === DidCommOutOfBandState.AwaitResponse) {\n // We're good to go. Waiting for a response. And the message is in response to an attached request message from the oob invitation.\n\n // Now that we have received the first response message to our out of band invitation, we mark the out of band record as done\n outOfBandRecord.state = DidCommOutOfBandState.Done\n await outOfBandRepository.update(messageContext.agentContext, outOfBandRecord)\n } else {\n throw new CredoError(`Out of band record is in incorrect state ${outOfBandRecord.state}`)\n }\n }\n\n public async updateState(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n newState: DidCommDidExchangeState\n ) {\n const previousState = connectionRecord.state\n connectionRecord.state = newState\n await this.connectionRepository.update(agentContext, connectionRecord)\n\n this.emitStateChangedEvent(agentContext, connectionRecord, previousState)\n }\n\n private emitStateChangedEvent(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n previousState: DidCommDidExchangeState | null\n ) {\n this.eventEmitter.emit<DidCommConnectionStateChangedEvent>(agentContext, {\n type: DidCommConnectionEventTypes.DidCommConnectionStateChanged,\n payload: {\n // Connection record in event should be static\n connectionRecord: connectionRecord.clone(),\n previousState,\n },\n })\n }\n\n public update(agentContext: AgentContext, connectionRecord: DidCommConnectionRecord) {\n return this.connectionRepository.update(agentContext, connectionRecord)\n }\n\n /**\n * Retrieve all connections records\n *\n * @returns List containing all connection records\n */\n public getAll(agentContext: AgentContext) {\n return this.connectionRepository.getAll(agentContext)\n }\n\n /**\n * Retrieve a connection record by id\n *\n * @param connectionId The connection record id\n * @throws {RecordNotFoundError} If no record is found\n * @return The connection record\n *\n */\n public getById(agentContext: AgentContext, connectionId: string): Promise<DidCommConnectionRecord> {\n return this.connectionRepository.getById(agentContext, connectionId)\n }\n\n /**\n * Find a connection record by id\n *\n * @param connectionId the connection record id\n * @returns The connection record or null if not found\n */\n public findById(agentContext: AgentContext, connectionId: string): Promise<DidCommConnectionRecord | null> {\n return this.connectionRepository.findById(agentContext, connectionId)\n }\n\n /**\n * Delete a connection record by id\n *\n * @param connectionId the connection record id\n */\n public async deleteById(agentContext: AgentContext, connectionId: string) {\n const connectionRecord = await this.getById(agentContext, connectionId)\n return this.connectionRepository.delete(agentContext, connectionRecord)\n }\n\n public async findByDids(agentContext: AgentContext, query: { ourDid: string; theirDid: string }) {\n return this.connectionRepository.findByDids(agentContext, query)\n }\n\n /**\n * Retrieve a connection record by thread id\n *\n * @param threadId The thread id\n * @throws {RecordNotFoundError} If no record is found\n * @throws {RecordDuplicateError} If multiple records are found\n * @returns The connection record\n */\n public async getByThreadId(agentContext: AgentContext, threadId: string): Promise<DidCommConnectionRecord> {\n return this.connectionRepository.getByThreadId(agentContext, threadId)\n }\n\n public async getByRoleAndThreadId(agentContext: AgentContext, role: DidCommDidExchangeRole, threadId: string) {\n return this.connectionRepository.getByRoleAndThreadId(agentContext, role, threadId)\n }\n\n public async findByTheirDid(agentContext: AgentContext, theirDid: string): Promise<DidCommConnectionRecord | null> {\n return this.connectionRepository.findSingleByQuery(agentContext, { theirDid })\n }\n\n public async findByOurDid(agentContext: AgentContext, ourDid: string): Promise<DidCommConnectionRecord | null> {\n return this.connectionRepository.findSingleByQuery(agentContext, { did: ourDid })\n }\n\n public async findAllByOutOfBandId(agentContext: AgentContext, outOfBandId: string) {\n return this.connectionRepository.findByQuery(agentContext, { outOfBandId })\n }\n\n public async findAllByConnectionTypes(\n agentContext: AgentContext,\n connectionTypes: Array<DidCommConnectionType | string>\n ) {\n return this.connectionRepository.findByQuery(agentContext, { connectionTypes })\n }\n\n public async findByInvitationDid(agentContext: AgentContext, invitationDid: string) {\n return this.connectionRepository.findByQuery(agentContext, { invitationDid })\n }\n\n public async findByKeys(\n agentContext: AgentContext,\n {\n senderKey,\n recipientKey,\n }: { senderKey: Kms.PublicJwk<Kms.Ed25519PublicJwk>; recipientKey: Kms.PublicJwk<Kms.Ed25519PublicJwk> }\n ) {\n const theirDidRecord = await this.didRepository.findReceivedDidByRecipientKey(agentContext, senderKey)\n if (theirDidRecord) {\n const ourDidRecord = await this.didRepository.findCreatedDidByRecipientKey(agentContext, recipientKey)\n if (ourDidRecord) {\n const connectionRecord = await this.findByDids(agentContext, {\n ourDid: ourDidRecord.did,\n theirDid: theirDidRecord.did,\n })\n if (connectionRecord?.isReady) return connectionRecord\n }\n }\n\n this.logger.debug(\n `No connection record found for encrypted message with recipient key ${recipientKey.fingerprint} and sender key ${senderKey.fingerprint}`\n )\n\n return null\n }\n\n public async findAllByQuery(\n agentContext: AgentContext,\n query: Query<DidCommConnectionRecord>,\n queryOptions?: QueryOptions\n ): Promise<DidCommConnectionRecord[]> {\n return this.connectionRepository.findByQuery(agentContext, query, queryOptions)\n }\n\n public async createConnection(\n agentContext: AgentContext,\n options: DidCommConnectionRecordProps\n ): Promise<DidCommConnectionRecord> {\n const connectionRecord = new DidCommConnectionRecord(options)\n await this.connectionRepository.save(agentContext, connectionRecord)\n return connectionRecord\n }\n\n public async addConnectionType(agentContext: AgentContext, connectionRecord: DidCommConnectionRecord, type: string) {\n const connectionTypes = connectionRecord.connectionTypes || []\n connectionRecord.connectionTypes = [type, ...connectionTypes]\n await this.update(agentContext, connectionRecord)\n }\n\n public async removeConnectionType(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n type: string\n ) {\n connectionRecord.connectionTypes = connectionRecord.connectionTypes.filter((value) => value !== type)\n await this.update(agentContext, connectionRecord)\n }\n\n public async getConnectionTypes(connectionRecord: DidCommConnectionRecord) {\n return connectionRecord.connectionTypes || []\n }\n\n private async createDid(\n agentContext: AgentContext,\n { role, didDoc, keys }: { role: DidDocumentRole; didDoc: DidDoc; keys?: DidDocumentKey[] }\n ) {\n if (keys && role !== DidDocumentRole.Created) {\n throw new CredoError(`keys can only be provided for did documents when the role is '${DidDocumentRole.Created}'`)\n }\n\n // Convert the legacy did doc to a new did document\n const { didDocument, keys: updatedKeys } = convertToNewDidDocument(didDoc, keys)\n\n // Assert that the keys we are going to use for creating a did document haven't already been used in another did document\n if (role === DidDocumentRole.Created) {\n await assertNoCreatedDidExistsForKeys(agentContext, didDocument.recipientKeys)\n }\n\n const peerDid = didDocumentJsonToNumAlgo1Did(didDocument.toJSON())\n didDocument.id = peerDid\n const didRecord = new DidRecord({\n did: peerDid,\n role,\n didDocument,\n keys: updatedKeys,\n })\n\n // Store the unqualified did with the legacy did document in the metadata\n // Can be removed at a later stage if we know for sure we don't need it anymore\n didRecord.metadata.set(DidRecordMetadataKeys.LegacyDid, {\n unqualifiedDid: didDoc.id,\n didDocumentString: JsonTransformer.serialize(didDoc),\n })\n\n this.logger.debug('Saving DID record', {\n id: didRecord.id,\n did: didRecord.did,\n role: didRecord.role,\n tags: didRecord.getTags(),\n didDocument: 'omitted...',\n })\n\n await this.didRepository.save(agentContext, didRecord)\n this.logger.debug('Did record created.', didRecord)\n return { did: peerDid, didDocument }\n }\n\n private createDidDoc(routing: DidCommRouting) {\n const recipientKeyBase58 = TypedArrayEncoder.toBase58(routing.recipientKey.publicKey.publicKey)\n const indyDid = utils.indyDidFromPublicKeyBase58(recipientKeyBase58)\n\n const keys: DidDocumentKey[] = [\n {\n didDocumentRelativeKeyId: '#1',\n kmsKeyId: routing.recipientKey.keyId,\n },\n ]\n\n const publicKey = new Ed25119Sig2018({\n id: `${indyDid}#1`,\n controller: indyDid,\n publicKeyBase58: recipientKeyBase58,\n })\n\n const auth = new ReferencedAuthentication(publicKey, authenticationTypes.Ed25519VerificationKey2018)\n\n // IndyAgentService is old service type\n const services = routing.endpoints.map(\n (endpoint, index) =>\n new IndyAgentService({\n id: `${indyDid}#IndyAgentService-${index + 1}`,\n serviceEndpoint: endpoint,\n recipientKeys: [recipientKeyBase58],\n routingKeys: routing.routingKeys.map((key) => TypedArrayEncoder.toBase58(key.publicKey.publicKey)),\n // Order of endpoint determines priority\n priority: index,\n })\n )\n\n return {\n didDoc: new DidDoc({\n id: indyDid,\n authentication: [auth],\n service: services,\n publicKey: [publicKey],\n }),\n keys,\n }\n }\n\n private createDidDocFromOutOfBandDidCommServices(outOfBandRecord: DidCommOutOfBandRecord) {\n const services = outOfBandRecord.outOfBandInvitation\n .getInlineServices()\n .map((service) => getResolvedDidcommServiceWithSigningKeyId(service, outOfBandRecord.invitationInlineServiceKeys))\n\n const [recipientKey] = services[0].recipientKeys\n const recipientKeyBase58 = TypedArrayEncoder.toBase58(recipientKey.publicKey.publicKey)\n const did = utils.indyDidFromPublicKeyBase58(recipientKeyBase58)\n\n const publicKey = new Ed25119Sig2018({\n id: `${did}#1`,\n controller: did,\n publicKeyBase58: recipientKeyBase58,\n })\n\n const auth = new ReferencedAuthentication(publicKey, authenticationTypes.Ed25519VerificationKey2018)\n\n // IndyAgentService is old service type\n const service = services.map(\n (service, index) =>\n new IndyAgentService({\n id: `${did}#IndyAgentService-${index + 1}`,\n serviceEndpoint: service.serviceEndpoint,\n recipientKeys: [recipientKeyBase58],\n routingKeys: service.routingKeys?.map((publicJwk) =>\n TypedArrayEncoder.toBase58(publicJwk.publicKey.publicKey)\n ),\n priority: index,\n })\n )\n\n return {\n didDoc: new DidDoc({\n id: did,\n authentication: [auth],\n service,\n publicKey: [publicKey],\n }),\n keys: [{ didDocumentRelativeKeyId: '#1', kmsKeyId: recipientKey.keyId }] satisfies DidDocumentKey[],\n }\n }\n\n public async returnWhenIsConnected(\n agentContext: AgentContext,\n connectionId: string,\n timeoutMs = 20000\n ): Promise<DidCommConnectionRecord> {\n const isConnected = (connection: DidCommConnectionRecord) => {\n return connection.id === connectionId && connection.state === DidCommDidExchangeState.Completed\n }\n\n const observable = this.eventEmitter.observable<DidCommConnectionStateChangedEvent>(\n DidCommConnectionEventTypes.DidCommConnectionStateChanged\n )\n const subject = new ReplaySubject<DidCommConnectionRecord>(1)\n\n observable\n .pipe(\n filterContextCorrelationId(agentContext.contextCorrelationId),\n map((e) => e.payload.connectionRecord),\n first(isConnected), // Do not wait for longer than specified timeout\n timeout({\n first: timeoutMs,\n meta: 'DidCommConnectionService.returnWhenIsConnected',\n })\n )\n .subscribe(subject)\n\n const connection = await this.getById(agentContext, connectionId)\n if (isConnected(connection)) {\n subject.next(connection)\n }\n\n return firstValueFrom(subject)\n }\n}\n\nexport interface ConnectionProtocolMsgReturnType<MessageType extends DidCommMessage> {\n message: MessageType\n connectionRecord: DidCommConnectionRecord\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEO,qCAAMA,2BAAyB;CAQpC,AAAO,YACL,AAAiCC,QACjC,sBACA,eACA,cACA;OAPM,mBAAmB;AAQzB,OAAK,uBAAuB;AAC5B,OAAK,gBAAgB;AACrB,OAAK,eAAe;AACpB,OAAK,SAAS;;CAGhB,AAAQ,0BAA0B;AAChC,MAAI,KAAK,iBAAkB;AAE3B,OAAK,OAAO,MACV,iJACD;AACD,OAAK,mBAAmB;;;;;;;;;CAU1B,MAAa,cACX,cACA,iBACA,QAC2E;AAC3E,OAAK,yBAAyB;AAC9B,OAAK,OAAO,MAAM,kBAAkB,gCAAgC,KAAK,eAAe,SAAS,gBAAgB;AACjH,kBAAgB,WAAW,qBAAqB,SAAS;AACzD,kBAAgB,YAAY,sBAAsB,gBAAgB;EAIlE,MAAM,EAAE,wBAAwB;EAEhC,MAAM,EAAE,eAAe,OAAO;EAC9B,MAAM,EAAE,QAAQ,SAAS,KAAK,aAAa,OAAO,QAAQ;EAI1D,MAAM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AAa,KAAK,aAAa,WACnC,4BAA4B,8BAC7B;EACD,MAAM,UAAU,IAAI,cAAuC,EAAE;AAE7D,aACG,KACC,2BAA2B,aAAa,qBAAqB,EAC7DC,OAAK,MAAM,EAAE,QAAQ,iBAAiB,EACtCC,QAAM,YAAY,EAClBC,UAAQ;GACN,OAAO;GACP,MAAM;GACP,CAAC,CACH,CACA,UAAU,QAAQ;EAErB,MAAM,aAAa,MAAM,KAAK,QAAQ,cAAc,aAAa;AACjE,MAAI,YAAY,WAAW,CACzB,SAAQ,KAAK,WAAW;AAG1B,SAAO,eAAe,QAAQ;;;;CAj9BjC,YAAY;oBAUR,OAAO,iBAAiB,OAAO"}
1
+ {"version":3,"file":"DidCommConnectionService.mjs","names":["DidCommConnectionService","logger: Logger","didDoc: DidDoc","keys: DidDocumentKey[]","signingKey: Kms.PublicJwk<Kms.Ed25519PublicJwk>","service","connection","map","first","timeout"],"sources":["../../../../src/modules/connections/services/DidCommConnectionService.ts"],"sourcesContent":["import type { AgentContext, DidDocumentKey, Query, QueryOptions } from '@credo-ts/core'\nimport {\n CredoError,\n DidDocumentRole,\n DidRecord,\n DidRecordMetadataKeys,\n DidRepository,\n DidsApi,\n didDocumentJsonToNumAlgo1Did,\n EventEmitter,\n filterContextCorrelationId,\n IndyAgentService,\n InjectionSymbols,\n inject,\n injectable,\n JsonTransformer,\n Kms,\n type Logger,\n parseDid,\n TypedArrayEncoder,\n utils,\n} from '@credo-ts/core'\nimport { firstValueFrom, ReplaySubject } from 'rxjs'\nimport { first, map, timeout } from 'rxjs/operators'\nimport type { DidCommMessage } from '../../../DidCommMessage'\nimport { signData, unpackAndVerifySignatureDecorator } from '../../../decorators/signature/SignatureDecoratorUtils'\nimport type { DidCommAckMessage } from '../../../messages'\nimport type { DidCommInboundMessageContext, DidCommRouting } from '../../../models'\nimport { DidCommOutOfBandService } from '../../oob/DidCommOutOfBandService'\nimport { DidCommOutOfBandRole } from '../../oob/domain/DidCommOutOfBandRole'\nimport { DidCommOutOfBandState } from '../../oob/domain/DidCommOutOfBandState'\nimport { DidCommInvitationType } from '../../oob/messages'\nimport type { DidCommOutOfBandRecord } from '../../oob/repository'\nimport { DidCommOutOfBandRepository } from '../../oob/repository'\nimport { DidCommOutOfBandRecordMetadataKeys } from '../../oob/repository/outOfBandRecordMetadataTypes'\nimport type { DidCommConnectionStateChangedEvent } from '../DidCommConnectionEvents'\nimport { DidCommConnectionEventTypes } from '../DidCommConnectionEvents'\nimport { ConnectionProblemReportError, ConnectionProblemReportReason } from '../errors'\nimport type { DidCommConnectionProblemReportMessage } from '../messages'\nimport { DidCommConnectionRequestMessage, DidCommConnectionResponseMessage, DidCommTrustPingMessage } from '../messages'\nimport type { DidCommConnectionType } from '../models'\nimport {\n authenticationTypes,\n DidCommConnection,\n DidCommDidExchangeRole,\n DidCommDidExchangeState,\n DidCommHandshakeProtocol,\n DidDoc,\n Ed25119Sig2018,\n ReferencedAuthentication,\n} from '../models'\nimport type { DidCommConnectionRecordProps } from '../repository'\nimport { DidCommConnectionRecord, DidCommConnectionRepository } from '../repository'\n\nimport {\n assertNoCreatedDidExistsForKeys,\n convertToNewDidDocument,\n getResolvedDidcommServiceWithSigningKeyId,\n} from './helpers'\n\nexport interface ConnectionRequestParams {\n label: string\n imageUrl?: string\n alias?: string\n routing: DidCommRouting\n autoAcceptConnection?: boolean\n}\n\n@injectable()\nexport class DidCommConnectionService {\n private connectionRepository: DidCommConnectionRepository\n private didRepository: DidRepository\n private eventEmitter: EventEmitter\n private logger: Logger\n\n private hasLoggedWarning = false\n\n public constructor(\n @inject(InjectionSymbols.Logger) logger: Logger,\n connectionRepository: DidCommConnectionRepository,\n didRepository: DidRepository,\n eventEmitter: EventEmitter\n ) {\n this.connectionRepository = connectionRepository\n this.didRepository = didRepository\n this.eventEmitter = eventEmitter\n this.logger = logger\n }\n\n private ensureWarningLoggedOnce() {\n if (this.hasLoggedWarning) return\n\n this.logger.debug(\n 'The v1 connection protocol is deprecated and will be removed in version 0.7 of Credo. You should upgrade to the did exchange protocol instead.'\n )\n this.hasLoggedWarning = true\n }\n\n /**\n * Create a connection request message for a given out-of-band.\n *\n * @param outOfBandRecord out-of-band record for which to create a connection request\n * @param config config for creation of connection request\n * @returns outbound message containing connection request\n */\n public async createRequest(\n agentContext: AgentContext,\n outOfBandRecord: DidCommOutOfBandRecord,\n config: ConnectionRequestParams\n ): Promise<ConnectionProtocolMsgReturnType<DidCommConnectionRequestMessage>> {\n this.ensureWarningLoggedOnce()\n this.logger.debug(`Create message ${DidCommConnectionRequestMessage.type.messageTypeUri} start`, outOfBandRecord)\n outOfBandRecord.assertRole(DidCommOutOfBandRole.Receiver)\n outOfBandRecord.assertState(DidCommOutOfBandState.PrepareResponse)\n\n // TODO check there is no connection record for particular oob record\n\n const { outOfBandInvitation } = outOfBandRecord\n\n const { mediatorId } = config.routing\n const { didDoc, keys } = this.createDidDoc(config.routing)\n\n // TODO: We should store only one did that we'll use to send the request message with success.\n // We take just the first one for now.\n const [invitationDid] = outOfBandInvitation.invitationDids\n\n const { did: peerDid } = await this.createDid(agentContext, {\n role: DidDocumentRole.Created,\n didDoc,\n keys,\n })\n\n const { label, imageUrl } = config\n\n const connectionRequest = new DidCommConnectionRequestMessage({\n label,\n did: didDoc.id,\n didDoc,\n imageUrl,\n })\n\n connectionRequest.setThread({\n threadId: connectionRequest.threadId,\n parentThreadId: outOfBandRecord.outOfBandInvitation.id,\n })\n\n const connectionRecord = await this.createConnection(agentContext, {\n protocol: DidCommHandshakeProtocol.Connections,\n role: DidCommDidExchangeRole.Requester,\n state: DidCommDidExchangeState.InvitationReceived,\n theirLabel: outOfBandInvitation.label,\n alias: config?.alias,\n did: peerDid,\n mediatorId,\n autoAcceptConnection: config?.autoAcceptConnection,\n outOfBandId: outOfBandRecord.id,\n invitationDid,\n imageUrl: outOfBandInvitation.imageUrl,\n threadId: connectionRequest.threadId,\n })\n\n await this.updateState(agentContext, connectionRecord, DidCommDidExchangeState.RequestSent)\n\n return {\n connectionRecord,\n message: connectionRequest,\n }\n }\n\n public async processRequest(\n messageContext: DidCommInboundMessageContext<DidCommConnectionRequestMessage>,\n outOfBandRecord: DidCommOutOfBandRecord\n ): Promise<DidCommConnectionRecord> {\n this.ensureWarningLoggedOnce()\n this.logger.debug(`Process message ${DidCommConnectionRequestMessage.type.messageTypeUri} start`, {\n message: messageContext.message,\n })\n outOfBandRecord.assertRole(DidCommOutOfBandRole.Sender)\n outOfBandRecord.assertState(DidCommOutOfBandState.AwaitResponse)\n\n // TODO check there is no connection record for particular oob record\n\n const { message } = messageContext\n if (!message.connection.didDoc) {\n throw new ConnectionProblemReportError('Public DIDs are not supported yet', {\n problemCode: ConnectionProblemReportReason.RequestNotAccepted,\n })\n }\n\n const { did: peerDid } = await this.createDid(messageContext.agentContext, {\n role: DidDocumentRole.Received,\n didDoc: message.connection.didDoc,\n })\n\n const connectionRecord = await this.createConnection(messageContext.agentContext, {\n protocol: DidCommHandshakeProtocol.Connections,\n role: DidCommDidExchangeRole.Responder,\n state: DidCommDidExchangeState.RequestReceived,\n alias: outOfBandRecord.alias,\n theirLabel: message.label,\n imageUrl: message.imageUrl,\n outOfBandId: outOfBandRecord.id,\n theirDid: peerDid,\n threadId: message.threadId,\n mediatorId: outOfBandRecord.mediatorId,\n autoAcceptConnection: outOfBandRecord.autoAcceptConnection,\n })\n\n await this.connectionRepository.update(messageContext.agentContext, connectionRecord)\n this.emitStateChangedEvent(messageContext.agentContext, connectionRecord, null)\n\n this.logger.debug(`Process message ${DidCommConnectionRequestMessage.type.messageTypeUri} end`, connectionRecord)\n return connectionRecord\n }\n\n /**\n * Create a connection response message for the connection with the specified connection id.\n *\n * @param connectionRecord the connection for which to create a connection response\n * @returns outbound message containing connection response\n */\n public async createResponse(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n outOfBandRecord: DidCommOutOfBandRecord,\n routing?: DidCommRouting\n ): Promise<ConnectionProtocolMsgReturnType<DidCommConnectionResponseMessage>> {\n this.ensureWarningLoggedOnce()\n this.logger.debug(`Create message ${DidCommConnectionResponseMessage.type.messageTypeUri} start`, connectionRecord)\n connectionRecord.assertState(DidCommDidExchangeState.RequestReceived)\n connectionRecord.assertRole(DidCommDidExchangeRole.Responder)\n\n let didDoc: DidDoc\n let keys: DidDocumentKey[]\n if (routing) {\n const result = this.createDidDoc(routing)\n didDoc = result.didDoc\n keys = result.keys\n } else if (outOfBandRecord.outOfBandInvitation.getInlineServices().length > 0) {\n const result = this.createDidDocFromOutOfBandDidCommServices(outOfBandRecord)\n didDoc = result.didDoc\n keys = result.keys\n } else {\n // We don't support using a did from the OOB invitation services currently, in this case we always pass routing to this method\n throw new CredoError(\n 'No routing provided, and no inline services found in out of band invitation. When using did services in out of band invitation, make sure to provide routing information for rotation.'\n )\n }\n\n const { did: peerDid } = await this.createDid(agentContext, {\n role: DidDocumentRole.Created,\n didDoc,\n keys,\n })\n\n const connection = new DidCommConnection({\n did: didDoc.id,\n didDoc,\n })\n\n const connectionJson = JsonTransformer.toJSON(connection)\n\n if (!connectionRecord.threadId) {\n throw new CredoError(`Connection record with id ${connectionRecord.id} does not have a thread id`)\n }\n\n let signingKey: Kms.PublicJwk<Kms.Ed25519PublicJwk>\n const firstService = outOfBandRecord.outOfBandInvitation.getServices()[0]\n if (typeof firstService === 'string') {\n const dids = agentContext.resolve(DidsApi)\n const resolved = await dids.resolveCreatedDidDocumentWithKeys(parseDid(firstService).did)\n\n const recipientKeys = resolved.didDocument.getRecipientKeysWithVerificationMethod({ mapX25519ToEd25519: true })\n if (recipientKeys.length === 0) {\n throw new CredoError(`Unable to extract signing key for connection response from did '${firstService}'`)\n }\n\n signingKey = recipientKeys[0].publicJwk\n // TOOD: we probably need an util: addKeyIdToVerificationMethodKey\n signingKey.keyId =\n resolved.keys?.find(({ didDocumentRelativeKeyId }) =>\n recipientKeys[0].verificationMethod.id.endsWith(didDocumentRelativeKeyId)\n )?.kmsKeyId ?? signingKey.legacyKeyId\n } else {\n const service = getResolvedDidcommServiceWithSigningKeyId(\n firstService,\n outOfBandRecord.invitationInlineServiceKeys\n )\n signingKey = service.recipientKeys[0]\n }\n\n const connectionResponse = new DidCommConnectionResponseMessage({\n threadId: connectionRecord.threadId,\n connectionSig: await signData(agentContext, connectionJson, signingKey),\n })\n\n connectionRecord.did = peerDid\n await this.updateState(agentContext, connectionRecord, DidCommDidExchangeState.ResponseSent)\n\n this.logger.debug(`Create message ${DidCommConnectionResponseMessage.type.messageTypeUri} end`, {\n connectionRecord,\n message: connectionResponse,\n })\n return {\n connectionRecord,\n message: connectionResponse,\n }\n }\n\n /**\n * Process a received connection response message. This will not accept the connection request\n * or send a connection acknowledgement message. It will only update the existing connection record\n * with all the new information from the connection response message. Use {@link DidCommConnectionService.createTrustPing}\n * after calling this function to create a trust ping message.\n *\n * @param messageContext the message context containing a connection response message\n * @returns updated connection record\n */\n public async processResponse(\n messageContext: DidCommInboundMessageContext<DidCommConnectionResponseMessage>,\n outOfBandRecord: DidCommOutOfBandRecord\n ): Promise<DidCommConnectionRecord> {\n this.ensureWarningLoggedOnce()\n this.logger.debug(`Process message ${DidCommConnectionResponseMessage.type.messageTypeUri} start`, {\n message: messageContext.message,\n })\n const { connection: connectionRecord, message, recipientKey, senderKey } = messageContext\n\n if (!recipientKey || !senderKey) {\n throw new CredoError('Unable to process connection request without senderKey or recipientKey')\n }\n\n if (!connectionRecord) {\n throw new CredoError('No connection record in message context.')\n }\n\n connectionRecord.assertState(DidCommDidExchangeState.RequestSent)\n connectionRecord.assertRole(DidCommDidExchangeRole.Requester)\n\n let connectionJson = null\n try {\n connectionJson = await unpackAndVerifySignatureDecorator(messageContext.agentContext, message.connectionSig)\n } catch (error) {\n if (error instanceof CredoError) {\n throw new ConnectionProblemReportError(error.message, {\n problemCode: ConnectionProblemReportReason.ResponseProcessingError,\n })\n }\n throw error\n }\n\n const connection = JsonTransformer.fromJSON(connectionJson, DidCommConnection)\n\n // Per the Connection RFC we must check if the key used to sign the connection~sig is the same key\n // as the recipient key(s) in the connection invitation message\n const signerVerkey = message.connectionSig.signer\n\n const invitationKey = Kms.PublicJwk.fromFingerprint(outOfBandRecord.getTags().recipientKeyFingerprints[0])\n if (!invitationKey.is(Kms.Ed25519PublicJwk)) {\n throw new ConnectionProblemReportError(\n `Expected invitation key to be an Ed25519 key, found ${invitationKey.jwkTypeHumanDescription}`,\n { problemCode: ConnectionProblemReportReason.ResponseNotAccepted }\n )\n }\n\n const invitationKeyBase58 = TypedArrayEncoder.toBase58(invitationKey.publicKey.publicKey)\n\n if (signerVerkey !== invitationKeyBase58) {\n throw new ConnectionProblemReportError(\n `Connection object in connection response message is not signed with same key as recipient key in invitation expected='${invitationKey}' received='${signerVerkey}'`,\n { problemCode: ConnectionProblemReportReason.ResponseNotAccepted }\n )\n }\n\n if (!connection.didDoc) {\n throw new CredoError('DID Document is missing.')\n }\n\n const { did: peerDid } = await this.createDid(messageContext.agentContext, {\n role: DidDocumentRole.Received,\n didDoc: connection.didDoc,\n })\n\n connectionRecord.theirDid = peerDid\n connectionRecord.threadId = message.threadId\n\n await this.updateState(messageContext.agentContext, connectionRecord, DidCommDidExchangeState.ResponseReceived)\n return connectionRecord\n }\n\n /**\n * Create a trust ping message for the connection with the specified connection id.\n *\n * By default a trust ping message should elicit a response. If this is not desired the\n * `config.responseRequested` property can be set to `false`.\n *\n * @param connectionRecord the connection for which to create a trust ping message\n * @param config the config for the trust ping message\n * @returns outbound message containing trust ping message\n */\n public async createTrustPing(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n config: { responseRequested?: boolean; comment?: string } = {}\n ): Promise<ConnectionProtocolMsgReturnType<DidCommTrustPingMessage>> {\n connectionRecord.assertState([DidCommDidExchangeState.ResponseReceived, DidCommDidExchangeState.Completed])\n\n // TODO:\n // - create ack message\n // - maybe this shouldn't be in the connection service?\n const trustPing = new DidCommTrustPingMessage(config)\n\n // Only update connection record and emit an event if the state is not already 'Complete'\n if (connectionRecord.state !== DidCommDidExchangeState.Completed) {\n await this.updateState(agentContext, connectionRecord, DidCommDidExchangeState.Completed)\n }\n\n return {\n connectionRecord,\n message: trustPing,\n }\n }\n\n /**\n * Process a received ack message. This will update the state of the connection\n * to Completed if this is not already the case.\n *\n * @param messageContext the message context containing an ack message\n * @returns updated connection record\n */\n public async processAck(\n messageContext: DidCommInboundMessageContext<DidCommAckMessage>\n ): Promise<DidCommConnectionRecord> {\n const { connection, recipientKey } = messageContext\n\n if (!connection) {\n throw new CredoError(\n `Unable to process connection ack: connection for recipient key ${recipientKey?.fingerprint} not found`\n )\n }\n\n // TODO: This is better addressed in a middleware of some kind because\n // any message can transition the state to complete, not just an ack or trust ping\n if (\n connection.state === DidCommDidExchangeState.ResponseSent &&\n connection.role === DidCommDidExchangeRole.Responder\n ) {\n await this.updateState(messageContext.agentContext, connection, DidCommDidExchangeState.Completed)\n }\n\n return connection\n }\n\n /**\n * Process a received {@link DidCommProblemReportMessage}.\n *\n * @param messageContext The message context containing a connection problem report message\n * @returns connection record associated with the connection problem report message\n *\n */\n public async processProblemReport(\n messageContext: DidCommInboundMessageContext<DidCommConnectionProblemReportMessage>\n ): Promise<DidCommConnectionRecord> {\n this.ensureWarningLoggedOnce()\n const { message: connectionProblemReportMessage, recipientKey, senderKey } = messageContext\n\n this.logger.debug(`Processing connection problem report for verkey ${recipientKey?.fingerprint}`)\n\n if (!recipientKey) {\n throw new CredoError('Unable to process connection problem report without recipientKey')\n }\n\n const ourDidRecord = await this.didRepository.findCreatedDidByRecipientKey(\n messageContext.agentContext,\n recipientKey\n )\n if (!ourDidRecord) {\n throw new CredoError(\n `Unable to process connection problem report: created did record for recipient key ${recipientKey.fingerprint} not found`\n )\n }\n\n const connectionRecord = await this.findByOurDid(messageContext.agentContext, ourDidRecord.did)\n if (!connectionRecord) {\n throw new CredoError(\n `Unable to process connection problem report: connection for recipient key ${recipientKey.fingerprint} not found`\n )\n }\n\n const theirDidRecord =\n connectionRecord.theirDid &&\n (await this.didRepository.findReceivedDid(messageContext.agentContext, connectionRecord.theirDid))\n if (!theirDidRecord) {\n throw new CredoError(`Received did record for did ${connectionRecord.theirDid} not found.`)\n }\n\n if (senderKey) {\n if (!theirDidRecord?.getTags().recipientKeyFingerprints?.includes(senderKey.fingerprint)) {\n throw new CredoError(\"Sender key doesn't match key of connection record\")\n }\n }\n\n connectionRecord.errorMessage = `${connectionProblemReportMessage.description.code} : ${connectionProblemReportMessage.description.en}`\n await this.update(messageContext.agentContext, connectionRecord)\n\n // Marking connection as abandoned in case of problem report from issuer agent\n // TODO: Can be conditionally abandoned - Like if another user is scanning already used connection invite where issuer will send invite-already-used problem code.\n await this.updateState(messageContext.agentContext, connectionRecord, DidCommDidExchangeState.Abandoned)\n\n return connectionRecord\n }\n\n /**\n * Assert that an inbound message either has a connection associated with it,\n * or has everything correctly set up for connection-less exchange (optionally with out of band)\n *\n * @param messageContext - the inbound message context\n */\n public async assertConnectionOrOutOfBandExchange(\n messageContext: DidCommInboundMessageContext,\n {\n lastSentMessage,\n lastReceivedMessage,\n expectedConnectionId,\n }: {\n lastSentMessage?: DidCommMessage | null\n lastReceivedMessage?: DidCommMessage | null\n expectedConnectionId?: string\n } = {}\n ) {\n const { connection, message } = messageContext\n\n if (expectedConnectionId && !connection) {\n throw new CredoError(\n `Expected incoming message to be from connection ${expectedConnectionId} but no connection found.`\n )\n }\n if (expectedConnectionId && connection?.id !== expectedConnectionId) {\n throw new CredoError(\n `Expected incoming message to be from connection ${expectedConnectionId} but connection is ${connection?.id}.`\n )\n }\n\n // Check if we have a ready connection. Verification is already done somewhere else. Return\n if (connection) {\n connection.assertReady()\n this.logger.debug(`Processing message with id ${message.id} and connection id ${connection.id}`, {\n type: message.type,\n })\n } else {\n this.logger.debug(`Processing connection-less message with id ${message.id}`, {\n type: message.type,\n })\n\n const recipientKey = messageContext.recipientKey\n const senderKey = messageContext.senderKey\n\n // set theirService to the value of lastReceivedMessage.service\n let theirService =\n messageContext.message?.service?.resolvedDidCommService ?? lastReceivedMessage?.service?.resolvedDidCommService\n let ourService = lastSentMessage?.service?.resolvedDidCommService\n\n // FIXME: we should remove support for the flow where no out of band record is used.\n // Users have had enough time to update to the OOB API which supports legacy connectionsless\n // invitations as well\n // 1. check if there's an oob record associated.\n const outOfBandRepository = messageContext.agentContext.dependencyManager.resolve(DidCommOutOfBandRepository)\n const outOfBandService = messageContext.agentContext.dependencyManager.resolve(DidCommOutOfBandService)\n const outOfBandRecord = await outOfBandRepository.findSingleByQuery(messageContext.agentContext, {\n invitationRequestsThreadIds: [message.threadId],\n })\n\n // If we have an out of band record, we can extract the service for our/the other party from the oob record\n if (outOfBandRecord?.role === DidCommOutOfBandRole.Sender) {\n ourService = await outOfBandService.getResolvedServiceForOutOfBandServices(\n messageContext.agentContext,\n outOfBandRecord.outOfBandInvitation.getServices(),\n outOfBandRecord.invitationInlineServiceKeys\n )\n } else if (outOfBandRecord?.role === DidCommOutOfBandRole.Receiver) {\n theirService = await outOfBandService.getResolvedServiceForOutOfBandServices(\n messageContext.agentContext,\n outOfBandRecord.outOfBandInvitation.getServices()\n )\n }\n\n // theirService can be null when we receive an oob invitation and process the message.\n // In this case there MUST be an oob record, otherwise there is no way for us to reply\n // to the message\n if (!theirService && !outOfBandRecord) {\n throw new CredoError(\n 'No service for incoming connection-less message and no associated out of band record found.'\n )\n }\n\n // ourService can be null when we receive an oob invitation or legacy connectionless message and process the message.\n // In this case lastSentMessage and lastReceivedMessage MUST be null, because there shouldn't be any previous exchange\n if (!ourService && (lastReceivedMessage || lastSentMessage)) {\n throw new CredoError(\n 'No keys on our side to use for encrypting messages, and previous messages found (in which case our keys MUST also be present).'\n )\n }\n\n // If the message is unpacked or AuthCrypt, there cannot be any previous exchange (this must be the first message).\n // All exchange after the first unpacked oob exchange MUST be encrypted.\n if ((!senderKey || !recipientKey) && (lastSentMessage || lastReceivedMessage)) {\n throw new CredoError(\n 'Incoming message must have recipientKey and senderKey (so cannot be AuthCrypt or unpacked) if there are lastSentMessage or lastReceivedMessage.'\n )\n }\n\n // Check if recipientKey is in ourService\n if (recipientKey && ourService) {\n const recipientKeyFound = ourService.recipientKeys.some((key) => recipientKey.equals(key))\n if (!recipientKeyFound) {\n throw new CredoError(`Recipient key ${recipientKey.fingerprint} not found in our service`)\n }\n }\n\n // Check if senderKey is in theirService\n if (senderKey && theirService) {\n const senderKeyFound = theirService.recipientKeys.some((key) => senderKey.equals(key))\n if (!senderKeyFound) {\n throw new CredoError(`Sender key ${senderKey.fingerprint} not found in their service.`)\n }\n }\n }\n }\n\n /**\n * If knownConnectionId is passed, it will compare the incoming connection id with the knownConnectionId, and skip the other validation.\n *\n * If no known connection id is passed, it asserts that the incoming message is in response to an attached request message to an out of band invitation.\n * If is the case, and the state of the out of band record is still await response, the state will be updated to done\n *\n */\n public async matchIncomingMessageToRequestMessageInOutOfBandExchange(\n messageContext: DidCommInboundMessageContext,\n { expectedConnectionId }: { expectedConnectionId?: string }\n ) {\n if (expectedConnectionId && messageContext.connection?.id !== expectedConnectionId) {\n throw new CredoError(\n `Expecting incoming message to have connection ${expectedConnectionId}, but incoming connection is ${\n messageContext.connection?.id ?? 'undefined'\n }`\n )\n }\n\n const outOfBandRepository = messageContext.agentContext.dependencyManager.resolve(DidCommOutOfBandRepository)\n const outOfBandInvitationId = messageContext.message.thread?.parentThreadId\n\n // Find the out of band record that is associated with this request\n const outOfBandRecord = await outOfBandRepository.findSingleByQuery(messageContext.agentContext, {\n invitationId: outOfBandInvitationId,\n role: DidCommOutOfBandRole.Sender,\n invitationRequestsThreadIds: [messageContext.message.threadId],\n })\n\n // There is no out of band record\n if (!outOfBandRecord) {\n throw new CredoError(\n `No out of band record found for credential request message with thread ${messageContext.message.threadId}, out of band invitation id ${outOfBandInvitationId} and role ${DidCommOutOfBandRole.Sender}`\n )\n }\n\n const legacyInvitationMetadata = outOfBandRecord.metadata.get(DidCommOutOfBandRecordMetadataKeys.LegacyInvitation)\n\n // If the original invitation was a legacy connectionless invitation, it's okay if the message does not have a pthid.\n if (\n legacyInvitationMetadata?.legacyInvitationType !== DidCommInvitationType.Connectionless &&\n outOfBandRecord.outOfBandInvitation.id !== outOfBandInvitationId\n ) {\n throw new CredoError(\n 'Response messages to out of band invitation requests MUST have a parent thread id that matches the out of band invitation id.'\n )\n }\n\n // This should not happen, as it is not allowed to create reusable out of band invitations with attached messages\n // But should that implementation change, we at least cover it here.\n if (outOfBandRecord.reusable) {\n throw new CredoError('Receiving messages in response to reusable out of band invitations is not supported.')\n }\n\n if (outOfBandRecord.state === DidCommOutOfBandState.Done) {\n if (!messageContext.connection) {\n throw new CredoError(\n \"Can't find connection associated with incoming message, while out of band state is done. State must be await response if no connection has been created\"\n )\n }\n if (messageContext.connection.outOfBandId !== outOfBandRecord.id) {\n throw new CredoError(\n 'Connection associated with incoming message is not associated with the out of band invitation containing the attached message.'\n )\n }\n\n // We're good to go. Connection was created and points to the correct out of band record. And the message is in response to an attached request message from the oob invitation.\n } else if (outOfBandRecord.state === DidCommOutOfBandState.AwaitResponse) {\n // We're good to go. Waiting for a response. And the message is in response to an attached request message from the oob invitation.\n\n // Now that we have received the first response message to our out of band invitation, we mark the out of band record as done\n outOfBandRecord.state = DidCommOutOfBandState.Done\n await outOfBandRepository.update(messageContext.agentContext, outOfBandRecord)\n } else {\n throw new CredoError(`Out of band record is in incorrect state ${outOfBandRecord.state}`)\n }\n }\n\n public async updateState(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n newState: DidCommDidExchangeState\n ) {\n const previousState = connectionRecord.state\n connectionRecord.state = newState\n await this.connectionRepository.update(agentContext, connectionRecord)\n\n this.emitStateChangedEvent(agentContext, connectionRecord, previousState)\n }\n\n private emitStateChangedEvent(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n previousState: DidCommDidExchangeState | null\n ) {\n this.eventEmitter.emit<DidCommConnectionStateChangedEvent>(agentContext, {\n type: DidCommConnectionEventTypes.DidCommConnectionStateChanged,\n payload: {\n // Connection record in event should be static\n connectionRecord: connectionRecord.clone(),\n previousState,\n },\n })\n }\n\n public update(agentContext: AgentContext, connectionRecord: DidCommConnectionRecord) {\n return this.connectionRepository.update(agentContext, connectionRecord)\n }\n\n /**\n * Retrieve all connections records\n *\n * @returns List containing all connection records\n */\n public getAll(agentContext: AgentContext) {\n return this.connectionRepository.getAll(agentContext)\n }\n\n /**\n * Retrieve a connection record by id\n *\n * @param connectionId The connection record id\n * @throws {RecordNotFoundError} If no record is found\n * @return The connection record\n *\n */\n public getById(agentContext: AgentContext, connectionId: string): Promise<DidCommConnectionRecord> {\n return this.connectionRepository.getById(agentContext, connectionId)\n }\n\n /**\n * Find a connection record by id\n *\n * @param connectionId the connection record id\n * @returns The connection record or null if not found\n */\n public findById(agentContext: AgentContext, connectionId: string): Promise<DidCommConnectionRecord | null> {\n return this.connectionRepository.findById(agentContext, connectionId)\n }\n\n /**\n * Delete a connection record by id\n *\n * @param connectionId the connection record id\n */\n public async deleteById(agentContext: AgentContext, connectionId: string) {\n const connectionRecord = await this.getById(agentContext, connectionId)\n return this.connectionRepository.delete(agentContext, connectionRecord)\n }\n\n public async findByDids(agentContext: AgentContext, query: { ourDid: string; theirDid: string }) {\n return this.connectionRepository.findByDids(agentContext, query)\n }\n\n /**\n * Retrieve a connection record by thread id\n *\n * @param threadId The thread id\n * @throws {RecordNotFoundError} If no record is found\n * @throws {RecordDuplicateError} If multiple records are found\n * @returns The connection record\n */\n public async getByThreadId(agentContext: AgentContext, threadId: string): Promise<DidCommConnectionRecord> {\n return this.connectionRepository.getByThreadId(agentContext, threadId)\n }\n\n public async getByRoleAndThreadId(agentContext: AgentContext, role: DidCommDidExchangeRole, threadId: string) {\n return this.connectionRepository.getByRoleAndThreadId(agentContext, role, threadId)\n }\n\n public async findByTheirDid(agentContext: AgentContext, theirDid: string): Promise<DidCommConnectionRecord | null> {\n return this.connectionRepository.findSingleByQuery(agentContext, { theirDid })\n }\n\n public async findByOurDid(agentContext: AgentContext, ourDid: string): Promise<DidCommConnectionRecord | null> {\n return this.connectionRepository.findSingleByQuery(agentContext, { did: ourDid })\n }\n\n public async findAllByOutOfBandId(agentContext: AgentContext, outOfBandId: string) {\n return this.connectionRepository.findByQuery(agentContext, { outOfBandId })\n }\n\n public async findAllByConnectionTypes(\n agentContext: AgentContext,\n connectionTypes: Array<DidCommConnectionType | string>\n ) {\n return this.connectionRepository.findByQuery(agentContext, { connectionTypes })\n }\n\n public async findByInvitationDid(agentContext: AgentContext, invitationDid: string) {\n return this.connectionRepository.findByQuery(agentContext, { invitationDid })\n }\n\n public async findByKeys(\n agentContext: AgentContext,\n {\n senderKey,\n recipientKey,\n }: { senderKey: Kms.PublicJwk<Kms.Ed25519PublicJwk>; recipientKey: Kms.PublicJwk<Kms.Ed25519PublicJwk> }\n ) {\n const theirDidRecord = await this.didRepository.findReceivedDidByRecipientKey(agentContext, senderKey)\n if (theirDidRecord) {\n const ourDidRecord = await this.didRepository.findCreatedDidByRecipientKey(agentContext, recipientKey)\n if (ourDidRecord) {\n const connectionRecord = await this.findByDids(agentContext, {\n ourDid: ourDidRecord.did,\n theirDid: theirDidRecord.did,\n })\n if (connectionRecord?.isReady) return connectionRecord\n }\n }\n\n this.logger.debug(\n `No connection record found for encrypted message with recipient key ${recipientKey.fingerprint} and sender key ${senderKey.fingerprint}`\n )\n\n return null\n }\n\n public async findAllByQuery(\n agentContext: AgentContext,\n query: Query<DidCommConnectionRecord>,\n queryOptions?: QueryOptions\n ): Promise<DidCommConnectionRecord[]> {\n return this.connectionRepository.findByQuery(agentContext, query, queryOptions)\n }\n\n public async createConnection(\n agentContext: AgentContext,\n options: DidCommConnectionRecordProps\n ): Promise<DidCommConnectionRecord> {\n const connectionRecord = new DidCommConnectionRecord(options)\n await this.connectionRepository.save(agentContext, connectionRecord)\n return connectionRecord\n }\n\n public async addConnectionType(agentContext: AgentContext, connectionRecord: DidCommConnectionRecord, type: string) {\n const connectionTypes = connectionRecord.connectionTypes || []\n connectionRecord.connectionTypes = [type, ...connectionTypes]\n await this.update(agentContext, connectionRecord)\n }\n\n public async removeConnectionType(\n agentContext: AgentContext,\n connectionRecord: DidCommConnectionRecord,\n type: string\n ) {\n connectionRecord.connectionTypes = connectionRecord.connectionTypes.filter((value) => value !== type)\n await this.update(agentContext, connectionRecord)\n }\n\n public async getConnectionTypes(connectionRecord: DidCommConnectionRecord) {\n return connectionRecord.connectionTypes || []\n }\n\n private async createDid(\n agentContext: AgentContext,\n { role, didDoc, keys }: { role: DidDocumentRole; didDoc: DidDoc; keys?: DidDocumentKey[] }\n ) {\n if (keys && role !== DidDocumentRole.Created) {\n throw new CredoError(`keys can only be provided for did documents when the role is '${DidDocumentRole.Created}'`)\n }\n\n // Convert the legacy did doc to a new did document\n const { didDocument, keys: updatedKeys } = convertToNewDidDocument(didDoc, keys)\n\n // Assert that the keys we are going to use for creating a did document haven't already been used in another did document\n if (role === DidDocumentRole.Created) {\n await assertNoCreatedDidExistsForKeys(agentContext, didDocument.recipientKeys)\n }\n\n const peerDid = didDocumentJsonToNumAlgo1Did(didDocument.toJSON())\n didDocument.id = peerDid\n const didRecord = new DidRecord({\n did: peerDid,\n role,\n didDocument,\n keys: updatedKeys,\n })\n\n // Store the unqualified did with the legacy did document in the metadata\n // Can be removed at a later stage if we know for sure we don't need it anymore\n didRecord.metadata.set(DidRecordMetadataKeys.LegacyDid, {\n unqualifiedDid: didDoc.id,\n didDocumentString: JsonTransformer.serialize(didDoc),\n })\n\n this.logger.debug('Saving DID record', {\n id: didRecord.id,\n did: didRecord.did,\n role: didRecord.role,\n tags: didRecord.getTags(),\n didDocument: 'omitted...',\n })\n\n await this.didRepository.save(agentContext, didRecord)\n this.logger.debug('Did record created.', didRecord)\n return { did: peerDid, didDocument }\n }\n\n private createDidDoc(routing: DidCommRouting) {\n const recipientKeyBase58 = TypedArrayEncoder.toBase58(routing.recipientKey.publicKey.publicKey)\n const indyDid = utils.indyDidFromPublicKeyBase58(recipientKeyBase58)\n\n const keys: DidDocumentKey[] = [\n {\n didDocumentRelativeKeyId: '#1',\n kmsKeyId: routing.recipientKey.keyId,\n },\n ]\n\n const publicKey = new Ed25119Sig2018({\n id: `${indyDid}#1`,\n controller: indyDid,\n publicKeyBase58: recipientKeyBase58,\n })\n\n const auth = new ReferencedAuthentication(publicKey, authenticationTypes.Ed25519VerificationKey2018)\n\n // IndyAgentService is old service type\n const services = routing.endpoints.map(\n (endpoint, index) =>\n new IndyAgentService({\n id: `${indyDid}#IndyAgentService-${index + 1}`,\n serviceEndpoint: endpoint,\n recipientKeys: [recipientKeyBase58],\n routingKeys: routing.routingKeys.map((key) => TypedArrayEncoder.toBase58(key.publicKey.publicKey)),\n // Order of endpoint determines priority\n priority: index,\n })\n )\n\n return {\n didDoc: new DidDoc({\n id: indyDid,\n authentication: [auth],\n service: services,\n publicKey: [publicKey],\n }),\n keys,\n }\n }\n\n private createDidDocFromOutOfBandDidCommServices(outOfBandRecord: DidCommOutOfBandRecord) {\n const services = outOfBandRecord.outOfBandInvitation\n .getInlineServices()\n .map((service) => getResolvedDidcommServiceWithSigningKeyId(service, outOfBandRecord.invitationInlineServiceKeys))\n\n const [recipientKey] = services[0].recipientKeys\n const recipientKeyBase58 = TypedArrayEncoder.toBase58(recipientKey.publicKey.publicKey)\n const did = utils.indyDidFromPublicKeyBase58(recipientKeyBase58)\n\n const publicKey = new Ed25119Sig2018({\n id: `${did}#1`,\n controller: did,\n publicKeyBase58: recipientKeyBase58,\n })\n\n const auth = new ReferencedAuthentication(publicKey, authenticationTypes.Ed25519VerificationKey2018)\n\n // IndyAgentService is old service type\n const service = services.map(\n (service, index) =>\n new IndyAgentService({\n id: `${did}#IndyAgentService-${index + 1}`,\n serviceEndpoint: service.serviceEndpoint,\n recipientKeys: [recipientKeyBase58],\n routingKeys: service.routingKeys?.map((publicJwk) =>\n TypedArrayEncoder.toBase58(publicJwk.publicKey.publicKey)\n ),\n priority: index,\n })\n )\n\n return {\n didDoc: new DidDoc({\n id: did,\n authentication: [auth],\n service,\n publicKey: [publicKey],\n }),\n keys: [{ didDocumentRelativeKeyId: '#1', kmsKeyId: recipientKey.keyId }] satisfies DidDocumentKey[],\n }\n }\n\n public async returnWhenIsConnected(\n agentContext: AgentContext,\n connectionId: string,\n timeoutMs = 20000\n ): Promise<DidCommConnectionRecord> {\n const isConnected = (connection: DidCommConnectionRecord) => {\n return connection.id === connectionId && connection.state === DidCommDidExchangeState.Completed\n }\n\n const observable = this.eventEmitter.observable<DidCommConnectionStateChangedEvent>(\n DidCommConnectionEventTypes.DidCommConnectionStateChanged\n )\n const subject = new ReplaySubject<DidCommConnectionRecord>(1)\n\n observable\n .pipe(\n filterContextCorrelationId(agentContext.contextCorrelationId),\n map((e) => e.payload.connectionRecord),\n first(isConnected), // Do not wait for longer than specified timeout\n timeout({\n first: timeoutMs,\n meta: 'DidCommConnectionService.returnWhenIsConnected',\n })\n )\n .subscribe(subject)\n\n const connection = await this.getById(agentContext, connectionId)\n if (isConnected(connection)) {\n subject.next(connection)\n }\n\n return firstValueFrom(subject)\n }\n}\n\nexport interface ConnectionProtocolMsgReturnType<MessageType extends DidCommMessage> {\n message: MessageType\n connectionRecord: DidCommConnectionRecord\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEO,qCAAMA,2BAAyB;CAQpC,AAAO,YACL,AAAiCC,QACjC,sBACA,eACA,cACA;OAPM,mBAAmB;AAQzB,OAAK,uBAAuB;AAC5B,OAAK,gBAAgB;AACrB,OAAK,eAAe;AACpB,OAAK,SAAS;;CAGhB,AAAQ,0BAA0B;AAChC,MAAI,KAAK,iBAAkB;AAE3B,OAAK,OAAO,MACV,iJACD;AACD,OAAK,mBAAmB;;;;;;;;;CAU1B,MAAa,cACX,cACA,iBACA,QAC2E;AAC3E,OAAK,yBAAyB;AAC9B,OAAK,OAAO,MAAM,kBAAkB,gCAAgC,KAAK,eAAe,SAAS,gBAAgB;AACjH,kBAAgB,WAAW,qBAAqB,SAAS;AACzD,kBAAgB,YAAY,sBAAsB,gBAAgB;EAIlE,MAAM,EAAE,wBA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,KACsB;EAClC,MAAM,eAAe,iBAAwC;AAC3D,UAAOC,aAAW,OAAO,gBAAgBA,aAAW,UAAU,wBAAwB;;EAGxF,MAAM,aAAa,KAAK,aAAa,WACnC,4BAA4B,8BAC7B;EACD,MAAM,UAAU,IAAI,cAAuC,EAAE;AAE7D,aACG,KACC,2BAA2B,aAAa,qBAAqB,EAC7DC,OAAK,MAAM,EAAE,QAAQ,iBAAiB,EACtCC,QAAM,YAAY,EAClBC,UAAQ;GACN,OAAO;GACP,MAAM;GACP,CAAC,CACH,CACA,UAAU,QAAQ;EAErB,MAAM,aAAa,MAAM,KAAK,QAAQ,cAAc,aAAa;AACjE,MAAI,YAAY,WAAW,CACzB,SAAQ,KAAK,WAAW;AAG1B,SAAO,eAAe,QAAQ;;;;CAj9BjC,YAAY;oBAUR,OAAO,iBAAiB,OAAO"}
@@ -1,7 +1,7 @@
1
- import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { createPeerDidFromServices, routingToServices } from "./helpers.mjs";
4
- import { __decorateParam } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateParam.mjs";
4
+ import { __decorateParam } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs";
5
5
  import { DidCommOutboundMessageContext } from "../../../models/DidCommOutboundMessageContext.mjs";
6
6
  import "../../../models/index.mjs";
7
7
  import { DidCommConnectionEventTypes } from "../DidCommConnectionEvents.mjs";
@@ -1,5 +1,5 @@
1
- import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { DidCommOutboundMessageContext } from "../../../models/DidCommOutboundMessageContext.mjs";
4
4
  import "../../../models/index.mjs";
5
5
  import { DidCommTrustPingResponseMessage } from "../messages/DidCommTrustPingResponseMessage.mjs";
@@ -1,7 +1,7 @@
1
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import "../../DidCommMessage.mjs";
4
- import { __decorateParam } from "../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateParam.mjs";
4
+ import { __decorateParam } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs";
5
5
  import { DidCommMessageSender } from "../../DidCommMessageSender.mjs";
6
6
  import { DidCommConnectionService } from "../connections/services/DidCommConnectionService.mjs";
7
7
  import "../connections/index.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"DidCommCredentialFormatServiceOptions.d.mts","names":[],"sources":["../../../../src/modules/credentials/formats/DidCommCredentialFormatServiceOptions.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AAwBA;;;;;AASA;;;;;;;AASA;;;AAGsB,KArBV,uBAqBU,CAAA,IAAA,CAAA,GArBsB,IAqBtB,SArBmC,8BAqBnC,CAAA,KAAA,iBAAA,CAAA,GApBlB,gBAoBkB,GAAA,KAAA;;AAMtB;AAKA;;;AAG6B,KA1BjB,wBA0BiB,CAAA,YA1BoB,8BA0Bp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;;AAES,UAtBZ,yCAsBY,CAAA,aAtByC,uBAsBzC,CAAA,CAAA;EAAiB,wBAAA,EArBlB,+BAqBkB;EAI7B,iBAAA,CAAA,EAxBK,8BAwBL,CAAA,CAxBqC,IAwBY,CAAA,EAAA,aAAA,CAAA;EACtC,YAAA,CAAA,EAAA,MAAA;EACN,eAAA,EAxBH,iBAwBG;;AACc,UAtBnB,wCAAA,SAAiD,mCAsB9B,CAAA;EAGnB,iBAAA,CAAA,EAxBK,wCAwByC,EAAA;;AAEzC,UAvBL,2CAuBK,CAAA,aAvBkD,uBAuBlD,CAAA,CAAA;EACH,wBAAA,EAvBS,+BAuBT;EAAiB,iBAAA,EAtBf,8BAsBe,CAAA,CAtBiB,IAsBjB,CAAA,EAAA,eAAA,CAAA;AAGpC;AAC4B,UAvBX,2CAuBW,CAAA,aAvB4C,uBAuB5C,CAAA,CAAA;EACL,wBAAA,EAvBK,+BAuBL;EACJ,iBAAA,CAAA,EAvBG,8BAuBH,CAAA,CAvBmC,IAuBnC,CAAA,EAAA,eAAA,CAAA;EACE,YAAA,CAAA,EAAA,MAAA;EAAiB,eAAA,CAAA,EAtBlB,iBAsBkB;EAGrB,iBAAA,EAxBI,iBAwBJ;EACW,wBAAA,CAAA,EAxBC,iBAwBD,EAAA;;AAER,UAtBH,iDAAA,CAsBG;EACC,wBAAA,EAtBO,+BAsBP;EACG,kBAAA,EAtBF,iBAsBE;EAAiB,eAAA,EArBtB,iBAqBsB;;UAlBxB,8CAAA;4BACW;sBACN;mBACH;;UAGF,gDAAA;4BACW;uBACL;mBACJ;qBACE;;UAGJ,mDAAA;4BACW;uBACL;oBACH;qBACC;wBACG"}
1
+ {"version":3,"file":"DidCommCredentialFormatServiceOptions.d.mts","names":[],"sources":["../../../../src/modules/credentials/formats/DidCommCredentialFormatServiceOptions.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AAwBA;;;;;AAQA;;;;;;;AASA;;;AAGsB,KApBV,uBAoBU,CAAA,IAAA,CAAA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-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { JsonTransformer, W3cCredential } from "@credo-ts/core";
4
4
  import { ArrayNotEmpty, IsBoolean, IsEnum, IsOptional, IsString, ValidateNested } from "class-validator";
5
5
  import { Expose, Type } from "class-transformer";
@@ -1,5 +1,5 @@
1
- import { __decorate } from "../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { DidCommJsonLdCredentialDetailOptions } from "./DidCommJsonLdCredentialDetailOptions.mjs";
4
4
  import { W3cCredential } from "@credo-ts/core";
5
5
  import { Expose, Type } from "class-transformer";
@@ -1,5 +1,5 @@
1
- import { __decorate } from "../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { IsObject, IsOptional, IsString } from "class-validator";
4
4
 
5
5
  //#region src/modules/credentials/formats/jsonld/DidCommJsonLdCredentialDetailOptions.ts
@@ -1,5 +1,5 @@
1
- import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { utils } from "@credo-ts/core";
4
4
  import { IsString } from "class-validator";
5
5
  import { Expose } from "class-transformer";
@@ -1,5 +1,5 @@
1
- import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { JsonTransformer } from "@credo-ts/core";
4
4
  import { IsMimeType, IsOptional, IsString } from "class-validator";
5
5
  import { Expose } from "class-transformer";
@@ -1,5 +1,5 @@
1
- import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
1
+ import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
3
  import { DateTransformer } from "@credo-ts/core";
4
4
 
5
5
  //#region src/modules/credentials/models/DidCommRevocationNotification.ts
@@ -1,6 +1,6 @@
1
- import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
1
+ import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
2
  import { IsValidMessageType, parseMessageType } from "../../../../../util/messageType.mjs";
3
- import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
3
+ import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
4
4
  import "../../../../../decorators/ack/AckDecorator.mjs";
5
5
  import { DidCommMessage } from "../../../../../DidCommMessage.mjs";
6
6
  import { IsOptional, IsString } from "class-validator";
@@ -1,6 +1,6 @@
1
- import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
1
+ import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
2
  import { IsValidMessageType, parseMessageType } from "../../../../../util/messageType.mjs";
3
- import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
3
+ import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
4
4
  import "../../../../../decorators/ack/AckDecorator.mjs";
5
5
  import { DidCommMessage } from "../../../../../DidCommMessage.mjs";
6
6
  import { IsOptional, IsString } from "class-validator";
@@ -1,6 +1,6 @@
1
- import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
2
- import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
3
- import { __decorateParam } from "../../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateParam.mjs";
1
+ import { __decorate } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
2
+ import { __decorateMetadata } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
3
+ import { __decorateParam } from "../../../../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs";
4
4
  import "../../../../connections/index.mjs";
5
5
  import { DidCommCredentialEventTypes } from "../../../DidCommCredentialEvents.mjs";
6
6
  import { DidCommRevocationNotification } from "../../../models/DidCommRevocationNotification.mjs";