Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / components / parsers / qs.js
index 1961922..eb9eaff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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
+var _0x34af=['intersection','attributes','nolimit','offset','where','pick','filter','object','includes','value','merge','VIRTUAL','lower','options','push','include','lodash','sequelize','moment','../../mysqldb','parse','keys','model','raw','fields','isEmpty','type','DATE','$gte','format','YYYY-MM-DD','utc','subtract','name','isArray','limit','sort','split','map','indexOf','priority','col','unsigned','substr','DESC','cast','ASC','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','replace','getOptions','query','$id','filters'];(function(_0x889daa,_0x22527c){var _0x267d0b=function(_0x33af1e){while(--_0x33af1e){_0x889daa['push'](_0x889daa['shift']());}};_0x267d0b(++_0x22527c);}(_0x34af,0x18a));var _0xf34a=function(_0x3268eb,_0x978d){_0x3268eb=_0x3268eb-0x0;var _0x5c8671=_0x34af[_0x3268eb];return _0x5c8671;};'use strict';var _=require(_0xf34a('0x0'));var sequelize=require(_0xf34a('0x1'));var moment=require(_0xf34a('0x2'));var db=require(_0xf34a('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x46faf4){var _0x2b9d0e=['ne'];try{var _0x13e438=JSON[_0xf34a('0x4')](_0x46faf4);var _0x2628dd=Object['keys'](_0x13e438)[0x0];return _0x2b9d0e['includes'](_0x2628dd);}catch(_0xe0e643){return![];}}function getOperatorValue(_0x509e73){var _0x3f72fd=JSON[_0xf34a('0x4')](_0x509e73);var _0x3431da=Object[_0xf34a('0x5')](_0x3f72fd)[0x0];var _0x29cbe8=_0x3f72fd[_0x3431da];return{['$'+_0x3431da]:_0x29cbe8};}function parseIncludeModel(_0x4d751c){var _0x1254ab=JSON[_0xf34a('0x4')](_0x4d751c);return{'model':db[_0x1254ab[_0xf34a('0x6')]],'as':_0x1254ab['alias'],'attributes':_0x1254ab['fields'],'raw':_0x1254ab[_0xf34a('0x7')]};}exports[_0xf34a('0x8')]=function(_0x20f48f){var _0x362d58=null;if(_0x20f48f){_0x362d58=_0x20f48f['split'](',');}return _0x362d58;};exports['filters']=function(_0x51d289,_0x59268e){var _0x4c3809={};if(!_[_0xf34a('0x9')](_0x51d289)){_['forOwn'](_0x51d289,function(_0x3f2bd6,_0x404eac){try{if(_0x59268e){var _0x4138a1=_['find'](_0x59268e,{'name':_0x404eac})||{};if(hasSequelizeOperator(_0x3f2bd6)){_0x4c3809[_0x404eac]=getOperatorValue(_0x3f2bd6);}else if(_0x4138a1[_0xf34a('0xa')]===_0xf34a('0xb')&&_['isPlainObject'](_0x3f2bd6)){var _0xd3c703=JSON[_0xf34a('0x4')](_0x3f2bd6);var _0xffa111={'$gte':moment(moment(_0xd3c703[_0xf34a('0xc')])[_0xf34a('0xd')](_0xf34a('0xe')))[_0xf34a('0xf')]()[_0xf34a('0xd')](),'$lte':moment(moment(_0xd3c703['$lte'])['format']('YYYY-MM-DD'))[_0xf34a('0xf')]()[_0xf34a('0x10')](0x1,'s')[_0xf34a('0xd')]()};_0x4c3809[_0x404eac]=_0xffa111;}else if(_0x4138a1[_0xf34a('0x11')]==='uniqueid'){_0x4c3809[_0x404eac]=_0x3f2bd6;}else{_0x4c3809[_0x404eac]=_[_0xf34a('0x12')](_0x3f2bd6)?_0x3f2bd6:JSON[_0xf34a('0x4')](_0x3f2bd6);}}else{_0x4c3809[_0x404eac]=_[_0xf34a('0x12')](_0x3f2bd6)?_0x3f2bd6:JSON[_0xf34a('0x4')](_0x3f2bd6);}}catch(_0x2ec3d0){_0x4c3809[_0x404eac]=_0x3f2bd6['split'](',');}});}return _0x4c3809;};exports[_0xf34a('0x13')]=function(_0x4dbbf9){_0x4dbbf9=parseInt(_0x4dbbf9,0xa);if(!_0x4dbbf9||_0x4dbbf9<0x0){_0x4dbbf9=LIMIT_VALUE;}return _0x4dbbf9;};exports['offset']=function(_0x4594d3){_0x4594d3=parseInt(_0x4594d3,0xa);if(!_0x4594d3||_0x4594d3<0x0){_0x4594d3=0x0;}return _0x4594d3;};exports[_0xf34a('0x14')]=function(_0x358edf){var _0x5ececc,_0x10e2ff=null;if(_0x358edf){_0x5ececc=_0x358edf[_0xf34a('0x15')](',');_0x10e2ff=_[_0xf34a('0x16')](_0x5ececc,function(_0xc8225a){if(_0xc8225a[_0xf34a('0x17')]('-')===0x0){return[_0xc8225a===_0xf34a('0x18')?sequelize['cast'](sequelize[_0xf34a('0x19')]('priority'),_0xf34a('0x1a')):_0xc8225a[_0xf34a('0x1b')](0x1),_0xf34a('0x1c')];}else{return[_0xc8225a===_0xf34a('0x18')?sequelize[_0xf34a('0x1d')](sequelize[_0xf34a('0x19')](_0xf34a('0x18')),'unsigned'):_0xc8225a,_0xf34a('0x1e')];}});}return _0x10e2ff;};exports['omit']=function(_0x18d936,_0xa6c0b2){if(_[_0xf34a('0x9')](_0x18d936)){return _0x18d936;}if(_[_0xf34a('0x12')](_0x18d936)){for(var _0x43ef3d=0x0;_0x43ef3d<_0x18d936[_0xf34a('0x1f')];_0x43ef3d+=0x1){_0x18d936[_0x43ef3d]=this['omit'](_0x18d936[_0x43ef3d],_0xa6c0b2);}return _0x18d936;}if(!_[_0xf34a('0x20')](_0x18d936)){return _0x18d936;}if(_[_0xf34a('0x21')](_0xa6c0b2)){_0xa6c0b2=[_0xa6c0b2];}if(!_[_0xf34a('0x12')](_0xa6c0b2)){return _0x18d936;}for(var _0x140d9a=0x0;_0x140d9a<_0xa6c0b2['length'];_0x140d9a+=0x1){_[_0xf34a('0x22')](_0x18d936,_0xa6c0b2[_0x140d9a]);}for(var _0x23465e in _0x18d936){if(_0x18d936[_0xf34a('0x23')](_0x23465e)){_0x18d936[_0x23465e]=this['omit'](_0x18d936[_0x23465e],_0xa6c0b2);}}return _0x18d936;};exports[_0xf34a('0x24')]=function(_0x5e3b35){return _0x5e3b35[_0xf34a('0x25')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xf34a('0x26')]=function(_0x1fa2a3){return _0x1fa2a3['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xf34a('0x27')]=function(_0x1c609e,_0x2b955c){var _0x4bdb13=[];var _0x24ae63=/[ `!@#$%^&*()_\-?~]/;var _0x4d056f=_0x2b955c?_0xf34a('0x28'):_0xf34a('0x29');_0x1c609e[_0xf34a('0x15')](/[ ,]+/)['forEach'](function(_0x39b377){_0x39b377=_0x39b377[_0xf34a('0x2a')](/([^:]")"+/g,'$1');_0x39b377='+'+_0x39b377+'*';var _0x3dc5ed=_0x39b377['match'](_0x24ae63);if(_0x3dc5ed){_0x39b377='\x22'+_0x39b377+'\x22';}_0x4bdb13['push'](_0x39b377);});_0x4d056f=_0x4d056f[_0xf34a('0x2a')]('{EXPR}',_0x4bdb13['join']('\x20'));return _0x4d056f;};exports[_0xf34a('0x2b')]=function(_0x821dd0,_0x1fc999,_0x1e3f44){var _0x903f64={},_0x1d20d7={};if(_0x1fc999[_0xf34a('0x2c')]['$id']){_0x1fc999[_0xf34a('0x2c')]['id']=_0x1fc999[_0xf34a('0x2c')][_0xf34a('0x2d')];delete _0x1fc999[_0xf34a('0x2c')][_0xf34a('0x2d')];}_0x903f64[_0xf34a('0x6')]=_[_0xf34a('0x16')](_0x821dd0,_0xf34a('0x11'));_0x903f64[_0xf34a('0x2c')]=_[_0xf34a('0x5')](_0x1fc999[_0xf34a('0x2c')]);_0x903f64[_0xf34a('0x2e')]=_[_0xf34a('0x2f')](_0x903f64[_0xf34a('0x6')],_0x903f64['query']);_0x1d20d7[_0xf34a('0x30')]=_[_0xf34a('0x2f')](_0x903f64[_0xf34a('0x6')],this[_0xf34a('0x8')](_0x1fc999['query'][_0xf34a('0x8')]));_0x1d20d7[_0xf34a('0x30')]=_0x1d20d7['attributes'][_0xf34a('0x1f')]?_0x1d20d7[_0xf34a('0x30')]:_0x903f64[_0xf34a('0x6')];if(!_0x1fc999['query'][_0xf34a('0x23')](_0xf34a('0x31'))){_0x1d20d7[_0xf34a('0x13')]=this[_0xf34a('0x13')](_0x1fc999['query'][_0xf34a('0x13')]);_0x1d20d7['offset']=this['offset'](_0x1fc999[_0xf34a('0x2c')][_0xf34a('0x32')]);}_0x1d20d7['order']=this[_0xf34a('0x14')](_0x1fc999[_0xf34a('0x2c')]['sort']);_0x1d20d7[_0xf34a('0x33')]=this[_0xf34a('0x2e')](_[_0xf34a('0x34')](_0x1fc999[_0xf34a('0x2c')],_0x903f64['filters']),_0x821dd0);if(_0x1fc999[_0xf34a('0x2c')][_0xf34a('0x35')]){var _0x312cdd=_0x821dd0;var _0x28bbed=_0x1fc999[_0xf34a('0x2c')][_0xf34a('0x35')];if(typeof _0x28bbed===_0xf34a('0x36')){_0x312cdd=_[_0xf34a('0x35')](_0x821dd0,function(_0x5b4010){return _[_0xf34a('0x37')](_0x28bbed['columns'],_0x5b4010[_0xf34a('0x11')]);});_0x28bbed=_0x28bbed[_0xf34a('0x38')];}_0x1d20d7[_0xf34a('0x33')]=_[_0xf34a('0x39')](_0x1d20d7[_0xf34a('0x33')],{'$or':_[_0xf34a('0x16')](_0x312cdd,function(_0x64d238){if(_0x64d238['type']!==_0xf34a('0x3a')){if(_0x1e3f44){return sequelize[_0xf34a('0x33')](sequelize['fn'](_0xf34a('0x3b'),sequelize[_0xf34a('0x19')](_0x64d238[_0xf34a('0x11')])),{'$like':sequelize['fn'](_0xf34a('0x3b'),'%'+_0x1fc999['query'][_0xf34a('0x35')]+'%')});}else{var _0x286fb7={};_0x286fb7[_0x64d238[_0xf34a('0x11')]]={'$like':'%'+_0x1fc999[_0xf34a('0x2c')][_0xf34a('0x35')]+'%'};return _0x286fb7;}}})});}_0x1d20d7=_[_0xf34a('0x39')]({},_0x1d20d7,_0x1fc999[_0xf34a('0x3c')]);return _0x1d20d7;};exports['include']=function(_0xb9d50b){var _0x1437cf=[];if(_0xb9d50b['includeAll']){_0x1437cf[_0xf34a('0x3d')]({'all':!![]});}else if(_0xb9d50b[_0xf34a('0x3e')]){if(Array['isArray'](_0xb9d50b[_0xf34a('0x3e')])){_0x1437cf=Object['keys'](_0xb9d50b[_0xf34a('0x3e')])['map'](function(_0x5cf550){return parseIncludeModel(_0xb9d50b[_0xf34a('0x3e')][_0x5cf550]);});}else{var _0x342dc9=parseIncludeModel(_0xb9d50b[_0xf34a('0x3e')]);_0x1437cf[_0xf34a('0x3d')](_0x342dc9);}}return _0x1437cf;};
\ No newline at end of file