@nmshd/runtime 1.2.12 → 1.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buildInformation.js +5 -5
- package/dist/dataViews/DataViewExpander.d.ts +7 -4
- package/dist/dataViews/DataViewExpander.js +115 -31
- package/dist/dataViews/DataViewExpander.js.map +1 -1
- package/dist/dataViews/DataViewTranslateable.js +5 -5
- package/dist/dataViews/consumption/MatchedAttributesDVO.d.ts +1 -0
- package/dist/dataViews/consumption/StoredAttributeDVO.d.ts +3 -2
- package/dist/dataViews/content/AttributeDVO.d.ts +2 -4
- package/dist/dataViews/content/MailDVOs.d.ts +7 -13
- package/dist/dataViews/content/RequestDVOs.d.ts +23 -1
- package/dist/dataViews/transport/MessageDVO.d.ts +63 -9
- package/dist/dataViews/transport/MessageDVO.js +12 -4
- package/dist/dataViews/transport/MessageDVO.js.map +1 -1
- package/dist/dataViews/transport/RelationshipDVO.d.ts +33 -0
- package/dist/dataViews/transport/RelationshipDVO.js +6 -0
- package/dist/dataViews/transport/RelationshipDVO.js.map +1 -1
- package/dist/useCases/common/QRCode.js +1 -1
- package/dist/useCases/common/QRCode.js.map +1 -1
- package/lib-web/nmshd.runtime.js +163 -50
- package/lib-web/nmshd.runtime.js.map +1 -1
- package/lib-web/nmshd.runtime.min.js +2 -2
- package/lib-web/nmshd.runtime.min.js.map +1 -1
- package/package.json +12 -12
|
@@ -3,9 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MessageStatus = void 0;
|
|
4
4
|
var MessageStatus;
|
|
5
5
|
(function (MessageStatus) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
MessageStatus["
|
|
6
|
+
/**
|
|
7
|
+
* Message was received
|
|
8
|
+
*/
|
|
9
|
+
MessageStatus["Received"] = "Received";
|
|
10
|
+
/**
|
|
11
|
+
* Message was sent but is not yet received by every recipient
|
|
12
|
+
*/
|
|
13
|
+
MessageStatus["Delivering"] = "Delivering";
|
|
14
|
+
/**
|
|
15
|
+
* Message was sent and was received by every recipient
|
|
16
|
+
*/
|
|
17
|
+
MessageStatus["Delivered"] = "Delivered";
|
|
10
18
|
})(MessageStatus = exports.MessageStatus || (exports.MessageStatus = {}));
|
|
11
19
|
//# sourceMappingURL=MessageDVO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageDVO.js","sourceRoot":"","sources":["../../../src/dataViews/transport/MessageDVO.ts"],"names":[],"mappings":";;;AAIA,IAAY,
|
|
1
|
+
{"version":3,"file":"MessageDVO.js","sourceRoot":"","sources":["../../../src/dataViews/transport/MessageDVO.ts"],"names":[],"mappings":";;;AAIA,IAAY,aAaX;AAbD,WAAY,aAAa;IACrB;;OAEG;IACH,sCAAqB,CAAA;IACrB;;OAEG;IACH,0CAAyB,CAAA;IACzB;;OAEG;IACH,wCAAuB,CAAA;AAC3B,CAAC,EAbW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAaxB"}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
import { RelationshipChangeStatus, RelationshipChangeType } from "@nmshd/transport";
|
|
1
2
|
import { DataViewObject } from "../DataViewObject";
|
|
3
|
+
export declare enum RelationshipDirection {
|
|
4
|
+
Outgoing = "Outgoing",
|
|
5
|
+
Incoming = "Incoming"
|
|
6
|
+
}
|
|
2
7
|
export interface RelationshipDVO extends DataViewObject {
|
|
3
8
|
type: "RelationshipDVO";
|
|
4
9
|
status: string;
|
|
10
|
+
direction: string;
|
|
11
|
+
statusText: string;
|
|
5
12
|
isPinned: boolean;
|
|
6
13
|
theme: RelationshipTheme;
|
|
14
|
+
changes: RelationshipChangeDVO[];
|
|
15
|
+
changeCount: number;
|
|
7
16
|
}
|
|
8
17
|
export interface RelationshipTheme {
|
|
9
18
|
image?: string;
|
|
@@ -11,3 +20,27 @@ export interface RelationshipTheme {
|
|
|
11
20
|
backgroundColor?: string;
|
|
12
21
|
foregroundColor?: string;
|
|
13
22
|
}
|
|
23
|
+
export interface RelationshipChangeDVO extends DataViewObject {
|
|
24
|
+
type: "RelationshipChangeDVO";
|
|
25
|
+
request: RelationshipChangeRequestDVO;
|
|
26
|
+
response?: RelationshipChangeResponseDVO;
|
|
27
|
+
status: RelationshipChangeStatus;
|
|
28
|
+
statusText: string;
|
|
29
|
+
changeType: RelationshipChangeType;
|
|
30
|
+
changeTypeText: string;
|
|
31
|
+
isOwn: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface RelationshipChangeRequestDVO extends DataViewObject {
|
|
34
|
+
type: "RelationshipChangeRequestDVO";
|
|
35
|
+
createdBy: string;
|
|
36
|
+
createdByDevice: string;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
content?: any;
|
|
39
|
+
}
|
|
40
|
+
export interface RelationshipChangeResponseDVO extends DataViewObject {
|
|
41
|
+
type: "RelationshipChangeResponseDVO";
|
|
42
|
+
createdBy: string;
|
|
43
|
+
createdByDevice: string;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
content?: any;
|
|
46
|
+
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RelationshipDirection = void 0;
|
|
4
|
+
var RelationshipDirection;
|
|
5
|
+
(function (RelationshipDirection) {
|
|
6
|
+
RelationshipDirection["Outgoing"] = "Outgoing";
|
|
7
|
+
RelationshipDirection["Incoming"] = "Incoming";
|
|
8
|
+
})(RelationshipDirection = exports.RelationshipDirection || (exports.RelationshipDirection = {}));
|
|
3
9
|
//# sourceMappingURL=RelationshipDVO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelationshipDVO.js","sourceRoot":"","sources":["../../../src/dataViews/transport/RelationshipDVO.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"RelationshipDVO.js","sourceRoot":"","sources":["../../../src/dataViews/transport/RelationshipDVO.ts"],"names":[],"mappings":";;;AAGA,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC7B,8CAAqB,CAAA;IACrB,8CAAqB,CAAA;AACzB,CAAC,EAHW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAGhC"}
|
|
@@ -29,7 +29,7 @@ class QRCode {
|
|
|
29
29
|
return this.base64;
|
|
30
30
|
}
|
|
31
31
|
static async from(utf8Content) {
|
|
32
|
-
const dataUrl = await QRCodeLibrary.toDataURL(utf8Content);
|
|
32
|
+
const dataUrl = await QRCodeLibrary.toDataURL(`nmshd://qr#${utf8Content}`);
|
|
33
33
|
const base64 = dataUrl.split(",")[1];
|
|
34
34
|
return new QRCode(base64);
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QRCode.js","sourceRoot":"","sources":["../../../src/useCases/common/QRCode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAwC;AAExC,MAAa,MAAM;IACf,YAAqC,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAEhD,QAAQ;QACX,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,WAAmB;QACxC,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"QRCode.js","sourceRoot":"","sources":["../../../src/useCases/common/QRCode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAwC;AAExC,MAAa,MAAM;IACf,YAAqC,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAEhD,QAAQ;QACX,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,WAAmB;QACxC,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,SAAS,CAAC,cAAc,WAAW,EAAE,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAErC,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;CACJ;AAbD,wBAaC"}
|
package/lib-web/nmshd.runtime.js
CHANGED
|
@@ -327,11 +327,11 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
|
327
327
|
const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
|
|
328
328
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
329
329
|
exports.buildInformation = {
|
|
330
|
-
version: "1.2.
|
|
331
|
-
build: "
|
|
332
|
-
date: "2022-01-
|
|
333
|
-
commit: "
|
|
334
|
-
dependencies: {"@js-soft/docdb-querytranslator":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/ts-serval":"1.0.2","@js-soft/ts-utils":"^1.1.1","@nmshd/consumption":"1.0.
|
|
330
|
+
version: "1.2.16",
|
|
331
|
+
build: "31",
|
|
332
|
+
date: "2022-01-21T10:36:06+00:00",
|
|
333
|
+
commit: "2a31bb2f8d8166ef9ed7e7c318d9ec99ddf95c18",
|
|
334
|
+
dependencies: {"@js-soft/docdb-querytranslator":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/ts-serval":"1.0.2","@js-soft/ts-utils":"^1.1.1","@nmshd/consumption":"1.0.12","@nmshd/content":"1.1.3","@nmshd/crypto":"1.0.7","@nmshd/transport":"1.1.6","ajv":"^8.9.0","ajv-errors":"^3.0.0","ajv-formats":"^2.1.1","fluent-ts-validator":"3.0.2","json-stringify-safe":"^5.0.1","luxon":"^2.3.0","qrcode":"1.5.0","reflect-metadata":"0.1.13","ts-simple-nameof":"1.3.1","typescript-ioc":"3.2.2"},
|
|
335
335
|
libraries: {
|
|
336
336
|
serval: ts_serval_1.buildInformation,
|
|
337
337
|
consumption: consumption_1.buildInformation,
|
|
@@ -373,6 +373,7 @@ const ConsumptionServices_1 = __webpack_require__(/*! ../extensibility/Consumpti
|
|
|
373
373
|
const useCases_1 = __webpack_require__(/*! ../useCases */ "./dist/useCases/index.js");
|
|
374
374
|
const DataViewTranslateable_1 = __webpack_require__(/*! ./DataViewTranslateable */ "./dist/dataViews/DataViewTranslateable.js");
|
|
375
375
|
const MessageDVO_1 = __webpack_require__(/*! ./transport/MessageDVO */ "./dist/dataViews/transport/MessageDVO.js");
|
|
376
|
+
const RelationshipDVO_1 = __webpack_require__(/*! ./transport/RelationshipDVO */ "./dist/dataViews/transport/RelationshipDVO.js");
|
|
376
377
|
let DataViewExpander = class DataViewExpander {
|
|
377
378
|
constructor(transport, consumption, identityController) {
|
|
378
379
|
this.transport = transport;
|
|
@@ -461,6 +462,8 @@ let DataViewExpander = class DataViewExpander {
|
|
|
461
462
|
}
|
|
462
463
|
async expandMessageDTO(message) {
|
|
463
464
|
const recipientRelationships = await this.expandRecipients(message.recipients);
|
|
465
|
+
const addressMap = {};
|
|
466
|
+
recipientRelationships.forEach((value) => (addressMap[value.id] = value));
|
|
464
467
|
const createdByRelationship = await this.expandAddress(message.createdBy);
|
|
465
468
|
const fileIds = [];
|
|
466
469
|
const filePromises = [];
|
|
@@ -476,13 +479,19 @@ let DataViewExpander = class DataViewExpander {
|
|
|
476
479
|
}
|
|
477
480
|
const files = await Promise.all(filePromises);
|
|
478
481
|
const isOwn = this.identityController.isMe(transport_1.CoreAddress.from(message.createdBy));
|
|
482
|
+
let peer;
|
|
479
483
|
let status = MessageDVO_1.MessageStatus.Received;
|
|
480
484
|
if (isOwn) {
|
|
481
485
|
const receivedByEveryone = message.recipients.every((r) => !!r.receivedAt);
|
|
482
486
|
status = receivedByEveryone ? MessageDVO_1.MessageStatus.Delivered : MessageDVO_1.MessageStatus.Delivering;
|
|
487
|
+
// Overwrite the RecipientDVO to be a IdentityDVO for this special case
|
|
488
|
+
peer = { ...recipientRelationships[0], type: "IdentityDVO" };
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
peer = createdByRelationship;
|
|
483
492
|
}
|
|
484
493
|
const name = DataViewTranslateable_1.DataViewTranslateable.transport.messageName;
|
|
485
|
-
const
|
|
494
|
+
const messageDVO = {
|
|
486
495
|
id: message.id,
|
|
487
496
|
name: name,
|
|
488
497
|
date: message.createdAt,
|
|
@@ -496,38 +505,42 @@ let DataViewExpander = class DataViewExpander {
|
|
|
496
505
|
recipientCount: message.recipients.length,
|
|
497
506
|
attachmentCount: message.attachments.length,
|
|
498
507
|
status,
|
|
499
|
-
|
|
508
|
+
statusText: `i18n://dvo.message.${status}`,
|
|
509
|
+
image: "",
|
|
510
|
+
peer: peer
|
|
500
511
|
};
|
|
501
512
|
if (message.content["@type"] === "Mail" || message.content["@type"] === "RequestMail") {
|
|
502
|
-
value.name = DataViewTranslateable_1.DataViewTranslateable.consumption.mails.mailSubjectFallback;
|
|
503
|
-
value.type = "MailDVO";
|
|
504
513
|
const mailContent = message.content;
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
}
|
|
508
|
-
value.to = await this.expandAddresses(mailContent.to);
|
|
509
|
-
value.toCount = mailContent.to.length;
|
|
510
|
-
value.ccCount = 0;
|
|
514
|
+
const to = mailContent.to.map((value) => addressMap[value]);
|
|
515
|
+
let cc = [];
|
|
511
516
|
if (mailContent.cc) {
|
|
512
|
-
|
|
513
|
-
value.ccCount = mailContent.cc.length;
|
|
517
|
+
cc = mailContent.cc.map((value) => addressMap[value]);
|
|
514
518
|
}
|
|
515
|
-
|
|
516
|
-
|
|
519
|
+
const mailDVO = {
|
|
520
|
+
...messageDVO,
|
|
521
|
+
type: "MailDVO",
|
|
522
|
+
name: mailContent.subject ? mailContent.subject : DataViewTranslateable_1.DataViewTranslateable.consumption.mails.mailSubjectFallback,
|
|
523
|
+
subject: mailContent.subject,
|
|
524
|
+
body: mailContent.body,
|
|
525
|
+
to: to,
|
|
526
|
+
toCount: mailContent.to.length,
|
|
527
|
+
cc: cc,
|
|
528
|
+
ccCount: cc.length
|
|
529
|
+
};
|
|
517
530
|
if (mailContent["@type"] === "RequestMail") {
|
|
518
531
|
const requestMailContent = message.content;
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
return
|
|
532
|
+
const requestMailDVO = {
|
|
533
|
+
...mailDVO,
|
|
534
|
+
type: "RequestMailDVO",
|
|
535
|
+
name: requestMailContent.subject ? requestMailContent.subject : DataViewTranslateable_1.DataViewTranslateable.consumption.mails.requestMailSubjectFallback,
|
|
536
|
+
requests: await this.expandUnknownRequests(requestMailContent.requests),
|
|
537
|
+
requestCount: requestMailContent.requests.length
|
|
538
|
+
};
|
|
539
|
+
return requestMailDVO;
|
|
527
540
|
}
|
|
528
|
-
return
|
|
541
|
+
return mailDVO;
|
|
529
542
|
}
|
|
530
|
-
return
|
|
543
|
+
return messageDVO;
|
|
531
544
|
}
|
|
532
545
|
async expandMessageDTOs(messages) {
|
|
533
546
|
const messagePromises = messages.map((message) => this.expandMessageDTO(message));
|
|
@@ -632,7 +645,8 @@ let DataViewExpander = class DataViewExpander {
|
|
|
632
645
|
value: attribute.content.value,
|
|
633
646
|
date: attribute.createdAt,
|
|
634
647
|
isOwn: true,
|
|
635
|
-
sharedItems: []
|
|
648
|
+
sharedItems: [],
|
|
649
|
+
sharedItemCount: 0
|
|
636
650
|
};
|
|
637
651
|
}
|
|
638
652
|
async expandConsumptionAttributes(attributes) {
|
|
@@ -654,6 +668,7 @@ let DataViewExpander = class DataViewExpander {
|
|
|
654
668
|
id: name,
|
|
655
669
|
name: name,
|
|
656
670
|
matches: matchedAttributes,
|
|
671
|
+
matchCount: matchedAttributes.length,
|
|
657
672
|
bestMatch: bestMatch
|
|
658
673
|
};
|
|
659
674
|
}
|
|
@@ -696,13 +711,24 @@ let DataViewExpander = class DataViewExpander {
|
|
|
696
711
|
else {
|
|
697
712
|
name = DataViewTranslateable_1.DataViewTranslateable.consumption.requests.attributesChangeRequestName;
|
|
698
713
|
}
|
|
714
|
+
const changes = [];
|
|
715
|
+
attributesObjects.forEach((attribute, index) => {
|
|
716
|
+
changes.push({
|
|
717
|
+
oldAttribute: oldAttributesObjects[index],
|
|
718
|
+
newAttribute: attribute
|
|
719
|
+
});
|
|
720
|
+
});
|
|
699
721
|
return {
|
|
700
722
|
...request,
|
|
701
723
|
type: "AttributesChangeRequestDVO",
|
|
702
724
|
name: name,
|
|
703
725
|
newAttributes: attributesObjects,
|
|
726
|
+
newAttributeCount: attributesObjects.length,
|
|
704
727
|
oldAttributes: oldAttributesObjects,
|
|
705
|
-
|
|
728
|
+
oldAttributeCount: oldAttributesObjects.length,
|
|
729
|
+
applyTo: applyToObject,
|
|
730
|
+
changes: changes,
|
|
731
|
+
changeCount: changes.length
|
|
706
732
|
};
|
|
707
733
|
}
|
|
708
734
|
async expandAttributesRequest(attributesRequest) {
|
|
@@ -719,8 +745,10 @@ let DataViewExpander = class DataViewExpander {
|
|
|
719
745
|
...request,
|
|
720
746
|
type: "AttributesRequestDVO",
|
|
721
747
|
names: attributesRequest.names,
|
|
748
|
+
nameCount: attributesRequest.names.length,
|
|
722
749
|
name: name,
|
|
723
750
|
attributes: attributesObjects,
|
|
751
|
+
attributeCount: attributesObjects.length,
|
|
724
752
|
required: attributesRequest.required
|
|
725
753
|
};
|
|
726
754
|
}
|
|
@@ -775,18 +803,69 @@ let DataViewExpander = class DataViewExpander {
|
|
|
775
803
|
const relationshipPromises = addresses.map((address) => this.expandAddress(address));
|
|
776
804
|
return await Promise.all(relationshipPromises);
|
|
777
805
|
}
|
|
806
|
+
async expandRecipient(recipient) {
|
|
807
|
+
const identity = await this.expandAddress(recipient.address);
|
|
808
|
+
return {
|
|
809
|
+
...identity,
|
|
810
|
+
type: "RecipientDVO",
|
|
811
|
+
receivedAt: recipient.receivedAt,
|
|
812
|
+
receivedByDevice: recipient.receivedByDevice
|
|
813
|
+
};
|
|
814
|
+
}
|
|
778
815
|
async expandRecipients(recipients) {
|
|
779
|
-
const relationshipPromises = recipients.map((recipient) => this.
|
|
816
|
+
const relationshipPromises = recipients.map((recipient) => this.expandRecipient(recipient));
|
|
780
817
|
return await Promise.all(relationshipPromises);
|
|
781
818
|
}
|
|
819
|
+
expandRelationshipChange(relationship, change) {
|
|
820
|
+
const date = change.response ? change.response.createdAt : change.request.createdAt;
|
|
821
|
+
let isOwn = false;
|
|
822
|
+
if (this.identityController.isMe(transport_1.CoreAddress.from(change.request.createdBy))) {
|
|
823
|
+
isOwn = true;
|
|
824
|
+
}
|
|
825
|
+
let response;
|
|
826
|
+
if (change.response) {
|
|
827
|
+
response = {
|
|
828
|
+
...change.response,
|
|
829
|
+
id: `${change.id}_response`,
|
|
830
|
+
name: "i18n://dvo.relationshipChange.response.name",
|
|
831
|
+
type: "RelationshipChangeResponseDVO"
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
return Promise.resolve({
|
|
835
|
+
type: "RelationshipChangeDVO",
|
|
836
|
+
id: change.id,
|
|
837
|
+
name: "",
|
|
838
|
+
date: date,
|
|
839
|
+
status: change.status,
|
|
840
|
+
statusText: `i18n://dvo.relationshipChange.${change.status}`,
|
|
841
|
+
changeType: change.type,
|
|
842
|
+
changeTypeText: `i18n://dvo.relationshipChange.${change.type}`,
|
|
843
|
+
isOwn: isOwn,
|
|
844
|
+
request: {
|
|
845
|
+
...change.request,
|
|
846
|
+
id: `${change.id}_request`,
|
|
847
|
+
name: "i18n://dvo.relationshipChange.request.name",
|
|
848
|
+
type: "RelationshipChangeRequestDVO"
|
|
849
|
+
},
|
|
850
|
+
response: response
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
async expandRelationshipChanges(relationship) {
|
|
854
|
+
const changePromises = relationship.changes.map((change) => this.expandRelationshipChange(relationship, change));
|
|
855
|
+
return await Promise.all(changePromises);
|
|
856
|
+
}
|
|
782
857
|
async createRelationshipDVO(relationship, relationshipInfo) {
|
|
783
858
|
var _a, _b, _c, _d;
|
|
784
859
|
if (!relationshipInfo) {
|
|
785
860
|
const relationshipInfoResult = await this.consumption.relationshipInfo.getRelationshipInfoByRelationship({ relationshipId: relationship.id });
|
|
786
861
|
relationshipInfo = relationshipInfoResult.value;
|
|
787
862
|
}
|
|
863
|
+
let direction = RelationshipDVO_1.RelationshipDirection.Incoming;
|
|
864
|
+
if (this.identityController.isMe(transport_1.CoreAddress.from(relationship.changes[0].request.createdBy))) {
|
|
865
|
+
direction = RelationshipDVO_1.RelationshipDirection.Outgoing;
|
|
866
|
+
}
|
|
788
867
|
let statusText = "";
|
|
789
|
-
if (relationship.status === transport_1.RelationshipStatus.Pending &&
|
|
868
|
+
if (relationship.status === transport_1.RelationshipStatus.Pending && direction === RelationshipDVO_1.RelationshipDirection.Outgoing) {
|
|
790
869
|
statusText = DataViewTranslateable_1.DataViewTranslateable.transport.relationshipOutgoing;
|
|
791
870
|
}
|
|
792
871
|
else if (relationship.status === transport_1.RelationshipStatus.Pending) {
|
|
@@ -801,6 +880,7 @@ let DataViewExpander = class DataViewExpander {
|
|
|
801
880
|
else if (relationship.status === transport_1.RelationshipStatus.Active) {
|
|
802
881
|
statusText = DataViewTranslateable_1.DataViewTranslateable.transport.relationshipActive;
|
|
803
882
|
}
|
|
883
|
+
const changes = await this.expandRelationshipChanges(relationship);
|
|
804
884
|
return {
|
|
805
885
|
id: relationship.id,
|
|
806
886
|
name: relationshipInfo.userTitle ? relationshipInfo.userTitle : relationshipInfo.title,
|
|
@@ -808,14 +888,18 @@ let DataViewExpander = class DataViewExpander {
|
|
|
808
888
|
date: relationship.changes[0].request.createdAt,
|
|
809
889
|
image: "",
|
|
810
890
|
type: "RelationshipDVO",
|
|
811
|
-
status:
|
|
891
|
+
status: relationship.status,
|
|
892
|
+
statusText: statusText,
|
|
893
|
+
direction: direction,
|
|
812
894
|
isPinned: relationshipInfo.isPinned,
|
|
813
895
|
theme: {
|
|
814
896
|
image: (_a = relationshipInfo.theme) === null || _a === void 0 ? void 0 : _a.image,
|
|
815
897
|
headerImage: (_b = relationshipInfo.theme) === null || _b === void 0 ? void 0 : _b.imageBar,
|
|
816
898
|
backgroundColor: (_c = relationshipInfo.theme) === null || _c === void 0 ? void 0 : _c.backgroundColor,
|
|
817
899
|
foregroundColor: (_d = relationshipInfo.theme) === null || _d === void 0 ? void 0 : _d.foregroundColor
|
|
818
|
-
}
|
|
900
|
+
},
|
|
901
|
+
changes: changes,
|
|
902
|
+
changeCount: changes.length
|
|
819
903
|
};
|
|
820
904
|
}
|
|
821
905
|
async expandRelationshipDTO(relationship) {
|
|
@@ -827,7 +911,7 @@ let DataViewExpander = class DataViewExpander {
|
|
|
827
911
|
const initials = ((_a = name.match(/\b\w/g)) !== null && _a !== void 0 ? _a : []).join("");
|
|
828
912
|
const relationshipDVO = await this.createRelationshipDVO(relationship, relationshipInfo);
|
|
829
913
|
if (!description) {
|
|
830
|
-
description = relationshipDVO.
|
|
914
|
+
description = relationshipDVO.statusText;
|
|
831
915
|
}
|
|
832
916
|
return {
|
|
833
917
|
type: "IdentityDVO",
|
|
@@ -950,11 +1034,11 @@ exports.DataViewTranslateable = DataViewTranslateable;
|
|
|
950
1034
|
DataViewTranslateable.prefix = "i18n://dvo.";
|
|
951
1035
|
DataViewTranslateable.transport = {
|
|
952
1036
|
messageName: `${DataViewTranslateable.prefix}message.name`,
|
|
953
|
-
relationshipOutgoing: `${DataViewTranslateable.prefix}relationship.
|
|
954
|
-
relationshipIncoming: `${DataViewTranslateable.prefix}relationship.
|
|
955
|
-
relationshipRejected: `${DataViewTranslateable.prefix}relationship.
|
|
956
|
-
relationshipRevoked: `${DataViewTranslateable.prefix}relationship.
|
|
957
|
-
relationshipActive: `${DataViewTranslateable.prefix}relationship.
|
|
1037
|
+
relationshipOutgoing: `${DataViewTranslateable.prefix}relationship.Outgoing`,
|
|
1038
|
+
relationshipIncoming: `${DataViewTranslateable.prefix}relationship.Incoming`,
|
|
1039
|
+
relationshipRejected: `${DataViewTranslateable.prefix}relationship.Rejected`,
|
|
1040
|
+
relationshipRevoked: `${DataViewTranslateable.prefix}relationship.Revoked`,
|
|
1041
|
+
relationshipActive: `${DataViewTranslateable.prefix}relationship.Active`,
|
|
958
1042
|
fileName: `${DataViewTranslateable.prefix}file.name`
|
|
959
1043
|
};
|
|
960
1044
|
DataViewTranslateable.consumption = {
|
|
@@ -1208,10 +1292,18 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1208
1292
|
exports.MessageStatus = void 0;
|
|
1209
1293
|
var MessageStatus;
|
|
1210
1294
|
(function (MessageStatus) {
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
MessageStatus["
|
|
1295
|
+
/**
|
|
1296
|
+
* Message was received
|
|
1297
|
+
*/
|
|
1298
|
+
MessageStatus["Received"] = "Received";
|
|
1299
|
+
/**
|
|
1300
|
+
* Message was sent but is not yet received by every recipient
|
|
1301
|
+
*/
|
|
1302
|
+
MessageStatus["Delivering"] = "Delivering";
|
|
1303
|
+
/**
|
|
1304
|
+
* Message was sent and was received by every recipient
|
|
1305
|
+
*/
|
|
1306
|
+
MessageStatus["Delivered"] = "Delivered";
|
|
1215
1307
|
})(MessageStatus = exports.MessageStatus || (exports.MessageStatus = {}));
|
|
1216
1308
|
//# sourceMappingURL=MessageDVO.js.map
|
|
1217
1309
|
|
|
@@ -1226,6 +1318,12 @@ var MessageStatus;
|
|
|
1226
1318
|
"use strict";
|
|
1227
1319
|
|
|
1228
1320
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1321
|
+
exports.RelationshipDirection = void 0;
|
|
1322
|
+
var RelationshipDirection;
|
|
1323
|
+
(function (RelationshipDirection) {
|
|
1324
|
+
RelationshipDirection["Outgoing"] = "Outgoing";
|
|
1325
|
+
RelationshipDirection["Incoming"] = "Incoming";
|
|
1326
|
+
})(RelationshipDirection = exports.RelationshipDirection || (exports.RelationshipDirection = {}));
|
|
1229
1327
|
//# sourceMappingURL=RelationshipDVO.js.map
|
|
1230
1328
|
|
|
1231
1329
|
/***/ }),
|
|
@@ -3724,7 +3822,7 @@ class QRCode {
|
|
|
3724
3822
|
return this.base64;
|
|
3725
3823
|
}
|
|
3726
3824
|
static async from(utf8Content) {
|
|
3727
|
-
const dataUrl = await QRCodeLibrary.toDataURL(utf8Content);
|
|
3825
|
+
const dataUrl = await QRCodeLibrary.toDataURL(`nmshd://qr#${utf8Content}`);
|
|
3728
3826
|
const base64 = dataUrl.split(",")[1];
|
|
3729
3827
|
return new QRCode(base64);
|
|
3730
3828
|
}
|
|
@@ -14157,7 +14255,7 @@ Object.defineProperty(exports, "CodeGen", ({ enumerable: true, get: function ()
|
|
|
14157
14255
|
"use strict";
|
|
14158
14256
|
|
|
14159
14257
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
14160
|
-
exports.regexpCode = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
|
|
14258
|
+
exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
|
|
14161
14259
|
class _CodeOrName {
|
|
14162
14260
|
}
|
|
14163
14261
|
exports._CodeOrName = _CodeOrName;
|
|
@@ -14297,6 +14395,14 @@ function getProperty(key) {
|
|
|
14297
14395
|
return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _ `[${key}]`;
|
|
14298
14396
|
}
|
|
14299
14397
|
exports.getProperty = getProperty;
|
|
14398
|
+
//Does best effort to format the name properly
|
|
14399
|
+
function getEsmExportName(key) {
|
|
14400
|
+
if (typeof key == "string" && exports.IDENTIFIER.test(key)) {
|
|
14401
|
+
return new _Code(`${key}`);
|
|
14402
|
+
}
|
|
14403
|
+
throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);
|
|
14404
|
+
}
|
|
14405
|
+
exports.getEsmExportName = getEsmExportName;
|
|
14300
14406
|
function regexpCode(rx) {
|
|
14301
14407
|
return new _Code(rx.toString());
|
|
14302
14408
|
}
|
|
@@ -19125,6 +19231,8 @@ exports["default"] = def;
|
|
|
19125
19231
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
19126
19232
|
const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/ajv/dist/compile/codegen/index.js");
|
|
19127
19233
|
const types_1 = __webpack_require__(/*! ../discriminator/types */ "./node_modules/ajv/dist/vocabularies/discriminator/types.js");
|
|
19234
|
+
const compile_1 = __webpack_require__(/*! ../../compile */ "./node_modules/ajv/dist/compile/index.js");
|
|
19235
|
+
const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/ajv/dist/compile/util.js");
|
|
19128
19236
|
const error = {
|
|
19129
19237
|
message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag
|
|
19130
19238
|
? `tag "${tagName}" must be string`
|
|
@@ -19176,10 +19284,15 @@ const def = {
|
|
|
19176
19284
|
const topRequired = hasRequired(parentSchema);
|
|
19177
19285
|
let tagRequired = true;
|
|
19178
19286
|
for (let i = 0; i < oneOf.length; i++) {
|
|
19179
|
-
|
|
19180
|
-
|
|
19287
|
+
let sch = oneOf[i];
|
|
19288
|
+
if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
|
|
19289
|
+
sch = compile_1.resolveRef.call(it.self, it.schemaEnv, it.baseId, sch === null || sch === void 0 ? void 0 : sch.$ref);
|
|
19290
|
+
if (sch instanceof compile_1.SchemaEnv)
|
|
19291
|
+
sch = sch.schema;
|
|
19292
|
+
}
|
|
19293
|
+
const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
|
|
19181
19294
|
if (typeof propSch != "object") {
|
|
19182
|
-
throw new Error(`discriminator: oneOf schemas must have "properties/${tagName}"`);
|
|
19295
|
+
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
|
|
19183
19296
|
}
|
|
19184
19297
|
tagRequired = tagRequired && (topRequired || hasRequired(sch));
|
|
19185
19298
|
addMappings(propSch, i);
|