@nmshd/consumption 2.0.0-alpha.11 → 2.0.0-alpha.14
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/buildInformation.js +4 -4
- package/dist/consumption/ConsumptionErrors.d.ts +2 -1
- package/dist/consumption/ConsumptionErrors.js +5 -2
- package/dist/consumption/ConsumptionErrors.js.map +1 -1
- package/dist/modules/attributes/ConsumptionAttributesController.d.ts +14 -10
- package/dist/modules/attributes/ConsumptionAttributesController.js +77 -58
- package/dist/modules/attributes/ConsumptionAttributesController.js.map +1 -1
- package/dist/modules/attributes/CreateConsumptionAttributeParams.d.ts +9 -0
- package/dist/modules/attributes/CreateConsumptionAttributeParams.js +26 -0
- package/dist/modules/attributes/CreateConsumptionAttributeParams.js.map +1 -0
- package/dist/modules/attributes/CreatePeerConsumptionAttributeParams.d.ts +16 -0
- package/dist/modules/attributes/CreatePeerConsumptionAttributeParams.js +42 -0
- package/dist/modules/attributes/CreatePeerConsumptionAttributeParams.js.map +1 -0
- package/dist/modules/attributes/CreateSharedConsumptionAttributeCopyParams.d.ts +13 -0
- package/dist/modules/attributes/CreateSharedConsumptionAttributeCopyParams.js +36 -0
- package/dist/modules/attributes/CreateSharedConsumptionAttributeCopyParams.js.map +1 -0
- package/dist/modules/attributes/SuccedConsumptionAttributeParams.d.ts +12 -0
- package/dist/modules/attributes/SuccedConsumptionAttributeParams.js +32 -0
- package/dist/modules/attributes/SuccedConsumptionAttributeParams.js.map +1 -0
- package/dist/modules/attributes/UpdateConsumptionAttributeParams.d.ts +12 -0
- package/dist/modules/attributes/UpdateConsumptionAttributeParams.js +32 -0
- package/dist/modules/attributes/UpdateConsumptionAttributeParams.js.map +1 -0
- package/dist/modules/attributes/local/ConsumptionAttribute.d.ts +19 -10
- package/dist/modules/attributes/local/ConsumptionAttribute.js +20 -14
- package/dist/modules/attributes/local/ConsumptionAttribute.js.map +1 -1
- package/dist/modules/attributes/local/ConsumptionAttributeShareInfo.d.ts +17 -0
- package/dist/modules/attributes/local/ConsumptionAttributeShareInfo.js +36 -0
- package/dist/modules/attributes/local/ConsumptionAttributeShareInfo.js.map +1 -0
- package/dist/modules/index.d.ts +4 -0
- package/dist/modules/index.js +4 -0
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/requests/outgoing/OutgoingRequestsController.js +13 -3
- package/dist/modules/requests/outgoing/OutgoingRequestsController.js.map +1 -1
- package/lib-web/nmshd.consumption.js +349 -85
- package/lib-web/nmshd.consumption.js.map +1 -1
- package/lib-web/nmshd.consumption.min.js +1 -1
- package/lib-web/nmshd.consumption.min.js.map +1 -1
- package/package.json +3 -3
package/dist/buildInformation.js
CHANGED
|
@@ -6,10 +6,10 @@ const content_1 = require("@nmshd/content");
|
|
|
6
6
|
const crypto_1 = require("@nmshd/crypto");
|
|
7
7
|
const transport_1 = require("@nmshd/transport");
|
|
8
8
|
exports.buildInformation = {
|
|
9
|
-
version: "2.0.0-alpha.
|
|
10
|
-
build: "
|
|
11
|
-
date: "2022-05-
|
|
12
|
-
commit: "
|
|
9
|
+
version: "2.0.0-alpha.14",
|
|
10
|
+
build: "32",
|
|
11
|
+
date: "2022-05-18T13:56:33+00:00",
|
|
12
|
+
commit: "6e1e22cfd79e7f43c9143c4ae5b2db57b0f4a92b",
|
|
13
13
|
dependencies: {},
|
|
14
14
|
libraries: {
|
|
15
15
|
transport: transport_1.buildInformation,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CoreError } from "@nmshd/transport";
|
|
2
2
|
declare class Attributes {
|
|
3
|
-
attributeExists(
|
|
3
|
+
attributeExists(id: string): CoreError;
|
|
4
|
+
predecessorNotFound(id: string): CoreError;
|
|
4
5
|
}
|
|
5
6
|
declare class Requests {
|
|
6
7
|
requestsExists(id: string): CoreError;
|
|
@@ -3,8 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ConsumptionErrors = void 0;
|
|
4
4
|
const transport_1 = require("@nmshd/transport");
|
|
5
5
|
class Attributes {
|
|
6
|
-
attributeExists(
|
|
7
|
-
return new transport_1.CoreError("error.consumption.attributes.attributeExists", `Attribute with
|
|
6
|
+
attributeExists(id) {
|
|
7
|
+
return new transport_1.CoreError("error.consumption.attributes.attributeExists", `Attribute with id '${id}' already exists. Please use succeed instead.`);
|
|
8
|
+
}
|
|
9
|
+
predecessorNotFound(id) {
|
|
10
|
+
return new transport_1.CoreError("error.consumption.attributes.predecessorNotFound", `Attribute with id '${id}' does not exist. Please use create instead.`);
|
|
8
11
|
}
|
|
9
12
|
}
|
|
10
13
|
class Requests {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsumptionErrors.js","sourceRoot":"","sources":["../../src/consumption/ConsumptionErrors.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C,MAAM,UAAU;IACL,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"ConsumptionErrors.js","sourceRoot":"","sources":["../../src/consumption/ConsumptionErrors.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C,MAAM,UAAU;IACL,eAAe,CAAC,EAAU;QAC7B,OAAO,IAAI,qBAAS,CAChB,8CAA8C,EAC9C,sBAAsB,EAAE,+CAA+C,CAC1E,CAAA;IACL,CAAC;IACM,mBAAmB,CAAC,EAAU;QACjC,OAAO,IAAI,qBAAS,CAChB,kDAAkD,EAClD,sBAAsB,EAAE,8CAA8C,CACzE,CAAA;IACL,CAAC;CACJ;AAED,MAAM,QAAQ;IACH,cAAc,CAAC,EAAU;QAC5B,OAAO,IAAI,qBAAS,CAChB,0CAA0C,EAC1C,mBAAmB,EAAE,uCAAuC,CAC/D,CAAA;IACL,CAAC;CACJ;AAED,MAAM,gBAAgB;IACX,sBAAsB,CAAC,cAAsB;QAChD,OAAO,IAAI,qBAAS,CAChB,4DAA4D,EAC5D,qCAAqC,cAAc,kBAAkB,CACxE,CAAA;IACL,CAAC;CACJ;AAED,MAAM,UAAU;IACL,eAAe,CAAC,aAAqB;QACxC,OAAO,IAAI,qBAAS,CAChB,8CAA8C,EAC9C,0BAA0B,aAAa,qCAAqC,CAC/E,CAAA;IACL,CAAC;IAEM,aAAa;QAChB,OAAO,IAAI,qBAAS,CAAC,4CAA4C,EAAE,4CAA4C,CAAC,CAAA;IACpH,CAAC;CACJ;AAED,MAAa,iBAAiB;;AAA9B,8CAKC;AAJiB,4BAAU,GAAG,IAAI,UAAU,EAAE,CAAA;AAC7B,0BAAQ,GAAG,IAAI,QAAQ,EAAE,CAAA;AACzB,kCAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAA;AACzC,4BAAU,GAAG,IAAI,UAAU,EAAE,CAAA"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CoreId } from "@nmshd/transport";
|
|
2
2
|
import { ConsumptionBaseController } from "../../consumption";
|
|
3
3
|
import { ConsumptionController } from "../../consumption/ConsumptionController";
|
|
4
|
+
import { ICreateConsumptionAttributeParams } from "./CreateConsumptionAttributeParams";
|
|
5
|
+
import { ICreatePeerConsumptionAttributeParams } from "./CreatePeerConsumptionAttributeParams";
|
|
6
|
+
import { ICreateSharedConsumptionAttributeCopyParams } from "./CreateSharedConsumptionAttributeCopyParams";
|
|
4
7
|
import { ConsumptionAttribute } from "./local/ConsumptionAttribute";
|
|
8
|
+
import { ISucceedConsumptionAttributeParams } from "./SuccedConsumptionAttributeParams";
|
|
9
|
+
import { IUpdateConsumptionAttributeParams } from "./UpdateConsumptionAttributeParams";
|
|
5
10
|
export declare class ConsumptionAttributesController extends ConsumptionBaseController {
|
|
6
11
|
private attributes;
|
|
7
12
|
constructor(parent: ConsumptionController);
|
|
@@ -9,14 +14,13 @@ export declare class ConsumptionAttributesController extends ConsumptionBaseCont
|
|
|
9
14
|
checkValid(attribute: ConsumptionAttribute): boolean;
|
|
10
15
|
findCurrent(attributes: ConsumptionAttribute[]): ConsumptionAttribute | undefined;
|
|
11
16
|
filterCurrent(attributes: ConsumptionAttribute[]): ConsumptionAttribute[];
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
updateAttribute(attribute: ConsumptionAttribute): Promise<ConsumptionAttribute>;
|
|
17
|
+
getConsumptionAttribute(id: CoreId): Promise<ConsumptionAttribute | undefined>;
|
|
18
|
+
getConsumptionAttributes(query?: any): Promise<ConsumptionAttribute[]>;
|
|
19
|
+
getValidConsumptionAttributes(query?: any): Promise<ConsumptionAttribute[]>;
|
|
20
|
+
createConsumptionAttribute(params: ICreateConsumptionAttributeParams): Promise<ConsumptionAttribute>;
|
|
21
|
+
succeedConsumptionAttribute(params: ISucceedConsumptionAttributeParams): Promise<ConsumptionAttribute>;
|
|
22
|
+
createSharedConsumptionAttributeCopy(params: ICreateSharedConsumptionAttributeCopyParams): Promise<ConsumptionAttribute>;
|
|
23
|
+
createPeerConsumptionAttribute(params: ICreatePeerConsumptionAttributeParams): Promise<ConsumptionAttribute>;
|
|
24
|
+
updateConsumptionAttribute(params: IUpdateConsumptionAttributeParams): Promise<ConsumptionAttribute>;
|
|
21
25
|
deleteAttribute(attribute: ConsumptionAttribute): Promise<void>;
|
|
22
26
|
}
|
|
@@ -4,7 +4,10 @@ exports.ConsumptionAttributesController = void 0;
|
|
|
4
4
|
const transport_1 = require("@nmshd/transport");
|
|
5
5
|
const ts_simple_nameof_1 = require("ts-simple-nameof");
|
|
6
6
|
const consumption_1 = require("../../consumption");
|
|
7
|
+
const CreateSharedConsumptionAttributeCopyParams_1 = require("./CreateSharedConsumptionAttributeCopyParams");
|
|
7
8
|
const ConsumptionAttribute_1 = require("./local/ConsumptionAttribute");
|
|
9
|
+
const ConsumptionAttributeShareInfo_1 = require("./local/ConsumptionAttributeShareInfo");
|
|
10
|
+
const SuccedConsumptionAttributeParams_1 = require("./SuccedConsumptionAttributeParams");
|
|
8
11
|
class ConsumptionAttributesController extends consumption_1.ConsumptionBaseController {
|
|
9
12
|
constructor(parent) {
|
|
10
13
|
super(consumption_1.ConsumptionControllerName.ConsumptionAttributesController, parent);
|
|
@@ -26,13 +29,13 @@ class ConsumptionAttributesController extends consumption_1.ConsumptionBaseContr
|
|
|
26
29
|
}
|
|
27
30
|
else if (!attribute.content.validFrom &&
|
|
28
31
|
attribute.content.validTo &&
|
|
29
|
-
attribute.content.validTo.
|
|
32
|
+
attribute.content.validTo.isSameOrAfter(now)) {
|
|
30
33
|
return true;
|
|
31
34
|
}
|
|
32
35
|
else if (attribute.content.validFrom &&
|
|
33
36
|
attribute.content.validTo &&
|
|
34
37
|
attribute.content.validFrom.isSameOrBefore(now) &&
|
|
35
|
-
attribute.content.validTo.
|
|
38
|
+
attribute.content.validTo.isSameOrAfter(now)) {
|
|
36
39
|
return true;
|
|
37
40
|
}
|
|
38
41
|
return false;
|
|
@@ -61,77 +64,93 @@ class ConsumptionAttributesController extends consumption_1.ConsumptionBaseContr
|
|
|
61
64
|
}
|
|
62
65
|
return items;
|
|
63
66
|
}
|
|
64
|
-
async
|
|
65
|
-
const result = await this.attributes.
|
|
67
|
+
async getConsumptionAttribute(id) {
|
|
68
|
+
const result = await this.attributes.findOne({
|
|
66
69
|
[(0, ts_simple_nameof_1.nameof)((c) => c.id)]: id.toString()
|
|
67
70
|
});
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
if (!result)
|
|
72
|
+
return;
|
|
73
|
+
return ConsumptionAttribute_1.ConsumptionAttribute.from(result);
|
|
70
74
|
}
|
|
71
|
-
async
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
});
|
|
75
|
-
const attributes = await this.parseArray(result, ConsumptionAttribute_1.ConsumptionAttribute);
|
|
76
|
-
return this.findCurrent(attributes);
|
|
75
|
+
async getConsumptionAttributes(query) {
|
|
76
|
+
const attributes = await this.attributes.find(query);
|
|
77
|
+
return await this.parseArray(attributes, ConsumptionAttribute_1.ConsumptionAttribute);
|
|
77
78
|
}
|
|
78
|
-
async
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
});
|
|
82
|
-
const attributes = await this.parseArray(result, ConsumptionAttribute_1.ConsumptionAttribute);
|
|
83
|
-
const sorted = attributes.sort((a, b) => {
|
|
84
|
-
return a.createdAt.compare(b.createdAt);
|
|
85
|
-
});
|
|
86
|
-
return sorted;
|
|
87
|
-
}
|
|
88
|
-
async getAttributes(query) {
|
|
89
|
-
const items = await this.attributes.find(query);
|
|
90
|
-
return await this.parseArray(items, ConsumptionAttribute_1.ConsumptionAttribute);
|
|
91
|
-
}
|
|
92
|
-
async getValidAttributes(query) {
|
|
93
|
-
const docs = await this.attributes.find(query);
|
|
94
|
-
const items = await this.parseArray(docs, ConsumptionAttribute_1.ConsumptionAttribute);
|
|
79
|
+
async getValidConsumptionAttributes(query) {
|
|
80
|
+
const attributes = await this.attributes.find(query);
|
|
81
|
+
const items = await this.parseArray(attributes, ConsumptionAttribute_1.ConsumptionAttribute);
|
|
95
82
|
return this.filterCurrent(items);
|
|
96
83
|
}
|
|
97
|
-
async
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return result;
|
|
102
|
-
};
|
|
103
|
-
return attributes.reduce(mapper, {});
|
|
84
|
+
async createConsumptionAttribute(params) {
|
|
85
|
+
const consumptionAttribute = await ConsumptionAttribute_1.ConsumptionAttribute.fromAttribute(params.content);
|
|
86
|
+
await this.attributes.create(consumptionAttribute);
|
|
87
|
+
return consumptionAttribute;
|
|
104
88
|
}
|
|
105
|
-
async
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
89
|
+
async succeedConsumptionAttribute(params) {
|
|
90
|
+
const parsedParams = SuccedConsumptionAttributeParams_1.SucceedConsumptionAttributeParams.from(params);
|
|
91
|
+
const current = await this.attributes.findOne({
|
|
92
|
+
[(0, ts_simple_nameof_1.nameof)((c) => c.id)]: params.succeeds.toString()
|
|
93
|
+
});
|
|
94
|
+
if (!current) {
|
|
95
|
+
throw consumption_1.ConsumptionErrors.attributes.predecessorNotFound(parsedParams.succeeds.toString());
|
|
109
96
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
async succeedAttribute(attribute, validFrom) {
|
|
114
|
-
const current = await this.getAttributeByName(attribute.content.name);
|
|
115
|
-
if (current && !validFrom) {
|
|
116
|
-
validFrom = transport_1.CoreDate.utc();
|
|
97
|
+
if (!parsedParams.successorContent.validFrom) {
|
|
98
|
+
parsedParams.successorContent.validFrom = transport_1.CoreDate.utc();
|
|
117
99
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
100
|
+
const validFrom = parsedParams.successorContent.validFrom;
|
|
101
|
+
const currentUpdated = ConsumptionAttribute_1.ConsumptionAttribute.from(current);
|
|
102
|
+
currentUpdated.content.validTo = validFrom.subtract(1);
|
|
103
|
+
await this.attributes.update(current, currentUpdated);
|
|
104
|
+
const successor = await ConsumptionAttribute_1.ConsumptionAttribute.fromAttribute(parsedParams.successorContent, parsedParams.succeeds);
|
|
105
|
+
await this.attributes.create(successor);
|
|
106
|
+
return successor;
|
|
107
|
+
}
|
|
108
|
+
async createSharedConsumptionAttributeCopy(params) {
|
|
109
|
+
const parsedParams = CreateSharedConsumptionAttributeCopyParams_1.CreateSharedConsumptionAttributeCopyParams.from(params);
|
|
110
|
+
const sourceAttribute = await this.getConsumptionAttribute(parsedParams.attributeId);
|
|
111
|
+
if (!sourceAttribute) {
|
|
112
|
+
throw consumption_1.ConsumptionErrors.attributes.predecessorNotFound(parsedParams.attributeId.toString());
|
|
122
113
|
}
|
|
123
|
-
|
|
124
|
-
|
|
114
|
+
const shareInfo = ConsumptionAttributeShareInfo_1.ConsumptionAttributeShareInfo.from({
|
|
115
|
+
peer: parsedParams.peer,
|
|
116
|
+
requestReference: parsedParams.requestReference,
|
|
117
|
+
sourceAttribute: parsedParams.attributeId
|
|
118
|
+
});
|
|
119
|
+
const sharedConsumptionAttributeCopy = await ConsumptionAttribute_1.ConsumptionAttribute.fromAttribute(sourceAttribute.content, undefined, shareInfo);
|
|
120
|
+
await this.attributes.create(sharedConsumptionAttributeCopy);
|
|
121
|
+
return sharedConsumptionAttributeCopy;
|
|
125
122
|
}
|
|
126
|
-
async
|
|
123
|
+
async createPeerConsumptionAttribute(params) {
|
|
124
|
+
const shareInfo = ConsumptionAttributeShareInfo_1.ConsumptionAttributeShareInfo.from({
|
|
125
|
+
peer: params.peer,
|
|
126
|
+
requestReference: params.requestReference
|
|
127
|
+
});
|
|
128
|
+
const peerConsumptionAttribute = ConsumptionAttribute_1.ConsumptionAttribute.from({
|
|
129
|
+
id: params.id,
|
|
130
|
+
content: params.content,
|
|
131
|
+
shareInfo: shareInfo,
|
|
132
|
+
createdAt: transport_1.CoreDate.utc()
|
|
133
|
+
});
|
|
134
|
+
await this.attributes.create(peerConsumptionAttribute);
|
|
135
|
+
return peerConsumptionAttribute;
|
|
136
|
+
}
|
|
137
|
+
async updateConsumptionAttribute(params) {
|
|
127
138
|
const current = await this.attributes.findOne({
|
|
128
|
-
[(0, ts_simple_nameof_1.nameof)((c) => c.id)]:
|
|
139
|
+
[(0, ts_simple_nameof_1.nameof)((c) => c.id)]: params.id.toString()
|
|
129
140
|
});
|
|
130
141
|
if (!current) {
|
|
131
|
-
throw transport_1.TransportErrors.general.recordNotFound(ConsumptionAttribute_1.ConsumptionAttribute,
|
|
142
|
+
throw transport_1.TransportErrors.general.recordNotFound(ConsumptionAttribute_1.ConsumptionAttribute, params.id.toString());
|
|
132
143
|
}
|
|
133
|
-
|
|
134
|
-
|
|
144
|
+
const updatedConsumptionAttribute = ConsumptionAttribute_1.ConsumptionAttribute.from({
|
|
145
|
+
id: current.id,
|
|
146
|
+
content: params.content,
|
|
147
|
+
createdAt: current.createdAt,
|
|
148
|
+
shareInfo: current.shareInfo,
|
|
149
|
+
succeededBy: current.succeededBy,
|
|
150
|
+
succeeds: current.succeeds
|
|
151
|
+
});
|
|
152
|
+
await this.attributes.update(current, updatedConsumptionAttribute);
|
|
153
|
+
return updatedConsumptionAttribute;
|
|
135
154
|
}
|
|
136
155
|
async deleteAttribute(attribute) {
|
|
137
156
|
await this.attributes.delete(attribute);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsumptionAttributesController.js","sourceRoot":"","sources":["../../../src/modules/attributes/ConsumptionAttributesController.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ConsumptionAttributesController.js","sourceRoot":"","sources":["../../../src/modules/attributes/ConsumptionAttributesController.ts"],"names":[],"mappings":";;;AAAA,gDAA4F;AAC5F,uDAAyC;AACzC,mDAA2G;AAI3G,6GAGqD;AACrD,uEAAmE;AACnE,yFAAqF;AACrF,yFAG2C;AAG3C,MAAa,+BAAgC,SAAQ,uCAAyB;IAG1E,YAAmB,MAA6B;QAC5C,KAAK,CAAC,uCAAyB,CAAC,+BAA+B,EAAE,MAAM,CAAC,CAAA;IAC5E,CAAC;IAEe,KAAK,CAAC,IAAI;QACtB,MAAM,KAAK,CAAC,IAAI,EAAE,CAAA;QAElB,IAAI,CAAC,UAAU,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,yBAAyB,CAAC,YAAY,CAAC,CAAA;QAE7F,OAAO,IAAI,CAAA;IACf,CAAC;IAEM,UAAU,CAAC,SAA+B;QAC7C,MAAM,GAAG,GAAG,oBAAQ,CAAC,GAAG,EAAE,CAAA;QAC1B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE;YAC5D,OAAO,IAAI,CAAA;SACd;aAAM,IACH,SAAS,CAAC,OAAO,CAAC,SAAS;YAC3B,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO;YAC1B,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,EACjD;YACE,OAAO,IAAI,CAAA;SACd;aAAM,IACH,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS;YA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EAAE,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE;SACpE,CAAC,CAAA;QACF,IAAI,CAAC,OAAO,EAAE;YACV,MAAM,2BAAe,CAAC,OAAO,CAAC,cAAc,CAAC,2CAAoB,EAAE,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;SAC3F;QACD,MAAM,2BAA2B,GAAG,2CAAoB,CAAC,IAAI,CAAC;YAC1D,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC7B,CAAC,CAAA;QACF,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,2BAA2B,CAAC,CAAA;QAClE,OAAO,2BAA2B,CAAA;IACtC,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,SAA+B;QACxD,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IAC3C,CAAC;CACJ;AApLD,0EAoLC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ISerializable, Serializable } from "@js-soft/ts-serval";
|
|
2
|
+
import { IdentityAttribute, IIdentityAttribute, IRelationshipAttribute, RelationshipAttribute } from "@nmshd/content";
|
|
3
|
+
export interface ICreateConsumptionAttributeParams extends ISerializable {
|
|
4
|
+
content: IIdentityAttribute | IRelationshipAttribute;
|
|
5
|
+
}
|
|
6
|
+
export declare class CreateConsumptionAttributeParams extends Serializable implements ICreateConsumptionAttributeParams {
|
|
7
|
+
content: IdentityAttribute | RelationshipAttribute;
|
|
8
|
+
static from(value: ICreateConsumptionAttributeParams): CreateConsumptionAttributeParams;
|
|
9
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CreateConsumptionAttributeParams = void 0;
|
|
13
|
+
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
14
|
+
const content_1 = require("@nmshd/content");
|
|
15
|
+
class CreateConsumptionAttributeParams extends ts_serval_1.Serializable {
|
|
16
|
+
static from(value) {
|
|
17
|
+
return this.fromAny(value);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, ts_serval_1.serialize)({ unionTypes: [content_1.IdentityAttribute, content_1.RelationshipAttribute] }),
|
|
22
|
+
(0, ts_serval_1.validate)(),
|
|
23
|
+
__metadata("design:type", Object)
|
|
24
|
+
], CreateConsumptionAttributeParams.prototype, "content", void 0);
|
|
25
|
+
exports.CreateConsumptionAttributeParams = CreateConsumptionAttributeParams;
|
|
26
|
+
//# sourceMappingURL=CreateConsumptionAttributeParams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateConsumptionAttributeParams.js","sourceRoot":"","sources":["../../../src/modules/attributes/CreateConsumptionAttributeParams.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAqF;AACrF,4CAAqH;AAMrH,MAAa,gCAAiC,SAAQ,wBAAY;IAKvD,MAAM,CAAC,IAAI,CAAC,KAAwC;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;CACJ;AALG;IAFC,IAAA,qBAAS,EAAC,EAAE,UAAU,EAAE,CAAC,2BAAiB,EAAE,+BAAqB,CAAC,EAAE,CAAC;IACrE,IAAA,oBAAQ,GAAE;;iEAC8C;AAH7D,4EAQC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ISerializable, Serializable } from "@js-soft/ts-serval";
|
|
2
|
+
import { IdentityAttribute, IIdentityAttribute, IRelationshipAttribute, RelationshipAttribute } from "@nmshd/content";
|
|
3
|
+
import { CoreAddress, CoreId, ICoreAddress, ICoreId } from "@nmshd/transport";
|
|
4
|
+
export interface ICreatePeerConsumptionAttributeParams extends ISerializable {
|
|
5
|
+
id: ICoreId;
|
|
6
|
+
content: IIdentityAttribute | IRelationshipAttribute;
|
|
7
|
+
requestReference: ICoreId;
|
|
8
|
+
peer: ICoreAddress;
|
|
9
|
+
}
|
|
10
|
+
export declare class CreatePeerConsumptionAttributeParams extends Serializable implements ICreatePeerConsumptionAttributeParams {
|
|
11
|
+
id: CoreId;
|
|
12
|
+
content: IdentityAttribute | RelationshipAttribute;
|
|
13
|
+
requestReference: CoreId;
|
|
14
|
+
peer: CoreAddress;
|
|
15
|
+
static from(value: ICreatePeerConsumptionAttributeParams): CreatePeerConsumptionAttributeParams;
|
|
16
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CreatePeerConsumptionAttributeParams = void 0;
|
|
13
|
+
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
14
|
+
const content_1 = require("@nmshd/content");
|
|
15
|
+
const transport_1 = require("@nmshd/transport");
|
|
16
|
+
class CreatePeerConsumptionAttributeParams extends ts_serval_1.Serializable {
|
|
17
|
+
static from(value) {
|
|
18
|
+
return this.fromAny(value);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, ts_serval_1.serialize)(),
|
|
23
|
+
(0, ts_serval_1.validate)(),
|
|
24
|
+
__metadata("design:type", transport_1.CoreId)
|
|
25
|
+
], CreatePeerConsumptionAttributeParams.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, ts_serval_1.serialize)({ unionTypes: [content_1.IdentityAttribute, content_1.RelationshipAttribute] }),
|
|
28
|
+
(0, ts_serval_1.validate)(),
|
|
29
|
+
__metadata("design:type", Object)
|
|
30
|
+
], CreatePeerConsumptionAttributeParams.prototype, "content", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, ts_serval_1.serialize)(),
|
|
33
|
+
(0, ts_serval_1.validate)(),
|
|
34
|
+
__metadata("design:type", transport_1.CoreId)
|
|
35
|
+
], CreatePeerConsumptionAttributeParams.prototype, "requestReference", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, ts_serval_1.serialize)(),
|
|
38
|
+
(0, ts_serval_1.validate)(),
|
|
39
|
+
__metadata("design:type", transport_1.CoreAddress)
|
|
40
|
+
], CreatePeerConsumptionAttributeParams.prototype, "peer", void 0);
|
|
41
|
+
exports.CreatePeerConsumptionAttributeParams = CreatePeerConsumptionAttributeParams;
|
|
42
|
+
//# sourceMappingURL=CreatePeerConsumptionAttributeParams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreatePeerConsumptionAttributeParams.js","sourceRoot":"","sources":["../../../src/modules/attributes/CreatePeerConsumptionAttributeParams.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAqF;AACrF,4CAAqH;AACrH,gDAA6E;AAS7E,MAAa,oCACT,SAAQ,wBAAY;IAmBb,MAAM,CAAC,IAAI,CAAC,KAA4C;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;CACJ;AAjBG;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACA,kBAAM;gEAAA;AAIjB;IAFC,IAAA,qBAAS,EAAC,EAAE,UAAU,EAAE,CAAC,2BAAiB,EAAE,+BAAqB,CAAC,EAAE,CAAC;IACrE,IAAA,oBAAQ,GAAE;;qEAC8C;AAIzD;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACc,kBAAM;8EAAA;AAI/B;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACE,uBAAW;kEAAA;AAlB5B,oFAuBC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ISerializable, Serializable } from "@js-soft/ts-serval";
|
|
2
|
+
import { CoreAddress, CoreId, ICoreAddress, ICoreId } from "@nmshd/transport";
|
|
3
|
+
export interface ICreateSharedConsumptionAttributeCopyParams extends ISerializable {
|
|
4
|
+
attributeId: ICoreId;
|
|
5
|
+
peer: ICoreAddress;
|
|
6
|
+
requestReference: ICoreId;
|
|
7
|
+
}
|
|
8
|
+
export declare class CreateSharedConsumptionAttributeCopyParams extends Serializable implements ICreateSharedConsumptionAttributeCopyParams {
|
|
9
|
+
attributeId: CoreId;
|
|
10
|
+
peer: CoreAddress;
|
|
11
|
+
requestReference: CoreId;
|
|
12
|
+
static from(value: ICreateSharedConsumptionAttributeCopyParams): CreateSharedConsumptionAttributeCopyParams;
|
|
13
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CreateSharedConsumptionAttributeCopyParams = void 0;
|
|
13
|
+
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
14
|
+
const transport_1 = require("@nmshd/transport");
|
|
15
|
+
class CreateSharedConsumptionAttributeCopyParams extends ts_serval_1.Serializable {
|
|
16
|
+
static from(value) {
|
|
17
|
+
return this.fromAny(value);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, ts_serval_1.serialize)(),
|
|
22
|
+
(0, ts_serval_1.validate)(),
|
|
23
|
+
__metadata("design:type", transport_1.CoreId)
|
|
24
|
+
], CreateSharedConsumptionAttributeCopyParams.prototype, "attributeId", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, ts_serval_1.serialize)(),
|
|
27
|
+
(0, ts_serval_1.validate)(),
|
|
28
|
+
__metadata("design:type", transport_1.CoreAddress)
|
|
29
|
+
], CreateSharedConsumptionAttributeCopyParams.prototype, "peer", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, ts_serval_1.serialize)(),
|
|
32
|
+
(0, ts_serval_1.validate)(),
|
|
33
|
+
__metadata("design:type", transport_1.CoreId)
|
|
34
|
+
], CreateSharedConsumptionAttributeCopyParams.prototype, "requestReference", void 0);
|
|
35
|
+
exports.CreateSharedConsumptionAttributeCopyParams = CreateSharedConsumptionAttributeCopyParams;
|
|
36
|
+
//# sourceMappingURL=CreateSharedConsumptionAttributeCopyParams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateSharedConsumptionAttributeCopyParams.js","sourceRoot":"","sources":["../../../src/modules/attributes/CreateSharedConsumptionAttributeCopyParams.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAqF;AACrF,gDAA6E;AAQ7E,MAAa,0CACT,SAAQ,wBAAY;IAeb,MAAM,CAAC,IAAI,CAAC,KAAkD;QACjE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;CACJ;AAbG;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACS,kBAAM;+EAAA;AAI1B;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACE,uBAAW;wEAAA;AAIxB;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACc,kBAAM;oFAAA;AAdnC,gGAmBC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ISerializable, Serializable } from "@js-soft/ts-serval";
|
|
2
|
+
import { IdentityAttribute, IIdentityAttribute, IRelationshipAttribute, RelationshipAttribute } from "@nmshd/content";
|
|
3
|
+
import { CoreId, ICoreId } from "@nmshd/transport";
|
|
4
|
+
export interface ISucceedConsumptionAttributeParams extends ISerializable {
|
|
5
|
+
successorContent: IIdentityAttribute | IRelationshipAttribute;
|
|
6
|
+
succeeds: ICoreId;
|
|
7
|
+
}
|
|
8
|
+
export declare class SucceedConsumptionAttributeParams extends Serializable implements ISucceedConsumptionAttributeParams {
|
|
9
|
+
successorContent: IdentityAttribute | RelationshipAttribute;
|
|
10
|
+
succeeds: CoreId;
|
|
11
|
+
static from(value: ISucceedConsumptionAttributeParams): SucceedConsumptionAttributeParams;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SucceedConsumptionAttributeParams = void 0;
|
|
13
|
+
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
14
|
+
const content_1 = require("@nmshd/content");
|
|
15
|
+
const transport_1 = require("@nmshd/transport");
|
|
16
|
+
class SucceedConsumptionAttributeParams extends ts_serval_1.Serializable {
|
|
17
|
+
static from(value) {
|
|
18
|
+
return this.fromAny(value);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, ts_serval_1.serialize)({ unionTypes: [content_1.IdentityAttribute, content_1.RelationshipAttribute] }),
|
|
23
|
+
(0, ts_serval_1.validate)(),
|
|
24
|
+
__metadata("design:type", Object)
|
|
25
|
+
], SucceedConsumptionAttributeParams.prototype, "successorContent", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, ts_serval_1.serialize)(),
|
|
28
|
+
(0, ts_serval_1.validate)(),
|
|
29
|
+
__metadata("design:type", transport_1.CoreId)
|
|
30
|
+
], SucceedConsumptionAttributeParams.prototype, "succeeds", void 0);
|
|
31
|
+
exports.SucceedConsumptionAttributeParams = SucceedConsumptionAttributeParams;
|
|
32
|
+
//# sourceMappingURL=SuccedConsumptionAttributeParams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuccedConsumptionAttributeParams.js","sourceRoot":"","sources":["../../../src/modules/attributes/SuccedConsumptionAttributeParams.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAqF;AACrF,4CAAqH;AACrH,gDAAkD;AAOlD,MAAa,iCAAkC,SAAQ,wBAAY;IASxD,MAAM,CAAC,IAAI,CAAC,KAAyC;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;CACJ;AATG;IAFC,IAAA,qBAAS,EAAC,EAAE,UAAU,EAAE,CAAC,2BAAiB,EAAE,+BAAqB,CAAC,EAAE,CAAC;IACrE,IAAA,oBAAQ,GAAE;;2EACuD;AAIlE;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACM,kBAAM;mEAAA;AAP3B,8EAYC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ISerializable, Serializable } from "@js-soft/ts-serval";
|
|
2
|
+
import { IdentityAttribute, IIdentityAttribute, IRelationshipAttribute, RelationshipAttribute } from "@nmshd/content";
|
|
3
|
+
import { CoreId, ICoreId } from "@nmshd/transport";
|
|
4
|
+
export interface IUpdateConsumptionAttributeParams extends ISerializable {
|
|
5
|
+
id: ICoreId;
|
|
6
|
+
content: IIdentityAttribute | IRelationshipAttribute;
|
|
7
|
+
}
|
|
8
|
+
export declare class UpdateConsumptionAttributeParams extends Serializable implements IUpdateConsumptionAttributeParams {
|
|
9
|
+
id: CoreId;
|
|
10
|
+
content: IdentityAttribute | RelationshipAttribute;
|
|
11
|
+
static from(value: IUpdateConsumptionAttributeParams): UpdateConsumptionAttributeParams;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UpdateConsumptionAttributeParams = void 0;
|
|
13
|
+
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
14
|
+
const content_1 = require("@nmshd/content");
|
|
15
|
+
const transport_1 = require("@nmshd/transport");
|
|
16
|
+
class UpdateConsumptionAttributeParams extends ts_serval_1.Serializable {
|
|
17
|
+
static from(value) {
|
|
18
|
+
return this.fromAny(value);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, ts_serval_1.serialize)(),
|
|
23
|
+
(0, ts_serval_1.validate)(),
|
|
24
|
+
__metadata("design:type", transport_1.CoreId)
|
|
25
|
+
], UpdateConsumptionAttributeParams.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, ts_serval_1.serialize)({ unionTypes: [content_1.IdentityAttribute, content_1.RelationshipAttribute] }),
|
|
28
|
+
(0, ts_serval_1.validate)(),
|
|
29
|
+
__metadata("design:type", Object)
|
|
30
|
+
], UpdateConsumptionAttributeParams.prototype, "content", void 0);
|
|
31
|
+
exports.UpdateConsumptionAttributeParams = UpdateConsumptionAttributeParams;
|
|
32
|
+
//# sourceMappingURL=UpdateConsumptionAttributeParams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateConsumptionAttributeParams.js","sourceRoot":"","sources":["../../../src/modules/attributes/UpdateConsumptionAttributeParams.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAqF;AACrF,4CAAqH;AACrH,gDAAkD;AAOlD,MAAa,gCAAiC,SAAQ,wBAAY;IASvD,MAAM,CAAC,IAAI,CAAC,KAAwC;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;CACJ;AATG;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACA,kBAAM;4DAAA;AAIjB;IAFC,IAAA,qBAAS,EAAC,EAAE,UAAU,EAAE,CAAC,2BAAiB,EAAE,+BAAqB,CAAC,EAAE,CAAC;IACrE,IAAA,oBAAQ,GAAE;;iEAC8C;AAP7D,4EAYC"}
|
|
@@ -1,19 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CoreDate, CoreSynchronizable, ICoreDate, ICoreSynchronizable } from "@nmshd/transport";
|
|
1
|
+
import { IdentityAttribute, IdentityAttributeJSON, IIdentityAttribute, IRelationshipAttribute, RelationshipAttribute, RelationshipAttributeJSON } from "@nmshd/content";
|
|
2
|
+
import { CoreDate, CoreId, CoreSynchronizable, ICoreDate, ICoreId, ICoreSynchronizable } from "@nmshd/transport";
|
|
3
|
+
import { ConsumptionAttributeShareInfo, ConsumptionAttributeShareInfoJSON, IConsumptionAttributeShareInfo } from "./ConsumptionAttributeShareInfo";
|
|
4
|
+
export interface ConsumptionAttributeJSON {
|
|
5
|
+
content: IdentityAttributeJSON | RelationshipAttributeJSON;
|
|
6
|
+
createdAt: string;
|
|
7
|
+
succeeds: string;
|
|
8
|
+
succeededBy: string;
|
|
9
|
+
shareInfo: ConsumptionAttributeShareInfoJSON;
|
|
10
|
+
}
|
|
3
11
|
export interface IConsumptionAttribute extends ICoreSynchronizable {
|
|
4
|
-
content:
|
|
12
|
+
content: IIdentityAttribute | IRelationshipAttribute;
|
|
5
13
|
createdAt: ICoreDate;
|
|
6
|
-
|
|
7
|
-
|
|
14
|
+
succeeds?: ICoreId;
|
|
15
|
+
succeededBy?: ICoreId;
|
|
16
|
+
shareInfo?: IConsumptionAttributeShareInfo;
|
|
8
17
|
}
|
|
9
18
|
export declare class ConsumptionAttribute extends CoreSynchronizable implements IConsumptionAttribute {
|
|
10
19
|
readonly technicalProperties: string[];
|
|
11
20
|
readonly userdataProperties: string[];
|
|
12
|
-
|
|
13
|
-
content: Attribute;
|
|
21
|
+
content: IdentityAttribute | RelationshipAttribute;
|
|
14
22
|
createdAt: CoreDate;
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
succeeds?: CoreId;
|
|
24
|
+
succeededBy?: CoreId;
|
|
25
|
+
shareInfo?: ConsumptionAttributeShareInfo;
|
|
17
26
|
static from(value: IConsumptionAttribute): ConsumptionAttribute;
|
|
18
|
-
static fromAttribute(attribute:
|
|
27
|
+
static fromAttribute(attribute: IIdentityAttribute | IRelationshipAttribute, succeeds?: ICoreId, shareInfo?: IConsumptionAttributeShareInfo): Promise<ConsumptionAttribute>;
|
|
19
28
|
}
|