@konplit-services/common 1.0.120 → 1.0.122
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/build/app.configs.d.ts
CHANGED
package/build/app.configs.js
CHANGED
|
@@ -41,6 +41,12 @@ class AppConfigs {
|
|
|
41
41
|
}
|
|
42
42
|
return this.env.MONGO_URI_MERCHANT;
|
|
43
43
|
}
|
|
44
|
+
getWalletDBURI() {
|
|
45
|
+
if (!this.env.MONGO_URI_WALLET) {
|
|
46
|
+
throw new Error("MONGO_URI_WALLET is required");
|
|
47
|
+
}
|
|
48
|
+
return this.env.MONGO_URI_WALLET;
|
|
49
|
+
}
|
|
44
50
|
getNATSURI() {
|
|
45
51
|
if (!this.env.NATS_URI) {
|
|
46
52
|
throw new Error("NATS_URI is required");
|
|
@@ -15,7 +15,10 @@ const errors_1 = require("../errors");
|
|
|
15
15
|
const validAllowedFields = (allowFields) => {
|
|
16
16
|
return (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
17
|
try {
|
|
18
|
-
const
|
|
18
|
+
const params = Object.keys(req.params);
|
|
19
|
+
const query = Object.keys(req.query);
|
|
20
|
+
const body = Object.keys(req.body);
|
|
21
|
+
const submittedFields = [...params, ...query, ...body];
|
|
19
22
|
const extraFields = submittedFields.filter((field) => !allowFields.includes(field));
|
|
20
23
|
if (extraFields.length > 0) {
|
|
21
24
|
throw new errors_1.BadRequestError(`Extra fields submitted: ${extraFields.join(", ")}`, error_codes_1.error_codes.INVALID_INPUT);
|