Built motion from commit (unavailable).|2.5.26
[motion2.git] / server / api / intFreshdeskAccount / intFreshdeskAccount.rpc.js
index cee6a68..931d92f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1402=['client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','debug','catch','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise'];(function(_0x2395cc,_0x159ebe){var _0x380e6f=function(_0x2da383){while(--_0x2da383){_0x2395cc['push'](_0x2395cc['shift']());}};_0x380e6f(++_0x159ebe);}(_0x1402,0x121));var _0x2140=function(_0x1d2a11,_0x44e346){_0x1d2a11=_0x1d2a11-0x0;var _0xc2dee0=_0x1402[_0x1d2a11];return _0xc2dee0;};'use strict';var _=require(_0x2140('0x0'));var util=require(_0x2140('0x1'));var moment=require(_0x2140('0x2'));var BPromise=require(_0x2140('0x3'));var rs=require(_0x2140('0x4'));var fs=require('fs');var Redis=require(_0x2140('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2140('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2140('0x7'));var client=jayson[_0x2140('0x8')][_0x2140('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ad262,_0x18e2f4,_0x1a97f4){return new BPromise(function(_0x5dffd7,_0x162c1c){return client['request'](_0x3ad262,_0x1a97f4)[_0x2140('0xa')](function(_0x1e6634){logger[_0x2140('0xb')](_0x2140('0xc'),_0x18e2f4,_0x2140('0xd'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x18e2f4,_0x2140('0xd'),JSON[_0x2140('0xe')](_0x1e6634));if(_0x1e6634['error']){if(_0x1e6634[_0x2140('0xf')][_0x2140('0x10')]===0x1f4){logger['error'](_0x2140('0xc'),_0x18e2f4,_0x1e6634[_0x2140('0xf')][_0x2140('0x11')]);return _0x162c1c(_0x1e6634[_0x2140('0xf')][_0x2140('0x11')]);}logger['error'](_0x2140('0xc'),_0x18e2f4,_0x1e6634[_0x2140('0xf')]['message']);return _0x5dffd7(_0x1e6634[_0x2140('0xf')][_0x2140('0x11')]);}else{logger[_0x2140('0xb')](_0x2140('0xc'),_0x18e2f4,'request\x20sent');_0x5dffd7(_0x1e6634['result'][_0x2140('0x11')]);}})['catch'](function(_0x4b84cb){logger[_0x2140('0xf')](_0x2140('0xc'),_0x18e2f4,_0x4b84cb);_0x162c1c(_0x4b84cb);});});}exports[_0x2140('0x12')]=function(_0x51a6da){var _0x31a0fa=this;return new Promise(function(_0x4fb0ad,_0x1b25fb){return db[_0x2140('0x13')][_0x2140('0x14')]({'raw':_0x51a6da[_0x2140('0x15')]?_0x51a6da[_0x2140('0x15')][_0x2140('0x16')]===undefined?!![]:![]:!![],'where':_0x51a6da[_0x2140('0x15')]?_0x51a6da['options'][_0x2140('0x17')]||null:null,'attributes':_0x51a6da['options']?_0x51a6da[_0x2140('0x15')][_0x2140('0x18')]||null:null,'limit':_0x51a6da[_0x2140('0x15')]?_0x51a6da[_0x2140('0x15')][_0x2140('0x19')]||null:null,'include':_0x51a6da[_0x2140('0x15')]?_0x51a6da['options'][_0x2140('0x1a')]?_['map'](_0x51a6da[_0x2140('0x15')][_0x2140('0x1a')],function(_0x592422){return{'model':db[_0x592422[_0x2140('0x1b')]],'as':_0x592422['as'],'attributes':_0x592422[_0x2140('0x18')],'include':_0x592422['include']?_['map'](_0x592422[_0x2140('0x1a')],function(_0x54169c){return{'model':db[_0x54169c[_0x2140('0x1b')]],'as':_0x54169c['as'],'attributes':_0x54169c[_0x2140('0x18')],'include':_0x54169c[_0x2140('0x1a')]?_[_0x2140('0x1c')](_0x54169c[_0x2140('0x1a')],function(_0x3e0da0){return{'model':db[_0x3e0da0[_0x2140('0x1b')]],'as':_0x3e0da0['as'],'attributes':_0x3e0da0[_0x2140('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2140('0xa')](function(_0x3293d3){logger[_0x2140('0xb')](_0x2140('0x12'),_0x51a6da);logger[_0x2140('0x1d')](_0x2140('0x12'),_0x51a6da,JSON['stringify'](_0x3293d3));_0x4fb0ad(_0x3293d3);})[_0x2140('0x1e')](function(_0x24fe6a){logger['error'](_0x2140('0x12'),_0x24fe6a['message'],_0x51a6da);_0x1b25fb(_0x31a0fa[_0x2140('0xf')](0x1f4,_0x24fe6a[_0x2140('0x11')]));});});};exports[_0x2140('0x1f')]=function(_0x15e40c){var _0x1e6c9e=this;return new Promise(function(_0x452258,_0x2a08ac){return db[_0x2140('0x13')][_0x2140('0x20')]({'raw':_0x15e40c[_0x2140('0x15')]?_0x15e40c[_0x2140('0x15')][_0x2140('0x16')]===undefined?!![]:![]:!![],'where':_0x15e40c['options']?_0x15e40c['options'][_0x2140('0x17')]||null:null,'attributes':_0x15e40c['options']?_0x15e40c[_0x2140('0x15')]['attributes']||null:null,'include':_0x15e40c[_0x2140('0x15')]?_0x15e40c[_0x2140('0x15')][_0x2140('0x1a')]?_['map'](_0x15e40c['options']['include'],function(_0x4c6aa6){return{'model':db[_0x4c6aa6[_0x2140('0x1b')]],'as':_0x4c6aa6['as'],'attributes':_0x4c6aa6['attributes'],'include':_0x4c6aa6['include']?_[_0x2140('0x1c')](_0x4c6aa6[_0x2140('0x1a')],function(_0x46e4da){return{'model':db[_0x46e4da[_0x2140('0x1b')]],'as':_0x46e4da['as'],'attributes':_0x46e4da[_0x2140('0x18')],'include':_0x46e4da[_0x2140('0x1a')]?_[_0x2140('0x1c')](_0x46e4da[_0x2140('0x1a')],function(_0xeaaa90){return{'model':db[_0xeaaa90[_0x2140('0x1b')]],'as':_0xeaaa90['as'],'attributes':_0xeaaa90['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x397d91){logger['info'](_0x2140('0x1f'),_0x15e40c);logger[_0x2140('0x1d')](_0x2140('0x1f'),_0x15e40c,JSON[_0x2140('0xe')](_0x397d91));_0x452258(_0x397d91);})[_0x2140('0x1e')](function(_0x1f2de1){logger[_0x2140('0xf')](_0x2140('0x1f'),_0x1f2de1['message'],_0x15e40c);_0x2a08ac(_0x1e6c9e[_0x2140('0xf')](0x1f4,_0x1f2de1['message']));});});};
\ No newline at end of file
+var _0xc2ff=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','findAll','options','raw','attributes','map','include','model','GetFreshdeskAccount','stringify','catch','ShowFreshdeskAccount','FreshdeskAccount','find','where','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2ff,0x69));var _0xfc2f=function(_0x32e7d5,_0x5e70f6){_0x32e7d5=_0x32e7d5-0x0;var _0x5c7664=_0xc2ff[_0x32e7d5];return _0x5c7664;};'use strict';var _=require(_0xfc2f('0x0'));var util=require(_0xfc2f('0x1'));var moment=require(_0xfc2f('0x2'));var BPromise=require('bluebird');var rs=require(_0xfc2f('0x3'));var fs=require('fs');var Redis=require(_0xfc2f('0x4'));var db=require(_0xfc2f('0x5'))['db'];var utils=require(_0xfc2f('0x6'));var logger=require(_0xfc2f('0x7'))(_0xfc2f('0x8'));var config=require(_0xfc2f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfc2f('0xa')][_0xfc2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1535df,_0x225daf,_0x546a3f){return new BPromise(function(_0x2e8cee,_0x46ecaf){return client[_0xfc2f('0xc')](_0x1535df,_0x546a3f)[_0xfc2f('0xd')](function(_0x5a41ee){logger['info'](_0xfc2f('0xe'),_0x225daf,_0xfc2f('0xf'));logger[_0xfc2f('0x10')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x225daf,_0xfc2f('0xf'),JSON['stringify'](_0x5a41ee));if(_0x5a41ee[_0xfc2f('0x11')]){if(_0x5a41ee[_0xfc2f('0x11')][_0xfc2f('0x12')]===0x1f4){logger[_0xfc2f('0x11')](_0xfc2f('0xe'),_0x225daf,_0x5a41ee[_0xfc2f('0x11')]['message']);return _0x46ecaf(_0x5a41ee[_0xfc2f('0x11')][_0xfc2f('0x13')]);}logger['error'](_0xfc2f('0xe'),_0x225daf,_0x5a41ee[_0xfc2f('0x11')]['message']);return _0x2e8cee(_0x5a41ee[_0xfc2f('0x11')][_0xfc2f('0x13')]);}else{logger[_0xfc2f('0x14')](_0xfc2f('0xe'),_0x225daf,_0xfc2f('0xf'));_0x2e8cee(_0x5a41ee[_0xfc2f('0x15')][_0xfc2f('0x13')]);}})['catch'](function(_0x15215c){logger[_0xfc2f('0x11')](_0xfc2f('0xe'),_0x225daf,_0x15215c);_0x46ecaf(_0x15215c);});});}exports['GetFreshdeskAccount']=function(_0x540bf5){var _0x40b99c=this;return new Promise(function(_0xdcb8a6,_0x3bb12a){return db['FreshdeskAccount'][_0xfc2f('0x16')]({'raw':_0x540bf5[_0xfc2f('0x17')]?_0x540bf5['options'][_0xfc2f('0x18')]===undefined?!![]:![]:!![],'where':_0x540bf5['options']?_0x540bf5[_0xfc2f('0x17')]['where']||null:null,'attributes':_0x540bf5[_0xfc2f('0x17')]?_0x540bf5[_0xfc2f('0x17')][_0xfc2f('0x19')]||null:null,'limit':_0x540bf5[_0xfc2f('0x17')]?_0x540bf5[_0xfc2f('0x17')]['limit']||null:null,'include':_0x540bf5['options']?_0x540bf5[_0xfc2f('0x17')]['include']?_[_0xfc2f('0x1a')](_0x540bf5[_0xfc2f('0x17')][_0xfc2f('0x1b')],function(_0x3caf26){return{'model':db[_0x3caf26['model']],'as':_0x3caf26['as'],'attributes':_0x3caf26[_0xfc2f('0x19')],'include':_0x3caf26[_0xfc2f('0x1b')]?_[_0xfc2f('0x1a')](_0x3caf26['include'],function(_0x12511a){return{'model':db[_0x12511a[_0xfc2f('0x1c')]],'as':_0x12511a['as'],'attributes':_0x12511a['attributes'],'include':_0x12511a[_0xfc2f('0x1b')]?_[_0xfc2f('0x1a')](_0x12511a[_0xfc2f('0x1b')],function(_0x3f867a){return{'model':db[_0x3f867a['model']],'as':_0x3f867a['as'],'attributes':_0x3f867a[_0xfc2f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfc2f('0xd')](function(_0x1d9494){logger[_0xfc2f('0x14')](_0xfc2f('0x1d'),_0x540bf5);logger['debug'](_0xfc2f('0x1d'),_0x540bf5,JSON[_0xfc2f('0x1e')](_0x1d9494));_0xdcb8a6(_0x1d9494);})[_0xfc2f('0x1f')](function(_0x5ceff4){logger[_0xfc2f('0x11')](_0xfc2f('0x1d'),_0x5ceff4['message'],_0x540bf5);_0x3bb12a(_0x40b99c[_0xfc2f('0x11')](0x1f4,_0x5ceff4[_0xfc2f('0x13')]));});});};exports[_0xfc2f('0x20')]=function(_0xdd8e22){var _0x4b9def=this;return new Promise(function(_0x28d0ea,_0x289ea9){return db[_0xfc2f('0x21')][_0xfc2f('0x22')]({'raw':_0xdd8e22[_0xfc2f('0x17')]?_0xdd8e22['options'][_0xfc2f('0x18')]===undefined?!![]:![]:!![],'where':_0xdd8e22[_0xfc2f('0x17')]?_0xdd8e22['options'][_0xfc2f('0x23')]||null:null,'attributes':_0xdd8e22[_0xfc2f('0x17')]?_0xdd8e22[_0xfc2f('0x17')][_0xfc2f('0x19')]||null:null,'include':_0xdd8e22[_0xfc2f('0x17')]?_0xdd8e22[_0xfc2f('0x17')][_0xfc2f('0x1b')]?_[_0xfc2f('0x1a')](_0xdd8e22[_0xfc2f('0x17')][_0xfc2f('0x1b')],function(_0x464914){return{'model':db[_0x464914[_0xfc2f('0x1c')]],'as':_0x464914['as'],'attributes':_0x464914[_0xfc2f('0x19')],'include':_0x464914['include']?_[_0xfc2f('0x1a')](_0x464914[_0xfc2f('0x1b')],function(_0x526176){return{'model':db[_0x526176[_0xfc2f('0x1c')]],'as':_0x526176['as'],'attributes':_0x526176[_0xfc2f('0x19')],'include':_0x526176['include']?_['map'](_0x526176[_0xfc2f('0x1b')],function(_0x338376){return{'model':db[_0x338376['model']],'as':_0x338376['as'],'attributes':_0x338376[_0xfc2f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfc2f('0xd')](function(_0x576a5f){logger[_0xfc2f('0x14')](_0xfc2f('0x20'),_0xdd8e22);logger['debug'](_0xfc2f('0x20'),_0xdd8e22,JSON['stringify'](_0x576a5f));_0x28d0ea(_0x576a5f);})[_0xfc2f('0x1f')](function(_0x1c7e47){logger[_0xfc2f('0x11')](_0xfc2f('0x20'),_0x1c7e47[_0xfc2f('0x13')],_0xdd8e22);_0x289ea9(_0x4b9def[_0xfc2f('0x11')](0x1f4,_0x1c7e47[_0xfc2f('0x13')]));});});};
\ No newline at end of file