@nmshd/runtime 1.2.1 → 1.2.5
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/Runtime.js +0 -3
- package/dist/Runtime.js.map +1 -1
- package/dist/buildInformation.js +5 -5
- package/dist/dataViews/DataViewExpander.d.ts +26 -20
- package/dist/dataViews/DataViewExpander.js +259 -147
- package/dist/dataViews/DataViewExpander.js.map +1 -1
- package/dist/dataViews/DataViewTranslateable.d.ts +4 -0
- package/dist/dataViews/DataViewTranslateable.js +5 -1
- package/dist/dataViews/DataViewTranslateable.js.map +1 -1
- package/dist/dataViews/consumption/MatchedAttributesDVO.d.ts +7 -0
- package/dist/dataViews/consumption/MatchedAttributesDVO.js +3 -0
- package/dist/dataViews/consumption/MatchedAttributesDVO.js.map +1 -0
- package/dist/dataViews/consumption/StoredAttributeDVO.d.ts +5 -0
- package/dist/dataViews/consumption/StoredAttributeDVO.js +3 -0
- package/dist/dataViews/consumption/StoredAttributeDVO.js.map +1 -0
- package/dist/dataViews/consumption/index.d.ts +1 -5
- package/dist/dataViews/consumption/index.js +1 -5
- package/dist/dataViews/consumption/index.js.map +1 -1
- package/dist/dataViews/content/AttributeDVO.d.ts +16 -0
- package/dist/dataViews/{consumption → content}/AttributeDVO.js +0 -0
- package/dist/dataViews/content/AttributeDVO.js.map +1 -0
- package/dist/dataViews/content/MailDVOs.d.ts +22 -0
- package/dist/dataViews/{consumption/MailDVO.js → content/MailDVOs.js} +1 -1
- package/dist/dataViews/content/MailDVOs.js.map +1 -0
- package/dist/dataViews/content/RequestDVOs.d.ts +44 -0
- package/dist/dataViews/{consumption/RequestMailDVO.js → content/RequestDVOs.js} +1 -1
- package/dist/dataViews/content/RequestDVOs.js.map +1 -0
- package/dist/dataViews/content/index.d.ts +3 -0
- package/dist/dataViews/content/index.js +16 -0
- package/dist/dataViews/content/index.js.map +1 -0
- package/dist/dataViews/index.d.ts +1 -0
- package/dist/dataViews/index.js +1 -0
- package/dist/dataViews/index.js.map +1 -1
- package/dist/dataViews/transport/FileDVO.d.ts +15 -5
- package/dist/dataViews/transport/IdentityDVO.d.ts +8 -20
- package/dist/dataViews/transport/MessageDVO.d.ts +13 -9
- package/dist/dataViews/transport/MessageDVO.js +1 -1
- package/dist/dataViews/transport/MessageDVO.js.map +1 -1
- package/dist/dataViews/transport/RelationshipDVO.d.ts +12 -2
- package/dist/dataViews/transport/RelationshipTemplateDVO.d.ts +7 -5
- package/dist/extensibility/facades/consumption/AttributesFacade.d.ts +4 -4
- package/dist/extensibility/facades/consumption/AttributesFacade.js +5 -5
- package/dist/extensibility/facades/consumption/AttributesFacade.js.map +1 -1
- package/dist/types/transport/IdentityDTO.d.ts +0 -4
- package/dist/types/transport/RecipientDTO.d.ts +2 -0
- package/dist/types/transport/RelationshipDTO.d.ts +2 -0
- package/dist/types/transport/RelationshipDTO.js.map +1 -1
- package/dist/useCases/common/SchemaRepository.d.ts +5 -4
- package/dist/useCases/common/SchemaRepository.js +11 -9
- package/dist/useCases/common/SchemaRepository.js.map +1 -1
- package/dist/useCases/common/Schemas.d.ts +78 -1602
- package/dist/useCases/common/Schemas.js +172 -57
- package/dist/useCases/common/Schemas.js.map +1 -1
- package/dist/useCases/common/UseCase.d.ts +1 -4
- package/dist/useCases/common/UseCase.js.map +1 -1
- package/dist/useCases/common/index.d.ts +2 -0
- package/dist/useCases/common/index.js +2 -0
- package/dist/useCases/common/index.js.map +1 -1
- package/dist/useCases/common/validation/IValidator.d.ts +4 -0
- package/dist/{dataViews/consumption/RequestDVO.js → useCases/common/validation/IValidator.js} +1 -1
- package/dist/useCases/common/validation/IValidator.js.map +1 -0
- package/dist/useCases/common/validation/SchemaValidator.d.ts +10 -0
- package/dist/useCases/common/{SchemaValidator.js → validation/SchemaValidator.js} +6 -3
- package/dist/useCases/common/validation/SchemaValidator.js.map +1 -0
- package/dist/useCases/consumption/attributes/AttributeMapper.d.ts +2 -2
- package/dist/useCases/consumption/attributes/AttributeMapper.js +3 -3
- package/dist/useCases/consumption/attributes/AttributeMapper.js.map +1 -1
- package/dist/useCases/consumption/attributes/GetAttributesByNames.d.ts +16 -0
- package/dist/useCases/consumption/attributes/{GetAttributesByName.js → GetAttributesByNames.js} +9 -9
- package/dist/useCases/consumption/attributes/GetAttributesByNames.js.map +1 -0
- package/dist/useCases/consumption/attributes/index.d.ts +1 -1
- package/dist/useCases/consumption/attributes/index.js +1 -1
- package/dist/useCases/consumption/attributes/index.js.map +1 -1
- package/dist/useCases/transport/devices/DeviceMapper.js +2 -10
- package/dist/useCases/transport/devices/DeviceMapper.js.map +1 -1
- package/dist/useCases/transport/files/CreateTokenForFile.d.ts +1 -3
- package/dist/useCases/transport/files/CreateTokenForFile.js +2 -4
- package/dist/useCases/transport/files/CreateTokenForFile.js.map +1 -1
- package/dist/useCases/transport/files/CreateTokenQrCodeForFile.d.ts +1 -3
- package/dist/useCases/transport/files/CreateTokenQrCodeForFile.js +2 -4
- package/dist/useCases/transport/files/CreateTokenQrCodeForFile.js.map +1 -1
- package/dist/useCases/transport/files/DownloadFile.d.ts +1 -3
- package/dist/useCases/transport/files/DownloadFile.js +2 -4
- package/dist/useCases/transport/files/DownloadFile.js.map +1 -1
- package/dist/useCases/transport/files/GetFile.d.ts +1 -3
- package/dist/useCases/transport/files/GetFile.js +2 -4
- package/dist/useCases/transport/files/GetFile.js.map +1 -1
- package/dist/useCases/transport/files/LoadPeerFile.d.ts +24 -13
- package/dist/useCases/transport/files/LoadPeerFile.js +36 -37
- package/dist/useCases/transport/files/LoadPeerFile.js.map +1 -1
- package/dist/useCases/transport/messages/MessageMapper.js +5 -2
- package/dist/useCases/transport/messages/MessageMapper.js.map +1 -1
- package/dist/useCases/transport/relationships/RelationshipMapper.js +5 -0
- package/dist/useCases/transport/relationships/RelationshipMapper.js.map +1 -1
- package/lib-web/nmshd.runtime.js +928 -398
- package/lib-web/nmshd.runtime.js.map +1 -1
- package/lib-web/nmshd.runtime.min.js +2 -2
- package/lib-web/nmshd.runtime.min.js.map +1 -1
- package/package.json +23 -23
- package/dist/dataViews/consumption/AttributeDVO.d.ts +0 -18
- package/dist/dataViews/consumption/AttributeDVO.js.map +0 -1
- package/dist/dataViews/consumption/AttributesChangeRequestDVO.d.ts +0 -11
- package/dist/dataViews/consumption/AttributesChangeRequestDVO.js +0 -3
- package/dist/dataViews/consumption/AttributesChangeRequestDVO.js.map +0 -1
- package/dist/dataViews/consumption/AttributesShareRequestDVO.d.ts +0 -12
- package/dist/dataViews/consumption/AttributesShareRequestDVO.js +0 -3
- package/dist/dataViews/consumption/AttributesShareRequestDVO.js.map +0 -1
- package/dist/dataViews/consumption/MailDVO.d.ts +0 -7
- package/dist/dataViews/consumption/MailDVO.js.map +0 -1
- package/dist/dataViews/consumption/RequestDVO.d.ts +0 -7
- package/dist/dataViews/consumption/RequestDVO.js.map +0 -1
- package/dist/dataViews/consumption/RequestMailDVO.d.ts +0 -10
- package/dist/dataViews/consumption/RequestMailDVO.js.map +0 -1
- package/dist/useCases/common/SchemaValidator.d.ts +0 -9
- package/dist/useCases/common/SchemaValidator.js.map +0 -1
- package/dist/useCases/consumption/attributes/GetAttributesByName.d.ts +0 -16
- package/dist/useCases/consumption/attributes/GetAttributesByName.js.map +0 -1
package/lib-web/nmshd.runtime.js
CHANGED
|
@@ -158,9 +158,6 @@ class Runtime {
|
|
|
158
158
|
typescript_ioc_1.Container.bind(consumption_1.RelationshipInfoController)
|
|
159
159
|
.factory(() => this.getConsumptionController().relationshipInfo)
|
|
160
160
|
.scope(typescript_ioc_1.Scope.Request);
|
|
161
|
-
typescript_ioc_1.Container.bind(consumption_1.SingleRelationshipController)
|
|
162
|
-
.factory(() => new consumption_1.SingleRelationshipController(this.getConsumptionController()))
|
|
163
|
-
.scope(typescript_ioc_1.Scope.Request);
|
|
164
161
|
typescript_ioc_1.Container.bind(consumption_1.RequestsController)
|
|
165
162
|
.factory(() => this.getConsumptionController().requests)
|
|
166
163
|
.scope(typescript_ioc_1.Scope.Request);
|
|
@@ -330,11 +327,11 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
|
330
327
|
const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
|
|
331
328
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
332
329
|
exports.buildInformation = {
|
|
333
|
-
version: "1.2.
|
|
334
|
-
build: "
|
|
335
|
-
date: "2021-12-
|
|
336
|
-
commit: "
|
|
337
|
-
dependencies: {"@js-soft/docdb-querytranslator":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/ts-serval":"1.0.2","@js-soft/ts-utils":"^1.1.1","@nmshd/consumption":"1.0.
|
|
330
|
+
version: "1.2.5",
|
|
331
|
+
build: "20",
|
|
332
|
+
date: "2021-12-27T15:29:57+00:00",
|
|
333
|
+
commit: "84f19a6c72e68971bc33076e81721e241afb1cb6",
|
|
334
|
+
dependencies: {"@js-soft/docdb-querytranslator":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/ts-serval":"1.0.2","@js-soft/ts-utils":"^1.1.1","@nmshd/consumption":"1.0.10","@nmshd/content":"1.1.2","@nmshd/crypto":"1.0.6","@nmshd/transport":"1.1.2","ajv":"^8.8.2","ajv-errors":"^3.0.0","ajv-formats":"^2.1.1","fluent-ts-validator":"3.0.2","luxon":"^2.2.0","qrcode":"1.5.0","reflect-metadata":"0.1.13","ts-simple-nameof":"1.3.1","typescript-ioc":"3.2.2"},
|
|
338
335
|
libraries: {
|
|
339
336
|
serval: ts_serval_1.buildInformation,
|
|
340
337
|
consumption: consumption_1.buildInformation,
|
|
@@ -377,8 +374,8 @@ const useCases_1 = __webpack_require__(/*! ../useCases */ "./dist/useCases/index
|
|
|
377
374
|
const DataViewTranslateable_1 = __webpack_require__(/*! ./DataViewTranslateable */ "./dist/dataViews/DataViewTranslateable.js");
|
|
378
375
|
const MessageDVO_1 = __webpack_require__(/*! ./transport/MessageDVO */ "./dist/dataViews/transport/MessageDVO.js");
|
|
379
376
|
let DataViewExpander = class DataViewExpander {
|
|
380
|
-
constructor(
|
|
381
|
-
this.
|
|
377
|
+
constructor(transport, consumption, identityController) {
|
|
378
|
+
this.transport = transport;
|
|
382
379
|
this.consumption = consumption;
|
|
383
380
|
this.identityController = identityController;
|
|
384
381
|
}
|
|
@@ -405,9 +402,9 @@ let DataViewExpander = class DataViewExpander {
|
|
|
405
402
|
return await this.expandMessageDTO(content);
|
|
406
403
|
case "Request":
|
|
407
404
|
if (content instanceof Array) {
|
|
408
|
-
return await this.
|
|
405
|
+
return await this.expandUnknownRequests(content);
|
|
409
406
|
}
|
|
410
|
-
return this.
|
|
407
|
+
return await this.expandUnknownRequest(content);
|
|
411
408
|
case "AttributesShareRequest":
|
|
412
409
|
if (content instanceof Array) {
|
|
413
410
|
return await this.expandAttributesShareRequests(content);
|
|
@@ -452,7 +449,7 @@ let DataViewExpander = class DataViewExpander {
|
|
|
452
449
|
if (content instanceof Array) {
|
|
453
450
|
return await this.expandRelationshipDTOs(content);
|
|
454
451
|
}
|
|
455
|
-
return this.expandRelationshipDTO(content);
|
|
452
|
+
return await this.expandRelationshipDTO(content);
|
|
456
453
|
case "ConsumptionAttribute":
|
|
457
454
|
if (content instanceof Array) {
|
|
458
455
|
return await this.expandConsumptionAttributes(content);
|
|
@@ -465,71 +462,127 @@ let DataViewExpander = class DataViewExpander {
|
|
|
465
462
|
async expandMessageDTO(message) {
|
|
466
463
|
const recipientRelationships = await this.expandRecipients(message.recipients);
|
|
467
464
|
const createdByRelationship = await this.expandAddress(message.createdBy);
|
|
468
|
-
const
|
|
465
|
+
const fileIds = [];
|
|
466
|
+
const filePromises = [];
|
|
467
|
+
for (const attachment of message.attachments) {
|
|
468
|
+
if (typeof attachment === "string") {
|
|
469
|
+
filePromises.push(this.expandFileId(attachment));
|
|
470
|
+
fileIds.push(attachment);
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
filePromises.push(this.expandFileDTO(attachment));
|
|
474
|
+
fileIds.push(attachment.id);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
const files = await Promise.all(filePromises);
|
|
469
478
|
const isOwn = this.identityController.isMe(transport_1.CoreAddress.from(message.createdBy));
|
|
470
|
-
let
|
|
479
|
+
let status = MessageDVO_1.MessageStatus.Received;
|
|
471
480
|
if (isOwn) {
|
|
472
|
-
|
|
481
|
+
const receivedByEveryone = message.recipients.every((r) => !!r.receivedAt);
|
|
482
|
+
status = receivedByEveryone ? MessageDVO_1.MessageStatus.Delivered : MessageDVO_1.MessageStatus.Delivering;
|
|
473
483
|
}
|
|
474
|
-
const
|
|
475
|
-
|
|
484
|
+
const name = DataViewTranslateable_1.DataViewTranslateable.transport.messageName;
|
|
485
|
+
const value = {
|
|
476
486
|
id: message.id,
|
|
477
|
-
name:
|
|
487
|
+
name: name,
|
|
478
488
|
date: message.createdAt,
|
|
479
489
|
type: "MessageDVO",
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
status: status
|
|
490
|
-
},
|
|
490
|
+
createdByDevice: message.createdByDevice,
|
|
491
|
+
createdAt: message.createdAt,
|
|
492
|
+
createdBy: createdByRelationship,
|
|
493
|
+
recipients: recipientRelationships,
|
|
494
|
+
attachments: files,
|
|
495
|
+
isOwn,
|
|
496
|
+
recipientCount: message.recipients.length,
|
|
497
|
+
attachmentCount: message.attachments.length,
|
|
498
|
+
status,
|
|
491
499
|
image: ""
|
|
492
500
|
};
|
|
501
|
+
if (message.content["@type"] === "Mail" || message.content["@type"] === "RequestMail") {
|
|
502
|
+
value.name = DataViewTranslateable_1.DataViewTranslateable.consumption.mails.mailSubjectFallback;
|
|
503
|
+
value.type = "MailDVO";
|
|
504
|
+
const mailContent = message.content;
|
|
505
|
+
if (mailContent.subject) {
|
|
506
|
+
value.name = mailContent.subject;
|
|
507
|
+
}
|
|
508
|
+
value.to = await this.expandAddresses(mailContent.to);
|
|
509
|
+
value.toCount = mailContent.to.length;
|
|
510
|
+
value.ccCount = 0;
|
|
511
|
+
if (mailContent.cc) {
|
|
512
|
+
value.cc = await this.expandAddresses(mailContent.cc);
|
|
513
|
+
value.ccCount = mailContent.cc.length;
|
|
514
|
+
}
|
|
515
|
+
value.subject = mailContent.subject;
|
|
516
|
+
value.body = mailContent.body;
|
|
517
|
+
if (mailContent["@type"] === "RequestMail") {
|
|
518
|
+
const requestMailContent = message.content;
|
|
519
|
+
value.name = DataViewTranslateable_1.DataViewTranslateable.consumption.mails.requestMailSubjectFallback;
|
|
520
|
+
if (requestMailContent.subject) {
|
|
521
|
+
value.name = requestMailContent.subject;
|
|
522
|
+
}
|
|
523
|
+
value.type = "RequestMailDVO";
|
|
524
|
+
value.requests = await this.expandUnknownRequests(requestMailContent.requests);
|
|
525
|
+
value.requestCount = requestMailContent.requests.length;
|
|
526
|
+
return value;
|
|
527
|
+
}
|
|
528
|
+
return value;
|
|
529
|
+
}
|
|
530
|
+
return value;
|
|
493
531
|
}
|
|
494
532
|
async expandMessageDTOs(messages) {
|
|
495
533
|
const messagePromises = messages.map((message) => this.expandMessageDTO(message));
|
|
496
534
|
return await Promise.all(messagePromises);
|
|
497
535
|
}
|
|
536
|
+
async expandUnknownRequest(request) {
|
|
537
|
+
switch (request["@type"]) {
|
|
538
|
+
case "AttributesRequest":
|
|
539
|
+
return await this.expandAttributesRequest(request);
|
|
540
|
+
case "AttributesShareRequest":
|
|
541
|
+
return await this.expandAttributesShareRequest(request);
|
|
542
|
+
case "AttributesChangeRequest":
|
|
543
|
+
return await this.expandAttributesChangeRequest(request);
|
|
544
|
+
}
|
|
545
|
+
return {
|
|
546
|
+
id: request.id ? request.id : "",
|
|
547
|
+
name: `${request["@type"]} ${request.key}`,
|
|
548
|
+
description: "i18n://dvo.request.unknownType",
|
|
549
|
+
type: "RequestDVO",
|
|
550
|
+
date: request.expiresAt,
|
|
551
|
+
...request
|
|
552
|
+
};
|
|
553
|
+
}
|
|
498
554
|
expandRequest(request) {
|
|
499
555
|
return {
|
|
500
|
-
id: "
|
|
501
|
-
name: "
|
|
502
|
-
type:
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
}
|
|
556
|
+
id: request.id ? request.id : "",
|
|
557
|
+
name: `${request["@type"]} ${request.key}`,
|
|
558
|
+
type: "RequestDVO",
|
|
559
|
+
date: request.expiresAt,
|
|
560
|
+
...request
|
|
506
561
|
};
|
|
507
562
|
}
|
|
508
|
-
async
|
|
509
|
-
const requestsPromise = requests.map((request) => this.
|
|
563
|
+
async expandUnknownRequests(requests) {
|
|
564
|
+
const requestsPromise = requests.map((request) => this.expandUnknownRequest(request));
|
|
510
565
|
return await Promise.all(requestsPromise);
|
|
511
566
|
}
|
|
512
567
|
async expandAttributesShareRequest(attributesShareRequest) {
|
|
513
568
|
var _a, _b;
|
|
514
569
|
const request = this.expandRequest(attributesShareRequest);
|
|
515
570
|
const recipientObjects = [];
|
|
516
|
-
let
|
|
571
|
+
let possibleRecipientCount = 0;
|
|
517
572
|
for (const recipient of attributesShareRequest.recipients) {
|
|
518
573
|
if (this.identityController.isMe(transport_1.CoreAddress.from(recipient))) {
|
|
519
574
|
continue;
|
|
520
575
|
}
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
recipientObjects.push(this.expandRelationshipDTO(result.value));
|
|
526
|
-
relationshipCount++;
|
|
576
|
+
const identity = await this.expandIdentityForAddress(recipient);
|
|
577
|
+
if (identity.hasRelationship) {
|
|
578
|
+
recipientObjects.push(identity);
|
|
579
|
+
possibleRecipientCount++;
|
|
527
580
|
}
|
|
528
581
|
}
|
|
529
582
|
if (recipientObjects.length === 0) {
|
|
530
583
|
request.errorCount = ((_a = request.errorCount) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
531
584
|
const error = {
|
|
532
|
-
code: "error.
|
|
585
|
+
code: "error.dvo.request.AttributeShareRequest.noRelationship",
|
|
533
586
|
message: "There are no relationships to any of the recipients of this request."
|
|
534
587
|
};
|
|
535
588
|
if (!request.errors) {
|
|
@@ -537,11 +590,11 @@ let DataViewExpander = class DataViewExpander {
|
|
|
537
590
|
}
|
|
538
591
|
request.errors.push(error);
|
|
539
592
|
}
|
|
540
|
-
else if (recipientObjects.length !==
|
|
593
|
+
else if (recipientObjects.length !== possibleRecipientCount) {
|
|
541
594
|
request.warningCount = ((_b = request.warningCount) !== null && _b !== void 0 ? _b : 0) + 1;
|
|
542
595
|
const warning = {
|
|
543
|
-
code: "warning.
|
|
544
|
-
message: "Not to every
|
|
596
|
+
code: "warning.dvo.request.AttributeShareRequest.onlyRelationships",
|
|
597
|
+
message: "Not to every recipient of this request exist a relationship."
|
|
545
598
|
};
|
|
546
599
|
if (!request.warnings) {
|
|
547
600
|
request.warnings = [];
|
|
@@ -562,27 +615,24 @@ let DataViewExpander = class DataViewExpander {
|
|
|
562
615
|
}
|
|
563
616
|
return {
|
|
564
617
|
...request,
|
|
565
|
-
name
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
relationshipCount: relationshipCount
|
|
573
|
-
}
|
|
618
|
+
name,
|
|
619
|
+
type: "AttributesShareRequestDVO",
|
|
620
|
+
attributes: attributesObjects,
|
|
621
|
+
attributeCount: attributesObjects.length,
|
|
622
|
+
recipients: recipientObjects,
|
|
623
|
+
recipientCount: recipientObjects.length,
|
|
624
|
+
possibleRecipientCount
|
|
574
625
|
};
|
|
575
626
|
}
|
|
576
627
|
expandConsumptionAttribute(attribute) {
|
|
577
628
|
return {
|
|
629
|
+
type: "StoredAttributeDVO",
|
|
578
630
|
id: attribute.id,
|
|
579
|
-
name:
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
},
|
|
585
|
-
date: attribute.createdAt
|
|
631
|
+
name: attribute.content.name,
|
|
632
|
+
value: attribute.content.value,
|
|
633
|
+
date: attribute.createdAt,
|
|
634
|
+
isOwn: true,
|
|
635
|
+
sharedItems: []
|
|
586
636
|
};
|
|
587
637
|
}
|
|
588
638
|
async expandConsumptionAttributes(attributes) {
|
|
@@ -591,38 +641,33 @@ let DataViewExpander = class DataViewExpander {
|
|
|
591
641
|
}
|
|
592
642
|
async expandAttributeName(name) {
|
|
593
643
|
const consumptionAttribute = await this.consumption.attributes.getAttributeByName({ name: name });
|
|
644
|
+
let matchedAttributes = [];
|
|
594
645
|
if (consumptionAttribute.isSuccess) {
|
|
595
|
-
|
|
646
|
+
matchedAttributes = [this.expandConsumptionAttribute(consumptionAttribute.value)];
|
|
647
|
+
}
|
|
648
|
+
let bestMatch;
|
|
649
|
+
if (matchedAttributes.length > 0) {
|
|
650
|
+
bestMatch = matchedAttributes[0];
|
|
596
651
|
}
|
|
597
|
-
return
|
|
652
|
+
return {
|
|
653
|
+
type: "MatchedAttributesDVO",
|
|
654
|
+
id: name,
|
|
655
|
+
name: name,
|
|
656
|
+
matches: matchedAttributes,
|
|
657
|
+
bestMatch: bestMatch
|
|
658
|
+
};
|
|
598
659
|
}
|
|
599
660
|
async expandAttributeNames(names) {
|
|
600
661
|
const namesPromise = names.map((name) => this.expandAttributeName(name));
|
|
601
662
|
return await Promise.all(namesPromise);
|
|
602
663
|
}
|
|
603
|
-
getUnknownAttribute(name) {
|
|
604
|
-
return {
|
|
605
|
-
id: name,
|
|
606
|
-
type: "Attribute",
|
|
607
|
-
name: DataViewTranslateable_1.DataViewTranslateable.consumption.attributes.unknownAttributeName,
|
|
608
|
-
attribute: {
|
|
609
|
-
content: {
|
|
610
|
-
"@type": "Attribute",
|
|
611
|
-
name: name
|
|
612
|
-
},
|
|
613
|
-
isAvailable: false
|
|
614
|
-
}
|
|
615
|
-
};
|
|
616
|
-
}
|
|
617
664
|
expandAttribute(attribute) {
|
|
618
665
|
return {
|
|
666
|
+
type: "AttributeDVO",
|
|
619
667
|
id: attribute.name,
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
...attribute,
|
|
624
|
-
isAvailable: false
|
|
625
|
-
}
|
|
668
|
+
name: attribute.name,
|
|
669
|
+
value: attribute.value,
|
|
670
|
+
isOwn: false
|
|
626
671
|
};
|
|
627
672
|
}
|
|
628
673
|
async expandAttributes(attributes) {
|
|
@@ -633,14 +678,10 @@ let DataViewExpander = class DataViewExpander {
|
|
|
633
678
|
const request = this.expandRequest(attributesChangeRequest);
|
|
634
679
|
let applyToObject;
|
|
635
680
|
if (attributesChangeRequest.applyTo) {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
if (result.isSuccess) {
|
|
641
|
-
applyToObject = this.expandRelationshipDTO(result.value);
|
|
642
|
-
}
|
|
643
|
-
}
|
|
681
|
+
applyToObject = await this.expandIdentityForAddress(attributesChangeRequest.applyTo);
|
|
682
|
+
}
|
|
683
|
+
else {
|
|
684
|
+
applyToObject = this.expandSelf();
|
|
644
685
|
}
|
|
645
686
|
let name;
|
|
646
687
|
const attributesObjects = [];
|
|
@@ -648,6 +689,7 @@ let DataViewExpander = class DataViewExpander {
|
|
|
648
689
|
const attributeDVO = this.expandAttribute(attribute);
|
|
649
690
|
attributesObjects.push(attributeDVO);
|
|
650
691
|
}
|
|
692
|
+
const oldAttributesObjects = await this.expandAttributeNames(attributesObjects.map((item) => item.id));
|
|
651
693
|
if (attributesObjects.length > 1) {
|
|
652
694
|
name = DataViewTranslateable_1.DataViewTranslateable.consumption.requests.attributesChangeRequestNamePlural;
|
|
653
695
|
}
|
|
@@ -656,47 +698,59 @@ let DataViewExpander = class DataViewExpander {
|
|
|
656
698
|
}
|
|
657
699
|
return {
|
|
658
700
|
...request,
|
|
701
|
+
type: "AttributesChangeRequestDVO",
|
|
659
702
|
name: name,
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
applyTo: attributesChangeRequest.applyTo,
|
|
664
|
-
attributeObjects: attributesObjects,
|
|
665
|
-
applyToObject: applyToObject
|
|
666
|
-
}
|
|
703
|
+
newAttributes: attributesObjects,
|
|
704
|
+
oldAttributes: oldAttributesObjects,
|
|
705
|
+
applyTo: applyToObject
|
|
667
706
|
};
|
|
668
707
|
}
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
let
|
|
672
|
-
const
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
676
|
-
if (isPerson) {
|
|
677
|
-
identityProperties = {
|
|
678
|
-
initials: initials,
|
|
679
|
-
statusText: "",
|
|
680
|
-
isPerson: true,
|
|
681
|
-
familyName: "",
|
|
682
|
-
givenName: "",
|
|
683
|
-
salutation: ""
|
|
684
|
-
};
|
|
708
|
+
async expandAttributesRequest(attributesRequest) {
|
|
709
|
+
const request = this.expandRequest(attributesRequest);
|
|
710
|
+
let name;
|
|
711
|
+
const attributesObjects = await this.expandAttributeNames(attributesRequest.names);
|
|
712
|
+
if (attributesObjects.length > 1) {
|
|
713
|
+
name = DataViewTranslateable_1.DataViewTranslateable.consumption.requests.attributesChangeRequestNamePlural;
|
|
685
714
|
}
|
|
686
715
|
else {
|
|
687
|
-
|
|
688
|
-
initials: initials,
|
|
689
|
-
statusText: "",
|
|
690
|
-
isOrganization: true,
|
|
691
|
-
legalName: ""
|
|
692
|
-
};
|
|
716
|
+
name = DataViewTranslateable_1.DataViewTranslateable.consumption.requests.attributesChangeRequestName;
|
|
693
717
|
}
|
|
718
|
+
return {
|
|
719
|
+
...request,
|
|
720
|
+
type: "AttributesRequestDVO",
|
|
721
|
+
names: attributesRequest.names,
|
|
722
|
+
name: name,
|
|
723
|
+
attributes: attributesObjects,
|
|
724
|
+
required: attributesRequest.required
|
|
725
|
+
};
|
|
726
|
+
}
|
|
727
|
+
expandSelf() {
|
|
728
|
+
const name = "i18n://dvo.identity.self.name";
|
|
729
|
+
const initials = "i18n://dvo.identity.self.initials";
|
|
730
|
+
return {
|
|
731
|
+
id: this.identityController.address.toString(),
|
|
732
|
+
type: "IdentityDVO",
|
|
733
|
+
name: name,
|
|
734
|
+
initials: initials,
|
|
735
|
+
realm: transport_1.Realm.Prod,
|
|
736
|
+
description: "i18n://dvo.identity.self.description",
|
|
737
|
+
isSelf: true,
|
|
738
|
+
hasRelationship: false
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
expandUnknown(address) {
|
|
742
|
+
var _a;
|
|
743
|
+
const name = address.substring(3, 9);
|
|
744
|
+
const initials = ((_a = name.match(/\b\w/g)) !== null && _a !== void 0 ? _a : []).join("");
|
|
694
745
|
return {
|
|
695
746
|
id: this.identityController.address.toString(),
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
747
|
+
type: "IdentityDVO",
|
|
748
|
+
name: name,
|
|
749
|
+
initials: initials,
|
|
750
|
+
realm: transport_1.Realm.Prod,
|
|
751
|
+
description: "i18n://dvo.identity.unknown.description",
|
|
752
|
+
isSelf: false,
|
|
753
|
+
hasRelationship: false
|
|
700
754
|
};
|
|
701
755
|
}
|
|
702
756
|
async expandAttributesShareRequests(requests) {
|
|
@@ -711,11 +765,11 @@ let DataViewExpander = class DataViewExpander {
|
|
|
711
765
|
if (this.identityController.isMe(transport_1.CoreAddress.from(address))) {
|
|
712
766
|
return this.expandSelf();
|
|
713
767
|
}
|
|
714
|
-
const result = await this.
|
|
768
|
+
const result = await this.transport.relationships.getRelationshipByAddress({ address: address });
|
|
715
769
|
if (result.isError) {
|
|
716
|
-
|
|
770
|
+
return this.expandUnknown(address);
|
|
717
771
|
}
|
|
718
|
-
return this.expandRelationshipDTO(result.value);
|
|
772
|
+
return await this.expandRelationshipDTO(result.value);
|
|
719
773
|
}
|
|
720
774
|
async expandAddresses(addresses) {
|
|
721
775
|
const relationshipPromises = addresses.map((address) => this.expandAddress(address));
|
|
@@ -725,9 +779,12 @@ let DataViewExpander = class DataViewExpander {
|
|
|
725
779
|
const relationshipPromises = recipients.map((recipient) => this.expandAddress(recipient.address));
|
|
726
780
|
return await Promise.all(relationshipPromises);
|
|
727
781
|
}
|
|
728
|
-
|
|
729
|
-
var _a;
|
|
730
|
-
|
|
782
|
+
async createRelationshipDVO(relationship, relationshipInfo) {
|
|
783
|
+
var _a, _b, _c, _d;
|
|
784
|
+
if (!relationshipInfo) {
|
|
785
|
+
const relationshipInfoResult = await this.consumption.relationshipInfo.getRelationshipInfoByRelationship({ relationshipId: relationship.id });
|
|
786
|
+
relationshipInfo = relationshipInfoResult.value;
|
|
787
|
+
}
|
|
731
788
|
let statusText = "";
|
|
732
789
|
if (relationship.status === transport_1.RelationshipStatus.Pending && this.identityController.isMe(transport_1.CoreAddress.from(relationship.changes[0].request.createdBy))) {
|
|
733
790
|
statusText = DataViewTranslateable_1.DataViewTranslateable.transport.relationshipOutgoing;
|
|
@@ -744,34 +801,85 @@ let DataViewExpander = class DataViewExpander {
|
|
|
744
801
|
else if (relationship.status === transport_1.RelationshipStatus.Active) {
|
|
745
802
|
statusText = DataViewTranslateable_1.DataViewTranslateable.transport.relationshipActive;
|
|
746
803
|
}
|
|
747
|
-
const initials = ((_a = name.match(/\b\w/g)) !== null && _a !== void 0 ? _a : []).join("");
|
|
748
|
-
const identityProperties = {
|
|
749
|
-
initials: initials,
|
|
750
|
-
statusText: statusText,
|
|
751
|
-
isPerson: true,
|
|
752
|
-
familyName: "",
|
|
753
|
-
givenName: "",
|
|
754
|
-
salutation: ""
|
|
755
|
-
};
|
|
756
804
|
return {
|
|
757
805
|
id: relationship.id,
|
|
758
|
-
name:
|
|
759
|
-
description:
|
|
806
|
+
name: relationshipInfo.userTitle ? relationshipInfo.userTitle : relationshipInfo.title,
|
|
807
|
+
description: relationshipInfo.userDescription ? relationshipInfo.userDescription : relationshipInfo.title,
|
|
760
808
|
date: relationship.changes[0].request.createdAt,
|
|
761
809
|
image: "",
|
|
762
|
-
type: "
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
810
|
+
type: "RelationshipDVO",
|
|
811
|
+
status: statusText,
|
|
812
|
+
isPinned: relationshipInfo.isPinned,
|
|
813
|
+
theme: {
|
|
814
|
+
image: (_a = relationshipInfo.theme) === null || _a === void 0 ? void 0 : _a.image,
|
|
815
|
+
headerImage: (_b = relationshipInfo.theme) === null || _b === void 0 ? void 0 : _b.imageBar,
|
|
816
|
+
backgroundColor: (_c = relationshipInfo.theme) === null || _c === void 0 ? void 0 : _c.backgroundColor,
|
|
817
|
+
foregroundColor: (_d = relationshipInfo.theme) === null || _d === void 0 ? void 0 : _d.foregroundColor
|
|
766
818
|
}
|
|
767
819
|
};
|
|
768
820
|
}
|
|
821
|
+
async expandRelationshipDTO(relationship) {
|
|
822
|
+
var _a;
|
|
823
|
+
const relationshipInfoResult = await this.consumption.relationshipInfo.getRelationshipInfoByRelationship({ relationshipId: relationship.id });
|
|
824
|
+
const relationshipInfo = relationshipInfoResult.value;
|
|
825
|
+
const name = relationshipInfo.userTitle ? relationshipInfo.userTitle : relationshipInfo.title;
|
|
826
|
+
let description = relationshipInfo.userDescription ? relationshipInfo.userDescription : relationshipInfo.description;
|
|
827
|
+
const initials = ((_a = name.match(/\b\w/g)) !== null && _a !== void 0 ? _a : []).join("");
|
|
828
|
+
const relationshipDVO = await this.createRelationshipDVO(relationship, relationshipInfo);
|
|
829
|
+
if (!description) {
|
|
830
|
+
description = relationshipDVO.status;
|
|
831
|
+
}
|
|
832
|
+
return {
|
|
833
|
+
type: "IdentityDVO",
|
|
834
|
+
id: relationship.peer,
|
|
835
|
+
name: name,
|
|
836
|
+
date: relationshipDVO.date,
|
|
837
|
+
description: description,
|
|
838
|
+
publicKey: relationship.peerIdentity.publicKey,
|
|
839
|
+
realm: relationship.peerIdentity.realm,
|
|
840
|
+
initials,
|
|
841
|
+
isSelf: false,
|
|
842
|
+
hasRelationship: true,
|
|
843
|
+
relationship: relationshipDVO
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
async expandIdentityForAddress(address) {
|
|
847
|
+
var _a;
|
|
848
|
+
if (address === this.identityController.address.toString()) {
|
|
849
|
+
return this.expandSelf();
|
|
850
|
+
}
|
|
851
|
+
const relationshipResult = await this.transport.relationships.getRelationshipByAddress({
|
|
852
|
+
address: address
|
|
853
|
+
});
|
|
854
|
+
if (relationshipResult.isSuccess) {
|
|
855
|
+
return await this.expandRelationshipDTO(relationshipResult.value);
|
|
856
|
+
}
|
|
857
|
+
if (relationshipResult.error.code !== useCases_1.RuntimeErrors.general.recordNotFound(transport_1.Relationship).code) {
|
|
858
|
+
throw relationshipResult.error;
|
|
859
|
+
}
|
|
860
|
+
const name = address.substring(3, 9);
|
|
861
|
+
const initials = ((_a = name.match(/\b\w/g)) !== null && _a !== void 0 ? _a : []).join("");
|
|
862
|
+
return {
|
|
863
|
+
id: address,
|
|
864
|
+
type: "IdentityDVO",
|
|
865
|
+
name: name,
|
|
866
|
+
initials: initials,
|
|
867
|
+
publicKey: "i18n://dvo.identity.publicKey.unknown",
|
|
868
|
+
realm: this.identityController.realm.toString(),
|
|
869
|
+
description: "i18n://dvo.identity.unknown",
|
|
870
|
+
isSelf: false,
|
|
871
|
+
hasRelationship: false
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
async expandIdentity(identity) {
|
|
875
|
+
return await this.expandIdentityForAddress(identity.address);
|
|
876
|
+
}
|
|
769
877
|
async expandRelationshipDTOs(relationships) {
|
|
770
878
|
const relationshipPromises = relationships.map((relationship) => this.expandRelationshipDTO(relationship));
|
|
771
879
|
return await Promise.all(relationshipPromises);
|
|
772
880
|
}
|
|
773
881
|
async expandFileId(id) {
|
|
774
|
-
const result = await this.
|
|
882
|
+
const result = await this.transport.files.getFile({ id: id });
|
|
775
883
|
if (result.isError) {
|
|
776
884
|
throw result.error;
|
|
777
885
|
}
|
|
@@ -783,15 +891,16 @@ let DataViewExpander = class DataViewExpander {
|
|
|
783
891
|
}
|
|
784
892
|
async expandFileDTO(file) {
|
|
785
893
|
return {
|
|
894
|
+
...file,
|
|
895
|
+
type: "FileDVO",
|
|
786
896
|
id: file.id,
|
|
787
897
|
name: file.title ? file.title : file.filename,
|
|
788
|
-
type: "FileDVO",
|
|
789
898
|
date: file.createdAt,
|
|
790
899
|
image: "",
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
900
|
+
filename: file.filename,
|
|
901
|
+
filesize: file.filesize,
|
|
902
|
+
createdBy: await this.expandAddress(file.createdBy),
|
|
903
|
+
deletedBy: file.deletedBy ? await this.expandAddress(file.deletedBy) : undefined
|
|
795
904
|
};
|
|
796
905
|
}
|
|
797
906
|
async expandFileDTOs(files) {
|
|
@@ -838,7 +947,7 @@ exports.DataViewTranslateable = void 0;
|
|
|
838
947
|
class DataViewTranslateable {
|
|
839
948
|
}
|
|
840
949
|
exports.DataViewTranslateable = DataViewTranslateable;
|
|
841
|
-
DataViewTranslateable.prefix = "i18n://";
|
|
950
|
+
DataViewTranslateable.prefix = "i18n://dvo.";
|
|
842
951
|
DataViewTranslateable.transport = {
|
|
843
952
|
messageName: `${DataViewTranslateable.prefix}message.name`,
|
|
844
953
|
relationshipOutgoing: `${DataViewTranslateable.prefix}relationship.name`,
|
|
@@ -849,6 +958,10 @@ DataViewTranslateable.transport = {
|
|
|
849
958
|
fileName: `${DataViewTranslateable.prefix}file.name`
|
|
850
959
|
};
|
|
851
960
|
DataViewTranslateable.consumption = {
|
|
961
|
+
mails: {
|
|
962
|
+
mailSubjectFallback: `${DataViewTranslateable.prefix}mails.mailSubjectFallback`,
|
|
963
|
+
requestMailSubjectFallback: `${DataViewTranslateable.prefix}mails.requestMailSubjectFallback`
|
|
964
|
+
},
|
|
852
965
|
attributes: {
|
|
853
966
|
unknownAttributeName: `${DataViewTranslateable.prefix}attributes.UnknownAttributeName`
|
|
854
967
|
},
|
|
@@ -925,75 +1038,86 @@ __exportStar(__webpack_require__(/*! ./Warning */ "./dist/dataViews/common/Warni
|
|
|
925
1038
|
|
|
926
1039
|
/***/ }),
|
|
927
1040
|
|
|
928
|
-
/***/ "./dist/dataViews/consumption/
|
|
929
|
-
|
|
930
|
-
!*** ./dist/dataViews/consumption/
|
|
931
|
-
|
|
1041
|
+
/***/ "./dist/dataViews/consumption/MatchedAttributesDVO.js":
|
|
1042
|
+
/*!************************************************************!*\
|
|
1043
|
+
!*** ./dist/dataViews/consumption/MatchedAttributesDVO.js ***!
|
|
1044
|
+
\************************************************************/
|
|
932
1045
|
/***/ ((__unused_webpack_module, exports) => {
|
|
933
1046
|
|
|
934
1047
|
"use strict";
|
|
935
1048
|
|
|
936
1049
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
937
|
-
//# sourceMappingURL=
|
|
1050
|
+
//# sourceMappingURL=MatchedAttributesDVO.js.map
|
|
938
1051
|
|
|
939
1052
|
/***/ }),
|
|
940
1053
|
|
|
941
|
-
/***/ "./dist/dataViews/consumption/
|
|
942
|
-
|
|
943
|
-
!*** ./dist/dataViews/consumption/
|
|
944
|
-
|
|
945
|
-
/***/ ((__unused_webpack_module, exports)
|
|
1054
|
+
/***/ "./dist/dataViews/consumption/index.js":
|
|
1055
|
+
/*!*********************************************!*\
|
|
1056
|
+
!*** ./dist/dataViews/consumption/index.js ***!
|
|
1057
|
+
\*********************************************/
|
|
1058
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
946
1059
|
|
|
947
1060
|
"use strict";
|
|
948
1061
|
|
|
1062
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1063
|
+
if (k2 === undefined) k2 = k;
|
|
1064
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
1065
|
+
}) : (function(o, m, k, k2) {
|
|
1066
|
+
if (k2 === undefined) k2 = k;
|
|
1067
|
+
o[k2] = m[k];
|
|
1068
|
+
}));
|
|
1069
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
1070
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1071
|
+
};
|
|
949
1072
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
950
|
-
|
|
1073
|
+
__exportStar(__webpack_require__(/*! ./MatchedAttributesDVO */ "./dist/dataViews/consumption/MatchedAttributesDVO.js"), exports);
|
|
1074
|
+
//# sourceMappingURL=index.js.map
|
|
951
1075
|
|
|
952
1076
|
/***/ }),
|
|
953
1077
|
|
|
954
|
-
/***/ "./dist/dataViews/
|
|
955
|
-
|
|
956
|
-
!*** ./dist/dataViews/
|
|
957
|
-
|
|
1078
|
+
/***/ "./dist/dataViews/content/AttributeDVO.js":
|
|
1079
|
+
/*!************************************************!*\
|
|
1080
|
+
!*** ./dist/dataViews/content/AttributeDVO.js ***!
|
|
1081
|
+
\************************************************/
|
|
958
1082
|
/***/ ((__unused_webpack_module, exports) => {
|
|
959
1083
|
|
|
960
1084
|
"use strict";
|
|
961
1085
|
|
|
962
1086
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
963
|
-
//# sourceMappingURL=
|
|
1087
|
+
//# sourceMappingURL=AttributeDVO.js.map
|
|
964
1088
|
|
|
965
1089
|
/***/ }),
|
|
966
1090
|
|
|
967
|
-
/***/ "./dist/dataViews/
|
|
968
|
-
|
|
969
|
-
!*** ./dist/dataViews/
|
|
970
|
-
|
|
1091
|
+
/***/ "./dist/dataViews/content/MailDVOs.js":
|
|
1092
|
+
/*!********************************************!*\
|
|
1093
|
+
!*** ./dist/dataViews/content/MailDVOs.js ***!
|
|
1094
|
+
\********************************************/
|
|
971
1095
|
/***/ ((__unused_webpack_module, exports) => {
|
|
972
1096
|
|
|
973
1097
|
"use strict";
|
|
974
1098
|
|
|
975
1099
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
976
|
-
//# sourceMappingURL=
|
|
1100
|
+
//# sourceMappingURL=MailDVOs.js.map
|
|
977
1101
|
|
|
978
1102
|
/***/ }),
|
|
979
1103
|
|
|
980
|
-
/***/ "./dist/dataViews/
|
|
981
|
-
|
|
982
|
-
!*** ./dist/dataViews/
|
|
983
|
-
|
|
1104
|
+
/***/ "./dist/dataViews/content/RequestDVOs.js":
|
|
1105
|
+
/*!***********************************************!*\
|
|
1106
|
+
!*** ./dist/dataViews/content/RequestDVOs.js ***!
|
|
1107
|
+
\***********************************************/
|
|
984
1108
|
/***/ ((__unused_webpack_module, exports) => {
|
|
985
1109
|
|
|
986
1110
|
"use strict";
|
|
987
1111
|
|
|
988
1112
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
989
|
-
//# sourceMappingURL=
|
|
1113
|
+
//# sourceMappingURL=RequestDVOs.js.map
|
|
990
1114
|
|
|
991
1115
|
/***/ }),
|
|
992
1116
|
|
|
993
|
-
/***/ "./dist/dataViews/
|
|
994
|
-
|
|
995
|
-
!*** ./dist/dataViews/
|
|
996
|
-
|
|
1117
|
+
/***/ "./dist/dataViews/content/index.js":
|
|
1118
|
+
/*!*****************************************!*\
|
|
1119
|
+
!*** ./dist/dataViews/content/index.js ***!
|
|
1120
|
+
\*****************************************/
|
|
997
1121
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
998
1122
|
|
|
999
1123
|
"use strict";
|
|
@@ -1009,11 +1133,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
1009
1133
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1010
1134
|
};
|
|
1011
1135
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1012
|
-
__exportStar(__webpack_require__(/*! ./AttributeDVO */ "./dist/dataViews/
|
|
1013
|
-
__exportStar(__webpack_require__(/*! ./
|
|
1014
|
-
__exportStar(__webpack_require__(/*! ./
|
|
1015
|
-
__exportStar(__webpack_require__(/*! ./MailDVO */ "./dist/dataViews/consumption/MailDVO.js"), exports);
|
|
1016
|
-
__exportStar(__webpack_require__(/*! ./RequestDVO */ "./dist/dataViews/consumption/RequestDVO.js"), exports);
|
|
1136
|
+
__exportStar(__webpack_require__(/*! ./AttributeDVO */ "./dist/dataViews/content/AttributeDVO.js"), exports);
|
|
1137
|
+
__exportStar(__webpack_require__(/*! ./MailDVOs */ "./dist/dataViews/content/MailDVOs.js"), exports);
|
|
1138
|
+
__exportStar(__webpack_require__(/*! ./RequestDVOs */ "./dist/dataViews/content/RequestDVOs.js"), exports);
|
|
1017
1139
|
//# sourceMappingURL=index.js.map
|
|
1018
1140
|
|
|
1019
1141
|
/***/ }),
|
|
@@ -1039,6 +1161,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
1039
1161
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1040
1162
|
__exportStar(__webpack_require__(/*! ./common */ "./dist/dataViews/common/index.js"), exports);
|
|
1041
1163
|
__exportStar(__webpack_require__(/*! ./consumption */ "./dist/dataViews/consumption/index.js"), exports);
|
|
1164
|
+
__exportStar(__webpack_require__(/*! ./content */ "./dist/dataViews/content/index.js"), exports);
|
|
1042
1165
|
__exportStar(__webpack_require__(/*! ./DataViewExpander */ "./dist/dataViews/DataViewExpander.js"), exports);
|
|
1043
1166
|
__exportStar(__webpack_require__(/*! ./DataViewObject */ "./dist/dataViews/DataViewObject.js"), exports);
|
|
1044
1167
|
__exportStar(__webpack_require__(/*! ./DataViewTranslateable */ "./dist/dataViews/DataViewTranslateable.js"), exports);
|
|
@@ -1085,7 +1208,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1085
1208
|
exports.MessageStatus = void 0;
|
|
1086
1209
|
var MessageStatus;
|
|
1087
1210
|
(function (MessageStatus) {
|
|
1088
|
-
MessageStatus["
|
|
1211
|
+
MessageStatus["Received"] = "received";
|
|
1089
1212
|
MessageStatus["Delivering"] = "delivering";
|
|
1090
1213
|
MessageStatus["Delivered"] = "delivered";
|
|
1091
1214
|
MessageStatus["Errorneous"] = "errorneous";
|
|
@@ -1778,7 +1901,7 @@ exports.AttributesFacade = void 0;
|
|
|
1778
1901
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
1779
1902
|
const useCases_1 = __webpack_require__(/*! ../../../useCases */ "./dist/useCases/index.js");
|
|
1780
1903
|
let AttributesFacade = class AttributesFacade {
|
|
1781
|
-
constructor(createAttributeUseCase, deleteAttributeUseCase, deleteAttributeByNameUseCase, getAllValidUseCase, getAttributeUseCase, getAttributeByNameUseCase, getAttributesUseCase,
|
|
1904
|
+
constructor(createAttributeUseCase, deleteAttributeUseCase, deleteAttributeByNameUseCase, getAllValidUseCase, getAttributeUseCase, getAttributeByNameUseCase, getAttributesUseCase, getAttributesByNamesUseCase, getHistoryByNameUseCase, succeedAttributeUseCase, updateAttributeUseCase) {
|
|
1782
1905
|
this.createAttributeUseCase = createAttributeUseCase;
|
|
1783
1906
|
this.deleteAttributeUseCase = deleteAttributeUseCase;
|
|
1784
1907
|
this.deleteAttributeByNameUseCase = deleteAttributeByNameUseCase;
|
|
@@ -1786,7 +1909,7 @@ let AttributesFacade = class AttributesFacade {
|
|
|
1786
1909
|
this.getAttributeUseCase = getAttributeUseCase;
|
|
1787
1910
|
this.getAttributeByNameUseCase = getAttributeByNameUseCase;
|
|
1788
1911
|
this.getAttributesUseCase = getAttributesUseCase;
|
|
1789
|
-
this.
|
|
1912
|
+
this.getAttributesByNamesUseCase = getAttributesByNamesUseCase;
|
|
1790
1913
|
this.getHistoryByNameUseCase = getHistoryByNameUseCase;
|
|
1791
1914
|
this.succeedAttributeUseCase = succeedAttributeUseCase;
|
|
1792
1915
|
this.updateAttributeUseCase = updateAttributeUseCase;
|
|
@@ -1812,8 +1935,8 @@ let AttributesFacade = class AttributesFacade {
|
|
|
1812
1935
|
async getAttributes(request) {
|
|
1813
1936
|
return await this.getAttributesUseCase.execute(request);
|
|
1814
1937
|
}
|
|
1815
|
-
async
|
|
1816
|
-
return await this.
|
|
1938
|
+
async getAttributesByNames(request) {
|
|
1939
|
+
return await this.getAttributesByNamesUseCase.execute(request);
|
|
1817
1940
|
}
|
|
1818
1941
|
async getHistoryByName(request) {
|
|
1819
1942
|
return await this.getHistoryByNameUseCase.execute(request);
|
|
@@ -1844,7 +1967,7 @@ AttributesFacade = __decorate([
|
|
|
1844
1967
|
useCases_1.GetAttributeUseCase,
|
|
1845
1968
|
useCases_1.GetAttributeByNameUseCase,
|
|
1846
1969
|
useCases_1.GetAttributesUseCase,
|
|
1847
|
-
useCases_1.
|
|
1970
|
+
useCases_1.GetAttributesByNamesUseCase,
|
|
1848
1971
|
useCases_1.GetHistoryByNameUseCase,
|
|
1849
1972
|
useCases_1.SucceedAttributeUseCase,
|
|
1850
1973
|
useCases_1.UpdateAttributeUseCase])
|
|
@@ -3794,21 +3917,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3794
3917
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3795
3918
|
exports.JsonSchema = exports.SchemaRepository = void 0;
|
|
3796
3919
|
const ajv_1 = __importDefault(__webpack_require__(/*! ajv */ "./node_modules/ajv/dist/ajv.js"));
|
|
3920
|
+
const ajv_errors_1 = __importDefault(__webpack_require__(/*! ajv-errors */ "./node_modules/ajv-errors/dist/index.js"));
|
|
3797
3921
|
const ajv_formats_1 = __importDefault(__webpack_require__(/*! ajv-formats */ "./node_modules/ajv-formats/dist/index.js"));
|
|
3798
3922
|
const customFormats = {
|
|
3799
|
-
fileId: "FIL[A-
|
|
3800
|
-
relationshipId: "REL[A-
|
|
3801
|
-
messageId: "MSG[A-
|
|
3802
|
-
relationshipTemplateId: "RLT[A-
|
|
3803
|
-
tokenId: "TOK[A-
|
|
3804
|
-
relationshipChangeId: "RCH[A-
|
|
3805
|
-
deviceId: "DVC[A-
|
|
3923
|
+
fileId: "FIL[A-z0-9]{17}",
|
|
3924
|
+
relationshipId: "REL[A-z0-9]{17}",
|
|
3925
|
+
messageId: "MSG[A-z0-9]{17}",
|
|
3926
|
+
relationshipTemplateId: "RLT[A-z0-9]{17}",
|
|
3927
|
+
tokenId: "TOK[A-z0-9]{17}",
|
|
3928
|
+
relationshipChangeId: "RCH[A-z0-9]{17}",
|
|
3929
|
+
deviceId: "DVC[A-z0-9]{17}"
|
|
3806
3930
|
};
|
|
3807
3931
|
class SchemaRepository {
|
|
3808
3932
|
constructor() {
|
|
3809
3933
|
this.jsonSchemas = new Map();
|
|
3810
|
-
this.compiler = new ajv_1.default();
|
|
3934
|
+
this.compiler = new ajv_1.default({ allErrors: true });
|
|
3811
3935
|
(0, ajv_formats_1.default)(this.compiler);
|
|
3936
|
+
(0, ajv_errors_1.default)(this.compiler);
|
|
3812
3937
|
this.addCustomFormats();
|
|
3813
3938
|
}
|
|
3814
3939
|
addCustomFormats() {
|
|
@@ -3841,7 +3966,7 @@ class JsonSchema {
|
|
|
3841
3966
|
this.validateSchema = validateSchema;
|
|
3842
3967
|
}
|
|
3843
3968
|
validate(obj) {
|
|
3844
|
-
return { isValid: this.validateSchema(obj), errors: this.validateSchema.errors };
|
|
3969
|
+
return { isValid: this.validateSchema(obj), errors: this.validateSchema.errors ? [...this.validateSchema.errors] : undefined };
|
|
3845
3970
|
}
|
|
3846
3971
|
}
|
|
3847
3972
|
exports.JsonSchema = JsonSchema;
|
|
@@ -3849,40 +3974,6 @@ exports.JsonSchema = JsonSchema;
|
|
|
3849
3974
|
|
|
3850
3975
|
/***/ }),
|
|
3851
3976
|
|
|
3852
|
-
/***/ "./dist/useCases/common/SchemaValidator.js":
|
|
3853
|
-
/*!*************************************************!*\
|
|
3854
|
-
!*** ./dist/useCases/common/SchemaValidator.js ***!
|
|
3855
|
-
\*************************************************/
|
|
3856
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3857
|
-
|
|
3858
|
-
"use strict";
|
|
3859
|
-
|
|
3860
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3861
|
-
exports.SchemaValidator = void 0;
|
|
3862
|
-
const fluent_ts_validator_1 = __webpack_require__(/*! fluent-ts-validator */ "./node_modules/fluent-ts-validator/index.js");
|
|
3863
|
-
class SchemaValidator {
|
|
3864
|
-
constructor(schema) {
|
|
3865
|
-
this.schema = schema;
|
|
3866
|
-
}
|
|
3867
|
-
validate(input) {
|
|
3868
|
-
const validationResult = this.schema.validate(input);
|
|
3869
|
-
const result = new fluent_ts_validator_1.ValidationResult();
|
|
3870
|
-
if (validationResult.isValid) {
|
|
3871
|
-
return result;
|
|
3872
|
-
}
|
|
3873
|
-
result.addFailures(validationResult.errors.map(this.schemaErrorToValidationFailure));
|
|
3874
|
-
return result;
|
|
3875
|
-
}
|
|
3876
|
-
schemaErrorToValidationFailure(err, target) {
|
|
3877
|
-
const errorMessage = `${err.instancePath} ${err.message}`.replace(/^\//, "").replace(/"/g, "");
|
|
3878
|
-
return new fluent_ts_validator_1.ValidationFailure(target, err.instancePath, undefined, undefined, errorMessage);
|
|
3879
|
-
}
|
|
3880
|
-
}
|
|
3881
|
-
exports.SchemaValidator = SchemaValidator;
|
|
3882
|
-
//# sourceMappingURL=SchemaValidator.js.map
|
|
3883
|
-
|
|
3884
|
-
/***/ }),
|
|
3885
|
-
|
|
3886
3977
|
/***/ "./dist/useCases/common/Schemas.js":
|
|
3887
3978
|
/*!*****************************************!*\
|
|
3888
3979
|
!*** ./dist/useCases/common/Schemas.js ***!
|
|
@@ -3892,8 +3983,8 @@ exports.SchemaValidator = SchemaValidator;
|
|
|
3892
3983
|
"use strict";
|
|
3893
3984
|
|
|
3894
3985
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3895
|
-
exports.
|
|
3896
|
-
exports.LoadPeerTokenRequest = exports.GetTokensRequest = exports.GetTokenRequest = exports.GetQRCodeForTokenRequest = exports.CreateOwnTokenRequest = exports.LoadPeerRelationshipTemplateRequest = exports.GetRelationshipTemplatesRequest = exports.GetRelationshipTemplateRequest = 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.
|
|
3986
|
+
exports.GetFilesRequest = exports.GetFileRequest = exports.CreateTokenQrCodeForFileRequest = exports.CreateTokenForFileRequest = exports.UpdateDeviceRequest = exports.GetDeviceOnboardingInfoRequest = exports.GetDeviceRequest = exports.DeleteDeviceRequest = exports.CreateDeviceOnboardingTokenRequest = exports.CreateDeviceRequest = exports.DownloadAttachmentRequest = exports.DownloadFileRequest = exports.RegisterPushNotificationTokenRequest = exports.UpdateSharedItemRequest = exports.GetSharedItemsSharedWithAddressRequest = exports.GetSharedItemsSharedByAddressRequest = exports.GetSharedItemsByReferenceRequest = exports.GetSharedItemsByAddressRequest = exports.GetSharedItemsRequest = exports.GetSharedItemRequest = exports.DeleteSharedItemRequest = exports.CreateSharedItemRequest = exports.UpdateSettingRequest = exports.GetSettingsRequest = exports.GetSettingRequest = exports.DeleteSettingRequest = exports.CreateSettingRequest = exports.UpdateRelationshipInfoRequest = exports.GetRelationshipInfoByRelationshipRequest = exports.GetRelationshipInfoRequest = exports.DeleteRelationshipInfoByRelationshipRequest = exports.DeleteRelationshipInfoRequest = exports.CreateRelationshipInfoRequest = exports.UpdateDraftRequest = exports.GetDraftsRequest = exports.GetDraftRequest = exports.DeleteDraftRequest = exports.CreateDraftRequest = exports.UpdateAttributeRequest = exports.SucceedAttributeRequest = exports.GetHistoryByNameRequest = exports.GetAttributesRequest = exports.GetAttributeByNameRequest = exports.GetAttributeRequest = exports.DeleteAttributeByNameRequest = exports.DeleteAttributeRequest = exports.CreateAttributeRequest = exports.GetAttributesByNamesRequest = exports.LoadPeerTokenAnonymousByTruncatedReferenceRequest = exports.LoadPeerTokenAnonymousByIdAndKeyRequest = void 0;
|
|
3987
|
+
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 = void 0;
|
|
3897
3988
|
exports.LoadPeerTokenAnonymousByIdAndKeyRequest = {
|
|
3898
3989
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3899
3990
|
"$ref": "#/definitions/LoadPeerTokenAnonymousByIdAndKeyRequest",
|
|
@@ -3934,6 +4025,16 @@ exports.LoadPeerTokenAnonymousByTruncatedReferenceRequest = {
|
|
|
3934
4025
|
}
|
|
3935
4026
|
}
|
|
3936
4027
|
};
|
|
4028
|
+
exports.GetAttributesByNamesRequest = {
|
|
4029
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4030
|
+
"$ref": "#/definitions/GetAttributesByNamesRequest",
|
|
4031
|
+
"definitions": {
|
|
4032
|
+
"GetAttributesByNamesRequest": {
|
|
4033
|
+
"type": "object",
|
|
4034
|
+
"additionalProperties": false
|
|
4035
|
+
}
|
|
4036
|
+
}
|
|
4037
|
+
};
|
|
3937
4038
|
exports.CreateAttributeRequest = {
|
|
3938
4039
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3939
4040
|
"$ref": "#/definitions/CreateAttributeRequest",
|
|
@@ -4066,16 +4167,6 @@ exports.GetAttributesRequest = {
|
|
|
4066
4167
|
}
|
|
4067
4168
|
}
|
|
4068
4169
|
};
|
|
4069
|
-
exports.GetAttributesByNameRequest = {
|
|
4070
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4071
|
-
"$ref": "#/definitions/GetAttributesByNameRequest",
|
|
4072
|
-
"definitions": {
|
|
4073
|
-
"GetAttributesByNameRequest": {
|
|
4074
|
-
"type": "object",
|
|
4075
|
-
"additionalProperties": false
|
|
4076
|
-
}
|
|
4077
|
-
}
|
|
4078
|
-
};
|
|
4079
4170
|
exports.GetHistoryByNameRequest = {
|
|
4080
4171
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4081
4172
|
"$ref": "#/definitions/GetHistoryByNameRequest",
|
|
@@ -4905,6 +4996,47 @@ exports.RegisterPushNotificationTokenRequest = {
|
|
|
4905
4996
|
}
|
|
4906
4997
|
}
|
|
4907
4998
|
};
|
|
4999
|
+
exports.DownloadFileRequest = {
|
|
5000
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5001
|
+
"$ref": "#/definitions/DownloadFileRequest",
|
|
5002
|
+
"definitions": {
|
|
5003
|
+
"DownloadFileRequest": {
|
|
5004
|
+
"type": "object",
|
|
5005
|
+
"properties": {
|
|
5006
|
+
"id": {
|
|
5007
|
+
"type": "string",
|
|
5008
|
+
"format": "fileId"
|
|
5009
|
+
}
|
|
5010
|
+
},
|
|
5011
|
+
"required": [
|
|
5012
|
+
"id"
|
|
5013
|
+
],
|
|
5014
|
+
"additionalProperties": false
|
|
5015
|
+
}
|
|
5016
|
+
}
|
|
5017
|
+
};
|
|
5018
|
+
exports.DownloadAttachmentRequest = {
|
|
5019
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5020
|
+
"$ref": "#/definitions/DownloadAttachmentRequest",
|
|
5021
|
+
"definitions": {
|
|
5022
|
+
"DownloadAttachmentRequest": {
|
|
5023
|
+
"type": "object",
|
|
5024
|
+
"properties": {
|
|
5025
|
+
"id": {
|
|
5026
|
+
"type": "string"
|
|
5027
|
+
},
|
|
5028
|
+
"attachmentId": {
|
|
5029
|
+
"type": "string"
|
|
5030
|
+
}
|
|
5031
|
+
},
|
|
5032
|
+
"required": [
|
|
5033
|
+
"id",
|
|
5034
|
+
"attachmentId"
|
|
5035
|
+
],
|
|
5036
|
+
"additionalProperties": false
|
|
5037
|
+
}
|
|
5038
|
+
}
|
|
5039
|
+
};
|
|
4908
5040
|
exports.CreateDeviceRequest = {
|
|
4909
5041
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4910
5042
|
"$ref": "#/definitions/CreateDeviceRequest",
|
|
@@ -5074,25 +5206,6 @@ exports.CreateTokenQrCodeForFileRequest = {
|
|
|
5074
5206
|
}
|
|
5075
5207
|
}
|
|
5076
5208
|
};
|
|
5077
|
-
exports.DownloadFileRequest = {
|
|
5078
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5079
|
-
"$ref": "#/definitions/DownloadFileRequest",
|
|
5080
|
-
"definitions": {
|
|
5081
|
-
"DownloadFileRequest": {
|
|
5082
|
-
"type": "object",
|
|
5083
|
-
"properties": {
|
|
5084
|
-
"id": {
|
|
5085
|
-
"type": "string",
|
|
5086
|
-
"format": "fileId"
|
|
5087
|
-
}
|
|
5088
|
-
},
|
|
5089
|
-
"required": [
|
|
5090
|
-
"id"
|
|
5091
|
-
],
|
|
5092
|
-
"additionalProperties": false
|
|
5093
|
-
}
|
|
5094
|
-
}
|
|
5095
|
-
};
|
|
5096
5209
|
exports.GetFileRequest = {
|
|
5097
5210
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5098
5211
|
"$ref": "#/definitions/GetFileRequest",
|
|
@@ -5135,11 +5248,65 @@ exports.GetFilesRequest = {
|
|
|
5135
5248
|
}
|
|
5136
5249
|
}
|
|
5137
5250
|
};
|
|
5251
|
+
exports.LoadPeerFileViaSecretRequest = {
|
|
5252
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5253
|
+
"$ref": "#/definitions/LoadPeerFileViaSecretRequest",
|
|
5254
|
+
"definitions": {
|
|
5255
|
+
"LoadPeerFileViaSecretRequest": {
|
|
5256
|
+
"type": "object",
|
|
5257
|
+
"properties": {
|
|
5258
|
+
"id": {
|
|
5259
|
+
"type": "string",
|
|
5260
|
+
"format": "fileId"
|
|
5261
|
+
},
|
|
5262
|
+
"secretKey": {
|
|
5263
|
+
"type": "string",
|
|
5264
|
+
"minLength": 100
|
|
5265
|
+
}
|
|
5266
|
+
},
|
|
5267
|
+
"required": [
|
|
5268
|
+
"id",
|
|
5269
|
+
"secretKey"
|
|
5270
|
+
],
|
|
5271
|
+
"additionalProperties": false
|
|
5272
|
+
}
|
|
5273
|
+
}
|
|
5274
|
+
};
|
|
5275
|
+
exports.LoadPeerFileViaReferenceRequest = {
|
|
5276
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5277
|
+
"$ref": "#/definitions/LoadPeerFileViaReferenceRequest",
|
|
5278
|
+
"definitions": {
|
|
5279
|
+
"LoadPeerFileViaReferenceRequest": {
|
|
5280
|
+
"type": "object",
|
|
5281
|
+
"properties": {
|
|
5282
|
+
"reference": {
|
|
5283
|
+
"type": "string",
|
|
5284
|
+
"pattern": "VE9L.{84}"
|
|
5285
|
+
}
|
|
5286
|
+
},
|
|
5287
|
+
"required": [
|
|
5288
|
+
"reference"
|
|
5289
|
+
],
|
|
5290
|
+
"additionalProperties": false,
|
|
5291
|
+
"errorMessage": "token reference invalid"
|
|
5292
|
+
}
|
|
5293
|
+
}
|
|
5294
|
+
};
|
|
5138
5295
|
exports.LoadPeerFileRequest = {
|
|
5139
5296
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5140
5297
|
"$ref": "#/definitions/LoadPeerFileRequest",
|
|
5141
5298
|
"definitions": {
|
|
5142
5299
|
"LoadPeerFileRequest": {
|
|
5300
|
+
"anyOf": [
|
|
5301
|
+
{
|
|
5302
|
+
"$ref": "#/definitions/LoadPeerFileViaSecretRequest"
|
|
5303
|
+
},
|
|
5304
|
+
{
|
|
5305
|
+
"$ref": "#/definitions/LoadPeerFileViaReferenceRequest"
|
|
5306
|
+
}
|
|
5307
|
+
]
|
|
5308
|
+
},
|
|
5309
|
+
"LoadPeerFileViaSecretRequest": {
|
|
5143
5310
|
"type": "object",
|
|
5144
5311
|
"properties": {
|
|
5145
5312
|
"id": {
|
|
@@ -5147,13 +5314,29 @@ exports.LoadPeerFileRequest = {
|
|
|
5147
5314
|
"format": "fileId"
|
|
5148
5315
|
},
|
|
5149
5316
|
"secretKey": {
|
|
5150
|
-
"type": "string"
|
|
5151
|
-
|
|
5152
|
-
"reference": {
|
|
5153
|
-
"type": "string"
|
|
5317
|
+
"type": "string",
|
|
5318
|
+
"minLength": 100
|
|
5154
5319
|
}
|
|
5155
5320
|
},
|
|
5321
|
+
"required": [
|
|
5322
|
+
"id",
|
|
5323
|
+
"secretKey"
|
|
5324
|
+
],
|
|
5156
5325
|
"additionalProperties": false
|
|
5326
|
+
},
|
|
5327
|
+
"LoadPeerFileViaReferenceRequest": {
|
|
5328
|
+
"type": "object",
|
|
5329
|
+
"properties": {
|
|
5330
|
+
"reference": {
|
|
5331
|
+
"type": "string",
|
|
5332
|
+
"pattern": "VE9L.{84}"
|
|
5333
|
+
}
|
|
5334
|
+
},
|
|
5335
|
+
"required": [
|
|
5336
|
+
"reference"
|
|
5337
|
+
],
|
|
5338
|
+
"additionalProperties": false,
|
|
5339
|
+
"errorMessage": "token reference invalid"
|
|
5157
5340
|
}
|
|
5158
5341
|
}
|
|
5159
5342
|
};
|
|
@@ -5248,28 +5431,6 @@ exports.CheckIdentityRequest = {
|
|
|
5248
5431
|
}
|
|
5249
5432
|
}
|
|
5250
5433
|
};
|
|
5251
|
-
exports.DownloadAttachmentRequest = {
|
|
5252
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5253
|
-
"$ref": "#/definitions/DownloadAttachmentRequest",
|
|
5254
|
-
"definitions": {
|
|
5255
|
-
"DownloadAttachmentRequest": {
|
|
5256
|
-
"type": "object",
|
|
5257
|
-
"properties": {
|
|
5258
|
-
"id": {
|
|
5259
|
-
"type": "string"
|
|
5260
|
-
},
|
|
5261
|
-
"attachmentId": {
|
|
5262
|
-
"type": "string"
|
|
5263
|
-
}
|
|
5264
|
-
},
|
|
5265
|
-
"required": [
|
|
5266
|
-
"id",
|
|
5267
|
-
"attachmentId"
|
|
5268
|
-
],
|
|
5269
|
-
"additionalProperties": false
|
|
5270
|
-
}
|
|
5271
|
-
}
|
|
5272
|
-
};
|
|
5273
5434
|
exports.GetAttachmentMetadataRequest = {
|
|
5274
5435
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5275
5436
|
"$ref": "#/definitions/GetAttachmentMetadataRequest",
|
|
@@ -5535,6 +5696,51 @@ exports.CreateOwnRelationshipTemplateRequest = {
|
|
|
5535
5696
|
}
|
|
5536
5697
|
}
|
|
5537
5698
|
};
|
|
5699
|
+
exports.CreateTokenForOwnTemplateRequest = {
|
|
5700
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5701
|
+
"$ref": "#/definitions/CreateTokenForOwnTemplateRequest",
|
|
5702
|
+
"definitions": {
|
|
5703
|
+
"CreateTokenForOwnTemplateRequest": {
|
|
5704
|
+
"type": "object",
|
|
5705
|
+
"properties": {
|
|
5706
|
+
"templateId": {
|
|
5707
|
+
"type": "string"
|
|
5708
|
+
},
|
|
5709
|
+
"expiresAt": {
|
|
5710
|
+
"type": "string"
|
|
5711
|
+
},
|
|
5712
|
+
"ephemeral": {
|
|
5713
|
+
"type": "boolean"
|
|
5714
|
+
}
|
|
5715
|
+
},
|
|
5716
|
+
"required": [
|
|
5717
|
+
"templateId"
|
|
5718
|
+
],
|
|
5719
|
+
"additionalProperties": false
|
|
5720
|
+
}
|
|
5721
|
+
}
|
|
5722
|
+
};
|
|
5723
|
+
exports.CreateTokenQrCodeForOwnTemplateRequest = {
|
|
5724
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5725
|
+
"$ref": "#/definitions/CreateTokenQrCodeForOwnTemplateRequest",
|
|
5726
|
+
"definitions": {
|
|
5727
|
+
"CreateTokenQrCodeForOwnTemplateRequest": {
|
|
5728
|
+
"type": "object",
|
|
5729
|
+
"properties": {
|
|
5730
|
+
"templateId": {
|
|
5731
|
+
"type": "string"
|
|
5732
|
+
},
|
|
5733
|
+
"expiresAt": {
|
|
5734
|
+
"type": "string"
|
|
5735
|
+
}
|
|
5736
|
+
},
|
|
5737
|
+
"required": [
|
|
5738
|
+
"templateId"
|
|
5739
|
+
],
|
|
5740
|
+
"additionalProperties": false
|
|
5741
|
+
}
|
|
5742
|
+
}
|
|
5743
|
+
};
|
|
5538
5744
|
exports.GetRelationshipTemplateRequest = {
|
|
5539
5745
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5540
5746
|
"$ref": "#/definitions/GetRelationshipTemplateRequest",
|
|
@@ -5819,11 +6025,13 @@ __exportStar(__webpack_require__(/*! ./OwnerRestriction */ "./dist/useCases/comm
|
|
|
5819
6025
|
__exportStar(__webpack_require__(/*! ./QRCode */ "./dist/useCases/common/QRCode.js"), exports);
|
|
5820
6026
|
__exportStar(__webpack_require__(/*! ./RuntimeErrors */ "./dist/useCases/common/RuntimeErrors.js"), exports);
|
|
5821
6027
|
__exportStar(__webpack_require__(/*! ./RuntimeValidator */ "./dist/useCases/common/RuntimeValidator.js"), exports);
|
|
6028
|
+
__exportStar(__webpack_require__(/*! ./SchemaRepository */ "./dist/useCases/common/SchemaRepository.js"), exports);
|
|
5822
6029
|
__exportStar(__webpack_require__(/*! ./UseCase */ "./dist/useCases/common/UseCase.js"), exports);
|
|
5823
6030
|
__exportStar(__webpack_require__(/*! ./validation/AddressValidator */ "./dist/useCases/common/validation/AddressValidator.js"), exports);
|
|
5824
6031
|
__exportStar(__webpack_require__(/*! ./validation/DateValidator */ "./dist/useCases/common/validation/DateValidator.js"), exports);
|
|
5825
6032
|
__exportStar(__webpack_require__(/*! ./validation/IdValidator */ "./dist/useCases/common/validation/IdValidator.js"), exports);
|
|
5826
6033
|
__exportStar(__webpack_require__(/*! ./validation/RelationshipAttributeDTOValidator */ "./dist/useCases/common/validation/RelationshipAttributeDTOValidator.js"), exports);
|
|
6034
|
+
__exportStar(__webpack_require__(/*! ./validation/SchemaValidator */ "./dist/useCases/common/validation/SchemaValidator.js"), exports);
|
|
5827
6035
|
//# sourceMappingURL=index.js.map
|
|
5828
6036
|
|
|
5829
6037
|
/***/ }),
|
|
@@ -5960,6 +6168,43 @@ exports.RelationshipAttributeDTOValidator = RelationshipAttributeDTOValidator;
|
|
|
5960
6168
|
|
|
5961
6169
|
/***/ }),
|
|
5962
6170
|
|
|
6171
|
+
/***/ "./dist/useCases/common/validation/SchemaValidator.js":
|
|
6172
|
+
/*!************************************************************!*\
|
|
6173
|
+
!*** ./dist/useCases/common/validation/SchemaValidator.js ***!
|
|
6174
|
+
\************************************************************/
|
|
6175
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6176
|
+
|
|
6177
|
+
"use strict";
|
|
6178
|
+
|
|
6179
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6180
|
+
exports.SchemaValidator = void 0;
|
|
6181
|
+
const fluent_ts_validator_1 = __webpack_require__(/*! fluent-ts-validator */ "./node_modules/fluent-ts-validator/index.js");
|
|
6182
|
+
class SchemaValidator {
|
|
6183
|
+
constructor(schema) {
|
|
6184
|
+
this.schema = schema;
|
|
6185
|
+
}
|
|
6186
|
+
validate(input) {
|
|
6187
|
+
const validationResult = this.schema.validate(input);
|
|
6188
|
+
return this.convertValidationResult(validationResult);
|
|
6189
|
+
}
|
|
6190
|
+
convertValidationResult(validationResult) {
|
|
6191
|
+
const result = new fluent_ts_validator_1.ValidationResult();
|
|
6192
|
+
if (validationResult.isValid) {
|
|
6193
|
+
return result;
|
|
6194
|
+
}
|
|
6195
|
+
result.addFailures(validationResult.errors.map(this.schemaErrorToValidationFailure));
|
|
6196
|
+
return result;
|
|
6197
|
+
}
|
|
6198
|
+
schemaErrorToValidationFailure(err) {
|
|
6199
|
+
const errorMessage = `${err.instancePath} ${err.message}`.replace(/^\//, "").replace(/"/g, "").trim();
|
|
6200
|
+
return new fluent_ts_validator_1.ValidationFailure(undefined, err.instancePath, undefined, undefined, errorMessage);
|
|
6201
|
+
}
|
|
6202
|
+
}
|
|
6203
|
+
exports.SchemaValidator = SchemaValidator;
|
|
6204
|
+
//# sourceMappingURL=SchemaValidator.js.map
|
|
6205
|
+
|
|
6206
|
+
/***/ }),
|
|
6207
|
+
|
|
5963
6208
|
/***/ "./dist/useCases/consumption/attributes/AttributeMapper.js":
|
|
5964
6209
|
/*!*****************************************************************!*\
|
|
5965
6210
|
!*** ./dist/useCases/consumption/attributes/AttributeMapper.js ***!
|
|
@@ -5981,10 +6226,10 @@ class AttributeMapper {
|
|
|
5981
6226
|
static toAttributeDTOList(attributes) {
|
|
5982
6227
|
return attributes.map((attribute) => this.toAttributeDTO(attribute));
|
|
5983
6228
|
}
|
|
5984
|
-
static
|
|
6229
|
+
static toGetAttributesByNamesResponse(attributesByNames) {
|
|
5985
6230
|
const response = {};
|
|
5986
|
-
for (const name in
|
|
5987
|
-
response[name] = AttributeMapper.toAttributeDTO(
|
|
6231
|
+
for (const name in attributesByNames) {
|
|
6232
|
+
response[name] = AttributeMapper.toAttributeDTO(attributesByNames[name]);
|
|
5988
6233
|
}
|
|
5989
6234
|
return response;
|
|
5990
6235
|
}
|
|
@@ -6393,10 +6638,10 @@ exports.GetAttributesUseCase = GetAttributesUseCase;
|
|
|
6393
6638
|
|
|
6394
6639
|
/***/ }),
|
|
6395
6640
|
|
|
6396
|
-
/***/ "./dist/useCases/consumption/attributes/
|
|
6397
|
-
|
|
6398
|
-
!*** ./dist/useCases/consumption/attributes/
|
|
6399
|
-
|
|
6641
|
+
/***/ "./dist/useCases/consumption/attributes/GetAttributesByNames.js":
|
|
6642
|
+
/*!**********************************************************************!*\
|
|
6643
|
+
!*** ./dist/useCases/consumption/attributes/GetAttributesByNames.js ***!
|
|
6644
|
+
\**********************************************************************/
|
|
6400
6645
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
6401
6646
|
|
|
6402
6647
|
"use strict";
|
|
@@ -6414,34 +6659,34 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
6414
6659
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
6415
6660
|
};
|
|
6416
6661
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6417
|
-
exports.
|
|
6662
|
+
exports.GetAttributesByNamesUseCase = void 0;
|
|
6418
6663
|
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
6419
6664
|
const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
|
|
6420
6665
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
6421
6666
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
6422
6667
|
const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
|
|
6423
|
-
class
|
|
6668
|
+
class GetAttributesByNamesRequestValidator extends common_1.RuntimeValidator {
|
|
6424
6669
|
constructor() {
|
|
6425
6670
|
super();
|
|
6426
6671
|
}
|
|
6427
6672
|
}
|
|
6428
|
-
let
|
|
6673
|
+
let GetAttributesByNamesUseCase = class GetAttributesByNamesUseCase extends common_1.UseCase {
|
|
6429
6674
|
constructor(attributeController, validator) {
|
|
6430
6675
|
super(validator);
|
|
6431
6676
|
this.attributeController = attributeController;
|
|
6432
6677
|
}
|
|
6433
6678
|
async executeInternal(_request) {
|
|
6434
6679
|
const attributes = await this.attributeController.getAttributesByName();
|
|
6435
|
-
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.
|
|
6680
|
+
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toGetAttributesByNamesResponse(attributes));
|
|
6436
6681
|
}
|
|
6437
6682
|
};
|
|
6438
|
-
|
|
6683
|
+
GetAttributesByNamesUseCase = __decorate([
|
|
6439
6684
|
__param(0, typescript_ioc_1.Inject),
|
|
6440
6685
|
__param(1, typescript_ioc_1.Inject),
|
|
6441
|
-
__metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController,
|
|
6442
|
-
],
|
|
6443
|
-
exports.
|
|
6444
|
-
//# sourceMappingURL=
|
|
6686
|
+
__metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController, GetAttributesByNamesRequestValidator])
|
|
6687
|
+
], GetAttributesByNamesUseCase);
|
|
6688
|
+
exports.GetAttributesByNamesUseCase = GetAttributesByNamesUseCase;
|
|
6689
|
+
//# sourceMappingURL=GetAttributesByNames.js.map
|
|
6445
6690
|
|
|
6446
6691
|
/***/ }),
|
|
6447
6692
|
|
|
@@ -6658,7 +6903,7 @@ __exportStar(__webpack_require__(/*! ./GetAllValid */ "./dist/useCases/consumpti
|
|
|
6658
6903
|
__exportStar(__webpack_require__(/*! ./GetAttribute */ "./dist/useCases/consumption/attributes/GetAttribute.js"), exports);
|
|
6659
6904
|
__exportStar(__webpack_require__(/*! ./GetAttributeByName */ "./dist/useCases/consumption/attributes/GetAttributeByName.js"), exports);
|
|
6660
6905
|
__exportStar(__webpack_require__(/*! ./GetAttributes */ "./dist/useCases/consumption/attributes/GetAttributes.js"), exports);
|
|
6661
|
-
__exportStar(__webpack_require__(/*! ./
|
|
6906
|
+
__exportStar(__webpack_require__(/*! ./GetAttributesByNames */ "./dist/useCases/consumption/attributes/GetAttributesByNames.js"), exports);
|
|
6662
6907
|
__exportStar(__webpack_require__(/*! ./GetHistoryByName */ "./dist/useCases/consumption/attributes/GetHistoryByName.js"), exports);
|
|
6663
6908
|
__exportStar(__webpack_require__(/*! ./SucceedAttribute */ "./dist/useCases/consumption/attributes/SucceedAttribute.js"), exports);
|
|
6664
6909
|
__exportStar(__webpack_require__(/*! ./UpdateAttribute */ "./dist/useCases/consumption/attributes/UpdateAttribute.js"), exports);
|
|
@@ -9324,12 +9569,8 @@ class DeviceMapper {
|
|
|
9324
9569
|
identityPrivateKey: deviceSharedSecret.identityPrivateKey ? deviceSharedSecret.identityPrivateKey.toString() : undefined,
|
|
9325
9570
|
identity: {
|
|
9326
9571
|
address: deviceSharedSecret.identity.address.toString(),
|
|
9327
|
-
createdAt: deviceSharedSecret.identity.createdAt.toString(),
|
|
9328
|
-
description: deviceSharedSecret.identity.description,
|
|
9329
|
-
name: deviceSharedSecret.identity.name,
|
|
9330
9572
|
publicKey: deviceSharedSecret.identity.publicKey.toString(),
|
|
9331
|
-
realm: deviceSharedSecret.identity.realm.toString()
|
|
9332
|
-
type: deviceSharedSecret.identity.type.toString()
|
|
9573
|
+
realm: deviceSharedSecret.identity.realm.toString()
|
|
9333
9574
|
},
|
|
9334
9575
|
password: deviceSharedSecret.password,
|
|
9335
9576
|
username: deviceSharedSecret.username
|
|
@@ -9348,12 +9589,8 @@ class DeviceMapper {
|
|
|
9348
9589
|
identityPrivateKey: deviceOnboardingDTO.identityPrivateKey ? await crypto_1.CryptoSignaturePrivateKey.deserialize(deviceOnboardingDTO.identityPrivateKey) : undefined,
|
|
9349
9590
|
identity: {
|
|
9350
9591
|
address: transport_1.CoreAddress.from(deviceOnboardingDTO.identity.address),
|
|
9351
|
-
createdAt: transport_1.CoreDate.from(deviceOnboardingDTO.identity.createdAt),
|
|
9352
|
-
name: deviceOnboardingDTO.identity.name,
|
|
9353
|
-
description: deviceOnboardingDTO.identity.description,
|
|
9354
9592
|
publicKey: await crypto_1.CryptoSignaturePublicKey.deserialize(deviceOnboardingDTO.identity.publicKey),
|
|
9355
|
-
realm: deviceOnboardingDTO.identity.realm
|
|
9356
|
-
type: deviceOnboardingDTO.identity.type
|
|
9593
|
+
realm: deviceOnboardingDTO.identity.realm
|
|
9357
9594
|
},
|
|
9358
9595
|
password: deviceOnboardingDTO.password,
|
|
9359
9596
|
username: deviceOnboardingDTO.username
|
|
@@ -9639,17 +9876,15 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
|
|
|
9639
9876
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
9640
9877
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
9641
9878
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
9642
|
-
const SchemaRepository_1 = __webpack_require__(/*! ../../common/SchemaRepository */ "./dist/useCases/common/SchemaRepository.js");
|
|
9643
|
-
const SchemaValidator_1 = __webpack_require__(/*! ../../common/SchemaValidator */ "./dist/useCases/common/SchemaValidator.js");
|
|
9644
9879
|
const TokenMapper_1 = __webpack_require__(/*! ../tokens/TokenMapper */ "./dist/useCases/transport/tokens/TokenMapper.js");
|
|
9645
|
-
let Validator = class Validator extends
|
|
9880
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
9646
9881
|
constructor(schemaRepository) {
|
|
9647
9882
|
super(schemaRepository.getSchema("CreateTokenForFileRequest"));
|
|
9648
9883
|
}
|
|
9649
9884
|
};
|
|
9650
9885
|
Validator = __decorate([
|
|
9651
9886
|
__param(0, typescript_ioc_1.Inject),
|
|
9652
|
-
__metadata("design:paramtypes", [
|
|
9887
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
9653
9888
|
], Validator);
|
|
9654
9889
|
let CreateTokenForFileUseCase = class CreateTokenForFileUseCase extends common_1.UseCase {
|
|
9655
9890
|
constructor(fileController, tokenController, accountController, validator) {
|
|
@@ -9723,16 +9958,14 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
|
|
|
9723
9958
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
9724
9959
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
9725
9960
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
9726
|
-
|
|
9727
|
-
const SchemaValidator_1 = __webpack_require__(/*! ../../common/SchemaValidator */ "./dist/useCases/common/SchemaValidator.js");
|
|
9728
|
-
let Validator = class Validator extends SchemaValidator_1.SchemaValidator {
|
|
9961
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
9729
9962
|
constructor(schemaRepository) {
|
|
9730
9963
|
super(schemaRepository.getSchema("CreateTokenQrCodeForFileRequest"));
|
|
9731
9964
|
}
|
|
9732
9965
|
};
|
|
9733
9966
|
Validator = __decorate([
|
|
9734
9967
|
__param(0, typescript_ioc_1.Inject),
|
|
9735
|
-
__metadata("design:paramtypes", [
|
|
9968
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
9736
9969
|
], Validator);
|
|
9737
9970
|
let CreateTokenQrCodeForFileUseCase = class CreateTokenQrCodeForFileUseCase extends common_1.UseCase {
|
|
9738
9971
|
constructor(fileController, tokenController, validator) {
|
|
@@ -9798,17 +10031,15 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
|
|
|
9798
10031
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
9799
10032
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
9800
10033
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
9801
|
-
const SchemaRepository_1 = __webpack_require__(/*! ../../common/SchemaRepository */ "./dist/useCases/common/SchemaRepository.js");
|
|
9802
|
-
const SchemaValidator_1 = __webpack_require__(/*! ../../common/SchemaValidator */ "./dist/useCases/common/SchemaValidator.js");
|
|
9803
10034
|
const FileMapper_1 = __webpack_require__(/*! ./FileMapper */ "./dist/useCases/transport/files/FileMapper.js");
|
|
9804
|
-
let Validator = class Validator extends
|
|
10035
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
9805
10036
|
constructor(schemaRepository) {
|
|
9806
10037
|
super(schemaRepository.getSchema("DownloadFileRequest"));
|
|
9807
10038
|
}
|
|
9808
10039
|
};
|
|
9809
10040
|
Validator = __decorate([
|
|
9810
10041
|
__param(0, typescript_ioc_1.Inject),
|
|
9811
|
-
__metadata("design:paramtypes", [
|
|
10042
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
9812
10043
|
], Validator);
|
|
9813
10044
|
let DownloadFileUseCase = class DownloadFileUseCase extends common_1.UseCase {
|
|
9814
10045
|
constructor(fileController, validator) {
|
|
@@ -9917,17 +10148,15 @@ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/
|
|
|
9917
10148
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
9918
10149
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
9919
10150
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
9920
|
-
const SchemaRepository_1 = __webpack_require__(/*! ../../common/SchemaRepository */ "./dist/useCases/common/SchemaRepository.js");
|
|
9921
|
-
const SchemaValidator_1 = __webpack_require__(/*! ../../common/SchemaValidator */ "./dist/useCases/common/SchemaValidator.js");
|
|
9922
10151
|
const FileMapper_1 = __webpack_require__(/*! ./FileMapper */ "./dist/useCases/transport/files/FileMapper.js");
|
|
9923
|
-
let Validator = class Validator extends
|
|
10152
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
9924
10153
|
constructor(schemaRepository) {
|
|
9925
10154
|
super(schemaRepository.getSchema("GetFileRequest"));
|
|
9926
10155
|
}
|
|
9927
10156
|
};
|
|
9928
10157
|
Validator = __decorate([
|
|
9929
10158
|
__param(0, typescript_ioc_1.Inject),
|
|
9930
|
-
__metadata("design:paramtypes", [
|
|
10159
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
9931
10160
|
], Validator);
|
|
9932
10161
|
let GetFileUseCase = class GetFileUseCase extends common_1.UseCase {
|
|
9933
10162
|
constructor(fileController, validator) {
|
|
@@ -10062,45 +10291,44 @@ exports.LoadPeerFileUseCase = void 0;
|
|
|
10062
10291
|
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
10063
10292
|
const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
|
|
10064
10293
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
10294
|
+
const fluent_ts_validator_1 = __webpack_require__(/*! fluent-ts-validator */ "./node_modules/fluent-ts-validator/index.js");
|
|
10065
10295
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
10066
10296
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
10067
10297
|
const FileMapper_1 = __webpack_require__(/*! ./FileMapper */ "./dist/useCases/transport/files/FileMapper.js");
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
this.validateIfString((x) => x.id)
|
|
10080
|
-
.fulfills(common_1.IdValidator.required(transport_1.BackboneIds.file))
|
|
10081
|
-
.when(this.isCreatePeerFileFromIdAndKeyRequest);
|
|
10082
|
-
this.validateIfString((x) => x.secretKey)
|
|
10083
|
-
.isNotNull()
|
|
10084
|
-
.when(this.isCreatePeerFileFromIdAndKeyRequest);
|
|
10085
|
-
}
|
|
10086
|
-
setupRulesForCreateFileFromTokenReferenceRequest() {
|
|
10087
|
-
this.validateIfString((x) => x.reference)
|
|
10088
|
-
.isNotNull()
|
|
10089
|
-
.fulfills(this.isTokenReference)
|
|
10090
|
-
.when(this.isCreatePeerFileFromTokenReferenceRequest);
|
|
10091
|
-
}
|
|
10092
|
-
isTokenReference(tokenReference) {
|
|
10093
|
-
// "TOK" as Base64
|
|
10094
|
-
const tokInBase64 = "VE9L";
|
|
10095
|
-
return tokenReference.startsWith(tokInBase64);
|
|
10096
|
-
}
|
|
10097
|
-
isCreatePeerFileFromIdAndKeyRequest(x) {
|
|
10098
|
-
return !!x.id && !!x.secretKey;
|
|
10298
|
+
function isLoadPeerFileViaSecret(request) {
|
|
10299
|
+
return "id" in request && "secretKey" in request;
|
|
10300
|
+
}
|
|
10301
|
+
function isLoadPeerFileViaReference(request) {
|
|
10302
|
+
return "reference" in request;
|
|
10303
|
+
}
|
|
10304
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
10305
|
+
constructor(schemaRepository) {
|
|
10306
|
+
super(schemaRepository.getSchema("LoadPeerFileRequest"));
|
|
10307
|
+
this.loadViaSecretSchema = schemaRepository.getSchema("LoadPeerFileViaSecretRequest");
|
|
10308
|
+
this.loadViaReferenceSchema = schemaRepository.getSchema("LoadPeerFileViaReferenceRequest");
|
|
10099
10309
|
}
|
|
10100
|
-
|
|
10101
|
-
|
|
10310
|
+
validate(input) {
|
|
10311
|
+
if (this.schema.validate(input).isValid)
|
|
10312
|
+
return new fluent_ts_validator_1.ValidationResult();
|
|
10313
|
+
// any-of in combination with missing properties is a bit weird
|
|
10314
|
+
// when { reference: null | undefined } is passed, it ignores reference
|
|
10315
|
+
// and treats it like a LoadPeerFileViaSecret.
|
|
10316
|
+
// That's why we validate with the specific schema afterwards
|
|
10317
|
+
if (isLoadPeerFileViaReference(input)) {
|
|
10318
|
+
return this.convertValidationResult(this.loadViaReferenceSchema.validate(input));
|
|
10319
|
+
}
|
|
10320
|
+
else if (isLoadPeerFileViaSecret(input)) {
|
|
10321
|
+
return this.convertValidationResult(this.loadViaSecretSchema.validate(input));
|
|
10322
|
+
}
|
|
10323
|
+
const result = new fluent_ts_validator_1.ValidationResult();
|
|
10324
|
+
result.addFailures([new fluent_ts_validator_1.ValidationFailure(undefined, "", undefined, common_1.RuntimeErrors.general.invalidPayload().code, common_1.RuntimeErrors.general.invalidPayload().message)]);
|
|
10325
|
+
return result;
|
|
10102
10326
|
}
|
|
10103
|
-
}
|
|
10327
|
+
};
|
|
10328
|
+
Validator = __decorate([
|
|
10329
|
+
__param(0, typescript_ioc_1.Inject),
|
|
10330
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
10331
|
+
], Validator);
|
|
10104
10332
|
let LoadPeerFileUseCase = class LoadPeerFileUseCase extends common_1.UseCase {
|
|
10105
10333
|
constructor(fileController, tokenController, accountController, validator) {
|
|
10106
10334
|
super(validator);
|
|
@@ -10110,11 +10338,11 @@ let LoadPeerFileUseCase = class LoadPeerFileUseCase extends common_1.UseCase {
|
|
|
10110
10338
|
}
|
|
10111
10339
|
async executeInternal(request) {
|
|
10112
10340
|
let createdFile;
|
|
10113
|
-
if (request
|
|
10341
|
+
if (isLoadPeerFileViaSecret(request)) {
|
|
10114
10342
|
const key = await crypto_1.CryptoSecretKey.fromBase64(request.secretKey);
|
|
10115
10343
|
createdFile = await this.loadFile(transport_1.CoreId.from(request.id), key);
|
|
10116
10344
|
}
|
|
10117
|
-
else if (request
|
|
10345
|
+
else if (isLoadPeerFileViaReference(request)) {
|
|
10118
10346
|
createdFile = await this.createFileFromTokenReferenceRequest(request.reference);
|
|
10119
10347
|
}
|
|
10120
10348
|
else {
|
|
@@ -10147,7 +10375,7 @@ LoadPeerFileUseCase = __decorate([
|
|
|
10147
10375
|
__metadata("design:paramtypes", [transport_1.FileController,
|
|
10148
10376
|
transport_1.TokenController,
|
|
10149
10377
|
transport_1.AccountController,
|
|
10150
|
-
|
|
10378
|
+
Validator])
|
|
10151
10379
|
], LoadPeerFileUseCase);
|
|
10152
10380
|
exports.LoadPeerFileUseCase = LoadPeerFileUseCase;
|
|
10153
10381
|
//# sourceMappingURL=LoadPeerFile.js.map
|
|
@@ -10775,7 +11003,7 @@ class MessageMapper {
|
|
|
10775
11003
|
}
|
|
10776
11004
|
return {
|
|
10777
11005
|
id: message.id.toString(),
|
|
10778
|
-
content: message.cache.content,
|
|
11006
|
+
content: message.cache.content.toJSON(),
|
|
10779
11007
|
createdBy: message.cache.createdBy.toString(),
|
|
10780
11008
|
createdByDevice: message.cache.createdByDevice.toString(),
|
|
10781
11009
|
recipients: message.cache.recipients.map((r) => this.toRecipient(r)),
|
|
@@ -10803,8 +11031,11 @@ class MessageMapper {
|
|
|
10803
11031
|
return messages.map((message) => this.toMessageDTO(message));
|
|
10804
11032
|
}
|
|
10805
11033
|
static toRecipient(recipient) {
|
|
11034
|
+
var _a, _b;
|
|
10806
11035
|
return {
|
|
10807
|
-
address: recipient.address.toString()
|
|
11036
|
+
address: recipient.address.toString(),
|
|
11037
|
+
receivedAt: (_a = recipient.receivedAt) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
11038
|
+
receivedByDevice: (_b = recipient.receivedByDevice) === null || _b === void 0 ? void 0 : _b.toString()
|
|
10808
11039
|
};
|
|
10809
11040
|
}
|
|
10810
11041
|
}
|
|
@@ -11967,6 +12198,11 @@ class RelationshipMapper {
|
|
|
11967
12198
|
template: RelationshipTemplateMapper_1.RelationshipTemplateMapper.toRelationshipTemplateDTO(relationship.cache.template),
|
|
11968
12199
|
status: relationship.status,
|
|
11969
12200
|
peer: relationship.peer.address.toString(),
|
|
12201
|
+
peerIdentity: {
|
|
12202
|
+
address: relationship.peer.address.toString(),
|
|
12203
|
+
publicKey: relationship.peer.publicKey.toString(),
|
|
12204
|
+
realm: relationship.peer.realm
|
|
12205
|
+
},
|
|
11970
12206
|
changes: relationship.cache.changes.map((c) => this.toRelationshipChangeDTO(c)),
|
|
11971
12207
|
lastMessageSentAt: (_a = relationship.cache.lastMessageSentAt) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
11972
12208
|
lastMessageReceivedAt: (_b = relationship.cache.lastMessageReceivedAt) === null || _b === void 0 ? void 0 : _b.toString()
|
|
@@ -13252,6 +13488,291 @@ exports.sleep = sleep;
|
|
|
13252
13488
|
|
|
13253
13489
|
/***/ }),
|
|
13254
13490
|
|
|
13491
|
+
/***/ "./node_modules/ajv-errors/dist/index.js":
|
|
13492
|
+
/*!***********************************************!*\
|
|
13493
|
+
!*** ./node_modules/ajv-errors/dist/index.js ***!
|
|
13494
|
+
\***********************************************/
|
|
13495
|
+
/***/ ((module, exports, __webpack_require__) => {
|
|
13496
|
+
|
|
13497
|
+
"use strict";
|
|
13498
|
+
|
|
13499
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
13500
|
+
const ajv_1 = __webpack_require__(/*! ajv */ "./node_modules/ajv/dist/ajv.js");
|
|
13501
|
+
const codegen_1 = __webpack_require__(/*! ajv/dist/compile/codegen */ "./node_modules/ajv/dist/compile/codegen/index.js");
|
|
13502
|
+
const code_1 = __webpack_require__(/*! ajv/dist/compile/codegen/code */ "./node_modules/ajv/dist/compile/codegen/code.js");
|
|
13503
|
+
const validate_1 = __webpack_require__(/*! ajv/dist/compile/validate */ "./node_modules/ajv/dist/compile/validate/index.js");
|
|
13504
|
+
const errors_1 = __webpack_require__(/*! ajv/dist/compile/errors */ "./node_modules/ajv/dist/compile/errors.js");
|
|
13505
|
+
const names_1 = __webpack_require__(/*! ajv/dist/compile/names */ "./node_modules/ajv/dist/compile/names.js");
|
|
13506
|
+
const keyword = "errorMessage";
|
|
13507
|
+
const used = new ajv_1.Name("emUsed");
|
|
13508
|
+
const KEYWORD_PROPERTY_PARAMS = {
|
|
13509
|
+
required: "missingProperty",
|
|
13510
|
+
dependencies: "property",
|
|
13511
|
+
dependentRequired: "property",
|
|
13512
|
+
};
|
|
13513
|
+
const INTERPOLATION = /\$\{[^}]+\}/;
|
|
13514
|
+
const INTERPOLATION_REPLACE = /\$\{([^}]+)\}/g;
|
|
13515
|
+
const EMPTY_STR = /^""\s*\+\s*|\s*\+\s*""$/g;
|
|
13516
|
+
function errorMessage(options) {
|
|
13517
|
+
return {
|
|
13518
|
+
keyword,
|
|
13519
|
+
schemaType: ["string", "object"],
|
|
13520
|
+
post: true,
|
|
13521
|
+
code(cxt) {
|
|
13522
|
+
const { gen, data, schema, schemaValue, it } = cxt;
|
|
13523
|
+
if (it.createErrors === false)
|
|
13524
|
+
return;
|
|
13525
|
+
const sch = schema;
|
|
13526
|
+
const instancePath = codegen_1.strConcat(names_1.default.instancePath, it.errorPath);
|
|
13527
|
+
gen.if(ajv_1._ `${names_1.default.errors} > 0`, () => {
|
|
13528
|
+
if (typeof sch == "object") {
|
|
13529
|
+
const [kwdPropErrors, kwdErrors] = keywordErrorsConfig(sch);
|
|
13530
|
+
if (kwdErrors)
|
|
13531
|
+
processKeywordErrors(kwdErrors);
|
|
13532
|
+
if (kwdPropErrors)
|
|
13533
|
+
processKeywordPropErrors(kwdPropErrors);
|
|
13534
|
+
processChildErrors(childErrorsConfig(sch));
|
|
13535
|
+
}
|
|
13536
|
+
const schMessage = typeof sch == "string" ? sch : sch._;
|
|
13537
|
+
if (schMessage)
|
|
13538
|
+
processAllErrors(schMessage);
|
|
13539
|
+
if (!options.keepErrors)
|
|
13540
|
+
removeUsedErrors();
|
|
13541
|
+
});
|
|
13542
|
+
function childErrorsConfig({ properties, items }) {
|
|
13543
|
+
const errors = {};
|
|
13544
|
+
if (properties) {
|
|
13545
|
+
errors.props = {};
|
|
13546
|
+
for (const p in properties)
|
|
13547
|
+
errors.props[p] = [];
|
|
13548
|
+
}
|
|
13549
|
+
if (items) {
|
|
13550
|
+
errors.items = {};
|
|
13551
|
+
for (let i = 0; i < items.length; i++)
|
|
13552
|
+
errors.items[i] = [];
|
|
13553
|
+
}
|
|
13554
|
+
return errors;
|
|
13555
|
+
}
|
|
13556
|
+
function keywordErrorsConfig(emSchema) {
|
|
13557
|
+
let propErrors;
|
|
13558
|
+
let errors;
|
|
13559
|
+
for (const k in emSchema) {
|
|
13560
|
+
if (k === "properties" || k === "items")
|
|
13561
|
+
continue;
|
|
13562
|
+
const kwdSch = emSchema[k];
|
|
13563
|
+
if (typeof kwdSch == "object") {
|
|
13564
|
+
propErrors || (propErrors = {});
|
|
13565
|
+
const errMap = (propErrors[k] = {});
|
|
13566
|
+
for (const p in kwdSch)
|
|
13567
|
+
errMap[p] = [];
|
|
13568
|
+
}
|
|
13569
|
+
else {
|
|
13570
|
+
errors || (errors = {});
|
|
13571
|
+
errors[k] = [];
|
|
13572
|
+
}
|
|
13573
|
+
}
|
|
13574
|
+
return [propErrors, errors];
|
|
13575
|
+
}
|
|
13576
|
+
function processKeywordErrors(kwdErrors) {
|
|
13577
|
+
const kwdErrs = gen.const("emErrors", ajv_1.stringify(kwdErrors));
|
|
13578
|
+
const templates = gen.const("templates", getTemplatesCode(kwdErrors, schema));
|
|
13579
|
+
gen.forOf("err", names_1.default.vErrors, (err) => gen.if(matchKeywordError(err, kwdErrs), () => gen.code(ajv_1._ `${kwdErrs}[${err}.keyword].push(${err})`).assign(ajv_1._ `${err}.${used}`, true)));
|
|
13580
|
+
const { singleError } = options;
|
|
13581
|
+
if (singleError) {
|
|
13582
|
+
const message = gen.let("message", ajv_1._ `""`);
|
|
13583
|
+
const paramsErrors = gen.let("paramsErrors", ajv_1._ `[]`);
|
|
13584
|
+
loopErrors((key) => {
|
|
13585
|
+
gen.if(message, () => gen.code(ajv_1._ `${message} += ${typeof singleError == "string" ? singleError : ";"}`));
|
|
13586
|
+
gen.code(ajv_1._ `${message} += ${errMessage(key)}`);
|
|
13587
|
+
gen.assign(paramsErrors, ajv_1._ `${paramsErrors}.concat(${kwdErrs}[${key}])`);
|
|
13588
|
+
});
|
|
13589
|
+
errors_1.reportError(cxt, { message, params: ajv_1._ `{errors: ${paramsErrors}}` });
|
|
13590
|
+
}
|
|
13591
|
+
else {
|
|
13592
|
+
loopErrors((key) => errors_1.reportError(cxt, {
|
|
13593
|
+
message: errMessage(key),
|
|
13594
|
+
params: ajv_1._ `{errors: ${kwdErrs}[${key}]}`,
|
|
13595
|
+
}));
|
|
13596
|
+
}
|
|
13597
|
+
function loopErrors(body) {
|
|
13598
|
+
gen.forIn("key", kwdErrs, (key) => gen.if(ajv_1._ `${kwdErrs}[${key}].length`, () => body(key)));
|
|
13599
|
+
}
|
|
13600
|
+
function errMessage(key) {
|
|
13601
|
+
return ajv_1._ `${key} in ${templates} ? ${templates}[${key}]() : ${schemaValue}[${key}]`;
|
|
13602
|
+
}
|
|
13603
|
+
}
|
|
13604
|
+
function processKeywordPropErrors(kwdPropErrors) {
|
|
13605
|
+
const kwdErrs = gen.const("emErrors", ajv_1.stringify(kwdPropErrors));
|
|
13606
|
+
const templatesCode = [];
|
|
13607
|
+
for (const k in kwdPropErrors) {
|
|
13608
|
+
templatesCode.push([
|
|
13609
|
+
k,
|
|
13610
|
+
getTemplatesCode(kwdPropErrors[k], schema[k]),
|
|
13611
|
+
]);
|
|
13612
|
+
}
|
|
13613
|
+
const templates = gen.const("templates", gen.object(...templatesCode));
|
|
13614
|
+
const kwdPropParams = gen.scopeValue("obj", {
|
|
13615
|
+
ref: KEYWORD_PROPERTY_PARAMS,
|
|
13616
|
+
code: ajv_1.stringify(KEYWORD_PROPERTY_PARAMS),
|
|
13617
|
+
});
|
|
13618
|
+
const propParam = gen.let("emPropParams");
|
|
13619
|
+
const paramsErrors = gen.let("emParamsErrors");
|
|
13620
|
+
gen.forOf("err", names_1.default.vErrors, (err) => gen.if(matchKeywordError(err, kwdErrs), () => {
|
|
13621
|
+
gen.assign(propParam, ajv_1._ `${kwdPropParams}[${err}.keyword]`);
|
|
13622
|
+
gen.assign(paramsErrors, ajv_1._ `${kwdErrs}[${err}.keyword][${err}.params[${propParam}]]`);
|
|
13623
|
+
gen.if(paramsErrors, () => gen.code(ajv_1._ `${paramsErrors}.push(${err})`).assign(ajv_1._ `${err}.${used}`, true));
|
|
13624
|
+
}));
|
|
13625
|
+
gen.forIn("key", kwdErrs, (key) => gen.forIn("keyProp", ajv_1._ `${kwdErrs}[${key}]`, (keyProp) => {
|
|
13626
|
+
gen.assign(paramsErrors, ajv_1._ `${kwdErrs}[${key}][${keyProp}]`);
|
|
13627
|
+
gen.if(ajv_1._ `${paramsErrors}.length`, () => {
|
|
13628
|
+
const tmpl = gen.const("tmpl", ajv_1._ `${templates}[${key}] && ${templates}[${key}][${keyProp}]`);
|
|
13629
|
+
errors_1.reportError(cxt, {
|
|
13630
|
+
message: ajv_1._ `${tmpl} ? ${tmpl}() : ${schemaValue}[${key}][${keyProp}]`,
|
|
13631
|
+
params: ajv_1._ `{errors: ${paramsErrors}}`,
|
|
13632
|
+
});
|
|
13633
|
+
});
|
|
13634
|
+
}));
|
|
13635
|
+
}
|
|
13636
|
+
function processChildErrors(childErrors) {
|
|
13637
|
+
const { props, items } = childErrors;
|
|
13638
|
+
if (!props && !items)
|
|
13639
|
+
return;
|
|
13640
|
+
const isObj = ajv_1._ `typeof ${data} == "object"`;
|
|
13641
|
+
const isArr = ajv_1._ `Array.isArray(${data})`;
|
|
13642
|
+
const childErrs = gen.let("emErrors");
|
|
13643
|
+
let childKwd;
|
|
13644
|
+
let childProp;
|
|
13645
|
+
const templates = gen.let("templates");
|
|
13646
|
+
if (props && items) {
|
|
13647
|
+
childKwd = gen.let("emChildKwd");
|
|
13648
|
+
gen.if(isObj);
|
|
13649
|
+
gen.if(isArr, () => {
|
|
13650
|
+
init(items, schema.items);
|
|
13651
|
+
gen.assign(childKwd, ajv_1.str `items`);
|
|
13652
|
+
}, () => {
|
|
13653
|
+
init(props, schema.properties);
|
|
13654
|
+
gen.assign(childKwd, ajv_1.str `properties`);
|
|
13655
|
+
});
|
|
13656
|
+
childProp = ajv_1._ `[${childKwd}]`;
|
|
13657
|
+
}
|
|
13658
|
+
else if (items) {
|
|
13659
|
+
gen.if(isArr);
|
|
13660
|
+
init(items, schema.items);
|
|
13661
|
+
childProp = ajv_1._ `.items`;
|
|
13662
|
+
}
|
|
13663
|
+
else if (props) {
|
|
13664
|
+
gen.if(codegen_1.and(isObj, codegen_1.not(isArr)));
|
|
13665
|
+
init(props, schema.properties);
|
|
13666
|
+
childProp = ajv_1._ `.properties`;
|
|
13667
|
+
}
|
|
13668
|
+
gen.forOf("err", names_1.default.vErrors, (err) => ifMatchesChildError(err, childErrs, (child) => gen.code(ajv_1._ `${childErrs}[${child}].push(${err})`).assign(ajv_1._ `${err}.${used}`, true)));
|
|
13669
|
+
gen.forIn("key", childErrs, (key) => gen.if(ajv_1._ `${childErrs}[${key}].length`, () => {
|
|
13670
|
+
errors_1.reportError(cxt, {
|
|
13671
|
+
message: ajv_1._ `${key} in ${templates} ? ${templates}[${key}]() : ${schemaValue}${childProp}[${key}]`,
|
|
13672
|
+
params: ajv_1._ `{errors: ${childErrs}[${key}]}`,
|
|
13673
|
+
});
|
|
13674
|
+
gen.assign(ajv_1._ `${names_1.default.vErrors}[${names_1.default.errors}-1].instancePath`, ajv_1._ `${instancePath} + "/" + ${key}.replace(/~/g, "~0").replace(/\\//g, "~1")`);
|
|
13675
|
+
}));
|
|
13676
|
+
gen.endIf();
|
|
13677
|
+
function init(children, msgs) {
|
|
13678
|
+
gen.assign(childErrs, ajv_1.stringify(children));
|
|
13679
|
+
gen.assign(templates, getTemplatesCode(children, msgs));
|
|
13680
|
+
}
|
|
13681
|
+
}
|
|
13682
|
+
function processAllErrors(schMessage) {
|
|
13683
|
+
const errs = gen.const("emErrs", ajv_1._ `[]`);
|
|
13684
|
+
gen.forOf("err", names_1.default.vErrors, (err) => gen.if(matchAnyError(err), () => gen.code(ajv_1._ `${errs}.push(${err})`).assign(ajv_1._ `${err}.${used}`, true)));
|
|
13685
|
+
gen.if(ajv_1._ `${errs}.length`, () => errors_1.reportError(cxt, {
|
|
13686
|
+
message: templateExpr(schMessage),
|
|
13687
|
+
params: ajv_1._ `{errors: ${errs}}`,
|
|
13688
|
+
}));
|
|
13689
|
+
}
|
|
13690
|
+
function removeUsedErrors() {
|
|
13691
|
+
const errs = gen.const("emErrs", ajv_1._ `[]`);
|
|
13692
|
+
gen.forOf("err", names_1.default.vErrors, (err) => gen.if(ajv_1._ `!${err}.${used}`, () => gen.code(ajv_1._ `${errs}.push(${err})`)));
|
|
13693
|
+
gen.assign(names_1.default.vErrors, errs).assign(names_1.default.errors, ajv_1._ `${errs}.length`);
|
|
13694
|
+
}
|
|
13695
|
+
function matchKeywordError(err, kwdErrs) {
|
|
13696
|
+
return codegen_1.and(ajv_1._ `${err}.keyword !== ${keyword}`, ajv_1._ `!${err}.${used}`, ajv_1._ `${err}.instancePath === ${instancePath}`, ajv_1._ `${err}.keyword in ${kwdErrs}`,
|
|
13697
|
+
// TODO match the end of the string?
|
|
13698
|
+
ajv_1._ `${err}.schemaPath.indexOf(${it.errSchemaPath}) === 0`, ajv_1._ `/^\\/[^\\/]*$/.test(${err}.schemaPath.slice(${it.errSchemaPath.length}))`);
|
|
13699
|
+
}
|
|
13700
|
+
function ifMatchesChildError(err, childErrs, thenBody) {
|
|
13701
|
+
gen.if(codegen_1.and(ajv_1._ `${err}.keyword !== ${keyword}`, ajv_1._ `!${err}.${used}`, ajv_1._ `${err}.instancePath.indexOf(${instancePath}) === 0`), () => {
|
|
13702
|
+
const childRegex = gen.scopeValue("pattern", {
|
|
13703
|
+
ref: /^\/([^/]*)(?:\/|$)/,
|
|
13704
|
+
code: ajv_1._ `new RegExp("^\\\/([^/]*)(?:\\\/|$)")`,
|
|
13705
|
+
});
|
|
13706
|
+
const matches = gen.const("emMatches", ajv_1._ `${childRegex}.exec(${err}.instancePath.slice(${instancePath}.length))`);
|
|
13707
|
+
const child = gen.const("emChild", ajv_1._ `${matches} && ${matches}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);
|
|
13708
|
+
gen.if(ajv_1._ `${child} !== undefined && ${child} in ${childErrs}`, () => thenBody(child));
|
|
13709
|
+
});
|
|
13710
|
+
}
|
|
13711
|
+
function matchAnyError(err) {
|
|
13712
|
+
return codegen_1.and(ajv_1._ `${err}.keyword !== ${keyword}`, ajv_1._ `!${err}.${used}`, codegen_1.or(ajv_1._ `${err}.instancePath === ${instancePath}`, codegen_1.and(ajv_1._ `${err}.instancePath.indexOf(${instancePath}) === 0`, ajv_1._ `${err}.instancePath[${instancePath}.length] === "/"`)), ajv_1._ `${err}.schemaPath.indexOf(${it.errSchemaPath}) === 0`, ajv_1._ `${err}.schemaPath[${it.errSchemaPath}.length] === "/"`);
|
|
13713
|
+
}
|
|
13714
|
+
function getTemplatesCode(keys, msgs) {
|
|
13715
|
+
const templatesCode = [];
|
|
13716
|
+
for (const k in keys) {
|
|
13717
|
+
const msg = msgs[k];
|
|
13718
|
+
if (INTERPOLATION.test(msg))
|
|
13719
|
+
templatesCode.push([k, templateFunc(msg)]);
|
|
13720
|
+
}
|
|
13721
|
+
return gen.object(...templatesCode);
|
|
13722
|
+
}
|
|
13723
|
+
function templateExpr(msg) {
|
|
13724
|
+
if (!INTERPOLATION.test(msg))
|
|
13725
|
+
return ajv_1.stringify(msg);
|
|
13726
|
+
return new code_1._Code(code_1.safeStringify(msg)
|
|
13727
|
+
.replace(INTERPOLATION_REPLACE, (_s, ptr) => `" + JSON.stringify(${validate_1.getData(ptr, it)}) + "`)
|
|
13728
|
+
.replace(EMPTY_STR, ""));
|
|
13729
|
+
}
|
|
13730
|
+
function templateFunc(msg) {
|
|
13731
|
+
return ajv_1._ `function(){return ${templateExpr(msg)}}`;
|
|
13732
|
+
}
|
|
13733
|
+
},
|
|
13734
|
+
metaSchema: {
|
|
13735
|
+
anyOf: [
|
|
13736
|
+
{ type: "string" },
|
|
13737
|
+
{
|
|
13738
|
+
type: "object",
|
|
13739
|
+
properties: {
|
|
13740
|
+
properties: { $ref: "#/$defs/stringMap" },
|
|
13741
|
+
items: { $ref: "#/$defs/stringList" },
|
|
13742
|
+
required: { $ref: "#/$defs/stringOrMap" },
|
|
13743
|
+
dependencies: { $ref: "#/$defs/stringOrMap" },
|
|
13744
|
+
},
|
|
13745
|
+
additionalProperties: { type: "string" },
|
|
13746
|
+
},
|
|
13747
|
+
],
|
|
13748
|
+
$defs: {
|
|
13749
|
+
stringMap: {
|
|
13750
|
+
type: "object",
|
|
13751
|
+
additionalProperties: { type: "string" },
|
|
13752
|
+
},
|
|
13753
|
+
stringOrMap: {
|
|
13754
|
+
anyOf: [{ type: "string" }, { $ref: "#/$defs/stringMap" }],
|
|
13755
|
+
},
|
|
13756
|
+
stringList: { type: "array", items: { type: "string" } },
|
|
13757
|
+
},
|
|
13758
|
+
},
|
|
13759
|
+
};
|
|
13760
|
+
}
|
|
13761
|
+
const ajvErrors = (ajv, options = {}) => {
|
|
13762
|
+
if (!ajv.opts.allErrors)
|
|
13763
|
+
throw new Error("ajv-errors: Ajv option allErrors must be true");
|
|
13764
|
+
if (ajv.opts.jsPropertySyntax) {
|
|
13765
|
+
throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");
|
|
13766
|
+
}
|
|
13767
|
+
return ajv.addKeyword(errorMessage(options));
|
|
13768
|
+
};
|
|
13769
|
+
exports["default"] = ajvErrors;
|
|
13770
|
+
module.exports = ajvErrors;
|
|
13771
|
+
module.exports["default"] = ajvErrors;
|
|
13772
|
+
//# sourceMappingURL=index.js.map
|
|
13773
|
+
|
|
13774
|
+
/***/ }),
|
|
13775
|
+
|
|
13255
13776
|
/***/ "./node_modules/ajv-formats/dist/formats.js":
|
|
13256
13777
|
/*!**************************************************!*\
|
|
13257
13778
|
!*** ./node_modules/ajv-formats/dist/formats.js ***!
|
|
@@ -30111,8 +30632,7 @@ var Duration = /*#__PURE__*/function () {
|
|
|
30111
30632
|
|
|
30112
30633
|
var i = Math.trunc(own);
|
|
30113
30634
|
built[k] = i;
|
|
30114
|
-
accumulated[k] = own - i; //
|
|
30115
|
-
// plus anything further down the chain that should be rolled up in to this
|
|
30635
|
+
accumulated[k] = (own * 1000 - i * 1000) / 1000; // plus anything further down the chain that should be rolled up in to this
|
|
30116
30636
|
|
|
30117
30637
|
for (var down in vals) {
|
|
30118
30638
|
if (orderedUnits$1.indexOf(down) > orderedUnits$1.indexOf(k)) {
|
|
@@ -31873,14 +32393,19 @@ function dateTimeFromMatches(matches) {
|
|
|
31873
32393
|
}
|
|
31874
32394
|
};
|
|
31875
32395
|
|
|
31876
|
-
var zone;
|
|
32396
|
+
var zone = null;
|
|
32397
|
+
var specificOffset;
|
|
31877
32398
|
|
|
31878
|
-
if (!isUndefined(matches.
|
|
31879
|
-
zone = new FixedOffsetZone(matches.Z);
|
|
31880
|
-
} else if (!isUndefined(matches.z)) {
|
|
32399
|
+
if (!isUndefined(matches.z)) {
|
|
31881
32400
|
zone = IANAZone.create(matches.z);
|
|
31882
|
-
}
|
|
31883
|
-
|
|
32401
|
+
}
|
|
32402
|
+
|
|
32403
|
+
if (!isUndefined(matches.Z)) {
|
|
32404
|
+
if (!zone) {
|
|
32405
|
+
zone = new FixedOffsetZone(matches.Z);
|
|
32406
|
+
}
|
|
32407
|
+
|
|
32408
|
+
specificOffset = matches.Z;
|
|
31884
32409
|
}
|
|
31885
32410
|
|
|
31886
32411
|
if (!isUndefined(matches.q)) {
|
|
@@ -31912,7 +32437,7 @@ function dateTimeFromMatches(matches) {
|
|
|
31912
32437
|
|
|
31913
32438
|
return r;
|
|
31914
32439
|
}, {});
|
|
31915
|
-
return [vals, zone];
|
|
32440
|
+
return [vals, zone, specificOffset];
|
|
31916
32441
|
}
|
|
31917
32442
|
|
|
31918
32443
|
var dummyDateTimeCache = null;
|
|
@@ -31984,9 +32509,10 @@ function explainFromTokens(locale, input, format) {
|
|
|
31984
32509
|
_match = match(input, regex, handlers),
|
|
31985
32510
|
rawMatches = _match[0],
|
|
31986
32511
|
matches = _match[1],
|
|
31987
|
-
_ref6 = matches ? dateTimeFromMatches(matches) : [null, null],
|
|
32512
|
+
_ref6 = matches ? dateTimeFromMatches(matches) : [null, null, undefined],
|
|
31988
32513
|
result = _ref6[0],
|
|
31989
|
-
zone = _ref6[1]
|
|
32514
|
+
zone = _ref6[1],
|
|
32515
|
+
specificOffset = _ref6[2];
|
|
31990
32516
|
|
|
31991
32517
|
if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) {
|
|
31992
32518
|
throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format");
|
|
@@ -31999,7 +32525,8 @@ function explainFromTokens(locale, input, format) {
|
|
|
31999
32525
|
rawMatches: rawMatches,
|
|
32000
32526
|
matches: matches,
|
|
32001
32527
|
result: result,
|
|
32002
|
-
zone: zone
|
|
32528
|
+
zone: zone,
|
|
32529
|
+
specificOffset: specificOffset
|
|
32003
32530
|
};
|
|
32004
32531
|
}
|
|
32005
32532
|
}
|
|
@@ -32007,9 +32534,10 @@ function parseFromTokens(locale, input, format) {
|
|
|
32007
32534
|
var _explainFromTokens = explainFromTokens(locale, input, format),
|
|
32008
32535
|
result = _explainFromTokens.result,
|
|
32009
32536
|
zone = _explainFromTokens.zone,
|
|
32537
|
+
specificOffset = _explainFromTokens.specificOffset,
|
|
32010
32538
|
invalidReason = _explainFromTokens.invalidReason;
|
|
32011
32539
|
|
|
32012
|
-
return [result, zone, invalidReason];
|
|
32540
|
+
return [result, zone, specificOffset, invalidReason];
|
|
32013
32541
|
}
|
|
32014
32542
|
|
|
32015
32543
|
var nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],
|
|
@@ -32297,14 +32825,15 @@ function adjustTime(inst, dur) {
|
|
|
32297
32825
|
// by handling the zone options
|
|
32298
32826
|
|
|
32299
32827
|
|
|
32300
|
-
function parseDataToDateTime(parsed, parsedZone, opts, format, text) {
|
|
32828
|
+
function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {
|
|
32301
32829
|
var setZone = opts.setZone,
|
|
32302
32830
|
zone = opts.zone;
|
|
32303
32831
|
|
|
32304
32832
|
if (parsed && Object.keys(parsed).length !== 0) {
|
|
32305
32833
|
var interpretationZone = parsedZone || zone,
|
|
32306
32834
|
inst = DateTime.fromObject(parsed, _extends({}, opts, {
|
|
32307
|
-
zone: interpretationZone
|
|
32835
|
+
zone: interpretationZone,
|
|
32836
|
+
specificOffset: specificOffset
|
|
32308
32837
|
}));
|
|
32309
32838
|
return setZone ? inst : inst.setZone(zone);
|
|
32310
32839
|
} else {
|
|
@@ -32849,7 +33378,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
32849
33378
|
}
|
|
32850
33379
|
|
|
32851
33380
|
var tsNow = Settings.now(),
|
|
32852
|
-
offsetProvis = zoneToUse.offset(tsNow),
|
|
33381
|
+
offsetProvis = !isUndefined(opts.specificOffset) ? opts.specificOffset : zoneToUse.offset(tsNow),
|
|
32853
33382
|
normalized = normalizeObject(obj, normalizeUnit),
|
|
32854
33383
|
containsOrdinal = !isUndefined(normalized.ordinal),
|
|
32855
33384
|
containsGregorYear = !isUndefined(normalized.year),
|
|
@@ -33053,12 +33582,13 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
33053
33582
|
_parseFromTokens = parseFromTokens(localeToUse, text, fmt),
|
|
33054
33583
|
vals = _parseFromTokens[0],
|
|
33055
33584
|
parsedZone = _parseFromTokens[1],
|
|
33056
|
-
|
|
33585
|
+
specificOffset = _parseFromTokens[2],
|
|
33586
|
+
invalid = _parseFromTokens[3];
|
|
33057
33587
|
|
|
33058
33588
|
if (invalid) {
|
|
33059
33589
|
return DateTime.invalid(invalid);
|
|
33060
33590
|
} else {
|
|
33061
|
-
return parseDataToDateTime(vals, parsedZone, opts, "format " + fmt, text);
|
|
33591
|
+
return parseDataToDateTime(vals, parsedZone, opts, "format " + fmt, text, specificOffset);
|
|
33062
33592
|
}
|
|
33063
33593
|
}
|
|
33064
33594
|
/**
|
|
@@ -34696,7 +35226,7 @@ function friendlyDateTime(dateTimeish) {
|
|
|
34696
35226
|
}
|
|
34697
35227
|
}
|
|
34698
35228
|
|
|
34699
|
-
var VERSION = "2.
|
|
35229
|
+
var VERSION = "2.2.0";
|
|
34700
35230
|
|
|
34701
35231
|
exports.DateTime = DateTime;
|
|
34702
35232
|
exports.Duration = Duration;
|