@nmshd/runtime 2.10.0 → 3.0.1

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 (177) hide show
  1. package/dist/DatabaseSchemaUpgrader.js.map +1 -1
  2. package/dist/Runtime.js.map +1 -1
  3. package/dist/buildInformation.js +5 -5
  4. package/dist/dataViews/DataViewExpander.js +9 -5
  5. package/dist/dataViews/DataViewExpander.js.map +1 -1
  6. package/dist/dataViews/consumption/LocalAttributeDVO.d.ts +8 -4
  7. package/dist/events/EventProxy.js +16 -7
  8. package/dist/events/EventProxy.js.map +1 -1
  9. package/dist/events/consumption/OwnSharedAttributeSucceededEvent.d.ts +6 -0
  10. package/dist/events/consumption/OwnSharedAttributeSucceededEvent.js +12 -0
  11. package/dist/events/consumption/OwnSharedAttributeSucceededEvent.js.map +1 -0
  12. package/dist/events/consumption/PeerSharedAttributeSucceededEvent.d.ts +6 -0
  13. package/dist/events/consumption/PeerSharedAttributeSucceededEvent.js +12 -0
  14. package/dist/events/consumption/PeerSharedAttributeSucceededEvent.js.map +1 -0
  15. package/dist/events/consumption/RepositoryAttributeSucceededEvent.d.ts +6 -0
  16. package/dist/events/consumption/RepositoryAttributeSucceededEvent.js +12 -0
  17. package/dist/events/consumption/RepositoryAttributeSucceededEvent.js.map +1 -0
  18. package/dist/events/consumption/SuccessionEventData.d.ts +5 -0
  19. package/dist/events/consumption/SuccessionEventData.js +3 -0
  20. package/dist/events/consumption/SuccessionEventData.js.map +1 -0
  21. package/dist/events/consumption/index.d.ts +4 -3
  22. package/dist/events/consumption/index.js +4 -3
  23. package/dist/events/consumption/index.js.map +1 -1
  24. package/dist/extensibility/facades/consumption/AttributesFacade.d.ts +18 -18
  25. package/dist/extensibility/facades/consumption/AttributesFacade.js +35 -35
  26. package/dist/extensibility/facades/consumption/AttributesFacade.js.map +1 -1
  27. package/dist/modules/AttributeListenerModule.js.map +1 -1
  28. package/dist/modules/DeciderModule.js.map +1 -1
  29. package/dist/modules/MessageModule.js.map +1 -1
  30. package/dist/modules/NotificationModule.js.map +1 -1
  31. package/dist/modules/RequestModule.js.map +1 -1
  32. package/dist/useCases/common/RuntimeErrors.d.ts +9 -1
  33. package/dist/useCases/common/RuntimeErrors.js +22 -0
  34. package/dist/useCases/common/RuntimeErrors.js.map +1 -1
  35. package/dist/useCases/common/SchemaRepository.js.map +1 -1
  36. package/dist/useCases/common/Schemas.d.ts +14 -14
  37. package/dist/useCases/common/Schemas.js +3885 -7797
  38. package/dist/useCases/common/Schemas.js.map +1 -1
  39. package/dist/useCases/common/UseCase.js.map +1 -1
  40. package/dist/useCases/common/validation/SchemaValidator.js.map +1 -1
  41. package/dist/useCases/consumption/attributeListeners/GetAttributeListener.js.map +1 -1
  42. package/dist/useCases/consumption/attributes/AttributeSuccessionResponse.d.ts +5 -0
  43. package/dist/useCases/consumption/attributes/AttributeSuccessionResponse.js +3 -0
  44. package/dist/useCases/consumption/attributes/AttributeSuccessionResponse.js.map +1 -0
  45. package/dist/useCases/consumption/attributes/CreateAndShareRelationshipAttribute.d.ts +34 -0
  46. package/dist/useCases/consumption/attributes/{ShareAttribute.js → CreateAndShareRelationshipAttribute.js} +26 -33
  47. package/dist/useCases/consumption/attributes/CreateAndShareRelationshipAttribute.js.map +1 -0
  48. package/dist/useCases/consumption/attributes/CreateIdentityAttribute.d.ts +24 -0
  49. package/dist/useCases/consumption/attributes/{CreateAttribute.js → CreateIdentityAttribute.js} +12 -8
  50. package/dist/useCases/consumption/attributes/CreateIdentityAttribute.js.map +1 -0
  51. package/dist/useCases/consumption/attributes/ExecuteIQLQuery.d.ts +2 -2
  52. package/dist/useCases/consumption/attributes/ExecuteIQLQuery.js.map +1 -1
  53. package/dist/useCases/consumption/attributes/ExecuteIdentityAttributeQuery.d.ts +2 -2
  54. package/dist/useCases/consumption/attributes/ExecuteIdentityAttributeQuery.js.map +1 -1
  55. package/dist/useCases/consumption/attributes/ExecuteRelationshipAttributeQuery.d.ts +2 -2
  56. package/dist/useCases/consumption/attributes/ExecuteRelationshipAttributeQuery.js.map +1 -1
  57. package/dist/useCases/consumption/attributes/ExecuteThirdPartyRelationshipAttributeQuery.d.ts +2 -2
  58. package/dist/useCases/consumption/attributes/ExecuteThirdPartyRelationshipAttributeQuery.js.map +1 -1
  59. package/dist/useCases/consumption/attributes/GetAttribute.js.map +1 -1
  60. package/dist/useCases/consumption/attributes/GetAttributes.d.ts +1 -0
  61. package/dist/useCases/consumption/attributes/GetAttributes.js +4 -0
  62. package/dist/useCases/consumption/attributes/GetAttributes.js.map +1 -1
  63. package/dist/useCases/consumption/attributes/{GetSharedToPeerAttributes.d.ts → GetOwnSharedAttributes.d.ts} +8 -7
  64. package/dist/useCases/consumption/attributes/{GetSharedToPeerAttributes.js → GetOwnSharedAttributes.js} +6 -6
  65. package/dist/useCases/consumption/attributes/GetOwnSharedAttributes.js.map +1 -0
  66. package/dist/useCases/consumption/attributes/{GetPeerAttributes.d.ts → GetPeerSharedAttributes.d.ts} +8 -7
  67. package/dist/useCases/consumption/attributes/{GetPeerAttributes.js → GetPeerSharedAttributes.js} +6 -6
  68. package/dist/useCases/consumption/attributes/GetPeerSharedAttributes.js.map +1 -0
  69. package/dist/useCases/consumption/attributes/NotifyPeerAboutIdentityAttributeSuccession.d.ts +24 -0
  70. package/dist/useCases/consumption/attributes/NotifyPeerAboutIdentityAttributeSuccession.js +118 -0
  71. package/dist/useCases/consumption/attributes/NotifyPeerAboutIdentityAttributeSuccession.js.map +1 -0
  72. package/dist/useCases/consumption/attributes/{ShareAttribute.d.ts → ShareIdentityAttribute.d.ts} +11 -10
  73. package/dist/useCases/consumption/attributes/ShareIdentityAttribute.js +120 -0
  74. package/dist/useCases/consumption/attributes/ShareIdentityAttribute.js.map +1 -0
  75. package/dist/useCases/consumption/attributes/SucceedIdentityAttribute.d.ts +29 -0
  76. package/dist/useCases/consumption/attributes/{CreateSharedAttributeCopy.js → SucceedIdentityAttribute.js} +30 -14
  77. package/dist/useCases/consumption/attributes/SucceedIdentityAttribute.js.map +1 -0
  78. package/dist/useCases/consumption/attributes/SucceedRelationshipAttributeAndNotifyPeer.d.ts +29 -0
  79. package/dist/useCases/consumption/attributes/SucceedRelationshipAttributeAndNotifyPeer.js +97 -0
  80. package/dist/useCases/consumption/attributes/SucceedRelationshipAttributeAndNotifyPeer.js.map +1 -0
  81. package/dist/useCases/consumption/attributes/ValidateIQLQuery.d.ts +2 -2
  82. package/dist/useCases/consumption/attributes/ValidateIQLQuery.js.map +1 -1
  83. package/dist/useCases/consumption/attributes/index.d.ts +8 -8
  84. package/dist/useCases/consumption/attributes/index.js +8 -8
  85. package/dist/useCases/consumption/attributes/index.js.map +1 -1
  86. package/dist/useCases/consumption/drafts/DeleteDraft.js.map +1 -1
  87. package/dist/useCases/consumption/drafts/GetDraft.js.map +1 -1
  88. package/dist/useCases/consumption/drafts/UpdateDraft.js.map +1 -1
  89. package/dist/useCases/consumption/requests/AcceptIncomingRequest.js.map +1 -1
  90. package/dist/useCases/consumption/requests/CompleteIncomingRequest.js.map +1 -1
  91. package/dist/useCases/consumption/requests/CompleteOutgoingRequest.js.map +1 -1
  92. package/dist/useCases/consumption/requests/CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponse.js.map +1 -1
  93. package/dist/useCases/consumption/requests/GetIncomingRequest.js.map +1 -1
  94. package/dist/useCases/consumption/requests/GetOutgoingRequest.js.map +1 -1
  95. package/dist/useCases/consumption/requests/ReceivedIncomingRequest.js.map +1 -1
  96. package/dist/useCases/consumption/requests/RejectIncomingRequest.js.map +1 -1
  97. package/dist/useCases/consumption/requests/SentOutgoingRequest.js.map +1 -1
  98. package/dist/useCases/consumption/requests/flattenObject.js.map +1 -1
  99. package/dist/useCases/consumption/settings/DeleteSetting.js.map +1 -1
  100. package/dist/useCases/consumption/settings/GetSetting.js.map +1 -1
  101. package/dist/useCases/consumption/settings/GetSettingByKey.js.map +1 -1
  102. package/dist/useCases/consumption/settings/UpdateSetting.js.map +1 -1
  103. package/dist/useCases/transport/account/LoadItemFromTruncatedReference.js.map +1 -1
  104. package/dist/useCases/transport/account/SyncEverything.js.map +1 -1
  105. package/dist/useCases/transport/challenges/CreateChallenge.js.map +1 -1
  106. package/dist/useCases/transport/challenges/ValidateChallenge.js.map +1 -1
  107. package/dist/useCases/transport/devices/DeleteDevice.js.map +1 -1
  108. package/dist/useCases/transport/devices/GetDevice.js.map +1 -1
  109. package/dist/useCases/transport/devices/UpdateDevice.js.map +1 -1
  110. package/dist/useCases/transport/files/CreateQrCodeForFile.js.map +1 -1
  111. package/dist/useCases/transport/files/CreateTokenForFile.js.map +1 -1
  112. package/dist/useCases/transport/files/CreateTokenQrCodeForFile.js.map +1 -1
  113. package/dist/useCases/transport/files/DownloadFile.js.map +1 -1
  114. package/dist/useCases/transport/files/FileMapper.js.map +1 -1
  115. package/dist/useCases/transport/files/GetFile.js.map +1 -1
  116. package/dist/useCases/transport/files/GetFiles.js.map +1 -1
  117. package/dist/useCases/transport/files/GetOrLoadFile.js.map +1 -1
  118. package/dist/useCases/transport/files/UploadOwnFile.js.map +1 -1
  119. package/dist/useCases/transport/identity/CheckIdentity.js.map +1 -1
  120. package/dist/useCases/transport/messages/DownloadAttachment.js.map +1 -1
  121. package/dist/useCases/transport/messages/GetAttachmentMetadata.js.map +1 -1
  122. package/dist/useCases/transport/messages/GetMessage.js.map +1 -1
  123. package/dist/useCases/transport/messages/GetMessages.js.map +1 -1
  124. package/dist/useCases/transport/messages/MessageMapper.js.map +1 -1
  125. package/dist/useCases/transport/messages/SendMessage.js.map +1 -1
  126. package/dist/useCases/transport/relationshipTemplates/CreateOwnRelationshipTemplate.js.map +1 -1
  127. package/dist/useCases/transport/relationshipTemplates/CreateQrCodeForOwnRelationshipTemplate.js.map +1 -1
  128. package/dist/useCases/transport/relationshipTemplates/CreateTokenForOwnRelationshipTemplate.js.map +1 -1
  129. package/dist/useCases/transport/relationshipTemplates/CreateTokenQrCodeForOwnRelationshipTemplate.js.map +1 -1
  130. package/dist/useCases/transport/relationshipTemplates/GetRelationshipTemplate.js.map +1 -1
  131. package/dist/useCases/transport/relationshipTemplates/GetRelationshipTemplates.js.map +1 -1
  132. package/dist/useCases/transport/relationshipTemplates/LoadPeerRelationshipTemplate.js.map +1 -1
  133. package/dist/useCases/transport/relationshipTemplates/RelationshipTemplateMapper.js.map +1 -1
  134. package/dist/useCases/transport/relationships/AcceptRelationshipChange.js.map +1 -1
  135. package/dist/useCases/transport/relationships/CreateRelationship.js.map +1 -1
  136. package/dist/useCases/transport/relationships/GetAttributesForRelationship.js.map +1 -1
  137. package/dist/useCases/transport/relationships/GetRelationship.js.map +1 -1
  138. package/dist/useCases/transport/relationships/GetRelationshipByAddress.js.map +1 -1
  139. package/dist/useCases/transport/relationships/RejectRelationshipChange.js.map +1 -1
  140. package/dist/useCases/transport/relationships/RelationshipMapper.js.map +1 -1
  141. package/dist/useCases/transport/relationships/RevokeRelationshipChange.js.map +1 -1
  142. package/dist/useCases/transport/tokens/CreateOwnToken.js.map +1 -1
  143. package/dist/useCases/transport/tokens/GetQRCodeForToken.js.map +1 -1
  144. package/dist/useCases/transport/tokens/GetToken.js.map +1 -1
  145. package/dist/useCases/transport/tokens/GetTokens.js.map +1 -1
  146. package/dist/useCases/transport/tokens/LoadPeerToken.js.map +1 -1
  147. package/dist/useCases/transport/tokens/TokenMapper.js.map +1 -1
  148. package/lib-web/nmshd.runtime.js +8471 -12149
  149. package/lib-web/nmshd.runtime.js.map +1 -1
  150. package/lib-web/nmshd.runtime.min.js +3 -3
  151. package/lib-web/nmshd.runtime.min.js.map +1 -1
  152. package/package.json +11 -11
  153. package/dist/events/consumption/AttributeSucceededEvent.d.ts +0 -6
  154. package/dist/events/consumption/AttributeSucceededEvent.js +0 -12
  155. package/dist/events/consumption/AttributeSucceededEvent.js.map +0 -1
  156. package/dist/events/consumption/AttributeUpdatedEvent.d.ts +0 -6
  157. package/dist/events/consumption/AttributeUpdatedEvent.js +0 -12
  158. package/dist/events/consumption/AttributeUpdatedEvent.js.map +0 -1
  159. package/dist/events/consumption/SharedAttributeCopyCreatedEvent.d.ts +0 -6
  160. package/dist/events/consumption/SharedAttributeCopyCreatedEvent.js +0 -12
  161. package/dist/events/consumption/SharedAttributeCopyCreatedEvent.js.map +0 -1
  162. package/dist/useCases/consumption/attributes/CreateAttribute.d.ts +0 -19
  163. package/dist/useCases/consumption/attributes/CreateAttribute.js.map +0 -1
  164. package/dist/useCases/consumption/attributes/CreateSharedAttributeCopy.d.ts +0 -20
  165. package/dist/useCases/consumption/attributes/CreateSharedAttributeCopy.js.map +0 -1
  166. package/dist/useCases/consumption/attributes/DeleteAttribute.d.ts +0 -17
  167. package/dist/useCases/consumption/attributes/DeleteAttribute.js +0 -55
  168. package/dist/useCases/consumption/attributes/DeleteAttribute.js.map +0 -1
  169. package/dist/useCases/consumption/attributes/GetPeerAttributes.js.map +0 -1
  170. package/dist/useCases/consumption/attributes/GetSharedToPeerAttributes.js.map +0 -1
  171. package/dist/useCases/consumption/attributes/ShareAttribute.js.map +0 -1
  172. package/dist/useCases/consumption/attributes/SucceedAttribute.d.ts +0 -20
  173. package/dist/useCases/consumption/attributes/SucceedAttribute.js +0 -56
  174. package/dist/useCases/consumption/attributes/SucceedAttribute.js.map +0 -1
  175. package/dist/useCases/consumption/attributes/UpdateAttribute.d.ts +0 -20
  176. package/dist/useCases/consumption/attributes/UpdateAttribute.js +0 -56
  177. package/dist/useCases/consumption/attributes/UpdateAttribute.js.map +0 -1
@@ -0,0 +1,24 @@
1
+ import { Result } from "@js-soft/ts-utils";
2
+ import { AttributesController } from "@nmshd/consumption";
3
+ import { AccountController, MessageController } from "@nmshd/transport";
4
+ import { LocalAttributeDTO } from "../../../types";
5
+ import { AddressString, AttributeIdString, SchemaRepository, SchemaValidator, UseCase } from "../../common";
6
+ export interface NotifyPeerAboutIdentityAttributeSuccessionResponse {
7
+ predecessor: LocalAttributeDTO;
8
+ successor: LocalAttributeDTO;
9
+ }
10
+ export interface NotifyPeerAboutIdentityAttributeSuccessionRequest {
11
+ attributeId: AttributeIdString;
12
+ peer: AddressString;
13
+ }
14
+ declare class Validator extends SchemaValidator<NotifyPeerAboutIdentityAttributeSuccessionRequest> {
15
+ constructor(schemaRepository: SchemaRepository);
16
+ }
17
+ export declare class NotifyPeerAboutIdentityAttributeSuccessionUseCase extends UseCase<NotifyPeerAboutIdentityAttributeSuccessionRequest, NotifyPeerAboutIdentityAttributeSuccessionResponse> {
18
+ private readonly accountController;
19
+ private readonly attributeController;
20
+ private readonly messageController;
21
+ constructor(accountController: AccountController, attributeController: AttributesController, messageController: MessageController, validator: Validator);
22
+ protected executeInternal(request: NotifyPeerAboutIdentityAttributeSuccessionRequest): Promise<Result<NotifyPeerAboutIdentityAttributeSuccessionResponse>>;
23
+ }
24
+ export {};
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.NotifyPeerAboutIdentityAttributeSuccessionUseCase = void 0;
16
+ const ts_utils_1 = require("@js-soft/ts-utils");
17
+ const consumption_1 = require("@nmshd/consumption");
18
+ const content_1 = require("@nmshd/content");
19
+ const transport_1 = require("@nmshd/transport");
20
+ const typescript_ioc_1 = require("typescript-ioc");
21
+ const common_1 = require("../../common");
22
+ const AttributeMapper_1 = require("./AttributeMapper");
23
+ let Validator = class Validator extends common_1.SchemaValidator {
24
+ constructor(schemaRepository) {
25
+ super(schemaRepository.getSchema("NotifyPeerAboutIdentityAttributeSuccessionRequest"));
26
+ }
27
+ };
28
+ Validator = __decorate([
29
+ __param(0, typescript_ioc_1.Inject),
30
+ __metadata("design:paramtypes", [common_1.SchemaRepository])
31
+ ], Validator);
32
+ let NotifyPeerAboutIdentityAttributeSuccessionUseCase = class NotifyPeerAboutIdentityAttributeSuccessionUseCase extends common_1.UseCase {
33
+ constructor(accountController, attributeController, messageController, validator) {
34
+ super(validator);
35
+ this.accountController = accountController;
36
+ this.attributeController = attributeController;
37
+ this.messageController = messageController;
38
+ }
39
+ async executeInternal(request) {
40
+ const repositoryAttributeSuccessorId = transport_1.CoreId.from(request.attributeId);
41
+ const repositoryAttributeSuccessor = await this.attributeController.getLocalAttribute(repositoryAttributeSuccessorId);
42
+ if (typeof repositoryAttributeSuccessor === "undefined")
43
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(consumption_1.LocalAttribute.name));
44
+ if (!repositoryAttributeSuccessor.isRepositoryAttribute())
45
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.isNoIdentityAttribute(repositoryAttributeSuccessor.id));
46
+ if (typeof repositoryAttributeSuccessor.succeededBy !== "undefined") {
47
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.canOnlyNotifyAboutLatestVersionOfIdentityAttribute(repositoryAttributeSuccessor.id));
48
+ }
49
+ const query = {
50
+ "content.owner": this.accountController.identity.address.toString(),
51
+ "content.@type": "IdentityAttribute",
52
+ "shareInfo.sourceAttribute": repositoryAttributeSuccessorId.toString(),
53
+ "shareInfo.peer": request.peer
54
+ };
55
+ const ownSharedIdentityAttributesOfRepositoryAttributeSuccessor = await this.attributeController.getLocalAttributes(query);
56
+ if (ownSharedIdentityAttributesOfRepositoryAttributeSuccessor.length > 0) {
57
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.identityAttributeHasAlreadyBeenSharedWithPeer(request.attributeId, request.peer, ownSharedIdentityAttributesOfRepositoryAttributeSuccessor[0].id));
58
+ }
59
+ const repositoryAttributeVersions = await this.attributeController.getVersionsOfAttribute(repositoryAttributeSuccessorId);
60
+ const repositoryAttributeVersionIds = repositoryAttributeVersions.map((x) => x.id.toString());
61
+ const candidatePredecessorsQuery = {
62
+ "shareInfo.sourceAttribute": { $in: repositoryAttributeVersionIds },
63
+ "shareInfo.peer": request.peer,
64
+ succededBy: { $exists: false }
65
+ };
66
+ const candidatePredecessors = await this.attributeController.getLocalAttributes(candidatePredecessorsQuery);
67
+ if (candidatePredecessors.length === 0) {
68
+ throw common_1.RuntimeErrors.general.recordNotFoundWithMessage("No shared predecessor found. If this is the fist version you want to share with this peer, use `ShareIdentityAttribute`.");
69
+ }
70
+ if (candidatePredecessors.length > 1) {
71
+ throw common_1.RuntimeErrors.attributes.detectedErroneousAttribute(request.attributeId, "The attribute has shared copies of predecessing versions that are not in a succession chain.");
72
+ }
73
+ const ownSharedIdentityAttributePredecessor = candidatePredecessors[0];
74
+ const notificationId = await consumption_1.ConsumptionIds.notification.generate();
75
+ const successorParams = {
76
+ content: repositoryAttributeSuccessor.content,
77
+ succeeds: ownSharedIdentityAttributePredecessor.id,
78
+ shareInfo: { peer: ownSharedIdentityAttributePredecessor.shareInfo.peer, sourceAttribute: repositoryAttributeSuccessor.id, notificationReference: notificationId },
79
+ parentId: repositoryAttributeSuccessor.parentId
80
+ };
81
+ const validationResult = await this.attributeController.validateOwnSharedIdentityAttributeSuccession(ownSharedIdentityAttributePredecessor.id, successorParams);
82
+ if (validationResult.isError()) {
83
+ return ts_utils_1.Result.fail(validationResult.error);
84
+ }
85
+ const { predecessor: updatedOwnSharedIdentityAttributePredecessor, successor: ownSharedIdentityAttributeSuccessor } = await this.attributeController.succeedOwnSharedIdentityAttribute(ownSharedIdentityAttributePredecessor.id, successorParams, false);
86
+ const notificationItem = content_1.PeerSharedAttributeSucceededNotificationItem.from({
87
+ predecessorId: ownSharedIdentityAttributePredecessor.id,
88
+ successorId: ownSharedIdentityAttributeSuccessor.id,
89
+ successorContent: ownSharedIdentityAttributeSuccessor.content
90
+ });
91
+ const notification = content_1.Notification.from({
92
+ id: notificationId,
93
+ items: [notificationItem]
94
+ });
95
+ await this.messageController.sendMessage({
96
+ recipients: [ownSharedIdentityAttributePredecessor.shareInfo.peer],
97
+ content: notification
98
+ });
99
+ await this.accountController.syncDatawallet();
100
+ const result = {
101
+ predecessor: AttributeMapper_1.AttributeMapper.toAttributeDTO(updatedOwnSharedIdentityAttributePredecessor),
102
+ successor: AttributeMapper_1.AttributeMapper.toAttributeDTO(ownSharedIdentityAttributeSuccessor)
103
+ };
104
+ return ts_utils_1.Result.ok(result);
105
+ }
106
+ };
107
+ exports.NotifyPeerAboutIdentityAttributeSuccessionUseCase = NotifyPeerAboutIdentityAttributeSuccessionUseCase;
108
+ exports.NotifyPeerAboutIdentityAttributeSuccessionUseCase = NotifyPeerAboutIdentityAttributeSuccessionUseCase = __decorate([
109
+ __param(0, typescript_ioc_1.Inject),
110
+ __param(1, typescript_ioc_1.Inject),
111
+ __param(2, typescript_ioc_1.Inject),
112
+ __param(3, typescript_ioc_1.Inject),
113
+ __metadata("design:paramtypes", [transport_1.AccountController,
114
+ consumption_1.AttributesController,
115
+ transport_1.MessageController,
116
+ Validator])
117
+ ], NotifyPeerAboutIdentityAttributeSuccessionUseCase);
118
+ //# sourceMappingURL=NotifyPeerAboutIdentityAttributeSuccession.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotifyPeerAboutIdentityAttributeSuccession.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/NotifyPeerAboutIdentityAttributeSuccession.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAAqH;AACrH,4CAA4F;AAC5F,gDAAgF;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ChE,CAAC,CAAC;QACH,MAAM,YAAY,GAAG,sBAAY,CAAC,IAAI,CAAC;YACnC,EAAE,EAAE,cAAc;YAClB,KAAK,EAAE,CAAC,gBAAgB,CAAC;SAC5B,CAAC,CAAC;QACH,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC;YACrC,UAAU,EAAE,CAAC,qCAAqC,CAAC,SAAU,CAAC,IAAI,CAAC;YACnE,OAAO,EAAE,YAAY;SACxB,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QAE9C,MAAM,MAAM,GAAG;YACX,WAAW,EAAE,iCAAe,CAAC,cAAc,CAAC,4CAA4C,CAAC;YACzF,SAAS,EAAE,iCAAe,CAAC,cAAc,CAAC,mCAAmC,CAAC;SACjF,CAAC;QACF,OAAO,iBAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;CACJ,CAAA;AAnGY,8GAAiD;4DAAjD,iDAAiD;IAKrD,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAHqC,6BAAiB;QACf,kCAAoB;QACtB,6BAAiB;QAC1C,SAAS;GARvB,iDAAiD,CAmG7D"}
@@ -2,25 +2,26 @@ import { Result } from "@js-soft/ts-utils";
2
2
  import { AttributesController, OutgoingRequestsController } from "@nmshd/consumption";
3
3
  import { AccountController, MessageController } from "@nmshd/transport";
4
4
  import { LocalRequestDTO } from "../../../types";
5
- import { AddressString, AttributeIdString, SchemaRepository, SchemaValidator, UseCase } from "../../common";
6
- export interface ShareAttributeRequest {
5
+ import { AddressString, AttributeIdString, ISO8601DateTimeString, SchemaRepository, SchemaValidator, UseCase } from "../../common";
6
+ export interface ShareIdentityAttributeRequest {
7
7
  attributeId: AttributeIdString;
8
8
  peer: AddressString;
9
- requestTitle?: string;
10
- requestDescription?: string;
11
- requestMetadata?: any;
12
- requestItemTitle?: string;
13
- requestItemDescription?: string;
9
+ requestMetadata?: {
10
+ title?: string;
11
+ description?: string;
12
+ metadata?: Record<string, any>;
13
+ expiresAt?: ISO8601DateTimeString;
14
+ };
14
15
  }
15
- declare class Validator extends SchemaValidator<ShareAttributeRequest> {
16
+ declare class Validator extends SchemaValidator<ShareIdentityAttributeRequest> {
16
17
  constructor(schemaRepository: SchemaRepository);
17
18
  }
18
- export declare class ShareAttributeUseCase extends UseCase<ShareAttributeRequest, LocalRequestDTO> {
19
+ export declare class ShareIdentityAttributeUseCase extends UseCase<ShareIdentityAttributeRequest, LocalRequestDTO> {
19
20
  private readonly attributeController;
20
21
  private readonly accountController;
21
22
  private readonly requestsController;
22
23
  private readonly messageController;
23
24
  constructor(attributeController: AttributesController, accountController: AccountController, requestsController: OutgoingRequestsController, messageController: MessageController, validator: Validator);
24
- protected executeInternal(request: ShareAttributeRequest): Promise<Result<LocalRequestDTO>>;
25
+ protected executeInternal(request: ShareIdentityAttributeRequest): Promise<Result<LocalRequestDTO>>;
25
26
  }
26
27
  export {};
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.ShareIdentityAttributeUseCase = void 0;
16
+ const ts_utils_1 = require("@js-soft/ts-utils");
17
+ const consumption_1 = require("@nmshd/consumption");
18
+ const content_1 = require("@nmshd/content");
19
+ const transport_1 = require("@nmshd/transport");
20
+ const typescript_ioc_1 = require("typescript-ioc");
21
+ const common_1 = require("../../common");
22
+ const requests_1 = require("../requests");
23
+ let Validator = class Validator extends common_1.SchemaValidator {
24
+ constructor(schemaRepository) {
25
+ super(schemaRepository.getSchema("ShareIdentityAttributeRequest"));
26
+ }
27
+ };
28
+ Validator = __decorate([
29
+ __param(0, typescript_ioc_1.Inject),
30
+ __metadata("design:paramtypes", [common_1.SchemaRepository])
31
+ ], Validator);
32
+ let ShareIdentityAttributeUseCase = class ShareIdentityAttributeUseCase extends common_1.UseCase {
33
+ constructor(attributeController, accountController, requestsController, messageController, validator) {
34
+ super(validator);
35
+ this.attributeController = attributeController;
36
+ this.accountController = accountController;
37
+ this.requestsController = requestsController;
38
+ this.messageController = messageController;
39
+ }
40
+ async executeInternal(request) {
41
+ const repositoryAttribute = await this.attributeController.getLocalAttribute(transport_1.CoreId.from(request.attributeId));
42
+ if (typeof repositoryAttribute === "undefined")
43
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(consumption_1.LocalAttribute.name));
44
+ if (!repositoryAttribute.isRepositoryAttribute())
45
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.isNoIdentityAttribute(repositoryAttribute.id));
46
+ const query = {
47
+ "content.owner": this.accountController.identity.address.toString(),
48
+ "content.@type": "IdentityAttribute",
49
+ "shareInfo.sourceAttribute": request.attributeId,
50
+ "shareInfo.peer": request.peer
51
+ };
52
+ const ownSharedIdentityAttributesOfRepositoryAttribute = await this.attributeController.getLocalAttributes(query);
53
+ if (ownSharedIdentityAttributesOfRepositoryAttribute.length > 0) {
54
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.identityAttributeHasAlreadyBeenSharedWithPeer(request.attributeId, request.peer, ownSharedIdentityAttributesOfRepositoryAttribute[0].id));
55
+ }
56
+ let repositoryAttributeVersion = repositoryAttribute;
57
+ while (typeof repositoryAttributeVersion.succeededBy !== "undefined") {
58
+ repositoryAttributeVersion = (await this.attributeController.getLocalAttribute(repositoryAttributeVersion.succeededBy));
59
+ const query = {
60
+ "content.owner": this.accountController.identity.address.toString(),
61
+ "content.@type": "IdentityAttribute",
62
+ "shareInfo.sourceAttribute": repositoryAttributeVersion.id.toString(),
63
+ "shareInfo.peer": request.peer
64
+ };
65
+ const ownSharedIdentityAttributesOfRepositoryAttributeVersion = await this.attributeController.getLocalAttributes(query);
66
+ if (ownSharedIdentityAttributesOfRepositoryAttributeVersion.length > 0) {
67
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.anotherVersionOfIdentityAttributeHasAlreadyBeenSharedWithPeer(request.attributeId, request.peer, ownSharedIdentityAttributesOfRepositoryAttributeVersion[0].id));
68
+ }
69
+ }
70
+ repositoryAttributeVersion = repositoryAttribute;
71
+ while (typeof repositoryAttributeVersion.succeeds !== "undefined") {
72
+ repositoryAttributeVersion = (await this.attributeController.getLocalAttribute(repositoryAttributeVersion.succeeds));
73
+ const query = {
74
+ "content.owner": this.accountController.identity.address.toString(),
75
+ "content.@type": "IdentityAttribute",
76
+ "shareInfo.sourceAttribute": repositoryAttributeVersion.id.toString(),
77
+ "shareInfo.peer": request.peer
78
+ };
79
+ const ownSharedIdentityAttributesOfRepositoryAttributeVersion = await this.attributeController.getLocalAttributes(query);
80
+ if (ownSharedIdentityAttributesOfRepositoryAttributeVersion.length > 0) {
81
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.anotherVersionOfIdentityAttributeHasAlreadyBeenSharedWithPeer(request.attributeId, request.peer, ownSharedIdentityAttributesOfRepositoryAttributeVersion[0].id));
82
+ }
83
+ }
84
+ const requestMetadata = request.requestMetadata ?? {};
85
+ const requestParams = consumption_1.CreateOutgoingRequestParameters.from({
86
+ peer: request.peer,
87
+ content: content_1.Request.from({
88
+ ...requestMetadata,
89
+ items: [
90
+ content_1.ShareAttributeRequestItem.from({
91
+ attribute: repositoryAttribute.content,
92
+ sourceAttributeId: repositoryAttribute.id,
93
+ mustBeAccepted: true
94
+ }).toJSON()
95
+ ]
96
+ })
97
+ });
98
+ const canCreateRequestResult = await this.requestsController.canCreate(requestParams);
99
+ if (canCreateRequestResult.isError())
100
+ return ts_utils_1.Result.fail(canCreateRequestResult.error);
101
+ const localRequest = await this.requestsController.create(requestParams);
102
+ await this.messageController.sendMessage({ recipients: [transport_1.CoreAddress.from(request.peer)], content: localRequest.content });
103
+ await this.accountController.syncDatawallet();
104
+ return ts_utils_1.Result.ok(requests_1.RequestMapper.toLocalRequestDTO(localRequest));
105
+ }
106
+ };
107
+ exports.ShareIdentityAttributeUseCase = ShareIdentityAttributeUseCase;
108
+ exports.ShareIdentityAttributeUseCase = ShareIdentityAttributeUseCase = __decorate([
109
+ __param(0, typescript_ioc_1.Inject),
110
+ __param(1, typescript_ioc_1.Inject),
111
+ __param(2, typescript_ioc_1.Inject),
112
+ __param(3, typescript_ioc_1.Inject),
113
+ __param(4, typescript_ioc_1.Inject),
114
+ __metadata("design:paramtypes", [consumption_1.AttributesController,
115
+ transport_1.AccountController,
116
+ consumption_1.OutgoingRequestsController,
117
+ transport_1.MessageController,
118
+ Validator])
119
+ ], ShareIdentityAttributeUseCase);
120
+ //# sourceMappingURL=ShareIdentityAttribute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShareIdentityAttribute.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/ShareIdentityAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAAuI;AACvI,4CAAoE;AACpE,gDAA6F;AAC7F,mDAAwC;AAExC,yCAAkJ;AAClJ,0CAA4C;AAa5C,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAA8C;IAClE,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAA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,EAAE;YAAE,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;QAEvF,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QACzE,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC,uBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC;QAC1H,MAAM,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QAE9C,OAAO,iBAAM,CAAC,EAAE,CAAC,wBAAa,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAC;IACpE,CAAC;CACJ,CAAA;AA9FY,sEAA6B;wCAA7B,6BAA6B;IAEjC,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAJuC,kCAAoB;QACtB,6BAAiB;QAChB,wCAA0B;QAC3B,6BAAiB;QAC1C,SAAS;GANvB,6BAA6B,CA8FzC"}
@@ -0,0 +1,29 @@
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 { LocalAttributeDTO } from "../../../types";
6
+ import { ISO8601DateTimeString, SchemaRepository, SchemaValidator, UseCase } from "../../common";
7
+ export interface SucceedIdentityAttributeResponse {
8
+ predecessor: LocalAttributeDTO;
9
+ successor: LocalAttributeDTO;
10
+ }
11
+ export interface SucceedIdentityAttributeRequest {
12
+ predecessorId: string;
13
+ successorContent: {
14
+ value: AttributeValues.Identity.Json;
15
+ tags?: string[];
16
+ validFrom?: ISO8601DateTimeString;
17
+ validTo?: ISO8601DateTimeString;
18
+ };
19
+ }
20
+ declare class Validator extends SchemaValidator<SucceedIdentityAttributeRequest> {
21
+ constructor(schemaRepository: SchemaRepository);
22
+ }
23
+ export declare class SucceedIdentityAttributeUseCase extends UseCase<SucceedIdentityAttributeRequest, SucceedIdentityAttributeResponse> {
24
+ private readonly attributeController;
25
+ private readonly accountController;
26
+ constructor(attributeController: AttributesController, accountController: AccountController, validator: Validator);
27
+ protected executeInternal(request: SucceedIdentityAttributeRequest): Promise<Result<SucceedIdentityAttributeResponse>>;
28
+ }
29
+ export {};
@@ -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.CreateSharedAttributeCopyUseCase = void 0;
15
+ exports.SucceedIdentityAttributeUseCase = void 0;
16
16
  const ts_utils_1 = require("@js-soft/ts-utils");
17
17
  const consumption_1 = require("@nmshd/consumption");
18
18
  const transport_1 = require("@nmshd/transport");
@@ -21,37 +21,53 @@ const common_1 = require("../../common");
21
21
  const AttributeMapper_1 = require("./AttributeMapper");
22
22
  let Validator = class Validator extends common_1.SchemaValidator {
23
23
  constructor(schemaRepository) {
24
- super(schemaRepository.getSchema("CreateSharedAttributeCopyRequest"));
24
+ super(schemaRepository.getSchema("SucceedIdentityAttributeRequest"));
25
25
  }
26
26
  };
27
27
  Validator = __decorate([
28
28
  __param(0, typescript_ioc_1.Inject),
29
29
  __metadata("design:paramtypes", [common_1.SchemaRepository])
30
30
  ], Validator);
31
- let CreateSharedAttributeCopyUseCase = class CreateSharedAttributeCopyUseCase extends common_1.UseCase {
31
+ let SucceedIdentityAttributeUseCase = class SucceedIdentityAttributeUseCase extends common_1.UseCase {
32
32
  constructor(attributeController, accountController, validator) {
33
33
  super(validator);
34
34
  this.attributeController = attributeController;
35
35
  this.accountController = accountController;
36
36
  }
37
37
  async executeInternal(request) {
38
- const params = consumption_1.CreateSharedLocalAttributeCopyParams.from({
39
- sourceAttributeId: transport_1.CoreId.from(request.attributeId),
40
- peer: transport_1.CoreAddress.from(request.peer),
41
- requestReference: transport_1.CoreId.from(request.requestReference)
42
- });
43
- const successor = await this.attributeController.createSharedLocalAttributeCopy(params);
38
+ const predecessor = await this.attributeController.getLocalAttribute(transport_1.CoreId.from(request.predecessorId));
39
+ if (typeof predecessor === "undefined") {
40
+ return ts_utils_1.Result.fail(consumption_1.CoreErrors.attributes.predecessorDoesNotExist());
41
+ }
42
+ const successorParams = {
43
+ content: {
44
+ "@type": "IdentityAttribute",
45
+ owner: this.accountController.identity.address.toString(),
46
+ ...request.successorContent
47
+ },
48
+ succeeds: predecessor.id.toString()
49
+ };
50
+ const predecessorId = transport_1.CoreId.from(request.predecessorId);
51
+ const validationResult = await this.attributeController.validateRepositoryAttributeSuccession(predecessorId, successorParams);
52
+ if (validationResult.isError()) {
53
+ return ts_utils_1.Result.fail(validationResult.error);
54
+ }
55
+ const { predecessor: updatedPredecessor, successor } = await this.attributeController.succeedRepositoryAttribute(predecessorId, successorParams, false);
44
56
  await this.accountController.syncDatawallet();
45
- return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTO(successor));
57
+ const response = {
58
+ predecessor: AttributeMapper_1.AttributeMapper.toAttributeDTO(updatedPredecessor),
59
+ successor: AttributeMapper_1.AttributeMapper.toAttributeDTO(successor)
60
+ };
61
+ return ts_utils_1.Result.ok(response);
46
62
  }
47
63
  };
48
- exports.CreateSharedAttributeCopyUseCase = CreateSharedAttributeCopyUseCase;
49
- exports.CreateSharedAttributeCopyUseCase = CreateSharedAttributeCopyUseCase = __decorate([
64
+ exports.SucceedIdentityAttributeUseCase = SucceedIdentityAttributeUseCase;
65
+ exports.SucceedIdentityAttributeUseCase = SucceedIdentityAttributeUseCase = __decorate([
50
66
  __param(0, typescript_ioc_1.Inject),
51
67
  __param(1, typescript_ioc_1.Inject),
52
68
  __param(2, typescript_ioc_1.Inject),
53
69
  __metadata("design:paramtypes", [consumption_1.AttributesController,
54
70
  transport_1.AccountController,
55
71
  Validator])
56
- ], CreateSharedAttributeCopyUseCase);
57
- //# sourceMappingURL=CreateSharedAttributeCopy.js.map
72
+ ], SucceedIdentityAttributeUseCase);
73
+ //# sourceMappingURL=SucceedIdentityAttribute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SucceedIdentityAttribute.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/SucceedIdentityAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAAoG;AAEpG,gDAA6D;AAC7D,mDAAwC;AAExC,yCAAiG;AACjG,uDAAoD;AAiBpD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAAgD;IACpE,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC,CAAC;IACzE,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAED,IAAa,+BAA+B,GAA5C,MAAa,+BAAgC,SAAQ,gBAA0E;IAC3H,YAC6B,mBAAyC,EACzC,iBAAoC,EACrD,SAAoB;QAE5B,KAAK,CAAC,SAAS,CAAC,CAAC;QAJQ,wBAAmB,GAAnB,mBAAmB,CAAsB;QACzC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAIjE,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAAwC;QACpE,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,kBAAM,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;QACzG,IAAI,OAAO,WAAW,KAAK,WAAW,EAAE,CAAC;YACrC,OAAO,iBAAM,CAAC,IAAI,CAAC,wBAAU,CAAC,UAAU,CAAC,uBAAuB,EAAE,CAAC,CAAC;QACxE,CAAC;QAED,MAAM,eAAe,GAAiC;YACl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ributesController } from "@nmshd/consumption";
3
+ import { AttributeValues } from "@nmshd/content";
4
+ import { AccountController, MessageController } from "@nmshd/transport";
5
+ import { LocalAttributeDTO } from "../../../types";
6
+ import { AttributeIdString, ISO8601DateTimeString, SchemaRepository, SchemaValidator, UseCase } from "../../common";
7
+ export interface SucceedRelationshipAttributeAndNotifyPeerResponse {
8
+ predecessor: LocalAttributeDTO;
9
+ successor: LocalAttributeDTO;
10
+ }
11
+ export interface SucceedRelationshipAttributeAndNotifyPeerRequest {
12
+ predecessorId: AttributeIdString;
13
+ successorContent: {
14
+ value: AttributeValues.Relationship.Json;
15
+ validFrom?: ISO8601DateTimeString;
16
+ validTo?: ISO8601DateTimeString;
17
+ };
18
+ }
19
+ declare class Validator extends SchemaValidator<SucceedRelationshipAttributeAndNotifyPeerRequest> {
20
+ constructor(schemaRepository: SchemaRepository);
21
+ }
22
+ export declare class SucceedRelationshipAttributeAndNotifyPeerUseCase extends UseCase<SucceedRelationshipAttributeAndNotifyPeerRequest, SucceedRelationshipAttributeAndNotifyPeerResponse> {
23
+ private readonly accountController;
24
+ private readonly attributeController;
25
+ private readonly messageController;
26
+ constructor(accountController: AccountController, attributeController: AttributesController, messageController: MessageController, validator: Validator);
27
+ protected executeInternal(request: SucceedRelationshipAttributeAndNotifyPeerRequest): Promise<Result<SucceedRelationshipAttributeAndNotifyPeerResponse>>;
28
+ }
29
+ export {};
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.SucceedRelationshipAttributeAndNotifyPeerUseCase = void 0;
16
+ const ts_utils_1 = require("@js-soft/ts-utils");
17
+ const consumption_1 = require("@nmshd/consumption");
18
+ const content_1 = require("@nmshd/content");
19
+ const transport_1 = require("@nmshd/transport");
20
+ const typescript_ioc_1 = require("typescript-ioc");
21
+ const common_1 = require("../../common");
22
+ const AttributeMapper_1 = require("./AttributeMapper");
23
+ let Validator = class Validator extends common_1.SchemaValidator {
24
+ constructor(schemaRepository) {
25
+ super(schemaRepository.getSchema("SucceedRelationshipAttributeAndNotifyPeerRequest"));
26
+ }
27
+ };
28
+ Validator = __decorate([
29
+ __param(0, typescript_ioc_1.Inject),
30
+ __metadata("design:paramtypes", [common_1.SchemaRepository])
31
+ ], Validator);
32
+ let SucceedRelationshipAttributeAndNotifyPeerUseCase = class SucceedRelationshipAttributeAndNotifyPeerUseCase extends common_1.UseCase {
33
+ constructor(accountController, attributeController, messageController, validator) {
34
+ super(validator);
35
+ this.accountController = accountController;
36
+ this.attributeController = attributeController;
37
+ this.messageController = messageController;
38
+ }
39
+ async executeInternal(request) {
40
+ const predecessor = await this.attributeController.getLocalAttribute(transport_1.CoreId.from(request.predecessorId));
41
+ if (typeof predecessor === "undefined") {
42
+ return ts_utils_1.Result.fail(consumption_1.CoreErrors.attributes.predecessorDoesNotExist());
43
+ }
44
+ if (!predecessor.isOwnSharedRelationshipAttribute(this.accountController.identity.address, predecessor.shareInfo?.peer)) {
45
+ return ts_utils_1.Result.fail(consumption_1.CoreErrors.attributes.invalidPredecessor());
46
+ }
47
+ const notificationId = await consumption_1.ConsumptionIds.notification.generate();
48
+ const predecessorId = transport_1.CoreId.from(request.predecessorId);
49
+ const att = {
50
+ "@type": "RelationshipAttribute",
51
+ ...request.successorContent,
52
+ confidentiality: predecessor.content.confidentiality,
53
+ isTechnical: predecessor.content.isTechnical,
54
+ key: predecessor.content.key,
55
+ owner: predecessor.content.owner.toString()
56
+ };
57
+ const successorParams = consumption_1.AttributeSuccessorParams.from({
58
+ content: content_1.RelationshipAttribute.from(att),
59
+ shareInfo: { peer: predecessor.shareInfo.peer, notificationReference: notificationId }
60
+ });
61
+ const validationResult = await this.attributeController.validateOwnSharedRelationshipAttributeSuccession(predecessorId, successorParams);
62
+ if (validationResult.isError()) {
63
+ return ts_utils_1.Result.fail(validationResult.error);
64
+ }
65
+ const { predecessor: updatedPredecessor, successor } = await this.attributeController.succeedOwnSharedRelationshipAttribute(predecessorId, successorParams, false);
66
+ const notificationItem = content_1.PeerSharedAttributeSucceededNotificationItem.from({
67
+ predecessorId: predecessor.id,
68
+ successorId: successor.id,
69
+ successorContent: successor.content
70
+ });
71
+ const notification = content_1.Notification.from({
72
+ id: notificationId,
73
+ items: [notificationItem]
74
+ });
75
+ await this.messageController.sendMessage({
76
+ recipients: [predecessor.shareInfo.peer],
77
+ content: notification
78
+ });
79
+ const response = {
80
+ predecessor: AttributeMapper_1.AttributeMapper.toAttributeDTO(updatedPredecessor),
81
+ successor: AttributeMapper_1.AttributeMapper.toAttributeDTO(successor)
82
+ };
83
+ return ts_utils_1.Result.ok(response);
84
+ }
85
+ };
86
+ exports.SucceedRelationshipAttributeAndNotifyPeerUseCase = SucceedRelationshipAttributeAndNotifyPeerUseCase;
87
+ exports.SucceedRelationshipAttributeAndNotifyPeerUseCase = SucceedRelationshipAttributeAndNotifyPeerUseCase = __decorate([
88
+ __param(0, typescript_ioc_1.Inject),
89
+ __param(1, typescript_ioc_1.Inject),
90
+ __param(2, typescript_ioc_1.Inject),
91
+ __param(3, typescript_ioc_1.Inject),
92
+ __metadata("design:paramtypes", [transport_1.AccountController,
93
+ consumption_1.AttributesController,
94
+ transport_1.MessageController,
95
+ Validator])
96
+ ], SucceedRelationshipAttributeAndNotifyPeerUseCase);
97
+ //# sourceMappingURL=SucceedRelationshipAttributeAndNotifyPeer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SucceedRelationshipAttributeAndNotifyPeer.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/SucceedRelationshipAttributeAndNotifyPeer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAAgH;AAChH,4CAA+J;AAC/J,gDAAgF;AAChF,mDAAwC;AAExC,yCAAoH;AACpH,uDAAoD;AAgBpD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAAiE;IACrF,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,kDAAkD,CAAC,CAAC,CAAC;IAC1F,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAED,IAAa,gDAAgD,GAA7D,MAAa,gDAAiD,SAAQ,gBAA4G;IAC9K,YAC6B,iBAAoC,EACpC,mBAAyC,EACzC,iBAAoC,EACrD,SAAoB;QAE5B,KAAK,CAAC,SAAS,CAAC,CAAC;QALQ,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,wBAAmB,GAAnB,mBAAmB,CAAsB;QACzC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAIjE,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAAyD;QACrF,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,kBAAM,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;QACzG,IAAI,OAAO,WAAW,KAAK,WAAW,EAAE,CAAC;YACrC,OAAO,iBAAM,CAAC,IAAI,CAAC,wBAAU,CAAC,UAAU,CAAC,uBAAuB,EAAE,CAAC,CAAC;QACxE,CAAC;QACD,IAAI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,CAAC,mBAAmB,CAAC,qCAAqC,CAAC,aAAa,EAAE,eAAe,EAAE,KAAK,CAAC,CAAC;QAEnK,MAAM,gBAAgB,GAAG,sDAA4C,CAAC,IAAI,CAAC;YACvE,aAAa,EAAE,WAAW,CAAC,EAAE;YAC7B,WAAW,EAAE,SAAS,CAAC,EAAE;YACzB,gBAAgB,EAAE,SAAS,CAAC,OAAO;SACtC,CAAC,CAAC;QACH,MAAM,YAAY,GAAG,sBAAY,CAAC,IAAI,CAAC;YACnC,EAAE,EAAE,cAAc;YAClB,KAAK,EAAE,CAAC,gBAAgB,CAAC;SAC5B,CAAC,CAAC;QACH,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC;YACrC,UAAU,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC;YACxC,OAAO,EAAE,YAAY;SACxB,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAsD;YAChE,WAAW,EAAE,iCAAe,CAAC,cAAc,CAAC,kBAAkB,CAAC;YAC/D,SAAS,EAAE,iCAAe,CAAC,cAAc,CAAC,SAAS,CAAC;SACvD,CAAC;QAEF,OAAO,iBAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;CACJ,CAAA;AA7DY,4GAAgD;2DAAhD,gDAAgD;IAEpD,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAHqC,6BAAiB;QACf,kCAAoB;QACtB,6BAAiB;QAC1C,SAAS;GALvB,gDAAgD,CA6D5D"}
@@ -1,10 +1,10 @@
1
1
  import { Result } from "@js-soft/ts-utils";
2
- import { IIQLQuery, IQLQueryJSON } from "@nmshd/content";
2
+ import { IQLQueryJSON } from "@nmshd/content";
3
3
  import { IValidateResult } from "@nmshd/iql";
4
4
  import { SchemaRepository, SchemaValidator, UseCase } from "../../common";
5
5
  export type ValidateIQLQueryResponse = IValidateResult;
6
6
  export interface ValidateIQLQueryRequest {
7
- query: IIQLQuery | IQLQueryJSON;
7
+ query: IQLQueryJSON;
8
8
  }
9
9
  declare class Validator extends SchemaValidator<ValidateIQLQueryRequest> {
10
10
  constructor(schemaRepository: SchemaRepository);
@@ -1 +1 @@
1
- {"version":3,"file":"ValidateIQLQuery.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/ValidateIQLQuery.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,4CAAmE;AACnE,oCAAsE;AACtE,mDAAwC;AACxC,yCAA0E;AAQ1E,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAAwC;IAC5D,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC,CAAC;IACjE,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAED,IAAa,uBAAuB,GAApC,MAAa,uBAAwB,SAAQ,gBAA0D;IACnG,YAA2B,SAAoB;QAC3C,KAAK,CAAC,SAAS,CAAC,CAAC;IACrB,CAAC;IAES,eAAe,CAAC,OAAgC;QACtD,MAAM,KAAK,GAAG,kBAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3C,MAAM,gBAAgB,GAAG,IAAA,cAAW,EAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACxD,OAAO,iBAAM,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC;IACvC,CAAC;CACJ,CAAA;AAVY,0DAAuB;kCAAvB,uBAAuB;IACZ,WAAA,uBAAM,CAAA;qCAAY,SAAS;GADtC,uBAAuB,CAUnC"}
1
+ {"version":3,"file":"ValidateIQLQuery.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/ValidateIQLQuery.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,4CAAwD;AACxD,oCAAsE;AACtE,mDAAwC;AACxC,yCAA0E;AAQ1E,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAAwC;IAC5D,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC,CAAC;IACjE,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAED,IAAa,uBAAuB,GAApC,MAAa,uBAAwB,SAAQ,gBAA0D;IACnG,YAA2B,SAAoB;QAC3C,KAAK,CAAC,SAAS,CAAC,CAAC;IACrB,CAAC;IAES,eAAe,CAAC,OAAgC;QACtD,MAAM,KAAK,GAAG,kBAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3C,MAAM,gBAAgB,GAAG,IAAA,cAAW,EAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACxD,OAAO,iBAAM,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC;IACvC,CAAC;CACJ,CAAA;AAVY,0DAAuB;kCAAvB,uBAAuB;IACZ,WAAA,uBAAM,CAAA;qCAAY,SAAS;GADtC,uBAAuB,CAUnC"}
@@ -1,16 +1,16 @@
1
1
  export * from "./AttributeMapper";
2
- export * from "./CreateAttribute";
3
- export * from "./CreateSharedAttributeCopy";
4
- export * from "./DeleteAttribute";
2
+ export * from "./CreateAndShareRelationshipAttribute";
3
+ export * from "./CreateIdentityAttribute";
5
4
  export * from "./ExecuteIdentityAttributeQuery";
6
5
  export * from "./ExecuteIQLQuery";
7
6
  export * from "./ExecuteRelationshipAttributeQuery";
8
7
  export * from "./ExecuteThirdPartyRelationshipAttributeQuery";
9
8
  export * from "./GetAttribute";
10
9
  export * from "./GetAttributes";
11
- export * from "./GetPeerAttributes";
12
- export * from "./GetSharedToPeerAttributes";
13
- export * from "./ShareAttribute";
14
- export * from "./SucceedAttribute";
15
- export * from "./UpdateAttribute";
10
+ export * from "./GetOwnSharedAttributes";
11
+ export * from "./GetPeerSharedAttributes";
12
+ export * from "./NotifyPeerAboutIdentityAttributeSuccession";
13
+ export * from "./ShareIdentityAttribute";
14
+ export * from "./SucceedIdentityAttribute";
15
+ export * from "./SucceedRelationshipAttributeAndNotifyPeer";
16
16
  export * from "./ValidateIQLQuery";