@credo-ts/didcomm 0.7.2-pr-2704-20260925144545 → 0.7.2

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 (598) hide show
  1. package/README.md +0 -2
  2. package/build/BaseDidCommMessage.d.mts +0 -4
  3. package/build/BaseDidCommMessage.d.mts.map +1 -1
  4. package/build/BaseDidCommMessage.mjs +0 -2
  5. package/build/BaseDidCommMessage.mjs.map +1 -1
  6. package/build/DidCommApi.d.mts +2 -2
  7. package/build/DidCommApi.mjs +1 -1
  8. package/build/DidCommEnvelopeService.d.mts +3 -13
  9. package/build/DidCommEnvelopeService.d.mts.map +1 -1
  10. package/build/DidCommEnvelopeService.mjs +4 -6
  11. package/build/DidCommEnvelopeService.mjs.map +1 -1
  12. package/build/DidCommEvents.d.mts +1 -1
  13. package/build/DidCommMessage.d.mts +0 -20
  14. package/build/DidCommMessage.d.mts.map +1 -1
  15. package/build/DidCommMessage.mjs +0 -1
  16. package/build/DidCommMessage.mjs.map +1 -1
  17. package/build/DidCommMessageHandlerRegistry.d.mts +1 -1
  18. package/build/DidCommMessageReceiver.d.mts +7 -19
  19. package/build/DidCommMessageReceiver.d.mts.map +1 -1
  20. package/build/DidCommMessageReceiver.mjs +19 -136
  21. package/build/DidCommMessageReceiver.mjs.map +1 -1
  22. package/build/DidCommMessageSender.d.mts +4 -15
  23. package/build/DidCommMessageSender.d.mts.map +1 -1
  24. package/build/DidCommMessageSender.mjs +15 -200
  25. package/build/DidCommMessageSender.mjs.map +1 -1
  26. package/build/DidCommModule.d.mts.map +1 -1
  27. package/build/DidCommModule.mjs +2 -14
  28. package/build/DidCommModule.mjs.map +1 -1
  29. package/build/DidCommModuleConfig.d.mts +6 -54
  30. package/build/DidCommModuleConfig.d.mts.map +1 -1
  31. package/build/DidCommModuleConfig.mjs +0 -24
  32. package/build/DidCommModuleConfig.mjs.map +1 -1
  33. package/build/DidCommTransportService.d.mts +0 -2
  34. package/build/DidCommTransportService.d.mts.map +1 -1
  35. package/build/DidCommTransportService.mjs.map +1 -1
  36. package/build/getDidCommOutboundMessageContext.d.mts +1 -1
  37. package/build/getDidCommOutboundMessageContext.d.mts.map +1 -1
  38. package/build/getDidCommOutboundMessageContext.mjs +16 -34
  39. package/build/getDidCommOutboundMessageContext.mjs.map +1 -1
  40. package/build/handlers/DidCommMessageHandler.d.mts +1 -1
  41. package/build/index.d.mts +18 -62
  42. package/build/index.mjs +18 -61
  43. package/build/messages/common/index.d.mts +1 -2
  44. package/build/messages/common/index.mjs +1 -2
  45. package/build/messages/index.d.mts +1 -2
  46. package/build/messages/index.mjs +1 -2
  47. package/build/models/DidCommInboundMessageContext.d.mts +6 -11
  48. package/build/models/DidCommInboundMessageContext.d.mts.map +1 -1
  49. package/build/models/DidCommInboundMessageContext.mjs +0 -1
  50. package/build/models/DidCommInboundMessageContext.mjs.map +1 -1
  51. package/build/models/DidCommOutboundMessageContext.d.mts +1 -3
  52. package/build/models/DidCommOutboundMessageContext.d.mts.map +1 -1
  53. package/build/models/DidCommOutboundMessageContext.mjs.map +1 -1
  54. package/build/models/DidCommRouting.d.mts +2 -22
  55. package/build/models/DidCommRouting.d.mts.map +1 -1
  56. package/build/models/index.d.mts +2 -2
  57. package/build/modules/basic-messages/DidCommBasicMessageEvents.d.mts +3 -13
  58. package/build/modules/basic-messages/DidCommBasicMessageEvents.d.mts.map +1 -1
  59. package/build/modules/basic-messages/DidCommBasicMessageEvents.mjs +0 -1
  60. package/build/modules/basic-messages/DidCommBasicMessageEvents.mjs.map +1 -1
  61. package/build/modules/basic-messages/DidCommBasicMessagesApi.d.mts +1 -8
  62. package/build/modules/basic-messages/DidCommBasicMessagesApi.d.mts.map +1 -1
  63. package/build/modules/basic-messages/DidCommBasicMessagesApi.mjs +3 -13
  64. package/build/modules/basic-messages/DidCommBasicMessagesApi.mjs.map +1 -1
  65. package/build/modules/basic-messages/DidCommBasicMessagesModule.d.mts +0 -3
  66. package/build/modules/basic-messages/DidCommBasicMessagesModule.d.mts.map +1 -1
  67. package/build/modules/basic-messages/DidCommBasicMessagesModule.mjs +12 -11
  68. package/build/modules/basic-messages/DidCommBasicMessagesModule.mjs.map +1 -1
  69. package/build/modules/basic-messages/{protocol/v1/handlers/DidCommBasicMessageHandler.mjs → handlers/BasicMessageHandler.mjs} +2 -2
  70. package/build/modules/basic-messages/handlers/BasicMessageHandler.mjs.map +1 -0
  71. package/build/modules/basic-messages/handlers/index.mjs +2 -0
  72. package/build/modules/basic-messages/index.d.mts +4 -8
  73. package/build/modules/basic-messages/index.mjs +3 -7
  74. package/build/modules/basic-messages/{protocol/v1/messages → messages}/DidCommBasicMessage.d.mts +4 -4
  75. package/build/modules/basic-messages/messages/DidCommBasicMessage.d.mts.map +1 -0
  76. package/build/modules/basic-messages/{protocol/v1/messages → messages}/DidCommBasicMessage.mjs +6 -6
  77. package/build/modules/basic-messages/messages/DidCommBasicMessage.mjs.map +1 -0
  78. package/build/modules/basic-messages/repository/DidCommBasicMessageRecord.d.mts +0 -2
  79. package/build/modules/basic-messages/repository/DidCommBasicMessageRecord.d.mts.map +1 -1
  80. package/build/modules/basic-messages/repository/DidCommBasicMessageRecord.mjs +0 -1
  81. package/build/modules/basic-messages/repository/DidCommBasicMessageRecord.mjs.map +1 -1
  82. package/build/modules/basic-messages/services/DidCommBasicMessageService.d.mts +11 -9
  83. package/build/modules/basic-messages/services/DidCommBasicMessageService.d.mts.map +1 -1
  84. package/build/modules/basic-messages/services/DidCommBasicMessageService.mjs +24 -23
  85. package/build/modules/basic-messages/services/DidCommBasicMessageService.mjs.map +1 -1
  86. package/build/modules/basic-messages/services/index.d.mts +1 -2
  87. package/build/modules/basic-messages/services/index.mjs +1 -2
  88. package/build/modules/connections/DidCommConnectionsApi.d.mts.map +1 -1
  89. package/build/modules/connections/DidCommConnectionsApi.mjs +16 -88
  90. package/build/modules/connections/DidCommConnectionsApi.mjs.map +1 -1
  91. package/build/modules/connections/DidCommConnectionsModule.d.mts.map +1 -1
  92. package/build/modules/connections/DidCommConnectionsModule.mjs +1 -8
  93. package/build/modules/connections/DidCommConnectionsModule.mjs.map +1 -1
  94. package/build/modules/connections/DidCommConnectionsModuleConfig.d.mts +0 -9
  95. package/build/modules/connections/DidCommConnectionsModuleConfig.d.mts.map +1 -1
  96. package/build/modules/connections/DidCommConnectionsModuleConfig.mjs +0 -7
  97. package/build/modules/connections/DidCommConnectionsModuleConfig.mjs.map +1 -1
  98. package/build/modules/connections/DidExchangeProtocol.d.mts.map +1 -1
  99. package/build/modules/connections/DidExchangeProtocol.mjs +8 -11
  100. package/build/modules/connections/DidExchangeProtocol.mjs.map +1 -1
  101. package/build/modules/connections/handlers/DidCommAckMessageHandler.d.mts +2 -2
  102. package/build/modules/connections/handlers/DidCommConnectionProblemReportHandler.d.mts +2 -2
  103. package/build/modules/connections/handlers/DidCommConnectionRequestHandler.d.mts +2 -2
  104. package/build/modules/connections/handlers/DidCommConnectionRequestHandler.mjs +2 -2
  105. package/build/modules/connections/handlers/DidCommConnectionRequestHandler.mjs.map +1 -1
  106. package/build/modules/connections/handlers/DidCommConnectionResponseHandler.d.mts +2 -2
  107. package/build/modules/connections/handlers/DidCommConnectionResponseHandler.d.mts.map +1 -1
  108. package/build/modules/connections/handlers/DidCommConnectionResponseHandler.mjs +2 -9
  109. package/build/modules/connections/handlers/DidCommConnectionResponseHandler.mjs.map +1 -1
  110. package/build/modules/connections/handlers/DidCommDidExchangeCompleteHandler.d.mts +2 -2
  111. package/build/modules/connections/handlers/DidCommDidExchangeRequestHandler.d.mts +2 -2
  112. package/build/modules/connections/handlers/DidCommDidExchangeRequestHandler.mjs +2 -2
  113. package/build/modules/connections/handlers/DidCommDidExchangeRequestHandler.mjs.map +1 -1
  114. package/build/modules/connections/handlers/DidCommDidExchangeResponseHandler.d.mts +2 -2
  115. package/build/modules/connections/handlers/DidCommDidRotateAckHandler.d.mts +2 -2
  116. package/build/modules/connections/handlers/DidCommDidRotateHandler.d.mts +2 -2
  117. package/build/modules/connections/handlers/DidCommDidRotateProblemReportHandler.d.mts +2 -2
  118. package/build/modules/connections/handlers/DidCommHangupHandler.d.mts +2 -2
  119. package/build/modules/connections/handlers/DidCommTrustPingMessageHandler.d.mts +2 -2
  120. package/build/modules/connections/handlers/DidCommTrustPingResponseMessageHandler.d.mts +2 -2
  121. package/build/modules/connections/handlers/index.d.mts +1 -2
  122. package/build/modules/connections/handlers/index.mjs +1 -2
  123. package/build/modules/connections/index.d.mts +1 -3
  124. package/build/modules/connections/index.mjs +1 -3
  125. package/build/modules/connections/messages/DidCommConnectionInvitationMessage.d.mts +1 -1
  126. package/build/modules/connections/messages/DidCommConnectionRequestMessage.d.mts +1 -8
  127. package/build/modules/connections/messages/DidCommConnectionRequestMessage.d.mts.map +1 -1
  128. package/build/modules/connections/messages/DidCommConnectionRequestMessage.mjs +0 -1
  129. package/build/modules/connections/messages/DidCommConnectionRequestMessage.mjs.map +1 -1
  130. package/build/modules/connections/messages/DidCommConnectionResponseMessage.d.mts +1 -7
  131. package/build/modules/connections/messages/DidCommConnectionResponseMessage.d.mts.map +1 -1
  132. package/build/modules/connections/messages/DidCommConnectionResponseMessage.mjs +0 -1
  133. package/build/modules/connections/messages/DidCommConnectionResponseMessage.mjs.map +1 -1
  134. package/build/modules/connections/messages/DidCommDidExchangeRequestMessage.d.mts +1 -1
  135. package/build/modules/connections/messages/DidCommDidExchangeResponseMessage.d.mts +1 -1
  136. package/build/modules/connections/models/DidCommHandshakeProtocol.d.mts +1 -6
  137. package/build/modules/connections/models/DidCommHandshakeProtocol.d.mts.map +1 -1
  138. package/build/modules/connections/models/DidCommHandshakeProtocol.mjs +0 -5
  139. package/build/modules/connections/models/DidCommHandshakeProtocol.mjs.map +1 -1
  140. package/build/modules/connections/models/did/DidDoc.mjs +2 -2
  141. package/build/modules/connections/models/did/DidDoc.mjs.map +1 -1
  142. package/build/modules/connections/repository/DidCommConnectionMetadataTypes.d.mts +1 -7
  143. package/build/modules/connections/repository/DidCommConnectionMetadataTypes.d.mts.map +1 -1
  144. package/build/modules/connections/repository/DidCommConnectionRecord.d.mts +0 -6
  145. package/build/modules/connections/repository/DidCommConnectionRecord.d.mts.map +1 -1
  146. package/build/modules/connections/repository/DidCommConnectionRecord.mjs +0 -2
  147. package/build/modules/connections/repository/DidCommConnectionRecord.mjs.map +1 -1
  148. package/build/modules/connections/services/DidCommConnectionService.d.mts +4 -13
  149. package/build/modules/connections/services/DidCommConnectionService.d.mts.map +1 -1
  150. package/build/modules/connections/services/DidCommConnectionService.mjs +10 -39
  151. package/build/modules/connections/services/DidCommConnectionService.mjs.map +1 -1
  152. package/build/modules/connections/services/helpers.mjs +3 -143
  153. package/build/modules/connections/services/helpers.mjs.map +1 -1
  154. package/build/modules/connections/services/index.d.mts +1 -2
  155. package/build/modules/connections/services/index.mjs +1 -2
  156. package/build/modules/credentials/DidCommCredentialsApi.d.mts +1 -1
  157. package/build/modules/credentials/protocol/DidCommBaseCredentialProtocol.d.mts +2 -2
  158. package/build/modules/credentials/protocol/DidCommCredentialProtocol.d.mts +2 -2
  159. package/build/modules/credentials/protocol/DidCommCredentialProtocolOptions.d.mts +1 -1
  160. package/build/modules/credentials/protocol/v2/DidCommCredentialV2Protocol.d.mts +4 -4
  161. package/build/modules/credentials/protocol/v2/handlers/DidCommOfferCredentialV2Handler.d.mts +1 -1
  162. package/build/modules/credentials/protocol/v2/messages/DidCommIssueCredentialV2Message.d.mts +1 -1
  163. package/build/modules/credentials/protocol/v2/messages/DidCommOfferCredentialV2Message.d.mts +1 -1
  164. package/build/modules/credentials/protocol/v2/messages/DidCommProposeCredentialV2Message.d.mts +1 -1
  165. package/build/modules/credentials/protocol/v2/messages/DidCommRequestCredentialV2Message.d.mts +1 -1
  166. package/build/modules/discover-features/DidCommDiscoverFeaturesEvents.d.mts +1 -1
  167. package/build/modules/discover-features/protocol/v1/DidCommDiscoverFeaturesV1Service.d.mts +1 -1
  168. package/build/modules/discover-features/services/DidCommDiscoverFeaturesService.d.mts +1 -1
  169. package/build/modules/index.d.mts +10 -41
  170. package/build/modules/index.mjs +19 -50
  171. package/build/modules/message-pickup/DidCommMessagePickupApi.d.mts +1 -2
  172. package/build/modules/message-pickup/DidCommMessagePickupApi.d.mts.map +1 -1
  173. package/build/modules/message-pickup/DidCommMessagePickupApi.mjs +1 -11
  174. package/build/modules/message-pickup/DidCommMessagePickupApi.mjs.map +1 -1
  175. package/build/modules/message-pickup/DidCommMessagePickupModule.d.mts +1 -2
  176. package/build/modules/message-pickup/DidCommMessagePickupModule.d.mts.map +1 -1
  177. package/build/modules/message-pickup/DidCommMessagePickupModule.mjs +1 -6
  178. package/build/modules/message-pickup/DidCommMessagePickupModule.mjs.map +1 -1
  179. package/build/modules/message-pickup/index.d.mts +1 -16
  180. package/build/modules/message-pickup/index.mjs +1 -16
  181. package/build/modules/message-pickup/protocol/DidCommBaseMessagePickupProtocol.d.mts +1 -1
  182. package/build/modules/message-pickup/protocol/DidCommMessagePickupProtocol.d.mts +1 -1
  183. package/build/modules/message-pickup/protocol/DidCommMessagePickupProtocolOptions.d.mts +1 -2
  184. package/build/modules/message-pickup/protocol/DidCommMessagePickupProtocolOptions.d.mts.map +1 -1
  185. package/build/modules/message-pickup/protocol/index.d.mts +1 -17
  186. package/build/modules/message-pickup/protocol/index.mjs +1 -17
  187. package/build/modules/message-pickup/protocol/v1/DidCommMessagePickupV1Protocol.d.mts +1 -1
  188. package/build/modules/message-pickup/protocol/v1/messages/DidCommBatchMessage.d.mts +0 -2
  189. package/build/modules/message-pickup/protocol/v1/messages/DidCommBatchMessage.d.mts.map +1 -1
  190. package/build/modules/message-pickup/protocol/v1/messages/DidCommBatchMessage.mjs +0 -1
  191. package/build/modules/message-pickup/protocol/v1/messages/DidCommBatchMessage.mjs.map +1 -1
  192. package/build/modules/message-pickup/protocol/v1/messages/DidCommBatchPickupMessage.d.mts +0 -2
  193. package/build/modules/message-pickup/protocol/v1/messages/DidCommBatchPickupMessage.d.mts.map +1 -1
  194. package/build/modules/message-pickup/protocol/v1/messages/DidCommBatchPickupMessage.mjs +0 -1
  195. package/build/modules/message-pickup/protocol/v1/messages/DidCommBatchPickupMessage.mjs.map +1 -1
  196. package/build/modules/message-pickup/protocol/v2/DidCommMessagePickupV2Protocol.d.mts +1 -1
  197. package/build/modules/message-pickup/protocol/v2/messages/DidCommDeliveryRequestV2Message.d.mts +0 -2
  198. package/build/modules/message-pickup/protocol/v2/messages/DidCommDeliveryRequestV2Message.d.mts.map +1 -1
  199. package/build/modules/message-pickup/protocol/v2/messages/DidCommDeliveryRequestV2Message.mjs +0 -1
  200. package/build/modules/message-pickup/protocol/v2/messages/DidCommDeliveryRequestV2Message.mjs.map +1 -1
  201. package/build/modules/message-pickup/protocol/v2/messages/DidCommLiveDeliveryChangeV2Message.d.mts +0 -2
  202. package/build/modules/message-pickup/protocol/v2/messages/DidCommLiveDeliveryChangeV2Message.d.mts.map +1 -1
  203. package/build/modules/message-pickup/protocol/v2/messages/DidCommLiveDeliveryChangeV2Message.mjs +0 -1
  204. package/build/modules/message-pickup/protocol/v2/messages/DidCommLiveDeliveryChangeV2Message.mjs.map +1 -1
  205. package/build/modules/message-pickup/protocol/v2/messages/DidCommMessageDeliveryV2Message.d.mts +1 -3
  206. package/build/modules/message-pickup/protocol/v2/messages/DidCommMessageDeliveryV2Message.d.mts.map +1 -1
  207. package/build/modules/message-pickup/protocol/v2/messages/DidCommMessageDeliveryV2Message.mjs +0 -1
  208. package/build/modules/message-pickup/protocol/v2/messages/DidCommMessageDeliveryV2Message.mjs.map +1 -1
  209. package/build/modules/message-pickup/protocol/v2/messages/DidCommMessagesReceivedV2Message.d.mts +0 -2
  210. package/build/modules/message-pickup/protocol/v2/messages/DidCommMessagesReceivedV2Message.d.mts.map +1 -1
  211. package/build/modules/message-pickup/protocol/v2/messages/DidCommMessagesReceivedV2Message.mjs +0 -1
  212. package/build/modules/message-pickup/protocol/v2/messages/DidCommMessagesReceivedV2Message.mjs.map +1 -1
  213. package/build/modules/message-pickup/protocol/v2/messages/DidCommStatusRequestV2Message.d.mts +0 -2
  214. package/build/modules/message-pickup/protocol/v2/messages/DidCommStatusRequestV2Message.d.mts.map +1 -1
  215. package/build/modules/message-pickup/protocol/v2/messages/DidCommStatusRequestV2Message.mjs +0 -1
  216. package/build/modules/message-pickup/protocol/v2/messages/DidCommStatusRequestV2Message.mjs.map +1 -1
  217. package/build/modules/message-pickup/protocol/v2/messages/DidCommStatusV2Message.d.mts +0 -2
  218. package/build/modules/message-pickup/protocol/v2/messages/DidCommStatusV2Message.d.mts.map +1 -1
  219. package/build/modules/message-pickup/protocol/v2/messages/DidCommStatusV2Message.mjs +0 -1
  220. package/build/modules/message-pickup/protocol/v2/messages/DidCommStatusV2Message.mjs.map +1 -1
  221. package/build/modules/oob/DidCommOutOfBandApi.d.mts +7 -39
  222. package/build/modules/oob/DidCommOutOfBandApi.d.mts.map +1 -1
  223. package/build/modules/oob/DidCommOutOfBandApi.mjs +32 -172
  224. package/build/modules/oob/DidCommOutOfBandApi.mjs.map +1 -1
  225. package/build/modules/oob/DidCommOutOfBandService.d.mts +10 -11
  226. package/build/modules/oob/DidCommOutOfBandService.d.mts.map +1 -1
  227. package/build/modules/oob/DidCommOutOfBandService.mjs +7 -21
  228. package/build/modules/oob/DidCommOutOfBandService.mjs.map +1 -1
  229. package/build/modules/oob/converters.mjs +2 -41
  230. package/build/modules/oob/converters.mjs.map +1 -1
  231. package/build/modules/oob/index.d.mts +1 -2
  232. package/build/modules/oob/index.mjs +2 -3
  233. package/build/modules/oob/messages/DidCommOutOfBandInvitation.d.mts +2 -17
  234. package/build/modules/oob/messages/DidCommOutOfBandInvitation.d.mts.map +1 -1
  235. package/build/modules/oob/messages/DidCommOutOfBandInvitation.mjs +0 -14
  236. package/build/modules/oob/messages/DidCommOutOfBandInvitation.mjs.map +1 -1
  237. package/build/modules/oob/messages/index.d.mts +1 -2
  238. package/build/modules/oob/messages/index.mjs +1 -2
  239. package/build/modules/oob/repository/DidCommOutOfBandRecord.d.mts +0 -6
  240. package/build/modules/oob/repository/DidCommOutOfBandRecord.d.mts.map +1 -1
  241. package/build/modules/oob/repository/DidCommOutOfBandRecord.mjs +1 -2
  242. package/build/modules/oob/repository/DidCommOutOfBandRecord.mjs.map +1 -1
  243. package/build/modules/oob/repository/outOfBandRecordMetadataTypes.d.mts +1 -14
  244. package/build/modules/oob/repository/outOfBandRecordMetadataTypes.d.mts.map +1 -1
  245. package/build/modules/proofs/DidCommProofsApi.d.mts +1 -1
  246. package/build/modules/proofs/protocol/DidCommBaseProofProtocol.d.mts +1 -1
  247. package/build/modules/proofs/protocol/DidCommProofProtocol.d.mts +1 -1
  248. package/build/modules/proofs/protocol/DidCommProofProtocolOptions.d.mts +1 -1
  249. package/build/modules/proofs/protocol/v2/DidCommProofV2Protocol.d.mts +1 -1
  250. package/build/modules/proofs/protocol/v2/messages/DidCommPresentationV2Message.d.mts +1 -1
  251. package/build/modules/proofs/protocol/v2/messages/DidCommProposePresentationV2Message.d.mts +1 -1
  252. package/build/modules/proofs/protocol/v2/messages/DidCommRequestPresentationV2Message.d.mts +1 -1
  253. package/build/modules/routing/DidCommMediationRecipientApi.d.mts +6 -38
  254. package/build/modules/routing/DidCommMediationRecipientApi.d.mts.map +1 -1
  255. package/build/modules/routing/DidCommMediationRecipientApi.mjs +28 -183
  256. package/build/modules/routing/DidCommMediationRecipientApi.mjs.map +1 -1
  257. package/build/modules/routing/DidCommMediationRecipientModule.d.mts.map +1 -1
  258. package/build/modules/routing/DidCommMediationRecipientModule.mjs +6 -21
  259. package/build/modules/routing/DidCommMediationRecipientModule.mjs.map +1 -1
  260. package/build/modules/routing/DidCommMediationRecipientModuleConfig.d.mts +0 -12
  261. package/build/modules/routing/DidCommMediationRecipientModuleConfig.d.mts.map +1 -1
  262. package/build/modules/routing/DidCommMediationRecipientModuleConfig.mjs +0 -4
  263. package/build/modules/routing/DidCommMediationRecipientModuleConfig.mjs.map +1 -1
  264. package/build/modules/routing/DidCommMediatorApi.d.mts +0 -4
  265. package/build/modules/routing/DidCommMediatorApi.d.mts.map +1 -1
  266. package/build/modules/routing/DidCommMediatorApi.mjs +1 -5
  267. package/build/modules/routing/DidCommMediatorApi.mjs.map +1 -1
  268. package/build/modules/routing/DidCommMediatorModule.d.mts.map +1 -1
  269. package/build/modules/routing/DidCommMediatorModule.mjs +5 -18
  270. package/build/modules/routing/DidCommMediatorModule.mjs.map +1 -1
  271. package/build/modules/routing/DidCommMediatorModuleConfig.d.mts +0 -17
  272. package/build/modules/routing/DidCommMediatorModuleConfig.d.mts.map +1 -1
  273. package/build/modules/routing/DidCommMediatorModuleConfig.mjs +0 -8
  274. package/build/modules/routing/DidCommMediatorModuleConfig.mjs.map +1 -1
  275. package/build/modules/routing/DidCommMediatorPickupStrategy.d.mts +0 -2
  276. package/build/modules/routing/DidCommMediatorPickupStrategy.d.mts.map +1 -1
  277. package/build/modules/routing/DidCommMediatorPickupStrategy.mjs +0 -2
  278. package/build/modules/routing/DidCommMediatorPickupStrategy.mjs.map +1 -1
  279. package/build/modules/routing/DidCommRoutingEvents.d.mts +1 -10
  280. package/build/modules/routing/DidCommRoutingEvents.d.mts.map +1 -1
  281. package/build/modules/routing/DidCommRoutingEvents.mjs +0 -1
  282. package/build/modules/routing/DidCommRoutingEvents.mjs.map +1 -1
  283. package/build/modules/routing/{protocol/v1/handlers → handlers}/DidCommForwardHandler.mjs +2 -4
  284. package/build/modules/routing/handlers/DidCommForwardHandler.mjs.map +1 -0
  285. package/build/modules/routing/{protocol/v1/handlers → handlers}/DidCommKeylistUpdateHandler.mjs +3 -3
  286. package/build/modules/routing/handlers/DidCommKeylistUpdateHandler.mjs.map +1 -0
  287. package/build/modules/routing/{protocol/v1/handlers → handlers}/DidCommKeylistUpdateResponseHandler.mjs +1 -1
  288. package/build/modules/routing/handlers/DidCommKeylistUpdateResponseHandler.mjs.map +1 -0
  289. package/build/modules/routing/{protocol/v1/handlers → handlers}/DidCommMediationDenyHandler.mjs +1 -1
  290. package/build/modules/routing/handlers/DidCommMediationDenyHandler.mjs.map +1 -0
  291. package/build/modules/routing/{protocol/v1/handlers → handlers}/DidCommMediationGrantHandler.mjs +1 -1
  292. package/build/modules/routing/handlers/DidCommMediationGrantHandler.mjs.map +1 -0
  293. package/build/modules/routing/{protocol/v1/handlers → handlers}/DidCommMediationRequestHandler.mjs +3 -3
  294. package/build/modules/routing/handlers/DidCommMediationRequestHandler.mjs.map +1 -0
  295. package/build/modules/routing/index.d.mts +9 -18
  296. package/build/modules/routing/index.mjs +12 -21
  297. package/build/modules/routing/{protocol/v1/messages → messages}/DidCommForwardMessage.d.mts +5 -7
  298. package/build/modules/routing/messages/DidCommForwardMessage.d.mts.map +1 -0
  299. package/build/modules/routing/{protocol/v1/messages → messages}/DidCommForwardMessage.mjs +5 -6
  300. package/build/modules/routing/messages/DidCommForwardMessage.mjs.map +1 -0
  301. package/build/modules/routing/{protocol/v1/messages → messages}/DidCommKeylistUpdateMessage.d.mts +4 -6
  302. package/build/modules/routing/messages/DidCommKeylistUpdateMessage.d.mts.map +1 -0
  303. package/build/modules/routing/{protocol/v1/messages → messages}/DidCommKeylistUpdateMessage.mjs +5 -6
  304. package/build/modules/routing/messages/DidCommKeylistUpdateMessage.mjs.map +1 -0
  305. package/build/modules/routing/{protocol/v1/messages → messages}/DidCommKeylistUpdateResponseMessage.d.mts +4 -6
  306. package/build/modules/routing/messages/DidCommKeylistUpdateResponseMessage.d.mts.map +1 -0
  307. package/build/modules/routing/{protocol/v1/messages → messages}/DidCommKeylistUpdateResponseMessage.mjs +5 -6
  308. package/build/modules/routing/messages/DidCommKeylistUpdateResponseMessage.mjs.map +1 -0
  309. package/build/modules/routing/{protocol/v1/messages → messages}/DidCommMediationDenyMessage.d.mts +4 -6
  310. package/build/modules/routing/messages/DidCommMediationDenyMessage.d.mts.map +1 -0
  311. package/build/modules/routing/{protocol/v1/messages → messages}/DidCommMediationDenyMessage.mjs +5 -6
  312. package/build/modules/routing/messages/DidCommMediationDenyMessage.mjs.map +1 -0
  313. package/build/modules/routing/{protocol/v1/messages → messages}/DidCommMediationGrantMessage.d.mts +4 -6
  314. package/build/modules/routing/messages/DidCommMediationGrantMessage.d.mts.map +1 -0
  315. package/build/modules/routing/{protocol/v1/messages → messages}/DidCommMediationGrantMessage.mjs +5 -6
  316. package/build/modules/routing/messages/DidCommMediationGrantMessage.mjs.map +1 -0
  317. package/build/modules/routing/{protocol/v1/messages → messages}/DidCommMediationRequestMessage.d.mts +4 -6
  318. package/build/modules/routing/messages/DidCommMediationRequestMessage.d.mts.map +1 -0
  319. package/build/modules/routing/{protocol/v1/messages → messages}/DidCommMediationRequestMessage.mjs +5 -6
  320. package/build/modules/routing/messages/DidCommMediationRequestMessage.mjs.map +1 -0
  321. package/build/modules/routing/{protocol/v1/messages → messages}/index.d.mts +1 -2
  322. package/build/modules/routing/{protocol/v1/messages → messages}/index.mjs +1 -2
  323. package/build/modules/routing/repository/DidCommMediationRecord.d.mts +0 -16
  324. package/build/modules/routing/repository/DidCommMediationRecord.d.mts.map +1 -1
  325. package/build/modules/routing/repository/DidCommMediationRecord.mjs +2 -21
  326. package/build/modules/routing/repository/DidCommMediationRecord.mjs.map +1 -1
  327. package/build/modules/routing/repository/DidCommMediationRepository.d.mts +0 -9
  328. package/build/modules/routing/repository/DidCommMediationRepository.d.mts.map +1 -1
  329. package/build/modules/routing/repository/DidCommMediationRepository.mjs +1 -18
  330. package/build/modules/routing/repository/DidCommMediationRepository.mjs.map +1 -1
  331. package/build/modules/routing/services/DidCommMediationRecipientService.d.mts +7 -32
  332. package/build/modules/routing/services/DidCommMediationRecipientService.d.mts.map +1 -1
  333. package/build/modules/routing/services/DidCommMediationRecipientService.mjs +14 -139
  334. package/build/modules/routing/services/DidCommMediationRecipientService.mjs.map +1 -1
  335. package/build/modules/routing/services/DidCommMediatorService.d.mts +7 -33
  336. package/build/modules/routing/services/DidCommMediatorService.d.mts.map +1 -1
  337. package/build/modules/routing/services/DidCommMediatorService.mjs +22 -184
  338. package/build/modules/routing/services/DidCommMediatorService.mjs.map +1 -1
  339. package/build/modules/routing/services/DidCommRoutingService.d.mts +2 -10
  340. package/build/modules/routing/services/DidCommRoutingService.d.mts.map +1 -1
  341. package/build/modules/routing/services/DidCommRoutingService.mjs +3 -30
  342. package/build/modules/routing/services/DidCommRoutingService.mjs.map +1 -1
  343. package/build/modules/routing/services/helpers.mjs +2 -2
  344. package/build/modules/routing/services/helpers.mjs.map +1 -1
  345. package/build/services/DidCommDocumentService.d.mts +0 -49
  346. package/build/services/DidCommDocumentService.d.mts.map +1 -1
  347. package/build/services/DidCommDocumentService.mjs +16 -183
  348. package/build/services/DidCommDocumentService.mjs.map +1 -1
  349. package/build/services/index.d.mts +2 -2
  350. package/build/transport/DidCommWsOutboundTransport.d.mts.map +1 -1
  351. package/build/transport/DidCommWsOutboundTransport.mjs.map +1 -1
  352. package/build/updates/0.1-0.2/connection.mjs +1 -1
  353. package/build/updates/0.1-0.2/mediation.mjs +1 -1
  354. package/build/updates/0.2-0.3/connection.mjs +1 -1
  355. package/build/util/parseInvitation.d.mts.map +1 -1
  356. package/build/util/parseInvitation.mjs +5 -11
  357. package/build/util/parseInvitation.mjs.map +1 -1
  358. package/package.json +2 -4
  359. package/build/envelope/DidCommEnvelope.d.mts +0 -67
  360. package/build/envelope/DidCommEnvelope.d.mts.map +0 -1
  361. package/build/envelope/DidCommEnvelopeRegistry.d.mts +0 -65
  362. package/build/envelope/DidCommEnvelopeRegistry.d.mts.map +0 -1
  363. package/build/envelope/DidCommEnvelopeRegistry.mjs +0 -83
  364. package/build/envelope/DidCommEnvelopeRegistry.mjs.map +0 -1
  365. package/build/envelope/DidCommV1Envelope.d.mts +0 -32
  366. package/build/envelope/DidCommV1Envelope.d.mts.map +0 -1
  367. package/build/envelope/DidCommV1Envelope.mjs +0 -46
  368. package/build/envelope/DidCommV1Envelope.mjs.map +0 -1
  369. package/build/envelope/DidCommV2Envelope.d.mts +0 -77
  370. package/build/envelope/DidCommV2Envelope.d.mts.map +0 -1
  371. package/build/envelope/DidCommV2Envelope.mjs +0 -229
  372. package/build/envelope/DidCommV2Envelope.mjs.map +0 -1
  373. package/build/envelope/index.d.mts +0 -5
  374. package/build/envelope/index.mjs +0 -4
  375. package/build/messages/common/DidCommEmptyMessage.d.mts +0 -21
  376. package/build/messages/common/DidCommEmptyMessage.d.mts.map +0 -1
  377. package/build/messages/common/DidCommEmptyMessage.mjs +0 -39
  378. package/build/messages/common/DidCommEmptyMessage.mjs.map +0 -1
  379. package/build/modules/basic-messages/DidCommBasicMessagesModuleConfig.d.mts +0 -25
  380. package/build/modules/basic-messages/DidCommBasicMessagesModuleConfig.d.mts.map +0 -1
  381. package/build/modules/basic-messages/DidCommBasicMessagesModuleConfig.mjs +0 -14
  382. package/build/modules/basic-messages/DidCommBasicMessagesModuleConfig.mjs.map +0 -1
  383. package/build/modules/basic-messages/protocol/index.d.mts +0 -6
  384. package/build/modules/basic-messages/protocol/index.mjs +0 -6
  385. package/build/modules/basic-messages/protocol/v1/handlers/DidCommBasicMessageHandler.mjs.map +0 -1
  386. package/build/modules/basic-messages/protocol/v1/handlers/index.mjs +0 -2
  387. package/build/modules/basic-messages/protocol/v1/index.d.mts +0 -3
  388. package/build/modules/basic-messages/protocol/v1/index.mjs +0 -3
  389. package/build/modules/basic-messages/protocol/v1/messages/DidCommBasicMessage.d.mts.map +0 -1
  390. package/build/modules/basic-messages/protocol/v1/messages/DidCommBasicMessage.mjs.map +0 -1
  391. package/build/modules/basic-messages/protocol/v2/DidCommBasicMessageV2Service.d.mts +0 -27
  392. package/build/modules/basic-messages/protocol/v2/DidCommBasicMessageV2Service.d.mts.map +0 -1
  393. package/build/modules/basic-messages/protocol/v2/DidCommBasicMessageV2Service.mjs +0 -81
  394. package/build/modules/basic-messages/protocol/v2/DidCommBasicMessageV2Service.mjs.map +0 -1
  395. package/build/modules/basic-messages/protocol/v2/handlers/DidCommBasicMessageV2Handler.mjs +0 -17
  396. package/build/modules/basic-messages/protocol/v2/handlers/DidCommBasicMessageV2Handler.mjs.map +0 -1
  397. package/build/modules/basic-messages/protocol/v2/handlers/index.mjs +0 -2
  398. package/build/modules/basic-messages/protocol/v2/index.d.mts +0 -4
  399. package/build/modules/basic-messages/protocol/v2/index.mjs +0 -4
  400. package/build/modules/basic-messages/protocol/v2/messages/DidCommBasicMessageV2.d.mts +0 -39
  401. package/build/modules/basic-messages/protocol/v2/messages/DidCommBasicMessageV2.d.mts.map +0 -1
  402. package/build/modules/basic-messages/protocol/v2/messages/DidCommBasicMessageV2.mjs +0 -71
  403. package/build/modules/basic-messages/protocol/v2/messages/DidCommBasicMessageV2.mjs.map +0 -1
  404. package/build/modules/basic-messages/protocol/v2/messages/index.d.mts +0 -2
  405. package/build/modules/basic-messages/protocol/v2/messages/index.mjs +0 -2
  406. package/build/modules/basic-messages/services/DidCommBaseBasicMessageService.d.mts +0 -21
  407. package/build/modules/basic-messages/services/DidCommBaseBasicMessageService.d.mts.map +0 -1
  408. package/build/modules/basic-messages/services/DidCommBaseBasicMessageService.mjs +0 -27
  409. package/build/modules/basic-messages/services/DidCommBaseBasicMessageService.mjs.map +0 -1
  410. package/build/modules/connections/handlers/DidCommEmptyMessageHandler.d.mts +0 -19
  411. package/build/modules/connections/handlers/DidCommEmptyMessageHandler.d.mts.map +0 -1
  412. package/build/modules/connections/handlers/DidCommEmptyMessageHandler.mjs +0 -21
  413. package/build/modules/connections/handlers/DidCommEmptyMessageHandler.mjs.map +0 -1
  414. package/build/modules/connections/services/DidCommDidRotateV2Service.d.mts +0 -103
  415. package/build/modules/connections/services/DidCommDidRotateV2Service.d.mts.map +0 -1
  416. package/build/modules/connections/services/DidCommDidRotateV2Service.mjs +0 -350
  417. package/build/modules/connections/services/DidCommDidRotateV2Service.mjs.map +0 -1
  418. package/build/modules/message-pickup/protocol/v4/DidCommMessagePickupV4Protocol.d.mts +0 -32
  419. package/build/modules/message-pickup/protocol/v4/DidCommMessagePickupV4Protocol.d.mts.map +0 -1
  420. package/build/modules/message-pickup/protocol/v4/DidCommMessagePickupV4Protocol.mjs +0 -224
  421. package/build/modules/message-pickup/protocol/v4/DidCommMessagePickupV4Protocol.mjs.map +0 -1
  422. package/build/modules/message-pickup/protocol/v4/errors/DidCommMessagePickupV4ProblemReportError.mjs +0 -17
  423. package/build/modules/message-pickup/protocol/v4/errors/DidCommMessagePickupV4ProblemReportError.mjs.map +0 -1
  424. package/build/modules/message-pickup/protocol/v4/errors/index.mjs +0 -2
  425. package/build/modules/message-pickup/protocol/v4/handlers/DidCommDeliveryRequestV4Handler.d.mts +0 -17
  426. package/build/modules/message-pickup/protocol/v4/handlers/DidCommDeliveryRequestV4Handler.d.mts.map +0 -1
  427. package/build/modules/message-pickup/protocol/v4/handlers/DidCommDeliveryRequestV4Handler.mjs +0 -17
  428. package/build/modules/message-pickup/protocol/v4/handlers/DidCommDeliveryRequestV4Handler.mjs.map +0 -1
  429. package/build/modules/message-pickup/protocol/v4/handlers/DidCommLiveDeliveryChangeV4Handler.d.mts +0 -17
  430. package/build/modules/message-pickup/protocol/v4/handlers/DidCommLiveDeliveryChangeV4Handler.d.mts.map +0 -1
  431. package/build/modules/message-pickup/protocol/v4/handlers/DidCommLiveDeliveryChangeV4Handler.mjs +0 -17
  432. package/build/modules/message-pickup/protocol/v4/handlers/DidCommLiveDeliveryChangeV4Handler.mjs.map +0 -1
  433. package/build/modules/message-pickup/protocol/v4/handlers/DidCommMessageDeliveryV4Handler.d.mts +0 -17
  434. package/build/modules/message-pickup/protocol/v4/handlers/DidCommMessageDeliveryV4Handler.d.mts.map +0 -1
  435. package/build/modules/message-pickup/protocol/v4/handlers/DidCommMessageDeliveryV4Handler.mjs +0 -38
  436. package/build/modules/message-pickup/protocol/v4/handlers/DidCommMessageDeliveryV4Handler.mjs.map +0 -1
  437. package/build/modules/message-pickup/protocol/v4/handlers/DidCommMessagePickupV4ProblemReportHandler.d.mts +0 -11
  438. package/build/modules/message-pickup/protocol/v4/handlers/DidCommMessagePickupV4ProblemReportHandler.d.mts.map +0 -1
  439. package/build/modules/message-pickup/protocol/v4/handlers/DidCommMessagePickupV4ProblemReportHandler.mjs +0 -13
  440. package/build/modules/message-pickup/protocol/v4/handlers/DidCommMessagePickupV4ProblemReportHandler.mjs.map +0 -1
  441. package/build/modules/message-pickup/protocol/v4/handlers/DidCommMessagesReceivedV4Handler.d.mts +0 -14
  442. package/build/modules/message-pickup/protocol/v4/handlers/DidCommMessagesReceivedV4Handler.d.mts.map +0 -1
  443. package/build/modules/message-pickup/protocol/v4/handlers/DidCommMessagesReceivedV4Handler.mjs +0 -17
  444. package/build/modules/message-pickup/protocol/v4/handlers/DidCommMessagesReceivedV4Handler.mjs.map +0 -1
  445. package/build/modules/message-pickup/protocol/v4/handlers/DidCommStatusRequestV4Handler.d.mts +0 -17
  446. package/build/modules/message-pickup/protocol/v4/handlers/DidCommStatusRequestV4Handler.d.mts.map +0 -1
  447. package/build/modules/message-pickup/protocol/v4/handlers/DidCommStatusRequestV4Handler.mjs +0 -17
  448. package/build/modules/message-pickup/protocol/v4/handlers/DidCommStatusRequestV4Handler.mjs.map +0 -1
  449. package/build/modules/message-pickup/protocol/v4/handlers/DidCommStatusV4Handler.d.mts +0 -18
  450. package/build/modules/message-pickup/protocol/v4/handlers/DidCommStatusV4Handler.d.mts.map +0 -1
  451. package/build/modules/message-pickup/protocol/v4/handlers/DidCommStatusV4Handler.mjs +0 -23
  452. package/build/modules/message-pickup/protocol/v4/handlers/DidCommStatusV4Handler.mjs.map +0 -1
  453. package/build/modules/message-pickup/protocol/v4/handlers/index.d.mts +0 -8
  454. package/build/modules/message-pickup/protocol/v4/handlers/index.mjs +0 -8
  455. package/build/modules/message-pickup/protocol/v4/index.d.mts +0 -18
  456. package/build/modules/message-pickup/protocol/v4/index.mjs +0 -18
  457. package/build/modules/message-pickup/protocol/v4/messages/DidCommDeliveryRequestV4Message.d.mts +0 -21
  458. package/build/modules/message-pickup/protocol/v4/messages/DidCommDeliveryRequestV4Message.d.mts.map +0 -1
  459. package/build/modules/message-pickup/protocol/v4/messages/DidCommDeliveryRequestV4Message.mjs +0 -39
  460. package/build/modules/message-pickup/protocol/v4/messages/DidCommDeliveryRequestV4Message.mjs.map +0 -1
  461. package/build/modules/message-pickup/protocol/v4/messages/DidCommLiveDeliveryChangeV4Message.d.mts +0 -19
  462. package/build/modules/message-pickup/protocol/v4/messages/DidCommLiveDeliveryChangeV4Message.d.mts.map +0 -1
  463. package/build/modules/message-pickup/protocol/v4/messages/DidCommLiveDeliveryChangeV4Message.mjs +0 -32
  464. package/build/modules/message-pickup/protocol/v4/messages/DidCommLiveDeliveryChangeV4Message.mjs.map +0 -1
  465. package/build/modules/message-pickup/protocol/v4/messages/DidCommMessageDeliveryV4Message.d.mts +0 -24
  466. package/build/modules/message-pickup/protocol/v4/messages/DidCommMessageDeliveryV4Message.d.mts.map +0 -1
  467. package/build/modules/message-pickup/protocol/v4/messages/DidCommMessageDeliveryV4Message.mjs +0 -47
  468. package/build/modules/message-pickup/protocol/v4/messages/DidCommMessageDeliveryV4Message.mjs.map +0 -1
  469. package/build/modules/message-pickup/protocol/v4/messages/DidCommMessagePickupV4ProblemReportMessage.d.mts +0 -16
  470. package/build/modules/message-pickup/protocol/v4/messages/DidCommMessagePickupV4ProblemReportMessage.d.mts.map +0 -1
  471. package/build/modules/message-pickup/protocol/v4/messages/DidCommMessagePickupV4ProblemReportMessage.mjs +0 -32
  472. package/build/modules/message-pickup/protocol/v4/messages/DidCommMessagePickupV4ProblemReportMessage.mjs.map +0 -1
  473. package/build/modules/message-pickup/protocol/v4/messages/DidCommMessagesReceivedV4Message.d.mts +0 -19
  474. package/build/modules/message-pickup/protocol/v4/messages/DidCommMessagesReceivedV4Message.d.mts.map +0 -1
  475. package/build/modules/message-pickup/protocol/v4/messages/DidCommMessagesReceivedV4Message.mjs +0 -30
  476. package/build/modules/message-pickup/protocol/v4/messages/DidCommMessagesReceivedV4Message.mjs.map +0 -1
  477. package/build/modules/message-pickup/protocol/v4/messages/DidCommStatusRequestV4Message.d.mts +0 -19
  478. package/build/modules/message-pickup/protocol/v4/messages/DidCommStatusRequestV4Message.d.mts.map +0 -1
  479. package/build/modules/message-pickup/protocol/v4/messages/DidCommStatusRequestV4Message.mjs +0 -33
  480. package/build/modules/message-pickup/protocol/v4/messages/DidCommStatusRequestV4Message.mjs.map +0 -1
  481. package/build/modules/message-pickup/protocol/v4/messages/DidCommStatusV4Message.d.mts +0 -30
  482. package/build/modules/message-pickup/protocol/v4/messages/DidCommStatusV4Message.d.mts.map +0 -1
  483. package/build/modules/message-pickup/protocol/v4/messages/DidCommStatusV4Message.mjs +0 -66
  484. package/build/modules/message-pickup/protocol/v4/messages/DidCommStatusV4Message.mjs.map +0 -1
  485. package/build/modules/message-pickup/protocol/v4/messages/index.d.mts +0 -8
  486. package/build/modules/message-pickup/protocol/v4/messages/index.mjs +0 -8
  487. package/build/modules/oob/messages/DidCommOutOfBandInvitationV2.d.mts +0 -44
  488. package/build/modules/oob/messages/DidCommOutOfBandInvitationV2.d.mts.map +0 -1
  489. package/build/modules/oob/messages/DidCommOutOfBandInvitationV2.mjs +0 -114
  490. package/build/modules/oob/messages/DidCommOutOfBandInvitationV2.mjs.map +0 -1
  491. package/build/modules/routing/protocol/index.d.mts +0 -18
  492. package/build/modules/routing/protocol/index.mjs +0 -18
  493. package/build/modules/routing/protocol/v1/handlers/DidCommForwardHandler.mjs.map +0 -1
  494. package/build/modules/routing/protocol/v1/handlers/DidCommKeylistUpdateHandler.mjs.map +0 -1
  495. package/build/modules/routing/protocol/v1/handlers/DidCommKeylistUpdateResponseHandler.mjs.map +0 -1
  496. package/build/modules/routing/protocol/v1/handlers/DidCommMediationDenyHandler.mjs.map +0 -1
  497. package/build/modules/routing/protocol/v1/handlers/DidCommMediationGrantHandler.mjs.map +0 -1
  498. package/build/modules/routing/protocol/v1/handlers/DidCommMediationRequestHandler.mjs.map +0 -1
  499. package/build/modules/routing/protocol/v1/index.d.mts +0 -9
  500. package/build/modules/routing/protocol/v1/index.mjs +0 -9
  501. package/build/modules/routing/protocol/v1/messages/DidCommForwardMessage.d.mts.map +0 -1
  502. package/build/modules/routing/protocol/v1/messages/DidCommForwardMessage.mjs.map +0 -1
  503. package/build/modules/routing/protocol/v1/messages/DidCommKeylistMessage.d.mts +0 -25
  504. package/build/modules/routing/protocol/v1/messages/DidCommKeylistMessage.d.mts.map +0 -1
  505. package/build/modules/routing/protocol/v1/messages/DidCommKeylistMessage.mjs +0 -36
  506. package/build/modules/routing/protocol/v1/messages/DidCommKeylistMessage.mjs.map +0 -1
  507. package/build/modules/routing/protocol/v1/messages/DidCommKeylistUpdateMessage.d.mts.map +0 -1
  508. package/build/modules/routing/protocol/v1/messages/DidCommKeylistUpdateMessage.mjs.map +0 -1
  509. package/build/modules/routing/protocol/v1/messages/DidCommKeylistUpdateResponseMessage.d.mts.map +0 -1
  510. package/build/modules/routing/protocol/v1/messages/DidCommKeylistUpdateResponseMessage.mjs.map +0 -1
  511. package/build/modules/routing/protocol/v1/messages/DidCommMediationDenyMessage.d.mts.map +0 -1
  512. package/build/modules/routing/protocol/v1/messages/DidCommMediationDenyMessage.mjs.map +0 -1
  513. package/build/modules/routing/protocol/v1/messages/DidCommMediationGrantMessage.d.mts.map +0 -1
  514. package/build/modules/routing/protocol/v1/messages/DidCommMediationGrantMessage.mjs.map +0 -1
  515. package/build/modules/routing/protocol/v1/messages/DidCommMediationRequestMessage.d.mts.map +0 -1
  516. package/build/modules/routing/protocol/v1/messages/DidCommMediationRequestMessage.mjs.map +0 -1
  517. package/build/modules/routing/protocol/v2/handlers/DidCommKeylistQueryV2Handler.mjs +0 -23
  518. package/build/modules/routing/protocol/v2/handlers/DidCommKeylistQueryV2Handler.mjs.map +0 -1
  519. package/build/modules/routing/protocol/v2/handlers/DidCommKeylistUpdateResponseV2Handler.mjs +0 -17
  520. package/build/modules/routing/protocol/v2/handlers/DidCommKeylistUpdateResponseV2Handler.mjs.map +0 -1
  521. package/build/modules/routing/protocol/v2/handlers/DidCommKeylistUpdateV2Handler.mjs +0 -23
  522. package/build/modules/routing/protocol/v2/handlers/DidCommKeylistUpdateV2Handler.mjs.map +0 -1
  523. package/build/modules/routing/protocol/v2/handlers/DidCommKeylistV2Handler.mjs +0 -17
  524. package/build/modules/routing/protocol/v2/handlers/DidCommKeylistV2Handler.mjs.map +0 -1
  525. package/build/modules/routing/protocol/v2/handlers/DidCommMediationDenyV2Handler.mjs +0 -17
  526. package/build/modules/routing/protocol/v2/handlers/DidCommMediationDenyV2Handler.mjs.map +0 -1
  527. package/build/modules/routing/protocol/v2/handlers/DidCommMediationGrantV2Handler.mjs +0 -17
  528. package/build/modules/routing/protocol/v2/handlers/DidCommMediationGrantV2Handler.mjs.map +0 -1
  529. package/build/modules/routing/protocol/v2/handlers/DidCommMediationRequestV2Handler.mjs +0 -27
  530. package/build/modules/routing/protocol/v2/handlers/DidCommMediationRequestV2Handler.mjs.map +0 -1
  531. package/build/modules/routing/protocol/v2/handlers/index.mjs +0 -8
  532. package/build/modules/routing/protocol/v2/index.d.mts +0 -10
  533. package/build/modules/routing/protocol/v2/index.mjs +0 -10
  534. package/build/modules/routing/protocol/v2/messages/DidCommForwardV2Message.d.mts +0 -58
  535. package/build/modules/routing/protocol/v2/messages/DidCommForwardV2Message.d.mts.map +0 -1
  536. package/build/modules/routing/protocol/v2/messages/DidCommForwardV2Message.mjs +0 -69
  537. package/build/modules/routing/protocol/v2/messages/DidCommForwardV2Message.mjs.map +0 -1
  538. package/build/modules/routing/protocol/v2/messages/DidCommKeylistQueryV2Message.d.mts +0 -33
  539. package/build/modules/routing/protocol/v2/messages/DidCommKeylistQueryV2Message.d.mts.map +0 -1
  540. package/build/modules/routing/protocol/v2/messages/DidCommKeylistQueryV2Message.mjs +0 -48
  541. package/build/modules/routing/protocol/v2/messages/DidCommKeylistQueryV2Message.mjs.map +0 -1
  542. package/build/modules/routing/protocol/v2/messages/DidCommKeylistUpdateResponseV2Message.d.mts +0 -43
  543. package/build/modules/routing/protocol/v2/messages/DidCommKeylistUpdateResponseV2Message.d.mts.map +0 -1
  544. package/build/modules/routing/protocol/v2/messages/DidCommKeylistUpdateResponseV2Message.mjs +0 -62
  545. package/build/modules/routing/protocol/v2/messages/DidCommKeylistUpdateResponseV2Message.mjs.map +0 -1
  546. package/build/modules/routing/protocol/v2/messages/DidCommKeylistUpdateV2Message.d.mts +0 -37
  547. package/build/modules/routing/protocol/v2/messages/DidCommKeylistUpdateV2Message.d.mts.map +0 -1
  548. package/build/modules/routing/protocol/v2/messages/DidCommKeylistUpdateV2Message.mjs +0 -58
  549. package/build/modules/routing/protocol/v2/messages/DidCommKeylistUpdateV2Message.mjs.map +0 -1
  550. package/build/modules/routing/protocol/v2/messages/DidCommKeylistV2Message.d.mts +0 -45
  551. package/build/modules/routing/protocol/v2/messages/DidCommKeylistV2Message.d.mts.map +0 -1
  552. package/build/modules/routing/protocol/v2/messages/DidCommKeylistV2Message.mjs +0 -66
  553. package/build/modules/routing/protocol/v2/messages/DidCommKeylistV2Message.mjs.map +0 -1
  554. package/build/modules/routing/protocol/v2/messages/DidCommMediateDenyV2Message.d.mts +0 -23
  555. package/build/modules/routing/protocol/v2/messages/DidCommMediateDenyV2Message.d.mts.map +0 -1
  556. package/build/modules/routing/protocol/v2/messages/DidCommMediateDenyV2Message.mjs +0 -28
  557. package/build/modules/routing/protocol/v2/messages/DidCommMediateDenyV2Message.mjs.map +0 -1
  558. package/build/modules/routing/protocol/v2/messages/DidCommMediateGrantV2Message.d.mts +0 -25
  559. package/build/modules/routing/protocol/v2/messages/DidCommMediateGrantV2Message.d.mts.map +0 -1
  560. package/build/modules/routing/protocol/v2/messages/DidCommMediateGrantV2Message.mjs +0 -37
  561. package/build/modules/routing/protocol/v2/messages/DidCommMediateGrantV2Message.mjs.map +0 -1
  562. package/build/modules/routing/protocol/v2/messages/DidCommMediateRequestV2Message.d.mts +0 -22
  563. package/build/modules/routing/protocol/v2/messages/DidCommMediateRequestV2Message.d.mts.map +0 -1
  564. package/build/modules/routing/protocol/v2/messages/DidCommMediateRequestV2Message.mjs +0 -27
  565. package/build/modules/routing/protocol/v2/messages/DidCommMediateRequestV2Message.mjs.map +0 -1
  566. package/build/modules/routing/protocol/v2/messages/index.d.mts +0 -9
  567. package/build/modules/routing/protocol/v2/messages/index.mjs +0 -9
  568. package/build/util/didcommVersion.d.mts +0 -33
  569. package/build/util/didcommVersion.d.mts.map +0 -1
  570. package/build/util/didcommVersion.mjs +0 -70
  571. package/build/util/didcommVersion.mjs.map +0 -1
  572. package/build/v2/DidCommV2EnvelopeService.d.mts +0 -86
  573. package/build/v2/DidCommV2EnvelopeService.d.mts.map +0 -1
  574. package/build/v2/DidCommV2EnvelopeService.mjs +0 -343
  575. package/build/v2/DidCommV2EnvelopeService.mjs.map +0 -1
  576. package/build/v2/apuApv.mjs +0 -13
  577. package/build/v2/apuApv.mjs.map +0 -1
  578. package/build/v2/index.d.mts +0 -6
  579. package/build/v2/index.mjs +0 -6
  580. package/build/v2/normalize.d.mts +0 -14
  581. package/build/v2/normalize.d.mts.map +0 -1
  582. package/build/v2/normalize.mjs +0 -53
  583. package/build/v2/normalize.mjs.map +0 -1
  584. package/build/v2/plaintextBuilder.d.mts +0 -23
  585. package/build/v2/plaintextBuilder.d.mts.map +0 -1
  586. package/build/v2/plaintextBuilder.mjs +0 -86
  587. package/build/v2/plaintextBuilder.mjs.map +0 -1
  588. package/build/v2/resolveV2Keys.d.mts +0 -59
  589. package/build/v2/resolveV2Keys.d.mts.map +0 -1
  590. package/build/v2/resolveV2Keys.mjs +0 -234
  591. package/build/v2/resolveV2Keys.mjs.map +0 -1
  592. package/build/v2/types.d.mts +0 -87
  593. package/build/v2/types.d.mts.map +0 -1
  594. package/build/v2/types.mjs +0 -29
  595. package/build/v2/types.mjs.map +0 -1
  596. /package/build/modules/basic-messages/{protocol/v1/messages → messages}/index.d.mts +0 -0
  597. /package/build/modules/basic-messages/{protocol/v1/messages → messages}/index.mjs +0 -0
  598. /package/build/modules/routing/{protocol/v1/handlers → handlers}/index.mjs +0 -0
package/README.md CHANGED
@@ -30,8 +30,6 @@
30
30
 
31
31
  Base DIDComm package for [Credo](https://github.com/openwallet-foundation/credo-ts.git). Adds all [DIDComm v1](https://hyperledger.github.io/aries-rfcs/latest/concepts/0005-didcomm/) Core protocols, such as Connections, Out-of-Band, Discover Features, Mediation Coordination, Message Pickup, Proofs and Credentials as defined in [Aries RFCs](https://github.com/hyperledger/aries-rfcs/tree/main/features).
32
32
 
33
- DIDComm v1 is the default. [DIDComm v2](https://identity.foundation/didcomm-messaging/spec/v2.0/) support is **opt-in** and experimental. See [DIDComm v2 Usage](../../docs/DIDCOMM-V2-USAGE.md) for how to enable it.
34
-
35
33
  ### Quick start
36
34
 
37
35
  In order for this module to work, we have to inject it into the agent to access agent functionality. See the example for more information.
@@ -5,10 +5,6 @@ export declare class BaseDidCommMessage {
5
5
  id: string;
6
6
  readonly type: string;
7
7
  static readonly type: ParsedMessageType;
8
- /** Sender DID (DIDComm v2 plaintext). Set when normalized from v2 envelope. */
9
- from?: string;
10
- /** Recipient DID(s) (DIDComm v2 plaintext). Set when normalized from v2 envelope. */
11
- to?: string | string[];
12
8
  generateId(): string;
13
9
  }
14
10
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"BaseDidCommMessage.d.mts","names":[],"sources":["../src/BaseDidCommMessage.ts"],"mappings":";;;qBAWa;EAGJ;WAIS;kBACO,MAAM;;EAItB;;EAIA;EAEA"}
1
+ {"version":3,"file":"BaseDidCommMessage.d.mts","names":[],"sources":["../src/BaseDidCommMessage.ts"],"mappings":";;;qBAWa;EAGJ;WAIS;kBACO,MAAM;EAEtB"}
@@ -21,8 +21,6 @@ __decorate([
21
21
  Matches(MessageTypeRegExp),
22
22
  __decorateMetadata("design:type", String)
23
23
  ], BaseDidCommMessage.prototype, "type", void 0);
24
- __decorate([Expose(), __decorateMetadata("design:type", String)], BaseDidCommMessage.prototype, "from", void 0);
25
- __decorate([Expose(), __decorateMetadata("design:type", Object)], BaseDidCommMessage.prototype, "to", void 0);
26
24
  //#endregion
27
25
  export { BaseDidCommMessage, MessageIdRegExp, MessageTypeRegExp };
28
26
 
@@ -1 +1 @@
1
- {"version":3,"file":"BaseDidCommMessage.mjs","names":[],"sources":["../src/BaseDidCommMessage.ts"],"sourcesContent":["import type { Constructor } from '@credo-ts/core'\nimport { utils } from '@credo-ts/core'\nimport { Expose } from 'class-transformer'\nimport { Matches } from 'class-validator'\nimport type { ParsedMessageType } from './util/messageType'\n\nexport const MessageIdRegExp = /[-_./a-zA-Z0-9]{8,64}/\nexport const MessageTypeRegExp = /(.*?)([a-zA-Z0-9._-]+)\\/(\\d[^/]*)\\/([a-zA-Z0-9._-]+)$/\n\nexport type BaseMessageConstructor = Constructor<BaseDidCommMessage>\n\nexport class BaseDidCommMessage {\n @Matches(MessageIdRegExp)\n @Expose({ name: '@id' })\n public id!: string\n\n @Expose({ name: '@type' })\n @Matches(MessageTypeRegExp)\n public readonly type!: string\n public static readonly type: ParsedMessageType\n\n /** Sender DID (DIDComm v2 plaintext). Set when normalized from v2 envelope. */\n @Expose()\n public from?: string\n\n /** Recipient DID(s) (DIDComm v2 plaintext). Set when normalized from v2 envelope. */\n @Expose()\n public to?: string | string[]\n\n public generateId() {\n return utils.uuid()\n }\n}\n"],"mappings":";;;;;;AAMA,MAAa,kBAAkB;AAC/B,MAAa,oBAAoB;AAIjC,IAAa,qBAAb,MAAgC;CAkB9B,aAAoB;EAClB,OAAO,MAAM,KAAK;CACpB;AACF;;CApBG,QAAQ,eAAe;CACvB,OAAO,EAAE,MAAM,MAAM,CAAC;;;;CAGtB,OAAO,EAAE,MAAM,QAAQ,CAAC;CACxB,QAAQ,iBAAiB;;;AAKzB,WAAA,CAAA,OAAO,GAAA,mBAAA,eAAA,MAAA,CAAA,GAAA,mBAAA,WAAA,QAAA,KAAA,CAAA;AAIP,WAAA,CAAA,OAAO,GAAA,mBAAA,eAAA,MAAA,CAAA,GAAA,mBAAA,WAAA,MAAA,KAAA,CAAA"}
1
+ {"version":3,"file":"BaseDidCommMessage.mjs","names":[],"sources":["../src/BaseDidCommMessage.ts"],"sourcesContent":["import type { Constructor } from '@credo-ts/core'\nimport { utils } from '@credo-ts/core'\nimport { Expose } from 'class-transformer'\nimport { Matches } from 'class-validator'\nimport type { ParsedMessageType } from './util/messageType'\n\nexport const MessageIdRegExp = /[-_./a-zA-Z0-9]{8,64}/\nexport const MessageTypeRegExp = /(.*?)([a-zA-Z0-9._-]+)\\/(\\d[^/]*)\\/([a-zA-Z0-9._-]+)$/\n\nexport type BaseMessageConstructor = Constructor<BaseDidCommMessage>\n\nexport class BaseDidCommMessage {\n @Matches(MessageIdRegExp)\n @Expose({ name: '@id' })\n public id!: string\n\n @Expose({ name: '@type' })\n @Matches(MessageTypeRegExp)\n public readonly type!: string\n public static readonly type: ParsedMessageType\n\n public generateId() {\n return utils.uuid()\n }\n}\n"],"mappings":";;;;;;AAMA,MAAa,kBAAkB;AAC/B,MAAa,oBAAoB;AAIjC,IAAa,qBAAb,MAAgC;CAU9B,aAAoB;EAClB,OAAO,MAAM,KAAK;CACpB;AACF;;CAZG,QAAQ,eAAe;CACvB,OAAO,EAAE,MAAM,MAAM,CAAC;;;;CAGtB,OAAO,EAAE,MAAM,QAAQ,CAAC;CACxB,QAAQ,iBAAiB"}
@@ -1,11 +1,11 @@
1
1
  import { DidCommMessageHandler } from "./handlers/DidCommMessageHandler.mjs";
2
2
  import { DidCommMessageHandlerMiddleware } from "./handlers/DidCommMessageHandlerMiddleware.mjs";
3
- import { DidCommMessageHandlerRegistry } from "./DidCommMessageHandlerRegistry.mjs";
3
+ import "./handlers/index.mjs";
4
4
  import { DidCommBasicMessagesApi } from "./modules/basic-messages/DidCommBasicMessagesApi.mjs";
5
+ import { DidCommMessageHandlerRegistry } from "./DidCommMessageHandlerRegistry.mjs";
5
6
  import { DidCommCredentialProtocol } from "./modules/credentials/protocol/DidCommCredentialProtocol.mjs";
6
7
  import { DidCommCredentialsModuleConfigOptions } from "./modules/credentials/DidCommCredentialsModuleConfig.mjs";
7
8
  import { DidCommCredentialsApi } from "./modules/credentials/DidCommCredentialsApi.mjs";
8
- import "./handlers/index.mjs";
9
9
  import { DefaultDidCommCredentialProtocols } from "./modules/credentials/DidCommCredentialsModule.mjs";
10
10
  import { DidCommDiscoverFeaturesApi } from "./modules/discover-features/DidCommDiscoverFeaturesApi.mjs";
11
11
  import { DidCommMessagePickupProtocol } from "./modules/message-pickup/protocol/DidCommMessagePickupProtocol.mjs";
@@ -3,8 +3,8 @@ import { DidCommFeatureRegistry } from "./DidCommFeatureRegistry.mjs";
3
3
  import { DidCommMessageHandlerRegistry } from "./DidCommMessageHandlerRegistry.mjs";
4
4
  import __decorateMetadata from "./_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.mjs";
5
5
  import { DidCommModuleConfig } from "./DidCommModuleConfig.mjs";
6
- import { DidCommBasicMessagesApi } from "./modules/basic-messages/DidCommBasicMessagesApi.mjs";
7
6
  import { DidCommConnectionsApi } from "./modules/connections/DidCommConnectionsApi.mjs";
7
+ import { DidCommBasicMessagesApi } from "./modules/basic-messages/DidCommBasicMessagesApi.mjs";
8
8
  import { DidCommOutOfBandApi } from "./modules/oob/DidCommOutOfBandApi.mjs";
9
9
  import { DidCommDiscoverFeaturesApi } from "./modules/discover-features/DidCommDiscoverFeaturesApi.mjs";
10
10
  import { DidCommMessagePickupApi } from "./modules/message-pickup/DidCommMessagePickupApi.mjs";
@@ -1,14 +1,12 @@
1
1
  import { DidCommEncryptedMessage, DidCommPlaintextMessage } from "./types.mjs";
2
- import { DidCommDocumentService } from "./services/DidCommDocumentService.mjs";
3
2
  import { DidCommMessage } from "./DidCommMessage.mjs";
3
+ import { DidCommDocumentService } from "./services/DidCommDocumentService.mjs";
4
4
  import { AgentContext, Kms, Logger } from "@credo-ts/core";
5
5
  //#region src/DidCommEnvelopeService.d.ts
6
6
  export interface EnvelopeKeys {
7
7
  recipientKeys: Kms.PublicJwk<Kms.Ed25519PublicJwk>[];
8
8
  routingKeys: Kms.PublicJwk<Kms.Ed25519PublicJwk>[];
9
9
  senderKey: Kms.PublicJwk<Kms.Ed25519PublicJwk> | null;
10
- /** DID URL of the sender key; used as skid in DIDComm v2 so recipient can resolve it */
11
- senderKeySkid?: string;
12
10
  }
13
11
  export declare class DidCommEnvelopeService {
14
12
  private logger;
@@ -20,18 +18,10 @@ export declare class DidCommEnvelopeService {
20
18
  unpackMessage(agentContext: AgentContext, encryptedMessage: DidCommEncryptedMessage): Promise<DecryptedDidCommMessageContext>;
21
19
  private extractOurRecipientKeyWithKeyId;
22
20
  }
23
- /**
24
- * A key that can appear on a DIDComm envelope.
25
- *
26
- * V1 uses Ed25519 keys throughout. V2 uses the key-agreement curves that the DIDComm Messaging
27
- * v2.1 specification requires. Both versions produce a decrypted context, so the context carries
28
- * the union rather than the v1 type with a cast over it.
29
- */
30
- export type DidCommEnvelopeKey = Kms.PublicJwk<Kms.Ed25519PublicJwk | Kms.X25519PublicJwk | Kms.P256PublicJwk | Kms.P384PublicJwk>;
31
21
  export interface DecryptedDidCommMessageContext {
32
22
  plaintextMessage: DidCommPlaintextMessage;
33
- senderKey?: DidCommEnvelopeKey;
34
- recipientKey: DidCommEnvelopeKey;
23
+ senderKey?: Kms.PublicJwk<Kms.Ed25519PublicJwk>;
24
+ recipientKey: Kms.PublicJwk<Kms.Ed25519PublicJwk>;
35
25
  }
36
26
  //#endregion
37
27
  //# sourceMappingURL=DidCommEnvelopeService.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DidCommEnvelopeService.d.mts","names":[],"sources":["../src/DidCommEnvelopeService.ts"],"mappings":";;;;;iBAuBiB;EACf,eAAe,IAAI,UAAU,IAAI;EACjC,aAAa,IAAI,UAAU,IAAI;EAC/B,WAAW,IAAI,UAAU,IAAI;;EAE7B;;qBAIW;UACH;UACA;EAE4C,YAAA,QAAQ,QAAQ,wBAAwB;UAK9E;UA8GA;EAsGD,YACX,cAAc,cACd,SAAS,gBACT,MAAM,eACL,QAAQ;EAsCE,cACX,cAAc,cACd,kBAAkB,0BACjB,QAAQ;UAKG;;;;;;;;;YAsJJ,qBAAqB,IAAI,UACnC,IAAI,mBAAmB,IAAI,kBAAkB,IAAI,gBAAgB,IAAI;iBAGtD;EACf,kBAAkB;EAClB,YAAY;EACZ,cAAc"}
1
+ {"version":3,"file":"DidCommEnvelopeService.d.mts","names":[],"sources":["../src/DidCommEnvelopeService.ts"],"mappings":";;;;;iBAuBiB;EACf,eAAe,IAAI,UAAU,IAAI;EACjC,aAAa,IAAI,UAAU,IAAI;EAC/B,WAAW,IAAI,UAAU,IAAI;;qBAIlB;UACH;UACA;EAE4C,YAAA,QAAQ,QAAQ,wBAAwB;UAK9E;UA0GA;EAsGD,YACX,cAAc,cACd,SAAS,gBACT,MAAM,eACL,QAAQ;EAsCE,cACX,cAAc,cACd,kBAAkB,0BACjB,QAAQ;UAKG;;iBA+IC;EACf,kBAAkB;EAClB,YAAY,IAAI,UAAU,IAAI;EAC9B,cAAc,IAAI,UAAU,IAAI"}
@@ -1,11 +1,11 @@
1
1
  import __decorate from "./_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.mjs";
2
2
  import __decorateMetadata from "./_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.mjs";
3
3
  import { DidCommModuleConfig } from "./DidCommModuleConfig.mjs";
4
- import { getResolvedDidcommServiceWithSigningKeyId, toX25519 } from "./modules/connections/services/helpers.mjs";
4
+ import { getResolvedDidcommServiceWithSigningKeyId } from "./modules/connections/services/helpers.mjs";
5
5
  import "./modules/oob/domain/DidCommOutOfBandRole.mjs";
6
6
  import __decorateParam from "./_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.mjs";
7
7
  import { DidCommOutOfBandRepository } from "./modules/oob/repository/DidCommOutOfBandRepository.mjs";
8
- import { DidCommForwardMessage } from "./modules/routing/protocol/v1/messages/DidCommForwardMessage.mjs";
8
+ import { DidCommForwardMessage } from "./modules/routing/messages/DidCommForwardMessage.mjs";
9
9
  import { DidCommMediatorRoutingRepository } from "./modules/routing/repository/DidCommMediatorRoutingRepository.mjs";
10
10
  import { DidCommDocumentService } from "./services/DidCommDocumentService.mjs";
11
11
  import { CredoError, InjectionSymbols, JsonEncoder, Kms, RecordNotFoundError, TypedArrayEncoder, inject, injectable } from "@credo-ts/core";
@@ -22,22 +22,20 @@ let DidCommEnvelopeService = class DidCommEnvelopeService {
22
22
  for (const recipientKey of recipientKeys) {
23
23
  let encryptedSender;
24
24
  if (senderKey) {
25
- const recipientX25519Jwk = toX25519(recipientKey).toJson();
26
25
  const { encrypted } = await kms.encrypt({
27
26
  key: { keyAgreement: {
28
27
  algorithm: "ECDH-HSALSA20",
29
- externalPublicJwk: recipientX25519Jwk
28
+ externalPublicJwk: recipientKey.convertTo(Kms.X25519PublicJwk).toJson()
30
29
  } },
31
30
  encryption: { algorithm: "XSALSA20-POLY1305" },
32
31
  data: TypedArrayEncoder.fromUtf8String(TypedArrayEncoder.toBase58(senderKey.publicKey.publicKey))
33
32
  });
34
33
  encryptedSender = TypedArrayEncoder.toBase64Url(encrypted);
35
34
  }
36
- const recipientX25519JwkForKey = toX25519(recipientKey).toJson();
37
35
  const { encrypted, iv } = await kms.encrypt({
38
36
  key: { keyAgreement: {
39
37
  algorithm: "ECDH-HSALSA20",
40
- externalPublicJwk: recipientX25519JwkForKey,
38
+ externalPublicJwk: recipientKey.convertTo(Kms.X25519PublicJwk).toJson(),
41
39
  keyId: senderKey?.keyId
42
40
  } },
43
41
  data: contentEncryptionKey,
@@ -1 +1 @@
1
- {"version":3,"file":"DidCommEnvelopeService.mjs","names":[],"sources":["../src/DidCommEnvelopeService.ts"],"sourcesContent":["import {\n AgentContext,\n CredoError,\n InjectionSymbols,\n inject,\n injectable,\n JsonEncoder,\n Kms,\n type Logger,\n RecordNotFoundError,\n TypedArrayEncoder,\n} from '@credo-ts/core'\nimport type { DidCommMessage } from './DidCommMessage'\nimport { DidCommModuleConfig } from './DidCommModuleConfig'\nimport { getResolvedDidcommServiceWithSigningKeyId, toX25519 } from './modules/connections/services/helpers'\nimport { DidCommOutOfBandRole } from './modules/oob/domain/DidCommOutOfBandRole'\nimport { DidCommOutOfBandRepository } from './modules/oob/repository/DidCommOutOfBandRepository'\nimport { DidCommOutOfBandRecordMetadataKeys } from './modules/oob/repository/outOfBandRecordMetadataTypes'\nimport { DidCommForwardMessage } from './modules/routing/protocol/v1/messages/DidCommForwardMessage'\nimport { DidCommMediatorRoutingRepository } from './modules/routing/repository/DidCommMediatorRoutingRepository'\nimport { DidCommDocumentService } from './services/DidCommDocumentService'\nimport type { DidCommEncryptedMessage, DidCommPlaintextMessage } from './types'\n\nexport interface EnvelopeKeys {\n recipientKeys: Kms.PublicJwk<Kms.Ed25519PublicJwk>[]\n routingKeys: Kms.PublicJwk<Kms.Ed25519PublicJwk>[]\n senderKey: Kms.PublicJwk<Kms.Ed25519PublicJwk> | null\n /** DID URL of the sender key; used as skid in DIDComm v2 so recipient can resolve it */\n senderKeySkid?: string\n}\n\n@injectable()\nexport class DidCommEnvelopeService {\n private logger: Logger\n private didcommDocumentService: DidCommDocumentService\n\n public constructor(@inject(InjectionSymbols.Logger) logger: Logger, didcommDocumentService: DidCommDocumentService) {\n this.logger = logger\n this.didcommDocumentService = didcommDocumentService\n }\n\n private async encryptDidcommV1Message(\n agentContext: AgentContext,\n message: DidCommPlaintextMessage,\n recipientKeys: Kms.PublicJwk<Kms.Ed25519PublicJwk>[],\n senderKey?: Kms.PublicJwk<Kms.Ed25519PublicJwk> | null\n ): Promise<DidCommEncryptedMessage> {\n const kms = agentContext.dependencyManager.resolve(Kms.KeyManagementApi)\n // Generally we would never generate the content encryption key outside of the KMS\n // However how DIDcommV1 is specified to calcualte the aad we need the encrypted content\n // encryption key, and thus we can't use the normal combined key agrement + encryption flow\n const contentEncryptionKey = kms.randomBytes({ length: 32 })\n\n const recipients: Array<{\n encrypted_key: string\n header: {\n kid: string\n\n // In case of Authcrypt\n sender?: string\n iv?: string\n }\n }> = []\n\n for (const recipientKey of recipientKeys) {\n let encryptedSender: string | undefined\n\n if (senderKey) {\n // DIDComm v1 uses Ed25519 keys but encryption happens with X25519 keys.\n const recipientX25519Jwk = toX25519(recipientKey).toJson()\n\n // Encrypt the sender\n const { encrypted } = await kms.encrypt({\n key: {\n keyAgreement: {\n algorithm: 'ECDH-HSALSA20',\n externalPublicJwk: recipientX25519Jwk,\n },\n },\n encryption: {\n algorithm: 'XSALSA20-POLY1305',\n },\n data: TypedArrayEncoder.fromUtf8String(TypedArrayEncoder.toBase58(senderKey.publicKey.publicKey)),\n })\n\n encryptedSender = TypedArrayEncoder.toBase64Url(encrypted)\n }\n\n // Encrypt the key\n const recipientX25519JwkForKey = toX25519(recipientKey).toJson()\n\n const { encrypted, iv } = await kms.encrypt({\n key: {\n keyAgreement: {\n algorithm: 'ECDH-HSALSA20',\n externalPublicJwk: recipientX25519JwkForKey,\n\n // Sender key only needed for Authcrypt\n keyId: senderKey?.keyId,\n },\n },\n data: contentEncryptionKey,\n encryption: {\n algorithm: 'XSALSA20-POLY1305',\n },\n })\n\n recipients.push({\n encrypted_key: TypedArrayEncoder.toBase64Url(encrypted),\n header: {\n kid: TypedArrayEncoder.toBase58(recipientKey.publicKey.publicKey),\n iv: iv ? TypedArrayEncoder.toBase64Url(iv) : undefined,\n sender: encryptedSender,\n },\n })\n }\n\n const protectedString = JsonEncoder.toBase64Url({\n enc: 'xchacha20poly1305_ietf',\n typ: 'JWM/1.0',\n alg: senderKey ? 'Authcrypt' : 'Anoncrypt',\n recipients,\n })\n\n // Perofrm the actual encryption\n const { encrypted, iv, tag } = await kms.encrypt({\n encryption: {\n algorithm: 'C20P',\n aad: TypedArrayEncoder.fromUtf8String(protectedString),\n },\n data: JsonEncoder.toUint8Array(message),\n key: {\n privateJwk: {\n kty: 'oct',\n k: TypedArrayEncoder.toBase64Url(contentEncryptionKey),\n },\n },\n })\n\n if (!iv || !tag) {\n throw new CredoError(\"Expected 'iv' and 'tag' to be defined\")\n }\n\n return {\n ciphertext: TypedArrayEncoder.toBase64Url(encrypted),\n iv: TypedArrayEncoder.toBase64Url(iv),\n tag: TypedArrayEncoder.toBase64Url(tag),\n protected: protectedString,\n } satisfies DidCommEncryptedMessage\n }\n\n private async decryptDidcommV1Message(agentContext: AgentContext, encryptedMessage: DidCommEncryptedMessage) {\n const kms = agentContext.dependencyManager.resolve(Kms.KeyManagementApi)\n const protectedJson = JsonEncoder.fromBase64Url(encryptedMessage.protected)\n\n const alg = protectedJson.alg as 'Anoncrypt' | 'Authcrypt'\n if (alg !== 'Anoncrypt' && alg !== 'Authcrypt') {\n throw new CredoError(`Unsupported pack algorithm: ${alg}`)\n }\n\n if (protectedJson.enc !== 'xchacha20poly1305_ietf') {\n throw new CredoError(`Unsupported enc algorithm: ${protectedJson.enc}`)\n }\n\n let recipientKey: Kms.PublicJwk<Kms.Ed25519PublicJwk> | null = null\n let recipient: {\n header: {\n kid: string\n iv?: string\n sender?: string\n }\n encrypted_key: string\n } | null = null\n\n for (const _recipient of protectedJson.recipients) {\n recipientKey = await this.extractOurRecipientKeyWithKeyId(agentContext, _recipient)\n\n if (recipientKey) {\n recipient = _recipient\n }\n }\n\n if (!recipientKey || !recipient) {\n throw new CredoError('No corresponding recipient key found')\n }\n\n if (alg === 'Authcrypt' && (!recipient.header.sender || !recipient.header.iv)) {\n throw new CredoError('Sender and iv header values are required for Authcrypt')\n }\n\n let senderPublicJwk: Kms.PublicJwk<Kms.Ed25519PublicJwk> | undefined\n if (recipient.header.sender) {\n const { data } = await kms.decrypt({\n key: {\n keyAgreement: {\n algorithm: 'ECDH-HSALSA20',\n keyId: recipientKey.keyId,\n },\n },\n decryption: {\n algorithm: 'XSALSA20-POLY1305',\n },\n encrypted: TypedArrayEncoder.fromBase64Url(recipient.header.sender),\n })\n\n senderPublicJwk = Kms.PublicJwk.fromPublicKey({\n crv: 'Ed25519',\n kty: 'OKP',\n publicKey: TypedArrayEncoder.fromBase58(TypedArrayEncoder.toUtf8String(data)),\n })\n }\n\n // Perofrm the actual decryption\n const { data: contentEncryptionKey } = await kms.decrypt({\n decryption: {\n algorithm: 'XSALSA20-POLY1305',\n iv: recipient.header.iv ? TypedArrayEncoder.fromBase64Url(recipient.header.iv) : undefined,\n },\n encrypted: TypedArrayEncoder.fromBase64Url(recipient.encrypted_key),\n key: {\n keyAgreement: {\n algorithm: 'ECDH-HSALSA20',\n keyId: recipientKey.keyId,\n\n // Optionally we have a sender\n externalPublicJwk: senderPublicJwk?.convertTo(Kms.X25519PublicJwk).toJson(),\n },\n },\n })\n\n const { data: message } = await kms.decrypt({\n decryption: {\n algorithm: 'C20P',\n iv: TypedArrayEncoder.fromBase64Url(encryptedMessage.iv),\n tag: TypedArrayEncoder.fromBase64Url(encryptedMessage.tag),\n aad: TypedArrayEncoder.fromUtf8String(encryptedMessage.protected),\n },\n key: {\n privateJwk: {\n kty: 'oct',\n k: TypedArrayEncoder.toBase64Url(contentEncryptionKey),\n },\n },\n encrypted: TypedArrayEncoder.fromBase64Url(encryptedMessage.ciphertext),\n })\n\n return {\n plaintextMessage: JsonEncoder.fromUint8Array(message),\n senderKey: senderPublicJwk,\n recipientKey,\n }\n }\n\n public async packMessage(\n agentContext: AgentContext,\n payload: DidCommMessage,\n keys: EnvelopeKeys\n ): Promise<DidCommEncryptedMessage> {\n const didcommConfig = agentContext.dependencyManager.resolve(DidCommModuleConfig)\n\n const { routingKeys, senderKey } = keys\n let recipientKeys = keys.recipientKeys\n\n // pass whether we want to use legacy did sov prefix\n const message = payload.toJSON({ useDidSovPrefixWhereAllowed: didcommConfig.useDidSovPrefixWhereAllowed })\n\n this.logger.debug(`Pack outbound message ${message['@type']}`)\n\n let encryptedMessage = await this.encryptDidcommV1Message(agentContext, message, recipientKeys, senderKey)\n\n // If the message has routing keys (mediator) pack for each mediator\n for (const routingKey of routingKeys) {\n const forwardMessage = new DidCommForwardMessage({\n // Forward to first recipient key\n to: TypedArrayEncoder.toBase58(recipientKeys[0].publicKey.publicKey),\n message: encryptedMessage,\n })\n recipientKeys = [routingKey]\n this.logger.debug('Forward message created', forwardMessage)\n\n const forwardJson = forwardMessage.toJSON({\n useDidSovPrefixWhereAllowed: didcommConfig.useDidSovPrefixWhereAllowed,\n })\n\n // Forward messages are anon packed\n encryptedMessage = await this.encryptDidcommV1Message(agentContext, forwardJson, [routingKey])\n }\n\n this.logger.debug(`Packed outbound message ${message['@type']}`, {\n routingKeys: routingKeys.map((routingKey) => routingKey.fingerprint),\n })\n\n return encryptedMessage\n }\n\n public async unpackMessage(\n agentContext: AgentContext,\n encryptedMessage: DidCommEncryptedMessage\n ): Promise<DecryptedDidCommMessageContext> {\n const decryptedMessage = await this.decryptDidcommV1Message(agentContext, encryptedMessage)\n return decryptedMessage\n }\n\n private async extractOurRecipientKeyWithKeyId(\n agentContext: AgentContext,\n recipient: {\n header: {\n kid: string\n }\n }\n ): Promise<Kms.PublicJwk<Kms.Ed25519PublicJwk> | null> {\n const kms = agentContext.resolve(Kms.KeyManagementApi)\n\n const publicKey = Kms.PublicJwk.fromPublicKey({\n kty: 'OKP',\n crv: 'Ed25519',\n publicKey: TypedArrayEncoder.fromBase58(recipient.header.kid),\n })\n\n // We need to find the associated did based on the recipient key\n // so we can extract the kms key id from the did record.\n try {\n const { didDocument, keys } = await this.didcommDocumentService.resolveCreatedDidDocumentWithKeysByRecipientKey(\n agentContext,\n publicKey\n )\n\n const verificationMethod = didDocument.findVerificationMethodByPublicKey(publicKey)\n const kmsKeyId = keys?.find(({ didDocumentRelativeKeyId }) =>\n verificationMethod.id.endsWith(didDocumentRelativeKeyId)\n )?.kmsKeyId\n\n agentContext.config.logger.debug(\n `Found did '${didDocument.id}' for recipient key '${publicKey.fingerprint}' for incoming didcomm message`\n )\n\n publicKey.keyId = kmsKeyId ?? publicKey.legacyKeyId\n return publicKey\n } catch (error) {\n // If there is no did record yet, we first look at the mediator routing record\n const mediatorRoutingRepository = agentContext.dependencyManager.resolve(DidCommMediatorRoutingRepository)\n if (error instanceof RecordNotFoundError) {\n const mediatorRoutingRecord = await mediatorRoutingRepository.findSingleByQuery(agentContext, {\n routingKeyFingerprints: [publicKey.fingerprint],\n })\n\n if (mediatorRoutingRecord) {\n agentContext.config.logger.debug(\n `Found mediator routing record with id '${mediatorRoutingRecord.id}' for recipient key '${publicKey.fingerprint}' for incoming didcomm message`\n )\n\n const routingKey = mediatorRoutingRecord.routingKeysWithKeyId.find((routingKey) =>\n publicKey.equals(routingKey)\n )\n\n // This should not happen as we only get here if the tag matches\n if (!routingKey) {\n throw new CredoError(\n `Expected to find key with fingerprint '${publicKey.fingerprint}' in routing keys of mediator routing record '${mediatorRoutingRecord.id}'`\n )\n }\n\n if (routingKey) {\n return routingKey\n }\n }\n\n // If there is no mediator routing record, we look at the out of band record\n const outOfBandRepository = agentContext.dependencyManager.resolve(DidCommOutOfBandRepository)\n const outOfBandRecord = await outOfBandRepository.findSingleByQuery(agentContext, {\n $or: [\n // In case we are the creator of the out of band invitation we can query based on\n // out of band invitation recipient key fingerprint\n {\n role: DidCommOutOfBandRole.Sender,\n recipientKeyFingerprints: [publicKey.fingerprint],\n },\n // In case we are the receiver of the out of band invitation we need to query\n // for the recipient routing fingerprint\n {\n role: DidCommOutOfBandRole.Receiver,\n recipientRoutingKeyFingerprint: publicKey.fingerprint,\n },\n ],\n })\n\n if (outOfBandRecord?.role === DidCommOutOfBandRole.Sender) {\n agentContext.config.logger.debug(\n `Found out of band record with id '${outOfBandRecord.id}' and role '${outOfBandRecord.role}' for recipient key '${publicKey.fingerprint}' for incoming didcomm message`\n )\n\n for (const service of outOfBandRecord.outOfBandInvitation.getInlineServices()) {\n const resolvedService = getResolvedDidcommServiceWithSigningKeyId(\n service,\n outOfBandRecord.invitationInlineServiceKeys\n )\n const _recipientKey = resolvedService.recipientKeys.find((recipientKey) => recipientKey.equals(publicKey))\n\n if (_recipientKey) {\n return _recipientKey\n }\n }\n } else if (outOfBandRecord?.role === DidCommOutOfBandRole.Receiver) {\n agentContext.config.logger.debug(\n `Found out of band record with id '${outOfBandRecord.id}' and role '${outOfBandRecord.role}' for recipient key '${publicKey.fingerprint}' for incoming didcomm message`\n )\n\n // If there is still no key we need to look at the metadata\n const recipieintRouting = outOfBandRecord.metadata.get(DidCommOutOfBandRecordMetadataKeys.RecipientRouting)\n if (recipieintRouting?.recipientKeyFingerprint === publicKey.fingerprint) {\n publicKey.keyId = recipieintRouting.recipientKeyId ?? publicKey.legacyKeyId\n return publicKey\n }\n }\n\n // If there is no did found, no out of band record found, and not mediator routing record\n // this is either:\n // - a connectionless oob exchange initiated before we added key ids.\n // - a message for a mediator, where the mediator routing record is created before we added key ids\n //\n // We will check if the public key exists based on the base58 encoded public key. We can remove this flow once we create a migration\n // that optimizes this flow.\n const kmsJwkPublic = await kms\n .getPublicKey({\n keyId: publicKey.legacyKeyId,\n })\n .catch((error) => {\n if (error instanceof Kms.KeyManagementKeyNotFoundError) return null\n throw error\n })\n if (kmsJwkPublic) {\n agentContext.config.logger.debug(\n `Found public key with legacy key id '${publicKey.legacyKeyId}' for recipient key '${publicKey.fingerprint}' for incoming didcomm message`\n )\n\n publicKey.keyId = publicKey.legacyKeyId\n return publicKey\n }\n }\n }\n\n // no match found\n return null\n }\n}\n\n/**\n * A key that can appear on a DIDComm envelope.\n *\n * V1 uses Ed25519 keys throughout. V2 uses the key-agreement curves that the DIDComm Messaging\n * v2.1 specification requires. Both versions produce a decrypted context, so the context carries\n * the union rather than the v1 type with a cast over it.\n */\nexport type DidCommEnvelopeKey = Kms.PublicJwk<\n Kms.Ed25519PublicJwk | Kms.X25519PublicJwk | Kms.P256PublicJwk | Kms.P384PublicJwk\n>\n\nexport interface DecryptedDidCommMessageContext {\n plaintextMessage: DidCommPlaintextMessage\n senderKey?: DidCommEnvelopeKey\n recipientKey: DidCommEnvelopeKey\n}\n"],"mappings":";;;;;;;;;;;;AAgCO,IAAM,yBAAN,MAAM,uBAAuB;CAIlC,YAAmB,QAAiD,wBAAgD;EAClH,KAAK,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AC7G;KAEA,UAAU,QAAQ,UAAU;KAC5B,OAAO;IACT;GACF;EACF;EAGA,OAAO;CACT;AACF;;CA7ZC,WAAW;CAKU,gBAAA,GAAA,OAAO,iBAAiB,MAAM,CAAA"}
1
+ {"version":3,"file":"DidCommEnvelopeService.mjs","names":[],"sources":["../src/DidCommEnvelopeService.ts"],"sourcesContent":["import {\n AgentContext,\n CredoError,\n InjectionSymbols,\n inject,\n injectable,\n JsonEncoder,\n Kms,\n type Logger,\n RecordNotFoundError,\n TypedArrayEncoder,\n} from '@credo-ts/core'\nimport type { DidCommMessage } from './DidCommMessage'\nimport { DidCommModuleConfig } from './DidCommModuleConfig'\nimport { getResolvedDidcommServiceWithSigningKeyId } from './modules/connections/services/helpers'\nimport { DidCommOutOfBandRole } from './modules/oob/domain/DidCommOutOfBandRole'\nimport { DidCommOutOfBandRepository } from './modules/oob/repository/DidCommOutOfBandRepository'\nimport { DidCommOutOfBandRecordMetadataKeys } from './modules/oob/repository/outOfBandRecordMetadataTypes'\nimport { DidCommForwardMessage } from './modules/routing/messages/DidCommForwardMessage'\nimport { DidCommMediatorRoutingRepository } from './modules/routing/repository/DidCommMediatorRoutingRepository'\nimport { DidCommDocumentService } from './services/DidCommDocumentService'\nimport type { DidCommEncryptedMessage, DidCommPlaintextMessage } from './types'\n\nexport interface EnvelopeKeys {\n recipientKeys: Kms.PublicJwk<Kms.Ed25519PublicJwk>[]\n routingKeys: Kms.PublicJwk<Kms.Ed25519PublicJwk>[]\n senderKey: Kms.PublicJwk<Kms.Ed25519PublicJwk> | null\n}\n\n@injectable()\nexport class DidCommEnvelopeService {\n private logger: Logger\n private didcommDocumentService: DidCommDocumentService\n\n public constructor(@inject(InjectionSymbols.Logger) logger: Logger, didcommDocumentService: DidCommDocumentService) {\n this.logger = logger\n this.didcommDocumentService = didcommDocumentService\n }\n\n private async encryptDidcommV1Message(\n agentContext: AgentContext,\n message: DidCommPlaintextMessage,\n recipientKeys: Kms.PublicJwk<Kms.Ed25519PublicJwk>[],\n senderKey?: Kms.PublicJwk<Kms.Ed25519PublicJwk> | null\n ): Promise<DidCommEncryptedMessage> {\n const kms = agentContext.dependencyManager.resolve(Kms.KeyManagementApi)\n // Generally we would never generate the content encryption key outside of the KMS\n // However how DIDcommV1 is specified to calcualte the aad we need the encrypted content\n // encryption key, and thus we can't use the normal combined key agrement + encryption flow\n const contentEncryptionKey = kms.randomBytes({ length: 32 })\n\n const recipients: Array<{\n encrypted_key: string\n header: {\n kid: string\n\n // In case of Authcrypt\n sender?: string\n iv?: string\n }\n }> = []\n\n for (const recipientKey of recipientKeys) {\n let encryptedSender: string | undefined\n\n if (senderKey) {\n // Encrypt the sender\n const { encrypted } = await kms.encrypt({\n key: {\n keyAgreement: {\n algorithm: 'ECDH-HSALSA20',\n // DIDComm v1 uses Ed25519 keys but encryption happens with X25519 keys\n externalPublicJwk: recipientKey.convertTo(Kms.X25519PublicJwk).toJson(),\n },\n },\n encryption: {\n algorithm: 'XSALSA20-POLY1305',\n },\n data: TypedArrayEncoder.fromUtf8String(TypedArrayEncoder.toBase58(senderKey.publicKey.publicKey)),\n })\n\n encryptedSender = TypedArrayEncoder.toBase64Url(encrypted)\n }\n\n // Encrypt the key\n const { encrypted, iv } = await kms.encrypt({\n key: {\n keyAgreement: {\n algorithm: 'ECDH-HSALSA20',\n externalPublicJwk: recipientKey.convertTo(Kms.X25519PublicJwk).toJson(),\n\n // Sender key only needed for Authcrypt\n keyId: senderKey?.keyId,\n },\n },\n data: contentEncryptionKey,\n encryption: {\n algorithm: 'XSALSA20-POLY1305',\n },\n })\n\n recipients.push({\n encrypted_key: TypedArrayEncoder.toBase64Url(encrypted),\n header: {\n kid: TypedArrayEncoder.toBase58(recipientKey.publicKey.publicKey),\n iv: iv ? TypedArrayEncoder.toBase64Url(iv) : undefined,\n sender: encryptedSender,\n },\n })\n }\n\n const protectedString = JsonEncoder.toBase64Url({\n enc: 'xchacha20poly1305_ietf',\n typ: 'JWM/1.0',\n alg: senderKey ? 'Authcrypt' : 'Anoncrypt',\n recipients,\n })\n\n // Perofrm the actual encryption\n const { encrypted, iv, tag } = await kms.encrypt({\n encryption: {\n algorithm: 'C20P',\n aad: TypedArrayEncoder.fromUtf8String(protectedString),\n },\n data: JsonEncoder.toUint8Array(message),\n key: {\n privateJwk: {\n kty: 'oct',\n k: TypedArrayEncoder.toBase64Url(contentEncryptionKey),\n },\n },\n })\n\n if (!iv || !tag) {\n throw new CredoError(\"Expected 'iv' and 'tag' to be defined\")\n }\n\n return {\n ciphertext: TypedArrayEncoder.toBase64Url(encrypted),\n iv: TypedArrayEncoder.toBase64Url(iv),\n tag: TypedArrayEncoder.toBase64Url(tag),\n protected: protectedString,\n } satisfies DidCommEncryptedMessage\n }\n\n private async decryptDidcommV1Message(agentContext: AgentContext, encryptedMessage: DidCommEncryptedMessage) {\n const kms = agentContext.dependencyManager.resolve(Kms.KeyManagementApi)\n const protectedJson = JsonEncoder.fromBase64Url(encryptedMessage.protected)\n\n const alg = protectedJson.alg as 'Anoncrypt' | 'Authcrypt'\n if (alg !== 'Anoncrypt' && alg !== 'Authcrypt') {\n throw new CredoError(`Unsupported pack algorithm: ${alg}`)\n }\n\n if (protectedJson.enc !== 'xchacha20poly1305_ietf') {\n throw new CredoError(`Unsupported enc algorithm: ${protectedJson.enc}`)\n }\n\n let recipientKey: Kms.PublicJwk<Kms.Ed25519PublicJwk> | null = null\n let recipient: {\n header: {\n kid: string\n iv?: string\n sender?: string\n }\n encrypted_key: string\n } | null = null\n\n for (const _recipient of protectedJson.recipients) {\n recipientKey = await this.extractOurRecipientKeyWithKeyId(agentContext, _recipient)\n\n if (recipientKey) {\n recipient = _recipient\n }\n }\n\n if (!recipientKey || !recipient) {\n throw new CredoError('No corresponding recipient key found')\n }\n\n if (alg === 'Authcrypt' && (!recipient.header.sender || !recipient.header.iv)) {\n throw new CredoError('Sender and iv header values are required for Authcrypt')\n }\n\n let senderPublicJwk: Kms.PublicJwk<Kms.Ed25519PublicJwk> | undefined\n if (recipient.header.sender) {\n const { data } = await kms.decrypt({\n key: {\n keyAgreement: {\n algorithm: 'ECDH-HSALSA20',\n keyId: recipientKey.keyId,\n },\n },\n decryption: {\n algorithm: 'XSALSA20-POLY1305',\n },\n encrypted: TypedArrayEncoder.fromBase64Url(recipient.header.sender),\n })\n\n senderPublicJwk = Kms.PublicJwk.fromPublicKey({\n crv: 'Ed25519',\n kty: 'OKP',\n publicKey: TypedArrayEncoder.fromBase58(TypedArrayEncoder.toUtf8String(data)),\n })\n }\n\n // Perofrm the actual decryption\n const { data: contentEncryptionKey } = await kms.decrypt({\n decryption: {\n algorithm: 'XSALSA20-POLY1305',\n iv: recipient.header.iv ? TypedArrayEncoder.fromBase64Url(recipient.header.iv) : undefined,\n },\n encrypted: TypedArrayEncoder.fromBase64Url(recipient.encrypted_key),\n key: {\n keyAgreement: {\n algorithm: 'ECDH-HSALSA20',\n keyId: recipientKey.keyId,\n\n // Optionally we have a sender\n externalPublicJwk: senderPublicJwk?.convertTo(Kms.X25519PublicJwk).toJson(),\n },\n },\n })\n\n const { data: message } = await kms.decrypt({\n decryption: {\n algorithm: 'C20P',\n iv: TypedArrayEncoder.fromBase64Url(encryptedMessage.iv),\n tag: TypedArrayEncoder.fromBase64Url(encryptedMessage.tag),\n aad: TypedArrayEncoder.fromUtf8String(encryptedMessage.protected),\n },\n key: {\n privateJwk: {\n kty: 'oct',\n k: TypedArrayEncoder.toBase64Url(contentEncryptionKey),\n },\n },\n encrypted: TypedArrayEncoder.fromBase64Url(encryptedMessage.ciphertext),\n })\n\n return {\n plaintextMessage: JsonEncoder.fromUint8Array(message),\n senderKey: senderPublicJwk,\n recipientKey,\n }\n }\n\n public async packMessage(\n agentContext: AgentContext,\n payload: DidCommMessage,\n keys: EnvelopeKeys\n ): Promise<DidCommEncryptedMessage> {\n const didcommConfig = agentContext.dependencyManager.resolve(DidCommModuleConfig)\n\n const { routingKeys, senderKey } = keys\n let recipientKeys = keys.recipientKeys\n\n // pass whether we want to use legacy did sov prefix\n const message = payload.toJSON({ useDidSovPrefixWhereAllowed: didcommConfig.useDidSovPrefixWhereAllowed })\n\n this.logger.debug(`Pack outbound message ${message['@type']}`)\n\n let encryptedMessage = await this.encryptDidcommV1Message(agentContext, message, recipientKeys, senderKey)\n\n // If the message has routing keys (mediator) pack for each mediator\n for (const routingKey of routingKeys) {\n const forwardMessage = new DidCommForwardMessage({\n // Forward to first recipient key\n to: TypedArrayEncoder.toBase58(recipientKeys[0].publicKey.publicKey),\n message: encryptedMessage,\n })\n recipientKeys = [routingKey]\n this.logger.debug('Forward message created', forwardMessage)\n\n const forwardJson = forwardMessage.toJSON({\n useDidSovPrefixWhereAllowed: didcommConfig.useDidSovPrefixWhereAllowed,\n })\n\n // Forward messages are anon packed\n encryptedMessage = await this.encryptDidcommV1Message(agentContext, forwardJson, [routingKey])\n }\n\n this.logger.debug(`Packed outbound message ${message['@type']}`, {\n routingKeys: routingKeys.map((routingKey) => routingKey.fingerprint),\n })\n\n return encryptedMessage\n }\n\n public async unpackMessage(\n agentContext: AgentContext,\n encryptedMessage: DidCommEncryptedMessage\n ): Promise<DecryptedDidCommMessageContext> {\n const decryptedMessage = await this.decryptDidcommV1Message(agentContext, encryptedMessage)\n return decryptedMessage\n }\n\n private async extractOurRecipientKeyWithKeyId(\n agentContext: AgentContext,\n recipient: {\n header: {\n kid: string\n }\n }\n ): Promise<Kms.PublicJwk<Kms.Ed25519PublicJwk> | null> {\n const kms = agentContext.resolve(Kms.KeyManagementApi)\n\n const publicKey = Kms.PublicJwk.fromPublicKey({\n kty: 'OKP',\n crv: 'Ed25519',\n publicKey: TypedArrayEncoder.fromBase58(recipient.header.kid),\n })\n\n // We need to find the associated did based on the recipient key\n // so we can extract the kms key id from the did record.\n try {\n const { didDocument, keys } = await this.didcommDocumentService.resolveCreatedDidDocumentWithKeysByRecipientKey(\n agentContext,\n publicKey\n )\n\n const verificationMethod = didDocument.findVerificationMethodByPublicKey(publicKey)\n const kmsKeyId = keys?.find(({ didDocumentRelativeKeyId }) =>\n verificationMethod.id.endsWith(didDocumentRelativeKeyId)\n )?.kmsKeyId\n\n agentContext.config.logger.debug(\n `Found did '${didDocument.id}' for recipient key '${publicKey.fingerprint}' for incoming didcomm message`\n )\n\n publicKey.keyId = kmsKeyId ?? publicKey.legacyKeyId\n return publicKey\n } catch (error) {\n // If there is no did record yet, we first look at the mediator routing record\n const mediatorRoutingRepository = agentContext.dependencyManager.resolve(DidCommMediatorRoutingRepository)\n if (error instanceof RecordNotFoundError) {\n const mediatorRoutingRecord = await mediatorRoutingRepository.findSingleByQuery(agentContext, {\n routingKeyFingerprints: [publicKey.fingerprint],\n })\n\n if (mediatorRoutingRecord) {\n agentContext.config.logger.debug(\n `Found mediator routing record with id '${mediatorRoutingRecord.id}' for recipient key '${publicKey.fingerprint}' for incoming didcomm message`\n )\n\n const routingKey = mediatorRoutingRecord.routingKeysWithKeyId.find((routingKey) =>\n publicKey.equals(routingKey)\n )\n\n // This should not happen as we only get here if the tag matches\n if (!routingKey) {\n throw new CredoError(\n `Expected to find key with fingerprint '${publicKey.fingerprint}' in routing keys of mediator routing record '${mediatorRoutingRecord.id}'`\n )\n }\n\n if (routingKey) {\n return routingKey\n }\n }\n\n // If there is no mediator routing record, we look at the out of band record\n const outOfBandRepository = agentContext.dependencyManager.resolve(DidCommOutOfBandRepository)\n const outOfBandRecord = await outOfBandRepository.findSingleByQuery(agentContext, {\n $or: [\n // In case we are the creator of the out of band invitation we can query based on\n // out of band invitation recipient key fingerprint\n {\n role: DidCommOutOfBandRole.Sender,\n recipientKeyFingerprints: [publicKey.fingerprint],\n },\n // In case we are the receiver of the out of band invitation we need to query\n // for the recipient routing fingerprint\n {\n role: DidCommOutOfBandRole.Receiver,\n recipientRoutingKeyFingerprint: publicKey.fingerprint,\n },\n ],\n })\n\n if (outOfBandRecord?.role === DidCommOutOfBandRole.Sender) {\n agentContext.config.logger.debug(\n `Found out of band record with id '${outOfBandRecord.id}' and role '${outOfBandRecord.role}' for recipient key '${publicKey.fingerprint}' for incoming didcomm message`\n )\n\n for (const service of outOfBandRecord.outOfBandInvitation.getInlineServices()) {\n const resolvedService = getResolvedDidcommServiceWithSigningKeyId(\n service,\n outOfBandRecord.invitationInlineServiceKeys\n )\n const _recipientKey = resolvedService.recipientKeys.find((recipientKey) => recipientKey.equals(publicKey))\n\n if (_recipientKey) {\n return _recipientKey\n }\n }\n } else if (outOfBandRecord?.role === DidCommOutOfBandRole.Receiver) {\n agentContext.config.logger.debug(\n `Found out of band record with id '${outOfBandRecord.id}' and role '${outOfBandRecord.role}' for recipient key '${publicKey.fingerprint}' for incoming didcomm message`\n )\n\n // If there is still no key we need to look at the metadata\n const recipieintRouting = outOfBandRecord.metadata.get(DidCommOutOfBandRecordMetadataKeys.RecipientRouting)\n if (recipieintRouting?.recipientKeyFingerprint === publicKey.fingerprint) {\n publicKey.keyId = recipieintRouting.recipientKeyId ?? publicKey.legacyKeyId\n return publicKey\n }\n }\n\n // If there is no did found, no out of band record found, and not mediator routing record\n // this is either:\n // - a connectionless oob exchange initiated before we added key ids.\n // - a message for a mediator, where the mediator routing record is created before we added key ids\n //\n // We will check if the public key exists based on the base58 encoded public key. We can remove this flow once we create a migration\n // that optimizes this flow.\n const kmsJwkPublic = await kms\n .getPublicKey({\n keyId: publicKey.legacyKeyId,\n })\n .catch((error) => {\n if (error instanceof Kms.KeyManagementKeyNotFoundError) return null\n throw error\n })\n if (kmsJwkPublic) {\n agentContext.config.logger.debug(\n `Found public key with legacy key id '${publicKey.legacyKeyId}' for recipient key '${publicKey.fingerprint}' for incoming didcomm message`\n )\n\n publicKey.keyId = publicKey.legacyKeyId\n return publicKey\n }\n }\n }\n\n // no match found\n return null\n }\n}\n\nexport interface DecryptedDidCommMessageContext {\n plaintextMessage: DidCommPlaintextMessage\n senderKey?: Kms.PublicJwk<Kms.Ed25519PublicJwk>\n recipientKey: Kms.PublicJwk<Kms.Ed25519PublicJwk>\n}\n"],"mappings":";;;;;;;;;;;;AA8BO,I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,MACzB,wCAAwC,UAAU,YAAY,uBAAuB,UAAU,YAAY,+BAC7G;KAEA,UAAU,QAAQ,UAAU;KAC5B,OAAO;IACT;GACF;EACF;EAGA,OAAO;CACT;AACF;;CAzZC,WAAW;CAKU,gBAAA,GAAA,OAAO,iBAAiB,MAAM,CAAA"}
@@ -1,8 +1,8 @@
1
1
  import { DidCommEncryptedMessage } from "./types.mjs";
2
+ import { DidCommMessage } from "./DidCommMessage.mjs";
2
3
  import { DidCommTransportSession } from "./DidCommTransportService.mjs";
3
4
  import { DidCommConnectionRecord } from "./modules/connections/repository/DidCommConnectionRecord.mjs";
4
5
  import "./modules/connections/repository/index.mjs";
5
- import { DidCommMessage } from "./DidCommMessage.mjs";
6
6
  import { DidCommOutboundMessageContext } from "./models/DidCommOutboundMessageContext.mjs";
7
7
  import { OutboundMessageSendStatus } from "./models/DidCommOutboundMessageSendStatus.mjs";
8
8
  import "./models/index.mjs";
@@ -7,7 +7,6 @@ import { DidCommPlaintextMessage } from "./types.mjs";
7
7
  import { ParsedMessageType } from "./util/messageType.mjs";
8
8
  import { BaseDidCommMessage } from "./BaseDidCommMessage.mjs";
9
9
  import { DidCommAttachment } from "./decorators/attachment/DidCommAttachment.mjs";
10
- import { DidCommVersion } from "./util/didcommVersion.mjs";
11
10
  import { ServiceDecorator, ServiceDecoratorOptions } from "./decorators/service/ServiceDecorator.mjs";
12
11
  import "./index.mjs";
13
12
  import { Constructor } from "@credo-ts/core";
@@ -22,8 +21,6 @@ declare const Decorated: {
22
21
  setThread(options: Partial<ThreadDecorator>): void;
23
22
  id: string;
24
23
  readonly type: string;
25
- from?: string;
26
- to?: string | string[];
27
24
  generateId(): string;
28
25
  };
29
26
  } & {
@@ -33,8 +30,6 @@ declare const Decorated: {
33
30
  getLocale(): string | undefined;
34
31
  id: string;
35
32
  readonly type: string;
36
- from?: string;
37
- to?: string | string[];
38
33
  generateId(): string;
39
34
  };
40
35
  } & {
@@ -45,8 +40,6 @@ declare const Decorated: {
45
40
  hasAnyReturnRoute(): boolean;
46
41
  id: string;
47
42
  readonly type: string;
48
- from?: string;
49
- to?: string | string[];
50
43
  generateId(): string;
51
44
  };
52
45
  } & {
@@ -55,8 +48,6 @@ declare const Decorated: {
55
48
  setTiming(options: Partial<TimingDecorator>): void;
56
49
  id: string;
57
50
  readonly type: string;
58
- from?: string;
59
- to?: string | string[];
60
51
  generateId(): string;
61
52
  };
62
53
  } & {
@@ -67,8 +58,6 @@ declare const Decorated: {
67
58
  requiresAck(): boolean;
68
59
  id: string;
69
60
  readonly type: string;
70
- from?: string;
71
- to?: string | string[];
72
61
  generateId(): string;
73
62
  };
74
63
  } & {
@@ -78,8 +67,6 @@ declare const Decorated: {
78
67
  addAppendedAttachment(attachment: DidCommAttachment): void;
79
68
  id: string;
80
69
  readonly type: string;
81
- from?: string;
82
- to?: string | string[];
83
70
  generateId(): string;
84
71
  };
85
72
  } & {
@@ -88,8 +75,6 @@ declare const Decorated: {
88
75
  setService(serviceData: ServiceDecoratorOptions): void;
89
76
  id: string;
90
77
  readonly type: string;
91
- from?: string;
92
- to?: string | string[];
93
78
  generateId(): string;
94
79
  };
95
80
  } & typeof BaseDidCommMessage;
@@ -108,11 +93,6 @@ export declare class DidCommMessage extends Decorated {
108
93
  * @see https://github.com/decentralized-identity/didcomm-messaging/blob/main/extensions/return_route/main.md#queue-transport
109
94
  */
110
95
  readonly allowQueueTransport: boolean;
111
- /**
112
- * DIDComm envelope versions this message type supports. undefined = both v1 and v2 allowed (default for all existing messages).
113
- * Set to ['v2'] for v2-only protocols (e.g. present-proof/3.0, trust-ping/2.0). Used to throw when sending v2-only over v1 connection.
114
- */
115
- readonly supportedDidCommVersions?: readonly DidCommVersion[];
116
96
  toJSON({ useDidSovPrefixWhereAllowed }?: {
117
97
  useDidSovPrefixWhereAllowed?: boolean;
118
98
  }): DidCommPlaintextMessage;
@@ -1 +1 @@
1
- {"version":3,"file":"DidCommMessage.d.mts","names":[],"sources":["../src/DidCommMessage.ts"],"mappings":";;;;;;;;;;;;;;YAgBY,4BAA4B,YAAY;EAAoB,MAAM;;cAExE;;aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAIL;qBAEY,uBAAuB;;;;;;;WAQlB;;;;;;;WASA;;;;;WAOA,oCAAoC;EAE7C,SACL;IAEA;MACO;EAaF,GAAG,iBAAiB,gBAAgB,OAAO,YAAY,aAAa"}
1
+ {"version":3,"file":"DidCommMessage.d.mts","names":[],"sources":["../src/DidCommMessage.ts"],"mappings":";;;;;;;;;;;;;YAeY,4BAA4B,YAAY;EAAoB,MAAM;;cAExE;;aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAIL;qBAEY,uBAAuB;;;;;;;WAQlB;;;;;;;WASA;EAET,SACL;IAEA;MACO;EAaF,GAAG,iBAAiB,gBAAgB,OAAO,YAAY,aAAa"}
@@ -30,7 +30,6 @@ var DidCommMessage = class extends Decorated {
30
30
  };
31
31
  __decorate([Exclude(), __decorateMetadata("design:type", Boolean)], DidCommMessage.prototype, "allowDidSovPrefix", void 0);
32
32
  __decorate([Exclude(), __decorateMetadata("design:type", Boolean)], DidCommMessage.prototype, "allowQueueTransport", void 0);
33
- __decorate([Exclude(), __decorateMetadata("design:type", Array)], DidCommMessage.prototype, "supportedDidCommVersions", void 0);
34
33
  //#endregion
35
34
  export { DidCommMessage };
36
35
 
@@ -1 +1 @@
1
- {"version":3,"file":"DidCommMessage.mjs","names":[],"sources":["../src/DidCommMessage.ts"],"sourcesContent":["import type { Constructor } from '@credo-ts/core'\nimport { JsonTransformer } from '@credo-ts/core'\nimport { Exclude } from 'class-transformer'\nimport { BaseDidCommMessage } from './BaseDidCommMessage'\nimport { AckDecorated } from './decorators/ack/AckDecoratorExtension'\nimport { AttachmentDecorated } from './decorators/attachment/AttachmentExtension'\nimport { L10nDecorated } from './decorators/l10n/L10nDecoratorExtension'\nimport { ServiceDecorated } from './decorators/service/ServiceDecoratorExtension'\nimport { ThreadDecorated } from './decorators/thread/ThreadDecoratorExtension'\nimport { TimingDecorated } from './decorators/timing/TimingDecoratorExtension'\nimport { TransportDecorated } from './decorators/transport/TransportDecoratorExtension'\nimport type { DidCommPlaintextMessage } from './types'\nimport type { DidCommVersion } from './util/didcommVersion'\nimport type { ParsedMessageType } from './util/messageType'\nimport { replaceNewDidCommPrefixWithLegacyDidSovOnMessage } from './util/messageType'\n\nexport type ConstructableAgentMessage = Constructor<DidCommMessage> & { type: ParsedMessageType }\n\nconst Decorated = ThreadDecorated(\n L10nDecorated(\n TransportDecorated(TimingDecorated(AckDecorated(AttachmentDecorated(ServiceDecorated(BaseDidCommMessage)))))\n )\n)\n\nexport class DidCommMessage extends Decorated {\n /**\n * Whether the protocol RFC was initially written using the legacy did:prefix instead of the\n * new https://didcomm.org message type prefix.\n *\n * @see https://github.com/hyperledger/aries-rfcs/blob/main/features/0348-transition-msg-type-to-https/README.md\n */\n @Exclude()\n public readonly allowDidSovPrefix: boolean = false\n\n /**\n * Whether to use Queue Transport in case the recipient of this message does not have a reliable\n * endpoint available\n *\n * @see https://github.com/decentralized-identity/didcomm-messaging/blob/main/extensions/return_route/main.md#queue-transport\n */\n @Exclude()\n public readonly allowQueueTransport: boolean = true\n\n /**\n * DIDComm envelope versions this message type supports. undefined = both v1 and v2 allowed (default for all existing messages).\n * Set to ['v2'] for v2-only protocols (e.g. present-proof/3.0, trust-ping/2.0). Used to throw when sending v2-only over v1 connection.\n */\n @Exclude()\n public readonly supportedDidCommVersions?: readonly DidCommVersion[]\n\n public toJSON({\n useDidSovPrefixWhereAllowed,\n }: {\n useDidSovPrefixWhereAllowed?: boolean\n } = {}): DidCommPlaintextMessage {\n const json = JsonTransformer.toJSON(this)\n\n // If we have `useDidSovPrefixWhereAllowed` enabled, we want to replace the new https://didcomm.org prefix with the legacy did:sov prefix.\n // However, we only do this if the protocol RFC was initially written with the did:sov message type prefix\n // See https://github.com/hyperledger/aries-rfcs/blob/main/features/0348-transition-msg-type-to-https/README.md\n if (this.allowDidSovPrefix && useDidSovPrefixWhereAllowed) {\n replaceNewDidCommPrefixWithLegacyDidSovOnMessage(json)\n }\n\n return json as DidCommPlaintextMessage\n }\n\n public is<C extends typeof DidCommMessage>(Class: C): this is InstanceType<C> {\n return this.type === Class.type.messageTypeUri\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAM,YAAY,gBAChB,cACE,mBAAmB,gBAAgB,aAAa,oBAAoB,iBAAiB,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAC7G,CACF;AAEA,IAAa,iBAAb,cAAoC,UAAU;;;EAO5C,KACgB,oBAA6B;EAQ7C,KACgB,sBAA+B;;CAS/C,OAAc,EACZ,gCAGE,CAAC,GAA4B;EAC/B,MAAM,OAAO,gBAAgB,OAAO,IAAI;EAKxC,IAAI,KAAK,qBAAqB,6BAC5B,iDAAiD,IAAI;EAGvD,OAAO;CACT;CAEA,GAA2C,OAAmC;EAC5E,OAAO,KAAK,SAAS,MAAM,KAAK;CAClC;AACF;AAvCG,WAAA,CAAA,QAAQ,GAAA,mBAAA,eAAA,OAAA,CAAA,GAAA,eAAA,WAAA,qBAAA,KAAA,CAAA;AASR,WAAA,CAAA,QAAQ,GAAA,mBAAA,eAAA,OAAA,CAAA,GAAA,eAAA,WAAA,uBAAA,KAAA,CAAA;AAOR,WAAA,CAAA,QAAQ,GAAA,mBAAA,eAAA,KAAA,CAAA,GAAA,eAAA,WAAA,4BAAA,KAAA,CAAA"}
1
+ {"version":3,"file":"DidCommMessage.mjs","names":[],"sources":["../src/DidCommMessage.ts"],"sourcesContent":["import type { Constructor } from '@credo-ts/core'\nimport { JsonTransformer } from '@credo-ts/core'\nimport { Exclude } from 'class-transformer'\nimport { BaseDidCommMessage } from './BaseDidCommMessage'\nimport { AckDecorated } from './decorators/ack/AckDecoratorExtension'\nimport { AttachmentDecorated } from './decorators/attachment/AttachmentExtension'\nimport { L10nDecorated } from './decorators/l10n/L10nDecoratorExtension'\nimport { ServiceDecorated } from './decorators/service/ServiceDecoratorExtension'\nimport { ThreadDecorated } from './decorators/thread/ThreadDecoratorExtension'\nimport { TimingDecorated } from './decorators/timing/TimingDecoratorExtension'\nimport { TransportDecorated } from './decorators/transport/TransportDecoratorExtension'\nimport type { DidCommPlaintextMessage } from './types'\nimport type { ParsedMessageType } from './util/messageType'\nimport { replaceNewDidCommPrefixWithLegacyDidSovOnMessage } from './util/messageType'\n\nexport type ConstructableAgentMessage = Constructor<DidCommMessage> & { type: ParsedMessageType }\n\nconst Decorated = ThreadDecorated(\n L10nDecorated(\n TransportDecorated(TimingDecorated(AckDecorated(AttachmentDecorated(ServiceDecorated(BaseDidCommMessage)))))\n )\n)\n\nexport class DidCommMessage extends Decorated {\n /**\n * Whether the protocol RFC was initially written using the legacy did:prefix instead of the\n * new https://didcomm.org message type prefix.\n *\n * @see https://github.com/hyperledger/aries-rfcs/blob/main/features/0348-transition-msg-type-to-https/README.md\n */\n @Exclude()\n public readonly allowDidSovPrefix: boolean = false\n\n /**\n * Whether to use Queue Transport in case the recipient of this message does not have a reliable\n * endpoint available\n *\n * @see https://github.com/decentralized-identity/didcomm-messaging/blob/main/extensions/return_route/main.md#queue-transport\n */\n @Exclude()\n public readonly allowQueueTransport: boolean = true\n\n public toJSON({\n useDidSovPrefixWhereAllowed,\n }: {\n useDidSovPrefixWhereAllowed?: boolean\n } = {}): DidCommPlaintextMessage {\n const json = JsonTransformer.toJSON(this)\n\n // If we have `useDidSovPrefixWhereAllowed` enabled, we want to replace the new https://didcomm.org prefix with the legacy did:sov prefix.\n // However, we only do this if the protocol RFC was initially written with the did:sov message type prefix\n // See https://github.com/hyperledger/aries-rfcs/blob/main/features/0348-transition-msg-type-to-https/README.md\n if (this.allowDidSovPrefix && useDidSovPrefixWhereAllowed) {\n replaceNewDidCommPrefixWithLegacyDidSovOnMessage(json)\n }\n\n return json as DidCommPlaintextMessage\n }\n\n public is<C extends typeof DidCommMessage>(Class: C): this is InstanceType<C> {\n return this.type === Class.type.messageTypeUri\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,MAAM,YAAY,gBAChB,cACE,mBAAmB,gBAAgB,aAAa,oBAAoB,iBAAiB,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAC7G,CACF;AAEA,IAAa,iBAAb,cAAoC,UAAU;;;EAO5C,KACgB,oBAA6B;EAQ7C,KACgB,sBAA+B;;CAE/C,OAAc,EACZ,gCAGE,CAAC,GAA4B;EAC/B,MAAM,OAAO,gBAAgB,OAAO,IAAI;EAKxC,IAAI,KAAK,qBAAqB,6BAC5B,iDAAiD,IAAI;EAGvD,OAAO;CACT;CAEA,GAA2C,OAAmC;EAC5E,OAAO,KAAK,SAAS,MAAM,KAAK;CAClC;AACF;AAhCG,WAAA,CAAA,QAAQ,GAAA,mBAAA,eAAA,OAAA,CAAA,GAAA,eAAA,WAAA,qBAAA,KAAA,CAAA;AASR,WAAA,CAAA,QAAQ,GAAA,mBAAA,eAAA,OAAA,CAAA,GAAA,eAAA,WAAA,uBAAA,KAAA,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { ParsedDidCommProtocolUri, ParsedMessageType } from "./util/messageType.mjs";
2
+ import { DidCommMessage } from "./DidCommMessage.mjs";
2
3
  import { DidCommMessageHandler } from "./handlers/DidCommMessageHandler.mjs";
3
4
  import { DidCommMessageHandlerMiddleware } from "./handlers/DidCommMessageHandlerMiddleware.mjs";
4
- import { DidCommMessage } from "./DidCommMessage.mjs";
5
5
  import { DidCommOutboundMessageContext } from "./models/DidCommOutboundMessageContext.mjs";
6
6
  import { DidCommInboundMessageContext } from "./models/DidCommInboundMessageContext.mjs";
7
7
  import "./models/index.mjs";
@@ -1,29 +1,24 @@
1
- import { DidCommMessageHandlerRegistry } from "./DidCommMessageHandlerRegistry.mjs";
1
+ import { DidCommEnvelopeService } from "./DidCommEnvelopeService.mjs";
2
2
  import { DidCommConnectionService } from "./modules/connections/services/DidCommConnectionService.mjs";
3
- import { DidCommOutOfBandService } from "./modules/oob/DidCommOutOfBandService.mjs";
3
+ import "./modules/connections/services/index.mjs";
4
+ import { DidCommMessageHandlerRegistry } from "./DidCommMessageHandlerRegistry.mjs";
4
5
  import { DidCommTransportService, DidCommTransportSession } from "./DidCommTransportService.mjs";
5
- import { DidCommEnvelopeRegistry } from "./envelope/DidCommEnvelopeRegistry.mjs";
6
- import "./envelope/index.mjs";
7
6
  import { DidCommMessageSender } from "./DidCommMessageSender.mjs";
8
- import { DidCommConnectionsModuleConfig } from "./modules/connections/DidCommConnectionsModuleConfig.mjs";
9
- import "./modules/connections/index.mjs";
10
7
  import { DidCommConnectionRecord } from "./modules/connections/repository/DidCommConnectionRecord.mjs";
11
8
  import "./modules/connections/repository/index.mjs";
12
9
  import { DidCommDispatcher } from "./DidCommDispatcher.mjs";
13
10
  import { AgentContextProvider, Logger } from "@credo-ts/core";
14
11
  //#region src/DidCommMessageReceiver.d.ts
15
12
  export declare class DidCommMessageReceiver {
16
- private envelopeRegistry;
13
+ private envelopeService;
17
14
  private transportService;
18
15
  private messageSender;
19
16
  private dispatcher;
20
17
  private logger;
21
18
  private connectionService;
22
- private outOfBandService;
23
- private connectionsModuleConfig;
24
19
  private messageHandlerRegistry;
25
20
  private agentContextProvider;
26
- constructor(envelopeRegistry: DidCommEnvelopeRegistry, transportService: DidCommTransportService, messageSender: DidCommMessageSender, connectionService: DidCommConnectionService, outOfBandService: DidCommOutOfBandService, connectionsModuleConfig: DidCommConnectionsModuleConfig, dispatcher: DidCommDispatcher, messageHandlerRegistry: DidCommMessageHandlerRegistry, agentContextProvider: AgentContextProvider, logger: Logger);
21
+ constructor(envelopeService: DidCommEnvelopeService, transportService: DidCommTransportService, messageSender: DidCommMessageSender, connectionService: DidCommConnectionService, dispatcher: DidCommDispatcher, messageHandlerRegistry: DidCommMessageHandlerRegistry, agentContextProvider: AgentContextProvider, logger: Logger);
27
22
  /**
28
23
  * Receive and handle an inbound DIDComm message. It will determine the agent context, decrypt the message, transform it
29
24
  * to it's corresponding message class and finally dispatch it to the dispatcher.
@@ -37,10 +32,9 @@ export declare class DidCommMessageReceiver {
37
32
  receivedAt?: Date;
38
33
  }): Promise<void>;
39
34
  private receivePlaintextMessage;
40
- private receiveSignedMessage;
41
35
  private receiveEncryptedMessage;
42
36
  /**
43
- * Decrypt a message with the envelope implementation resolved for its wire format.
37
+ * Decrypt a message using the envelope service.
44
38
  *
45
39
  * @param message the received inbound message to decrypt
46
40
  */
@@ -48,13 +42,7 @@ export declare class DidCommMessageReceiver {
48
42
  private isPlaintextMessage;
49
43
  private isEncryptedMessage;
50
44
  private transformAndValidate;
51
- private findConnection;
52
- /**
53
- * Generate a fresh per-pair peer DID for a v2 connection that was auto-created from a
54
- * reusable or implicit OOB invitation, and write `from_prior` rotation metadata so the
55
- * next outbound message announces the rotation.
56
- */
57
- private rotateInviterDidForV2OOB;
45
+ private findConnectionByMessageKeys;
58
46
  /**
59
47
  * Transform an plaintext DIDComm message into it's corresponding message class. Will look at all message types in the registered handlers.
60
48
  *
@@ -1 +1 @@
1
- {"version":3,"file":"DidCommMessageReceiver.d.mts","names":[],"sources":["../src/DidCommMessageReceiver.ts"],"mappings":";;;;;;;;;;;;;;qBA0Ca;UACH;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;EAGN,YAAA,kBAAkB,yBAClB,kBAAkB,yBAClB,eAAe,sBACf,mBAAmB,0BACnB,kBAAkB,yBAClB,yBAAyB,gCACzB,YAAY,mBACZ,wBAAwB,+BACuB,sBAAsB,sBACpC,QAAQ;;;;;;;EAoB9B,eACX,2BAEE,SACA,YACA,sBACA;IAEA,UAAU;IACV,aAAa;IACb;IACA,aAAa;MACT;UAyBM;UAWA;UAcA;;;;;;UAmFA;UAiBN;UAQA;UAKM;UAeA;;;;;;UAiIA;;;;;;UAsBA;;;;;;;UA6BA"}
1
+ {"version":3,"file":"DidCommMessageReceiver.d.mts","names":[],"sources":["../src/DidCommMessageReceiver.ts"],"mappings":";;;;;;;;;;;qBA4Ba;UACH;UACA;UACA;UACA;UACA;UACA;UACA;UACA;EAGN,YAAA,iBAAiB,wBACjB,kBAAkB,yBAClB,eAAe,sBACf,mBAAmB,0BACnB,YAAY,mBACZ,wBAAwB,+BACuB,sBAAsB,sBACpC,QAAQ;;;;;;;EAkB9B,eACX,2BAEE,SACA,YACA,sBACA;IAEA,UAAU;IACV,aAAa;IACb;IACA,aAAa;MACT;UAuBM;UAWA;;;;;;UA6DA;UAgBN;UAQA;UAKM;UAeA;;;;;;UAmBA;;;;;;;UA6BA"}