Built motion from commit (unavailable).|2.5.12
[motion2.git] / server / components / parsers / qs.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xd51e=['substr','ASC','omit','length','isObject','unset','hasOwnProperty','isEmail','match','getFullTextValue','forEach','includes','push','sequelize','moment','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','parse','$gte','format','utc','YYYY-MM-DD','subtract','isArray','limit','sort','map','indexOf','priority','cast','col'];(function(_0x36f5ae,_0x53960b){var _0x10c86c=function(_0x597583){while(--_0x597583){_0x36f5ae['push'](_0x36f5ae['shift']());}};_0x10c86c(++_0x53960b);}(_0xd51e,0x163));var _0xed51=function(_0x222a4b,_0x3d53d2){_0x222a4b=_0x222a4b-0x0;var _0x2bedb3=_0xd51e[_0x222a4b];return _0x2bedb3;};'use strict';var _=require('lodash');var sequelize=require(_0xed51('0x0'));var moment=require(_0xed51('0x1'));var LIMIT_VALUE=0xfa;exports[_0xed51('0x2')]=function(_0x27cea3){var _0x516dd3=null;if(_0x27cea3){_0x516dd3=_0x27cea3[_0xed51('0x3')](',');}return _0x516dd3;};exports[_0xed51('0x4')]=function(_0x58c95a,_0x12fa9c){var _0x55872e={};if(!_[_0xed51('0x5')](_0x58c95a)){_[_0xed51('0x6')](_0x58c95a,function(_0x2cd9bb,_0x5821b6){try{if(_0x12fa9c){var _0x59bda0=_[_0xed51('0x7')](_0x12fa9c,{'name':_0x5821b6})||{};if(_0x59bda0[_0xed51('0x8')]===_0xed51('0x9')&&_[_0xed51('0xa')](_0x2cd9bb)){var _0x1c8759=JSON[_0xed51('0xb')](_0x2cd9bb);var _0x5ab549={'$gte':moment(moment(_0x1c8759[_0xed51('0xc')])[_0xed51('0xd')]('YYYY-MM-DD'))[_0xed51('0xe')]()[_0xed51('0xd')](),'$lte':moment(moment(_0x1c8759['$lte'])[_0xed51('0xd')](_0xed51('0xf')))[_0xed51('0xe')]()[_0xed51('0x10')](0x1,'s')['format']()};_0x55872e[_0x5821b6]=_0x5ab549;}else{_0x55872e[_0x5821b6]=_[_0xed51('0x11')](_0x2cd9bb)?_0x2cd9bb:JSON[_0xed51('0xb')](_0x2cd9bb);}}else{_0x55872e[_0x5821b6]=_[_0xed51('0x11')](_0x2cd9bb)?_0x2cd9bb:JSON[_0xed51('0xb')](_0x2cd9bb);}}catch(_0x4eade6){_0x55872e[_0x5821b6]=_0x2cd9bb[_0xed51('0x3')](',');}});}return _0x55872e;};exports[_0xed51('0x12')]=function(_0x5a3b96){_0x5a3b96=parseInt(_0x5a3b96,0xa);if(!_0x5a3b96||_0x5a3b96<0x0){_0x5a3b96=LIMIT_VALUE;}return _0x5a3b96;};exports['offset']=function(_0x1e3761){_0x1e3761=parseInt(_0x1e3761,0xa);if(!_0x1e3761||_0x1e3761<0x0){_0x1e3761=0x0;}return _0x1e3761;};exports[_0xed51('0x13')]=function(_0x46b13e){var _0x5e544c,_0x1fbebc=null;if(_0x46b13e){_0x5e544c=_0x46b13e[_0xed51('0x3')](',');_0x1fbebc=_[_0xed51('0x14')](_0x5e544c,function(_0x5c8082){if(_0x5c8082[_0xed51('0x15')]('-')===0x0){return[_0x5c8082===_0xed51('0x16')?sequelize[_0xed51('0x17')](sequelize[_0xed51('0x18')](_0xed51('0x16')),'unsigned'):_0x5c8082[_0xed51('0x19')](0x1),'DESC'];}else{return[_0x5c8082===_0xed51('0x16')?sequelize[_0xed51('0x17')](sequelize[_0xed51('0x18')](_0xed51('0x16')),'unsigned'):_0x5c8082,_0xed51('0x1a')];}});}return _0x1fbebc;};exports[_0xed51('0x1b')]=function(_0x24019d,_0x35a1d8){if(_[_0xed51('0x5')](_0x24019d)){return _0x24019d;}if(_[_0xed51('0x11')](_0x24019d)){for(var _0x133105=0x0;_0x133105<_0x24019d[_0xed51('0x1c')];_0x133105+=0x1){_0x24019d[_0x133105]=this['omit'](_0x24019d[_0x133105],_0x35a1d8);}return _0x24019d;}if(!_[_0xed51('0x1d')](_0x24019d)){return _0x24019d;}if(_['isString'](_0x35a1d8)){_0x35a1d8=[_0x35a1d8];}if(!_['isArray'](_0x35a1d8)){return _0x24019d;}for(var _0x1ddc87=0x0;_0x1ddc87<_0x35a1d8['length'];_0x1ddc87+=0x1){_[_0xed51('0x1e')](_0x24019d,_0x35a1d8[_0x1ddc87]);}for(var _0x540f41 in _0x24019d){if(_0x24019d[_0xed51('0x1f')](_0x540f41)){_0x24019d[_0x540f41]=this[_0xed51('0x1b')](_0x24019d[_0x540f41],_0x35a1d8);}}return _0x24019d;};exports['isNumeric']=function(_0x1fc0ed){return _0x1fc0ed['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xed51('0x20')]=function(_0x5091b9){return _0x5091b9[_0xed51('0x21')](/^\S+@\S+$/)?!![]:![];};exports[_0xed51('0x22')]=function(_0x570216){var _0x713073=[];_0x570216[_0xed51('0x3')](/[ ,]+/)[_0xed51('0x23')](function(_0x2efcec){_0x2efcec=_0x2efcec['replace'](/([^:]")"+/g,'$1');_0x2efcec='+'+_0x2efcec+'*';if(_0x2efcec[_0xed51('0x24')]('@'))_0x2efcec='\x22'+_0x2efcec+'\x22';_0x713073[_0xed51('0x25')](_0x2efcec);});return _0x713073['join']('\x20');};