Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / api / intFreshdeskAccount / intFreshdeskAccount.rpc.js
index 14fcab9..aaf1788 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb0f=['result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','attributes','limit','include','map','model','catch','ShowFreshdeskAccount','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x1543b0,_0x22de65){var _0xaa76b1=function(_0x17741a){while(--_0x17741a){_0x1543b0['push'](_0x1543b0['shift']());}};_0xaa76b1(++_0x22de65);}(_0xcb0f,0x7d));var _0xfcb0=function(_0x14ed2f,_0x439945){_0x14ed2f=_0x14ed2f-0x0;var _0x5e29f9=_0xcb0f[_0x14ed2f];return _0x5e29f9;};'use strict';var _=require(_0xfcb0('0x0'));var util=require(_0xfcb0('0x1'));var moment=require(_0xfcb0('0x2'));var BPromise=require('bluebird');var rs=require(_0xfcb0('0x3'));var fs=require('fs');var Redis=require(_0xfcb0('0x4'));var db=require(_0xfcb0('0x5'))['db'];var utils=require(_0xfcb0('0x6'));var logger=require(_0xfcb0('0x7'))(_0xfcb0('0x8'));var config=require(_0xfcb0('0x9'));var jayson=require(_0xfcb0('0xa'));var client=jayson[_0xfcb0('0xb')][_0xfcb0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c53d2,_0x50995c,_0x3c0b5c){return new BPromise(function(_0x3ac1e6,_0x5c291c){return client[_0xfcb0('0xd')](_0x1c53d2,_0x3c0b5c)[_0xfcb0('0xe')](function(_0xd25efb){logger[_0xfcb0('0xf')](_0xfcb0('0x10'),_0x50995c,_0xfcb0('0x11'));logger[_0xfcb0('0x12')](_0xfcb0('0x13'),_0x50995c,_0xfcb0('0x11'),JSON[_0xfcb0('0x14')](_0xd25efb));if(_0xd25efb['error']){if(_0xd25efb[_0xfcb0('0x15')]['code']===0x1f4){logger[_0xfcb0('0x15')]('FreshdeskAccount,\x20%s,\x20%s',_0x50995c,_0xd25efb[_0xfcb0('0x15')][_0xfcb0('0x16')]);return _0x5c291c(_0xd25efb[_0xfcb0('0x15')][_0xfcb0('0x16')]);}logger['error'](_0xfcb0('0x10'),_0x50995c,_0xd25efb[_0xfcb0('0x15')][_0xfcb0('0x16')]);return _0x3ac1e6(_0xd25efb[_0xfcb0('0x15')]['message']);}else{logger[_0xfcb0('0xf')](_0xfcb0('0x10'),_0x50995c,'request\x20sent');_0x3ac1e6(_0xd25efb[_0xfcb0('0x17')][_0xfcb0('0x16')]);}})['catch'](function(_0x45fa37){logger['error'](_0xfcb0('0x10'),_0x50995c,_0x45fa37);_0x5c291c(_0x45fa37);});});}exports[_0xfcb0('0x18')]=function(_0x387ca4){var _0x3a9a04=this;return new Promise(function(_0x594872,_0x28c96d){return db[_0xfcb0('0x19')][_0xfcb0('0x1a')]({'raw':_0x387ca4[_0xfcb0('0x1b')]?_0x387ca4[_0xfcb0('0x1b')][_0xfcb0('0x1c')]===undefined?!![]:![]:!![],'where':_0x387ca4['options']?_0x387ca4[_0xfcb0('0x1b')]['where']||null:null,'attributes':_0x387ca4[_0xfcb0('0x1b')]?_0x387ca4[_0xfcb0('0x1b')][_0xfcb0('0x1d')]||null:null,'limit':_0x387ca4[_0xfcb0('0x1b')]?_0x387ca4[_0xfcb0('0x1b')][_0xfcb0('0x1e')]||null:null,'include':_0x387ca4[_0xfcb0('0x1b')]?_0x387ca4['options'][_0xfcb0('0x1f')]?_[_0xfcb0('0x20')](_0x387ca4['options']['include'],function(_0x434460){return{'model':db[_0x434460[_0xfcb0('0x21')]],'as':_0x434460['as'],'attributes':_0x434460[_0xfcb0('0x1d')],'include':_0x434460['include']?_[_0xfcb0('0x20')](_0x434460[_0xfcb0('0x1f')],function(_0x163ccd){return{'model':db[_0x163ccd['model']],'as':_0x163ccd['as'],'attributes':_0x163ccd[_0xfcb0('0x1d')],'include':_0x163ccd['include']?_[_0xfcb0('0x20')](_0x163ccd[_0xfcb0('0x1f')],function(_0x1ab398){return{'model':db[_0x1ab398['model']],'as':_0x1ab398['as'],'attributes':_0x1ab398[_0xfcb0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfcb0('0xe')](function(_0x14f53a){logger['info'](_0xfcb0('0x18'),_0x387ca4);logger[_0xfcb0('0x12')](_0xfcb0('0x18'),_0x387ca4,JSON[_0xfcb0('0x14')](_0x14f53a));_0x594872(_0x14f53a);})[_0xfcb0('0x22')](function(_0x1b1287){logger[_0xfcb0('0x15')](_0xfcb0('0x18'),_0x1b1287[_0xfcb0('0x16')],_0x387ca4);_0x28c96d(_0x3a9a04['error'](0x1f4,_0x1b1287[_0xfcb0('0x16')]));});});};exports[_0xfcb0('0x23')]=function(_0x5285ea){var _0x158f9e=this;return new Promise(function(_0x36cdd7,_0x41debf){return db[_0xfcb0('0x19')]['find']({'raw':_0x5285ea[_0xfcb0('0x1b')]?_0x5285ea[_0xfcb0('0x1b')][_0xfcb0('0x1c')]===undefined?!![]:![]:!![],'where':_0x5285ea['options']?_0x5285ea['options'][_0xfcb0('0x24')]||null:null,'attributes':_0x5285ea[_0xfcb0('0x1b')]?_0x5285ea[_0xfcb0('0x1b')][_0xfcb0('0x1d')]||null:null,'include':_0x5285ea[_0xfcb0('0x1b')]?_0x5285ea[_0xfcb0('0x1b')][_0xfcb0('0x1f')]?_['map'](_0x5285ea[_0xfcb0('0x1b')]['include'],function(_0x3b3e21){return{'model':db[_0x3b3e21[_0xfcb0('0x21')]],'as':_0x3b3e21['as'],'attributes':_0x3b3e21[_0xfcb0('0x1d')],'include':_0x3b3e21['include']?_['map'](_0x3b3e21[_0xfcb0('0x1f')],function(_0x126ac7){return{'model':db[_0x126ac7[_0xfcb0('0x21')]],'as':_0x126ac7['as'],'attributes':_0x126ac7['attributes'],'include':_0x126ac7[_0xfcb0('0x1f')]?_[_0xfcb0('0x20')](_0x126ac7[_0xfcb0('0x1f')],function(_0x480fbc){return{'model':db[_0x480fbc['model']],'as':_0x480fbc['as'],'attributes':_0x480fbc[_0xfcb0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfcb0('0xe')](function(_0x4dffeb){logger['info']('ShowFreshdeskAccount',_0x5285ea);logger[_0xfcb0('0x12')](_0xfcb0('0x23'),_0x5285ea,JSON[_0xfcb0('0x14')](_0x4dffeb));_0x36cdd7(_0x4dffeb);})[_0xfcb0('0x22')](function(_0x47383c){logger[_0xfcb0('0x15')]('ShowFreshdeskAccount',_0x47383c['message'],_0x5285ea);_0x41debf(_0x158f9e['error'](0x1f4,_0x47383c[_0xfcb0('0x16')]));});});};
\ No newline at end of file
+var _0xa1fb=['options','raw','where','limit','include','map','model','attributes','ShowFreshdeskAccount','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','FreshdeskAccount'];(function(_0x357979,_0x56feef){var _0xabb42f=function(_0x447f9d){while(--_0x447f9d){_0x357979['push'](_0x357979['shift']());}};_0xabb42f(++_0x56feef);}(_0xa1fb,0x1c9));var _0xba1f=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xa1fb[_0x35da42];return _0x370035;};'use strict';var _=require('lodash');var util=require(_0xba1f('0x0'));var moment=require(_0xba1f('0x1'));var BPromise=require(_0xba1f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba1f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xba1f('0x4'));var logger=require(_0xba1f('0x5'))(_0xba1f('0x6'));var config=require(_0xba1f('0x7'));var jayson=require(_0xba1f('0x8'));var client=jayson['client'][_0xba1f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31d4d4,_0x365af2,_0x13749d){return new BPromise(function(_0x44a462,_0x62c9e8){return client['request'](_0x31d4d4,_0x13749d)[_0xba1f('0xa')](function(_0x4c44a7){logger[_0xba1f('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x365af2,_0xba1f('0xc'));logger[_0xba1f('0xd')](_0xba1f('0xe'),_0x365af2,_0xba1f('0xc'),JSON[_0xba1f('0xf')](_0x4c44a7));if(_0x4c44a7['error']){if(_0x4c44a7[_0xba1f('0x10')]['code']===0x1f4){logger['error'](_0xba1f('0x11'),_0x365af2,_0x4c44a7[_0xba1f('0x10')][_0xba1f('0x12')]);return _0x62c9e8(_0x4c44a7['error'][_0xba1f('0x12')]);}logger[_0xba1f('0x10')](_0xba1f('0x11'),_0x365af2,_0x4c44a7['error'][_0xba1f('0x12')]);return _0x44a462(_0x4c44a7[_0xba1f('0x10')][_0xba1f('0x12')]);}else{logger['info'](_0xba1f('0x11'),_0x365af2,_0xba1f('0xc'));_0x44a462(_0x4c44a7[_0xba1f('0x13')][_0xba1f('0x12')]);}})[_0xba1f('0x14')](function(_0x25e152){logger[_0xba1f('0x10')](_0xba1f('0x11'),_0x365af2,_0x25e152);_0x62c9e8(_0x25e152);});});}exports[_0xba1f('0x15')]=function(_0x55aeba){var _0x41e81a=this;return new Promise(function(_0x295a24,_0xfeffe){return db[_0xba1f('0x16')]['findAll']({'raw':_0x55aeba[_0xba1f('0x17')]?_0x55aeba[_0xba1f('0x17')][_0xba1f('0x18')]===undefined?!![]:![]:!![],'where':_0x55aeba['options']?_0x55aeba[_0xba1f('0x17')][_0xba1f('0x19')]||null:null,'attributes':_0x55aeba['options']?_0x55aeba[_0xba1f('0x17')]['attributes']||null:null,'limit':_0x55aeba[_0xba1f('0x17')]?_0x55aeba[_0xba1f('0x17')][_0xba1f('0x1a')]||null:null,'include':_0x55aeba[_0xba1f('0x17')]?_0x55aeba[_0xba1f('0x17')][_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x55aeba[_0xba1f('0x17')][_0xba1f('0x1b')],function(_0x179a18){return{'model':db[_0x179a18[_0xba1f('0x1d')]],'as':_0x179a18['as'],'attributes':_0x179a18[_0xba1f('0x1e')],'include':_0x179a18[_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x179a18[_0xba1f('0x1b')],function(_0x22b038){return{'model':db[_0x22b038['model']],'as':_0x22b038['as'],'attributes':_0x22b038[_0xba1f('0x1e')],'include':_0x22b038[_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x22b038[_0xba1f('0x1b')],function(_0x524073){return{'model':db[_0x524073[_0xba1f('0x1d')]],'as':_0x524073['as'],'attributes':_0x524073[_0xba1f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xba1f('0xa')](function(_0x17d02e){logger[_0xba1f('0xb')]('GetFreshdeskAccount',_0x55aeba);logger[_0xba1f('0xd')](_0xba1f('0x15'),_0x55aeba,JSON[_0xba1f('0xf')](_0x17d02e));_0x295a24(_0x17d02e);})[_0xba1f('0x14')](function(_0x485805){logger[_0xba1f('0x10')](_0xba1f('0x15'),_0x485805[_0xba1f('0x12')],_0x55aeba);_0xfeffe(_0x41e81a[_0xba1f('0x10')](0x1f4,_0x485805[_0xba1f('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x405ea0){var _0x56866b=this;return new Promise(function(_0x497c95,_0xde539e){return db[_0xba1f('0x16')]['find']({'raw':_0x405ea0['options']?_0x405ea0[_0xba1f('0x17')][_0xba1f('0x18')]===undefined?!![]:![]:!![],'where':_0x405ea0['options']?_0x405ea0[_0xba1f('0x17')][_0xba1f('0x19')]||null:null,'attributes':_0x405ea0[_0xba1f('0x17')]?_0x405ea0[_0xba1f('0x17')][_0xba1f('0x1e')]||null:null,'include':_0x405ea0['options']?_0x405ea0['options'][_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x405ea0[_0xba1f('0x17')]['include'],function(_0x363279){return{'model':db[_0x363279[_0xba1f('0x1d')]],'as':_0x363279['as'],'attributes':_0x363279['attributes'],'include':_0x363279[_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x363279[_0xba1f('0x1b')],function(_0x1bfe99){return{'model':db[_0x1bfe99['model']],'as':_0x1bfe99['as'],'attributes':_0x1bfe99[_0xba1f('0x1e')],'include':_0x1bfe99[_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x1bfe99[_0xba1f('0x1b')],function(_0x55b692){return{'model':db[_0x55b692[_0xba1f('0x1d')]],'as':_0x55b692['as'],'attributes':_0x55b692[_0xba1f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x527b79){logger[_0xba1f('0xb')](_0xba1f('0x1f'),_0x405ea0);logger[_0xba1f('0xd')](_0xba1f('0x1f'),_0x405ea0,JSON[_0xba1f('0xf')](_0x527b79));_0x497c95(_0x527b79);})[_0xba1f('0x14')](function(_0x22787f){logger[_0xba1f('0x10')](_0xba1f('0x1f'),_0x22787f[_0xba1f('0x12')],_0x405ea0);_0xde539e(_0x56866b[_0xba1f('0x10')](0x1f4,_0x22787f['message']));});});};
\ No newline at end of file