01ba2aa45a0096adc1a3d5fa17541d7dd5f86181
[motion-next.git] / server / api / smsQueue / smsQueue.rpc.js
1 const a570_0x286b=['where','debug','ShowSmsQueue','map','attributes','GetSmsQueue','options','message','./smsQueue.socket','info','include','catch','../../mysqldb','model','findAll','findOne','lodash','../../config/logger','register','limit','stringify','SmsQueue','raw','../../rediscache','error'];(function(_0x3e56e2,_0x286bda){const _0x541410=function(_0x2fdcb1){while(--_0x2fdcb1){_0x3e56e2['push'](_0x3e56e2['shift']());}};_0x541410(++_0x286bda);}(a570_0x286b,0xa7));const a570_0x5414=function(_0x3e56e2,_0x286bda){_0x3e56e2=_0x3e56e2-0x0;let _0x541410=a570_0x286b[_0x3e56e2];return _0x541410;};const _0x40e7ba=a570_0x5414;'use strict';const _=require(_0x40e7ba('0x18')),db=require(_0x40e7ba('0x14'))['db'],logger=require(_0x40e7ba('0x0'))('rpc'),{getSocket}=require(_0x40e7ba('0x6')),socket=getSocket();require(_0x40e7ba('0x10'))[_0x40e7ba('0x1')](socket),exports[_0x40e7ba('0xd')]=function(_0x2fdcb1){const _0x265b75=this;return new Promise(function(_0x256118,_0x29705b){const _0xb24d33=a570_0x5414;return db[_0xb24d33('0x4')][_0xb24d33('0x16')]({'raw':_0x2fdcb1[_0xb24d33('0xe')]?_0x2fdcb1[_0xb24d33('0xe')][_0xb24d33('0x5')]===undefined?!![]:![]:!![],'where':_0x2fdcb1['options']?_0x2fdcb1['options']['where']||null:null,'attributes':_0x2fdcb1['options']?_0x2fdcb1[_0xb24d33('0xe')][_0xb24d33('0xc')]||null:null,'limit':_0x2fdcb1['options']?_0x2fdcb1[_0xb24d33('0xe')][_0xb24d33('0x2')]||null:null,'include':_0x2fdcb1[_0xb24d33('0xe')]?_0x2fdcb1[_0xb24d33('0xe')]['include']?_[_0xb24d33('0xb')](_0x2fdcb1[_0xb24d33('0xe')][_0xb24d33('0x12')],function(_0xd0a74e){const _0x3c1cc4=_0xb24d33;return{'model':db[_0xd0a74e[_0x3c1cc4('0x15')]],'as':_0xd0a74e['as'],'attributes':_0xd0a74e[_0x3c1cc4('0xc')],'include':_0xd0a74e[_0x3c1cc4('0x12')]?_[_0x3c1cc4('0xb')](_0xd0a74e['include'],function(_0x22b237){const _0x3c7a76=_0x3c1cc4;return{'model':db[_0x22b237[_0x3c7a76('0x15')]],'as':_0x22b237['as'],'attributes':_0x22b237[_0x3c7a76('0xc')],'include':_0x22b237['include']?_[_0x3c7a76('0xb')](_0x22b237[_0x3c7a76('0x12')],function(_0x2e4c02){return{'model':db[_0x2e4c02['model']],'as':_0x2e4c02['as'],'attributes':_0x2e4c02['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d1655){const _0x1a9490=_0xb24d33;logger['info'](_0x1a9490('0xd'),_0x2fdcb1),logger[_0x1a9490('0x9')](_0x1a9490('0xd'),_0x2fdcb1,JSON['stringify'](_0x2d1655)),_0x256118(_0x2d1655);})[_0xb24d33('0x13')](function(_0x1588e3){const _0x23ba0b=_0xb24d33;logger[_0x23ba0b('0x7')](_0x23ba0b('0xd'),_0x1588e3[_0x23ba0b('0xf')],_0x2fdcb1),_0x29705b(_0x265b75[_0x23ba0b('0x7')](0x1f4,_0x1588e3[_0x23ba0b('0xf')]));});});},exports[_0x40e7ba('0xa')]=function(_0x1cc368){const _0x154872=this;return new Promise(function(_0x3d9e33,_0x3b6023){const _0x4fae50=a570_0x5414;return db['SmsQueue'][_0x4fae50('0x17')]({'raw':_0x1cc368[_0x4fae50('0xe')]?_0x1cc368['options'][_0x4fae50('0x5')]===undefined?!![]:![]:!![],'where':_0x1cc368['options']?_0x1cc368[_0x4fae50('0xe')][_0x4fae50('0x8')]||null:null,'attributes':_0x1cc368[_0x4fae50('0xe')]?_0x1cc368['options'][_0x4fae50('0xc')]||null:null,'include':_0x1cc368[_0x4fae50('0xe')]?_0x1cc368[_0x4fae50('0xe')][_0x4fae50('0x12')]?_[_0x4fae50('0xb')](_0x1cc368['options'][_0x4fae50('0x12')],function(_0x483244){const _0x1eef5d=_0x4fae50;return{'model':db[_0x483244[_0x1eef5d('0x15')]],'as':_0x483244['as'],'attributes':_0x483244[_0x1eef5d('0xc')],'include':_0x483244[_0x1eef5d('0x12')]?_['map'](_0x483244[_0x1eef5d('0x12')],function(_0x8ddcbd){const _0x1b2f38=_0x1eef5d;return{'model':db[_0x8ddcbd[_0x1b2f38('0x15')]],'as':_0x8ddcbd['as'],'attributes':_0x8ddcbd[_0x1b2f38('0xc')],'include':_0x8ddcbd[_0x1b2f38('0x12')]?_[_0x1b2f38('0xb')](_0x8ddcbd[_0x1b2f38('0x12')],function(_0x25ea21){const _0x4d2850=_0x1b2f38;return{'model':db[_0x25ea21[_0x4d2850('0x15')]],'as':_0x25ea21['as'],'attributes':_0x25ea21[_0x4d2850('0xc')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d4074){const _0xd442d9=_0x4fae50;logger[_0xd442d9('0x11')](_0xd442d9('0xa'),_0x1cc368),logger['debug']('ShowSmsQueue',_0x1cc368,JSON[_0xd442d9('0x3')](_0x3d4074)),_0x3d9e33(_0x3d4074);})[_0x4fae50('0x13')](function(_0x4342dc){const _0x400e76=_0x4fae50;logger['error'](_0x400e76('0xa'),_0x4342dc[_0x400e76('0xf')],_0x1cc368),_0x3b6023(_0x154872['error'](0x1f4,_0x4342dc['message']));});});};