@nmshd/content 2.0.0-alpha.32 → 2.0.0-alpha.35

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.
@@ -26,5 +26,6 @@ export declare class RelationshipAttributeCreationHints extends Serializable imp
26
26
  valueHints?: ValueHints;
27
27
  isTechnical: boolean;
28
28
  confidentiality: RelationshipAttributeConfidentiality;
29
+ protected static preFrom(value: any): any;
29
30
  static from(value: IRelationshipAttributeCreationHints | RelationshipAttributeCreationHintsJSON): RelationshipAttributeCreationHints;
30
31
  }
@@ -19,9 +19,10 @@ const ValueHints_1 = require("./ValueHints");
19
19
  * a proprietary Attribute, even without such an Attribute existent.
20
20
  */
21
21
  let RelationshipAttributeCreationHints = class RelationshipAttributeCreationHints extends ts_serval_1.Serializable {
22
- constructor() {
23
- super(...arguments);
24
- this.isTechnical = false;
22
+ static preFrom(value) {
23
+ if (typeof value.isTechnical === "undefined")
24
+ value.isTechnical = false;
25
+ return value;
25
26
  }
26
27
  static from(value) {
27
28
  return this.fromAny(value);
@@ -45,7 +46,7 @@ __decorate([
45
46
  __decorate([
46
47
  (0, ts_serval_1.serialize)(),
47
48
  (0, ts_serval_1.validate)({ nullable: true }),
48
- __metadata("design:type", Object)
49
+ __metadata("design:type", Boolean)
49
50
  ], RelationshipAttributeCreationHints.prototype, "isTechnical", void 0);
50
51
  __decorate([
51
52
  (0, ts_serval_1.serialize)(),
@@ -1 +1 @@
1
- {"version":3,"file":"RelationshipAttributeHints.js","sourceRoot":"","sources":["../../../src/attributes/hints/RelationshipAttributeHints.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA2F;AAC3F,oEAA+E;AAC/E,6CAAsE;AAkBtE;;;;GAIG;AAEH,IAAa,kCAAkC,GAA/C,MAAa,kCAAmC,SAAQ,wBAAY;IAApE;;QAeW,gBAAW,GAAG,KAAK,CAAA;IAgB9B,CAAC;IALU,MAAM,CAAC,IAAI,CACd,KAAmF;QAEnF,OAAO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AA;IAChB,CAAC;IAEM,MAAM,CAAC,IAAI,CACd,KAAmF;QAEnF,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;CACJ,CAAA;AAlCG;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;;iEACS;AAIpB;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uEACF;AAI3B;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACT,uBAAU;sEAAA;AAI9B;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uEACF;AAS3B;IAPC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,EAAC;QACN,eAAe,EAAE,CAAC,CAAC,EAAE,EAAE,CACnB,CAAC,MAAM,CAAC,MAAM,CAAC,4DAAoC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC5D,CAAC,CAAC,mBAAmB,MAAM,CAAC,MAAM,CAAC,4DAAoC,CAAC,EAAE;YAC1E,CAAC,CAAC,SAAS;KACtB,CAAC;;2EAC0D;AAxBnD,kCAAkC;IAD9C,IAAA,gBAAI,EAAC,4BAA4B,CAAC;GACtB,kCAAkC,CAqC9C;AArCY,gFAAkC"}
@@ -5,10 +5,10 @@ const ts_serval_1 = require("@js-soft/ts-serval");
5
5
  const crypto_1 = require("@nmshd/crypto");
6
6
  const transport_1 = require("@nmshd/transport");
7
7
  exports.buildInformation = {
8
- version: "2.0.0-alpha.32",
9
- build: "62",
10
- date: "2022-06-03T15:06:19+00:00",
11
- commit: "06f06cf3dc35d1caa1b1946c6308e1f6c80c3526",
8
+ version: "2.0.0-alpha.35",
9
+ build: "65",
10
+ date: "2022-06-13T06:45:21+00:00",
11
+ commit: "d8bf251a9fae809a7dcf94dc85832036ceb97864",
12
12
  dependencies: {"@js-soft/logging-abstractions":"^1.0.0"},
13
13
  libraries: {
14
14
  serval: ts_serval_1.buildInformation,
@@ -1,3 +1,4 @@
1
+ import { Serializable } from "@js-soft/ts-serval";
1
2
  import { IdentityAttribute, IdentityAttributeJSON, IdentityAttributeQuery, IdentityAttributeQueryJSON, IIdentityAttribute, IIdentityAttributeQuery, IRelationshipAttribute, IRelationshipAttributeQuery, RelationshipAttribute, RelationshipAttributeJSON, RelationshipAttributeQuery, RelationshipAttributeQueryJSON } from "../../../attributes";
2
3
  import { IRequestItem, RequestItem, RequestItemJSON } from "../../RequestItem";
3
4
  export interface ProposeAttributeRequestItemJSON extends RequestItemJSON {
@@ -12,4 +13,5 @@ export declare class ProposeAttributeRequestItem extends RequestItem implements
12
13
  query: IdentityAttributeQuery | RelationshipAttributeQuery;
13
14
  attribute: IdentityAttribute | RelationshipAttribute;
14
15
  static from(value: IProposeAttributeRequestItem): ProposeAttributeRequestItem;
16
+ protected static postFrom<T extends Serializable>(value: T): T;
15
17
  }
@@ -8,15 +8,33 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
+ var ProposeAttributeRequestItem_1;
11
12
  Object.defineProperty(exports, "__esModule", { value: true });
12
13
  exports.ProposeAttributeRequestItem = void 0;
13
14
  const ts_serval_1 = require("@js-soft/ts-serval");
15
+ const ts_simple_nameof_1 = require("ts-simple-nameof");
14
16
  const attributes_1 = require("../../../attributes");
15
17
  const RequestItem_1 = require("../../RequestItem");
16
- let ProposeAttributeRequestItem = class ProposeAttributeRequestItem extends RequestItem_1.RequestItem {
18
+ let ProposeAttributeRequestItem = ProposeAttributeRequestItem_1 = class ProposeAttributeRequestItem extends RequestItem_1.RequestItem {
17
19
  static from(value) {
18
20
  return this.fromAny(value);
19
21
  }
22
+ static postFrom(value) {
23
+ if (!(value instanceof ProposeAttributeRequestItem_1))
24
+ throw new Error("this should never happen");
25
+ const attributeValueType = value.attribute.value.toJSON()["@type"];
26
+ const queryValueType = value.query.valueType;
27
+ if (attributeValueType !== queryValueType) {
28
+ throw new ts_serval_1.ValidationError(ProposeAttributeRequestItem_1.name, `${(0, ts_simple_nameof_1.nameof)((x) => x.query)}.${(0, ts_simple_nameof_1.nameof)((x) => x.valueType)}`, `You cannot propose an Attribute whose type of the value ('${attributeValueType}') is different from the value type of the query ('${queryValueType}').`);
29
+ }
30
+ if (value.attribute instanceof attributes_1.RelationshipAttribute && !(value.query instanceof attributes_1.RelationshipAttributeQuery)) {
31
+ throw new ts_serval_1.ValidationError(ProposeAttributeRequestItem_1.name, "", "When proposing a RelationshipAttribute, the corresponding query has to be a RelationshipAttributeQuery.");
32
+ }
33
+ if (value.attribute instanceof attributes_1.IdentityAttribute && !(value.query instanceof attributes_1.IdentityAttributeQuery)) {
34
+ throw new ts_serval_1.ValidationError(ProposeAttributeRequestItem_1.name, "", "When proposing an IdentityAttribute, the corresponding query has to be a IdentityAttributeQuery.");
35
+ }
36
+ return value;
37
+ }
20
38
  };
21
39
  __decorate([
22
40
  (0, ts_serval_1.serialize)({ unionTypes: [attributes_1.IdentityAttributeQuery, attributes_1.RelationshipAttributeQuery] }),
@@ -28,7 +46,7 @@ __decorate([
28
46
  (0, ts_serval_1.validate)(),
29
47
  __metadata("design:type", Object)
30
48
  ], ProposeAttributeRequestItem.prototype, "attribute", void 0);
31
- ProposeAttributeRequestItem = __decorate([
49
+ ProposeAttributeRequestItem = ProposeAttributeRequestItem_1 = __decorate([
32
50
  (0, ts_serval_1.type)("ProposeAttributeRequestItem")
33
51
  ], ProposeAttributeRequestItem);
34
52
  exports.ProposeAttributeRequestItem = ProposeAttributeRequestItem;
@@ -1 +1 @@
1
- {"version":3,"file":"ProposeAttributeRequestItem.js","sourceRoot":"","sources":["../../../../src/requests/items/proposeAttribute/ProposeAttributeRequestItem.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA8D;AAC9D,oDAa4B;AAC5B,mDAA8E;AAY9E,IAAa,2BAA2B,GAAxC,MAAa,2BAA4B,SAAQ,yBAAW;IASjD,MAAM,CAAC,IAAI,CAAC,KAAmC;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;CACJ,CAAA;AATG;IAFC,IAAA,qBAAS,EAAC,EAAE,UAAU,EAAE,CAAC,mCAAsB,EAAE,uCAA0B,CAAC,EAAE,CAAC;IAC/E,IAAA,oBAAQ,GAAE;;0DACsD;AAIjE;IAFC,IAAA,qBAAS,EAAC,EAAE,UAAU,EAAE,CAAC,8BAAiB,EAAE,kCAAqB,CAAC,EAAE,CAAC;IACrE,IAAA,oBAAQ,GAAE;;8DACgD;AAPlD,2BAA2B;IADvC,IAAA,gBAAI,EAAC,6BAA6B,CAAC;GACvB,2BAA2B,CAYvC;AAZY,kEAA2B"}
1
+ {"version":3,"file":"ProposeAttributeRequestItem.js","sourceRoot":"","sources":["../../../../src/requests/items/proposeAttribute/ProposeAttributeRequestItem.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAA6F;AAC7F,uDAAyC;AACzC,oDAc4B;AAC5B,mDAA8E;AAa9E,IAAa,2BAA2B,mCAAxC,MAAa,2BAA4B,SAAQ,yBAAW;IASjD,MAAM,CAAC,IAAI,CAAC,KAAmC;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;IAES,MAAM,CAAU,QAAQ,CAAyB,KAAQ;QAC/D,IAAI,CAAC,CAAC,KAAK,YAAY,6BAA2B,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAEhG,MAAM,kBAAkB,GAAI,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,EAAU,CAAC,OAAO,CAAC,CAAA;QAC3E,MAAM,cAAc,GAAG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*/ "./dist/attributes/
1422
1422
  * a proprietary Attribute, even without such an Attribute existent.
1423
1423
  */
1424
1424
  let RelationshipAttributeCreationHints = class RelationshipAttributeCreationHints extends ts_serval_1.Serializable {
1425
- constructor() {
1426
- super(...arguments);
1427
- this.isTechnical = false;
1425
+ static preFrom(value) {
1426
+ if (typeof value.isTechnical === "undefined")
1427
+ value.isTechnical = false;
1428
+ return value;
1428
1429
  }
1429
1430
  static from(value) {
1430
1431
  return this.fromAny(value);
@@ -1448,7 +1449,7 @@ __decorate([
1448
1449
  __decorate([
1449
1450
  (0, ts_serval_1.serialize)(),
1450
1451
  (0, ts_serval_1.validate)({ nullable: true }),
1451
- __metadata("design:type", Object)
1452
+ __metadata("design:type", Boolean)
1452
1453
  ], RelationshipAttributeCreationHints.prototype, "isTechnical", void 0);
1453
1454
  __decorate([
1454
1455
  (0, ts_serval_1.serialize)(),
@@ -4929,10 +4930,10 @@ const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-s
4929
4930
  const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
4930
4931
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
4931
4932
  exports.buildInformation = {
4932
- version: "2.0.0-alpha.32",
4933
- build: "62",
4934
- date: "2022-06-03T15:06:19+00:00",
4935
- commit: "06f06cf3dc35d1caa1b1946c6308e1f6c80c3526",
4933
+ version: "2.0.0-alpha.35",
4934
+ build: "65",
4935
+ date: "2022-06-13T06:45:21+00:00",
4936
+ commit: "d8bf251a9fae809a7dcf94dc85832036ceb97864",
4936
4937
  dependencies: {"@js-soft/logging-abstractions":"^1.0.0"},
4937
4938
  libraries: {
4938
4939
  serval: ts_serval_1.buildInformation,
@@ -6025,15 +6026,33 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6025
6026
  var __metadata = (this && this.__metadata) || function (k, v) {
6026
6027
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
6027
6028
  };
6029
+ var ProposeAttributeRequestItem_1;
6028
6030
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6029
6031
  exports.ProposeAttributeRequestItem = void 0;
6030
6032
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
6033
+ const ts_simple_nameof_1 = __webpack_require__(/*! ts-simple-nameof */ "./node_modules/ts-simple-nameof/index.js");
6031
6034
  const attributes_1 = __webpack_require__(/*! ../../../attributes */ "./dist/attributes/index.js");
6032
6035
  const RequestItem_1 = __webpack_require__(/*! ../../RequestItem */ "./dist/requests/RequestItem.js");
6033
- let ProposeAttributeRequestItem = class ProposeAttributeRequestItem extends RequestItem_1.RequestItem {
6036
+ let ProposeAttributeRequestItem = ProposeAttributeRequestItem_1 = class ProposeAttributeRequestItem extends RequestItem_1.RequestItem {
6034
6037
  static from(value) {
6035
6038
  return this.fromAny(value);
6036
6039
  }
6040
+ static postFrom(value) {
6041
+ if (!(value instanceof ProposeAttributeRequestItem_1))
6042
+ throw new Error("this should never happen");
6043
+ const attributeValueType = value.attribute.value.toJSON()["@type"];
6044
+ const queryValueType = value.query.valueType;
6045
+ if (attributeValueType !== queryValueType) {
6046
+ throw new ts_serval_1.ValidationError(ProposeAttributeRequestItem_1.name, `${(0, ts_simple_nameof_1.nameof)((x) => x.query)}.${(0, ts_simple_nameof_1.nameof)((x) => x.valueType)}`, `You cannot propose an Attribute whose type of the value ('${attributeValueType}') is different from the value type of the query ('${queryValueType}').`);
6047
+ }
6048
+ if (value.attribute instanceof attributes_1.RelationshipAttribute && !(value.query instanceof attributes_1.RelationshipAttributeQuery)) {
6049
+ throw new ts_serval_1.ValidationError(ProposeAttributeRequestItem_1.name, "", "When proposing a RelationshipAttribute, the corresponding query has to be a RelationshipAttributeQuery.");
6050
+ }
6051
+ if (value.attribute instanceof attributes_1.IdentityAttribute && !(value.query instanceof attributes_1.IdentityAttributeQuery)) {
6052
+ throw new ts_serval_1.ValidationError(ProposeAttributeRequestItem_1.name, "", "When proposing an IdentityAttribute, the corresponding query has to be a IdentityAttributeQuery.");
6053
+ }
6054
+ return value;
6055
+ }
6037
6056
  };
6038
6057
  __decorate([
6039
6058
  (0, ts_serval_1.serialize)({ unionTypes: [attributes_1.IdentityAttributeQuery, attributes_1.RelationshipAttributeQuery] }),
@@ -6045,7 +6064,7 @@ __decorate([
6045
6064
  (0, ts_serval_1.validate)(),
6046
6065
  __metadata("design:type", Object)
6047
6066
  ], ProposeAttributeRequestItem.prototype, "attribute", void 0);
6048
- ProposeAttributeRequestItem = __decorate([
6067
+ ProposeAttributeRequestItem = ProposeAttributeRequestItem_1 = __decorate([
6049
6068
  (0, ts_serval_1.type)("ProposeAttributeRequestItem")
6050
6069
  ], ProposeAttributeRequestItem);
6051
6070
  exports.ProposeAttributeRequestItem = ProposeAttributeRequestItem;