@nmshd/runtime 2.0.0-alpha.10 → 2.0.0-alpha.13
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 +15 -21
- package/dist/dataViews/DataViewExpander.js +160 -207
- package/dist/dataViews/DataViewExpander.js.map +1 -1
- package/dist/dataViews/DataViewObject.d.ts +1 -1
- package/dist/dataViews/consumption/ConsumptionAttributeDVO.d.ts +65 -0
- package/dist/dataViews/{content/AttributeDVO.js → consumption/ConsumptionAttributeDVO.js} +1 -1
- package/dist/dataViews/consumption/ConsumptionAttributeDVO.js.map +1 -0
- package/dist/dataViews/consumption/ConsumptionRequestDVO.d.ts +26 -0
- package/dist/dataViews/consumption/{StoredAttributeDVO.js → ConsumptionRequestDVO.js} +1 -1
- package/dist/dataViews/consumption/ConsumptionRequestDVO.js.map +1 -0
- package/dist/dataViews/consumption/index.d.ts +2 -1
- package/dist/dataViews/consumption/index.js +2 -1
- package/dist/dataViews/consumption/index.js.map +1 -1
- package/dist/dataViews/content/RequestDVOs.d.ts +14 -18
- package/dist/dataViews/content/index.d.ts +0 -1
- package/dist/dataViews/content/index.js +0 -1
- package/dist/dataViews/content/index.js.map +1 -1
- package/dist/extensibility/facades/consumption/AttributesFacade.d.ts +4 -10
- package/dist/extensibility/facades/consumption/AttributesFacade.js +6 -24
- package/dist/extensibility/facades/consumption/AttributesFacade.js.map +1 -1
- package/dist/types/consumption/ConsumptionAttributeDTO.d.ts +6 -2
- package/dist/useCases/common/Schemas.d.ts +1 -4
- package/dist/useCases/common/Schemas.js +427 -96
- package/dist/useCases/common/Schemas.js.map +1 -1
- package/dist/useCases/consumption/attributes/AttributeMapper.d.ts +0 -2
- package/dist/useCases/consumption/attributes/AttributeMapper.js +6 -9
- package/dist/useCases/consumption/attributes/AttributeMapper.js.map +1 -1
- package/dist/useCases/consumption/attributes/CreateAttribute.d.ts +6 -6
- package/dist/useCases/consumption/attributes/CreateAttribute.js +13 -9
- package/dist/useCases/consumption/attributes/CreateAttribute.js.map +1 -1
- package/dist/useCases/consumption/attributes/CreateShareAttributeCopy.d.ts +29 -0
- package/dist/useCases/consumption/attributes/{DeleteAttributeByName.js → CreateShareAttributeCopy.js} +23 -18
- package/dist/useCases/consumption/attributes/CreateShareAttributeCopy.js.map +1 -0
- package/dist/useCases/consumption/attributes/DeleteAttribute.d.ts +7 -4
- package/dist/useCases/consumption/attributes/DeleteAttribute.js +10 -7
- package/dist/useCases/consumption/attributes/DeleteAttribute.js.map +1 -1
- package/dist/useCases/consumption/attributes/ExtendedAttributeValue.d.ts +10 -0
- package/dist/{dataViews/consumption/MatchedAttributesDVO.js → useCases/consumption/attributes/ExtendedAttributeValue.js} +1 -1
- package/dist/useCases/consumption/attributes/ExtendedAttributeValue.js.map +1 -0
- package/dist/useCases/consumption/attributes/GetAllValid.js +1 -1
- package/dist/useCases/consumption/attributes/GetAllValid.js.map +1 -1
- package/dist/useCases/consumption/attributes/GetAttribute.d.ts +7 -4
- package/dist/useCases/consumption/attributes/GetAttribute.js +10 -7
- package/dist/useCases/consumption/attributes/GetAttribute.js.map +1 -1
- package/dist/useCases/consumption/attributes/GetAttributes.d.ts +29 -6
- package/dist/useCases/consumption/attributes/GetAttributes.js +108 -12
- package/dist/useCases/consumption/attributes/GetAttributes.js.map +1 -1
- package/dist/useCases/consumption/attributes/SucceedAttribute.d.ts +10 -7
- package/dist/useCases/consumption/attributes/SucceedAttribute.js +14 -10
- package/dist/useCases/consumption/attributes/SucceedAttribute.js.map +1 -1
- package/dist/useCases/consumption/attributes/UpdateAttribute.d.ts +9 -6
- package/dist/useCases/consumption/attributes/UpdateAttribute.js +14 -15
- package/dist/useCases/consumption/attributes/UpdateAttribute.js.map +1 -1
- package/dist/useCases/consumption/attributes/index.d.ts +1 -4
- package/dist/useCases/consumption/attributes/index.js +1 -4
- package/dist/useCases/consumption/attributes/index.js.map +1 -1
- package/dist/useCases/consumption/requests/CompleteIncomingRequest.d.ts +1 -1
- package/dist/useCases/consumption/requests/RequestValidationResultMapper.js +2 -2
- package/dist/useCases/consumption/requests/RequestValidationResultMapper.js.map +1 -1
- package/dist/useCases/transport/challenges/{ValidateChallange.d.ts → ValidateChallenge.d.ts} +0 -0
- package/dist/useCases/transport/challenges/{ValidateChallange.js → ValidateChallenge.js} +1 -1
- package/dist/useCases/transport/challenges/{ValidateChallange.js.map → ValidateChallenge.js.map} +1 -1
- package/dist/useCases/transport/challenges/index.d.ts +1 -1
- package/dist/useCases/transport/challenges/index.js +1 -1
- package/dist/useCases/transport/messages/GetMessages.js +0 -1
- package/dist/useCases/transport/messages/GetMessages.js.map +1 -1
- package/lib-web/nmshd.runtime.js +853 -646
- package/lib-web/nmshd.runtime.js.map +1 -1
- package/lib-web/nmshd.runtime.min.js +3 -3
- package/lib-web/nmshd.runtime.min.js.map +1 -1
- package/package.json +7 -7
- package/dist/dataViews/consumption/MatchedAttributesDVO.d.ts +0 -8
- package/dist/dataViews/consumption/MatchedAttributesDVO.js.map +0 -1
- package/dist/dataViews/consumption/StoredAttributeDVO.d.ts +0 -6
- package/dist/dataViews/consumption/StoredAttributeDVO.js.map +0 -1
- package/dist/dataViews/content/AttributeDVO.d.ts +0 -14
- package/dist/dataViews/content/AttributeDVO.js.map +0 -1
- package/dist/useCases/consumption/attributes/DeleteAttributeByName.d.ts +0 -17
- package/dist/useCases/consumption/attributes/DeleteAttributeByName.js.map +0 -1
- package/dist/useCases/consumption/attributes/GetAttributeByName.d.ts +0 -16
- package/dist/useCases/consumption/attributes/GetAttributeByName.js +0 -47
- package/dist/useCases/consumption/attributes/GetAttributeByName.js.map +0 -1
- package/dist/useCases/consumption/attributes/GetAttributesByNames.d.ts +0 -16
- package/dist/useCases/consumption/attributes/GetAttributesByNames.js +0 -42
- package/dist/useCases/consumption/attributes/GetAttributesByNames.js.map +0 -1
- package/dist/useCases/consumption/attributes/GetHistoryByName.d.ts +0 -16
- package/dist/useCases/consumption/attributes/GetHistoryByName.js +0 -47
- package/dist/useCases/consumption/attributes/GetHistoryByName.js.map +0 -1
package/lib-web/nmshd.runtime.js
CHANGED
|
@@ -435,11 +435,11 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
|
435
435
|
const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
|
|
436
436
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
437
437
|
exports.buildInformation = {
|
|
438
|
-
version: "2.0.0-alpha.
|
|
439
|
-
build: "
|
|
440
|
-
date: "2022-
|
|
441
|
-
commit: "
|
|
442
|
-
dependencies: {"@js-soft/docdb-querytranslator":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/ts-serval":"2.0.3","@js-soft/ts-utils":"^1.1.2","@nmshd/consumption":"2.0.0-alpha.
|
|
438
|
+
version: "2.0.0-alpha.13",
|
|
439
|
+
build: "60",
|
|
440
|
+
date: "2022-06-01T10:35:04+00:00",
|
|
441
|
+
commit: "0b4c874c72636c43a1a3d8462edfa1948ac167a7",
|
|
442
|
+
dependencies: {"@js-soft/docdb-querytranslator":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/ts-serval":"2.0.3","@js-soft/ts-utils":"^1.1.2","@nmshd/consumption":"2.0.0-alpha.19","@nmshd/content":"2.0.0-alpha.25","@nmshd/crypto":"2.0.1","@nmshd/transport":"2.0.0-alpha.1","ajv":"^8.11.0","ajv-errors":"^3.0.0","ajv-formats":"^2.1.1","fluent-ts-validator":"3.0.3","json-stringify-safe":"^5.0.1","luxon":"^2.4.0","qrcode":"1.5.0","reflect-metadata":"0.1.13","ts-simple-nameof":"1.3.1","typescript-ioc":"3.2.2"},
|
|
443
443
|
libraries: {
|
|
444
444
|
serval: ts_serval_1.buildInformation,
|
|
445
445
|
consumption: consumption_1.buildInformation,
|
|
@@ -474,6 +474,9 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
474
474
|
};
|
|
475
475
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
476
476
|
exports.DataViewExpander = void 0;
|
|
477
|
+
const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
|
|
478
|
+
const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
|
|
479
|
+
const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
477
480
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
478
481
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
479
482
|
const extensibility_1 = __webpack_require__(/*! ../extensibility */ "./dist/extensibility/index.js");
|
|
@@ -483,9 +486,10 @@ const DataViewTranslateable_1 = __webpack_require__(/*! ./DataViewTranslateable
|
|
|
483
486
|
const MessageDVO_1 = __webpack_require__(/*! ./transport/MessageDVO */ "./dist/dataViews/transport/MessageDVO.js");
|
|
484
487
|
const RelationshipDVO_1 = __webpack_require__(/*! ./transport/RelationshipDVO */ "./dist/dataViews/transport/RelationshipDVO.js");
|
|
485
488
|
let DataViewExpander = class DataViewExpander {
|
|
486
|
-
constructor(transport, consumption, identityController) {
|
|
489
|
+
constructor(transport, consumption, consumptionController, identityController) {
|
|
487
490
|
this.transport = transport;
|
|
488
491
|
this.consumption = consumption;
|
|
492
|
+
this.consumptionController = consumptionController;
|
|
489
493
|
this.identityController = identityController;
|
|
490
494
|
}
|
|
491
495
|
async expand(content, expectedType) {
|
|
@@ -509,31 +513,11 @@ let DataViewExpander = class DataViewExpander {
|
|
|
509
513
|
return await this.expandMessageDTOs(content);
|
|
510
514
|
}
|
|
511
515
|
return await this.expandMessageDTO(content);
|
|
512
|
-
case "AttributesRequest":
|
|
513
|
-
if (content instanceof Array) {
|
|
514
|
-
return await this.expandUnknownRequests(content);
|
|
515
|
-
}
|
|
516
|
-
return await this.expandUnknownRequest(content);
|
|
517
|
-
case "AttributesShareRequest":
|
|
518
|
-
if (content instanceof Array) {
|
|
519
|
-
return await this.expandAttributesShareRequests(content);
|
|
520
|
-
}
|
|
521
|
-
return await this.expandAttributesShareRequest(content);
|
|
522
|
-
case "AttributesChangeRequest":
|
|
523
|
-
if (content instanceof Array) {
|
|
524
|
-
return await this.expandAttributesChangeRequests(content);
|
|
525
|
-
}
|
|
526
|
-
return await this.expandAttributesChangeRequest(content);
|
|
527
516
|
case "Attribute":
|
|
528
517
|
if (content instanceof Array) {
|
|
529
518
|
return await this.expandAttributes(content);
|
|
530
519
|
}
|
|
531
|
-
return this.expandAttribute(content);
|
|
532
|
-
case "AttributeName":
|
|
533
|
-
if (content instanceof Array) {
|
|
534
|
-
return await this.expandAttributeNames(content);
|
|
535
|
-
}
|
|
536
|
-
return await this.expandAttributeName(content);
|
|
520
|
+
return await this.expandAttribute(content);
|
|
537
521
|
case "Address":
|
|
538
522
|
if (content instanceof Array) {
|
|
539
523
|
return await this.expandAddresses(content);
|
|
@@ -563,7 +547,7 @@ let DataViewExpander = class DataViewExpander {
|
|
|
563
547
|
if (content instanceof Array) {
|
|
564
548
|
return await this.expandConsumptionAttributes(content);
|
|
565
549
|
}
|
|
566
|
-
return this.expandConsumptionAttribute(content);
|
|
550
|
+
return await this.expandConsumptionAttribute(content);
|
|
567
551
|
default:
|
|
568
552
|
throw useCases_1.RuntimeErrors.general.notImplemented();
|
|
569
553
|
}
|
|
@@ -641,7 +625,7 @@ let DataViewExpander = class DataViewExpander {
|
|
|
641
625
|
...mailDVO,
|
|
642
626
|
type: "RequestMailDVO",
|
|
643
627
|
name: requestMailContent.subject ? requestMailContent.subject : DataViewTranslateable_1.DataViewTranslateable.consumption.mails.requestMailSubjectFallback,
|
|
644
|
-
requests:
|
|
628
|
+
requests: [],
|
|
645
629
|
requestCount: requestMailContent.requests.length
|
|
646
630
|
};
|
|
647
631
|
return requestMailDVO;
|
|
@@ -654,211 +638,184 @@ let DataViewExpander = class DataViewExpander {
|
|
|
654
638
|
const messagePromises = messages.map((message) => this.expandMessageDTO(message));
|
|
655
639
|
return await Promise.all(messagePromises);
|
|
656
640
|
}
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
case "AttributesRequest":
|
|
660
|
-
return await this.expandAttributesRequest(request);
|
|
661
|
-
case "AttributesShareRequest":
|
|
662
|
-
return await this.expandAttributesShareRequest(request);
|
|
663
|
-
case "AttributesChangeRequest":
|
|
664
|
-
return await this.expandAttributesChangeRequest(request);
|
|
665
|
-
}
|
|
641
|
+
expandRequest(request) {
|
|
642
|
+
const id = request.id ? request.id : "";
|
|
666
643
|
return {
|
|
667
|
-
id:
|
|
668
|
-
name: `${request["@type"]} ${
|
|
669
|
-
description: "i18n://dvo.request.unknownType",
|
|
644
|
+
id: id,
|
|
645
|
+
name: `${request["@type"]} ${id}`,
|
|
670
646
|
type: "RequestDVO",
|
|
671
647
|
date: request.expiresAt,
|
|
672
648
|
...request
|
|
673
649
|
};
|
|
674
650
|
}
|
|
675
|
-
|
|
651
|
+
async expandConsumptionRequest(request) {
|
|
676
652
|
return {
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
653
|
+
...request,
|
|
654
|
+
id: request.id,
|
|
655
|
+
name: "i18n://dvo.request.name.response",
|
|
656
|
+
type: "ConsumptionRequestDVO",
|
|
657
|
+
date: request.createdAt,
|
|
658
|
+
peer: await this.expandAddress(request.peer),
|
|
659
|
+
response: request.response ? this.expandConsumptionResponse(request.response) : undefined
|
|
682
660
|
};
|
|
683
661
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
662
|
+
expandConsumptionResponse(response) {
|
|
663
|
+
return {
|
|
664
|
+
...response,
|
|
665
|
+
id: "",
|
|
666
|
+
name: "i18n://dvo.request.name.response",
|
|
667
|
+
type: "ConsumptionResponseDVO",
|
|
668
|
+
date: response.createdAt
|
|
669
|
+
};
|
|
687
670
|
}
|
|
688
|
-
async
|
|
689
|
-
const
|
|
690
|
-
const
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
671
|
+
async expandConsumptionAttribute(attribute) {
|
|
672
|
+
const valueType = attribute.content.value["@type"];
|
|
673
|
+
const consumptionAttribute = await this.consumptionController.attributes.getConsumptionAttribute(transport_1.CoreId.from(attribute.id));
|
|
674
|
+
if (!consumptionAttribute) {
|
|
675
|
+
throw new Error("Attribute not found");
|
|
676
|
+
}
|
|
677
|
+
const owner = await this.expandAddress(attribute.content.owner);
|
|
678
|
+
let name = `i18n://dvo.attribute.name.${valueType}`;
|
|
679
|
+
let description = `i18n://dvo.attribute.description.${valueType}`;
|
|
680
|
+
if (consumptionAttribute.content instanceof content_1.RelationshipAttribute) {
|
|
681
|
+
name = "";
|
|
682
|
+
description = "";
|
|
683
|
+
}
|
|
684
|
+
const renderHints = consumptionAttribute.content.value.renderHints.toJSON();
|
|
685
|
+
const valueHints = consumptionAttribute.content.value.valueHints.toJSON();
|
|
686
|
+
if (consumptionAttribute.shareInfo) {
|
|
687
|
+
const peer = await this.expandAddress(consumptionAttribute.shareInfo.peer.toString());
|
|
688
|
+
if (consumptionAttribute.shareInfo.sourceAttribute) {
|
|
689
|
+
// Own Shared Attribute
|
|
690
|
+
return {
|
|
691
|
+
type: "SharedToPeerAttributeDVO",
|
|
692
|
+
id: attribute.id,
|
|
693
|
+
name,
|
|
694
|
+
description,
|
|
695
|
+
content: attribute.content,
|
|
696
|
+
value: attribute.content.value,
|
|
697
|
+
date: attribute.createdAt,
|
|
698
|
+
owner: owner,
|
|
699
|
+
renderHints,
|
|
700
|
+
valueHints,
|
|
701
|
+
isValid: true,
|
|
702
|
+
createdAt: attribute.createdAt,
|
|
703
|
+
isOwn: true,
|
|
704
|
+
peer: peer,
|
|
705
|
+
requestReference: consumptionAttribute.shareInfo.requestReference.toString(),
|
|
706
|
+
sourceAttribute: consumptionAttribute.shareInfo.sourceAttribute.toString()
|
|
707
|
+
};
|
|
710
708
|
}
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
709
|
+
// Peer Attribute
|
|
710
|
+
return {
|
|
711
|
+
type: "PeerAttributeDVO",
|
|
712
|
+
id: attribute.id,
|
|
713
|
+
name,
|
|
714
|
+
description,
|
|
715
|
+
content: attribute.content,
|
|
716
|
+
value: attribute.content.value,
|
|
717
|
+
date: attribute.createdAt,
|
|
718
|
+
owner: owner,
|
|
719
|
+
renderHints,
|
|
720
|
+
valueHints,
|
|
721
|
+
isValid: true,
|
|
722
|
+
createdAt: attribute.createdAt,
|
|
723
|
+
isOwn: false,
|
|
724
|
+
peer: peer,
|
|
725
|
+
requestReference: consumptionAttribute.shareInfo.requestReference.toString()
|
|
718
726
|
};
|
|
719
|
-
if (!request.warnings) {
|
|
720
|
-
request.warnings = [];
|
|
721
|
-
}
|
|
722
|
-
request.warnings.push(warning);
|
|
723
|
-
}
|
|
724
|
-
const attributesObjects = [];
|
|
725
|
-
for (const attributeName of attributesShareRequest.attributes) {
|
|
726
|
-
const attributeDVO = await this.expandAttributeName(attributeName);
|
|
727
|
-
attributesObjects.push(attributeDVO);
|
|
728
|
-
}
|
|
729
|
-
let name;
|
|
730
|
-
if (attributesObjects.length > 1) {
|
|
731
|
-
name = DataViewTranslateable_1.DataViewTranslateable.consumption.requests.attributesShareRequestNamePlural;
|
|
732
|
-
}
|
|
733
|
-
else {
|
|
734
|
-
name = DataViewTranslateable_1.DataViewTranslateable.consumption.requests.attributesShareRequestName;
|
|
735
727
|
}
|
|
728
|
+
const sharedToPeerAttributes = await this.consumption.attributes.getAttributes({ query: { shareInfo: { sourceAttribute: attribute.id } } });
|
|
729
|
+
const sharedToPeerDVOs = await this.expandConsumptionAttributes(sharedToPeerAttributes.value);
|
|
730
|
+
// Own Source Attribute
|
|
736
731
|
return {
|
|
737
|
-
|
|
738
|
-
name,
|
|
739
|
-
type: "AttributesShareRequestDVO",
|
|
740
|
-
attributes: attributesObjects,
|
|
741
|
-
attributeCount: attributesObjects.length,
|
|
742
|
-
recipients: recipientObjects,
|
|
743
|
-
recipientCount: recipientObjects.length,
|
|
744
|
-
possibleRecipientCount
|
|
745
|
-
};
|
|
746
|
-
}
|
|
747
|
-
expandConsumptionAttribute(attribute) {
|
|
748
|
-
return {
|
|
749
|
-
type: "StoredAttributeDVO",
|
|
732
|
+
type: "RepositoryAttributeDVO",
|
|
750
733
|
id: attribute.id,
|
|
751
|
-
name
|
|
734
|
+
name,
|
|
735
|
+
description,
|
|
736
|
+
content: attribute.content,
|
|
752
737
|
value: attribute.content.value,
|
|
753
738
|
date: attribute.createdAt,
|
|
739
|
+
owner: owner,
|
|
740
|
+
renderHints,
|
|
741
|
+
valueHints,
|
|
742
|
+
isValid: true,
|
|
743
|
+
createdAt: attribute.createdAt,
|
|
754
744
|
isOwn: true,
|
|
755
|
-
|
|
756
|
-
sharedItemCount: 0
|
|
745
|
+
sharedWith: sharedToPeerDVOs
|
|
757
746
|
};
|
|
758
747
|
}
|
|
759
748
|
async expandConsumptionAttributes(attributes) {
|
|
760
749
|
const attributesPromise = attributes.map((attribute) => this.expandConsumptionAttribute(attribute));
|
|
761
750
|
return await Promise.all(attributesPromise);
|
|
762
751
|
}
|
|
763
|
-
async
|
|
764
|
-
const
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
752
|
+
async expandIdentityAttributeQuery(query) {
|
|
753
|
+
const queryInstance = content_1.IdentityAttributeQuery.from(query);
|
|
754
|
+
const matchedAttributes = await this.consumptionController.attributes.executeIdentityAttributeQuery({ query: queryInstance });
|
|
755
|
+
const matchedAttributeDTOs = useCases_1.AttributeMapper.toAttributeDTOList(matchedAttributes);
|
|
756
|
+
const matchedAttributeDVOs = await this.expandConsumptionAttributes(matchedAttributeDTOs);
|
|
757
|
+
const valueType = query.valueType;
|
|
758
|
+
const name = `i18n://dvo.attribute.name.${valueType}`;
|
|
759
|
+
const description = `i18n://dvo.attribute.description.${valueType}`;
|
|
760
|
+
const valueTypeClass = ts_serval_1.SerializableBase.getModule(valueType, 1);
|
|
761
|
+
if (!valueTypeClass) {
|
|
762
|
+
throw new Error(`No class implementation found for ${valueType}`);
|
|
763
|
+
}
|
|
764
|
+
let renderHints = {
|
|
765
|
+
"@type": "RenderHints",
|
|
766
|
+
editType: content_1.RenderHintsEditType.InputLike,
|
|
767
|
+
technicalType: content_1.RenderHintsTechnicalType.String
|
|
768
|
+
};
|
|
769
|
+
let valueHints = {
|
|
770
|
+
"@type": "ValueHints",
|
|
771
|
+
max: 200
|
|
772
|
+
};
|
|
773
|
+
if (valueTypeClass.renderHints && valueTypeClass.renderHints instanceof content_1.RenderHints) {
|
|
774
|
+
renderHints = valueTypeClass.renderHints.toJSON();
|
|
768
775
|
}
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
bestMatch = matchedAttributes[0];
|
|
776
|
+
if (valueTypeClass.valueHints && valueTypeClass.valueHints instanceof content_1.ValueHints) {
|
|
777
|
+
valueHints = valueTypeClass.valueHints.toJSON();
|
|
772
778
|
}
|
|
773
779
|
return {
|
|
774
|
-
type: "
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
+
type: "IdentityAttributeQueryExpanded",
|
|
781
|
+
name,
|
|
782
|
+
description,
|
|
783
|
+
valueType,
|
|
784
|
+
validFrom: query.validFrom,
|
|
785
|
+
validTo: query.validTo,
|
|
786
|
+
results: matchedAttributeDVOs,
|
|
787
|
+
renderHints,
|
|
788
|
+
valueHints
|
|
780
789
|
};
|
|
781
790
|
}
|
|
782
|
-
async
|
|
783
|
-
const
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
791
|
+
async expandAttribute(attribute) {
|
|
792
|
+
const attributeInstance = ts_serval_1.Serializable.fromAny(attribute);
|
|
793
|
+
const valueType = attribute.value["@type"];
|
|
794
|
+
let name = `i18n://dvo.attribute.name.${valueType}`;
|
|
795
|
+
let description = `i18n://dvo.attribute.description.${valueType}`;
|
|
796
|
+
const renderHints = attributeInstance.value.renderHints.toJSON();
|
|
797
|
+
const valueHints = attributeInstance.value.valueHints.toJSON();
|
|
798
|
+
if (attributeInstance instanceof content_1.RelationshipAttribute) {
|
|
799
|
+
name = ""; // attributeInstance.value.title;
|
|
800
|
+
description = ""; // attributeInstance.value.description;
|
|
801
|
+
}
|
|
802
|
+
const owner = await this.expandAddress(attribute.owner);
|
|
787
803
|
return {
|
|
788
|
-
type: "
|
|
789
|
-
|
|
790
|
-
name
|
|
791
|
-
|
|
792
|
-
|
|
804
|
+
type: "DraftAttributeDVO",
|
|
805
|
+
content: attribute,
|
|
806
|
+
name,
|
|
807
|
+
description,
|
|
808
|
+
id: "",
|
|
809
|
+
owner: owner,
|
|
810
|
+
renderHints,
|
|
811
|
+
valueHints,
|
|
812
|
+
value: attribute.value
|
|
793
813
|
};
|
|
794
814
|
}
|
|
795
815
|
async expandAttributes(attributes) {
|
|
796
816
|
const attributesPromise = attributes.map((attribute) => this.expandAttribute(attribute));
|
|
797
817
|
return await Promise.all(attributesPromise);
|
|
798
818
|
}
|
|
799
|
-
async expandAttributesChangeRequest(attributesChangeRequest) {
|
|
800
|
-
const request = this.expandRequest(attributesChangeRequest);
|
|
801
|
-
let applyToObject;
|
|
802
|
-
if (attributesChangeRequest.applyTo) {
|
|
803
|
-
applyToObject = await this.expandIdentityForAddress(attributesChangeRequest.applyTo);
|
|
804
|
-
}
|
|
805
|
-
else {
|
|
806
|
-
applyToObject = this.expandSelf();
|
|
807
|
-
}
|
|
808
|
-
let name;
|
|
809
|
-
const attributesObjects = [];
|
|
810
|
-
for (const attribute of attributesChangeRequest.attributes) {
|
|
811
|
-
const attributeDVO = this.expandAttribute(attribute);
|
|
812
|
-
attributesObjects.push(attributeDVO);
|
|
813
|
-
}
|
|
814
|
-
const oldAttributesObjects = await this.expandAttributeNames(attributesObjects.map((item) => item.id));
|
|
815
|
-
if (attributesObjects.length > 1) {
|
|
816
|
-
name = DataViewTranslateable_1.DataViewTranslateable.consumption.requests.attributesChangeRequestNamePlural;
|
|
817
|
-
}
|
|
818
|
-
else {
|
|
819
|
-
name = DataViewTranslateable_1.DataViewTranslateable.consumption.requests.attributesChangeRequestName;
|
|
820
|
-
}
|
|
821
|
-
const changes = [];
|
|
822
|
-
attributesObjects.forEach((attribute, index) => {
|
|
823
|
-
changes.push({
|
|
824
|
-
oldAttribute: oldAttributesObjects[index],
|
|
825
|
-
newAttribute: attribute
|
|
826
|
-
});
|
|
827
|
-
});
|
|
828
|
-
return {
|
|
829
|
-
...request,
|
|
830
|
-
type: "AttributesChangeRequestDVO",
|
|
831
|
-
name: name,
|
|
832
|
-
newAttributes: attributesObjects,
|
|
833
|
-
newAttributeCount: attributesObjects.length,
|
|
834
|
-
oldAttributes: oldAttributesObjects,
|
|
835
|
-
oldAttributeCount: oldAttributesObjects.length,
|
|
836
|
-
applyTo: applyToObject,
|
|
837
|
-
changes: changes,
|
|
838
|
-
changeCount: changes.length
|
|
839
|
-
};
|
|
840
|
-
}
|
|
841
|
-
async expandAttributesRequest(attributesRequest) {
|
|
842
|
-
const request = this.expandRequest(attributesRequest);
|
|
843
|
-
let name;
|
|
844
|
-
const attributesObjects = await this.expandAttributeNames(attributesRequest.names);
|
|
845
|
-
if (attributesObjects.length > 1) {
|
|
846
|
-
name = DataViewTranslateable_1.DataViewTranslateable.consumption.requests.attributesChangeRequestNamePlural;
|
|
847
|
-
}
|
|
848
|
-
else {
|
|
849
|
-
name = DataViewTranslateable_1.DataViewTranslateable.consumption.requests.attributesChangeRequestName;
|
|
850
|
-
}
|
|
851
|
-
return {
|
|
852
|
-
...request,
|
|
853
|
-
type: "AttributesRequestDVO",
|
|
854
|
-
names: attributesRequest.names,
|
|
855
|
-
nameCount: attributesRequest.names.length,
|
|
856
|
-
name: name,
|
|
857
|
-
attributes: attributesObjects,
|
|
858
|
-
attributeCount: attributesObjects.length,
|
|
859
|
-
required: attributesRequest.required
|
|
860
|
-
};
|
|
861
|
-
}
|
|
862
819
|
expandSelf() {
|
|
863
820
|
const name = "i18n://dvo.identity.self.name";
|
|
864
821
|
const initials = "i18n://dvo.identity.self.initials";
|
|
@@ -877,7 +834,7 @@ let DataViewExpander = class DataViewExpander {
|
|
|
877
834
|
const name = address.substring(3, 9);
|
|
878
835
|
const initials = (name.match(/\b\w/g) ?? []).join("");
|
|
879
836
|
return {
|
|
880
|
-
id:
|
|
837
|
+
id: address,
|
|
881
838
|
type: "IdentityDVO",
|
|
882
839
|
name: name,
|
|
883
840
|
initials: initials,
|
|
@@ -887,14 +844,6 @@ let DataViewExpander = class DataViewExpander {
|
|
|
887
844
|
hasRelationship: false
|
|
888
845
|
};
|
|
889
846
|
}
|
|
890
|
-
async expandAttributesShareRequests(requests) {
|
|
891
|
-
const requestsPromise = requests.map((request) => this.expandAttributesShareRequest(request));
|
|
892
|
-
return await Promise.all(requestsPromise);
|
|
893
|
-
}
|
|
894
|
-
async expandAttributesChangeRequests(requests) {
|
|
895
|
-
const requestsPromise = requests.map((request) => this.expandAttributesChangeRequest(request));
|
|
896
|
-
return await Promise.all(requestsPromise);
|
|
897
|
-
}
|
|
898
847
|
async expandAddress(address) {
|
|
899
848
|
if (this.identityController.isMe(transport_1.CoreAddress.from(address))) {
|
|
900
849
|
return this.expandSelf();
|
|
@@ -1014,14 +963,16 @@ let DataViewExpander = class DataViewExpander {
|
|
|
1014
963
|
// const relationshipInfo = relationshipInfoResult.value;
|
|
1015
964
|
// const name = relationshipInfo.userTitle ? relationshipInfo.userTitle : relationshipInfo.title;
|
|
1016
965
|
// let description = relationshipInfo.userDescription ? relationshipInfo.userDescription : relationshipInfo.description;
|
|
1017
|
-
const name =
|
|
1018
|
-
const description = "";
|
|
966
|
+
const name = relationship.peer.substring(3, 9);
|
|
1019
967
|
const initials = (name.match(/\b\w/g) ?? []).join("");
|
|
1020
968
|
const relationshipDVO = await this.createRelationshipDVO(relationship);
|
|
969
|
+
const description = relationshipDVO.statusText;
|
|
1021
970
|
// TODO: re-enable when we can query relationship info
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
971
|
+
/*
|
|
972
|
+
if (!description) {
|
|
973
|
+
description = relationshipDVO.statusText;
|
|
974
|
+
}
|
|
975
|
+
*/
|
|
1025
976
|
return {
|
|
1026
977
|
type: "IdentityDVO",
|
|
1027
978
|
id: relationship.peer,
|
|
@@ -1104,8 +1055,10 @@ DataViewExpander = __decorate([
|
|
|
1104
1055
|
__param(0, typescript_ioc_1.Inject),
|
|
1105
1056
|
__param(1, typescript_ioc_1.Inject),
|
|
1106
1057
|
__param(2, typescript_ioc_1.Inject),
|
|
1058
|
+
__param(3, typescript_ioc_1.Inject),
|
|
1107
1059
|
__metadata("design:paramtypes", [extensibility_1.TransportServices,
|
|
1108
1060
|
ConsumptionServices_1.ConsumptionServices,
|
|
1061
|
+
consumption_1.ConsumptionController,
|
|
1109
1062
|
transport_1.IdentityController])
|
|
1110
1063
|
], DataViewExpander);
|
|
1111
1064
|
exports.DataViewExpander = DataViewExpander;
|
|
@@ -1234,16 +1187,29 @@ __exportStar(__webpack_require__(/*! ./Warning */ "./dist/dataViews/common/Warni
|
|
|
1234
1187
|
|
|
1235
1188
|
/***/ }),
|
|
1236
1189
|
|
|
1237
|
-
/***/ "./dist/dataViews/consumption/
|
|
1238
|
-
|
|
1239
|
-
!*** ./dist/dataViews/consumption/
|
|
1240
|
-
|
|
1190
|
+
/***/ "./dist/dataViews/consumption/ConsumptionAttributeDVO.js":
|
|
1191
|
+
/*!***************************************************************!*\
|
|
1192
|
+
!*** ./dist/dataViews/consumption/ConsumptionAttributeDVO.js ***!
|
|
1193
|
+
\***************************************************************/
|
|
1241
1194
|
/***/ ((__unused_webpack_module, exports) => {
|
|
1242
1195
|
|
|
1243
1196
|
"use strict";
|
|
1244
1197
|
|
|
1245
1198
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1246
|
-
//# sourceMappingURL=
|
|
1199
|
+
//# sourceMappingURL=ConsumptionAttributeDVO.js.map
|
|
1200
|
+
|
|
1201
|
+
/***/ }),
|
|
1202
|
+
|
|
1203
|
+
/***/ "./dist/dataViews/consumption/ConsumptionRequestDVO.js":
|
|
1204
|
+
/*!*************************************************************!*\
|
|
1205
|
+
!*** ./dist/dataViews/consumption/ConsumptionRequestDVO.js ***!
|
|
1206
|
+
\*************************************************************/
|
|
1207
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1208
|
+
|
|
1209
|
+
"use strict";
|
|
1210
|
+
|
|
1211
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1212
|
+
//# sourceMappingURL=ConsumptionRequestDVO.js.map
|
|
1247
1213
|
|
|
1248
1214
|
/***/ }),
|
|
1249
1215
|
|
|
@@ -1270,24 +1236,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
1270
1236
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1271
1237
|
};
|
|
1272
1238
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1273
|
-
__exportStar(__webpack_require__(/*! ./
|
|
1239
|
+
__exportStar(__webpack_require__(/*! ./ConsumptionAttributeDVO */ "./dist/dataViews/consumption/ConsumptionAttributeDVO.js"), exports);
|
|
1240
|
+
__exportStar(__webpack_require__(/*! ./ConsumptionRequestDVO */ "./dist/dataViews/consumption/ConsumptionRequestDVO.js"), exports);
|
|
1274
1241
|
//# sourceMappingURL=index.js.map
|
|
1275
1242
|
|
|
1276
1243
|
/***/ }),
|
|
1277
1244
|
|
|
1278
|
-
/***/ "./dist/dataViews/content/AttributeDVO.js":
|
|
1279
|
-
/*!************************************************!*\
|
|
1280
|
-
!*** ./dist/dataViews/content/AttributeDVO.js ***!
|
|
1281
|
-
\************************************************/
|
|
1282
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
1283
|
-
|
|
1284
|
-
"use strict";
|
|
1285
|
-
|
|
1286
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1287
|
-
//# sourceMappingURL=AttributeDVO.js.map
|
|
1288
|
-
|
|
1289
|
-
/***/ }),
|
|
1290
|
-
|
|
1291
1245
|
/***/ "./dist/dataViews/content/MailDVOs.js":
|
|
1292
1246
|
/*!********************************************!*\
|
|
1293
1247
|
!*** ./dist/dataViews/content/MailDVOs.js ***!
|
|
@@ -1337,7 +1291,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
1337
1291
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1338
1292
|
};
|
|
1339
1293
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1340
|
-
__exportStar(__webpack_require__(/*! ./AttributeDVO */ "./dist/dataViews/content/AttributeDVO.js"), exports);
|
|
1341
1294
|
__exportStar(__webpack_require__(/*! ./MailDVOs */ "./dist/dataViews/content/MailDVOs.js"), exports);
|
|
1342
1295
|
__exportStar(__webpack_require__(/*! ./RequestDVOs */ "./dist/dataViews/content/RequestDVOs.js"), exports);
|
|
1343
1296
|
//# sourceMappingURL=index.js.map
|
|
@@ -2263,46 +2216,34 @@ exports.AttributesFacade = void 0;
|
|
|
2263
2216
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
2264
2217
|
const useCases_1 = __webpack_require__(/*! ../../../useCases */ "./dist/useCases/index.js");
|
|
2265
2218
|
let AttributesFacade = class AttributesFacade {
|
|
2266
|
-
constructor(createAttributeUseCase,
|
|
2219
|
+
constructor(createAttributeUseCase, createSharedAttributeCopyUseCase, deleteAttributeUseCase, getAllValidUseCase, getAttributeUseCase, getAttributesUseCase, succeedAttributeUseCase, updateAttributeUseCase) {
|
|
2267
2220
|
this.createAttributeUseCase = createAttributeUseCase;
|
|
2221
|
+
this.createSharedAttributeCopyUseCase = createSharedAttributeCopyUseCase;
|
|
2268
2222
|
this.deleteAttributeUseCase = deleteAttributeUseCase;
|
|
2269
|
-
this.deleteAttributeByNameUseCase = deleteAttributeByNameUseCase;
|
|
2270
2223
|
this.getAllValidUseCase = getAllValidUseCase;
|
|
2271
2224
|
this.getAttributeUseCase = getAttributeUseCase;
|
|
2272
|
-
this.getAttributeByNameUseCase = getAttributeByNameUseCase;
|
|
2273
2225
|
this.getAttributesUseCase = getAttributesUseCase;
|
|
2274
|
-
this.getAttributesByNamesUseCase = getAttributesByNamesUseCase;
|
|
2275
|
-
this.getHistoryByNameUseCase = getHistoryByNameUseCase;
|
|
2276
2226
|
this.succeedAttributeUseCase = succeedAttributeUseCase;
|
|
2277
2227
|
this.updateAttributeUseCase = updateAttributeUseCase;
|
|
2278
2228
|
}
|
|
2279
2229
|
async createAttribute(request) {
|
|
2280
2230
|
return await this.createAttributeUseCase.execute(request);
|
|
2281
2231
|
}
|
|
2232
|
+
async createSharedAttributeCopy(request) {
|
|
2233
|
+
return await this.createSharedAttributeCopyUseCase.execute(request);
|
|
2234
|
+
}
|
|
2282
2235
|
async deleteAttribute(request) {
|
|
2283
2236
|
return await this.deleteAttributeUseCase.execute(request);
|
|
2284
2237
|
}
|
|
2285
|
-
async deleteAttributeByName(request) {
|
|
2286
|
-
return await this.deleteAttributeByNameUseCase.execute(request);
|
|
2287
|
-
}
|
|
2288
2238
|
async getAllValid() {
|
|
2289
2239
|
return await this.getAllValidUseCase.execute();
|
|
2290
2240
|
}
|
|
2291
2241
|
async getAttribute(request) {
|
|
2292
2242
|
return await this.getAttributeUseCase.execute(request);
|
|
2293
2243
|
}
|
|
2294
|
-
async getAttributeByName(request) {
|
|
2295
|
-
return await this.getAttributeByNameUseCase.execute(request);
|
|
2296
|
-
}
|
|
2297
2244
|
async getAttributes(request) {
|
|
2298
2245
|
return await this.getAttributesUseCase.execute(request);
|
|
2299
2246
|
}
|
|
2300
|
-
async getAttributesByNames(request) {
|
|
2301
|
-
return await this.getAttributesByNamesUseCase.execute(request);
|
|
2302
|
-
}
|
|
2303
|
-
async getHistoryByName(request) {
|
|
2304
|
-
return await this.getHistoryByNameUseCase.execute(request);
|
|
2305
|
-
}
|
|
2306
2247
|
async succeedAttribute(request) {
|
|
2307
2248
|
return await this.succeedAttributeUseCase.execute(request);
|
|
2308
2249
|
}
|
|
@@ -2319,18 +2260,12 @@ AttributesFacade = __decorate([
|
|
|
2319
2260
|
__param(5, typescript_ioc_1.Inject),
|
|
2320
2261
|
__param(6, typescript_ioc_1.Inject),
|
|
2321
2262
|
__param(7, typescript_ioc_1.Inject),
|
|
2322
|
-
__param(8, typescript_ioc_1.Inject),
|
|
2323
|
-
__param(9, typescript_ioc_1.Inject),
|
|
2324
|
-
__param(10, typescript_ioc_1.Inject),
|
|
2325
2263
|
__metadata("design:paramtypes", [useCases_1.CreateAttributeUseCase,
|
|
2264
|
+
useCases_1.CreateSharedAttributeCopyUseCase,
|
|
2326
2265
|
useCases_1.DeleteAttributeUseCase,
|
|
2327
|
-
useCases_1.DeleteAttributeByNameUseCase,
|
|
2328
2266
|
useCases_1.GetAllValidUseCase,
|
|
2329
2267
|
useCases_1.GetAttributeUseCase,
|
|
2330
|
-
useCases_1.GetAttributeByNameUseCase,
|
|
2331
2268
|
useCases_1.GetAttributesUseCase,
|
|
2332
|
-
useCases_1.GetAttributesByNamesUseCase,
|
|
2333
|
-
useCases_1.GetHistoryByNameUseCase,
|
|
2334
2269
|
useCases_1.SucceedAttributeUseCase,
|
|
2335
2270
|
useCases_1.UpdateAttributeUseCase])
|
|
2336
2271
|
], AttributesFacade);
|
|
@@ -4677,8 +4612,8 @@ exports.JsonSchema = JsonSchema;
|
|
|
4677
4612
|
"use strict";
|
|
4678
4613
|
|
|
4679
4614
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4680
|
-
exports.GetDeviceRequest = exports.DeleteDeviceRequest = exports.CreateDeviceOnboardingTokenRequest = exports.CreateDeviceRequest = exports.ValidateChallengeRequest = exports.CreateChallengeRequest = exports.CreateDeviceChallengeRequest = exports.CreateIdentityChallengeRequest = exports.CreateRelationshipChallengeRequest = exports.SyncEverythingRequest = exports.DownloadAttachmentRequest = exports.DownloadFileRequest = exports.SyncDatawalletRequest = exports.RegisterPushNotificationTokenRequest = exports.UpdateSettingRequest = exports.GetSettingsRequest = exports.GetSettingRequest = exports.DeleteSettingRequest = exports.CreateSettingRequest = exports.SentOutgoingRequestRequest = exports.RequireManualDecisionOfIncomingRequestRequest = exports.ReceivedIncomingRequestRequest = exports.GetOutgoingRequestsRequest = exports.GetOutgoingRequestRequest = exports.GetIncomingRequestsRequest = exports.GetIncomingRequestRequest = exports.CreateAndCompleteOutgoingRequestFromRelationshipCreationChangeRequest = exports.CompleteOutgoingRequestRequest = exports.CompleteIncomingRequestRequest = exports.CheckPrerequisitesOfIncomingRequestRequest = exports.RejectIncomingRequestRequest = exports.CreateOutgoingRequestRequest = exports.AcceptIncomingRequestRequest = exports.UpdateDraftRequest = exports.GetDraftsRequest = exports.GetDraftRequest = exports.DeleteDraftRequest = exports.CreateDraftRequest = exports.UpdateAttributeRequest = exports.SucceedAttributeRequest = exports.
|
|
4681
|
-
exports.LoadPeerTokenRequest = exports.GetTokensRequest = exports.GetTokenRequest = exports.GetQRCodeForTokenRequest = exports.CreateOwnTokenRequest = exports.LoadPeerRelationshipTemplateRequest = exports.GetRelationshipTemplatesRequest = exports.GetRelationshipTemplateRequest = exports.CreateTokenQrCodeForOwnTemplateRequest = exports.CreateTokenForOwnTemplateRequest = exports.CreateOwnRelationshipTemplateRequest = exports.RevokeRelationshipChangeRequest = exports.RejectRelationshipChangeRequest = exports.GetRelationshipsRequest = exports.GetRelationshipByAddressRequest = exports.GetRelationshipRequest = exports.CreateRelationshipChangeRequest = exports.CreateRelationshipRequest = exports.AcceptRelationshipChangeRequest = exports.SendMessageRequest = exports.GetMessagesRequest = exports.GetMessageRequest = exports.GetAttachmentMetadataRequest = exports.CheckIdentityRequest = exports.UploadOwnFileRequest = exports.LoadPeerFileRequest = exports.LoadPeerFileViaReferenceRequest = exports.LoadPeerFileViaSecretRequest = exports.GetFilesRequest = exports.GetFileRequest = exports.CreateTokenQrCodeForFileRequest =
|
|
4615
|
+
exports.CreateTokenForFileRequest = exports.UpdateDeviceRequest = exports.GetDeviceOnboardingInfoRequest = exports.GetDeviceRequest = exports.DeleteDeviceRequest = exports.CreateDeviceOnboardingTokenRequest = exports.CreateDeviceRequest = exports.ValidateChallengeRequest = exports.CreateChallengeRequest = exports.CreateDeviceChallengeRequest = exports.CreateIdentityChallengeRequest = exports.CreateRelationshipChallengeRequest = exports.SyncEverythingRequest = exports.DownloadAttachmentRequest = exports.DownloadFileRequest = exports.SyncDatawalletRequest = exports.RegisterPushNotificationTokenRequest = exports.UpdateSettingRequest = exports.GetSettingsRequest = exports.GetSettingRequest = exports.DeleteSettingRequest = exports.CreateSettingRequest = exports.SentOutgoingRequestRequest = exports.RequireManualDecisionOfIncomingRequestRequest = exports.ReceivedIncomingRequestRequest = exports.GetOutgoingRequestsRequest = exports.GetOutgoingRequestRequest = exports.GetIncomingRequestsRequest = exports.GetIncomingRequestRequest = exports.CreateAndCompleteOutgoingRequestFromRelationshipCreationChangeRequest = exports.CompleteOutgoingRequestRequest = exports.CompleteIncomingRequestRequest = exports.CheckPrerequisitesOfIncomingRequestRequest = exports.RejectIncomingRequestRequest = exports.CreateOutgoingRequestRequest = exports.AcceptIncomingRequestRequest = exports.UpdateDraftRequest = exports.GetDraftsRequest = exports.GetDraftRequest = exports.DeleteDraftRequest = exports.CreateDraftRequest = exports.UpdateAttributeRequest = exports.SucceedAttributeRequest = exports.GetAttributesRequest = exports.GetAttributeRequest = exports.DeleteAttributeRequest = exports.CreateShareAttributeCopyRequest = exports.CreateAttributeRequest = exports.LoadPeerTokenAnonymousByTruncatedReferenceRequest = exports.LoadPeerTokenAnonymousByIdAndKeyRequest = void 0;
|
|
4616
|
+
exports.LoadPeerTokenRequest = exports.GetTokensRequest = exports.GetTokenRequest = exports.GetQRCodeForTokenRequest = exports.CreateOwnTokenRequest = exports.LoadPeerRelationshipTemplateRequest = exports.GetRelationshipTemplatesRequest = exports.GetRelationshipTemplateRequest = exports.CreateTokenQrCodeForOwnTemplateRequest = exports.CreateTokenForOwnTemplateRequest = exports.CreateOwnRelationshipTemplateRequest = exports.RevokeRelationshipChangeRequest = exports.RejectRelationshipChangeRequest = exports.GetRelationshipsRequest = exports.GetRelationshipByAddressRequest = exports.GetRelationshipRequest = exports.CreateRelationshipChangeRequest = exports.CreateRelationshipRequest = exports.AcceptRelationshipChangeRequest = exports.SendMessageRequest = exports.GetMessagesRequest = exports.GetMessageRequest = exports.GetAttachmentMetadataRequest = exports.CheckIdentityRequest = exports.UploadOwnFileRequest = exports.LoadPeerFileRequest = exports.LoadPeerFileViaReferenceRequest = exports.LoadPeerFileViaSecretRequest = exports.GetFilesRequest = exports.GetFileRequest = exports.CreateTokenQrCodeForFileRequest = void 0;
|
|
4682
4617
|
exports.LoadPeerTokenAnonymousByIdAndKeyRequest = {
|
|
4683
4618
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4684
4619
|
"$ref": "#/definitions/LoadPeerTokenAnonymousByIdAndKeyRequest",
|
|
@@ -4719,16 +4654,6 @@ exports.LoadPeerTokenAnonymousByTruncatedReferenceRequest = {
|
|
|
4719
4654
|
}
|
|
4720
4655
|
}
|
|
4721
4656
|
};
|
|
4722
|
-
exports.GetAttributesByNamesRequest = {
|
|
4723
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4724
|
-
"$ref": "#/definitions/GetAttributesByNamesRequest",
|
|
4725
|
-
"definitions": {
|
|
4726
|
-
"GetAttributesByNamesRequest": {
|
|
4727
|
-
"type": "object",
|
|
4728
|
-
"additionalProperties": false
|
|
4729
|
-
}
|
|
4730
|
-
}
|
|
4731
|
-
};
|
|
4732
4657
|
exports.CreateAttributeRequest = {
|
|
4733
4658
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4734
4659
|
"$ref": "#/definitions/CreateAttributeRequest",
|
|
@@ -4736,80 +4661,184 @@ exports.CreateAttributeRequest = {
|
|
|
4736
4661
|
"CreateAttributeRequest": {
|
|
4737
4662
|
"type": "object",
|
|
4738
4663
|
"properties": {
|
|
4739
|
-
"
|
|
4740
|
-
"
|
|
4664
|
+
"content": {
|
|
4665
|
+
"anyOf": [
|
|
4666
|
+
{
|
|
4667
|
+
"$ref": "#/definitions/ExtendedIdentityAttributeJSON"
|
|
4668
|
+
},
|
|
4669
|
+
{
|
|
4670
|
+
"$ref": "#/definitions/ExtendedRelationshipAttributeJSON"
|
|
4671
|
+
}
|
|
4672
|
+
]
|
|
4741
4673
|
}
|
|
4742
4674
|
},
|
|
4743
4675
|
"required": [
|
|
4744
|
-
"
|
|
4676
|
+
"content"
|
|
4745
4677
|
],
|
|
4746
4678
|
"additionalProperties": false
|
|
4747
4679
|
},
|
|
4748
|
-
"
|
|
4680
|
+
"ExtendedIdentityAttributeJSON": {
|
|
4749
4681
|
"type": "object",
|
|
4750
4682
|
"properties": {
|
|
4751
|
-
"
|
|
4683
|
+
"@type": {
|
|
4684
|
+
"type": "string"
|
|
4685
|
+
},
|
|
4686
|
+
"@context": {
|
|
4687
|
+
"type": "string"
|
|
4688
|
+
},
|
|
4689
|
+
"@version": {
|
|
4690
|
+
"type": "string"
|
|
4691
|
+
},
|
|
4692
|
+
"owner": {
|
|
4752
4693
|
"type": "string"
|
|
4753
4694
|
},
|
|
4754
|
-
"value": {},
|
|
4755
4695
|
"validFrom": {
|
|
4756
|
-
"
|
|
4696
|
+
"type": "string"
|
|
4757
4697
|
},
|
|
4758
4698
|
"validTo": {
|
|
4759
|
-
"
|
|
4699
|
+
"type": "string"
|
|
4700
|
+
},
|
|
4701
|
+
"value": {
|
|
4702
|
+
"type": "object",
|
|
4703
|
+
"properties": {
|
|
4704
|
+
"@type": {
|
|
4705
|
+
"type": "string"
|
|
4706
|
+
},
|
|
4707
|
+
"@context": {
|
|
4708
|
+
"type": "string"
|
|
4709
|
+
},
|
|
4710
|
+
"@version": {
|
|
4711
|
+
"type": "string"
|
|
4712
|
+
}
|
|
4713
|
+
},
|
|
4714
|
+
"required": [
|
|
4715
|
+
"@type"
|
|
4716
|
+
]
|
|
4717
|
+
},
|
|
4718
|
+
"tags": {
|
|
4719
|
+
"type": "array",
|
|
4720
|
+
"items": {
|
|
4721
|
+
"type": "string"
|
|
4722
|
+
}
|
|
4760
4723
|
}
|
|
4761
4724
|
},
|
|
4762
4725
|
"required": [
|
|
4763
|
-
"
|
|
4726
|
+
"@type",
|
|
4727
|
+
"owner",
|
|
4764
4728
|
"value"
|
|
4765
4729
|
],
|
|
4766
4730
|
"additionalProperties": false
|
|
4767
4731
|
},
|
|
4768
|
-
"
|
|
4732
|
+
"ExtendedRelationshipAttributeJSON": {
|
|
4769
4733
|
"type": "object",
|
|
4770
4734
|
"properties": {
|
|
4771
|
-
"
|
|
4735
|
+
"@type": {
|
|
4736
|
+
"type": "string"
|
|
4737
|
+
},
|
|
4738
|
+
"@context": {
|
|
4739
|
+
"type": "string"
|
|
4740
|
+
},
|
|
4741
|
+
"@version": {
|
|
4742
|
+
"type": "string"
|
|
4743
|
+
},
|
|
4744
|
+
"owner": {
|
|
4772
4745
|
"type": "string"
|
|
4746
|
+
},
|
|
4747
|
+
"validFrom": {
|
|
4748
|
+
"type": "string"
|
|
4749
|
+
},
|
|
4750
|
+
"validTo": {
|
|
4751
|
+
"type": "string"
|
|
4752
|
+
},
|
|
4753
|
+
"value": {
|
|
4754
|
+
"type": "object",
|
|
4755
|
+
"properties": {
|
|
4756
|
+
"@type": {
|
|
4757
|
+
"type": "string"
|
|
4758
|
+
},
|
|
4759
|
+
"@context": {
|
|
4760
|
+
"type": "string"
|
|
4761
|
+
},
|
|
4762
|
+
"@version": {
|
|
4763
|
+
"type": "string"
|
|
4764
|
+
}
|
|
4765
|
+
},
|
|
4766
|
+
"required": [
|
|
4767
|
+
"@type"
|
|
4768
|
+
]
|
|
4769
|
+
},
|
|
4770
|
+
"key": {
|
|
4771
|
+
"type": "string"
|
|
4772
|
+
},
|
|
4773
|
+
"isTechnical": {
|
|
4774
|
+
"type": "boolean"
|
|
4775
|
+
},
|
|
4776
|
+
"confidentiality": {
|
|
4777
|
+
"$ref": "#/definitions/RelationshipAttributeConfidentiality"
|
|
4773
4778
|
}
|
|
4774
4779
|
},
|
|
4775
4780
|
"required": [
|
|
4776
|
-
"
|
|
4781
|
+
"@type",
|
|
4782
|
+
"confidentiality",
|
|
4783
|
+
"key",
|
|
4784
|
+
"owner",
|
|
4785
|
+
"value"
|
|
4777
4786
|
],
|
|
4778
4787
|
"additionalProperties": false
|
|
4788
|
+
},
|
|
4789
|
+
"RelationshipAttributeConfidentiality": {
|
|
4790
|
+
"type": "string",
|
|
4791
|
+
"enum": [
|
|
4792
|
+
"public",
|
|
4793
|
+
"private",
|
|
4794
|
+
"protected"
|
|
4795
|
+
]
|
|
4779
4796
|
}
|
|
4780
4797
|
}
|
|
4781
4798
|
};
|
|
4782
|
-
exports.
|
|
4799
|
+
exports.CreateShareAttributeCopyRequest = {
|
|
4783
4800
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4784
|
-
"$ref": "#/definitions/
|
|
4801
|
+
"$ref": "#/definitions/CreateShareAttributeCopyRequest",
|
|
4785
4802
|
"definitions": {
|
|
4786
|
-
"
|
|
4803
|
+
"CreateShareAttributeCopyRequest": {
|
|
4787
4804
|
"type": "object",
|
|
4788
4805
|
"properties": {
|
|
4789
|
-
"
|
|
4790
|
-
"type": "string"
|
|
4806
|
+
"attributeId": {
|
|
4807
|
+
"type": "string",
|
|
4808
|
+
"pattern": "ATT[A-Za-z0-9]{17}"
|
|
4809
|
+
},
|
|
4810
|
+
"peer": {
|
|
4811
|
+
"type": "string",
|
|
4812
|
+
"pattern": "[a-zA-Z1-9]{35,36}"
|
|
4813
|
+
},
|
|
4814
|
+
"requestReference": {
|
|
4815
|
+
"type": "string",
|
|
4816
|
+
"pattern": "REQ[A-Za-z0-9]{17}"
|
|
4791
4817
|
}
|
|
4792
4818
|
},
|
|
4793
4819
|
"required": [
|
|
4794
|
-
"
|
|
4820
|
+
"attributeId",
|
|
4821
|
+
"peer",
|
|
4822
|
+
"requestReference"
|
|
4795
4823
|
],
|
|
4796
4824
|
"additionalProperties": false
|
|
4797
4825
|
}
|
|
4798
4826
|
}
|
|
4799
4827
|
};
|
|
4800
|
-
exports.
|
|
4828
|
+
exports.DeleteAttributeRequest = {
|
|
4801
4829
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4802
|
-
"$ref": "#/definitions/
|
|
4830
|
+
"$ref": "#/definitions/DeleteAttributeRequest",
|
|
4803
4831
|
"definitions": {
|
|
4804
|
-
"
|
|
4832
|
+
"DeleteAttributeRequest": {
|
|
4805
4833
|
"type": "object",
|
|
4806
4834
|
"properties": {
|
|
4807
|
-
"
|
|
4808
|
-
"type": "string"
|
|
4835
|
+
"id": {
|
|
4836
|
+
"type": "string",
|
|
4837
|
+
"pattern": "ATT[A-Za-z0-9]{17}"
|
|
4809
4838
|
}
|
|
4810
4839
|
},
|
|
4811
4840
|
"required": [
|
|
4812
|
-
"
|
|
4841
|
+
"id"
|
|
4813
4842
|
],
|
|
4814
4843
|
"additionalProperties": false
|
|
4815
4844
|
}
|
|
@@ -4823,7 +4852,8 @@ exports.GetAttributeRequest = {
|
|
|
4823
4852
|
"type": "object",
|
|
4824
4853
|
"properties": {
|
|
4825
4854
|
"id": {
|
|
4826
|
-
"type": "string"
|
|
4855
|
+
"type": "string",
|
|
4856
|
+
"pattern": "ATT[A-Za-z0-9]{17}"
|
|
4827
4857
|
}
|
|
4828
4858
|
},
|
|
4829
4859
|
"required": [
|
|
@@ -4833,102 +4863,245 @@ exports.GetAttributeRequest = {
|
|
|
4833
4863
|
}
|
|
4834
4864
|
}
|
|
4835
4865
|
};
|
|
4836
|
-
exports.GetAttributeByNameRequest = {
|
|
4837
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4838
|
-
"$ref": "#/definitions/GetAttributeByNameRequest",
|
|
4839
|
-
"definitions": {
|
|
4840
|
-
"GetAttributeByNameRequest": {
|
|
4841
|
-
"type": "object",
|
|
4842
|
-
"properties": {
|
|
4843
|
-
"name": {
|
|
4844
|
-
"type": "string"
|
|
4845
|
-
}
|
|
4846
|
-
},
|
|
4847
|
-
"required": [
|
|
4848
|
-
"name"
|
|
4849
|
-
],
|
|
4850
|
-
"additionalProperties": false
|
|
4851
|
-
}
|
|
4852
|
-
}
|
|
4853
|
-
};
|
|
4854
4866
|
exports.GetAttributesRequest = {
|
|
4855
4867
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4856
4868
|
"$ref": "#/definitions/GetAttributesRequest",
|
|
4857
4869
|
"definitions": {
|
|
4858
4870
|
"GetAttributesRequest": {
|
|
4859
|
-
"type": "object",
|
|
4860
|
-
"additionalProperties": false
|
|
4861
|
-
}
|
|
4862
|
-
}
|
|
4863
|
-
};
|
|
4864
|
-
exports.GetHistoryByNameRequest = {
|
|
4865
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4866
|
-
"$ref": "#/definitions/GetHistoryByNameRequest",
|
|
4867
|
-
"definitions": {
|
|
4868
|
-
"GetHistoryByNameRequest": {
|
|
4869
4871
|
"type": "object",
|
|
4870
4872
|
"properties": {
|
|
4871
|
-
"
|
|
4872
|
-
"
|
|
4873
|
+
"query": {
|
|
4874
|
+
"$ref": "#/definitions/ConsumptionAttributeQuery"
|
|
4873
4875
|
}
|
|
4874
4876
|
},
|
|
4875
|
-
"required": [
|
|
4876
|
-
"name"
|
|
4877
|
-
],
|
|
4878
4877
|
"additionalProperties": false
|
|
4879
|
-
}
|
|
4880
|
-
|
|
4881
|
-
};
|
|
4882
|
-
exports.SucceedAttributeRequest = {
|
|
4883
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4884
|
-
"$ref": "#/definitions/SucceedAttributeRequest",
|
|
4885
|
-
"definitions": {
|
|
4886
|
-
"SucceedAttributeRequest": {
|
|
4878
|
+
},
|
|
4879
|
+
"ConsumptionAttributeQuery": {
|
|
4887
4880
|
"type": "object",
|
|
4888
4881
|
"properties": {
|
|
4889
|
-
"
|
|
4890
|
-
"$ref": "#/definitions/IAttribute"
|
|
4891
|
-
},
|
|
4892
|
-
"validFrom": {
|
|
4882
|
+
"createdAt": {
|
|
4893
4883
|
"type": "string"
|
|
4894
|
-
}
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4884
|
+
},
|
|
4885
|
+
"content": {
|
|
4886
|
+
"type": "object",
|
|
4887
|
+
"properties": {
|
|
4888
|
+
"@type": {
|
|
4889
|
+
"type": "string"
|
|
4890
|
+
},
|
|
4891
|
+
"tags": {
|
|
4892
|
+
"type": "array",
|
|
4893
|
+
"items": {
|
|
4894
|
+
"type": "string"
|
|
4895
|
+
}
|
|
4896
|
+
},
|
|
4897
|
+
"owner": {
|
|
4898
|
+
"type": "string"
|
|
4899
|
+
},
|
|
4900
|
+
"validFrom": {
|
|
4901
|
+
"type": "string"
|
|
4902
|
+
},
|
|
4903
|
+
"validTo": {
|
|
4904
|
+
"type": "string"
|
|
4905
|
+
},
|
|
4906
|
+
"key": {
|
|
4907
|
+
"type": "string"
|
|
4908
|
+
},
|
|
4909
|
+
"isTechnical": {
|
|
4910
|
+
"type": "boolean"
|
|
4911
|
+
},
|
|
4912
|
+
"confidentiality": {
|
|
4913
|
+
"$ref": "#/definitions/RelationshipAttributeConfidentiality"
|
|
4914
|
+
},
|
|
4915
|
+
"value": {
|
|
4916
|
+
"type": "object",
|
|
4917
|
+
"properties": {
|
|
4918
|
+
"@type": {
|
|
4919
|
+
"type": "string"
|
|
4920
|
+
}
|
|
4921
|
+
},
|
|
4922
|
+
"additionalProperties": false
|
|
4923
|
+
}
|
|
4924
|
+
},
|
|
4925
|
+
"additionalProperties": false
|
|
4926
|
+
},
|
|
4927
|
+
"succeeds": {
|
|
4928
|
+
"type": "string"
|
|
4929
|
+
},
|
|
4930
|
+
"succeededBy": {
|
|
4931
|
+
"type": "string"
|
|
4932
|
+
},
|
|
4933
|
+
"shareInfo": {
|
|
4934
|
+
"type": "object",
|
|
4935
|
+
"properties": {
|
|
4936
|
+
"requestReference": {
|
|
4937
|
+
"type": "string"
|
|
4938
|
+
},
|
|
4939
|
+
"peer": {
|
|
4940
|
+
"type": "string"
|
|
4941
|
+
},
|
|
4942
|
+
"sourceAttribute": {
|
|
4943
|
+
"type": "string"
|
|
4944
|
+
}
|
|
4945
|
+
},
|
|
4946
|
+
"additionalProperties": false
|
|
4947
|
+
}
|
|
4948
|
+
},
|
|
4949
|
+
"additionalProperties": {}
|
|
4950
|
+
},
|
|
4951
|
+
"RelationshipAttributeConfidentiality": {
|
|
4952
|
+
"type": "string",
|
|
4953
|
+
"enum": [
|
|
4954
|
+
"public",
|
|
4955
|
+
"private",
|
|
4956
|
+
"protected"
|
|
4957
|
+
]
|
|
4958
|
+
}
|
|
4959
|
+
}
|
|
4960
|
+
};
|
|
4961
|
+
exports.SucceedAttributeRequest = {
|
|
4962
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4963
|
+
"$ref": "#/definitions/SucceedAttributeRequest",
|
|
4964
|
+
"definitions": {
|
|
4965
|
+
"SucceedAttributeRequest": {
|
|
4966
|
+
"type": "object",
|
|
4967
|
+
"properties": {
|
|
4968
|
+
"successorContent": {
|
|
4969
|
+
"anyOf": [
|
|
4970
|
+
{
|
|
4971
|
+
"$ref": "#/definitions/ExtendedIdentityAttributeJSON"
|
|
4972
|
+
},
|
|
4973
|
+
{
|
|
4974
|
+
"$ref": "#/definitions/ExtendedRelationshipAttributeJSON"
|
|
4975
|
+
}
|
|
4976
|
+
]
|
|
4977
|
+
},
|
|
4978
|
+
"succeeds": {
|
|
4979
|
+
"type": "string",
|
|
4980
|
+
"pattern": "ATT[A-Za-z0-9]{17}"
|
|
4981
|
+
}
|
|
4982
|
+
},
|
|
4983
|
+
"required": [
|
|
4984
|
+
"successorContent",
|
|
4985
|
+
"succeeds"
|
|
4986
|
+
],
|
|
4899
4987
|
"additionalProperties": false
|
|
4900
4988
|
},
|
|
4901
|
-
"
|
|
4989
|
+
"ExtendedIdentityAttributeJSON": {
|
|
4902
4990
|
"type": "object",
|
|
4903
4991
|
"properties": {
|
|
4904
|
-
"
|
|
4992
|
+
"@type": {
|
|
4993
|
+
"type": "string"
|
|
4994
|
+
},
|
|
4995
|
+
"@context": {
|
|
4996
|
+
"type": "string"
|
|
4997
|
+
},
|
|
4998
|
+
"@version": {
|
|
4999
|
+
"type": "string"
|
|
5000
|
+
},
|
|
5001
|
+
"owner": {
|
|
4905
5002
|
"type": "string"
|
|
4906
5003
|
},
|
|
4907
|
-
"value": {},
|
|
4908
5004
|
"validFrom": {
|
|
4909
|
-
"
|
|
5005
|
+
"type": "string"
|
|
4910
5006
|
},
|
|
4911
5007
|
"validTo": {
|
|
4912
|
-
"
|
|
5008
|
+
"type": "string"
|
|
5009
|
+
},
|
|
5010
|
+
"value": {
|
|
5011
|
+
"type": "object",
|
|
5012
|
+
"properties": {
|
|
5013
|
+
"@type": {
|
|
5014
|
+
"type": "string"
|
|
5015
|
+
},
|
|
5016
|
+
"@context": {
|
|
5017
|
+
"type": "string"
|
|
5018
|
+
},
|
|
5019
|
+
"@version": {
|
|
5020
|
+
"type": "string"
|
|
5021
|
+
}
|
|
5022
|
+
},
|
|
5023
|
+
"required": [
|
|
5024
|
+
"@type"
|
|
5025
|
+
]
|
|
5026
|
+
},
|
|
5027
|
+
"tags": {
|
|
5028
|
+
"type": "array",
|
|
5029
|
+
"items": {
|
|
5030
|
+
"type": "string"
|
|
5031
|
+
}
|
|
4913
5032
|
}
|
|
4914
5033
|
},
|
|
4915
5034
|
"required": [
|
|
4916
|
-
"
|
|
5035
|
+
"@type",
|
|
5036
|
+
"owner",
|
|
4917
5037
|
"value"
|
|
4918
5038
|
],
|
|
4919
5039
|
"additionalProperties": false
|
|
4920
5040
|
},
|
|
4921
|
-
"
|
|
5041
|
+
"ExtendedRelationshipAttributeJSON": {
|
|
4922
5042
|
"type": "object",
|
|
4923
5043
|
"properties": {
|
|
4924
|
-
"
|
|
5044
|
+
"@type": {
|
|
5045
|
+
"type": "string"
|
|
5046
|
+
},
|
|
5047
|
+
"@context": {
|
|
5048
|
+
"type": "string"
|
|
5049
|
+
},
|
|
5050
|
+
"@version": {
|
|
5051
|
+
"type": "string"
|
|
5052
|
+
},
|
|
5053
|
+
"owner": {
|
|
5054
|
+
"type": "string"
|
|
5055
|
+
},
|
|
5056
|
+
"validFrom": {
|
|
5057
|
+
"type": "string"
|
|
5058
|
+
},
|
|
5059
|
+
"validTo": {
|
|
5060
|
+
"type": "string"
|
|
5061
|
+
},
|
|
5062
|
+
"value": {
|
|
5063
|
+
"type": "object",
|
|
5064
|
+
"properties": {
|
|
5065
|
+
"@type": {
|
|
5066
|
+
"type": "string"
|
|
5067
|
+
},
|
|
5068
|
+
"@context": {
|
|
5069
|
+
"type": "string"
|
|
5070
|
+
},
|
|
5071
|
+
"@version": {
|
|
5072
|
+
"type": "string"
|
|
5073
|
+
}
|
|
5074
|
+
},
|
|
5075
|
+
"required": [
|
|
5076
|
+
"@type"
|
|
5077
|
+
]
|
|
5078
|
+
},
|
|
5079
|
+
"key": {
|
|
4925
5080
|
"type": "string"
|
|
5081
|
+
},
|
|
5082
|
+
"isTechnical": {
|
|
5083
|
+
"type": "boolean"
|
|
5084
|
+
},
|
|
5085
|
+
"confidentiality": {
|
|
5086
|
+
"$ref": "#/definitions/RelationshipAttributeConfidentiality"
|
|
4926
5087
|
}
|
|
4927
5088
|
},
|
|
4928
5089
|
"required": [
|
|
4929
|
-
"
|
|
5090
|
+
"@type",
|
|
5091
|
+
"confidentiality",
|
|
5092
|
+
"key",
|
|
5093
|
+
"owner",
|
|
5094
|
+
"value"
|
|
4930
5095
|
],
|
|
4931
5096
|
"additionalProperties": false
|
|
5097
|
+
},
|
|
5098
|
+
"RelationshipAttributeConfidentiality": {
|
|
5099
|
+
"type": "string",
|
|
5100
|
+
"enum": [
|
|
5101
|
+
"public",
|
|
5102
|
+
"private",
|
|
5103
|
+
"protected"
|
|
5104
|
+
]
|
|
4932
5105
|
}
|
|
4933
5106
|
}
|
|
4934
5107
|
};
|
|
@@ -4940,49 +5113,142 @@ exports.UpdateAttributeRequest = {
|
|
|
4940
5113
|
"type": "object",
|
|
4941
5114
|
"properties": {
|
|
4942
5115
|
"id": {
|
|
4943
|
-
"type": "string"
|
|
5116
|
+
"type": "string",
|
|
5117
|
+
"pattern": "ATT[A-Za-z0-9]{17}"
|
|
4944
5118
|
},
|
|
4945
|
-
"
|
|
4946
|
-
"
|
|
5119
|
+
"content": {
|
|
5120
|
+
"anyOf": [
|
|
5121
|
+
{
|
|
5122
|
+
"$ref": "#/definitions/ExtendedIdentityAttributeJSON"
|
|
5123
|
+
},
|
|
5124
|
+
{
|
|
5125
|
+
"$ref": "#/definitions/ExtendedRelationshipAttributeJSON"
|
|
5126
|
+
}
|
|
5127
|
+
]
|
|
4947
5128
|
}
|
|
4948
5129
|
},
|
|
4949
5130
|
"required": [
|
|
4950
5131
|
"id",
|
|
4951
|
-
"
|
|
5132
|
+
"content"
|
|
4952
5133
|
],
|
|
4953
5134
|
"additionalProperties": false
|
|
4954
5135
|
},
|
|
4955
|
-
"
|
|
5136
|
+
"ExtendedIdentityAttributeJSON": {
|
|
4956
5137
|
"type": "object",
|
|
4957
5138
|
"properties": {
|
|
4958
|
-
"
|
|
5139
|
+
"@type": {
|
|
5140
|
+
"type": "string"
|
|
5141
|
+
},
|
|
5142
|
+
"@context": {
|
|
5143
|
+
"type": "string"
|
|
5144
|
+
},
|
|
5145
|
+
"@version": {
|
|
5146
|
+
"type": "string"
|
|
5147
|
+
},
|
|
5148
|
+
"owner": {
|
|
4959
5149
|
"type": "string"
|
|
4960
5150
|
},
|
|
4961
|
-
"value": {},
|
|
4962
5151
|
"validFrom": {
|
|
4963
|
-
"
|
|
5152
|
+
"type": "string"
|
|
4964
5153
|
},
|
|
4965
5154
|
"validTo": {
|
|
4966
|
-
"
|
|
5155
|
+
"type": "string"
|
|
5156
|
+
},
|
|
5157
|
+
"value": {
|
|
5158
|
+
"type": "object",
|
|
5159
|
+
"properties": {
|
|
5160
|
+
"@type": {
|
|
5161
|
+
"type": "string"
|
|
5162
|
+
},
|
|
5163
|
+
"@context": {
|
|
5164
|
+
"type": "string"
|
|
5165
|
+
},
|
|
5166
|
+
"@version": {
|
|
5167
|
+
"type": "string"
|
|
5168
|
+
}
|
|
5169
|
+
},
|
|
5170
|
+
"required": [
|
|
5171
|
+
"@type"
|
|
5172
|
+
]
|
|
5173
|
+
},
|
|
5174
|
+
"tags": {
|
|
5175
|
+
"type": "array",
|
|
5176
|
+
"items": {
|
|
5177
|
+
"type": "string"
|
|
5178
|
+
}
|
|
4967
5179
|
}
|
|
4968
5180
|
},
|
|
4969
5181
|
"required": [
|
|
4970
|
-
"
|
|
5182
|
+
"@type",
|
|
5183
|
+
"owner",
|
|
4971
5184
|
"value"
|
|
4972
5185
|
],
|
|
4973
5186
|
"additionalProperties": false
|
|
4974
5187
|
},
|
|
4975
|
-
"
|
|
5188
|
+
"ExtendedRelationshipAttributeJSON": {
|
|
4976
5189
|
"type": "object",
|
|
4977
5190
|
"properties": {
|
|
4978
|
-
"
|
|
5191
|
+
"@type": {
|
|
5192
|
+
"type": "string"
|
|
5193
|
+
},
|
|
5194
|
+
"@context": {
|
|
5195
|
+
"type": "string"
|
|
5196
|
+
},
|
|
5197
|
+
"@version": {
|
|
4979
5198
|
"type": "string"
|
|
5199
|
+
},
|
|
5200
|
+
"owner": {
|
|
5201
|
+
"type": "string"
|
|
5202
|
+
},
|
|
5203
|
+
"validFrom": {
|
|
5204
|
+
"type": "string"
|
|
5205
|
+
},
|
|
5206
|
+
"validTo": {
|
|
5207
|
+
"type": "string"
|
|
5208
|
+
},
|
|
5209
|
+
"value": {
|
|
5210
|
+
"type": "object",
|
|
5211
|
+
"properties": {
|
|
5212
|
+
"@type": {
|
|
5213
|
+
"type": "string"
|
|
5214
|
+
},
|
|
5215
|
+
"@context": {
|
|
5216
|
+
"type": "string"
|
|
5217
|
+
},
|
|
5218
|
+
"@version": {
|
|
5219
|
+
"type": "string"
|
|
5220
|
+
}
|
|
5221
|
+
},
|
|
5222
|
+
"required": [
|
|
5223
|
+
"@type"
|
|
5224
|
+
]
|
|
5225
|
+
},
|
|
5226
|
+
"key": {
|
|
5227
|
+
"type": "string"
|
|
5228
|
+
},
|
|
5229
|
+
"isTechnical": {
|
|
5230
|
+
"type": "boolean"
|
|
5231
|
+
},
|
|
5232
|
+
"confidentiality": {
|
|
5233
|
+
"$ref": "#/definitions/RelationshipAttributeConfidentiality"
|
|
4980
5234
|
}
|
|
4981
5235
|
},
|
|
4982
5236
|
"required": [
|
|
4983
|
-
"
|
|
5237
|
+
"@type",
|
|
5238
|
+
"confidentiality",
|
|
5239
|
+
"key",
|
|
5240
|
+
"owner",
|
|
5241
|
+
"value"
|
|
4984
5242
|
],
|
|
4985
5243
|
"additionalProperties": false
|
|
5244
|
+
},
|
|
5245
|
+
"RelationshipAttributeConfidentiality": {
|
|
5246
|
+
"type": "string",
|
|
5247
|
+
"enum": [
|
|
5248
|
+
"public",
|
|
5249
|
+
"private",
|
|
5250
|
+
"protected"
|
|
5251
|
+
]
|
|
4986
5252
|
}
|
|
4987
5253
|
}
|
|
4988
5254
|
};
|
|
@@ -5524,7 +5790,7 @@ exports.CompleteIncomingRequestRequest = {
|
|
|
5524
5790
|
"properties": {
|
|
5525
5791
|
"requestId": {
|
|
5526
5792
|
"type": "string",
|
|
5527
|
-
"pattern": "REQ[A-Za-z0-9]{
|
|
5793
|
+
"pattern": "REQ[A-Za-z0-9]{17}"
|
|
5528
5794
|
},
|
|
5529
5795
|
"responseSourceId": {
|
|
5530
5796
|
"type": "string",
|
|
@@ -7646,30 +7912,27 @@ exports.SchemaValidator = SchemaValidator;
|
|
|
7646
7912
|
/*!*****************************************************************!*\
|
|
7647
7913
|
!*** ./dist/useCases/consumption/attributes/AttributeMapper.js ***!
|
|
7648
7914
|
\*****************************************************************/
|
|
7649
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
7915
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7650
7916
|
|
|
7651
7917
|
"use strict";
|
|
7652
7918
|
|
|
7653
7919
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7654
7920
|
exports.AttributeMapper = void 0;
|
|
7921
|
+
const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
7655
7922
|
class AttributeMapper {
|
|
7656
7923
|
static toAttributeDTO(attribute) {
|
|
7657
7924
|
return {
|
|
7658
7925
|
id: attribute.id.toString(),
|
|
7659
|
-
content: attribute.content.toJSON(),
|
|
7660
|
-
createdAt: attribute.createdAt.toString()
|
|
7926
|
+
content: attribute.content instanceof content_1.IdentityAttribute ? attribute.content.toJSON() : attribute.content.toJSON(),
|
|
7927
|
+
createdAt: attribute.createdAt.toString(),
|
|
7928
|
+
succeeds: attribute.succeeds?.toString(),
|
|
7929
|
+
succeededBy: attribute.succeededBy?.toString(),
|
|
7930
|
+
shareInfo: attribute.shareInfo?.toJSON()
|
|
7661
7931
|
};
|
|
7662
7932
|
}
|
|
7663
7933
|
static toAttributeDTOList(attributes) {
|
|
7664
7934
|
return attributes.map((attribute) => this.toAttributeDTO(attribute));
|
|
7665
7935
|
}
|
|
7666
|
-
static toGetAttributesByNamesResponse(attributesByNames) {
|
|
7667
|
-
const response = {};
|
|
7668
|
-
for (const name in attributesByNames) {
|
|
7669
|
-
response[name] = AttributeMapper.toAttributeDTO(attributesByNames[name]);
|
|
7670
|
-
}
|
|
7671
|
-
return response;
|
|
7672
|
-
}
|
|
7673
7936
|
}
|
|
7674
7937
|
exports.AttributeMapper = AttributeMapper;
|
|
7675
7938
|
//# sourceMappingURL=AttributeMapper.js.map
|
|
@@ -7704,13 +7967,15 @@ const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transpor
|
|
|
7704
7967
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
7705
7968
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
7706
7969
|
const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
|
|
7707
|
-
class
|
|
7708
|
-
constructor() {
|
|
7709
|
-
super();
|
|
7710
|
-
this.validateIf((x) => x.attribute).isDefined();
|
|
7711
|
-
this.validateIfString((x) => x.attribute.name).isNotEmpty();
|
|
7970
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
7971
|
+
constructor(schemaRepository) {
|
|
7972
|
+
super(schemaRepository.getSchema("CreateAttributeRequest"));
|
|
7712
7973
|
}
|
|
7713
|
-
}
|
|
7974
|
+
};
|
|
7975
|
+
Validator = __decorate([
|
|
7976
|
+
__param(0, typescript_ioc_1.Inject),
|
|
7977
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
7978
|
+
], Validator);
|
|
7714
7979
|
let CreateAttributeUseCase = class CreateAttributeUseCase extends common_1.UseCase {
|
|
7715
7980
|
constructor(attributeController, accountController, validator) {
|
|
7716
7981
|
super(validator);
|
|
@@ -7718,8 +7983,10 @@ let CreateAttributeUseCase = class CreateAttributeUseCase extends common_1.UseCa
|
|
|
7718
7983
|
this.accountController = accountController;
|
|
7719
7984
|
}
|
|
7720
7985
|
async executeInternal(request) {
|
|
7721
|
-
const
|
|
7722
|
-
|
|
7986
|
+
const params = consumption_1.CreateConsumptionAttributeParams.from({
|
|
7987
|
+
content: request.content
|
|
7988
|
+
});
|
|
7989
|
+
const createdAttribute = await this.attributeController.createConsumptionAttribute(params);
|
|
7723
7990
|
await this.accountController.syncDatawallet();
|
|
7724
7991
|
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTO(createdAttribute));
|
|
7725
7992
|
}
|
|
@@ -7730,17 +7997,17 @@ CreateAttributeUseCase = __decorate([
|
|
|
7730
7997
|
__param(2, typescript_ioc_1.Inject),
|
|
7731
7998
|
__metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController,
|
|
7732
7999
|
transport_1.AccountController,
|
|
7733
|
-
|
|
8000
|
+
Validator])
|
|
7734
8001
|
], CreateAttributeUseCase);
|
|
7735
8002
|
exports.CreateAttributeUseCase = CreateAttributeUseCase;
|
|
7736
8003
|
//# sourceMappingURL=CreateAttribute.js.map
|
|
7737
8004
|
|
|
7738
8005
|
/***/ }),
|
|
7739
8006
|
|
|
7740
|
-
/***/ "./dist/useCases/consumption/attributes/
|
|
7741
|
-
|
|
7742
|
-
!*** ./dist/useCases/consumption/attributes/
|
|
7743
|
-
|
|
8007
|
+
/***/ "./dist/useCases/consumption/attributes/CreateShareAttributeCopy.js":
|
|
8008
|
+
/*!**************************************************************************!*\
|
|
8009
|
+
!*** ./dist/useCases/consumption/attributes/CreateShareAttributeCopy.js ***!
|
|
8010
|
+
\**************************************************************************/
|
|
7744
8011
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
7745
8012
|
|
|
7746
8013
|
"use strict";
|
|
@@ -7758,51 +8025,56 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
7758
8025
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
7759
8026
|
};
|
|
7760
8027
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7761
|
-
exports.
|
|
8028
|
+
exports.CreateSharedAttributeCopyUseCase = void 0;
|
|
7762
8029
|
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
7763
8030
|
const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
|
|
7764
8031
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
7765
8032
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
7766
8033
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
8034
|
+
const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
|
|
8035
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
8036
|
+
constructor(schemaRepository) {
|
|
8037
|
+
super(schemaRepository.getSchema("CreateShareAttributeCopyRequest"));
|
|
7771
8038
|
}
|
|
7772
|
-
}
|
|
7773
|
-
|
|
8039
|
+
};
|
|
8040
|
+
Validator = __decorate([
|
|
8041
|
+
__param(0, typescript_ioc_1.Inject),
|
|
8042
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
8043
|
+
], Validator);
|
|
8044
|
+
let CreateSharedAttributeCopyUseCase = class CreateSharedAttributeCopyUseCase extends common_1.UseCase {
|
|
7774
8045
|
constructor(attributeController, accountController, validator) {
|
|
7775
8046
|
super(validator);
|
|
7776
8047
|
this.attributeController = attributeController;
|
|
7777
8048
|
this.accountController = accountController;
|
|
7778
8049
|
}
|
|
7779
8050
|
async executeInternal(request) {
|
|
7780
|
-
const
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
8051
|
+
const params = consumption_1.CreateSharedConsumptionAttributeCopyParams.from({
|
|
8052
|
+
attributeId: transport_1.CoreId.from(request.attributeId),
|
|
8053
|
+
peer: transport_1.CoreAddress.from(request.peer),
|
|
8054
|
+
requestReference: transport_1.CoreId.from(request.requestReference)
|
|
8055
|
+
});
|
|
8056
|
+
const successor = await this.attributeController.createSharedConsumptionAttributeCopy(params);
|
|
7785
8057
|
await this.accountController.syncDatawallet();
|
|
7786
|
-
return ts_utils_1.Result.ok(
|
|
8058
|
+
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTO(successor));
|
|
7787
8059
|
}
|
|
7788
8060
|
};
|
|
7789
|
-
|
|
8061
|
+
CreateSharedAttributeCopyUseCase = __decorate([
|
|
7790
8062
|
__param(0, typescript_ioc_1.Inject),
|
|
7791
8063
|
__param(1, typescript_ioc_1.Inject),
|
|
7792
8064
|
__param(2, typescript_ioc_1.Inject),
|
|
7793
8065
|
__metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController,
|
|
7794
8066
|
transport_1.AccountController,
|
|
7795
|
-
|
|
7796
|
-
],
|
|
7797
|
-
exports.
|
|
7798
|
-
//# sourceMappingURL=
|
|
8067
|
+
Validator])
|
|
8068
|
+
], CreateSharedAttributeCopyUseCase);
|
|
8069
|
+
exports.CreateSharedAttributeCopyUseCase = CreateSharedAttributeCopyUseCase;
|
|
8070
|
+
//# sourceMappingURL=CreateShareAttributeCopy.js.map
|
|
7799
8071
|
|
|
7800
8072
|
/***/ }),
|
|
7801
8073
|
|
|
7802
|
-
/***/ "./dist/useCases/consumption/attributes/
|
|
7803
|
-
|
|
7804
|
-
!*** ./dist/useCases/consumption/attributes/
|
|
7805
|
-
|
|
8074
|
+
/***/ "./dist/useCases/consumption/attributes/DeleteAttribute.js":
|
|
8075
|
+
/*!*****************************************************************!*\
|
|
8076
|
+
!*** ./dist/useCases/consumption/attributes/DeleteAttribute.js ***!
|
|
8077
|
+
\*****************************************************************/
|
|
7806
8078
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
7807
8079
|
|
|
7808
8080
|
"use strict";
|
|
@@ -7820,26 +8092,29 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
7820
8092
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
7821
8093
|
};
|
|
7822
8094
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7823
|
-
exports.
|
|
8095
|
+
exports.DeleteAttributeUseCase = void 0;
|
|
7824
8096
|
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
7825
8097
|
const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
|
|
7826
8098
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
7827
8099
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
7828
8100
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
7829
|
-
class
|
|
7830
|
-
constructor() {
|
|
7831
|
-
super();
|
|
7832
|
-
this.validateIfString((d) => d.name).isDefined();
|
|
8101
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
8102
|
+
constructor(schemaRepository) {
|
|
8103
|
+
super(schemaRepository.getSchema("DeleteAttributeRequest"));
|
|
7833
8104
|
}
|
|
7834
|
-
}
|
|
7835
|
-
|
|
8105
|
+
};
|
|
8106
|
+
Validator = __decorate([
|
|
8107
|
+
__param(0, typescript_ioc_1.Inject),
|
|
8108
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
8109
|
+
], Validator);
|
|
8110
|
+
let DeleteAttributeUseCase = class DeleteAttributeUseCase extends common_1.UseCase {
|
|
7836
8111
|
constructor(attributeController, accountController, validator) {
|
|
7837
8112
|
super(validator);
|
|
7838
8113
|
this.attributeController = attributeController;
|
|
7839
8114
|
this.accountController = accountController;
|
|
7840
8115
|
}
|
|
7841
8116
|
async executeInternal(request) {
|
|
7842
|
-
const attribute = await this.attributeController.
|
|
8117
|
+
const attribute = await this.attributeController.getConsumptionAttribute(transport_1.CoreId.from(request.id));
|
|
7843
8118
|
if (!attribute) {
|
|
7844
8119
|
return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(consumption_1.ConsumptionAttribute));
|
|
7845
8120
|
}
|
|
@@ -7848,16 +8123,16 @@ let DeleteAttributeByNameUseCase = class DeleteAttributeByNameUseCase extends co
|
|
|
7848
8123
|
return ts_utils_1.Result.ok(undefined);
|
|
7849
8124
|
}
|
|
7850
8125
|
};
|
|
7851
|
-
|
|
8126
|
+
DeleteAttributeUseCase = __decorate([
|
|
7852
8127
|
__param(0, typescript_ioc_1.Inject),
|
|
7853
8128
|
__param(1, typescript_ioc_1.Inject),
|
|
7854
8129
|
__param(2, typescript_ioc_1.Inject),
|
|
7855
8130
|
__metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController,
|
|
7856
8131
|
transport_1.AccountController,
|
|
7857
|
-
|
|
7858
|
-
],
|
|
7859
|
-
exports.
|
|
7860
|
-
//# sourceMappingURL=
|
|
8132
|
+
Validator])
|
|
8133
|
+
], DeleteAttributeUseCase);
|
|
8134
|
+
exports.DeleteAttributeUseCase = DeleteAttributeUseCase;
|
|
8135
|
+
//# sourceMappingURL=DeleteAttribute.js.map
|
|
7861
8136
|
|
|
7862
8137
|
/***/ }),
|
|
7863
8138
|
|
|
@@ -7894,7 +8169,7 @@ let GetAllValidUseCase = class GetAllValidUseCase extends common_1.UseCase {
|
|
|
7894
8169
|
this.attributeController = attributeController;
|
|
7895
8170
|
}
|
|
7896
8171
|
async executeInternal() {
|
|
7897
|
-
const attributes = await this.attributeController.
|
|
8172
|
+
const attributes = await this.attributeController.getValidConsumptionAttributes();
|
|
7898
8173
|
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTOList(attributes));
|
|
7899
8174
|
}
|
|
7900
8175
|
};
|
|
@@ -7936,19 +8211,22 @@ const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transpor
|
|
|
7936
8211
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
7937
8212
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
7938
8213
|
const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
|
|
7939
|
-
class
|
|
7940
|
-
constructor() {
|
|
7941
|
-
super();
|
|
7942
|
-
this.validateIf((x) => x.id).fulfills(common_1.IdValidator.required(consumption_1.ConsumptionIds.attribute));
|
|
8214
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
8215
|
+
constructor(schemaRepository) {
|
|
8216
|
+
super(schemaRepository.getSchema("GetAttributeRequest"));
|
|
7943
8217
|
}
|
|
7944
|
-
}
|
|
8218
|
+
};
|
|
8219
|
+
Validator = __decorate([
|
|
8220
|
+
__param(0, typescript_ioc_1.Inject),
|
|
8221
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
8222
|
+
], Validator);
|
|
7945
8223
|
let GetAttributeUseCase = class GetAttributeUseCase extends common_1.UseCase {
|
|
7946
8224
|
constructor(attributeController, validator) {
|
|
7947
8225
|
super(validator);
|
|
7948
8226
|
this.attributeController = attributeController;
|
|
7949
8227
|
}
|
|
7950
8228
|
async executeInternal(request) {
|
|
7951
|
-
const attribute = await this.attributeController.
|
|
8229
|
+
const attribute = await this.attributeController.getConsumptionAttribute(transport_1.CoreId.from(request.id));
|
|
7952
8230
|
if (!attribute) {
|
|
7953
8231
|
return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(content_1.Attribute));
|
|
7954
8232
|
}
|
|
@@ -7958,70 +8236,13 @@ let GetAttributeUseCase = class GetAttributeUseCase extends common_1.UseCase {
|
|
|
7958
8236
|
GetAttributeUseCase = __decorate([
|
|
7959
8237
|
__param(0, typescript_ioc_1.Inject),
|
|
7960
8238
|
__param(1, typescript_ioc_1.Inject),
|
|
7961
|
-
__metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController,
|
|
8239
|
+
__metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController, Validator])
|
|
7962
8240
|
], GetAttributeUseCase);
|
|
7963
8241
|
exports.GetAttributeUseCase = GetAttributeUseCase;
|
|
7964
8242
|
//# sourceMappingURL=GetAttribute.js.map
|
|
7965
8243
|
|
|
7966
8244
|
/***/ }),
|
|
7967
8245
|
|
|
7968
|
-
/***/ "./dist/useCases/consumption/attributes/GetAttributeByName.js":
|
|
7969
|
-
/*!********************************************************************!*\
|
|
7970
|
-
!*** ./dist/useCases/consumption/attributes/GetAttributeByName.js ***!
|
|
7971
|
-
\********************************************************************/
|
|
7972
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
7973
|
-
|
|
7974
|
-
"use strict";
|
|
7975
|
-
|
|
7976
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
7977
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7978
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7979
|
-
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;
|
|
7980
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7981
|
-
};
|
|
7982
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
7983
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
7984
|
-
};
|
|
7985
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
7986
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
7987
|
-
};
|
|
7988
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7989
|
-
exports.GetAttributeByNameUseCase = void 0;
|
|
7990
|
-
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
7991
|
-
const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
|
|
7992
|
-
const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
7993
|
-
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
7994
|
-
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
7995
|
-
const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
|
|
7996
|
-
class GetAttributeByNameRequestValidator extends common_1.RuntimeValidator {
|
|
7997
|
-
constructor() {
|
|
7998
|
-
super();
|
|
7999
|
-
this.validateIfString((d) => d.name).isNotEmpty();
|
|
8000
|
-
}
|
|
8001
|
-
}
|
|
8002
|
-
let GetAttributeByNameUseCase = class GetAttributeByNameUseCase extends common_1.UseCase {
|
|
8003
|
-
constructor(attributeController, validator) {
|
|
8004
|
-
super(validator);
|
|
8005
|
-
this.attributeController = attributeController;
|
|
8006
|
-
}
|
|
8007
|
-
async executeInternal(request) {
|
|
8008
|
-
const attribute = await this.attributeController.getAttributeByName(request.name);
|
|
8009
|
-
if (!attribute) {
|
|
8010
|
-
return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(content_1.Attribute));
|
|
8011
|
-
}
|
|
8012
|
-
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTO(attribute));
|
|
8013
|
-
}
|
|
8014
|
-
};
|
|
8015
|
-
GetAttributeByNameUseCase = __decorate([
|
|
8016
|
-
__param(0, typescript_ioc_1.Inject),
|
|
8017
|
-
__param(1, typescript_ioc_1.Inject),
|
|
8018
|
-
__metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController, GetAttributeByNameRequestValidator])
|
|
8019
|
-
], GetAttributeByNameUseCase);
|
|
8020
|
-
exports.GetAttributeByNameUseCase = GetAttributeByNameUseCase;
|
|
8021
|
-
//# sourceMappingURL=GetAttributeByName.js.map
|
|
8022
|
-
|
|
8023
|
-
/***/ }),
|
|
8024
|
-
|
|
8025
8246
|
/***/ "./dist/useCases/consumption/attributes/GetAttributes.js":
|
|
8026
8247
|
/*!***************************************************************!*\
|
|
8027
8248
|
!*** ./dist/useCases/consumption/attributes/GetAttributes.js ***!
|
|
@@ -8044,146 +8265,133 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
8044
8265
|
};
|
|
8045
8266
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8046
8267
|
exports.GetAttributesUseCase = void 0;
|
|
8268
|
+
const docdb_querytranslator_1 = __webpack_require__(/*! @js-soft/docdb-querytranslator */ "./node_modules/@js-soft/docdb-querytranslator/dist/index.js");
|
|
8047
8269
|
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
8048
8270
|
const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
|
|
8271
|
+
const luxon_1 = __webpack_require__(/*! luxon */ "./node_modules/luxon/build/cjs-browser/luxon.js");
|
|
8272
|
+
const ts_simple_nameof_1 = __webpack_require__(/*! ts-simple-nameof */ "./node_modules/ts-simple-nameof/index.js");
|
|
8049
8273
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
8050
8274
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
8275
|
+
const flattenObject_1 = __webpack_require__(/*! ../requests/flattenObject */ "./dist/useCases/consumption/requests/flattenObject.js");
|
|
8051
8276
|
const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
|
|
8052
|
-
class GetAttributesRequestValidator extends common_1.RuntimeValidator {
|
|
8053
|
-
constructor() {
|
|
8054
|
-
super();
|
|
8055
|
-
// TODO: JSSNMSHDD-2465 (add validation)
|
|
8056
|
-
}
|
|
8057
|
-
}
|
|
8058
8277
|
let GetAttributesUseCase = class GetAttributesUseCase extends common_1.UseCase {
|
|
8059
|
-
constructor(attributeController
|
|
8060
|
-
super(
|
|
8278
|
+
constructor(attributeController) {
|
|
8279
|
+
super();
|
|
8061
8280
|
this.attributeController = attributeController;
|
|
8062
8281
|
}
|
|
8063
|
-
async executeInternal(
|
|
8064
|
-
const
|
|
8282
|
+
async executeInternal(request) {
|
|
8283
|
+
const flattenedQuery = (0, flattenObject_1.flattenObject)(request.query);
|
|
8284
|
+
const dbQuery = GetAttributesUseCase.queryTranslator.parse(flattenedQuery);
|
|
8285
|
+
const fetched = await this.attributeController.getConsumptionAttributes(dbQuery);
|
|
8065
8286
|
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTOList(fetched));
|
|
8066
8287
|
}
|
|
8067
8288
|
};
|
|
8289
|
+
GetAttributesUseCase.queryTranslator = new docdb_querytranslator_1.QueryTranslator({
|
|
8290
|
+
whitelist: {
|
|
8291
|
+
[(0, ts_simple_nameof_1.nameof)((x) => x.createdAt)]: true,
|
|
8292
|
+
[(0, ts_simple_nameof_1.nameof)((x) => x.succeeds)]: true,
|
|
8293
|
+
[(0, ts_simple_nameof_1.nameof)((x) => x.succeededBy)]: true,
|
|
8294
|
+
// content.abstractAttribute
|
|
8295
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.validFrom)}`]: true,
|
|
8296
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.validTo)}`]: true,
|
|
8297
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.owner)}`]: true,
|
|
8298
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.@type`]: true,
|
|
8299
|
+
// content.identityAttribute
|
|
8300
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.tags)}`]: true,
|
|
8301
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.value)}.@type`]: true,
|
|
8302
|
+
// content.relationshipAttribute
|
|
8303
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.key)}`]: true,
|
|
8304
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.isTechnical)}`]: true,
|
|
8305
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.confidentiality)}`]: true,
|
|
8306
|
+
// content.shareInfo
|
|
8307
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.peer)}`]: true,
|
|
8308
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.requestReference)}`]: true,
|
|
8309
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.sourceAttribute)}`]: true
|
|
8310
|
+
},
|
|
8311
|
+
alias: {
|
|
8312
|
+
[(0, ts_simple_nameof_1.nameof)((x) => x.createdAt)]: [(0, ts_simple_nameof_1.nameof)((x) => x.createdAt)],
|
|
8313
|
+
[(0, ts_simple_nameof_1.nameof)((x) => x.succeeds)]: [(0, ts_simple_nameof_1.nameof)((x) => x.succeeds)],
|
|
8314
|
+
[(0, ts_simple_nameof_1.nameof)((x) => x.succeededBy)]: [(0, ts_simple_nameof_1.nameof)((x) => x.succeededBy)],
|
|
8315
|
+
// content.abstractAttribute
|
|
8316
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.validFrom)}`]: [
|
|
8317
|
+
`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.validFrom)}`
|
|
8318
|
+
],
|
|
8319
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.validTo)}`]: [
|
|
8320
|
+
`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.validTo)}`
|
|
8321
|
+
],
|
|
8322
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.owner)}`]: [
|
|
8323
|
+
`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.owner)}`
|
|
8324
|
+
],
|
|
8325
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.@type`]: [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.@type`],
|
|
8326
|
+
// content.identityAttribute
|
|
8327
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.tags)}`]: [
|
|
8328
|
+
`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.tags)}`
|
|
8329
|
+
],
|
|
8330
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.value)}.@type`]: [
|
|
8331
|
+
`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.value)}.@type`
|
|
8332
|
+
],
|
|
8333
|
+
// content.relationshipAttribute
|
|
8334
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.key)}`]: [
|
|
8335
|
+
`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.key)}`
|
|
8336
|
+
],
|
|
8337
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.isTechnical)}`]: [
|
|
8338
|
+
`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.isTechnical)}`
|
|
8339
|
+
],
|
|
8340
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.confidentiality)}`]: [
|
|
8341
|
+
`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.confidentiality)}`
|
|
8342
|
+
],
|
|
8343
|
+
// content.shareInfo
|
|
8344
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.peer)}`]: [
|
|
8345
|
+
`${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.peer)}`
|
|
8346
|
+
],
|
|
8347
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.requestReference)}`]: [
|
|
8348
|
+
`${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.requestReference)}`
|
|
8349
|
+
],
|
|
8350
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.sourceAttribute)}`]: [
|
|
8351
|
+
`${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.sourceAttribute)}`
|
|
8352
|
+
]
|
|
8353
|
+
},
|
|
8354
|
+
custom: {
|
|
8355
|
+
// content.validFrom
|
|
8356
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.validFrom)}`]: (query, input) => {
|
|
8357
|
+
if (!input) {
|
|
8358
|
+
return;
|
|
8359
|
+
}
|
|
8360
|
+
const validFromUtcString = luxon_1.DateTime.fromISO(input).toUTC().toString();
|
|
8361
|
+
query[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.validFrom)}`] = {
|
|
8362
|
+
$gte: validFromUtcString
|
|
8363
|
+
};
|
|
8364
|
+
},
|
|
8365
|
+
// content.validTo
|
|
8366
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.validTo)}`]: (query, input) => {
|
|
8367
|
+
if (!input) {
|
|
8368
|
+
return;
|
|
8369
|
+
}
|
|
8370
|
+
const validToUtcString = luxon_1.DateTime.fromISO(input).toUTC().toString();
|
|
8371
|
+
query[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.validTo)}`] = {
|
|
8372
|
+
$lte: validToUtcString
|
|
8373
|
+
};
|
|
8374
|
+
},
|
|
8375
|
+
// content.tags
|
|
8376
|
+
[`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.tags)}`]: (query, input) => {
|
|
8377
|
+
const allowedTags = [];
|
|
8378
|
+
for (const tag of input) {
|
|
8379
|
+
const tagQuery = { [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.tags)}`]: { $contains: tag } };
|
|
8380
|
+
allowedTags.push(tagQuery);
|
|
8381
|
+
}
|
|
8382
|
+
query["$or"] = allowedTags;
|
|
8383
|
+
}
|
|
8384
|
+
}
|
|
8385
|
+
});
|
|
8068
8386
|
GetAttributesUseCase = __decorate([
|
|
8069
8387
|
__param(0, typescript_ioc_1.Inject),
|
|
8070
|
-
|
|
8071
|
-
__metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController, GetAttributesRequestValidator])
|
|
8388
|
+
__metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController])
|
|
8072
8389
|
], GetAttributesUseCase);
|
|
8073
8390
|
exports.GetAttributesUseCase = GetAttributesUseCase;
|
|
8074
8391
|
//# sourceMappingURL=GetAttributes.js.map
|
|
8075
8392
|
|
|
8076
8393
|
/***/ }),
|
|
8077
8394
|
|
|
8078
|
-
/***/ "./dist/useCases/consumption/attributes/GetAttributesByNames.js":
|
|
8079
|
-
/*!**********************************************************************!*\
|
|
8080
|
-
!*** ./dist/useCases/consumption/attributes/GetAttributesByNames.js ***!
|
|
8081
|
-
\**********************************************************************/
|
|
8082
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
8083
|
-
|
|
8084
|
-
"use strict";
|
|
8085
|
-
|
|
8086
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
8087
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8088
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8089
|
-
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;
|
|
8090
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8091
|
-
};
|
|
8092
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8093
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
8094
|
-
};
|
|
8095
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
8096
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
8097
|
-
};
|
|
8098
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8099
|
-
exports.GetAttributesByNamesUseCase = void 0;
|
|
8100
|
-
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
8101
|
-
const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
|
|
8102
|
-
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
8103
|
-
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
8104
|
-
const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
|
|
8105
|
-
class GetAttributesByNamesRequestValidator extends common_1.RuntimeValidator {
|
|
8106
|
-
constructor() {
|
|
8107
|
-
super();
|
|
8108
|
-
}
|
|
8109
|
-
}
|
|
8110
|
-
let GetAttributesByNamesUseCase = class GetAttributesByNamesUseCase extends common_1.UseCase {
|
|
8111
|
-
constructor(attributeController, validator) {
|
|
8112
|
-
super(validator);
|
|
8113
|
-
this.attributeController = attributeController;
|
|
8114
|
-
}
|
|
8115
|
-
async executeInternal(_request) {
|
|
8116
|
-
const attributes = await this.attributeController.getAttributesByName();
|
|
8117
|
-
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toGetAttributesByNamesResponse(attributes));
|
|
8118
|
-
}
|
|
8119
|
-
};
|
|
8120
|
-
GetAttributesByNamesUseCase = __decorate([
|
|
8121
|
-
__param(0, typescript_ioc_1.Inject),
|
|
8122
|
-
__param(1, typescript_ioc_1.Inject),
|
|
8123
|
-
__metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController, GetAttributesByNamesRequestValidator])
|
|
8124
|
-
], GetAttributesByNamesUseCase);
|
|
8125
|
-
exports.GetAttributesByNamesUseCase = GetAttributesByNamesUseCase;
|
|
8126
|
-
//# sourceMappingURL=GetAttributesByNames.js.map
|
|
8127
|
-
|
|
8128
|
-
/***/ }),
|
|
8129
|
-
|
|
8130
|
-
/***/ "./dist/useCases/consumption/attributes/GetHistoryByName.js":
|
|
8131
|
-
/*!******************************************************************!*\
|
|
8132
|
-
!*** ./dist/useCases/consumption/attributes/GetHistoryByName.js ***!
|
|
8133
|
-
\******************************************************************/
|
|
8134
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
8135
|
-
|
|
8136
|
-
"use strict";
|
|
8137
|
-
|
|
8138
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
8139
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8140
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8141
|
-
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;
|
|
8142
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8143
|
-
};
|
|
8144
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8145
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
8146
|
-
};
|
|
8147
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
8148
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
8149
|
-
};
|
|
8150
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8151
|
-
exports.GetHistoryByNameUseCase = void 0;
|
|
8152
|
-
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
8153
|
-
const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
|
|
8154
|
-
const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
8155
|
-
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
8156
|
-
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
8157
|
-
const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
|
|
8158
|
-
class GetHistoryByNameRequestValidator extends common_1.RuntimeValidator {
|
|
8159
|
-
constructor() {
|
|
8160
|
-
super();
|
|
8161
|
-
this.validateIfString((x) => x.name).isDefined();
|
|
8162
|
-
}
|
|
8163
|
-
}
|
|
8164
|
-
let GetHistoryByNameUseCase = class GetHistoryByNameUseCase extends common_1.UseCase {
|
|
8165
|
-
constructor(attributeController, validator) {
|
|
8166
|
-
super(validator);
|
|
8167
|
-
this.attributeController = attributeController;
|
|
8168
|
-
}
|
|
8169
|
-
async executeInternal(request) {
|
|
8170
|
-
const attributes = await this.attributeController.getAttributeHistoryByName(request.name);
|
|
8171
|
-
if (attributes.length === 0) {
|
|
8172
|
-
return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(content_1.Attribute));
|
|
8173
|
-
}
|
|
8174
|
-
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTOList(attributes));
|
|
8175
|
-
}
|
|
8176
|
-
};
|
|
8177
|
-
GetHistoryByNameUseCase = __decorate([
|
|
8178
|
-
__param(0, typescript_ioc_1.Inject),
|
|
8179
|
-
__param(1, typescript_ioc_1.Inject),
|
|
8180
|
-
__metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController, GetHistoryByNameRequestValidator])
|
|
8181
|
-
], GetHistoryByNameUseCase);
|
|
8182
|
-
exports.GetHistoryByNameUseCase = GetHistoryByNameUseCase;
|
|
8183
|
-
//# sourceMappingURL=GetHistoryByName.js.map
|
|
8184
|
-
|
|
8185
|
-
/***/ }),
|
|
8186
|
-
|
|
8187
8395
|
/***/ "./dist/useCases/consumption/attributes/SucceedAttribute.js":
|
|
8188
8396
|
/*!******************************************************************!*\
|
|
8189
8397
|
!*** ./dist/useCases/consumption/attributes/SucceedAttribute.js ***!
|
|
@@ -8212,14 +8420,15 @@ const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transpor
|
|
|
8212
8420
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
8213
8421
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
8214
8422
|
const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
|
|
8215
|
-
class
|
|
8216
|
-
constructor() {
|
|
8217
|
-
super();
|
|
8218
|
-
this.validateIf((x) => x.validFrom).fulfills(common_1.DateValidator.optional());
|
|
8219
|
-
this.validateIf((x) => x.attribute).isDefined();
|
|
8220
|
-
this.validateIf((x) => x.attribute.name).isNotEmpty();
|
|
8423
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
8424
|
+
constructor(schemaRepository) {
|
|
8425
|
+
super(schemaRepository.getSchema("SucceedAttributeRequest"));
|
|
8221
8426
|
}
|
|
8222
|
-
}
|
|
8427
|
+
};
|
|
8428
|
+
Validator = __decorate([
|
|
8429
|
+
__param(0, typescript_ioc_1.Inject),
|
|
8430
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
8431
|
+
], Validator);
|
|
8223
8432
|
let SucceedAttributeUseCase = class SucceedAttributeUseCase extends common_1.UseCase {
|
|
8224
8433
|
constructor(attributeController, accountController, validator) {
|
|
8225
8434
|
super(validator);
|
|
@@ -8227,8 +8436,11 @@ let SucceedAttributeUseCase = class SucceedAttributeUseCase extends common_1.Use
|
|
|
8227
8436
|
this.accountController = accountController;
|
|
8228
8437
|
}
|
|
8229
8438
|
async executeInternal(request) {
|
|
8230
|
-
const
|
|
8231
|
-
|
|
8439
|
+
const params = consumption_1.SucceedConsumptionAttributeParams.from({
|
|
8440
|
+
successorContent: request.successorContent,
|
|
8441
|
+
succeeds: request.succeeds
|
|
8442
|
+
});
|
|
8443
|
+
const successor = await this.attributeController.succeedConsumptionAttribute(params);
|
|
8232
8444
|
await this.accountController.syncDatawallet();
|
|
8233
8445
|
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTO(successor));
|
|
8234
8446
|
}
|
|
@@ -8239,7 +8451,7 @@ SucceedAttributeUseCase = __decorate([
|
|
|
8239
8451
|
__param(2, typescript_ioc_1.Inject),
|
|
8240
8452
|
__metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController,
|
|
8241
8453
|
transport_1.AccountController,
|
|
8242
|
-
|
|
8454
|
+
Validator])
|
|
8243
8455
|
], SucceedAttributeUseCase);
|
|
8244
8456
|
exports.SucceedAttributeUseCase = SucceedAttributeUseCase;
|
|
8245
8457
|
//# sourceMappingURL=SucceedAttribute.js.map
|
|
@@ -8270,19 +8482,19 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
8270
8482
|
exports.UpdateAttributeUseCase = void 0;
|
|
8271
8483
|
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
8272
8484
|
const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
|
|
8273
|
-
const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
8274
8485
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
8275
8486
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
8276
8487
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
8277
8488
|
const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
|
|
8278
|
-
class
|
|
8279
|
-
constructor() {
|
|
8280
|
-
super();
|
|
8281
|
-
this.validateIfString((x) => x.id).fulfills(common_1.IdValidator.required(consumption_1.ConsumptionIds.attribute));
|
|
8282
|
-
this.validateIf((x) => x.attribute).isDefined();
|
|
8283
|
-
this.validateIf((x) => x.attribute.name).isNotEmpty();
|
|
8489
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
8490
|
+
constructor(schemaRepository) {
|
|
8491
|
+
super(schemaRepository.getSchema("UpdateAttributeRequest"));
|
|
8284
8492
|
}
|
|
8285
|
-
}
|
|
8493
|
+
};
|
|
8494
|
+
Validator = __decorate([
|
|
8495
|
+
__param(0, typescript_ioc_1.Inject),
|
|
8496
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
8497
|
+
], Validator);
|
|
8286
8498
|
let UpdateAttributeUseCase = class UpdateAttributeUseCase extends common_1.UseCase {
|
|
8287
8499
|
constructor(attributeController, accountController, validator) {
|
|
8288
8500
|
super(validator);
|
|
@@ -8290,12 +8502,11 @@ let UpdateAttributeUseCase = class UpdateAttributeUseCase extends common_1.UseCa
|
|
|
8290
8502
|
this.accountController = accountController;
|
|
8291
8503
|
}
|
|
8292
8504
|
async executeInternal(request) {
|
|
8293
|
-
const
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
}
|
|
8297
|
-
|
|
8298
|
-
const updated = await this.attributeController.updateAttribute(attribute);
|
|
8505
|
+
const params = consumption_1.UpdateConsumptionAttributeParams.from({
|
|
8506
|
+
id: request.id,
|
|
8507
|
+
content: request.content
|
|
8508
|
+
});
|
|
8509
|
+
const updated = await this.attributeController.updateConsumptionAttribute(params);
|
|
8299
8510
|
await this.accountController.syncDatawallet();
|
|
8300
8511
|
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTO(updated));
|
|
8301
8512
|
}
|
|
@@ -8306,7 +8517,7 @@ UpdateAttributeUseCase = __decorate([
|
|
|
8306
8517
|
__param(2, typescript_ioc_1.Inject),
|
|
8307
8518
|
__metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController,
|
|
8308
8519
|
transport_1.AccountController,
|
|
8309
|
-
|
|
8520
|
+
Validator])
|
|
8310
8521
|
], UpdateAttributeUseCase);
|
|
8311
8522
|
exports.UpdateAttributeUseCase = UpdateAttributeUseCase;
|
|
8312
8523
|
//# sourceMappingURL=UpdateAttribute.js.map
|
|
@@ -8338,14 +8549,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
8338
8549
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8339
8550
|
__exportStar(__webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js"), exports);
|
|
8340
8551
|
__exportStar(__webpack_require__(/*! ./CreateAttribute */ "./dist/useCases/consumption/attributes/CreateAttribute.js"), exports);
|
|
8552
|
+
__exportStar(__webpack_require__(/*! ./CreateShareAttributeCopy */ "./dist/useCases/consumption/attributes/CreateShareAttributeCopy.js"), exports);
|
|
8341
8553
|
__exportStar(__webpack_require__(/*! ./DeleteAttribute */ "./dist/useCases/consumption/attributes/DeleteAttribute.js"), exports);
|
|
8342
|
-
__exportStar(__webpack_require__(/*! ./DeleteAttributeByName */ "./dist/useCases/consumption/attributes/DeleteAttributeByName.js"), exports);
|
|
8343
8554
|
__exportStar(__webpack_require__(/*! ./GetAllValid */ "./dist/useCases/consumption/attributes/GetAllValid.js"), exports);
|
|
8344
8555
|
__exportStar(__webpack_require__(/*! ./GetAttribute */ "./dist/useCases/consumption/attributes/GetAttribute.js"), exports);
|
|
8345
|
-
__exportStar(__webpack_require__(/*! ./GetAttributeByName */ "./dist/useCases/consumption/attributes/GetAttributeByName.js"), exports);
|
|
8346
8556
|
__exportStar(__webpack_require__(/*! ./GetAttributes */ "./dist/useCases/consumption/attributes/GetAttributes.js"), exports);
|
|
8347
|
-
__exportStar(__webpack_require__(/*! ./GetAttributesByNames */ "./dist/useCases/consumption/attributes/GetAttributesByNames.js"), exports);
|
|
8348
|
-
__exportStar(__webpack_require__(/*! ./GetHistoryByName */ "./dist/useCases/consumption/attributes/GetHistoryByName.js"), exports);
|
|
8349
8557
|
__exportStar(__webpack_require__(/*! ./SucceedAttribute */ "./dist/useCases/consumption/attributes/SucceedAttribute.js"), exports);
|
|
8350
8558
|
__exportStar(__webpack_require__(/*! ./UpdateAttribute */ "./dist/useCases/consumption/attributes/UpdateAttribute.js"), exports);
|
|
8351
8559
|
//# sourceMappingURL=index.js.map
|
|
@@ -9862,8 +10070,8 @@ class RequestValidationResultMapper {
|
|
|
9862
10070
|
static toRequestValidationResultDTO(request) {
|
|
9863
10071
|
return {
|
|
9864
10072
|
isSuccess: request.isSuccess(),
|
|
9865
|
-
code: request.isError() ? request.code : undefined,
|
|
9866
|
-
message: request.isError() ? request.message : undefined,
|
|
10073
|
+
code: request.isError() ? request.error.code : undefined,
|
|
10074
|
+
message: request.isError() ? request.error.message : undefined,
|
|
9867
10075
|
items: request.items.map((item) => this.toRequestValidationResultDTO(item))
|
|
9868
10076
|
};
|
|
9869
10077
|
}
|
|
@@ -11111,9 +11319,9 @@ exports.CreateChallengeUseCase = CreateChallengeUseCase;
|
|
|
11111
11319
|
|
|
11112
11320
|
/***/ }),
|
|
11113
11321
|
|
|
11114
|
-
/***/ "./dist/useCases/transport/challenges/
|
|
11322
|
+
/***/ "./dist/useCases/transport/challenges/ValidateChallenge.js":
|
|
11115
11323
|
/*!*****************************************************************!*\
|
|
11116
|
-
!*** ./dist/useCases/transport/challenges/
|
|
11324
|
+
!*** ./dist/useCases/transport/challenges/ValidateChallenge.js ***!
|
|
11117
11325
|
\*****************************************************************/
|
|
11118
11326
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
11119
11327
|
|
|
@@ -11213,7 +11421,7 @@ ValidateChallengeUseCase = __decorate([
|
|
|
11213
11421
|
__metadata("design:paramtypes", [transport_1.ChallengeController, Validator])
|
|
11214
11422
|
], ValidateChallengeUseCase);
|
|
11215
11423
|
exports.ValidateChallengeUseCase = ValidateChallengeUseCase;
|
|
11216
|
-
//# sourceMappingURL=
|
|
11424
|
+
//# sourceMappingURL=ValidateChallenge.js.map
|
|
11217
11425
|
|
|
11218
11426
|
/***/ }),
|
|
11219
11427
|
|
|
@@ -11241,7 +11449,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11241
11449
|
};
|
|
11242
11450
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11243
11451
|
__exportStar(__webpack_require__(/*! ./CreateChallenge */ "./dist/useCases/transport/challenges/CreateChallenge.js"), exports);
|
|
11244
|
-
__exportStar(__webpack_require__(/*! ./
|
|
11452
|
+
__exportStar(__webpack_require__(/*! ./ValidateChallenge */ "./dist/useCases/transport/challenges/ValidateChallenge.js"), exports);
|
|
11245
11453
|
//# sourceMappingURL=index.js.map
|
|
11246
11454
|
|
|
11247
11455
|
/***/ }),
|
|
@@ -12807,7 +13015,6 @@ const MessageMapper_1 = __webpack_require__(/*! ./MessageMapper */ "./dist/useCa
|
|
|
12807
13015
|
class GetMessagesRequestValidator extends common_1.RuntimeValidator {
|
|
12808
13016
|
constructor() {
|
|
12809
13017
|
super();
|
|
12810
|
-
// TODO: JSSNMSHDD-2470 (add validation)
|
|
12811
13018
|
}
|
|
12812
13019
|
}
|
|
12813
13020
|
let GetMessagesUseCase = class GetMessagesUseCase extends common_1.UseCase {
|