@nmshd/consumption 2.0.0-beta.24 → 2.0.0-beta.26
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/ConsumptionError.d.ts +2 -0
- package/dist/consumption/ConsumptionError.js +7 -0
- package/dist/consumption/ConsumptionError.js.map +1 -0
- package/dist/consumption/{ConsumptionErrors.d.ts → CoreErrors.d.ts} +1 -12
- package/dist/consumption/{ConsumptionErrors.js → CoreErrors.js} +8 -29
- package/dist/consumption/CoreErrors.js.map +1 -0
- package/dist/consumption/index.d.ts +2 -1
- package/dist/consumption/index.js +2 -1
- package/dist/consumption/index.js.map +1 -1
- package/dist/modules/attributes/AttributesController.js +5 -5
- package/dist/modules/attributes/AttributesController.js.map +1 -1
- package/dist/modules/attributes/local/QueryTranslator.js +2 -1
- package/dist/modules/attributes/local/QueryTranslator.js.map +1 -1
- package/dist/modules/drafts/DraftsController.js +2 -2
- package/dist/modules/drafts/DraftsController.js.map +1 -1
- package/dist/modules/requests/events/IncomingRequestReceivedEvent.js +2 -1
- package/dist/modules/requests/events/IncomingRequestReceivedEvent.js.map +1 -1
- package/dist/modules/requests/events/IncomingRequestStatusChangedEvent.js +2 -1
- package/dist/modules/requests/events/IncomingRequestStatusChangedEvent.js.map +1 -1
- package/dist/modules/requests/events/OutgoingRequestCreatedEvent.d.ts +1 -1
- package/dist/modules/requests/events/OutgoingRequestCreatedEvent.js +2 -1
- package/dist/modules/requests/events/OutgoingRequestCreatedEvent.js.map +1 -1
- package/dist/modules/requests/events/OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent.d.ts +1 -1
- package/dist/modules/requests/events/OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent.js +2 -1
- package/dist/modules/requests/events/OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent.js.map +1 -1
- package/dist/modules/requests/events/OutgoingRequestStatusChangedEvent.js +2 -1
- package/dist/modules/requests/events/OutgoingRequestStatusChangedEvent.js.map +1 -1
- package/dist/modules/requests/incoming/DecideRequestParametersValidator.js +9 -9
- package/dist/modules/requests/incoming/DecideRequestParametersValidator.js.map +1 -1
- package/dist/modules/requests/incoming/IncomingRequestsController.js +13 -13
- package/dist/modules/requests/incoming/IncomingRequestsController.js.map +1 -1
- package/dist/modules/requests/itemProcessors/RequestItemProcessorRegistry.js +3 -2
- package/dist/modules/requests/itemProcessors/RequestItemProcessorRegistry.js.map +1 -1
- package/dist/modules/requests/itemProcessors/createAttribute/CreateAttributeRequestItemProcessor.js +3 -3
- package/dist/modules/requests/itemProcessors/createAttribute/CreateAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/proposeAttribute/ProposeAttributeRequestItemProcessor.js +4 -4
- package/dist/modules/requests/itemProcessors/proposeAttribute/ProposeAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/readAttribute/AcceptReadAttributeRequestItemParameters.js +4 -2
- package/dist/modules/requests/itemProcessors/readAttribute/AcceptReadAttributeRequestItemParameters.js.map +1 -1
- package/dist/modules/requests/itemProcessors/readAttribute/ReadAttributeRequestItemProcessor.js +2 -2
- package/dist/modules/requests/itemProcessors/readAttribute/ReadAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/shareAttribute/ShareAttributeRequestItemProcessor.js +2 -2
- package/dist/modules/requests/itemProcessors/shareAttribute/ShareAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/utility/validateQuery.js +3 -3
- package/dist/modules/requests/itemProcessors/utility/validateQuery.js.map +1 -1
- package/dist/modules/requests/local/LocalRequest.js +3 -2
- package/dist/modules/requests/local/LocalRequest.js.map +1 -1
- package/dist/modules/requests/outgoing/OutgoingRequestsController.js +17 -20
- package/dist/modules/requests/outgoing/OutgoingRequestsController.js.map +1 -1
- package/dist/modules/settings/SettingsController.js +18 -3
- package/dist/modules/settings/SettingsController.js.map +1 -1
- package/lib-web/nmshd.consumption.js +237 -160
- 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 +10 -10
- package/dist/consumption/ConsumptionErrors.js.map +0 -1
|
@@ -17,10 +17,10 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
|
17
17
|
const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
|
|
18
18
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
19
19
|
exports.buildInformation = {
|
|
20
|
-
version: "2.0.0-beta.
|
|
21
|
-
build: "
|
|
22
|
-
date: "2022-09-
|
|
23
|
-
commit: "
|
|
20
|
+
version: "2.0.0-beta.26",
|
|
21
|
+
build: "78",
|
|
22
|
+
date: "2022-09-29T07:28:06+00:00",
|
|
23
|
+
commit: "b951a4478b0f71ccc8e8d1379bae83129bb3dd82",
|
|
24
24
|
dependencies: {"@js-soft/docdb-querytranslator":"^1.1.0","ts-simple-nameof":"^1.3.1"},
|
|
25
25
|
libraries: {
|
|
26
26
|
transport: transport_1.buildInformation,
|
|
@@ -159,22 +159,59 @@ var ConsumptionControllerName;
|
|
|
159
159
|
|
|
160
160
|
/***/ }),
|
|
161
161
|
|
|
162
|
-
/***/ "./dist/consumption/
|
|
163
|
-
|
|
164
|
-
!*** ./dist/consumption/
|
|
165
|
-
|
|
162
|
+
/***/ "./dist/consumption/ConsumptionError.js":
|
|
163
|
+
/*!**********************************************!*\
|
|
164
|
+
!*** ./dist/consumption/ConsumptionError.js ***!
|
|
165
|
+
\**********************************************/
|
|
166
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
167
|
+
|
|
168
|
+
"use strict";
|
|
169
|
+
|
|
170
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
171
|
+
exports.ConsumptionError = void 0;
|
|
172
|
+
class ConsumptionError extends Error {
|
|
173
|
+
}
|
|
174
|
+
exports.ConsumptionError = ConsumptionError;
|
|
175
|
+
//# sourceMappingURL=ConsumptionError.js.map
|
|
176
|
+
|
|
177
|
+
/***/ }),
|
|
178
|
+
|
|
179
|
+
/***/ "./dist/consumption/ConsumptionIds.js":
|
|
180
|
+
/*!********************************************!*\
|
|
181
|
+
!*** ./dist/consumption/ConsumptionIds.js ***!
|
|
182
|
+
\********************************************/
|
|
166
183
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
167
184
|
|
|
168
185
|
"use strict";
|
|
169
186
|
|
|
170
187
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
171
|
-
exports.
|
|
188
|
+
exports.ConsumptionIds = void 0;
|
|
189
|
+
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
190
|
+
class ConsumptionIds {
|
|
191
|
+
}
|
|
192
|
+
exports.ConsumptionIds = ConsumptionIds;
|
|
193
|
+
ConsumptionIds.draft = new transport_1.CoreIdHelper("LCLDRF");
|
|
194
|
+
ConsumptionIds.setting = new transport_1.CoreIdHelper("LCLSET");
|
|
195
|
+
ConsumptionIds.attribute = new transport_1.CoreIdHelper("ATT");
|
|
196
|
+
ConsumptionIds.request = new transport_1.CoreIdHelper("REQ");
|
|
197
|
+
ConsumptionIds.attributeListener = new transport_1.CoreIdHelper("ATL");
|
|
198
|
+
//# sourceMappingURL=ConsumptionIds.js.map
|
|
199
|
+
|
|
200
|
+
/***/ }),
|
|
201
|
+
|
|
202
|
+
/***/ "./dist/consumption/CoreErrors.js":
|
|
203
|
+
/*!****************************************!*\
|
|
204
|
+
!*** ./dist/consumption/CoreErrors.js ***!
|
|
205
|
+
\****************************************/
|
|
206
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
207
|
+
|
|
208
|
+
"use strict";
|
|
209
|
+
|
|
210
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
211
|
+
exports.CoreErrors = void 0;
|
|
172
212
|
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
173
213
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
174
214
|
class Attributes {
|
|
175
|
-
attributeExists(id) {
|
|
176
|
-
return new transport_1.CoreError("error.consumption.attributes.attributeExists", `Attribute with id '${id}' already exists. Please use succeed instead.`);
|
|
177
|
-
}
|
|
178
215
|
predecessorNotFound(id) {
|
|
179
216
|
return new transport_1.CoreError("error.consumption.attributes.predecessorNotFound", `Attribute with id '${id}' does not exist. Please use create instead.`);
|
|
180
217
|
}
|
|
@@ -186,14 +223,11 @@ class Requests {
|
|
|
186
223
|
constructor() {
|
|
187
224
|
this.decideValidation = new Requests._decideValidation();
|
|
188
225
|
}
|
|
189
|
-
requestExists(id) {
|
|
190
|
-
return new transport_1.CoreError("error.consumption.requests.requestExists", `Request with id ${id} already exists and can't be created.`);
|
|
191
|
-
}
|
|
192
226
|
unexpectedErrorDuringRequestItemProcessing(error) {
|
|
193
|
-
return new transport_1.CoreError("error.consumption.requests.unexpectedErrorDuringRequestItemProcessing", error instanceof Error ? error.message :
|
|
227
|
+
return new transport_1.CoreError("error.consumption.requests.unexpectedErrorDuringRequestItemProcessing", error instanceof Error ? error.message : `Unknown error: '${JSON.stringify(error)}'`, undefined, undefined, error);
|
|
194
228
|
}
|
|
195
229
|
servalErrorDuringRequestItemProcessing(error) {
|
|
196
|
-
return new transport_1.CoreError("error.consumption.requests.servalErrorDuringRequestItemProcessing", error instanceof Error ? error.message :
|
|
230
|
+
return new transport_1.CoreError("error.consumption.requests.servalErrorDuringRequestItemProcessing", error instanceof Error ? error.message : `Serval error: '${JSON.stringify(error)}'`, undefined, undefined, error);
|
|
197
231
|
}
|
|
198
232
|
invalidRequestItem(message) {
|
|
199
233
|
return new transport_1.CoreError("error.consumption.requests.invalidRequestItem", message);
|
|
@@ -219,50 +253,12 @@ Requests._decideValidation = class {
|
|
|
219
253
|
return new ts_utils_1.ApplicationError("error.requests.decide.validation.requestItemGroupAnsweredAsRequestItem", "The RequestItemGroup was answered as a RequestItem.");
|
|
220
254
|
}
|
|
221
255
|
};
|
|
222
|
-
class
|
|
223
|
-
relationshipInfoExists(relationshipId) {
|
|
224
|
-
return new transport_1.CoreError("error.consumption.relationshipInfos.relationshipInfoExists", `RelationshipInfo for Relationship ${relationshipId} already exists.`);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
class Onboarding {
|
|
228
|
-
attributeNotSet(attributeName) {
|
|
229
|
-
return new transport_1.CoreError("error.consumption.onboarding.attributeNotSet", `No attribute with name ${attributeName} set but was required to be shared.`);
|
|
230
|
-
}
|
|
231
|
-
wrongTemplate() {
|
|
232
|
-
return new transport_1.CoreError("error.consumption.onboarding.wrongTemplate", "The given template is in the wrong format.");
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
class ConsumptionErrors {
|
|
256
|
+
class CoreErrors {
|
|
236
257
|
}
|
|
237
|
-
exports.
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
ConsumptionErrors.onboarding = new Onboarding();
|
|
242
|
-
//# sourceMappingURL=ConsumptionErrors.js.map
|
|
243
|
-
|
|
244
|
-
/***/ }),
|
|
245
|
-
|
|
246
|
-
/***/ "./dist/consumption/ConsumptionIds.js":
|
|
247
|
-
/*!********************************************!*\
|
|
248
|
-
!*** ./dist/consumption/ConsumptionIds.js ***!
|
|
249
|
-
\********************************************/
|
|
250
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
251
|
-
|
|
252
|
-
"use strict";
|
|
253
|
-
|
|
254
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
255
|
-
exports.ConsumptionIds = void 0;
|
|
256
|
-
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
257
|
-
class ConsumptionIds {
|
|
258
|
-
}
|
|
259
|
-
exports.ConsumptionIds = ConsumptionIds;
|
|
260
|
-
ConsumptionIds.draft = new transport_1.CoreIdHelper("LCLDRF");
|
|
261
|
-
ConsumptionIds.setting = new transport_1.CoreIdHelper("LCLSET");
|
|
262
|
-
ConsumptionIds.attribute = new transport_1.CoreIdHelper("ATT");
|
|
263
|
-
ConsumptionIds.request = new transport_1.CoreIdHelper("REQ");
|
|
264
|
-
ConsumptionIds.attributeListener = new transport_1.CoreIdHelper("ATL");
|
|
265
|
-
//# sourceMappingURL=ConsumptionIds.js.map
|
|
258
|
+
exports.CoreErrors = CoreErrors;
|
|
259
|
+
CoreErrors.attributes = new Attributes();
|
|
260
|
+
CoreErrors.requests = new Requests();
|
|
261
|
+
//# sourceMappingURL=CoreErrors.js.map
|
|
266
262
|
|
|
267
263
|
/***/ }),
|
|
268
264
|
|
|
@@ -291,8 +287,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
291
287
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
292
288
|
__exportStar(__webpack_require__(/*! ./ConsumptionBaseController */ "./dist/consumption/ConsumptionBaseController.js"), exports);
|
|
293
289
|
__exportStar(__webpack_require__(/*! ./ConsumptionControllerName */ "./dist/consumption/ConsumptionControllerName.js"), exports);
|
|
294
|
-
__exportStar(__webpack_require__(/*! ./
|
|
290
|
+
__exportStar(__webpack_require__(/*! ./ConsumptionError */ "./dist/consumption/ConsumptionError.js"), exports);
|
|
295
291
|
__exportStar(__webpack_require__(/*! ./ConsumptionIds */ "./dist/consumption/ConsumptionIds.js"), exports);
|
|
292
|
+
__exportStar(__webpack_require__(/*! ./CoreErrors */ "./dist/consumption/CoreErrors.js"), exports);
|
|
296
293
|
//# sourceMappingURL=index.js.map
|
|
297
294
|
|
|
298
295
|
/***/ }),
|
|
@@ -700,7 +697,7 @@ class AttributesController extends consumption_1.ConsumptionBaseController {
|
|
|
700
697
|
}
|
|
701
698
|
async createLocalAttributesForNestedAttributeValues(localAttribute) {
|
|
702
699
|
if (!(localAttribute.content instanceof content_1.IdentityAttribute)) {
|
|
703
|
-
throw new
|
|
700
|
+
throw new consumption_1.ConsumptionError("Only Identity Attributes are allowed here");
|
|
704
701
|
}
|
|
705
702
|
const nestedAttributeValues = Object.values(localAttribute.content.value).filter((p) => p instanceof content_1.AbstractAttributeValue);
|
|
706
703
|
for (const propertyValue of nestedAttributeValues) {
|
|
@@ -718,10 +715,10 @@ class AttributesController extends consumption_1.ConsumptionBaseController {
|
|
|
718
715
|
});
|
|
719
716
|
const currentAttribute = LocalAttribute_1.LocalAttribute.from(currentAttributeDoc);
|
|
720
717
|
if (currentAttribute.parentId) {
|
|
721
|
-
throw consumption_1.
|
|
718
|
+
throw consumption_1.CoreErrors.attributes.cannotSucceedAttributesWithAParent(parsedParams.succeeds.toString());
|
|
722
719
|
}
|
|
723
720
|
if (!currentAttributeDoc) {
|
|
724
|
-
throw consumption_1.
|
|
721
|
+
throw consumption_1.CoreErrors.attributes.predecessorNotFound(parsedParams.succeeds.toString());
|
|
725
722
|
}
|
|
726
723
|
if (!parsedParams.successorContent.validFrom) {
|
|
727
724
|
parsedParams.successorContent.validFrom = transport_1.CoreDate.utc();
|
|
@@ -738,7 +735,7 @@ class AttributesController extends consumption_1.ConsumptionBaseController {
|
|
|
738
735
|
const parsedParams = CreateSharedLocalAttributeCopyParams_1.CreateSharedLocalAttributeCopyParams.from(params);
|
|
739
736
|
const sourceAttribute = await this.getLocalAttribute(parsedParams.sourceAttributeId);
|
|
740
737
|
if (!sourceAttribute) {
|
|
741
|
-
throw consumption_1.
|
|
738
|
+
throw consumption_1.CoreErrors.attributes.predecessorNotFound(parsedParams.sourceAttributeId.toString());
|
|
742
739
|
}
|
|
743
740
|
const shareInfo = LocalAttributeShareInfo_1.LocalAttributeShareInfo.from({
|
|
744
741
|
peer: parsedParams.peer,
|
|
@@ -770,7 +767,7 @@ class AttributesController extends consumption_1.ConsumptionBaseController {
|
|
|
770
767
|
[(0, ts_simple_nameof_1.nameof)((c) => c.id)]: params.id.toString()
|
|
771
768
|
});
|
|
772
769
|
if (!current) {
|
|
773
|
-
throw transport_1.
|
|
770
|
+
throw transport_1.CoreErrors.general.recordNotFound(LocalAttribute_1.LocalAttribute, params.id.toString());
|
|
774
771
|
}
|
|
775
772
|
const updatedLocalAttribute = LocalAttribute_1.LocalAttribute.from({
|
|
776
773
|
id: current.id,
|
|
@@ -1286,6 +1283,7 @@ exports.ThirdPartyRelationshipAttributeQueryTranslator = exports.RelationshipAtt
|
|
|
1286
1283
|
const docdb_querytranslator_1 = __webpack_require__(/*! @js-soft/docdb-querytranslator */ "./node_modules/@js-soft/docdb-querytranslator/dist/index.js");
|
|
1287
1284
|
const luxon_1 = __webpack_require__(/*! luxon */ "./node_modules/luxon/build/node/luxon.js");
|
|
1288
1285
|
const ts_simple_nameof_1 = __webpack_require__(/*! ts-simple-nameof */ "./node_modules/ts-simple-nameof/index.js");
|
|
1286
|
+
const consumption_1 = __webpack_require__(/*! ../../../consumption */ "./dist/consumption/index.js");
|
|
1289
1287
|
class IdentityAttributeQueryTranslator {
|
|
1290
1288
|
static translate(query) {
|
|
1291
1289
|
return this.translator.parse({ ...query.toJSON(), attributeType: "IdentityAttribute" });
|
|
@@ -1314,7 +1312,7 @@ IdentityAttributeQueryTranslator.translator = new docdb_querytranslator_1.QueryT
|
|
|
1314
1312
|
if (!input)
|
|
1315
1313
|
return;
|
|
1316
1314
|
if (!Array.isArray(input)) {
|
|
1317
|
-
throw new
|
|
1315
|
+
throw new consumption_1.ConsumptionError("Invalid input: 'tags' must be an array");
|
|
1318
1316
|
}
|
|
1319
1317
|
const inputAsArray = input;
|
|
1320
1318
|
query["$or"] = inputAsArray.map((t) => ({
|
|
@@ -1569,7 +1567,7 @@ class DraftsController extends consumption_1.ConsumptionBaseController {
|
|
|
1569
1567
|
async createDraft(content, type = "") {
|
|
1570
1568
|
const draft = Draft_1.Draft.from({
|
|
1571
1569
|
id: await consumption_1.ConsumptionIds.draft.generate(),
|
|
1572
|
-
content
|
|
1570
|
+
content,
|
|
1573
1571
|
createdAt: new transport_1.CoreDate(),
|
|
1574
1572
|
lastModifiedAt: new transport_1.CoreDate(),
|
|
1575
1573
|
type: type
|
|
@@ -1580,7 +1578,7 @@ class DraftsController extends consumption_1.ConsumptionBaseController {
|
|
|
1580
1578
|
async updateDraft(draft) {
|
|
1581
1579
|
const oldDraft = await this.drafts.read(draft.id.toString());
|
|
1582
1580
|
if (!oldDraft) {
|
|
1583
|
-
throw new
|
|
1581
|
+
throw new consumption_1.ConsumptionError("Draft Not Found");
|
|
1584
1582
|
}
|
|
1585
1583
|
await this.drafts.update(oldDraft, draft);
|
|
1586
1584
|
}
|
|
@@ -1745,11 +1743,12 @@ __exportStar(__webpack_require__(/*! ./settings */ "./dist/modules/settings/inde
|
|
|
1745
1743
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1746
1744
|
exports.IncomingRequestReceivedEvent = void 0;
|
|
1747
1745
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
1746
|
+
const consumption_1 = __webpack_require__(/*! ../../../consumption */ "./dist/consumption/index.js");
|
|
1748
1747
|
class IncomingRequestReceivedEvent extends transport_1.TransportDataEvent {
|
|
1749
1748
|
constructor(eventTargetAddress, data) {
|
|
1750
1749
|
super(IncomingRequestReceivedEvent.namespace, eventTargetAddress, data);
|
|
1751
1750
|
if (data.isOwn)
|
|
1752
|
-
throw new
|
|
1751
|
+
throw new consumption_1.ConsumptionError("Cannot create this event for an outgoing Request");
|
|
1753
1752
|
}
|
|
1754
1753
|
}
|
|
1755
1754
|
exports.IncomingRequestReceivedEvent = IncomingRequestReceivedEvent;
|
|
@@ -1769,11 +1768,12 @@ IncomingRequestReceivedEvent.namespace = "consumption.incomingRequestReceived";
|
|
|
1769
1768
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1770
1769
|
exports.IncomingRequestStatusChangedEvent = void 0;
|
|
1771
1770
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
1771
|
+
const consumption_1 = __webpack_require__(/*! ../../../consumption */ "./dist/consumption/index.js");
|
|
1772
1772
|
class IncomingRequestStatusChangedEvent extends transport_1.TransportDataEvent {
|
|
1773
1773
|
constructor(eventTargetAddress, data) {
|
|
1774
1774
|
super(IncomingRequestStatusChangedEvent.namespace, eventTargetAddress, data);
|
|
1775
1775
|
if (data.request.isOwn)
|
|
1776
|
-
throw new
|
|
1776
|
+
throw new consumption_1.ConsumptionError("Cannot create this event for an outgoing Request");
|
|
1777
1777
|
}
|
|
1778
1778
|
}
|
|
1779
1779
|
exports.IncomingRequestStatusChangedEvent = IncomingRequestStatusChangedEvent;
|
|
@@ -1793,11 +1793,12 @@ IncomingRequestStatusChangedEvent.namespace = "consumption.incomingRequestStatus
|
|
|
1793
1793
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1794
1794
|
exports.OutgoingRequestCreatedEvent = void 0;
|
|
1795
1795
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
1796
|
+
const consumption_1 = __webpack_require__(/*! ../../../consumption */ "./dist/consumption/index.js");
|
|
1796
1797
|
class OutgoingRequestCreatedEvent extends transport_1.TransportDataEvent {
|
|
1797
1798
|
constructor(eventTargetAddress, data) {
|
|
1798
1799
|
super(OutgoingRequestCreatedEvent.namespace, eventTargetAddress, data);
|
|
1799
1800
|
if (!data.isOwn)
|
|
1800
|
-
throw new
|
|
1801
|
+
throw new consumption_1.ConsumptionError("Cannot create this event for an incoming Request");
|
|
1801
1802
|
}
|
|
1802
1803
|
}
|
|
1803
1804
|
exports.OutgoingRequestCreatedEvent = OutgoingRequestCreatedEvent;
|
|
@@ -1817,11 +1818,12 @@ OutgoingRequestCreatedEvent.namespace = "consumption.outgoingRequestCreated";
|
|
|
1817
1818
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1818
1819
|
exports.OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent = void 0;
|
|
1819
1820
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
1821
|
+
const consumption_1 = __webpack_require__(/*! ../../../consumption */ "./dist/consumption/index.js");
|
|
1820
1822
|
class OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent extends transport_1.TransportDataEvent {
|
|
1821
1823
|
constructor(eventTargetAddress, data) {
|
|
1822
1824
|
super(OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent.namespace, eventTargetAddress, data);
|
|
1823
1825
|
if (!data.isOwn)
|
|
1824
|
-
throw new
|
|
1826
|
+
throw new consumption_1.ConsumptionError("Cannot create this event for an incoming Request");
|
|
1825
1827
|
}
|
|
1826
1828
|
}
|
|
1827
1829
|
exports.OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent = OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent;
|
|
@@ -1841,11 +1843,12 @@ OutgoingRequestFromRelationshipCreationChangeCreatedAndCompletedEvent.namespace
|
|
|
1841
1843
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1842
1844
|
exports.OutgoingRequestStatusChangedEvent = void 0;
|
|
1843
1845
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
1846
|
+
const consumption_1 = __webpack_require__(/*! ../../../consumption */ "./dist/consumption/index.js");
|
|
1844
1847
|
class OutgoingRequestStatusChangedEvent extends transport_1.TransportDataEvent {
|
|
1845
1848
|
constructor(eventTargetAddress, data) {
|
|
1846
1849
|
super(OutgoingRequestStatusChangedEvent.namespace, eventTargetAddress, data);
|
|
1847
1850
|
if (!data.request.isOwn)
|
|
1848
|
-
throw new
|
|
1851
|
+
throw new consumption_1.ConsumptionError("Cannot create this event for an incoming Request");
|
|
1849
1852
|
}
|
|
1850
1853
|
}
|
|
1851
1854
|
exports.OutgoingRequestStatusChangedEvent = OutgoingRequestStatusChangedEvent;
|
|
@@ -1905,10 +1908,10 @@ const DecideRequestItemParameters_1 = __webpack_require__(/*! ./decide/DecideReq
|
|
|
1905
1908
|
class DecideRequestParametersValidator {
|
|
1906
1909
|
validate(params, request) {
|
|
1907
1910
|
if (!request.id.equals(transport_1.CoreId.from(params.requestId))) {
|
|
1908
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
1911
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.decideValidation.invalidRequestId());
|
|
1909
1912
|
}
|
|
1910
1913
|
if (params.items.length !== request.content.items.length) {
|
|
1911
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
1914
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.decideValidation.invalidNumberOfItems("Number of items in Request and Response do not match"));
|
|
1912
1915
|
}
|
|
1913
1916
|
const validationResults = request.content.items.map((requestItem, index) => this.checkItemOrGroup(requestItem, params.items[index], params.accept));
|
|
1914
1917
|
return ValidationResult_1.ValidationResult.fromItems(validationResults);
|
|
@@ -1921,29 +1924,29 @@ class DecideRequestParametersValidator {
|
|
|
1921
1924
|
}
|
|
1922
1925
|
checkItem(requestItem, response, isParentAccepted) {
|
|
1923
1926
|
if ((0, DecideRequestItemGroupParameters_1.isDecideRequestItemGroupParametersJSON)(response)) {
|
|
1924
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
1927
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.decideValidation.requestItemAnsweredAsRequestItemGroup());
|
|
1925
1928
|
}
|
|
1926
1929
|
if (!isParentAccepted && response.accept) {
|
|
1927
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
1930
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.decideValidation.itemAcceptedButParentNotAccepted("The RequestItem was accepted, but the parent was not accepted."));
|
|
1928
1931
|
}
|
|
1929
1932
|
if (isParentAccepted && requestItem.mustBeAccepted && !response.accept) {
|
|
1930
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
1933
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.decideValidation.mustBeAcceptedItemNotAccepted("The RequestItem is flagged as 'mustBeAccepted', but it was not accepted."));
|
|
1931
1934
|
}
|
|
1932
1935
|
return ValidationResult_1.ValidationResult.success();
|
|
1933
1936
|
}
|
|
1934
1937
|
checkItemGroup(requestItemGroup, responseItemGroup, isParentAccepted) {
|
|
1935
1938
|
if ((0, DecideRequestItemParameters_1.isDecideRequestItemParametersJSON)(responseItemGroup)) {
|
|
1936
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
1939
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.decideValidation.requestItemGroupAnsweredAsRequestItem());
|
|
1937
1940
|
}
|
|
1938
1941
|
if (responseItemGroup.items.length !== requestItemGroup.items.length) {
|
|
1939
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
1942
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.decideValidation.invalidNumberOfItems("Number of items in RequestItemGroup and ResponseItemGroup do not match"));
|
|
1940
1943
|
}
|
|
1941
1944
|
const isGroupAccepted = responseItemGroup.items.some((value) => value.accept);
|
|
1942
1945
|
if (!isParentAccepted && isGroupAccepted) {
|
|
1943
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
1946
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.decideValidation.itemAcceptedButParentNotAccepted("The RequestItemGroup was accepted, but the parent was not accepted."));
|
|
1944
1947
|
}
|
|
1945
1948
|
if (isParentAccepted && requestItemGroup.mustBeAccepted && !isGroupAccepted) {
|
|
1946
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
1949
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.decideValidation.mustBeAcceptedItemNotAccepted("The RequestItemGroup is flagged as 'mustBeAccepted', but it was not accepted. Please accept all 'mustBeAccepted' items in this group."));
|
|
1947
1950
|
}
|
|
1948
1951
|
const validationResults = requestItemGroup.items.map((requestItem, index) => this.checkItem(requestItem, responseItemGroup.items[index], isGroupAccepted));
|
|
1949
1952
|
return ValidationResult_1.ValidationResult.fromItems(validationResults);
|
|
@@ -2013,7 +2016,7 @@ class IncomingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
2013
2016
|
}
|
|
2014
2017
|
extractInfoFromMessage(message) {
|
|
2015
2018
|
if (message.isOwn)
|
|
2016
|
-
throw new
|
|
2019
|
+
throw new consumption_1.ConsumptionError("Cannot create incoming Request from own Message");
|
|
2017
2020
|
return {
|
|
2018
2021
|
peer: message.cache.createdBy,
|
|
2019
2022
|
source: {
|
|
@@ -2024,7 +2027,7 @@ class IncomingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
2024
2027
|
}
|
|
2025
2028
|
extractInfoFromRelationshipTemplate(template) {
|
|
2026
2029
|
if (template.isOwn)
|
|
2027
|
-
throw new
|
|
2030
|
+
throw new consumption_1.ConsumptionError("Cannot create incoming Request from own Relationship Template");
|
|
2028
2031
|
return {
|
|
2029
2032
|
peer: template.cache.createdBy,
|
|
2030
2033
|
source: {
|
|
@@ -2123,22 +2126,22 @@ class IncomingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
2123
2126
|
}
|
|
2124
2127
|
catch (e) {
|
|
2125
2128
|
if (e instanceof ts_serval_1.ServalError) {
|
|
2126
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
2129
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.servalErrorDuringRequestItemProcessing(e));
|
|
2127
2130
|
}
|
|
2128
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
2131
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.unexpectedErrorDuringRequestItemProcessing(e));
|
|
2129
2132
|
}
|
|
2130
2133
|
}
|
|
2131
2134
|
async accept(params) {
|
|
2132
2135
|
const canAccept = await this.canAccept(params);
|
|
2133
2136
|
if (!canAccept.isSuccess()) {
|
|
2134
|
-
throw new
|
|
2137
|
+
throw new consumption_1.ConsumptionError("Cannot accept the Request with the given parameters. Call 'canAccept' to get more information.");
|
|
2135
2138
|
}
|
|
2136
2139
|
return await this.decide({ ...params, accept: true });
|
|
2137
2140
|
}
|
|
2138
2141
|
async reject(params) {
|
|
2139
2142
|
const canReject = await this.canReject(params);
|
|
2140
2143
|
if (!canReject.isSuccess()) {
|
|
2141
|
-
throw new
|
|
2144
|
+
throw new consumption_1.ConsumptionError("Cannot reject the Request with the given parameters. Call 'canReject' to get more information.");
|
|
2142
2145
|
}
|
|
2143
2146
|
return await this.decide({ ...params, accept: false });
|
|
2144
2147
|
}
|
|
@@ -2173,7 +2176,7 @@ class IncomingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
2173
2176
|
}
|
|
2174
2177
|
async decideGroup(groupItemParam, requestItemGroup, request) {
|
|
2175
2178
|
const items = (await this.decideItems(groupItemParam.items, requestItemGroup.items, request));
|
|
2176
|
-
const group = content_1.ResponseItemGroup.from({ items
|
|
2179
|
+
const group = content_1.ResponseItemGroup.from({ items });
|
|
2177
2180
|
return group;
|
|
2178
2181
|
}
|
|
2179
2182
|
async decideItems(params, requestItems, request) {
|
|
@@ -2203,14 +2206,14 @@ class IncomingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
2203
2206
|
if (e instanceof Error) {
|
|
2204
2207
|
details = ` Details: ${e.message}`;
|
|
2205
2208
|
}
|
|
2206
|
-
throw new
|
|
2209
|
+
throw new consumption_1.ConsumptionError(`An error occurred while processing a '${requestItem.constructor.name}'. You should contact the developer of this RequestItem.${details}}`);
|
|
2207
2210
|
}
|
|
2208
2211
|
}
|
|
2209
2212
|
async complete(params) {
|
|
2210
2213
|
const parsedParams = CompleteIncomingRequestParameters_1.CompleteIncomingRequestParameters.from(params);
|
|
2211
2214
|
const request = await this.getOrThrow(parsedParams.requestId);
|
|
2212
2215
|
if (request.isOwn) {
|
|
2213
|
-
throw new
|
|
2216
|
+
throw new consumption_1.ConsumptionError("Cannot decide own Request");
|
|
2214
2217
|
}
|
|
2215
2218
|
this.assertRequestStatus(request, LocalRequestStatus_1.LocalRequestStatus.Decided);
|
|
2216
2219
|
const requestIsRejected = request.response.content.result === content_1.ResponseResult.Rejected;
|
|
@@ -2222,7 +2225,7 @@ class IncomingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
2222
2225
|
});
|
|
2223
2226
|
}
|
|
2224
2227
|
else if (!requestIsRejected || !requestIsFromTemplate) {
|
|
2225
|
-
throw new
|
|
2228
|
+
throw new consumption_1.ConsumptionError("A Request can only be completed without a responseSource if the Request is rejected and the Request is from a Relationship Template");
|
|
2226
2229
|
}
|
|
2227
2230
|
request.changeStatus(LocalRequestStatus_1.LocalRequestStatus.Completed);
|
|
2228
2231
|
await this.update(request);
|
|
@@ -2251,20 +2254,20 @@ class IncomingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
2251
2254
|
async getOrThrow(id) {
|
|
2252
2255
|
const request = await this.getIncomingRequest(transport_1.CoreId.from(id));
|
|
2253
2256
|
if (!request) {
|
|
2254
|
-
throw transport_1.
|
|
2257
|
+
throw transport_1.CoreErrors.general.recordNotFound(LocalRequest_1.LocalRequest, id.toString());
|
|
2255
2258
|
}
|
|
2256
2259
|
return request;
|
|
2257
2260
|
}
|
|
2258
2261
|
async update(request) {
|
|
2259
2262
|
const requestDoc = await this.localRequests.findOne({ id: request.id.toString(), isOwn: false });
|
|
2260
2263
|
if (!requestDoc) {
|
|
2261
|
-
throw transport_1.
|
|
2264
|
+
throw transport_1.CoreErrors.general.recordNotFound(LocalRequest_1.LocalRequest, request.id.toString());
|
|
2262
2265
|
}
|
|
2263
2266
|
await this.localRequests.update(requestDoc, request);
|
|
2264
2267
|
}
|
|
2265
2268
|
assertRequestStatus(request, ...status) {
|
|
2266
2269
|
if (!status.includes(request.status)) {
|
|
2267
|
-
throw new
|
|
2270
|
+
throw new consumption_1.ConsumptionError(`Local Request has to be in status '${status.join("/")}'.`);
|
|
2268
2271
|
}
|
|
2269
2272
|
}
|
|
2270
2273
|
async updateRequestExpiry(request) {
|
|
@@ -2738,12 +2741,13 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
2738
2741
|
/*!******************************************************************************!*\
|
|
2739
2742
|
!*** ./dist/modules/requests/itemProcessors/RequestItemProcessorRegistry.js ***!
|
|
2740
2743
|
\******************************************************************************/
|
|
2741
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
2744
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2742
2745
|
|
|
2743
2746
|
"use strict";
|
|
2744
2747
|
|
|
2745
2748
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2746
2749
|
exports.RequestItemProcessorRegistry = void 0;
|
|
2750
|
+
const consumption_1 = __webpack_require__(/*! ../../../consumption */ "./dist/consumption/index.js");
|
|
2747
2751
|
class RequestItemProcessorRegistry {
|
|
2748
2752
|
constructor(consumptionController, processors = new Map()) {
|
|
2749
2753
|
this.consumptionController = consumptionController;
|
|
@@ -2751,7 +2755,7 @@ class RequestItemProcessorRegistry {
|
|
|
2751
2755
|
}
|
|
2752
2756
|
registerProcessor(itemConstructor, processorConstructor) {
|
|
2753
2757
|
if (this.processors.has(itemConstructor)) {
|
|
2754
|
-
throw new
|
|
2758
|
+
throw new consumption_1.ConsumptionError(`There is already a processor registered for '${itemConstructor.name}''. Use 'replaceProcessorForType' if you want to replace it.`);
|
|
2755
2759
|
}
|
|
2756
2760
|
this.processors.set(itemConstructor, processorConstructor);
|
|
2757
2761
|
}
|
|
@@ -2761,7 +2765,7 @@ class RequestItemProcessorRegistry {
|
|
|
2761
2765
|
getProcessorForItem(item) {
|
|
2762
2766
|
const constructor = this.processors.get(item.constructor);
|
|
2763
2767
|
if (!constructor) {
|
|
2764
|
-
throw new
|
|
2768
|
+
throw new consumption_1.ConsumptionError(`There was no processor registered for '${item.constructor.name}'.`);
|
|
2765
2769
|
}
|
|
2766
2770
|
return new constructor(this.consumptionController);
|
|
2767
2771
|
}
|
|
@@ -2873,17 +2877,17 @@ class CreateAttributeRequestItemProcessor extends GenericRequestItemProcessor_1.
|
|
|
2873
2877
|
const ownerIsEmptyString = requestItem.attribute.owner.toString() === "";
|
|
2874
2878
|
if (requestItem.attribute instanceof content_1.IdentityAttribute) {
|
|
2875
2879
|
if (senderIsAttributeOwner) {
|
|
2876
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
2880
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.invalidRequestItem("Cannot create own Attributes with a CreateAttributeRequestItem. Use a ShareAttributeRequestItem instead."));
|
|
2877
2881
|
}
|
|
2878
2882
|
if (recipientIsAttributeOwner || ownerIsEmptyString || recipient === undefined) {
|
|
2879
2883
|
return ValidationResult_1.ValidationResult.success();
|
|
2880
2884
|
}
|
|
2881
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
2885
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.invalidRequestItem("The owner of the given `attribute` can only be the recipient's address or an empty string. The latter will default to the recipient's address."));
|
|
2882
2886
|
}
|
|
2883
2887
|
if (recipientIsAttributeOwner || senderIsAttributeOwner || ownerIsEmptyString || recipient === undefined) {
|
|
2884
2888
|
return ValidationResult_1.ValidationResult.success();
|
|
2885
2889
|
}
|
|
2886
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
2890
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.invalidRequestItem("The owner of the given 'attribute' can only be the sender's address, the recipient's address or an empty string. The latter will default to the recipient's address."));
|
|
2887
2891
|
}
|
|
2888
2892
|
async accept(requestItem, _params, requestInfo) {
|
|
2889
2893
|
if (requestItem.attribute.owner.toString() === "") {
|
|
@@ -3024,7 +3028,7 @@ class ProposeAttributeRequestItemProcessor extends GenericRequestItemProcessor_1
|
|
|
3024
3028
|
}
|
|
3025
3029
|
validateAttribute(attribute) {
|
|
3026
3030
|
if (attribute.owner.toString() !== "") {
|
|
3027
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
3031
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.invalidRequestItem("The owner of the given `attribute` can only be an empty string. This is because you can only propose Attributes where the recipient of the Request is the owner anyway. And in order to avoid mistakes, the owner will be automatically filled for you."));
|
|
3028
3032
|
}
|
|
3029
3033
|
return ValidationResult_1.ValidationResult.success();
|
|
3030
3034
|
}
|
|
@@ -3034,7 +3038,7 @@ class ProposeAttributeRequestItemProcessor extends GenericRequestItemProcessor_1
|
|
|
3034
3038
|
return commonQueryValidationResult;
|
|
3035
3039
|
}
|
|
3036
3040
|
if (requestItem.query instanceof content_1.RelationshipAttributeQuery && requestItem.query.owner.toString() !== "") {
|
|
3037
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
3041
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.invalidRequestItem("The owner of the given `query` can only be an empty string. This is because you can only propose Attributes where the recipient of the Request is the owner anyway. And in order to avoid mistakes, the owner will be automatically filled for you."));
|
|
3038
3042
|
}
|
|
3039
3043
|
return ValidationResult_1.ValidationResult.success();
|
|
3040
3044
|
}
|
|
@@ -3044,12 +3048,12 @@ class ProposeAttributeRequestItemProcessor extends GenericRequestItemProcessor_1
|
|
|
3044
3048
|
if (parsedParams.attributeId) {
|
|
3045
3049
|
const localAttribute = await this.consumptionController.attributes.getLocalAttribute(parsedParams.attributeId);
|
|
3046
3050
|
if (!localAttribute) {
|
|
3047
|
-
return ValidationResult_1.ValidationResult.error(transport_1.
|
|
3051
|
+
return ValidationResult_1.ValidationResult.error(transport_1.CoreErrors.general.recordNotFound(LocalAttribute_1.LocalAttribute, requestInfo.id.toString()));
|
|
3048
3052
|
}
|
|
3049
3053
|
attribute = localAttribute.content;
|
|
3050
3054
|
}
|
|
3051
3055
|
if (!attribute.owner.equals(this.currentIdentityAddress)) {
|
|
3052
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
3056
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.invalidRequestItem("The given Attribute belongs to someone else. You can only share own Attributes."));
|
|
3053
3057
|
}
|
|
3054
3058
|
return ValidationResult_1.ValidationResult.success();
|
|
3055
3059
|
}
|
|
@@ -3133,6 +3137,7 @@ const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-s
|
|
|
3133
3137
|
const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
3134
3138
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
3135
3139
|
const ts_simple_nameof_1 = __webpack_require__(/*! ts-simple-nameof */ "./node_modules/ts-simple-nameof/index.js");
|
|
3140
|
+
const consumption_1 = __webpack_require__(/*! ../../../../consumption */ "./dist/consumption/index.js");
|
|
3136
3141
|
let AcceptReadAttributeRequestItemParameters = AcceptReadAttributeRequestItemParameters_1 = class AcceptReadAttributeRequestItemParameters extends ts_serval_1.Serializable {
|
|
3137
3142
|
isWithExistingAttribute() {
|
|
3138
3143
|
return this.existingAttributeId !== undefined;
|
|
@@ -3144,8 +3149,9 @@ let AcceptReadAttributeRequestItemParameters = AcceptReadAttributeRequestItemPar
|
|
|
3144
3149
|
return this.fromAny(value);
|
|
3145
3150
|
}
|
|
3146
3151
|
static postFrom(value) {
|
|
3147
|
-
if (!(value instanceof AcceptReadAttributeRequestItemParameters_1))
|
|
3148
|
-
throw new
|
|
3152
|
+
if (!(value instanceof AcceptReadAttributeRequestItemParameters_1)) {
|
|
3153
|
+
throw new consumption_1.ConsumptionError("this should never happen");
|
|
3154
|
+
}
|
|
3149
3155
|
if (value.existingAttributeId && value.newAttribute) {
|
|
3150
3156
|
throw new ts_serval_1.ValidationError(AcceptReadAttributeRequestItemParameters_1.name, (0, ts_simple_nameof_1.nameof)((x) => x.newAttribute), `You cannot specify both ${(0, ts_simple_nameof_1.nameof)((x) => x.newAttribute)} and ${(0, ts_simple_nameof_1.nameof)((x) => x.existingAttributeId)}.`);
|
|
3151
3157
|
}
|
|
@@ -3207,11 +3213,11 @@ class ReadAttributeRequestItemProcessor extends GenericRequestItemProcessor_1.Ge
|
|
|
3207
3213
|
if (parsedParams.isWithExistingAttribute()) {
|
|
3208
3214
|
const foundAttribute = await this.consumptionController.attributes.getLocalAttribute(parsedParams.existingAttributeId);
|
|
3209
3215
|
if (!foundAttribute) {
|
|
3210
|
-
return ValidationResult_1.ValidationResult.error(transport_1.
|
|
3216
|
+
return ValidationResult_1.ValidationResult.error(transport_1.CoreErrors.general.recordNotFound(LocalAttribute_1.LocalAttribute, requestInfo.id.toString()));
|
|
3211
3217
|
}
|
|
3212
3218
|
const ownerIsCurrentIdentity = this.accountController.identity.isMe(foundAttribute.content.owner);
|
|
3213
3219
|
if (!ownerIsCurrentIdentity) {
|
|
3214
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
3220
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.invalidRequestItem("The given Attribute belongs to someone else. You can only share own Attributes."));
|
|
3215
3221
|
}
|
|
3216
3222
|
}
|
|
3217
3223
|
return ValidationResult_1.ValidationResult.success();
|
|
@@ -3356,13 +3362,13 @@ class ShareAttributeRequestItemProcessor extends GenericRequestItemProcessor_1.G
|
|
|
3356
3362
|
const ownerIsEmpty = requestItem.attribute.owner.toString() === "";
|
|
3357
3363
|
const ownerIsCurrentIdentity = requestItem.attribute.owner.equals(this.currentIdentityAddress);
|
|
3358
3364
|
if (!ownerIsEmpty && !ownerIsCurrentIdentity) {
|
|
3359
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
3365
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.invalidRequestItem("The owner of the given `attribute` can only be an empty string. This is because you can only send Attributes where the recipient of the Request is the owner anyway. And in order to avoid mistakes, the owner will be automatically filled for you."));
|
|
3360
3366
|
}
|
|
3361
3367
|
return ValidationResult_1.ValidationResult.success();
|
|
3362
3368
|
}
|
|
3363
3369
|
canCreateWithRelationshipAttribute(attribute) {
|
|
3364
3370
|
if (attribute.confidentiality === content_1.RelationshipAttributeConfidentiality.Private) {
|
|
3365
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
3371
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.invalidRequestItem("The confidentiality of the given `attribute` is private. Therefore you are not allowed to share it."));
|
|
3366
3372
|
}
|
|
3367
3373
|
return ValidationResult_1.ValidationResult.success();
|
|
3368
3374
|
}
|
|
@@ -3412,13 +3418,13 @@ const ValidationResult_1 = __webpack_require__(/*! ../ValidationResult */ "./dis
|
|
|
3412
3418
|
function validateQuery(query, sender, recipient) {
|
|
3413
3419
|
if (query instanceof content_1.ThirdPartyRelationshipAttributeQuery) {
|
|
3414
3420
|
if (query.thirdParty.equals(sender)) {
|
|
3415
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
3421
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.invalidRequestItem("Cannot query an Attribute with the own address as third party."));
|
|
3416
3422
|
}
|
|
3417
3423
|
if (query.thirdParty.equals(recipient)) {
|
|
3418
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
3424
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.invalidRequestItem("Cannot query an Attribute with the recipient's address as third party."));
|
|
3419
3425
|
}
|
|
3420
3426
|
if (query.owner.equals(sender)) {
|
|
3421
|
-
return ValidationResult_1.ValidationResult.error(consumption_1.
|
|
3427
|
+
return ValidationResult_1.ValidationResult.error(consumption_1.CoreErrors.requests.invalidRequestItem("Cannot query own Attributes from a third party."));
|
|
3422
3428
|
}
|
|
3423
3429
|
}
|
|
3424
3430
|
return ValidationResult_1.ValidationResult.success();
|
|
@@ -3450,6 +3456,7 @@ exports.LocalRequest = exports.LocalRequestSource = void 0;
|
|
|
3450
3456
|
const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
|
|
3451
3457
|
const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
3452
3458
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
3459
|
+
const consumption_1 = __webpack_require__(/*! ../../../consumption */ "./dist/consumption/index.js");
|
|
3453
3460
|
const LocalRequestStatus_1 = __webpack_require__(/*! ./LocalRequestStatus */ "./dist/modules/requests/local/LocalRequestStatus.js");
|
|
3454
3461
|
const LocalRequestStatusLogEntry_1 = __webpack_require__(/*! ./LocalRequestStatusLogEntry */ "./dist/modules/requests/local/LocalRequestStatusLogEntry.js");
|
|
3455
3462
|
const LocalResponse_1 = __webpack_require__(/*! ./LocalResponse */ "./dist/modules/requests/local/LocalResponse.js");
|
|
@@ -3475,7 +3482,7 @@ exports.LocalRequestSource = LocalRequestSource;
|
|
|
3475
3482
|
let LocalRequest = class LocalRequest extends transport_1.CoreSynchronizable {
|
|
3476
3483
|
changeStatus(newStatus) {
|
|
3477
3484
|
if (this.status === newStatus)
|
|
3478
|
-
throw new
|
|
3485
|
+
throw new consumption_1.ConsumptionError("cannot change status to the same status");
|
|
3479
3486
|
const logEntry = LocalRequestStatusLogEntry_1.LocalRequestStatusLogEntry.from({
|
|
3480
3487
|
createdAt: transport_1.CoreDate.utc(),
|
|
3481
3488
|
oldStatus: this.status,
|
|
@@ -3486,7 +3493,7 @@ let LocalRequest = class LocalRequest extends transport_1.CoreSynchronizable {
|
|
|
3486
3493
|
}
|
|
3487
3494
|
sent(source) {
|
|
3488
3495
|
if (this.status !== LocalRequestStatus_1.LocalRequestStatus.Draft) {
|
|
3489
|
-
throw new
|
|
3496
|
+
throw new consumption_1.ConsumptionError("Local Request has to be in status 'Draft'.");
|
|
3490
3497
|
}
|
|
3491
3498
|
this.source = source;
|
|
3492
3499
|
this.changeStatus(LocalRequestStatus_1.LocalRequestStatus.Open);
|
|
@@ -3783,16 +3790,13 @@ class OutgoingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
3783
3790
|
return request;
|
|
3784
3791
|
}
|
|
3785
3792
|
async _create(id, content, peer) {
|
|
3786
|
-
const canCreateResult = await this.canCreate({
|
|
3787
|
-
content,
|
|
3788
|
-
peer
|
|
3789
|
-
});
|
|
3793
|
+
const canCreateResult = await this.canCreate({ content, peer });
|
|
3790
3794
|
if (canCreateResult.isError()) {
|
|
3791
3795
|
throw canCreateResult.error;
|
|
3792
3796
|
}
|
|
3793
3797
|
const request = LocalRequest_1.LocalRequest.from({
|
|
3794
3798
|
id: id,
|
|
3795
|
-
content
|
|
3799
|
+
content,
|
|
3796
3800
|
createdAt: transport_1.CoreDate.utc(),
|
|
3797
3801
|
isOwn: true,
|
|
3798
3802
|
peer: peer,
|
|
@@ -3805,17 +3809,17 @@ class OutgoingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
3805
3809
|
async createFromRelationshipCreationChange(params) {
|
|
3806
3810
|
const parsedParams = CreateOutgoingRequestFromRelationshipCreationChangeParameters_1.CreateOutgoingRequestFromRelationshipCreationChangeParameters.from(params);
|
|
3807
3811
|
const peer = parsedParams.creationChange.request.createdBy;
|
|
3808
|
-
const
|
|
3809
|
-
if (!(
|
|
3810
|
-
throw new
|
|
3812
|
+
const requestContent = parsedParams.creationChange.request.content;
|
|
3813
|
+
if (!(requestContent instanceof content_1.RelationshipCreationChangeRequestContent)) {
|
|
3814
|
+
throw new consumption_1.ConsumptionError("The content of the request is not supported as it is not type of RelationshipCreationChangeRequestContent.");
|
|
3811
3815
|
}
|
|
3812
|
-
const receivedResponse =
|
|
3816
|
+
const receivedResponse = requestContent.response;
|
|
3813
3817
|
const id = receivedResponse.requestId;
|
|
3814
3818
|
const templateContent = parsedParams.template.cache.content;
|
|
3815
|
-
if (!(templateContent instanceof content_1.
|
|
3816
|
-
throw new
|
|
3819
|
+
if (!(templateContent instanceof content_1.RelationshipTemplateContent)) {
|
|
3820
|
+
throw new consumption_1.ConsumptionError("The content of the template is not supported as it is not type of RelationshipTemplateContent.");
|
|
3817
3821
|
}
|
|
3818
|
-
// TODO: is this the correct request (=> could be
|
|
3822
|
+
// TODO: is this the correct request (=> could be RelationshipTemplateContent#existingRelationshipRequest)
|
|
3819
3823
|
await this._create(id, templateContent.onNewRelationship, peer);
|
|
3820
3824
|
await this._sent(id, parsedParams.template);
|
|
3821
3825
|
const request = await this._complete(id, parsedParams.creationChange, receivedResponse);
|
|
@@ -3846,17 +3850,17 @@ class OutgoingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
3846
3850
|
getSourceType(sourceObject) {
|
|
3847
3851
|
if (sourceObject instanceof transport_1.Message) {
|
|
3848
3852
|
if (!sourceObject.isOwn) {
|
|
3849
|
-
throw new
|
|
3853
|
+
throw new consumption_1.ConsumptionError("Cannot create outgoing Request from a peer Message");
|
|
3850
3854
|
}
|
|
3851
3855
|
return "Message";
|
|
3852
3856
|
}
|
|
3853
3857
|
else if (sourceObject instanceof transport_1.RelationshipTemplate) {
|
|
3854
3858
|
if (!sourceObject.isOwn) {
|
|
3855
|
-
throw new
|
|
3859
|
+
throw new consumption_1.ConsumptionError("Cannot create outgoing Request from a peer Relationship Template");
|
|
3856
3860
|
}
|
|
3857
3861
|
return "RelationshipTemplate";
|
|
3858
3862
|
}
|
|
3859
|
-
throw new
|
|
3863
|
+
throw new consumption_1.ConsumptionError("The given sourceObject is not of a valid type. Valid types are 'Message' and 'RelationshipTemplate'.");
|
|
3860
3864
|
}
|
|
3861
3865
|
async complete(params) {
|
|
3862
3866
|
const parsedParams = CompleteOutgoingRequestParameters_1.CompleteOugoingRequestParameters.from(params);
|
|
@@ -3875,7 +3879,7 @@ class OutgoingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
3875
3879
|
? responseSourceObject.cache.createdAt
|
|
3876
3880
|
: responseSourceObject.request.createdAt;
|
|
3877
3881
|
if (request.status === LocalRequestStatus_1.LocalRequestStatus.Expired && request.isExpired(responseSourceObjectCreationDate)) {
|
|
3878
|
-
throw new
|
|
3882
|
+
throw new consumption_1.ConsumptionError("Cannot complete an expired request with a response that was created before the expiration date");
|
|
3879
3883
|
}
|
|
3880
3884
|
const canComplete = await this.canComplete(request, receivedResponse);
|
|
3881
3885
|
if (canComplete.isError()) {
|
|
@@ -3890,7 +3894,7 @@ class OutgoingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
3890
3894
|
responseSource = "RelationshipChange";
|
|
3891
3895
|
}
|
|
3892
3896
|
else {
|
|
3893
|
-
throw new
|
|
3897
|
+
throw new consumption_1.ConsumptionError("Invalid responseSourceObject");
|
|
3894
3898
|
}
|
|
3895
3899
|
const localResponse = LocalResponse_1.LocalResponse.from({
|
|
3896
3900
|
content: receivedResponse,
|
|
@@ -3968,20 +3972,20 @@ class OutgoingRequestsController extends consumption_1.ConsumptionBaseController
|
|
|
3968
3972
|
async getOrThrow(id) {
|
|
3969
3973
|
const request = await this.getOutgoingRequest(id);
|
|
3970
3974
|
if (!request) {
|
|
3971
|
-
throw transport_1.
|
|
3975
|
+
throw transport_1.CoreErrors.general.recordNotFound(LocalRequest_1.LocalRequest, id.toString());
|
|
3972
3976
|
}
|
|
3973
3977
|
return request;
|
|
3974
3978
|
}
|
|
3975
3979
|
async update(request) {
|
|
3976
3980
|
const requestDoc = await this.localRequests.findOne({ id: request.id.toString(), isOwn: true });
|
|
3977
3981
|
if (!requestDoc) {
|
|
3978
|
-
throw transport_1.
|
|
3982
|
+
throw transport_1.CoreErrors.general.recordNotFound(LocalRequest_1.LocalRequest, request.id.toString());
|
|
3979
3983
|
}
|
|
3980
3984
|
await this.localRequests.update(requestDoc, request);
|
|
3981
3985
|
}
|
|
3982
3986
|
assertRequestStatus(request, ...status) {
|
|
3983
3987
|
if (!status.includes(request.status)) {
|
|
3984
|
-
throw new
|
|
3988
|
+
throw new consumption_1.ConsumptionError(`Local Request has to be in status '${status.join("/")}'.`);
|
|
3985
3989
|
}
|
|
3986
3990
|
}
|
|
3987
3991
|
async updateRequestExpiry(request) {
|
|
@@ -4228,12 +4232,22 @@ exports.SentOutgoingRequestParameters = SentOutgoingRequestParameters;
|
|
|
4228
4232
|
/*!*****************************************************!*\
|
|
4229
4233
|
!*** ./dist/modules/settings/SettingsController.js ***!
|
|
4230
4234
|
\*****************************************************/
|
|
4231
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
4235
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
4232
4236
|
|
|
4233
4237
|
"use strict";
|
|
4234
4238
|
|
|
4239
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4240
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4241
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4242
|
+
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;
|
|
4243
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4244
|
+
};
|
|
4245
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
4246
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
4247
|
+
};
|
|
4235
4248
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4236
4249
|
exports.SettingsController = void 0;
|
|
4250
|
+
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
4237
4251
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
4238
4252
|
const consumption_1 = __webpack_require__(/*! ../../consumption */ "./dist/consumption/index.js");
|
|
4239
4253
|
const Setting_1 = __webpack_require__(/*! ./local/Setting */ "./dist/modules/settings/local/Setting.js");
|
|
@@ -4270,15 +4284,20 @@ class SettingsController extends consumption_1.ConsumptionBaseController {
|
|
|
4270
4284
|
}
|
|
4271
4285
|
async updateSetting(setting) {
|
|
4272
4286
|
const oldSetting = await this.settings.read(setting.id.toString());
|
|
4273
|
-
if (!oldSetting)
|
|
4274
|
-
throw transport_1.
|
|
4275
|
-
}
|
|
4287
|
+
if (!oldSetting)
|
|
4288
|
+
throw transport_1.CoreErrors.general.recordNotFound(Setting_1.Setting, setting.id.toString());
|
|
4276
4289
|
await this.settings.update(oldSetting, setting);
|
|
4277
4290
|
}
|
|
4278
4291
|
async deleteSetting(setting) {
|
|
4279
4292
|
await this.settings.delete(setting);
|
|
4280
4293
|
}
|
|
4281
4294
|
}
|
|
4295
|
+
__decorate([
|
|
4296
|
+
(0, ts_utils_1.log)(),
|
|
4297
|
+
__metadata("design:type", Function),
|
|
4298
|
+
__metadata("design:paramtypes", [Setting_1.Setting]),
|
|
4299
|
+
__metadata("design:returntype", Promise)
|
|
4300
|
+
], SettingsController.prototype, "updateSetting", null);
|
|
4282
4301
|
exports.SettingsController = SettingsController;
|
|
4283
4302
|
//# sourceMappingURL=SettingsController.js.map
|
|
4284
4303
|
|
|
@@ -4983,29 +5002,50 @@ __exportStar(__webpack_require__(/*! ./sleep */ "./node_modules/@js-soft/ts-util
|
|
|
4983
5002
|
/*!*************************************************************!*\
|
|
4984
5003
|
!*** ./node_modules/@js-soft/ts-utils/dist/logDecorator.js ***!
|
|
4985
5004
|
\*************************************************************/
|
|
4986
|
-
/***/ ((__unused_webpack_module, exports)
|
|
5005
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
4987
5006
|
|
|
4988
5007
|
"use strict";
|
|
4989
5008
|
|
|
5009
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5010
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5011
|
+
};
|
|
4990
5012
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4991
5013
|
exports.log = void 0;
|
|
4992
|
-
|
|
4993
|
-
function log(
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5014
|
+
const json_stringify_safe_1 = __importDefault(__webpack_require__(/*! json-stringify-safe */ "./node_modules/json-stringify-safe/stringify.js"));
|
|
5015
|
+
function log(params) {
|
|
5016
|
+
return function (_target, propertyName, propertyDescriptorDoNotChangeMyNamePlease) {
|
|
5017
|
+
const method = propertyDescriptorDoNotChangeMyNamePlease.value;
|
|
5018
|
+
propertyDescriptorDoNotChangeMyNamePlease.value = function (...args) {
|
|
5019
|
+
const thisT = this;
|
|
5020
|
+
try {
|
|
5021
|
+
if (params?.logParams) {
|
|
5022
|
+
thisT.log.trace(`Calling ${propertyName}(${args.map((a) => (0, json_stringify_safe_1.default)(a)).join(", ")})`);
|
|
5023
|
+
}
|
|
5024
|
+
else {
|
|
5025
|
+
thisT.log.trace(`Calling ${propertyName}`);
|
|
5026
|
+
}
|
|
5027
|
+
const returnValue = method.apply(this, args);
|
|
5028
|
+
if (params?.logReturnValue) {
|
|
5029
|
+
thisT.log.trace(`Returning from ${propertyName} with: ${(0, json_stringify_safe_1.default)(returnValue)}`);
|
|
5030
|
+
}
|
|
5031
|
+
else {
|
|
5032
|
+
thisT.log.trace(`Returning from ${propertyName}`);
|
|
5033
|
+
}
|
|
5034
|
+
return returnValue;
|
|
5035
|
+
}
|
|
5036
|
+
catch (error) {
|
|
5037
|
+
if (error instanceof Error && error.stack) {
|
|
5038
|
+
error.stack = error.stack
|
|
5039
|
+
.split("\n")
|
|
5040
|
+
.filter((s) => !s.includes(".propertyDescriptorDoNotChangeMyNamePlease.value"))
|
|
5041
|
+
.join("\n");
|
|
5042
|
+
}
|
|
5043
|
+
thisT.log.error(`Error in ${propertyName}:`, error);
|
|
5044
|
+
throw error;
|
|
5045
|
+
}
|
|
5046
|
+
};
|
|
5047
|
+
return propertyDescriptorDoNotChangeMyNamePlease;
|
|
5007
5048
|
};
|
|
5008
|
-
return propertyDesciptor;
|
|
5009
5049
|
}
|
|
5010
5050
|
exports.log = log;
|
|
5011
5051
|
//# sourceMappingURL=logDecorator.js.map
|
|
@@ -6826,6 +6866,43 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
|
|
6826
6866
|
}();
|
|
6827
6867
|
|
|
6828
6868
|
|
|
6869
|
+
/***/ }),
|
|
6870
|
+
|
|
6871
|
+
/***/ "./node_modules/json-stringify-safe/stringify.js":
|
|
6872
|
+
/*!*******************************************************!*\
|
|
6873
|
+
!*** ./node_modules/json-stringify-safe/stringify.js ***!
|
|
6874
|
+
\*******************************************************/
|
|
6875
|
+
/***/ ((module, exports) => {
|
|
6876
|
+
|
|
6877
|
+
exports = module.exports = stringify
|
|
6878
|
+
exports.getSerialize = serializer
|
|
6879
|
+
|
|
6880
|
+
function stringify(obj, replacer, spaces, cycleReplacer) {
|
|
6881
|
+
return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)
|
|
6882
|
+
}
|
|
6883
|
+
|
|
6884
|
+
function serializer(replacer, cycleReplacer) {
|
|
6885
|
+
var stack = [], keys = []
|
|
6886
|
+
|
|
6887
|
+
if (cycleReplacer == null) cycleReplacer = function(key, value) {
|
|
6888
|
+
if (stack[0] === value) return "[Circular ~]"
|
|
6889
|
+
return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"
|
|
6890
|
+
}
|
|
6891
|
+
|
|
6892
|
+
return function(key, value) {
|
|
6893
|
+
if (stack.length > 0) {
|
|
6894
|
+
var thisPos = stack.indexOf(this)
|
|
6895
|
+
~thisPos ? stack.splice(thisPos + 1) : stack.push(this)
|
|
6896
|
+
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)
|
|
6897
|
+
if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)
|
|
6898
|
+
}
|
|
6899
|
+
else stack.push(value)
|
|
6900
|
+
|
|
6901
|
+
return replacer == null ? value : replacer.call(this, key, value)
|
|
6902
|
+
}
|
|
6903
|
+
}
|
|
6904
|
+
|
|
6905
|
+
|
|
6829
6906
|
/***/ }),
|
|
6830
6907
|
|
|
6831
6908
|
/***/ "./node_modules/luxon/build/node/luxon.js":
|
|
@@ -11189,7 +11266,7 @@ function dayDiff(earlier, later) {
|
|
|
11189
11266
|
}
|
|
11190
11267
|
|
|
11191
11268
|
function highOrderDiffs(cursor, later, units) {
|
|
11192
|
-
const differs = [["years", (a, b) => b.year - a.year], ["quarters", (a, b) => b.quarter - a.quarter], ["months", (a, b) => b.month - a.month + (b.year - a.year) * 12], ["weeks", (a, b) => {
|
|
11269
|
+
const differs = [["years", (a, b) => b.year - a.year], ["quarters", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4], ["months", (a, b) => b.month - a.month + (b.year - a.year) * 12], ["weeks", (a, b) => {
|
|
11193
11270
|
const days = dayDiff(a, b);
|
|
11194
11271
|
return (days - days % 7) / 7;
|
|
11195
11272
|
}], ["days", dayDiff]];
|
|
@@ -14378,7 +14455,7 @@ function friendlyDateTime(dateTimeish) {
|
|
|
14378
14455
|
}
|
|
14379
14456
|
}
|
|
14380
14457
|
|
|
14381
|
-
const VERSION = "3.0.
|
|
14458
|
+
const VERSION = "3.0.4";
|
|
14382
14459
|
|
|
14383
14460
|
exports.DateTime = DateTime;
|
|
14384
14461
|
exports.Duration = Duration;
|