Built motion from commit e1760111.|2.6.18
[motion2.git] / server / api / intZendeskAccount / intZendeskAccount.rpc.js
index 8665462..747ef34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc409=['debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','then','ShowZendeskAccount','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info'];(function(_0x529d0e,_0x58ff12){var _0x58ef95=function(_0x2fc2b1){while(--_0x2fc2b1){_0x529d0e['push'](_0x529d0e['shift']());}};_0x58ef95(++_0x58ff12);}(_0xc409,0xc6));var _0x9c40=function(_0x371126,_0x9aa557){_0x371126=_0x371126-0x0;var _0x53b8b6=_0xc409[_0x371126];return _0x53b8b6;};'use strict';var _=require(_0x9c40('0x0'));var util=require(_0x9c40('0x1'));var moment=require(_0x9c40('0x2'));var BPromise=require(_0x9c40('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c40('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c40('0x5'));var logger=require(_0x9c40('0x6'))(_0x9c40('0x7'));var config=require(_0x9c40('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9c40('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x211744,_0x20f7ea,_0x16bb9d){return new BPromise(function(_0x47b333,_0x8b7d1){return client[_0x9c40('0xa')](_0x211744,_0x16bb9d)['then'](function(_0x2f7752){logger[_0x9c40('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x20f7ea,'request\x20sent');logger[_0x9c40('0xc')](_0x9c40('0xd'),_0x20f7ea,_0x9c40('0xe'),JSON[_0x9c40('0xf')](_0x2f7752));if(_0x2f7752['error']){if(_0x2f7752[_0x9c40('0x10')][_0x9c40('0x11')]===0x1f4){logger[_0x9c40('0x10')](_0x9c40('0x12'),_0x20f7ea,_0x2f7752['error'][_0x9c40('0x13')]);return _0x8b7d1(_0x2f7752['error'][_0x9c40('0x13')]);}logger[_0x9c40('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x20f7ea,_0x2f7752[_0x9c40('0x10')][_0x9c40('0x13')]);return _0x47b333(_0x2f7752[_0x9c40('0x10')][_0x9c40('0x13')]);}else{logger[_0x9c40('0xb')](_0x9c40('0x12'),_0x20f7ea,_0x9c40('0xe'));_0x47b333(_0x2f7752[_0x9c40('0x14')][_0x9c40('0x13')]);}})[_0x9c40('0x15')](function(_0x3d6ebe){logger[_0x9c40('0x10')](_0x9c40('0x12'),_0x20f7ea,_0x3d6ebe);_0x8b7d1(_0x3d6ebe);});});}exports[_0x9c40('0x16')]=function(_0x3a69e5){var _0x3771bf=this;return new Promise(function(_0x3ff63a,_0x5dc779){return db[_0x9c40('0x17')][_0x9c40('0x18')]({'raw':_0x3a69e5[_0x9c40('0x19')]?_0x3a69e5[_0x9c40('0x19')][_0x9c40('0x1a')]===undefined?!![]:![]:!![],'where':_0x3a69e5[_0x9c40('0x19')]?_0x3a69e5['options'][_0x9c40('0x1b')]||null:null,'attributes':_0x3a69e5[_0x9c40('0x19')]?_0x3a69e5[_0x9c40('0x19')]['attributes']||null:null,'limit':_0x3a69e5[_0x9c40('0x19')]?_0x3a69e5[_0x9c40('0x19')][_0x9c40('0x1c')]||null:null,'include':_0x3a69e5['options']?_0x3a69e5[_0x9c40('0x19')][_0x9c40('0x1d')]?_[_0x9c40('0x1e')](_0x3a69e5[_0x9c40('0x19')][_0x9c40('0x1d')],function(_0x30a69a){return{'model':db[_0x30a69a[_0x9c40('0x1f')]],'as':_0x30a69a['as'],'attributes':_0x30a69a[_0x9c40('0x20')],'include':_0x30a69a[_0x9c40('0x1d')]?_[_0x9c40('0x1e')](_0x30a69a[_0x9c40('0x1d')],function(_0x377ebc){return{'model':db[_0x377ebc[_0x9c40('0x1f')]],'as':_0x377ebc['as'],'attributes':_0x377ebc[_0x9c40('0x20')],'include':_0x377ebc[_0x9c40('0x1d')]?_['map'](_0x377ebc[_0x9c40('0x1d')],function(_0x477555){return{'model':db[_0x477555[_0x9c40('0x1f')]],'as':_0x477555['as'],'attributes':_0x477555[_0x9c40('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9c40('0x21')](function(_0x504ff1){logger[_0x9c40('0xb')](_0x9c40('0x16'),_0x3a69e5);logger[_0x9c40('0xc')](_0x9c40('0x16'),_0x3a69e5,JSON[_0x9c40('0xf')](_0x504ff1));_0x3ff63a(_0x504ff1);})[_0x9c40('0x15')](function(_0x2666f3){logger[_0x9c40('0x10')](_0x9c40('0x16'),_0x2666f3['message'],_0x3a69e5);_0x5dc779(_0x3771bf[_0x9c40('0x10')](0x1f4,_0x2666f3[_0x9c40('0x13')]));});});};exports[_0x9c40('0x22')]=function(_0x47cba0){var _0x4c5086=this;return new Promise(function(_0x42b9a3,_0x1e74dc){return db['ZendeskAccount']['find']({'raw':_0x47cba0[_0x9c40('0x19')]?_0x47cba0[_0x9c40('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x47cba0['options']?_0x47cba0[_0x9c40('0x19')]['where']||null:null,'attributes':_0x47cba0['options']?_0x47cba0[_0x9c40('0x19')]['attributes']||null:null,'include':_0x47cba0['options']?_0x47cba0['options'][_0x9c40('0x1d')]?_[_0x9c40('0x1e')](_0x47cba0['options'][_0x9c40('0x1d')],function(_0xb51884){return{'model':db[_0xb51884[_0x9c40('0x1f')]],'as':_0xb51884['as'],'attributes':_0xb51884['attributes'],'include':_0xb51884[_0x9c40('0x1d')]?_[_0x9c40('0x1e')](_0xb51884['include'],function(_0x4290d9){return{'model':db[_0x4290d9[_0x9c40('0x1f')]],'as':_0x4290d9['as'],'attributes':_0x4290d9[_0x9c40('0x20')],'include':_0x4290d9['include']?_[_0x9c40('0x1e')](_0x4290d9[_0x9c40('0x1d')],function(_0x106bf8){return{'model':db[_0x106bf8[_0x9c40('0x1f')]],'as':_0x106bf8['as'],'attributes':_0x106bf8[_0x9c40('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9c40('0x21')](function(_0x312516){logger[_0x9c40('0xb')]('ShowZendeskAccount',_0x47cba0);logger['debug']('ShowZendeskAccount',_0x47cba0,JSON[_0x9c40('0xf')](_0x312516));_0x42b9a3(_0x312516);})[_0x9c40('0x15')](function(_0x47a48e){logger[_0x9c40('0x10')](_0x9c40('0x22'),_0x47a48e['message'],_0x47cba0);_0x1e74dc(_0x4c5086[_0x9c40('0x10')](0x1f4,_0x47a48e['message']));});});};
\ No newline at end of file
+var _0x2421=['map','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','model','include'];(function(_0x312c7d,_0x5cdb5a){var _0x1d9635=function(_0x4a3078){while(--_0x4a3078){_0x312c7d['push'](_0x312c7d['shift']());}};_0x1d9635(++_0x5cdb5a);}(_0x2421,0x12b));var _0x1242=function(_0x4bf50f,_0x578e28){_0x4bf50f=_0x4bf50f-0x0;var _0x559a54=_0x2421[_0x4bf50f];return _0x559a54;};'use strict';var _=require(_0x1242('0x0'));var util=require(_0x1242('0x1'));var moment=require(_0x1242('0x2'));var BPromise=require(_0x1242('0x3'));var rs=require(_0x1242('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1242('0x5'))['db'];var utils=require(_0x1242('0x6'));var logger=require(_0x1242('0x7'))(_0x1242('0x8'));var config=require(_0x1242('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1242('0xa')][_0x1242('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11d73a,_0xe57b24,_0x40e598){return new BPromise(function(_0x5c5b5a,_0x320f6a){return client[_0x1242('0xc')](_0x11d73a,_0x40e598)[_0x1242('0xd')](function(_0x974707){logger[_0x1242('0xe')](_0x1242('0xf'),_0xe57b24,_0x1242('0x10'));logger[_0x1242('0x11')](_0x1242('0x12'),_0xe57b24,_0x1242('0x10'),JSON[_0x1242('0x13')](_0x974707));if(_0x974707[_0x1242('0x14')]){if(_0x974707[_0x1242('0x14')][_0x1242('0x15')]===0x1f4){logger['error'](_0x1242('0xf'),_0xe57b24,_0x974707[_0x1242('0x14')][_0x1242('0x16')]);return _0x320f6a(_0x974707[_0x1242('0x14')]['message']);}logger[_0x1242('0x14')](_0x1242('0xf'),_0xe57b24,_0x974707['error']['message']);return _0x5c5b5a(_0x974707['error']['message']);}else{logger[_0x1242('0xe')](_0x1242('0xf'),_0xe57b24,_0x1242('0x10'));_0x5c5b5a(_0x974707['result'][_0x1242('0x16')]);}})[_0x1242('0x17')](function(_0x562f79){logger[_0x1242('0x14')]('ZendeskAccount,\x20%s,\x20%s',_0xe57b24,_0x562f79);_0x320f6a(_0x562f79);});});}exports[_0x1242('0x18')]=function(_0x147fd7){var _0x175e6f=this;return new Promise(function(_0x33ee3f,_0x2e2077){return db[_0x1242('0x19')][_0x1242('0x1a')]({'raw':_0x147fd7[_0x1242('0x1b')]?_0x147fd7[_0x1242('0x1b')][_0x1242('0x1c')]===undefined?!![]:![]:!![],'where':_0x147fd7[_0x1242('0x1b')]?_0x147fd7[_0x1242('0x1b')][_0x1242('0x1d')]||null:null,'attributes':_0x147fd7[_0x1242('0x1b')]?_0x147fd7[_0x1242('0x1b')][_0x1242('0x1e')]||null:null,'limit':_0x147fd7[_0x1242('0x1b')]?_0x147fd7['options'][_0x1242('0x1f')]||null:null,'include':_0x147fd7[_0x1242('0x1b')]?_0x147fd7[_0x1242('0x1b')]['include']?_['map'](_0x147fd7[_0x1242('0x1b')]['include'],function(_0x223304){return{'model':db[_0x223304[_0x1242('0x20')]],'as':_0x223304['as'],'attributes':_0x223304[_0x1242('0x1e')],'include':_0x223304[_0x1242('0x21')]?_['map'](_0x223304[_0x1242('0x21')],function(_0x5d3ddb){return{'model':db[_0x5d3ddb[_0x1242('0x20')]],'as':_0x5d3ddb['as'],'attributes':_0x5d3ddb['attributes'],'include':_0x5d3ddb[_0x1242('0x21')]?_[_0x1242('0x22')](_0x5d3ddb[_0x1242('0x21')],function(_0x481add){return{'model':db[_0x481add[_0x1242('0x20')]],'as':_0x481add['as'],'attributes':_0x481add[_0x1242('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1242('0xd')](function(_0x25ccbf){logger[_0x1242('0xe')](_0x1242('0x18'),_0x147fd7);logger['debug'](_0x1242('0x18'),_0x147fd7,JSON['stringify'](_0x25ccbf));_0x33ee3f(_0x25ccbf);})[_0x1242('0x17')](function(_0x4bd388){logger[_0x1242('0x14')](_0x1242('0x18'),_0x4bd388[_0x1242('0x16')],_0x147fd7);_0x2e2077(_0x175e6f[_0x1242('0x14')](0x1f4,_0x4bd388[_0x1242('0x16')]));});});};exports[_0x1242('0x23')]=function(_0x180f42){var _0xeee04a=this;return new Promise(function(_0x2cf4ff,_0x44c9be){return db[_0x1242('0x19')][_0x1242('0x24')]({'raw':_0x180f42['options']?_0x180f42[_0x1242('0x1b')][_0x1242('0x1c')]===undefined?!![]:![]:!![],'where':_0x180f42['options']?_0x180f42[_0x1242('0x1b')][_0x1242('0x1d')]||null:null,'attributes':_0x180f42[_0x1242('0x1b')]?_0x180f42[_0x1242('0x1b')][_0x1242('0x1e')]||null:null,'include':_0x180f42[_0x1242('0x1b')]?_0x180f42['options'][_0x1242('0x21')]?_[_0x1242('0x22')](_0x180f42['options'][_0x1242('0x21')],function(_0x17bdef){return{'model':db[_0x17bdef[_0x1242('0x20')]],'as':_0x17bdef['as'],'attributes':_0x17bdef[_0x1242('0x1e')],'include':_0x17bdef[_0x1242('0x21')]?_[_0x1242('0x22')](_0x17bdef[_0x1242('0x21')],function(_0x3a59bb){return{'model':db[_0x3a59bb['model']],'as':_0x3a59bb['as'],'attributes':_0x3a59bb[_0x1242('0x1e')],'include':_0x3a59bb[_0x1242('0x21')]?_[_0x1242('0x22')](_0x3a59bb[_0x1242('0x21')],function(_0xcca169){return{'model':db[_0xcca169[_0x1242('0x20')]],'as':_0xcca169['as'],'attributes':_0xcca169[_0x1242('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1242('0xd')](function(_0x574f6d){logger[_0x1242('0xe')](_0x1242('0x23'),_0x180f42);logger[_0x1242('0x11')]('ShowZendeskAccount',_0x180f42,JSON[_0x1242('0x13')](_0x574f6d));_0x2cf4ff(_0x574f6d);})[_0x1242('0x17')](function(_0x3a1c11){logger[_0x1242('0x14')](_0x1242('0x23'),_0x3a1c11[_0x1242('0x16')],_0x180f42);_0x44c9be(_0xeee04a['error'](0x1f4,_0x3a1c11[_0x1242('0x16')]));});});};
\ No newline at end of file