@nmshd/consumption 2.0.0-alpha.6 → 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 (46) hide show
  1. package/dist/buildInformation.js +4 -4
  2. package/dist/consumption/ConsumptionBaseController.d.ts +1 -1
  3. package/dist/consumption/ConsumptionController.d.ts +1 -5
  4. package/dist/consumption/ConsumptionController.js +2 -10
  5. package/dist/consumption/ConsumptionController.js.map +1 -1
  6. package/dist/consumption/ConsumptionIds.d.ts +0 -3
  7. package/dist/consumption/ConsumptionIds.js +0 -3
  8. package/dist/consumption/ConsumptionIds.js.map +1 -1
  9. package/dist/modules/attributes/ConsumptionAttributesController.d.ts +1 -1
  10. package/dist/modules/drafts/DraftsController.d.ts +1 -1
  11. package/dist/modules/index.d.ts +0 -6
  12. package/dist/modules/index.js +0 -6
  13. package/dist/modules/index.js.map +1 -1
  14. package/dist/modules/requests/incoming/IncomingRequestsController.d.ts +6 -6
  15. package/dist/modules/requests/incoming/IncomingRequestsController.js +13 -10
  16. package/dist/modules/requests/incoming/IncomingRequestsController.js.map +1 -1
  17. package/dist/modules/requests/outgoing/OutgoingRequestsController.d.ts +6 -6
  18. package/dist/modules/requests/outgoing/OutgoingRequestsController.js +11 -8
  19. package/dist/modules/requests/outgoing/OutgoingRequestsController.js.map +1 -1
  20. package/dist/modules/settings/SettingsController.d.ts +1 -1
  21. package/lib-web/nmshd.consumption.js +30 -711
  22. package/lib-web/nmshd.consumption.js.map +1 -1
  23. package/lib-web/nmshd.consumption.min.js +1 -1
  24. package/lib-web/nmshd.consumption.min.js.map +1 -1
  25. package/package.json +1 -1
  26. package/dist/modules/relationships/RelationshipInfoController.d.ts +0 -15
  27. package/dist/modules/relationships/RelationshipInfoController.js +0 -61
  28. package/dist/modules/relationships/RelationshipInfoController.js.map +0 -1
  29. package/dist/modules/relationships/RelationshipInfoUtil.d.ts +0 -15
  30. package/dist/modules/relationships/RelationshipInfoUtil.js +0 -219
  31. package/dist/modules/relationships/RelationshipInfoUtil.js.map +0 -1
  32. package/dist/modules/relationships/local/RelationshipAttribute.d.ts +0 -14
  33. package/dist/modules/relationships/local/RelationshipAttribute.js +0 -40
  34. package/dist/modules/relationships/local/RelationshipAttribute.js.map +0 -1
  35. package/dist/modules/relationships/local/RelationshipInfo.d.ts +0 -27
  36. package/dist/modules/relationships/local/RelationshipInfo.js +0 -97
  37. package/dist/modules/relationships/local/RelationshipInfo.js.map +0 -1
  38. package/dist/modules/relationships/local/RelationshipTheme.d.ts +0 -14
  39. package/dist/modules/relationships/local/RelationshipTheme.js +0 -43
  40. package/dist/modules/relationships/local/RelationshipTheme.js.map +0 -1
  41. package/dist/modules/sharedItems/SharedItemsController.d.ts +0 -14
  42. package/dist/modules/sharedItems/SharedItemsController.js +0 -40
  43. package/dist/modules/sharedItems/SharedItemsController.js.map +0 -1
  44. package/dist/modules/sharedItems/local/SharedItem.d.ts +0 -31
  45. package/dist/modules/sharedItems/local/SharedItem.js +0 -100
  46. package/dist/modules/sharedItems/local/SharedItem.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nmshd/consumption",
3
- "version": "2.0.0-alpha.6",
3
+ "version": "2.0.0-alpha.9",
4
4
  "description": "The consumption library extends the transport library.",
5
5
  "homepage": "https://enmeshed.eu",
6
6
  "repository": "github:nmshd/cns-consumption",
@@ -1,15 +0,0 @@
1
- import { CoreId } from "@nmshd/transport";
2
- import { ConsumptionBaseController } from "../../consumption";
3
- import { ConsumptionController } from "../../consumption/ConsumptionController";
4
- import { RelationshipInfo } from "./local/RelationshipInfo";
5
- export declare class RelationshipInfoController extends ConsumptionBaseController {
6
- private relationshipInfo;
7
- constructor(parent: ConsumptionController);
8
- init(): Promise<RelationshipInfoController>;
9
- getRelationshipInfo(id: CoreId): Promise<RelationshipInfo | undefined>;
10
- getRelationshipInfoByRelationship(relationshipId: CoreId): Promise<RelationshipInfo | undefined>;
11
- getRelationshipInfos(query?: any): Promise<RelationshipInfo[]>;
12
- createRelationshipInfo(relationshipInfo: RelationshipInfo): Promise<RelationshipInfo>;
13
- updateRelationshipInfo(relationshipInfo: RelationshipInfo): Promise<void>;
14
- deleteRelationshipInfo(relationshipInfo: RelationshipInfo): Promise<void>;
15
- }
@@ -1,61 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RelationshipInfoController = void 0;
4
- const consumption_1 = require("../../consumption");
5
- const RelationshipInfo_1 = require("./local/RelationshipInfo");
6
- const RelationshipInfoUtil_1 = require("./RelationshipInfoUtil");
7
- class RelationshipInfoController extends consumption_1.ConsumptionBaseController {
8
- constructor(parent) {
9
- super(consumption_1.ConsumptionControllerName.RelationshipInfoController, parent);
10
- }
11
- async init() {
12
- await super.init();
13
- this.relationshipInfo = await this.parent.accountController.getSynchronizedCollection("RelationshipInfo");
14
- return this;
15
- }
16
- async getRelationshipInfo(id) {
17
- const result = await this.relationshipInfo.read(id.toString());
18
- return result ? RelationshipInfo_1.RelationshipInfo.from(result) : undefined;
19
- }
20
- async getRelationshipInfoByRelationship(relationshipId) {
21
- const info = await new RelationshipInfoUtil_1.RelationshipInfoUtil(this.parent).createInitialRelationshipInfo(relationshipId);
22
- return info;
23
- /*
24
- // So far, do not store the relationshipInfo, as they wouldn't be updated correctly
25
-
26
- const result = await this.relationshipInfo.findOne({ relationshipId: relationshipId.toString() })
27
-
28
- if (result) {
29
- return await RelationshipInfo.from(result)
30
- }
31
-
32
- const info = await new RelationshipInfoUtil(this.parent).createInitialRelationshipInfo(relationshipId)
33
- await this.relationshipInfo.create(info)
34
- return info
35
- */
36
- }
37
- async getRelationshipInfos(query) {
38
- const items = await this.relationshipInfo.find(query);
39
- return await this.parseArray(items, RelationshipInfo_1.RelationshipInfo);
40
- }
41
- async createRelationshipInfo(relationshipInfo) {
42
- const exists = await this.relationshipInfo.exists({ relationshipId: relationshipInfo.relationshipId });
43
- if (exists) {
44
- throw consumption_1.ConsumptionErrors.relationshipInfo.relationshipInfoExists(relationshipInfo.relationshipId.toString());
45
- }
46
- await this.relationshipInfo.create(relationshipInfo);
47
- return relationshipInfo;
48
- }
49
- async updateRelationshipInfo(relationshipInfo) {
50
- const oldRelationshipInfo = await this.relationshipInfo.read(relationshipInfo.id.toString());
51
- if (!oldRelationshipInfo) {
52
- throw new Error("RelationshipInfo Not Found");
53
- }
54
- await this.relationshipInfo.update(oldRelationshipInfo, relationshipInfo);
55
- }
56
- async deleteRelationshipInfo(relationshipInfo) {
57
- await this.relationshipInfo.delete(relationshipInfo);
58
- }
59
- }
60
- exports.RelationshipInfoController = RelationshipInfoController;
61
- //# sourceMappingURL=RelationshipInfoController.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RelationshipInfoController.js","sourceRoot":"","sources":["../../../src/modules/relationships/RelationshipInfoController.ts"],"names":[],"mappings":";;;AACA,mDAA2G;AAE3G,+DAA2D;AAC3D,iEAA6D;AAE7D,MAAa,0BAA2B,SAAQ,uCAAyB;IAGrE,YAAmB,MAA6B;QAC5C,KAAK,CAAC,uCAAyB,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAA;IACvE,CAAC;IAEe,KAAK,CAAC,IAAI;QACtB,MAAM,KAAK,CAAC,IAAI,EAAE,CAAA;QAElB,IAAI,CAAC,gBAAgB,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,CAAA;QACzG,OAAO,IAAI,CAAA;IACf,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAAC,EAAU;QACvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;QAC9D,OAAO,MAAM,CAAC,CAAC,CAAC,mCAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC7D,CAAC;IAEM,KAAK,CAAC,iC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C,gBAAgB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA;IACxD,CAAC;CACJ;AA/DD,gEA+DC"}
@@ -1,15 +0,0 @@
1
- import { ILogger } from "@js-soft/logging-abstractions";
2
- import { CoreId } from "@nmshd/transport";
3
- import { ConsumptionController } from "../../consumption/ConsumptionController";
4
- import { RelationshipInfo } from "./local/RelationshipInfo";
5
- export declare class RelationshipInfoUtil {
6
- private readonly parent;
7
- protected _log: ILogger;
8
- get log(): ILogger;
9
- constructor(parent: ConsumptionController);
10
- createInitialRelationshipInfo(id: CoreId): Promise<RelationshipInfo>;
11
- private getTitle;
12
- private createRelationshipInfo;
13
- private parseTemplateBody;
14
- private parseCreationRequest;
15
- }
@@ -1,219 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RelationshipInfoUtil = void 0;
4
- const ts_serval_1 = require("@js-soft/ts-serval");
5
- const content_1 = require("@nmshd/content");
6
- const transport_1 = require("@nmshd/transport");
7
- const consumption_1 = require("../../consumption");
8
- const SharedItem_1 = require("../sharedItems/local/SharedItem");
9
- const RelationshipAttribute_1 = require("./local/RelationshipAttribute");
10
- const RelationshipInfo_1 = require("./local/RelationshipInfo");
11
- class RelationshipInfoUtil {
12
- constructor(parent) {
13
- this.parent = parent;
14
- this._log = transport_1.TransportLoggerFactory.getLogger(RelationshipInfoUtil);
15
- }
16
- get log() {
17
- return this._log;
18
- }
19
- async createInitialRelationshipInfo(id) {
20
- const relationship = await this.parent.accountController.relationships.getRelationship(id);
21
- if (!relationship) {
22
- throw transport_1.TransportErrors.general.recordNotFound(transport_1.Relationship, id.toString()).logWith(this._log);
23
- }
24
- await this.parseTemplateBody(relationship);
25
- await this.parseCreationRequest(relationship);
26
- return await this.createRelationshipInfo(relationship);
27
- }
28
- getTitle(relationship, attributeMap) {
29
- let title = relationship.peer.address.toString().substring(3, 9);
30
- const thingName = attributeMap.get("Thing.name")?.content.value;
31
- const givenName = attributeMap.get("Person.givenName")?.content.value;
32
- const familyName = attributeMap.get("Person.familyName")?.content.value;
33
- const gender = attributeMap.get("Person.gender")?.content.value;
34
- const orgname = attributeMap.get("Organization.name")?.content.value;
35
- const legalName = attributeMap.get("Organization.legalname")?.content.value;
36
- if (thingName) {
37
- title = thingName;
38
- }
39
- else if (givenName && familyName) {
40
- title = `${givenName} ${familyName}`;
41
- }
42
- else if (givenName) {
43
- title = givenName;
44
- }
45
- else if (familyName && gender) {
46
- title = `i18n://salutation.gender.${gender} ${familyName}`;
47
- }
48
- else if (orgname) {
49
- title = orgname;
50
- }
51
- else if (legalName) {
52
- title = legalName;
53
- }
54
- return title;
55
- }
56
- async createRelationshipInfo(relationship) {
57
- const peerAddress = relationship.peer.address;
58
- const truncatedAddress = peerAddress.address.substring(3, 9);
59
- const info = RelationshipInfo_1.RelationshipInfo.from({
60
- attributes: [],
61
- id: await consumption_1.ConsumptionIds.relationshipInfo.generate(),
62
- isPinned: false,
63
- relationshipId: relationship.id,
64
- title: truncatedAddress
65
- });
66
- // info = await this.parent.relationshipInfo.createRelationshipInfo(info)
67
- const items = await this.parent.sharedItems.getSharedItems({
68
- sharedBy: relationship.peer.address.toString()
69
- });
70
- const attributes = [];
71
- const attributeMap = new Map();
72
- for (const item of items) {
73
- if (item.content instanceof content_1.Attribute) {
74
- const relAttr = RelationshipAttribute_1.RelationshipAttribute.from({
75
- name: item.content.name,
76
- sharedItem: item.id,
77
- content: item.content
78
- });
79
- attributes.push(relAttr);
80
- attributeMap.set(relAttr.name, relAttr);
81
- }
82
- }
83
- info.attributes = attributes;
84
- const title = this.getTitle(relationship, attributeMap);
85
- info.title = title;
86
- // await this.parent.relationshipInfo.updateRelationshipInfo(info)
87
- return info;
88
- }
89
- async parseTemplateBody(relationship) {
90
- const template = relationship.cache.template;
91
- if (!template.cache) {
92
- throw transport_1.TransportErrors.general.cacheEmpty(transport_1.RelationshipTemplate, template.id.toString()).logWith(this._log);
93
- }
94
- const body = template.cache.content;
95
- const isTemplator = this.parent.accountController.identity.isMe(template.cache.createdBy);
96
- const sharedAt = template.cache.createdAt;
97
- const sharedBy = isTemplator ? this.parent.accountController.identity.address : relationship.peer.address;
98
- const sharedWith = isTemplator ? relationship.peer.address : this.parent.accountController.identity.address;
99
- const sharedItemsWithSameReference = await this.parent.sharedItems.getSharedItems({
100
- reference: template.id.toString()
101
- });
102
- const missingItems = [];
103
- if (body instanceof content_1.RelationshipTemplateBody) {
104
- const attributes = body.sharedAttributes;
105
- if (attributes) {
106
- if (sharedItemsWithSameReference.length !== attributes.length) {
107
- attributes.forEach((attribute) => {
108
- if (!sharedItemsWithSameReference.find(function (item) {
109
- const content = item.content;
110
- return content.name === attribute.name;
111
- })) {
112
- missingItems.push(attribute);
113
- }
114
- });
115
- }
116
- }
117
- }
118
- else {
119
- // Try to parse the old template format (without types)
120
- let oldTemplateBody = body;
121
- if (body instanceof ts_serval_1.JSONWrapper) {
122
- oldTemplateBody = oldTemplateBody.value;
123
- }
124
- if (oldTemplateBody?.attributes && Array.isArray(oldTemplateBody.attributes)) {
125
- if (sharedItemsWithSameReference.length !== oldTemplateBody.attributes.length) {
126
- oldTemplateBody.attributes.forEach((attribute) => {
127
- if (!sharedItemsWithSameReference.find(function (item) {
128
- const content = item.content;
129
- return content.name === attribute.name;
130
- })) {
131
- missingItems.push(content_1.Attribute.from({
132
- name: attribute.name,
133
- value: attribute.value
134
- }));
135
- }
136
- });
137
- }
138
- }
139
- }
140
- for (const attribute of missingItems) {
141
- const sharedItem = SharedItem_1.SharedItem.from({
142
- id: await consumption_1.ConsumptionIds.sharedItem.generate(),
143
- content: attribute,
144
- sharedAt: sharedAt,
145
- sharedBy: sharedBy,
146
- sharedWith: sharedWith,
147
- reference: template.id,
148
- expiresAt: attribute.validTo
149
- });
150
- await this.parent.sharedItems.createSharedItem(sharedItem);
151
- }
152
- }
153
- async parseCreationRequest(relationship) {
154
- const change = relationship.cache.creationChange;
155
- const request = change.request;
156
- const body = request.content;
157
- const isRequestor = this.parent.accountController.identity.isMe(request.createdBy);
158
- const sharedAt = request.createdAt;
159
- const sharedBy = isRequestor ? this.parent.accountController.identity.address : relationship.peer.address;
160
- const sharedWith = isRequestor ? relationship.peer.address : this.parent.accountController.identity.address;
161
- const sharedItemsWithSameReference = await this.parent.sharedItems.getSharedItems({
162
- reference: change.id.toString()
163
- });
164
- const missingItems = [];
165
- if (body instanceof content_1.RelationshipCreationChangeRequestBody) {
166
- const attributes = body.sharedAttributes;
167
- if (attributes && attributes.length > 0) {
168
- if (sharedItemsWithSameReference.length !== attributes.length) {
169
- attributes.forEach((attribute) => {
170
- if (!sharedItemsWithSameReference.find(function (item) {
171
- const content = item.content;
172
- return content.name === attribute.name;
173
- })) {
174
- missingItems.push(attribute);
175
- }
176
- });
177
- }
178
- }
179
- }
180
- else {
181
- // Try to parse the old request format (without types)
182
- let oldRequestBody = body;
183
- if (body instanceof ts_serval_1.JSONWrapper) {
184
- oldRequestBody = oldRequestBody.value;
185
- }
186
- if (oldRequestBody?.attributes) {
187
- const keys = Object.keys(oldRequestBody.attributes);
188
- if (sharedItemsWithSameReference.length !== keys.length) {
189
- keys.forEach((key) => {
190
- const attribute = oldRequestBody.attributes[key];
191
- if (!sharedItemsWithSameReference.find(function (item) {
192
- const content = item.content;
193
- return content.name === attribute.name;
194
- })) {
195
- missingItems.push(content_1.Attribute.from({
196
- name: attribute.name,
197
- value: attribute.value
198
- }));
199
- }
200
- });
201
- }
202
- }
203
- }
204
- for (const attribute of missingItems) {
205
- const sharedItem = SharedItem_1.SharedItem.from({
206
- id: await consumption_1.ConsumptionIds.sharedItem.generate(),
207
- content: attribute,
208
- sharedAt: sharedAt,
209
- sharedBy: sharedBy,
210
- sharedWith: sharedWith,
211
- reference: change.id,
212
- expiresAt: attribute.validTo
213
- });
214
- await this.parent.sharedItems.createSharedItem(sharedItem);
215
- }
216
- }
217
- }
218
- exports.RelationshipInfoUtil = RelationshipInfoUtil;
219
- //# sourceMappingURL=RelationshipInfoUtil.js.map
@@ -1 +0,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KAAK,MAAM,SAAS,IAAI,YAAY,EAAE;YAClC,MAAM,UAAU,GAAG,uBAAU,CAAC,IAAI,CAAC;gBAC/B,EAAE,EAAE,MAAM,4BAAc,CAAC,UAAU,CAAC,QAAQ,EAAE;gBAC9C,OAAO,EAAE,SAAS;gBAClB,QAAQ,EAAE,QAAQ;gBAClB,QAAQ,EAAE,QAAQ;gBAClB,UAAU,EAAE,UAAU;gBACtB,SAAS,EAAE,MAAM,CAAC,EAAE;gBACpB,SAAS,EAAE,SAAS,CAAC,OAAO;aAC/B,CAAC,CAAA;YACF,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAA;SAC7D;IACL,CAAC;CACJ;AAvOD,oDAuOC"}
@@ -1,14 +0,0 @@
1
- import { ISerializable, Serializable } from "@js-soft/ts-serval";
2
- import { Attribute, IAttribute } from "@nmshd/content";
3
- import { CoreId, ICoreId } from "@nmshd/transport";
4
- export interface IRelationshipAttribute extends ISerializable {
5
- name: string;
6
- content: IAttribute;
7
- sharedItem: ICoreId;
8
- }
9
- export declare class RelationshipAttribute extends Serializable implements IRelationshipAttribute {
10
- name: string;
11
- content: Attribute;
12
- sharedItem: CoreId;
13
- static from(value: IRelationshipAttribute): RelationshipAttribute;
14
- }
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- 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;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.RelationshipAttribute = void 0;
13
- const ts_serval_1 = require("@js-soft/ts-serval");
14
- const content_1 = require("@nmshd/content");
15
- const transport_1 = require("@nmshd/transport");
16
- let RelationshipAttribute = class RelationshipAttribute extends ts_serval_1.Serializable {
17
- static from(value) {
18
- return this.fromAny(value);
19
- }
20
- };
21
- __decorate([
22
- (0, ts_serval_1.validate)(),
23
- (0, ts_serval_1.serialize)(),
24
- __metadata("design:type", String)
25
- ], RelationshipAttribute.prototype, "name", void 0);
26
- __decorate([
27
- (0, ts_serval_1.validate)(),
28
- (0, ts_serval_1.serialize)(),
29
- __metadata("design:type", content_1.Attribute)
30
- ], RelationshipAttribute.prototype, "content", void 0);
31
- __decorate([
32
- (0, ts_serval_1.validate)(),
33
- (0, ts_serval_1.serialize)(),
34
- __metadata("design:type", transport_1.CoreId)
35
- ], RelationshipAttribute.prototype, "sharedItem", void 0);
36
- RelationshipAttribute = __decorate([
37
- (0, ts_serval_1.type)("RelationshipAttribute")
38
- ], RelationshipAttribute);
39
- exports.RelationshipAttribute = RelationshipAttribute;
40
- //# sourceMappingURL=RelationshipAttribute.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RelationshipAttribute.js","sourceRoot":"","sources":["../../../../src/modules/relationships/local/RelationshipAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA2F;AAC3F,4CAAsD;AACtD,gDAAkD;AASlD,IAAa,qBAAqB,GAAlC,MAAa,qBAAsB,SAAQ,wBAAY;IAa5C,MAAM,CAAC,IAAI,CAAC,KAA6B;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;CACJ,CAAA;AAbG;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;;mDACO;AAInB;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACI,mBAAS;sDAAA;AAIzB;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACO,kBAAM;yDAAA;AAXhB,qBAAqB;IADjC,IAAA,gBAAI,EAAC,uBAAuB,CAAC;GACjB,qBAAqB,CAgBjC;AAhBY,sDAAqB"}
@@ -1,27 +0,0 @@
1
- import { CoreId, CoreSynchronizable, ICoreId, ICoreSynchronizable, Relationship } from "@nmshd/transport";
2
- import { IRelationshipAttribute, RelationshipAttribute } from "./RelationshipAttribute";
3
- import { IRelationshipTheme, RelationshipTheme } from "./RelationshipTheme";
4
- export interface IRelationshipInfo extends ICoreSynchronizable {
5
- relationshipId: ICoreId;
6
- attributes: IRelationshipAttribute[];
7
- isPinned: boolean;
8
- title: string;
9
- description?: string;
10
- userTitle?: string;
11
- userDescription?: string;
12
- theme?: IRelationshipTheme;
13
- }
14
- export declare class RelationshipInfo extends CoreSynchronizable implements IRelationshipInfo {
15
- readonly technicalProperties: string[];
16
- readonly userdataProperties: string[];
17
- relationshipId: CoreId;
18
- attributes: RelationshipAttribute[];
19
- isPinned: boolean;
20
- userTitle?: string;
21
- title: string;
22
- userDescription?: string;
23
- description?: string;
24
- theme?: RelationshipTheme;
25
- static fromRelationship(relationship: Relationship): Promise<RelationshipInfo>;
26
- static from(value: IRelationshipInfo): RelationshipInfo;
27
- }
@@ -1,97 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- 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;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var RelationshipInfo_1;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.RelationshipInfo = void 0;
14
- const ts_serval_1 = require("@js-soft/ts-serval");
15
- const transport_1 = require("@nmshd/transport");
16
- const ts_simple_nameof_1 = require("ts-simple-nameof");
17
- const consumption_1 = require("../../../consumption");
18
- const RelationshipAttribute_1 = require("./RelationshipAttribute");
19
- const RelationshipTheme_1 = require("./RelationshipTheme");
20
- let RelationshipInfo = RelationshipInfo_1 = class RelationshipInfo extends transport_1.CoreSynchronizable {
21
- constructor() {
22
- super(...arguments);
23
- this.technicalProperties = [
24
- "@type",
25
- "@context",
26
- (0, ts_simple_nameof_1.nameof)((r) => r.relationshipId),
27
- (0, ts_simple_nameof_1.nameof)((r) => r.title),
28
- (0, ts_simple_nameof_1.nameof)((r) => r.description),
29
- (0, ts_simple_nameof_1.nameof)((r) => r.theme)
30
- ];
31
- this.userdataProperties = [
32
- (0, ts_simple_nameof_1.nameof)((r) => r.isPinned),
33
- (0, ts_simple_nameof_1.nameof)((r) => r.userTitle),
34
- (0, ts_simple_nameof_1.nameof)((r) => r.userDescription)
35
- ];
36
- }
37
- static async fromRelationship(relationship) {
38
- if (typeof relationship.metadata === "undefined") {
39
- return RelationshipInfo_1.from({
40
- id: await consumption_1.ConsumptionIds.relationshipInfo.generate(),
41
- relationshipId: relationship.id,
42
- attributes: [],
43
- isPinned: false,
44
- title: relationship.peer.address.address.substring(3, 9)
45
- });
46
- }
47
- return RelationshipInfo_1.from(relationship.metadata);
48
- }
49
- static from(value) {
50
- return this.fromAny(value);
51
- }
52
- };
53
- __decorate([
54
- (0, ts_serval_1.validate)(),
55
- (0, ts_serval_1.serialize)(),
56
- __metadata("design:type", transport_1.CoreId)
57
- ], RelationshipInfo.prototype, "relationshipId", void 0);
58
- __decorate([
59
- (0, ts_serval_1.validate)(),
60
- (0, ts_serval_1.serialize)({ type: RelationshipAttribute_1.RelationshipAttribute }),
61
- __metadata("design:type", Array)
62
- ], RelationshipInfo.prototype, "attributes", void 0);
63
- __decorate([
64
- (0, ts_serval_1.validate)(),
65
- (0, ts_serval_1.serialize)(),
66
- __metadata("design:type", Boolean)
67
- ], RelationshipInfo.prototype, "isPinned", void 0);
68
- __decorate([
69
- (0, ts_serval_1.validate)({ nullable: true }),
70
- (0, ts_serval_1.serialize)(),
71
- __metadata("design:type", String)
72
- ], RelationshipInfo.prototype, "userTitle", void 0);
73
- __decorate([
74
- (0, ts_serval_1.validate)(),
75
- (0, ts_serval_1.serialize)(),
76
- __metadata("design:type", String)
77
- ], RelationshipInfo.prototype, "title", void 0);
78
- __decorate([
79
- (0, ts_serval_1.validate)({ nullable: true }),
80
- (0, ts_serval_1.serialize)(),
81
- __metadata("design:type", String)
82
- ], RelationshipInfo.prototype, "userDescription", void 0);
83
- __decorate([
84
- (0, ts_serval_1.validate)({ nullable: true }),
85
- (0, ts_serval_1.serialize)(),
86
- __metadata("design:type", String)
87
- ], RelationshipInfo.prototype, "description", void 0);
88
- __decorate([
89
- (0, ts_serval_1.validate)({ nullable: true }),
90
- (0, ts_serval_1.serialize)(),
91
- __metadata("design:type", RelationshipTheme_1.RelationshipTheme)
92
- ], RelationshipInfo.prototype, "theme", void 0);
93
- RelationshipInfo = RelationshipInfo_1 = __decorate([
94
- (0, ts_serval_1.type)("RelationshipInfo")
95
- ], RelationshipInfo);
96
- exports.RelationshipInfo = RelationshipInfo;
97
- //# sourceMappingURL=RelationshipInfo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RelationshipInfo.js","sourceRoot":"","sources":["../../../../src/modules/relationships/local/RelationshipInfo.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAA8D;AAC9D,gDAAyG;AACzG,uDAAyC;AACzC,sDAAqD;AACrD,mEAAuF;AACvF,2DAA2E;AAc3E,IAAa,gBAAgB,wBAA7B,MAAa,gBAAiB,SAAQ,8BAAkB;IAAxD;;QAC6B,wBAAmB,GAAG;YAC3C,O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AK,CAAC,CAAA;IAC9B,CAAC;CACJ,CAAA;AA9CG;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACW,kBAAM;wDAAA;AAI7B;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,EAAC,EAAE,IAAI,EAAE,6CAAqB,EAAE,CAAC;;oDACD;AAI1C;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;;kDACY;AAIxB;IAFC,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,IAAA,qBAAS,GAAE;;mDACa;AAIzB;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;;+CACQ;AAIpB;IAFC,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,IAAA,qBAAS,GAAE;;yDACmB;AAI/B;IAFC,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,IAAA,qBAAS,GAAE;;qDACe;AAI3B;IAFC,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,IAAA,qBAAS,GAAE;8BACG,qCAAiB;+CAAA;AA9CvB,gBAAgB;IAD5B,IAAA,gBAAI,EAAC,kBAAkB,CAAC;GACZ,gBAAgB,CAgE5B;AAhEY,4CAAgB"}
@@ -1,14 +0,0 @@
1
- import { ISerializable, Serializable } from "@js-soft/ts-serval";
2
- export interface IRelationshipTheme extends ISerializable {
3
- image: string;
4
- imageBar: string;
5
- backgroundColor: string;
6
- foregroundColor: string;
7
- }
8
- export declare class RelationshipTheme extends Serializable implements IRelationshipTheme {
9
- image: string;
10
- imageBar: string;
11
- backgroundColor: string;
12
- foregroundColor: string;
13
- static from(value: IRelationshipTheme): RelationshipTheme;
14
- }
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- 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;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.RelationshipTheme = void 0;
13
- const ts_serval_1 = require("@js-soft/ts-serval");
14
- let RelationshipTheme = class RelationshipTheme extends ts_serval_1.Serializable {
15
- static from(value) {
16
- return this.fromAny(value);
17
- }
18
- };
19
- __decorate([
20
- (0, ts_serval_1.validate)(),
21
- (0, ts_serval_1.serialize)(),
22
- __metadata("design:type", String)
23
- ], RelationshipTheme.prototype, "image", void 0);
24
- __decorate([
25
- (0, ts_serval_1.validate)(),
26
- (0, ts_serval_1.serialize)(),
27
- __metadata("design:type", String)
28
- ], RelationshipTheme.prototype, "imageBar", void 0);
29
- __decorate([
30
- (0, ts_serval_1.validate)(),
31
- (0, ts_serval_1.serialize)(),
32
- __metadata("design:type", String)
33
- ], RelationshipTheme.prototype, "backgroundColor", void 0);
34
- __decorate([
35
- (0, ts_serval_1.validate)(),
36
- (0, ts_serval_1.serialize)(),
37
- __metadata("design:type", String)
38
- ], RelationshipTheme.prototype, "foregroundColor", void 0);
39
- RelationshipTheme = __decorate([
40
- (0, ts_serval_1.type)("RelationshipTheme")
41
- ], RelationshipTheme);
42
- exports.RelationshipTheme = RelationshipTheme;
43
- //# sourceMappingURL=RelationshipTheme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RelationshipTheme.js","sourceRoot":"","sources":["../../../../src/modules/relationships/local/RelationshipTheme.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA2F;AAU3F,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,wBAAY;IAiBxC,MAAM,CAAC,IAAI,CAAC,KAAyB;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;CACJ,CAAA;AAjBG;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;;gDACQ;AAIpB;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;;mDACW;AAIvB;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;;0DACkB;AAI9B;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;;0DACkB;AAfrB,iBAAiB;IAD7B,IAAA,gBAAI,EAAC,mBAAmB,CAAC;GACb,iBAAiB,CAoB7B;AApBY,8CAAiB"}
@@ -1,14 +0,0 @@
1
- import { CoreId } from "@nmshd/transport";
2
- import { ConsumptionBaseController } from "../../consumption";
3
- import { ConsumptionController } from "../../consumption/ConsumptionController";
4
- import { SharedItem } from "./local/SharedItem";
5
- export declare class SharedItemsController extends ConsumptionBaseController {
6
- private sharedItems;
7
- constructor(parent: ConsumptionController);
8
- init(): Promise<SharedItemsController>;
9
- getSharedItem(id: CoreId): Promise<SharedItem | undefined>;
10
- getSharedItems(query?: any): Promise<SharedItem[]>;
11
- createSharedItem(sharedItem: SharedItem): Promise<SharedItem>;
12
- updateSharedItem(sharedItem: SharedItem): Promise<SharedItem>;
13
- deleteSharedItem(sharedItem: SharedItem): Promise<void>;
14
- }