@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.
@@ -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['query_ids'] || 25));
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digione/node-custom-api",
3
- "version": "0.1.9-beta16",
3
+ "version": "0.1.9-beta17",
4
4
  "description": "Typescript node digione-api",
5
5
  "author": "Monchai Jirayupong <monchai.j@seven.co.th>",
6
6
  "license": "MIT",
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(":");
@@ -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['query_ids'] || 25)) });
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['query_ids'] || 25)) });
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) {