@nmshd/runtime 2.0.0-beta.3 → 2.0.0-beta.6

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 (106) hide show
  1. package/dist/Runtime.d.ts +6 -4
  2. package/dist/Runtime.js +18 -8
  3. package/dist/Runtime.js.map +1 -1
  4. package/dist/buildInformation.js +5 -5
  5. package/dist/dataViews/DataViewExpander.js +3 -0
  6. package/dist/dataViews/DataViewExpander.js.map +1 -1
  7. package/dist/events/EventProxy.d.ts +12 -0
  8. package/dist/events/EventProxy.js +112 -0
  9. package/dist/events/EventProxy.js.map +1 -0
  10. package/dist/events/consumption/index.d.ts +12 -0
  11. package/dist/events/consumption/index.js +29 -0
  12. package/dist/events/consumption/index.js.map +1 -0
  13. package/dist/events/index.d.ts +3 -23
  14. package/dist/events/index.js +3 -23
  15. package/dist/events/index.js.map +1 -1
  16. package/dist/events/runtime/index.d.ts +5 -0
  17. package/dist/events/runtime/index.js +22 -0
  18. package/dist/events/runtime/index.js.map +1 -0
  19. package/dist/events/transport/MessageDeliveredEvent.d.ts +6 -0
  20. package/dist/events/transport/MessageDeliveredEvent.js +13 -0
  21. package/dist/events/transport/MessageDeliveredEvent.js.map +1 -0
  22. package/dist/events/transport/index.d.ts +5 -0
  23. package/dist/events/transport/index.js +22 -0
  24. package/dist/events/transport/index.js.map +1 -0
  25. package/dist/modules/RequestModule.js +41 -16
  26. package/dist/modules/RequestModule.js.map +1 -1
  27. package/dist/types/consumption/SettingDTO.d.ts +0 -1
  28. package/dist/useCases/consumption/attributes/CreateAttribute.d.ts +3 -5
  29. package/dist/useCases/consumption/attributes/CreateAttribute.js +2 -11
  30. package/dist/useCases/consumption/attributes/CreateAttribute.js.map +1 -1
  31. package/dist/useCases/consumption/attributes/CreateSharedAttributeCopy.d.ts +3 -5
  32. package/dist/useCases/consumption/attributes/CreateSharedAttributeCopy.js +2 -11
  33. package/dist/useCases/consumption/attributes/CreateSharedAttributeCopy.js.map +1 -1
  34. package/dist/useCases/consumption/attributes/DeleteAttribute.d.ts +3 -5
  35. package/dist/useCases/consumption/attributes/DeleteAttribute.js +1 -10
  36. package/dist/useCases/consumption/attributes/DeleteAttribute.js.map +1 -1
  37. package/dist/useCases/consumption/attributes/SucceedAttribute.d.ts +3 -5
  38. package/dist/useCases/consumption/attributes/SucceedAttribute.js +2 -11
  39. package/dist/useCases/consumption/attributes/SucceedAttribute.js.map +1 -1
  40. package/dist/useCases/consumption/attributes/UpdateAttribute.d.ts +3 -5
  41. package/dist/useCases/consumption/attributes/UpdateAttribute.js +2 -11
  42. package/dist/useCases/consumption/attributes/UpdateAttribute.js.map +1 -1
  43. package/dist/useCases/consumption/requests/AcceptIncomingRequest.d.ts +2 -3
  44. package/dist/useCases/consumption/requests/AcceptIncomingRequest.js +3 -13
  45. package/dist/useCases/consumption/requests/AcceptIncomingRequest.js.map +1 -1
  46. package/dist/useCases/consumption/requests/CheckPrerequisitesOfIncomingRequest.d.ts +2 -3
  47. package/dist/useCases/consumption/requests/CheckPrerequisitesOfIncomingRequest.js +3 -14
  48. package/dist/useCases/consumption/requests/CheckPrerequisitesOfIncomingRequest.js.map +1 -1
  49. package/dist/useCases/consumption/requests/CompleteIncomingRequest.d.ts +2 -3
  50. package/dist/useCases/consumption/requests/CompleteIncomingRequest.js +2 -12
  51. package/dist/useCases/consumption/requests/CompleteIncomingRequest.js.map +1 -1
  52. package/dist/useCases/consumption/requests/CompleteOutgoingRequest.d.ts +2 -3
  53. package/dist/useCases/consumption/requests/CompleteOutgoingRequest.js +3 -13
  54. package/dist/useCases/consumption/requests/CompleteOutgoingRequest.js.map +1 -1
  55. package/dist/useCases/consumption/requests/CreateAndCompleteOutgoingRequestFromRelationshipCreationChange.d.ts +2 -3
  56. package/dist/useCases/consumption/requests/CreateAndCompleteOutgoingRequestFromRelationshipCreationChange.js +3 -9
  57. package/dist/useCases/consumption/requests/CreateAndCompleteOutgoingRequestFromRelationshipCreationChange.js.map +1 -1
  58. package/dist/useCases/consumption/requests/CreateOutgoingRequest.d.ts +2 -3
  59. package/dist/useCases/consumption/requests/CreateOutgoingRequest.js +3 -8
  60. package/dist/useCases/consumption/requests/CreateOutgoingRequest.js.map +1 -1
  61. package/dist/useCases/consumption/requests/ReceivedIncomingRequest.d.ts +2 -3
  62. package/dist/useCases/consumption/requests/ReceivedIncomingRequest.js +3 -9
  63. package/dist/useCases/consumption/requests/ReceivedIncomingRequest.js.map +1 -1
  64. package/dist/useCases/consumption/requests/RejectIncomingRequest.d.ts +2 -3
  65. package/dist/useCases/consumption/requests/RejectIncomingRequest.js +3 -13
  66. package/dist/useCases/consumption/requests/RejectIncomingRequest.js.map +1 -1
  67. package/dist/useCases/consumption/requests/RequireManualDecisionOfIncomingRequest.d.ts +2 -3
  68. package/dist/useCases/consumption/requests/RequireManualDecisionOfIncomingRequest.js +3 -12
  69. package/dist/useCases/consumption/requests/RequireManualDecisionOfIncomingRequest.js.map +1 -1
  70. package/dist/useCases/consumption/requests/SentOutgoingRequest.d.ts +2 -3
  71. package/dist/useCases/consumption/requests/SentOutgoingRequest.js +3 -14
  72. package/dist/useCases/consumption/requests/SentOutgoingRequest.js.map +1 -1
  73. package/dist/useCases/consumption/settings/SettingMapper.js +0 -1
  74. package/dist/useCases/consumption/settings/SettingMapper.js.map +1 -1
  75. package/dist/useCases/transport/account/SyncEverything.d.ts +3 -7
  76. package/dist/useCases/transport/account/SyncEverything.js +2 -33
  77. package/dist/useCases/transport/account/SyncEverything.js.map +1 -1
  78. package/dist/useCases/transport/messages/SendMessage.d.ts +3 -5
  79. package/dist/useCases/transport/messages/SendMessage.js +1 -10
  80. package/dist/useCases/transport/messages/SendMessage.js.map +1 -1
  81. package/dist/useCases/transport/relationshipTemplates/LoadPeerRelationshipTemplate.d.ts +2 -3
  82. package/dist/useCases/transport/relationshipTemplates/LoadPeerRelationshipTemplate.js +1 -9
  83. package/dist/useCases/transport/relationshipTemplates/LoadPeerRelationshipTemplate.js.map +1 -1
  84. package/dist/useCases/transport/relationships/AcceptRelationshipChange.d.ts +3 -5
  85. package/dist/useCases/transport/relationships/AcceptRelationshipChange.js +2 -11
  86. package/dist/useCases/transport/relationships/AcceptRelationshipChange.js.map +1 -1
  87. package/dist/useCases/transport/relationships/CreateRelationship.d.ts +3 -5
  88. package/dist/useCases/transport/relationships/CreateRelationship.js +2 -11
  89. package/dist/useCases/transport/relationships/CreateRelationship.js.map +1 -1
  90. package/dist/useCases/transport/relationships/RejectRelationshipChange.d.ts +3 -5
  91. package/dist/useCases/transport/relationships/RejectRelationshipChange.js +2 -11
  92. package/dist/useCases/transport/relationships/RejectRelationshipChange.js.map +1 -1
  93. package/dist/useCases/transport/relationships/RevokeRelationshipChange.d.ts +3 -5
  94. package/dist/useCases/transport/relationships/RevokeRelationshipChange.js +2 -11
  95. package/dist/useCases/transport/relationships/RevokeRelationshipChange.js.map +1 -1
  96. package/lib-web/nmshd.runtime.js +394 -364
  97. package/lib-web/nmshd.runtime.js.map +1 -1
  98. package/lib-web/nmshd.runtime.min.js +3 -3
  99. package/lib-web/nmshd.runtime.min.js.map +1 -1
  100. package/package.json +4 -4
  101. package/dist/events/transport/TransportLibraryInitializedEvent.d.ts +0 -5
  102. package/dist/events/transport/TransportLibraryInitializedEvent.js +0 -12
  103. package/dist/events/transport/TransportLibraryInitializedEvent.js.map +0 -1
  104. package/dist/events/transport/TransportLibraryInitializingEvent.d.ts +0 -5
  105. package/dist/events/transport/TransportLibraryInitializingEvent.js +0 -12
  106. package/dist/events/transport/TransportLibraryInitializingEvent.js.map +0 -1
@@ -114,17 +114,20 @@ const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modul
114
114
  const DatabaseSchemaUpgrader_1 = __webpack_require__(/*! ./DatabaseSchemaUpgrader */ "./dist/DatabaseSchemaUpgrader.js");
115
115
  const dataViews_1 = __webpack_require__(/*! ./dataViews */ "./dist/dataViews/index.js");
116
116
  const events_1 = __webpack_require__(/*! ./events */ "./dist/events/index.js");
117
+ const EventProxy_1 = __webpack_require__(/*! ./events/EventProxy */ "./dist/events/EventProxy.js");
117
118
  const extensibility_1 = __webpack_require__(/*! ./extensibility */ "./dist/extensibility/index.js");
118
119
  const modules_1 = __webpack_require__(/*! ./modules */ "./dist/modules/index.js");
119
120
  const RuntimeLoggerFactory_1 = __webpack_require__(/*! ./RuntimeLoggerFactory */ "./dist/RuntimeLoggerFactory.js");
120
121
  const useCases_1 = __webpack_require__(/*! ./useCases */ "./dist/useCases/index.js");
121
122
  const SchemaRepository_1 = __webpack_require__(/*! ./useCases/common/SchemaRepository */ "./dist/useCases/common/SchemaRepository.js");
122
123
  class Runtime {
123
- constructor(config) {
124
+ constructor(runtimeConfig) {
125
+ this.runtimeConfig = runtimeConfig;
124
126
  this._isInitialized = false;
125
127
  this._isStarted = false;
126
- this.runtimeConfig = config;
127
- this._eventBus = new ts_utils_1.EventEmitter2EventBus();
128
+ }
129
+ get logger() {
130
+ return this._logger;
128
131
  }
129
132
  get anonymousServices() {
130
133
  return this._anonymousServices;
@@ -164,8 +167,12 @@ class Runtime {
164
167
  if (this._isInitialized) {
165
168
  throw useCases_1.RuntimeErrors.general.alreadyInitialized();
166
169
  }
167
- this.eventBus.publish(new events_1.RuntimeInitializingEvent());
168
170
  this.loggerFactory = await this.createLoggerFactory();
171
+ this._logger = this.loggerFactory.getLogger(this.constructor.name);
172
+ this._eventBus = new ts_utils_1.EventEmitter2EventBus((error, namespace) => {
173
+ this.logger.error(`An error was thrown in an event handler of the runtime event bus (namespace: '${namespace}'). Root error: ${error}`);
174
+ });
175
+ this.eventBus.publish(new events_1.RuntimeInitializingEvent());
169
176
  await this.initDIContainer();
170
177
  await this.initTransportLibrary();
171
178
  await this.initAccount();
@@ -173,6 +180,7 @@ class Runtime {
173
180
  await this.loadModules();
174
181
  await this.initInfrastructure();
175
182
  await this.initModules();
183
+ this._eventProxy = new EventProxy_1.EventProxy(this._eventBus, this.transport.eventBus).start();
176
184
  this._isInitialized = true;
177
185
  this.eventBus.publish(new events_1.RuntimeInitializedEvent());
178
186
  }
@@ -188,15 +196,15 @@ class Runtime {
188
196
  };
189
197
  }
190
198
  async initTransportLibrary() {
191
- this.eventBus.publish(new events_1.TransportLibraryInitializingEvent());
192
199
  this.logger.debug("Initializing Database connection... ");
193
200
  const databaseConnection = await this.createDatabaseConnection();
194
- this.transport = new transport_1.Transport(databaseConnection, this.runtimeConfig.transportLibrary, this.loggerFactory);
201
+ this.transport = new transport_1.Transport(databaseConnection, this.runtimeConfig.transportLibrary, new ts_utils_1.EventEmitter2EventBus((error, namespace) => {
202
+ this.logger.error(`An error was thrown in an event handler of the transport event bus (namespace: '${namespace}'). Root error: ${error}`);
203
+ }), this.loggerFactory);
195
204
  this.logger.debug("Initializing Transport Library...");
196
205
  await this.transport.init();
197
206
  this.logger.debug("Finished initialization of Transport Library.");
198
207
  this._anonymousServices = typescript_ioc_1.Container.get(extensibility_1.AnonymousServices);
199
- this.eventBus.publish(new events_1.TransportLibraryInitializedEvent());
200
208
  }
201
209
  async initDIContainer() {
202
210
  typescript_ioc_1.Container.bind(ts_utils_1.EventBus)
@@ -342,7 +350,9 @@ class Runtime {
342
350
  }
343
351
  await this.stopModules();
344
352
  await this.stopInfrastructure();
345
- await this.eventBus.close();
353
+ await this.transport.eventBus.close();
354
+ this._eventProxy.stop();
355
+ await this._eventBus.close();
346
356
  this.logger.info("Closing AccountController...");
347
357
  await this._accountController?.close();
348
358
  this._accountController = undefined;
@@ -436,11 +446,11 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
436
446
  const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
437
447
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
438
448
  exports.buildInformation = {
439
- version: "2.0.0-beta.3",
440
- build: "89",
441
- date: "2022-07-21T13:40:04+00:00",
442
- commit: "2303603c9a8d836d650a9b7ead5a9b44538756b5",
443
- dependencies: {"@js-soft/docdb-querytranslator":"1.1.0","@js-soft/logging-abstractions":"1.0.0","@js-soft/ts-serval":"2.0.3","@js-soft/ts-utils":"^2.0.1","@nmshd/consumption":"2.0.0-alpha.30","@nmshd/content":"2.0.0-alpha.45","@nmshd/crypto":"2.0.1","@nmshd/transport":"2.0.0-alpha.3","ajv":"^8.11.0","ajv-errors":"^3.0.0","ajv-formats":"^2.1.1","fluent-ts-validator":"3.0.3","json-stringify-safe":"^5.0.1","luxon":"^3.0.1","qrcode":"1.5.1","reflect-metadata":"0.1.13","ts-simple-nameof":"1.3.1","typescript-ioc":"3.2.2"},
449
+ version: "2.0.0-beta.6",
450
+ build: "92",
451
+ date: "2022-07-22T14:32:56+00:00",
452
+ commit: "e6526f0f0d97e341aefff2221810a5ea4db6e4bc",
453
+ dependencies: {"@js-soft/docdb-querytranslator":"1.1.0","@js-soft/logging-abstractions":"1.0.0","@js-soft/ts-serval":"2.0.3","@js-soft/ts-utils":"^2.2.0","@nmshd/consumption":"2.0.0-beta.2","@nmshd/content":"2.0.0-alpha.45","@nmshd/crypto":"2.0.1","@nmshd/transport":"2.0.0-beta.1","ajv":"^8.11.0","ajv-errors":"^3.0.0","ajv-formats":"^2.1.1","fluent-ts-validator":"3.0.3","json-stringify-safe":"^5.0.1","luxon":"^3.0.1","qrcode":"1.5.1","reflect-metadata":"0.1.13","ts-simple-nameof":"1.3.1","typescript-ioc":"3.2.2"},
444
454
  libraries: {
445
455
  serval: ts_serval_1.buildInformation,
446
456
  consumption: consumption_1.buildInformation,
@@ -809,6 +819,9 @@ let DataViewExpander = class DataViewExpander {
809
819
  };
810
820
  case "ProposeAttributeRequestItem":
811
821
  const proposeAttributeRequestItem = requestItem;
822
+ if (localRequestDTO) {
823
+ proposeAttributeRequestItem.attribute.owner = localRequestDTO.isOwn ? localRequestDTO.peer : this.identityController.address.toString();
824
+ }
812
825
  if (isDecidable) {
813
826
  return {
814
827
  ...proposeAttributeRequestItem,
@@ -1865,6 +1878,128 @@ exports.DataEvent = DataEvent;
1865
1878
 
1866
1879
  /***/ }),
1867
1880
 
1881
+ /***/ "./dist/events/EventProxy.js":
1882
+ /*!***********************************!*\
1883
+ !*** ./dist/events/EventProxy.js ***!
1884
+ \***********************************/
1885
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1886
+
1887
+ "use strict";
1888
+
1889
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1890
+ if (k2 === undefined) k2 = k;
1891
+ var desc = Object.getOwnPropertyDescriptor(m, k);
1892
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1893
+ desc = { enumerable: true, get: function() { return m[k]; } };
1894
+ }
1895
+ Object.defineProperty(o, k2, desc);
1896
+ }) : (function(o, m, k, k2) {
1897
+ if (k2 === undefined) k2 = k;
1898
+ o[k2] = m[k];
1899
+ }));
1900
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
1901
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1902
+ }) : function(o, v) {
1903
+ o["default"] = v;
1904
+ });
1905
+ var __importStar = (this && this.__importStar) || function (mod) {
1906
+ if (mod && mod.__esModule) return mod;
1907
+ var result = {};
1908
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1909
+ __setModuleDefault(result, mod);
1910
+ return result;
1911
+ };
1912
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1913
+ exports.EventProxy = void 0;
1914
+ const consumption = __importStar(__webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption"));
1915
+ const transport = __importStar(__webpack_require__(/*! @nmshd/transport */ "@nmshd/transport"));
1916
+ const useCases_1 = __webpack_require__(/*! ../useCases */ "./dist/useCases/index.js");
1917
+ const RequestMapper_1 = __webpack_require__(/*! ../useCases/consumption/requests/RequestMapper */ "./dist/useCases/consumption/requests/RequestMapper.js");
1918
+ const consumption_1 = __webpack_require__(/*! ./consumption */ "./dist/events/consumption/index.js");
1919
+ const transport_1 = __webpack_require__(/*! ./transport */ "./dist/events/transport/index.js");
1920
+ class EventProxy {
1921
+ constructor(targetEventBus, sourceEventBus) {
1922
+ this.targetEventBus = targetEventBus;
1923
+ this.sourceEventBus = sourceEventBus;
1924
+ this.subscriptionIds = [];
1925
+ }
1926
+ start() {
1927
+ if (this.subscriptionIds.length > 0)
1928
+ throw new Error("EventProxy is already started");
1929
+ this.proxyConsumptionEvents();
1930
+ this.proxyTransportEvents();
1931
+ return this;
1932
+ }
1933
+ proxyTransportEvents() {
1934
+ this.subscribeToSourceEvent(transport.MessageDeliveredEvent, (event) => {
1935
+ this.targetEventBus.publish(new transport_1.MessageDeliveredEvent(event.eventTargetAddress, useCases_1.MessageMapper.toMessageDTO(event.data)));
1936
+ });
1937
+ this.subscribeToSourceEvent(transport.MessageReceivedEvent, (event) => {
1938
+ this.targetEventBus.publish(new transport_1.MessageReceivedEvent(event.eventTargetAddress, useCases_1.MessageMapper.toMessageDTO(event.data)));
1939
+ });
1940
+ this.subscribeToSourceEvent(transport.MessageSentEvent, (event) => {
1941
+ this.targetEventBus.publish(new transport_1.MessageSentEvent(event.eventTargetAddress, useCases_1.MessageMapper.toMessageDTO(event.data)));
1942
+ });
1943
+ this.subscribeToSourceEvent(transport.PeerRelationshipTemplateLoadedEvent, (event) => {
1944
+ this.targetEventBus.publish(new transport_1.PeerRelationshipTemplateLoadedEvent(event.eventTargetAddress, useCases_1.RelationshipTemplateMapper.toRelationshipTemplateDTO(event.data)));
1945
+ });
1946
+ this.subscribeToSourceEvent(transport.RelationshipChangedEvent, (event) => {
1947
+ this.targetEventBus.publish(new transport_1.RelationshipChangedEvent(event.eventTargetAddress, useCases_1.RelationshipMapper.toRelationshipDTO(event.data)));
1948
+ });
1949
+ }
1950
+ proxyConsumptionEvents() {
1951
+ this.subscribeToSourceEvent(consumption.AttributeCreatedEvent, (event) => {
1952
+ this.targetEventBus.publish(new consumption_1.AttributeCreatedEvent(event.eventTargetAddress, useCases_1.AttributeMapper.toAttributeDTO(event.data)));
1953
+ });
1954
+ this.subscribeToSourceEvent(consumption.AttributeDeletedEvent, (event) => {
1955
+ this.targetEventBus.publish(new consumption_1.AttributeDeletedEvent(event.eventTargetAddress, useCases_1.AttributeMapper.toAttributeDTO(event.data)));
1956
+ });
1957
+ this.subscribeToSourceEvent(consumption.AttributeSucceededEvent, (event) => {
1958
+ this.targetEventBus.publish(new consumption_1.AttributeSucceededEvent(event.eventTargetAddress, useCases_1.AttributeMapper.toAttributeDTO(event.data)));
1959
+ });
1960
+ this.subscribeToSourceEvent(consumption.AttributeUpdatedEvent, (event) => {
1961
+ this.targetEventBus.publish(new consumption_1.AttributeUpdatedEvent(event.eventTargetAddress, useCases_1.AttributeMapper.toAttributeDTO(event.data)));
1962
+ });
1963
+ this.subscribeToSourceEvent(consumption.IncomingRequestReceivedEvent, (event) => {
1964
+ this.targetEventBus.publish(new consumption_1.IncomingRequestReceivedEvent(event.eventTargetAddress, RequestMapper_1.RequestMapper.toLocalRequestDTO(event.data)));
1965
+ });
1966
+ this.subscribeToSourceEvent(consumption.IncomingRequestStatusChangedEvent, (event) => {
1967
+ this.targetEventBus.publish(new consumption_1.IncomingRequestStatusChangedEvent(event.eventTargetAddress, {
1968
+ request: RequestMapper_1.RequestMapper.toLocalRequestDTO(event.data.request),
1969
+ oldStatus: event.data.oldStatus,
1970
+ newStatus: event.data.newStatus
1971
+ }));
1972
+ });
1973
+ this.subscribeToSourceEvent(consumption.OutgoingRequestCreatedEvent, (event) => {
1974
+ this.targetEventBus.publish(new consumption_1.OutgoingRequestCreatedEvent(event.eventTargetAddress, RequestMapper_1.RequestMapper.toLocalRequestDTO(event.data)));
1975
+ });
1976
+ this.subscribeToSourceEvent(consumption.OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent, (event) => {
1977
+ this.targetEventBus.publish(new consumption_1.OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent(event.eventTargetAddress, RequestMapper_1.RequestMapper.toLocalRequestDTO(event.data)));
1978
+ });
1979
+ this.subscribeToSourceEvent(consumption.OutgoingRequestStatusChangedEvent, (event) => {
1980
+ this.targetEventBus.publish(new consumption_1.OutgoingRequestStatusChangedEvent(event.eventTargetAddress, {
1981
+ request: RequestMapper_1.RequestMapper.toLocalRequestDTO(event.data.request),
1982
+ oldStatus: event.data.oldStatus,
1983
+ newStatus: event.data.newStatus
1984
+ }));
1985
+ });
1986
+ this.subscribeToSourceEvent(consumption.SharedAttributeCopyCreatedEvent, (event) => {
1987
+ this.targetEventBus.publish(new consumption_1.SharedAttributeCopyCreatedEvent(event.eventTargetAddress, useCases_1.AttributeMapper.toAttributeDTO(event.data)));
1988
+ });
1989
+ }
1990
+ subscribeToSourceEvent(subscriptionTarget, handler) {
1991
+ const subscriptionId = this.sourceEventBus.subscribe(subscriptionTarget, handler);
1992
+ this.subscriptionIds.push(subscriptionId);
1993
+ }
1994
+ stop() {
1995
+ this.subscriptionIds.forEach((id) => this.sourceEventBus.unsubscribe(id));
1996
+ }
1997
+ }
1998
+ exports.EventProxy = EventProxy;
1999
+ //# sourceMappingURL=EventProxy.js.map
2000
+
2001
+ /***/ }),
2002
+
1868
2003
  /***/ "./dist/events/consumption/AttributeCreatedEvent.js":
1869
2004
  /*!**********************************************************!*\
1870
2005
  !*** ./dist/events/consumption/AttributeCreatedEvent.js ***!
@@ -2141,6 +2276,45 @@ SharedAttributeCopyCreatedEvent.namespace = "consumption.sharedAttributeCopyCrea
2141
2276
 
2142
2277
  /***/ }),
2143
2278
 
2279
+ /***/ "./dist/events/consumption/index.js":
2280
+ /*!******************************************!*\
2281
+ !*** ./dist/events/consumption/index.js ***!
2282
+ \******************************************/
2283
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2284
+
2285
+ "use strict";
2286
+
2287
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2288
+ if (k2 === undefined) k2 = k;
2289
+ var desc = Object.getOwnPropertyDescriptor(m, k);
2290
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2291
+ desc = { enumerable: true, get: function() { return m[k]; } };
2292
+ }
2293
+ Object.defineProperty(o, k2, desc);
2294
+ }) : (function(o, m, k, k2) {
2295
+ if (k2 === undefined) k2 = k;
2296
+ o[k2] = m[k];
2297
+ }));
2298
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
2299
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2300
+ };
2301
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
2302
+ __exportStar(__webpack_require__(/*! ./AttributeCreatedEvent */ "./dist/events/consumption/AttributeCreatedEvent.js"), exports);
2303
+ __exportStar(__webpack_require__(/*! ./AttributeDeletedEvent */ "./dist/events/consumption/AttributeDeletedEvent.js"), exports);
2304
+ __exportStar(__webpack_require__(/*! ./AttributeSucceededEvent */ "./dist/events/consumption/AttributeSucceededEvent.js"), exports);
2305
+ __exportStar(__webpack_require__(/*! ./AttributeUpdatedEvent */ "./dist/events/consumption/AttributeUpdatedEvent.js"), exports);
2306
+ __exportStar(__webpack_require__(/*! ./IncomingRequestReceivedEvent */ "./dist/events/consumption/IncomingRequestReceivedEvent.js"), exports);
2307
+ __exportStar(__webpack_require__(/*! ./IncomingRequestStatusChangedEvent */ "./dist/events/consumption/IncomingRequestStatusChangedEvent.js"), exports);
2308
+ __exportStar(__webpack_require__(/*! ./MailReceivedEvent */ "./dist/events/consumption/MailReceivedEvent.js"), exports);
2309
+ __exportStar(__webpack_require__(/*! ./OutgoingRequestCreatedEvent */ "./dist/events/consumption/OutgoingRequestCreatedEvent.js"), exports);
2310
+ __exportStar(__webpack_require__(/*! ./OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent */ "./dist/events/consumption/OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent.js"), exports);
2311
+ __exportStar(__webpack_require__(/*! ./OutgoingRequestStatusChangedEvent */ "./dist/events/consumption/OutgoingRequestStatusChangedEvent.js"), exports);
2312
+ __exportStar(__webpack_require__(/*! ./RelationshipEvent */ "./dist/events/consumption/RelationshipEvent.js"), exports);
2313
+ __exportStar(__webpack_require__(/*! ./SharedAttributeCopyCreatedEvent */ "./dist/events/consumption/SharedAttributeCopyCreatedEvent.js"), exports);
2314
+ //# sourceMappingURL=index.js.map
2315
+
2316
+ /***/ }),
2317
+
2144
2318
  /***/ "./dist/events/index.js":
2145
2319
  /*!******************************!*\
2146
2320
  !*** ./dist/events/index.js ***!
@@ -2164,30 +2338,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
2164
2338
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2165
2339
  };
2166
2340
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2167
- __exportStar(__webpack_require__(/*! ./consumption/AttributeCreatedEvent */ "./dist/events/consumption/AttributeCreatedEvent.js"), exports);
2168
- __exportStar(__webpack_require__(/*! ./consumption/AttributeDeletedEvent */ "./dist/events/consumption/AttributeDeletedEvent.js"), exports);
2169
- __exportStar(__webpack_require__(/*! ./consumption/AttributeSucceededEvent */ "./dist/events/consumption/AttributeSucceededEvent.js"), exports);
2170
- __exportStar(__webpack_require__(/*! ./consumption/AttributeUpdatedEvent */ "./dist/events/consumption/AttributeUpdatedEvent.js"), exports);
2171
- __exportStar(__webpack_require__(/*! ./consumption/IncomingRequestReceivedEvent */ "./dist/events/consumption/IncomingRequestReceivedEvent.js"), exports);
2172
- __exportStar(__webpack_require__(/*! ./consumption/IncomingRequestStatusChangedEvent */ "./dist/events/consumption/IncomingRequestStatusChangedEvent.js"), exports);
2173
- __exportStar(__webpack_require__(/*! ./consumption/MailReceivedEvent */ "./dist/events/consumption/MailReceivedEvent.js"), exports);
2174
- __exportStar(__webpack_require__(/*! ./consumption/OutgoingRequestCreatedEvent */ "./dist/events/consumption/OutgoingRequestCreatedEvent.js"), exports);
2175
- __exportStar(__webpack_require__(/*! ./consumption/OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent */ "./dist/events/consumption/OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent.js"), exports);
2176
- __exportStar(__webpack_require__(/*! ./consumption/OutgoingRequestStatusChangedEvent */ "./dist/events/consumption/OutgoingRequestStatusChangedEvent.js"), exports);
2177
- __exportStar(__webpack_require__(/*! ./consumption/RelationshipEvent */ "./dist/events/consumption/RelationshipEvent.js"), exports);
2178
- __exportStar(__webpack_require__(/*! ./consumption/SharedAttributeCopyCreatedEvent */ "./dist/events/consumption/SharedAttributeCopyCreatedEvent.js"), exports);
2341
+ __exportStar(__webpack_require__(/*! ./consumption */ "./dist/events/consumption/index.js"), exports);
2179
2342
  __exportStar(__webpack_require__(/*! ./DataEvent */ "./dist/events/DataEvent.js"), exports);
2180
- __exportStar(__webpack_require__(/*! ./runtime/ModulesInitializedEvent */ "./dist/events/runtime/ModulesInitializedEvent.js"), exports);
2181
- __exportStar(__webpack_require__(/*! ./runtime/ModulesLoadedEvent */ "./dist/events/runtime/ModulesLoadedEvent.js"), exports);
2182
- __exportStar(__webpack_require__(/*! ./runtime/ModulesStartedEvent */ "./dist/events/runtime/ModulesStartedEvent.js"), exports);
2183
- __exportStar(__webpack_require__(/*! ./runtime/RuntimeInitializedEvent */ "./dist/events/runtime/RuntimeInitializedEvent.js"), exports);
2184
- __exportStar(__webpack_require__(/*! ./runtime/RuntimeInitializingEvent */ "./dist/events/runtime/RuntimeInitializingEvent.js"), exports);
2185
- __exportStar(__webpack_require__(/*! ./transport/MessageReceivedEvent */ "./dist/events/transport/MessageReceivedEvent.js"), exports);
2186
- __exportStar(__webpack_require__(/*! ./transport/MessageSentEvent */ "./dist/events/transport/MessageSentEvent.js"), exports);
2187
- __exportStar(__webpack_require__(/*! ./transport/PeerRelationshipTemplateLoadedEvent */ "./dist/events/transport/PeerRelationshipTemplateLoadedEvent.js"), exports);
2188
- __exportStar(__webpack_require__(/*! ./transport/RelationshipChangedEvent */ "./dist/events/transport/RelationshipChangedEvent.js"), exports);
2189
- __exportStar(__webpack_require__(/*! ./transport/TransportLibraryInitializedEvent */ "./dist/events/transport/TransportLibraryInitializedEvent.js"), exports);
2190
- __exportStar(__webpack_require__(/*! ./transport/TransportLibraryInitializingEvent */ "./dist/events/transport/TransportLibraryInitializingEvent.js"), exports);
2343
+ __exportStar(__webpack_require__(/*! ./runtime */ "./dist/events/runtime/index.js"), exports);
2344
+ __exportStar(__webpack_require__(/*! ./transport */ "./dist/events/transport/index.js"), exports);
2191
2345
  //# sourceMappingURL=index.js.map
2192
2346
 
2193
2347
  /***/ }),
@@ -2302,6 +2456,61 @@ RuntimeInitializingEvent.namespace = "runtime.initializing";
2302
2456
 
2303
2457
  /***/ }),
2304
2458
 
2459
+ /***/ "./dist/events/runtime/index.js":
2460
+ /*!**************************************!*\
2461
+ !*** ./dist/events/runtime/index.js ***!
2462
+ \**************************************/
2463
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2464
+
2465
+ "use strict";
2466
+
2467
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2468
+ if (k2 === undefined) k2 = k;
2469
+ var desc = Object.getOwnPropertyDescriptor(m, k);
2470
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2471
+ desc = { enumerable: true, get: function() { return m[k]; } };
2472
+ }
2473
+ Object.defineProperty(o, k2, desc);
2474
+ }) : (function(o, m, k, k2) {
2475
+ if (k2 === undefined) k2 = k;
2476
+ o[k2] = m[k];
2477
+ }));
2478
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
2479
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2480
+ };
2481
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
2482
+ __exportStar(__webpack_require__(/*! ./ModulesInitializedEvent */ "./dist/events/runtime/ModulesInitializedEvent.js"), exports);
2483
+ __exportStar(__webpack_require__(/*! ./ModulesLoadedEvent */ "./dist/events/runtime/ModulesLoadedEvent.js"), exports);
2484
+ __exportStar(__webpack_require__(/*! ./ModulesStartedEvent */ "./dist/events/runtime/ModulesStartedEvent.js"), exports);
2485
+ __exportStar(__webpack_require__(/*! ./RuntimeInitializedEvent */ "./dist/events/runtime/RuntimeInitializedEvent.js"), exports);
2486
+ __exportStar(__webpack_require__(/*! ./RuntimeInitializingEvent */ "./dist/events/runtime/RuntimeInitializingEvent.js"), exports);
2487
+ //# sourceMappingURL=index.js.map
2488
+
2489
+ /***/ }),
2490
+
2491
+ /***/ "./dist/events/transport/MessageDeliveredEvent.js":
2492
+ /*!********************************************************!*\
2493
+ !*** ./dist/events/transport/MessageDeliveredEvent.js ***!
2494
+ \********************************************************/
2495
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2496
+
2497
+ "use strict";
2498
+
2499
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
2500
+ exports.MessageDeliveredEvent = void 0;
2501
+ const DataEvent_1 = __webpack_require__(/*! ../DataEvent */ "./dist/events/DataEvent.js");
2502
+ // This event is currently not triggered because it is disabled in the backbone. (JSSNMSHDD-2372)
2503
+ class MessageDeliveredEvent extends DataEvent_1.DataEvent {
2504
+ constructor(eventTargetAddress, data) {
2505
+ super(MessageDeliveredEvent.namespace, eventTargetAddress, data);
2506
+ }
2507
+ }
2508
+ exports.MessageDeliveredEvent = MessageDeliveredEvent;
2509
+ MessageDeliveredEvent.namespace = "transport.messageDelivered";
2510
+ //# sourceMappingURL=MessageDeliveredEvent.js.map
2511
+
2512
+ /***/ }),
2513
+
2305
2514
  /***/ "./dist/events/transport/MessageReceivedEvent.js":
2306
2515
  /*!*******************************************************!*\
2307
2516
  !*** ./dist/events/transport/MessageReceivedEvent.js ***!
@@ -2390,47 +2599,35 @@ RelationshipChangedEvent.namespace = "transport.relationshipChanged";
2390
2599
 
2391
2600
  /***/ }),
2392
2601
 
2393
- /***/ "./dist/events/transport/TransportLibraryInitializedEvent.js":
2394
- /*!*******************************************************************!*\
2395
- !*** ./dist/events/transport/TransportLibraryInitializedEvent.js ***!
2396
- \*******************************************************************/
2397
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2602
+ /***/ "./dist/events/transport/index.js":
2603
+ /*!****************************************!*\
2604
+ !*** ./dist/events/transport/index.js ***!
2605
+ \****************************************/
2606
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2398
2607
 
2399
2608
  "use strict";
2400
2609
 
2401
- Object.defineProperty(exports, "__esModule", ({ value: true }));
2402
- exports.TransportLibraryInitializedEvent = void 0;
2403
- const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
2404
- class TransportLibraryInitializedEvent extends ts_utils_1.Event {
2405
- constructor() {
2406
- super(TransportLibraryInitializedEvent.namespace);
2610
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2611
+ if (k2 === undefined) k2 = k;
2612
+ var desc = Object.getOwnPropertyDescriptor(m, k);
2613
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2614
+ desc = { enumerable: true, get: function() { return m[k]; } };
2407
2615
  }
2408
- }
2409
- exports.TransportLibraryInitializedEvent = TransportLibraryInitializedEvent;
2410
- TransportLibraryInitializedEvent.namespace = "transport.initialized";
2411
- //# sourceMappingURL=TransportLibraryInitializedEvent.js.map
2412
-
2413
- /***/ }),
2414
-
2415
- /***/ "./dist/events/transport/TransportLibraryInitializingEvent.js":
2416
- /*!********************************************************************!*\
2417
- !*** ./dist/events/transport/TransportLibraryInitializingEvent.js ***!
2418
- \********************************************************************/
2419
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2420
-
2421
- "use strict";
2422
-
2616
+ Object.defineProperty(o, k2, desc);
2617
+ }) : (function(o, m, k, k2) {
2618
+ if (k2 === undefined) k2 = k;
2619
+ o[k2] = m[k];
2620
+ }));
2621
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
2622
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2623
+ };
2423
2624
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2424
- exports.TransportLibraryInitializingEvent = void 0;
2425
- const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
2426
- class TransportLibraryInitializingEvent extends ts_utils_1.Event {
2427
- constructor() {
2428
- super(TransportLibraryInitializingEvent.namespace);
2429
- }
2430
- }
2431
- exports.TransportLibraryInitializingEvent = TransportLibraryInitializingEvent;
2432
- TransportLibraryInitializingEvent.namespace = "transport.initializing";
2433
- //# sourceMappingURL=TransportLibraryInitializingEvent.js.map
2625
+ __exportStar(__webpack_require__(/*! ./MessageDeliveredEvent */ "./dist/events/transport/MessageDeliveredEvent.js"), exports);
2626
+ __exportStar(__webpack_require__(/*! ./MessageReceivedEvent */ "./dist/events/transport/MessageReceivedEvent.js"), exports);
2627
+ __exportStar(__webpack_require__(/*! ./MessageSentEvent */ "./dist/events/transport/MessageSentEvent.js"), exports);
2628
+ __exportStar(__webpack_require__(/*! ./PeerRelationshipTemplateLoadedEvent */ "./dist/events/transport/PeerRelationshipTemplateLoadedEvent.js"), exports);
2629
+ __exportStar(__webpack_require__(/*! ./RelationshipChangedEvent */ "./dist/events/transport/RelationshipChangedEvent.js"), exports);
2630
+ //# sourceMappingURL=index.js.map
2434
2631
 
2435
2632
  /***/ }),
2436
2633
 
@@ -4032,25 +4229,48 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
4032
4229
  this.subscribeToEvent(events_1.RelationshipChangedEvent, this.handleRelationshipChangedEvent.bind(this));
4033
4230
  }
4034
4231
  async handlePeerRelationshipTemplateLoaded(event) {
4035
- if (event.data.content["@type"] !== "RelationshipTemplateBody")
4232
+ const template = event.data;
4233
+ if (template.content["@type"] !== "RelationshipTemplateBody")
4036
4234
  return;
4037
- const body = event.data.content;
4235
+ const body = template.content;
4038
4236
  const request = body.onNewRelationship;
4039
4237
  const services = this.runtime.getServices(event.eventTargetAddress);
4040
- await this.createIncomingRequest(services, request, event.data.id);
4238
+ const requestResult = await services.consumptionServices.incomingRequests.getRequests({ query: { "source.reference": template.id } });
4239
+ if (requestResult.isError) {
4240
+ this.logger.error(`Could not get requests for template '${template.id}'. Root error:`, requestResult.error);
4241
+ return;
4242
+ }
4243
+ if (requestResult.value.some((r) => r.status !== consumption_1.LocalRequestStatus.Completed)) {
4244
+ // TODO: JSSNMSHDD-3111 (inform caller of `loadPeerRelationshipTemplate` about the Request)
4245
+ this.logger.warn(`There is already an open Request for the RelationshipTemplate '${template.id}'. Skipping creation of a new request.`);
4246
+ return;
4247
+ }
4248
+ const getRelationshipsResult = await services.transportServices.relationships.getRelationships({ query: { peer: template.createdBy } });
4249
+ if (getRelationshipsResult.isError) {
4250
+ this.logger.error(`Could not get relationships for template '${template.id}'. Root error:`, getRelationshipsResult.error);
4251
+ return;
4252
+ }
4253
+ if (getRelationshipsResult.isSuccess && getRelationshipsResult.value.some((r) => r.status === types_1.RelationshipStatus.Pending || r.status === types_1.RelationshipStatus.Active)) {
4254
+ // TODO: use body.onExistingRelationship if exists
4255
+ // TODO: JSSNMSHDD-3111 (inform caller of `loadPeerRelationshipTemplate` about the Relationship if body.onExistingRelationship not exists)
4256
+ this.logger.warn(`There is already an open or pending Relationship for the RelationshipTemplate '${template.id}'. Skipping creation of a new request.`);
4257
+ return;
4258
+ }
4259
+ await this.createIncomingRequest(services, request, template.id);
4041
4260
  }
4042
4261
  async handleMessageReceivedEvent(event) {
4043
4262
  const services = this.runtime.getServices(event.eventTargetAddress);
4044
- const messageContentType = event.data.content["@type"];
4263
+ const message = event.data;
4264
+ const messageContentType = message.content["@type"];
4045
4265
  switch (messageContentType) {
4046
4266
  case "Request":
4047
- await this.createIncomingRequest(services, event.data.content, event.data.id);
4267
+ await this.createIncomingRequest(services, message.content, message.id);
4048
4268
  break;
4049
4269
  case "Response":
4050
- const receivedResponse = event.data.content;
4051
- const result = await services.consumptionServices.outgoingRequests.complete({ receivedResponse, messageId: event.data.id });
4270
+ const receivedResponse = message.content;
4271
+ const result = await services.consumptionServices.outgoingRequests.complete({ receivedResponse, messageId: message.id });
4052
4272
  if (result.isError) {
4053
- this.logger.error(`Could not complete outgoing request for message id ${event.data.id} due to ${result.error}. Root error:`, result.error);
4273
+ this.logger.error(`Could not complete outgoing request for message id ${message.id} due to ${result.error}. Root error:`, result.error);
4054
4274
  }
4055
4275
  break;
4056
4276
  }
@@ -4082,7 +4302,8 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
4082
4302
  async handleIncomingRequestStatusChanged(event) {
4083
4303
  if (event.data.newStatus !== consumption_1.LocalRequestStatus.Decided)
4084
4304
  return;
4085
- switch (event.data.request.source.type) {
4305
+ const request = event.data.request;
4306
+ switch (request.source.type) {
4086
4307
  case "RelationshipTemplate":
4087
4308
  await this.handleIncomingRequestDecidedForRelationship(event);
4088
4309
  break;
@@ -4090,12 +4311,13 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
4090
4311
  await this.handleIncomingRequestDecidedForMessage(event);
4091
4312
  break;
4092
4313
  default:
4093
- throw new Error(`Cannot handle source.type '${event.data.request.source.type}'.`);
4314
+ throw new Error(`Cannot handle source.type '${request.source.type}'.`);
4094
4315
  }
4095
4316
  }
4096
4317
  async handleIncomingRequestDecidedForRelationship(event) {
4097
- const templateId = event.data.request.source.reference;
4098
- if (event.data.request.response.content.result !== "Accepted") {
4318
+ const request = event.data.request;
4319
+ const templateId = request.source.reference;
4320
+ if (request.response.content.result !== "Accepted") {
4099
4321
  // TODO: correctly handle rejection (=> delete / new status)
4100
4322
  // ignore rejection for now
4101
4323
  return;
@@ -4110,7 +4332,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
4110
4332
  const template = templateResult.value;
4111
4333
  const creationChangeBody = content_1.RelationshipCreationChangeRequestBody.from({
4112
4334
  "@type": "RelationshipCreationChangeRequestBody",
4113
- response: event.data.request.response.content,
4335
+ response: request.response.content,
4114
4336
  templateContentMetadata: template.content.metadata
4115
4337
  });
4116
4338
  const createRelationshipResult = await services.transportServices.relationships.createRelationship({ templateId, content: creationChangeBody });
@@ -4119,7 +4341,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
4119
4341
  // TODO: error state
4120
4342
  return;
4121
4343
  }
4122
- const requestId = event.data.request.id;
4344
+ const requestId = request.id;
4123
4345
  const completeRequestResult = await services.consumptionServices.incomingRequests.complete({
4124
4346
  requestId,
4125
4347
  responseSourceId: createRelationshipResult.value.changes[0].id
@@ -4153,10 +4375,10 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
4153
4375
  }
4154
4376
  async handleRelationshipChangedEvent(event) {
4155
4377
  // only trigger for new relationships that were created from an own template
4156
- if (event.data.status !== types_1.RelationshipStatus.Pending || !event.data.template.isOwn)
4378
+ const createdRelationship = event.data;
4379
+ if (createdRelationship.status !== types_1.RelationshipStatus.Pending || !createdRelationship.template.isOwn)
4157
4380
  return;
4158
4381
  const services = this.runtime.getServices(event.eventTargetAddress);
4159
- const createdRelationship = event.data;
4160
4382
  const template = createdRelationship.template;
4161
4383
  const templateId = template.id;
4162
4384
  // do not trigger for templates without the correct content type
@@ -11767,7 +11989,6 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
11767
11989
  const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
11768
11990
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
11769
11991
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
11770
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
11771
11992
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
11772
11993
  const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
11773
11994
  let Validator = class Validator extends common_1.SchemaValidator {
@@ -11780,12 +12001,10 @@ Validator = __decorate([
11780
12001
  __metadata("design:paramtypes", [common_1.SchemaRepository])
11781
12002
  ], Validator);
11782
12003
  let CreateAttributeUseCase = class CreateAttributeUseCase extends common_1.UseCase {
11783
- constructor(attributeController, accountController, identityController, eventBus, validator) {
12004
+ constructor(attributeController, accountController, validator) {
11784
12005
  super(validator);
11785
12006
  this.attributeController = attributeController;
11786
12007
  this.accountController = accountController;
11787
- this.identityController = identityController;
11788
- this.eventBus = eventBus;
11789
12008
  }
11790
12009
  async executeInternal(request) {
11791
12010
  const params = consumption_1.CreateLocalAttributeParams.from({
@@ -11793,21 +12012,15 @@ let CreateAttributeUseCase = class CreateAttributeUseCase extends common_1.UseCa
11793
12012
  });
11794
12013
  const createdAttribute = await this.attributeController.createLocalAttribute(params);
11795
12014
  await this.accountController.syncDatawallet();
11796
- const attributeDTO = AttributeMapper_1.AttributeMapper.toAttributeDTO(createdAttribute);
11797
- this.eventBus.publish(new events_1.AttributeCreatedEvent(this.identityController.identity.address.toString(), attributeDTO));
11798
- return ts_utils_1.Result.ok(attributeDTO);
12015
+ return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTO(createdAttribute));
11799
12016
  }
11800
12017
  };
11801
12018
  CreateAttributeUseCase = __decorate([
11802
12019
  __param(0, typescript_ioc_1.Inject),
11803
12020
  __param(1, typescript_ioc_1.Inject),
11804
12021
  __param(2, typescript_ioc_1.Inject),
11805
- __param(3, typescript_ioc_1.Inject),
11806
- __param(4, typescript_ioc_1.Inject),
11807
12022
  __metadata("design:paramtypes", [consumption_1.LocalAttributesController,
11808
12023
  transport_1.AccountController,
11809
- transport_1.IdentityController,
11810
- ts_utils_1.EventBus,
11811
12024
  Validator])
11812
12025
  ], CreateAttributeUseCase);
11813
12026
  exports.CreateAttributeUseCase = CreateAttributeUseCase;
@@ -11841,7 +12054,6 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
11841
12054
  const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
11842
12055
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
11843
12056
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
11844
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
11845
12057
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
11846
12058
  const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
11847
12059
  let Validator = class Validator extends common_1.SchemaValidator {
@@ -11854,12 +12066,10 @@ Validator = __decorate([
11854
12066
  __metadata("design:paramtypes", [common_1.SchemaRepository])
11855
12067
  ], Validator);
11856
12068
  let CreateSharedAttributeCopyUseCase = class CreateSharedAttributeCopyUseCase extends common_1.UseCase {
11857
- constructor(attributeController, accountController, identityController, eventBus, validator) {
12069
+ constructor(attributeController, accountController, validator) {
11858
12070
  super(validator);
11859
12071
  this.attributeController = attributeController;
11860
12072
  this.accountController = accountController;
11861
- this.identityController = identityController;
11862
- this.eventBus = eventBus;
11863
12073
  }
11864
12074
  async executeInternal(request) {
11865
12075
  const params = consumption_1.CreateSharedLocalAttributeCopyParams.from({
@@ -11869,21 +12079,15 @@ let CreateSharedAttributeCopyUseCase = class CreateSharedAttributeCopyUseCase ex
11869
12079
  });
11870
12080
  const successor = await this.attributeController.createSharedLocalAttributeCopy(params);
11871
12081
  await this.accountController.syncDatawallet();
11872
- const attributeDTO = AttributeMapper_1.AttributeMapper.toAttributeDTO(successor);
11873
- this.eventBus.publish(new events_1.SharedAttributeCopyCreatedEvent(this.identityController.identity.address.toString(), attributeDTO));
11874
- return ts_utils_1.Result.ok(attributeDTO);
12082
+ return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTO(successor));
11875
12083
  }
11876
12084
  };
11877
12085
  CreateSharedAttributeCopyUseCase = __decorate([
11878
12086
  __param(0, typescript_ioc_1.Inject),
11879
12087
  __param(1, typescript_ioc_1.Inject),
11880
12088
  __param(2, typescript_ioc_1.Inject),
11881
- __param(3, typescript_ioc_1.Inject),
11882
- __param(4, typescript_ioc_1.Inject),
11883
12089
  __metadata("design:paramtypes", [consumption_1.LocalAttributesController,
11884
12090
  transport_1.AccountController,
11885
- transport_1.IdentityController,
11886
- ts_utils_1.EventBus,
11887
12091
  Validator])
11888
12092
  ], CreateSharedAttributeCopyUseCase);
11889
12093
  exports.CreateSharedAttributeCopyUseCase = CreateSharedAttributeCopyUseCase;
@@ -11917,9 +12121,7 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
11917
12121
  const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
11918
12122
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
11919
12123
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
11920
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
11921
12124
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
11922
- const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
11923
12125
  let Validator = class Validator extends common_1.SchemaValidator {
11924
12126
  constructor(schemaRepository) {
11925
12127
  super(schemaRepository.getSchema("DeleteAttributeRequest"));
@@ -11930,12 +12132,10 @@ Validator = __decorate([
11930
12132
  __metadata("design:paramtypes", [common_1.SchemaRepository])
11931
12133
  ], Validator);
11932
12134
  let DeleteAttributeUseCase = class DeleteAttributeUseCase extends common_1.UseCase {
11933
- constructor(attributeController, accountController, identityController, eventBus, validator) {
12135
+ constructor(attributeController, accountController, validator) {
11934
12136
  super(validator);
11935
12137
  this.attributeController = attributeController;
11936
12138
  this.accountController = accountController;
11937
- this.identityController = identityController;
11938
- this.eventBus = eventBus;
11939
12139
  }
11940
12140
  async executeInternal(request) {
11941
12141
  const attribute = await this.attributeController.getLocalAttribute(transport_1.CoreId.from(request.id));
@@ -11944,7 +12144,6 @@ let DeleteAttributeUseCase = class DeleteAttributeUseCase extends common_1.UseCa
11944
12144
  }
11945
12145
  await this.attributeController.deleteAttribute(attribute);
11946
12146
  await this.accountController.syncDatawallet();
11947
- this.eventBus.publish(new events_1.AttributeDeletedEvent(this.identityController.identity.address.toString(), AttributeMapper_1.AttributeMapper.toAttributeDTO(attribute)));
11948
12147
  return ts_utils_1.Result.ok(undefined);
11949
12148
  }
11950
12149
  };
@@ -11952,12 +12151,8 @@ DeleteAttributeUseCase = __decorate([
11952
12151
  __param(0, typescript_ioc_1.Inject),
11953
12152
  __param(1, typescript_ioc_1.Inject),
11954
12153
  __param(2, typescript_ioc_1.Inject),
11955
- __param(3, typescript_ioc_1.Inject),
11956
- __param(4, typescript_ioc_1.Inject),
11957
12154
  __metadata("design:paramtypes", [consumption_1.LocalAttributesController,
11958
12155
  transport_1.AccountController,
11959
- transport_1.IdentityController,
11960
- ts_utils_1.EventBus,
11961
12156
  Validator])
11962
12157
  ], DeleteAttributeUseCase);
11963
12158
  exports.DeleteAttributeUseCase = DeleteAttributeUseCase;
@@ -12424,7 +12619,6 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
12424
12619
  const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
12425
12620
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
12426
12621
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
12427
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
12428
12622
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
12429
12623
  const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
12430
12624
  let Validator = class Validator extends common_1.SchemaValidator {
@@ -12437,12 +12631,10 @@ Validator = __decorate([
12437
12631
  __metadata("design:paramtypes", [common_1.SchemaRepository])
12438
12632
  ], Validator);
12439
12633
  let SucceedAttributeUseCase = class SucceedAttributeUseCase extends common_1.UseCase {
12440
- constructor(attributeController, accountController, identityController, eventBus, validator) {
12634
+ constructor(attributeController, accountController, validator) {
12441
12635
  super(validator);
12442
12636
  this.attributeController = attributeController;
12443
12637
  this.accountController = accountController;
12444
- this.identityController = identityController;
12445
- this.eventBus = eventBus;
12446
12638
  }
12447
12639
  async executeInternal(request) {
12448
12640
  const params = consumption_1.SucceedLocalAttributeParams.from({
@@ -12451,21 +12643,15 @@ let SucceedAttributeUseCase = class SucceedAttributeUseCase extends common_1.Use
12451
12643
  });
12452
12644
  const successor = await this.attributeController.succeedLocalAttribute(params);
12453
12645
  await this.accountController.syncDatawallet();
12454
- const attributeDTO = AttributeMapper_1.AttributeMapper.toAttributeDTO(successor);
12455
- this.eventBus.publish(new events_1.AttributeSucceededEvent(this.identityController.identity.address.toString(), attributeDTO));
12456
- return ts_utils_1.Result.ok(attributeDTO);
12646
+ return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTO(successor));
12457
12647
  }
12458
12648
  };
12459
12649
  SucceedAttributeUseCase = __decorate([
12460
12650
  __param(0, typescript_ioc_1.Inject),
12461
12651
  __param(1, typescript_ioc_1.Inject),
12462
12652
  __param(2, typescript_ioc_1.Inject),
12463
- __param(3, typescript_ioc_1.Inject),
12464
- __param(4, typescript_ioc_1.Inject),
12465
12653
  __metadata("design:paramtypes", [consumption_1.LocalAttributesController,
12466
12654
  transport_1.AccountController,
12467
- transport_1.IdentityController,
12468
- ts_utils_1.EventBus,
12469
12655
  Validator])
12470
12656
  ], SucceedAttributeUseCase);
12471
12657
  exports.SucceedAttributeUseCase = SucceedAttributeUseCase;
@@ -12499,7 +12685,6 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
12499
12685
  const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
12500
12686
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
12501
12687
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
12502
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
12503
12688
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
12504
12689
  const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
12505
12690
  let Validator = class Validator extends common_1.SchemaValidator {
@@ -12512,12 +12697,10 @@ Validator = __decorate([
12512
12697
  __metadata("design:paramtypes", [common_1.SchemaRepository])
12513
12698
  ], Validator);
12514
12699
  let UpdateAttributeUseCase = class UpdateAttributeUseCase extends common_1.UseCase {
12515
- constructor(attributeController, accountController, identityController, eventBus, validator) {
12700
+ constructor(attributeController, accountController, validator) {
12516
12701
  super(validator);
12517
12702
  this.attributeController = attributeController;
12518
12703
  this.accountController = accountController;
12519
- this.identityController = identityController;
12520
- this.eventBus = eventBus;
12521
12704
  }
12522
12705
  async executeInternal(request) {
12523
12706
  const params = consumption_1.UpdateLocalAttributeParams.from({
@@ -12526,21 +12709,15 @@ let UpdateAttributeUseCase = class UpdateAttributeUseCase extends common_1.UseCa
12526
12709
  });
12527
12710
  const updated = await this.attributeController.updateLocalAttribute(params);
12528
12711
  await this.accountController.syncDatawallet();
12529
- const attributeDTO = AttributeMapper_1.AttributeMapper.toAttributeDTO(updated);
12530
- this.eventBus.publish(new events_1.AttributeUpdatedEvent(this.identityController.identity.address.toString(), attributeDTO));
12531
- return ts_utils_1.Result.ok(attributeDTO);
12712
+ return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTO(updated));
12532
12713
  }
12533
12714
  };
12534
12715
  UpdateAttributeUseCase = __decorate([
12535
12716
  __param(0, typescript_ioc_1.Inject),
12536
12717
  __param(1, typescript_ioc_1.Inject),
12537
12718
  __param(2, typescript_ioc_1.Inject),
12538
- __param(3, typescript_ioc_1.Inject),
12539
- __param(4, typescript_ioc_1.Inject),
12540
12719
  __metadata("design:paramtypes", [consumption_1.LocalAttributesController,
12541
12720
  transport_1.AccountController,
12542
- transport_1.IdentityController,
12543
- ts_utils_1.EventBus,
12544
12721
  Validator])
12545
12722
  ], UpdateAttributeUseCase);
12546
12723
  exports.UpdateAttributeUseCase = UpdateAttributeUseCase;
@@ -13003,35 +13180,25 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
13003
13180
  const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
13004
13181
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
13005
13182
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
13006
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
13007
13183
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
13008
13184
  const RequestMapper_1 = __webpack_require__(/*! ./RequestMapper */ "./dist/useCases/consumption/requests/RequestMapper.js");
13009
13185
  let AcceptIncomingRequestUseCase = class AcceptIncomingRequestUseCase extends common_1.UseCase {
13010
- constructor(incomingRequestsController, eventBus) {
13186
+ constructor(incomingRequestsController) {
13011
13187
  super();
13012
13188
  this.incomingRequestsController = incomingRequestsController;
13013
- this.eventBus = eventBus;
13014
13189
  }
13015
13190
  async executeInternal(request) {
13016
13191
  let localRequest = await this.incomingRequestsController.getIncomingRequest(transport_1.CoreId.from(request.requestId));
13017
13192
  if (!localRequest) {
13018
13193
  return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(consumption_1.LocalRequest));
13019
13194
  }
13020
- const oldStatus = localRequest.status;
13021
13195
  localRequest = await this.incomingRequestsController.accept(request);
13022
- const dto = RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest);
13023
- this.eventBus.publish(new events_1.IncomingRequestStatusChangedEvent(this.incomingRequestsController.parent.accountController.identity.address.address, {
13024
- request: dto,
13025
- oldStatus,
13026
- newStatus: dto.status
13027
- }));
13028
- return ts_utils_1.Result.ok(dto);
13196
+ return ts_utils_1.Result.ok(RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest));
13029
13197
  }
13030
13198
  };
13031
13199
  AcceptIncomingRequestUseCase = __decorate([
13032
13200
  __param(0, typescript_ioc_1.Inject),
13033
- __param(1, typescript_ioc_1.Inject),
13034
- __metadata("design:paramtypes", [consumption_1.IncomingRequestsController, ts_utils_1.EventBus])
13201
+ __metadata("design:paramtypes", [consumption_1.IncomingRequestsController])
13035
13202
  ], AcceptIncomingRequestUseCase);
13036
13203
  exports.AcceptIncomingRequestUseCase = AcceptIncomingRequestUseCase;
13037
13204
  //# sourceMappingURL=AcceptIncomingRequest.js.map
@@ -13211,7 +13378,6 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
13211
13378
  const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
13212
13379
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
13213
13380
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
13214
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
13215
13381
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
13216
13382
  const RequestMapper_1 = __webpack_require__(/*! ./RequestMapper */ "./dist/useCases/consumption/requests/RequestMapper.js");
13217
13383
  let Validator = class Validator extends common_1.SchemaValidator {
@@ -13224,31 +13390,21 @@ Validator = __decorate([
13224
13390
  __metadata("design:paramtypes", [common_1.SchemaRepository])
13225
13391
  ], Validator);
13226
13392
  let CheckPrerequisitesOfIncomingRequestUseCase = class CheckPrerequisitesOfIncomingRequestUseCase extends common_1.UseCase {
13227
- constructor(validator, incomingRequestsController, eventBus) {
13393
+ constructor(validator, incomingRequestsController) {
13228
13394
  super(validator);
13229
13395
  this.incomingRequestsController = incomingRequestsController;
13230
- this.eventBus = eventBus;
13231
13396
  }
13232
13397
  async executeInternal(request) {
13233
13398
  const localRequest = await this.incomingRequestsController.checkPrerequisites({
13234
13399
  requestId: transport_1.CoreId.from(request.requestId)
13235
13400
  });
13236
- const dto = RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest);
13237
- if (localRequest.status === consumption_1.LocalRequestStatus.DecisionRequired) {
13238
- this.eventBus.publish(new events_1.IncomingRequestStatusChangedEvent(this.incomingRequestsController.parent.accountController.identity.address.address, {
13239
- request: dto,
13240
- oldStatus: consumption_1.LocalRequestStatus.Open,
13241
- newStatus: dto.status
13242
- }));
13243
- }
13244
- return ts_utils_1.Result.ok(dto);
13401
+ return ts_utils_1.Result.ok(RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest));
13245
13402
  }
13246
13403
  };
13247
13404
  CheckPrerequisitesOfIncomingRequestUseCase = __decorate([
13248
13405
  __param(0, typescript_ioc_1.Inject),
13249
13406
  __param(1, typescript_ioc_1.Inject),
13250
- __param(2, typescript_ioc_1.Inject),
13251
- __metadata("design:paramtypes", [Validator, consumption_1.IncomingRequestsController, ts_utils_1.EventBus])
13407
+ __metadata("design:paramtypes", [Validator, consumption_1.IncomingRequestsController])
13252
13408
  ], CheckPrerequisitesOfIncomingRequestUseCase);
13253
13409
  exports.CheckPrerequisitesOfIncomingRequestUseCase = CheckPrerequisitesOfIncomingRequestUseCase;
13254
13410
  //# sourceMappingURL=CheckPrerequisitesOfIncomingRequest.js.map
@@ -13281,7 +13437,6 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
13281
13437
  const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
13282
13438
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
13283
13439
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
13284
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
13285
13440
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
13286
13441
  const RequestMapper_1 = __webpack_require__(/*! ./RequestMapper */ "./dist/useCases/consumption/requests/RequestMapper.js");
13287
13442
  let Validator = class Validator extends common_1.SchemaValidator {
@@ -13294,10 +13449,9 @@ Validator = __decorate([
13294
13449
  __metadata("design:paramtypes", [common_1.SchemaRepository])
13295
13450
  ], Validator);
13296
13451
  let CompleteIncomingRequestUseCase = class CompleteIncomingRequestUseCase extends common_1.UseCase {
13297
- constructor(validator, incomingRequestsController, eventBus, messageController, relationshipController) {
13452
+ constructor(validator, incomingRequestsController, messageController, relationshipController) {
13298
13453
  super(validator);
13299
13454
  this.incomingRequestsController = incomingRequestsController;
13300
- this.eventBus = eventBus;
13301
13455
  this.messageController = messageController;
13302
13456
  this.relationshipController = relationshipController;
13303
13457
  }
@@ -13324,13 +13478,7 @@ let CompleteIncomingRequestUseCase = class CompleteIncomingRequestUseCase extend
13324
13478
  requestId: transport_1.CoreId.from(request.requestId),
13325
13479
  responseSourceObject
13326
13480
  });
13327
- const dto = RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest);
13328
- this.eventBus.publish(new events_1.IncomingRequestStatusChangedEvent(this.incomingRequestsController.parent.accountController.identity.address.address, {
13329
- request: dto,
13330
- oldStatus: consumption_1.LocalRequestStatus.Decided,
13331
- newStatus: dto.status
13332
- }));
13333
- return ts_utils_1.Result.ok(dto);
13481
+ return ts_utils_1.Result.ok(RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest));
13334
13482
  }
13335
13483
  };
13336
13484
  CompleteIncomingRequestUseCase = __decorate([
@@ -13338,10 +13486,8 @@ CompleteIncomingRequestUseCase = __decorate([
13338
13486
  __param(1, typescript_ioc_1.Inject),
13339
13487
  __param(2, typescript_ioc_1.Inject),
13340
13488
  __param(3, typescript_ioc_1.Inject),
13341
- __param(4, typescript_ioc_1.Inject),
13342
13489
  __metadata("design:paramtypes", [Validator,
13343
13490
  consumption_1.IncomingRequestsController,
13344
- ts_utils_1.EventBus,
13345
13491
  transport_1.MessageController,
13346
13492
  transport_1.RelationshipsController])
13347
13493
  ], CompleteIncomingRequestUseCase);
@@ -13377,7 +13523,6 @@ const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/cons
13377
13523
  const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
13378
13524
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
13379
13525
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
13380
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
13381
13526
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
13382
13527
  const RequestMapper_1 = __webpack_require__(/*! ./RequestMapper */ "./dist/useCases/consumption/requests/RequestMapper.js");
13383
13528
  let Validator = class Validator extends common_1.SchemaValidator {
@@ -13390,11 +13535,10 @@ Validator = __decorate([
13390
13535
  __metadata("design:paramtypes", [common_1.SchemaRepository])
13391
13536
  ], Validator);
13392
13537
  let CompleteOutgoingRequestUseCase = class CompleteOutgoingRequestUseCase extends common_1.UseCase {
13393
- constructor(validator, outgoingRequestsController, messageController, eventBus) {
13538
+ constructor(validator, outgoingRequestsController, messageController) {
13394
13539
  super(validator);
13395
13540
  this.outgoingRequestsController = outgoingRequestsController;
13396
13541
  this.messageController = messageController;
13397
- this.eventBus = eventBus;
13398
13542
  }
13399
13543
  async executeInternal(request) {
13400
13544
  const message = await this.messageController.getMessage(transport_1.CoreId.from(request.messageId));
@@ -13407,24 +13551,16 @@ let CompleteOutgoingRequestUseCase = class CompleteOutgoingRequestUseCase extend
13407
13551
  responseSourceObject: message
13408
13552
  };
13409
13553
  const localRequest = await this.outgoingRequestsController.complete(params);
13410
- const dto = RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest);
13411
- this.eventBus.publish(new events_1.OutgoingRequestStatusChangedEvent(this.outgoingRequestsController.parent.accountController.identity.address.address, {
13412
- oldStatus: consumption_1.LocalRequestStatus.Open,
13413
- newStatus: dto.status,
13414
- request: dto
13415
- }));
13416
- return ts_utils_1.Result.ok(dto);
13554
+ return ts_utils_1.Result.ok(RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest));
13417
13555
  }
13418
13556
  };
13419
13557
  CompleteOutgoingRequestUseCase = __decorate([
13420
13558
  __param(0, typescript_ioc_1.Inject),
13421
13559
  __param(1, typescript_ioc_1.Inject),
13422
13560
  __param(2, typescript_ioc_1.Inject),
13423
- __param(3, typescript_ioc_1.Inject),
13424
13561
  __metadata("design:paramtypes", [Validator,
13425
13562
  consumption_1.OutgoingRequestsController,
13426
- transport_1.MessageController,
13427
- ts_utils_1.EventBus])
13563
+ transport_1.MessageController])
13428
13564
  ], CompleteOutgoingRequestUseCase);
13429
13565
  exports.CompleteOutgoingRequestUseCase = CompleteOutgoingRequestUseCase;
13430
13566
  //# sourceMappingURL=CompleteOutgoingRequest.js.map
@@ -13457,16 +13593,14 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
13457
13593
  const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
13458
13594
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
13459
13595
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
13460
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
13461
13596
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
13462
13597
  const RequestMapper_1 = __webpack_require__(/*! ./RequestMapper */ "./dist/useCases/consumption/requests/RequestMapper.js");
13463
13598
  let CreateAndCompleteOutgoingRequestFromRelationshipCreationChangeUseCase = class CreateAndCompleteOutgoingRequestFromRelationshipCreationChangeUseCase extends common_1.UseCase {
13464
- constructor(outgoingRequestsController, relationshipController, relationshipTemplateController, eventBus) {
13599
+ constructor(outgoingRequestsController, relationshipController, relationshipTemplateController) {
13465
13600
  super();
13466
13601
  this.outgoingRequestsController = outgoingRequestsController;
13467
13602
  this.relationshipController = relationshipController;
13468
13603
  this.relationshipTemplateController = relationshipTemplateController;
13469
- this.eventBus = eventBus;
13470
13604
  }
13471
13605
  async executeInternal(request) {
13472
13606
  const template = await this.relationshipTemplateController.getRelationshipTemplate(transport_1.CoreId.from(request.templateId));
@@ -13483,20 +13617,16 @@ let CreateAndCompleteOutgoingRequestFromRelationshipCreationChangeUseCase = clas
13483
13617
  creationChange: relationship.cache.creationChange
13484
13618
  };
13485
13619
  const localRequest = await this.outgoingRequestsController.createFromRelationshipCreationChange(params);
13486
- const dto = RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest);
13487
- this.eventBus.publish(new events_1.OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent(this.outgoingRequestsController.parent.accountController.identity.address.address, dto));
13488
- return ts_utils_1.Result.ok(dto);
13620
+ return ts_utils_1.Result.ok(RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest));
13489
13621
  }
13490
13622
  };
13491
13623
  CreateAndCompleteOutgoingRequestFromRelationshipCreationChangeUseCase = __decorate([
13492
13624
  __param(0, typescript_ioc_1.Inject),
13493
13625
  __param(1, typescript_ioc_1.Inject),
13494
13626
  __param(2, typescript_ioc_1.Inject),
13495
- __param(3, typescript_ioc_1.Inject),
13496
13627
  __metadata("design:paramtypes", [consumption_1.OutgoingRequestsController,
13497
13628
  transport_1.RelationshipsController,
13498
- transport_1.RelationshipTemplateController,
13499
- ts_utils_1.EventBus])
13629
+ transport_1.RelationshipTemplateController])
13500
13630
  ], CreateAndCompleteOutgoingRequestFromRelationshipCreationChangeUseCase);
13501
13631
  exports.CreateAndCompleteOutgoingRequestFromRelationshipCreationChangeUseCase = CreateAndCompleteOutgoingRequestFromRelationshipCreationChangeUseCase;
13502
13632
  //# sourceMappingURL=CreateAndCompleteOutgoingRequestFromRelationshipCreationChange.js.map
@@ -13529,14 +13659,12 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
13529
13659
  const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
13530
13660
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
13531
13661
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
13532
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
13533
13662
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
13534
13663
  const RequestMapper_1 = __webpack_require__(/*! ./RequestMapper */ "./dist/useCases/consumption/requests/RequestMapper.js");
13535
13664
  let CreateOutgoingRequestUseCase = class CreateOutgoingRequestUseCase extends common_1.UseCase {
13536
- constructor(outgoingRequestsController, eventBus) {
13665
+ constructor(outgoingRequestsController) {
13537
13666
  super();
13538
13667
  this.outgoingRequestsController = outgoingRequestsController;
13539
- this.eventBus = eventBus;
13540
13668
  }
13541
13669
  async executeInternal(request) {
13542
13670
  const params = {
@@ -13545,15 +13673,12 @@ let CreateOutgoingRequestUseCase = class CreateOutgoingRequestUseCase extends co
13545
13673
  peer: transport_1.CoreAddress.from(request.peer)
13546
13674
  };
13547
13675
  const localRequest = await this.outgoingRequestsController.create(params);
13548
- const dto = RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest);
13549
- this.eventBus.publish(new events_1.OutgoingRequestCreatedEvent(this.outgoingRequestsController.parent.accountController.identity.address.address, dto));
13550
- return ts_utils_1.Result.ok(dto);
13676
+ return ts_utils_1.Result.ok(RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest));
13551
13677
  }
13552
13678
  };
13553
13679
  CreateOutgoingRequestUseCase = __decorate([
13554
13680
  __param(0, typescript_ioc_1.Inject),
13555
- __param(1, typescript_ioc_1.Inject),
13556
- __metadata("design:paramtypes", [consumption_1.OutgoingRequestsController, ts_utils_1.EventBus])
13681
+ __metadata("design:paramtypes", [consumption_1.OutgoingRequestsController])
13557
13682
  ], CreateOutgoingRequestUseCase);
13558
13683
  exports.CreateOutgoingRequestUseCase = CreateOutgoingRequestUseCase;
13559
13684
  //# sourceMappingURL=CreateOutgoingRequest.js.map
@@ -13924,16 +14049,14 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
13924
14049
  const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
13925
14050
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
13926
14051
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
13927
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
13928
14052
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
13929
14053
  const RequestMapper_1 = __webpack_require__(/*! ./RequestMapper */ "./dist/useCases/consumption/requests/RequestMapper.js");
13930
14054
  let ReceivedIncomingRequestUseCase = class ReceivedIncomingRequestUseCase extends common_1.UseCase {
13931
- constructor(incomingRequestsController, messageController, relationshipTemplateController, eventBus) {
14055
+ constructor(incomingRequestsController, messageController, relationshipTemplateController) {
13932
14056
  super();
13933
14057
  this.incomingRequestsController = incomingRequestsController;
13934
14058
  this.messageController = messageController;
13935
14059
  this.relationshipTemplateController = relationshipTemplateController;
13936
- this.eventBus = eventBus;
13937
14060
  }
13938
14061
  async executeInternal(request) {
13939
14062
  let requestSourceObject;
@@ -13954,20 +14077,16 @@ let ReceivedIncomingRequestUseCase = class ReceivedIncomingRequestUseCase extend
13954
14077
  receivedRequest: request.receivedRequest,
13955
14078
  requestSourceObject
13956
14079
  });
13957
- const dto = RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest);
13958
- this.eventBus.publish(new events_1.IncomingRequestReceivedEvent(this.incomingRequestsController.parent.accountController.identity.address.address, dto));
13959
- return ts_utils_1.Result.ok(dto);
14080
+ return ts_utils_1.Result.ok(RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest));
13960
14081
  }
13961
14082
  };
13962
14083
  ReceivedIncomingRequestUseCase = __decorate([
13963
14084
  __param(0, typescript_ioc_1.Inject),
13964
14085
  __param(1, typescript_ioc_1.Inject),
13965
14086
  __param(2, typescript_ioc_1.Inject),
13966
- __param(3, typescript_ioc_1.Inject),
13967
14087
  __metadata("design:paramtypes", [consumption_1.IncomingRequestsController,
13968
14088
  transport_1.MessageController,
13969
- transport_1.RelationshipTemplateController,
13970
- ts_utils_1.EventBus])
14089
+ transport_1.RelationshipTemplateController])
13971
14090
  ], ReceivedIncomingRequestUseCase);
13972
14091
  exports.ReceivedIncomingRequestUseCase = ReceivedIncomingRequestUseCase;
13973
14092
  //# sourceMappingURL=ReceivedIncomingRequest.js.map
@@ -14000,35 +14119,25 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
14000
14119
  const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
14001
14120
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
14002
14121
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
14003
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
14004
14122
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
14005
14123
  const RequestMapper_1 = __webpack_require__(/*! ./RequestMapper */ "./dist/useCases/consumption/requests/RequestMapper.js");
14006
14124
  let RejectIncomingRequestUseCase = class RejectIncomingRequestUseCase extends common_1.UseCase {
14007
- constructor(incomingRequestsController, eventBus) {
14125
+ constructor(incomingRequestsController) {
14008
14126
  super();
14009
14127
  this.incomingRequestsController = incomingRequestsController;
14010
- this.eventBus = eventBus;
14011
14128
  }
14012
14129
  async executeInternal(request) {
14013
14130
  let localRequest = await this.incomingRequestsController.getIncomingRequest(transport_1.CoreId.from(request.requestId));
14014
14131
  if (!localRequest) {
14015
14132
  return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(consumption_1.LocalRequest));
14016
14133
  }
14017
- const oldStatus = localRequest.status;
14018
14134
  localRequest = await this.incomingRequestsController.reject(request);
14019
- const dto = RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest);
14020
- this.eventBus.publish(new events_1.IncomingRequestStatusChangedEvent(this.incomingRequestsController.parent.accountController.identity.address.address, {
14021
- request: dto,
14022
- oldStatus,
14023
- newStatus: dto.status
14024
- }));
14025
- return ts_utils_1.Result.ok(dto);
14135
+ return ts_utils_1.Result.ok(RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest));
14026
14136
  }
14027
14137
  };
14028
14138
  RejectIncomingRequestUseCase = __decorate([
14029
14139
  __param(0, typescript_ioc_1.Inject),
14030
- __param(1, typescript_ioc_1.Inject),
14031
- __metadata("design:paramtypes", [consumption_1.IncomingRequestsController, ts_utils_1.EventBus])
14140
+ __metadata("design:paramtypes", [consumption_1.IncomingRequestsController])
14032
14141
  ], RejectIncomingRequestUseCase);
14033
14142
  exports.RejectIncomingRequestUseCase = RejectIncomingRequestUseCase;
14034
14143
  //# sourceMappingURL=RejectIncomingRequest.js.map
@@ -14134,32 +14243,23 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
14134
14243
  const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
14135
14244
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
14136
14245
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
14137
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
14138
14246
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
14139
14247
  const RequestMapper_1 = __webpack_require__(/*! ./RequestMapper */ "./dist/useCases/consumption/requests/RequestMapper.js");
14140
14248
  let RequireManualDecisionOfIncomingRequestUseCase = class RequireManualDecisionOfIncomingRequestUseCase extends common_1.UseCase {
14141
- constructor(incomingRequestsController, eventBus) {
14249
+ constructor(incomingRequestsController) {
14142
14250
  super();
14143
14251
  this.incomingRequestsController = incomingRequestsController;
14144
- this.eventBus = eventBus;
14145
14252
  }
14146
14253
  async executeInternal(request) {
14147
14254
  const localRequest = await this.incomingRequestsController.requireManualDecision({
14148
14255
  requestId: transport_1.CoreId.from(request.requestId)
14149
14256
  });
14150
- const dto = RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest);
14151
- this.eventBus.publish(new events_1.IncomingRequestStatusChangedEvent(this.incomingRequestsController.parent.accountController.identity.address.address, {
14152
- request: dto,
14153
- oldStatus: consumption_1.LocalRequestStatus.DecisionRequired,
14154
- newStatus: dto.status
14155
- }));
14156
- return ts_utils_1.Result.ok(dto);
14257
+ return ts_utils_1.Result.ok(RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest));
14157
14258
  }
14158
14259
  };
14159
14260
  RequireManualDecisionOfIncomingRequestUseCase = __decorate([
14160
14261
  __param(0, typescript_ioc_1.Inject),
14161
- __param(1, typescript_ioc_1.Inject),
14162
- __metadata("design:paramtypes", [consumption_1.IncomingRequestsController, ts_utils_1.EventBus])
14262
+ __metadata("design:paramtypes", [consumption_1.IncomingRequestsController])
14163
14263
  ], RequireManualDecisionOfIncomingRequestUseCase);
14164
14264
  exports.RequireManualDecisionOfIncomingRequestUseCase = RequireManualDecisionOfIncomingRequestUseCase;
14165
14265
  //# sourceMappingURL=RequireManualDecisionOfIncomingRequest.js.map
@@ -14192,15 +14292,13 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
14192
14292
  const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
14193
14293
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
14194
14294
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
14195
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
14196
14295
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
14197
14296
  const RequestMapper_1 = __webpack_require__(/*! ./RequestMapper */ "./dist/useCases/consumption/requests/RequestMapper.js");
14198
14297
  let SentOutgoingRequestUseCase = class SentOutgoingRequestUseCase extends common_1.UseCase {
14199
- constructor(outgoingRequestsController, messageController, eventBus) {
14298
+ constructor(outgoingRequestsController, messageController) {
14200
14299
  super();
14201
14300
  this.outgoingRequestsController = outgoingRequestsController;
14202
14301
  this.messageController = messageController;
14203
- this.eventBus = eventBus;
14204
14302
  }
14205
14303
  async executeInternal(request) {
14206
14304
  const message = await this.messageController.getMessage(transport_1.CoreId.from(request.messageId));
@@ -14212,22 +14310,13 @@ let SentOutgoingRequestUseCase = class SentOutgoingRequestUseCase extends common
14212
14310
  requestSourceObject: message
14213
14311
  };
14214
14312
  const localRequest = await this.outgoingRequestsController.sent(params);
14215
- const dto = RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest);
14216
- this.eventBus.publish(new events_1.OutgoingRequestStatusChangedEvent(this.outgoingRequestsController.parent.accountController.identity.address.address, {
14217
- request: dto,
14218
- oldStatus: consumption_1.LocalRequestStatus.Draft,
14219
- newStatus: dto.status
14220
- }));
14221
- return ts_utils_1.Result.ok(dto);
14313
+ return ts_utils_1.Result.ok(RequestMapper_1.RequestMapper.toLocalRequestDTO(localRequest));
14222
14314
  }
14223
14315
  };
14224
14316
  SentOutgoingRequestUseCase = __decorate([
14225
14317
  __param(0, typescript_ioc_1.Inject),
14226
14318
  __param(1, typescript_ioc_1.Inject),
14227
- __param(2, typescript_ioc_1.Inject),
14228
- __metadata("design:paramtypes", [consumption_1.OutgoingRequestsController,
14229
- transport_1.MessageController,
14230
- ts_utils_1.EventBus])
14319
+ __metadata("design:paramtypes", [consumption_1.OutgoingRequestsController, transport_1.MessageController])
14231
14320
  ], SentOutgoingRequestUseCase);
14232
14321
  exports.SentOutgoingRequestUseCase = SentOutgoingRequestUseCase;
14233
14322
  //# sourceMappingURL=SentOutgoingRequest.js.map
@@ -14581,7 +14670,6 @@ class SettingMapper {
14581
14670
  reference: setting.reference?.toString(),
14582
14671
  value: setting.value.toJSON(),
14583
14672
  createdAt: setting.createdAt.toISOString(),
14584
- deletedAt: setting.deletedAt?.toISOString(),
14585
14673
  succeedsItem: setting.succeedsItem?.toString(),
14586
14674
  succeedsAt: setting.succeedsAt?.toString()
14587
14675
  };
@@ -15094,17 +15182,14 @@ exports.SyncEverythingUseCase = void 0;
15094
15182
  const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
15095
15183
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
15096
15184
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
15097
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
15098
15185
  const RuntimeLoggerFactory_1 = __webpack_require__(/*! ../../../RuntimeLoggerFactory */ "./dist/RuntimeLoggerFactory.js");
15099
15186
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
15100
15187
  const MessageMapper_1 = __webpack_require__(/*! ../messages/MessageMapper */ "./dist/useCases/transport/messages/MessageMapper.js");
15101
15188
  const RelationshipMapper_1 = __webpack_require__(/*! ../relationships/RelationshipMapper */ "./dist/useCases/transport/relationships/RelationshipMapper.js");
15102
15189
  let SyncEverythingUseCase = class SyncEverythingUseCase extends common_1.UseCase {
15103
- constructor(accountController, identityController, eventBus, loggerFactory) {
15190
+ constructor(accountController, loggerFactory) {
15104
15191
  super();
15105
15192
  this.accountController = accountController;
15106
- this.identityController = identityController;
15107
- this.eventBus = eventBus;
15108
15193
  this.logger = loggerFactory.getLogger(SyncEverythingUseCase);
15109
15194
  }
15110
15195
  async executeInternal(request) {
@@ -15123,44 +15208,16 @@ let SyncEverythingUseCase = class SyncEverythingUseCase extends common_1.UseCase
15123
15208
  const changedItems = await this.accountController.syncEverything(request.callback);
15124
15209
  const messageDTOs = changedItems.messages.map((m) => MessageMapper_1.MessageMapper.toMessageDTO(m));
15125
15210
  const relationshipDTOs = changedItems.relationships.map((r) => RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(r));
15126
- const eventTargetAddress = this.identityController.identity.address.toString();
15127
- this.processNewMessages(messageDTOs, eventTargetAddress);
15128
- this.processNewRelationships(relationshipDTOs, eventTargetAddress);
15129
15211
  return ts_utils_1.Result.ok({
15130
15212
  messages: messageDTOs,
15131
15213
  relationships: relationshipDTOs
15132
15214
  });
15133
15215
  }
15134
- processNewRelationships(relationships, eventTargetAddress) {
15135
- if (relationships.length === 0) {
15136
- return;
15137
- }
15138
- this.logger.debug(`Found ${relationships.length} relationship(s) with changes. Start publishing on event bus...`);
15139
- for (const relationship of relationships) {
15140
- this.eventBus.publish(new events_1.RelationshipChangedEvent(eventTargetAddress, relationship));
15141
- }
15142
- this.logger.debug("Finished publishing relationship changes on event bus.");
15143
- }
15144
- processNewMessages(messages, eventTargetAddress) {
15145
- if (messages.length === 0) {
15146
- return;
15147
- }
15148
- this.logger.debug(`Found ${messages.length} new message(s). Start publishing on event bus...`);
15149
- for (const message of messages) {
15150
- this.eventBus.publish(new events_1.MessageReceivedEvent(eventTargetAddress, message));
15151
- }
15152
- this.logger.debug("Finished publishing message changes on event bus.");
15153
- }
15154
15216
  };
15155
15217
  SyncEverythingUseCase = __decorate([
15156
15218
  __param(0, typescript_ioc_1.Inject),
15157
15219
  __param(1, typescript_ioc_1.Inject),
15158
- __param(2, typescript_ioc_1.Inject),
15159
- __param(3, typescript_ioc_1.Inject),
15160
- __metadata("design:paramtypes", [transport_1.AccountController,
15161
- transport_1.IdentityController,
15162
- ts_utils_1.EventBus,
15163
- RuntimeLoggerFactory_1.RuntimeLoggerFactory])
15220
+ __metadata("design:paramtypes", [transport_1.AccountController, RuntimeLoggerFactory_1.RuntimeLoggerFactory])
15164
15221
  ], SyncEverythingUseCase);
15165
15222
  exports.SyncEverythingUseCase = SyncEverythingUseCase;
15166
15223
  //# sourceMappingURL=SyncEverything.js.map
@@ -17290,7 +17347,6 @@ exports.SendMessageUseCase = void 0;
17290
17347
  const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
17291
17348
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
17292
17349
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
17293
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
17294
17350
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
17295
17351
  const MessageMapper_1 = __webpack_require__(/*! ./MessageMapper */ "./dist/useCases/transport/messages/MessageMapper.js");
17296
17352
  class SendMessageRequestValidator extends common_1.RuntimeValidator {
@@ -17303,13 +17359,11 @@ class SendMessageRequestValidator extends common_1.RuntimeValidator {
17303
17359
  }
17304
17360
  }
17305
17361
  let SendMessageUseCase = class SendMessageUseCase extends common_1.UseCase {
17306
- constructor(messageController, fileController, accountController, identityController, eventBus, validator) {
17362
+ constructor(messageController, fileController, accountController, validator) {
17307
17363
  super(validator);
17308
17364
  this.messageController = messageController;
17309
17365
  this.fileController = fileController;
17310
17366
  this.accountController = accountController;
17311
- this.identityController = identityController;
17312
- this.eventBus = eventBus;
17313
17367
  }
17314
17368
  async executeInternal(request) {
17315
17369
  const transformAttachmentsResult = await this.transformAttachments(request.attachments);
@@ -17321,8 +17375,6 @@ let SendMessageUseCase = class SendMessageUseCase extends common_1.UseCase {
17321
17375
  content: request.content,
17322
17376
  attachments: transformAttachmentsResult.value
17323
17377
  });
17324
- const messageDTO = MessageMapper_1.MessageMapper.toMessageDTO(result);
17325
- this.eventBus.publish(new events_1.MessageSentEvent(this.identityController.identity.address.toString(), messageDTO));
17326
17378
  await this.accountController.syncDatawallet();
17327
17379
  return ts_utils_1.Result.ok(MessageMapper_1.MessageMapper.toMessageDTO(result));
17328
17380
  }
@@ -17346,13 +17398,9 @@ SendMessageUseCase = __decorate([
17346
17398
  __param(1, typescript_ioc_1.Inject),
17347
17399
  __param(2, typescript_ioc_1.Inject),
17348
17400
  __param(3, typescript_ioc_1.Inject),
17349
- __param(4, typescript_ioc_1.Inject),
17350
- __param(5, typescript_ioc_1.Inject),
17351
17401
  __metadata("design:paramtypes", [transport_1.MessageController,
17352
17402
  transport_1.FileController,
17353
17403
  transport_1.AccountController,
17354
- transport_1.IdentityController,
17355
- ts_utils_1.EventBus,
17356
17404
  SendMessageRequestValidator])
17357
17405
  ], SendMessageUseCase);
17358
17406
  exports.SendMessageUseCase = SendMessageUseCase;
@@ -17839,7 +17887,6 @@ const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
17839
17887
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
17840
17888
  const fluent_ts_validator_1 = __webpack_require__(/*! fluent-ts-validator */ "./node_modules/fluent-ts-validator/dist/index.js");
17841
17889
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
17842
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
17843
17890
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
17844
17891
  const RelationshipTemplateMapper_1 = __webpack_require__(/*! ./RelationshipTemplateMapper */ "./dist/useCases/transport/relationshipTemplates/RelationshipTemplateMapper.js");
17845
17892
  function isLoadPeerRelationshipTemplateViaSecret(request) {
@@ -17877,12 +17924,11 @@ Validator = __decorate([
17877
17924
  __metadata("design:paramtypes", [common_1.SchemaRepository])
17878
17925
  ], Validator);
17879
17926
  let LoadPeerRelationshipTemplateUseCase = class LoadPeerRelationshipTemplateUseCase extends common_1.UseCase {
17880
- constructor(templateController, tokenController, accountController, eventBus, validator) {
17927
+ constructor(templateController, tokenController, accountController, validator) {
17881
17928
  super(validator);
17882
17929
  this.templateController = templateController;
17883
17930
  this.tokenController = tokenController;
17884
17931
  this.accountController = accountController;
17885
- this.eventBus = eventBus;
17886
17932
  }
17887
17933
  async executeInternal(request) {
17888
17934
  let createdTemplateResult;
@@ -17897,10 +17943,6 @@ let LoadPeerRelationshipTemplateUseCase = class LoadPeerRelationshipTemplateUseC
17897
17943
  throw new Error("Invalid request format.");
17898
17944
  }
17899
17945
  await this.accountController.syncDatawallet();
17900
- if (createdTemplateResult.isSuccess) {
17901
- const event = new events_1.PeerRelationshipTemplateLoadedEvent(this.accountController.identity.address.address, createdTemplateResult.value);
17902
- this.eventBus.publish(event);
17903
- }
17904
17946
  return createdTemplateResult;
17905
17947
  }
17906
17948
  async loadRelationshipTemplateFromReference(reference) {
@@ -17937,11 +17979,9 @@ LoadPeerRelationshipTemplateUseCase = __decorate([
17937
17979
  __param(1, typescript_ioc_1.Inject),
17938
17980
  __param(2, typescript_ioc_1.Inject),
17939
17981
  __param(3, typescript_ioc_1.Inject),
17940
- __param(4, typescript_ioc_1.Inject),
17941
17982
  __metadata("design:paramtypes", [transport_1.RelationshipTemplateController,
17942
17983
  transport_1.TokenController,
17943
17984
  transport_1.AccountController,
17944
- ts_utils_1.EventBus,
17945
17985
  Validator])
17946
17986
  ], LoadPeerRelationshipTemplateUseCase);
17947
17987
  exports.LoadPeerRelationshipTemplateUseCase = LoadPeerRelationshipTemplateUseCase;
@@ -18048,7 +18088,6 @@ exports.AcceptRelationshipChangeUseCase = void 0;
18048
18088
  const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
18049
18089
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
18050
18090
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
18051
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
18052
18091
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
18053
18092
  const RelationshipMapper_1 = __webpack_require__(/*! ./RelationshipMapper */ "./dist/useCases/transport/relationships/RelationshipMapper.js");
18054
18093
  class AcceptRelationshipChangeRequestValidator extends common_1.RuntimeValidator {
@@ -18060,12 +18099,10 @@ class AcceptRelationshipChangeRequestValidator extends common_1.RuntimeValidator
18060
18099
  }
18061
18100
  }
18062
18101
  let AcceptRelationshipChangeUseCase = class AcceptRelationshipChangeUseCase extends common_1.UseCase {
18063
- constructor(relationshipsController, accountController, identityController, eventBus, validator) {
18102
+ constructor(relationshipsController, accountController, validator) {
18064
18103
  super(validator);
18065
18104
  this.relationshipsController = relationshipsController;
18066
18105
  this.accountController = accountController;
18067
- this.identityController = identityController;
18068
- this.eventBus = eventBus;
18069
18106
  }
18070
18107
  async executeInternal(request) {
18071
18108
  const relationship = await this.relationshipsController.getRelationship(transport_1.CoreId.from(request.relationshipId));
@@ -18080,22 +18117,16 @@ let AcceptRelationshipChangeUseCase = class AcceptRelationshipChangeUseCase exte
18080
18117
  return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(transport_1.RelationshipChange));
18081
18118
  }
18082
18119
  const updatedRelationship = await this.relationshipsController.acceptChange(change, request.content);
18083
- const relationshipDTO = RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(updatedRelationship);
18084
- this.eventBus.publish(new events_1.RelationshipChangedEvent(this.identityController.identity.address.toString(), relationshipDTO));
18085
18120
  await this.accountController.syncDatawallet();
18086
- return ts_utils_1.Result.ok(relationshipDTO);
18121
+ return ts_utils_1.Result.ok(RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(updatedRelationship));
18087
18122
  }
18088
18123
  };
18089
18124
  AcceptRelationshipChangeUseCase = __decorate([
18090
18125
  __param(0, typescript_ioc_1.Inject),
18091
18126
  __param(1, typescript_ioc_1.Inject),
18092
18127
  __param(2, typescript_ioc_1.Inject),
18093
- __param(3, typescript_ioc_1.Inject),
18094
- __param(4, typescript_ioc_1.Inject),
18095
18128
  __metadata("design:paramtypes", [transport_1.RelationshipsController,
18096
18129
  transport_1.AccountController,
18097
- transport_1.IdentityController,
18098
- ts_utils_1.EventBus,
18099
18130
  AcceptRelationshipChangeRequestValidator])
18100
18131
  ], AcceptRelationshipChangeUseCase);
18101
18132
  exports.AcceptRelationshipChangeUseCase = AcceptRelationshipChangeUseCase;
@@ -18128,7 +18159,6 @@ exports.CreateRelationshipUseCase = void 0;
18128
18159
  const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
18129
18160
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
18130
18161
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
18131
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
18132
18162
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
18133
18163
  const RelationshipMapper_1 = __webpack_require__(/*! ./RelationshipMapper */ "./dist/useCases/transport/relationships/RelationshipMapper.js");
18134
18164
  class CreateRelationshipRequestValidator extends common_1.RuntimeValidator {
@@ -18139,13 +18169,11 @@ class CreateRelationshipRequestValidator extends common_1.RuntimeValidator {
18139
18169
  }
18140
18170
  }
18141
18171
  let CreateRelationshipUseCase = class CreateRelationshipUseCase extends common_1.UseCase {
18142
- constructor(relationshipsController, relationshipTemplateController, accountController, identityController, eventBus, validator) {
18172
+ constructor(relationshipsController, relationshipTemplateController, accountController, validator) {
18143
18173
  super(validator);
18144
18174
  this.relationshipsController = relationshipsController;
18145
18175
  this.relationshipTemplateController = relationshipTemplateController;
18146
18176
  this.accountController = accountController;
18147
- this.identityController = identityController;
18148
- this.eventBus = eventBus;
18149
18177
  }
18150
18178
  async executeInternal(request) {
18151
18179
  const template = await this.relationshipTemplateController.getRelationshipTemplate(transport_1.CoreId.from(request.templateId));
@@ -18156,10 +18184,8 @@ let CreateRelationshipUseCase = class CreateRelationshipUseCase extends common_1
18156
18184
  template: template,
18157
18185
  content: request.content
18158
18186
  });
18159
- const relationshipDTO = RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(relationship);
18160
- this.eventBus.publish(new events_1.RelationshipChangedEvent(this.identityController.identity.address.toString(), relationshipDTO));
18161
18187
  await this.accountController.syncDatawallet();
18162
- return ts_utils_1.Result.ok(relationshipDTO);
18188
+ return ts_utils_1.Result.ok(RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(relationship));
18163
18189
  }
18164
18190
  };
18165
18191
  CreateRelationshipUseCase = __decorate([
@@ -18167,13 +18193,9 @@ CreateRelationshipUseCase = __decorate([
18167
18193
  __param(1, typescript_ioc_1.Inject),
18168
18194
  __param(2, typescript_ioc_1.Inject),
18169
18195
  __param(3, typescript_ioc_1.Inject),
18170
- __param(4, typescript_ioc_1.Inject),
18171
- __param(5, typescript_ioc_1.Inject),
18172
18196
  __metadata("design:paramtypes", [transport_1.RelationshipsController,
18173
18197
  transport_1.RelationshipTemplateController,
18174
18198
  transport_1.AccountController,
18175
- transport_1.IdentityController,
18176
- ts_utils_1.EventBus,
18177
18199
  CreateRelationshipRequestValidator])
18178
18200
  ], CreateRelationshipUseCase);
18179
18201
  exports.CreateRelationshipUseCase = CreateRelationshipUseCase;
@@ -18512,7 +18534,6 @@ exports.RejectRelationshipChangeUseCase = void 0;
18512
18534
  const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
18513
18535
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
18514
18536
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
18515
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
18516
18537
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
18517
18538
  const RelationshipMapper_1 = __webpack_require__(/*! ./RelationshipMapper */ "./dist/useCases/transport/relationships/RelationshipMapper.js");
18518
18539
  class RejectRelationshipChangeRequestValidator extends common_1.RuntimeValidator {
@@ -18524,12 +18545,10 @@ class RejectRelationshipChangeRequestValidator extends common_1.RuntimeValidator
18524
18545
  }
18525
18546
  }
18526
18547
  let RejectRelationshipChangeUseCase = class RejectRelationshipChangeUseCase extends common_1.UseCase {
18527
- constructor(relationshipsController, accountController, identityController, eventBus, validator) {
18548
+ constructor(relationshipsController, accountController, validator) {
18528
18549
  super(validator);
18529
18550
  this.relationshipsController = relationshipsController;
18530
18551
  this.accountController = accountController;
18531
- this.identityController = identityController;
18532
- this.eventBus = eventBus;
18533
18552
  }
18534
18553
  async executeInternal(request) {
18535
18554
  const relationship = await this.relationshipsController.getRelationship(transport_1.CoreId.from(request.relationshipId));
@@ -18544,22 +18563,16 @@ let RejectRelationshipChangeUseCase = class RejectRelationshipChangeUseCase exte
18544
18563
  return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(transport_1.RelationshipChange));
18545
18564
  }
18546
18565
  const updatedRelationship = await this.relationshipsController.rejectChange(change, request.content);
18547
- const relationshipDTO = RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(updatedRelationship);
18548
- this.eventBus.publish(new events_1.RelationshipChangedEvent(this.identityController.identity.address.toString(), relationshipDTO));
18549
18566
  await this.accountController.syncDatawallet();
18550
- return ts_utils_1.Result.ok(relationshipDTO);
18567
+ return ts_utils_1.Result.ok(RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(updatedRelationship));
18551
18568
  }
18552
18569
  };
18553
18570
  RejectRelationshipChangeUseCase = __decorate([
18554
18571
  __param(0, typescript_ioc_1.Inject),
18555
18572
  __param(1, typescript_ioc_1.Inject),
18556
18573
  __param(2, typescript_ioc_1.Inject),
18557
- __param(3, typescript_ioc_1.Inject),
18558
- __param(4, typescript_ioc_1.Inject),
18559
18574
  __metadata("design:paramtypes", [transport_1.RelationshipsController,
18560
18575
  transport_1.AccountController,
18561
- transport_1.IdentityController,
18562
- ts_utils_1.EventBus,
18563
18576
  RejectRelationshipChangeRequestValidator])
18564
18577
  ], RejectRelationshipChangeUseCase);
18565
18578
  exports.RejectRelationshipChangeUseCase = RejectRelationshipChangeUseCase;
@@ -18657,7 +18670,6 @@ exports.RevokeRelationshipChangeUseCase = void 0;
18657
18670
  const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
18658
18671
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
18659
18672
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
18660
- const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
18661
18673
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
18662
18674
  const RelationshipMapper_1 = __webpack_require__(/*! ./RelationshipMapper */ "./dist/useCases/transport/relationships/RelationshipMapper.js");
18663
18675
  class RevokeRelationshipChangeRequestValidator extends common_1.RuntimeValidator {
@@ -18669,12 +18681,10 @@ class RevokeRelationshipChangeRequestValidator extends common_1.RuntimeValidator
18669
18681
  }
18670
18682
  }
18671
18683
  let RevokeRelationshipChangeUseCase = class RevokeRelationshipChangeUseCase extends common_1.UseCase {
18672
- constructor(relationshipsController, accountController, eventBus, identityController, validator) {
18684
+ constructor(relationshipsController, accountController, validator) {
18673
18685
  super(validator);
18674
18686
  this.relationshipsController = relationshipsController;
18675
18687
  this.accountController = accountController;
18676
- this.eventBus = eventBus;
18677
- this.identityController = identityController;
18678
18688
  }
18679
18689
  async executeInternal(request) {
18680
18690
  const relationship = await this.relationshipsController.getRelationship(transport_1.CoreId.from(request.relationshipId));
@@ -18689,22 +18699,16 @@ let RevokeRelationshipChangeUseCase = class RevokeRelationshipChangeUseCase exte
18689
18699
  return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(transport_1.RelationshipChange));
18690
18700
  }
18691
18701
  const updatedRelationship = await this.relationshipsController.revokeChange(change, request.content);
18692
- const relationshipDTO = RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(updatedRelationship);
18693
- this.eventBus.publish(new events_1.RelationshipChangedEvent(this.identityController.identity.address.toString(), relationshipDTO));
18694
18702
  await this.accountController.syncDatawallet();
18695
- return ts_utils_1.Result.ok(relationshipDTO);
18703
+ return ts_utils_1.Result.ok(RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(updatedRelationship));
18696
18704
  }
18697
18705
  };
18698
18706
  RevokeRelationshipChangeUseCase = __decorate([
18699
18707
  __param(0, typescript_ioc_1.Inject),
18700
18708
  __param(1, typescript_ioc_1.Inject),
18701
18709
  __param(2, typescript_ioc_1.Inject),
18702
- __param(3, typescript_ioc_1.Inject),
18703
- __param(4, typescript_ioc_1.Inject),
18704
18710
  __metadata("design:paramtypes", [transport_1.RelationshipsController,
18705
18711
  transport_1.AccountController,
18706
- ts_utils_1.EventBus,
18707
- transport_1.IdentityController,
18708
18712
  RevokeRelationshipChangeRequestValidator])
18709
18713
  ], RevokeRelationshipChangeUseCase);
18710
18714
  exports.RevokeRelationshipChangeUseCase = RevokeRelationshipChangeUseCase;
@@ -19500,12 +19504,19 @@ __webpack_require__(/*! reflect-metadata */ "./node_modules/reflect-metadata/Ref
19500
19504
  const EventBus_1 = __webpack_require__(/*! ../EventBus */ "./node_modules/@js-soft/ts-utils/dist/eventBus/EventBus.js");
19501
19505
  const SubscriptionTargetInfo_1 = __webpack_require__(/*! ../SubscriptionTargetInfo */ "./node_modules/@js-soft/ts-utils/dist/eventBus/SubscriptionTargetInfo.js");
19502
19506
  class EventEmitter2EventBus {
19507
+ errorCallback;
19503
19508
  emitter;
19504
19509
  listeners = new Map();
19505
19510
  nextId = 0;
19506
19511
  invocationPromises = [];
19507
- constructor(options) {
19508
- this.emitter = new eventemitter2_1.EventEmitter2({ ...options, wildcard: true, maxListeners: 50, verboseMemoryLeak: true });
19512
+ constructor(errorCallback, eventEmitter2Options) {
19513
+ this.errorCallback = errorCallback;
19514
+ this.emitter = new eventemitter2_1.EventEmitter2({
19515
+ maxListeners: 50,
19516
+ verboseMemoryLeak: true,
19517
+ ...eventEmitter2Options,
19518
+ wildcard: true
19519
+ });
19509
19520
  }
19510
19521
  subscribe(subscriptionTarget, handler) {
19511
19522
  return this.registerHandler(subscriptionTarget, handler);
@@ -19525,7 +19536,7 @@ class EventEmitter2EventBus {
19525
19536
  }
19526
19537
  const invocationPromise = (async () => await handler(event))();
19527
19538
  this.invocationPromises.push(invocationPromise);
19528
- await invocationPromise;
19539
+ await invocationPromise.catch((e) => this.errorCallback(e, subscriptionTargetInfo.namespace));
19529
19540
  this.invocationPromises = this.invocationPromises.filter((p) => p !== invocationPromise);
19530
19541
  if (isOneTimeHandler)
19531
19542
  this.listeners.delete(listenerId);
@@ -19589,7 +19600,11 @@ exports.EventEmitter2EventBus = EventEmitter2EventBus;
19589
19600
 
19590
19601
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
19591
19602
  if (k2 === undefined) k2 = k;
19592
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
19603
+ var desc = Object.getOwnPropertyDescriptor(m, k);
19604
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19605
+ desc = { enumerable: true, get: function() { return m[k]; } };
19606
+ }
19607
+ Object.defineProperty(o, k2, desc);
19593
19608
  }) : (function(o, m, k, k2) {
19594
19609
  if (k2 === undefined) k2 = k;
19595
19610
  o[k2] = m[k];
@@ -19658,7 +19673,11 @@ exports.Event = Event;
19658
19673
 
19659
19674
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
19660
19675
  if (k2 === undefined) k2 = k;
19661
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
19676
+ var desc = Object.getOwnPropertyDescriptor(m, k);
19677
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19678
+ desc = { enumerable: true, get: function() { return m[k]; } };
19679
+ }
19680
+ Object.defineProperty(o, k2, desc);
19662
19681
  }) : (function(o, m, k, k2) {
19663
19682
  if (k2 === undefined) k2 = k;
19664
19683
  o[k2] = m[k];
@@ -19683,7 +19702,11 @@ __exportStar(__webpack_require__(/*! ./Event */ "./node_modules/@js-soft/ts-util
19683
19702
 
19684
19703
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
19685
19704
  if (k2 === undefined) k2 = k;
19686
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
19705
+ var desc = Object.getOwnPropertyDescriptor(m, k);
19706
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19707
+ desc = { enumerable: true, get: function() { return m[k]; } };
19708
+ }
19709
+ Object.defineProperty(o, k2, desc);
19687
19710
  }) : (function(o, m, k, k2) {
19688
19711
  if (k2 === undefined) k2 = k;
19689
19712
  o[k2] = m[k];
@@ -19808,6 +19831,9 @@ class ApplicationError extends Error {
19808
19831
  equals(error) {
19809
19832
  return this.code === error.code;
19810
19833
  }
19834
+ toString() {
19835
+ return JSON.stringify(this, undefined, 2);
19836
+ }
19811
19837
  }
19812
19838
  exports.ApplicationError = ApplicationError;
19813
19839
  //# sourceMappingURL=ApplicationError.js.map
@@ -19853,7 +19879,7 @@ class Result {
19853
19879
  }
19854
19880
  get value() {
19855
19881
  if (!this.isSuccess) {
19856
- throw new Error("Can't get the value of an error result. Use 'error' instead.");
19882
+ throw new Error(`Can't get the value of an error result. Use 'error' instead. Root error: \r\n${this.error}`);
19857
19883
  }
19858
19884
  return this._value;
19859
19885
  }
@@ -19879,7 +19905,11 @@ exports.Result = Result;
19879
19905
 
19880
19906
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
19881
19907
  if (k2 === undefined) k2 = k;
19882
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
19908
+ var desc = Object.getOwnPropertyDescriptor(m, k);
19909
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19910
+ desc = { enumerable: true, get: function() { return m[k]; } };
19911
+ }
19912
+ Object.defineProperty(o, k2, desc);
19883
19913
  }) : (function(o, m, k, k2) {
19884
19914
  if (k2 === undefined) k2 = k;
19885
19915
  o[k2] = m[k];