Built motion from commit bfc7a72f7045b27461c9a5d1f71c1a658cfd0b8b. Version 3.0.0...
[motion-next.git] / server / api / campaign / campaign.rpc.js
1 const a44_0x2aac=['../../config/logger','attributes','Campaign','map','message','GetCampaign','model','stringify','raw','error','catch','limit','rpc','then','findAll','include','../../mysqldb','options','lodash','info','debug'];(function(_0xc2e517,_0x2aace7){const _0x112ae1=function(_0x43aaff){while(--_0x43aaff){_0xc2e517['push'](_0xc2e517['shift']());}};_0x112ae1(++_0x2aace7);}(a44_0x2aac,0x1cb));const a44_0x112a=function(_0xc2e517,_0x2aace7){_0xc2e517=_0xc2e517-0x0;let _0x112ae1=a44_0x2aac[_0xc2e517];return _0x112ae1;};const _0x2e8659=a44_0x112a;'use strict';const _=require(_0x2e8659('0x0')),db=require(_0x2e8659('0x13'))['db'],logger=require(_0x2e8659('0x3'))(_0x2e8659('0xf'));exports[_0x2e8659('0x8')]=function(_0x43aaff){const _0x188dcb=this;return new Promise(function(_0x28cd6b,_0x25c1c1){const _0x4c34b5=a44_0x112a;return db[_0x4c34b5('0x5')][_0x4c34b5('0x11')]({'raw':_0x43aaff[_0x4c34b5('0x14')]?_0x43aaff[_0x4c34b5('0x14')][_0x4c34b5('0xb')]===undefined?!![]:![]:!![],'where':_0x43aaff['options']?_0x43aaff[_0x4c34b5('0x14')]['where']||null:null,'attributes':_0x43aaff[_0x4c34b5('0x14')]?_0x43aaff[_0x4c34b5('0x14')][_0x4c34b5('0x4')]||null:null,'limit':_0x43aaff[_0x4c34b5('0x14')]?_0x43aaff['options'][_0x4c34b5('0xe')]||null:null,'include':_0x43aaff[_0x4c34b5('0x14')]?_0x43aaff[_0x4c34b5('0x14')]['include']?_['map'](_0x43aaff[_0x4c34b5('0x14')][_0x4c34b5('0x12')],function(_0x3a7b72){const _0x150ac3=_0x4c34b5;return{'model':db[_0x3a7b72[_0x150ac3('0x9')]],'as':_0x3a7b72['as'],'attributes':_0x3a7b72[_0x150ac3('0x4')],'include':_0x3a7b72[_0x150ac3('0x12')]?_[_0x150ac3('0x6')](_0x3a7b72[_0x150ac3('0x12')],function(_0x41827b){const _0x4f7f1e=_0x150ac3;return{'model':db[_0x41827b[_0x4f7f1e('0x9')]],'as':_0x41827b['as'],'attributes':_0x41827b[_0x4f7f1e('0x4')],'include':_0x41827b[_0x4f7f1e('0x12')]?_[_0x4f7f1e('0x6')](_0x41827b['include'],function(_0x1985e1){const _0x104814=_0x4f7f1e;return{'model':db[_0x1985e1[_0x104814('0x9')]],'as':_0x1985e1['as'],'attributes':_0x1985e1[_0x104814('0x4')]};}):[]};}):[]};}):[]:[]})[_0x4c34b5('0x10')](function(_0x9f3e56){const _0x26ea23=_0x4c34b5;logger[_0x26ea23('0x1')](_0x26ea23('0x8'),_0x43aaff),logger[_0x26ea23('0x2')]('GetCampaign',_0x43aaff,JSON[_0x26ea23('0xa')](_0x9f3e56)),_0x28cd6b(_0x9f3e56);})[_0x4c34b5('0xd')](function(_0x94d27c){const _0x16c0cc=_0x4c34b5;logger[_0x16c0cc('0xc')](_0x16c0cc('0x8'),_0x94d27c['message'],_0x43aaff),_0x25c1c1(_0x188dcb['error'](0x1f4,_0x94d27c[_0x16c0cc('0x7')]));});});};