Built motion from commit efa66e19.|2.6.22
[motion2.git] / server / api / intFreshdeskAccount / intFreshdeskAccount.rpc.js
index 51ddfb0..14fcab9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd1b=['info','result','catch','findAll','options','attributes','limit','map','include','model','GetFreshdeskAccount','ShowFreshdeskAccount','find','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','request\x20sent','debug','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message'];(function(_0x3670c5,_0x5a5ee2){var _0x52ab45=function(_0x85d5e1){while(--_0x85d5e1){_0x3670c5['push'](_0x3670c5['shift']());}};_0x52ab45(++_0x5a5ee2);}(_0xcd1b,0x18e));var _0xbcd1=function(_0xf008da,_0x395d94){_0xf008da=_0xf008da-0x0;var _0x2e0b55=_0xcd1b[_0xf008da];return _0x2e0b55;};'use strict';var _=require(_0xbcd1('0x0'));var util=require(_0xbcd1('0x1'));var moment=require('moment');var BPromise=require(_0xbcd1('0x2'));var rs=require(_0xbcd1('0x3'));var fs=require('fs');var Redis=require(_0xbcd1('0x4'));var db=require(_0xbcd1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbcd1('0x6'))(_0xbcd1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbcd1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x187ec1,_0x46d5f8,_0x26f7e5){return new BPromise(function(_0x19d0da,_0x76c75c){return client[_0xbcd1('0x9')](_0x187ec1,_0x26f7e5)[_0xbcd1('0xa')](function(_0x579920){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x46d5f8,_0xbcd1('0xb'));logger[_0xbcd1('0xc')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x46d5f8,_0xbcd1('0xb'),JSON[_0xbcd1('0xd')](_0x579920));if(_0x579920[_0xbcd1('0xe')]){if(_0x579920[_0xbcd1('0xe')][_0xbcd1('0xf')]===0x1f4){logger['error'](_0xbcd1('0x10'),_0x46d5f8,_0x579920[_0xbcd1('0xe')][_0xbcd1('0x11')]);return _0x76c75c(_0x579920[_0xbcd1('0xe')]['message']);}logger[_0xbcd1('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x46d5f8,_0x579920[_0xbcd1('0xe')][_0xbcd1('0x11')]);return _0x19d0da(_0x579920[_0xbcd1('0xe')]['message']);}else{logger[_0xbcd1('0x12')](_0xbcd1('0x10'),_0x46d5f8,'request\x20sent');_0x19d0da(_0x579920[_0xbcd1('0x13')][_0xbcd1('0x11')]);}})[_0xbcd1('0x14')](function(_0x5411c2){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x46d5f8,_0x5411c2);_0x76c75c(_0x5411c2);});});}exports['GetFreshdeskAccount']=function(_0x546e15){var _0x17931e=this;return new Promise(function(_0x407299,_0x34ba97){return db['FreshdeskAccount'][_0xbcd1('0x15')]({'raw':_0x546e15[_0xbcd1('0x16')]?_0x546e15[_0xbcd1('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x546e15[_0xbcd1('0x16')]?_0x546e15[_0xbcd1('0x16')]['where']||null:null,'attributes':_0x546e15[_0xbcd1('0x16')]?_0x546e15[_0xbcd1('0x16')][_0xbcd1('0x17')]||null:null,'limit':_0x546e15[_0xbcd1('0x16')]?_0x546e15[_0xbcd1('0x16')][_0xbcd1('0x18')]||null:null,'include':_0x546e15[_0xbcd1('0x16')]?_0x546e15[_0xbcd1('0x16')]['include']?_[_0xbcd1('0x19')](_0x546e15[_0xbcd1('0x16')][_0xbcd1('0x1a')],function(_0x2b05f6){return{'model':db[_0x2b05f6[_0xbcd1('0x1b')]],'as':_0x2b05f6['as'],'attributes':_0x2b05f6['attributes'],'include':_0x2b05f6[_0xbcd1('0x1a')]?_[_0xbcd1('0x19')](_0x2b05f6[_0xbcd1('0x1a')],function(_0x427f9d){return{'model':db[_0x427f9d[_0xbcd1('0x1b')]],'as':_0x427f9d['as'],'attributes':_0x427f9d[_0xbcd1('0x17')],'include':_0x427f9d['include']?_[_0xbcd1('0x19')](_0x427f9d[_0xbcd1('0x1a')],function(_0x4d743d){return{'model':db[_0x4d743d[_0xbcd1('0x1b')]],'as':_0x4d743d['as'],'attributes':_0x4d743d[_0xbcd1('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e80cb){logger[_0xbcd1('0x12')](_0xbcd1('0x1c'),_0x546e15);logger[_0xbcd1('0xc')](_0xbcd1('0x1c'),_0x546e15,JSON[_0xbcd1('0xd')](_0x5e80cb));_0x407299(_0x5e80cb);})[_0xbcd1('0x14')](function(_0x459868){logger[_0xbcd1('0xe')](_0xbcd1('0x1c'),_0x459868['message'],_0x546e15);_0x34ba97(_0x17931e[_0xbcd1('0xe')](0x1f4,_0x459868[_0xbcd1('0x11')]));});});};exports[_0xbcd1('0x1d')]=function(_0x8c93d){var _0x21dedd=this;return new Promise(function(_0x3c8872,_0x26e295){return db['FreshdeskAccount'][_0xbcd1('0x1e')]({'raw':_0x8c93d['options']?_0x8c93d[_0xbcd1('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x8c93d[_0xbcd1('0x16')]?_0x8c93d['options'][_0xbcd1('0x1f')]||null:null,'attributes':_0x8c93d[_0xbcd1('0x16')]?_0x8c93d[_0xbcd1('0x16')]['attributes']||null:null,'include':_0x8c93d[_0xbcd1('0x16')]?_0x8c93d[_0xbcd1('0x16')][_0xbcd1('0x1a')]?_[_0xbcd1('0x19')](_0x8c93d[_0xbcd1('0x16')][_0xbcd1('0x1a')],function(_0x664296){return{'model':db[_0x664296[_0xbcd1('0x1b')]],'as':_0x664296['as'],'attributes':_0x664296['attributes'],'include':_0x664296['include']?_['map'](_0x664296['include'],function(_0x2dd0d1){return{'model':db[_0x2dd0d1['model']],'as':_0x2dd0d1['as'],'attributes':_0x2dd0d1[_0xbcd1('0x17')],'include':_0x2dd0d1[_0xbcd1('0x1a')]?_[_0xbcd1('0x19')](_0x2dd0d1[_0xbcd1('0x1a')],function(_0x459d43){return{'model':db[_0x459d43['model']],'as':_0x459d43['as'],'attributes':_0x459d43[_0xbcd1('0x17')]};}):[]};}):[]};}):[]:[]})[_0xbcd1('0xa')](function(_0x30f875){logger[_0xbcd1('0x12')]('ShowFreshdeskAccount',_0x8c93d);logger['debug'](_0xbcd1('0x1d'),_0x8c93d,JSON[_0xbcd1('0xd')](_0x30f875));_0x3c8872(_0x30f875);})['catch'](function(_0x41762f){logger[_0xbcd1('0xe')](_0xbcd1('0x1d'),_0x41762f['message'],_0x8c93d);_0x26e295(_0x21dedd[_0xbcd1('0xe')](0x1f4,_0x41762f[_0xbcd1('0x11')]));});});};
\ No newline at end of file
+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