@nmshd/runtime 2.0.0-alpha.35 → 2.0.0-alpha.36

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.
@@ -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-alpha.35",
11
- build: "84",
12
- date: "2022-07-19T08:49:46+00:00",
13
- commit: "2b4c79f3248edf4ca49e76beef9446c3a13b0a0e",
10
+ version: "2.0.0-alpha.36",
11
+ build: "85",
12
+ date: "2022-07-19T11:51:16+00:00",
13
+ commit: "0ddb105135bf88881ce8ee408d4524a56609236d",
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.0.1","@nmshd/consumption":"2.0.0-alpha.29","@nmshd/content":"2.0.0-alpha.44","@nmshd/crypto":"2.0.1","@nmshd/transport":"2.0.0-alpha.3","ajv":"^8.11.0","ajv-errors":"^3.0.0","ajv-formats":"^2.1.1","fluent-ts-validator":"3.0.3","json-stringify-safe":"^5.0.1","luxon":"^2.4.0","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,
@@ -35,8 +35,9 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
35
35
  case "Response":
36
36
  const receivedResponse = event.data.content;
37
37
  const result = await services.consumptionServices.outgoingRequests.complete({ receivedResponse, messageId: event.data.id });
38
- if (result.isError)
39
- this.logger.error(`Could not complete outgoing request for message id ${event.data.id} due to ${result.error}`);
38
+ if (result.isError) {
39
+ this.logger.error(`Could not complete outgoing request for message id ${event.data.id} due to ${result.error}. Root error:`, result.error);
40
+ }
40
41
  break;
41
42
  }
42
43
  }
@@ -48,19 +49,19 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
48
49
  const request = message.content;
49
50
  const requestResult = await services.consumptionServices.outgoingRequests.sent({ requestId: request.id, messageId: message.id });
50
51
  if (requestResult.isError) {
51
- this.logger.error(`Could not mark request '${request.id}' as sent using message '${message.id}'.`);
52
+ this.logger.error(`Could not mark request '${request.id}' as sent using message '${message.id}'. Root error:`, requestResult.error);
52
53
  return;
53
54
  }
54
55
  }
55
56
  async createIncomingRequest(services, request, requestSourceId) {
56
57
  const receivedRequestResult = await services.consumptionServices.incomingRequests.received({ receivedRequest: request, requestSourceId });
57
58
  if (receivedRequestResult.isError) {
58
- this.logger.error(`Could not receive request ${request.id}`, receivedRequestResult.error);
59
+ this.logger.error(`Could not receive request ${request.id}. Root error:`, receivedRequestResult.error);
59
60
  return;
60
61
  }
61
62
  const checkPrerequitesResult = await services.consumptionServices.incomingRequests.checkPrerequisites({ requestId: receivedRequestResult.value.id });
62
63
  if (checkPrerequitesResult.isError) {
63
- this.logger.error(`Could not check prerequisites for request ${request.id}`, checkPrerequitesResult.error);
64
+ this.logger.error(`Could not check prerequisites for request ${request.id}. Root error:`, checkPrerequitesResult.error);
64
65
  return;
65
66
  }
66
67
  }
@@ -88,7 +89,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
88
89
  const services = this.runtime.getServices(event.eventTargetAddress);
89
90
  const templateResult = await services.transportServices.relationshipTemplates.getRelationshipTemplate({ id: templateId });
90
91
  if (templateResult.isError) {
91
- this.logger.error(`Could not find template with id '${templateId}'.`);
92
+ this.logger.error(`Could not find template with id '${templateId}'. Root error:`, templateResult.error);
92
93
  // TODO: error state
93
94
  return;
94
95
  }
@@ -100,7 +101,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
100
101
  });
101
102
  const createRelationshipResult = await services.transportServices.relationships.createRelationship({ templateId, content: creationChangeBody });
102
103
  if (createRelationshipResult.isError) {
103
- this.logger.error(`Could not create relationship for templateId '${templateId}'.`);
104
+ this.logger.error(`Could not create relationship for templateId '${templateId}'. Root error:`, createRelationshipResult.error);
104
105
  // TODO: error state
105
106
  return;
106
107
  }
@@ -110,7 +111,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
110
111
  responseSourceId: createRelationshipResult.value.changes[0].id
111
112
  });
112
113
  if (completeRequestResult.isError) {
113
- this.logger.error(`Could not complete the request '${requestId}'.`);
114
+ this.logger.error(`Could not complete the request '${requestId}'. Root error:`, completeRequestResult.error);
114
115
  return;
115
116
  }
116
117
  }
@@ -123,7 +124,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
123
124
  content: request.response.content
124
125
  });
125
126
  if (sendMessageResult.isError) {
126
- this.logger.error(`Could not send message to answer the request '${requestId}'.`);
127
+ this.logger.error(`Could not send message to answer the request '${requestId}'.`, sendMessageResult.error);
127
128
  // TODO: error state
128
129
  return;
129
130
  }
@@ -132,7 +133,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
132
133
  responseSourceId: sendMessageResult.value.id
133
134
  });
134
135
  if (completeRequestResult.isError) {
135
- this.logger.error(`Could not complete the request '${requestId}'.`);
136
+ this.logger.error(`Could not complete the request '${requestId}'. Root error:`, completeRequestResult.error);
136
137
  return;
137
138
  }
138
139
  }
@@ -154,7 +155,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
154
155
  return;
155
156
  const result = await services.consumptionServices.outgoingRequests.createAndCompleteFromRelationshipCreationChange({ templateId, relationshipChangeId });
156
157
  if (result.isError) {
157
- this.logger.error(`Could not create and complete request for templateId '${templateId}' and changeId '${relationshipChangeId}'.`, result.error);
158
+ this.logger.error(`Could not create and complete request for templateId '${templateId}' and changeId '${relationshipChangeId}'. Root error:`, result.error);
158
159
  return;
159
160
  }
160
161
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RequestModule.js","sourceRoot":"","sources":["../../src/modules/RequestModule.ts"],"names":[],"mappings":";;;AAAA,oDAAwD;AACxD,4CAAgI;AAChI,sCAAqK;AACrK,0EAAuE;AAEv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AAC,CAAC;QAClE,MAAM,oBAAoB,GAAG,0BAA0B,CAAC,EAAE,CAAC;QAC3D,uEAAuE;QACvE,IAAI,0BAA0B,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,uCAAuC;YAAE,OAAO;QAE5G,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,+CAA+C,CAAC,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAC,CAAC;QACzJ,IAAI,MAAM,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,yDAAyD,UAAU,mBAAmB,oBAAoB,gBAAgB,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5J,OAAO;SACV;IACL,CAAC;IAEM,IAAI;QACP,IAAI,CAAC,wBAAwB,EAAE,CAAC;IACpC,CAAC;CACJ;AApLD,sCAoLC"}
@@ -436,10 +436,10 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
436
436
  const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
437
437
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
438
438
  exports.buildInformation = {
439
- version: "2.0.0-alpha.35",
440
- build: "84",
441
- date: "2022-07-19T08:49:46+00:00",
442
- commit: "2b4c79f3248edf4ca49e76beef9446c3a13b0a0e",
439
+ version: "2.0.0-alpha.36",
440
+ build: "85",
441
+ date: "2022-07-19T11:51:16+00:00",
442
+ commit: "0ddb105135bf88881ce8ee408d4524a56609236d",
443
443
  dependencies: {"@js-soft/docdb-querytranslator":"1.1.0","@js-soft/logging-abstractions":"1.0.0","@js-soft/ts-serval":"2.0.3","@js-soft/ts-utils":"^2.0.1","@nmshd/consumption":"2.0.0-alpha.29","@nmshd/content":"2.0.0-alpha.44","@nmshd/crypto":"2.0.1","@nmshd/transport":"2.0.0-alpha.3","ajv":"^8.11.0","ajv-errors":"^3.0.0","ajv-formats":"^2.1.1","fluent-ts-validator":"3.0.3","json-stringify-safe":"^5.0.1","luxon":"^2.4.0","qrcode":"1.5.1","reflect-metadata":"0.1.13","ts-simple-nameof":"1.3.1","typescript-ioc":"3.2.2"},
444
444
  libraries: {
445
445
  serval: ts_serval_1.buildInformation,
@@ -4003,8 +4003,9 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
4003
4003
  case "Response":
4004
4004
  const receivedResponse = event.data.content;
4005
4005
  const result = await services.consumptionServices.outgoingRequests.complete({ receivedResponse, messageId: event.data.id });
4006
- if (result.isError)
4007
- this.logger.error(`Could not complete outgoing request for message id ${event.data.id} due to ${result.error}`);
4006
+ if (result.isError) {
4007
+ this.logger.error(`Could not complete outgoing request for message id ${event.data.id} due to ${result.error}. Root error:`, result.error);
4008
+ }
4008
4009
  break;
4009
4010
  }
4010
4011
  }
@@ -4016,19 +4017,19 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
4016
4017
  const request = message.content;
4017
4018
  const requestResult = await services.consumptionServices.outgoingRequests.sent({ requestId: request.id, messageId: message.id });
4018
4019
  if (requestResult.isError) {
4019
- this.logger.error(`Could not mark request '${request.id}' as sent using message '${message.id}'.`);
4020
+ this.logger.error(`Could not mark request '${request.id}' as sent using message '${message.id}'. Root error:`, requestResult.error);
4020
4021
  return;
4021
4022
  }
4022
4023
  }
4023
4024
  async createIncomingRequest(services, request, requestSourceId) {
4024
4025
  const receivedRequestResult = await services.consumptionServices.incomingRequests.received({ receivedRequest: request, requestSourceId });
4025
4026
  if (receivedRequestResult.isError) {
4026
- this.logger.error(`Could not receive request ${request.id}`, receivedRequestResult.error);
4027
+ this.logger.error(`Could not receive request ${request.id}. Root error:`, receivedRequestResult.error);
4027
4028
  return;
4028
4029
  }
4029
4030
  const checkPrerequitesResult = await services.consumptionServices.incomingRequests.checkPrerequisites({ requestId: receivedRequestResult.value.id });
4030
4031
  if (checkPrerequitesResult.isError) {
4031
- this.logger.error(`Could not check prerequisites for request ${request.id}`, checkPrerequitesResult.error);
4032
+ this.logger.error(`Could not check prerequisites for request ${request.id}. Root error:`, checkPrerequitesResult.error);
4032
4033
  return;
4033
4034
  }
4034
4035
  }
@@ -4056,7 +4057,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
4056
4057
  const services = this.runtime.getServices(event.eventTargetAddress);
4057
4058
  const templateResult = await services.transportServices.relationshipTemplates.getRelationshipTemplate({ id: templateId });
4058
4059
  if (templateResult.isError) {
4059
- this.logger.error(`Could not find template with id '${templateId}'.`);
4060
+ this.logger.error(`Could not find template with id '${templateId}'. Root error:`, templateResult.error);
4060
4061
  // TODO: error state
4061
4062
  return;
4062
4063
  }
@@ -4068,7 +4069,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
4068
4069
  });
4069
4070
  const createRelationshipResult = await services.transportServices.relationships.createRelationship({ templateId, content: creationChangeBody });
4070
4071
  if (createRelationshipResult.isError) {
4071
- this.logger.error(`Could not create relationship for templateId '${templateId}'.`);
4072
+ this.logger.error(`Could not create relationship for templateId '${templateId}'. Root error:`, createRelationshipResult.error);
4072
4073
  // TODO: error state
4073
4074
  return;
4074
4075
  }
@@ -4078,7 +4079,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
4078
4079
  responseSourceId: createRelationshipResult.value.changes[0].id
4079
4080
  });
4080
4081
  if (completeRequestResult.isError) {
4081
- this.logger.error(`Could not complete the request '${requestId}'.`);
4082
+ this.logger.error(`Could not complete the request '${requestId}'. Root error:`, completeRequestResult.error);
4082
4083
  return;
4083
4084
  }
4084
4085
  }
@@ -4091,7 +4092,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
4091
4092
  content: request.response.content
4092
4093
  });
4093
4094
  if (sendMessageResult.isError) {
4094
- this.logger.error(`Could not send message to answer the request '${requestId}'.`);
4095
+ this.logger.error(`Could not send message to answer the request '${requestId}'.`, sendMessageResult.error);
4095
4096
  // TODO: error state
4096
4097
  return;
4097
4098
  }
@@ -4100,7 +4101,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
4100
4101
  responseSourceId: sendMessageResult.value.id
4101
4102
  });
4102
4103
  if (completeRequestResult.isError) {
4103
- this.logger.error(`Could not complete the request '${requestId}'.`);
4104
+ this.logger.error(`Could not complete the request '${requestId}'. Root error:`, completeRequestResult.error);
4104
4105
  return;
4105
4106
  }
4106
4107
  }
@@ -4122,7 +4123,7 @@ class RequestModule extends RuntimeModule_1.RuntimeModule {
4122
4123
  return;
4123
4124
  const result = await services.consumptionServices.outgoingRequests.createAndCompleteFromRelationshipCreationChange({ templateId, relationshipChangeId });
4124
4125
  if (result.isError) {
4125
- this.logger.error(`Could not create and complete request for templateId '${templateId}' and changeId '${relationshipChangeId}'.`, result.error);
4126
+ this.logger.error(`Could not create and complete request for templateId '${templateId}' and changeId '${relationshipChangeId}'. Root error:`, result.error);
4126
4127
  return;
4127
4128
  }
4128
4129
  }