Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / config / utils.js
index 32991f7..520c323 100644 (file)
@@ -1 +1 @@
-const a888_0x1031=['sms','openchannel','whatsapp','Maximum\x20login\x20has\x20been\x20reached','role','agents','then','agent','chat','update','./license/util','fax','catch','toLowerCase','../mysqldb','isUndefined','sequelize','blockedAt','getLicense','clearBlockUser','getChannels'];(function(_0x43f285,_0x1031a5){const _0x8c8bec=function(_0x2381c7){while(--_0x2381c7){_0x43f285['push'](_0x43f285['shift']());}};_0x8c8bec(++_0x1031a5);}(a888_0x1031,0x1ba));const a888_0x8c8b=function(_0x43f285,_0x1031a5){_0x43f285=_0x43f285-0x0;let _0x8c8bec=a888_0x1031[_0x43f285];return _0x8c8bec;};const _0x507dfb=a888_0x8c8b;'use strict';const _=require('lodash'),db=require(_0x507dfb('0xd'))['db'],util=require(_0x507dfb('0x9')),{Op}=require(_0x507dfb('0xf')),channels=['voice','mail',_0x507dfb('0x7'),_0x507dfb('0xa'),_0x507dfb('0x14'),_0x507dfb('0x1'),_0x507dfb('0x0')];exports[_0x507dfb('0x13')]=function(){return channels;},exports['isValidChannel']=function(_0x2381c7){const _0x69ad19=_0x507dfb;return _0x2381c7=_0x2381c7[_0x69ad19('0xc')](),_['includes'](channels,_0x2381c7);},exports[_0x507dfb('0x12')]=function(_0x15c475,_0x3cdc95,_0x19e6fc,_0x578777){const _0xf97661=_0x507dfb,_0x66e0d={'loginAttempts':_0x3cdc95,'blocked':_0x19e6fc};return!_[_0xf97661('0xe')](_0x578777)&&(_0x66e0d[_0xf97661('0x10')]=_0x578777),_0x15c475[_0xf97661('0x8')](_0x66e0d);},exports['getLicense']=function(_0x527c54){return new Promise(function(_0x5bdb70,_0x107ee9){const _0x1843d7=a888_0x8c8b;let _0x5c70d8=0x0;_0x527c54[_0x1843d7('0x3')]!==_0x1843d7('0x6')&&_0x5bdb70(_0x527c54),db['User']['count']({'where':{'role':_0x1843d7('0x6'),'online':!![],'id':{[Op['ne']]:_0x527c54['id']}}})['then'](function(_0x2a9872){const _0x2af941=_0x1843d7;return _0x5c70d8=_0x2a9872,util[_0x2af941('0x11')]();})[_0x1843d7('0x5')](function(_0x12075e){const _0x313161=_0x1843d7;if(_0x12075e&&_0x12075e[_0x313161('0x4')]&&_0x5c70d8>=_0x12075e['agents'])throw Error(_0x313161('0x2'));_0x5bdb70(_0x527c54);})[_0x1843d7('0xb')](function(_0x4f6ad8){_0x107ee9(_0x4f6ad8);});});};
\ No newline at end of file
+const a888_0x5ee5=['lodash','role','update','chat','sequelize','sms','../mysqldb','toLowerCase','voice','whatsapp','agent','fax','blockedAt','then','Maximum\x20login\x20has\x20been\x20reached','isValidChannel','clearBlockUser','getChannels','./license/util','mail','openchannel','User','includes','agents'];(function(_0x924704,_0x5ee507){const _0xca5a31=function(_0x3999e6){while(--_0x3999e6){_0x924704['push'](_0x924704['shift']());}};_0xca5a31(++_0x5ee507);}(a888_0x5ee5,0x131));const a888_0xca5a=function(_0x924704,_0x5ee507){_0x924704=_0x924704-0x0;let _0xca5a31=a888_0x5ee5[_0x924704];return _0xca5a31;};const _0x51d2e2=a888_0xca5a;'use strict';const _=require(_0x51d2e2('0x7')),db=require(_0x51d2e2('0xd'))['db'],util=require(_0x51d2e2('0x1')),{Op}=require(_0x51d2e2('0xb')),channels=[_0x51d2e2('0xf'),_0x51d2e2('0x2'),_0x51d2e2('0xa'),_0x51d2e2('0x12'),_0x51d2e2('0xc'),_0x51d2e2('0x10'),_0x51d2e2('0x3')];exports[_0x51d2e2('0x0')]=function(){return channels;},exports[_0x51d2e2('0x16')]=function(_0x3999e6){const _0x59cc1e=_0x51d2e2;return _0x3999e6=_0x3999e6[_0x59cc1e('0xe')](),_[_0x59cc1e('0x5')](channels,_0x3999e6);},exports[_0x51d2e2('0x17')]=function(_0x581a41,_0x74ca28,_0x5e3536,_0x32bfd5){const _0x50fe59=_0x51d2e2,_0x15e041={'loginAttempts':_0x74ca28,'blocked':_0x5e3536};return!_['isUndefined'](_0x32bfd5)&&(_0x15e041[_0x50fe59('0x13')]=_0x32bfd5),_0x581a41[_0x50fe59('0x9')](_0x15e041);},exports['getLicense']=function(_0x19e878){return new Promise(function(_0x6e9f2b,_0x19036a){const _0x2a9a02=a888_0xca5a;let _0x5bb781=0x0;_0x19e878[_0x2a9a02('0x8')]!==_0x2a9a02('0x11')&&_0x6e9f2b(_0x19e878),db[_0x2a9a02('0x4')]['count']({'where':{'role':_0x2a9a02('0x11'),'online':!![],'id':{[Op['ne']]:_0x19e878['id']}}})[_0x2a9a02('0x14')](function(_0x102afe){return _0x5bb781=_0x102afe,util['getLicense']();})[_0x2a9a02('0x14')](function(_0x34fee7){const _0x57d594=_0x2a9a02;if(_0x34fee7&&_0x34fee7[_0x57d594('0x6')]&&_0x5bb781>=_0x34fee7[_0x57d594('0x6')])throw Error(_0x57d594('0x15'));_0x6e9f2b(_0x19e878);})['catch'](function(_0x43306d){_0x19036a(_0x43306d);});});};
\ No newline at end of file