@nmshd/runtime 7.0.0-openid4vc.6 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/LICENSE +659 -3
  2. package/README.md +1 -1
  3. package/dist/Runtime.d.ts.map +1 -1
  4. package/dist/Runtime.js +0 -3
  5. package/dist/Runtime.js.map +1 -1
  6. package/dist/buildInformation.js +5 -5
  7. package/dist/dataViews/DataViewExpander.d.ts +5 -3
  8. package/dist/dataViews/DataViewExpander.d.ts.map +1 -1
  9. package/dist/dataViews/DataViewExpander.js +163 -174
  10. package/dist/dataViews/DataViewExpander.js.map +1 -1
  11. package/dist/dataViews/consumption/LocalAttributeDVO.d.ts +37 -46
  12. package/dist/dataViews/consumption/LocalAttributeDVO.d.ts.map +1 -1
  13. package/dist/dataViews/content/RequestItemDVOs.d.ts +1 -2
  14. package/dist/dataViews/content/RequestItemDVOs.d.ts.map +1 -1
  15. package/dist/dataViews/content/ResponseItemDVOs.d.ts +4 -10
  16. package/dist/dataViews/content/ResponseItemDVOs.d.ts.map +1 -1
  17. package/dist/events/EventProxy.d.ts.map +1 -1
  18. package/dist/events/EventProxy.js +10 -29
  19. package/dist/events/EventProxy.js.map +1 -1
  20. package/dist/events/consumption/AttributeForwardingDetailsChangedEvent.d.ts +7 -0
  21. package/dist/events/consumption/AttributeForwardingDetailsChangedEvent.d.ts.map +1 -0
  22. package/dist/events/consumption/AttributeForwardingDetailsChangedEvent.js +12 -0
  23. package/dist/events/consumption/AttributeForwardingDetailsChangedEvent.js.map +1 -0
  24. package/dist/events/consumption/AttributeSucceededEvent.d.ts +11 -0
  25. package/dist/events/consumption/AttributeSucceededEvent.d.ts.map +1 -0
  26. package/dist/events/consumption/AttributeSucceededEvent.js +12 -0
  27. package/dist/events/consumption/AttributeSucceededEvent.js.map +1 -0
  28. package/dist/events/consumption/ForwardedAttributeDeletedByPeerEvent.d.ts +7 -0
  29. package/dist/events/consumption/ForwardedAttributeDeletedByPeerEvent.d.ts.map +1 -0
  30. package/dist/events/consumption/ForwardedAttributeDeletedByPeerEvent.js +12 -0
  31. package/dist/events/consumption/ForwardedAttributeDeletedByPeerEvent.js.map +1 -0
  32. package/dist/events/consumption/OwnAttributeDeletedByOwnerEvent.d.ts +7 -0
  33. package/dist/events/consumption/OwnAttributeDeletedByOwnerEvent.d.ts.map +1 -0
  34. package/dist/events/consumption/OwnAttributeDeletedByOwnerEvent.js +12 -0
  35. package/dist/events/consumption/OwnAttributeDeletedByOwnerEvent.js.map +1 -0
  36. package/dist/events/consumption/PeerRelationshipAttributeDeletedByPeerEvent.d.ts +7 -0
  37. package/dist/events/consumption/PeerRelationshipAttributeDeletedByPeerEvent.d.ts.map +1 -0
  38. package/dist/events/consumption/PeerRelationshipAttributeDeletedByPeerEvent.js +12 -0
  39. package/dist/events/consumption/PeerRelationshipAttributeDeletedByPeerEvent.js.map +1 -0
  40. package/dist/events/consumption/index.d.ts +5 -9
  41. package/dist/events/consumption/index.d.ts.map +1 -1
  42. package/dist/events/consumption/index.js +5 -9
  43. package/dist/events/consumption/index.js.map +1 -1
  44. package/dist/extensibility/ConsumptionServices.d.ts +2 -3
  45. package/dist/extensibility/ConsumptionServices.d.ts.map +1 -1
  46. package/dist/extensibility/ConsumptionServices.js +2 -5
  47. package/dist/extensibility/ConsumptionServices.js.map +1 -1
  48. package/dist/extensibility/facades/consumption/AttributesFacade.d.ts +27 -31
  49. package/dist/extensibility/facades/consumption/AttributesFacade.d.ts.map +1 -1
  50. package/dist/extensibility/facades/consumption/AttributesFacade.js +51 -63
  51. package/dist/extensibility/facades/consumption/AttributesFacade.js.map +1 -1
  52. package/dist/extensibility/facades/consumption/index.d.ts +0 -1
  53. package/dist/extensibility/facades/consumption/index.d.ts.map +1 -1
  54. package/dist/extensibility/facades/consumption/index.js +0 -1
  55. package/dist/extensibility/facades/consumption/index.js.map +1 -1
  56. package/dist/useCases/common/RuntimeErrors.d.ts +8 -11
  57. package/dist/useCases/common/RuntimeErrors.d.ts.map +1 -1
  58. package/dist/useCases/common/RuntimeErrors.js +16 -25
  59. package/dist/useCases/common/RuntimeErrors.js.map +1 -1
  60. package/dist/useCases/common/Schemas.d.ts +13 -38
  61. package/dist/useCases/common/Schemas.d.ts.map +1 -1
  62. package/dist/useCases/common/Schemas.js +9981 -13789
  63. package/dist/useCases/common/Schemas.js.map +1 -1
  64. package/dist/useCases/consumption/attributes/AttributeMapper.d.ts +3 -2
  65. package/dist/useCases/consumption/attributes/AttributeMapper.d.ts.map +1 -1
  66. package/dist/useCases/consumption/attributes/AttributeMapper.js +27 -5
  67. package/dist/useCases/consumption/attributes/AttributeMapper.js.map +1 -1
  68. package/dist/useCases/consumption/attributes/CanCreateOwnIdentityAttribute.d.ts +37 -0
  69. package/dist/useCases/consumption/attributes/CanCreateOwnIdentityAttribute.d.ts.map +1 -0
  70. package/dist/useCases/consumption/attributes/{CanCreateRepositoryAttribute.js → CanCreateOwnIdentityAttribute.js} +20 -10
  71. package/dist/useCases/consumption/attributes/CanCreateOwnIdentityAttribute.js.map +1 -0
  72. package/dist/useCases/consumption/attributes/{ChangeDefaultRepositoryAttribute.d.ts → ChangeDefaultOwnIdentityAttribute.d.ts} +5 -5
  73. package/dist/useCases/consumption/attributes/ChangeDefaultOwnIdentityAttribute.d.ts.map +1 -0
  74. package/dist/useCases/consumption/attributes/{ChangeDefaultRepositoryAttribute.js → ChangeDefaultOwnIdentityAttribute.js} +13 -13
  75. package/dist/useCases/consumption/attributes/ChangeDefaultOwnIdentityAttribute.js.map +1 -0
  76. package/dist/useCases/consumption/attributes/CreateOwnIdentityAttribute.d.ts +30 -0
  77. package/dist/useCases/consumption/attributes/CreateOwnIdentityAttribute.d.ts.map +1 -0
  78. package/dist/useCases/consumption/attributes/{CreateRepositoryAttribute.js → CreateOwnIdentityAttribute.js} +15 -16
  79. package/dist/useCases/consumption/attributes/CreateOwnIdentityAttribute.js.map +1 -0
  80. package/dist/useCases/consumption/attributes/DeleteAttributeAndNotify.d.ts +33 -0
  81. package/dist/useCases/consumption/attributes/DeleteAttributeAndNotify.d.ts.map +1 -0
  82. package/dist/useCases/consumption/attributes/DeleteAttributeAndNotify.js +198 -0
  83. package/dist/useCases/consumption/attributes/DeleteAttributeAndNotify.js.map +1 -0
  84. package/dist/useCases/consumption/attributes/DeleteSharedAttributesForRejectedOrRevokedRelationship.d.ts.map +1 -1
  85. package/dist/useCases/consumption/attributes/DeleteSharedAttributesForRejectedOrRevokedRelationship.js +8 -2
  86. package/dist/useCases/consumption/attributes/DeleteSharedAttributesForRejectedOrRevokedRelationship.js.map +1 -1
  87. package/dist/useCases/consumption/attributes/GetAttributes.d.ts +5 -8
  88. package/dist/useCases/consumption/attributes/GetAttributes.d.ts.map +1 -1
  89. package/dist/useCases/consumption/attributes/GetAttributes.js +9 -18
  90. package/dist/useCases/consumption/attributes/GetAttributes.js.map +1 -1
  91. package/dist/useCases/consumption/attributes/GetForwardingDetailsForAttribute.d.ts +28 -0
  92. package/dist/useCases/consumption/attributes/GetForwardingDetailsForAttribute.d.ts.map +1 -0
  93. package/dist/useCases/consumption/attributes/GetForwardingDetailsForAttribute.js +77 -0
  94. package/dist/useCases/consumption/attributes/GetForwardingDetailsForAttribute.js.map +1 -0
  95. package/dist/useCases/consumption/attributes/{GetPeerSharedAttributes.d.ts → GetOwnAttributesSharedWithPeer.d.ts} +10 -11
  96. package/dist/useCases/consumption/attributes/GetOwnAttributesSharedWithPeer.d.ts.map +1 -0
  97. package/dist/useCases/consumption/attributes/{GetOwnSharedAttributes.js → GetOwnAttributesSharedWithPeer.js} +11 -18
  98. package/dist/useCases/consumption/attributes/GetOwnAttributesSharedWithPeer.js.map +1 -0
  99. package/dist/useCases/consumption/attributes/{GetRepositoryAttributes.d.ts → GetOwnIdentityAttributes.d.ts} +9 -9
  100. package/dist/useCases/consumption/attributes/GetOwnIdentityAttributes.d.ts.map +1 -0
  101. package/dist/useCases/consumption/attributes/{GetRepositoryAttributes.js → GetOwnIdentityAttributes.js} +8 -8
  102. package/dist/useCases/consumption/attributes/GetOwnIdentityAttributes.js.map +1 -0
  103. package/dist/useCases/consumption/attributes/GetPeerAttributes.d.ts +39 -0
  104. package/dist/useCases/consumption/attributes/GetPeerAttributes.d.ts.map +1 -0
  105. package/dist/useCases/consumption/attributes/{GetPeerSharedAttributes.js → GetPeerAttributes.js} +10 -10
  106. package/dist/useCases/consumption/attributes/GetPeerAttributes.js.map +1 -0
  107. package/dist/useCases/consumption/attributes/GetVersionsOfAttribute.js +1 -1
  108. package/dist/useCases/consumption/attributes/GetVersionsOfAttribute.js.map +1 -1
  109. package/dist/useCases/consumption/attributes/GetVersionsOfAttributeSharedWithPeer.d.ts +22 -0
  110. package/dist/useCases/consumption/attributes/GetVersionsOfAttributeSharedWithPeer.d.ts.map +1 -0
  111. package/dist/useCases/consumption/attributes/{GetSharedVersionsOfAttribute.js → GetVersionsOfAttributeSharedWithPeer.js} +14 -20
  112. package/dist/useCases/consumption/attributes/GetVersionsOfAttributeSharedWithPeer.js.map +1 -0
  113. package/dist/useCases/consumption/attributes/{NotifyPeerAboutRepositoryAttributeSuccession.d.ts → NotifyPeerAboutOwnIdentityAttributeSuccession.d.ts} +9 -9
  114. package/dist/useCases/consumption/attributes/NotifyPeerAboutOwnIdentityAttributeSuccession.d.ts.map +1 -0
  115. package/dist/useCases/consumption/attributes/NotifyPeerAboutOwnIdentityAttributeSuccession.js +95 -0
  116. package/dist/useCases/consumption/attributes/NotifyPeerAboutOwnIdentityAttributeSuccession.js.map +1 -0
  117. package/dist/useCases/consumption/attributes/{ShareRepositoryAttribute.d.ts → ShareOwnIdentityAttribute.d.ts} +5 -5
  118. package/dist/useCases/consumption/attributes/ShareOwnIdentityAttribute.d.ts.map +1 -0
  119. package/dist/useCases/consumption/attributes/{ShareRepositoryAttribute.js → ShareOwnIdentityAttribute.js} +14 -15
  120. package/dist/useCases/consumption/attributes/ShareOwnIdentityAttribute.js.map +1 -0
  121. package/dist/useCases/consumption/attributes/{SucceedRepositoryAttribute.d.ts → SucceedOwnIdentityAttribute.d.ts} +6 -6
  122. package/dist/useCases/consumption/attributes/SucceedOwnIdentityAttribute.d.ts.map +1 -0
  123. package/dist/useCases/consumption/attributes/{SucceedRepositoryAttribute.js → SucceedOwnIdentityAttribute.js} +13 -14
  124. package/dist/useCases/consumption/attributes/SucceedOwnIdentityAttribute.js.map +1 -0
  125. package/dist/useCases/consumption/attributes/SucceedRelationshipAttributeAndNotifyPeer.d.ts.map +1 -1
  126. package/dist/useCases/consumption/attributes/SucceedRelationshipAttributeAndNotifyPeer.js +13 -16
  127. package/dist/useCases/consumption/attributes/SucceedRelationshipAttributeAndNotifyPeer.js.map +1 -1
  128. package/dist/useCases/consumption/attributes/index.d.ts +12 -14
  129. package/dist/useCases/consumption/attributes/index.d.ts.map +1 -1
  130. package/dist/useCases/consumption/attributes/index.js +12 -14
  131. package/dist/useCases/consumption/attributes/index.js.map +1 -1
  132. package/dist/useCases/consumption/index.d.ts +0 -1
  133. package/dist/useCases/consumption/index.d.ts.map +1 -1
  134. package/dist/useCases/consumption/index.js +0 -1
  135. package/dist/useCases/consumption/index.js.map +1 -1
  136. package/dist/useCases/transport/relationships/GetAttributesForRelationship.d.ts.map +1 -1
  137. package/dist/useCases/transport/relationships/GetAttributesForRelationship.js +1 -8
  138. package/dist/useCases/transport/relationships/GetAttributesForRelationship.js.map +1 -1
  139. package/package.json +8 -11
  140. package/dist/events/consumption/OwnSharedAttributeDeletedByOwnerEvent.d.ts +0 -7
  141. package/dist/events/consumption/OwnSharedAttributeDeletedByOwnerEvent.d.ts.map +0 -1
  142. package/dist/events/consumption/OwnSharedAttributeDeletedByOwnerEvent.js +0 -12
  143. package/dist/events/consumption/OwnSharedAttributeDeletedByOwnerEvent.js.map +0 -1
  144. package/dist/events/consumption/OwnSharedAttributeSucceededEvent.d.ts +0 -7
  145. package/dist/events/consumption/OwnSharedAttributeSucceededEvent.d.ts.map +0 -1
  146. package/dist/events/consumption/OwnSharedAttributeSucceededEvent.js +0 -12
  147. package/dist/events/consumption/OwnSharedAttributeSucceededEvent.js.map +0 -1
  148. package/dist/events/consumption/PeerSharedAttributeDeletedByPeerEvent.d.ts +0 -7
  149. package/dist/events/consumption/PeerSharedAttributeDeletedByPeerEvent.d.ts.map +0 -1
  150. package/dist/events/consumption/PeerSharedAttributeDeletedByPeerEvent.js +0 -12
  151. package/dist/events/consumption/PeerSharedAttributeDeletedByPeerEvent.js.map +0 -1
  152. package/dist/events/consumption/PeerSharedAttributeSucceededEvent.d.ts +0 -7
  153. package/dist/events/consumption/PeerSharedAttributeSucceededEvent.d.ts.map +0 -1
  154. package/dist/events/consumption/PeerSharedAttributeSucceededEvent.js +0 -12
  155. package/dist/events/consumption/PeerSharedAttributeSucceededEvent.js.map +0 -1
  156. package/dist/events/consumption/RepositoryAttributeSucceededEvent.d.ts +0 -7
  157. package/dist/events/consumption/RepositoryAttributeSucceededEvent.d.ts.map +0 -1
  158. package/dist/events/consumption/RepositoryAttributeSucceededEvent.js +0 -12
  159. package/dist/events/consumption/RepositoryAttributeSucceededEvent.js.map +0 -1
  160. package/dist/events/consumption/SuccessionEventData.d.ts +0 -6
  161. package/dist/events/consumption/SuccessionEventData.d.ts.map +0 -1
  162. package/dist/events/consumption/SuccessionEventData.js +0 -3
  163. package/dist/events/consumption/SuccessionEventData.js.map +0 -1
  164. package/dist/events/consumption/ThirdPartyOwnedRelationshipAttributeSucceededEvent.d.ts +0 -7
  165. package/dist/events/consumption/ThirdPartyOwnedRelationshipAttributeSucceededEvent.d.ts.map +0 -1
  166. package/dist/events/consumption/ThirdPartyOwnedRelationshipAttributeSucceededEvent.js +0 -12
  167. package/dist/events/consumption/ThirdPartyOwnedRelationshipAttributeSucceededEvent.js.map +0 -1
  168. package/dist/events/consumption/ThirdPartyRelationshipAttributeDeletedByPeerEvent.d.ts +0 -7
  169. package/dist/events/consumption/ThirdPartyRelationshipAttributeDeletedByPeerEvent.d.ts.map +0 -1
  170. package/dist/events/consumption/ThirdPartyRelationshipAttributeDeletedByPeerEvent.js +0 -12
  171. package/dist/events/consumption/ThirdPartyRelationshipAttributeDeletedByPeerEvent.js.map +0 -1
  172. package/dist/events/consumption/ThirdPartyRelationshipAttributeSucceededEvent.d.ts +0 -7
  173. package/dist/events/consumption/ThirdPartyRelationshipAttributeSucceededEvent.d.ts.map +0 -1
  174. package/dist/events/consumption/ThirdPartyRelationshipAttributeSucceededEvent.js +0 -12
  175. package/dist/events/consumption/ThirdPartyRelationshipAttributeSucceededEvent.js.map +0 -1
  176. package/dist/extensibility/facades/consumption/OpenId4VcFacade.d.ts +0 -20
  177. package/dist/extensibility/facades/consumption/OpenId4VcFacade.d.ts.map +0 -1
  178. package/dist/extensibility/facades/consumption/OpenId4VcFacade.js +0 -64
  179. package/dist/extensibility/facades/consumption/OpenId4VcFacade.js.map +0 -1
  180. package/dist/useCases/consumption/attributes/CanCreateRepositoryAttribute.d.ts +0 -37
  181. package/dist/useCases/consumption/attributes/CanCreateRepositoryAttribute.d.ts.map +0 -1
  182. package/dist/useCases/consumption/attributes/CanCreateRepositoryAttribute.js.map +0 -1
  183. package/dist/useCases/consumption/attributes/ChangeDefaultRepositoryAttribute.d.ts.map +0 -1
  184. package/dist/useCases/consumption/attributes/ChangeDefaultRepositoryAttribute.js.map +0 -1
  185. package/dist/useCases/consumption/attributes/CreateRepositoryAttribute.d.ts +0 -30
  186. package/dist/useCases/consumption/attributes/CreateRepositoryAttribute.d.ts.map +0 -1
  187. package/dist/useCases/consumption/attributes/CreateRepositoryAttribute.js.map +0 -1
  188. package/dist/useCases/consumption/attributes/DeleteOwnSharedAttributeAndNotifyPeer.d.ts +0 -23
  189. package/dist/useCases/consumption/attributes/DeleteOwnSharedAttributeAndNotifyPeer.d.ts.map +0 -1
  190. package/dist/useCases/consumption/attributes/DeleteOwnSharedAttributeAndNotifyPeer.js +0 -89
  191. package/dist/useCases/consumption/attributes/DeleteOwnSharedAttributeAndNotifyPeer.js.map +0 -1
  192. package/dist/useCases/consumption/attributes/DeletePeerSharedAttributeAndNotifyOwner.d.ts +0 -23
  193. package/dist/useCases/consumption/attributes/DeletePeerSharedAttributeAndNotifyOwner.d.ts.map +0 -1
  194. package/dist/useCases/consumption/attributes/DeletePeerSharedAttributeAndNotifyOwner.js +0 -90
  195. package/dist/useCases/consumption/attributes/DeletePeerSharedAttributeAndNotifyOwner.js.map +0 -1
  196. package/dist/useCases/consumption/attributes/DeleteRepositoryAttribute.d.ts +0 -18
  197. package/dist/useCases/consumption/attributes/DeleteRepositoryAttribute.d.ts.map +0 -1
  198. package/dist/useCases/consumption/attributes/DeleteRepositoryAttribute.js +0 -65
  199. package/dist/useCases/consumption/attributes/DeleteRepositoryAttribute.js.map +0 -1
  200. package/dist/useCases/consumption/attributes/DeleteThirdPartyRelationshipAttributeAndNotifyPeer.d.ts +0 -23
  201. package/dist/useCases/consumption/attributes/DeleteThirdPartyRelationshipAttributeAndNotifyPeer.d.ts.map +0 -1
  202. package/dist/useCases/consumption/attributes/DeleteThirdPartyRelationshipAttributeAndNotifyPeer.js +0 -88
  203. package/dist/useCases/consumption/attributes/DeleteThirdPartyRelationshipAttributeAndNotifyPeer.js.map +0 -1
  204. package/dist/useCases/consumption/attributes/GetOwnSharedAttributes.d.ts +0 -43
  205. package/dist/useCases/consumption/attributes/GetOwnSharedAttributes.d.ts.map +0 -1
  206. package/dist/useCases/consumption/attributes/GetOwnSharedAttributes.js.map +0 -1
  207. package/dist/useCases/consumption/attributes/GetPeerSharedAttributes.d.ts.map +0 -1
  208. package/dist/useCases/consumption/attributes/GetPeerSharedAttributes.js.map +0 -1
  209. package/dist/useCases/consumption/attributes/GetRepositoryAttributes.d.ts.map +0 -1
  210. package/dist/useCases/consumption/attributes/GetRepositoryAttributes.js.map +0 -1
  211. package/dist/useCases/consumption/attributes/GetSharedVersionsOfAttribute.d.ts +0 -24
  212. package/dist/useCases/consumption/attributes/GetSharedVersionsOfAttribute.d.ts.map +0 -1
  213. package/dist/useCases/consumption/attributes/GetSharedVersionsOfAttribute.js.map +0 -1
  214. package/dist/useCases/consumption/attributes/NotifyPeerAboutRepositoryAttributeSuccession.d.ts.map +0 -1
  215. package/dist/useCases/consumption/attributes/NotifyPeerAboutRepositoryAttributeSuccession.js +0 -105
  216. package/dist/useCases/consumption/attributes/NotifyPeerAboutRepositoryAttributeSuccession.js.map +0 -1
  217. package/dist/useCases/consumption/attributes/ShareRepositoryAttribute.d.ts.map +0 -1
  218. package/dist/useCases/consumption/attributes/ShareRepositoryAttribute.js.map +0 -1
  219. package/dist/useCases/consumption/attributes/SucceedRepositoryAttribute.d.ts.map +0 -1
  220. package/dist/useCases/consumption/attributes/SucceedRepositoryAttribute.js.map +0 -1
  221. package/dist/useCases/consumption/openid4vc/AcceptProofRequestUseCase.d.ts +0 -17
  222. package/dist/useCases/consumption/openid4vc/AcceptProofRequestUseCase.d.ts.map +0 -1
  223. package/dist/useCases/consumption/openid4vc/AcceptProofRequestUseCase.js +0 -46
  224. package/dist/useCases/consumption/openid4vc/AcceptProofRequestUseCase.js.map +0 -1
  225. package/dist/useCases/consumption/openid4vc/FetchCredentialOfferUseCase.d.ts +0 -17
  226. package/dist/useCases/consumption/openid4vc/FetchCredentialOfferUseCase.d.ts.map +0 -1
  227. package/dist/useCases/consumption/openid4vc/FetchCredentialOfferUseCase.js +0 -46
  228. package/dist/useCases/consumption/openid4vc/FetchCredentialOfferUseCase.js.map +0 -1
  229. package/dist/useCases/consumption/openid4vc/FetchProofRequestUseCase.d.ts +0 -17
  230. package/dist/useCases/consumption/openid4vc/FetchProofRequestUseCase.d.ts.map +0 -1
  231. package/dist/useCases/consumption/openid4vc/FetchProofRequestUseCase.js +0 -46
  232. package/dist/useCases/consumption/openid4vc/FetchProofRequestUseCase.js.map +0 -1
  233. package/dist/useCases/consumption/openid4vc/GetVerifiableCredentialsUseCase.d.ts +0 -17
  234. package/dist/useCases/consumption/openid4vc/GetVerifiableCredentialsUseCase.d.ts.map +0 -1
  235. package/dist/useCases/consumption/openid4vc/GetVerifiableCredentialsUseCase.js +0 -48
  236. package/dist/useCases/consumption/openid4vc/GetVerifiableCredentialsUseCase.js.map +0 -1
  237. package/dist/useCases/consumption/openid4vc/ResolveCredentialOfferUseCase.d.ts +0 -17
  238. package/dist/useCases/consumption/openid4vc/ResolveCredentialOfferUseCase.d.ts.map +0 -1
  239. package/dist/useCases/consumption/openid4vc/ResolveCredentialOfferUseCase.js +0 -46
  240. package/dist/useCases/consumption/openid4vc/ResolveCredentialOfferUseCase.js.map +0 -1
  241. package/dist/useCases/consumption/openid4vc/ResolveFetchedCredentialUseCase.d.ts +0 -19
  242. package/dist/useCases/consumption/openid4vc/ResolveFetchedCredentialUseCase.d.ts.map +0 -1
  243. package/dist/useCases/consumption/openid4vc/ResolveFetchedCredentialUseCase.js +0 -51
  244. package/dist/useCases/consumption/openid4vc/ResolveFetchedCredentialUseCase.js.map +0 -1
  245. package/dist/useCases/consumption/openid4vc/index.d.ts +0 -6
  246. package/dist/useCases/consumption/openid4vc/index.d.ts.map +0 -1
  247. package/dist/useCases/consumption/openid4vc/index.js +0 -22
  248. package/dist/useCases/consumption/openid4vc/index.js.map +0 -1
@@ -1,7 +1,8 @@
1
- import { LocalAttribute } from "@nmshd/consumption";
2
- import { LocalAttributeDTO } from "@nmshd/runtime-types";
1
+ import { AttributeForwardingDetails, LocalAttribute } from "@nmshd/consumption";
2
+ import { LocalAttributeDTO, LocalAttributeForwardingDetailsDTO } from "@nmshd/runtime-types";
3
3
  export declare class AttributeMapper {
4
4
  static toAttributeDTO(attribute: LocalAttribute): LocalAttributeDTO;
5
5
  static toAttributeDTOList(attributes: LocalAttribute[]): LocalAttributeDTO[];
6
+ static toForwardingDetailsDTO(forwardingDetails: AttributeForwardingDetails): LocalAttributeForwardingDetailsDTO;
6
7
  }
7
8
  //# sourceMappingURL=AttributeMapper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeMapper.d.ts","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/AttributeMapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA+D,MAAM,oBAAoB,CAAC;AACjH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,qBAAa,eAAe;WACV,cAAc,CAAC,SAAS,EAAE,cAAc,GAAG,iBAAiB;WAe5D,kBAAkB,CAAC,UAAU,EAAE,cAAc,EAAE,GAAG,iBAAiB,EAAE;CAGtF"}
1
+ {"version":3,"file":"AttributeMapper.d.ts","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/AttributeMapper.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,0BAA0B,EAC1B,cAAc,EAMjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,kCAAkC,EAAE,MAAM,sBAAsB,CAAC;AAE7F,qBAAa,eAAe;WACV,cAAc,CAAC,SAAS,EAAE,cAAc,GAAG,iBAAiB;WA8B5D,kBAAkB,CAAC,UAAU,EAAE,cAAc,EAAE,GAAG,iBAAiB,EAAE;WAIrE,sBAAsB,CAAC,iBAAiB,EAAE,0BAA0B,GAAG,kCAAkC;CAU1H"}
@@ -1,24 +1,46 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AttributeMapper = void 0;
4
+ const consumption_1 = require("@nmshd/consumption");
4
5
  class AttributeMapper {
5
6
  static toAttributeDTO(attribute) {
7
+ const attributeIsShared = attribute instanceof consumption_1.OwnRelationshipAttribute ||
8
+ attribute instanceof consumption_1.PeerRelationshipAttribute ||
9
+ attribute instanceof consumption_1.PeerIdentityAttribute ||
10
+ attribute instanceof consumption_1.ThirdPartyRelationshipAttribute;
6
11
  return {
12
+ "@type": attribute.constructor.name,
7
13
  id: attribute.id.toString(),
8
- parentId: attribute.parentId?.toString(),
9
14
  content: attribute.content.toJSON(),
10
15
  createdAt: attribute.createdAt.toString(),
11
16
  succeeds: attribute.succeeds?.toString(),
12
17
  succeededBy: attribute.succeededBy?.toString(),
13
- shareInfo: attribute.shareInfo?.toJSON(),
14
- deletionInfo: attribute.deletionInfo?.toJSON(),
15
- isDefault: attribute.isDefault,
16
- wasViewedAt: attribute.wasViewedAt?.toString()
18
+ wasViewedAt: attribute.wasViewedAt?.toString(),
19
+ isDefault: attribute instanceof consumption_1.OwnIdentityAttribute ? attribute.isDefault : undefined,
20
+ peer: attributeIsShared ? attribute.peer.toString() : undefined,
21
+ sourceReference: attributeIsShared ? attribute.sourceReference.toString() : undefined,
22
+ deletionInfo: attributeIsShared && attribute.deletionInfo
23
+ ? { deletionStatus: attribute.deletionInfo.deletionStatus, deletionDate: attribute.deletionInfo.deletionDate.toString() }
24
+ : undefined,
25
+ initialAttributePeer: attribute instanceof consumption_1.ThirdPartyRelationshipAttribute ? attribute.initialAttributePeer.toString() : undefined,
26
+ numberOfForwards: attribute instanceof consumption_1.OwnIdentityAttribute || attribute instanceof consumption_1.OwnRelationshipAttribute || attribute instanceof consumption_1.PeerRelationshipAttribute
27
+ ? attribute.numberOfForwards
28
+ : undefined
17
29
  };
18
30
  }
19
31
  static toAttributeDTOList(attributes) {
20
32
  return attributes.map((attribute) => this.toAttributeDTO(attribute));
21
33
  }
34
+ static toForwardingDetailsDTO(forwardingDetails) {
35
+ return {
36
+ peer: forwardingDetails.peer.toString(),
37
+ sourceReference: forwardingDetails.sourceReference.toString(),
38
+ sharedAt: forwardingDetails.sharedAt.toString(),
39
+ deletionInfo: forwardingDetails.deletionInfo
40
+ ? { deletionStatus: forwardingDetails.deletionInfo.deletionStatus, deletionDate: forwardingDetails.deletionInfo.deletionDate.toString() }
41
+ : undefined
42
+ };
43
+ }
22
44
  }
23
45
  exports.AttributeMapper = AttributeMapper;
24
46
  //# sourceMappingURL=AttributeMapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeMapper.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/AttributeMapper.ts"],"names":[],"mappings":";;;AAGA,MAAa,eAAe;IACjB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SAAS,CAAC,CAAC,CAAC;IACzE,CAAC;IAEM,MAAM,CAAC,sBAAsB,CAAC,iBAA6C;QAC9E,OAAO;YACH,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,QAAQ,EAAE;YACvC,eAAe,EAAE,iBAAiB,CAAC,eAAe,CAAC,QAAQ,EAAE;YAC7D,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,EAAE;YAC/C,YAAY,EAAE,iBAAiB,CAAC,YAAY;gBACxC,CAAC,CAAC,EAAE,cAAc,EAAE,iBAAiB,CAAC,YAAY,CAAC,cAAc,EAAE,YAAY,EAAE,iBAAiB,CAAC,YAAY,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE;gBACzI,CAAC,CAAC,SAAS;SAClB,CAAC;IACN,CAAC;CACJ;AA7CD,0CA6CC"}
@@ -0,0 +1,37 @@
1
+ import { Result } from "@js-soft/ts-utils";
2
+ import { AttributesController } from "@nmshd/consumption";
3
+ import { AttributeValues } from "@nmshd/content";
4
+ import { AccountController } from "@nmshd/transport";
5
+ import { SchemaRepository, UseCase, ValidationResult } from "../../common";
6
+ import { IValidator } from "../../common/validation/IValidator";
7
+ interface AbstractCanCreateOwnIdentityAttributeRequest<T> {
8
+ content: {
9
+ value: T;
10
+ tags?: string[];
11
+ };
12
+ }
13
+ export interface CanCreateOwnIdentityAttributeRequest extends AbstractCanCreateOwnIdentityAttributeRequest<AttributeValues.Identity.Json> {
14
+ }
15
+ export interface SchemaValidatableCanCreateOwnIdentityAttributeRequest extends AbstractCanCreateOwnIdentityAttributeRequest<unknown> {
16
+ }
17
+ declare class Validator implements IValidator<CanCreateOwnIdentityAttributeRequest> {
18
+ private readonly schemaRepository;
19
+ constructor(schemaRepository: SchemaRepository);
20
+ validate(request: CanCreateOwnIdentityAttributeRequest): ValidationResult;
21
+ }
22
+ export type CanCreateOwnIdentityAttributeResponse = {
23
+ isSuccess: true;
24
+ } | {
25
+ isSuccess: false;
26
+ code: string;
27
+ message: string;
28
+ };
29
+ export declare class CanCreateOwnIdentityAttributeUseCase extends UseCase<CanCreateOwnIdentityAttributeRequest, CanCreateOwnIdentityAttributeResponse> {
30
+ private readonly attributesController;
31
+ private readonly accountController;
32
+ private readonly schemaRepository;
33
+ constructor(attributesController: AttributesController, accountController: AccountController, schemaRepository: SchemaRepository, validator: Validator);
34
+ protected executeInternal(request: CanCreateOwnIdentityAttributeRequest): Promise<Result<CanCreateOwnIdentityAttributeResponse>>;
35
+ }
36
+ export {};
37
+ //# sourceMappingURL=CanCreateOwnIdentityAttribute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanCreateOwnIdentityAttribute.d.ts","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/CanCreateOwnIdentityAttribute.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAqB,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAiB,gBAAgB,EAAmB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC3G,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAGhE,UAAU,4CAA4C,CAAC,CAAC;IACpD,OAAO,EAAE;QACL,KAAK,EAAE,CAAC,CAAC;QACT,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;CACL;AAED,MAAM,WAAW,oCAAqC,SAAQ,4CAA4C,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC;CAAG;AAE5I,MAAM,WAAW,qDAAsD,SAAQ,4CAA4C,CAAC,OAAO,CAAC;CAAG;AAEvI,cAAM,SAAU,YAAW,UAAU,CAAC,oCAAoC,CAAC;IAC5C,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,gBAAgB;IAEvE,QAAQ,CAAC,OAAO,EAAE,oCAAoC,GAAG,gBAAgB;CAInF;AAED,MAAM,MAAM,qCAAqC,GAC3C;IAAE,SAAS,EAAE,IAAI,CAAA;CAAE,GACnB;IACI,SAAS,EAAE,KAAK,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAER,qBAAa,oCAAqC,SAAQ,OAAO,CAAC,oCAAoC,EAAE,qCAAqC,CAAC;IAE9H,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAFhB,oBAAoB,EAAE,oBAAoB,EAC1C,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,EAAE,gBAAgB,EACnD,SAAS,EAAE,SAAS;cAKhB,eAAe,CAAC,OAAO,EAAE,oCAAoC,GAAG,OAAO,CAAC,MAAM,CAAC,qCAAqC,CAAC,CAAC;CA6BzI"}
@@ -12,9 +12,11 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  return function (target, key) { decorator(target, key, paramIndex); }
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.CanCreateRepositoryAttributeUseCase = void 0;
15
+ exports.CanCreateOwnIdentityAttributeUseCase = void 0;
16
+ const ts_serval_1 = require("@js-soft/ts-serval");
16
17
  const ts_utils_1 = require("@js-soft/ts-utils");
17
18
  const consumption_1 = require("@nmshd/consumption");
19
+ const content_1 = require("@nmshd/content");
18
20
  const transport_1 = require("@nmshd/transport");
19
21
  const typescript_ioc_1 = require("@nmshd/typescript-ioc");
20
22
  const common_1 = require("../../common");
@@ -24,7 +26,7 @@ let Validator = class Validator {
24
26
  this.schemaRepository = schemaRepository;
25
27
  }
26
28
  validate(request) {
27
- const requestSchemaValidator = new common_1.SchemaValidator(this.schemaRepository.getSchema("CanCreateRepositoryAttributeRequest"));
29
+ const requestSchemaValidator = new common_1.SchemaValidator(this.schemaRepository.getSchema("CanCreateOwnIdentityAttributeRequest"));
28
30
  return requestSchemaValidator.validate(request);
29
31
  }
30
32
  };
@@ -32,7 +34,7 @@ Validator = __decorate([
32
34
  __param(0, typescript_ioc_1.Inject),
33
35
  __metadata("design:paramtypes", [common_1.SchemaRepository])
34
36
  ], Validator);
35
- let CanCreateRepositoryAttributeUseCase = class CanCreateRepositoryAttributeUseCase extends common_1.UseCase {
37
+ let CanCreateOwnIdentityAttributeUseCase = class CanCreateOwnIdentityAttributeUseCase extends common_1.UseCase {
36
38
  constructor(attributesController, accountController, schemaRepository, validator) {
37
39
  super(validator);
38
40
  this.attributesController = attributesController;
@@ -46,9 +48,17 @@ let CanCreateRepositoryAttributeUseCase = class CanCreateRepositoryAttributeUseC
46
48
  const failures = attributeValueValidationResult.getFailures();
47
49
  return ts_utils_1.Result.ok({ isSuccess: false, code: failures[0].error.code, message: failures[0].error.message });
48
50
  }
49
- const repositoryAttributeDuplicate = await this.attributesController.getRepositoryAttributeWithSameValue(request.content.value);
50
- if (repositoryAttributeDuplicate) {
51
- const error = common_1.RuntimeErrors.attributes.cannotCreateDuplicateRepositoryAttribute(repositoryAttributeDuplicate.id);
51
+ try {
52
+ content_1.IdentityAttribute.from({ owner: "", value: request.content.value, tags: request.content.tags });
53
+ }
54
+ catch (e) {
55
+ if (!(e instanceof ts_serval_1.ServalError))
56
+ throw e;
57
+ return ts_utils_1.Result.ok({ isSuccess: false, code: "error.runtime.validation.invalidPropertyValue", message: e.message });
58
+ }
59
+ const ownIdentityAttributeDuplicate = await this.attributesController.getOwnIdentityAttributeWithSameValue(request.content.value);
60
+ if (ownIdentityAttributeDuplicate) {
61
+ const error = common_1.RuntimeErrors.attributes.cannotCreateDuplicateOwnIdentityAttribute(ownIdentityAttributeDuplicate.id);
52
62
  return ts_utils_1.Result.ok({ isSuccess: false, code: error.code, message: error.message });
53
63
  }
54
64
  if (request.content.tags && request.content.tags.length > 0) {
@@ -59,8 +69,8 @@ let CanCreateRepositoryAttributeUseCase = class CanCreateRepositoryAttributeUseC
59
69
  return ts_utils_1.Result.ok({ isSuccess: true });
60
70
  }
61
71
  };
62
- exports.CanCreateRepositoryAttributeUseCase = CanCreateRepositoryAttributeUseCase;
63
- exports.CanCreateRepositoryAttributeUseCase = CanCreateRepositoryAttributeUseCase = __decorate([
72
+ exports.CanCreateOwnIdentityAttributeUseCase = CanCreateOwnIdentityAttributeUseCase;
73
+ exports.CanCreateOwnIdentityAttributeUseCase = CanCreateOwnIdentityAttributeUseCase = __decorate([
64
74
  __param(0, typescript_ioc_1.Inject),
65
75
  __param(1, typescript_ioc_1.Inject),
66
76
  __param(2, typescript_ioc_1.Inject),
@@ -69,5 +79,5 @@ exports.CanCreateRepositoryAttributeUseCase = CanCreateRepositoryAttributeUseCas
69
79
  transport_1.AccountController,
70
80
  common_1.SchemaRepository,
71
81
  Validator])
72
- ], CanCreateRepositoryAttributeUseCase);
73
- //# sourceMappingURL=CanCreateRepositoryAttribute.js.map
82
+ ], CanCreateOwnIdentityAttributeUseCase);
83
+ //# sourceMappingURL=CanCreateOwnIdentityAttribute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanCreateOwnIdentityAttribute.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/CanCreateOwnIdentityAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAAiD;AACjD,gDAA2C;AAC3C,oDAA0D;AAC1D,4CAAoE;AACpE,gDAAqD;AACrD,0DAA+C;AAC/C,yCAA2G;AAE3G,uFAAoF;AAapF,IAAM,SAAS,GAAf,MAAM,SAAS;IACX,YAA4C,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAAG,CAAC;IAE3E,QAAQ,CAAC,OAA6C;QACzD,MAAM,sBAAsB,GAAG,IAAI,wBAAe,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,sCAAsC,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AAC,CAAC;IAC1C,CAAC;CACJ,CAAA;AAvCY,oFAAoC;+CAApC,oCAAoC;IAExC,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAHwC,kCAAoB;QACvB,6BAAiB;QAClB,yBAAgB;QACxC,SAAS;GALvB,oCAAoC,CAuChD"}
@@ -3,17 +3,17 @@ import { AttributesController } from "@nmshd/consumption";
3
3
  import { LocalAttributeDTO } from "@nmshd/runtime-types";
4
4
  import { AccountController } from "@nmshd/transport";
5
5
  import { AttributeIdString, SchemaRepository, SchemaValidator, UseCase } from "../../common";
6
- export interface ChangeDefaultRepositoryAttributeRequest {
6
+ export interface ChangeDefaultOwnIdentityAttributeRequest {
7
7
  attributeId: AttributeIdString;
8
8
  }
9
- declare class Validator extends SchemaValidator<ChangeDefaultRepositoryAttributeRequest> {
9
+ declare class Validator extends SchemaValidator<ChangeDefaultOwnIdentityAttributeRequest> {
10
10
  constructor(schemaRepository: SchemaRepository);
11
11
  }
12
- export declare class ChangeDefaultRepositoryAttributeUseCase extends UseCase<ChangeDefaultRepositoryAttributeRequest, LocalAttributeDTO> {
12
+ export declare class ChangeDefaultOwnIdentityAttributeUseCase extends UseCase<ChangeDefaultOwnIdentityAttributeRequest, LocalAttributeDTO> {
13
13
  private readonly attributesController;
14
14
  private readonly accountController;
15
15
  constructor(attributesController: AttributesController, accountController: AccountController, validator: Validator);
16
- protected executeInternal(request: ChangeDefaultRepositoryAttributeRequest): Promise<Result<LocalAttributeDTO>>;
16
+ protected executeInternal(request: ChangeDefaultOwnIdentityAttributeRequest): Promise<Result<LocalAttributeDTO>>;
17
17
  }
18
18
  export {};
19
- //# sourceMappingURL=ChangeDefaultRepositoryAttribute.d.ts.map
19
+ //# sourceMappingURL=ChangeDefaultOwnIdentityAttribute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChangeDefaultOwnIdentityAttribute.d.ts","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/ChangeDefaultOwnIdentityAttribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAwC,MAAM,oBAAoB,CAAC;AAEhG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAiB,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5G,MAAM,WAAW,wCAAwC;IACrD,WAAW,EAAE,iBAAiB,CAAC;CAClC;AAED,cAAM,SAAU,SAAQ,eAAe,CAAC,wCAAwC,CAAC;gBAClD,gBAAgB,EAAE,gBAAgB;CAGhE;AAED,qBAAa,wCAAyC,SAAQ,OAAO,CAAC,wCAAwC,EAAE,iBAAiB,CAAC;IAElH,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBADjB,oBAAoB,EAAE,oBAAoB,EAC1C,iBAAiB,EAAE,iBAAiB,EACrD,SAAS,EAAE,SAAS;cAKhB,eAAe,CAAC,OAAO,EAAE,wCAAwC,GAAG,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;CAsBzH"}
@@ -12,7 +12,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  return function (target, key) { decorator(target, key, paramIndex); }
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ChangeDefaultRepositoryAttributeUseCase = void 0;
15
+ exports.ChangeDefaultOwnIdentityAttributeUseCase = void 0;
16
16
  const ts_utils_1 = require("@js-soft/ts-utils");
17
17
  const consumption_1 = require("@nmshd/consumption");
18
18
  const core_types_1 = require("@nmshd/core-types");
@@ -22,44 +22,44 @@ const common_1 = require("../../common");
22
22
  const AttributeMapper_1 = require("./AttributeMapper");
23
23
  let Validator = class Validator extends common_1.SchemaValidator {
24
24
  constructor(schemaRepository) {
25
- super(schemaRepository.getSchema("ChangeDefaultRepositoryAttributeRequest"));
25
+ super(schemaRepository.getSchema("ChangeDefaultOwnIdentityAttributeRequest"));
26
26
  }
27
27
  };
28
28
  Validator = __decorate([
29
29
  __param(0, typescript_ioc_1.Inject),
30
30
  __metadata("design:paramtypes", [common_1.SchemaRepository])
31
31
  ], Validator);
32
- let ChangeDefaultRepositoryAttributeUseCase = class ChangeDefaultRepositoryAttributeUseCase extends common_1.UseCase {
32
+ let ChangeDefaultOwnIdentityAttributeUseCase = class ChangeDefaultOwnIdentityAttributeUseCase extends common_1.UseCase {
33
33
  constructor(attributesController, accountController, validator) {
34
34
  super(validator);
35
35
  this.attributesController = attributesController;
36
36
  this.accountController = accountController;
37
37
  }
38
38
  async executeInternal(request) {
39
- if (!this.attributesController.parent.consumptionConfig.setDefaultRepositoryAttributes) {
40
- return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.setDefaultRepositoryAttributesIsDisabled());
39
+ if (!this.attributesController.parent.consumptionConfig.setDefaultOwnIdentityAttributes) {
40
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.setDefaultOwnIdentityAttributesIsDisabled());
41
41
  }
42
42
  const newDefaultAttribute = await this.attributesController.getLocalAttribute(core_types_1.CoreId.from(request.attributeId));
43
43
  if (!newDefaultAttribute)
44
44
  return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(consumption_1.LocalAttribute));
45
- if (!newDefaultAttribute.isRepositoryAttribute(this.accountController.identity.address)) {
46
- return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.isNotRepositoryAttribute(core_types_1.CoreId.from(request.attributeId)));
45
+ if (!(newDefaultAttribute instanceof consumption_1.OwnIdentityAttribute)) {
46
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.isNotOwnIdentityAttribute(core_types_1.CoreId.from(request.attributeId)));
47
47
  }
48
48
  if (newDefaultAttribute.succeededBy) {
49
49
  return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.hasSuccessor(newDefaultAttribute));
50
50
  }
51
- const defaultRepositoryAttribute = await this.attributesController.setAsDefaultRepositoryAttribute(newDefaultAttribute, false);
51
+ const defaultOwnIdentityAttribute = await this.attributesController.setAsDefaultOwnIdentityAttribute(newDefaultAttribute, false);
52
52
  await this.accountController.syncDatawallet();
53
- return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTO(defaultRepositoryAttribute));
53
+ return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTO(defaultOwnIdentityAttribute));
54
54
  }
55
55
  };
56
- exports.ChangeDefaultRepositoryAttributeUseCase = ChangeDefaultRepositoryAttributeUseCase;
57
- exports.ChangeDefaultRepositoryAttributeUseCase = ChangeDefaultRepositoryAttributeUseCase = __decorate([
56
+ exports.ChangeDefaultOwnIdentityAttributeUseCase = ChangeDefaultOwnIdentityAttributeUseCase;
57
+ exports.ChangeDefaultOwnIdentityAttributeUseCase = ChangeDefaultOwnIdentityAttributeUseCase = __decorate([
58
58
  __param(0, typescript_ioc_1.Inject),
59
59
  __param(1, typescript_ioc_1.Inject),
60
60
  __param(2, typescript_ioc_1.Inject),
61
61
  __metadata("design:paramtypes", [consumption_1.AttributesController,
62
62
  transport_1.AccountController,
63
63
  Validator])
64
- ], ChangeDefaultRepositoryAttributeUseCase);
65
- //# sourceMappingURL=ChangeDefaultRepositoryAttribute.js.map
64
+ ], ChangeDefaultOwnIdentityAttributeUseCase);
65
+ //# sourceMappingURL=ChangeDefaultOwnIdentityAttribute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChangeDefaultOwnIdentityAttribute.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/ChangeDefaultOwnIdentityAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAAgG;AAChG,kDAA2C;AAE3C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QAC7G,CAAC;QAED,IAAI,mBAAmB,CAAC,WAAW,EAAE,CAAC;YAClC,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,UAAU,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,CAAC;QACnF,CAAC;QAED,MAAM,2BAA2B,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,gCAAgC,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;QAEjI,MAAM,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QAE9C,OAAO,iBAAM,CAAC,EAAE,CAAC,iCAAe,CAAC,cAAc,CAAC,2BAA2B,CAAC,CAAC,CAAC;IAClF,CAAC;CACJ,CAAA;AA/BY,4FAAwC;mDAAxC,wCAAwC;IAE5C,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAFwC,kCAAoB;QACvB,6BAAiB;QAC1C,SAAS;GAJvB,wCAAwC,CA+BpD"}
@@ -0,0 +1,30 @@
1
+ import { Result } from "@js-soft/ts-utils";
2
+ import { AttributesController } from "@nmshd/consumption";
3
+ import { AttributeValues } from "@nmshd/content";
4
+ import { LocalAttributeDTO } from "@nmshd/runtime-types";
5
+ import { AccountController } from "@nmshd/transport";
6
+ import { SchemaRepository, UseCase, ValidationResult } from "../../common";
7
+ import { IValidator } from "../../common/validation/IValidator";
8
+ interface AbstractCreateOwnIdentityAttributeRequest<T> {
9
+ content: {
10
+ value: T;
11
+ tags?: string[];
12
+ };
13
+ }
14
+ export interface CreateOwnIdentityAttributeRequest extends AbstractCreateOwnIdentityAttributeRequest<AttributeValues.Identity.Json> {
15
+ }
16
+ export interface SchemaValidatableCreateOwnIdentityAttributeRequest extends AbstractCreateOwnIdentityAttributeRequest<unknown> {
17
+ }
18
+ declare class Validator implements IValidator<CreateOwnIdentityAttributeRequest> {
19
+ private readonly schemaRepository;
20
+ constructor(schemaRepository: SchemaRepository);
21
+ validate(request: CreateOwnIdentityAttributeRequest): Promise<ValidationResult> | ValidationResult;
22
+ }
23
+ export declare class CreateOwnIdentityAttributeUseCase extends UseCase<CreateOwnIdentityAttributeRequest, LocalAttributeDTO> {
24
+ private readonly attributesController;
25
+ private readonly accountController;
26
+ constructor(attributesController: AttributesController, accountController: AccountController, validator: Validator);
27
+ protected executeInternal(request: CreateOwnIdentityAttributeRequest): Promise<Result<LocalAttributeDTO>>;
28
+ }
29
+ export {};
30
+ //# sourceMappingURL=CreateOwnIdentityAttribute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateOwnIdentityAttribute.d.ts","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/CreateOwnIdentityAttribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAqB,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAiB,gBAAgB,EAAmB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC3G,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAIhE,UAAU,yCAAyC,CAAC,CAAC;IACjD,OAAO,EAAE;QACL,KAAK,EAAE,CAAC,CAAC;QACT,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;CACL;AAED,MAAM,WAAW,iCAAkC,SAAQ,yCAAyC,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC;CAAG;AAEtI,MAAM,WAAW,kDAAmD,SAAQ,yCAAyC,CAAC,OAAO,CAAC;CAAG;AAEjI,cAAM,SAAU,YAAW,UAAU,CAAC,iCAAiC,CAAC;IACzC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,gBAAgB;IAEvE,QAAQ,CAAC,OAAO,EAAE,iCAAiC,GAAG,OAAO,CAAC,gBAAgB,CAAC,GAAG,gBAAgB;CAQ5G;AAED,qBAAa,iCAAkC,SAAQ,OAAO,CAAC,iCAAiC,EAAE,iBAAiB,CAAC;IAEpG,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBADjB,oBAAoB,EAAE,oBAAoB,EAC1C,iBAAiB,EAAE,iBAAiB,EACrD,SAAS,EAAE,SAAS;cAKhB,eAAe,CAAC,OAAO,EAAE,iCAAiC,GAAG,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;CAiBlH"}
@@ -12,9 +12,10 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  return function (target, key) { decorator(target, key, paramIndex); }
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.CreateRepositoryAttributeUseCase = void 0;
15
+ exports.CreateOwnIdentityAttributeUseCase = void 0;
16
16
  const ts_utils_1 = require("@js-soft/ts-utils");
17
17
  const consumption_1 = require("@nmshd/consumption");
18
+ const content_1 = require("@nmshd/content");
18
19
  const transport_1 = require("@nmshd/transport");
19
20
  const typescript_ioc_1 = require("@nmshd/typescript-ioc");
20
21
  const common_1 = require("../../common");
@@ -25,7 +26,7 @@ let Validator = class Validator {
25
26
  this.schemaRepository = schemaRepository;
26
27
  }
27
28
  validate(request) {
28
- const requestSchemaValidator = new common_1.SchemaValidator(this.schemaRepository.getSchema("CreateRepositoryAttributeRequest"));
29
+ const requestSchemaValidator = new common_1.SchemaValidator(this.schemaRepository.getSchema("CreateOwnIdentityAttributeRequest"));
29
30
  const requestValidationResult = requestSchemaValidator.validate(request);
30
31
  if (requestValidationResult.isInvalid())
31
32
  return requestValidationResult;
@@ -37,36 +38,34 @@ Validator = __decorate([
37
38
  __param(0, typescript_ioc_1.Inject),
38
39
  __metadata("design:paramtypes", [common_1.SchemaRepository])
39
40
  ], Validator);
40
- let CreateRepositoryAttributeUseCase = class CreateRepositoryAttributeUseCase extends common_1.UseCase {
41
+ let CreateOwnIdentityAttributeUseCase = class CreateOwnIdentityAttributeUseCase extends common_1.UseCase {
41
42
  constructor(attributesController, accountController, validator) {
42
43
  super(validator);
43
44
  this.attributesController = attributesController;
44
45
  this.accountController = accountController;
45
46
  }
46
47
  async executeInternal(request) {
47
- const repositoryAttributeDuplicate = await this.attributesController.getRepositoryAttributeWithSameValue(request.content.value);
48
- if (repositoryAttributeDuplicate) {
49
- return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.cannotCreateDuplicateRepositoryAttribute(repositoryAttributeDuplicate.id));
48
+ const ownIdentityAttributeDuplicate = await this.attributesController.getOwnIdentityAttributeWithSameValue(request.content.value);
49
+ if (ownIdentityAttributeDuplicate) {
50
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.cannotCreateDuplicateOwnIdentityAttribute(ownIdentityAttributeDuplicate.id));
50
51
  }
51
- const params = consumption_1.CreateRepositoryAttributeParams.from({
52
- content: {
53
- "@type": "IdentityAttribute",
54
- owner: this.accountController.identity.address.toString(),
52
+ const createdLocalAttribute = await this.attributesController.createOwnIdentityAttribute({
53
+ content: content_1.IdentityAttribute.from({
54
+ owner: this.accountController.identity.address,
55
55
  ...request.content
56
- }
56
+ })
57
57
  });
58
- const createdLocalAttribute = await this.attributesController.createRepositoryAttribute(params);
59
58
  await this.accountController.syncDatawallet();
60
59
  return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTO(createdLocalAttribute));
61
60
  }
62
61
  };
63
- exports.CreateRepositoryAttributeUseCase = CreateRepositoryAttributeUseCase;
64
- exports.CreateRepositoryAttributeUseCase = CreateRepositoryAttributeUseCase = __decorate([
62
+ exports.CreateOwnIdentityAttributeUseCase = CreateOwnIdentityAttributeUseCase;
63
+ exports.CreateOwnIdentityAttributeUseCase = CreateOwnIdentityAttributeUseCase = __decorate([
65
64
  __param(0, typescript_ioc_1.Inject),
66
65
  __param(1, typescript_ioc_1.Inject),
67
66
  __param(2, typescript_ioc_1.Inject),
68
67
  __metadata("design:paramtypes", [consumption_1.AttributesController,
69
68
  transport_1.AccountController,
70
69
  Validator])
71
- ], CreateRepositoryAttributeUseCase);
72
- //# sourceMappingURL=CreateRepositoryAttribute.js.map
70
+ ], CreateOwnIdentityAttributeUseCase);
71
+ //# sourceMappingURL=CreateOwnIdentityAttribute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateOwnIdentityAttribute.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/CreateOwnIdentityAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAA0D;AAC1D,4CAAoE;AAEpE,gDAAqD;AACrD,0DAA+C;AAC/C,yCAA2G;AAE3G,uDAAoD;AACpD,uFAAoF;AAapF,IAAM,SAAS,GAAf,MAAM,SAAS;IACX,YAA4C,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAAG,CAAC;IAE3E,QAAQ,CAAC,OAA0C;QACtD,MAAM,sBAAsB,GAAG,IAAI,wBAAe,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,mCAAmC,CAAC,CAAC,CAAC;QACzH,MAAM,uBAAuB,GAAG,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACzE,IAAI,uBAAuB,CAAC,SAAS,EAAE;YAAE,OAAO,uBAAuB,CAAC;QAExE,MAAM,+BAA+B,GAAG,IAAI,iEAA+B,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACnG,OAAO,+BAA+B,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC3E,CAAC;CACJ,CAAA;AAXK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAoC,yBAAgB;GAD5E,SAAS,CAWd;AAED,IAAa,iCAAiC,GAA9C,MAAa,iCAAkC,SAAQ,gBAA6D;IAChH,YAC6B,oBAA0C,EAC1C,iBAAoC,EACrD,SAAoB;QAE5B,KAAK,CAAC,SAAS,CAAC,CAAC;QAJQ,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,sBAAiB,GAAjB,iBAAiB,CAAmB;IAIjE,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAA0C;QACtE,MAAM,6BAA6B,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,oCAAoC,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAClI,IAAI,6BAA6B,EAAE,CAAC;YAChC,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,UAAU,CAAC,yCAAyC,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7H,CAAC;QAED,MAAM,qBAAqB,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,0BAA0B,CAAC;YACrF,OAAO,EAAE,2BAAiB,CAAC,IAAI,CAAC;gBAC5B,KAAK,EAAE,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,OAAO;gBAC9C,GAAG,OAAO,CAAC,OAAO;aACrB,CAAC;SACL,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QAE9C,OAAO,iBAAM,CAAC,EAAE,CAAC,iCAAe,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAC5E,CAAC;CACJ,CAAA;AA1BY,8EAAiC;4CAAjC,iCAAiC;IAErC,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAFwC,kCAAoB;QACvB,6BAAiB;QAC1C,SAAS;GAJvB,iCAAiC,CA0B7C"}
@@ -0,0 +1,33 @@
1
+ import { Result } from "@js-soft/ts-utils";
2
+ import { AttributesController } from "@nmshd/consumption";
3
+ import { AccountController, MessageController, RelationshipsController } from "@nmshd/transport";
4
+ import { AttributeIdString, NotificationIdString, SchemaRepository, SchemaValidator, UseCase } from "../../common";
5
+ export interface DeleteAttributeAndNotifyRequest {
6
+ attributeId: AttributeIdString;
7
+ }
8
+ export interface DeleteAttributeAndNotifyResponse {
9
+ notificationIds: NotificationIdString[];
10
+ }
11
+ declare class Validator extends SchemaValidator<DeleteAttributeAndNotifyRequest> {
12
+ constructor(schemaRepository: SchemaRepository);
13
+ }
14
+ export declare class DeleteAttributeAndNotifyUseCase extends UseCase<DeleteAttributeAndNotifyRequest, DeleteAttributeAndNotifyResponse> {
15
+ private readonly attributesController;
16
+ private readonly accountController;
17
+ private readonly messageController;
18
+ private readonly relationshipsController;
19
+ constructor(attributesController: AttributesController, accountController: AccountController, messageController: MessageController, relationshipsController: RelationshipsController, validator: Validator);
20
+ protected executeInternal(request: DeleteAttributeAndNotifyRequest): Promise<Result<DeleteAttributeAndNotifyResponse>>;
21
+ private getPeersOfAttributeToNotify;
22
+ private getPeersOfRelationshipAttribute;
23
+ private getForwardingPeersOfAttribute;
24
+ private getPeerOfAttribute;
25
+ private getPeersOfPredecessorsToNotify;
26
+ private notifyPeers;
27
+ private notifyPeersOfAttribute;
28
+ private notifyPeersOfPredecessors;
29
+ private createAttributeDeletedNotificationItem;
30
+ private sendNotification;
31
+ }
32
+ export {};
33
+ //# sourceMappingURL=DeleteAttributeAndNotify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeleteAttributeAndNotify.d.ts","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/DeleteAttributeAndNotify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EACH,oBAAoB,EAQvB,MAAM,oBAAoB,CAAC;AAS5B,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAsB,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAErH,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAA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