Built motion from commit ecdc8e66766c75b1b08288b0ea13eb12d42606b4. Version 3.0.0...
[motion-next.git] / server / api / intVtigerAccount / intVtigerAccount.rpc.js
1 const a322_0xf3fa=['debug','where','attributes','findAll','ShowVtigerAccount','catch','message','../../config/logger','info','then','GetVtigerAccount','stringify','model','lodash','map','VtigerAccount','error','include','rpc','limit','options','raw','../../mysqldb'];(function(_0x5e3648,_0xf3fa3b){const _0x34fc90=function(_0x176306){while(--_0x176306){_0x5e3648['push'](_0x5e3648['shift']());}};_0x34fc90(++_0xf3fa3b);}(a322_0xf3fa,0x136));const a322_0x34fc=function(_0x5e3648,_0xf3fa3b){_0x5e3648=_0x5e3648-0x0;let _0x34fc90=a322_0xf3fa[_0x5e3648];return _0x34fc90;};const _0x2c25ee=a322_0x34fc;'use strict';const _=require(_0x2c25ee('0x2')),db=require(_0x2c25ee('0xb'))['db'],logger=require(_0x2c25ee('0x13'))(_0x2c25ee('0x7'));exports[_0x2c25ee('0x16')]=function(_0x176306){const _0x166e81=this;return new Promise(function(_0x3e8355,_0x3cba0a){const _0x1bfe4d=a322_0x34fc;return db[_0x1bfe4d('0x4')][_0x1bfe4d('0xf')]({'raw':_0x176306[_0x1bfe4d('0x9')]?_0x176306[_0x1bfe4d('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x176306['options']?_0x176306[_0x1bfe4d('0x9')][_0x1bfe4d('0xd')]||null:null,'attributes':_0x176306['options']?_0x176306[_0x1bfe4d('0x9')][_0x1bfe4d('0xe')]||null:null,'limit':_0x176306['options']?_0x176306[_0x1bfe4d('0x9')][_0x1bfe4d('0x8')]||null:null,'include':_0x176306['options']?_0x176306[_0x1bfe4d('0x9')][_0x1bfe4d('0x6')]?_['map'](_0x176306['options'][_0x1bfe4d('0x6')],function(_0x9bb3af){const _0x1c8646=_0x1bfe4d;return{'model':db[_0x9bb3af[_0x1c8646('0x1')]],'as':_0x9bb3af['as'],'attributes':_0x9bb3af[_0x1c8646('0xe')],'include':_0x9bb3af[_0x1c8646('0x6')]?_[_0x1c8646('0x3')](_0x9bb3af[_0x1c8646('0x6')],function(_0x114d60){const _0x3a75ae=_0x1c8646;return{'model':db[_0x114d60[_0x3a75ae('0x1')]],'as':_0x114d60['as'],'attributes':_0x114d60['attributes'],'include':_0x114d60[_0x3a75ae('0x6')]?_[_0x3a75ae('0x3')](_0x114d60[_0x3a75ae('0x6')],function(_0x4a3df9){const _0x496e5e=_0x3a75ae;return{'model':db[_0x4a3df9[_0x496e5e('0x1')]],'as':_0x4a3df9['as'],'attributes':_0x4a3df9[_0x496e5e('0xe')]};}):[]};}):[]};}):[]:[]})[_0x1bfe4d('0x15')](function(_0x462ff3){const _0x4cdec9=_0x1bfe4d;logger[_0x4cdec9('0x14')]('GetVtigerAccount',_0x176306),logger[_0x4cdec9('0xc')](_0x4cdec9('0x16'),_0x176306,JSON[_0x4cdec9('0x0')](_0x462ff3)),_0x3e8355(_0x462ff3);})[_0x1bfe4d('0x11')](function(_0x153093){const _0x364e5d=_0x1bfe4d;logger['error']('GetVtigerAccount',_0x153093['message'],_0x176306),_0x3cba0a(_0x166e81[_0x364e5d('0x5')](0x1f4,_0x153093[_0x364e5d('0x12')]));});});},exports['ShowVtigerAccount']=function(_0x245133){const _0x8fdc4a=this;return new Promise(function(_0x51bc04,_0x18edcb){const _0x29e4c6=a322_0x34fc;return db['VtigerAccount']['findOne']({'raw':_0x245133['options']?_0x245133[_0x29e4c6('0x9')][_0x29e4c6('0xa')]===undefined?!![]:![]:!![],'where':_0x245133[_0x29e4c6('0x9')]?_0x245133[_0x29e4c6('0x9')][_0x29e4c6('0xd')]||null:null,'attributes':_0x245133[_0x29e4c6('0x9')]?_0x245133[_0x29e4c6('0x9')][_0x29e4c6('0xe')]||null:null,'include':_0x245133[_0x29e4c6('0x9')]?_0x245133[_0x29e4c6('0x9')][_0x29e4c6('0x6')]?_[_0x29e4c6('0x3')](_0x245133[_0x29e4c6('0x9')][_0x29e4c6('0x6')],function(_0x3cbc01){const _0x5c6485=_0x29e4c6;return{'model':db[_0x3cbc01[_0x5c6485('0x1')]],'as':_0x3cbc01['as'],'attributes':_0x3cbc01[_0x5c6485('0xe')],'include':_0x3cbc01[_0x5c6485('0x6')]?_[_0x5c6485('0x3')](_0x3cbc01['include'],function(_0x2347cd){const _0x296b8b=_0x5c6485;return{'model':db[_0x2347cd['model']],'as':_0x2347cd['as'],'attributes':_0x2347cd[_0x296b8b('0xe')],'include':_0x2347cd[_0x296b8b('0x6')]?_[_0x296b8b('0x3')](_0x2347cd[_0x296b8b('0x6')],function(_0x5ba3dd){const _0x404805=_0x296b8b;return{'model':db[_0x5ba3dd[_0x404805('0x1')]],'as':_0x5ba3dd['as'],'attributes':_0x5ba3dd[_0x404805('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29c5c1){const _0x496a24=_0x29e4c6;logger['info'](_0x496a24('0x10'),_0x245133),logger[_0x496a24('0xc')](_0x496a24('0x10'),_0x245133,JSON['stringify'](_0x29c5c1)),_0x51bc04(_0x29c5c1);})[_0x29e4c6('0x11')](function(_0x3715ff){const _0x5e225d=_0x29e4c6;logger['error'](_0x5e225d('0x10'),_0x3715ff['message'],_0x245133),_0x18edcb(_0x8fdc4a['error'](0x1f4,_0x3715ff[_0x5e225d('0x12')]));});});};