@nmshd/runtime 2.0.0-beta.2 → 2.0.0-beta.5
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.
- package/dist/Runtime.d.ts +3 -2
- package/dist/Runtime.js +8 -6
- package/dist/Runtime.js.map +1 -1
- package/dist/buildInformation.js +5 -5
- package/dist/dataViews/DataViewExpander.d.ts +3 -3
- package/dist/dataViews/DataViewExpander.js +63 -34
- package/dist/dataViews/DataViewExpander.js.map +1 -1
- package/dist/dataViews/consumption/LocalAttributeDVO.d.ts +3 -3
- package/dist/dataViews/consumption/RelationshipSettingDVO.d.ts +5 -0
- package/dist/{types/consumption/RelationshipInfoDTO.js → dataViews/consumption/RelationshipSettingDVO.js} +1 -1
- package/dist/dataViews/consumption/RelationshipSettingDVO.js.map +1 -0
- package/dist/dataViews/consumption/index.d.ts +1 -0
- package/dist/dataViews/consumption/index.js +1 -0
- package/dist/dataViews/consumption/index.js.map +1 -1
- package/dist/dataViews/transport/RelationshipDVO.d.ts +5 -1
- package/dist/dataViews/transport/RelationshipDVO.js.map +1 -1
- package/dist/events/EventProxy.d.ts +12 -0
- package/dist/events/EventProxy.js +112 -0
- package/dist/events/EventProxy.js.map +1 -0
- package/dist/events/consumption/index.d.ts +12 -0
- package/dist/events/consumption/index.js +29 -0
- package/dist/events/consumption/index.js.map +1 -0
- package/dist/events/index.d.ts +3 -23
- package/dist/events/index.js +3 -23
- package/dist/events/index.js.map +1 -1
- package/dist/events/runtime/index.d.ts +5 -0
- package/dist/events/runtime/index.js +22 -0
- package/dist/events/runtime/index.js.map +1 -0
- package/dist/events/transport/MessageDeliveredEvent.d.ts +6 -0
- package/dist/events/transport/MessageDeliveredEvent.js +13 -0
- package/dist/events/transport/MessageDeliveredEvent.js.map +1 -0
- package/dist/events/transport/index.d.ts +5 -0
- package/dist/events/transport/index.js +22 -0
- package/dist/events/transport/index.js.map +1 -0
- package/dist/modules/RequestModule.js +25 -3
- package/dist/modules/RequestModule.js.map +1 -1
- package/dist/types/consumption/SettingDTO.d.ts +0 -1
- package/dist/types/consumption/index.d.ts +0 -4
- package/dist/types/consumption/index.js +0 -4
- package/dist/types/consumption/index.js.map +1 -1
- package/dist/useCases/consumption/attributes/CreateAttribute.d.ts +3 -5
- package/dist/useCases/consumption/attributes/CreateAttribute.js +2 -11
- package/dist/useCases/consumption/attributes/CreateAttribute.js.map +1 -1
- package/dist/useCases/consumption/attributes/CreateSharedAttributeCopy.d.ts +3 -5
- package/dist/useCases/consumption/attributes/CreateSharedAttributeCopy.js +2 -11
- package/dist/useCases/consumption/attributes/CreateSharedAttributeCopy.js.map +1 -1
- package/dist/useCases/consumption/attributes/DeleteAttribute.d.ts +3 -5
- package/dist/useCases/consumption/attributes/DeleteAttribute.js +1 -10
- package/dist/useCases/consumption/attributes/DeleteAttribute.js.map +1 -1
- package/dist/useCases/consumption/attributes/SucceedAttribute.d.ts +3 -5
- package/dist/useCases/consumption/attributes/SucceedAttribute.js +2 -11
- package/dist/useCases/consumption/attributes/SucceedAttribute.js.map +1 -1
- package/dist/useCases/consumption/attributes/UpdateAttribute.d.ts +3 -5
- package/dist/useCases/consumption/attributes/UpdateAttribute.js +2 -11
- package/dist/useCases/consumption/attributes/UpdateAttribute.js.map +1 -1
- package/dist/useCases/consumption/requests/AcceptIncomingRequest.d.ts +2 -3
- package/dist/useCases/consumption/requests/AcceptIncomingRequest.js +3 -13
- package/dist/useCases/consumption/requests/AcceptIncomingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/CheckPrerequisitesOfIncomingRequest.d.ts +2 -3
- package/dist/useCases/consumption/requests/CheckPrerequisitesOfIncomingRequest.js +3 -14
- package/dist/useCases/consumption/requests/CheckPrerequisitesOfIncomingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/CompleteIncomingRequest.d.ts +2 -3
- package/dist/useCases/consumption/requests/CompleteIncomingRequest.js +2 -12
- package/dist/useCases/consumption/requests/CompleteIncomingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/CompleteOutgoingRequest.d.ts +2 -3
- package/dist/useCases/consumption/requests/CompleteOutgoingRequest.js +3 -13
- package/dist/useCases/consumption/requests/CompleteOutgoingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/CreateAndCompleteOutgoingRequestFromRelationshipCreationChange.d.ts +2 -3
- package/dist/useCases/consumption/requests/CreateAndCompleteOutgoingRequestFromRelationshipCreationChange.js +3 -9
- package/dist/useCases/consumption/requests/CreateAndCompleteOutgoingRequestFromRelationshipCreationChange.js.map +1 -1
- package/dist/useCases/consumption/requests/CreateOutgoingRequest.d.ts +2 -3
- package/dist/useCases/consumption/requests/CreateOutgoingRequest.js +3 -8
- package/dist/useCases/consumption/requests/CreateOutgoingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/ReceivedIncomingRequest.d.ts +2 -3
- package/dist/useCases/consumption/requests/ReceivedIncomingRequest.js +3 -9
- package/dist/useCases/consumption/requests/ReceivedIncomingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/RejectIncomingRequest.d.ts +2 -3
- package/dist/useCases/consumption/requests/RejectIncomingRequest.js +3 -13
- package/dist/useCases/consumption/requests/RejectIncomingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/RequireManualDecisionOfIncomingRequest.d.ts +2 -3
- package/dist/useCases/consumption/requests/RequireManualDecisionOfIncomingRequest.js +3 -12
- package/dist/useCases/consumption/requests/RequireManualDecisionOfIncomingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/SentOutgoingRequest.d.ts +2 -3
- package/dist/useCases/consumption/requests/SentOutgoingRequest.js +3 -14
- package/dist/useCases/consumption/requests/SentOutgoingRequest.js.map +1 -1
- package/dist/useCases/consumption/settings/SettingMapper.js +0 -1
- package/dist/useCases/consumption/settings/SettingMapper.js.map +1 -1
- package/dist/useCases/transport/account/SyncEverything.d.ts +3 -7
- package/dist/useCases/transport/account/SyncEverything.js +2 -33
- package/dist/useCases/transport/account/SyncEverything.js.map +1 -1
- package/dist/useCases/transport/messages/SendMessage.d.ts +3 -5
- package/dist/useCases/transport/messages/SendMessage.js +1 -10
- package/dist/useCases/transport/messages/SendMessage.js.map +1 -1
- package/dist/useCases/transport/relationshipTemplates/LoadPeerRelationshipTemplate.d.ts +2 -3
- package/dist/useCases/transport/relationshipTemplates/LoadPeerRelationshipTemplate.js +1 -9
- package/dist/useCases/transport/relationshipTemplates/LoadPeerRelationshipTemplate.js.map +1 -1
- package/dist/useCases/transport/relationships/AcceptRelationshipChange.d.ts +3 -5
- package/dist/useCases/transport/relationships/AcceptRelationshipChange.js +2 -11
- package/dist/useCases/transport/relationships/AcceptRelationshipChange.js.map +1 -1
- package/dist/useCases/transport/relationships/CreateRelationship.d.ts +3 -5
- package/dist/useCases/transport/relationships/CreateRelationship.js +2 -11
- package/dist/useCases/transport/relationships/CreateRelationship.js.map +1 -1
- package/dist/useCases/transport/relationships/RejectRelationshipChange.d.ts +3 -5
- package/dist/useCases/transport/relationships/RejectRelationshipChange.js +2 -11
- package/dist/useCases/transport/relationships/RejectRelationshipChange.js.map +1 -1
- package/dist/useCases/transport/relationships/RevokeRelationshipChange.d.ts +3 -5
- package/dist/useCases/transport/relationships/RevokeRelationshipChange.js +2 -11
- package/dist/useCases/transport/relationships/RevokeRelationshipChange.js.map +1 -1
- package/lib-web/nmshd.runtime.js +408 -431
- package/lib-web/nmshd.runtime.js.map +1 -1
- package/lib-web/nmshd.runtime.min.js +3 -3
- package/lib-web/nmshd.runtime.min.js.map +1 -1
- package/package.json +3 -3
- package/dist/events/transport/TransportLibraryInitializedEvent.d.ts +0 -5
- package/dist/events/transport/TransportLibraryInitializedEvent.js +0 -12
- package/dist/events/transport/TransportLibraryInitializedEvent.js.map +0 -1
- package/dist/events/transport/TransportLibraryInitializingEvent.d.ts +0 -5
- package/dist/events/transport/TransportLibraryInitializingEvent.js +0 -12
- package/dist/events/transport/TransportLibraryInitializingEvent.js.map +0 -1
- package/dist/types/consumption/RelationshipAttributeDTO.d.ts +0 -6
- package/dist/types/consumption/RelationshipAttributeDTO.js +0 -3
- package/dist/types/consumption/RelationshipAttributeDTO.js.map +0 -1
- package/dist/types/consumption/RelationshipInfoDTO.d.ts +0 -13
- package/dist/types/consumption/RelationshipInfoDTO.js.map +0 -1
- package/dist/types/consumption/RelationshipThemeDTO.d.ts +0 -6
- package/dist/types/consumption/RelationshipThemeDTO.js +0 -3
- package/dist/types/consumption/RelationshipThemeDTO.js.map +0 -1
- package/dist/types/consumption/SharedItemDTO.d.ts +0 -12
- package/dist/types/consumption/SharedItemDTO.js +0 -3
- package/dist/types/consumption/SharedItemDTO.js.map +0 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.EventProxy = void 0;
|
|
27
|
+
const consumption = __importStar(require("@nmshd/consumption"));
|
|
28
|
+
const transport = __importStar(require("@nmshd/transport"));
|
|
29
|
+
const useCases_1 = require("../useCases");
|
|
30
|
+
const RequestMapper_1 = require("../useCases/consumption/requests/RequestMapper");
|
|
31
|
+
const consumption_1 = require("./consumption");
|
|
32
|
+
const transport_1 = require("./transport");
|
|
33
|
+
class EventProxy {
|
|
34
|
+
constructor(targetEventBus, sourceEventBus) {
|
|
35
|
+
this.targetEventBus = targetEventBus;
|
|
36
|
+
this.sourceEventBus = sourceEventBus;
|
|
37
|
+
this.subscriptionIds = [];
|
|
38
|
+
}
|
|
39
|
+
start() {
|
|
40
|
+
if (this.subscriptionIds.length > 0)
|
|
41
|
+
throw new Error("EventProxy is already started");
|
|
42
|
+
this.proxyConsumptionEvents();
|
|
43
|
+
this.proxyTransportEvents();
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
proxyTransportEvents() {
|
|
47
|
+
this.subscribeToSourceEvent(transport.MessageDeliveredEvent, (event) => {
|
|
48
|
+
this.targetEventBus.publish(new transport_1.MessageDeliveredEvent(event.eventTargetAddress, useCases_1.MessageMapper.toMessageDTO(event.data)));
|
|
49
|
+
});
|
|
50
|
+
this.subscribeToSourceEvent(transport.MessageReceivedEvent, (event) => {
|
|
51
|
+
this.targetEventBus.publish(new transport_1.MessageReceivedEvent(event.eventTargetAddress, useCases_1.MessageMapper.toMessageDTO(event.data)));
|
|
52
|
+
});
|
|
53
|
+
this.subscribeToSourceEvent(transport.MessageSentEvent, (event) => {
|
|
54
|
+
this.targetEventBus.publish(new transport_1.MessageSentEvent(event.eventTargetAddress, useCases_1.MessageMapper.toMessageDTO(event.data)));
|
|
55
|
+
});
|
|
56
|
+
this.subscribeToSourceEvent(transport.PeerRelationshipTemplateLoadedEvent, (event) => {
|
|
57
|
+
this.targetEventBus.publish(new transport_1.PeerRelationshipTemplateLoadedEvent(event.eventTargetAddress, useCases_1.RelationshipTemplateMapper.toRelationshipTemplateDTO(event.data)));
|
|
58
|
+
});
|
|
59
|
+
this.subscribeToSourceEvent(transport.RelationshipChangedEvent, (event) => {
|
|
60
|
+
this.targetEventBus.publish(new transport_1.RelationshipChangedEvent(event.eventTargetAddress, useCases_1.RelationshipMapper.toRelationshipDTO(event.data)));
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
proxyConsumptionEvents() {
|
|
64
|
+
this.subscribeToSourceEvent(consumption.AttributeCreatedEvent, (event) => {
|
|
65
|
+
this.targetEventBus.publish(new consumption_1.AttributeCreatedEvent(event.eventTargetAddress, useCases_1.AttributeMapper.toAttributeDTO(event.data)));
|
|
66
|
+
});
|
|
67
|
+
this.subscribeToSourceEvent(consumption.AttributeDeletedEvent, (event) => {
|
|
68
|
+
this.targetEventBus.publish(new consumption_1.AttributeDeletedEvent(event.eventTargetAddress, useCases_1.AttributeMapper.toAttributeDTO(event.data)));
|
|
69
|
+
});
|
|
70
|
+
this.subscribeToSourceEvent(consumption.AttributeSucceededEvent, (event) => {
|
|
71
|
+
this.targetEventBus.publish(new consumption_1.AttributeSucceededEvent(event.eventTargetAddress, useCases_1.AttributeMapper.toAttributeDTO(event.data)));
|
|
72
|
+
});
|
|
73
|
+
this.subscribeToSourceEvent(consumption.AttributeUpdatedEvent, (event) => {
|
|
74
|
+
this.targetEventBus.publish(new consumption_1.AttributeUpdatedEvent(event.eventTargetAddress, useCases_1.AttributeMapper.toAttributeDTO(event.data)));
|
|
75
|
+
});
|
|
76
|
+
this.subscribeToSourceEvent(consumption.IncomingRequestReceivedEvent, (event) => {
|
|
77
|
+
this.targetEventBus.publish(new consumption_1.IncomingRequestReceivedEvent(event.eventTargetAddress, RequestMapper_1.RequestMapper.toLocalRequestDTO(event.data)));
|
|
78
|
+
});
|
|
79
|
+
this.subscribeToSourceEvent(consumption.IncomingRequestStatusChangedEvent, (event) => {
|
|
80
|
+
this.targetEventBus.publish(new consumption_1.IncomingRequestStatusChangedEvent(event.eventTargetAddress, {
|
|
81
|
+
request: RequestMapper_1.RequestMapper.toLocalRequestDTO(event.data.request),
|
|
82
|
+
oldStatus: event.data.oldStatus,
|
|
83
|
+
newStatus: event.data.newStatus
|
|
84
|
+
}));
|
|
85
|
+
});
|
|
86
|
+
this.subscribeToSourceEvent(consumption.OutgoingRequestCreatedEvent, (event) => {
|
|
87
|
+
this.targetEventBus.publish(new consumption_1.OutgoingRequestCreatedEvent(event.eventTargetAddress, RequestMapper_1.RequestMapper.toLocalRequestDTO(event.data)));
|
|
88
|
+
});
|
|
89
|
+
this.subscribeToSourceEvent(consumption.OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent, (event) => {
|
|
90
|
+
this.targetEventBus.publish(new consumption_1.OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent(event.eventTargetAddress, RequestMapper_1.RequestMapper.toLocalRequestDTO(event.data)));
|
|
91
|
+
});
|
|
92
|
+
this.subscribeToSourceEvent(consumption.OutgoingRequestStatusChangedEvent, (event) => {
|
|
93
|
+
this.targetEventBus.publish(new consumption_1.OutgoingRequestStatusChangedEvent(event.eventTargetAddress, {
|
|
94
|
+
request: RequestMapper_1.RequestMapper.toLocalRequestDTO(event.data.request),
|
|
95
|
+
oldStatus: event.data.oldStatus,
|
|
96
|
+
newStatus: event.data.newStatus
|
|
97
|
+
}));
|
|
98
|
+
});
|
|
99
|
+
this.subscribeToSourceEvent(consumption.SharedAttributeCopyCreatedEvent, (event) => {
|
|
100
|
+
this.targetEventBus.publish(new consumption_1.SharedAttributeCopyCreatedEvent(event.eventTargetAddress, useCases_1.AttributeMapper.toAttributeDTO(event.data)));
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
subscribeToSourceEvent(subscriptionTarget, handler) {
|
|
104
|
+
const subscriptionId = this.sourceEventBus.subscribe(subscriptionTarget, handler);
|
|
105
|
+
this.subscriptionIds.push(subscriptionId);
|
|
106
|
+
}
|
|
107
|
+
stop() {
|
|
108
|
+
this.subscriptionIds.forEach((id) => this.sourceEventBus.unsubscribe(id));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
exports.EventProxy = EventProxy;
|
|
112
|
+
//# sourceMappingURL=EventProxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventProxy.js","sourceRoot":"","sources":["../../src/events/EventProxy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gEAAkD;AAClD,4DAA8C;AAC9C,0CAA6G;AAC7G,kFAA+E;AAC/E,+CAWuB;AACvB,2CAA2J;AAE3J,MAAa,UAAU;IAGnB,YAAoC,cAAwB,EAAmB,cAAwB;QAAnE,mBAAc,GAAd,cAAc,CAAU;QAAmB,mBAAc,GAAd,cAAc,CAAU;QAFtF,oBAAe,GAAa,EAAE,CAAC;IAE0D,CAAC;IAEpG,KAAK;QACR,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAEtF,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC9B,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC;IAChB,CAAC;IAEO,oBAAoB;QACxB,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,qBAAqB,EAAE,CAAC,KAAK,EAAE,EAAE;YACnE,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,iCAAqB,CAAC,KAAK,CAAC,kBAAkB,EAAE,wBAAa,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7H,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,oBAAoB,EAAE,CAAC,KAAK,EAAE,EAAE;YAClE,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,gCAAoB,CAAC,KAA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I,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,6CAA+B,CAAC,KAAK,CAAC,kBAAkB,EAAE,0BAAe,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3I,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,sBAAsB,CAAe,kBAA8C,EAAE,OAA6B;QACtH,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;QAClF,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC9C,CAAC;IAEM,IAAI;QACP,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;CACJ;AAnGD,gCAmGC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./AttributeCreatedEvent";
|
|
2
|
+
export * from "./AttributeDeletedEvent";
|
|
3
|
+
export * from "./AttributeSucceededEvent";
|
|
4
|
+
export * from "./AttributeUpdatedEvent";
|
|
5
|
+
export * from "./IncomingRequestReceivedEvent";
|
|
6
|
+
export * from "./IncomingRequestStatusChangedEvent";
|
|
7
|
+
export * from "./MailReceivedEvent";
|
|
8
|
+
export * from "./OutgoingRequestCreatedEvent";
|
|
9
|
+
export * from "./OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent";
|
|
10
|
+
export * from "./OutgoingRequestStatusChangedEvent";
|
|
11
|
+
export * from "./RelationshipEvent";
|
|
12
|
+
export * from "./SharedAttributeCopyCreatedEvent";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AttributeCreatedEvent"), exports);
|
|
18
|
+
__exportStar(require("./AttributeDeletedEvent"), exports);
|
|
19
|
+
__exportStar(require("./AttributeSucceededEvent"), exports);
|
|
20
|
+
__exportStar(require("./AttributeUpdatedEvent"), exports);
|
|
21
|
+
__exportStar(require("./IncomingRequestReceivedEvent"), exports);
|
|
22
|
+
__exportStar(require("./IncomingRequestStatusChangedEvent"), exports);
|
|
23
|
+
__exportStar(require("./MailReceivedEvent"), exports);
|
|
24
|
+
__exportStar(require("./OutgoingRequestCreatedEvent"), exports);
|
|
25
|
+
__exportStar(require("./OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent"), exports);
|
|
26
|
+
__exportStar(require("./OutgoingRequestStatusChangedEvent"), exports);
|
|
27
|
+
__exportStar(require("./RelationshipEvent"), exports);
|
|
28
|
+
__exportStar(require("./SharedAttributeCopyCreatedEvent"), exports);
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/events/consumption/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,0DAAwC;AACxC,4DAA0C;AAC1C,0DAAwC;AACxC,iEAA+C;AAC/C,sEAAoD;AACpD,sDAAoC;AACpC,gEAA8C;AAC9C,0GAAwF;AACxF,sEAAoD;AACpD,sDAAoC;AACpC,oEAAkD"}
|
package/dist/events/index.d.ts
CHANGED
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
export * from "./consumption
|
|
2
|
-
export * from "./consumption/AttributeDeletedEvent";
|
|
3
|
-
export * from "./consumption/AttributeSucceededEvent";
|
|
4
|
-
export * from "./consumption/AttributeUpdatedEvent";
|
|
5
|
-
export * from "./consumption/IncomingRequestReceivedEvent";
|
|
6
|
-
export * from "./consumption/IncomingRequestStatusChangedEvent";
|
|
7
|
-
export * from "./consumption/MailReceivedEvent";
|
|
8
|
-
export * from "./consumption/OutgoingRequestCreatedEvent";
|
|
9
|
-
export * from "./consumption/OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent";
|
|
10
|
-
export * from "./consumption/OutgoingRequestStatusChangedEvent";
|
|
11
|
-
export * from "./consumption/RelationshipEvent";
|
|
12
|
-
export * from "./consumption/SharedAttributeCopyCreatedEvent";
|
|
1
|
+
export * from "./consumption";
|
|
13
2
|
export * from "./DataEvent";
|
|
14
|
-
export * from "./runtime
|
|
15
|
-
export * from "./
|
|
16
|
-
export * from "./runtime/ModulesStartedEvent";
|
|
17
|
-
export * from "./runtime/RuntimeInitializedEvent";
|
|
18
|
-
export * from "./runtime/RuntimeInitializingEvent";
|
|
19
|
-
export * from "./transport/MessageReceivedEvent";
|
|
20
|
-
export * from "./transport/MessageSentEvent";
|
|
21
|
-
export * from "./transport/PeerRelationshipTemplateLoadedEvent";
|
|
22
|
-
export * from "./transport/RelationshipChangedEvent";
|
|
23
|
-
export * from "./transport/TransportLibraryInitializedEvent";
|
|
24
|
-
export * from "./transport/TransportLibraryInitializingEvent";
|
|
3
|
+
export * from "./runtime";
|
|
4
|
+
export * from "./transport";
|
package/dist/events/index.js
CHANGED
|
@@ -14,28 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./consumption
|
|
18
|
-
__exportStar(require("./consumption/AttributeDeletedEvent"), exports);
|
|
19
|
-
__exportStar(require("./consumption/AttributeSucceededEvent"), exports);
|
|
20
|
-
__exportStar(require("./consumption/AttributeUpdatedEvent"), exports);
|
|
21
|
-
__exportStar(require("./consumption/IncomingRequestReceivedEvent"), exports);
|
|
22
|
-
__exportStar(require("./consumption/IncomingRequestStatusChangedEvent"), exports);
|
|
23
|
-
__exportStar(require("./consumption/MailReceivedEvent"), exports);
|
|
24
|
-
__exportStar(require("./consumption/OutgoingRequestCreatedEvent"), exports);
|
|
25
|
-
__exportStar(require("./consumption/OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent"), exports);
|
|
26
|
-
__exportStar(require("./consumption/OutgoingRequestStatusChangedEvent"), exports);
|
|
27
|
-
__exportStar(require("./consumption/RelationshipEvent"), exports);
|
|
28
|
-
__exportStar(require("./consumption/SharedAttributeCopyCreatedEvent"), exports);
|
|
17
|
+
__exportStar(require("./consumption"), exports);
|
|
29
18
|
__exportStar(require("./DataEvent"), exports);
|
|
30
|
-
__exportStar(require("./runtime
|
|
31
|
-
__exportStar(require("./
|
|
32
|
-
__exportStar(require("./runtime/ModulesStartedEvent"), exports);
|
|
33
|
-
__exportStar(require("./runtime/RuntimeInitializedEvent"), exports);
|
|
34
|
-
__exportStar(require("./runtime/RuntimeInitializingEvent"), exports);
|
|
35
|
-
__exportStar(require("./transport/MessageReceivedEvent"), exports);
|
|
36
|
-
__exportStar(require("./transport/MessageSentEvent"), exports);
|
|
37
|
-
__exportStar(require("./transport/PeerRelationshipTemplateLoadedEvent"), exports);
|
|
38
|
-
__exportStar(require("./transport/RelationshipChangedEvent"), exports);
|
|
39
|
-
__exportStar(require("./transport/TransportLibraryInitializedEvent"), exports);
|
|
40
|
-
__exportStar(require("./transport/TransportLibraryInitializingEvent"), exports);
|
|
19
|
+
__exportStar(require("./runtime"), exports);
|
|
20
|
+
__exportStar(require("./transport"), exports);
|
|
41
21
|
//# sourceMappingURL=index.js.map
|
package/dist/events/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ModulesInitializedEvent"), exports);
|
|
18
|
+
__exportStar(require("./ModulesLoadedEvent"), exports);
|
|
19
|
+
__exportStar(require("./ModulesStartedEvent"), exports);
|
|
20
|
+
__exportStar(require("./RuntimeInitializedEvent"), exports);
|
|
21
|
+
__exportStar(require("./RuntimeInitializingEvent"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/events/runtime/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,uDAAqC;AACrC,wDAAsC;AACtC,4DAA0C;AAC1C,6DAA2C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MessageDTO } from "../../types";
|
|
2
|
+
import { DataEvent } from "../DataEvent";
|
|
3
|
+
export declare class MessageDeliveredEvent extends DataEvent<MessageDTO> {
|
|
4
|
+
static readonly namespace = "transport.messageDelivered";
|
|
5
|
+
constructor(eventTargetAddress: string, data: MessageDTO);
|
|
6
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageDeliveredEvent = void 0;
|
|
4
|
+
const DataEvent_1 = require("../DataEvent");
|
|
5
|
+
// This event is currently not triggered because it is disabled in the backbone. (JSSNMSHDD-2372)
|
|
6
|
+
class MessageDeliveredEvent extends DataEvent_1.DataEvent {
|
|
7
|
+
constructor(eventTargetAddress, data) {
|
|
8
|
+
super(MessageDeliveredEvent.namespace, eventTargetAddress, data);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.MessageDeliveredEvent = MessageDeliveredEvent;
|
|
12
|
+
MessageDeliveredEvent.namespace = "transport.messageDelivered";
|
|
13
|
+
//# sourceMappingURL=MessageDeliveredEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageDeliveredEvent.js","sourceRoot":"","sources":["../../../src/events/transport/MessageDeliveredEvent.ts"],"names":[],"mappings":";;;AACA,4CAAyC;AAEzC,iGAAiG;AACjG,MAAa,qBAAsB,SAAQ,qBAAqB;IAG5D,YAAmB,kBAA0B,EAAE,IAAgB;QAC3D,KAAK,CAAC,qBAAqB,CAAC,SAAS,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAC;IACrE,CAAC;;AALL,sDAMC;AAL0B,+BAAS,GAAG,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./MessageDeliveredEvent"), exports);
|
|
18
|
+
__exportStar(require("./MessageReceivedEvent"), exports);
|
|
19
|
+
__exportStar(require("./MessageSentEvent"), exports);
|
|
20
|
+
__exportStar(require("./PeerRelationshipTemplateLoadedEvent"), exports);
|
|
21
|
+
__exportStar(require("./RelationshipChangedEvent"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/events/transport/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,yDAAuC;AACvC,qDAAmC;AACnC,wEAAsD;AACtD,6DAA2C"}
|
|
@@ -18,12 +18,34 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
|
|
|
18
18
|
this.subscribeToEvent(events_1.RelationshipChangedEvent, this.handleRelationshipChangedEvent.bind(this));
|
|
19
19
|
}
|
|
20
20
|
async handlePeerRelationshipTemplateLoaded(event) {
|
|
21
|
-
|
|
21
|
+
const template = event.data;
|
|
22
|
+
if (template.content["@type"] !== "RelationshipTemplateBody")
|
|
22
23
|
return;
|
|
23
|
-
const body =
|
|
24
|
+
const body = template.content;
|
|
24
25
|
const request = body.onNewRelationship;
|
|
25
26
|
const services = this.runtime.getServices(event.eventTargetAddress);
|
|
26
|
-
await
|
|
27
|
+
const requestResult = await services.consumptionServices.incomingRequests.getRequests({ query: { "source.reference": template.id } });
|
|
28
|
+
if (requestResult.isError) {
|
|
29
|
+
this.logger.error(`Could not get requests for template '${template.id}'. Root error:`, requestResult.error);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (requestResult.value.some((r) => r.status !== consumption_1.LocalRequestStatus.Completed)) {
|
|
33
|
+
// TODO: JSSNMSHDD-3111 (inform caller of `loadPeerRelationshipTemplate` about the Request)
|
|
34
|
+
this.logger.warn(`There is already an open Request for the RelationshipTemplate '${template.id}'. Skipping creation of a new request.`);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const getRelationshipsResult = await services.transportServices.relationships.getRelationships({ query: { peer: template.createdBy } });
|
|
38
|
+
if (getRelationshipsResult.isError) {
|
|
39
|
+
this.logger.error(`Could not get relationships for template '${template.id}'. Root error:`, getRelationshipsResult.error);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (getRelationshipsResult.isSuccess && getRelationshipsResult.value.some((r) => r.status === types_1.RelationshipStatus.Pending || r.status === types_1.RelationshipStatus.Active)) {
|
|
43
|
+
// TODO: use body.onExistingRelationship if exists
|
|
44
|
+
// TODO: JSSNMSHDD-3111 (inform caller of `loadPeerRelationshipTemplate` about the Relationship if body.onExistingRelationship not exists)
|
|
45
|
+
this.logger.warn(`There is already an open or pending Relationship for the RelationshipTemplate '${template.id}'. Skipping creation of a new request.`);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
await this.createIncomingRequest(services, request, template.id);
|
|
27
49
|
}
|
|
28
50
|
async handleMessageReceivedEvent(event) {
|
|
29
51
|
const services = this.runtime.getServices(event.eventTargetAddress);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestModule.js","sourceRoot":"","sources":["../../src/modules/RequestModule.ts"],"names":[],"mappings":";;;AAAA,oDAAwD;AACxD,4CAAgI;AAChI,sCAAqK;AACrK,0EAAuE;AAEvE,oCAA8C;AAE9C,MAAa,aAAc,SAAQ,6BAAa;IACrC,IAAI;QACP,qBAAqB;IACzB,CAAC;IAEM,KAAK;QACR,IAAI,CAAC,gBAAgB,CAAC,4CAAmC,EAAE,IAAI,CAAC,oCAAoC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACjH,IAAI,CAAC,gBAAgB,CAAC,6BAAoB,EAAE,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACxF,IAAI,CAAC,gBAAgB,CAAC,yBAAgB,EAAE,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAChF,IAAI,CAAC,gBAAgB,CAAC,0CAAiC,EAAE,IAAI,CAAC,kCAAkC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7G,IAAI,CAAC,gBAAgB,CAAC,iCAAwB,EAAE,IAAI,CAAC,8BAA8B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACpG,CAAC;IAEO,KAAK,CAAC,oCAAoC,CAAC,KAA0C;QACzF,
|
|
1
|
+
{"version":3,"file":"RequestModule.js","sourceRoot":"","sources":["../../src/modules/RequestModule.ts"],"names":[],"mappings":";;;AAAA,oDAAwD;AACxD,4CAAgI;AA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uC;YAAE,OAAO;QAE5G,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,+CAA+C,CAAC,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAC,CAAC;QACzJ,IAAI,MAAM,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,yDAAyD,UAAU,mBAAmB,oBAAoB,gBAAgB,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5J,OAAO;SACV;IACL,CAAC;IAEM,IAAI;QACP,IAAI,CAAC,wBAAwB,EAAE,CAAC;IACpC,CAAC;CACJ;AAjND,sCAiNC"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
export * from "./DraftDTO";
|
|
2
2
|
export * from "./LocalAttributeDTO";
|
|
3
3
|
export * from "./LocalRequestDTO";
|
|
4
|
-
export * from "./RelationshipAttributeDTO";
|
|
5
|
-
export * from "./RelationshipInfoDTO";
|
|
6
|
-
export * from "./RelationshipThemeDTO";
|
|
7
4
|
export * from "./RequestValidationResultDTO";
|
|
8
5
|
export * from "./SettingDTO";
|
|
9
|
-
export * from "./SharedItemDTO";
|
|
@@ -17,10 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./DraftDTO"), exports);
|
|
18
18
|
__exportStar(require("./LocalAttributeDTO"), exports);
|
|
19
19
|
__exportStar(require("./LocalRequestDTO"), exports);
|
|
20
|
-
__exportStar(require("./RelationshipAttributeDTO"), exports);
|
|
21
|
-
__exportStar(require("./RelationshipInfoDTO"), exports);
|
|
22
|
-
__exportStar(require("./RelationshipThemeDTO"), exports);
|
|
23
20
|
__exportStar(require("./RequestValidationResultDTO"), exports);
|
|
24
21
|
__exportStar(require("./SettingDTO"), exports);
|
|
25
|
-
__exportStar(require("./SharedItemDTO"), exports);
|
|
26
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/consumption/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,sDAAoC;AACpC,oDAAkC;AAClC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/consumption/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,sDAAoC;AACpC,oDAAkC;AAClC,+DAA6C;AAC7C,+CAA6B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Result } from "@js-soft/ts-utils";
|
|
2
2
|
import { LocalAttributesController } from "@nmshd/consumption";
|
|
3
|
-
import { AccountController
|
|
3
|
+
import { AccountController } from "@nmshd/transport";
|
|
4
4
|
import { LocalAttributeDTO } from "../../../types";
|
|
5
5
|
import { SchemaRepository, SchemaValidator, UseCase } from "../../common";
|
|
6
6
|
import { ExtendedIdentityAttributeJSON, ExtendedRelationshipAttributeJSON } from "./ExtendedAttributeValue";
|
|
@@ -13,9 +13,7 @@ declare class Validator extends SchemaValidator<CreateAttributeRequest> {
|
|
|
13
13
|
export declare class CreateAttributeUseCase extends UseCase<CreateAttributeRequest, LocalAttributeDTO> {
|
|
14
14
|
private readonly attributeController;
|
|
15
15
|
private readonly accountController;
|
|
16
|
-
|
|
17
|
-
private readonly eventBus;
|
|
18
|
-
constructor(attributeController: LocalAttributesController, accountController: AccountController, identityController: IdentityController, eventBus: EventBus, validator: Validator);
|
|
16
|
+
constructor(attributeController: LocalAttributesController, accountController: AccountController, validator: Validator);
|
|
19
17
|
protected executeInternal(request: CreateAttributeRequest): Promise<Result<LocalAttributeDTO>>;
|
|
20
18
|
}
|
|
21
19
|
export {};
|
|
@@ -17,7 +17,6 @@ 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");
|
|
19
19
|
const typescript_ioc_1 = require("typescript-ioc");
|
|
20
|
-
const events_1 = require("../../../events");
|
|
21
20
|
const common_1 = require("../../common");
|
|
22
21
|
const AttributeMapper_1 = require("./AttributeMapper");
|
|
23
22
|
let Validator = class Validator extends common_1.SchemaValidator {
|
|
@@ -30,12 +29,10 @@ Validator = __decorate([
|
|
|
30
29
|
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
31
30
|
], Validator);
|
|
32
31
|
let CreateAttributeUseCase = class CreateAttributeUseCase extends common_1.UseCase {
|
|
33
|
-
constructor(attributeController, accountController,
|
|
32
|
+
constructor(attributeController, accountController, validator) {
|
|
34
33
|
super(validator);
|
|
35
34
|
this.attributeController = attributeController;
|
|
36
35
|
this.accountController = accountController;
|
|
37
|
-
this.identityController = identityController;
|
|
38
|
-
this.eventBus = eventBus;
|
|
39
36
|
}
|
|
40
37
|
async executeInternal(request) {
|
|
41
38
|
const params = consumption_1.CreateLocalAttributeParams.from({
|
|
@@ -43,21 +40,15 @@ let CreateAttributeUseCase = class CreateAttributeUseCase extends common_1.UseCa
|
|
|
43
40
|
});
|
|
44
41
|
const createdAttribute = await this.attributeController.createLocalAttribute(params);
|
|
45
42
|
await this.accountController.syncDatawallet();
|
|
46
|
-
|
|
47
|
-
this.eventBus.publish(new events_1.AttributeCreatedEvent(this.identityController.identity.address.toString(), attributeDTO));
|
|
48
|
-
return ts_utils_1.Result.ok(attributeDTO);
|
|
43
|
+
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTO(createdAttribute));
|
|
49
44
|
}
|
|
50
45
|
};
|
|
51
46
|
CreateAttributeUseCase = __decorate([
|
|
52
47
|
__param(0, typescript_ioc_1.Inject),
|
|
53
48
|
__param(1, typescript_ioc_1.Inject),
|
|
54
49
|
__param(2, typescript_ioc_1.Inject),
|
|
55
|
-
__param(3, typescript_ioc_1.Inject),
|
|
56
|
-
__param(4, typescript_ioc_1.Inject),
|
|
57
50
|
__metadata("design:paramtypes", [consumption_1.LocalAttributesController,
|
|
58
51
|
transport_1.AccountController,
|
|
59
|
-
transport_1.IdentityController,
|
|
60
|
-
ts_utils_1.EventBus,
|
|
61
52
|
Validator])
|
|
62
53
|
], CreateAttributeUseCase);
|
|
63
54
|
exports.CreateAttributeUseCase = CreateAttributeUseCase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateAttribute.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/CreateAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"CreateAttribute.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/CreateAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAA2F;AAC3F,gDAAqD;AACrD,mDAAwC;AAExC,yCAA0E;AAC1E,uDAAoD;AAOpD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAAuC;IAC3D,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAChE,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAED,IAAa,sBAAsB,GAAnC,MAAa,sBAAuB,SAAQ,gBAAkD;IAC1F,YAC6B,mBAA8C,EAC9C,iBAAoC,EACrD,SAAoB;QAE5B,KAAK,CAAC,SAAS,CAAC,CAAC;QAJQ,wBAAmB,GAAnB,mBAAmB,CAA2B;QAC9C,sBAAiB,GAAjB,iBAAiB,CAAmB;IAIjE,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAA+B;QAC3D,MAAM,MAAM,GAAG,wCAA0B,CAAC,IAAI,CAAC;YAC3C,OAAO,EAAE,OAAO,CAAC,OAAO;SAC3B,CAAC,CAAC;QACH,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;QACrF,MAAM,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QAE9C,OAAO,iBAAM,CAAC,EAAE,CAAC,iCAAe,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACvE,CAAC;CACJ,CAAA;AAlBY,sBAAsB;IAE1B,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAFuC,uCAAyB;QAC3B,6BAAiB;QAC1C,SAAS;GAJvB,sBAAsB,CAkBlC;AAlBY,wDAAsB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Result } from "@js-soft/ts-utils";
|
|
2
2
|
import { LocalAttributesController } from "@nmshd/consumption";
|
|
3
|
-
import { AccountController
|
|
3
|
+
import { AccountController } from "@nmshd/transport";
|
|
4
4
|
import { LocalAttributeDTO } from "../../../types";
|
|
5
5
|
import { SchemaRepository, SchemaValidator, UseCase } from "../../common";
|
|
6
6
|
export interface CreateSharedAttributeCopyRequest {
|
|
@@ -23,9 +23,7 @@ declare class Validator extends SchemaValidator<CreateSharedAttributeCopyRequest
|
|
|
23
23
|
export declare class CreateSharedAttributeCopyUseCase extends UseCase<CreateSharedAttributeCopyRequest, LocalAttributeDTO> {
|
|
24
24
|
private readonly attributeController;
|
|
25
25
|
private readonly accountController;
|
|
26
|
-
|
|
27
|
-
private readonly eventBus;
|
|
28
|
-
constructor(attributeController: LocalAttributesController, accountController: AccountController, identityController: IdentityController, eventBus: EventBus, validator: Validator);
|
|
26
|
+
constructor(attributeController: LocalAttributesController, accountController: AccountController, validator: Validator);
|
|
29
27
|
protected executeInternal(request: CreateSharedAttributeCopyRequest): Promise<Result<LocalAttributeDTO>>;
|
|
30
28
|
}
|
|
31
29
|
export {};
|
|
@@ -17,7 +17,6 @@ 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");
|
|
19
19
|
const typescript_ioc_1 = require("typescript-ioc");
|
|
20
|
-
const events_1 = require("../../../events");
|
|
21
20
|
const common_1 = require("../../common");
|
|
22
21
|
const AttributeMapper_1 = require("./AttributeMapper");
|
|
23
22
|
let Validator = class Validator extends common_1.SchemaValidator {
|
|
@@ -30,12 +29,10 @@ Validator = __decorate([
|
|
|
30
29
|
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
31
30
|
], Validator);
|
|
32
31
|
let CreateSharedAttributeCopyUseCase = class CreateSharedAttributeCopyUseCase extends common_1.UseCase {
|
|
33
|
-
constructor(attributeController, accountController,
|
|
32
|
+
constructor(attributeController, accountController, validator) {
|
|
34
33
|
super(validator);
|
|
35
34
|
this.attributeController = attributeController;
|
|
36
35
|
this.accountController = accountController;
|
|
37
|
-
this.identityController = identityController;
|
|
38
|
-
this.eventBus = eventBus;
|
|
39
36
|
}
|
|
40
37
|
async executeInternal(request) {
|
|
41
38
|
const params = consumption_1.CreateSharedLocalAttributeCopyParams.from({
|
|
@@ -45,21 +42,15 @@ let CreateSharedAttributeCopyUseCase = class CreateSharedAttributeCopyUseCase ex
|
|
|
45
42
|
});
|
|
46
43
|
const successor = await this.attributeController.createSharedLocalAttributeCopy(params);
|
|
47
44
|
await this.accountController.syncDatawallet();
|
|
48
|
-
|
|
49
|
-
this.eventBus.publish(new events_1.SharedAttributeCopyCreatedEvent(this.identityController.identity.address.toString(), attributeDTO));
|
|
50
|
-
return ts_utils_1.Result.ok(attributeDTO);
|
|
45
|
+
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTO(successor));
|
|
51
46
|
}
|
|
52
47
|
};
|
|
53
48
|
CreateSharedAttributeCopyUseCase = __decorate([
|
|
54
49
|
__param(0, typescript_ioc_1.Inject),
|
|
55
50
|
__param(1, typescript_ioc_1.Inject),
|
|
56
51
|
__param(2, typescript_ioc_1.Inject),
|
|
57
|
-
__param(3, typescript_ioc_1.Inject),
|
|
58
|
-
__param(4, typescript_ioc_1.Inject),
|
|
59
52
|
__metadata("design:paramtypes", [consumption_1.LocalAttributesController,
|
|
60
53
|
transport_1.AccountController,
|
|
61
|
-
transport_1.IdentityController,
|
|
62
|
-
ts_utils_1.EventBus,
|
|
63
54
|
Validator])
|
|
64
55
|
], CreateSharedAttributeCopyUseCase);
|
|
65
56
|
exports.CreateSharedAttributeCopyUseCase = CreateSharedAttributeCopyUseCase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateSharedAttributeCopy.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/CreateSharedAttributeCopy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"CreateSharedAttributeCopy.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/CreateSharedAttributeCopy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAAqG;AACrG,gDAA0E;AAC1E,mDAAwC;AAExC,yCAA0E;AAC1E,uDAAoD;AAiBpD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAAiD;IACrE,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,kCAAkC,CAAC,CAAC,CAAC;IAC1E,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAED,IAAa,gCAAgC,GAA7C,MAAa,gCAAiC,SAAQ,gBAA4D;IAC9G,YAC6B,mBAA8C,EAC9C,iBAAoC,EACrD,SAAoB;QAE5B,KAAK,CAAC,SAAS,CAAC,CAAC;QAJQ,wBAAmB,GAAnB,mBAAmB,CAA2B;QAC9C,sBAAiB,GAAjB,iBAAiB,CAAmB;IAIjE,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAAyC;QACrE,MAAM,MAAM,GAAG,kDAAoC,CAAC,IAAI,CAAC;YACrD,iBAAiB,EAAE,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