@nmshd/runtime 2.0.0-beta.10 → 2.0.0-beta.11
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/buildInformation.js +4 -4
- package/dist/modules/DeciderModule.js +1 -1
- package/dist/modules/DeciderModule.js.map +1 -1
- package/dist/modules/MessageModule.js +1 -1
- package/dist/modules/MessageModule.js.map +1 -1
- package/dist/modules/RequestModule.js +6 -6
- package/dist/modules/RequestModule.js.map +1 -1
- package/lib-web/nmshd.runtime.js +12 -12
- 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
package/dist/Runtime.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare abstract class Runtime<TConfig extends RuntimeConfig = RuntimeCon
|
|
|
28
28
|
protected login(accountController: AccountController, consumptionController: ConsumptionController): Promise<RuntimeServices>;
|
|
29
29
|
private _modules;
|
|
30
30
|
get modules(): RuntimeModuleRegistry;
|
|
31
|
-
abstract getServices(address: string | ICoreAddress): RuntimeServices
|
|
31
|
+
abstract getServices(address: string | ICoreAddress): RuntimeServices | Promise<RuntimeServices>;
|
|
32
32
|
private readonly _eventBus;
|
|
33
33
|
get eventBus(): EventBus;
|
|
34
34
|
private _eventProxy;
|
package/dist/buildInformation.js
CHANGED
|
@@ -7,10 +7,10 @@ const content_1 = require("@nmshd/content");
|
|
|
7
7
|
const crypto_1 = require("@nmshd/crypto");
|
|
8
8
|
const transport_1 = require("@nmshd/transport");
|
|
9
9
|
exports.buildInformation = {
|
|
10
|
-
version: "2.0.0-beta.
|
|
11
|
-
build: "
|
|
12
|
-
date: "2022-07-
|
|
13
|
-
commit: "
|
|
10
|
+
version: "2.0.0-beta.11",
|
|
11
|
+
build: "97",
|
|
12
|
+
date: "2022-07-27T15:17:43+00:00",
|
|
13
|
+
commit: "b831181f91e40a5f6b137d18b74e1bd17b838827",
|
|
14
14
|
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.4","@nmshd/content":"2.0.0-alpha.45","@nmshd/crypto":"2.0.1","@nmshd/transport":"2.0.0-beta.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"},
|
|
15
15
|
libraries: {
|
|
16
16
|
serval: ts_serval_1.buildInformation,
|
|
@@ -14,7 +14,7 @@ class DeciderModule extends extensibility_1.RuntimeModule {
|
|
|
14
14
|
async handleIncomingRequestStatusChanged(event) {
|
|
15
15
|
if (event.data.newStatus !== consumption_1.LocalRequestStatus.DecisionRequired)
|
|
16
16
|
return;
|
|
17
|
-
const services = this.runtime.getServices(event.eventTargetAddress);
|
|
17
|
+
const services = await this.runtime.getServices(event.eventTargetAddress);
|
|
18
18
|
const requireManualDecisionResult = await services.consumptionServices.incomingRequests.requireManualDecision({ requestId: event.data.request.id });
|
|
19
19
|
if (requireManualDecisionResult.isError) {
|
|
20
20
|
this.logger.error(`Could not require manual decision for request ${event.data.request.id}`, requireManualDecisionResult.error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeciderModule.js","sourceRoot":"","sources":["../../src/modules/DeciderModule.ts"],"names":[],"mappings":";;;AAAA,oDAAwD;AACxD,sCAA8D;AAC9D,oDAAiD;AAEjD,MAAa,aAAc,SAAQ,6BAAa;IACrC,IAAI;QACP,qBAAqB;IACzB,CAAC;IAEM,KAAK;QACR,IAAI,CAAC,gBAAgB,CAAC,0CAAiC,EAAE,IAAI,CAAC,kCAAkC,CAAC,IAAI,CAAC,IAAI,CAAC,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CAAC;CACJ;AAvBD,sCAuBC"}
|
|
@@ -28,7 +28,7 @@ class MessageModule extends RuntimeModule_1.RuntimeModule {
|
|
|
28
28
|
// Unknown type
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
const services = this.runtime.getServices(messageReceivedEvent.eventTargetAddress);
|
|
31
|
+
const services = await this.runtime.getServices(messageReceivedEvent.eventTargetAddress);
|
|
32
32
|
const result = await services.transportServices.relationships.getRelationshipByAddress({ address: message.createdBy });
|
|
33
33
|
if (!result.isSuccess) {
|
|
34
34
|
this.logger.error(`Could not find relationship for address '${message.createdBy}'.`, result.error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageModule.js","sourceRoot":"","sources":["../../src/modules/MessageModule.ts"],"names":[],"mappings":";;;AACA,4CAAsC;AACtC,sCAAuF;AACvF,0EAA4F;AAI5F,MAAa,aAAc,SAAQ,6BAAyC;IACjE,IAAI;QACP,qBAAqB;IACzB,CAAC;IAEM,KAAK;QACR,IAAI,CAAC,gBAAgB,CAAC,6BAAoB,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACvF,CAAC;IAEO,KAAK,CAAC,qBAAqB,CAAC,oBAA0C;QAC1E,MAAM,OAAO,GAAG,oBAAoB,CAAC,IAAI,CAAC;QAC1C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qCAAqC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;QACrE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAE9B,IAAI,KAAwB,CAAC;QAC7B,QAAQ,IAAI,EAAE;YACV,KAAK,MAAM;gBACP,MAAM,IAAI,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBACxC,KAAK,GAAG,IAAI,0BAAiB,CAAC,oBAAoB,CAAC,kBAAkB,EA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,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBACrC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAmC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;gBACnE,MAAM;YAEV;gBACI,eAAe;gBACf,OAAO;SACd;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;QACzF,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,iBAAiB,CAAC,aAAa,CAAC,wBAAwB,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QACvH,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,4CAA4C,OAAO,CAAC,SAAS,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;YACnG,OAAO;SACV;QACD,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC;QAElC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,0BAAiB,CAAC,oBAAoB,CAAC,kBAAkB,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;QACnH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAmC,OAAO,CAAC,EAAE,OAAO,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC;IAC7F,CAAC;IAEM,IAAI;QACP,IAAI,CAAC,wBAAwB,EAAE,CAAC;IACpC,CAAC;CACJ;AA5CD,sCA4CC"}
|
|
@@ -22,7 +22,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
|
|
|
22
22
|
if (template.content["@type"] !== "RelationshipTemplateBody")
|
|
23
23
|
return;
|
|
24
24
|
const body = template.content;
|
|
25
|
-
const services = this.runtime.getServices(event.eventTargetAddress);
|
|
25
|
+
const services = await this.runtime.getServices(event.eventTargetAddress);
|
|
26
26
|
const requestResult = await services.consumptionServices.incomingRequests.getRequests({ query: { "source.reference": template.id } });
|
|
27
27
|
if (requestResult.isError) {
|
|
28
28
|
this.logger.error(`Could not get requests for template '${template.id}'. Root error:`, requestResult.error);
|
|
@@ -55,7 +55,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
|
|
|
55
55
|
await this.createIncomingRequest(services, body.onNewRelationship, template.id);
|
|
56
56
|
}
|
|
57
57
|
async handleMessageReceivedEvent(event) {
|
|
58
|
-
const services = this.runtime.getServices(event.eventTargetAddress);
|
|
58
|
+
const services = await this.runtime.getServices(event.eventTargetAddress);
|
|
59
59
|
const message = event.data;
|
|
60
60
|
const messageContentType = message.content["@type"];
|
|
61
61
|
switch (messageContentType) {
|
|
@@ -75,7 +75,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
|
|
|
75
75
|
const message = event.data;
|
|
76
76
|
if (message.content["@type"] !== "Request")
|
|
77
77
|
return;
|
|
78
|
-
const services = this.runtime.getServices(event.eventTargetAddress);
|
|
78
|
+
const services = await this.runtime.getServices(event.eventTargetAddress);
|
|
79
79
|
const request = message.content;
|
|
80
80
|
const requestResult = await services.consumptionServices.outgoingRequests.sent({ requestId: request.id, messageId: message.id });
|
|
81
81
|
if (requestResult.isError) {
|
|
@@ -113,7 +113,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
|
|
|
113
113
|
async handleIncomingRequestDecidedForRelationship(event) {
|
|
114
114
|
const request = event.data.request;
|
|
115
115
|
const templateId = request.source.reference;
|
|
116
|
-
const services = this.runtime.getServices(event.eventTargetAddress);
|
|
116
|
+
const services = await this.runtime.getServices(event.eventTargetAddress);
|
|
117
117
|
if (request.response.content.result === content_1.ResponseResult.Rejected) {
|
|
118
118
|
await services.consumptionServices.incomingRequests.complete({ requestId: request.id });
|
|
119
119
|
return;
|
|
@@ -149,7 +149,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
|
|
|
149
149
|
async handleIncomingRequestDecidedForMessage(event) {
|
|
150
150
|
const request = event.data.request;
|
|
151
151
|
const requestId = request.id;
|
|
152
|
-
const services = this.runtime.getServices(event.eventTargetAddress);
|
|
152
|
+
const services = await this.runtime.getServices(event.eventTargetAddress);
|
|
153
153
|
const sendMessageResult = await services.transportServices.messages.sendMessage({
|
|
154
154
|
recipients: [request.peer],
|
|
155
155
|
content: request.response.content
|
|
@@ -173,7 +173,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
|
|
|
173
173
|
const createdRelationship = event.data;
|
|
174
174
|
if (createdRelationship.status !== types_1.RelationshipStatus.Pending || !createdRelationship.template.isOwn)
|
|
175
175
|
return;
|
|
176
|
-
const services = this.runtime.getServices(event.eventTargetAddress);
|
|
176
|
+
const services = await this.runtime.getServices(event.eventTargetAddress);
|
|
177
177
|
const template = createdRelationship.template;
|
|
178
178
|
const templateId = template.id;
|
|
179
179
|
// do not trigger for templates without the correct content type
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestModule.js","sourceRoot":"","sources":["../../src/modules/RequestModule.ts"],"names":[],"mappings":";;;AAAA,oDAAwD;AACxD,4CAAgJ;AAChJ,sCAAqK;AACrK,0EAAuE;AAEvE,oCAA8C;AAE9C,MAAa,aAAc,SAAQ,6BAAa;IACrC,IAAI;QACP,qBAAqB;IACzB,CAAC;IAEM,KAAK;QACR,IAAI,CAAC,gBAAgB,CAAC,4CAAmC,EAAE,IAAI,CAAC,oCAAoC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACjH,IAAI,CAAC,gBAAgB,CAAC,6BAAoB,EAAE,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACxF,IAAI,CAAC,gBAAgB,CAAC,yBAAgB,EAAE,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAChF,IAAI,CAAC,gBAAgB,CAAC,0CAAiC,EAAE,IAAI,CAAC,kCAAkC,CAAC,IAAI,CAAC,IAA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AK,CAAC,CAAC;YAC5J,OAAO;SACV;IACL,CAAC;IAEM,IAAI;QACP,IAAI,CAAC,wBAAwB,EAAE,CAAC;IACpC,CAAC;CACJ;AA7ND,sCA6NC"}
|
package/lib-web/nmshd.runtime.js
CHANGED
|
@@ -446,10 +446,10 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
|
446
446
|
const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
|
|
447
447
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
448
448
|
exports.buildInformation = {
|
|
449
|
-
version: "2.0.0-beta.
|
|
450
|
-
build: "
|
|
451
|
-
date: "2022-07-
|
|
452
|
-
commit: "
|
|
449
|
+
version: "2.0.0-beta.11",
|
|
450
|
+
build: "97",
|
|
451
|
+
date: "2022-07-27T15:17:43+00:00",
|
|
452
|
+
commit: "b831181f91e40a5f6b137d18b74e1bd17b838827",
|
|
453
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.4","@nmshd/content":"2.0.0-alpha.45","@nmshd/crypto":"2.0.1","@nmshd/transport":"2.0.0-beta.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"},
|
|
454
454
|
libraries: {
|
|
455
455
|
serval: ts_serval_1.buildInformation,
|
|
@@ -4130,7 +4130,7 @@ class DeciderModule extends extensibility_1.RuntimeModule {
|
|
|
4130
4130
|
async handleIncomingRequestStatusChanged(event) {
|
|
4131
4131
|
if (event.data.newStatus !== consumption_1.LocalRequestStatus.DecisionRequired)
|
|
4132
4132
|
return;
|
|
4133
|
-
const services = this.runtime.getServices(event.eventTargetAddress);
|
|
4133
|
+
const services = await this.runtime.getServices(event.eventTargetAddress);
|
|
4134
4134
|
const requireManualDecisionResult = await services.consumptionServices.incomingRequests.requireManualDecision({ requestId: event.data.request.id });
|
|
4135
4135
|
if (requireManualDecisionResult.isError) {
|
|
4136
4136
|
this.logger.error(`Could not require manual decision for request ${event.data.request.id}`, requireManualDecisionResult.error);
|
|
@@ -4183,7 +4183,7 @@ class MessageModule extends RuntimeModule_1.RuntimeModule {
|
|
|
4183
4183
|
// Unknown type
|
|
4184
4184
|
return;
|
|
4185
4185
|
}
|
|
4186
|
-
const services = this.runtime.getServices(messageReceivedEvent.eventTargetAddress);
|
|
4186
|
+
const services = await this.runtime.getServices(messageReceivedEvent.eventTargetAddress);
|
|
4187
4187
|
const result = await services.transportServices.relationships.getRelationshipByAddress({ address: message.createdBy });
|
|
4188
4188
|
if (!result.isSuccess) {
|
|
4189
4189
|
this.logger.error(`Could not find relationship for address '${message.createdBy}'.`, result.error);
|
|
@@ -4233,7 +4233,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
|
|
|
4233
4233
|
if (template.content["@type"] !== "RelationshipTemplateBody")
|
|
4234
4234
|
return;
|
|
4235
4235
|
const body = template.content;
|
|
4236
|
-
const services = this.runtime.getServices(event.eventTargetAddress);
|
|
4236
|
+
const services = await this.runtime.getServices(event.eventTargetAddress);
|
|
4237
4237
|
const requestResult = await services.consumptionServices.incomingRequests.getRequests({ query: { "source.reference": template.id } });
|
|
4238
4238
|
if (requestResult.isError) {
|
|
4239
4239
|
this.logger.error(`Could not get requests for template '${template.id}'. Root error:`, requestResult.error);
|
|
@@ -4266,7 +4266,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
|
|
|
4266
4266
|
await this.createIncomingRequest(services, body.onNewRelationship, template.id);
|
|
4267
4267
|
}
|
|
4268
4268
|
async handleMessageReceivedEvent(event) {
|
|
4269
|
-
const services = this.runtime.getServices(event.eventTargetAddress);
|
|
4269
|
+
const services = await this.runtime.getServices(event.eventTargetAddress);
|
|
4270
4270
|
const message = event.data;
|
|
4271
4271
|
const messageContentType = message.content["@type"];
|
|
4272
4272
|
switch (messageContentType) {
|
|
@@ -4286,7 +4286,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
|
|
|
4286
4286
|
const message = event.data;
|
|
4287
4287
|
if (message.content["@type"] !== "Request")
|
|
4288
4288
|
return;
|
|
4289
|
-
const services = this.runtime.getServices(event.eventTargetAddress);
|
|
4289
|
+
const services = await this.runtime.getServices(event.eventTargetAddress);
|
|
4290
4290
|
const request = message.content;
|
|
4291
4291
|
const requestResult = await services.consumptionServices.outgoingRequests.sent({ requestId: request.id, messageId: message.id });
|
|
4292
4292
|
if (requestResult.isError) {
|
|
@@ -4324,7 +4324,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
|
|
|
4324
4324
|
async handleIncomingRequestDecidedForRelationship(event) {
|
|
4325
4325
|
const request = event.data.request;
|
|
4326
4326
|
const templateId = request.source.reference;
|
|
4327
|
-
const services = this.runtime.getServices(event.eventTargetAddress);
|
|
4327
|
+
const services = await this.runtime.getServices(event.eventTargetAddress);
|
|
4328
4328
|
if (request.response.content.result === content_1.ResponseResult.Rejected) {
|
|
4329
4329
|
await services.consumptionServices.incomingRequests.complete({ requestId: request.id });
|
|
4330
4330
|
return;
|
|
@@ -4360,7 +4360,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
|
|
|
4360
4360
|
async handleIncomingRequestDecidedForMessage(event) {
|
|
4361
4361
|
const request = event.data.request;
|
|
4362
4362
|
const requestId = request.id;
|
|
4363
|
-
const services = this.runtime.getServices(event.eventTargetAddress);
|
|
4363
|
+
const services = await this.runtime.getServices(event.eventTargetAddress);
|
|
4364
4364
|
const sendMessageResult = await services.transportServices.messages.sendMessage({
|
|
4365
4365
|
recipients: [request.peer],
|
|
4366
4366
|
content: request.response.content
|
|
@@ -4384,7 +4384,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
|
|
|
4384
4384
|
const createdRelationship = event.data;
|
|
4385
4385
|
if (createdRelationship.status !== types_1.RelationshipStatus.Pending || !createdRelationship.template.isOwn)
|
|
4386
4386
|
return;
|
|
4387
|
-
const services = this.runtime.getServices(event.eventTargetAddress);
|
|
4387
|
+
const services = await this.runtime.getServices(event.eventTargetAddress);
|
|
4388
4388
|
const template = createdRelationship.template;
|
|
4389
4389
|
const templateId = template.id;
|
|
4390
4390
|
// do not trigger for templates without the correct content type
|