@nmshd/content 2.0.2 → 2.1.0

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.
@@ -4,17 +4,18 @@ export interface ThirdPartyRelationshipAttributeQueryJSON extends AbstractAttrib
4
4
  "@type": "ThirdPartyRelationshipAttributeQuery";
5
5
  key: string;
6
6
  owner: string;
7
- thirdParty: string;
7
+ thirdParty: string[];
8
8
  }
9
9
  export interface IThirdPartyRelationshipAttributeQuery extends IAbstractAttributeQuery {
10
10
  key: string;
11
11
  owner: ICoreAddress;
12
- thirdParty: ICoreAddress;
12
+ thirdParty: ICoreAddress[];
13
13
  }
14
14
  export declare class ThirdPartyRelationshipAttributeQuery extends AbstractAttributeQuery implements IThirdPartyRelationshipAttributeQuery {
15
15
  key: string;
16
16
  owner: CoreAddress;
17
- thirdParty: CoreAddress;
17
+ thirdParty: CoreAddress[];
18
+ protected static preFrom(value: any): any;
18
19
  static from(value: IThirdPartyRelationshipAttributeQuery | Omit<ThirdPartyRelationshipAttributeQueryJSON, "@type">): ThirdPartyRelationshipAttributeQuery;
19
20
  toJSON(verbose?: boolean | undefined, serializeAsString?: boolean | undefined): ThirdPartyRelationshipAttributeQueryJSON;
20
21
  }
@@ -14,6 +14,12 @@ 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
16
  let ThirdPartyRelationshipAttributeQuery = class ThirdPartyRelationshipAttributeQuery extends AbstractAttributeQuery_1.AbstractAttributeQuery {
17
+ static preFrom(value) {
18
+ if (typeof value.thirdParty === "string" || "address" in value.thirdParty) {
19
+ value.thirdParty = [transport_1.CoreAddress.from(value.thirdParty)];
20
+ }
21
+ return value;
22
+ }
17
23
  static from(value) {
18
24
  return this.fromAny(value);
19
25
  }
@@ -32,9 +38,9 @@ __decorate([
32
38
  __metadata("design:type", transport_1.CoreAddress)
33
39
  ], ThirdPartyRelationshipAttributeQuery.prototype, "owner", void 0);
34
40
  __decorate([
35
- (0, ts_serval_1.serialize)(),
36
- (0, ts_serval_1.validate)(),
37
- __metadata("design:type", transport_1.CoreAddress)
41
+ (0, ts_serval_1.serialize)({ type: transport_1.CoreAddress }),
42
+ (0, ts_serval_1.validate)({ customValidator: (v) => (v.length < 1 ? "may not be empty" : undefined) }),
43
+ __metadata("design:type", Array)
38
44
  ], ThirdPartyRelationshipAttributeQuery.prototype, "thirdParty", void 0);
39
45
  ThirdPartyRelationshipAttributeQuery = __decorate([
40
46
  (0, ts_serval_1.type)("ThirdPartyRelationshipAttributeQuery")
@@ -1 +1 @@
1
- {"version":3,"file":"ThirdPartyRelationshipAttributeQuery.js","sourceRoot":"","sources":["../../src/attributes/ThirdPartyRelationshipAttributeQuery.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA8D;AAC9D,gDAA4D;AAC5D,qEAAsH;AAgB/G,IAAM,oCAAoC,GAA1C,MAAM,oCACT,SAAQ,+CAAsB;IAevB,MAAM,CAAC,IAAI,CACd,KAAsG;QAEtG,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;IAEe,MAAM,CAClB,OAA6B,EAC7B,iBAAuC;QAEvC,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,iBAAiB,CAA6C,CAAA;IAC/F,CAAC;CACJ,CAAA;AAxBG;IAAC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;;iEACO;AAElB;IAAC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACG,uBAAW;mEAAA;AAEzB;IAAC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACQ,uBAAW;wEAAA;AAdrB,oCAAoC;IADhD,IAAA,gBAAI,EAAC,sCAAsC,CAAC;GAChC,oCAAoC,CA4BhD;AA5BY,oFAAoC"}
1
+ {"version":3,"file":"ThirdPartyRelationshipAttributeQuery.js","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");
5
5
  const crypto_1 = require("@nmshd/crypto");
6
6
  const transport_1 = require("@nmshd/transport");
7
7
  exports.buildInformation = {
8
- version: "2.0.2",
9
- build: "123",
10
- date: "2022-11-11T12:23:04+00:00",
11
- commit: "b8540ee0d09eb063b9628bfe24bf1ba48822a91e",
8
+ version: "2.1.0",
9
+ build: "124",
10
+ date: "2022-11-15T14:31:09+00:00",
11
+ commit: "a1defd5c5e1594f249643c650d2ac444f564475c",
12
12
  dependencies: {"@js-soft/logging-abstractions":"^1.0.0","easy-tsnameof":"^3.0.6","mocha-param":"^2.0.1"},
13
13
  libraries: {
14
14
  serval: ts_serval_1.buildInformation,
@@ -639,6 +639,12 @@ const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-s
639
639
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
640
640
  const AbstractAttributeQuery_1 = __webpack_require__(/*! ./AbstractAttributeQuery */ "./dist/attributes/AbstractAttributeQuery.js");
641
641
  let ThirdPartyRelationshipAttributeQuery = class ThirdPartyRelationshipAttributeQuery extends AbstractAttributeQuery_1.AbstractAttributeQuery {
642
+ static preFrom(value) {
643
+ if (typeof value.thirdParty === "string" || "address" in value.thirdParty) {
644
+ value.thirdParty = [transport_1.CoreAddress.from(value.thirdParty)];
645
+ }
646
+ return value;
647
+ }
642
648
  static from(value) {
643
649
  return this.fromAny(value);
644
650
  }
@@ -657,9 +663,9 @@ __decorate([
657
663
  __metadata("design:type", transport_1.CoreAddress)
658
664
  ], ThirdPartyRelationshipAttributeQuery.prototype, "owner", void 0);
659
665
  __decorate([
660
- (0, ts_serval_1.serialize)(),
661
- (0, ts_serval_1.validate)(),
662
- __metadata("design:type", transport_1.CoreAddress)
666
+ (0, ts_serval_1.serialize)({ type: transport_1.CoreAddress }),
667
+ (0, ts_serval_1.validate)({ customValidator: (v) => (v.length < 1 ? "may not be empty" : undefined) }),
668
+ __metadata("design:type", Array)
663
669
  ], ThirdPartyRelationshipAttributeQuery.prototype, "thirdParty", void 0);
664
670
  ThirdPartyRelationshipAttributeQuery = __decorate([
665
671
  (0, ts_serval_1.type)("ThirdPartyRelationshipAttributeQuery")
@@ -6001,10 +6007,10 @@ const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-s
6001
6007
  const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
6002
6008
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
6003
6009
  exports.buildInformation = {
6004
- version: "2.0.2",
6005
- build: "123",
6006
- date: "2022-11-11T12:23:04+00:00",
6007
- commit: "b8540ee0d09eb063b9628bfe24bf1ba48822a91e",
6010
+ version: "2.1.0",
6011
+ build: "124",
6012
+ date: "2022-11-15T14:31:09+00:00",
6013
+ commit: "a1defd5c5e1594f249643c650d2ac444f564475c",
6008
6014
  dependencies: {"@js-soft/logging-abstractions":"^1.0.0","easy-tsnameof":"^3.0.6","mocha-param":"^2.0.1"},
6009
6015
  libraries: {
6010
6016
  serval: ts_serval_1.buildInformation,