Built motion from commit e1760111.|2.6.18
[motion2.git] / server / components / parsers / qs.js
index 771852b..203741d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x219f=['$lte','subtract','limit','sort','col','priority','unsigned','substr','DESC','cast','ASC','omit','isEmpty','isArray','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','toString','join','lodash','sequelize','moment','fields','split','forOwn','find','type','DATE','isPlainObject','parse','$gte','format','YYYY-MM-DD','utc'];(function(_0x37c8ef,_0x334449){var _0x5eaee9=function(_0x4b1b98){while(--_0x4b1b98){_0x37c8ef['push'](_0x37c8ef['shift']());}};_0x5eaee9(++_0x334449);}(_0x219f,0xc3));var _0xf219=function(_0x3df923,_0xcac3ce){_0x3df923=_0x3df923-0x0;var _0x3f08c8=_0x219f[_0x3df923];return _0x3f08c8;};'use strict';var _=require(_0xf219('0x0'));var sequelize=require(_0xf219('0x1'));var moment=require(_0xf219('0x2'));var LIMIT_VALUE=0xfa;exports[_0xf219('0x3')]=function(_0x3d4769){var _0x33486b=null;if(_0x3d4769){_0x33486b=_0x3d4769[_0xf219('0x4')](',');}return _0x33486b;};exports['filters']=function(_0x619e5a,_0x25352a){var _0x341ea4={};if(!_['isEmpty'](_0x619e5a)){_[_0xf219('0x5')](_0x619e5a,function(_0xa111cb,_0xfb7fac){try{if(_0x25352a){var _0x5560ac=_[_0xf219('0x6')](_0x25352a,{'name':_0xfb7fac})||{};if(_0x5560ac[_0xf219('0x7')]===_0xf219('0x8')&&_[_0xf219('0x9')](_0xa111cb)){var _0x46b8f2=JSON[_0xf219('0xa')](_0xa111cb);var _0x165c19={'$gte':moment(moment(_0x46b8f2[_0xf219('0xb')])[_0xf219('0xc')](_0xf219('0xd')))[_0xf219('0xe')]()[_0xf219('0xc')](),'$lte':moment(moment(_0x46b8f2[_0xf219('0xf')])['format'](_0xf219('0xd')))[_0xf219('0xe')]()[_0xf219('0x10')](0x1,'s')[_0xf219('0xc')]()};_0x341ea4[_0xfb7fac]=_0x165c19;}else{_0x341ea4[_0xfb7fac]=_['isArray'](_0xa111cb)?_0xa111cb:JSON[_0xf219('0xa')](_0xa111cb);}}else{_0x341ea4[_0xfb7fac]=_['isArray'](_0xa111cb)?_0xa111cb:JSON[_0xf219('0xa')](_0xa111cb);}}catch(_0x4cf038){_0x341ea4[_0xfb7fac]=_0xa111cb[_0xf219('0x4')](',');}});}return _0x341ea4;};exports[_0xf219('0x11')]=function(_0x1a3d49){_0x1a3d49=parseInt(_0x1a3d49,0xa);if(!_0x1a3d49||_0x1a3d49<0x0){_0x1a3d49=LIMIT_VALUE;}return _0x1a3d49;};exports['offset']=function(_0x5b2aeb){_0x5b2aeb=parseInt(_0x5b2aeb,0xa);if(!_0x5b2aeb||_0x5b2aeb<0x0){_0x5b2aeb=0x0;}return _0x5b2aeb;};exports[_0xf219('0x12')]=function(_0x2b1595){var _0xab6479,_0x3a5a2b=null;if(_0x2b1595){_0xab6479=_0x2b1595['split'](',');_0x3a5a2b=_['map'](_0xab6479,function(_0x3ed9c0){if(_0x3ed9c0['indexOf']('-')===0x0){return[_0x3ed9c0==='priority'?sequelize['cast'](sequelize[_0xf219('0x13')](_0xf219('0x14')),_0xf219('0x15')):_0x3ed9c0[_0xf219('0x16')](0x1),_0xf219('0x17')];}else{return[_0x3ed9c0===_0xf219('0x14')?sequelize[_0xf219('0x18')](sequelize[_0xf219('0x13')](_0xf219('0x14')),_0xf219('0x15')):_0x3ed9c0,_0xf219('0x19')];}});}return _0x3a5a2b;};exports[_0xf219('0x1a')]=function(_0x5a428a,_0x34ef22){if(_[_0xf219('0x1b')](_0x5a428a)){return _0x5a428a;}if(_[_0xf219('0x1c')](_0x5a428a)){for(var _0x5e295c=0x0;_0x5e295c<_0x5a428a[_0xf219('0x1d')];_0x5e295c+=0x1){_0x5a428a[_0x5e295c]=this[_0xf219('0x1a')](_0x5a428a[_0x5e295c],_0x34ef22);}return _0x5a428a;}if(!_[_0xf219('0x1e')](_0x5a428a)){return _0x5a428a;}if(_[_0xf219('0x1f')](_0x34ef22)){_0x34ef22=[_0x34ef22];}if(!_[_0xf219('0x1c')](_0x34ef22)){return _0x5a428a;}for(var _0x595f6f=0x0;_0x595f6f<_0x34ef22[_0xf219('0x1d')];_0x595f6f+=0x1){_[_0xf219('0x20')](_0x5a428a,_0x34ef22[_0x595f6f]);}for(var _0x3adfbd in _0x5a428a){if(_0x5a428a[_0xf219('0x21')](_0x3adfbd)){_0x5a428a[_0x3adfbd]=this[_0xf219('0x1a')](_0x5a428a[_0x3adfbd],_0x34ef22);}}return _0x5a428a;};exports[_0xf219('0x22')]=function(_0x2717b6){return _0x2717b6[_0xf219('0x23')](RegExp(_0xf219('0x24')))?!![]:![];};exports[_0xf219('0x25')]=function(_0x2e043d){return _0x2e043d[_0xf219('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0xf219('0x26')]=function(_0x4e61f1){var _0x4a28c4=[];_0x4e61f1[_0xf219('0x4')]('\x20')[_0xf219('0x27')](function(_0x37beb0){_0x4a28c4['push']('+'+_0x37beb0[_0xf219('0x28')]()+'*');});return _0x4a28c4[_0xf219('0x29')]('\x20');};
\ 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