55c152ae5a81f95e7c2222f88f83ed2659f7173b
[motion-next.git] / server / api / trunk / trunk.rpc.js
1 const a645_0x100d=['../../config/logger','where','findOne','options','message','Trunk','ShowTrunk','stringify','model','then','info','raw','rpc','error','include','lodash','GetTrunk','attributes','limit','../../mysqldb','catch','map','debug'];(function(_0xf48364,_0x100d12){const _0x521303=function(_0x37c8c2){while(--_0x37c8c2){_0xf48364['push'](_0xf48364['shift']());}};_0x521303(++_0x100d12);}(a645_0x100d,0x11a));const a645_0x5213=function(_0xf48364,_0x100d12){_0xf48364=_0xf48364-0x0;let _0x521303=a645_0x100d[_0xf48364];return _0x521303;};const _0x60d8cf=a645_0x5213;'use strict';const _=require(_0x60d8cf('0x9')),db=require(_0x60d8cf('0xd'))['db'],logger=require(_0x60d8cf('0x11'))(_0x60d8cf('0x6'));exports[_0x60d8cf('0xa')]=function(_0x37c8c2){const _0xcf664=this;return new Promise(function(_0x38066a,_0xf45484){const _0x83072b=a645_0x5213;return db['Trunk']['findAll']({'raw':_0x37c8c2['options']?_0x37c8c2[_0x83072b('0x14')][_0x83072b('0x5')]===undefined?!![]:![]:!![],'where':_0x37c8c2[_0x83072b('0x14')]?_0x37c8c2[_0x83072b('0x14')][_0x83072b('0x12')]||null:null,'attributes':_0x37c8c2[_0x83072b('0x14')]?_0x37c8c2['options'][_0x83072b('0xb')]||null:null,'limit':_0x37c8c2[_0x83072b('0x14')]?_0x37c8c2['options'][_0x83072b('0xc')]||null:null,'include':_0x37c8c2[_0x83072b('0x14')]?_0x37c8c2[_0x83072b('0x14')]['include']?_[_0x83072b('0xf')](_0x37c8c2['options'][_0x83072b('0x8')],function(_0x640450){const _0x2321e9=_0x83072b;return{'model':db[_0x640450[_0x2321e9('0x2')]],'as':_0x640450['as'],'attributes':_0x640450[_0x2321e9('0xb')],'include':_0x640450[_0x2321e9('0x8')]?_[_0x2321e9('0xf')](_0x640450[_0x2321e9('0x8')],function(_0x24ced3){const _0x327411=_0x2321e9;return{'model':db[_0x24ced3[_0x327411('0x2')]],'as':_0x24ced3['as'],'attributes':_0x24ced3[_0x327411('0xb')],'include':_0x24ced3['include']?_[_0x327411('0xf')](_0x24ced3[_0x327411('0x8')],function(_0x2ed8f1){const _0x307c23=_0x327411;return{'model':db[_0x2ed8f1[_0x307c23('0x2')]],'as':_0x2ed8f1['as'],'attributes':_0x2ed8f1[_0x307c23('0xb')]};}):[]};}):[]};}):[]:[]})[_0x83072b('0x3')](function(_0x4b42b5){const _0x27d664=_0x83072b;logger[_0x27d664('0x4')](_0x27d664('0xa'),_0x37c8c2),logger[_0x27d664('0x10')]('GetTrunk',_0x37c8c2,JSON[_0x27d664('0x1')](_0x4b42b5)),_0x38066a(_0x4b42b5);})[_0x83072b('0xe')](function(_0x220d36){const _0x57cac3=_0x83072b;logger[_0x57cac3('0x7')]('GetTrunk',_0x220d36[_0x57cac3('0x15')],_0x37c8c2),_0xf45484(_0xcf664['error'](0x1f4,_0x220d36['message']));});});},exports[_0x60d8cf('0x0')]=function(_0x1a5d49){const _0x4d3900=this;return new Promise(function(_0x5cb6a1,_0x18bcaa){const _0x3213e9=a645_0x5213;return db[_0x3213e9('0x16')][_0x3213e9('0x13')]({'raw':_0x1a5d49[_0x3213e9('0x14')]?_0x1a5d49[_0x3213e9('0x14')][_0x3213e9('0x5')]===undefined?!![]:![]:!![],'where':_0x1a5d49['options']?_0x1a5d49[_0x3213e9('0x14')][_0x3213e9('0x12')]||null:null,'attributes':_0x1a5d49['options']?_0x1a5d49[_0x3213e9('0x14')]['attributes']||null:null,'include':_0x1a5d49[_0x3213e9('0x14')]?_0x1a5d49[_0x3213e9('0x14')][_0x3213e9('0x8')]?_[_0x3213e9('0xf')](_0x1a5d49[_0x3213e9('0x14')][_0x3213e9('0x8')],function(_0x2e1091){const _0x7dacee=_0x3213e9;return{'model':db[_0x2e1091[_0x7dacee('0x2')]],'as':_0x2e1091['as'],'attributes':_0x2e1091['attributes'],'include':_0x2e1091['include']?_[_0x7dacee('0xf')](_0x2e1091[_0x7dacee('0x8')],function(_0x171f96){const _0x331a9e=_0x7dacee;return{'model':db[_0x171f96[_0x331a9e('0x2')]],'as':_0x171f96['as'],'attributes':_0x171f96[_0x331a9e('0xb')],'include':_0x171f96[_0x331a9e('0x8')]?_[_0x331a9e('0xf')](_0x171f96['include'],function(_0x1adaf0){const _0x5dfc9e=_0x331a9e;return{'model':db[_0x1adaf0[_0x5dfc9e('0x2')]],'as':_0x1adaf0['as'],'attributes':_0x1adaf0['attributes']};}):[]};}):[]};}):[]:[]})[_0x3213e9('0x3')](function(_0x5b2d8e){const _0x4744b5=_0x3213e9;logger[_0x4744b5('0x4')]('ShowTrunk',_0x1a5d49),logger[_0x4744b5('0x10')](_0x4744b5('0x0'),_0x1a5d49,JSON[_0x4744b5('0x1')](_0x5b2d8e)),_0x5cb6a1(_0x5b2d8e);})[_0x3213e9('0xe')](function(_0x36a3e0){const _0x3e4405=_0x3213e9;logger[_0x3e4405('0x7')](_0x3e4405('0x0'),_0x36a3e0[_0x3e4405('0x15')],_0x1a5d49),_0x18bcaa(_0x4d3900[_0x3e4405('0x7')](0x1f4,_0x36a3e0[_0x3e4405('0x15')]));});});};