@nmshd/consumption 2.0.0-alpha.21 → 2.0.0-alpha.25
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/README.md +2 -2
- package/dist/buildInformation.js +4 -4
- package/dist/consumption/ConsumptionController.d.ts +2 -2
- package/dist/consumption/ConsumptionController.js +2 -2
- package/dist/consumption/ConsumptionController.js.map +1 -1
- package/dist/consumption/ConsumptionControllerName.d.ts +1 -1
- package/dist/consumption/ConsumptionControllerName.js +1 -1
- package/dist/consumption/ConsumptionControllerName.js.map +1 -1
- package/dist/modules/attributes/LocalAttributesController.d.ts +30 -0
- package/dist/modules/attributes/{ConsumptionAttributesController.js → LocalAttributesController.js} +42 -42
- package/dist/modules/attributes/LocalAttributesController.js.map +1 -0
- package/dist/modules/attributes/local/{CreateConsumptionAttributeParams.d.ts → CreateLocalAttributeParams.d.ts} +4 -4
- package/dist/modules/attributes/local/{CreateConsumptionAttributeParams.js → CreateLocalAttributeParams.js} +5 -5
- package/dist/modules/attributes/local/CreateLocalAttributeParams.js.map +1 -0
- package/dist/modules/attributes/local/{CreatePeerConsumptionAttributeParams.d.ts → CreatePeerLocalAttributeParams.d.ts} +4 -4
- package/dist/modules/attributes/local/{CreatePeerConsumptionAttributeParams.js → CreatePeerLocalAttributeParams.js} +8 -8
- package/dist/modules/attributes/local/CreatePeerLocalAttributeParams.js.map +1 -0
- package/dist/modules/attributes/local/CreateSharedLocalAttributeCopyParams.d.ts +18 -0
- package/dist/modules/attributes/local/{CreateSharedConsumptionAttributeCopyParams.js → CreateSharedLocalAttributeCopyParams.js} +7 -7
- package/dist/modules/attributes/local/CreateSharedLocalAttributeCopyParams.js.map +1 -0
- package/dist/modules/attributes/local/{ConsumptionAttribute.d.ts → LocalAttribute.d.ts} +9 -9
- package/dist/modules/attributes/local/{ConsumptionAttribute.js → LocalAttribute.js} +14 -14
- package/dist/modules/attributes/local/LocalAttribute.js.map +1 -0
- package/dist/modules/attributes/local/{ConsumptionAttributeShareInfo.d.ts → LocalAttributeShareInfo.d.ts} +4 -4
- package/dist/modules/attributes/local/{ConsumptionAttributeShareInfo.js → LocalAttributeShareInfo.js} +7 -7
- package/dist/modules/attributes/local/LocalAttributeShareInfo.js.map +1 -0
- package/dist/modules/attributes/local/QueryTranslator.js +11 -7
- package/dist/modules/attributes/local/QueryTranslator.js.map +1 -1
- package/dist/modules/attributes/local/{SucceedConsumptionAttributeParams.d.ts → SucceedLocalAttributeParams.d.ts} +4 -4
- package/dist/modules/attributes/local/{UpdateConsumptionAttributeParams.js → SucceedLocalAttributeParams.js} +10 -10
- package/dist/modules/attributes/local/SucceedLocalAttributeParams.js.map +1 -0
- package/dist/modules/attributes/local/{UpdateConsumptionAttributeParams.d.ts → UpdateLocalAttributeParams.d.ts} +4 -4
- package/dist/modules/attributes/local/{SucceedConsumptionAttributeParams.js → UpdateLocalAttributeParams.js} +10 -10
- package/dist/modules/attributes/local/UpdateLocalAttributeParams.js.map +1 -0
- package/dist/modules/index.d.ts +13 -13
- package/dist/modules/index.js +12 -13
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/requests/incoming/DecideRequestParametersValidator.d.ts +2 -2
- package/dist/modules/requests/incoming/DecideRequestParametersValidator.js.map +1 -1
- package/dist/modules/requests/incoming/IncomingRequestsController.d.ts +10 -10
- package/dist/modules/requests/incoming/IncomingRequestsController.js +26 -29
- package/dist/modules/requests/incoming/IncomingRequestsController.js.map +1 -1
- package/dist/modules/requests/itemProcessors/AbstractRequestItemProcessor.d.ts +8 -8
- package/dist/modules/requests/itemProcessors/GenericRequestItemProcessor.d.ts +8 -8
- package/dist/modules/requests/itemProcessors/GenericRequestItemProcessor.js +2 -8
- package/dist/modules/requests/itemProcessors/GenericRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/IRequestItemProcessor.d.ts +8 -8
- package/dist/modules/requests/itemProcessors/createAttribute/CreateAttributeRequestItemProcessor.d.ts +3 -3
- package/dist/modules/requests/itemProcessors/createAttribute/CreateAttributeRequestItemProcessor.js +4 -5
- package/dist/modules/requests/itemProcessors/createAttribute/CreateAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/proposeAttribute/AcceptProposeAttributeRequestItemParameters.d.ts +1 -1
- package/dist/modules/requests/itemProcessors/proposeAttribute/ProposeAttributeRequestItemProcessor.d.ts +4 -4
- package/dist/modules/requests/itemProcessors/proposeAttribute/ProposeAttributeRequestItemProcessor.js +14 -14
- package/dist/modules/requests/itemProcessors/proposeAttribute/ProposeAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/readAttribute/AcceptReadAttributeRequestItemParameters.d.ts +13 -4
- package/dist/modules/requests/itemProcessors/readAttribute/AcceptReadAttributeRequestItemParameters.js +13 -6
- package/dist/modules/requests/itemProcessors/readAttribute/AcceptReadAttributeRequestItemParameters.js.map +1 -1
- package/dist/modules/requests/itemProcessors/readAttribute/ReadAttributeRequestItemProcessor.d.ts +4 -4
- package/dist/modules/requests/itemProcessors/readAttribute/ReadAttributeRequestItemProcessor.js +16 -16
- package/dist/modules/requests/itemProcessors/readAttribute/ReadAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/shareAttribute/ShareAttributeRequestItemProcessor.d.ts +4 -4
- package/dist/modules/requests/itemProcessors/shareAttribute/ShareAttributeRequestItemProcessor.js +5 -5
- package/dist/modules/requests/itemProcessors/shareAttribute/ShareAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/local/LocalRequest.d.ts +37 -0
- package/dist/modules/requests/local/{ConsumptionRequest.js → LocalRequest.js} +32 -32
- package/dist/modules/requests/local/LocalRequest.js.map +1 -0
- package/dist/modules/requests/local/{ConsumptionRequestStatus.d.ts → LocalRequestStatus.d.ts} +1 -1
- package/dist/modules/requests/local/LocalRequestStatus.js +13 -0
- package/dist/modules/requests/local/LocalRequestStatus.js.map +1 -0
- package/dist/modules/requests/local/LocalRequestStatusLogEntry.d.ts +17 -0
- package/dist/modules/requests/local/{ConsumptionRequestStatusLogEntry.js → LocalRequestStatusLogEntry.js} +13 -13
- package/dist/modules/requests/local/LocalRequestStatusLogEntry.js.map +1 -0
- package/dist/modules/requests/local/LocalResponse.d.ts +22 -0
- package/dist/modules/requests/local/{ConsumptionResponse.js → LocalResponse.js} +18 -18
- package/dist/modules/requests/local/LocalResponse.js.map +1 -0
- package/dist/modules/requests/outgoing/OutgoingRequestsController.d.ts +7 -7
- package/dist/modules/requests/outgoing/OutgoingRequestsController.js +17 -17
- package/dist/modules/requests/outgoing/OutgoingRequestsController.js.map +1 -1
- package/lib-web/nmshd.consumption.js +440 -440
- 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 +6 -6
- package/dist/modules/attributes/ConsumptionAttributesController.d.ts +0 -30
- package/dist/modules/attributes/ConsumptionAttributesController.js.map +0 -1
- package/dist/modules/attributes/local/ConsumptionAttribute.js.map +0 -1
- package/dist/modules/attributes/local/ConsumptionAttributeShareInfo.js.map +0 -1
- package/dist/modules/attributes/local/CreateConsumptionAttributeParams.js.map +0 -1
- package/dist/modules/attributes/local/CreatePeerConsumptionAttributeParams.js.map +0 -1
- package/dist/modules/attributes/local/CreateSharedConsumptionAttributeCopyParams.d.ts +0 -18
- package/dist/modules/attributes/local/CreateSharedConsumptionAttributeCopyParams.js.map +0 -1
- package/dist/modules/attributes/local/SucceedConsumptionAttributeParams.js.map +0 -1
- package/dist/modules/attributes/local/UpdateConsumptionAttributeParams.js.map +0 -1
- package/dist/modules/requests/local/ConsumptionRequest.d.ts +0 -37
- package/dist/modules/requests/local/ConsumptionRequest.js.map +0 -1
- package/dist/modules/requests/local/ConsumptionRequestStatus.js +0 -13
- package/dist/modules/requests/local/ConsumptionRequestStatus.js.map +0 -1
- package/dist/modules/requests/local/ConsumptionRequestStatusLogEntry.d.ts +0 -17
- package/dist/modules/requests/local/ConsumptionRequestStatusLogEntry.js.map +0 -1
- package/dist/modules/requests/local/ConsumptionResponse.d.ts +0 -22
- package/dist/modules/requests/local/ConsumptionResponse.js.map +0 -1
package/dist/modules/requests/itemProcessors/shareAttribute/ShareAttributeRequestItemProcessor.js
CHANGED
|
@@ -8,7 +8,7 @@ const GenericRequestItemProcessor_1 = require("../GenericRequestItemProcessor");
|
|
|
8
8
|
const ValidationResult_1 = require("../ValidationResult");
|
|
9
9
|
class ShareAttributeRequestItemProcessor extends GenericRequestItemProcessor_1.GenericRequestItemProcessor {
|
|
10
10
|
async canCreateOutgoingRequestItem(requestItem, _request, recipient) {
|
|
11
|
-
const attribute = await this.consumptionController.attributes.
|
|
11
|
+
const attribute = await this.consumptionController.attributes.getLocalAttribute(requestItem.attributeId);
|
|
12
12
|
if (!attribute) {
|
|
13
13
|
return ValidationResult_1.ValidationResult.error(transport_1.TransportErrors.general.recordNotFound(content_1.Attribute, requestItem.attributeId.toString()));
|
|
14
14
|
}
|
|
@@ -23,7 +23,7 @@ class ShareAttributeRequestItemProcessor extends GenericRequestItemProcessor_1.G
|
|
|
23
23
|
if (!relationshipToShareWith) {
|
|
24
24
|
return false; // Should the containing Request move to Error state?
|
|
25
25
|
}
|
|
26
|
-
const attribute = await this.consumptionController.attributes.
|
|
26
|
+
const attribute = await this.consumptionController.attributes.getLocalAttribute(requestItem.attributeId);
|
|
27
27
|
if (!attribute) {
|
|
28
28
|
return false; // Should the containing Request move to Error state?
|
|
29
29
|
}
|
|
@@ -50,7 +50,7 @@ class ShareAttributeRequestItemProcessor extends GenericRequestItemProcessor_1.G
|
|
|
50
50
|
return ValidationResult_1.ValidationResult.success();
|
|
51
51
|
}
|
|
52
52
|
async accept(requestItem, _params, _requestInfo) {
|
|
53
|
-
const attribute = await this.consumptionController.attributes.
|
|
53
|
+
const attribute = await this.consumptionController.attributes.getLocalAttribute(requestItem.attributeId);
|
|
54
54
|
if (!(await this.isAttributeAlreadyShared(attribute, requestItem.shareWith))) {
|
|
55
55
|
await this.shareAttribute(attribute, requestItem.shareWith);
|
|
56
56
|
}
|
|
@@ -58,12 +58,12 @@ class ShareAttributeRequestItemProcessor extends GenericRequestItemProcessor_1.G
|
|
|
58
58
|
}
|
|
59
59
|
async isAttributeAlreadyShared(attribute, shareWith) {
|
|
60
60
|
if (attribute.content instanceof content_1.IdentityAttribute) {
|
|
61
|
-
return ((await this.consumptionController.attributes.
|
|
61
|
+
return ((await this.consumptionController.attributes.getLocalAttributes({
|
|
62
62
|
"shareInfo.sourceAttribute": attribute.shareInfo.sourceAttribute.toString(),
|
|
63
63
|
"shareInfo.peer": shareWith.toString() // eslint-disable-line @typescript-eslint/naming-convention
|
|
64
64
|
})).length > 0);
|
|
65
65
|
}
|
|
66
|
-
return ((await this.consumptionController.attributes.
|
|
66
|
+
return ((await this.consumptionController.attributes.getLocalAttributes({
|
|
67
67
|
"shareInfo.sourceAttribute": attribute.id.toString(),
|
|
68
68
|
"shareInfo.peer": shareWith.toString() // eslint-disable-line @typescript-eslint/naming-convention
|
|
69
69
|
})).length > 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShareAttributeRequestItemProcessor.js","sourceRoot":"","sources":["../../../../../src/modules/requests/itemProcessors/shareAttribute/ShareAttributeRequestItemProcessor.ts"],"names":[],"mappings":";;;AAAA,4CASuB;AACvB,gDAA+D;AAC/D,yDAA2D;AAE3D,gFAA4E;AAE5E,0DAAsD;AAGtD,MAAa,kCAAmC,SAAQ,yDAGvD;IACmB,KAAK,CAAC,4BAA4B,CAC9C,WAAsC,EACtC,QAAiB,EACjB,SAAsB;QAEtB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"ShareAttributeRequestItemProcessor.js","sourceRoot":"","sources":["../../../../../src/modules/requests/itemProcessors/shareAttribute/ShareAttributeRequestItemProcessor.ts"],"names":[],"mappings":";;;AAAA,4CASuB;AACvB,gDAA+D;AAC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UAAU,EAAE,CAAC,SAAS,CAAC;YACvB,OAAO,EAAE,sBAAsB,CAAC,OAAO;SAC1C,CAAC,CAAA;QAEF,MAAM,IAAI,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,IAAI,CAAC;YACnD,SAAS,EAAE,sBAAsB,CAAC,EAAE;YACpC,mBAAmB,EAAE,OAAO;SAC/B,CAAC,CAAA;IACN,CAAC;CACJ;AApJD,gFAoJC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IRequest, Request } from "@nmshd/content";
|
|
2
|
+
import { CoreAddress, CoreDate, CoreId, CoreSerializable, CoreSynchronizable, ICoreAddress, ICoreDate, ICoreId, ICoreSerializable, ICoreSynchronizable } from "@nmshd/transport";
|
|
3
|
+
import { LocalRequestStatus } from "./LocalRequestStatus";
|
|
4
|
+
import { ILocalRequestStatusLogEntry, LocalRequestStatusLogEntry } from "./LocalRequestStatusLogEntry";
|
|
5
|
+
import { ILocalResponse, LocalResponse } from "./LocalResponse";
|
|
6
|
+
export interface ILocalRequestSource extends ICoreSerializable {
|
|
7
|
+
type: "Message" | "RelationshipTemplate";
|
|
8
|
+
reference: ICoreId;
|
|
9
|
+
}
|
|
10
|
+
export declare class LocalRequestSource extends CoreSerializable implements ILocalRequestSource {
|
|
11
|
+
type: "Message" | "RelationshipTemplate";
|
|
12
|
+
reference: CoreId;
|
|
13
|
+
static from(value: ILocalRequestSource): LocalRequestSource;
|
|
14
|
+
}
|
|
15
|
+
export interface ILocalRequest extends ICoreSynchronizable {
|
|
16
|
+
isOwn: boolean;
|
|
17
|
+
peer: ICoreAddress;
|
|
18
|
+
createdAt: ICoreDate;
|
|
19
|
+
content: IRequest;
|
|
20
|
+
source?: ILocalRequestSource;
|
|
21
|
+
response?: ILocalResponse;
|
|
22
|
+
status: LocalRequestStatus;
|
|
23
|
+
statusLog: ILocalRequestStatusLogEntry[];
|
|
24
|
+
}
|
|
25
|
+
export declare class LocalRequest extends CoreSynchronizable implements ILocalRequest {
|
|
26
|
+
isOwn: boolean;
|
|
27
|
+
peer: CoreAddress;
|
|
28
|
+
createdAt: CoreDate;
|
|
29
|
+
content: Request;
|
|
30
|
+
source?: LocalRequestSource;
|
|
31
|
+
response?: LocalResponse;
|
|
32
|
+
status: LocalRequestStatus;
|
|
33
|
+
statusLog: LocalRequestStatusLogEntry[];
|
|
34
|
+
changeStatus(newStatus: LocalRequestStatus): void;
|
|
35
|
+
sent(source: LocalRequestSource): void;
|
|
36
|
+
static from(value: ILocalRequest): LocalRequest;
|
|
37
|
+
}
|
|
@@ -9,14 +9,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.LocalRequest = exports.LocalRequestSource = void 0;
|
|
13
13
|
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
14
14
|
const content_1 = require("@nmshd/content");
|
|
15
15
|
const transport_1 = require("@nmshd/transport");
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
let
|
|
16
|
+
const LocalRequestStatus_1 = require("./LocalRequestStatus");
|
|
17
|
+
const LocalRequestStatusLogEntry_1 = require("./LocalRequestStatusLogEntry");
|
|
18
|
+
const LocalResponse_1 = require("./LocalResponse");
|
|
19
|
+
let LocalRequestSource = class LocalRequestSource extends transport_1.CoreSerializable {
|
|
20
20
|
static from(value) {
|
|
21
21
|
return this.fromAny(value);
|
|
22
22
|
}
|
|
@@ -25,19 +25,19 @@ __decorate([
|
|
|
25
25
|
(0, ts_serval_1.serialize)(),
|
|
26
26
|
(0, ts_serval_1.validate)(),
|
|
27
27
|
__metadata("design:type", String)
|
|
28
|
-
],
|
|
28
|
+
], LocalRequestSource.prototype, "type", void 0);
|
|
29
29
|
__decorate([
|
|
30
30
|
(0, ts_serval_1.serialize)(),
|
|
31
31
|
(0, ts_serval_1.validate)(),
|
|
32
32
|
__metadata("design:type", transport_1.CoreId)
|
|
33
|
-
],
|
|
34
|
-
|
|
35
|
-
(0, ts_serval_1.type)("
|
|
36
|
-
],
|
|
37
|
-
exports.
|
|
38
|
-
let
|
|
33
|
+
], LocalRequestSource.prototype, "reference", void 0);
|
|
34
|
+
LocalRequestSource = __decorate([
|
|
35
|
+
(0, ts_serval_1.type)("LocalRequestSource")
|
|
36
|
+
], LocalRequestSource);
|
|
37
|
+
exports.LocalRequestSource = LocalRequestSource;
|
|
38
|
+
let LocalRequest = class LocalRequest extends transport_1.CoreSynchronizable {
|
|
39
39
|
changeStatus(newStatus) {
|
|
40
|
-
const logEntry =
|
|
40
|
+
const logEntry = LocalRequestStatusLogEntry_1.LocalRequestStatusLogEntry.from({
|
|
41
41
|
createdAt: transport_1.CoreDate.utc(),
|
|
42
42
|
oldStatus: this.status,
|
|
43
43
|
newStatus
|
|
@@ -46,11 +46,11 @@ let ConsumptionRequest = class ConsumptionRequest extends transport_1.CoreSynchr
|
|
|
46
46
|
this.status = newStatus;
|
|
47
47
|
}
|
|
48
48
|
sent(source) {
|
|
49
|
-
if (this.status !==
|
|
50
|
-
throw new Error("
|
|
49
|
+
if (this.status !== LocalRequestStatus_1.LocalRequestStatus.Draft) {
|
|
50
|
+
throw new Error("Local Request has to be in status 'Draft'.");
|
|
51
51
|
}
|
|
52
52
|
this.source = source;
|
|
53
|
-
this.changeStatus(
|
|
53
|
+
this.changeStatus(LocalRequestStatus_1.LocalRequestStatus.Open);
|
|
54
54
|
}
|
|
55
55
|
static from(value) {
|
|
56
56
|
return this.fromAny(value);
|
|
@@ -60,44 +60,44 @@ __decorate([
|
|
|
60
60
|
(0, ts_serval_1.serialize)(),
|
|
61
61
|
(0, ts_serval_1.validate)(),
|
|
62
62
|
__metadata("design:type", Boolean)
|
|
63
|
-
],
|
|
63
|
+
], LocalRequest.prototype, "isOwn", void 0);
|
|
64
64
|
__decorate([
|
|
65
65
|
(0, ts_serval_1.serialize)(),
|
|
66
66
|
(0, ts_serval_1.validate)(),
|
|
67
67
|
__metadata("design:type", transport_1.CoreAddress)
|
|
68
|
-
],
|
|
68
|
+
], LocalRequest.prototype, "peer", void 0);
|
|
69
69
|
__decorate([
|
|
70
70
|
(0, ts_serval_1.serialize)(),
|
|
71
71
|
(0, ts_serval_1.validate)(),
|
|
72
72
|
__metadata("design:type", transport_1.CoreDate)
|
|
73
|
-
],
|
|
73
|
+
], LocalRequest.prototype, "createdAt", void 0);
|
|
74
74
|
__decorate([
|
|
75
75
|
(0, ts_serval_1.serialize)(),
|
|
76
76
|
(0, ts_serval_1.validate)(),
|
|
77
77
|
__metadata("design:type", content_1.Request)
|
|
78
|
-
],
|
|
78
|
+
], LocalRequest.prototype, "content", void 0);
|
|
79
79
|
__decorate([
|
|
80
80
|
(0, ts_serval_1.serialize)(),
|
|
81
81
|
(0, ts_serval_1.validate)({ nullable: true }),
|
|
82
|
-
__metadata("design:type",
|
|
83
|
-
],
|
|
82
|
+
__metadata("design:type", LocalRequestSource)
|
|
83
|
+
], LocalRequest.prototype, "source", void 0);
|
|
84
84
|
__decorate([
|
|
85
85
|
(0, ts_serval_1.serialize)(),
|
|
86
86
|
(0, ts_serval_1.validate)({ nullable: true }),
|
|
87
|
-
__metadata("design:type",
|
|
88
|
-
],
|
|
87
|
+
__metadata("design:type", LocalResponse_1.LocalResponse)
|
|
88
|
+
], LocalRequest.prototype, "response", void 0);
|
|
89
89
|
__decorate([
|
|
90
90
|
(0, ts_serval_1.serialize)(),
|
|
91
91
|
(0, ts_serval_1.validate)(),
|
|
92
92
|
__metadata("design:type", String)
|
|
93
|
-
],
|
|
93
|
+
], LocalRequest.prototype, "status", void 0);
|
|
94
94
|
__decorate([
|
|
95
|
-
(0, ts_serval_1.serialize)({ type:
|
|
95
|
+
(0, ts_serval_1.serialize)({ type: LocalRequestStatusLogEntry_1.LocalRequestStatusLogEntry }),
|
|
96
96
|
(0, ts_serval_1.validate)(),
|
|
97
97
|
__metadata("design:type", Array)
|
|
98
|
-
],
|
|
99
|
-
|
|
100
|
-
(0, ts_serval_1.type)("
|
|
101
|
-
],
|
|
102
|
-
exports.
|
|
103
|
-
//# sourceMappingURL=
|
|
98
|
+
], LocalRequest.prototype, "statusLog", void 0);
|
|
99
|
+
LocalRequest = __decorate([
|
|
100
|
+
(0, ts_serval_1.type)("LocalRequest")
|
|
101
|
+
], LocalRequest);
|
|
102
|
+
exports.LocalRequest = LocalRequest;
|
|
103
|
+
//# sourceMappingURL=LocalRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalRequest.js","sourceRoot":"","sources":["../../../../src/modules/requests/local/LocalRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA8D;AAC9D,4CAAkD;AAClD,gDAWyB;AACzB,6DAAyD;AACzD,6EAAsG;AACtG,mDAA+D;AAQ/D,IAAa,kBAAkB,GAA/B,MAAa,kBAAmB,SAAQ,4BAAgB;IAS7C,MAAM,CAAC,IAAI,CAAC,KAA0B;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;CACJ,CAAA;AATG;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;;gDACoC;AAI/C;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACO,kBAAM;qDAAA;AAPf,kBAAkB;IAD9B,IAAA,gBAAI,EAAC,oBAAoB,CAAC;GACd,kBAAkB,CAY9B;AAZY,gDAAkB;AA0B/B,IAAa,YAAY,GAAzB,MAAa,YAAa,SAAQ,8BAAkB;IAiCzC,YAAY,CAAC,SAA6B;QAC7C,MAAM,QAAQ,GAAG,uDAA0B,CAAC,IAAI,CAAC;YAC7C,SAAS,EAAE,oBAAQ,CAAC,GAAG,EAAE;YACzB,SAAS,EAAE,IAAI,CAAC,MAAM;YACtB,SAAS;SACZ,CAAC,CAAA;QAEF,I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AC,cAAc,CAAC;GACR,YAAY,CAyDxB;AAzDY,oCAAY"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LocalRequestStatus = void 0;
|
|
4
|
+
var LocalRequestStatus;
|
|
5
|
+
(function (LocalRequestStatus) {
|
|
6
|
+
LocalRequestStatus["Draft"] = "Draft";
|
|
7
|
+
LocalRequestStatus["Open"] = "Open";
|
|
8
|
+
LocalRequestStatus["DecisionRequired"] = "DecisionRequired";
|
|
9
|
+
LocalRequestStatus["ManualDecisionRequired"] = "ManualDecisionRequired";
|
|
10
|
+
LocalRequestStatus["Decided"] = "Decided";
|
|
11
|
+
LocalRequestStatus["Completed"] = "Completed";
|
|
12
|
+
})(LocalRequestStatus = exports.LocalRequestStatus || (exports.LocalRequestStatus = {}));
|
|
13
|
+
//# sourceMappingURL=LocalRequestStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalRequestStatus.js","sourceRoot":"","sources":["../../../../src/modules/requests/local/LocalRequestStatus.ts"],"names":[],"mappings":";;;AAAA,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC1B,qCAAe,CAAA;IACf,mCAAa,CAAA;IACb,2DAAqC,CAAA;IACrC,uEAAiD,CAAA;IACjD,yCAAmB,CAAA;IACnB,6CAAuB,CAAA;AAC3B,CAAC,EAPW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAO7B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CoreDate, CoreSerializable, ICoreDate, ICoreSerializable } from "@nmshd/transport";
|
|
2
|
+
import { LocalRequestStatus } from "./LocalRequestStatus";
|
|
3
|
+
export interface ILocalRequestStatusLogEntry extends ICoreSerializable {
|
|
4
|
+
createdAt: ICoreDate;
|
|
5
|
+
oldStatus: LocalRequestStatus;
|
|
6
|
+
newStatus: LocalRequestStatus;
|
|
7
|
+
data?: object;
|
|
8
|
+
code?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class LocalRequestStatusLogEntry extends CoreSerializable implements ILocalRequestStatusLogEntry {
|
|
11
|
+
createdAt: CoreDate;
|
|
12
|
+
oldStatus: LocalRequestStatus;
|
|
13
|
+
newStatus: LocalRequestStatus;
|
|
14
|
+
data?: object;
|
|
15
|
+
code?: string;
|
|
16
|
+
static from(value: ILocalRequestStatusLogEntry): LocalRequestStatusLogEntry;
|
|
17
|
+
}
|
|
@@ -9,11 +9,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.LocalRequestStatusLogEntry = void 0;
|
|
13
13
|
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
14
14
|
const transport_1 = require("@nmshd/transport");
|
|
15
|
-
const
|
|
16
|
-
let
|
|
15
|
+
const LocalRequestStatus_1 = require("./LocalRequestStatus");
|
|
16
|
+
let LocalRequestStatusLogEntry = class LocalRequestStatusLogEntry extends transport_1.CoreSerializable {
|
|
17
17
|
static from(value) {
|
|
18
18
|
return this.fromAny(value);
|
|
19
19
|
}
|
|
@@ -22,29 +22,29 @@ __decorate([
|
|
|
22
22
|
(0, ts_serval_1.serialize)(),
|
|
23
23
|
(0, ts_serval_1.validate)(),
|
|
24
24
|
__metadata("design:type", transport_1.CoreDate)
|
|
25
|
-
],
|
|
25
|
+
], LocalRequestStatusLogEntry.prototype, "createdAt", void 0);
|
|
26
26
|
__decorate([
|
|
27
27
|
(0, ts_serval_1.serialize)(),
|
|
28
28
|
(0, ts_serval_1.validate)(),
|
|
29
29
|
__metadata("design:type", String)
|
|
30
|
-
],
|
|
30
|
+
], LocalRequestStatusLogEntry.prototype, "oldStatus", void 0);
|
|
31
31
|
__decorate([
|
|
32
32
|
(0, ts_serval_1.serialize)(),
|
|
33
33
|
(0, ts_serval_1.validate)(),
|
|
34
34
|
__metadata("design:type", String)
|
|
35
|
-
],
|
|
35
|
+
], LocalRequestStatusLogEntry.prototype, "newStatus", void 0);
|
|
36
36
|
__decorate([
|
|
37
37
|
(0, ts_serval_1.serialize)(),
|
|
38
38
|
(0, ts_serval_1.validate)({ nullable: true }),
|
|
39
39
|
__metadata("design:type", Object)
|
|
40
|
-
],
|
|
40
|
+
], LocalRequestStatusLogEntry.prototype, "data", void 0);
|
|
41
41
|
__decorate([
|
|
42
42
|
(0, ts_serval_1.serialize)(),
|
|
43
43
|
(0, ts_serval_1.validate)({ nullable: true }),
|
|
44
44
|
__metadata("design:type", String)
|
|
45
|
-
],
|
|
46
|
-
|
|
47
|
-
(0, ts_serval_1.type)("
|
|
48
|
-
],
|
|
49
|
-
exports.
|
|
50
|
-
//# sourceMappingURL=
|
|
45
|
+
], LocalRequestStatusLogEntry.prototype, "code", void 0);
|
|
46
|
+
LocalRequestStatusLogEntry = __decorate([
|
|
47
|
+
(0, ts_serval_1.type)("LocalRequestStatusLogEntry")
|
|
48
|
+
], LocalRequestStatusLogEntry);
|
|
49
|
+
exports.LocalRequestStatusLogEntry = LocalRequestStatusLogEntry;
|
|
50
|
+
//# sourceMappingURL=LocalRequestStatusLogEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalRequestStatusLogEntry.js","sourceRoot":"","sources":["../../../../src/modules/requests/local/LocalRequestStatusLogEntry.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA8D;AAC9D,gDAA2F;AAC3F,6DAAyD;AAWzD,IAAa,0BAA0B,GAAvC,MAAa,0BAA2B,SAAQ,4BAAgB;IAqBrD,MAAM,CAAC,IAAI,CAAC,KAAkC;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;CACJ,CAAA;AArBG;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACO,oBAAQ;6DAAA;AAI1B;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;;6DACyB;AAIpC;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;;6DACyB;AAIpC;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACT;AAIpB;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACT;AAnBX,0BAA0B;IADtC,IAAA,gBAAI,EAAC,4BAA4B,CAAC;GACtB,0BAA0B,CAwBtC;AAxBY,gEAA0B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IResponse, Response } from "@nmshd/content";
|
|
2
|
+
import { CoreDate, CoreId, CoreSerializable, ICoreDate, ICoreId, ICoreSerializable } from "@nmshd/transport";
|
|
3
|
+
export interface ILocalResponseSource extends ICoreSerializable {
|
|
4
|
+
type: "Message" | "RelationshipChange";
|
|
5
|
+
reference: ICoreId;
|
|
6
|
+
}
|
|
7
|
+
export declare class LocalResponseSource extends CoreSerializable implements ILocalResponseSource {
|
|
8
|
+
type: "Message" | "RelationshipChange";
|
|
9
|
+
reference: CoreId;
|
|
10
|
+
static from(value: ILocalResponseSource): LocalResponseSource;
|
|
11
|
+
}
|
|
12
|
+
export interface ILocalResponse extends ICoreSerializable {
|
|
13
|
+
createdAt: ICoreDate;
|
|
14
|
+
content: IResponse;
|
|
15
|
+
source?: ILocalResponseSource;
|
|
16
|
+
}
|
|
17
|
+
export declare class LocalResponse extends CoreSerializable implements ILocalResponse {
|
|
18
|
+
createdAt: CoreDate;
|
|
19
|
+
content: Response;
|
|
20
|
+
source?: LocalResponseSource;
|
|
21
|
+
static from(value: ILocalResponse): LocalResponse;
|
|
22
|
+
}
|
|
@@ -9,11 +9,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.LocalResponse = exports.LocalResponseSource = void 0;
|
|
13
13
|
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
14
14
|
const content_1 = require("@nmshd/content");
|
|
15
15
|
const transport_1 = require("@nmshd/transport");
|
|
16
|
-
let
|
|
16
|
+
let LocalResponseSource = class LocalResponseSource extends transport_1.CoreSerializable {
|
|
17
17
|
static from(value) {
|
|
18
18
|
return this.fromAny(value);
|
|
19
19
|
}
|
|
@@ -22,17 +22,17 @@ __decorate([
|
|
|
22
22
|
(0, ts_serval_1.serialize)(),
|
|
23
23
|
(0, ts_serval_1.validate)(),
|
|
24
24
|
__metadata("design:type", String)
|
|
25
|
-
],
|
|
25
|
+
], LocalResponseSource.prototype, "type", void 0);
|
|
26
26
|
__decorate([
|
|
27
27
|
(0, ts_serval_1.serialize)(),
|
|
28
28
|
(0, ts_serval_1.validate)(),
|
|
29
29
|
__metadata("design:type", transport_1.CoreId)
|
|
30
|
-
],
|
|
31
|
-
|
|
32
|
-
(0, ts_serval_1.type)("
|
|
33
|
-
],
|
|
34
|
-
exports.
|
|
35
|
-
let
|
|
30
|
+
], LocalResponseSource.prototype, "reference", void 0);
|
|
31
|
+
LocalResponseSource = __decorate([
|
|
32
|
+
(0, ts_serval_1.type)("LocalResponseSource")
|
|
33
|
+
], LocalResponseSource);
|
|
34
|
+
exports.LocalResponseSource = LocalResponseSource;
|
|
35
|
+
let LocalResponse = class LocalResponse extends transport_1.CoreSerializable {
|
|
36
36
|
static from(value) {
|
|
37
37
|
return this.fromAny(value);
|
|
38
38
|
}
|
|
@@ -41,19 +41,19 @@ __decorate([
|
|
|
41
41
|
(0, ts_serval_1.serialize)(),
|
|
42
42
|
(0, ts_serval_1.validate)(),
|
|
43
43
|
__metadata("design:type", transport_1.CoreDate)
|
|
44
|
-
],
|
|
44
|
+
], LocalResponse.prototype, "createdAt", void 0);
|
|
45
45
|
__decorate([
|
|
46
46
|
(0, ts_serval_1.serialize)(),
|
|
47
47
|
(0, ts_serval_1.validate)(),
|
|
48
48
|
__metadata("design:type", content_1.Response)
|
|
49
|
-
],
|
|
49
|
+
], LocalResponse.prototype, "content", void 0);
|
|
50
50
|
__decorate([
|
|
51
51
|
(0, ts_serval_1.serialize)(),
|
|
52
52
|
(0, ts_serval_1.validate)({ nullable: true }),
|
|
53
|
-
__metadata("design:type",
|
|
54
|
-
],
|
|
55
|
-
|
|
56
|
-
(0, ts_serval_1.type)("
|
|
57
|
-
],
|
|
58
|
-
exports.
|
|
59
|
-
//# sourceMappingURL=
|
|
53
|
+
__metadata("design:type", LocalResponseSource)
|
|
54
|
+
], LocalResponse.prototype, "source", void 0);
|
|
55
|
+
LocalResponse = __decorate([
|
|
56
|
+
(0, ts_serval_1.type)("LocalResponse")
|
|
57
|
+
], LocalResponse);
|
|
58
|
+
exports.LocalResponse = LocalResponse;
|
|
59
|
+
//# sourceMappingURL=LocalResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalResponse.js","sourceRoot":"","sources":["../../../../src/modules/requests/local/LocalResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA8D;AAC9D,4CAAoD;AACpD,gDAA4G;AAQ5G,IAAa,mBAAmB,GAAhC,MAAa,mBAAoB,SAAQ,4BAAgB;IAS9C,MAAM,CAAC,IAAI,CAAC,KAA2B;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;CACJ,CAAA;AATG;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;;iDACkC;AAI7C;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACO,kBAAM;sDAAA;AAPf,mBAAmB;IAD/B,IAAA,gBAAI,EAAC,qBAAqB,CAAC;GACf,mBAAmB,CAY/B;AAZY,kDAAmB;AAqBhC,IAAa,aAAa,GAA1B,MAAa,aAAc,SAAQ,4BAAgB;IAaxC,MAAM,CAAC,IAAI,CAAC,KAAqB;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;CACJ,CAAA;AAbG;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACO,oBAAQ;gDAAA;AAI1B;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,GAAE;8BACK,kBAAQ;8CAAA;AAIxB;IAFC,IAAA,qBAAS,GAAE;IACX,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACb,mBAAmB;6CAAA;AAX1B,aAAa;IADzB,IAAA,gBAAI,EAAC,eAAe,CAAC;GACT,aAAa,CAgBzB;AAhBY,sCAAa"}
|
|
@@ -3,7 +3,7 @@ import { ConsumptionBaseController } from "../../../consumption";
|
|
|
3
3
|
import { ConsumptionController } from "../../../consumption/ConsumptionController";
|
|
4
4
|
import { RequestItemProcessorRegistry } from "../itemProcessors/RequestItemProcessorRegistry";
|
|
5
5
|
import { ValidationResult } from "../itemProcessors/ValidationResult";
|
|
6
|
-
import {
|
|
6
|
+
import { LocalRequest } from "../local/LocalRequest";
|
|
7
7
|
import { ICompleteOugoingRequestParameters } from "./completeOutgoingRequest/CompleteOutgoingRequestParameters";
|
|
8
8
|
import { ICreateOutgoingRequestFromRelationshipCreationChangeParameters } from "./createFromRelationshipCreationChange/CreateOutgoingRequestFromRelationshipCreationChangeParameters";
|
|
9
9
|
import { ICreateOutgoingRequestParameters } from "./createOutgoingRequest/CreateOutgoingRequestParameters";
|
|
@@ -16,19 +16,19 @@ export declare class OutgoingRequestsController extends ConsumptionBaseControlle
|
|
|
16
16
|
private canCreateItems;
|
|
17
17
|
private canCreateItem;
|
|
18
18
|
private canCreateItemGroup;
|
|
19
|
-
create(params: ICreateOutgoingRequestParameters): Promise<
|
|
19
|
+
create(params: ICreateOutgoingRequestParameters): Promise<LocalRequest>;
|
|
20
20
|
private _create;
|
|
21
|
-
createFromRelationshipCreationChange(params: ICreateOutgoingRequestFromRelationshipCreationChangeParameters): Promise<
|
|
22
|
-
sent(params: ISentOutgoingRequestParameters): Promise<
|
|
21
|
+
createFromRelationshipCreationChange(params: ICreateOutgoingRequestFromRelationshipCreationChangeParameters): Promise<LocalRequest>;
|
|
22
|
+
sent(params: ISentOutgoingRequestParameters): Promise<LocalRequest>;
|
|
23
23
|
private _sent;
|
|
24
24
|
private getSourceType;
|
|
25
|
-
complete(params: ICompleteOugoingRequestParameters): Promise<
|
|
25
|
+
complete(params: ICompleteOugoingRequestParameters): Promise<LocalRequest>;
|
|
26
26
|
private _complete;
|
|
27
27
|
private canComplete;
|
|
28
28
|
private applyItems;
|
|
29
29
|
private applyItem;
|
|
30
|
-
getOutgoingRequests(query?: any): Promise<
|
|
31
|
-
getOutgoingRequest(id: ICoreId): Promise<
|
|
30
|
+
getOutgoingRequests(query?: any): Promise<LocalRequest[]>;
|
|
31
|
+
getOutgoingRequest(id: ICoreId): Promise<LocalRequest | undefined>;
|
|
32
32
|
private getOrThrow;
|
|
33
33
|
private update;
|
|
34
34
|
private assertRequestStatus;
|
|
@@ -5,9 +5,9 @@ const content_1 = require("@nmshd/content");
|
|
|
5
5
|
const transport_1 = require("@nmshd/transport");
|
|
6
6
|
const consumption_1 = require("../../../consumption");
|
|
7
7
|
const ValidationResult_1 = require("../itemProcessors/ValidationResult");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
8
|
+
const LocalRequest_1 = require("../local/LocalRequest");
|
|
9
|
+
const LocalRequestStatus_1 = require("../local/LocalRequestStatus");
|
|
10
|
+
const LocalResponse_1 = require("../local/LocalResponse");
|
|
11
11
|
const CompleteOutgoingRequestParameters_1 = require("./completeOutgoingRequest/CompleteOutgoingRequestParameters");
|
|
12
12
|
const CreateOutgoingRequestFromRelationshipCreationChangeParameters_1 = require("./createFromRelationshipCreationChange/CreateOutgoingRequestFromRelationshipCreationChangeParameters");
|
|
13
13
|
const CreateOutgoingRequestParameters_1 = require("./createOutgoingRequest/CreateOutgoingRequestParameters");
|
|
@@ -66,13 +66,13 @@ class OutgoingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
66
66
|
if (canCreateResult.isError()) {
|
|
67
67
|
throw canCreateResult.error;
|
|
68
68
|
}
|
|
69
|
-
const consumptionRequest =
|
|
69
|
+
const consumptionRequest = LocalRequest_1.LocalRequest.from({
|
|
70
70
|
id: id,
|
|
71
71
|
content: content,
|
|
72
72
|
createdAt: transport_1.CoreDate.utc(),
|
|
73
73
|
isOwn: true,
|
|
74
74
|
peer: peer,
|
|
75
|
-
status:
|
|
75
|
+
status: LocalRequestStatus_1.LocalRequestStatus.Draft,
|
|
76
76
|
statusLog: []
|
|
77
77
|
});
|
|
78
78
|
await this.consumptionRequests.create(consumptionRequest);
|
|
@@ -103,9 +103,9 @@ class OutgoingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
103
103
|
}
|
|
104
104
|
async _sent(requestId, requestSourceObject) {
|
|
105
105
|
const request = await this.getOrThrow(requestId);
|
|
106
|
-
this.assertRequestStatus(request,
|
|
107
|
-
request.changeStatus(
|
|
108
|
-
request.source =
|
|
106
|
+
this.assertRequestStatus(request, LocalRequestStatus_1.LocalRequestStatus.Draft);
|
|
107
|
+
request.changeStatus(LocalRequestStatus_1.LocalRequestStatus.Open);
|
|
108
|
+
request.source = LocalRequest_1.LocalRequestSource.from({
|
|
109
109
|
reference: requestSourceObject.id,
|
|
110
110
|
type: this.getSourceType(requestSourceObject)
|
|
111
111
|
});
|
|
@@ -133,7 +133,7 @@ class OutgoingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
133
133
|
}
|
|
134
134
|
async _complete(requestId, responseSourceObject, receivedResponse) {
|
|
135
135
|
const request = await this.getOrThrow(requestId);
|
|
136
|
-
this.assertRequestStatus(request,
|
|
136
|
+
this.assertRequestStatus(request, LocalRequestStatus_1.LocalRequestStatus.Open);
|
|
137
137
|
const canComplete = await this.canComplete(request, receivedResponse);
|
|
138
138
|
if (canComplete.isError()) {
|
|
139
139
|
throw canComplete.error;
|
|
@@ -149,13 +149,13 @@ class OutgoingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
149
149
|
else {
|
|
150
150
|
throw new Error("Invalid responseSourceObject");
|
|
151
151
|
}
|
|
152
|
-
const
|
|
152
|
+
const localResponse = LocalResponse_1.LocalResponse.from({
|
|
153
153
|
content: receivedResponse,
|
|
154
154
|
createdAt: transport_1.CoreDate.utc(),
|
|
155
155
|
source: { reference: responseSourceObject.id, type: responseSource }
|
|
156
156
|
});
|
|
157
|
-
request.response =
|
|
158
|
-
request.changeStatus(
|
|
157
|
+
request.response = localResponse;
|
|
158
|
+
request.changeStatus(LocalRequestStatus_1.LocalRequestStatus.Completed);
|
|
159
159
|
await this.update(request);
|
|
160
160
|
return request;
|
|
161
161
|
}
|
|
@@ -206,31 +206,31 @@ class OutgoingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
206
206
|
query ??= {};
|
|
207
207
|
query.isOwn = true;
|
|
208
208
|
const requestDocs = await this.consumptionRequests.find(query);
|
|
209
|
-
const requests = requestDocs.map((r) =>
|
|
209
|
+
const requests = requestDocs.map((r) => LocalRequest_1.LocalRequest.from(r));
|
|
210
210
|
return requests;
|
|
211
211
|
}
|
|
212
212
|
async getOutgoingRequest(id) {
|
|
213
213
|
const requestDoc = await this.consumptionRequests.findOne({ id: id.toString(), isOwn: true });
|
|
214
|
-
const request = requestDoc ?
|
|
214
|
+
const request = requestDoc ? LocalRequest_1.LocalRequest.from(requestDoc) : undefined;
|
|
215
215
|
return request;
|
|
216
216
|
}
|
|
217
217
|
async getOrThrow(id) {
|
|
218
218
|
const request = await this.getOutgoingRequest(id);
|
|
219
219
|
if (!request) {
|
|
220
|
-
throw transport_1.TransportErrors.general.recordNotFound(
|
|
220
|
+
throw transport_1.TransportErrors.general.recordNotFound(LocalRequest_1.LocalRequest, id.toString());
|
|
221
221
|
}
|
|
222
222
|
return request;
|
|
223
223
|
}
|
|
224
224
|
async update(request) {
|
|
225
225
|
const requestDoc = await this.consumptionRequests.findOne({ id: request.id.toString(), isOwn: true });
|
|
226
226
|
if (!requestDoc) {
|
|
227
|
-
throw transport_1.TransportErrors.general.recordNotFound(
|
|
227
|
+
throw transport_1.TransportErrors.general.recordNotFound(LocalRequest_1.LocalRequest, request.id.toString());
|
|
228
228
|
}
|
|
229
229
|
await this.consumptionRequests.update(requestDoc, request);
|
|
230
230
|
}
|
|
231
231
|
assertRequestStatus(request, ...status) {
|
|
232
232
|
if (!status.includes(request.status)) {
|
|
233
|
-
throw new Error(`
|
|
233
|
+
throw new Error(`Local Request has to be in status '${status.join("/")}'.`);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutgoingRequestsController.js","sourceRoot":"","sources":["../../../../src/modules/requests/outgoing/OutgoingRequestsController.ts"],"names":[],"mappings":";;;AAAA,4CASuB;AACvB,gDAUyB;AACzB,sDAA2G;AAG3G,yEAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"OutgoingRequestsController.js","sourceRoot":"","sources":["../../../../src/modules/requests/outgoing/OutgoingRequestsController.ts"],"names":[],"mappings":";;;AAAA,4CASuB;AACvB,gDAUyB;AACzB,sDAA2G;AAG3G,yEAAqE;AACrE,wDAAwE;AACxE,oEAAgE;AAChE,0DAAsD;AACtD,mHAGoE;AACpE,wLAG6G;AAC7G,6GAGgE;AAChE,uGAG4D;AAE5D,MAAa,0BAA2B,SAAQ,uCAAyB;IACrE,YACqB,mBAA2C,EAC3C,iBAA+C,EAChE,MAA6B;QAE7B,KAAK,CAAC,uCAAyB,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAA;QAJ1C,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