@nmshd/runtime 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buildInformation.js +4 -4
- package/dist/events/DataEvent.d.ts +2 -1
- package/dist/events/DataEvent.js +2 -1
- package/dist/events/DataEvent.js.map +1 -1
- package/dist/events/consumption/MailReceivedEvent.d.ts +1 -1
- package/dist/events/consumption/MailReceivedEvent.js +2 -2
- package/dist/events/consumption/MailReceivedEvent.js.map +1 -1
- package/dist/events/consumption/RelationshipEvent.d.ts +1 -1
- package/dist/events/consumption/RelationshipEvent.js +2 -2
- package/dist/events/consumption/RelationshipEvent.js.map +1 -1
- package/dist/events/consumption/RequestMailReceivedEvent.d.ts +1 -1
- package/dist/events/consumption/RequestMailReceivedEvent.js +2 -2
- package/dist/events/consumption/RequestMailReceivedEvent.js.map +1 -1
- package/dist/events/consumption/RequestReceivedEvent.d.ts +1 -1
- package/dist/events/consumption/RequestReceivedEvent.js +2 -2
- package/dist/events/consumption/RequestReceivedEvent.js.map +1 -1
- package/dist/events/transport/MessageDeliveredEvent.d.ts +1 -1
- package/dist/events/transport/MessageDeliveredEvent.js +2 -2
- package/dist/events/transport/MessageDeliveredEvent.js.map +1 -1
- package/dist/events/transport/MessageReceivedEvent.d.ts +1 -1
- package/dist/events/transport/MessageReceivedEvent.js +2 -2
- package/dist/events/transport/MessageReceivedEvent.js.map +1 -1
- package/dist/events/transport/MessageSentEvent.d.ts +1 -1
- package/dist/events/transport/MessageSentEvent.js +2 -2
- package/dist/events/transport/MessageSentEvent.js.map +1 -1
- package/dist/events/transport/RelationshipChangeReceivedEvent.d.ts +1 -1
- package/dist/events/transport/RelationshipChangeReceivedEvent.js +2 -2
- package/dist/events/transport/RelationshipChangeReceivedEvent.js.map +1 -1
- package/dist/events/transport/RelationshipChangedEvent.d.ts +1 -1
- package/dist/events/transport/RelationshipChangedEvent.js +2 -2
- package/dist/events/transport/RelationshipChangedEvent.js.map +1 -1
- package/dist/modules/MessageModule.js +4 -4
- package/dist/modules/MessageModule.js.map +1 -1
- package/dist/useCases/transport/account/SyncEverything.d.ts +3 -2
- package/dist/useCases/transport/account/SyncEverything.js +14 -8
- 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 +5 -2
- 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 +5 -2
- 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 +5 -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 +5 -2
- 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 +5 -2
- package/dist/useCases/transport/relationships/RevokeRelationshipChange.js.map +1 -1
- package/lib-web/nmshd.runtime.js +63 -41
- 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 +1 -1
|
@@ -27,11 +27,12 @@ class CreateRelationshipRequestValidator extends common_1.RuntimeValidator {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
let CreateRelationshipUseCase = class CreateRelationshipUseCase extends common_1.UseCase {
|
|
30
|
-
constructor(relationshipsController, relationshipTemplateController, accountController, eventBus, validator) {
|
|
30
|
+
constructor(relationshipsController, relationshipTemplateController, accountController, identityController, eventBus, validator) {
|
|
31
31
|
super(validator);
|
|
32
32
|
this.relationshipsController = relationshipsController;
|
|
33
33
|
this.relationshipTemplateController = relationshipTemplateController;
|
|
34
34
|
this.accountController = accountController;
|
|
35
|
+
this.identityController = identityController;
|
|
35
36
|
this.eventBus = eventBus;
|
|
36
37
|
}
|
|
37
38
|
async executeInternal(request) {
|
|
@@ -44,7 +45,7 @@ let CreateRelationshipUseCase = class CreateRelationshipUseCase extends common_1
|
|
|
44
45
|
content: request.content
|
|
45
46
|
});
|
|
46
47
|
const relationshipDTO = RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(relationship);
|
|
47
|
-
this.eventBus.publish(new events_1.RelationshipChangedEvent(relationshipDTO));
|
|
48
|
+
this.eventBus.publish(new events_1.RelationshipChangedEvent(this.identityController.identity.address.toString(), relationshipDTO));
|
|
48
49
|
await this.accountController.syncDatawallet();
|
|
49
50
|
return ts_utils_1.Result.ok(relationshipDTO);
|
|
50
51
|
}
|
|
@@ -55,9 +56,11 @@ CreateRelationshipUseCase = __decorate([
|
|
|
55
56
|
__param(2, typescript_ioc_1.Inject),
|
|
56
57
|
__param(3, typescript_ioc_1.Inject),
|
|
57
58
|
__param(4, typescript_ioc_1.Inject),
|
|
59
|
+
__param(5, typescript_ioc_1.Inject),
|
|
58
60
|
__metadata("design:paramtypes", [transport_1.RelationshipsController,
|
|
59
61
|
transport_1.RelationshipTemplateController,
|
|
60
62
|
transport_1.AccountController,
|
|
63
|
+
transport_1.IdentityController,
|
|
61
64
|
ts_utils_1.EventBus,
|
|
62
65
|
CreateRelationshipRequestValidator])
|
|
63
66
|
], CreateRelationshipUseCase);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateRelationship.js","sourceRoot":"","sources":["../../../../src/useCases/transport/relationships/CreateRelationship.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"CreateRelationship.js","sourceRoot":"","sources":["../../../../src/useCases/transport/relationships/CreateRelationship.ts"],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gBAAgB,CAAC;YACrE,QAAQ,EAAE,QAAQ;YAClB,OAAO,EAAE,OAAO,CAAC,OAAO;SAC3B,CAAC,CAAC;QACH,MAAM,eAAe,GAAG,uCAAkB,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;QAE3E,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,iCAAwB,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC;QAC1H,MAAM,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QAE9C,OAAO,iBAAM,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC;IACtC,CAAC;CACJ,CAAA;AA9BY,yBAAyB;IAE7B,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IAEN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAN2C,mCAAuB;QAChB,0CAA8B;QAC3C,6BAAiB;QAEhB,8BAAkB;QAC5B,mBAAQ;QACxB,kCAAkC;GARhD,yBAAyB,CA8BrC;AA9BY,8DAAyB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventBus, Result } from "@js-soft/ts-utils";
|
|
2
|
-
import { AccountController, RelationshipsController } from "@nmshd/transport";
|
|
2
|
+
import { AccountController, IdentityController, RelationshipsController } from "@nmshd/transport";
|
|
3
3
|
import { RelationshipDTO } from "../../../types";
|
|
4
4
|
import { RuntimeValidator, UseCase } from "../../common";
|
|
5
5
|
export interface RejectRelationshipChangeRequest {
|
|
@@ -13,8 +13,9 @@ declare class RejectRelationshipChangeRequestValidator extends RuntimeValidator<
|
|
|
13
13
|
export declare class RejectRelationshipChangeUseCase extends UseCase<RejectRelationshipChangeRequest, RelationshipDTO> {
|
|
14
14
|
private readonly relationshipsController;
|
|
15
15
|
private readonly accountController;
|
|
16
|
+
private readonly identityController;
|
|
16
17
|
private readonly eventBus;
|
|
17
|
-
constructor(relationshipsController: RelationshipsController, accountController: AccountController, eventBus: EventBus, validator: RejectRelationshipChangeRequestValidator);
|
|
18
|
+
constructor(relationshipsController: RelationshipsController, accountController: AccountController, identityController: IdentityController, eventBus: EventBus, validator: RejectRelationshipChangeRequestValidator);
|
|
18
19
|
protected executeInternal(request: RejectRelationshipChangeRequest): Promise<Result<RelationshipDTO>>;
|
|
19
20
|
}
|
|
20
21
|
export {};
|
|
@@ -27,10 +27,11 @@ class RejectRelationshipChangeRequestValidator extends common_1.RuntimeValidator
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
let RejectRelationshipChangeUseCase = class RejectRelationshipChangeUseCase extends common_1.UseCase {
|
|
30
|
-
constructor(relationshipsController, accountController, eventBus, validator) {
|
|
30
|
+
constructor(relationshipsController, accountController, identityController, eventBus, validator) {
|
|
31
31
|
super(validator);
|
|
32
32
|
this.relationshipsController = relationshipsController;
|
|
33
33
|
this.accountController = accountController;
|
|
34
|
+
this.identityController = identityController;
|
|
34
35
|
this.eventBus = eventBus;
|
|
35
36
|
}
|
|
36
37
|
async executeInternal(request) {
|
|
@@ -47,7 +48,7 @@ let RejectRelationshipChangeUseCase = class RejectRelationshipChangeUseCase exte
|
|
|
47
48
|
}
|
|
48
49
|
const updatedRelationship = await this.relationshipsController.rejectChange(change, request.content);
|
|
49
50
|
const relationshipDTO = RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(updatedRelationship);
|
|
50
|
-
this.eventBus.publish(new events_1.RelationshipChangedEvent(relationshipDTO));
|
|
51
|
+
this.eventBus.publish(new events_1.RelationshipChangedEvent(this.identityController.identity.address.toString(), relationshipDTO));
|
|
51
52
|
await this.accountController.syncDatawallet();
|
|
52
53
|
return ts_utils_1.Result.ok(relationshipDTO);
|
|
53
54
|
}
|
|
@@ -57,8 +58,10 @@ RejectRelationshipChangeUseCase = __decorate([
|
|
|
57
58
|
__param(1, typescript_ioc_1.Inject),
|
|
58
59
|
__param(2, typescript_ioc_1.Inject),
|
|
59
60
|
__param(3, typescript_ioc_1.Inject),
|
|
61
|
+
__param(4, typescript_ioc_1.Inject),
|
|
60
62
|
__metadata("design:paramtypes", [transport_1.RelationshipsController,
|
|
61
63
|
transport_1.AccountController,
|
|
64
|
+
transport_1.IdentityController,
|
|
62
65
|
ts_utils_1.EventBus,
|
|
63
66
|
RejectRelationshipChangeRequestValidator])
|
|
64
67
|
], RejectRelationshipChangeUseCase);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RejectRelationshipChange.js","sourceRoot":"","sources":["../../../../src/useCases/transport/relationships/RejectRelationshipChange.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"RejectRelationshipChange.js","sourceRoot":"","sources":["../../../../src/useCases/transport/relationships/RejectRelationshipChange.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAqD;AACrD,gDAAyJ;AACzJ,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,EAEpC,kBAA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AAC,QAAQ,CAAC,OAAO,CAAC,IAAI,iCAAwB,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC;QAC1H,MAAM,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QAE9C,OAAO,iBAAM,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC;IACtC,CAAC;CACJ,CAAA;AAnCY,+BAA+B;IAEnC,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IAEN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAL2C,mCAAuB;QAC7B,6BAAiB;QAEhB,8BAAkB;QAC5B,mBAAQ;QACxB,wCAAwC;GAPtD,+BAA+B,CAmC3C;AAnCY,0EAA+B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventBus, Result } from "@js-soft/ts-utils";
|
|
2
|
-
import { AccountController, RelationshipsController } from "@nmshd/transport";
|
|
2
|
+
import { AccountController, IdentityController, RelationshipsController } from "@nmshd/transport";
|
|
3
3
|
import { RelationshipDTO } from "../../../types";
|
|
4
4
|
import { RuntimeValidator, UseCase } from "../../common";
|
|
5
5
|
export interface RevokeRelationshipChangeRequest {
|
|
@@ -14,7 +14,8 @@ export declare class RevokeRelationshipChangeUseCase extends UseCase<RevokeRelat
|
|
|
14
14
|
private readonly relationshipsController;
|
|
15
15
|
private readonly accountController;
|
|
16
16
|
private readonly eventBus;
|
|
17
|
-
|
|
17
|
+
private readonly identityController;
|
|
18
|
+
constructor(relationshipsController: RelationshipsController, accountController: AccountController, eventBus: EventBus, identityController: IdentityController, validator: RevokeRelationshipChangeRequestValidator);
|
|
18
19
|
protected executeInternal(request: RevokeRelationshipChangeRequest): Promise<Result<RelationshipDTO>>;
|
|
19
20
|
}
|
|
20
21
|
export {};
|
|
@@ -27,11 +27,12 @@ class RevokeRelationshipChangeRequestValidator extends common_1.RuntimeValidator
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
let RevokeRelationshipChangeUseCase = class RevokeRelationshipChangeUseCase extends common_1.UseCase {
|
|
30
|
-
constructor(relationshipsController, accountController, eventBus, validator) {
|
|
30
|
+
constructor(relationshipsController, accountController, eventBus, identityController, validator) {
|
|
31
31
|
super(validator);
|
|
32
32
|
this.relationshipsController = relationshipsController;
|
|
33
33
|
this.accountController = accountController;
|
|
34
34
|
this.eventBus = eventBus;
|
|
35
|
+
this.identityController = identityController;
|
|
35
36
|
}
|
|
36
37
|
async executeInternal(request) {
|
|
37
38
|
const relationship = await this.relationshipsController.getRelationship(transport_1.CoreId.from(request.relationshipId));
|
|
@@ -47,7 +48,7 @@ let RevokeRelationshipChangeUseCase = class RevokeRelationshipChangeUseCase exte
|
|
|
47
48
|
}
|
|
48
49
|
const updatedRelationship = await this.relationshipsController.revokeChange(change, request.content);
|
|
49
50
|
const relationshipDTO = RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(updatedRelationship);
|
|
50
|
-
this.eventBus.publish(new events_1.RelationshipChangedEvent(relationshipDTO));
|
|
51
|
+
this.eventBus.publish(new events_1.RelationshipChangedEvent(this.identityController.identity.address.toString(), relationshipDTO));
|
|
51
52
|
await this.accountController.syncDatawallet();
|
|
52
53
|
return ts_utils_1.Result.ok(relationshipDTO);
|
|
53
54
|
}
|
|
@@ -57,9 +58,11 @@ RevokeRelationshipChangeUseCase = __decorate([
|
|
|
57
58
|
__param(1, typescript_ioc_1.Inject),
|
|
58
59
|
__param(2, typescript_ioc_1.Inject),
|
|
59
60
|
__param(3, typescript_ioc_1.Inject),
|
|
61
|
+
__param(4, typescript_ioc_1.Inject),
|
|
60
62
|
__metadata("design:paramtypes", [transport_1.RelationshipsController,
|
|
61
63
|
transport_1.AccountController,
|
|
62
64
|
ts_utils_1.EventBus,
|
|
65
|
+
transport_1.IdentityController,
|
|
63
66
|
RevokeRelationshipChangeRequestValidator])
|
|
64
67
|
], RevokeRelationshipChangeUseCase);
|
|
65
68
|
exports.RevokeRelationshipChangeUseCase = RevokeRelationshipChangeUseCase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RevokeRelationshipChange.js","sourceRoot":"","sources":["../../../../src/useCases/transport/relationships/RevokeRelationshipChange.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"RevokeRelationshipChange.js","sourceRoot":"","sources":["../../../../src/useCases/transport/relationships/RevokeRelationshipChange.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAqD;AACrD,gDAAyJ;AACzJ,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,EAClB,kBAAsC,EACvD,SAAmD;QAE3D,KAAK,CAAC,SAAS,CAAC,CAAC;QANQ,4BAAuB,GAAvB,uBAAuB,CAAyB;QAChD,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,aAAQ,GAAR,QAAQ,CAAU;QAClB,uBAAkB,GAAlB,kBAAkB,CAAoB;IAInE,CAAC;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C,EAAE,CAAC,eAAe,CAAC,CAAC;IACtC,CAAC;CACJ,CAAA;AAlCY,+BAA+B;IAEnC,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAJ2C,mCAAuB;QAC7B,6BAAiB;QAC1B,mBAAQ;QACE,8BAAkB;QAC5C,wCAAwC;GANtD,+BAA+B,CAkC3C;AAlCY,0EAA+B"}
|
package/lib-web/nmshd.runtime.js
CHANGED
|
@@ -330,10 +330,10 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
|
330
330
|
const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
|
|
331
331
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
332
332
|
exports.buildInformation = {
|
|
333
|
-
version: "1.2.
|
|
334
|
-
build: "
|
|
335
|
-
date: "2021-
|
|
336
|
-
commit: "
|
|
333
|
+
version: "1.2.1",
|
|
334
|
+
build: "15",
|
|
335
|
+
date: "2021-12-02T12:17:23+00:00",
|
|
336
|
+
commit: "b119218b9a3b99f73d87b734d7ab14de51619681",
|
|
337
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.5","@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"},
|
|
338
338
|
libraries: {
|
|
339
339
|
serval: ts_serval_1.buildInformation,
|
|
@@ -1160,8 +1160,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1160
1160
|
exports.DataEvent = void 0;
|
|
1161
1161
|
const Event_1 = __webpack_require__(/*! ./Event */ "./dist/events/Event.js");
|
|
1162
1162
|
class DataEvent extends Event_1.Event {
|
|
1163
|
-
constructor(namespace, data) {
|
|
1163
|
+
constructor(namespace, eventTargetAddress, data) {
|
|
1164
1164
|
super(namespace);
|
|
1165
|
+
this.eventTargetAddress = eventTargetAddress;
|
|
1165
1166
|
this.data = data;
|
|
1166
1167
|
}
|
|
1167
1168
|
}
|
|
@@ -1202,8 +1203,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1202
1203
|
exports.MailReceivedEvent = void 0;
|
|
1203
1204
|
const DataEvent_1 = __webpack_require__(/*! ../DataEvent */ "./dist/events/DataEvent.js");
|
|
1204
1205
|
class MailReceivedEvent extends DataEvent_1.DataEvent {
|
|
1205
|
-
constructor(mail, data) {
|
|
1206
|
-
super(MailReceivedEvent.namespace, data);
|
|
1206
|
+
constructor(eventTargetAddress, mail, data) {
|
|
1207
|
+
super(MailReceivedEvent.namespace, eventTargetAddress, data);
|
|
1207
1208
|
this.mail = mail;
|
|
1208
1209
|
}
|
|
1209
1210
|
}
|
|
@@ -1225,8 +1226,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1225
1226
|
exports.RelationshipEvent = void 0;
|
|
1226
1227
|
const DataEvent_1 = __webpack_require__(/*! ../DataEvent */ "./dist/events/DataEvent.js");
|
|
1227
1228
|
class RelationshipEvent extends DataEvent_1.DataEvent {
|
|
1228
|
-
constructor(event, data) {
|
|
1229
|
-
super(RelationshipEvent.namespace + data.id, data);
|
|
1229
|
+
constructor(eventTargetAddress, event, data) {
|
|
1230
|
+
super(RelationshipEvent.namespace + data.id, eventTargetAddress, data);
|
|
1230
1231
|
this.event = event;
|
|
1231
1232
|
}
|
|
1232
1233
|
}
|
|
@@ -1248,8 +1249,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1248
1249
|
exports.RequestMailReceivedEvent = void 0;
|
|
1249
1250
|
const DataEvent_1 = __webpack_require__(/*! ../DataEvent */ "./dist/events/DataEvent.js");
|
|
1250
1251
|
class RequestMailReceivedEvent extends DataEvent_1.DataEvent {
|
|
1251
|
-
constructor(requestMail, data) {
|
|
1252
|
-
super(RequestMailReceivedEvent.namespace, data);
|
|
1252
|
+
constructor(eventTargetAddress, requestMail, data) {
|
|
1253
|
+
super(RequestMailReceivedEvent.namespace, eventTargetAddress, data);
|
|
1253
1254
|
this.requestMail = requestMail;
|
|
1254
1255
|
}
|
|
1255
1256
|
}
|
|
@@ -1271,8 +1272,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1271
1272
|
exports.RequestReceivedEvent = void 0;
|
|
1272
1273
|
const DataEvent_1 = __webpack_require__(/*! ../DataEvent */ "./dist/events/DataEvent.js");
|
|
1273
1274
|
class RequestReceivedEvent extends DataEvent_1.DataEvent {
|
|
1274
|
-
constructor(request, data) {
|
|
1275
|
-
super(RequestReceivedEvent.namespace, data);
|
|
1275
|
+
constructor(eventTargetAddress, request, data) {
|
|
1276
|
+
super(RequestReceivedEvent.namespace, eventTargetAddress, data);
|
|
1276
1277
|
this.request = request;
|
|
1277
1278
|
}
|
|
1278
1279
|
}
|
|
@@ -1439,8 +1440,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1439
1440
|
exports.MessageReceivedEvent = void 0;
|
|
1440
1441
|
const DataEvent_1 = __webpack_require__(/*! ../DataEvent */ "./dist/events/DataEvent.js");
|
|
1441
1442
|
class MessageReceivedEvent extends DataEvent_1.DataEvent {
|
|
1442
|
-
constructor(data) {
|
|
1443
|
-
super(MessageReceivedEvent.namespace, data);
|
|
1443
|
+
constructor(eventTargetAddress, data) {
|
|
1444
|
+
super(MessageReceivedEvent.namespace, eventTargetAddress, data);
|
|
1444
1445
|
}
|
|
1445
1446
|
}
|
|
1446
1447
|
exports.MessageReceivedEvent = MessageReceivedEvent;
|
|
@@ -1461,8 +1462,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1461
1462
|
exports.MessageSentEvent = void 0;
|
|
1462
1463
|
const DataEvent_1 = __webpack_require__(/*! ../DataEvent */ "./dist/events/DataEvent.js");
|
|
1463
1464
|
class MessageSentEvent extends DataEvent_1.DataEvent {
|
|
1464
|
-
constructor(data) {
|
|
1465
|
-
super(MessageSentEvent.namespace, data);
|
|
1465
|
+
constructor(eventTargetAddress, data) {
|
|
1466
|
+
super(MessageSentEvent.namespace, eventTargetAddress, data);
|
|
1466
1467
|
}
|
|
1467
1468
|
}
|
|
1468
1469
|
exports.MessageSentEvent = MessageSentEvent;
|
|
@@ -1483,8 +1484,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1483
1484
|
exports.RelationshipChangedEvent = void 0;
|
|
1484
1485
|
const DataEvent_1 = __webpack_require__(/*! ../DataEvent */ "./dist/events/DataEvent.js");
|
|
1485
1486
|
class RelationshipChangedEvent extends DataEvent_1.DataEvent {
|
|
1486
|
-
constructor(data) {
|
|
1487
|
-
super(RelationshipChangedEvent.namespace, data);
|
|
1487
|
+
constructor(eventTargetAddress, data) {
|
|
1488
|
+
super(RelationshipChangedEvent.namespace, eventTargetAddress, data);
|
|
1488
1489
|
}
|
|
1489
1490
|
}
|
|
1490
1491
|
exports.RelationshipChangedEvent = RelationshipChangedEvent;
|
|
@@ -2931,18 +2932,18 @@ class MessageModule extends RuntimeModule_1.RuntimeModule {
|
|
|
2931
2932
|
switch (type) {
|
|
2932
2933
|
case "Mail":
|
|
2933
2934
|
const mail = await content_1.Mail.from(message.content);
|
|
2934
|
-
event = new MailReceivedEvent_1.MailReceivedEvent(mail, message);
|
|
2935
|
+
event = new MailReceivedEvent_1.MailReceivedEvent(messageReceivedEvent.eventTargetAddress, mail, message);
|
|
2935
2936
|
this.runtime.eventBus.publish(event);
|
|
2936
2937
|
this.logger.trace(`Published MailReceivedEvent for ${message.id}`);
|
|
2937
2938
|
break;
|
|
2938
2939
|
case "RequestMail":
|
|
2939
2940
|
const requestMail = await content_1.RequestMail.from(message.content);
|
|
2940
|
-
event = new RequestMailReceivedEvent_1.RequestMailReceivedEvent(requestMail, message);
|
|
2941
|
+
event = new RequestMailReceivedEvent_1.RequestMailReceivedEvent(messageReceivedEvent.eventTargetAddress, requestMail, message);
|
|
2941
2942
|
this.runtime.eventBus.publish(event);
|
|
2942
2943
|
this.logger.trace(`Published RequestMailReceivedEvent for ${message.id}`);
|
|
2943
2944
|
let i = 0;
|
|
2944
2945
|
for (const request of requestMail.requests) {
|
|
2945
|
-
this.runtime.eventBus.publish(new RequestReceivedEvent_1.RequestReceivedEvent(request, message));
|
|
2946
|
+
this.runtime.eventBus.publish(new RequestReceivedEvent_1.RequestReceivedEvent(messageReceivedEvent.eventTargetAddress, request, message));
|
|
2946
2947
|
this.logger.trace(`Published RequestReceivedEvent request #${i} of RequestMail ${message.id}`);
|
|
2947
2948
|
i++;
|
|
2948
2949
|
}
|
|
@@ -2957,7 +2958,7 @@ class MessageModule extends RuntimeModule_1.RuntimeModule {
|
|
|
2957
2958
|
return;
|
|
2958
2959
|
}
|
|
2959
2960
|
const relationship = result.value;
|
|
2960
|
-
this.runtime.eventBus.publish(new RelationshipEvent_1.RelationshipEvent(event, relationship));
|
|
2961
|
+
this.runtime.eventBus.publish(new RelationshipEvent_1.RelationshipEvent(messageReceivedEvent.eventTargetAddress, event, relationship));
|
|
2961
2962
|
this.logger.trace(`Published RelationshipEvent for ${message.id} to ${relationship.id}`);
|
|
2962
2963
|
}
|
|
2963
2964
|
stop() {
|
|
@@ -8995,9 +8996,10 @@ const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common
|
|
|
8995
8996
|
const MessageMapper_1 = __webpack_require__(/*! ../messages/MessageMapper */ "./dist/useCases/transport/messages/MessageMapper.js");
|
|
8996
8997
|
const RelationshipMapper_1 = __webpack_require__(/*! ../relationships/RelationshipMapper */ "./dist/useCases/transport/relationships/RelationshipMapper.js");
|
|
8997
8998
|
let SyncEverythingUseCase = class SyncEverythingUseCase extends common_1.UseCase {
|
|
8998
|
-
constructor(accountController, eventBus, loggerFactory) {
|
|
8999
|
+
constructor(accountController, identityController, eventBus, loggerFactory) {
|
|
8999
9000
|
super();
|
|
9000
9001
|
this.accountController = accountController;
|
|
9002
|
+
this.identityController = identityController;
|
|
9001
9003
|
this.eventBus = eventBus;
|
|
9002
9004
|
this.logger = loggerFactory.getLogger(SyncEverythingUseCase);
|
|
9003
9005
|
}
|
|
@@ -9017,30 +9019,31 @@ let SyncEverythingUseCase = class SyncEverythingUseCase extends common_1.UseCase
|
|
|
9017
9019
|
const changedItems = await this.accountController.syncEverything();
|
|
9018
9020
|
const messageDTOs = changedItems.messages.map((m) => MessageMapper_1.MessageMapper.toMessageDTO(m));
|
|
9019
9021
|
const relationshipDTOs = changedItems.relationships.map((r) => RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(r));
|
|
9020
|
-
this.
|
|
9021
|
-
this.
|
|
9022
|
+
const eventTargetAddress = this.identityController.identity.address.toString();
|
|
9023
|
+
this.processNewMessages(messageDTOs, eventTargetAddress);
|
|
9024
|
+
this.processNewRelationships(relationshipDTOs, eventTargetAddress);
|
|
9022
9025
|
return ts_utils_1.Result.ok({
|
|
9023
9026
|
messages: messageDTOs,
|
|
9024
9027
|
relationships: relationshipDTOs
|
|
9025
9028
|
});
|
|
9026
9029
|
}
|
|
9027
|
-
processNewRelationships(relationships) {
|
|
9030
|
+
processNewRelationships(relationships, eventTargetAddress) {
|
|
9028
9031
|
if (relationships.length === 0) {
|
|
9029
9032
|
return;
|
|
9030
9033
|
}
|
|
9031
9034
|
this.logger.debug(`Found ${relationships.length} relationship(s) with changes. Start publishing on event bus...`);
|
|
9032
9035
|
for (const relationship of relationships) {
|
|
9033
|
-
this.eventBus.publish(new events_1.RelationshipChangedEvent(relationship));
|
|
9036
|
+
this.eventBus.publish(new events_1.RelationshipChangedEvent(eventTargetAddress, relationship));
|
|
9034
9037
|
}
|
|
9035
9038
|
this.logger.debug("Finished publishing relationship changes on event bus.");
|
|
9036
9039
|
}
|
|
9037
|
-
processNewMessages(messages) {
|
|
9040
|
+
processNewMessages(messages, eventTargetAddress) {
|
|
9038
9041
|
if (messages.length === 0) {
|
|
9039
9042
|
return;
|
|
9040
9043
|
}
|
|
9041
9044
|
this.logger.debug(`Found ${messages.length} new message(s). Start publishing on event bus...`);
|
|
9042
9045
|
for (const message of messages) {
|
|
9043
|
-
this.eventBus.publish(new events_1.MessageReceivedEvent(message));
|
|
9046
|
+
this.eventBus.publish(new events_1.MessageReceivedEvent(eventTargetAddress, message));
|
|
9044
9047
|
}
|
|
9045
9048
|
this.logger.debug("Finished publishing message changes on event bus.");
|
|
9046
9049
|
}
|
|
@@ -9049,7 +9052,11 @@ SyncEverythingUseCase = __decorate([
|
|
|
9049
9052
|
__param(0, typescript_ioc_1.Inject),
|
|
9050
9053
|
__param(1, typescript_ioc_1.Inject),
|
|
9051
9054
|
__param(2, typescript_ioc_1.Inject),
|
|
9052
|
-
|
|
9055
|
+
__param(3, typescript_ioc_1.Inject),
|
|
9056
|
+
__metadata("design:paramtypes", [transport_1.AccountController,
|
|
9057
|
+
transport_1.IdentityController,
|
|
9058
|
+
ts_utils_1.EventBus,
|
|
9059
|
+
RuntimeLoggerFactory_1.RuntimeLoggerFactory])
|
|
9053
9060
|
], SyncEverythingUseCase);
|
|
9054
9061
|
exports.SyncEverythingUseCase = SyncEverythingUseCase;
|
|
9055
9062
|
//# sourceMappingURL=SyncEverything.js.map
|
|
@@ -10844,11 +10851,12 @@ class SendMessageRequestValidator extends common_1.RuntimeValidator {
|
|
|
10844
10851
|
}
|
|
10845
10852
|
}
|
|
10846
10853
|
let SendMessageUseCase = class SendMessageUseCase extends common_1.UseCase {
|
|
10847
|
-
constructor(messageController, fileController, accountController, eventBus, validator) {
|
|
10854
|
+
constructor(messageController, fileController, accountController, identityController, eventBus, validator) {
|
|
10848
10855
|
super(validator);
|
|
10849
10856
|
this.messageController = messageController;
|
|
10850
10857
|
this.fileController = fileController;
|
|
10851
10858
|
this.accountController = accountController;
|
|
10859
|
+
this.identityController = identityController;
|
|
10852
10860
|
this.eventBus = eventBus;
|
|
10853
10861
|
}
|
|
10854
10862
|
async executeInternal(request) {
|
|
@@ -10862,7 +10870,7 @@ let SendMessageUseCase = class SendMessageUseCase extends common_1.UseCase {
|
|
|
10862
10870
|
attachments: transformAttachmentsResult.value
|
|
10863
10871
|
});
|
|
10864
10872
|
const messageDTO = MessageMapper_1.MessageMapper.toMessageDTO(result);
|
|
10865
|
-
this.eventBus.publish(new events_1.MessageSentEvent(messageDTO));
|
|
10873
|
+
this.eventBus.publish(new events_1.MessageSentEvent(this.identityController.identity.address.toString(), messageDTO));
|
|
10866
10874
|
await this.accountController.syncDatawallet();
|
|
10867
10875
|
return ts_utils_1.Result.ok(MessageMapper_1.MessageMapper.toMessageDTO(result));
|
|
10868
10876
|
}
|
|
@@ -10887,9 +10895,11 @@ SendMessageUseCase = __decorate([
|
|
|
10887
10895
|
__param(2, typescript_ioc_1.Inject),
|
|
10888
10896
|
__param(3, typescript_ioc_1.Inject),
|
|
10889
10897
|
__param(4, typescript_ioc_1.Inject),
|
|
10898
|
+
__param(5, typescript_ioc_1.Inject),
|
|
10890
10899
|
__metadata("design:paramtypes", [transport_1.MessageController,
|
|
10891
10900
|
transport_1.FileController,
|
|
10892
10901
|
transport_1.AccountController,
|
|
10902
|
+
transport_1.IdentityController,
|
|
10893
10903
|
ts_utils_1.EventBus,
|
|
10894
10904
|
SendMessageRequestValidator])
|
|
10895
10905
|
], SendMessageUseCase);
|
|
@@ -11497,10 +11507,11 @@ class AcceptRelationshipChangeRequestValidator extends common_1.RuntimeValidator
|
|
|
11497
11507
|
}
|
|
11498
11508
|
}
|
|
11499
11509
|
let AcceptRelationshipChangeUseCase = class AcceptRelationshipChangeUseCase extends common_1.UseCase {
|
|
11500
|
-
constructor(relationshipsController, accountController, eventBus, validator) {
|
|
11510
|
+
constructor(relationshipsController, accountController, identityController, eventBus, validator) {
|
|
11501
11511
|
super(validator);
|
|
11502
11512
|
this.relationshipsController = relationshipsController;
|
|
11503
11513
|
this.accountController = accountController;
|
|
11514
|
+
this.identityController = identityController;
|
|
11504
11515
|
this.eventBus = eventBus;
|
|
11505
11516
|
}
|
|
11506
11517
|
async executeInternal(request) {
|
|
@@ -11517,7 +11528,7 @@ let AcceptRelationshipChangeUseCase = class AcceptRelationshipChangeUseCase exte
|
|
|
11517
11528
|
}
|
|
11518
11529
|
const updatedRelationship = await this.relationshipsController.acceptChange(change, request.content);
|
|
11519
11530
|
const relationshipDTO = RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(updatedRelationship);
|
|
11520
|
-
this.eventBus.publish(new events_1.RelationshipChangedEvent(relationshipDTO));
|
|
11531
|
+
this.eventBus.publish(new events_1.RelationshipChangedEvent(this.identityController.identity.address.toString(), relationshipDTO));
|
|
11521
11532
|
await this.accountController.syncDatawallet();
|
|
11522
11533
|
return ts_utils_1.Result.ok(relationshipDTO);
|
|
11523
11534
|
}
|
|
@@ -11527,8 +11538,10 @@ AcceptRelationshipChangeUseCase = __decorate([
|
|
|
11527
11538
|
__param(1, typescript_ioc_1.Inject),
|
|
11528
11539
|
__param(2, typescript_ioc_1.Inject),
|
|
11529
11540
|
__param(3, typescript_ioc_1.Inject),
|
|
11541
|
+
__param(4, typescript_ioc_1.Inject),
|
|
11530
11542
|
__metadata("design:paramtypes", [transport_1.RelationshipsController,
|
|
11531
11543
|
transport_1.AccountController,
|
|
11544
|
+
transport_1.IdentityController,
|
|
11532
11545
|
ts_utils_1.EventBus,
|
|
11533
11546
|
AcceptRelationshipChangeRequestValidator])
|
|
11534
11547
|
], AcceptRelationshipChangeUseCase);
|
|
@@ -11573,11 +11586,12 @@ class CreateRelationshipRequestValidator extends common_1.RuntimeValidator {
|
|
|
11573
11586
|
}
|
|
11574
11587
|
}
|
|
11575
11588
|
let CreateRelationshipUseCase = class CreateRelationshipUseCase extends common_1.UseCase {
|
|
11576
|
-
constructor(relationshipsController, relationshipTemplateController, accountController, eventBus, validator) {
|
|
11589
|
+
constructor(relationshipsController, relationshipTemplateController, accountController, identityController, eventBus, validator) {
|
|
11577
11590
|
super(validator);
|
|
11578
11591
|
this.relationshipsController = relationshipsController;
|
|
11579
11592
|
this.relationshipTemplateController = relationshipTemplateController;
|
|
11580
11593
|
this.accountController = accountController;
|
|
11594
|
+
this.identityController = identityController;
|
|
11581
11595
|
this.eventBus = eventBus;
|
|
11582
11596
|
}
|
|
11583
11597
|
async executeInternal(request) {
|
|
@@ -11590,7 +11604,7 @@ let CreateRelationshipUseCase = class CreateRelationshipUseCase extends common_1
|
|
|
11590
11604
|
content: request.content
|
|
11591
11605
|
});
|
|
11592
11606
|
const relationshipDTO = RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(relationship);
|
|
11593
|
-
this.eventBus.publish(new events_1.RelationshipChangedEvent(relationshipDTO));
|
|
11607
|
+
this.eventBus.publish(new events_1.RelationshipChangedEvent(this.identityController.identity.address.toString(), relationshipDTO));
|
|
11594
11608
|
await this.accountController.syncDatawallet();
|
|
11595
11609
|
return ts_utils_1.Result.ok(relationshipDTO);
|
|
11596
11610
|
}
|
|
@@ -11601,9 +11615,11 @@ CreateRelationshipUseCase = __decorate([
|
|
|
11601
11615
|
__param(2, typescript_ioc_1.Inject),
|
|
11602
11616
|
__param(3, typescript_ioc_1.Inject),
|
|
11603
11617
|
__param(4, typescript_ioc_1.Inject),
|
|
11618
|
+
__param(5, typescript_ioc_1.Inject),
|
|
11604
11619
|
__metadata("design:paramtypes", [transport_1.RelationshipsController,
|
|
11605
11620
|
transport_1.RelationshipTemplateController,
|
|
11606
11621
|
transport_1.AccountController,
|
|
11622
|
+
transport_1.IdentityController,
|
|
11607
11623
|
ts_utils_1.EventBus,
|
|
11608
11624
|
CreateRelationshipRequestValidator])
|
|
11609
11625
|
], CreateRelationshipUseCase);
|
|
@@ -11884,10 +11900,11 @@ class RejectRelationshipChangeRequestValidator extends common_1.RuntimeValidator
|
|
|
11884
11900
|
}
|
|
11885
11901
|
}
|
|
11886
11902
|
let RejectRelationshipChangeUseCase = class RejectRelationshipChangeUseCase extends common_1.UseCase {
|
|
11887
|
-
constructor(relationshipsController, accountController, eventBus, validator) {
|
|
11903
|
+
constructor(relationshipsController, accountController, identityController, eventBus, validator) {
|
|
11888
11904
|
super(validator);
|
|
11889
11905
|
this.relationshipsController = relationshipsController;
|
|
11890
11906
|
this.accountController = accountController;
|
|
11907
|
+
this.identityController = identityController;
|
|
11891
11908
|
this.eventBus = eventBus;
|
|
11892
11909
|
}
|
|
11893
11910
|
async executeInternal(request) {
|
|
@@ -11904,7 +11921,7 @@ let RejectRelationshipChangeUseCase = class RejectRelationshipChangeUseCase exte
|
|
|
11904
11921
|
}
|
|
11905
11922
|
const updatedRelationship = await this.relationshipsController.rejectChange(change, request.content);
|
|
11906
11923
|
const relationshipDTO = RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(updatedRelationship);
|
|
11907
|
-
this.eventBus.publish(new events_1.RelationshipChangedEvent(relationshipDTO));
|
|
11924
|
+
this.eventBus.publish(new events_1.RelationshipChangedEvent(this.identityController.identity.address.toString(), relationshipDTO));
|
|
11908
11925
|
await this.accountController.syncDatawallet();
|
|
11909
11926
|
return ts_utils_1.Result.ok(relationshipDTO);
|
|
11910
11927
|
}
|
|
@@ -11914,8 +11931,10 @@ RejectRelationshipChangeUseCase = __decorate([
|
|
|
11914
11931
|
__param(1, typescript_ioc_1.Inject),
|
|
11915
11932
|
__param(2, typescript_ioc_1.Inject),
|
|
11916
11933
|
__param(3, typescript_ioc_1.Inject),
|
|
11934
|
+
__param(4, typescript_ioc_1.Inject),
|
|
11917
11935
|
__metadata("design:paramtypes", [transport_1.RelationshipsController,
|
|
11918
11936
|
transport_1.AccountController,
|
|
11937
|
+
transport_1.IdentityController,
|
|
11919
11938
|
ts_utils_1.EventBus,
|
|
11920
11939
|
RejectRelationshipChangeRequestValidator])
|
|
11921
11940
|
], RejectRelationshipChangeUseCase);
|
|
@@ -12023,11 +12042,12 @@ class RevokeRelationshipChangeRequestValidator extends common_1.RuntimeValidator
|
|
|
12023
12042
|
}
|
|
12024
12043
|
}
|
|
12025
12044
|
let RevokeRelationshipChangeUseCase = class RevokeRelationshipChangeUseCase extends common_1.UseCase {
|
|
12026
|
-
constructor(relationshipsController, accountController, eventBus, validator) {
|
|
12045
|
+
constructor(relationshipsController, accountController, eventBus, identityController, validator) {
|
|
12027
12046
|
super(validator);
|
|
12028
12047
|
this.relationshipsController = relationshipsController;
|
|
12029
12048
|
this.accountController = accountController;
|
|
12030
12049
|
this.eventBus = eventBus;
|
|
12050
|
+
this.identityController = identityController;
|
|
12031
12051
|
}
|
|
12032
12052
|
async executeInternal(request) {
|
|
12033
12053
|
const relationship = await this.relationshipsController.getRelationship(transport_1.CoreId.from(request.relationshipId));
|
|
@@ -12043,7 +12063,7 @@ let RevokeRelationshipChangeUseCase = class RevokeRelationshipChangeUseCase exte
|
|
|
12043
12063
|
}
|
|
12044
12064
|
const updatedRelationship = await this.relationshipsController.revokeChange(change, request.content);
|
|
12045
12065
|
const relationshipDTO = RelationshipMapper_1.RelationshipMapper.toRelationshipDTO(updatedRelationship);
|
|
12046
|
-
this.eventBus.publish(new events_1.RelationshipChangedEvent(relationshipDTO));
|
|
12066
|
+
this.eventBus.publish(new events_1.RelationshipChangedEvent(this.identityController.identity.address.toString(), relationshipDTO));
|
|
12047
12067
|
await this.accountController.syncDatawallet();
|
|
12048
12068
|
return ts_utils_1.Result.ok(relationshipDTO);
|
|
12049
12069
|
}
|
|
@@ -12053,9 +12073,11 @@ RevokeRelationshipChangeUseCase = __decorate([
|
|
|
12053
12073
|
__param(1, typescript_ioc_1.Inject),
|
|
12054
12074
|
__param(2, typescript_ioc_1.Inject),
|
|
12055
12075
|
__param(3, typescript_ioc_1.Inject),
|
|
12076
|
+
__param(4, typescript_ioc_1.Inject),
|
|
12056
12077
|
__metadata("design:paramtypes", [transport_1.RelationshipsController,
|
|
12057
12078
|
transport_1.AccountController,
|
|
12058
12079
|
ts_utils_1.EventBus,
|
|
12080
|
+
transport_1.IdentityController,
|
|
12059
12081
|
RevokeRelationshipChangeRequestValidator])
|
|
12060
12082
|
], RevokeRelationshipChangeUseCase);
|
|
12061
12083
|
exports.RevokeRelationshipChangeUseCase = RevokeRelationshipChangeUseCase;
|