Built motion from commit bfc7a72f7045b27461c9a5d1f71c1a658cfd0b8b. Version 3.0.0...
[motion-next.git] / server / api / trigger / trigger.rpc.js
1 const a640_0x476e=['model','map','message','rpc','where','options','GetTrigger','stringify','../../mysqldb','catch','then','findAll','lodash','attributes','include','info','error','../../config/logger','Trigger','ShowTrigger','debug','raw'];(function(_0xd9147a,_0x476e81){const _0x405b3c=function(_0x182fda){while(--_0x182fda){_0xd9147a['push'](_0xd9147a['shift']());}};_0x405b3c(++_0x476e81);}(a640_0x476e,0x154));const a640_0x405b=function(_0xd9147a,_0x476e81){_0xd9147a=_0xd9147a-0x0;let _0x405b3c=a640_0x476e[_0xd9147a];return _0x405b3c;};const _0x244e3c=a640_0x405b;'use strict';const _=require(_0x244e3c('0x2')),db=require(_0x244e3c('0x14'))['db'],logger=require(_0x244e3c('0x7'))(_0x244e3c('0xf'));exports[_0x244e3c('0x12')]=function(_0x182fda){const _0x2bd3e1=this;return new Promise(function(_0x17d8d6,_0xd6e21b){const _0x1290a9=a640_0x405b;return db[_0x1290a9('0x8')][_0x1290a9('0x1')]({'raw':_0x182fda[_0x1290a9('0x11')]?_0x182fda[_0x1290a9('0x11')][_0x1290a9('0xb')]===undefined?!![]:![]:!![],'where':_0x182fda[_0x1290a9('0x11')]?_0x182fda[_0x1290a9('0x11')][_0x1290a9('0x10')]||null:null,'attributes':_0x182fda[_0x1290a9('0x11')]?_0x182fda[_0x1290a9('0x11')]['attributes']||null:null,'limit':_0x182fda[_0x1290a9('0x11')]?_0x182fda[_0x1290a9('0x11')]['limit']||null:null,'include':_0x182fda[_0x1290a9('0x11')]?_0x182fda['options'][_0x1290a9('0x4')]?_[_0x1290a9('0xd')](_0x182fda[_0x1290a9('0x11')][_0x1290a9('0x4')],function(_0x639d31){const _0x217a92=_0x1290a9;return{'model':db[_0x639d31['model']],'as':_0x639d31['as'],'attributes':_0x639d31['attributes'],'include':_0x639d31[_0x217a92('0x4')]?_[_0x217a92('0xd')](_0x639d31[_0x217a92('0x4')],function(_0x30155c){const _0x44013b=_0x217a92;return{'model':db[_0x30155c[_0x44013b('0xc')]],'as':_0x30155c['as'],'attributes':_0x30155c[_0x44013b('0x3')],'include':_0x30155c['include']?_[_0x44013b('0xd')](_0x30155c[_0x44013b('0x4')],function(_0x46fb73){const _0x4712c8=_0x44013b;return{'model':db[_0x46fb73[_0x4712c8('0xc')]],'as':_0x46fb73['as'],'attributes':_0x46fb73['attributes']};}):[]};}):[]};}):[]:[]})[_0x1290a9('0x0')](function(_0x10148f){const _0x3f0b7a=_0x1290a9;logger[_0x3f0b7a('0x5')]('GetTrigger',_0x182fda),logger[_0x3f0b7a('0xa')](_0x3f0b7a('0x12'),_0x182fda,JSON['stringify'](_0x10148f)),_0x17d8d6(_0x10148f);})[_0x1290a9('0x15')](function(_0x48bc19){const _0xcc9f4d=_0x1290a9;logger[_0xcc9f4d('0x6')](_0xcc9f4d('0x12'),_0x48bc19['message'],_0x182fda),_0xd6e21b(_0x2bd3e1[_0xcc9f4d('0x6')](0x1f4,_0x48bc19[_0xcc9f4d('0xe')]));});});},exports[_0x244e3c('0x9')]=function(_0x167eb1){const _0x3315be=this;return new Promise(function(_0x37fcde,_0x45af2c){const _0x1258bc=a640_0x405b;return db[_0x1258bc('0x8')]['findOne']({'raw':_0x167eb1['options']?_0x167eb1[_0x1258bc('0x11')][_0x1258bc('0xb')]===undefined?!![]:![]:!![],'where':_0x167eb1['options']?_0x167eb1[_0x1258bc('0x11')][_0x1258bc('0x10')]||null:null,'attributes':_0x167eb1[_0x1258bc('0x11')]?_0x167eb1['options'][_0x1258bc('0x3')]||null:null,'include':_0x167eb1[_0x1258bc('0x11')]?_0x167eb1['options'][_0x1258bc('0x4')]?_['map'](_0x167eb1[_0x1258bc('0x11')][_0x1258bc('0x4')],function(_0x47448b){const _0x2c5831=_0x1258bc;return{'model':db[_0x47448b[_0x2c5831('0xc')]],'as':_0x47448b['as'],'attributes':_0x47448b[_0x2c5831('0x3')],'include':_0x47448b[_0x2c5831('0x4')]?_[_0x2c5831('0xd')](_0x47448b[_0x2c5831('0x4')],function(_0x4bdafa){const _0x4e4843=_0x2c5831;return{'model':db[_0x4bdafa[_0x4e4843('0xc')]],'as':_0x4bdafa['as'],'attributes':_0x4bdafa['attributes'],'include':_0x4bdafa[_0x4e4843('0x4')]?_[_0x4e4843('0xd')](_0x4bdafa[_0x4e4843('0x4')],function(_0x1daa89){const _0x272f54=_0x4e4843;return{'model':db[_0x1daa89['model']],'as':_0x1daa89['as'],'attributes':_0x1daa89[_0x272f54('0x3')]};}):[]};}):[]};}):[]:[]})[_0x1258bc('0x0')](function(_0x578a0b){const _0xe2e0f0=_0x1258bc;logger[_0xe2e0f0('0x5')](_0xe2e0f0('0x9'),_0x167eb1),logger[_0xe2e0f0('0xa')](_0xe2e0f0('0x9'),_0x167eb1,JSON[_0xe2e0f0('0x13')](_0x578a0b)),_0x37fcde(_0x578a0b);})[_0x1258bc('0x15')](function(_0x4f8f49){const _0x5eeac8=_0x1258bc;logger[_0x5eeac8('0x6')](_0x5eeac8('0x9'),_0x4f8f49['message'],_0x167eb1),_0x45af2c(_0x3315be[_0x5eeac8('0x6')](0x1f4,_0x4f8f49[_0x5eeac8('0xe')]));});});};