Built motion from commit (unavailable).|2.5.4
[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 _0x9bf4=['priority','cast','col','substr','DESC','ASC','omit','isEmpty','length','isObject','isString','unset','hasOwnProperty','match','^[0-9]*$','isEmail','getFullTextValue','forEach','push','join','lodash','sequelize','moment','split','filters','find','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','$lte','format','isArray','parse','offset','sort','map'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0x9bf4,0xd7));var _0x49bf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9bf4[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x49bf('0x0'));var sequelize=require(_0x49bf('0x1'));var moment=require(_0x49bf('0x2'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x1bd387){var _0x541add=null;if(_0x1bd387){_0x541add=_0x1bd387[_0x49bf('0x3')](',');}return _0x541add;};exports[_0x49bf('0x4')]=function(_0x317ee4,_0x3dbd9c){var _0x3e117a={};if(!_['isEmpty'](_0x317ee4)){_['forOwn'](_0x317ee4,function(_0x3c7fde,_0x4e1a61){try{if(_0x3dbd9c){var _0xf0ae02=_[_0x49bf('0x5')](_0x3dbd9c,{'name':_0x4e1a61})||{};if(_0xf0ae02[_0x49bf('0x6')]===_0x49bf('0x7')&&_[_0x49bf('0x8')](_0x3c7fde)){var _0x5343a7=JSON['parse'](_0x3c7fde);var _0x416fad={'$gte':moment(moment(_0x5343a7[_0x49bf('0x9')])['format'](_0x49bf('0xa')))[_0x49bf('0xb')]()['format'](),'$lte':moment(moment(_0x5343a7[_0x49bf('0xc')])[_0x49bf('0xd')](_0x49bf('0xa')))[_0x49bf('0xb')]()['subtract'](0x1,'s')[_0x49bf('0xd')]()};_0x3e117a[_0x4e1a61]=_0x416fad;}else{_0x3e117a[_0x4e1a61]=_[_0x49bf('0xe')](_0x3c7fde)?_0x3c7fde:JSON[_0x49bf('0xf')](_0x3c7fde);}}else{_0x3e117a[_0x4e1a61]=_[_0x49bf('0xe')](_0x3c7fde)?_0x3c7fde:JSON[_0x49bf('0xf')](_0x3c7fde);}}catch(_0x5ba08c){_0x3e117a[_0x4e1a61]=_0x3c7fde[_0x49bf('0x3')](',');}});}return _0x3e117a;};exports['limit']=function(_0x14c03f){_0x14c03f=parseInt(_0x14c03f,0xa);if(!_0x14c03f||_0x14c03f<0x0){_0x14c03f=LIMIT_VALUE;}return _0x14c03f;};exports[_0x49bf('0x10')]=function(_0x1a3441){_0x1a3441=parseInt(_0x1a3441,0xa);if(!_0x1a3441||_0x1a3441<0x0){_0x1a3441=0x0;}return _0x1a3441;};exports[_0x49bf('0x11')]=function(_0xed0989){var _0xed27c5,_0xf31fcb=null;if(_0xed0989){_0xed27c5=_0xed0989['split'](',');_0xf31fcb=_[_0x49bf('0x12')](_0xed27c5,function(_0x3ff8b7){if(_0x3ff8b7['indexOf']('-')===0x0){return[_0x3ff8b7===_0x49bf('0x13')?sequelize[_0x49bf('0x14')](sequelize[_0x49bf('0x15')](_0x49bf('0x13')),'unsigned'):_0x3ff8b7[_0x49bf('0x16')](0x1),_0x49bf('0x17')];}else{return[_0x3ff8b7===_0x49bf('0x13')?sequelize[_0x49bf('0x14')](sequelize['col']('priority'),'unsigned'):_0x3ff8b7,_0x49bf('0x18')];}});}return _0xf31fcb;};exports[_0x49bf('0x19')]=function(_0x43ca10,_0x6c8487){if(_[_0x49bf('0x1a')](_0x43ca10)){return _0x43ca10;}if(_[_0x49bf('0xe')](_0x43ca10)){for(var _0x1e96cb=0x0;_0x1e96cb<_0x43ca10[_0x49bf('0x1b')];_0x1e96cb+=0x1){_0x43ca10[_0x1e96cb]=this[_0x49bf('0x19')](_0x43ca10[_0x1e96cb],_0x6c8487);}return _0x43ca10;}if(!_[_0x49bf('0x1c')](_0x43ca10)){return _0x43ca10;}if(_[_0x49bf('0x1d')](_0x6c8487)){_0x6c8487=[_0x6c8487];}if(!_[_0x49bf('0xe')](_0x6c8487)){return _0x43ca10;}for(var _0x4b1d4a=0x0;_0x4b1d4a<_0x6c8487[_0x49bf('0x1b')];_0x4b1d4a+=0x1){_[_0x49bf('0x1e')](_0x43ca10,_0x6c8487[_0x4b1d4a]);}for(var _0xb0869b in _0x43ca10){if(_0x43ca10[_0x49bf('0x1f')](_0xb0869b)){_0x43ca10[_0xb0869b]=this['omit'](_0x43ca10[_0xb0869b],_0x6c8487);}}return _0x43ca10;};exports['isNumeric']=function(_0x4734b8){return _0x4734b8[_0x49bf('0x20')](RegExp(_0x49bf('0x21')))?!![]:![];};exports[_0x49bf('0x22')]=function(_0x65bf1f){return _0x65bf1f['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x49bf('0x23')]=function(_0xd1c194){var _0x359738=[];_0xd1c194[_0x49bf('0x3')]('\x20')[_0x49bf('0x24')](function(_0x3babbb){_0x359738[_0x49bf('0x25')]('+'+_0x3babbb['toString']()+'*');});return _0x359738[_0x49bf('0x26')]('\x20');};