Built motion from commit ded33658aad58fc8de845a8299a9db59a88cc353. Version 3.0.0...
[motion-next.git] / server / api / variable / variable.rpc.js
1 const a699_0xd7aa=['error','then','ShowVariable','rpc','debug','../../mysqldb','model','findOne','attributes','../../config/logger','options','Variable','stringify','info','raw','include','map','where','message','catch'];(function(_0x2ae0f8,_0xd7aa81){const _0xe61fa5=function(_0x3f7fd9){while(--_0x3f7fd9){_0x2ae0f8['push'](_0x2ae0f8['shift']());}};_0xe61fa5(++_0xd7aa81);}(a699_0xd7aa,0xaf));const a699_0xe61f=function(_0x2ae0f8,_0xd7aa81){_0x2ae0f8=_0x2ae0f8-0x0;let _0xe61fa5=a699_0xd7aa[_0x2ae0f8];return _0xe61fa5;};const _0x1c8894=a699_0xe61f;'use strict';const db=require(_0x1c8894('0xa'))['db'],logger=require(_0x1c8894('0xe'))(_0x1c8894('0x8')),_=require('lodash');exports[_0x1c8894('0x7')]=function(_0x3f7fd9){const _0x36a39b=this;return new Promise(function(_0x2f58c1,_0x19e780){const _0x22b947=a699_0xe61f;return db[_0x22b947('0x10')][_0x22b947('0xc')]({'raw':_0x3f7fd9['options']?_0x3f7fd9[_0x22b947('0xf')][_0x22b947('0x13')]===undefined?!![]:![]:!![],'where':_0x3f7fd9['options']?_0x3f7fd9['options'][_0x22b947('0x2')]||null:null,'attributes':_0x3f7fd9['options']?_0x3f7fd9[_0x22b947('0xf')][_0x22b947('0xd')]||null:null,'include':_0x3f7fd9['options']?_0x3f7fd9['options'][_0x22b947('0x0')]?_[_0x22b947('0x1')](_0x3f7fd9[_0x22b947('0xf')][_0x22b947('0x0')],function(_0x30dd5b){const _0x465b9c=_0x22b947;return{'model':db[_0x30dd5b[_0x465b9c('0xb')]],'as':_0x30dd5b['as'],'attributes':_0x30dd5b[_0x465b9c('0xd')],'include':_0x30dd5b[_0x465b9c('0x0')]?_[_0x465b9c('0x1')](_0x30dd5b[_0x465b9c('0x0')],function(_0x1bfd29){const _0x54e9e3=_0x465b9c;return{'model':db[_0x1bfd29[_0x54e9e3('0xb')]],'as':_0x1bfd29['as'],'attributes':_0x1bfd29['attributes'],'include':_0x1bfd29['include']?_[_0x54e9e3('0x1')](_0x1bfd29[_0x54e9e3('0x0')],function(_0x11514e){const _0x411f14=_0x54e9e3;return{'model':db[_0x11514e[_0x411f14('0xb')]],'as':_0x11514e['as'],'attributes':_0x11514e[_0x411f14('0xd')]};}):[]};}):[]};}):[]:[]})[_0x22b947('0x6')](function(_0x249233){const _0x651f4d=_0x22b947;logger[_0x651f4d('0x12')]('ShowVariable',_0x3f7fd9),logger[_0x651f4d('0x9')]('ShowVariable',_0x3f7fd9,JSON[_0x651f4d('0x11')](_0x249233)),_0x2f58c1(_0x249233);})[_0x22b947('0x4')](function(_0x4dad37){const _0x11b022=_0x22b947;logger[_0x11b022('0x5')]('ShowVariable',_0x4dad37[_0x11b022('0x3')],_0x3f7fd9),_0x19e780(_0x36a39b[_0x11b022('0x5')](0x1f4,_0x4dad37['message']));});});};