@digione/node-custom-api 0.1.9-beta16 → 0.1.9-beta17
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/middlewares/paramQuery.js +1 -1
- package/package.json +1 -1
- package/utils/metadata.js +2 -2
- package/utils/validator.js +2 -2
|
@@ -145,7 +145,7 @@ const getQueryParamCUD = (req, res, next) => {
|
|
|
145
145
|
res.locals.option['records'] = String(req.query.records).split(',');
|
|
146
146
|
}
|
|
147
147
|
if (req.query.ids) {
|
|
148
|
-
res.locals.option['ids'] = String(req.query.ids).split(',').slice(0, (config['
|
|
148
|
+
res.locals.option['ids'] = String(req.query.ids).split(',').slice(0, (config['maxQueryIds'] || 25));
|
|
149
149
|
}
|
|
150
150
|
return (0, exports.getAuthParam)(req, res, () => {
|
|
151
151
|
if (req.query.lang_code) {
|
package/package.json
CHANGED
package/utils/metadata.js
CHANGED
|
@@ -27,11 +27,11 @@ class MetadataUtil {
|
|
|
27
27
|
let value = {}, type = types;
|
|
28
28
|
if (_.isObject(input[key])) {
|
|
29
29
|
let val = {};
|
|
30
|
-
_.each(input[key], (v, k) => { val['value_' + k] = (0, helper_1.stripHtml)(v ? v.substring(0, str_length) : ""); });
|
|
30
|
+
_.each(input[key], (v, k) => { val['value_' + k] = (0, helper_1.stripHtml)(v ? v.replace(/[^\p{L}\p{N}\p{P}\p{Z}^$\n]/gu, '').substring(0, str_length) : ""); });
|
|
31
31
|
value = val;
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
|
-
value = { value_en: (0, helper_1.stripHtml)(String(input[key] || "").substring(0, str_length)) };
|
|
34
|
+
value = { value_en: (0, helper_1.stripHtml)(String(input[key] || "").replace(/[^\p{L}\p{N}\p{P}\p{Z}^$\n]/gu, '').substring(0, str_length)) };
|
|
35
35
|
}
|
|
36
36
|
if (autoType && !items[key]) {
|
|
37
37
|
let str = key.split(":");
|
package/utils/validator.js
CHANGED
|
@@ -242,7 +242,7 @@ exports.exportService = exportService;
|
|
|
242
242
|
const printService = ({ print_type = [], schema = {} } = {}) => (req, res, next) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
243
243
|
let config = res.locals.config || {};
|
|
244
244
|
if (req.query.ids) {
|
|
245
|
-
res.locals.option = Object.assign(Object.assign({}, (res.locals.option || {})), { ids: String(req.query.ids).split(',').slice(0, (config['
|
|
245
|
+
res.locals.option = Object.assign(Object.assign({}, (res.locals.option || {})), { ids: String(req.query.ids).split(',').slice(0, (config['maxQueryIds'] || 25)) });
|
|
246
246
|
}
|
|
247
247
|
if (print_type && !req.query.print_type) {
|
|
248
248
|
req.query.print_type = print_type[0];
|
|
@@ -264,7 +264,7 @@ exports.printService = printService;
|
|
|
264
264
|
const dataService = ({ schema = {} } = {}) => (req, res, next) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
265
265
|
let config = res.locals.config || {};
|
|
266
266
|
if (req.query.ids) {
|
|
267
|
-
res.locals.option = Object.assign(Object.assign({}, (res.locals.option || {})), { ids: String(req.query.ids).split(',').slice(0, (config['
|
|
267
|
+
res.locals.option = Object.assign(Object.assign({}, (res.locals.option || {})), { ids: String(req.query.ids).split(',').slice(0, (config['maxQueryIds'] || 25)) });
|
|
268
268
|
}
|
|
269
269
|
let option = Object.keys(schema || {});
|
|
270
270
|
if (option.length) {
|