Built motion from commit 87cd5f02.|2.5.48
[motion2.git] / server / components / parsers / qs.js
index a2ddba5..4cf09a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x732f=['limit','sort','map','priority','cast','col','unsigned','DESC','omit','length','isObject','unset','isNumeric','match','^[0-9]*$','isEmail','getFullTextValue','push','toString','join','lodash','moment','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','parse','$gte','format','YYYY-MM-DD','$lte','utc','subtract','isArray'];(function(_0x5c18cb,_0x136453){var _0x3b8e66=function(_0x18a161){while(--_0x18a161){_0x5c18cb['push'](_0x5c18cb['shift']());}};_0x3b8e66(++_0x136453);}(_0x732f,0xb0));var _0xf732=function(_0x4624f9,_0x49b411){_0x4624f9=_0x4624f9-0x0;var _0x10c5ab=_0x732f[_0x4624f9];return _0x10c5ab;};'use strict';var _=require(_0xf732('0x0'));var sequelize=require('sequelize');var moment=require(_0xf732('0x1'));var LIMIT_VALUE=0xfa;exports[_0xf732('0x2')]=function(_0x3e6768){var _0x3ad837=null;if(_0x3e6768){_0x3ad837=_0x3e6768[_0xf732('0x3')](',');}return _0x3ad837;};exports[_0xf732('0x4')]=function(_0xa92ee2,_0x52b622){var _0x50cd1b={};if(!_[_0xf732('0x5')](_0xa92ee2)){_[_0xf732('0x6')](_0xa92ee2,function(_0x4963f6,_0x415cc2){try{if(_0x52b622){var _0x212bd7=_[_0xf732('0x7')](_0x52b622,{'name':_0x415cc2})||{};if(_0x212bd7[_0xf732('0x8')]===_0xf732('0x9')&&_[_0xf732('0xa')](_0x4963f6)){var _0xd56b4a=JSON[_0xf732('0xb')](_0x4963f6);var _0x20f64e={'$gte':moment(moment(_0xd56b4a[_0xf732('0xc')])[_0xf732('0xd')](_0xf732('0xe')))['utc']()['format'](),'$lte':moment(moment(_0xd56b4a[_0xf732('0xf')])[_0xf732('0xd')](_0xf732('0xe')))[_0xf732('0x10')]()[_0xf732('0x11')](0x1,'s')[_0xf732('0xd')]()};_0x50cd1b[_0x415cc2]=_0x20f64e;}else{_0x50cd1b[_0x415cc2]=_[_0xf732('0x12')](_0x4963f6)?_0x4963f6:JSON[_0xf732('0xb')](_0x4963f6);}}else{_0x50cd1b[_0x415cc2]=_[_0xf732('0x12')](_0x4963f6)?_0x4963f6:JSON[_0xf732('0xb')](_0x4963f6);}}catch(_0x3c8319){_0x50cd1b[_0x415cc2]=_0x4963f6[_0xf732('0x3')](',');}});}return _0x50cd1b;};exports[_0xf732('0x13')]=function(_0x5df7a7){_0x5df7a7=parseInt(_0x5df7a7,0xa);if(!_0x5df7a7||_0x5df7a7<0x0){_0x5df7a7=LIMIT_VALUE;}return _0x5df7a7;};exports['offset']=function(_0x2b3942){_0x2b3942=parseInt(_0x2b3942,0xa);if(!_0x2b3942||_0x2b3942<0x0){_0x2b3942=0x0;}return _0x2b3942;};exports[_0xf732('0x14')]=function(_0x394e52){var _0x1a4a12,_0x82057e=null;if(_0x394e52){_0x1a4a12=_0x394e52[_0xf732('0x3')](',');_0x82057e=_[_0xf732('0x15')](_0x1a4a12,function(_0x13d939){if(_0x13d939['indexOf']('-')===0x0){return[_0x13d939===_0xf732('0x16')?sequelize[_0xf732('0x17')](sequelize[_0xf732('0x18')]('priority'),_0xf732('0x19')):_0x13d939['substr'](0x1),_0xf732('0x1a')];}else{return[_0x13d939===_0xf732('0x16')?sequelize['cast'](sequelize[_0xf732('0x18')](_0xf732('0x16')),_0xf732('0x19')):_0x13d939,'ASC'];}});}return _0x82057e;};exports[_0xf732('0x1b')]=function(_0xabb099,_0x44a510){if(_[_0xf732('0x5')](_0xabb099)){return _0xabb099;}if(_[_0xf732('0x12')](_0xabb099)){for(var _0xaa010b=0x0;_0xaa010b<_0xabb099[_0xf732('0x1c')];_0xaa010b+=0x1){_0xabb099[_0xaa010b]=this[_0xf732('0x1b')](_0xabb099[_0xaa010b],_0x44a510);}return _0xabb099;}if(!_[_0xf732('0x1d')](_0xabb099)){return _0xabb099;}if(_['isString'](_0x44a510)){_0x44a510=[_0x44a510];}if(!_[_0xf732('0x12')](_0x44a510)){return _0xabb099;}for(var _0x3bf6a5=0x0;_0x3bf6a5<_0x44a510['length'];_0x3bf6a5+=0x1){_[_0xf732('0x1e')](_0xabb099,_0x44a510[_0x3bf6a5]);}for(var _0x4f294c in _0xabb099){if(_0xabb099['hasOwnProperty'](_0x4f294c)){_0xabb099[_0x4f294c]=this[_0xf732('0x1b')](_0xabb099[_0x4f294c],_0x44a510);}}return _0xabb099;};exports[_0xf732('0x1f')]=function(_0x3c9b9c){return _0x3c9b9c[_0xf732('0x20')](RegExp(_0xf732('0x21')))?!![]:![];};exports[_0xf732('0x22')]=function(_0x1f3a56){return _0x1f3a56[_0xf732('0x20')](/^\S+@\S+$/)?!![]:![];};exports[_0xf732('0x23')]=function(_0x109534){var _0x3b5cb8=[];_0x109534['split']('\x20')['forEach'](function(_0x3cc27e){_0x3b5cb8[_0xf732('0x24')]('+'+_0x3cc27e[_0xf732('0x25')]()+'*');});return _0x3b5cb8[_0xf732('0x26')]('\x20');};
\ No newline at end of file
+var _0x5334=['value','merge','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','omit','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','getOptions','query','$id','model','intersection','attributes','nolimit','limit','offset','order','where','pick','filter','object','columns'];(function(_0x2ccc05,_0x345621){var _0x2d0ff8=function(_0x285b5d){while(--_0x285b5d){_0x2ccc05['push'](_0x2ccc05['shift']());}};_0x2d0ff8(++_0x345621);}(_0x5334,0x84));var _0x4533=function(_0x459ce9,_0x512b3d){_0x459ce9=_0x459ce9-0x0;var _0x183b79=_0x5334[_0x459ce9];return _0x183b79;};'use strict';var _=require(_0x4533('0x0'));var sequelize=require(_0x4533('0x1'));var moment=require(_0x4533('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x35fb80){var _0x39af56=['ne'];try{var _0x52b768=JSON[_0x4533('0x3')](_0x35fb80);var _0x5176b5=Object[_0x4533('0x4')](_0x52b768)[0x0];return _0x39af56[_0x4533('0x5')](_0x5176b5);}catch(_0x5cbca4){return![];}}function getOperatorValue(_0x4a576a){var _0x51b4ce=JSON[_0x4533('0x3')](_0x4a576a);var _0x4dea06=Object['keys'](_0x51b4ce)[0x0];var _0x487906=_0x51b4ce[_0x4dea06];return{['$'+_0x4dea06]:_0x487906};}exports[_0x4533('0x6')]=function(_0x42f94b){var _0x300877=null;if(_0x42f94b){_0x300877=_0x42f94b[_0x4533('0x7')](',');}return _0x300877;};exports[_0x4533('0x8')]=function(_0x21b22f,_0xd417){var _0x4fdbda={};if(!_[_0x4533('0x9')](_0x21b22f)){_[_0x4533('0xa')](_0x21b22f,function(_0x1b52ee,_0x12131a){try{if(_0xd417){var _0x5465bf=_[_0x4533('0xb')](_0xd417,{'name':_0x12131a})||{};if(hasSequelizeOperator(_0x1b52ee)){_0x4fdbda[_0x12131a]=getOperatorValue(_0x1b52ee);}else if(_0x5465bf['type']===_0x4533('0xc')&&_[_0x4533('0xd')](_0x1b52ee)){var _0x45ba67=JSON[_0x4533('0x3')](_0x1b52ee);var _0x57ff74={'$gte':moment(moment(_0x45ba67[_0x4533('0xe')])[_0x4533('0xf')](_0x4533('0x10')))[_0x4533('0x11')]()['format'](),'$lte':moment(moment(_0x45ba67[_0x4533('0x12')])['format']('YYYY-MM-DD'))[_0x4533('0x11')]()[_0x4533('0x13')](0x1,'s')['format']()};_0x4fdbda[_0x12131a]=_0x57ff74;}else if(_0x5465bf[_0x4533('0x14')]===_0x4533('0x15')){_0x4fdbda[_0x12131a]=_0x1b52ee;}else{_0x4fdbda[_0x12131a]=_[_0x4533('0x16')](_0x1b52ee)?_0x1b52ee:JSON['parse'](_0x1b52ee);}}else{_0x4fdbda[_0x12131a]=_[_0x4533('0x16')](_0x1b52ee)?_0x1b52ee:JSON['parse'](_0x1b52ee);}}catch(_0x3ddb36){_0x4fdbda[_0x12131a]=_0x1b52ee[_0x4533('0x7')](',');}});}return _0x4fdbda;};exports['limit']=function(_0xd10c6a){_0xd10c6a=parseInt(_0xd10c6a,0xa);if(!_0xd10c6a||_0xd10c6a<0x0){_0xd10c6a=LIMIT_VALUE;}return _0xd10c6a;};exports['offset']=function(_0x5c2c9c){_0x5c2c9c=parseInt(_0x5c2c9c,0xa);if(!_0x5c2c9c||_0x5c2c9c<0x0){_0x5c2c9c=0x0;}return _0x5c2c9c;};exports[_0x4533('0x17')]=function(_0x9740a6){var _0x49fb91,_0x53fe43=null;if(_0x9740a6){_0x49fb91=_0x9740a6[_0x4533('0x7')](',');_0x53fe43=_[_0x4533('0x18')](_0x49fb91,function(_0x3467ba){if(_0x3467ba[_0x4533('0x19')]('-')===0x0){return[_0x3467ba===_0x4533('0x1a')?sequelize[_0x4533('0x1b')](sequelize[_0x4533('0x1c')]('priority'),_0x4533('0x1d')):_0x3467ba[_0x4533('0x1e')](0x1),_0x4533('0x1f')];}else{return[_0x3467ba==='priority'?sequelize['cast'](sequelize[_0x4533('0x1c')](_0x4533('0x1a')),'unsigned'):_0x3467ba,'ASC'];}});}return _0x53fe43;};exports[_0x4533('0x20')]=function(_0x1fa8be,_0xfd9409){if(_['isEmpty'](_0x1fa8be)){return _0x1fa8be;}if(_[_0x4533('0x16')](_0x1fa8be)){for(var _0x39b261=0x0;_0x39b261<_0x1fa8be[_0x4533('0x21')];_0x39b261+=0x1){_0x1fa8be[_0x39b261]=this[_0x4533('0x20')](_0x1fa8be[_0x39b261],_0xfd9409);}return _0x1fa8be;}if(!_[_0x4533('0x22')](_0x1fa8be)){return _0x1fa8be;}if(_[_0x4533('0x23')](_0xfd9409)){_0xfd9409=[_0xfd9409];}if(!_[_0x4533('0x16')](_0xfd9409)){return _0x1fa8be;}for(var _0x27b653=0x0;_0x27b653<_0xfd9409[_0x4533('0x21')];_0x27b653+=0x1){_['unset'](_0x1fa8be,_0xfd9409[_0x27b653]);}for(var _0x5c1e24 in _0x1fa8be){if(_0x1fa8be[_0x4533('0x24')](_0x5c1e24)){_0x1fa8be[_0x5c1e24]=this['omit'](_0x1fa8be[_0x5c1e24],_0xfd9409);}}return _0x1fa8be;};exports[_0x4533('0x25')]=function(_0x4e2b80){return _0x4e2b80[_0x4533('0x26')](RegExp(_0x4533('0x27')))?!![]:![];};exports[_0x4533('0x28')]=function(_0x4300c1){return _0x4300c1[_0x4533('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0x4533('0x29')]=function(_0xe584a2){var _0xa58dd1=[];_0xe584a2[_0x4533('0x7')](/[ ,]+/)[_0x4533('0x2a')](function(_0x728791){_0x728791=_0x728791[_0x4533('0x2b')](/([^:]")"+/g,'$1');_0x728791='+'+_0x728791+'*';var _0x7fc887=/[ `!@#$%^&*()_\-?~]/;if(_0x728791['match'](_0x7fc887))_0x728791='\x22'+_0x728791+'\x22';_0xa58dd1[_0x4533('0x2c')](_0x728791);});return _0xa58dd1['join']('\x20');};exports[_0x4533('0x2d')]=function(_0x3f7720,_0xb7f0b1,_0x3b89f0){var _0x24acf5={},_0x6d58aa={};if(_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x2f')]){_0xb7f0b1[_0x4533('0x2e')]['id']=_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x2f')];delete _0xb7f0b1[_0x4533('0x2e')]['$id'];}_0x24acf5[_0x4533('0x30')]=_[_0x4533('0x18')](_0x3f7720,_0x4533('0x14'));_0x24acf5[_0x4533('0x2e')]=_[_0x4533('0x4')](_0xb7f0b1['query']);_0x24acf5[_0x4533('0x8')]=_[_0x4533('0x31')](_0x24acf5[_0x4533('0x30')],_0x24acf5[_0x4533('0x2e')]);_0x6d58aa[_0x4533('0x32')]=_[_0x4533('0x31')](_0x24acf5['model'],this[_0x4533('0x6')](_0xb7f0b1[_0x4533('0x2e')]['fields']));_0x6d58aa[_0x4533('0x32')]=_0x6d58aa[_0x4533('0x32')][_0x4533('0x21')]?_0x6d58aa[_0x4533('0x32')]:_0x24acf5[_0x4533('0x30')];if(!_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x24')](_0x4533('0x33'))){_0x6d58aa[_0x4533('0x34')]=this[_0x4533('0x34')](_0xb7f0b1['query'][_0x4533('0x34')]);_0x6d58aa[_0x4533('0x35')]=this[_0x4533('0x35')](_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x35')]);}_0x6d58aa[_0x4533('0x36')]=this[_0x4533('0x17')](_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x17')]);_0x6d58aa[_0x4533('0x37')]=this[_0x4533('0x8')](_[_0x4533('0x38')](_0xb7f0b1['query'],_0x24acf5['filters']),_0x3f7720);if(_0xb7f0b1[_0x4533('0x2e')]['filter']){var _0x4260e6=_0x3f7720;var _0x97aa9e=_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x39')];if(typeof _0x97aa9e===_0x4533('0x3a')){_0x4260e6=_[_0x4533('0x39')](_0x3f7720,function(_0x2df795){return _[_0x4533('0x5')](_0x97aa9e[_0x4533('0x3b')],_0x2df795[_0x4533('0x14')]);});_0x97aa9e=_0x97aa9e[_0x4533('0x3c')];}_0x6d58aa[_0x4533('0x37')]=_[_0x4533('0x3d')](_0x6d58aa['where'],{'$or':_[_0x4533('0x18')](_0x4260e6,function(_0x556dd9){if(_0x556dd9['type']!=='VIRTUAL'){if(_0x3b89f0){return sequelize['where'](sequelize['fn'](_0x4533('0x3e'),sequelize[_0x4533('0x1c')](_0x556dd9[_0x4533('0x14')])),{'$like':sequelize['fn'](_0x4533('0x3e'),'%'+_0xb7f0b1['query'][_0x4533('0x39')]+'%')});}else{var _0x369284={};_0x369284[_0x556dd9[_0x4533('0x14')]]={'$like':'%'+_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x39')]+'%'};return _0x369284;}}})});}_0x6d58aa=_[_0x4533('0x3d')]({},_0x6d58aa,_0xb7f0b1[_0x4533('0x3f')]);return _0x6d58aa;};
\ No newline at end of file