@optimiser/common 1.0.429 → 1.0.430

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.
Files changed (2) hide show
  1. package/dist/lib/utility.js +10 -5
  2. package/package.json +60 -59
@@ -106,6 +106,7 @@ var sanitize_html_1 = __importDefault(require("sanitize-html"));
106
106
  var sanitize = require('mongo-sanitize');
107
107
  var phoneUtil = require("google-libphonenumber").PhoneNumberUtil.getInstance();
108
108
  var qrcode = require('qrcode');
109
+ var convert = require('html-to-text').convert;
109
110
  var _settingData = {};
110
111
  function GetObjectByKeyValueFromList(list, key, val) {
111
112
  if (list && list.length > 0) {
@@ -4909,7 +4910,7 @@ function ValidateUserInput(options) {
4909
4910
  }
4910
4911
  }
4911
4912
  _loop_20 = function (pageField) {
4912
- var fieldName, fieldData, field, parentData, oldValue, newValue, isSame, searchQuery, result, fld, _k, minValue, maxValue, filter, searchObj, dbConnection, result, searchObj, totalRecord, _l, schemaData, result, searchObj, result, schemaData, result, searchObj, totalRecord, regexpression, phone, files, _m, fieldData_1, obj, searchObj, totalRecord, searchObj, result, searchVideoObj, videoPromise, thumbnailPromise, searchThumbnailObj, _o, videoResult, thumbnailResult, _p, fieldData_2, obj;
4913
+ var fieldName, fieldData, field, parentData, oldValue, newValue, isSame, searchQuery, result, fld, _k, minValue, maxValue, filter, searchObj, dbConnection, result, searchObj, totalRecord, _l, schemaData, result, searchObj, result, schemaData, result, searchObj, totalRecord, regexpression, phone, files, _m, fieldData_1, obj, searchObj, totalRecord, searchObj, result, searchVideoObj, videoPromise, thumbnailPromise, searchThumbnailObj, _o, videoResult, thumbnailResult, text, _p, fieldData_2, obj;
4913
4914
  return __generator(this, function (_q) {
4914
4915
  switch (_q.label) {
4915
4916
  case 0:
@@ -5051,10 +5052,10 @@ function ValidateUserInput(options) {
5051
5052
  msg = 'Invalid value for ' + field.DisplayName + '!';
5052
5053
  }
5053
5054
  else if (minValue !== undefined && minValue !== null && fieldData < minValue) {
5054
- msg = field.DisplayName + ' value must be greater then or equal to ' + minValue;
5055
+ msg = field.DisplayName + ' value must be greater than or equal to ' + minValue;
5055
5056
  }
5056
5057
  else if (maxValue !== undefined && maxValue !== null && maxValue < fieldData) {
5057
- msg = field.DisplayName + ' value must be smaller then or equal to ' + maxValue;
5058
+ msg = field.DisplayName + ' value must be smaller than or equal to ' + maxValue;
5058
5059
  }
5059
5060
  }
5060
5061
  return [3 /*break*/, 59];
@@ -5335,9 +5336,13 @@ function ValidateUserInput(options) {
5335
5336
  return [3 /*break*/, 59];
5336
5337
  case 53:
5337
5338
  {
5338
- // Maxlength check;
5339
+ // Maxlength check;
5340
+ if (field.UIDataType === 'texteditor') {
5341
+ text = convert(fieldData, { wordwrap: false });
5342
+ fieldData = text.replace(/\n/g, ' ').trim();
5343
+ }
5339
5344
  if (field.MaxLength !== undefined && field.MaxLength !== null && fieldData.length > field.MaxLength) {
5340
- msg = field.DisplayName + ' can not be greater then ' + field.MaxLength + ' characters!';
5345
+ msg = field.DisplayName + ' can not be greater than ' + field.MaxLength + ' characters!';
5341
5346
  }
5342
5347
  if (!IsStringValue(fieldData)) {
5343
5348
  msg = 'Invalid value for ' + field.DisplayName;
package/package.json CHANGED
@@ -1,59 +1,60 @@
1
- {
2
- "name": "@optimiser/common",
3
- "version": "1.0.429",
4
- "description": "",
5
- "main": "dist/index.js",
6
- "scripts": {
7
- "compile": "tsc",
8
- "push": "tsc && npm version patch -git-tag-version false && npm publish"
9
- },
10
- "files": [
11
- "dist/*"
12
- ],
13
- "author": "",
14
- "license": "ISC",
15
- "dependencies": {
16
- "@types/geoip-lite": "^1.4.0",
17
- "@types/promise.allsettled": "^1.0.3",
18
- "@types/request": "^2.48.5",
19
- "@types/sanitize-html": "^2.11.0",
20
- "@types/sequelize": "^4.28.9",
21
- "@types/unzipper": "^0.10.3",
22
- "@types/uuid": "^8.3.0",
23
- "aws-sdk": "^2.786.0",
24
- "axios": "^0.21.4",
25
- "bson": "^4.2.0",
26
- "exceljs": "^4.3.0",
27
- "express": "^4.17.1",
28
- "express-validator": "^6.9.2",
29
- "firebase-admin": "^12.0.0",
30
- "geoip-lite": "^1.4.2",
31
- "google-libphonenumber": "^3.2.30",
32
- "ioredis": "^4.17.3",
33
- "libphonenumber-js": "^1.9.51",
34
- "moment": "^2.25.3",
35
- "moment-timezone": "^0.5.27",
36
- "mongo-sanitize": "^1.1.0",
37
- "mongodb": "^3.6.2",
38
- "nodemailer": "^6.4.11",
39
- "promise.allsettled": "^1.0.2",
40
- "qrcode": "^1.5.3",
41
- "request": "^2.88.2",
42
- "sanitize-html": "^2.13.0",
43
- "sequelize": "^6.3.5",
44
- "typescript": "^5.3.3",
45
- "unzipper": "^0.10.11",
46
- "uuid": "^8.3.1"
47
- },
48
- "devDependencies": {
49
- "@types/aws-sdk": "^2.7.0",
50
- "@types/bson": "^4.0.2",
51
- "@types/exceljs": "^1.3.0",
52
- "@types/express": "^4.17.8",
53
- "@types/ioredis": "^4.17.4",
54
- "@types/moment": "^2.13.0",
55
- "@types/moment-timezone": "^0.5.30",
56
- "@types/mongodb": "^3.5.27",
57
- "@types/nodemailer": "^6.4.0"
58
- }
59
- }
1
+ {
2
+ "name": "@optimiser/common",
3
+ "version": "1.0.430",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "compile": "tsc",
8
+ "push": "tsc && npm version patch -git-tag-version false && npm publish"
9
+ },
10
+ "files": [
11
+ "dist/*"
12
+ ],
13
+ "author": "",
14
+ "license": "ISC",
15
+ "dependencies": {
16
+ "@types/geoip-lite": "^1.4.0",
17
+ "@types/promise.allsettled": "^1.0.3",
18
+ "@types/request": "^2.48.5",
19
+ "@types/sanitize-html": "^2.11.0",
20
+ "@types/sequelize": "^4.28.9",
21
+ "@types/unzipper": "^0.10.3",
22
+ "@types/uuid": "^8.3.0",
23
+ "aws-sdk": "^2.786.0",
24
+ "axios": "^0.21.4",
25
+ "bson": "^4.2.0",
26
+ "exceljs": "^4.3.0",
27
+ "express": "^4.17.1",
28
+ "express-validator": "^6.9.2",
29
+ "firebase-admin": "^12.0.0",
30
+ "geoip-lite": "^1.4.2",
31
+ "google-libphonenumber": "^3.2.30",
32
+ "html-to-text": "^8.2.0",
33
+ "ioredis": "^4.17.3",
34
+ "libphonenumber-js": "^1.9.51",
35
+ "moment": "^2.25.3",
36
+ "moment-timezone": "^0.5.27",
37
+ "mongo-sanitize": "^1.1.0",
38
+ "mongodb": "^3.6.2",
39
+ "nodemailer": "^6.4.11",
40
+ "promise.allsettled": "^1.0.2",
41
+ "qrcode": "^1.5.3",
42
+ "request": "^2.88.2",
43
+ "sanitize-html": "^2.13.0",
44
+ "sequelize": "^6.3.5",
45
+ "typescript": "^5.3.3",
46
+ "unzipper": "^0.10.11",
47
+ "uuid": "^8.3.1"
48
+ },
49
+ "devDependencies": {
50
+ "@types/aws-sdk": "^2.7.0",
51
+ "@types/bson": "^4.0.2",
52
+ "@types/exceljs": "^1.3.0",
53
+ "@types/express": "^4.17.8",
54
+ "@types/ioredis": "^4.17.4",
55
+ "@types/moment": "^2.13.0",
56
+ "@types/moment-timezone": "^0.5.30",
57
+ "@types/mongodb": "^3.5.27",
58
+ "@types/nodemailer": "^6.4.0"
59
+ }
60
+ }