a38f8cb20623b88469bec26530224a82b2518a15
[motion-next.git] / server / api / interval / interval.rpc.js
1 const a369_0x2d92=['GetInterval','message','../../config/logger','model','lodash','../../mysqldb','error','rpc','include','then','stringify','where','Interval','options','debug','raw','catch','ShowInterval','attributes','map','limit','findOne','info'];(function(_0x47af10,_0x2d922d){const _0x14768f=function(_0x7b37a4){while(--_0x7b37a4){_0x47af10['push'](_0x47af10['shift']());}};_0x14768f(++_0x2d922d);}(a369_0x2d92,0x183));const a369_0x1476=function(_0x47af10,_0x2d922d){_0x47af10=_0x47af10-0x0;let _0x14768f=a369_0x2d92[_0x47af10];return _0x14768f;};const _0x59de2e=a369_0x1476;'use strict';const _=require(_0x59de2e('0x8')),db=require(_0x59de2e('0x9'))['db'],logger=require(_0x59de2e('0x6'))(_0x59de2e('0xb'));exports[_0x59de2e('0x4')]=function(_0x7b37a4){const _0x3bf653=this;return new Promise(function(_0x174d8a,_0x583976){const _0x177738=a369_0x1476;return db[_0x177738('0x10')]['findAll']({'raw':_0x7b37a4[_0x177738('0x11')]?_0x7b37a4[_0x177738('0x11')][_0x177738('0x13')]===undefined?!![]:![]:!![],'where':_0x7b37a4[_0x177738('0x11')]?_0x7b37a4[_0x177738('0x11')][_0x177738('0xf')]||null:null,'attributes':_0x7b37a4[_0x177738('0x11')]?_0x7b37a4[_0x177738('0x11')][_0x177738('0x16')]||null:null,'limit':_0x7b37a4['options']?_0x7b37a4[_0x177738('0x11')][_0x177738('0x1')]||null:null,'include':_0x7b37a4[_0x177738('0x11')]?_0x7b37a4[_0x177738('0x11')][_0x177738('0xc')]?_['map'](_0x7b37a4[_0x177738('0x11')][_0x177738('0xc')],function(_0x533755){const _0x5988f3=_0x177738;return{'model':db[_0x533755['model']],'as':_0x533755['as'],'attributes':_0x533755[_0x5988f3('0x16')],'include':_0x533755[_0x5988f3('0xc')]?_['map'](_0x533755[_0x5988f3('0xc')],function(_0x1914f6){const _0x13dbbc=_0x5988f3;return{'model':db[_0x1914f6['model']],'as':_0x1914f6['as'],'attributes':_0x1914f6[_0x13dbbc('0x16')],'include':_0x1914f6[_0x13dbbc('0xc')]?_[_0x13dbbc('0x0')](_0x1914f6[_0x13dbbc('0xc')],function(_0x8e59d5){return{'model':db[_0x8e59d5['model']],'as':_0x8e59d5['as'],'attributes':_0x8e59d5['attributes']};}):[]};}):[]};}):[]:[]})[_0x177738('0xd')](function(_0x5ce562){const _0x5626f8=_0x177738;logger[_0x5626f8('0x3')]('GetInterval',_0x7b37a4),logger[_0x5626f8('0x12')](_0x5626f8('0x4'),_0x7b37a4,JSON[_0x5626f8('0xe')](_0x5ce562)),_0x174d8a(_0x5ce562);})[_0x177738('0x14')](function(_0x50f930){const _0xba6f6=_0x177738;logger[_0xba6f6('0xa')]('GetInterval',_0x50f930[_0xba6f6('0x5')],_0x7b37a4),_0x583976(_0x3bf653[_0xba6f6('0xa')](0x1f4,_0x50f930[_0xba6f6('0x5')]));});});},exports['ShowInterval']=function(_0xe50eeb){const _0x2cb7d1=this;return new Promise(function(_0x8f0ca4,_0x184566){const _0x555f39=a369_0x1476;return db[_0x555f39('0x10')][_0x555f39('0x2')]({'raw':_0xe50eeb[_0x555f39('0x11')]?_0xe50eeb['options']['raw']===undefined?!![]:![]:!![],'where':_0xe50eeb[_0x555f39('0x11')]?_0xe50eeb[_0x555f39('0x11')][_0x555f39('0xf')]||null:null,'attributes':_0xe50eeb[_0x555f39('0x11')]?_0xe50eeb['options'][_0x555f39('0x16')]||null:null,'include':_0xe50eeb[_0x555f39('0x11')]?_0xe50eeb['options'][_0x555f39('0xc')]?_['map'](_0xe50eeb[_0x555f39('0x11')][_0x555f39('0xc')],function(_0x1310ad){const _0x5bf54c=_0x555f39;return{'model':db[_0x1310ad[_0x5bf54c('0x7')]],'as':_0x1310ad['as'],'attributes':_0x1310ad[_0x5bf54c('0x16')],'include':_0x1310ad['include']?_[_0x5bf54c('0x0')](_0x1310ad[_0x5bf54c('0xc')],function(_0x55b912){const _0x4aa2db=_0x5bf54c;return{'model':db[_0x55b912[_0x4aa2db('0x7')]],'as':_0x55b912['as'],'attributes':_0x55b912[_0x4aa2db('0x16')],'include':_0x55b912['include']?_[_0x4aa2db('0x0')](_0x55b912[_0x4aa2db('0xc')],function(_0x3bf334){const _0x1c4387=_0x4aa2db;return{'model':db[_0x3bf334[_0x1c4387('0x7')]],'as':_0x3bf334['as'],'attributes':_0x3bf334[_0x1c4387('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5313af){const _0x2631dc=_0x555f39;logger['info'](_0x2631dc('0x15'),_0xe50eeb),logger[_0x2631dc('0x12')](_0x2631dc('0x15'),_0xe50eeb,JSON[_0x2631dc('0xe')](_0x5313af)),_0x8f0ca4(_0x5313af);})[_0x555f39('0x14')](function(_0x50cf2f){const _0x20f1e8=_0x555f39;logger['error'](_0x20f1e8('0x15'),_0x50cf2f['message'],_0xe50eeb),_0x184566(_0x2cb7d1[_0x20f1e8('0xa')](0x1f4,_0x50cf2f[_0x20f1e8('0x5')]));});});};