Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / components / parsers / qs.js
index 1961922..8a72817 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 _0xd09e=['isObject','isString','unset','hasOwnProperty','isNumeric','match','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','getOptions','query','$id','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','object','value','merge','type','VIRTUAL','lower','options','lodash','sequelize','keys','includes','parse','fields','filters','isEmpty','forOwn','find','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','isArray','split','limit','offset','map','indexOf','priority','cast','substr','DESC','col','unsigned','ASC','omit'];(function(_0x161f59,_0x42e9ff){var _0x3ffa0e=function(_0x3aef14){while(--_0x3aef14){_0x161f59['push'](_0x161f59['shift']());}};_0x3ffa0e(++_0x42e9ff);}(_0xd09e,0xdc));var _0xed09=function(_0x1833a5,_0x166312){_0x1833a5=_0x1833a5-0x0;var _0x1385b5=_0xd09e[_0x1833a5];return _0x1385b5;};'use strict';var _=require(_0xed09('0x0'));var sequelize=require(_0xed09('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1f0210){var _0x4c331b=['ne'];try{var _0x181ca4=JSON['parse'](_0x1f0210);var _0x51612b=Object[_0xed09('0x2')](_0x181ca4)[0x0];return _0x4c331b[_0xed09('0x3')](_0x51612b);}catch(_0x2226e5){return![];}}function getOperatorValue(_0x1e0b1e){var _0x27ba52=JSON[_0xed09('0x4')](_0x1e0b1e);var _0x3252ed=Object[_0xed09('0x2')](_0x27ba52)[0x0];var _0x1168fd=_0x27ba52[_0x3252ed];return{['$'+_0x3252ed]:_0x1168fd};}exports[_0xed09('0x5')]=function(_0x3bf636){var _0x10e243=null;if(_0x3bf636){_0x10e243=_0x3bf636['split'](',');}return _0x10e243;};exports[_0xed09('0x6')]=function(_0x47d757,_0x167c80){var _0x47ce53={};if(!_[_0xed09('0x7')](_0x47d757)){_[_0xed09('0x8')](_0x47d757,function(_0x300aa1,_0x5f466b){try{if(_0x167c80){var _0x57f78e=_[_0xed09('0x9')](_0x167c80,{'name':_0x5f466b})||{};if(hasSequelizeOperator(_0x300aa1)){_0x47ce53[_0x5f466b]=getOperatorValue(_0x300aa1);}else if(_0x57f78e['type']===_0xed09('0xa')&&_[_0xed09('0xb')](_0x300aa1)){var _0x92dbf1=JSON[_0xed09('0x4')](_0x300aa1);var _0x4bdd61={'$gte':moment(moment(_0x92dbf1[_0xed09('0xc')])[_0xed09('0xd')](_0xed09('0xe')))[_0xed09('0xf')]()['format'](),'$lte':moment(moment(_0x92dbf1[_0xed09('0x10')])[_0xed09('0xd')]('YYYY-MM-DD'))[_0xed09('0xf')]()[_0xed09('0x11')](0x1,'s')[_0xed09('0xd')]()};_0x47ce53[_0x5f466b]=_0x4bdd61;}else if(_0x57f78e['name']==='uniqueid'){_0x47ce53[_0x5f466b]=_0x300aa1;}else{_0x47ce53[_0x5f466b]=_[_0xed09('0x12')](_0x300aa1)?_0x300aa1:JSON[_0xed09('0x4')](_0x300aa1);}}else{_0x47ce53[_0x5f466b]=_[_0xed09('0x12')](_0x300aa1)?_0x300aa1:JSON[_0xed09('0x4')](_0x300aa1);}}catch(_0x15ab3e){_0x47ce53[_0x5f466b]=_0x300aa1[_0xed09('0x13')](',');}});}return _0x47ce53;};exports[_0xed09('0x14')]=function(_0x1feec7){_0x1feec7=parseInt(_0x1feec7,0xa);if(!_0x1feec7||_0x1feec7<0x0){_0x1feec7=LIMIT_VALUE;}return _0x1feec7;};exports[_0xed09('0x15')]=function(_0x19a566){_0x19a566=parseInt(_0x19a566,0xa);if(!_0x19a566||_0x19a566<0x0){_0x19a566=0x0;}return _0x19a566;};exports['sort']=function(_0x4afd63){var _0x3899b5,_0x637368=null;if(_0x4afd63){_0x3899b5=_0x4afd63[_0xed09('0x13')](',');_0x637368=_[_0xed09('0x16')](_0x3899b5,function(_0xad5b5){if(_0xad5b5[_0xed09('0x17')]('-')===0x0){return[_0xad5b5===_0xed09('0x18')?sequelize[_0xed09('0x19')](sequelize['col']('priority'),'unsigned'):_0xad5b5[_0xed09('0x1a')](0x1),_0xed09('0x1b')];}else{return[_0xad5b5===_0xed09('0x18')?sequelize[_0xed09('0x19')](sequelize[_0xed09('0x1c')](_0xed09('0x18')),_0xed09('0x1d')):_0xad5b5,_0xed09('0x1e')];}});}return _0x637368;};exports[_0xed09('0x1f')]=function(_0x3fcb42,_0x514e9e){if(_[_0xed09('0x7')](_0x3fcb42)){return _0x3fcb42;}if(_[_0xed09('0x12')](_0x3fcb42)){for(var _0x28f647=0x0;_0x28f647<_0x3fcb42['length'];_0x28f647+=0x1){_0x3fcb42[_0x28f647]=this[_0xed09('0x1f')](_0x3fcb42[_0x28f647],_0x514e9e);}return _0x3fcb42;}if(!_[_0xed09('0x20')](_0x3fcb42)){return _0x3fcb42;}if(_[_0xed09('0x21')](_0x514e9e)){_0x514e9e=[_0x514e9e];}if(!_['isArray'](_0x514e9e)){return _0x3fcb42;}for(var _0x1626aa=0x0;_0x1626aa<_0x514e9e['length'];_0x1626aa+=0x1){_[_0xed09('0x22')](_0x3fcb42,_0x514e9e[_0x1626aa]);}for(var _0x1329df in _0x3fcb42){if(_0x3fcb42[_0xed09('0x23')](_0x1329df)){_0x3fcb42[_0x1329df]=this[_0xed09('0x1f')](_0x3fcb42[_0x1329df],_0x514e9e);}}return _0x3fcb42;};exports[_0xed09('0x24')]=function(_0xe02db7){return _0xe02db7[_0xed09('0x25')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x585ec7){return _0x585ec7['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xed09('0x26')]=function(_0xaea332,_0x1c05d0){var _0x42e4fd=[];var _0x3648bc=/[ `!@#$%^&*()_\-?~]/;var _0x1923de=_0x1c05d0?_0xed09('0x27'):_0xed09('0x28');_0xaea332[_0xed09('0x13')](/[ ,]+/)[_0xed09('0x29')](function(_0x4a6d45){_0x4a6d45=_0x4a6d45[_0xed09('0x2a')](/([^:]")"+/g,'$1');_0x4a6d45='+'+_0x4a6d45+'*';var _0x348331=_0x4a6d45[_0xed09('0x25')](_0x3648bc);if(_0x348331){_0x4a6d45='\x22'+_0x4a6d45+'\x22';}_0x42e4fd['push'](_0x4a6d45);});_0x1923de=_0x1923de[_0xed09('0x2a')](_0xed09('0x28'),_0x42e4fd['join']('\x20'));return _0x1923de;};exports[_0xed09('0x2b')]=function(_0x55008d,_0x3f5221,_0x2fcc92){var _0x49021a={},_0x45a7be={};if(_0x3f5221[_0xed09('0x2c')][_0xed09('0x2d')]){_0x3f5221[_0xed09('0x2c')]['id']=_0x3f5221['query'][_0xed09('0x2d')];delete _0x3f5221[_0xed09('0x2c')][_0xed09('0x2d')];}_0x49021a['model']=_[_0xed09('0x16')](_0x55008d,'name');_0x49021a['query']=_[_0xed09('0x2')](_0x3f5221['query']);_0x49021a['filters']=_[_0xed09('0x2e')](_0x49021a[_0xed09('0x2f')],_0x49021a['query']);_0x45a7be[_0xed09('0x30')]=_[_0xed09('0x2e')](_0x49021a[_0xed09('0x2f')],this[_0xed09('0x5')](_0x3f5221[_0xed09('0x2c')][_0xed09('0x5')]));_0x45a7be[_0xed09('0x30')]=_0x45a7be['attributes'][_0xed09('0x31')]?_0x45a7be[_0xed09('0x30')]:_0x49021a[_0xed09('0x2f')];if(!_0x3f5221[_0xed09('0x2c')][_0xed09('0x23')](_0xed09('0x32'))){_0x45a7be[_0xed09('0x14')]=this['limit'](_0x3f5221[_0xed09('0x2c')][_0xed09('0x14')]);_0x45a7be['offset']=this['offset'](_0x3f5221['query'][_0xed09('0x15')]);}_0x45a7be[_0xed09('0x33')]=this['sort'](_0x3f5221[_0xed09('0x2c')][_0xed09('0x34')]);_0x45a7be[_0xed09('0x35')]=this['filters'](_[_0xed09('0x36')](_0x3f5221[_0xed09('0x2c')],_0x49021a[_0xed09('0x6')]),_0x55008d);if(_0x3f5221[_0xed09('0x2c')]['filter']){var _0x54d335=_0x55008d;var _0xbe1831=_0x3f5221['query'][_0xed09('0x37')];if(typeof _0xbe1831===_0xed09('0x38')){_0x54d335=_[_0xed09('0x37')](_0x55008d,function(_0x241f76){return _[_0xed09('0x3')](_0xbe1831['columns'],_0x241f76['name']);});_0xbe1831=_0xbe1831[_0xed09('0x39')];}_0x45a7be[_0xed09('0x35')]=_[_0xed09('0x3a')](_0x45a7be[_0xed09('0x35')],{'$or':_[_0xed09('0x16')](_0x54d335,function(_0x75113){if(_0x75113[_0xed09('0x3b')]!==_0xed09('0x3c')){if(_0x2fcc92){return sequelize['where'](sequelize['fn'](_0xed09('0x3d'),sequelize[_0xed09('0x1c')](_0x75113['name'])),{'$like':sequelize['fn'](_0xed09('0x3d'),'%'+_0x3f5221['query']['filter']+'%')});}else{var _0x5778aa={};_0x5778aa[_0x75113['name']]={'$like':'%'+_0x3f5221['query'][_0xed09('0x37')]+'%'};return _0x5778aa;}}})});}_0x45a7be=_['merge']({},_0x45a7be,_0x3f5221[_0xed09('0x3e')]);return _0x45a7be;};
\ No newline at end of file