Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / components / parsers / qs.js
index 8c5fee9..1961922 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bd8=['type','VIRTUAL','lower','options','lodash','moment','parse','keys','fields','forOwn','find','DATE','$gte','format','YYYY-MM-DD','$lte','subtract','name','uniqueid','isArray','split','limit','offset','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','isEmpty','length','omit','isObject','isString','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','filters','intersection','attributes','nolimit','sort','where','pick','filter','includes','value','merge'];(function(_0x10c783,_0x7658a2){var _0x2f0f87=function(_0x10cf4b){while(--_0x10cf4b){_0x10c783['push'](_0x10c783['shift']());}};_0x2f0f87(++_0x7658a2);}(_0x2bd8,0x130));var _0x82bd=function(_0x216fcc,_0x3477ef){_0x216fcc=_0x216fcc-0x0;var _0x4ccefa=_0x2bd8[_0x216fcc];return _0x4ccefa;};'use strict';var _=require(_0x82bd('0x0'));var sequelize=require('sequelize');var moment=require(_0x82bd('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x391673){var _0x208a3d=['ne'];try{var _0x41dbdf=JSON[_0x82bd('0x2')](_0x391673);var _0x197dbc=Object[_0x82bd('0x3')](_0x41dbdf)[0x0];return _0x208a3d['includes'](_0x197dbc);}catch(_0x41584e){return![];}}function getOperatorValue(_0x2e1a98){var _0x3bf810=JSON['parse'](_0x2e1a98);var _0x19dbb1=Object[_0x82bd('0x3')](_0x3bf810)[0x0];var _0x226f60=_0x3bf810[_0x19dbb1];return{['$'+_0x19dbb1]:_0x226f60};}exports[_0x82bd('0x4')]=function(_0x4dc3a6){var _0x1666cf=null;if(_0x4dc3a6){_0x1666cf=_0x4dc3a6['split'](',');}return _0x1666cf;};exports['filters']=function(_0x51c6ea,_0x5bb22c){var _0x5f0434={};if(!_['isEmpty'](_0x51c6ea)){_[_0x82bd('0x5')](_0x51c6ea,function(_0x5f3959,_0x4e50da){try{if(_0x5bb22c){var _0x32821a=_[_0x82bd('0x6')](_0x5bb22c,{'name':_0x4e50da})||{};if(hasSequelizeOperator(_0x5f3959)){_0x5f0434[_0x4e50da]=getOperatorValue(_0x5f3959);}else if(_0x32821a['type']===_0x82bd('0x7')&&_['isPlainObject'](_0x5f3959)){var _0xfaccf7=JSON['parse'](_0x5f3959);var _0x338bb4={'$gte':moment(moment(_0xfaccf7[_0x82bd('0x8')])[_0x82bd('0x9')](_0x82bd('0xa')))['utc']()[_0x82bd('0x9')](),'$lte':moment(moment(_0xfaccf7[_0x82bd('0xb')])['format'](_0x82bd('0xa')))['utc']()[_0x82bd('0xc')](0x1,'s')[_0x82bd('0x9')]()};_0x5f0434[_0x4e50da]=_0x338bb4;}else if(_0x32821a[_0x82bd('0xd')]===_0x82bd('0xe')){_0x5f0434[_0x4e50da]=_0x5f3959;}else{_0x5f0434[_0x4e50da]=_[_0x82bd('0xf')](_0x5f3959)?_0x5f3959:JSON[_0x82bd('0x2')](_0x5f3959);}}else{_0x5f0434[_0x4e50da]=_[_0x82bd('0xf')](_0x5f3959)?_0x5f3959:JSON[_0x82bd('0x2')](_0x5f3959);}}catch(_0x31a350){_0x5f0434[_0x4e50da]=_0x5f3959[_0x82bd('0x10')](',');}});}return _0x5f0434;};exports[_0x82bd('0x11')]=function(_0x29b689){_0x29b689=parseInt(_0x29b689,0xa);if(!_0x29b689||_0x29b689<0x0){_0x29b689=LIMIT_VALUE;}return _0x29b689;};exports[_0x82bd('0x12')]=function(_0x253741){_0x253741=parseInt(_0x253741,0xa);if(!_0x253741||_0x253741<0x0){_0x253741=0x0;}return _0x253741;};exports['sort']=function(_0x5688ed){var _0x283ce7,_0x3eb844=null;if(_0x5688ed){_0x283ce7=_0x5688ed[_0x82bd('0x10')](',');_0x3eb844=_[_0x82bd('0x13')](_0x283ce7,function(_0x34899b){if(_0x34899b[_0x82bd('0x14')]('-')===0x0){return[_0x34899b===_0x82bd('0x15')?sequelize[_0x82bd('0x16')](sequelize[_0x82bd('0x17')](_0x82bd('0x15')),_0x82bd('0x18')):_0x34899b[_0x82bd('0x19')](0x1),_0x82bd('0x1a')];}else{return[_0x34899b===_0x82bd('0x15')?sequelize[_0x82bd('0x16')](sequelize[_0x82bd('0x17')](_0x82bd('0x15')),_0x82bd('0x18')):_0x34899b,_0x82bd('0x1b')];}});}return _0x3eb844;};exports['omit']=function(_0x4b3215,_0x4248be){if(_[_0x82bd('0x1c')](_0x4b3215)){return _0x4b3215;}if(_[_0x82bd('0xf')](_0x4b3215)){for(var _0x3eb6a5=0x0;_0x3eb6a5<_0x4b3215[_0x82bd('0x1d')];_0x3eb6a5+=0x1){_0x4b3215[_0x3eb6a5]=this[_0x82bd('0x1e')](_0x4b3215[_0x3eb6a5],_0x4248be);}return _0x4b3215;}if(!_[_0x82bd('0x1f')](_0x4b3215)){return _0x4b3215;}if(_[_0x82bd('0x20')](_0x4248be)){_0x4248be=[_0x4248be];}if(!_[_0x82bd('0xf')](_0x4248be)){return _0x4b3215;}for(var _0x2add80=0x0;_0x2add80<_0x4248be['length'];_0x2add80+=0x1){_['unset'](_0x4b3215,_0x4248be[_0x2add80]);}for(var _0x5609b7 in _0x4b3215){if(_0x4b3215['hasOwnProperty'](_0x5609b7)){_0x4b3215[_0x5609b7]=this[_0x82bd('0x1e')](_0x4b3215[_0x5609b7],_0x4248be);}}return _0x4b3215;};exports[_0x82bd('0x21')]=function(_0x351d3d){return _0x351d3d[_0x82bd('0x22')](RegExp(_0x82bd('0x23')))?!![]:![];};exports['isEmail']=function(_0x516c6d){return _0x516c6d['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x82bd('0x24')]=function(_0x2a5867){var _0x40884f=[];_0x2a5867['split'](/[ ,]+/)[_0x82bd('0x25')](function(_0x4f209e){_0x4f209e=_0x4f209e[_0x82bd('0x26')](/([^:]")"+/g,'$1');_0x4f209e='+'+_0x4f209e+'*';var _0x1a1e24=/[ `!@#$%^&*()_\-?~]/;if(_0x4f209e[_0x82bd('0x22')](_0x1a1e24))_0x4f209e='\x22'+_0x4f209e+'\x22';_0x40884f[_0x82bd('0x27')](_0x4f209e);});return _0x40884f[_0x82bd('0x28')]('\x20');};exports[_0x82bd('0x29')]=function(_0x5ca7fc,_0x591b38,_0x406c96){var _0x3a7d07={},_0x4a927a={};if(_0x591b38[_0x82bd('0x2a')]['$id']){_0x591b38['query']['id']=_0x591b38[_0x82bd('0x2a')][_0x82bd('0x2b')];delete _0x591b38[_0x82bd('0x2a')][_0x82bd('0x2b')];}_0x3a7d07[_0x82bd('0x2c')]=_[_0x82bd('0x13')](_0x5ca7fc,_0x82bd('0xd'));_0x3a7d07[_0x82bd('0x2a')]=_[_0x82bd('0x3')](_0x591b38[_0x82bd('0x2a')]);_0x3a7d07[_0x82bd('0x2d')]=_[_0x82bd('0x2e')](_0x3a7d07[_0x82bd('0x2c')],_0x3a7d07[_0x82bd('0x2a')]);_0x4a927a[_0x82bd('0x2f')]=_[_0x82bd('0x2e')](_0x3a7d07[_0x82bd('0x2c')],this['fields'](_0x591b38['query']['fields']));_0x4a927a[_0x82bd('0x2f')]=_0x4a927a[_0x82bd('0x2f')]['length']?_0x4a927a[_0x82bd('0x2f')]:_0x3a7d07['model'];if(!_0x591b38['query']['hasOwnProperty'](_0x82bd('0x30'))){_0x4a927a[_0x82bd('0x11')]=this[_0x82bd('0x11')](_0x591b38[_0x82bd('0x2a')][_0x82bd('0x11')]);_0x4a927a['offset']=this['offset'](_0x591b38['query'][_0x82bd('0x12')]);}_0x4a927a['order']=this['sort'](_0x591b38[_0x82bd('0x2a')][_0x82bd('0x31')]);_0x4a927a[_0x82bd('0x32')]=this[_0x82bd('0x2d')](_[_0x82bd('0x33')](_0x591b38[_0x82bd('0x2a')],_0x3a7d07[_0x82bd('0x2d')]),_0x5ca7fc);if(_0x591b38[_0x82bd('0x2a')][_0x82bd('0x34')]){var _0x5512b0=_0x5ca7fc;var _0x5c7661=_0x591b38[_0x82bd('0x2a')][_0x82bd('0x34')];if(typeof _0x5c7661==='object'){_0x5512b0=_['filter'](_0x5ca7fc,function(_0x277b7a){return _[_0x82bd('0x35')](_0x5c7661['columns'],_0x277b7a[_0x82bd('0xd')]);});_0x5c7661=_0x5c7661[_0x82bd('0x36')];}_0x4a927a[_0x82bd('0x32')]=_[_0x82bd('0x37')](_0x4a927a[_0x82bd('0x32')],{'$or':_[_0x82bd('0x13')](_0x5512b0,function(_0x2a18c3){if(_0x2a18c3[_0x82bd('0x38')]!==_0x82bd('0x39')){if(_0x406c96){return sequelize[_0x82bd('0x32')](sequelize['fn'](_0x82bd('0x3a'),sequelize[_0x82bd('0x17')](_0x2a18c3['name'])),{'$like':sequelize['fn'](_0x82bd('0x3a'),'%'+_0x591b38[_0x82bd('0x2a')]['filter']+'%')});}else{var _0x5b736e={};_0x5b736e[_0x2a18c3[_0x82bd('0xd')]]={'$like':'%'+_0x591b38[_0x82bd('0x2a')][_0x82bd('0x34')]+'%'};return _0x5b736e;}}})});}_0x4a927a=_[_0x82bd('0x37')]({},_0x4a927a,_0x591b38[_0x82bd('0x3b')]);return _0x4a927a;};
\ No newline at end of file
+var _0xf781=['length','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','getOptions','query','$id','model','name','attributes','nolimit','order','pick','filter','object','columns','value','where','merge','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','$lte','utc','subtract','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','col','DESC','unsigned','omit'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0xf781,0x125));var _0x1f78=function(_0x4bd8ce,_0x363ab3){_0x4bd8ce=_0x4bd8ce-0x0;var _0x2199a3=_0xf781[_0x4bd8ce];return _0x2199a3;};'use strict';var _=require(_0x1f78('0x0'));var sequelize=require(_0x1f78('0x1'));var moment=require(_0x1f78('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x398ed5){var _0x1c9c9c=['ne'];try{var _0x524e42=JSON[_0x1f78('0x3')](_0x398ed5);var _0x592885=Object[_0x1f78('0x4')](_0x524e42)[0x0];return _0x1c9c9c[_0x1f78('0x5')](_0x592885);}catch(_0x1486cf){return![];}}function getOperatorValue(_0x41a44b){var _0x487bbf=JSON['parse'](_0x41a44b);var _0xe2e20d=Object[_0x1f78('0x4')](_0x487bbf)[0x0];var _0x479741=_0x487bbf[_0xe2e20d];return{['$'+_0xe2e20d]:_0x479741};}exports[_0x1f78('0x6')]=function(_0x276196){var _0x30fc1d=null;if(_0x276196){_0x30fc1d=_0x276196[_0x1f78('0x7')](',');}return _0x30fc1d;};exports[_0x1f78('0x8')]=function(_0x118d25,_0x3abd0e){var _0x459d32={};if(!_[_0x1f78('0x9')](_0x118d25)){_['forOwn'](_0x118d25,function(_0xc6ab4c,_0x48261e){try{if(_0x3abd0e){var _0x563d8b=_['find'](_0x3abd0e,{'name':_0x48261e})||{};if(hasSequelizeOperator(_0xc6ab4c)){_0x459d32[_0x48261e]=getOperatorValue(_0xc6ab4c);}else if(_0x563d8b[_0x1f78('0xa')]===_0x1f78('0xb')&&_[_0x1f78('0xc')](_0xc6ab4c)){var _0x34998f=JSON[_0x1f78('0x3')](_0xc6ab4c);var _0x2fc53f={'$gte':moment(moment(_0x34998f[_0x1f78('0xd')])[_0x1f78('0xe')](_0x1f78('0xf')))['utc']()[_0x1f78('0xe')](),'$lte':moment(moment(_0x34998f[_0x1f78('0x10')])[_0x1f78('0xe')](_0x1f78('0xf')))[_0x1f78('0x11')]()[_0x1f78('0x12')](0x1,'s')['format']()};_0x459d32[_0x48261e]=_0x2fc53f;}else if(_0x563d8b['name']===_0x1f78('0x13')){_0x459d32[_0x48261e]=_0xc6ab4c;}else{_0x459d32[_0x48261e]=_[_0x1f78('0x14')](_0xc6ab4c)?_0xc6ab4c:JSON[_0x1f78('0x3')](_0xc6ab4c);}}else{_0x459d32[_0x48261e]=_[_0x1f78('0x14')](_0xc6ab4c)?_0xc6ab4c:JSON['parse'](_0xc6ab4c);}}catch(_0x289aac){_0x459d32[_0x48261e]=_0xc6ab4c[_0x1f78('0x7')](',');}});}return _0x459d32;};exports[_0x1f78('0x15')]=function(_0x37e31c){_0x37e31c=parseInt(_0x37e31c,0xa);if(!_0x37e31c||_0x37e31c<0x0){_0x37e31c=LIMIT_VALUE;}return _0x37e31c;};exports[_0x1f78('0x16')]=function(_0x3c1073){_0x3c1073=parseInt(_0x3c1073,0xa);if(!_0x3c1073||_0x3c1073<0x0){_0x3c1073=0x0;}return _0x3c1073;};exports[_0x1f78('0x17')]=function(_0x5aa57a){var _0x31760b,_0x4a5761=null;if(_0x5aa57a){_0x31760b=_0x5aa57a[_0x1f78('0x7')](',');_0x4a5761=_[_0x1f78('0x18')](_0x31760b,function(_0x5aab9d){if(_0x5aab9d[_0x1f78('0x19')]('-')===0x0){return[_0x5aab9d===_0x1f78('0x1a')?sequelize[_0x1f78('0x1b')](sequelize[_0x1f78('0x1c')]('priority'),'unsigned'):_0x5aab9d['substr'](0x1),_0x1f78('0x1d')];}else{return[_0x5aab9d===_0x1f78('0x1a')?sequelize['cast'](sequelize['col']('priority'),_0x1f78('0x1e')):_0x5aab9d,'ASC'];}});}return _0x4a5761;};exports[_0x1f78('0x1f')]=function(_0x51abe1,_0x508749){if(_['isEmpty'](_0x51abe1)){return _0x51abe1;}if(_[_0x1f78('0x14')](_0x51abe1)){for(var _0x133790=0x0;_0x133790<_0x51abe1[_0x1f78('0x20')];_0x133790+=0x1){_0x51abe1[_0x133790]=this[_0x1f78('0x1f')](_0x51abe1[_0x133790],_0x508749);}return _0x51abe1;}if(!_['isObject'](_0x51abe1)){return _0x51abe1;}if(_[_0x1f78('0x21')](_0x508749)){_0x508749=[_0x508749];}if(!_[_0x1f78('0x14')](_0x508749)){return _0x51abe1;}for(var _0x4f08d3=0x0;_0x4f08d3<_0x508749[_0x1f78('0x20')];_0x4f08d3+=0x1){_[_0x1f78('0x22')](_0x51abe1,_0x508749[_0x4f08d3]);}for(var _0x24edc7 in _0x51abe1){if(_0x51abe1[_0x1f78('0x23')](_0x24edc7)){_0x51abe1[_0x24edc7]=this[_0x1f78('0x1f')](_0x51abe1[_0x24edc7],_0x508749);}}return _0x51abe1;};exports[_0x1f78('0x24')]=function(_0x2349b8){return _0x2349b8[_0x1f78('0x25')](RegExp(_0x1f78('0x26')))?!![]:![];};exports[_0x1f78('0x27')]=function(_0x303d3d){return _0x303d3d['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x1f78('0x28')]=function(_0x38cccb,_0x3a5504){var _0x28eabc=[];var _0x526e2f=/[ `!@#$%^&*()_\-?~]/;var _0x3de753=_0x3a5504?_0x1f78('0x29'):_0x1f78('0x2a');_0x38cccb['split'](/[ ,]+/)[_0x1f78('0x2b')](function(_0x494f7d){_0x494f7d=_0x494f7d[_0x1f78('0x2c')](/([^:]")"+/g,'$1');_0x494f7d='+'+_0x494f7d+'*';var _0x30b7a4=_0x494f7d[_0x1f78('0x25')](_0x526e2f);if(_0x30b7a4){_0x494f7d='\x22'+_0x494f7d+'\x22';}_0x28eabc[_0x1f78('0x2d')](_0x494f7d);});_0x3de753=_0x3de753['replace'](_0x1f78('0x2a'),_0x28eabc[_0x1f78('0x2e')]('\x20'));return _0x3de753;};exports[_0x1f78('0x2f')]=function(_0x84d4f6,_0x232ef1,_0x56a85f){var _0x42fa6f={},_0x8dcdae={};if(_0x232ef1[_0x1f78('0x30')][_0x1f78('0x31')]){_0x232ef1[_0x1f78('0x30')]['id']=_0x232ef1[_0x1f78('0x30')][_0x1f78('0x31')];delete _0x232ef1['query'][_0x1f78('0x31')];}_0x42fa6f[_0x1f78('0x32')]=_[_0x1f78('0x18')](_0x84d4f6,_0x1f78('0x33'));_0x42fa6f['query']=_[_0x1f78('0x4')](_0x232ef1[_0x1f78('0x30')]);_0x42fa6f[_0x1f78('0x8')]=_['intersection'](_0x42fa6f[_0x1f78('0x32')],_0x42fa6f[_0x1f78('0x30')]);_0x8dcdae['attributes']=_['intersection'](_0x42fa6f[_0x1f78('0x32')],this[_0x1f78('0x6')](_0x232ef1[_0x1f78('0x30')]['fields']));_0x8dcdae[_0x1f78('0x34')]=_0x8dcdae[_0x1f78('0x34')]['length']?_0x8dcdae[_0x1f78('0x34')]:_0x42fa6f[_0x1f78('0x32')];if(!_0x232ef1[_0x1f78('0x30')][_0x1f78('0x23')](_0x1f78('0x35'))){_0x8dcdae['limit']=this['limit'](_0x232ef1[_0x1f78('0x30')]['limit']);_0x8dcdae[_0x1f78('0x16')]=this['offset'](_0x232ef1[_0x1f78('0x30')][_0x1f78('0x16')]);}_0x8dcdae[_0x1f78('0x36')]=this[_0x1f78('0x17')](_0x232ef1[_0x1f78('0x30')][_0x1f78('0x17')]);_0x8dcdae['where']=this[_0x1f78('0x8')](_[_0x1f78('0x37')](_0x232ef1[_0x1f78('0x30')],_0x42fa6f[_0x1f78('0x8')]),_0x84d4f6);if(_0x232ef1[_0x1f78('0x30')][_0x1f78('0x38')]){var _0x5dc865=_0x84d4f6;var _0x5e7fd6=_0x232ef1[_0x1f78('0x30')][_0x1f78('0x38')];if(typeof _0x5e7fd6===_0x1f78('0x39')){_0x5dc865=_[_0x1f78('0x38')](_0x84d4f6,function(_0x5d8a56){return _[_0x1f78('0x5')](_0x5e7fd6[_0x1f78('0x3a')],_0x5d8a56[_0x1f78('0x33')]);});_0x5e7fd6=_0x5e7fd6[_0x1f78('0x3b')];}_0x8dcdae[_0x1f78('0x3c')]=_[_0x1f78('0x3d')](_0x8dcdae['where'],{'$or':_[_0x1f78('0x18')](_0x5dc865,function(_0x5780fb){if(_0x5780fb[_0x1f78('0xa')]!==_0x1f78('0x3e')){if(_0x56a85f){return sequelize[_0x1f78('0x3c')](sequelize['fn'](_0x1f78('0x3f'),sequelize[_0x1f78('0x1c')](_0x5780fb[_0x1f78('0x33')])),{'$like':sequelize['fn']('lower','%'+_0x232ef1[_0x1f78('0x30')][_0x1f78('0x38')]+'%')});}else{var _0x2cd853={};_0x2cd853[_0x5780fb[_0x1f78('0x33')]]={'$like':'%'+_0x232ef1['query'][_0x1f78('0x38')]+'%'};return _0x2cd853;}}})});}_0x8dcdae=_[_0x1f78('0x3d')]({},_0x8dcdae,_0x232ef1[_0x1f78('0x40')]);return _0x8dcdae;};
\ No newline at end of file