@nmshd/runtime 1.0.8 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Runtime.d.ts +1 -1
- package/dist/Runtime.js +3 -4
- package/dist/Runtime.js.map +1 -1
- package/dist/buildInformation.js +4 -4
- package/dist/events/index.d.ts +1 -0
- package/dist/events/index.js +1 -0
- package/dist/events/index.js.map +1 -1
- package/dist/events/transport/MessageSentEvent.d.ts +6 -0
- package/dist/events/transport/MessageSentEvent.js +12 -0
- package/dist/events/transport/MessageSentEvent.js.map +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/types/transport/RelationshipDTO.d.ts +9 -1
- package/dist/types/transport/RelationshipDTO.js +10 -0
- package/dist/types/transport/RelationshipDTO.js.map +1 -1
- package/dist/useCases/transport/account/SyncEverything.d.ts +1 -2
- package/dist/useCases/transport/account/SyncEverything.js +1 -2
- package/dist/useCases/transport/account/SyncEverything.js.map +1 -1
- package/dist/useCases/transport/messages/SendMessage.d.ts +3 -2
- package/dist/useCases/transport/messages/SendMessage.js +7 -1
- package/dist/useCases/transport/messages/SendMessage.js.map +1 -1
- package/dist/useCases/transport/relationships/AcceptRelationshipChange.d.ts +3 -2
- package/dist/useCases/transport/relationships/AcceptRelationshipChange.js +9 -3
- package/dist/useCases/transport/relationships/AcceptRelationshipChange.js.map +1 -1
- package/dist/useCases/transport/relationships/CreateRelationship.d.ts +3 -2
- package/dist/useCases/transport/relationships/CreateRelationship.js +8 -2
- package/dist/useCases/transport/relationships/CreateRelationship.js.map +1 -1
- package/dist/useCases/transport/relationships/RejectRelationshipChange.d.ts +3 -2
- package/dist/useCases/transport/relationships/RejectRelationshipChange.js +9 -3
- package/dist/useCases/transport/relationships/RejectRelationshipChange.js.map +1 -1
- package/dist/useCases/transport/relationships/RevokeRelationshipChange.d.ts +3 -2
- package/dist/useCases/transport/relationships/RevokeRelationshipChange.js +9 -3
- package/dist/useCases/transport/relationships/RevokeRelationshipChange.js.map +1 -1
- package/lib-web/nmshd.runtime.js +83 -183
- package/lib-web/nmshd.runtime.js.map +1 -1
- package/lib-web/nmshd.runtime.min.js +1 -1
- package/lib-web/nmshd.runtime.min.js.map +1 -1
- package/package.json +3 -3
- package/dist/eventBus/EventBus.d.ts +0 -14
- package/dist/eventBus/EventBus.js +0 -11
- package/dist/eventBus/EventBus.js.map +0 -1
- package/dist/eventBus/SubscriptionTargetInfo.d.ts +0 -6
- package/dist/eventBus/SubscriptionTargetInfo.js +0 -36
- package/dist/eventBus/SubscriptionTargetInfo.js.map +0 -1
- package/dist/eventBus/eventEmitter2/EventEmitter2EventBus.d.ts +0 -15
- package/dist/eventBus/eventEmitter2/EventEmitter2EventBus.js +0 -58
- package/dist/eventBus/eventEmitter2/EventEmitter2EventBus.js.map +0 -1
- package/dist/eventBus/index.d.ts +0 -2
- package/dist/eventBus/index.js +0 -15
- package/dist/eventBus/index.js.map +0 -1
- package/dist/eventBus/reflection/Constants.d.ts +0 -1
- package/dist/eventBus/reflection/Constants.js +0 -5
- package/dist/eventBus/reflection/Constants.js.map +0 -1
- package/dist/eventBus/reflection/Reflection.d.ts +0 -5
- package/dist/eventBus/reflection/Reflection.js +0 -21
- package/dist/eventBus/reflection/Reflection.js.map +0 -1
|
@@ -16,6 +16,7 @@ exports.RevokeRelationshipChangeUseCase = void 0;
|
|
|
16
16
|
const ts_utils_1 = require("@js-soft/ts-utils");
|
|
17
17
|
const transport_1 = require("@nmshd/transport");
|
|
18
18
|
const typescript_ioc_1 = require("typescript-ioc");
|
|
19
|
+
const events_1 = require("../../../events");
|
|
19
20
|
const common_1 = require("../../common");
|
|
20
21
|
const RelationshipMapper_1 = require("./RelationshipMapper");
|
|
21
22
|
class RevokeRelationshipChangeRequestValidator extends common_1.RuntimeValidator {
|
|
@@ -26,10 +27,11 @@ class RevokeRelationshipChangeRequestValidator extends common_1.RuntimeValidator
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
let RevokeRelationshipChangeUseCase = class RevokeRelationshipChangeUseCase extends common_1.UseCase {
|
|
29
|
-
constructor(relationshipsController, accountController, validator) {
|
|
30
|
+
constructor(relationshipsController, accountController, eventBus, validator) {
|
|
30
31
|
super(validator);
|
|
31
32
|
this.relationshipsController = relationshipsController;
|
|
32
33
|
this.accountController = accountController;
|
|
34
|
+
this.eventBus = eventBus;
|
|
33
35
|
}
|
|
34
36
|
async executeInternal(request) {
|
|
35
37
|
const relationship = await this.relationshipsController.getRelationship(transport_1.CoreId.from(request.relationshipId));
|
|
@@ -43,17 +45,21 @@ let RevokeRelationshipChangeUseCase = class RevokeRelationshipChangeUseCase exte
|
|
|
43
45
|
if (!change) {
|
|
44
46
|
return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(transport_1.RelationshipChange));
|
|
45
47
|
}
|
|
46
|
-
const
|
|
48
|
+
const updatedRelationship = await this.relationshipsController.revokeChange(change, request.content);
|
|
49
|
+
const relationshipDTO = RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(updatedRelationship);
|
|
50
|
+
this.eventBus.publish(new events_1.RelationshipChangedEvent(relationshipDTO));
|
|
47
51
|
await this.accountController.syncDatawallet();
|
|
48
|
-
return ts_utils_1.Result.ok(
|
|
52
|
+
return ts_utils_1.Result.ok(relationshipDTO);
|
|
49
53
|
}
|
|
50
54
|
};
|
|
51
55
|
RevokeRelationshipChangeUseCase = __decorate([
|
|
52
56
|
__param(0, typescript_ioc_1.Inject),
|
|
53
57
|
__param(1, typescript_ioc_1.Inject),
|
|
54
58
|
__param(2, typescript_ioc_1.Inject),
|
|
59
|
+
__param(3, typescript_ioc_1.Inject),
|
|
55
60
|
__metadata("design:paramtypes", [transport_1.RelationshipsController,
|
|
56
61
|
transport_1.AccountController,
|
|
62
|
+
ts_utils_1.EventBus,
|
|
57
63
|
RevokeRelationshipChangeRequestValidator])
|
|
58
64
|
], RevokeRelationshipChangeUseCase);
|
|
59
65
|
exports.RevokeRelationshipChangeUseCase = RevokeRelationshipChangeUseCase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RevokeRelationshipChange.js","sourceRoot":"","sources":["../../../../src/useCases/transport/relationships/RevokeRelationshipChange.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"RevokeRelationshipChange.js","sourceRoot":"","sources":["../../../../src/useCases/transport/relationships/RevokeRelationshipChange.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAqD;AACrD,gDAAqI;AACrI,mDAAwC;AACxC,4CAA2D;AAE3D,yCAAqF;AACrF,6DAA0D;AAQ1D,MAAM,wCAAyC,SAAQ,yBAAiD;IACpG;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,oBAAW,CAAC,QAAQ,CAAC,uBAAW,CAAC,YAAY,CAAC,CAAC,CAAC;QACxG,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,oBAAW,CAAC,QAAQ,CAAC,uBAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC5G,CAAC;CACJ;AAED,IAAa,+BAA+B,GAA5C,MAAa,+BAAgC,SAAQ,gBAAyD;IAC1G,YAC6B,uBAAgD,EAChD,iBAAoC,EACpC,QAAkB,EACnC,SAAmD;QAE3D,KAAK,CAAC,SAAS,CAAC,CAAC;QALQ,4BAAuB,GAAvB,uBAAuB,CAAyB;QAChD,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,aAAQ,GAAR,QAAQ,CAAU;IAI/C,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAAwC;QACpE,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,eAAe,CAAC,kBAAM,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;QAC7G,IAAI,CAAC,YAAY,EAAE;YACf,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,CAAC,CAAC;SAC1E;QAED,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE;YACrB,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,OAAO,CAAC,UAAU,CAAC,wBAAY,EAAE,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;SAClG;QAED,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC5F,IAAI,CAAC,MAAM,EAAE;YACT,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,OAAO,CAAC,cAAc,CAAC,8BAAkB,CAAC,CAAC,CAAC;SAChF;QAED,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACrG,MAAM,eAAe,GAAG,uCAAkB,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,iCAAwB,CAAC,eAAe,CAAC,CAAC,CAAC;QACrE,MAAM,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QAE9C,OAAO,iBAAM,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC;IACtC,CAAC;CACJ,CAAA;AAjCY,+BAA+B;IAEnC,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAH2C,mCAAuB;QAC7B,6BAAiB;QAC1B,mBAAQ;QACxB,wCAAwC;GALtD,+BAA+B,CAiC3C;AAjCY,0EAA+B"}
|
package/lib-web/nmshd.runtime.js
CHANGED
|
@@ -12,12 +12,11 @@ var NMSHDRuntime;
|
|
|
12
12
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
14
14
|
exports.Runtime = void 0;
|
|
15
|
+
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
15
16
|
const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
|
|
16
17
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
17
18
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
18
19
|
const dataViews_1 = __webpack_require__(/*! ./dataViews */ "./dist/dataViews/index.js");
|
|
19
|
-
const eventBus_1 = __webpack_require__(/*! ./eventBus */ "./dist/eventBus/index.js");
|
|
20
|
-
const EventEmitter2EventBus_1 = __webpack_require__(/*! ./eventBus/eventEmitter2/EventEmitter2EventBus */ "./dist/eventBus/eventEmitter2/EventEmitter2EventBus.js");
|
|
21
20
|
const events_1 = __webpack_require__(/*! ./events */ "./dist/events/index.js");
|
|
22
21
|
const extensibility_1 = __webpack_require__(/*! ./extensibility */ "./dist/extensibility/index.js");
|
|
23
22
|
const RuntimeLoggerFactory_1 = __webpack_require__(/*! ./RuntimeLoggerFactory */ "./dist/RuntimeLoggerFactory.js");
|
|
@@ -28,7 +27,7 @@ class Runtime {
|
|
|
28
27
|
this._isInitialized = false;
|
|
29
28
|
this._isStarted = false;
|
|
30
29
|
this.runtimeConfig = config;
|
|
31
|
-
this._eventBus = new
|
|
30
|
+
this._eventBus = new ts_utils_1.EventEmitter2EventBus();
|
|
32
31
|
}
|
|
33
32
|
isLoggedIn() {
|
|
34
33
|
return !!this._accountController;
|
|
@@ -114,7 +113,7 @@ class Runtime {
|
|
|
114
113
|
this.eventBus.publish(new events_1.TransportLibraryInitializedEvent());
|
|
115
114
|
}
|
|
116
115
|
async initDIContainer() {
|
|
117
|
-
typescript_ioc_1.Container.bind(
|
|
116
|
+
typescript_ioc_1.Container.bind(ts_utils_1.EventBus)
|
|
118
117
|
.factory(() => this.eventBus)
|
|
119
118
|
.scope(typescript_ioc_1.Scope.Singleton);
|
|
120
119
|
typescript_ioc_1.Container.bind(RuntimeLoggerFactory_1.RuntimeLoggerFactory)
|
|
@@ -331,10 +330,10 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
|
331
330
|
const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
|
|
332
331
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
333
332
|
exports.buildInformation = {
|
|
334
|
-
version: "1.0
|
|
335
|
-
build: "
|
|
336
|
-
date: "2021-11-
|
|
337
|
-
commit: "
|
|
333
|
+
version: "1.1.0",
|
|
334
|
+
build: "13",
|
|
335
|
+
date: "2021-11-26T09:03:51+00:00",
|
|
336
|
+
commit: "a589a49b970249c8a28e0f24893956253c6ee857",
|
|
338
337
|
dependencies: {"@js-soft/docdb-querytranslator":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/ts-serval":"1.0.2","@js-soft/ts-utils":"^1.1.1","@nmshd/consumption":"1.0.5","@nmshd/content":"1.0.4","@nmshd/crypto":"1.0.4","@nmshd/transport":"1.1.0","ajv":"^8.8.2","ajv-formats":"^2.1.1","fluent-ts-validator":"3.0.2","luxon":"^2.1.1","qrcode":"1.5.0","reflect-metadata":"0.1.13","ts-simple-nameof":"1.3.1","typescript-ioc":"3.2.2"},
|
|
339
338
|
libraries: {
|
|
340
339
|
serval: ts_serval_1.buildInformation,
|
|
@@ -1149,166 +1148,6 @@ __exportStar(__webpack_require__(/*! ./RelationshipTemplateDVO */ "./dist/dataVi
|
|
|
1149
1148
|
|
|
1150
1149
|
/***/ }),
|
|
1151
1150
|
|
|
1152
|
-
/***/ "./dist/eventBus/EventBus.js":
|
|
1153
|
-
/*!***********************************!*\
|
|
1154
|
-
!*** ./dist/eventBus/EventBus.js ***!
|
|
1155
|
-
\***********************************/
|
|
1156
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
1157
|
-
|
|
1158
|
-
"use strict";
|
|
1159
|
-
|
|
1160
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1161
|
-
exports.getEventNamespaceFromObject = exports.EventBus = void 0;
|
|
1162
|
-
class EventBus {
|
|
1163
|
-
}
|
|
1164
|
-
exports.EventBus = EventBus;
|
|
1165
|
-
function getEventNamespaceFromObject(targetObject) {
|
|
1166
|
-
return targetObject.namespace;
|
|
1167
|
-
}
|
|
1168
|
-
exports.getEventNamespaceFromObject = getEventNamespaceFromObject;
|
|
1169
|
-
//# sourceMappingURL=EventBus.js.map
|
|
1170
|
-
|
|
1171
|
-
/***/ }),
|
|
1172
|
-
|
|
1173
|
-
/***/ "./dist/eventBus/SubscriptionTargetInfo.js":
|
|
1174
|
-
/*!*************************************************!*\
|
|
1175
|
-
!*** ./dist/eventBus/SubscriptionTargetInfo.js ***!
|
|
1176
|
-
\*************************************************/
|
|
1177
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
1178
|
-
|
|
1179
|
-
"use strict";
|
|
1180
|
-
|
|
1181
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1182
|
-
exports.SubscriptionTargetInfo = void 0;
|
|
1183
|
-
class SubscriptionTargetInfo {
|
|
1184
|
-
constructor(namespace) {
|
|
1185
|
-
this.namespace = namespace;
|
|
1186
|
-
}
|
|
1187
|
-
static from(target) {
|
|
1188
|
-
if (target instanceof Function) {
|
|
1189
|
-
return new ConstructorSubscriptionTargetInfo(target);
|
|
1190
|
-
}
|
|
1191
|
-
return new NamespaceSubscriptionTargetInfo(target);
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
exports.SubscriptionTargetInfo = SubscriptionTargetInfo;
|
|
1195
|
-
class ConstructorSubscriptionTargetInfo extends SubscriptionTargetInfo {
|
|
1196
|
-
constructor(constructorFunction) {
|
|
1197
|
-
super(getEventNamespaceFromClass(constructorFunction));
|
|
1198
|
-
this.constructorFunction = constructorFunction;
|
|
1199
|
-
}
|
|
1200
|
-
isCompatibleWith(event) {
|
|
1201
|
-
return event instanceof this.constructorFunction;
|
|
1202
|
-
}
|
|
1203
|
-
}
|
|
1204
|
-
class NamespaceSubscriptionTargetInfo extends SubscriptionTargetInfo {
|
|
1205
|
-
constructor(namespace) {
|
|
1206
|
-
super(namespace);
|
|
1207
|
-
}
|
|
1208
|
-
isCompatibleWith(_event) {
|
|
1209
|
-
return true;
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
function getEventNamespaceFromClass(targetClass) {
|
|
1213
|
-
return targetClass.namespace;
|
|
1214
|
-
}
|
|
1215
|
-
//# sourceMappingURL=SubscriptionTargetInfo.js.map
|
|
1216
|
-
|
|
1217
|
-
/***/ }),
|
|
1218
|
-
|
|
1219
|
-
/***/ "./dist/eventBus/eventEmitter2/EventEmitter2EventBus.js":
|
|
1220
|
-
/*!**************************************************************!*\
|
|
1221
|
-
!*** ./dist/eventBus/eventEmitter2/EventEmitter2EventBus.js ***!
|
|
1222
|
-
\**************************************************************/
|
|
1223
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1224
|
-
|
|
1225
|
-
"use strict";
|
|
1226
|
-
|
|
1227
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1228
|
-
exports.EventEmitter2EventBus = void 0;
|
|
1229
|
-
const eventemitter2_1 = __webpack_require__(/*! eventemitter2 */ "./node_modules/eventemitter2/lib/eventemitter2.js");
|
|
1230
|
-
__webpack_require__(/*! reflect-metadata */ "./node_modules/reflect-metadata/Reflect.js");
|
|
1231
|
-
const EventBus_1 = __webpack_require__(/*! ../EventBus */ "./dist/eventBus/EventBus.js");
|
|
1232
|
-
const SubscriptionTargetInfo_1 = __webpack_require__(/*! ../SubscriptionTargetInfo */ "./dist/eventBus/SubscriptionTargetInfo.js");
|
|
1233
|
-
class EventEmitter2EventBus {
|
|
1234
|
-
constructor() {
|
|
1235
|
-
this.wrappers = new Map();
|
|
1236
|
-
this.nextId = 0;
|
|
1237
|
-
this.emitter = new eventemitter2_1.EventEmitter2({ wildcard: true, maxListeners: 50, verboseMemoryLeak: true });
|
|
1238
|
-
}
|
|
1239
|
-
subscribe(subscriptionTarget, handler) {
|
|
1240
|
-
return this.registerHandler(subscriptionTarget, handler);
|
|
1241
|
-
}
|
|
1242
|
-
subscribeOnce(subscriptionTarget, handler) {
|
|
1243
|
-
return this.registerHandler(subscriptionTarget, handler, true);
|
|
1244
|
-
}
|
|
1245
|
-
unsubscribe(subscriptionTarget, subscriptionId) {
|
|
1246
|
-
return this.unregisterHandler(subscriptionTarget, subscriptionId);
|
|
1247
|
-
}
|
|
1248
|
-
registerHandler(subscriptionTarget, handler, isOneTimeHandler = false) {
|
|
1249
|
-
const subscriptionTargetInfo = SubscriptionTargetInfo_1.SubscriptionTargetInfo.from(subscriptionTarget);
|
|
1250
|
-
const handlerId = this.nextId++;
|
|
1251
|
-
const handlerWrapper = (event) => {
|
|
1252
|
-
if (!subscriptionTargetInfo.isCompatibleWith(event)) {
|
|
1253
|
-
return;
|
|
1254
|
-
}
|
|
1255
|
-
handler(event);
|
|
1256
|
-
if (isOneTimeHandler) {
|
|
1257
|
-
this.unsubscribe(subscriptionTarget, handlerId);
|
|
1258
|
-
}
|
|
1259
|
-
};
|
|
1260
|
-
this.wrappers.set(handlerId, handlerWrapper);
|
|
1261
|
-
this.emitter.on(subscriptionTargetInfo.namespace, handlerWrapper);
|
|
1262
|
-
return handlerId;
|
|
1263
|
-
}
|
|
1264
|
-
unregisterHandler(subscriptionTarget, handlerId) {
|
|
1265
|
-
const subscriptionTargetInfo = SubscriptionTargetInfo_1.SubscriptionTargetInfo.from(subscriptionTarget);
|
|
1266
|
-
const handlerWrapper = this.wrappers.get(handlerId);
|
|
1267
|
-
if (!handlerWrapper) {
|
|
1268
|
-
return false;
|
|
1269
|
-
}
|
|
1270
|
-
this.emitter.off(subscriptionTargetInfo.namespace, handlerWrapper);
|
|
1271
|
-
this.wrappers.delete(handlerId);
|
|
1272
|
-
return true;
|
|
1273
|
-
}
|
|
1274
|
-
publish(event) {
|
|
1275
|
-
const namespace = (0, EventBus_1.getEventNamespaceFromObject)(event);
|
|
1276
|
-
if (!namespace) {
|
|
1277
|
-
throw Error("The event needs a namespace. Use the EventNamespace-decorator in order to define a namespace for a event.");
|
|
1278
|
-
}
|
|
1279
|
-
this.emitter.emit(namespace, event);
|
|
1280
|
-
}
|
|
1281
|
-
}
|
|
1282
|
-
exports.EventEmitter2EventBus = EventEmitter2EventBus;
|
|
1283
|
-
//# sourceMappingURL=EventEmitter2EventBus.js.map
|
|
1284
|
-
|
|
1285
|
-
/***/ }),
|
|
1286
|
-
|
|
1287
|
-
/***/ "./dist/eventBus/index.js":
|
|
1288
|
-
/*!********************************!*\
|
|
1289
|
-
!*** ./dist/eventBus/index.js ***!
|
|
1290
|
-
\********************************/
|
|
1291
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1292
|
-
|
|
1293
|
-
"use strict";
|
|
1294
|
-
|
|
1295
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1296
|
-
if (k2 === undefined) k2 = k;
|
|
1297
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
1298
|
-
}) : (function(o, m, k, k2) {
|
|
1299
|
-
if (k2 === undefined) k2 = k;
|
|
1300
|
-
o[k2] = m[k];
|
|
1301
|
-
}));
|
|
1302
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
1303
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1304
|
-
};
|
|
1305
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1306
|
-
__exportStar(__webpack_require__(/*! ./EventBus */ "./dist/eventBus/EventBus.js"), exports);
|
|
1307
|
-
__exportStar(__webpack_require__(/*! ./eventEmitter2/EventEmitter2EventBus */ "./dist/eventBus/eventEmitter2/EventEmitter2EventBus.js"), exports);
|
|
1308
|
-
//# sourceMappingURL=index.js.map
|
|
1309
|
-
|
|
1310
|
-
/***/ }),
|
|
1311
|
-
|
|
1312
1151
|
/***/ "./dist/events/DataEvent.js":
|
|
1313
1152
|
/*!**********************************!*\
|
|
1314
1153
|
!*** ./dist/events/DataEvent.js ***!
|
|
@@ -1470,6 +1309,7 @@ __exportStar(__webpack_require__(/*! ./runtime/ModulesStartedEvent */ "./dist/ev
|
|
|
1470
1309
|
__exportStar(__webpack_require__(/*! ./runtime/RuntimeInitializedEvent */ "./dist/events/runtime/RuntimeInitializedEvent.js"), exports);
|
|
1471
1310
|
__exportStar(__webpack_require__(/*! ./runtime/RuntimeInitializingEvent */ "./dist/events/runtime/RuntimeInitializingEvent.js"), exports);
|
|
1472
1311
|
__exportStar(__webpack_require__(/*! ./transport/MessageReceivedEvent */ "./dist/events/transport/MessageReceivedEvent.js"), exports);
|
|
1312
|
+
__exportStar(__webpack_require__(/*! ./transport/MessageSentEvent */ "./dist/events/transport/MessageSentEvent.js"), exports);
|
|
1473
1313
|
__exportStar(__webpack_require__(/*! ./transport/RelationshipChangedEvent */ "./dist/events/transport/RelationshipChangedEvent.js"), exports);
|
|
1474
1314
|
__exportStar(__webpack_require__(/*! ./transport/TransportLibraryInitializedEvent */ "./dist/events/transport/TransportLibraryInitializedEvent.js"), exports);
|
|
1475
1315
|
__exportStar(__webpack_require__(/*! ./transport/TransportLibraryInitializingEvent */ "./dist/events/transport/TransportLibraryInitializingEvent.js"), exports);
|
|
@@ -1609,6 +1449,28 @@ MessageReceivedEvent.namespace = "transport.messageReceived";
|
|
|
1609
1449
|
|
|
1610
1450
|
/***/ }),
|
|
1611
1451
|
|
|
1452
|
+
/***/ "./dist/events/transport/MessageSentEvent.js":
|
|
1453
|
+
/*!***************************************************!*\
|
|
1454
|
+
!*** ./dist/events/transport/MessageSentEvent.js ***!
|
|
1455
|
+
\***************************************************/
|
|
1456
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1457
|
+
|
|
1458
|
+
"use strict";
|
|
1459
|
+
|
|
1460
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1461
|
+
exports.MessageSentEvent = void 0;
|
|
1462
|
+
const DataEvent_1 = __webpack_require__(/*! ../DataEvent */ "./dist/events/DataEvent.js");
|
|
1463
|
+
class MessageSentEvent extends DataEvent_1.DataEvent {
|
|
1464
|
+
constructor(data) {
|
|
1465
|
+
super(MessageSentEvent.namespace, data);
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
exports.MessageSentEvent = MessageSentEvent;
|
|
1469
|
+
MessageSentEvent.namespace = "transport.messageSent";
|
|
1470
|
+
//# sourceMappingURL=MessageSentEvent.js.map
|
|
1471
|
+
|
|
1472
|
+
/***/ }),
|
|
1473
|
+
|
|
1612
1474
|
/***/ "./dist/events/transport/RelationshipChangedEvent.js":
|
|
1613
1475
|
/*!***********************************************************!*\
|
|
1614
1476
|
!*** ./dist/events/transport/RelationshipChangedEvent.js ***!
|
|
@@ -3019,7 +2881,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
3019
2881
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3020
2882
|
__exportStar(__webpack_require__(/*! ./buildInformation */ "./dist/buildInformation.js"), exports);
|
|
3021
2883
|
__exportStar(__webpack_require__(/*! ./dataViews */ "./dist/dataViews/index.js"), exports);
|
|
3022
|
-
__exportStar(__webpack_require__(/*! ./eventBus */ "./dist/eventBus/index.js"), exports);
|
|
3023
2884
|
__exportStar(__webpack_require__(/*! ./events */ "./dist/events/index.js"), exports);
|
|
3024
2885
|
__exportStar(__webpack_require__(/*! ./extensibility */ "./dist/extensibility/index.js"), exports);
|
|
3025
2886
|
__exportStar(__webpack_require__(/*! ./modules */ "./dist/modules/index.js"), exports);
|
|
@@ -3413,6 +3274,16 @@ var RelationshipChangeType;
|
|
|
3413
3274
|
"use strict";
|
|
3414
3275
|
|
|
3415
3276
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3277
|
+
exports.RelationshipStatus = void 0;
|
|
3278
|
+
var RelationshipStatus;
|
|
3279
|
+
(function (RelationshipStatus) {
|
|
3280
|
+
RelationshipStatus["Pending"] = "Pending";
|
|
3281
|
+
RelationshipStatus["Active"] = "Active";
|
|
3282
|
+
RelationshipStatus["Rejected"] = "Rejected";
|
|
3283
|
+
RelationshipStatus["Revoked"] = "Revoked";
|
|
3284
|
+
RelationshipStatus["Terminating"] = "Terminating";
|
|
3285
|
+
RelationshipStatus["Terminated"] = "Terminated";
|
|
3286
|
+
})(RelationshipStatus = exports.RelationshipStatus || (exports.RelationshipStatus = {}));
|
|
3416
3287
|
//# sourceMappingURL=RelationshipDTO.js.map
|
|
3417
3288
|
|
|
3418
3289
|
/***/ }),
|
|
@@ -9022,7 +8893,6 @@ exports.SyncEverythingUseCase = void 0;
|
|
|
9022
8893
|
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
9023
8894
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
9024
8895
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
9025
|
-
const EventBus_1 = __webpack_require__(/*! ../../../eventBus/EventBus */ "./dist/eventBus/EventBus.js");
|
|
9026
8896
|
const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
|
|
9027
8897
|
const RuntimeLoggerFactory_1 = __webpack_require__(/*! ../../../RuntimeLoggerFactory */ "./dist/RuntimeLoggerFactory.js");
|
|
9028
8898
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
@@ -9083,7 +8953,7 @@ SyncEverythingUseCase = __decorate([
|
|
|
9083
8953
|
__param(0, typescript_ioc_1.Inject),
|
|
9084
8954
|
__param(1, typescript_ioc_1.Inject),
|
|
9085
8955
|
__param(2, typescript_ioc_1.Inject),
|
|
9086
|
-
__metadata("design:paramtypes", [transport_1.AccountController,
|
|
8956
|
+
__metadata("design:paramtypes", [transport_1.AccountController, ts_utils_1.EventBus, RuntimeLoggerFactory_1.RuntimeLoggerFactory])
|
|
9087
8957
|
], SyncEverythingUseCase);
|
|
9088
8958
|
exports.SyncEverythingUseCase = SyncEverythingUseCase;
|
|
9089
8959
|
//# sourceMappingURL=SyncEverything.js.map
|
|
@@ -10864,6 +10734,7 @@ exports.SendMessageUseCase = void 0;
|
|
|
10864
10734
|
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
10865
10735
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
10866
10736
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
10737
|
+
const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
|
|
10867
10738
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
10868
10739
|
const MessageMapper_1 = __webpack_require__(/*! ./MessageMapper */ "./dist/useCases/transport/messages/MessageMapper.js");
|
|
10869
10740
|
class SendMessageRequestValidator extends common_1.RuntimeValidator {
|
|
@@ -10876,11 +10747,12 @@ class SendMessageRequestValidator extends common_1.RuntimeValidator {
|
|
|
10876
10747
|
}
|
|
10877
10748
|
}
|
|
10878
10749
|
let SendMessageUseCase = class SendMessageUseCase extends common_1.UseCase {
|
|
10879
|
-
constructor(messageController, fileController, accountController, validator) {
|
|
10750
|
+
constructor(messageController, fileController, accountController, eventBus, validator) {
|
|
10880
10751
|
super(validator);
|
|
10881
10752
|
this.messageController = messageController;
|
|
10882
10753
|
this.fileController = fileController;
|
|
10883
10754
|
this.accountController = accountController;
|
|
10755
|
+
this.eventBus = eventBus;
|
|
10884
10756
|
}
|
|
10885
10757
|
async executeInternal(request) {
|
|
10886
10758
|
const transformAttachmentsResult = await this.transformAttachments(request.attachments);
|
|
@@ -10892,6 +10764,8 @@ let SendMessageUseCase = class SendMessageUseCase extends common_1.UseCase {
|
|
|
10892
10764
|
content: request.content,
|
|
10893
10765
|
attachments: transformAttachmentsResult.value
|
|
10894
10766
|
});
|
|
10767
|
+
const messageDTO = MessageMapper_1.MessageMapper.toMessageDTO(result);
|
|
10768
|
+
this.eventBus.publish(new events_1.MessageSentEvent(messageDTO));
|
|
10895
10769
|
await this.accountController.syncDatawallet();
|
|
10896
10770
|
return ts_utils_1.Result.ok(MessageMapper_1.MessageMapper.toMessageDTO(result));
|
|
10897
10771
|
}
|
|
@@ -10915,9 +10789,11 @@ SendMessageUseCase = __decorate([
|
|
|
10915
10789
|
__param(1, typescript_ioc_1.Inject),
|
|
10916
10790
|
__param(2, typescript_ioc_1.Inject),
|
|
10917
10791
|
__param(3, typescript_ioc_1.Inject),
|
|
10792
|
+
__param(4, typescript_ioc_1.Inject),
|
|
10918
10793
|
__metadata("design:paramtypes", [transport_1.MessageController,
|
|
10919
10794
|
transport_1.FileController,
|
|
10920
10795
|
transport_1.AccountController,
|
|
10796
|
+
ts_utils_1.EventBus,
|
|
10921
10797
|
SendMessageRequestValidator])
|
|
10922
10798
|
], SendMessageUseCase);
|
|
10923
10799
|
exports.SendMessageUseCase = SendMessageUseCase;
|
|
@@ -11513,6 +11389,7 @@ exports.AcceptRelationshipChangeUseCase = void 0;
|
|
|
11513
11389
|
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
11514
11390
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
11515
11391
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
11392
|
+
const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
|
|
11516
11393
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
11517
11394
|
const RelationshipMapper_1 = __webpack_require__(/*! ./RelationshipMapper */ "./dist/useCases/transport/relationships/RelationshipMapper.js");
|
|
11518
11395
|
class AcceptRelationshipChangeRequestValidator extends common_1.RuntimeValidator {
|
|
@@ -11523,10 +11400,11 @@ class AcceptRelationshipChangeRequestValidator extends common_1.RuntimeValidator
|
|
|
11523
11400
|
}
|
|
11524
11401
|
}
|
|
11525
11402
|
let AcceptRelationshipChangeUseCase = class AcceptRelationshipChangeUseCase extends common_1.UseCase {
|
|
11526
|
-
constructor(relationshipsController, accountController, validator) {
|
|
11403
|
+
constructor(relationshipsController, accountController, eventBus, validator) {
|
|
11527
11404
|
super(validator);
|
|
11528
11405
|
this.relationshipsController = relationshipsController;
|
|
11529
11406
|
this.accountController = accountController;
|
|
11407
|
+
this.eventBus = eventBus;
|
|
11530
11408
|
}
|
|
11531
11409
|
async executeInternal(request) {
|
|
11532
11410
|
const relationship = await this.relationshipsController.getRelationship(transport_1.CoreId.from(request.relationshipId));
|
|
@@ -11540,17 +11418,21 @@ let AcceptRelationshipChangeUseCase = class AcceptRelationshipChangeUseCase exte
|
|
|
11540
11418
|
if (!change) {
|
|
11541
11419
|
return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(transport_1.RelationshipChange));
|
|
11542
11420
|
}
|
|
11543
|
-
const
|
|
11421
|
+
const updatedRelationship = await this.relationshipsController.acceptChange(change, request.content);
|
|
11422
|
+
const relationshipDTO = RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(updatedRelationship);
|
|
11423
|
+
this.eventBus.publish(new events_1.RelationshipChangedEvent(relationshipDTO));
|
|
11544
11424
|
await this.accountController.syncDatawallet();
|
|
11545
|
-
return ts_utils_1.Result.ok(
|
|
11425
|
+
return ts_utils_1.Result.ok(relationshipDTO);
|
|
11546
11426
|
}
|
|
11547
11427
|
};
|
|
11548
11428
|
AcceptRelationshipChangeUseCase = __decorate([
|
|
11549
11429
|
__param(0, typescript_ioc_1.Inject),
|
|
11550
11430
|
__param(1, typescript_ioc_1.Inject),
|
|
11551
11431
|
__param(2, typescript_ioc_1.Inject),
|
|
11432
|
+
__param(3, typescript_ioc_1.Inject),
|
|
11552
11433
|
__metadata("design:paramtypes", [transport_1.RelationshipsController,
|
|
11553
11434
|
transport_1.AccountController,
|
|
11435
|
+
ts_utils_1.EventBus,
|
|
11554
11436
|
AcceptRelationshipChangeRequestValidator])
|
|
11555
11437
|
], AcceptRelationshipChangeUseCase);
|
|
11556
11438
|
exports.AcceptRelationshipChangeUseCase = AcceptRelationshipChangeUseCase;
|
|
@@ -11583,6 +11465,7 @@ exports.CreateRelationshipUseCase = void 0;
|
|
|
11583
11465
|
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
11584
11466
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
11585
11467
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
11468
|
+
const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
|
|
11586
11469
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
11587
11470
|
const RelationshipMapper_1 = __webpack_require__(/*! ./RelationshipMapper */ "./dist/useCases/transport/relationships/RelationshipMapper.js");
|
|
11588
11471
|
class CreateRelationshipRequestValidator extends common_1.RuntimeValidator {
|
|
@@ -11593,11 +11476,12 @@ class CreateRelationshipRequestValidator extends common_1.RuntimeValidator {
|
|
|
11593
11476
|
}
|
|
11594
11477
|
}
|
|
11595
11478
|
let CreateRelationshipUseCase = class CreateRelationshipUseCase extends common_1.UseCase {
|
|
11596
|
-
constructor(relationshipsController, relationshipTemplateController, accountController, validator) {
|
|
11479
|
+
constructor(relationshipsController, relationshipTemplateController, accountController, eventBus, validator) {
|
|
11597
11480
|
super(validator);
|
|
11598
11481
|
this.relationshipsController = relationshipsController;
|
|
11599
11482
|
this.relationshipTemplateController = relationshipTemplateController;
|
|
11600
11483
|
this.accountController = accountController;
|
|
11484
|
+
this.eventBus = eventBus;
|
|
11601
11485
|
}
|
|
11602
11486
|
async executeInternal(request) {
|
|
11603
11487
|
const template = await this.relationshipTemplateController.getRelationshipTemplate(transport_1.CoreId.from(request.templateId));
|
|
@@ -11608,8 +11492,10 @@ let CreateRelationshipUseCase = class CreateRelationshipUseCase extends common_1
|
|
|
11608
11492
|
template: template,
|
|
11609
11493
|
content: request.content
|
|
11610
11494
|
});
|
|
11495
|
+
const relationshipDTO = RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(relationship);
|
|
11496
|
+
this.eventBus.publish(new events_1.RelationshipChangedEvent(relationshipDTO));
|
|
11611
11497
|
await this.accountController.syncDatawallet();
|
|
11612
|
-
return ts_utils_1.Result.ok(
|
|
11498
|
+
return ts_utils_1.Result.ok(relationshipDTO);
|
|
11613
11499
|
}
|
|
11614
11500
|
};
|
|
11615
11501
|
CreateRelationshipUseCase = __decorate([
|
|
@@ -11617,9 +11503,11 @@ CreateRelationshipUseCase = __decorate([
|
|
|
11617
11503
|
__param(1, typescript_ioc_1.Inject),
|
|
11618
11504
|
__param(2, typescript_ioc_1.Inject),
|
|
11619
11505
|
__param(3, typescript_ioc_1.Inject),
|
|
11506
|
+
__param(4, typescript_ioc_1.Inject),
|
|
11620
11507
|
__metadata("design:paramtypes", [transport_1.RelationshipsController,
|
|
11621
11508
|
transport_1.RelationshipTemplateController,
|
|
11622
11509
|
transport_1.AccountController,
|
|
11510
|
+
ts_utils_1.EventBus,
|
|
11623
11511
|
CreateRelationshipRequestValidator])
|
|
11624
11512
|
], CreateRelationshipUseCase);
|
|
11625
11513
|
exports.CreateRelationshipUseCase = CreateRelationshipUseCase;
|
|
@@ -11888,6 +11776,7 @@ exports.RejectRelationshipChangeUseCase = void 0;
|
|
|
11888
11776
|
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
11889
11777
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
11890
11778
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
11779
|
+
const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
|
|
11891
11780
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
11892
11781
|
const RelationshipMapper_1 = __webpack_require__(/*! ./RelationshipMapper */ "./dist/useCases/transport/relationships/RelationshipMapper.js");
|
|
11893
11782
|
class RejectRelationshipChangeRequestValidator extends common_1.RuntimeValidator {
|
|
@@ -11898,10 +11787,11 @@ class RejectRelationshipChangeRequestValidator extends common_1.RuntimeValidator
|
|
|
11898
11787
|
}
|
|
11899
11788
|
}
|
|
11900
11789
|
let RejectRelationshipChangeUseCase = class RejectRelationshipChangeUseCase extends common_1.UseCase {
|
|
11901
|
-
constructor(relationshipsController, accountController, validator) {
|
|
11790
|
+
constructor(relationshipsController, accountController, eventBus, validator) {
|
|
11902
11791
|
super(validator);
|
|
11903
11792
|
this.relationshipsController = relationshipsController;
|
|
11904
11793
|
this.accountController = accountController;
|
|
11794
|
+
this.eventBus = eventBus;
|
|
11905
11795
|
}
|
|
11906
11796
|
async executeInternal(request) {
|
|
11907
11797
|
const relationship = await this.relationshipsController.getRelationship(transport_1.CoreId.from(request.relationshipId));
|
|
@@ -11915,17 +11805,21 @@ let RejectRelationshipChangeUseCase = class RejectRelationshipChangeUseCase exte
|
|
|
11915
11805
|
if (!change) {
|
|
11916
11806
|
return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(transport_1.RelationshipChange));
|
|
11917
11807
|
}
|
|
11918
|
-
const
|
|
11808
|
+
const updatedRelationship = await this.relationshipsController.rejectChange(change, request.content);
|
|
11809
|
+
const relationshipDTO = RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(updatedRelationship);
|
|
11810
|
+
this.eventBus.publish(new events_1.RelationshipChangedEvent(relationshipDTO));
|
|
11919
11811
|
await this.accountController.syncDatawallet();
|
|
11920
|
-
return ts_utils_1.Result.ok(
|
|
11812
|
+
return ts_utils_1.Result.ok(relationshipDTO);
|
|
11921
11813
|
}
|
|
11922
11814
|
};
|
|
11923
11815
|
RejectRelationshipChangeUseCase = __decorate([
|
|
11924
11816
|
__param(0, typescript_ioc_1.Inject),
|
|
11925
11817
|
__param(1, typescript_ioc_1.Inject),
|
|
11926
11818
|
__param(2, typescript_ioc_1.Inject),
|
|
11819
|
+
__param(3, typescript_ioc_1.Inject),
|
|
11927
11820
|
__metadata("design:paramtypes", [transport_1.RelationshipsController,
|
|
11928
11821
|
transport_1.AccountController,
|
|
11822
|
+
ts_utils_1.EventBus,
|
|
11929
11823
|
RejectRelationshipChangeRequestValidator])
|
|
11930
11824
|
], RejectRelationshipChangeUseCase);
|
|
11931
11825
|
exports.RejectRelationshipChangeUseCase = RejectRelationshipChangeUseCase;
|
|
@@ -12021,6 +11915,7 @@ exports.RevokeRelationshipChangeUseCase = void 0;
|
|
|
12021
11915
|
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
12022
11916
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
12023
11917
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
11918
|
+
const events_1 = __webpack_require__(/*! ../../../events */ "./dist/events/index.js");
|
|
12024
11919
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
12025
11920
|
const RelationshipMapper_1 = __webpack_require__(/*! ./RelationshipMapper */ "./dist/useCases/transport/relationships/RelationshipMapper.js");
|
|
12026
11921
|
class RevokeRelationshipChangeRequestValidator extends common_1.RuntimeValidator {
|
|
@@ -12031,10 +11926,11 @@ class RevokeRelationshipChangeRequestValidator extends common_1.RuntimeValidator
|
|
|
12031
11926
|
}
|
|
12032
11927
|
}
|
|
12033
11928
|
let RevokeRelationshipChangeUseCase = class RevokeRelationshipChangeUseCase extends common_1.UseCase {
|
|
12034
|
-
constructor(relationshipsController, accountController, validator) {
|
|
11929
|
+
constructor(relationshipsController, accountController, eventBus, validator) {
|
|
12035
11930
|
super(validator);
|
|
12036
11931
|
this.relationshipsController = relationshipsController;
|
|
12037
11932
|
this.accountController = accountController;
|
|
11933
|
+
this.eventBus = eventBus;
|
|
12038
11934
|
}
|
|
12039
11935
|
async executeInternal(request) {
|
|
12040
11936
|
const relationship = await this.relationshipsController.getRelationship(transport_1.CoreId.from(request.relationshipId));
|
|
@@ -12048,17 +11944,21 @@ let RevokeRelationshipChangeUseCase = class RevokeRelationshipChangeUseCase exte
|
|
|
12048
11944
|
if (!change) {
|
|
12049
11945
|
return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(transport_1.RelationshipChange));
|
|
12050
11946
|
}
|
|
12051
|
-
const
|
|
11947
|
+
const updatedRelationship = await this.relationshipsController.revokeChange(change, request.content);
|
|
11948
|
+
const relationshipDTO = RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(updatedRelationship);
|
|
11949
|
+
this.eventBus.publish(new events_1.RelationshipChangedEvent(relationshipDTO));
|
|
12052
11950
|
await this.accountController.syncDatawallet();
|
|
12053
|
-
return ts_utils_1.Result.ok(
|
|
11951
|
+
return ts_utils_1.Result.ok(relationshipDTO);
|
|
12054
11952
|
}
|
|
12055
11953
|
};
|
|
12056
11954
|
RevokeRelationshipChangeUseCase = __decorate([
|
|
12057
11955
|
__param(0, typescript_ioc_1.Inject),
|
|
12058
11956
|
__param(1, typescript_ioc_1.Inject),
|
|
12059
11957
|
__param(2, typescript_ioc_1.Inject),
|
|
11958
|
+
__param(3, typescript_ioc_1.Inject),
|
|
12060
11959
|
__metadata("design:paramtypes", [transport_1.RelationshipsController,
|
|
12061
11960
|
transport_1.AccountController,
|
|
11961
|
+
ts_utils_1.EventBus,
|
|
12062
11962
|
RevokeRelationshipChangeRequestValidator])
|
|
12063
11963
|
], RevokeRelationshipChangeUseCase);
|
|
12064
11964
|
exports.RevokeRelationshipChangeUseCase = RevokeRelationshipChangeUseCase;
|