@nmshd/content 2.0.0-alpha.33 → 2.0.0-alpha.36

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.
@@ -1,6 +1,6 @@
1
1
  import { CoreAddress, ICoreAddress } from "@nmshd/transport";
2
2
  import { AbstractAttributeQuery, AbstractAttributeQueryJSON, IAbstractAttributeQuery } from "./AbstractAttributeQuery";
3
- import { IRelationshipAttributeCreationHints, RelationshipAttributeCreationHints, RelationshipAttributeCreationHintsJSON } from "./hints/RelationshipAttributeHints";
3
+ import { IRelationshipAttributeCreationHints, RelationshipAttributeCreationHints, RelationshipAttributeCreationHintsJSON } from "./hints/RelationshipAttributeCreationHints";
4
4
  export interface RelationshipAttributeQueryJSON extends AbstractAttributeQueryJSON {
5
5
  key: string;
6
6
  owner: string;
@@ -13,7 +13,7 @@ exports.RelationshipAttributeQuery = void 0;
13
13
  const ts_serval_1 = require("@js-soft/ts-serval");
14
14
  const transport_1 = require("@nmshd/transport");
15
15
  const AbstractAttributeQuery_1 = require("./AbstractAttributeQuery");
16
- const RelationshipAttributeHints_1 = require("./hints/RelationshipAttributeHints");
16
+ const RelationshipAttributeCreationHints_1 = require("./hints/RelationshipAttributeCreationHints");
17
17
  let RelationshipAttributeQuery = class RelationshipAttributeQuery extends AbstractAttributeQuery_1.AbstractAttributeQuery {
18
18
  static from(value) {
19
19
  return this.fromAny(value);
@@ -40,7 +40,7 @@ __decorate([
40
40
  __decorate([
41
41
  (0, ts_serval_1.serialize)(),
42
42
  (0, ts_serval_1.validate)(),
43
- __metadata("design:type", RelationshipAttributeHints_1.RelationshipAttributeCreationHints)
43
+ __metadata("design:type", RelationshipAttributeCreationHints_1.RelationshipAttributeCreationHints)
44
44
  ], RelationshipAttributeQuery.prototype, "attributeCreationHints", void 0);
45
45
  RelationshipAttributeQuery = __decorate([
46
46
  (0, ts_serval_1.type)("RelationshipAttributeQuery")
@@ -1 +1 @@
1
- {"version":3,"file":"RelationshipAttributeQuery.js","sourceRoot":"","sources":["../../src/attributes/RelationshipAttributeQuery.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA8D;AAC9D,gDAA4D;AAC5D,qEAAsH;AACtH,mFAI2C;AAiB3C,IAAa,0BAA0B,GAAvC,MAAa,0BAA2B,SAAQ,+CAAsB;IAiB3D,MAAM,CAAC,IAAI,CACd,KAAmE;QAEnE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;IAEe,MAAM;QAClB,OAAO,KAAK,CAAC,MAAM,EAAoC,CAAA;IAC3D,CAAC;CACJ,CAAA;AAvBG;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;;uDACO;AAIlB;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACG,uBAAW;yDAAA;AAIzB;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACT,uBAAW;8DAAA;AAI/B;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACoB,+DAAkC;0EAAA;AAfxD,0BAA0B;IADtC,IAAA,gBAAI,EAAC,4BAA4B,CAAC;GACtB,0BAA0B,CA0BtC;AA1BY,gEAA0B"}
1
+ {"version":3,"file":"RelationshipAttributeQuery.js","sourceRoot":"","sources":["../../src/attributes/RelationshipAttributeQuery.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA8D;AAC9D,gDAA4D;AAC5D,qEAAsH;AACtH,mGAImD;AAiBnD,IAAa,0BAA0B,GAAvC,MAAa,0BAA2B,SAAQ,+CAAsB;IAiB3D,MAAM,CAAC,IAAI,CACd,KAAmE;QAEnE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;IAEe,MAAM;QAClB,OAAO,KAAK,CAAC,MAAM,EAAoC,CAAA;IAC3D,CAAC;CACJ,CAAA;AAvBG;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;;uDACO;AAIlB;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACG,uBAAW;yDAAA;AAIzB;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACT,uBAAW;8DAAA;AAI/B;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACoB,uEAAkC;0EAAA;AAfxD,0BAA0B;IADtC,IAAA,gBAAI,EAAC,4BAA4B,CAAC;GACtB,0BAA0B,CA0BtC;AA1BY,gEAA0B"}
@@ -24,7 +24,8 @@ export declare class RelationshipAttributeCreationHints extends Serializable imp
24
24
  title: string;
25
25
  description?: string;
26
26
  valueHints?: ValueHints;
27
- isTechnical?: boolean;
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);
@@ -57,7 +58,7 @@ __decorate([
57
58
  __metadata("design:type", String)
58
59
  ], RelationshipAttributeCreationHints.prototype, "confidentiality", void 0);
59
60
  RelationshipAttributeCreationHints = __decorate([
60
- (0, ts_serval_1.type)("RelationshipAttributeHints")
61
+ (0, ts_serval_1.type)("RelationshipAttributeCreationHints")
61
62
  ], RelationshipAttributeCreationHints);
62
63
  exports.RelationshipAttributeCreationHints = RelationshipAttributeCreationHints;
63
- //# sourceMappingURL=RelationshipAttributeHints.js.map
64
+ //# sourceMappingURL=RelationshipAttributeCreationHints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelationshipAttributeCreationHints.js","sourceRoot":"","sources":["../../../src/attributes/hints/RelationshipAttributeCreationHints.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA2F;AAC3F,oEAA+E;AAC/E,6CAAsE;AAkBtE;;;;GAIG;AAEH,IAAa,kCAAkC,GAA/C,MAAa,kCAAmC,SAAQ,wBAAY;IA0BtD,MAAM,CAAU,OAAO,CAAC,KAAU;QACxC,IAAI,OAAO,KAAK,CAAC,WAAW,KAAK,WAAW;YAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAA;QAEvE,OAAO,KAAK,CAAA;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,oCAAoC,CAAC;GAC9B,kCAAkC,CAqC9C;AArCY,gFAAkC"}
@@ -1,4 +1,4 @@
1
- export * from "./RelationshipAttributeHints";
1
+ export * from "./RelationshipAttributeCreationHints";
2
2
  export * from "./RenderHints";
3
3
  export * from "./ValueHints";
4
4
  export * from "./ValueHintsValue";
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./RelationshipAttributeHints"), exports);
17
+ __exportStar(require("./RelationshipAttributeCreationHints"), exports);
18
18
  __exportStar(require("./RenderHints"), exports);
19
19
  __exportStar(require("./ValueHints"), exports);
20
20
  __exportStar(require("./ValueHintsValue"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/attributes/hints/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA4C;AAC5C,gDAA6B;AAC7B,+CAA4B;AAC5B,oDAAiC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/attributes/hints/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uEAAoD;AACpD,gDAA6B;AAC7B,+CAA4B;AAC5B,oDAAiC"}
@@ -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.33",
9
- build: "63",
10
- date: "2022-06-07T13:00:13+00:00",
11
- commit: "5de28c400ead3ef3ca61ca44c7d6063044692350",
8
+ version: "2.0.0-alpha.36",
9
+ build: "66",
10
+ date: "2022-06-14T14:08:36+00:00",
11
+ commit: "c27097cdf65746805563072ab19a3f9c3dbaeea9",
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,KAAK,CAAC,KAAK,CAAC,SAAS,CAAA;QAE5C,IAAI,kBAAkB,KAAK,cAAc,EAAE;YACvC,MAAM,IAAI,2BAAe,CACrB,6BAA2B,CAAC,IAAI,EAChC,GAAG,IAAA,yBAAM,EAA8B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAA,yBAAM,EAC5D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CACrB,EAAE,EACH,6DAA6D,kBAAkB,sDAAsD,cAAc,KAAK,CAC3J,CAAA;SACJ;QAED,IAAI,KAAK,CAAC,SAAS,YAAY,kCAAqB,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,YAAY,uCAA0B,CAAC,EAAE;YAC1G,MAAM,IAAI,2BAAe,CACrB,6BAA2B,CAAC,IAAI,EAChC,EAAE,EACF,yGAAyG,CAC5G,CAAA;SACJ;QAED,IAAI,KAAK,CAAC,SAAS,YAAY,8BAAiB,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,YAAY,mCAAsB,CAAC,EAAE;YAClG,MAAM,IAAI,2BAAe,CACrB,6BAA2B,CAAC,IAAI,EAChC,EAAE,EACF,kGAAkG,CACrG,CAAA;SACJ;QAED,OAAO,KAAK,CAAA;IAChB,CAAC;CACJ,CAAA;AA5CG;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,CA+CvC;AA/CY,kEAA2B"}
@@ -428,7 +428,7 @@ exports.RelationshipAttributeQuery = void 0;
428
428
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
429
429
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
430
430
  const AbstractAttributeQuery_1 = __webpack_require__(/*! ./AbstractAttributeQuery */ "./dist/attributes/AbstractAttributeQuery.js");
431
- const RelationshipAttributeHints_1 = __webpack_require__(/*! ./hints/RelationshipAttributeHints */ "./dist/attributes/hints/RelationshipAttributeHints.js");
431
+ const RelationshipAttributeCreationHints_1 = __webpack_require__(/*! ./hints/RelationshipAttributeCreationHints */ "./dist/attributes/hints/RelationshipAttributeCreationHints.js");
432
432
  let RelationshipAttributeQuery = class RelationshipAttributeQuery extends AbstractAttributeQuery_1.AbstractAttributeQuery {
433
433
  static from(value) {
434
434
  return this.fromAny(value);
@@ -455,7 +455,7 @@ __decorate([
455
455
  __decorate([
456
456
  (0, ts_serval_1.serialize)(),
457
457
  (0, ts_serval_1.validate)(),
458
- __metadata("design:type", RelationshipAttributeHints_1.RelationshipAttributeCreationHints)
458
+ __metadata("design:type", RelationshipAttributeCreationHints_1.RelationshipAttributeCreationHints)
459
459
  ], RelationshipAttributeQuery.prototype, "attributeCreationHints", void 0);
460
460
  RelationshipAttributeQuery = __decorate([
461
461
  (0, ts_serval_1.type)("RelationshipAttributeQuery")
@@ -1395,10 +1395,10 @@ __exportStar(__webpack_require__(/*! ./LanguagesISO639 */ "./dist/attributes/con
1395
1395
 
1396
1396
  /***/ }),
1397
1397
 
1398
- /***/ "./dist/attributes/hints/RelationshipAttributeHints.js":
1399
- /*!*************************************************************!*\
1400
- !*** ./dist/attributes/hints/RelationshipAttributeHints.js ***!
1401
- \*************************************************************/
1398
+ /***/ "./dist/attributes/hints/RelationshipAttributeCreationHints.js":
1399
+ /*!*********************************************************************!*\
1400
+ !*** ./dist/attributes/hints/RelationshipAttributeCreationHints.js ***!
1401
+ \*********************************************************************/
1402
1402
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1403
1403
 
1404
1404
 
@@ -1422,9 +1422,10 @@ const ValueHints_1 = __webpack_require__(/*! ./ValueHints */ "./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);
@@ -1460,10 +1461,10 @@ __decorate([
1460
1461
  __metadata("design:type", String)
1461
1462
  ], RelationshipAttributeCreationHints.prototype, "confidentiality", void 0);
1462
1463
  RelationshipAttributeCreationHints = __decorate([
1463
- (0, ts_serval_1.type)("RelationshipAttributeHints")
1464
+ (0, ts_serval_1.type)("RelationshipAttributeCreationHints")
1464
1465
  ], RelationshipAttributeCreationHints);
1465
1466
  exports.RelationshipAttributeCreationHints = RelationshipAttributeCreationHints;
1466
- //# sourceMappingURL=RelationshipAttributeHints.js.map
1467
+ //# sourceMappingURL=RelationshipAttributeCreationHints.js.map
1467
1468
 
1468
1469
  /***/ }),
1469
1470
 
@@ -1765,7 +1766,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
1765
1766
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1766
1767
  };
1767
1768
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1768
- __exportStar(__webpack_require__(/*! ./RelationshipAttributeHints */ "./dist/attributes/hints/RelationshipAttributeHints.js"), exports);
1769
+ __exportStar(__webpack_require__(/*! ./RelationshipAttributeCreationHints */ "./dist/attributes/hints/RelationshipAttributeCreationHints.js"), exports);
1769
1770
  __exportStar(__webpack_require__(/*! ./RenderHints */ "./dist/attributes/hints/RenderHints.js"), exports);
1770
1771
  __exportStar(__webpack_require__(/*! ./ValueHints */ "./dist/attributes/hints/ValueHints.js"), exports);
1771
1772
  __exportStar(__webpack_require__(/*! ./ValueHintsValue */ "./dist/attributes/hints/ValueHintsValue.js"), exports);
@@ -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.33",
4933
- build: "63",
4934
- date: "2022-06-07T13:00:13+00:00",
4935
- commit: "5de28c400ead3ef3ca61ca44c7d6063044692350",
4933
+ version: "2.0.0-alpha.36",
4934
+ build: "66",
4935
+ date: "2022-06-14T14:08:36+00:00",
4936
+ commit: "c27097cdf65746805563072ab19a3f9c3dbaeea9",
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;