corebasic 1.0.263 → 1.0.264
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/libs/features.js +8 -0
- package/libs/features.ts +10 -0
- package/package.json +1 -1
package/dist/libs/features.js
CHANGED
|
@@ -200,6 +200,14 @@ const apiHandler = async (req, res) => {
|
|
|
200
200
|
return undefined;
|
|
201
201
|
return query;
|
|
202
202
|
}
|
|
203
|
+
if (feature.opt?.[0] === "*" && req.body.params?.opt === "*")
|
|
204
|
+
throw { status: 404, message: `Param opt: "*" not allowed when mandatory.` };
|
|
205
|
+
if (feature.opt?.[0] === "*" && !feature.opt?.includes(req.body.params?.opt))
|
|
206
|
+
throw { status: 404, message: `Param opt: "${req.body.params?.opt}" doesn't exist in the mandatory configuration.` };
|
|
207
|
+
if (feature.mut?.[0] === "*" && req.body.params?.mut === "*")
|
|
208
|
+
throw { status: 404, message: `Param mut: "*" not allowed when mandatory.` };
|
|
209
|
+
if (feature.mut?.[0] === "*" && !feature.mut?.includes(req.body.params?.mut))
|
|
210
|
+
throw { status: 404, message: `Param mut: "${req.body.params?.mut}" doesn't exist in the mandatory configuration.` };
|
|
203
211
|
const message = {
|
|
204
212
|
meta,
|
|
205
213
|
data: req.body.data,
|
package/libs/features.ts
CHANGED
|
@@ -332,6 +332,16 @@ const apiHandler = async (req: ExpressRequest, res: ExpressResponse) => {
|
|
|
332
332
|
return query
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
+
if (feature.opt?.[0] === "*" && req.body.params?.opt === "*")
|
|
336
|
+
throw { status: 404, message: `Param opt: "*" not allowed when mandatory.` }
|
|
337
|
+
if (feature.opt?.[0] === "*" && !feature.opt?.includes(req.body.params?.opt as string))
|
|
338
|
+
throw { status: 404, message: `Param opt: "${req.body.params?.opt}" doesn't exist in the mandatory configuration.` }
|
|
339
|
+
if (feature.mut?.[0] === "*" && req.body.params?.mut === "*")
|
|
340
|
+
throw { status: 404, message: `Param mut: "*" not allowed when mandatory.` }
|
|
341
|
+
if (feature.mut?.[0] === "*" && !feature.mut?.includes(req.body.params?.mut as string))
|
|
342
|
+
throw { status: 404, message: `Param mut: "${req.body.params?.mut}" doesn't exist in the mandatory configuration.` }
|
|
343
|
+
|
|
344
|
+
|
|
335
345
|
const message: FeatureMessage = {
|
|
336
346
|
meta,
|
|
337
347
|
data: req.body.data,
|