Built motion from commit 43538d75.|2.5.35
[motion2.git] / server / api / intFreshdeskAccount / intFreshdeskAccount.rpc.js
index 83124c1..edc1193 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x267a=['result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','limit','map','include','attributes','model','where','ShowFreshdeskAccount','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','info'];(function(_0x14572b,_0x123f18){var _0x1812e8=function(_0x435f15){while(--_0x435f15){_0x14572b['push'](_0x14572b['shift']());}};_0x1812e8(++_0x123f18);}(_0x267a,0x140));var _0xa267=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x267a[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa267('0x0'));var BPromise=require(_0xa267('0x1'));var rs=require(_0xa267('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa267('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa267('0x4'));var config=require(_0xa267('0x5'));var jayson=require(_0xa267('0x6'));var client=jayson[_0xa267('0x7')][_0xa267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14d113,_0x3c9cec,_0x257cc9){return new BPromise(function(_0x40e69f,_0x523608){return client[_0xa267('0x9')](_0x14d113,_0x257cc9)[_0xa267('0xa')](function(_0x23a7f9){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x3c9cec,_0xa267('0xb'));logger[_0xa267('0xc')](_0xa267('0xd'),_0x3c9cec,_0xa267('0xb'),JSON[_0xa267('0xe')](_0x23a7f9));if(_0x23a7f9[_0xa267('0xf')]){if(_0x23a7f9[_0xa267('0xf')][_0xa267('0x10')]===0x1f4){logger['error'](_0xa267('0x11'),_0x3c9cec,_0x23a7f9[_0xa267('0xf')][_0xa267('0x12')]);return _0x523608(_0x23a7f9[_0xa267('0xf')][_0xa267('0x12')]);}logger[_0xa267('0xf')](_0xa267('0x11'),_0x3c9cec,_0x23a7f9[_0xa267('0xf')][_0xa267('0x12')]);return _0x40e69f(_0x23a7f9[_0xa267('0xf')][_0xa267('0x12')]);}else{logger[_0xa267('0x13')](_0xa267('0x11'),_0x3c9cec,_0xa267('0xb'));_0x40e69f(_0x23a7f9[_0xa267('0x14')][_0xa267('0x12')]);}})[_0xa267('0x15')](function(_0x2144da){logger['error'](_0xa267('0x11'),_0x3c9cec,_0x2144da);_0x523608(_0x2144da);});});}exports[_0xa267('0x16')]=function(_0x11a0c5){var _0x1f71bc=this;return new Promise(function(_0x4b544b,_0x3f2d1d){return db[_0xa267('0x17')][_0xa267('0x18')]({'raw':_0x11a0c5[_0xa267('0x19')]?_0x11a0c5[_0xa267('0x19')][_0xa267('0x1a')]===undefined?!![]:![]:!![],'where':_0x11a0c5[_0xa267('0x19')]?_0x11a0c5[_0xa267('0x19')]['where']||null:null,'attributes':_0x11a0c5['options']?_0x11a0c5[_0xa267('0x19')]['attributes']||null:null,'limit':_0x11a0c5[_0xa267('0x19')]?_0x11a0c5['options'][_0xa267('0x1b')]||null:null,'include':_0x11a0c5['options']?_0x11a0c5[_0xa267('0x19')]['include']?_[_0xa267('0x1c')](_0x11a0c5[_0xa267('0x19')][_0xa267('0x1d')],function(_0x4eae01){return{'model':db[_0x4eae01['model']],'as':_0x4eae01['as'],'attributes':_0x4eae01[_0xa267('0x1e')],'include':_0x4eae01['include']?_['map'](_0x4eae01[_0xa267('0x1d')],function(_0x3156c9){return{'model':db[_0x3156c9[_0xa267('0x1f')]],'as':_0x3156c9['as'],'attributes':_0x3156c9[_0xa267('0x1e')],'include':_0x3156c9[_0xa267('0x1d')]?_[_0xa267('0x1c')](_0x3156c9[_0xa267('0x1d')],function(_0x470796){return{'model':db[_0x470796['model']],'as':_0x470796['as'],'attributes':_0x470796[_0xa267('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa267('0xa')](function(_0x163e31){logger['info']('GetFreshdeskAccount',_0x11a0c5);logger['debug'](_0xa267('0x16'),_0x11a0c5,JSON[_0xa267('0xe')](_0x163e31));_0x4b544b(_0x163e31);})[_0xa267('0x15')](function(_0xdddf25){logger[_0xa267('0xf')](_0xa267('0x16'),_0xdddf25[_0xa267('0x12')],_0x11a0c5);_0x3f2d1d(_0x1f71bc['error'](0x1f4,_0xdddf25[_0xa267('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x172857){var _0x5a85ee=this;return new Promise(function(_0x5087d3,_0x47bffe){return db[_0xa267('0x17')]['find']({'raw':_0x172857[_0xa267('0x19')]?_0x172857[_0xa267('0x19')][_0xa267('0x1a')]===undefined?!![]:![]:!![],'where':_0x172857[_0xa267('0x19')]?_0x172857['options'][_0xa267('0x20')]||null:null,'attributes':_0x172857['options']?_0x172857[_0xa267('0x19')][_0xa267('0x1e')]||null:null,'include':_0x172857[_0xa267('0x19')]?_0x172857['options'][_0xa267('0x1d')]?_[_0xa267('0x1c')](_0x172857[_0xa267('0x19')][_0xa267('0x1d')],function(_0x3e53b2){return{'model':db[_0x3e53b2[_0xa267('0x1f')]],'as':_0x3e53b2['as'],'attributes':_0x3e53b2[_0xa267('0x1e')],'include':_0x3e53b2[_0xa267('0x1d')]?_['map'](_0x3e53b2[_0xa267('0x1d')],function(_0x3fa0e1){return{'model':db[_0x3fa0e1['model']],'as':_0x3fa0e1['as'],'attributes':_0x3fa0e1[_0xa267('0x1e')],'include':_0x3fa0e1['include']?_[_0xa267('0x1c')](_0x3fa0e1[_0xa267('0x1d')],function(_0x13f437){return{'model':db[_0x13f437[_0xa267('0x1f')]],'as':_0x13f437['as'],'attributes':_0x13f437['attributes']};}):[]};}):[]};}):[]:[]})[_0xa267('0xa')](function(_0x4e7efb){logger['info'](_0xa267('0x21'),_0x172857);logger['debug']('ShowFreshdeskAccount',_0x172857,JSON['stringify'](_0x4e7efb));_0x5087d3(_0x4e7efb);})['catch'](function(_0x51e531){logger[_0xa267('0xf')](_0xa267('0x21'),_0x51e531[_0xa267('0x12')],_0x172857);_0x47bffe(_0x5a85ee[_0xa267('0xf')](0x1f4,_0x51e531[_0xa267('0x12')]));});});};
\ No newline at end of file
+var _0xca3d=['options','raw','where','include','map','model','attributes','catch','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetFreshdeskAccount','findAll'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xca3d,0xa4));var _0xdca3=function(_0x43a1b8,_0x1c90c8){_0x43a1b8=_0x43a1b8-0x0;var _0x324ecc=_0xca3d[_0x43a1b8];return _0x324ecc;};'use strict';var _=require(_0xdca3('0x0'));var util=require(_0xdca3('0x1'));var moment=require(_0xdca3('0x2'));var BPromise=require(_0xdca3('0x3'));var rs=require(_0xdca3('0x4'));var fs=require('fs');var Redis=require(_0xdca3('0x5'));var db=require(_0xdca3('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdca3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdca3('0x8')][_0xdca3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x114ba7,_0x5355b1,_0x432693){return new BPromise(function(_0x396801,_0x3c7e95){return client['request'](_0x114ba7,_0x432693)[_0xdca3('0xa')](function(_0x3cb92b){logger['info'](_0xdca3('0xb'),_0x5355b1,_0xdca3('0xc'));logger[_0xdca3('0xd')](_0xdca3('0xe'),_0x5355b1,_0xdca3('0xc'),JSON[_0xdca3('0xf')](_0x3cb92b));if(_0x3cb92b[_0xdca3('0x10')]){if(_0x3cb92b[_0xdca3('0x10')]['code']===0x1f4){logger['error'](_0xdca3('0xb'),_0x5355b1,_0x3cb92b[_0xdca3('0x10')][_0xdca3('0x11')]);return _0x3c7e95(_0x3cb92b['error']['message']);}logger[_0xdca3('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x5355b1,_0x3cb92b['error'][_0xdca3('0x11')]);return _0x396801(_0x3cb92b['error'][_0xdca3('0x11')]);}else{logger[_0xdca3('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x5355b1,_0xdca3('0xc'));_0x396801(_0x3cb92b[_0xdca3('0x13')][_0xdca3('0x11')]);}})['catch'](function(_0x221be3){logger[_0xdca3('0x10')](_0xdca3('0xb'),_0x5355b1,_0x221be3);_0x3c7e95(_0x221be3);});});}exports[_0xdca3('0x14')]=function(_0x66e536){var _0x31e7cb=this;return new Promise(function(_0x1e99c9,_0x1fd2d9){return db['FreshdeskAccount'][_0xdca3('0x15')]({'raw':_0x66e536[_0xdca3('0x16')]?_0x66e536[_0xdca3('0x16')][_0xdca3('0x17')]===undefined?!![]:![]:!![],'where':_0x66e536['options']?_0x66e536['options'][_0xdca3('0x18')]||null:null,'attributes':_0x66e536[_0xdca3('0x16')]?_0x66e536[_0xdca3('0x16')]['attributes']||null:null,'limit':_0x66e536[_0xdca3('0x16')]?_0x66e536[_0xdca3('0x16')]['limit']||null:null,'include':_0x66e536[_0xdca3('0x16')]?_0x66e536[_0xdca3('0x16')][_0xdca3('0x19')]?_[_0xdca3('0x1a')](_0x66e536[_0xdca3('0x16')]['include'],function(_0x59dcd0){return{'model':db[_0x59dcd0[_0xdca3('0x1b')]],'as':_0x59dcd0['as'],'attributes':_0x59dcd0['attributes'],'include':_0x59dcd0[_0xdca3('0x19')]?_[_0xdca3('0x1a')](_0x59dcd0[_0xdca3('0x19')],function(_0x4702f5){return{'model':db[_0x4702f5[_0xdca3('0x1b')]],'as':_0x4702f5['as'],'attributes':_0x4702f5[_0xdca3('0x1c')],'include':_0x4702f5['include']?_[_0xdca3('0x1a')](_0x4702f5[_0xdca3('0x19')],function(_0x400c6d){return{'model':db[_0x400c6d[_0xdca3('0x1b')]],'as':_0x400c6d['as'],'attributes':_0x400c6d[_0xdca3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdca3('0xa')](function(_0x527a38){logger[_0xdca3('0x12')](_0xdca3('0x14'),_0x66e536);logger['debug'](_0xdca3('0x14'),_0x66e536,JSON[_0xdca3('0xf')](_0x527a38));_0x1e99c9(_0x527a38);})[_0xdca3('0x1d')](function(_0x4145f4){logger['error'](_0xdca3('0x14'),_0x4145f4[_0xdca3('0x11')],_0x66e536);_0x1fd2d9(_0x31e7cb['error'](0x1f4,_0x4145f4[_0xdca3('0x11')]));});});};exports[_0xdca3('0x1e')]=function(_0x593383){var _0x5c76c4=this;return new Promise(function(_0x36743d,_0x40860d){return db['FreshdeskAccount']['find']({'raw':_0x593383[_0xdca3('0x16')]?_0x593383[_0xdca3('0x16')][_0xdca3('0x17')]===undefined?!![]:![]:!![],'where':_0x593383['options']?_0x593383[_0xdca3('0x16')][_0xdca3('0x18')]||null:null,'attributes':_0x593383[_0xdca3('0x16')]?_0x593383[_0xdca3('0x16')][_0xdca3('0x1c')]||null:null,'include':_0x593383[_0xdca3('0x16')]?_0x593383[_0xdca3('0x16')][_0xdca3('0x19')]?_[_0xdca3('0x1a')](_0x593383['options'][_0xdca3('0x19')],function(_0xdb503e){return{'model':db[_0xdb503e['model']],'as':_0xdb503e['as'],'attributes':_0xdb503e[_0xdca3('0x1c')],'include':_0xdb503e['include']?_[_0xdca3('0x1a')](_0xdb503e['include'],function(_0x44efe7){return{'model':db[_0x44efe7[_0xdca3('0x1b')]],'as':_0x44efe7['as'],'attributes':_0x44efe7['attributes'],'include':_0x44efe7[_0xdca3('0x19')]?_['map'](_0x44efe7[_0xdca3('0x19')],function(_0x4f2b3a){return{'model':db[_0x4f2b3a[_0xdca3('0x1b')]],'as':_0x4f2b3a['as'],'attributes':_0x4f2b3a[_0xdca3('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcbe026){logger[_0xdca3('0x12')](_0xdca3('0x1e'),_0x593383);logger['debug'](_0xdca3('0x1e'),_0x593383,JSON[_0xdca3('0xf')](_0xcbe026));_0x36743d(_0xcbe026);})[_0xdca3('0x1d')](function(_0x517b4d){logger['error']('ShowFreshdeskAccount',_0x517b4d['message'],_0x593383);_0x40860d(_0x5c76c4['error'](0x1f4,_0x517b4d[_0xdca3('0x11')]));});});};
\ No newline at end of file