@nmshd/runtime 2.8.3 → 2.9.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.
Files changed (68) hide show
  1. package/dist/Runtime.js +7 -0
  2. package/dist/Runtime.js.map +1 -1
  3. package/dist/buildInformation.js +4 -4
  4. package/dist/extensibility/ConsumptionServices.d.ts +3 -2
  5. package/dist/extensibility/ConsumptionServices.js +5 -2
  6. package/dist/extensibility/ConsumptionServices.js.map +1 -1
  7. package/dist/extensibility/facades/consumption/NotificationsFacade.d.ts +18 -0
  8. package/dist/extensibility/facades/consumption/NotificationsFacade.js +61 -0
  9. package/dist/extensibility/facades/consumption/NotificationsFacade.js.map +1 -0
  10. package/dist/extensibility/facades/consumption/index.d.ts +1 -0
  11. package/dist/extensibility/facades/consumption/index.js +1 -0
  12. package/dist/extensibility/facades/consumption/index.js.map +1 -1
  13. package/dist/modules/NotificationModule.d.ts +8 -0
  14. package/dist/modules/NotificationModule.js +47 -0
  15. package/dist/modules/NotificationModule.js.map +1 -0
  16. package/dist/modules/index.d.ts +1 -0
  17. package/dist/modules/index.js +1 -0
  18. package/dist/modules/index.js.map +1 -1
  19. package/dist/types/consumption/LocalNotificationDTO.d.ts +15 -0
  20. package/dist/types/consumption/LocalNotificationDTO.js +3 -0
  21. package/dist/types/consumption/LocalNotificationDTO.js.map +1 -0
  22. package/dist/types/consumption/index.d.ts +1 -0
  23. package/dist/types/consumption/index.js +1 -0
  24. package/dist/types/consumption/index.js.map +1 -1
  25. package/dist/useCases/common/RuntimeErrors.d.ts +7 -0
  26. package/dist/useCases/common/RuntimeErrors.js +12 -0
  27. package/dist/useCases/common/RuntimeErrors.js.map +1 -1
  28. package/dist/useCases/common/Schemas.d.ts +5 -0
  29. package/dist/useCases/common/Schemas.js +122 -3
  30. package/dist/useCases/common/Schemas.js.map +1 -1
  31. package/dist/useCases/common/validation/ValidatableStrings.d.ts +4 -0
  32. package/dist/useCases/consumption/attributes/DeleteAttribute.js.map +1 -1
  33. package/dist/useCases/consumption/attributes/GetAttribute.js.map +1 -1
  34. package/dist/useCases/consumption/attributes/SucceedAttribute.js.map +1 -1
  35. package/dist/useCases/consumption/index.d.ts +1 -0
  36. package/dist/useCases/consumption/index.js +1 -0
  37. package/dist/useCases/consumption/index.js.map +1 -1
  38. package/dist/useCases/consumption/notifications/GetNotification.d.ts +16 -0
  39. package/dist/useCases/consumption/notifications/GetNotification.js +48 -0
  40. package/dist/useCases/consumption/notifications/GetNotification.js.map +1 -0
  41. package/dist/useCases/consumption/notifications/GetNotifications.d.ts +15 -0
  42. package/dist/useCases/consumption/notifications/GetNotifications.js +40 -0
  43. package/dist/useCases/consumption/notifications/GetNotifications.js.map +1 -0
  44. package/dist/useCases/consumption/notifications/NotificationMapper.d.ts +6 -0
  45. package/dist/useCases/consumption/notifications/NotificationMapper.js +25 -0
  46. package/dist/useCases/consumption/notifications/NotificationMapper.js.map +1 -0
  47. package/dist/useCases/consumption/notifications/ProcessNotificationById.d.ts +16 -0
  48. package/dist/useCases/consumption/notifications/ProcessNotificationById.js +49 -0
  49. package/dist/useCases/consumption/notifications/ProcessNotificationById.js.map +1 -0
  50. package/dist/useCases/consumption/notifications/ProcessOpenNotifactionsReceivedByCurrentDevice.d.ts +8 -0
  51. package/dist/useCases/consumption/notifications/ProcessOpenNotifactionsReceivedByCurrentDevice.js +35 -0
  52. package/dist/useCases/consumption/notifications/ProcessOpenNotifactionsReceivedByCurrentDevice.js.map +1 -0
  53. package/dist/useCases/consumption/notifications/ReceivedNotification.d.ts +18 -0
  54. package/dist/useCases/consumption/notifications/ReceivedNotification.js +60 -0
  55. package/dist/useCases/consumption/notifications/ReceivedNotification.js.map +1 -0
  56. package/dist/useCases/consumption/notifications/SentNotification.d.ts +18 -0
  57. package/dist/useCases/consumption/notifications/SentNotification.js +60 -0
  58. package/dist/useCases/consumption/notifications/SentNotification.js.map +1 -0
  59. package/dist/useCases/consumption/notifications/index.d.ts +6 -0
  60. package/dist/useCases/consumption/notifications/index.js +23 -0
  61. package/dist/useCases/consumption/notifications/index.js.map +1 -0
  62. package/dist/useCases/transport/messages/GetAttachmentMetadata.js +1 -1
  63. package/dist/useCases/transport/messages/GetAttachmentMetadata.js.map +1 -1
  64. package/lib-web/nmshd.runtime.js +716 -10
  65. package/lib-web/nmshd.runtime.js.map +1 -1
  66. package/lib-web/nmshd.runtime.min.js +3 -3
  67. package/lib-web/nmshd.runtime.min.js.map +1 -1
  68. package/package.json +7 -5
@@ -359,6 +359,9 @@ class Runtime {
359
359
  typescript_ioc_1.Container.bind(consumption_1.SettingsController)
360
360
  .factory(() => this.getConsumptionController().settings)
361
361
  .scope(typescript_ioc_1.Scope.Request);
362
+ typescript_ioc_1.Container.bind(consumption_1.NotificationsController)
363
+ .factory(() => this.getConsumptionController().notifications)
364
+ .scope(typescript_ioc_1.Scope.Request);
362
365
  typescript_ioc_1.Container.bind(transport_1.AnonymousTokenController)
363
366
  .factory(() => new transport_1.AnonymousTokenController(this.transport.config))
364
367
  .scope(typescript_ioc_1.Scope.Singleton);
@@ -408,6 +411,10 @@ class Runtime {
408
411
  const attributeListenerModule = new modules_1.AttributeListenerModule(this, moduleConfiguration, this.loggerFactory.getLogger(modules_1.AttributeListenerModule));
409
412
  this.modules.add(attributeListenerModule);
410
413
  break;
414
+ case "NotificationModule":
415
+ const notificationModule = new modules_1.NotificationModule(this, moduleConfiguration, this.loggerFactory.getLogger(modules_1.NotificationModule));
416
+ this.modules.add(notificationModule);
417
+ break;
411
418
  default:
412
419
  throw new Error(`Module ${moduleConfiguration.name} is not a builtin module.`);
413
420
  }
@@ -548,10 +555,10 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
548
555
  const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
549
556
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
550
557
  exports.buildInformation = {
551
- version: "2.8.3",
552
- build: "172",
553
- date: "2023-10-20T10:54:54+00:00",
554
- commit: "4c2920768495e1467d200b244e51d4a1ffe13f67",
558
+ version: "2.9.0",
559
+ build: "173",
560
+ date: "2023-10-31T12:24:51+00:00",
561
+ commit: "015233cc97f24e4f5769718b4bb2b8d89548e0a6",
555
562
  dependencies: {"@js-soft/docdb-querytranslator":"1.1.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/ts-serval":"2.0.9","@js-soft/ts-utils":"^2.3.1","@nmshd/consumption":"3.4.3","@nmshd/content":"2.7.4","@nmshd/crypto":"2.0.4","@nmshd/transport":"2.1.2","ajv":"^8.12.0","ajv-errors":"^3.0.0","ajv-formats":"^2.1.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","luxon":"^3.4.3","qrcode":"1.5.3","reflect-metadata":"0.1.13","ts-simple-nameof":"1.3.1","typescript-ioc":"3.2.2"},
556
563
  libraries: {
557
564
  serval: ts_serval_1.buildInformation,
@@ -3507,13 +3514,14 @@ exports.ConsumptionServices = void 0;
3507
3514
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
3508
3515
  const consumption_1 = __webpack_require__(/*! ./facades/consumption */ "./dist/extensibility/facades/consumption/index.js");
3509
3516
  let ConsumptionServices = class ConsumptionServices {
3510
- constructor(attributes, drafts, settings, incomingRequests, outgoingRequests, attributeListeners) {
3517
+ constructor(attributes, drafts, settings, incomingRequests, outgoingRequests, attributeListeners, notifications) {
3511
3518
  this.attributes = attributes;
3512
3519
  this.drafts = drafts;
3513
3520
  this.settings = settings;
3514
3521
  this.incomingRequests = incomingRequests;
3515
3522
  this.outgoingRequests = outgoingRequests;
3516
3523
  this.attributeListeners = attributeListeners;
3524
+ this.notifications = notifications;
3517
3525
  }
3518
3526
  };
3519
3527
  exports.ConsumptionServices = ConsumptionServices;
@@ -3524,12 +3532,14 @@ exports.ConsumptionServices = ConsumptionServices = __decorate([
3524
3532
  __param(3, typescript_ioc_1.Inject),
3525
3533
  __param(4, typescript_ioc_1.Inject),
3526
3534
  __param(5, typescript_ioc_1.Inject),
3535
+ __param(6, typescript_ioc_1.Inject),
3527
3536
  __metadata("design:paramtypes", [consumption_1.AttributesFacade,
3528
3537
  consumption_1.DraftsFacade,
3529
3538
  consumption_1.SettingsFacade,
3530
3539
  consumption_1.IncomingRequestsFacade,
3531
3540
  consumption_1.OutgoingRequestsFacade,
3532
- consumption_1.AttributeListenersFacade])
3541
+ consumption_1.AttributeListenersFacade,
3542
+ consumption_1.NotificationsFacade])
3533
3543
  ], ConsumptionServices);
3534
3544
  //# sourceMappingURL=ConsumptionServices.js.map
3535
3545
 
@@ -4001,6 +4011,77 @@ exports.IncomingRequestsFacade = IncomingRequestsFacade = __decorate([
4001
4011
 
4002
4012
  /***/ }),
4003
4013
 
4014
+ /***/ "./dist/extensibility/facades/consumption/NotificationsFacade.js":
4015
+ /*!***********************************************************************!*\
4016
+ !*** ./dist/extensibility/facades/consumption/NotificationsFacade.js ***!
4017
+ \***********************************************************************/
4018
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
4019
+
4020
+ "use strict";
4021
+
4022
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
4023
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4024
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4025
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4026
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
4027
+ };
4028
+ var __metadata = (this && this.__metadata) || function (k, v) {
4029
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
4030
+ };
4031
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
4032
+ return function (target, key) { decorator(target, key, paramIndex); }
4033
+ };
4034
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
4035
+ exports.NotificationsFacade = void 0;
4036
+ const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
4037
+ const useCases_1 = __webpack_require__(/*! ../../../useCases */ "./dist/useCases/index.js");
4038
+ let NotificationsFacade = class NotificationsFacade {
4039
+ constructor(getUseCase, queryUseCase, sentNotificationUseCase, receivedNotificationUseCase, processOpenNotifactionsReceivedByCurrentDeviceUseCase, processNotificationByIdUseCase) {
4040
+ this.getUseCase = getUseCase;
4041
+ this.queryUseCase = queryUseCase;
4042
+ this.sentNotificationUseCase = sentNotificationUseCase;
4043
+ this.receivedNotificationUseCase = receivedNotificationUseCase;
4044
+ this.processOpenNotifactionsReceivedByCurrentDeviceUseCase = processOpenNotifactionsReceivedByCurrentDeviceUseCase;
4045
+ this.processNotificationByIdUseCase = processNotificationByIdUseCase;
4046
+ }
4047
+ async getNotification(request) {
4048
+ return await this.getUseCase.execute(request);
4049
+ }
4050
+ async getNotifications(request) {
4051
+ return await this.queryUseCase.execute(request);
4052
+ }
4053
+ async sentNotification(request) {
4054
+ return await this.sentNotificationUseCase.execute(request);
4055
+ }
4056
+ async receivedNotification(request) {
4057
+ return await this.receivedNotificationUseCase.execute(request);
4058
+ }
4059
+ async processOpenNotifactionsReceivedByCurrentDevice() {
4060
+ return await this.processOpenNotifactionsReceivedByCurrentDeviceUseCase.execute();
4061
+ }
4062
+ async processNotificationById(request) {
4063
+ return await this.processNotificationByIdUseCase.execute(request);
4064
+ }
4065
+ };
4066
+ exports.NotificationsFacade = NotificationsFacade;
4067
+ exports.NotificationsFacade = NotificationsFacade = __decorate([
4068
+ __param(0, typescript_ioc_1.Inject),
4069
+ __param(1, typescript_ioc_1.Inject),
4070
+ __param(2, typescript_ioc_1.Inject),
4071
+ __param(3, typescript_ioc_1.Inject),
4072
+ __param(4, typescript_ioc_1.Inject),
4073
+ __param(5, typescript_ioc_1.Inject),
4074
+ __metadata("design:paramtypes", [useCases_1.GetNotificationUseCase,
4075
+ useCases_1.GetNotificationsUseCase,
4076
+ useCases_1.SentNotificationUseCase,
4077
+ useCases_1.ReceivedNotificationUseCase,
4078
+ useCases_1.ProcessOpenNotifactionsReceivedByCurrentDeviceUseCase,
4079
+ useCases_1.ProcessNotificationByIdUseCase])
4080
+ ], NotificationsFacade);
4081
+ //# sourceMappingURL=NotificationsFacade.js.map
4082
+
4083
+ /***/ }),
4084
+
4004
4085
  /***/ "./dist/extensibility/facades/consumption/OutgoingRequestsFacade.js":
4005
4086
  /*!**************************************************************************!*\
4006
4087
  !*** ./dist/extensibility/facades/consumption/OutgoingRequestsFacade.js ***!
@@ -4182,6 +4263,7 @@ __exportStar(__webpack_require__(/*! ./AttributeListenersFacade */ "./dist/exten
4182
4263
  __exportStar(__webpack_require__(/*! ./AttributesFacade */ "./dist/extensibility/facades/consumption/AttributesFacade.js"), exports);
4183
4264
  __exportStar(__webpack_require__(/*! ./DraftsFacade */ "./dist/extensibility/facades/consumption/DraftsFacade.js"), exports);
4184
4265
  __exportStar(__webpack_require__(/*! ./IncomingRequestsFacade */ "./dist/extensibility/facades/consumption/IncomingRequestsFacade.js"), exports);
4266
+ __exportStar(__webpack_require__(/*! ./NotificationsFacade */ "./dist/extensibility/facades/consumption/NotificationsFacade.js"), exports);
4185
4267
  __exportStar(__webpack_require__(/*! ./OutgoingRequestsFacade */ "./dist/extensibility/facades/consumption/OutgoingRequestsFacade.js"), exports);
4186
4268
  __exportStar(__webpack_require__(/*! ./SettingsFacade */ "./dist/extensibility/facades/consumption/SettingsFacade.js"), exports);
4187
4269
  //# sourceMappingURL=index.js.map
@@ -5240,6 +5322,63 @@ exports.MessageModule = MessageModule;
5240
5322
 
5241
5323
  /***/ }),
5242
5324
 
5325
+ /***/ "./dist/modules/NotificationModule.js":
5326
+ /*!********************************************!*\
5327
+ !*** ./dist/modules/NotificationModule.js ***!
5328
+ \********************************************/
5329
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5330
+
5331
+ "use strict";
5332
+
5333
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
5334
+ exports.NotificationModule = void 0;
5335
+ const events_1 = __webpack_require__(/*! ../events */ "./dist/events/index.js");
5336
+ const RuntimeModule_1 = __webpack_require__(/*! ../extensibility/modules/RuntimeModule */ "./dist/extensibility/modules/RuntimeModule.js");
5337
+ class NotificationModule extends RuntimeModule_1.RuntimeModule {
5338
+ init() {
5339
+ // Noting to do here
5340
+ }
5341
+ start() {
5342
+ this.subscribeToEvent(events_1.MessageReceivedEvent, this.handleMessageReceivedEvent.bind(this));
5343
+ this.subscribeToEvent(events_1.MessageSentEvent, this.handleMessageSentEvent.bind(this));
5344
+ }
5345
+ async handleMessageReceivedEvent(event) {
5346
+ const message = event.data;
5347
+ if (message.content["@type"] !== "Notification")
5348
+ return;
5349
+ const services = await this.runtime.getServices(event.eventTargetAddress);
5350
+ const receivedResult = await services.consumptionServices.notifications.receivedNotification({ messageId: message.id });
5351
+ if (receivedResult.isError) {
5352
+ this.logger.error(`Could not mark Notification as received for message '${message.id}'.`, receivedResult.error);
5353
+ return;
5354
+ }
5355
+ const notification = receivedResult.value;
5356
+ const processResult = await services.consumptionServices.notifications.processNotificationById({ notificationId: notification.id });
5357
+ if (processResult.isError) {
5358
+ this.logger.error(`Could not process Notification '${notification.id}'.`, processResult.error);
5359
+ return;
5360
+ }
5361
+ }
5362
+ async handleMessageSentEvent(event) {
5363
+ const message = event.data;
5364
+ if (message.content["@type"] !== "Notification")
5365
+ return;
5366
+ const services = await this.runtime.getServices(event.eventTargetAddress);
5367
+ const sentResult = await services.consumptionServices.notifications.sentNotification({ messageId: message.id });
5368
+ if (sentResult.isError) {
5369
+ this.logger.error(`Could not mark Notification as sent by Message '${message.id}'.`, sentResult.error);
5370
+ return;
5371
+ }
5372
+ }
5373
+ stop() {
5374
+ this.unsubscribeFromAllEvents();
5375
+ }
5376
+ }
5377
+ exports.NotificationModule = NotificationModule;
5378
+ //# sourceMappingURL=NotificationModule.js.map
5379
+
5380
+ /***/ }),
5381
+
5243
5382
  /***/ "./dist/modules/RequestModule.js":
5244
5383
  /*!***************************************!*\
5245
5384
  !*** ./dist/modules/RequestModule.js ***!
@@ -5520,6 +5659,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
5520
5659
  __exportStar(__webpack_require__(/*! ./AttributeListenerModule */ "./dist/modules/AttributeListenerModule.js"), exports);
5521
5660
  __exportStar(__webpack_require__(/*! ./DeciderModule */ "./dist/modules/DeciderModule.js"), exports);
5522
5661
  __exportStar(__webpack_require__(/*! ./MessageModule */ "./dist/modules/MessageModule.js"), exports);
5662
+ __exportStar(__webpack_require__(/*! ./NotificationModule */ "./dist/modules/NotificationModule.js"), exports);
5523
5663
  __exportStar(__webpack_require__(/*! ./RequestModule */ "./dist/modules/RequestModule.js"), exports);
5524
5664
  //# sourceMappingURL=index.js.map
5525
5665
 
@@ -5577,6 +5717,19 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
5577
5717
 
5578
5718
  /***/ }),
5579
5719
 
5720
+ /***/ "./dist/types/consumption/LocalNotificationDTO.js":
5721
+ /*!********************************************************!*\
5722
+ !*** ./dist/types/consumption/LocalNotificationDTO.js ***!
5723
+ \********************************************************/
5724
+ /***/ ((__unused_webpack_module, exports) => {
5725
+
5726
+ "use strict";
5727
+
5728
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
5729
+ //# sourceMappingURL=LocalNotificationDTO.js.map
5730
+
5731
+ /***/ }),
5732
+
5580
5733
  /***/ "./dist/types/consumption/LocalRequestDTO.js":
5581
5734
  /*!***************************************************!*\
5582
5735
  !*** ./dist/types/consumption/LocalRequestDTO.js ***!
@@ -5642,6 +5795,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
5642
5795
  __exportStar(__webpack_require__(/*! ./DraftDTO */ "./dist/types/consumption/DraftDTO.js"), exports);
5643
5796
  __exportStar(__webpack_require__(/*! ./LocalAttributeDTO */ "./dist/types/consumption/LocalAttributeDTO.js"), exports);
5644
5797
  __exportStar(__webpack_require__(/*! ./LocalAttributeListenerDTO */ "./dist/types/consumption/LocalAttributeListenerDTO.js"), exports);
5798
+ __exportStar(__webpack_require__(/*! ./LocalNotificationDTO */ "./dist/types/consumption/LocalNotificationDTO.js"), exports);
5645
5799
  __exportStar(__webpack_require__(/*! ./LocalRequestDTO */ "./dist/types/consumption/LocalRequestDTO.js"), exports);
5646
5800
  __exportStar(__webpack_require__(/*! ./RequestValidationResultDTO */ "./dist/types/consumption/RequestValidationResultDTO.js"), exports);
5647
5801
  __exportStar(__webpack_require__(/*! ./SettingDTO */ "./dist/types/consumption/SettingDTO.js"), exports);
@@ -6300,6 +6454,17 @@ class Challenges {
6300
6454
  return new ts_utils_1.ApplicationError("error.runtime.challenges.invalidChallenge", "The challengeString is invalid.");
6301
6455
  }
6302
6456
  }
6457
+ class Notifications {
6458
+ cannotReceiveNotificationFromOwnMessage() {
6459
+ return new ts_utils_1.ApplicationError("error.runtime.notifications.cannotReceiveNotificationFromOwnMessage", "Cannot receive Notification from own message.");
6460
+ }
6461
+ cannotSaveSentNotificationFromPeerMessage() {
6462
+ return new ts_utils_1.ApplicationError("error.runtime.notifications.cannotSaveSendNotificationFromPeerMessage", "Cannot send Notification from peer message.");
6463
+ }
6464
+ messageDoesNotContainNotification(messageId) {
6465
+ return new ts_utils_1.ApplicationError("error.runtime.notifications.messageDoesNotContainNotification", `The Message with the ID '${messageId.toString()}' does not contain a Notification.`);
6466
+ }
6467
+ }
6303
6468
  class RuntimeErrors {
6304
6469
  }
6305
6470
  exports.RuntimeErrors = RuntimeErrors;
@@ -6310,6 +6475,7 @@ RuntimeErrors.files = new Files();
6310
6475
  RuntimeErrors.relationshipTemplates = new RelationshipTemplates();
6311
6476
  RuntimeErrors.messages = new Messages();
6312
6477
  RuntimeErrors.challenges = new Challenges();
6478
+ RuntimeErrors.notifications = new Notifications();
6313
6479
  //# sourceMappingURL=RuntimeErrors.js.map
6314
6480
 
6315
6481
  /***/ }),
@@ -6402,9 +6568,9 @@ exports.JsonSchema = JsonSchema;
6402
6568
  "use strict";
6403
6569
 
6404
6570
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6405
- exports.DownloadAttachmentRequest = exports.SyncDatawalletRequest = exports.RegisterPushNotificationTokenRequest = exports.LoadItemFromTruncatedReferenceRequest = exports.DownloadFileRequest = exports.UpdateSettingRequest = exports.GetSettingsRequest = exports.GetSettingByKeyRequest = exports.GetSettingRequest = exports.DeleteSettingRequest = exports.CreateSettingRequest = exports.UpdateDraftRequest = exports.GetDraftsRequest = exports.GetDraftRequest = exports.DeleteDraftRequest = exports.CreateDraftRequest = exports.ValidateIQLQueryRequest = exports.UpdateAttributeRequest = exports.SucceedAttributeRequest = exports.ShareAttributeRequest = exports.SentOutgoingRequestRequest = exports.RequireManualDecisionOfIncomingRequestRequest = exports.ReceivedIncomingRequestRequest = exports.GetOutgoingRequestsRequest = exports.GetOutgoingRequestRequest = exports.GetIncomingRequestsRequest = exports.GetIncomingRequestRequest = exports.DiscardOutgoingRequestRequest = exports.CreateOutgoingRequestRequest = exports.CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseRequest = exports.CompleteOutgoingRequestRequest = exports.CompleteIncomingRequestRequest = exports.CheckPrerequisitesOfIncomingRequestRequest = exports.RejectIncomingRequestRequest = exports.CanCreateOutgoingRequestRequest = exports.AcceptIncomingRequestRequest = exports.GetSharedToPeerAttributesRequest = exports.GetPeerAttributesRequest = exports.GetAttributesRequest = exports.GetAttributeRequest = exports.ExecuteThirdPartyRelationshipAttributeQueryRequest = exports.ExecuteRelationshipAttributeQueryRequest = exports.ExecuteIQLQueryRequest = exports.ExecuteIdentityAttributeQueryRequest = exports.DeleteAttributeRequest = exports.CreateSharedAttributeCopyRequest = exports.CreateAttributeRequest = exports.GetAttributeListenerRequest = exports.LoadPeerTokenAnonymousByTruncatedReferenceRequest = exports.LoadPeerTokenAnonymousByIdAndKeyRequest = void 0;
6406
- exports.LoadPeerTokenViaSecretRequest = exports.LoadPeerTokenViaReferenceRequest = exports.GetTokensRequest = exports.GetTokenRequest = exports.GetQRCodeForTokenRequest = exports.CreateOwnTokenRequest = exports.LoadPeerRelationshipTemplateRequest = exports.LoadPeerRelationshipTemplateViaReferenceRequest = exports.LoadPeerRelationshipTemplateViaSecretRequest = exports.GetRelationshipTemplatesRequest = exports.GetRelationshipTemplateRequest = exports.CreateTokenQrCodeForOwnTemplateRequest = exports.CreateTokenForOwnTemplateRequest = exports.CreateQrCodeForOwnTemplateRequest = exports.CreateOwnRelationshipTemplateRequest = exports.RevokeRelationshipChangeRequest = exports.RejectRelationshipChangeRequest = exports.GetRelationshipsRequest = exports.GetRelationshipByAddressRequest = exports.GetRelationshipRequest = exports.GetAttributesForRelationshipRequest = exports.CreateRelationshipRequest = exports.AcceptRelationshipChangeRequest = exports.SendMessageRequest = exports.GetMessagesRequest = exports.GetMessageRequest = exports.GetAttachmentMetadataRequest = exports.CheckIdentityRequest = exports.UploadOwnFileValidatableRequest = exports.UploadOwnFileRequest = exports.GetOrLoadFileRequest = exports.GetOrLoadFileViaReferenceRequest = exports.GetOrLoadFileViaSecretRequest = exports.GetFilesRequest = exports.GetFileRequest = exports.CreateTokenQrCodeForFileRequest = exports.CreateTokenForFileRequest = exports.CreateQrCodeForFileRequest = exports.UpdateDeviceRequest = exports.GetDeviceOnboardingInfoRequest = exports.GetDeviceRequest = exports.DeleteDeviceRequest = exports.CreateDeviceOnboardingTokenRequest = exports.CreateDeviceRequest = exports.ValidateChallengeRequest = exports.CreateChallengeRequest = exports.CreateDeviceChallengeRequest = exports.CreateIdentityChallengeRequest = exports.CreateRelationshipChallengeRequest = exports.SyncEverythingRequest = void 0;
6407
- exports.LoadPeerTokenRequest = void 0;
6571
+ exports.UpdateSettingRequest = exports.GetSettingsRequest = exports.GetSettingByKeyRequest = exports.GetSettingRequest = exports.DeleteSettingRequest = exports.CreateSettingRequest = exports.SentNotificationRequest = exports.ReceivedNotificationRequest = exports.ProcessNotificationByIdRequest = exports.GetNotificationsRequest = exports.GetNotificationRequest = exports.UpdateDraftRequest = exports.GetDraftsRequest = exports.GetDraftRequest = exports.DeleteDraftRequest = exports.CreateDraftRequest = exports.ValidateIQLQueryRequest = exports.UpdateAttributeRequest = exports.SucceedAttributeRequest = exports.ShareAttributeRequest = exports.SentOutgoingRequestRequest = exports.RequireManualDecisionOfIncomingRequestRequest = exports.ReceivedIncomingRequestRequest = exports.GetOutgoingRequestsRequest = exports.GetOutgoingRequestRequest = exports.GetIncomingRequestsRequest = exports.GetIncomingRequestRequest = exports.DiscardOutgoingRequestRequest = exports.CreateOutgoingRequestRequest = exports.CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseRequest = exports.CompleteOutgoingRequestRequest = exports.CompleteIncomingRequestRequest = exports.CheckPrerequisitesOfIncomingRequestRequest = exports.RejectIncomingRequestRequest = exports.CanCreateOutgoingRequestRequest = exports.AcceptIncomingRequestRequest = exports.GetSharedToPeerAttributesRequest = exports.GetPeerAttributesRequest = exports.GetAttributesRequest = exports.GetAttributeRequest = exports.ExecuteThirdPartyRelationshipAttributeQueryRequest = exports.ExecuteRelationshipAttributeQueryRequest = exports.ExecuteIQLQueryRequest = exports.ExecuteIdentityAttributeQueryRequest = exports.DeleteAttributeRequest = exports.CreateSharedAttributeCopyRequest = exports.CreateAttributeRequest = exports.GetAttributeListenerRequest = exports.LoadPeerTokenAnonymousByTruncatedReferenceRequest = exports.LoadPeerTokenAnonymousByIdAndKeyRequest = void 0;
6572
+ exports.CreateOwnTokenRequest = exports.LoadPeerRelationshipTemplateRequest = exports.LoadPeerRelationshipTemplateViaReferenceRequest = exports.LoadPeerRelationshipTemplateViaSecretRequest = exports.GetRelationshipTemplatesRequest = exports.GetRelationshipTemplateRequest = exports.CreateTokenQrCodeForOwnTemplateRequest = exports.CreateTokenForOwnTemplateRequest = exports.CreateQrCodeForOwnTemplateRequest = exports.CreateOwnRelationshipTemplateRequest = exports.RevokeRelationshipChangeRequest = exports.RejectRelationshipChangeRequest = exports.GetRelationshipsRequest = exports.GetRelationshipByAddressRequest = exports.GetRelationshipRequest = exports.GetAttributesForRelationshipRequest = exports.CreateRelationshipRequest = exports.AcceptRelationshipChangeRequest = exports.SendMessageRequest = exports.GetMessagesRequest = exports.GetMessageRequest = exports.GetAttachmentMetadataRequest = exports.CheckIdentityRequest = exports.UploadOwnFileValidatableRequest = exports.UploadOwnFileRequest = exports.GetOrLoadFileRequest = exports.GetOrLoadFileViaReferenceRequest = exports.GetOrLoadFileViaSecretRequest = exports.GetFilesRequest = exports.GetFileRequest = exports.CreateTokenQrCodeForFileRequest = exports.CreateTokenForFileRequest = exports.CreateQrCodeForFileRequest = exports.UpdateDeviceRequest = exports.GetDeviceOnboardingInfoRequest = exports.GetDeviceRequest = exports.DeleteDeviceRequest = exports.CreateDeviceOnboardingTokenRequest = exports.CreateDeviceRequest = exports.ValidateChallengeRequest = exports.CreateChallengeRequest = exports.CreateDeviceChallengeRequest = exports.CreateIdentityChallengeRequest = exports.CreateRelationshipChallengeRequest = exports.SyncEverythingRequest = exports.DownloadAttachmentRequest = exports.SyncDatawalletRequest = exports.RegisterPushNotificationTokenRequest = exports.LoadItemFromTruncatedReferenceRequest = exports.DownloadFileRequest = void 0;
6573
+ exports.LoadPeerTokenRequest = exports.LoadPeerTokenViaSecretRequest = exports.LoadPeerTokenViaReferenceRequest = exports.GetTokensRequest = exports.GetTokenRequest = exports.GetQRCodeForTokenRequest = void 0;
6408
6574
  exports.LoadPeerTokenAnonymousByIdAndKeyRequest = {
6409
6575
  "$schema": "http://json-schema.org/draft-07/schema#",
6410
6576
  "$ref": "#/definitions/LoadPeerTokenAnonymousByIdAndKeyRequest",
@@ -29474,6 +29640,125 @@ exports.UpdateDraftRequest = {
29474
29640
  }
29475
29641
  }
29476
29642
  };
29643
+ exports.GetNotificationRequest = {
29644
+ "$schema": "http://json-schema.org/draft-07/schema#",
29645
+ "$ref": "#/definitions/GetNotificationRequest",
29646
+ "definitions": {
29647
+ "GetNotificationRequest": {
29648
+ "type": "object",
29649
+ "properties": {
29650
+ "id": {
29651
+ "$ref": "#/definitions/NotificationIdString"
29652
+ }
29653
+ },
29654
+ "required": [
29655
+ "id"
29656
+ ],
29657
+ "additionalProperties": false
29658
+ },
29659
+ "NotificationIdString": {
29660
+ "type": "string",
29661
+ "pattern": "NOT[A-Za-z0-9]{17}"
29662
+ }
29663
+ }
29664
+ };
29665
+ exports.GetNotificationsRequest = {
29666
+ "$schema": "http://json-schema.org/draft-07/schema#",
29667
+ "$ref": "#/definitions/GetNotificationsRequest",
29668
+ "definitions": {
29669
+ "GetNotificationsRequest": {
29670
+ "type": "object",
29671
+ "properties": {
29672
+ "query": {
29673
+ "$ref": "#/definitions/GetNotificationsRequestQuery"
29674
+ }
29675
+ },
29676
+ "additionalProperties": false
29677
+ },
29678
+ "GetNotificationsRequestQuery": {
29679
+ "type": "object",
29680
+ "additionalProperties": {
29681
+ "anyOf": [
29682
+ {
29683
+ "type": "string"
29684
+ },
29685
+ {
29686
+ "type": "array",
29687
+ "items": {
29688
+ "type": "string"
29689
+ }
29690
+ }
29691
+ ]
29692
+ }
29693
+ }
29694
+ }
29695
+ };
29696
+ exports.ProcessNotificationByIdRequest = {
29697
+ "$schema": "http://json-schema.org/draft-07/schema#",
29698
+ "$ref": "#/definitions/ProcessNotificationByIdRequest",
29699
+ "definitions": {
29700
+ "ProcessNotificationByIdRequest": {
29701
+ "type": "object",
29702
+ "properties": {
29703
+ "notificationId": {
29704
+ "$ref": "#/definitions/NotificationIdString"
29705
+ }
29706
+ },
29707
+ "required": [
29708
+ "notificationId"
29709
+ ],
29710
+ "additionalProperties": false
29711
+ },
29712
+ "NotificationIdString": {
29713
+ "type": "string",
29714
+ "pattern": "NOT[A-Za-z0-9]{17}"
29715
+ }
29716
+ }
29717
+ };
29718
+ exports.ReceivedNotificationRequest = {
29719
+ "$schema": "http://json-schema.org/draft-07/schema#",
29720
+ "$ref": "#/definitions/ReceivedNotificationRequest",
29721
+ "definitions": {
29722
+ "ReceivedNotificationRequest": {
29723
+ "type": "object",
29724
+ "properties": {
29725
+ "messageId": {
29726
+ "$ref": "#/definitions/MessageIdString"
29727
+ }
29728
+ },
29729
+ "required": [
29730
+ "messageId"
29731
+ ],
29732
+ "additionalProperties": false
29733
+ },
29734
+ "MessageIdString": {
29735
+ "type": "string",
29736
+ "pattern": "MSG[A-Za-z0-9]{17}"
29737
+ }
29738
+ }
29739
+ };
29740
+ exports.SentNotificationRequest = {
29741
+ "$schema": "http://json-schema.org/draft-07/schema#",
29742
+ "$ref": "#/definitions/SentNotificationRequest",
29743
+ "definitions": {
29744
+ "SentNotificationRequest": {
29745
+ "type": "object",
29746
+ "properties": {
29747
+ "messageId": {
29748
+ "$ref": "#/definitions/MessageIdString"
29749
+ }
29750
+ },
29751
+ "required": [
29752
+ "messageId"
29753
+ ],
29754
+ "additionalProperties": false
29755
+ },
29756
+ "MessageIdString": {
29757
+ "type": "string",
29758
+ "pattern": "MSG[A-Za-z0-9]{17}"
29759
+ }
29760
+ }
29761
+ };
29477
29762
  exports.CreateSettingRequest = {
29478
29763
  "$schema": "http://json-schema.org/draft-07/schema#",
29479
29764
  "$ref": "#/definitions/CreateSettingRequest",
@@ -33499,12 +33784,433 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
33499
33784
  __exportStar(__webpack_require__(/*! ./attributeListeners */ "./dist/useCases/consumption/attributeListeners/index.js"), exports);
33500
33785
  __exportStar(__webpack_require__(/*! ./attributes */ "./dist/useCases/consumption/attributes/index.js"), exports);
33501
33786
  __exportStar(__webpack_require__(/*! ./drafts */ "./dist/useCases/consumption/drafts/index.js"), exports);
33787
+ __exportStar(__webpack_require__(/*! ./notifications */ "./dist/useCases/consumption/notifications/index.js"), exports);
33502
33788
  __exportStar(__webpack_require__(/*! ./requests */ "./dist/useCases/consumption/requests/index.js"), exports);
33503
33789
  __exportStar(__webpack_require__(/*! ./settings */ "./dist/useCases/consumption/settings/index.js"), exports);
33504
33790
  //# sourceMappingURL=index.js.map
33505
33791
 
33506
33792
  /***/ }),
33507
33793
 
33794
+ /***/ "./dist/useCases/consumption/notifications/GetNotification.js":
33795
+ /*!********************************************************************!*\
33796
+ !*** ./dist/useCases/consumption/notifications/GetNotification.js ***!
33797
+ \********************************************************************/
33798
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
33799
+
33800
+ "use strict";
33801
+
33802
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
33803
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
33804
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
33805
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
33806
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
33807
+ };
33808
+ var __metadata = (this && this.__metadata) || function (k, v) {
33809
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
33810
+ };
33811
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
33812
+ return function (target, key) { decorator(target, key, paramIndex); }
33813
+ };
33814
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
33815
+ exports.GetNotificationUseCase = void 0;
33816
+ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
33817
+ const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
33818
+ const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
33819
+ const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
33820
+ const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
33821
+ const NotificationMapper_1 = __webpack_require__(/*! ./NotificationMapper */ "./dist/useCases/consumption/notifications/NotificationMapper.js");
33822
+ let Validator = class Validator extends common_1.SchemaValidator {
33823
+ constructor(schemaRepository) {
33824
+ super(schemaRepository.getSchema("GetNotificationRequest"));
33825
+ }
33826
+ };
33827
+ Validator = __decorate([
33828
+ __param(0, typescript_ioc_1.Inject),
33829
+ __metadata("design:paramtypes", [common_1.SchemaRepository])
33830
+ ], Validator);
33831
+ let GetNotificationUseCase = class GetNotificationUseCase extends common_1.UseCase {
33832
+ constructor(notificationsController, validator) {
33833
+ super(validator);
33834
+ this.notificationsController = notificationsController;
33835
+ }
33836
+ async executeInternal(request) {
33837
+ const notification = await this.notificationsController.getNotification(transport_1.CoreId.from(request.id));
33838
+ return ts_utils_1.Result.ok(NotificationMapper_1.NotificationMapper.toNotificationDTO(notification));
33839
+ }
33840
+ };
33841
+ exports.GetNotificationUseCase = GetNotificationUseCase;
33842
+ exports.GetNotificationUseCase = GetNotificationUseCase = __decorate([
33843
+ __param(0, typescript_ioc_1.Inject),
33844
+ __param(1, typescript_ioc_1.Inject),
33845
+ __metadata("design:paramtypes", [consumption_1.NotificationsController,
33846
+ Validator])
33847
+ ], GetNotificationUseCase);
33848
+ //# sourceMappingURL=GetNotification.js.map
33849
+
33850
+ /***/ }),
33851
+
33852
+ /***/ "./dist/useCases/consumption/notifications/GetNotifications.js":
33853
+ /*!*********************************************************************!*\
33854
+ !*** ./dist/useCases/consumption/notifications/GetNotifications.js ***!
33855
+ \*********************************************************************/
33856
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
33857
+
33858
+ "use strict";
33859
+
33860
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
33861
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
33862
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
33863
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
33864
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
33865
+ };
33866
+ var __metadata = (this && this.__metadata) || function (k, v) {
33867
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
33868
+ };
33869
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
33870
+ return function (target, key) { decorator(target, key, paramIndex); }
33871
+ };
33872
+ var GetNotificationsUseCase_1;
33873
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
33874
+ exports.GetNotificationsUseCase = void 0;
33875
+ const docdb_querytranslator_1 = __webpack_require__(/*! @js-soft/docdb-querytranslator */ "./node_modules/@js-soft/docdb-querytranslator/dist/index.js");
33876
+ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
33877
+ const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
33878
+ const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
33879
+ const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
33880
+ const NotificationMapper_1 = __webpack_require__(/*! ./NotificationMapper */ "./dist/useCases/consumption/notifications/NotificationMapper.js");
33881
+ let GetNotificationsUseCase = GetNotificationsUseCase_1 = class GetNotificationsUseCase extends common_1.UseCase {
33882
+ constructor(notificationsController) {
33883
+ super();
33884
+ this.notificationsController = notificationsController;
33885
+ }
33886
+ async executeInternal(request) {
33887
+ const dbQuery = GetNotificationsUseCase_1.queryTranslator.parse(request.query);
33888
+ const notifications = await this.notificationsController.getNotifications(dbQuery);
33889
+ return ts_utils_1.Result.ok(NotificationMapper_1.NotificationMapper.toNotificationDTOList(notifications));
33890
+ }
33891
+ };
33892
+ exports.GetNotificationsUseCase = GetNotificationsUseCase;
33893
+ GetNotificationsUseCase.queryTranslator = new docdb_querytranslator_1.QueryTranslator({});
33894
+ exports.GetNotificationsUseCase = GetNotificationsUseCase = GetNotificationsUseCase_1 = __decorate([
33895
+ __param(0, typescript_ioc_1.Inject),
33896
+ __metadata("design:paramtypes", [consumption_1.NotificationsController])
33897
+ ], GetNotificationsUseCase);
33898
+ //# sourceMappingURL=GetNotifications.js.map
33899
+
33900
+ /***/ }),
33901
+
33902
+ /***/ "./dist/useCases/consumption/notifications/NotificationMapper.js":
33903
+ /*!***********************************************************************!*\
33904
+ !*** ./dist/useCases/consumption/notifications/NotificationMapper.js ***!
33905
+ \***********************************************************************/
33906
+ /***/ ((__unused_webpack_module, exports) => {
33907
+
33908
+ "use strict";
33909
+
33910
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
33911
+ exports.NotificationMapper = void 0;
33912
+ class NotificationMapper {
33913
+ static toNotificationDTO(notification) {
33914
+ return {
33915
+ id: notification.id.toString(),
33916
+ isOwn: notification.isOwn,
33917
+ peer: notification.peer.toString(),
33918
+ createdAt: notification.createdAt.toISOString(),
33919
+ receivedByDevice: notification.receivedByDevice?.toString(),
33920
+ content: notification.content.toJSON(),
33921
+ status: notification.status,
33922
+ source: {
33923
+ type: "Message",
33924
+ reference: notification.source.reference.toString()
33925
+ }
33926
+ };
33927
+ }
33928
+ static toNotificationDTOList(notifications) {
33929
+ return notifications.map((notification) => this.toNotificationDTO(notification));
33930
+ }
33931
+ }
33932
+ exports.NotificationMapper = NotificationMapper;
33933
+ //# sourceMappingURL=NotificationMapper.js.map
33934
+
33935
+ /***/ }),
33936
+
33937
+ /***/ "./dist/useCases/consumption/notifications/ProcessNotificationById.js":
33938
+ /*!****************************************************************************!*\
33939
+ !*** ./dist/useCases/consumption/notifications/ProcessNotificationById.js ***!
33940
+ \****************************************************************************/
33941
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
33942
+
33943
+ "use strict";
33944
+
33945
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
33946
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
33947
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
33948
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
33949
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
33950
+ };
33951
+ var __metadata = (this && this.__metadata) || function (k, v) {
33952
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
33953
+ };
33954
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
33955
+ return function (target, key) { decorator(target, key, paramIndex); }
33956
+ };
33957
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
33958
+ exports.ProcessNotificationByIdUseCase = void 0;
33959
+ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
33960
+ const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
33961
+ const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
33962
+ const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
33963
+ const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
33964
+ const NotificationMapper_1 = __webpack_require__(/*! ./NotificationMapper */ "./dist/useCases/consumption/notifications/NotificationMapper.js");
33965
+ let Validator = class Validator extends common_1.SchemaValidator {
33966
+ constructor(schemaRepository) {
33967
+ super(schemaRepository.getSchema("ProcessNotificationByIdRequest"));
33968
+ }
33969
+ };
33970
+ Validator = __decorate([
33971
+ __param(0, typescript_ioc_1.Inject),
33972
+ __metadata("design:paramtypes", [common_1.SchemaRepository])
33973
+ ], Validator);
33974
+ let ProcessNotificationByIdUseCase = class ProcessNotificationByIdUseCase extends common_1.UseCase {
33975
+ constructor(notificationsController, validator) {
33976
+ super(validator);
33977
+ this.notificationsController = notificationsController;
33978
+ }
33979
+ async executeInternal(request) {
33980
+ const processedNotification = await this.notificationsController.processNotificationById(transport_1.CoreId.from(request.notificationId));
33981
+ const dto = NotificationMapper_1.NotificationMapper.toNotificationDTO(processedNotification);
33982
+ return ts_utils_1.Result.ok(dto);
33983
+ }
33984
+ };
33985
+ exports.ProcessNotificationByIdUseCase = ProcessNotificationByIdUseCase;
33986
+ exports.ProcessNotificationByIdUseCase = ProcessNotificationByIdUseCase = __decorate([
33987
+ __param(0, typescript_ioc_1.Inject),
33988
+ __param(1, typescript_ioc_1.Inject),
33989
+ __metadata("design:paramtypes", [consumption_1.NotificationsController,
33990
+ Validator])
33991
+ ], ProcessNotificationByIdUseCase);
33992
+ //# sourceMappingURL=ProcessNotificationById.js.map
33993
+
33994
+ /***/ }),
33995
+
33996
+ /***/ "./dist/useCases/consumption/notifications/ProcessOpenNotifactionsReceivedByCurrentDevice.js":
33997
+ /*!***************************************************************************************************!*\
33998
+ !*** ./dist/useCases/consumption/notifications/ProcessOpenNotifactionsReceivedByCurrentDevice.js ***!
33999
+ \***************************************************************************************************/
34000
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
34001
+
34002
+ "use strict";
34003
+
34004
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
34005
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
34006
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
34007
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
34008
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
34009
+ };
34010
+ var __metadata = (this && this.__metadata) || function (k, v) {
34011
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
34012
+ };
34013
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
34014
+ return function (target, key) { decorator(target, key, paramIndex); }
34015
+ };
34016
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
34017
+ exports.ProcessOpenNotifactionsReceivedByCurrentDeviceUseCase = void 0;
34018
+ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
34019
+ const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
34020
+ const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
34021
+ const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
34022
+ let ProcessOpenNotifactionsReceivedByCurrentDeviceUseCase = class ProcessOpenNotifactionsReceivedByCurrentDeviceUseCase extends common_1.UseCase {
34023
+ constructor(notificationsController) {
34024
+ super();
34025
+ this.notificationsController = notificationsController;
34026
+ }
34027
+ async executeInternal() {
34028
+ await this.notificationsController.processOpenNotifactionsReceivedByCurrentDevice();
34029
+ return ts_utils_1.Result.ok(undefined);
34030
+ }
34031
+ };
34032
+ exports.ProcessOpenNotifactionsReceivedByCurrentDeviceUseCase = ProcessOpenNotifactionsReceivedByCurrentDeviceUseCase;
34033
+ exports.ProcessOpenNotifactionsReceivedByCurrentDeviceUseCase = ProcessOpenNotifactionsReceivedByCurrentDeviceUseCase = __decorate([
34034
+ __param(0, typescript_ioc_1.Inject),
34035
+ __metadata("design:paramtypes", [consumption_1.NotificationsController])
34036
+ ], ProcessOpenNotifactionsReceivedByCurrentDeviceUseCase);
34037
+ //# sourceMappingURL=ProcessOpenNotifactionsReceivedByCurrentDevice.js.map
34038
+
34039
+ /***/ }),
34040
+
34041
+ /***/ "./dist/useCases/consumption/notifications/ReceivedNotification.js":
34042
+ /*!*************************************************************************!*\
34043
+ !*** ./dist/useCases/consumption/notifications/ReceivedNotification.js ***!
34044
+ \*************************************************************************/
34045
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
34046
+
34047
+ "use strict";
34048
+
34049
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
34050
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
34051
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
34052
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
34053
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
34054
+ };
34055
+ var __metadata = (this && this.__metadata) || function (k, v) {
34056
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
34057
+ };
34058
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
34059
+ return function (target, key) { decorator(target, key, paramIndex); }
34060
+ };
34061
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
34062
+ exports.ReceivedNotificationUseCase = void 0;
34063
+ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
34064
+ const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
34065
+ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
34066
+ const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
34067
+ const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
34068
+ const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
34069
+ const NotificationMapper_1 = __webpack_require__(/*! ./NotificationMapper */ "./dist/useCases/consumption/notifications/NotificationMapper.js");
34070
+ let Validator = class Validator extends common_1.SchemaValidator {
34071
+ constructor(schemaRepository) {
34072
+ super(schemaRepository.getSchema("ReceivedNotificationRequest"));
34073
+ }
34074
+ };
34075
+ Validator = __decorate([
34076
+ __param(0, typescript_ioc_1.Inject),
34077
+ __metadata("design:paramtypes", [common_1.SchemaRepository])
34078
+ ], Validator);
34079
+ let ReceivedNotificationUseCase = class ReceivedNotificationUseCase extends common_1.UseCase {
34080
+ constructor(notificationsController, messageController, validator) {
34081
+ super(validator);
34082
+ this.notificationsController = notificationsController;
34083
+ this.messageController = messageController;
34084
+ }
34085
+ async executeInternal(request) {
34086
+ const message = await this.messageController.getMessage(transport_1.CoreId.from(request.messageId));
34087
+ if (!message)
34088
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(transport_1.Message));
34089
+ if (!(message.cache.content instanceof content_1.Notification))
34090
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.notifications.messageDoesNotContainNotification(message.id));
34091
+ if (message.isOwn)
34092
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.notifications.cannotReceiveNotificationFromOwnMessage());
34093
+ const notification = await this.notificationsController.received(message);
34094
+ const dto = NotificationMapper_1.NotificationMapper.toNotificationDTO(notification);
34095
+ return ts_utils_1.Result.ok(dto);
34096
+ }
34097
+ };
34098
+ exports.ReceivedNotificationUseCase = ReceivedNotificationUseCase;
34099
+ exports.ReceivedNotificationUseCase = ReceivedNotificationUseCase = __decorate([
34100
+ __param(0, typescript_ioc_1.Inject),
34101
+ __param(1, typescript_ioc_1.Inject),
34102
+ __param(2, typescript_ioc_1.Inject),
34103
+ __metadata("design:paramtypes", [consumption_1.NotificationsController,
34104
+ transport_1.MessageController,
34105
+ Validator])
34106
+ ], ReceivedNotificationUseCase);
34107
+ //# sourceMappingURL=ReceivedNotification.js.map
34108
+
34109
+ /***/ }),
34110
+
34111
+ /***/ "./dist/useCases/consumption/notifications/SentNotification.js":
34112
+ /*!*********************************************************************!*\
34113
+ !*** ./dist/useCases/consumption/notifications/SentNotification.js ***!
34114
+ \*********************************************************************/
34115
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
34116
+
34117
+ "use strict";
34118
+
34119
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
34120
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
34121
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
34122
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
34123
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
34124
+ };
34125
+ var __metadata = (this && this.__metadata) || function (k, v) {
34126
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
34127
+ };
34128
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
34129
+ return function (target, key) { decorator(target, key, paramIndex); }
34130
+ };
34131
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
34132
+ exports.SentNotificationUseCase = void 0;
34133
+ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
34134
+ const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
34135
+ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
34136
+ const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
34137
+ const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
34138
+ const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
34139
+ const NotificationMapper_1 = __webpack_require__(/*! ./NotificationMapper */ "./dist/useCases/consumption/notifications/NotificationMapper.js");
34140
+ let Validator = class Validator extends common_1.SchemaValidator {
34141
+ constructor(schemaRepository) {
34142
+ super(schemaRepository.getSchema("SentNotificationRequest"));
34143
+ }
34144
+ };
34145
+ Validator = __decorate([
34146
+ __param(0, typescript_ioc_1.Inject),
34147
+ __metadata("design:paramtypes", [common_1.SchemaRepository])
34148
+ ], Validator);
34149
+ let SentNotificationUseCase = class SentNotificationUseCase extends common_1.UseCase {
34150
+ constructor(notificationsController, messageController, validator) {
34151
+ super(validator);
34152
+ this.notificationsController = notificationsController;
34153
+ this.messageController = messageController;
34154
+ }
34155
+ async executeInternal(request) {
34156
+ const message = await this.messageController.getMessage(transport_1.CoreId.from(request.messageId));
34157
+ if (!message)
34158
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(transport_1.Message));
34159
+ if (!(message.cache.content instanceof content_1.Notification))
34160
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.notifications.messageDoesNotContainNotification(message.id));
34161
+ if (!message.isOwn)
34162
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.notifications.cannotSaveSentNotificationFromPeerMessage());
34163
+ const notification = await this.notificationsController.sent(message);
34164
+ const dto = NotificationMapper_1.NotificationMapper.toNotificationDTO(notification);
34165
+ return ts_utils_1.Result.ok(dto);
34166
+ }
34167
+ };
34168
+ exports.SentNotificationUseCase = SentNotificationUseCase;
34169
+ exports.SentNotificationUseCase = SentNotificationUseCase = __decorate([
34170
+ __param(0, typescript_ioc_1.Inject),
34171
+ __param(1, typescript_ioc_1.Inject),
34172
+ __param(2, typescript_ioc_1.Inject),
34173
+ __metadata("design:paramtypes", [consumption_1.NotificationsController,
34174
+ transport_1.MessageController,
34175
+ Validator])
34176
+ ], SentNotificationUseCase);
34177
+ //# sourceMappingURL=SentNotification.js.map
34178
+
34179
+ /***/ }),
34180
+
34181
+ /***/ "./dist/useCases/consumption/notifications/index.js":
34182
+ /*!**********************************************************!*\
34183
+ !*** ./dist/useCases/consumption/notifications/index.js ***!
34184
+ \**********************************************************/
34185
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
34186
+
34187
+ "use strict";
34188
+
34189
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
34190
+ if (k2 === undefined) k2 = k;
34191
+ var desc = Object.getOwnPropertyDescriptor(m, k);
34192
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
34193
+ desc = { enumerable: true, get: function() { return m[k]; } };
34194
+ }
34195
+ Object.defineProperty(o, k2, desc);
34196
+ }) : (function(o, m, k, k2) {
34197
+ if (k2 === undefined) k2 = k;
34198
+ o[k2] = m[k];
34199
+ }));
34200
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
34201
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
34202
+ };
34203
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
34204
+ __exportStar(__webpack_require__(/*! ./GetNotification */ "./dist/useCases/consumption/notifications/GetNotification.js"), exports);
34205
+ __exportStar(__webpack_require__(/*! ./GetNotifications */ "./dist/useCases/consumption/notifications/GetNotifications.js"), exports);
34206
+ __exportStar(__webpack_require__(/*! ./ProcessNotificationById */ "./dist/useCases/consumption/notifications/ProcessNotificationById.js"), exports);
34207
+ __exportStar(__webpack_require__(/*! ./ProcessOpenNotifactionsReceivedByCurrentDevice */ "./dist/useCases/consumption/notifications/ProcessOpenNotifactionsReceivedByCurrentDevice.js"), exports);
34208
+ __exportStar(__webpack_require__(/*! ./ReceivedNotification */ "./dist/useCases/consumption/notifications/ReceivedNotification.js"), exports);
34209
+ __exportStar(__webpack_require__(/*! ./SentNotification */ "./dist/useCases/consumption/notifications/SentNotification.js"), exports);
34210
+ //# sourceMappingURL=index.js.map
34211
+
34212
+ /***/ }),
34213
+
33508
34214
  /***/ "./dist/useCases/consumption/requests/AcceptIncomingRequest.js":
33509
34215
  /*!*********************************************************************!*\
33510
34216
  !*** ./dist/useCases/consumption/requests/AcceptIncomingRequest.js ***!
@@ -37706,7 +38412,7 @@ let GetAttachmentMetadataUseCase = class GetAttachmentMetadataUseCase extends co
37706
38412
  }
37707
38413
  const file = await this.fileController.getFile(attachment);
37708
38414
  if (!file) {
37709
- return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(File));
38415
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(transport_1.File));
37710
38416
  }
37711
38417
  return ts_utils_1.Result.ok(FileMapper_1.FileMapper.toFileDTO(file));
37712
38418
  }