@nmshd/content 2.0.0-beta.14 → 2.0.0-beta.15
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/attributes/AbstractAttributeQuery.d.ts +0 -3
- package/dist/attributes/AbstractAttributeQuery.js +0 -7
- package/dist/attributes/AbstractAttributeQuery.js.map +1 -1
- package/dist/attributes/IdentityAttributeQuery.d.ts +3 -0
- package/dist/attributes/IdentityAttributeQuery.js +7 -0
- package/dist/attributes/IdentityAttributeQuery.js.map +1 -1
- package/dist/buildInformation.js +4 -4
- package/dist/requests/items/proposeAttribute/ProposeAttributeRequestItem.js +6 -4
- package/dist/requests/items/proposeAttribute/ProposeAttributeRequestItem.js.map +1 -1
- package/lib-web/nmshd.content.js +17 -15
- package/lib-web/nmshd.content.min.js +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { CoreDate, CoreSerializable, ICoreDate, ICoreSerializable } from "@nmshd/transport";
|
|
2
2
|
import { ContentJSON } from "../ContentJSON";
|
|
3
3
|
export interface AbstractAttributeQueryJSON extends ContentJSON {
|
|
4
|
-
valueType: string;
|
|
5
4
|
validFrom?: string;
|
|
6
5
|
validTo?: string;
|
|
7
6
|
}
|
|
8
7
|
export interface IAbstractAttributeQuery extends ICoreSerializable {
|
|
9
|
-
valueType: string;
|
|
10
8
|
validFrom?: ICoreDate;
|
|
11
9
|
validTo?: ICoreDate;
|
|
12
10
|
}
|
|
13
11
|
export declare abstract class AbstractAttributeQuery extends CoreSerializable implements IAbstractAttributeQuery {
|
|
14
|
-
valueType: string;
|
|
15
12
|
validFrom?: CoreDate;
|
|
16
13
|
validTo?: CoreDate;
|
|
17
14
|
}
|
|
@@ -14,13 +14,6 @@ const ts_serval_1 = require("@js-soft/ts-serval");
|
|
|
14
14
|
const transport_1 = require("@nmshd/transport");
|
|
15
15
|
class AbstractAttributeQuery extends transport_1.CoreSerializable {
|
|
16
16
|
}
|
|
17
|
-
__decorate([
|
|
18
|
-
(0, ts_serval_1.serialize)(),
|
|
19
|
-
(0, ts_serval_1.validate)({
|
|
20
|
-
customValidator: (v) => (v === "" ? "must not be an empty string" : undefined)
|
|
21
|
-
}),
|
|
22
|
-
__metadata("design:type", String)
|
|
23
|
-
], AbstractAttributeQuery.prototype, "valueType", void 0);
|
|
24
17
|
__decorate([
|
|
25
18
|
(0, ts_serval_1.serialize)(),
|
|
26
19
|
(0, ts_serval_1.validate)({ nullable: true }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractAttributeQuery.js","sourceRoot":"","sources":["../../src/attributes/AbstractAttributeQuery.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAwD;AACxD,gDAA2F;
|
|
1
|
+
{"version":3,"file":"AbstractAttributeQuery.js","sourceRoot":"","sources":["../../src/attributes/AbstractAttributeQuery.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAwD;AACxD,gDAA2F;AAa3F,MAAsB,sBAAuB,SAAQ,4BAAgB;CAQpE;AALG;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACV,oBAAQ;yDAAA;AAI3B;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACZ,oBAAQ;uDAAA;AAP7B,wDAQC"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { AbstractAttributeQuery, AbstractAttributeQueryJSON, IAbstractAttributeQuery } from "./AbstractAttributeQuery";
|
|
2
2
|
export interface IdentityAttributeQueryJSON extends AbstractAttributeQueryJSON {
|
|
3
|
+
valueType: string;
|
|
3
4
|
tags?: string[];
|
|
4
5
|
}
|
|
5
6
|
export interface IIdentityAttributeQuery extends IAbstractAttributeQuery {
|
|
7
|
+
valueType: string;
|
|
6
8
|
tags?: string[];
|
|
7
9
|
}
|
|
8
10
|
export declare class IdentityAttributeQuery extends AbstractAttributeQuery implements IIdentityAttributeQuery {
|
|
11
|
+
valueType: string;
|
|
9
12
|
tags?: string[];
|
|
10
13
|
static from(value: IIdentityAttributeQuery | IdentityAttributeQueryJSON): IdentityAttributeQuery;
|
|
11
14
|
toJSON(): IdentityAttributeQueryJSON;
|
|
@@ -20,6 +20,13 @@ let IdentityAttributeQuery = class IdentityAttributeQuery extends AbstractAttrib
|
|
|
20
20
|
return super.toJSON();
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, ts_serval_1.serialize)(),
|
|
25
|
+
(0, ts_serval_1.validate)({
|
|
26
|
+
customValidator: (v) => (v === "" ? "must not be an empty string" : undefined)
|
|
27
|
+
}),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], IdentityAttributeQuery.prototype, "valueType", void 0);
|
|
23
30
|
__decorate([
|
|
24
31
|
(0, ts_serval_1.serialize)({ type: String }),
|
|
25
32
|
(0, ts_serval_1.validate)({ nullable: true }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityAttributeQuery.js","sourceRoot":"","sources":["../../src/attributes/IdentityAttributeQuery.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA8D;AAC9D,qEAAsH;
|
|
1
|
+
{"version":3,"file":"IdentityAttributeQuery.js","sourceRoot":"","sources":["../../src/attributes/IdentityAttributeQuery.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA8D;AAC9D,qEAAsH;AAatH,IAAa,sBAAsB,GAAnC,MAAa,sBAAuB,SAAQ,+CAAsB;IAWvD,MAAM,CAAC,IAAI,CAAC,KAA2D;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;IAEe,MAAM;QAClB,OAAO,KAAK,CAAC,MAAM,EAAgC,CAAA;IACvD,CAAC;CACJ,CAAA;AAbG;IAJC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,EAAC;QACN,eAAe,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,SAAS,CAAC;KACjF,CAAC;;yDACsB;AAIxB;IAFC,IAAA,qBAAS,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC3B,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACP;AATb,sBAAsB;IADlC,IAAA,gBAAI,EAAC,wBAAwB,CAAC;GAClB,sBAAsB,CAkBlC;AAlBY,wDAAsB"}
|
package/dist/buildInformation.js
CHANGED
|
@@ -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-beta.
|
|
9
|
-
build: "
|
|
10
|
-
date: "2022-09-05T12:
|
|
11
|
-
commit: "
|
|
8
|
+
version: "2.0.0-beta.15",
|
|
9
|
+
build: "92",
|
|
10
|
+
date: "2022-09-05T12:26:50+00:00",
|
|
11
|
+
commit: "d60c4f189ed63e91afbeaedfae5e93509d1195ba",
|
|
12
12
|
dependencies: {"@js-soft/logging-abstractions":"^1.0.0","easy-tsnameof":"^3.0.6"},
|
|
13
13
|
libraries: {
|
|
14
14
|
serval: ts_serval_1.buildInformation,
|
|
@@ -22,10 +22,12 @@ let ProposeAttributeRequestItem = ProposeAttributeRequestItem_1 = class ProposeA
|
|
|
22
22
|
static postFrom(value) {
|
|
23
23
|
if (!(value instanceof ProposeAttributeRequestItem_1))
|
|
24
24
|
throw new Error("this should never happen");
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
if (value.query instanceof attributes_1.IdentityAttributeQuery) {
|
|
26
|
+
const attributeValueType = value.attribute.value.toJSON()["@type"];
|
|
27
|
+
const queryValueType = value.query.valueType;
|
|
28
|
+
if (attributeValueType !== queryValueType) {
|
|
29
|
+
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}').`);
|
|
30
|
+
}
|
|
29
31
|
}
|
|
30
32
|
if (value.attribute instanceof attributes_1.RelationshipAttribute && !(value.query instanceof attributes_1.RelationshipAttributeQuery)) {
|
|
31
33
|
throw new ts_serval_1.ValidationError(ProposeAttributeRequestItem_1.name, "", "When proposing a RelationshipAttribute, the corresponding query has to be a RelationshipAttributeQuery.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProposeAttributeRequestItem.js","sourceRoot":"","sources":["../../../../src/requests/items/proposeAttribute/ProposeAttributeRequestItem.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAA6F;AAC7F,uDAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"ProposeAttributeRequestItem.js","sourceRoot":"","sources":["../../../../src/requests/items/proposeAttribute/ProposeAttributeRequestItem.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAA6F;AAC7F,uDAAyC;AACzC,oDAa4B;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,IAAI,KAAK,CAAC,KAAK,YAAY,mCAAsB,EAAE;YAC/C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,gBAAI,EAAC,6BAA6B,CAAC;GACvB,2BAA2B,CAiDvC;AAjDY,kEAA2B"}
|
package/lib-web/nmshd.content.js
CHANGED
|
@@ -79,13 +79,6 @@ const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-s
|
|
|
79
79
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
80
80
|
class AbstractAttributeQuery extends transport_1.CoreSerializable {
|
|
81
81
|
}
|
|
82
|
-
__decorate([
|
|
83
|
-
(0, ts_serval_1.serialize)(),
|
|
84
|
-
(0, ts_serval_1.validate)({
|
|
85
|
-
customValidator: (v) => (v === "" ? "must not be an empty string" : undefined)
|
|
86
|
-
}),
|
|
87
|
-
__metadata("design:type", String)
|
|
88
|
-
], AbstractAttributeQuery.prototype, "valueType", void 0);
|
|
89
82
|
__decorate([
|
|
90
83
|
(0, ts_serval_1.serialize)(),
|
|
91
84
|
(0, ts_serval_1.validate)({ nullable: true }),
|
|
@@ -304,6 +297,13 @@ let IdentityAttributeQuery = class IdentityAttributeQuery extends AbstractAttrib
|
|
|
304
297
|
return super.toJSON();
|
|
305
298
|
}
|
|
306
299
|
};
|
|
300
|
+
__decorate([
|
|
301
|
+
(0, ts_serval_1.serialize)(),
|
|
302
|
+
(0, ts_serval_1.validate)({
|
|
303
|
+
customValidator: (v) => (v === "" ? "must not be an empty string" : undefined)
|
|
304
|
+
}),
|
|
305
|
+
__metadata("design:type", String)
|
|
306
|
+
], IdentityAttributeQuery.prototype, "valueType", void 0);
|
|
307
307
|
__decorate([
|
|
308
308
|
(0, ts_serval_1.serialize)({ type: String }),
|
|
309
309
|
(0, ts_serval_1.validate)({ nullable: true }),
|
|
@@ -5487,10 +5487,10 @@ const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-s
|
|
|
5487
5487
|
const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
|
|
5488
5488
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
5489
5489
|
exports.buildInformation = {
|
|
5490
|
-
version: "2.0.0-beta.
|
|
5491
|
-
build: "
|
|
5492
|
-
date: "2022-09-05T12:
|
|
5493
|
-
commit: "
|
|
5490
|
+
version: "2.0.0-beta.15",
|
|
5491
|
+
build: "92",
|
|
5492
|
+
date: "2022-09-05T12:26:50+00:00",
|
|
5493
|
+
commit: "d60c4f189ed63e91afbeaedfae5e93509d1195ba",
|
|
5494
5494
|
dependencies: {"@js-soft/logging-abstractions":"^1.0.0","easy-tsnameof":"^3.0.6"},
|
|
5495
5495
|
libraries: {
|
|
5496
5496
|
serval: ts_serval_1.buildInformation,
|
|
@@ -6685,10 +6685,12 @@ let ProposeAttributeRequestItem = ProposeAttributeRequestItem_1 = class ProposeA
|
|
|
6685
6685
|
static postFrom(value) {
|
|
6686
6686
|
if (!(value instanceof ProposeAttributeRequestItem_1))
|
|
6687
6687
|
throw new Error("this should never happen");
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6688
|
+
if (value.query instanceof attributes_1.IdentityAttributeQuery) {
|
|
6689
|
+
const attributeValueType = value.attribute.value.toJSON()["@type"];
|
|
6690
|
+
const queryValueType = value.query.valueType;
|
|
6691
|
+
if (attributeValueType !== queryValueType) {
|
|
6692
|
+
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}').`);
|
|
6693
|
+
}
|
|
6692
6694
|
}
|
|
6693
6695
|
if (value.attribute instanceof attributes_1.RelationshipAttribute && !(value.query instanceof attributes_1.RelationshipAttributeQuery)) {
|
|
6694
6696
|
throw new ts_serval_1.ValidationError(ProposeAttributeRequestItem_1.name, "", "When proposing a RelationshipAttribute, the corresponding query has to be a RelationshipAttributeQuery.");
|