@nmshd/consumption 2.0.0-alpha.12 → 2.0.0-alpha.13
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 +11 -10
- package/dist/modules/attributes/ConsumptionAttributesController.js +48 -54
- 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/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/local/ConsumptionAttribute.d.ts +12 -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 +12 -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 +3 -0
- package/dist/modules/index.js +3 -0
- package/dist/modules/index.js.map +1 -1
- package/lib-web/nmshd.consumption.js +253 -77
- 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 +1 -1
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.13",
|
|
10
|
+
build: "31",
|
|
11
|
+
date: "2022-05-17T12:00:51+00:00",
|
|
12
|
+
commit: "44fe03b9135fe648c60e658c1d26ee7dc7b1f145",
|
|
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,10 @@
|
|
|
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 { ICreateSharedConsumptionAttributeCopyParams } from "./CreateSharedConsumptionAttributeCopyParams";
|
|
4
6
|
import { ConsumptionAttribute } from "./local/ConsumptionAttribute";
|
|
7
|
+
import { ISucceedConsumptionAttributeParams } from "./SuccedConsumptionAttributeParams";
|
|
5
8
|
export declare class ConsumptionAttributesController extends ConsumptionBaseController {
|
|
6
9
|
private attributes;
|
|
7
10
|
constructor(parent: ConsumptionController);
|
|
@@ -9,14 +12,12 @@ export declare class ConsumptionAttributesController extends ConsumptionBaseCont
|
|
|
9
12
|
checkValid(attribute: ConsumptionAttribute): boolean;
|
|
10
13
|
findCurrent(attributes: ConsumptionAttribute[]): ConsumptionAttribute | undefined;
|
|
11
14
|
filterCurrent(attributes: ConsumptionAttribute[]): ConsumptionAttribute[];
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
succeedAttribute(attribute: ConsumptionAttribute, validFrom?: CoreDate): Promise<ConsumptionAttribute>;
|
|
20
|
-
updateAttribute(attribute: ConsumptionAttribute): Promise<ConsumptionAttribute>;
|
|
15
|
+
getConsumptionAttribute(id: CoreId): Promise<ConsumptionAttribute | undefined>;
|
|
16
|
+
getConsumptionAttributes(query?: any): Promise<ConsumptionAttribute[]>;
|
|
17
|
+
getValidConsumptionAttributes(query?: any): Promise<ConsumptionAttribute[]>;
|
|
18
|
+
createConsumptionAttribute(params: ICreateConsumptionAttributeParams): Promise<ConsumptionAttribute>;
|
|
19
|
+
succeedConsumptionAttribute(params: ISucceedConsumptionAttributeParams): Promise<ConsumptionAttribute>;
|
|
20
|
+
createSharedConsumptionAttributeCopy(params: ICreateSharedConsumptionAttributeCopyParams): Promise<ConsumptionAttribute>;
|
|
21
|
+
updateConsumptionAttribute(attribute: ConsumptionAttribute): Promise<ConsumptionAttribute>;
|
|
21
22
|
deleteAttribute(attribute: ConsumptionAttribute): Promise<void>;
|
|
22
23
|
}
|
|
@@ -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,69 +64,60 @@ 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);
|
|
77
|
-
}
|
|
78
|
-
async getAttributeHistoryByName(name) {
|
|
79
|
-
const result = await this.attributes.find({
|
|
80
|
-
[`${(0, ts_simple_nameof_1.nameof)((c) => c.content)}.${(0, ts_simple_nameof_1.nameof)((a) => a.name)}`]: name
|
|
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);
|
|
75
|
+
async getConsumptionAttributes(query) {
|
|
76
|
+
const attributes = await this.attributes.find(query);
|
|
77
|
+
return await this.parseArray(attributes, ConsumptionAttribute_1.ConsumptionAttribute);
|
|
91
78
|
}
|
|
92
|
-
async
|
|
93
|
-
const
|
|
94
|
-
const items = await this.parseArray(
|
|
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.getConsumptionAttribute(parsedParams.succeeds);
|
|
92
|
+
if (!current) {
|
|
93
|
+
throw consumption_1.ConsumptionErrors.attributes.predecessorNotFound(parsedParams.succeeds.toString());
|
|
109
94
|
}
|
|
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();
|
|
95
|
+
if (!parsedParams.successorContent.validFrom) {
|
|
96
|
+
parsedParams.successorContent.validFrom = transport_1.CoreDate.utc();
|
|
117
97
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
98
|
+
const validFrom = parsedParams.successorContent.validFrom;
|
|
99
|
+
current.content.validTo = validFrom.subtract(1);
|
|
100
|
+
await this.updateConsumptionAttribute(current);
|
|
101
|
+
const successor = await ConsumptionAttribute_1.ConsumptionAttribute.fromAttribute(parsedParams.successorContent, parsedParams.succeeds);
|
|
102
|
+
await this.attributes.create(successor);
|
|
103
|
+
return successor;
|
|
104
|
+
}
|
|
105
|
+
async createSharedConsumptionAttributeCopy(params) {
|
|
106
|
+
const parsedParams = CreateSharedConsumptionAttributeCopyParams_1.CreateSharedConsumptionAttributeCopyParams.from(params);
|
|
107
|
+
const sourceAttribute = await this.getConsumptionAttribute(parsedParams.attributeId);
|
|
108
|
+
if (!sourceAttribute) {
|
|
109
|
+
throw consumption_1.ConsumptionErrors.attributes.predecessorNotFound(parsedParams.attributeId.toString());
|
|
122
110
|
}
|
|
123
|
-
|
|
124
|
-
|
|
111
|
+
const shareInfo = ConsumptionAttributeShareInfo_1.ConsumptionAttributeShareInfo.from({
|
|
112
|
+
peer: parsedParams.peer,
|
|
113
|
+
requestReference: parsedParams.requestReference,
|
|
114
|
+
sourceAttribute: parsedParams.attributeId
|
|
115
|
+
});
|
|
116
|
+
const sharedConsumptionAttributeCopy = await ConsumptionAttribute_1.ConsumptionAttribute.fromAttribute(sourceAttribute.content, undefined, shareInfo);
|
|
117
|
+
await this.attributes.create(sharedConsumptionAttributeCopy);
|
|
118
|
+
return sharedConsumptionAttributeCopy;
|
|
125
119
|
}
|
|
126
|
-
async
|
|
120
|
+
async updateConsumptionAttribute(attribute) {
|
|
127
121
|
const current = await this.attributes.findOne({
|
|
128
122
|
[(0, ts_simple_nameof_1.nameof)((c) => c.id)]: attribute.id.toString()
|
|
129
123
|
});
|
|
@@ -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;AAG3G,6GAGqD;AACrD,uEAA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AC;YAC1C,CAAC,IAAA,yBAAM,EAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE;SACvE,CAAC,CAAA;QACF,IAAI,CAAC,OAAO,EAAE;YACV,MAAM,2BAAe,CAAC,OAAO,CAAC,cAAc,CAAC,2CAAoB,EAAE,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;SAC9F;QACD,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;QAChD,OAAO,SAAS,CAAA;IACpB,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,SAA+B;QACxD,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IAC3C,CAAC;CACJ;AAxJD,0EAwJC"}
|
|
@@ -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,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"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CoreDate, CoreSynchronizable, ICoreDate, ICoreSynchronizable } from "@nmshd/transport";
|
|
1
|
+
import { IdentityAttribute, IIdentityAttribute, IRelationshipAttribute, RelationshipAttribute } from "@nmshd/content";
|
|
2
|
+
import { CoreDate, CoreId, CoreSynchronizable, ICoreDate, ICoreId, ICoreSynchronizable } from "@nmshd/transport";
|
|
3
|
+
import { ConsumptionAttributeShareInfo, IConsumptionAttributeShareInfo } from "./ConsumptionAttributeShareInfo";
|
|
3
4
|
export interface IConsumptionAttribute extends ICoreSynchronizable {
|
|
4
|
-
content:
|
|
5
|
+
content: IIdentityAttribute | IRelationshipAttribute;
|
|
5
6
|
createdAt: ICoreDate;
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
succeeds?: ICoreId;
|
|
8
|
+
succeededBy?: ICoreId;
|
|
9
|
+
shareInfo?: IConsumptionAttributeShareInfo;
|
|
8
10
|
}
|
|
9
11
|
export declare class ConsumptionAttribute extends CoreSynchronizable implements IConsumptionAttribute {
|
|
10
12
|
readonly technicalProperties: string[];
|
|
11
13
|
readonly userdataProperties: string[];
|
|
12
|
-
|
|
13
|
-
content: Attribute;
|
|
14
|
+
content: IdentityAttribute | RelationshipAttribute;
|
|
14
15
|
createdAt: CoreDate;
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
succeeds?: CoreId;
|
|
17
|
+
succeededBy?: CoreId;
|
|
18
|
+
shareInfo?: ConsumptionAttributeShareInfo;
|
|
17
19
|
static from(value: IConsumptionAttribute): ConsumptionAttribute;
|
|
18
|
-
static fromAttribute(attribute:
|
|
20
|
+
static fromAttribute(attribute: IIdentityAttribute | IRelationshipAttribute, succeeds?: ICoreId, shareInfo?: IConsumptionAttributeShareInfo): Promise<ConsumptionAttribute>;
|
|
19
21
|
}
|
|
@@ -15,35 +15,36 @@ const content_1 = require("@nmshd/content");
|
|
|
15
15
|
const transport_1 = require("@nmshd/transport");
|
|
16
16
|
const ts_simple_nameof_1 = require("ts-simple-nameof");
|
|
17
17
|
const consumption_1 = require("../../../consumption");
|
|
18
|
+
const ConsumptionAttributeShareInfo_1 = require("./ConsumptionAttributeShareInfo");
|
|
18
19
|
let ConsumptionAttribute = class ConsumptionAttribute extends transport_1.CoreSynchronizable {
|
|
19
20
|
constructor() {
|
|
20
21
|
super(...arguments);
|
|
21
22
|
this.technicalProperties = [
|
|
22
23
|
"@type",
|
|
23
24
|
"@context",
|
|
25
|
+
(0, ts_simple_nameof_1.nameof)((r) => r.createdAt),
|
|
26
|
+
(0, ts_simple_nameof_1.nameof)((r) => r.succeeds),
|
|
24
27
|
(0, ts_simple_nameof_1.nameof)((r) => r.createdAt)
|
|
25
28
|
];
|
|
26
29
|
this.userdataProperties = [(0, ts_simple_nameof_1.nameof)((r) => r.content)];
|
|
27
|
-
this.metadataProperties = [
|
|
28
|
-
(0, ts_simple_nameof_1.nameof)((r) => r.metadata),
|
|
29
|
-
(0, ts_simple_nameof_1.nameof)((r) => r.metadataModifiedAt)
|
|
30
|
-
];
|
|
31
30
|
}
|
|
32
31
|
static from(value) {
|
|
33
32
|
return this.fromAny(value);
|
|
34
33
|
}
|
|
35
|
-
static async fromAttribute(attribute) {
|
|
34
|
+
static async fromAttribute(attribute, succeeds, shareInfo) {
|
|
36
35
|
return this.from({
|
|
37
|
-
content:
|
|
36
|
+
content: attribute,
|
|
38
37
|
id: await consumption_1.ConsumptionIds.attribute.generate(),
|
|
39
|
-
createdAt: transport_1.CoreDate.utc()
|
|
38
|
+
createdAt: transport_1.CoreDate.utc(),
|
|
39
|
+
succeeds: succeeds,
|
|
40
|
+
shareInfo: shareInfo
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
__decorate([
|
|
44
45
|
(0, ts_serval_1.validate)(),
|
|
45
|
-
(0, ts_serval_1.serialize)({
|
|
46
|
-
__metadata("design:type",
|
|
46
|
+
(0, ts_serval_1.serialize)({ unionTypes: [content_1.IdentityAttribute, content_1.RelationshipAttribute] }),
|
|
47
|
+
__metadata("design:type", Object)
|
|
47
48
|
], ConsumptionAttribute.prototype, "content", void 0);
|
|
48
49
|
__decorate([
|
|
49
50
|
(0, ts_serval_1.validate)(),
|
|
@@ -52,14 +53,19 @@ __decorate([
|
|
|
52
53
|
], ConsumptionAttribute.prototype, "createdAt", void 0);
|
|
53
54
|
__decorate([
|
|
54
55
|
(0, ts_serval_1.validate)({ nullable: true }),
|
|
55
|
-
(0, ts_serval_1.serialize)(
|
|
56
|
-
__metadata("design:type",
|
|
57
|
-
], ConsumptionAttribute.prototype, "
|
|
56
|
+
(0, ts_serval_1.serialize)(),
|
|
57
|
+
__metadata("design:type", transport_1.CoreId)
|
|
58
|
+
], ConsumptionAttribute.prototype, "succeeds", void 0);
|
|
58
59
|
__decorate([
|
|
59
60
|
(0, ts_serval_1.validate)({ nullable: true }),
|
|
60
61
|
(0, ts_serval_1.serialize)(),
|
|
61
|
-
__metadata("design:type", transport_1.
|
|
62
|
-
], ConsumptionAttribute.prototype, "
|
|
62
|
+
__metadata("design:type", transport_1.CoreId)
|
|
63
|
+
], ConsumptionAttribute.prototype, "succeededBy", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, ts_serval_1.validate)({ nullable: true }),
|
|
66
|
+
(0, ts_serval_1.serialize)(),
|
|
67
|
+
__metadata("design:type", ConsumptionAttributeShareInfo_1.ConsumptionAttributeShareInfo)
|
|
68
|
+
], ConsumptionAttribute.prototype, "shareInfo", void 0);
|
|
63
69
|
ConsumptionAttribute = __decorate([
|
|
64
70
|
(0, ts_serval_1.type)("ConsumptionAttribute")
|
|
65
71
|
], ConsumptionAttribute);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsumptionAttribute.js","sourceRoot":"","sources":["../../../../src/modules/attributes/local/ConsumptionAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"ConsumptionAttribute.js","sourceRoot":"","sources":["../../../../src/modules/attributes/local/ConsumptionAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA8D;AAC9D,4CAAqH;AACrH,gDAAgH;AAChH,uDAAyC;AACzC,sDAAqD;AACrD,mFAA+G;AAW/G,IAAa,oBAAoB,GAAjC,MAAa,oBAAqB,SAAQ,8BAAkB;IAA5D;;QAC6B,wBAAmB,GAAG;YAC3C,OAAO;YACP,UAAU;YACV,IAAA,yBAAM,EAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;YAChD,IAAA,yBAAM,EAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;YAC/C,IAAA,yBAAM,EAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;SACnD,CAAA;QAEwB,uBAAkB,GAAG,CAAC,IAAA,yBAAM,EAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;IAuClG,CAAC;IAjBU,MAAM,CAAC,IAAI,CAAC,KAA4B;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,aAAa,CAC7B,SAAsD,EACtD,QAAkB,EAClB,SAA0C;QAE1C,OAAO,IAAI,CAAC,IAAI,CAAC;YACb,OAAO,EAAE,SAAS;YAClB,EAAE,EAAE,MAAM,4BAAc,CAAC,SAAS,CAAC,QAAQ,EAAE;YAC7C,SAAS,EAAE,oBAAQ,CAAC,GAAG,EAAE;YACzB,QAAQ,EAAE,QAAQ;YAClB,SAAS,EAAE,SAAS;SACvB,CAAC,CAAA;IACN,CAAC;CACJ,CAAA;AAnCG;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,EAAC,EAAE,UAAU,EAAE,CAAC,2BAAiB,EAAE,+BAAqB,CAAC,EAAE,CAAC;;qDACb;AAIzD;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACM,oBAAQ;uDAAA;AAI1B;IAFC,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,IAAA,qBAAS,GAAE;8BACM,kBAAM;sDAAA;AAIxB;IAFC,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,IAAA,qBAAS,GAAE;8BACS,kBAAM;yDAAA;AAI3B;IAFC,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,IAAA,qBAAS,GAAE;8BACO,6DAA6B;uDAAA;AA7BvC,oBAAoB;IADhC,IAAA,gBAAI,EAAC,sBAAsB,CAAC;GAChB,oBAAoB,CAgDhC;AAhDY,oDAAoB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CoreAddress, CoreId, CoreSerializable, ICoreAddress, ICoreId, ICoreSerializable } from "@nmshd/transport";
|
|
2
|
+
export interface IConsumptionAttributeShareInfo extends ICoreSerializable {
|
|
3
|
+
requestReference: ICoreId;
|
|
4
|
+
peer: ICoreAddress;
|
|
5
|
+
sourceAttribute?: ICoreId;
|
|
6
|
+
}
|
|
7
|
+
export declare class ConsumptionAttributeShareInfo extends CoreSerializable implements IConsumptionAttributeShareInfo {
|
|
8
|
+
requestReference: CoreId;
|
|
9
|
+
peer: CoreAddress;
|
|
10
|
+
sourceAttribute?: CoreId;
|
|
11
|
+
static from(value: IConsumptionAttributeShareInfo): ConsumptionAttributeShareInfo;
|
|
12
|
+
}
|
|
@@ -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.ConsumptionAttributeShareInfo = void 0;
|
|
13
|
+
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
14
|
+
const transport_1 = require("@nmshd/transport");
|
|
15
|
+
class ConsumptionAttributeShareInfo extends transport_1.CoreSerializable {
|
|
16
|
+
static from(value) {
|
|
17
|
+
return super.fromAny(value);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, ts_serval_1.validate)(),
|
|
22
|
+
(0, ts_serval_1.serialize)(),
|
|
23
|
+
__metadata("design:type", transport_1.CoreId)
|
|
24
|
+
], ConsumptionAttributeShareInfo.prototype, "requestReference", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, ts_serval_1.validate)(),
|
|
27
|
+
(0, ts_serval_1.serialize)(),
|
|
28
|
+
__metadata("design:type", transport_1.CoreAddress)
|
|
29
|
+
], ConsumptionAttributeShareInfo.prototype, "peer", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, ts_serval_1.validate)({ nullable: true }),
|
|
32
|
+
(0, ts_serval_1.serialize)(),
|
|
33
|
+
__metadata("design:type", transport_1.CoreId)
|
|
34
|
+
], ConsumptionAttributeShareInfo.prototype, "sourceAttribute", void 0);
|
|
35
|
+
exports.ConsumptionAttributeShareInfo = ConsumptionAttributeShareInfo;
|
|
36
|
+
//# sourceMappingURL=ConsumptionAttributeShareInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConsumptionAttributeShareInfo.js","sourceRoot":"","sources":["../../../../src/modules/attributes/local/ConsumptionAttributeShareInfo.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAwD;AACxD,gDAAkH;AAQlH,MAAa,6BAA8B,SAAQ,4BAAgB;IAaxD,MAAM,CAAC,IAAI,CAAC,KAAqC;QACpD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAkC,CAAA;IAChE,CAAC;CACJ;AAbG;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACa,kBAAM;uEAAA;AAI/B;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACC,uBAAW;2DAAA;AAIxB;IAFC,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,IAAA,qBAAS,GAAE;8BACa,kBAAM;sEAAA;AAXnC,sEAgBC"}
|
package/dist/modules/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export * from "./attributes/ConsumptionAttributesController";
|
|
2
|
+
export * from "./attributes/CreateConsumptionAttributeParams";
|
|
3
|
+
export * from "./attributes/CreateSharedConsumptionAttributeCopyParams";
|
|
2
4
|
export * from "./attributes/local/ConsumptionAttribute";
|
|
5
|
+
export * from "./attributes/SuccedConsumptionAttributeParams";
|
|
3
6
|
export * from "./drafts/DraftsController";
|
|
4
7
|
export * from "./drafts/local/Draft";
|
|
5
8
|
export * from "./requests/incoming/checkPrerequisites/CheckPrerequisitesOfIncomingRequestParameters";
|
package/dist/modules/index.js
CHANGED
|
@@ -15,7 +15,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./attributes/ConsumptionAttributesController"), exports);
|
|
18
|
+
__exportStar(require("./attributes/CreateConsumptionAttributeParams"), exports);
|
|
19
|
+
__exportStar(require("./attributes/CreateSharedConsumptionAttributeCopyParams"), exports);
|
|
18
20
|
__exportStar(require("./attributes/local/ConsumptionAttribute"), exports);
|
|
21
|
+
__exportStar(require("./attributes/SuccedConsumptionAttributeParams"), exports);
|
|
19
22
|
__exportStar(require("./drafts/DraftsController"), exports);
|
|
20
23
|
__exportStar(require("./drafts/local/Draft"), exports);
|
|
21
24
|
__exportStar(require("./requests/incoming/checkPrerequisites/CheckPrerequisitesOfIncomingRequestParameters"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+EAA4D;AAC5D,0EAAuD;AACvD,4DAAyC;AACzC,uDAAoC;AACpC,uHAAoG;AACpG,iGAA8E;AAC9E,yFAAsE;AACtE,8FAA2E;AAC3E,yFAAsE;AACtE,qFAAkE;AAClE,yFAAsE;AACtE,uFAAoE;AACpE,iFAA8D;AAC9D,iGAA8E;AAC9E,6HAA0G;AAC1G,wFAAqE;AACrE,iFAA8D;AAC9D,mFAAgE;AAChE,yFAAsE;AACtE,6EAA0D;AAC1D,sEAAmD;AACnD,4EAAyD;AACzD,oFAAiE;AACjE,uEAAoD;AACpD,gHAA6F;AAC7F,yJAAsI;AACtI,4GAAyF;AACzF,iFAA8D;AAC9D,wGAAqF;AACrF,2DAAwC;AACxC,gEAA6C;AAC7C,yDAAsC;AACtC,gEAA6C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+EAA4D;AAC5D,gFAA6D;AAC7D,0FAAuE;AACvE,0EAAuD;AACvD,gFAA6D;AAC7D,4DAAyC;AACzC,uDAAoC;AACpC,uHAAoG;AACpG,iGAA8E;AAC9E,yFAAsE;AACtE,8FAA2E;AAC3E,yFAAsE;AACtE,qFAAkE;AAClE,yFAAsE;AACtE,uFAAoE;AACpE,iFAA8D;AAC9D,iGAA8E;AAC9E,6HAA0G;AAC1G,wFAAqE;AACrE,iFAA8D;AAC9D,mFAAgE;AAChE,yFAAsE;AACtE,6EAA0D;AAC1D,sEAAmD;AACnD,4EAAyD;AACzD,oFAAiE;AACjE,uEAAoD;AACpD,gHAA6F;AAC7F,yJAAsI;AACtI,4GAAyF;AACzF,iFAA8D;AAC9D,wGAAqF;AACrF,2DAAwC;AACxC,gEAA6C;AAC7C,yDAAsC;AACtC,gEAA6C"}
|