Built motion from commit 4a18b36e645f5fa4a517d36f9783bde259878164. Version 3.0.0...
[motion-next.git] / server / api / intFreshdeskAccount / intFreshdeskAccount.rpc.js
1 const a257_0x2964=['map','where','info','ShowFreshdeskAccount','findOne','../../config/logger','GetFreshdeskAccount','../../mysqldb','attributes','lodash','message','findAll','limit','error','debug','catch','stringify','rpc','raw','model','options','include'];(function(_0x523484,_0x296419){const _0x177cc1=function(_0x573ce6){while(--_0x573ce6){_0x523484['push'](_0x523484['shift']());}};_0x177cc1(++_0x296419);}(a257_0x2964,0xd2));const a257_0x177c=function(_0x523484,_0x296419){_0x523484=_0x523484-0x0;let _0x177cc1=a257_0x2964[_0x523484];return _0x177cc1;};const _0x34bbea=a257_0x177c;'use strict';const _=require(_0x34bbea('0x13')),db=require(_0x34bbea('0x11'))['db'],logger=require(_0x34bbea('0xf'))(_0x34bbea('0x5'));exports[_0x34bbea('0x10')]=function(_0x573ce6){const _0x50cfcb=this;return new Promise(function(_0x2cc77a,_0x5359d2){const _0x8c5986=a257_0x177c;return db['FreshdeskAccount'][_0x8c5986('0x15')]({'raw':_0x573ce6['options']?_0x573ce6[_0x8c5986('0x8')][_0x8c5986('0x6')]===undefined?!![]:![]:!![],'where':_0x573ce6[_0x8c5986('0x8')]?_0x573ce6['options'][_0x8c5986('0xb')]||null:null,'attributes':_0x573ce6[_0x8c5986('0x8')]?_0x573ce6[_0x8c5986('0x8')][_0x8c5986('0x12')]||null:null,'limit':_0x573ce6['options']?_0x573ce6['options'][_0x8c5986('0x0')]||null:null,'include':_0x573ce6[_0x8c5986('0x8')]?_0x573ce6[_0x8c5986('0x8')][_0x8c5986('0x9')]?_['map'](_0x573ce6[_0x8c5986('0x8')][_0x8c5986('0x9')],function(_0x5020d3){const _0x34c242=_0x8c5986;return{'model':db[_0x5020d3[_0x34c242('0x7')]],'as':_0x5020d3['as'],'attributes':_0x5020d3[_0x34c242('0x12')],'include':_0x5020d3[_0x34c242('0x9')]?_[_0x34c242('0xa')](_0x5020d3[_0x34c242('0x9')],function(_0x252902){const _0x42944c=_0x34c242;return{'model':db[_0x252902['model']],'as':_0x252902['as'],'attributes':_0x252902[_0x42944c('0x12')],'include':_0x252902['include']?_['map'](_0x252902['include'],function(_0x2afbbd){const _0x201b4b=_0x42944c;return{'model':db[_0x2afbbd[_0x201b4b('0x7')]],'as':_0x2afbbd['as'],'attributes':_0x2afbbd[_0x201b4b('0x12')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x58d268){const _0x1d345b=_0x8c5986;logger[_0x1d345b('0xc')](_0x1d345b('0x10'),_0x573ce6),logger[_0x1d345b('0x2')]('GetFreshdeskAccount',_0x573ce6,JSON['stringify'](_0x58d268)),_0x2cc77a(_0x58d268);})[_0x8c5986('0x3')](function(_0xf0cdb0){const _0x279197=_0x8c5986;logger['error'](_0x279197('0x10'),_0xf0cdb0[_0x279197('0x14')],_0x573ce6),_0x5359d2(_0x50cfcb[_0x279197('0x1')](0x1f4,_0xf0cdb0[_0x279197('0x14')]));});});},exports[_0x34bbea('0xd')]=function(_0x208e3a){const _0x26c2d6=this;return new Promise(function(_0x1020fb,_0x321b8d){const _0x5e632e=a257_0x177c;return db['FreshdeskAccount'][_0x5e632e('0xe')]({'raw':_0x208e3a[_0x5e632e('0x8')]?_0x208e3a[_0x5e632e('0x8')][_0x5e632e('0x6')]===undefined?!![]:![]:!![],'where':_0x208e3a[_0x5e632e('0x8')]?_0x208e3a[_0x5e632e('0x8')]['where']||null:null,'attributes':_0x208e3a[_0x5e632e('0x8')]?_0x208e3a[_0x5e632e('0x8')][_0x5e632e('0x12')]||null:null,'include':_0x208e3a['options']?_0x208e3a[_0x5e632e('0x8')][_0x5e632e('0x9')]?_[_0x5e632e('0xa')](_0x208e3a[_0x5e632e('0x8')]['include'],function(_0x121333){const _0x56ddf5=_0x5e632e;return{'model':db[_0x121333[_0x56ddf5('0x7')]],'as':_0x121333['as'],'attributes':_0x121333[_0x56ddf5('0x12')],'include':_0x121333[_0x56ddf5('0x9')]?_[_0x56ddf5('0xa')](_0x121333[_0x56ddf5('0x9')],function(_0x5893ee){const _0x57ce00=_0x56ddf5;return{'model':db[_0x5893ee['model']],'as':_0x5893ee['as'],'attributes':_0x5893ee['attributes'],'include':_0x5893ee[_0x57ce00('0x9')]?_[_0x57ce00('0xa')](_0x5893ee[_0x57ce00('0x9')],function(_0x546a12){const _0x459c57=_0x57ce00;return{'model':db[_0x546a12['model']],'as':_0x546a12['as'],'attributes':_0x546a12[_0x459c57('0x12')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4299dd){const _0x447b2d=_0x5e632e;logger[_0x447b2d('0xc')](_0x447b2d('0xd'),_0x208e3a),logger['debug'](_0x447b2d('0xd'),_0x208e3a,JSON[_0x447b2d('0x4')](_0x4299dd)),_0x1020fb(_0x4299dd);})['catch'](function(_0x3c97ec){const _0x39abea=_0x5e632e;logger[_0x39abea('0x1')](_0x39abea('0xd'),_0x3c97ec[_0x39abea('0x14')],_0x208e3a),_0x321b8d(_0x26c2d6['error'](0x1f4,_0x3c97ec[_0x39abea('0x14')]));});});};