7c3fc4d625819400cd51139149d080e2becccc21
[motion-next.git] / server / api / intDynamics365Account / intDynamics365Account.rpc.js
1 const a244_0x326d=['options','attributes','../../config/logger','catch','debug','Dynamics365Account','map','model','then','message','GetDynamics365Account','raw','error','ShowDynamics365Account','stringify','include','where','../../mysqldb','rpc','findOne','findAll','info'];(function(_0x5b551b,_0x326d7f){const _0x300cc1=function(_0xf1cec8){while(--_0xf1cec8){_0x5b551b['push'](_0x5b551b['shift']());}};_0x300cc1(++_0x326d7f);}(a244_0x326d,0x9a));const a244_0x300c=function(_0x5b551b,_0x326d7f){_0x5b551b=_0x5b551b-0x0;let _0x300cc1=a244_0x326d[_0x5b551b];return _0x300cc1;};const _0x6c761a=a244_0x300c;'use strict';const _=require('lodash'),db=require(_0x6c761a('0x11'))['db'],logger=require(_0x6c761a('0x2'))(_0x6c761a('0x12'));exports[_0x6c761a('0xa')]=function(_0xf1cec8){const _0x32c459=this;return new Promise(function(_0x4b8998,_0x3fcae0){const _0x420eec=a244_0x300c;return db[_0x420eec('0x5')][_0x420eec('0x14')]({'raw':_0xf1cec8[_0x420eec('0x0')]?_0xf1cec8[_0x420eec('0x0')]['raw']===undefined?!![]:![]:!![],'where':_0xf1cec8['options']?_0xf1cec8['options'][_0x420eec('0x10')]||null:null,'attributes':_0xf1cec8['options']?_0xf1cec8[_0x420eec('0x0')][_0x420eec('0x1')]||null:null,'limit':_0xf1cec8[_0x420eec('0x0')]?_0xf1cec8[_0x420eec('0x0')]['limit']||null:null,'include':_0xf1cec8[_0x420eec('0x0')]?_0xf1cec8[_0x420eec('0x0')][_0x420eec('0xf')]?_[_0x420eec('0x6')](_0xf1cec8[_0x420eec('0x0')][_0x420eec('0xf')],function(_0x4f0a22){const _0x3234e7=_0x420eec;return{'model':db[_0x4f0a22[_0x3234e7('0x7')]],'as':_0x4f0a22['as'],'attributes':_0x4f0a22[_0x3234e7('0x1')],'include':_0x4f0a22[_0x3234e7('0xf')]?_['map'](_0x4f0a22['include'],function(_0x5eefdd){const _0xa04e70=_0x3234e7;return{'model':db[_0x5eefdd[_0xa04e70('0x7')]],'as':_0x5eefdd['as'],'attributes':_0x5eefdd[_0xa04e70('0x1')],'include':_0x5eefdd[_0xa04e70('0xf')]?_[_0xa04e70('0x6')](_0x5eefdd['include'],function(_0x51206d){const _0x361baf=_0xa04e70;return{'model':db[_0x51206d[_0x361baf('0x7')]],'as':_0x51206d['as'],'attributes':_0x51206d[_0x361baf('0x1')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x133375){const _0x4f0f92=_0x420eec;logger[_0x4f0f92('0x15')](_0x4f0f92('0xa'),_0xf1cec8),logger[_0x4f0f92('0x4')](_0x4f0f92('0xa'),_0xf1cec8,JSON[_0x4f0f92('0xe')](_0x133375)),_0x4b8998(_0x133375);})['catch'](function(_0x41dca9){const _0x504cff=_0x420eec;logger['error'](_0x504cff('0xa'),_0x41dca9[_0x504cff('0x9')],_0xf1cec8),_0x3fcae0(_0x32c459['error'](0x1f4,_0x41dca9['message']));});});},exports[_0x6c761a('0xd')]=function(_0x5e5a57){const _0x59ecd6=this;return new Promise(function(_0x3e9388,_0x3b13b9){const _0xa4d93=a244_0x300c;return db[_0xa4d93('0x5')][_0xa4d93('0x13')]({'raw':_0x5e5a57[_0xa4d93('0x0')]?_0x5e5a57['options'][_0xa4d93('0xb')]===undefined?!![]:![]:!![],'where':_0x5e5a57[_0xa4d93('0x0')]?_0x5e5a57['options']['where']||null:null,'attributes':_0x5e5a57[_0xa4d93('0x0')]?_0x5e5a57[_0xa4d93('0x0')][_0xa4d93('0x1')]||null:null,'include':_0x5e5a57[_0xa4d93('0x0')]?_0x5e5a57[_0xa4d93('0x0')][_0xa4d93('0xf')]?_['map'](_0x5e5a57['options'][_0xa4d93('0xf')],function(_0x5a1dc4){const _0x3f5479=_0xa4d93;return{'model':db[_0x5a1dc4[_0x3f5479('0x7')]],'as':_0x5a1dc4['as'],'attributes':_0x5a1dc4[_0x3f5479('0x1')],'include':_0x5a1dc4[_0x3f5479('0xf')]?_['map'](_0x5a1dc4[_0x3f5479('0xf')],function(_0x1b5c9b){const _0x265289=_0x3f5479;return{'model':db[_0x1b5c9b[_0x265289('0x7')]],'as':_0x1b5c9b['as'],'attributes':_0x1b5c9b[_0x265289('0x1')],'include':_0x1b5c9b[_0x265289('0xf')]?_[_0x265289('0x6')](_0x1b5c9b[_0x265289('0xf')],function(_0x3b024e){const _0x104021=_0x265289;return{'model':db[_0x3b024e[_0x104021('0x7')]],'as':_0x3b024e['as'],'attributes':_0x3b024e[_0x104021('0x1')]};}):[]};}):[]};}):[]:[]})[_0xa4d93('0x8')](function(_0x4dd78e){const _0x1a75c2=_0xa4d93;logger[_0x1a75c2('0x15')](_0x1a75c2('0xd'),_0x5e5a57),logger['debug']('ShowDynamics365Account',_0x5e5a57,JSON[_0x1a75c2('0xe')](_0x4dd78e)),_0x3e9388(_0x4dd78e);})[_0xa4d93('0x3')](function(_0x58f30e){const _0x20d22c=_0xa4d93;logger[_0x20d22c('0xc')](_0x20d22c('0xd'),_0x58f30e[_0x20d22c('0x9')],_0x5e5a57),_0x3b13b9(_0x59ecd6[_0x20d22c('0xc')](0x1f4,_0x58f30e[_0x20d22c('0x9')]));});});};