@nmshd/consumption 2.0.0-alpha.8 → 2.0.0-alpha.9

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 (36) hide show
  1. package/dist/buildInformation.js +4 -4
  2. package/dist/consumption/ConsumptionController.d.ts +1 -5
  3. package/dist/consumption/ConsumptionController.js +0 -8
  4. package/dist/consumption/ConsumptionController.js.map +1 -1
  5. package/dist/consumption/ConsumptionIds.d.ts +0 -3
  6. package/dist/consumption/ConsumptionIds.js +0 -3
  7. package/dist/consumption/ConsumptionIds.js.map +1 -1
  8. package/dist/modules/index.d.ts +0 -6
  9. package/dist/modules/index.js +0 -6
  10. package/dist/modules/index.js.map +1 -1
  11. package/lib-web/nmshd.consumption.js +4 -691
  12. package/lib-web/nmshd.consumption.js.map +1 -1
  13. package/lib-web/nmshd.consumption.min.js +1 -1
  14. package/lib-web/nmshd.consumption.min.js.map +1 -1
  15. package/package.json +1 -1
  16. package/dist/modules/relationships/RelationshipInfoController.d.ts +0 -15
  17. package/dist/modules/relationships/RelationshipInfoController.js +0 -61
  18. package/dist/modules/relationships/RelationshipInfoController.js.map +0 -1
  19. package/dist/modules/relationships/RelationshipInfoUtil.d.ts +0 -15
  20. package/dist/modules/relationships/RelationshipInfoUtil.js +0 -219
  21. package/dist/modules/relationships/RelationshipInfoUtil.js.map +0 -1
  22. package/dist/modules/relationships/local/RelationshipAttribute.d.ts +0 -14
  23. package/dist/modules/relationships/local/RelationshipAttribute.js +0 -40
  24. package/dist/modules/relationships/local/RelationshipAttribute.js.map +0 -1
  25. package/dist/modules/relationships/local/RelationshipInfo.d.ts +0 -27
  26. package/dist/modules/relationships/local/RelationshipInfo.js +0 -97
  27. package/dist/modules/relationships/local/RelationshipInfo.js.map +0 -1
  28. package/dist/modules/relationships/local/RelationshipTheme.d.ts +0 -14
  29. package/dist/modules/relationships/local/RelationshipTheme.js +0 -43
  30. package/dist/modules/relationships/local/RelationshipTheme.js.map +0 -1
  31. package/dist/modules/sharedItems/SharedItemsController.d.ts +0 -14
  32. package/dist/modules/sharedItems/SharedItemsController.js +0 -40
  33. package/dist/modules/sharedItems/SharedItemsController.js.map +0 -1
  34. package/dist/modules/sharedItems/local/SharedItem.d.ts +0 -31
  35. package/dist/modules/sharedItems/local/SharedItem.js +0 -100
  36. package/dist/modules/sharedItems/local/SharedItem.js.map +0 -1
@@ -17,10 +17,10 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
17
17
  const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
18
18
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
19
19
  exports.buildInformation = {
20
- version: "2.0.0-alpha.8",
21
- build: "26",
22
- date: "2022-05-05T12:20:20+00:00",
23
- commit: "c699fbc6fc9984848f31155fdf1713706bdfffe5",
20
+ version: "2.0.0-alpha.9",
21
+ build: "27",
22
+ date: "2022-05-09T15:04:46+00:00",
23
+ commit: "d91fff65600f42a4e813034e0a8ae618b60e2e52",
24
24
  dependencies: {},
25
25
  libraries: {
26
26
  transport: transport_1.buildInformation,
@@ -100,12 +100,6 @@ class ConsumptionController {
100
100
  get settings() {
101
101
  return this._settings;
102
102
  }
103
- get sharedItems() {
104
- return this._sharedItems;
105
- }
106
- get relationshipInfo() {
107
- return this._relationshipInfo;
108
- }
109
103
  async init(requestItemProcessors = []) {
110
104
  this._attributes = await new modules_1.ConsumptionAttributesController(this).init();
111
105
  this._drafts = await new modules_1.DraftsController(this).init();
@@ -113,8 +107,6 @@ class ConsumptionController {
113
107
  this._outgoingRequests = await new modules_1.OutgoingRequestsController(await this.accountController.getSynchronizedCollection("Requests"), processorRegistry, this).init();
114
108
  this._incomingRequests = await new IncomingRequestsController_1.IncomingRequestsController(await this.accountController.getSynchronizedCollection("Requests"), processorRegistry, this).init();
115
109
  this._settings = await new modules_1.SettingsController(this).init();
116
- this._sharedItems = await new modules_1.SharedItemsController(this).init();
117
- this._relationshipInfo = await new modules_1.RelationshipInfoController(this).init();
118
110
  return this;
119
111
  }
120
112
  }
@@ -210,9 +202,6 @@ class ConsumptionIds {
210
202
  exports.ConsumptionIds = ConsumptionIds;
211
203
  ConsumptionIds.attribute = new transport_1.CoreIdHelper("CNSATT");
212
204
  ConsumptionIds.draft = new transport_1.CoreIdHelper("CNSDRF");
213
- ConsumptionIds.relationshipInfo = new transport_1.CoreIdHelper("CNSRIN");
214
- ConsumptionIds.sharedItem = new transport_1.CoreIdHelper("CNSSIT");
215
- ConsumptionIds.response = new transport_1.CoreIdHelper("CNSRES");
216
205
  ConsumptionIds.request = new transport_1.CoreIdHelper("CNSREQ");
217
206
  ConsumptionIds.setting = new transport_1.CoreIdHelper("CNSSET");
218
207
  //# sourceMappingURL=ConsumptionIds.js.map
@@ -673,10 +662,6 @@ __exportStar(__webpack_require__(/*! ./attributes/ConsumptionAttributesControlle
673
662
  __exportStar(__webpack_require__(/*! ./attributes/local/ConsumptionAttribute */ "./dist/modules/attributes/local/ConsumptionAttribute.js"), exports);
674
663
  __exportStar(__webpack_require__(/*! ./drafts/DraftsController */ "./dist/modules/drafts/DraftsController.js"), exports);
675
664
  __exportStar(__webpack_require__(/*! ./drafts/local/Draft */ "./dist/modules/drafts/local/Draft.js"), exports);
676
- __exportStar(__webpack_require__(/*! ./relationships/local/RelationshipAttribute */ "./dist/modules/relationships/local/RelationshipAttribute.js"), exports);
677
- __exportStar(__webpack_require__(/*! ./relationships/local/RelationshipInfo */ "./dist/modules/relationships/local/RelationshipInfo.js"), exports);
678
- __exportStar(__webpack_require__(/*! ./relationships/local/RelationshipTheme */ "./dist/modules/relationships/local/RelationshipTheme.js"), exports);
679
- __exportStar(__webpack_require__(/*! ./relationships/RelationshipInfoController */ "./dist/modules/relationships/RelationshipInfoController.js"), exports);
680
665
  __exportStar(__webpack_require__(/*! ./requests/incoming/checkPrerequisites/CheckPrerequisitesOfIncomingRequestParameters */ "./dist/modules/requests/incoming/checkPrerequisites/CheckPrerequisitesOfIncomingRequestParameters.js"), exports);
681
666
  __exportStar(__webpack_require__(/*! ./requests/incoming/complete/CompleteIncomingRequestParameters */ "./dist/modules/requests/incoming/complete/CompleteIncomingRequestParameters.js"), exports);
682
667
  __exportStar(__webpack_require__(/*! ./requests/incoming/decide/AcceptRequestItemParameters */ "./dist/modules/requests/incoming/decide/AcceptRequestItemParameters.js"), exports);
@@ -704,524 +689,12 @@ __exportStar(__webpack_require__(/*! ./requests/outgoing/OutgoingRequestsControl
704
689
  __exportStar(__webpack_require__(/*! ./requests/outgoing/sentOutgoingRequest/SentOutgoingRequestParameters */ "./dist/modules/requests/outgoing/sentOutgoingRequest/SentOutgoingRequestParameters.js"), exports);
705
690
  __exportStar(__webpack_require__(/*! ./settings/local/Setting */ "./dist/modules/settings/local/Setting.js"), exports);
706
691
  __exportStar(__webpack_require__(/*! ./settings/SettingsController */ "./dist/modules/settings/SettingsController.js"), exports);
707
- __exportStar(__webpack_require__(/*! ./sharedItems/local/SharedItem */ "./dist/modules/sharedItems/local/SharedItem.js"), exports);
708
- __exportStar(__webpack_require__(/*! ./sharedItems/SharedItemsController */ "./dist/modules/sharedItems/SharedItemsController.js"), exports);
709
692
  __exportStar(__webpack_require__(/*! ./signatures/Signature */ "./dist/modules/signatures/Signature.js"), exports);
710
693
  __exportStar(__webpack_require__(/*! ./signatures/SignatureContent */ "./dist/modules/signatures/SignatureContent.js"), exports);
711
694
  //# sourceMappingURL=index.js.map
712
695
 
713
696
  /***/ }),
714
697
 
715
- /***/ "./dist/modules/relationships/RelationshipInfoController.js":
716
- /*!******************************************************************!*\
717
- !*** ./dist/modules/relationships/RelationshipInfoController.js ***!
718
- \******************************************************************/
719
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
720
-
721
- "use strict";
722
-
723
- Object.defineProperty(exports, "__esModule", ({ value: true }));
724
- exports.RelationshipInfoController = void 0;
725
- const consumption_1 = __webpack_require__(/*! ../../consumption */ "./dist/consumption/index.js");
726
- const RelationshipInfo_1 = __webpack_require__(/*! ./local/RelationshipInfo */ "./dist/modules/relationships/local/RelationshipInfo.js");
727
- const RelationshipInfoUtil_1 = __webpack_require__(/*! ./RelationshipInfoUtil */ "./dist/modules/relationships/RelationshipInfoUtil.js");
728
- class RelationshipInfoController extends consumption_1.ConsumptionBaseController {
729
- constructor(parent) {
730
- super(consumption_1.ConsumptionControllerName.RelationshipInfoController, parent);
731
- }
732
- async init() {
733
- await super.init();
734
- this.relationshipInfo = await this.parent.accountController.getSynchronizedCollection("RelationshipInfo");
735
- return this;
736
- }
737
- async getRelationshipInfo(id) {
738
- const result = await this.relationshipInfo.read(id.toString());
739
- return result ? RelationshipInfo_1.RelationshipInfo.from(result) : undefined;
740
- }
741
- async getRelationshipInfoByRelationship(relationshipId) {
742
- const info = await new RelationshipInfoUtil_1.RelationshipInfoUtil(this.parent).createInitialRelationshipInfo(relationshipId);
743
- return info;
744
- /*
745
- // So far, do not store the relationshipInfo, as they wouldn't be updated correctly
746
-
747
- const result = await this.relationshipInfo.findOne({ relationshipId: relationshipId.toString() })
748
-
749
- if (result) {
750
- return await RelationshipInfo.from(result)
751
- }
752
-
753
- const info = await new RelationshipInfoUtil(this.parent).createInitialRelationshipInfo(relationshipId)
754
- await this.relationshipInfo.create(info)
755
- return info
756
- */
757
- }
758
- async getRelationshipInfos(query) {
759
- const items = await this.relationshipInfo.find(query);
760
- return await this.parseArray(items, RelationshipInfo_1.RelationshipInfo);
761
- }
762
- async createRelationshipInfo(relationshipInfo) {
763
- const exists = await this.relationshipInfo.exists({ relationshipId: relationshipInfo.relationshipId });
764
- if (exists) {
765
- throw consumption_1.ConsumptionErrors.relationshipInfo.relationshipInfoExists(relationshipInfo.relationshipId.toString());
766
- }
767
- await this.relationshipInfo.create(relationshipInfo);
768
- return relationshipInfo;
769
- }
770
- async updateRelationshipInfo(relationshipInfo) {
771
- const oldRelationshipInfo = await this.relationshipInfo.read(relationshipInfo.id.toString());
772
- if (!oldRelationshipInfo) {
773
- throw new Error("RelationshipInfo Not Found");
774
- }
775
- await this.relationshipInfo.update(oldRelationshipInfo, relationshipInfo);
776
- }
777
- async deleteRelationshipInfo(relationshipInfo) {
778
- await this.relationshipInfo.delete(relationshipInfo);
779
- }
780
- }
781
- exports.RelationshipInfoController = RelationshipInfoController;
782
- //# sourceMappingURL=RelationshipInfoController.js.map
783
-
784
- /***/ }),
785
-
786
- /***/ "./dist/modules/relationships/RelationshipInfoUtil.js":
787
- /*!************************************************************!*\
788
- !*** ./dist/modules/relationships/RelationshipInfoUtil.js ***!
789
- \************************************************************/
790
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
791
-
792
- "use strict";
793
-
794
- Object.defineProperty(exports, "__esModule", ({ value: true }));
795
- exports.RelationshipInfoUtil = void 0;
796
- const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
797
- const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
798
- const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
799
- const consumption_1 = __webpack_require__(/*! ../../consumption */ "./dist/consumption/index.js");
800
- const SharedItem_1 = __webpack_require__(/*! ../sharedItems/local/SharedItem */ "./dist/modules/sharedItems/local/SharedItem.js");
801
- const RelationshipAttribute_1 = __webpack_require__(/*! ./local/RelationshipAttribute */ "./dist/modules/relationships/local/RelationshipAttribute.js");
802
- const RelationshipInfo_1 = __webpack_require__(/*! ./local/RelationshipInfo */ "./dist/modules/relationships/local/RelationshipInfo.js");
803
- class RelationshipInfoUtil {
804
- constructor(parent) {
805
- this.parent = parent;
806
- this._log = transport_1.TransportLoggerFactory.getLogger(RelationshipInfoUtil);
807
- }
808
- get log() {
809
- return this._log;
810
- }
811
- async createInitialRelationshipInfo(id) {
812
- const relationship = await this.parent.accountController.relationships.getRelationship(id);
813
- if (!relationship) {
814
- throw transport_1.TransportErrors.general.recordNotFound(transport_1.Relationship, id.toString()).logWith(this._log);
815
- }
816
- await this.parseTemplateBody(relationship);
817
- await this.parseCreationRequest(relationship);
818
- return await this.createRelationshipInfo(relationship);
819
- }
820
- getTitle(relationship, attributeMap) {
821
- let title = relationship.peer.address.toString().substring(3, 9);
822
- const thingName = attributeMap.get("Thing.name")?.content.value;
823
- const givenName = attributeMap.get("Person.givenName")?.content.value;
824
- const familyName = attributeMap.get("Person.familyName")?.content.value;
825
- const gender = attributeMap.get("Person.gender")?.content.value;
826
- const orgname = attributeMap.get("Organization.name")?.content.value;
827
- const legalName = attributeMap.get("Organization.legalname")?.content.value;
828
- if (thingName) {
829
- title = thingName;
830
- }
831
- else if (givenName && familyName) {
832
- title = `${givenName} ${familyName}`;
833
- }
834
- else if (givenName) {
835
- title = givenName;
836
- }
837
- else if (familyName && gender) {
838
- title = `i18n://salutation.gender.${gender} ${familyName}`;
839
- }
840
- else if (orgname) {
841
- title = orgname;
842
- }
843
- else if (legalName) {
844
- title = legalName;
845
- }
846
- return title;
847
- }
848
- async createRelationshipInfo(relationship) {
849
- const peerAddress = relationship.peer.address;
850
- const truncatedAddress = peerAddress.address.substring(3, 9);
851
- const info = RelationshipInfo_1.RelationshipInfo.from({
852
- attributes: [],
853
- id: await consumption_1.ConsumptionIds.relationshipInfo.generate(),
854
- isPinned: false,
855
- relationshipId: relationship.id,
856
- title: truncatedAddress
857
- });
858
- // info = await this.parent.relationshipInfo.createRelationshipInfo(info)
859
- const items = await this.parent.sharedItems.getSharedItems({
860
- sharedBy: relationship.peer.address.toString()
861
- });
862
- const attributes = [];
863
- const attributeMap = new Map();
864
- for (const item of items) {
865
- if (item.content instanceof content_1.Attribute) {
866
- const relAttr = RelationshipAttribute_1.RelationshipAttribute.from({
867
- name: item.content.name,
868
- sharedItem: item.id,
869
- content: item.content
870
- });
871
- attributes.push(relAttr);
872
- attributeMap.set(relAttr.name, relAttr);
873
- }
874
- }
875
- info.attributes = attributes;
876
- const title = this.getTitle(relationship, attributeMap);
877
- info.title = title;
878
- // await this.parent.relationshipInfo.updateRelationshipInfo(info)
879
- return info;
880
- }
881
- async parseTemplateBody(relationship) {
882
- const template = relationship.cache.template;
883
- if (!template.cache) {
884
- throw transport_1.TransportErrors.general.cacheEmpty(transport_1.RelationshipTemplate, template.id.toString()).logWith(this._log);
885
- }
886
- const body = template.cache.content;
887
- const isTemplator = this.parent.accountController.identity.isMe(template.cache.createdBy);
888
- const sharedAt = template.cache.createdAt;
889
- const sharedBy = isTemplator ? this.parent.accountController.identity.address : relationship.peer.address;
890
- const sharedWith = isTemplator ? relationship.peer.address : this.parent.accountController.identity.address;
891
- const sharedItemsWithSameReference = await this.parent.sharedItems.getSharedItems({
892
- reference: template.id.toString()
893
- });
894
- const missingItems = [];
895
- if (body instanceof content_1.RelationshipTemplateBody) {
896
- const attributes = body.sharedAttributes;
897
- if (attributes) {
898
- if (sharedItemsWithSameReference.length !== attributes.length) {
899
- attributes.forEach((attribute) => {
900
- if (!sharedItemsWithSameReference.find(function (item) {
901
- const content = item.content;
902
- return content.name === attribute.name;
903
- })) {
904
- missingItems.push(attribute);
905
- }
906
- });
907
- }
908
- }
909
- }
910
- else {
911
- // Try to parse the old template format (without types)
912
- let oldTemplateBody = body;
913
- if (body instanceof ts_serval_1.JSONWrapper) {
914
- oldTemplateBody = oldTemplateBody.value;
915
- }
916
- if (oldTemplateBody?.attributes && Array.isArray(oldTemplateBody.attributes)) {
917
- if (sharedItemsWithSameReference.length !== oldTemplateBody.attributes.length) {
918
- oldTemplateBody.attributes.forEach((attribute) => {
919
- if (!sharedItemsWithSameReference.find(function (item) {
920
- const content = item.content;
921
- return content.name === attribute.name;
922
- })) {
923
- missingItems.push(content_1.Attribute.from({
924
- name: attribute.name,
925
- value: attribute.value
926
- }));
927
- }
928
- });
929
- }
930
- }
931
- }
932
- for (const attribute of missingItems) {
933
- const sharedItem = SharedItem_1.SharedItem.from({
934
- id: await consumption_1.ConsumptionIds.sharedItem.generate(),
935
- content: attribute,
936
- sharedAt: sharedAt,
937
- sharedBy: sharedBy,
938
- sharedWith: sharedWith,
939
- reference: template.id,
940
- expiresAt: attribute.validTo
941
- });
942
- await this.parent.sharedItems.createSharedItem(sharedItem);
943
- }
944
- }
945
- async parseCreationRequest(relationship) {
946
- const change = relationship.cache.creationChange;
947
- const request = change.request;
948
- const body = request.content;
949
- const isRequestor = this.parent.accountController.identity.isMe(request.createdBy);
950
- const sharedAt = request.createdAt;
951
- const sharedBy = isRequestor ? this.parent.accountController.identity.address : relationship.peer.address;
952
- const sharedWith = isRequestor ? relationship.peer.address : this.parent.accountController.identity.address;
953
- const sharedItemsWithSameReference = await this.parent.sharedItems.getSharedItems({
954
- reference: change.id.toString()
955
- });
956
- const missingItems = [];
957
- if (body instanceof content_1.RelationshipCreationChangeRequestBody) {
958
- const attributes = body.sharedAttributes;
959
- if (attributes && attributes.length > 0) {
960
- if (sharedItemsWithSameReference.length !== attributes.length) {
961
- attributes.forEach((attribute) => {
962
- if (!sharedItemsWithSameReference.find(function (item) {
963
- const content = item.content;
964
- return content.name === attribute.name;
965
- })) {
966
- missingItems.push(attribute);
967
- }
968
- });
969
- }
970
- }
971
- }
972
- else {
973
- // Try to parse the old request format (without types)
974
- let oldRequestBody = body;
975
- if (body instanceof ts_serval_1.JSONWrapper) {
976
- oldRequestBody = oldRequestBody.value;
977
- }
978
- if (oldRequestBody?.attributes) {
979
- const keys = Object.keys(oldRequestBody.attributes);
980
- if (sharedItemsWithSameReference.length !== keys.length) {
981
- keys.forEach((key) => {
982
- const attribute = oldRequestBody.attributes[key];
983
- if (!sharedItemsWithSameReference.find(function (item) {
984
- const content = item.content;
985
- return content.name === attribute.name;
986
- })) {
987
- missingItems.push(content_1.Attribute.from({
988
- name: attribute.name,
989
- value: attribute.value
990
- }));
991
- }
992
- });
993
- }
994
- }
995
- }
996
- for (const attribute of missingItems) {
997
- const sharedItem = SharedItem_1.SharedItem.from({
998
- id: await consumption_1.ConsumptionIds.sharedItem.generate(),
999
- content: attribute,
1000
- sharedAt: sharedAt,
1001
- sharedBy: sharedBy,
1002
- sharedWith: sharedWith,
1003
- reference: change.id,
1004
- expiresAt: attribute.validTo
1005
- });
1006
- await this.parent.sharedItems.createSharedItem(sharedItem);
1007
- }
1008
- }
1009
- }
1010
- exports.RelationshipInfoUtil = RelationshipInfoUtil;
1011
- //# sourceMappingURL=RelationshipInfoUtil.js.map
1012
-
1013
- /***/ }),
1014
-
1015
- /***/ "./dist/modules/relationships/local/RelationshipAttribute.js":
1016
- /*!*******************************************************************!*\
1017
- !*** ./dist/modules/relationships/local/RelationshipAttribute.js ***!
1018
- \*******************************************************************/
1019
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1020
-
1021
- "use strict";
1022
-
1023
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
1024
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1025
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1026
- 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;
1027
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1028
- };
1029
- var __metadata = (this && this.__metadata) || function (k, v) {
1030
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
1031
- };
1032
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1033
- exports.RelationshipAttribute = void 0;
1034
- const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
1035
- const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
1036
- const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
1037
- let RelationshipAttribute = class RelationshipAttribute extends ts_serval_1.Serializable {
1038
- static from(value) {
1039
- return this.fromAny(value);
1040
- }
1041
- };
1042
- __decorate([
1043
- (0, ts_serval_1.validate)(),
1044
- (0, ts_serval_1.serialize)(),
1045
- __metadata("design:type", String)
1046
- ], RelationshipAttribute.prototype, "name", void 0);
1047
- __decorate([
1048
- (0, ts_serval_1.validate)(),
1049
- (0, ts_serval_1.serialize)(),
1050
- __metadata("design:type", content_1.Attribute)
1051
- ], RelationshipAttribute.prototype, "content", void 0);
1052
- __decorate([
1053
- (0, ts_serval_1.validate)(),
1054
- (0, ts_serval_1.serialize)(),
1055
- __metadata("design:type", transport_1.CoreId)
1056
- ], RelationshipAttribute.prototype, "sharedItem", void 0);
1057
- RelationshipAttribute = __decorate([
1058
- (0, ts_serval_1.type)("RelationshipAttribute")
1059
- ], RelationshipAttribute);
1060
- exports.RelationshipAttribute = RelationshipAttribute;
1061
- //# sourceMappingURL=RelationshipAttribute.js.map
1062
-
1063
- /***/ }),
1064
-
1065
- /***/ "./dist/modules/relationships/local/RelationshipInfo.js":
1066
- /*!**************************************************************!*\
1067
- !*** ./dist/modules/relationships/local/RelationshipInfo.js ***!
1068
- \**************************************************************/
1069
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1070
-
1071
- "use strict";
1072
-
1073
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
1074
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1075
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1076
- 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;
1077
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1078
- };
1079
- var __metadata = (this && this.__metadata) || function (k, v) {
1080
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
1081
- };
1082
- var RelationshipInfo_1;
1083
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1084
- exports.RelationshipInfo = void 0;
1085
- const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
1086
- const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
1087
- const ts_simple_nameof_1 = __webpack_require__(/*! ts-simple-nameof */ "./node_modules/ts-simple-nameof/index.js");
1088
- const consumption_1 = __webpack_require__(/*! ../../../consumption */ "./dist/consumption/index.js");
1089
- const RelationshipAttribute_1 = __webpack_require__(/*! ./RelationshipAttribute */ "./dist/modules/relationships/local/RelationshipAttribute.js");
1090
- const RelationshipTheme_1 = __webpack_require__(/*! ./RelationshipTheme */ "./dist/modules/relationships/local/RelationshipTheme.js");
1091
- let RelationshipInfo = RelationshipInfo_1 = class RelationshipInfo extends transport_1.CoreSynchronizable {
1092
- constructor() {
1093
- super(...arguments);
1094
- this.technicalProperties = [
1095
- "@type",
1096
- "@context",
1097
- (0, ts_simple_nameof_1.nameof)((r) => r.relationshipId),
1098
- (0, ts_simple_nameof_1.nameof)((r) => r.title),
1099
- (0, ts_simple_nameof_1.nameof)((r) => r.description),
1100
- (0, ts_simple_nameof_1.nameof)((r) => r.theme)
1101
- ];
1102
- this.userdataProperties = [
1103
- (0, ts_simple_nameof_1.nameof)((r) => r.isPinned),
1104
- (0, ts_simple_nameof_1.nameof)((r) => r.userTitle),
1105
- (0, ts_simple_nameof_1.nameof)((r) => r.userDescription)
1106
- ];
1107
- }
1108
- static async fromRelationship(relationship) {
1109
- if (typeof relationship.metadata === "undefined") {
1110
- return RelationshipInfo_1.from({
1111
- id: await consumption_1.ConsumptionIds.relationshipInfo.generate(),
1112
- relationshipId: relationship.id,
1113
- attributes: [],
1114
- isPinned: false,
1115
- title: relationship.peer.address.address.substring(3, 9)
1116
- });
1117
- }
1118
- return RelationshipInfo_1.from(relationship.metadata);
1119
- }
1120
- static from(value) {
1121
- return this.fromAny(value);
1122
- }
1123
- };
1124
- __decorate([
1125
- (0, ts_serval_1.validate)(),
1126
- (0, ts_serval_1.serialize)(),
1127
- __metadata("design:type", transport_1.CoreId)
1128
- ], RelationshipInfo.prototype, "relationshipId", void 0);
1129
- __decorate([
1130
- (0, ts_serval_1.validate)(),
1131
- (0, ts_serval_1.serialize)({ type: RelationshipAttribute_1.RelationshipAttribute }),
1132
- __metadata("design:type", Array)
1133
- ], RelationshipInfo.prototype, "attributes", void 0);
1134
- __decorate([
1135
- (0, ts_serval_1.validate)(),
1136
- (0, ts_serval_1.serialize)(),
1137
- __metadata("design:type", Boolean)
1138
- ], RelationshipInfo.prototype, "isPinned", void 0);
1139
- __decorate([
1140
- (0, ts_serval_1.validate)({ nullable: true }),
1141
- (0, ts_serval_1.serialize)(),
1142
- __metadata("design:type", String)
1143
- ], RelationshipInfo.prototype, "userTitle", void 0);
1144
- __decorate([
1145
- (0, ts_serval_1.validate)(),
1146
- (0, ts_serval_1.serialize)(),
1147
- __metadata("design:type", String)
1148
- ], RelationshipInfo.prototype, "title", void 0);
1149
- __decorate([
1150
- (0, ts_serval_1.validate)({ nullable: true }),
1151
- (0, ts_serval_1.serialize)(),
1152
- __metadata("design:type", String)
1153
- ], RelationshipInfo.prototype, "userDescription", void 0);
1154
- __decorate([
1155
- (0, ts_serval_1.validate)({ nullable: true }),
1156
- (0, ts_serval_1.serialize)(),
1157
- __metadata("design:type", String)
1158
- ], RelationshipInfo.prototype, "description", void 0);
1159
- __decorate([
1160
- (0, ts_serval_1.validate)({ nullable: true }),
1161
- (0, ts_serval_1.serialize)(),
1162
- __metadata("design:type", RelationshipTheme_1.RelationshipTheme)
1163
- ], RelationshipInfo.prototype, "theme", void 0);
1164
- RelationshipInfo = RelationshipInfo_1 = __decorate([
1165
- (0, ts_serval_1.type)("RelationshipInfo")
1166
- ], RelationshipInfo);
1167
- exports.RelationshipInfo = RelationshipInfo;
1168
- //# sourceMappingURL=RelationshipInfo.js.map
1169
-
1170
- /***/ }),
1171
-
1172
- /***/ "./dist/modules/relationships/local/RelationshipTheme.js":
1173
- /*!***************************************************************!*\
1174
- !*** ./dist/modules/relationships/local/RelationshipTheme.js ***!
1175
- \***************************************************************/
1176
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1177
-
1178
- "use strict";
1179
-
1180
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
1181
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1182
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1183
- 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;
1184
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1185
- };
1186
- var __metadata = (this && this.__metadata) || function (k, v) {
1187
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
1188
- };
1189
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1190
- exports.RelationshipTheme = void 0;
1191
- const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
1192
- let RelationshipTheme = class RelationshipTheme extends ts_serval_1.Serializable {
1193
- static from(value) {
1194
- return this.fromAny(value);
1195
- }
1196
- };
1197
- __decorate([
1198
- (0, ts_serval_1.validate)(),
1199
- (0, ts_serval_1.serialize)(),
1200
- __metadata("design:type", String)
1201
- ], RelationshipTheme.prototype, "image", void 0);
1202
- __decorate([
1203
- (0, ts_serval_1.validate)(),
1204
- (0, ts_serval_1.serialize)(),
1205
- __metadata("design:type", String)
1206
- ], RelationshipTheme.prototype, "imageBar", void 0);
1207
- __decorate([
1208
- (0, ts_serval_1.validate)(),
1209
- (0, ts_serval_1.serialize)(),
1210
- __metadata("design:type", String)
1211
- ], RelationshipTheme.prototype, "backgroundColor", void 0);
1212
- __decorate([
1213
- (0, ts_serval_1.validate)(),
1214
- (0, ts_serval_1.serialize)(),
1215
- __metadata("design:type", String)
1216
- ], RelationshipTheme.prototype, "foregroundColor", void 0);
1217
- RelationshipTheme = __decorate([
1218
- (0, ts_serval_1.type)("RelationshipTheme")
1219
- ], RelationshipTheme);
1220
- exports.RelationshipTheme = RelationshipTheme;
1221
- //# sourceMappingURL=RelationshipTheme.js.map
1222
-
1223
- /***/ }),
1224
-
1225
698
  /***/ "./dist/modules/requests/incoming/DecideRequestParametersValidator.js":
1226
699
  /*!****************************************************************************!*\
1227
700
  !*** ./dist/modules/requests/incoming/DecideRequestParametersValidator.js ***!
@@ -2896,166 +2369,6 @@ exports.Setting = Setting;
2896
2369
 
2897
2370
  /***/ }),
2898
2371
 
2899
- /***/ "./dist/modules/sharedItems/SharedItemsController.js":
2900
- /*!***********************************************************!*\
2901
- !*** ./dist/modules/sharedItems/SharedItemsController.js ***!
2902
- \***********************************************************/
2903
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2904
-
2905
- "use strict";
2906
-
2907
- Object.defineProperty(exports, "__esModule", ({ value: true }));
2908
- exports.SharedItemsController = void 0;
2909
- const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
2910
- const consumption_1 = __webpack_require__(/*! ../../consumption */ "./dist/consumption/index.js");
2911
- const SharedItem_1 = __webpack_require__(/*! ./local/SharedItem */ "./dist/modules/sharedItems/local/SharedItem.js");
2912
- class SharedItemsController extends consumption_1.ConsumptionBaseController {
2913
- constructor(parent) {
2914
- super(consumption_1.ConsumptionControllerName.SharedItemsController, parent);
2915
- }
2916
- async init() {
2917
- await super.init();
2918
- this.sharedItems = await this.parent.accountController.getSynchronizedCollection("SharedItems");
2919
- return this;
2920
- }
2921
- async getSharedItem(id) {
2922
- const result = await this.sharedItems.read(id.toString());
2923
- return result ? SharedItem_1.SharedItem.from(result) : undefined;
2924
- }
2925
- async getSharedItems(query) {
2926
- const items = await this.sharedItems.find(query);
2927
- return await this.parseArray(items, SharedItem_1.SharedItem);
2928
- }
2929
- async createSharedItem(sharedItem) {
2930
- await this.sharedItems.create(sharedItem);
2931
- return sharedItem;
2932
- }
2933
- async updateSharedItem(sharedItem) {
2934
- const oldSharedItem = await this.sharedItems.read(sharedItem.id.toString());
2935
- if (!oldSharedItem) {
2936
- throw transport_1.TransportErrors.general.recordNotFound(SharedItem_1.SharedItem, sharedItem.id.toString());
2937
- }
2938
- return await this.sharedItems.update(oldSharedItem, sharedItem);
2939
- }
2940
- async deleteSharedItem(sharedItem) {
2941
- await this.sharedItems.delete(sharedItem);
2942
- }
2943
- }
2944
- exports.SharedItemsController = SharedItemsController;
2945
- //# sourceMappingURL=SharedItemsController.js.map
2946
-
2947
- /***/ }),
2948
-
2949
- /***/ "./dist/modules/sharedItems/local/SharedItem.js":
2950
- /*!******************************************************!*\
2951
- !*** ./dist/modules/sharedItems/local/SharedItem.js ***!
2952
- \******************************************************/
2953
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2954
-
2955
- "use strict";
2956
-
2957
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2958
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2959
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2960
- 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;
2961
- return c > 3 && r && Object.defineProperty(target, key, r), r;
2962
- };
2963
- var __metadata = (this && this.__metadata) || function (k, v) {
2964
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
2965
- };
2966
- Object.defineProperty(exports, "__esModule", ({ value: true }));
2967
- exports.SharedItem = void 0;
2968
- const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
2969
- const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
2970
- const ts_simple_nameof_1 = __webpack_require__(/*! ts-simple-nameof */ "./node_modules/ts-simple-nameof/index.js");
2971
- let SharedItem = class SharedItem extends transport_1.CoreSynchronizable {
2972
- constructor() {
2973
- super(...arguments);
2974
- this.technicalProperties = [
2975
- "@type",
2976
- "@context",
2977
- (0, ts_simple_nameof_1.nameof)((r) => r.tags),
2978
- (0, ts_simple_nameof_1.nameof)((r) => r.sharedBy),
2979
- (0, ts_simple_nameof_1.nameof)((r) => r.sharedWith),
2980
- (0, ts_simple_nameof_1.nameof)((r) => r.sharedAt),
2981
- (0, ts_simple_nameof_1.nameof)((r) => r.reference),
2982
- (0, ts_simple_nameof_1.nameof)((r) => r.content),
2983
- (0, ts_simple_nameof_1.nameof)((r) => r.succeedsItem),
2984
- (0, ts_simple_nameof_1.nameof)((r) => r.succeedsAt),
2985
- (0, ts_simple_nameof_1.nameof)((r) => r.expiresAt)
2986
- ];
2987
- this.metadataProperties = [
2988
- (0, ts_simple_nameof_1.nameof)((r) => r.metadata),
2989
- (0, ts_simple_nameof_1.nameof)((r) => r.metadataModifiedAt)
2990
- ];
2991
- }
2992
- static from(value) {
2993
- return this.fromAny(value);
2994
- }
2995
- };
2996
- __decorate([
2997
- (0, ts_serval_1.validate)({ nullable: true }),
2998
- (0, ts_serval_1.serialize)({ type: String }),
2999
- __metadata("design:type", Array)
3000
- ], SharedItem.prototype, "tags", void 0);
3001
- __decorate([
3002
- (0, ts_serval_1.validate)(),
3003
- (0, ts_serval_1.serialize)(),
3004
- __metadata("design:type", transport_1.CoreAddress)
3005
- ], SharedItem.prototype, "sharedBy", void 0);
3006
- __decorate([
3007
- (0, ts_serval_1.validate)(),
3008
- (0, ts_serval_1.serialize)(),
3009
- __metadata("design:type", transport_1.CoreAddress)
3010
- ], SharedItem.prototype, "sharedWith", void 0);
3011
- __decorate([
3012
- (0, ts_serval_1.validate)(),
3013
- (0, ts_serval_1.serialize)(),
3014
- __metadata("design:type", transport_1.CoreDate)
3015
- ], SharedItem.prototype, "sharedAt", void 0);
3016
- __decorate([
3017
- (0, ts_serval_1.validate)({ nullable: true }),
3018
- (0, ts_serval_1.serialize)(),
3019
- __metadata("design:type", transport_1.CoreId)
3020
- ], SharedItem.prototype, "reference", void 0);
3021
- __decorate([
3022
- (0, ts_serval_1.validate)(),
3023
- (0, ts_serval_1.serialize)(),
3024
- __metadata("design:type", ts_serval_1.Serializable)
3025
- ], SharedItem.prototype, "content", void 0);
3026
- __decorate([
3027
- (0, ts_serval_1.validate)({ nullable: true }),
3028
- (0, ts_serval_1.serialize)(),
3029
- __metadata("design:type", transport_1.CoreId)
3030
- ], SharedItem.prototype, "succeedsItem", void 0);
3031
- __decorate([
3032
- (0, ts_serval_1.validate)({ nullable: true }),
3033
- (0, ts_serval_1.serialize)(),
3034
- __metadata("design:type", transport_1.CoreDate)
3035
- ], SharedItem.prototype, "succeedsAt", void 0);
3036
- __decorate([
3037
- (0, ts_serval_1.validate)({ nullable: true }),
3038
- (0, ts_serval_1.serialize)(),
3039
- __metadata("design:type", transport_1.CoreDate)
3040
- ], SharedItem.prototype, "expiresAt", void 0);
3041
- __decorate([
3042
- (0, ts_serval_1.validate)({ nullable: true }),
3043
- (0, ts_serval_1.serialize)({ any: true }),
3044
- __metadata("design:type", Object)
3045
- ], SharedItem.prototype, "metadata", void 0);
3046
- __decorate([
3047
- (0, ts_serval_1.validate)({ nullable: true }),
3048
- (0, ts_serval_1.serialize)(),
3049
- __metadata("design:type", transport_1.CoreDate)
3050
- ], SharedItem.prototype, "metadataModifiedAt", void 0);
3051
- SharedItem = __decorate([
3052
- (0, ts_serval_1.type)("SharedItem")
3053
- ], SharedItem);
3054
- exports.SharedItem = SharedItem;
3055
- //# sourceMappingURL=SharedItem.js.map
3056
-
3057
- /***/ }),
3058
-
3059
2372
  /***/ "./dist/modules/signatures/Signature.js":
3060
2373
  /*!**********************************************!*\
3061
2374
  !*** ./dist/modules/signatures/Signature.js ***!