Built motion from commit e1760111.|2.6.18
[motion2.git] / server / components / parsers / qs.js
index bfab4f6..203741d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf072=['DESC','unsigned','ASC','omit','isString','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','nolimit','limit','offset','pick','filter','object','includes','columns','where','merge','type','lower','col','options','lodash','sequelize','moment','parse','keys','fields','split','filters','forOwn','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte','subtract','name','uniqueid','isArray','sort','map','cast','priority','substr'];(function(_0x4c39f5,_0x109684){var _0x1db24f=function(_0x44879b){while(--_0x44879b){_0x4c39f5['push'](_0x4c39f5['shift']());}};_0x1db24f(++_0x109684);}(_0xf072,0x1cf));var _0x2f07=function(_0x2889b6,_0x558a66){_0x2889b6=_0x2889b6-0x0;var _0x79991d=_0xf072[_0x2889b6];return _0x79991d;};'use strict';var _=require(_0x2f07('0x0'));var sequelize=require(_0x2f07('0x1'));var moment=require(_0x2f07('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4f62b0){var _0x3c1c25=['ne'];try{var _0x5f20e3=JSON[_0x2f07('0x3')](_0x4f62b0);var _0x432696=Object[_0x2f07('0x4')](_0x5f20e3)[0x0];return _0x3c1c25['includes'](_0x432696);}catch(_0x1d5a33){return![];}}function getOperatorValue(_0x14d6e6){var _0x3643bb=JSON[_0x2f07('0x3')](_0x14d6e6);var _0x235418=Object[_0x2f07('0x4')](_0x3643bb)[0x0];var _0x33b99c=_0x3643bb[_0x235418];return{['$'+_0x235418]:_0x33b99c};}exports[_0x2f07('0x5')]=function(_0x4746c2){var _0x2e167=null;if(_0x4746c2){_0x2e167=_0x4746c2[_0x2f07('0x6')](',');}return _0x2e167;};exports[_0x2f07('0x7')]=function(_0x1a3848,_0x18fe13){var _0x14e237={};if(!_['isEmpty'](_0x1a3848)){_[_0x2f07('0x8')](_0x1a3848,function(_0x2f464b,_0x1d0812){try{if(_0x18fe13){var _0x3525be=_['find'](_0x18fe13,{'name':_0x1d0812})||{};if(hasSequelizeOperator(_0x2f464b)){_0x14e237[_0x1d0812]=getOperatorValue(_0x2f464b);}else if(_0x3525be['type']===_0x2f07('0x9')&&_[_0x2f07('0xa')](_0x2f464b)){var _0x58549c=JSON[_0x2f07('0x3')](_0x2f464b);var _0x34dbd4={'$gte':moment(moment(_0x58549c[_0x2f07('0xb')])['format'](_0x2f07('0xc')))[_0x2f07('0xd')]()[_0x2f07('0xe')](),'$lte':moment(moment(_0x58549c[_0x2f07('0xf')])[_0x2f07('0xe')](_0x2f07('0xc')))['utc']()[_0x2f07('0x10')](0x1,'s')['format']()};_0x14e237[_0x1d0812]=_0x34dbd4;}else if(_0x3525be[_0x2f07('0x11')]===_0x2f07('0x12')){_0x14e237[_0x1d0812]=_0x2f464b;}else{_0x14e237[_0x1d0812]=_[_0x2f07('0x13')](_0x2f464b)?_0x2f464b:JSON[_0x2f07('0x3')](_0x2f464b);}}else{_0x14e237[_0x1d0812]=_[_0x2f07('0x13')](_0x2f464b)?_0x2f464b:JSON[_0x2f07('0x3')](_0x2f464b);}}catch(_0x1a6135){_0x14e237[_0x1d0812]=_0x2f464b[_0x2f07('0x6')](',');}});}return _0x14e237;};exports['limit']=function(_0x15c3dd){_0x15c3dd=parseInt(_0x15c3dd,0xa);if(!_0x15c3dd||_0x15c3dd<0x0){_0x15c3dd=LIMIT_VALUE;}return _0x15c3dd;};exports['offset']=function(_0x3cd3c0){_0x3cd3c0=parseInt(_0x3cd3c0,0xa);if(!_0x3cd3c0||_0x3cd3c0<0x0){_0x3cd3c0=0x0;}return _0x3cd3c0;};exports[_0x2f07('0x14')]=function(_0x119b68){var _0xd944d6,_0x2ef47d=null;if(_0x119b68){_0xd944d6=_0x119b68['split'](',');_0x2ef47d=_[_0x2f07('0x15')](_0xd944d6,function(_0x5a0146){if(_0x5a0146['indexOf']('-')===0x0){return[_0x5a0146==='priority'?sequelize[_0x2f07('0x16')](sequelize['col'](_0x2f07('0x17')),'unsigned'):_0x5a0146[_0x2f07('0x18')](0x1),_0x2f07('0x19')];}else{return[_0x5a0146===_0x2f07('0x17')?sequelize[_0x2f07('0x16')](sequelize['col'](_0x2f07('0x17')),_0x2f07('0x1a')):_0x5a0146,_0x2f07('0x1b')];}});}return _0x2ef47d;};exports['omit']=function(_0x111376,_0x113916){if(_['isEmpty'](_0x111376)){return _0x111376;}if(_[_0x2f07('0x13')](_0x111376)){for(var _0x1c9ca1=0x0;_0x1c9ca1<_0x111376['length'];_0x1c9ca1+=0x1){_0x111376[_0x1c9ca1]=this[_0x2f07('0x1c')](_0x111376[_0x1c9ca1],_0x113916);}return _0x111376;}if(!_['isObject'](_0x111376)){return _0x111376;}if(_[_0x2f07('0x1d')](_0x113916)){_0x113916=[_0x113916];}if(!_[_0x2f07('0x13')](_0x113916)){return _0x111376;}for(var _0x27bd72=0x0;_0x27bd72<_0x113916[_0x2f07('0x1e')];_0x27bd72+=0x1){_[_0x2f07('0x1f')](_0x111376,_0x113916[_0x27bd72]);}for(var _0x139ea8 in _0x111376){if(_0x111376[_0x2f07('0x20')](_0x139ea8)){_0x111376[_0x139ea8]=this[_0x2f07('0x1c')](_0x111376[_0x139ea8],_0x113916);}}return _0x111376;};exports[_0x2f07('0x21')]=function(_0x468cd8){return _0x468cd8[_0x2f07('0x22')](RegExp(_0x2f07('0x23')))?!![]:![];};exports['isEmail']=function(_0x1accef){return _0x1accef[_0x2f07('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x2f07('0x24')]=function(_0x571839){var _0x36d4b8=[];_0x571839[_0x2f07('0x6')](/[ ,]+/)[_0x2f07('0x25')](function(_0x5ad0de){_0x5ad0de=_0x5ad0de[_0x2f07('0x26')](/([^:]")"+/g,'$1');_0x5ad0de='+'+_0x5ad0de+'*';var _0x368e3d=/[ `!@#$%^&*()_\-?~]/;if(_0x5ad0de[_0x2f07('0x22')](_0x368e3d))_0x5ad0de='\x22'+_0x5ad0de+'\x22';_0x36d4b8[_0x2f07('0x27')](_0x5ad0de);});return _0x36d4b8[_0x2f07('0x28')]('\x20');};exports[_0x2f07('0x29')]=function(_0x3fed73,_0x5c7593,_0x1decd1){var _0x5b0407={},_0x3496eb={};if(_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x2b')]){_0x5c7593[_0x2f07('0x2a')]['id']=_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x2b')];delete _0x5c7593[_0x2f07('0x2a')][_0x2f07('0x2b')];}_0x5b0407[_0x2f07('0x2c')]=_[_0x2f07('0x15')](_0x3fed73,_0x2f07('0x11'));_0x5b0407[_0x2f07('0x2a')]=_[_0x2f07('0x4')](_0x5c7593[_0x2f07('0x2a')]);_0x5b0407[_0x2f07('0x7')]=_[_0x2f07('0x2d')](_0x5b0407['model'],_0x5b0407['query']);_0x3496eb[_0x2f07('0x2e')]=_[_0x2f07('0x2d')](_0x5b0407[_0x2f07('0x2c')],this['fields'](_0x5c7593['query'][_0x2f07('0x5')]));_0x3496eb['attributes']=_0x3496eb[_0x2f07('0x2e')][_0x2f07('0x1e')]?_0x3496eb[_0x2f07('0x2e')]:_0x5b0407[_0x2f07('0x2c')];if(!_0x5c7593[_0x2f07('0x2a')]['hasOwnProperty'](_0x2f07('0x2f'))){_0x3496eb['limit']=this[_0x2f07('0x30')](_0x5c7593['query'][_0x2f07('0x30')]);_0x3496eb['offset']=this['offset'](_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x31')]);}_0x3496eb['order']=this[_0x2f07('0x14')](_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x14')]);_0x3496eb['where']=this[_0x2f07('0x7')](_[_0x2f07('0x32')](_0x5c7593[_0x2f07('0x2a')],_0x5b0407[_0x2f07('0x7')]),_0x3fed73);if(_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x33')]){var _0x1a0ef2=_0x3fed73;var _0x1a9645=_0x5c7593['query'][_0x2f07('0x33')];if(typeof _0x1a9645===_0x2f07('0x34')){_0x1a0ef2=_[_0x2f07('0x33')](_0x3fed73,function(_0x3f1b6b){return _[_0x2f07('0x35')](_0x1a9645[_0x2f07('0x36')],_0x3f1b6b[_0x2f07('0x11')]);});_0x1a9645=_0x1a9645['value'];}_0x3496eb[_0x2f07('0x37')]=_[_0x2f07('0x38')](_0x3496eb[_0x2f07('0x37')],{'$or':_[_0x2f07('0x15')](_0x1a0ef2,function(_0x3db7ad){if(_0x3db7ad[_0x2f07('0x39')]!=='VIRTUAL'){if(_0x1decd1){return sequelize[_0x2f07('0x37')](sequelize['fn'](_0x2f07('0x3a'),sequelize[_0x2f07('0x3b')](_0x3db7ad[_0x2f07('0x11')])),{'$like':sequelize['fn']('lower','%'+_0x5c7593['query'][_0x2f07('0x33')]+'%')});}else{var _0x437e94={};_0x437e94[_0x3db7ad[_0x2f07('0x11')]]={'$like':'%'+_0x5c7593[_0x2f07('0x2a')]['filter']+'%'};return _0x437e94;}}})});}_0x3496eb=_[_0x2f07('0x38')]({},_0x3496eb,_0x5c7593[_0x2f07('0x3c')]);return _0x3496eb;};
\ No newline at end of file
+var _0x0229=['isPlainObject','$gte','format','utc','$lte','name','offset','map','indexOf','priority','cast','col','unsigned','substr','DESC','omit','isArray','length','isObject','isString','hasOwnProperty','isNumeric','match','isEmail','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','query','$id','model','attributes','intersection','nolimit','limit','order','sort','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','type','DATE'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x0229,0x16c));var _0x9022=function(_0x38e047,_0x39b949){_0x38e047=_0x38e047-0x0;var _0x72eac6=_0x0229[_0x38e047];return _0x72eac6;};'use strict';var _=require(_0x9022('0x0'));var sequelize=require(_0x9022('0x1'));var moment=require(_0x9022('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5ac81f){var _0x8b874a=['ne'];try{var _0x1dcb1a=JSON[_0x9022('0x3')](_0x5ac81f);var _0x400d27=Object[_0x9022('0x4')](_0x1dcb1a)[0x0];return _0x8b874a[_0x9022('0x5')](_0x400d27);}catch(_0x3cd275){return![];}}function getOperatorValue(_0x5a4f21){var _0x3528ab=JSON['parse'](_0x5a4f21);var _0x414753=Object[_0x9022('0x4')](_0x3528ab)[0x0];var _0x134423=_0x3528ab[_0x414753];return{['$'+_0x414753]:_0x134423};}exports[_0x9022('0x6')]=function(_0x3133a8){var _0x4d5b30=null;if(_0x3133a8){_0x4d5b30=_0x3133a8[_0x9022('0x7')](',');}return _0x4d5b30;};exports[_0x9022('0x8')]=function(_0x4fcda8,_0x58659e){var _0x514e44={};if(!_[_0x9022('0x9')](_0x4fcda8)){_[_0x9022('0xa')](_0x4fcda8,function(_0x475834,_0x105985){try{if(_0x58659e){var _0x4bcee1=_[_0x9022('0xb')](_0x58659e,{'name':_0x105985})||{};if(hasSequelizeOperator(_0x475834)){_0x514e44[_0x105985]=getOperatorValue(_0x475834);}else if(_0x4bcee1[_0x9022('0xc')]===_0x9022('0xd')&&_[_0x9022('0xe')](_0x475834)){var _0x158a80=JSON[_0x9022('0x3')](_0x475834);var _0x37dac7={'$gte':moment(moment(_0x158a80[_0x9022('0xf')])[_0x9022('0x10')]('YYYY-MM-DD'))[_0x9022('0x11')]()[_0x9022('0x10')](),'$lte':moment(moment(_0x158a80[_0x9022('0x12')])['format']('YYYY-MM-DD'))[_0x9022('0x11')]()['subtract'](0x1,'s')[_0x9022('0x10')]()};_0x514e44[_0x105985]=_0x37dac7;}else if(_0x4bcee1[_0x9022('0x13')]==='uniqueid'){_0x514e44[_0x105985]=_0x475834;}else{_0x514e44[_0x105985]=_['isArray'](_0x475834)?_0x475834:JSON[_0x9022('0x3')](_0x475834);}}else{_0x514e44[_0x105985]=_['isArray'](_0x475834)?_0x475834:JSON[_0x9022('0x3')](_0x475834);}}catch(_0x54279c){_0x514e44[_0x105985]=_0x475834[_0x9022('0x7')](',');}});}return _0x514e44;};exports['limit']=function(_0xcd3ef){_0xcd3ef=parseInt(_0xcd3ef,0xa);if(!_0xcd3ef||_0xcd3ef<0x0){_0xcd3ef=LIMIT_VALUE;}return _0xcd3ef;};exports[_0x9022('0x14')]=function(_0x534f1e){_0x534f1e=parseInt(_0x534f1e,0xa);if(!_0x534f1e||_0x534f1e<0x0){_0x534f1e=0x0;}return _0x534f1e;};exports['sort']=function(_0x206baa){var _0x496534,_0x7ed93e=null;if(_0x206baa){_0x496534=_0x206baa[_0x9022('0x7')](',');_0x7ed93e=_[_0x9022('0x15')](_0x496534,function(_0x3b8c5a){if(_0x3b8c5a[_0x9022('0x16')]('-')===0x0){return[_0x3b8c5a===_0x9022('0x17')?sequelize[_0x9022('0x18')](sequelize[_0x9022('0x19')](_0x9022('0x17')),_0x9022('0x1a')):_0x3b8c5a[_0x9022('0x1b')](0x1),_0x9022('0x1c')];}else{return[_0x3b8c5a===_0x9022('0x17')?sequelize[_0x9022('0x18')](sequelize['col'](_0x9022('0x17')),_0x9022('0x1a')):_0x3b8c5a,'ASC'];}});}return _0x7ed93e;};exports[_0x9022('0x1d')]=function(_0x48e851,_0x57417c){if(_[_0x9022('0x9')](_0x48e851)){return _0x48e851;}if(_[_0x9022('0x1e')](_0x48e851)){for(var _0xfe750a=0x0;_0xfe750a<_0x48e851[_0x9022('0x1f')];_0xfe750a+=0x1){_0x48e851[_0xfe750a]=this[_0x9022('0x1d')](_0x48e851[_0xfe750a],_0x57417c);}return _0x48e851;}if(!_[_0x9022('0x20')](_0x48e851)){return _0x48e851;}if(_[_0x9022('0x21')](_0x57417c)){_0x57417c=[_0x57417c];}if(!_[_0x9022('0x1e')](_0x57417c)){return _0x48e851;}for(var _0x201ce1=0x0;_0x201ce1<_0x57417c[_0x9022('0x1f')];_0x201ce1+=0x1){_['unset'](_0x48e851,_0x57417c[_0x201ce1]);}for(var _0x386973 in _0x48e851){if(_0x48e851[_0x9022('0x22')](_0x386973)){_0x48e851[_0x386973]=this[_0x9022('0x1d')](_0x48e851[_0x386973],_0x57417c);}}return _0x48e851;};exports[_0x9022('0x23')]=function(_0x341f56){return _0x341f56[_0x9022('0x24')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x9022('0x25')]=function(_0x4a0ca1){return _0x4a0ca1['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x4b81e7,_0x26c322){var _0x5d0cc2=[];var _0x2976a9=/[ `!@#$%^&*()_\-?~]/;var _0x4eba69=_0x26c322?_0x9022('0x26'):_0x9022('0x27');_0x4b81e7[_0x9022('0x7')](/[ ,]+/)[_0x9022('0x28')](function(_0x5cc11e){_0x5cc11e=_0x5cc11e[_0x9022('0x29')](/([^:]")"+/g,'$1');_0x5cc11e='+'+_0x5cc11e+'*';var _0x3d80bb=_0x5cc11e[_0x9022('0x24')](_0x2976a9);if(_0x3d80bb){_0x5cc11e='\x22'+_0x5cc11e+'\x22';}_0x5d0cc2[_0x9022('0x2a')](_0x5cc11e);});_0x4eba69=_0x4eba69[_0x9022('0x29')](_0x9022('0x27'),_0x5d0cc2[_0x9022('0x2b')]('\x20'));return _0x4eba69;};exports['getOptions']=function(_0xfb6cb5,_0x226014,_0x506b7d){var _0x24dfb1={},_0x4dce03={};if(_0x226014[_0x9022('0x2c')][_0x9022('0x2d')]){_0x226014[_0x9022('0x2c')]['id']=_0x226014[_0x9022('0x2c')]['$id'];delete _0x226014['query']['$id'];}_0x24dfb1[_0x9022('0x2e')]=_['map'](_0xfb6cb5,_0x9022('0x13'));_0x24dfb1['query']=_[_0x9022('0x4')](_0x226014[_0x9022('0x2c')]);_0x24dfb1[_0x9022('0x8')]=_['intersection'](_0x24dfb1['model'],_0x24dfb1[_0x9022('0x2c')]);_0x4dce03[_0x9022('0x2f')]=_[_0x9022('0x30')](_0x24dfb1[_0x9022('0x2e')],this['fields'](_0x226014[_0x9022('0x2c')][_0x9022('0x6')]));_0x4dce03['attributes']=_0x4dce03[_0x9022('0x2f')][_0x9022('0x1f')]?_0x4dce03[_0x9022('0x2f')]:_0x24dfb1[_0x9022('0x2e')];if(!_0x226014[_0x9022('0x2c')][_0x9022('0x22')](_0x9022('0x31'))){_0x4dce03[_0x9022('0x32')]=this[_0x9022('0x32')](_0x226014['query'][_0x9022('0x32')]);_0x4dce03[_0x9022('0x14')]=this[_0x9022('0x14')](_0x226014['query']['offset']);}_0x4dce03[_0x9022('0x33')]=this[_0x9022('0x34')](_0x226014[_0x9022('0x2c')]['sort']);_0x4dce03[_0x9022('0x35')]=this[_0x9022('0x8')](_[_0x9022('0x36')](_0x226014[_0x9022('0x2c')],_0x24dfb1[_0x9022('0x8')]),_0xfb6cb5);if(_0x226014[_0x9022('0x2c')]['filter']){var _0xc512a5=_0xfb6cb5;var _0x4db29d=_0x226014[_0x9022('0x2c')][_0x9022('0x37')];if(typeof _0x4db29d===_0x9022('0x38')){_0xc512a5=_[_0x9022('0x37')](_0xfb6cb5,function(_0xedd68){return _[_0x9022('0x5')](_0x4db29d[_0x9022('0x39')],_0xedd68[_0x9022('0x13')]);});_0x4db29d=_0x4db29d[_0x9022('0x3a')];}_0x4dce03[_0x9022('0x35')]=_[_0x9022('0x3b')](_0x4dce03['where'],{'$or':_['map'](_0xc512a5,function(_0x21d778){if(_0x21d778[_0x9022('0xc')]!==_0x9022('0x3c')){if(_0x506b7d){return sequelize[_0x9022('0x35')](sequelize['fn']('lower',sequelize['col'](_0x21d778[_0x9022('0x13')])),{'$like':sequelize['fn'](_0x9022('0x3d'),'%'+_0x226014[_0x9022('0x2c')]['filter']+'%')});}else{var _0x213e56={};_0x213e56[_0x21d778[_0x9022('0x13')]]={'$like':'%'+_0x226014['query'][_0x9022('0x37')]+'%'};return _0x213e56;}}})});}_0x4dce03=_['merge']({},_0x4dce03,_0x226014[_0x9022('0x3e')]);return _0x4dce03;};
\ No newline at end of file