Built motion from commit ecf5ab8ec560fd4c6972692268e350fcef2f38e7. Version 3.0.0...
[motion-next.git] / server / config / utils.js
1 const a888_0x13d9=['./license/util','sms','isValidChannel','clearBlockUser','mail','getChannels','Maximum\x20login\x20has\x20been\x20reached','agents','openchannel','blockedAt','../mysqldb','lodash','fax','count','voice','catch','update','getLicense','sequelize','then','agent','isUndefined'];(function(_0x49fe35,_0x13d965){const _0x3fbf5f=function(_0x2ca1df){while(--_0x2ca1df){_0x49fe35['push'](_0x49fe35['shift']());}};_0x3fbf5f(++_0x13d965);}(a888_0x13d9,0xb8));const a888_0x3fbf=function(_0x49fe35,_0x13d965){_0x49fe35=_0x49fe35-0x0;let _0x3fbf5f=a888_0x13d9[_0x49fe35];return _0x3fbf5f;};const _0x35819c=a888_0x3fbf;'use strict';const _=require(_0x35819c('0x3')),db=require(_0x35819c('0x2'))['db'],util=require(_0x35819c('0xe')),{Op}=require(_0x35819c('0xa')),channels=[_0x35819c('0x6'),_0x35819c('0x12'),'chat',_0x35819c('0x4'),_0x35819c('0xf'),'whatsapp',_0x35819c('0x0')];exports[_0x35819c('0x13')]=function(){return channels;},exports[_0x35819c('0x10')]=function(_0x2ca1df){return _0x2ca1df=_0x2ca1df['toLowerCase'](),_['includes'](channels,_0x2ca1df);},exports[_0x35819c('0x11')]=function(_0xfcaea2,_0x5ce464,_0x561c85,_0x45a7d7){const _0xf772c2=_0x35819c,_0x42fc21={'loginAttempts':_0x5ce464,'blocked':_0x561c85};return!_[_0xf772c2('0xd')](_0x45a7d7)&&(_0x42fc21[_0xf772c2('0x1')]=_0x45a7d7),_0xfcaea2[_0xf772c2('0x8')](_0x42fc21);},exports['getLicense']=function(_0x349c39){return new Promise(function(_0x5ecf27,_0x22f9e9){const _0x139ccb=a888_0x3fbf;let _0xf77b9c=0x0;_0x349c39['role']!==_0x139ccb('0xc')&&_0x5ecf27(_0x349c39),db['User'][_0x139ccb('0x5')]({'where':{'role':_0x139ccb('0xc'),'online':!![],'id':{[Op['ne']]:_0x349c39['id']}}})[_0x139ccb('0xb')](function(_0xf77d88){const _0x468dc1=_0x139ccb;return _0xf77b9c=_0xf77d88,util[_0x468dc1('0x9')]();})[_0x139ccb('0xb')](function(_0x1d0b96){const _0x225cdc=_0x139ccb;if(_0x1d0b96&&_0x1d0b96[_0x225cdc('0x15')]&&_0xf77b9c>=_0x1d0b96[_0x225cdc('0x15')])throw Error(_0x225cdc('0x14'));_0x5ecf27(_0x349c39);})[_0x139ccb('0x7')](function(_0x1e5aab){_0x22f9e9(_0x1e5aab);});});};