Built motion from commit a61a4a20.|2.5.46
[motion2.git] / server / components / parsers / qs.js
index d3ea2f2..81d3de0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x059a=['isArray','offset','sort','map','indexOf','cast','col','unsigned','substr','priority','ASC','length','omit','isObject','isString','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','includes','push','join','getOptions','query','$id','model','intersection','attributes','fields','limit','where','pick','filter','merge','type','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','split','filters','isEmpty','forOwn','find','DATE','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid'];(function(_0xbb6352,_0x50de62){var _0x16feac=function(_0x1fdc20){while(--_0x1fdc20){_0xbb6352['push'](_0xbb6352['shift']());}};_0x16feac(++_0x50de62);}(_0x059a,0x14f));var _0xa059=function(_0x413410,_0xf7ac22){_0x413410=_0x413410-0x0;var _0x1294e5=_0x059a[_0x413410];return _0x1294e5;};'use strict';var _=require(_0xa059('0x0'));var sequelize=require(_0xa059('0x1'));var moment=require(_0xa059('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x888784){var _0x5b929f=['ne'];try{var _0x4a1ef4=JSON[_0xa059('0x3')](_0x888784);var _0x579737=Object[_0xa059('0x4')](_0x4a1ef4)[0x0];return _0x5b929f['includes'](_0x579737);}catch(_0xd2e740){return![];}}function getOperatorValue(_0x243d3d){var _0x534f71=JSON[_0xa059('0x3')](_0x243d3d);var _0x5808a3=Object[_0xa059('0x4')](_0x534f71)[0x0];var _0x38bd16=_0x534f71[_0x5808a3];return{['$'+_0x5808a3]:_0x38bd16};}exports['fields']=function(_0x281edd){var _0x254c8d=null;if(_0x281edd){_0x254c8d=_0x281edd[_0xa059('0x5')](',');}return _0x254c8d;};exports[_0xa059('0x6')]=function(_0x51fa25,_0x38264a){var _0x17abc4={};if(!_[_0xa059('0x7')](_0x51fa25)){_[_0xa059('0x8')](_0x51fa25,function(_0x3a3884,_0x234bf7){try{if(_0x38264a){var _0x111873=_[_0xa059('0x9')](_0x38264a,{'name':_0x234bf7})||{};if(hasSequelizeOperator(_0x3a3884)){_0x17abc4[_0x234bf7]=getOperatorValue(_0x3a3884);}else if(_0x111873['type']===_0xa059('0xa')&&_['isPlainObject'](_0x3a3884)){var _0x47efdf=JSON[_0xa059('0x3')](_0x3a3884);var _0x71949f={'$gte':moment(moment(_0x47efdf[_0xa059('0xb')])[_0xa059('0xc')](_0xa059('0xd')))[_0xa059('0xe')]()['format'](),'$lte':moment(moment(_0x47efdf[_0xa059('0xf')])[_0xa059('0xc')](_0xa059('0xd')))[_0xa059('0xe')]()[_0xa059('0x10')](0x1,'s')[_0xa059('0xc')]()};_0x17abc4[_0x234bf7]=_0x71949f;}else if(_0x111873[_0xa059('0x11')]===_0xa059('0x12')){_0x17abc4[_0x234bf7]=_0x3a3884;}else{_0x17abc4[_0x234bf7]=_[_0xa059('0x13')](_0x3a3884)?_0x3a3884:JSON[_0xa059('0x3')](_0x3a3884);}}else{_0x17abc4[_0x234bf7]=_[_0xa059('0x13')](_0x3a3884)?_0x3a3884:JSON['parse'](_0x3a3884);}}catch(_0xd5edc1){_0x17abc4[_0x234bf7]=_0x3a3884['split'](',');}});}return _0x17abc4;};exports['limit']=function(_0x4ff441){_0x4ff441=parseInt(_0x4ff441,0xa);if(!_0x4ff441||_0x4ff441<0x0){_0x4ff441=LIMIT_VALUE;}return _0x4ff441;};exports[_0xa059('0x14')]=function(_0x5ab187){_0x5ab187=parseInt(_0x5ab187,0xa);if(!_0x5ab187||_0x5ab187<0x0){_0x5ab187=0x0;}return _0x5ab187;};exports[_0xa059('0x15')]=function(_0x58fde6){var _0x387e3c,_0x1d13e1=null;if(_0x58fde6){_0x387e3c=_0x58fde6[_0xa059('0x5')](',');_0x1d13e1=_[_0xa059('0x16')](_0x387e3c,function(_0x4cca38){if(_0x4cca38[_0xa059('0x17')]('-')===0x0){return[_0x4cca38==='priority'?sequelize[_0xa059('0x18')](sequelize[_0xa059('0x19')]('priority'),_0xa059('0x1a')):_0x4cca38[_0xa059('0x1b')](0x1),'DESC'];}else{return[_0x4cca38===_0xa059('0x1c')?sequelize['cast'](sequelize[_0xa059('0x19')](_0xa059('0x1c')),'unsigned'):_0x4cca38,_0xa059('0x1d')];}});}return _0x1d13e1;};exports['omit']=function(_0x451048,_0x549a24){if(_[_0xa059('0x7')](_0x451048)){return _0x451048;}if(_[_0xa059('0x13')](_0x451048)){for(var _0x5088d6=0x0;_0x5088d6<_0x451048[_0xa059('0x1e')];_0x5088d6+=0x1){_0x451048[_0x5088d6]=this[_0xa059('0x1f')](_0x451048[_0x5088d6],_0x549a24);}return _0x451048;}if(!_[_0xa059('0x20')](_0x451048)){return _0x451048;}if(_[_0xa059('0x21')](_0x549a24)){_0x549a24=[_0x549a24];}if(!_[_0xa059('0x13')](_0x549a24)){return _0x451048;}for(var _0x29f07a=0x0;_0x29f07a<_0x549a24[_0xa059('0x1e')];_0x29f07a+=0x1){_[_0xa059('0x22')](_0x451048,_0x549a24[_0x29f07a]);}for(var _0xa1a017 in _0x451048){if(_0x451048[_0xa059('0x23')](_0xa1a017)){_0x451048[_0xa1a017]=this[_0xa059('0x1f')](_0x451048[_0xa1a017],_0x549a24);}}return _0x451048;};exports[_0xa059('0x24')]=function(_0x2a3818){return _0x2a3818[_0xa059('0x25')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xa059('0x26')]=function(_0x397ae7){return _0x397ae7[_0xa059('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0xa059('0x27')]=function(_0x3c49ef){var _0x5df131=[];_0x3c49ef[_0xa059('0x5')](/[ ,]+/)['forEach'](function(_0x4f2c83){_0x4f2c83=_0x4f2c83['replace'](/([^:]")"+/g,'$1');_0x4f2c83='+'+_0x4f2c83+'*';if(_0x4f2c83[_0xa059('0x28')]('@'))_0x4f2c83='\x22'+_0x4f2c83+'\x22';_0x5df131[_0xa059('0x29')](_0x4f2c83);});return _0x5df131[_0xa059('0x2a')]('\x20');};exports[_0xa059('0x2b')]=function(_0x25d5f6,_0xede28a,_0x4a9f1f){var _0x5033fa={},_0x437fb6={};if(_0xede28a[_0xa059('0x2c')]['$id']){_0xede28a['query']['id']=_0xede28a['query'][_0xa059('0x2d')];delete _0xede28a['query'][_0xa059('0x2d')];}_0x5033fa[_0xa059('0x2e')]=_[_0xa059('0x16')](_0x25d5f6,'name');_0x5033fa[_0xa059('0x2c')]=_[_0xa059('0x4')](_0xede28a[_0xa059('0x2c')]);_0x5033fa[_0xa059('0x6')]=_[_0xa059('0x2f')](_0x5033fa[_0xa059('0x2e')],_0x5033fa[_0xa059('0x2c')]);_0x437fb6[_0xa059('0x30')]=_[_0xa059('0x2f')](_0x5033fa[_0xa059('0x2e')],this[_0xa059('0x31')](_0xede28a[_0xa059('0x2c')][_0xa059('0x31')]));_0x437fb6[_0xa059('0x30')]=_0x437fb6['attributes'][_0xa059('0x1e')]?_0x437fb6[_0xa059('0x30')]:_0x5033fa[_0xa059('0x2e')];if(!_0xede28a[_0xa059('0x2c')][_0xa059('0x23')]('nolimit')){_0x437fb6[_0xa059('0x32')]=this[_0xa059('0x32')](_0xede28a[_0xa059('0x2c')]['limit']);_0x437fb6['offset']=this[_0xa059('0x14')](_0xede28a[_0xa059('0x2c')]['offset']);}_0x437fb6['order']=this[_0xa059('0x15')](_0xede28a[_0xa059('0x2c')]['sort']);_0x437fb6[_0xa059('0x33')]=this[_0xa059('0x6')](_[_0xa059('0x34')](_0xede28a['query'],_0x5033fa['filters']),_0x25d5f6);if(_0xede28a[_0xa059('0x2c')][_0xa059('0x35')]){_0x437fb6['where']=_[_0xa059('0x36')](_0x437fb6[_0xa059('0x33')],{'$or':_[_0xa059('0x16')](_0x25d5f6,function(_0x4d6e2a){if(_0x4d6e2a[_0xa059('0x37')]!==_0xa059('0x38')){if(_0x4a9f1f){return sequelize[_0xa059('0x33')](sequelize['fn'](_0xa059('0x39'),sequelize['col'](_0x4d6e2a[_0xa059('0x11')])),{'$like':sequelize['fn']('lower','%'+_0xede28a[_0xa059('0x2c')][_0xa059('0x35')]+'%')});}else{var _0x3e4a37={};_0x3e4a37[_0x4d6e2a[_0xa059('0x11')]]={'$like':'%'+_0xede28a[_0xa059('0x2c')]['filter']+'%'};return _0x3e4a37;}}})});}_0x437fb6=_[_0xa059('0x36')]({},_0x437fb6,_0xede28a[_0xa059('0x3a')]);return _0x437fb6;};
\ No newline at end of file
+var _0x1db9=['lower','options','lodash','sequelize','moment','keys','fields','split','forOwn','find','type','parse','$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','indexOf','priority','cast','col','unsigned','substr','DESC','omit','isEmpty','isObject','isString','length','unset','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','push','getOptions','query','$id','model','map','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','object','columns','value','merge'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0x1db9,0x176));var _0x91db=function(_0x76d334,_0x16abc0){_0x76d334=_0x76d334-0x0;var _0x4a6cb0=_0x1db9[_0x76d334];return _0x4a6cb0;};'use strict';var _=require(_0x91db('0x0'));var sequelize=require(_0x91db('0x1'));var moment=require(_0x91db('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x340fb6){var _0xcdfaed=['ne'];try{var _0xb6de0b=JSON['parse'](_0x340fb6);var _0x95a17d=Object[_0x91db('0x3')](_0xb6de0b)[0x0];return _0xcdfaed['includes'](_0x95a17d);}catch(_0x4c9f59){return![];}}function getOperatorValue(_0x379fa9){var _0x4b3f5c=JSON['parse'](_0x379fa9);var _0x433c75=Object[_0x91db('0x3')](_0x4b3f5c)[0x0];var _0x45fea0=_0x4b3f5c[_0x433c75];return{['$'+_0x433c75]:_0x45fea0};}exports[_0x91db('0x4')]=function(_0x2d89a1){var _0x55fe3e=null;if(_0x2d89a1){_0x55fe3e=_0x2d89a1[_0x91db('0x5')](',');}return _0x55fe3e;};exports['filters']=function(_0x39e939,_0xad8dd7){var _0x177e5c={};if(!_['isEmpty'](_0x39e939)){_[_0x91db('0x6')](_0x39e939,function(_0x549be2,_0x4ac257){try{if(_0xad8dd7){var _0x55fcef=_[_0x91db('0x7')](_0xad8dd7,{'name':_0x4ac257})||{};if(hasSequelizeOperator(_0x549be2)){_0x177e5c[_0x4ac257]=getOperatorValue(_0x549be2);}else if(_0x55fcef[_0x91db('0x8')]==='DATE'&&_['isPlainObject'](_0x549be2)){var _0x2b9b98=JSON[_0x91db('0x9')](_0x549be2);var _0x1f55f5={'$gte':moment(moment(_0x2b9b98[_0x91db('0xa')])[_0x91db('0xb')]('YYYY-MM-DD'))[_0x91db('0xc')]()[_0x91db('0xb')](),'$lte':moment(moment(_0x2b9b98[_0x91db('0xd')])[_0x91db('0xb')](_0x91db('0xe')))[_0x91db('0xc')]()[_0x91db('0xf')](0x1,'s')[_0x91db('0xb')]()};_0x177e5c[_0x4ac257]=_0x1f55f5;}else if(_0x55fcef[_0x91db('0x10')]===_0x91db('0x11')){_0x177e5c[_0x4ac257]=_0x549be2;}else{_0x177e5c[_0x4ac257]=_[_0x91db('0x12')](_0x549be2)?_0x549be2:JSON[_0x91db('0x9')](_0x549be2);}}else{_0x177e5c[_0x4ac257]=_['isArray'](_0x549be2)?_0x549be2:JSON[_0x91db('0x9')](_0x549be2);}}catch(_0x23d125){_0x177e5c[_0x4ac257]=_0x549be2[_0x91db('0x5')](',');}});}return _0x177e5c;};exports[_0x91db('0x13')]=function(_0xeb51b0){_0xeb51b0=parseInt(_0xeb51b0,0xa);if(!_0xeb51b0||_0xeb51b0<0x0){_0xeb51b0=LIMIT_VALUE;}return _0xeb51b0;};exports[_0x91db('0x14')]=function(_0x5c15ef){_0x5c15ef=parseInt(_0x5c15ef,0xa);if(!_0x5c15ef||_0x5c15ef<0x0){_0x5c15ef=0x0;}return _0x5c15ef;};exports['sort']=function(_0x4158f5){var _0x137edf,_0x2c3915=null;if(_0x4158f5){_0x137edf=_0x4158f5[_0x91db('0x5')](',');_0x2c3915=_['map'](_0x137edf,function(_0x168dea){if(_0x168dea[_0x91db('0x15')]('-')===0x0){return[_0x168dea===_0x91db('0x16')?sequelize[_0x91db('0x17')](sequelize[_0x91db('0x18')](_0x91db('0x16')),_0x91db('0x19')):_0x168dea[_0x91db('0x1a')](0x1),_0x91db('0x1b')];}else{return[_0x168dea===_0x91db('0x16')?sequelize['cast'](sequelize['col'](_0x91db('0x16')),_0x91db('0x19')):_0x168dea,'ASC'];}});}return _0x2c3915;};exports[_0x91db('0x1c')]=function(_0x16efa4,_0x39ae31){if(_[_0x91db('0x1d')](_0x16efa4)){return _0x16efa4;}if(_[_0x91db('0x12')](_0x16efa4)){for(var _0x4e2a8f=0x0;_0x4e2a8f<_0x16efa4['length'];_0x4e2a8f+=0x1){_0x16efa4[_0x4e2a8f]=this[_0x91db('0x1c')](_0x16efa4[_0x4e2a8f],_0x39ae31);}return _0x16efa4;}if(!_[_0x91db('0x1e')](_0x16efa4)){return _0x16efa4;}if(_[_0x91db('0x1f')](_0x39ae31)){_0x39ae31=[_0x39ae31];}if(!_['isArray'](_0x39ae31)){return _0x16efa4;}for(var _0x3b38f2=0x0;_0x3b38f2<_0x39ae31[_0x91db('0x20')];_0x3b38f2+=0x1){_[_0x91db('0x21')](_0x16efa4,_0x39ae31[_0x3b38f2]);}for(var _0x1bb4f8 in _0x16efa4){if(_0x16efa4['hasOwnProperty'](_0x1bb4f8)){_0x16efa4[_0x1bb4f8]=this[_0x91db('0x1c')](_0x16efa4[_0x1bb4f8],_0x39ae31);}}return _0x16efa4;};exports[_0x91db('0x22')]=function(_0x1805ef){return _0x1805ef['match'](RegExp(_0x91db('0x23')))?!![]:![];};exports[_0x91db('0x24')]=function(_0x2d3ebd){return _0x2d3ebd[_0x91db('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0x91db('0x26')]=function(_0x1e865e){var _0x2e6a27=[];_0x1e865e[_0x91db('0x5')](/[ ,]+/)[_0x91db('0x27')](function(_0x1b27f9){_0x1b27f9=_0x1b27f9[_0x91db('0x28')](/([^:]")"+/g,'$1');_0x1b27f9='+'+_0x1b27f9+'*';var _0x5b24b2=/[ `!@#$%^&*()_\-?~]/;if(_0x1b27f9[_0x91db('0x25')](_0x5b24b2))_0x1b27f9='\x22'+_0x1b27f9+'\x22';_0x2e6a27[_0x91db('0x29')](_0x1b27f9);});return _0x2e6a27['join']('\x20');};exports[_0x91db('0x2a')]=function(_0x1368b9,_0x73d4f4,_0x431bf6){var _0x370934={},_0x593920={};if(_0x73d4f4[_0x91db('0x2b')][_0x91db('0x2c')]){_0x73d4f4[_0x91db('0x2b')]['id']=_0x73d4f4['query'][_0x91db('0x2c')];delete _0x73d4f4['query'][_0x91db('0x2c')];}_0x370934[_0x91db('0x2d')]=_[_0x91db('0x2e')](_0x1368b9,_0x91db('0x10'));_0x370934['query']=_[_0x91db('0x3')](_0x73d4f4[_0x91db('0x2b')]);_0x370934[_0x91db('0x2f')]=_['intersection'](_0x370934[_0x91db('0x2d')],_0x370934[_0x91db('0x2b')]);_0x593920['attributes']=_[_0x91db('0x30')](_0x370934[_0x91db('0x2d')],this['fields'](_0x73d4f4[_0x91db('0x2b')]['fields']));_0x593920[_0x91db('0x31')]=_0x593920[_0x91db('0x31')]['length']?_0x593920['attributes']:_0x370934['model'];if(!_0x73d4f4[_0x91db('0x2b')][_0x91db('0x32')]('nolimit')){_0x593920[_0x91db('0x13')]=this[_0x91db('0x13')](_0x73d4f4[_0x91db('0x2b')][_0x91db('0x13')]);_0x593920[_0x91db('0x14')]=this[_0x91db('0x14')](_0x73d4f4[_0x91db('0x2b')][_0x91db('0x14')]);}_0x593920[_0x91db('0x33')]=this[_0x91db('0x34')](_0x73d4f4[_0x91db('0x2b')]['sort']);_0x593920[_0x91db('0x35')]=this['filters'](_[_0x91db('0x36')](_0x73d4f4[_0x91db('0x2b')],_0x370934['filters']),_0x1368b9);if(_0x73d4f4[_0x91db('0x2b')][_0x91db('0x37')]){var _0x16a7e9=_0x1368b9;var _0x12e86f=_0x73d4f4[_0x91db('0x2b')]['filter'];if(typeof _0x12e86f===_0x91db('0x38')){_0x16a7e9=_[_0x91db('0x37')](_0x1368b9,function(_0x1effb3){return _['includes'](_0x12e86f[_0x91db('0x39')],_0x1effb3[_0x91db('0x10')]);});_0x12e86f=_0x12e86f[_0x91db('0x3a')];}_0x593920['where']=_[_0x91db('0x3b')](_0x593920[_0x91db('0x35')],{'$or':_[_0x91db('0x2e')](_0x16a7e9,function(_0x3d73a7){if(_0x3d73a7[_0x91db('0x8')]!=='VIRTUAL'){if(_0x431bf6){return sequelize[_0x91db('0x35')](sequelize['fn']('lower',sequelize[_0x91db('0x18')](_0x3d73a7[_0x91db('0x10')])),{'$like':sequelize['fn'](_0x91db('0x3c'),'%'+_0x73d4f4[_0x91db('0x2b')][_0x91db('0x37')]+'%')});}else{var _0x2fcf33={};_0x2fcf33[_0x3d73a7[_0x91db('0x10')]]={'$like':'%'+_0x73d4f4[_0x91db('0x2b')][_0x91db('0x37')]+'%'};return _0x2fcf33;}}})});}_0x593920=_[_0x91db('0x3b')]({},_0x593920,_0x73d4f4[_0x91db('0x3d')]);return _0x593920;};
\ No newline at end of file