Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / components / parsers / qs.js
index 141e1c4..8a72817 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2c8=['ASC','length','omit','isObject','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','push','toString','join','sequelize','fields','split','filters','isEmpty','isArray','parse','limit','offset','map','indexOf','priority','cast','col','substr','DESC'];(function(_0x2e1591,_0x1f0cfc){var _0x43c542=function(_0x264537){while(--_0x264537){_0x2e1591['push'](_0x2e1591['shift']());}};_0x43c542(++_0x1f0cfc);}(_0xb2c8,0x81));var _0x8b2c=function(_0x12b973,_0x57291b){_0x12b973=_0x12b973-0x0;var _0x516564=_0xb2c8[_0x12b973];return _0x516564;};'use strict';var _=require('lodash');var sequelize=require(_0x8b2c('0x0'));var LIMIT_VALUE=0xfa;exports[_0x8b2c('0x1')]=function(_0xcc6382){var _0x137577=null;if(_0xcc6382){_0x137577=_0xcc6382[_0x8b2c('0x2')](',');}return _0x137577;};exports[_0x8b2c('0x3')]=function(_0x33ab93){var _0x5b89a2={};if(!_[_0x8b2c('0x4')](_0x33ab93)){_0x5b89a2={};_['forOwn'](_0x33ab93,function(_0x52014c,_0xf01698){try{_0x5b89a2[_0xf01698]=_[_0x8b2c('0x5')](_0x52014c)?_0x52014c:JSON[_0x8b2c('0x6')](_0x52014c);}catch(_0xe4949b){_0x5b89a2[_0xf01698]=_0x52014c[_0x8b2c('0x2')](',');}});}return _0x5b89a2;};exports[_0x8b2c('0x7')]=function(_0x5b847a){_0x5b847a=parseInt(_0x5b847a,0xa);if(!_0x5b847a||_0x5b847a<0x0){_0x5b847a=LIMIT_VALUE;}return _0x5b847a;};exports[_0x8b2c('0x8')]=function(_0x23af95){_0x23af95=parseInt(_0x23af95,0xa);if(!_0x23af95||_0x23af95<0x0){_0x23af95=0x0;}return _0x23af95;};exports['sort']=function(_0x933aad){var _0x524d12,_0x2394cb=null;if(_0x933aad){_0x524d12=_0x933aad['split'](',');_0x2394cb=_[_0x8b2c('0x9')](_0x524d12,function(_0x2cb507){if(_0x2cb507[_0x8b2c('0xa')]('-')===0x0){return[_0x2cb507===_0x8b2c('0xb')?sequelize[_0x8b2c('0xc')](sequelize[_0x8b2c('0xd')]('priority'),'unsigned'):_0x2cb507[_0x8b2c('0xe')](0x1),_0x8b2c('0xf')];}else{return[_0x2cb507==='priority'?sequelize['cast'](sequelize['col']('priority'),'unsigned'):_0x2cb507,_0x8b2c('0x10')];}});}return _0x2394cb;};exports['omit']=function(_0x189829,_0x4569b2){if(_['isEmpty'](_0x189829)){return _0x189829;}if(_['isArray'](_0x189829)){for(var _0x4d1a62=0x0;_0x4d1a62<_0x189829[_0x8b2c('0x11')];_0x4d1a62+=0x1){_0x189829[_0x4d1a62]=this[_0x8b2c('0x12')](_0x189829[_0x4d1a62],_0x4569b2);}return _0x189829;}if(!_[_0x8b2c('0x13')](_0x189829)){return _0x189829;}if(_['isString'](_0x4569b2)){_0x4569b2=[_0x4569b2];}if(!_[_0x8b2c('0x5')](_0x4569b2)){return _0x189829;}for(var _0x955980=0x0;_0x955980<_0x4569b2[_0x8b2c('0x11')];_0x955980+=0x1){_[_0x8b2c('0x14')](_0x189829,_0x4569b2[_0x955980]);}for(var _0x1bd6d9 in _0x189829){if(_0x189829[_0x8b2c('0x15')](_0x1bd6d9)){_0x189829[_0x1bd6d9]=this[_0x8b2c('0x12')](_0x189829[_0x1bd6d9],_0x4569b2);}}return _0x189829;};exports[_0x8b2c('0x16')]=function(_0x5865c7){return _0x5865c7[_0x8b2c('0x17')](RegExp('^[0-9]*$'))?!![]:![];};exports[_0x8b2c('0x18')]=function(_0x2088cf){return _0x2088cf[_0x8b2c('0x17')](/^\S+@\S+$/)?!![]:![];};exports[_0x8b2c('0x19')]=function(_0x41fe12){var _0x250600=[];_0x41fe12['split']('\x20')['forEach'](function(_0x147288){_0x250600[_0x8b2c('0x1a')]('+'+_0x147288[_0x8b2c('0x1b')]()+'*');});return _0x250600[_0x8b2c('0x1c')]('\x20');};
\ 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