3cae4763007a3ee7c01b10aa01eebeb688b561f6
[motion-next.git] / server / api / intFreshsalesAccount / intFreshsalesAccount.rpc.js
1 const a270_0x2bf1=['include','stringify','GetFreshsalesAccount','debug','info','catch','../../mysqldb','where','then','error','raw','model','FreshsalesAccount','options','message','ShowFreshsalesAccount','attributes','rpc','limit','../../config/logger','findOne','map'];(function(_0x4a386a,_0x2bf14c){const _0xf53a60=function(_0x183d76){while(--_0x183d76){_0x4a386a['push'](_0x4a386a['shift']());}};_0xf53a60(++_0x2bf14c);}(a270_0x2bf1,0x1e1));const a270_0xf53a=function(_0x4a386a,_0x2bf14c){_0x4a386a=_0x4a386a-0x0;let _0xf53a60=a270_0x2bf1[_0x4a386a];return _0xf53a60;};const _0x31ea4d=a270_0xf53a;'use strict';const _=require('lodash'),db=require(_0x31ea4d('0x9'))['db'],logger=require(_0x31ea4d('0x0'))(_0x31ea4d('0x14'));exports[_0x31ea4d('0x5')]=function(_0x183d76){const _0x2ffd69=this;return new Promise(function(_0x47e39f,_0x19dd91){const _0x36264d=a270_0xf53a;return db[_0x36264d('0xf')]['findAll']({'raw':_0x183d76[_0x36264d('0x10')]?_0x183d76['options']['raw']===undefined?!![]:![]:!![],'where':_0x183d76[_0x36264d('0x10')]?_0x183d76[_0x36264d('0x10')][_0x36264d('0xa')]||null:null,'attributes':_0x183d76[_0x36264d('0x10')]?_0x183d76[_0x36264d('0x10')]['attributes']||null:null,'limit':_0x183d76[_0x36264d('0x10')]?_0x183d76[_0x36264d('0x10')][_0x36264d('0x15')]||null:null,'include':_0x183d76[_0x36264d('0x10')]?_0x183d76[_0x36264d('0x10')][_0x36264d('0x3')]?_[_0x36264d('0x2')](_0x183d76[_0x36264d('0x10')][_0x36264d('0x3')],function(_0x5e47fa){const _0x35bdd3=_0x36264d;return{'model':db[_0x5e47fa[_0x35bdd3('0xe')]],'as':_0x5e47fa['as'],'attributes':_0x5e47fa[_0x35bdd3('0x13')],'include':_0x5e47fa['include']?_[_0x35bdd3('0x2')](_0x5e47fa[_0x35bdd3('0x3')],function(_0x4a5425){const _0x5f4523=_0x35bdd3;return{'model':db[_0x4a5425[_0x5f4523('0xe')]],'as':_0x4a5425['as'],'attributes':_0x4a5425['attributes'],'include':_0x4a5425[_0x5f4523('0x3')]?_[_0x5f4523('0x2')](_0x4a5425[_0x5f4523('0x3')],function(_0x20fe5a){const _0x20f1cb=_0x5f4523;return{'model':db[_0x20fe5a[_0x20f1cb('0xe')]],'as':_0x20fe5a['as'],'attributes':_0x20fe5a['attributes']};}):[]};}):[]};}):[]:[]})[_0x36264d('0xb')](function(_0x16beaf){const _0x1829dc=_0x36264d;logger['info']('GetFreshsalesAccount',_0x183d76),logger[_0x1829dc('0x6')]('GetFreshsalesAccount',_0x183d76,JSON[_0x1829dc('0x4')](_0x16beaf)),_0x47e39f(_0x16beaf);})[_0x36264d('0x8')](function(_0x58311a){const _0x19a44c=_0x36264d;logger[_0x19a44c('0xc')]('GetFreshsalesAccount',_0x58311a['message'],_0x183d76),_0x19dd91(_0x2ffd69[_0x19a44c('0xc')](0x1f4,_0x58311a[_0x19a44c('0x11')]));});});},exports[_0x31ea4d('0x12')]=function(_0x3106e4){const _0x28d8d3=this;return new Promise(function(_0x22be8e,_0x589a60){const _0x1bb279=a270_0xf53a;return db['FreshsalesAccount'][_0x1bb279('0x1')]({'raw':_0x3106e4[_0x1bb279('0x10')]?_0x3106e4[_0x1bb279('0x10')][_0x1bb279('0xd')]===undefined?!![]:![]:!![],'where':_0x3106e4[_0x1bb279('0x10')]?_0x3106e4[_0x1bb279('0x10')][_0x1bb279('0xa')]||null:null,'attributes':_0x3106e4[_0x1bb279('0x10')]?_0x3106e4[_0x1bb279('0x10')][_0x1bb279('0x13')]||null:null,'include':_0x3106e4['options']?_0x3106e4[_0x1bb279('0x10')]['include']?_[_0x1bb279('0x2')](_0x3106e4['options'][_0x1bb279('0x3')],function(_0x4c142b){const _0x392dcf=_0x1bb279;return{'model':db[_0x4c142b[_0x392dcf('0xe')]],'as':_0x4c142b['as'],'attributes':_0x4c142b['attributes'],'include':_0x4c142b[_0x392dcf('0x3')]?_[_0x392dcf('0x2')](_0x4c142b[_0x392dcf('0x3')],function(_0x5e2c73){const _0x448b61=_0x392dcf;return{'model':db[_0x5e2c73[_0x448b61('0xe')]],'as':_0x5e2c73['as'],'attributes':_0x5e2c73[_0x448b61('0x13')],'include':_0x5e2c73[_0x448b61('0x3')]?_[_0x448b61('0x2')](_0x5e2c73[_0x448b61('0x3')],function(_0x6be9be){const _0x2304f0=_0x448b61;return{'model':db[_0x6be9be[_0x2304f0('0xe')]],'as':_0x6be9be['as'],'attributes':_0x6be9be[_0x2304f0('0x13')]};}):[]};}):[]};}):[]:[]})[_0x1bb279('0xb')](function(_0x436406){const _0x2d47=_0x1bb279;logger[_0x2d47('0x7')]('ShowFreshsalesAccount',_0x3106e4),logger['debug'](_0x2d47('0x12'),_0x3106e4,JSON[_0x2d47('0x4')](_0x436406)),_0x22be8e(_0x436406);})['catch'](function(_0x551929){const _0x3ec13c=_0x1bb279;logger[_0x3ec13c('0xc')](_0x3ec13c('0x12'),_0x551929[_0x3ec13c('0x11')],_0x3106e4),_0x589a60(_0x28d8d3['error'](0x1f4,_0x551929[_0x3ec13c('0x11')]));});});};