Built motion from commit 639a1a7f.|2.6.19
[motion2.git] / server / api / intZendeskAccount / intZendeskAccount.rpc.js
index a8a0174..ac060a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','model','map','ShowZendeskAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x75267d,_0x5d286c){var _0x21ccec=function(_0x1a3c1f){while(--_0x1a3c1f){_0x75267d['push'](_0x75267d['shift']());}};_0x21ccec(++_0x5d286c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}exports[_0x0baf('0x16')]=function(_0x53c338){var _0x63c820=this;return new Promise(function(_0xfbecec,_0x1ef0e5){return db[_0x0baf('0x17')][_0x0baf('0x18')]({'raw':_0x53c338[_0x0baf('0x19')]?_0x53c338['options']['raw']===undefined?!![]:![]:!![],'where':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'limit':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1c')]||null:null,'include':_0x53c338[_0x0baf('0x19')]?_0x53c338['options'][_0x0baf('0x1d')]?_['map'](_0x53c338[_0x0baf('0x19')]['include'],function(_0x4de74c){return{'model':db[_0x4de74c[_0x0baf('0x1e')]],'as':_0x4de74c['as'],'attributes':_0x4de74c['attributes'],'include':_0x4de74c['include']?_[_0x0baf('0x1f')](_0x4de74c[_0x0baf('0x1d')],function(_0x34e264){return{'model':db[_0x34e264[_0x0baf('0x1e')]],'as':_0x34e264['as'],'attributes':_0x34e264[_0x0baf('0x1b')],'include':_0x34e264['include']?_[_0x0baf('0x1f')](_0x34e264[_0x0baf('0x1d')],function(_0x1ca35a){return{'model':db[_0x1ca35a[_0x0baf('0x1e')]],'as':_0x1ca35a['as'],'attributes':_0x1ca35a[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x453525){logger['info'](_0x0baf('0x16'),_0x53c338);logger[_0x0baf('0x10')](_0x0baf('0x16'),_0x53c338,JSON[_0x0baf('0x12')](_0x453525));_0xfbecec(_0x453525);})['catch'](function(_0x29dbdf){logger[_0x0baf('0x13')]('GetZendeskAccount',_0x29dbdf[_0x0baf('0x14')],_0x53c338);_0x1ef0e5(_0x63c820[_0x0baf('0x13')](0x1f4,_0x29dbdf[_0x0baf('0x14')]));});});};exports[_0x0baf('0x20')]=function(_0xd14f0f){var _0x366924=this;return new Promise(function(_0x213a6a,_0x57476f){return db[_0x0baf('0x17')][_0x0baf('0x21')]({'raw':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x22')]===undefined?!![]:![]:!![],'where':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'include':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1d')]?_['map'](_0xd14f0f[_0x0baf('0x19')]['include'],function(_0x1aa474){return{'model':db[_0x1aa474[_0x0baf('0x1e')]],'as':_0x1aa474['as'],'attributes':_0x1aa474[_0x0baf('0x1b')],'include':_0x1aa474[_0x0baf('0x1d')]?_['map'](_0x1aa474[_0x0baf('0x1d')],function(_0x1d6575){return{'model':db[_0x1d6575['model']],'as':_0x1d6575['as'],'attributes':_0x1d6575[_0x0baf('0x1b')],'include':_0x1d6575[_0x0baf('0x1d')]?_[_0x0baf('0x1f')](_0x1d6575[_0x0baf('0x1d')],function(_0x1f60bd){return{'model':db[_0x1f60bd[_0x0baf('0x1e')]],'as':_0x1f60bd['as'],'attributes':_0x1f60bd[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x4aa6ed){logger[_0x0baf('0xd')](_0x0baf('0x20'),_0xd14f0f);logger['debug'](_0x0baf('0x20'),_0xd14f0f,JSON['stringify'](_0x4aa6ed));_0x213a6a(_0x4aa6ed);})['catch'](function(_0x11bc49){logger[_0x0baf('0x13')]('ShowZendeskAccount',_0x11bc49['message'],_0xd14f0f);_0x57476f(_0x366924[_0x0baf('0x13')](0x1f4,_0x11bc49[_0x0baf('0x14')]));});});};
\ No newline at end of file
+var _0xcda9=['stringify','error','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','find','ShowZendeskAccount','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xa3e1ad,_0x2a49f6){var _0x45f2ca=function(_0x388914){while(--_0x388914){_0xa3e1ad['push'](_0xa3e1ad['shift']());}};_0x45f2ca(++_0x2a49f6);}(_0xcda9,0xb2));var _0x9cda=function(_0x543d49,_0xc31591){_0x543d49=_0x543d49-0x0;var _0x177b78=_0xcda9[_0x543d49];return _0x177b78;};'use strict';var _=require('lodash');var util=require(_0x9cda('0x0'));var moment=require('moment');var BPromise=require(_0x9cda('0x1'));var rs=require(_0x9cda('0x2'));var fs=require('fs');var Redis=require(_0x9cda('0x3'));var db=require(_0x9cda('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9cda('0x5'));var jayson=require(_0x9cda('0x6'));var client=jayson[_0x9cda('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed842,_0x39d5df,_0x49be89){return new BPromise(function(_0x494045,_0x36345c){return client[_0x9cda('0x8')](_0x4ed842,_0x49be89)['then'](function(_0x58105d){logger[_0x9cda('0x9')](_0x9cda('0xa'),_0x39d5df,'request\x20sent');logger[_0x9cda('0xb')](_0x9cda('0xc'),_0x39d5df,_0x9cda('0xd'),JSON[_0x9cda('0xe')](_0x58105d));if(_0x58105d['error']){if(_0x58105d[_0x9cda('0xf')]['code']===0x1f4){logger[_0x9cda('0xf')](_0x9cda('0xa'),_0x39d5df,_0x58105d[_0x9cda('0xf')][_0x9cda('0x10')]);return _0x36345c(_0x58105d['error'][_0x9cda('0x10')]);}logger['error'](_0x9cda('0xa'),_0x39d5df,_0x58105d['error']['message']);return _0x494045(_0x58105d[_0x9cda('0xf')][_0x9cda('0x10')]);}else{logger[_0x9cda('0x9')]('ZendeskAccount,\x20%s,\x20%s',_0x39d5df,'request\x20sent');_0x494045(_0x58105d['result'][_0x9cda('0x10')]);}})[_0x9cda('0x11')](function(_0x58b05c){logger[_0x9cda('0xf')](_0x9cda('0xa'),_0x39d5df,_0x58b05c);_0x36345c(_0x58b05c);});});}exports[_0x9cda('0x12')]=function(_0x163fda){var _0x47fd3d=this;return new Promise(function(_0x5b36f3,_0x32ce6c){return db[_0x9cda('0x13')][_0x9cda('0x14')]({'raw':_0x163fda['options']?_0x163fda[_0x9cda('0x15')][_0x9cda('0x16')]===undefined?!![]:![]:!![],'where':_0x163fda[_0x9cda('0x15')]?_0x163fda[_0x9cda('0x15')][_0x9cda('0x17')]||null:null,'attributes':_0x163fda[_0x9cda('0x15')]?_0x163fda[_0x9cda('0x15')][_0x9cda('0x18')]||null:null,'limit':_0x163fda[_0x9cda('0x15')]?_0x163fda['options'][_0x9cda('0x19')]||null:null,'include':_0x163fda[_0x9cda('0x15')]?_0x163fda[_0x9cda('0x15')][_0x9cda('0x1a')]?_[_0x9cda('0x1b')](_0x163fda['options'][_0x9cda('0x1a')],function(_0x1a263b){return{'model':db[_0x1a263b[_0x9cda('0x1c')]],'as':_0x1a263b['as'],'attributes':_0x1a263b[_0x9cda('0x18')],'include':_0x1a263b['include']?_[_0x9cda('0x1b')](_0x1a263b[_0x9cda('0x1a')],function(_0x45557c){return{'model':db[_0x45557c['model']],'as':_0x45557c['as'],'attributes':_0x45557c[_0x9cda('0x18')],'include':_0x45557c[_0x9cda('0x1a')]?_[_0x9cda('0x1b')](_0x45557c[_0x9cda('0x1a')],function(_0x462d6e){return{'model':db[_0x462d6e[_0x9cda('0x1c')]],'as':_0x462d6e['as'],'attributes':_0x462d6e[_0x9cda('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9cda('0x1d')](function(_0x34160e){logger[_0x9cda('0x9')](_0x9cda('0x12'),_0x163fda);logger[_0x9cda('0xb')]('GetZendeskAccount',_0x163fda,JSON[_0x9cda('0xe')](_0x34160e));_0x5b36f3(_0x34160e);})[_0x9cda('0x11')](function(_0x526b58){logger['error'](_0x9cda('0x12'),_0x526b58[_0x9cda('0x10')],_0x163fda);_0x32ce6c(_0x47fd3d[_0x9cda('0xf')](0x1f4,_0x526b58[_0x9cda('0x10')]));});});};exports['ShowZendeskAccount']=function(_0x281746){var _0x58edd5=this;return new Promise(function(_0x15dccb,_0xbaf349){return db[_0x9cda('0x13')][_0x9cda('0x1e')]({'raw':_0x281746['options']?_0x281746[_0x9cda('0x15')][_0x9cda('0x16')]===undefined?!![]:![]:!![],'where':_0x281746['options']?_0x281746[_0x9cda('0x15')][_0x9cda('0x17')]||null:null,'attributes':_0x281746['options']?_0x281746[_0x9cda('0x15')][_0x9cda('0x18')]||null:null,'include':_0x281746['options']?_0x281746[_0x9cda('0x15')][_0x9cda('0x1a')]?_[_0x9cda('0x1b')](_0x281746[_0x9cda('0x15')]['include'],function(_0x2ec5ba){return{'model':db[_0x2ec5ba[_0x9cda('0x1c')]],'as':_0x2ec5ba['as'],'attributes':_0x2ec5ba[_0x9cda('0x18')],'include':_0x2ec5ba[_0x9cda('0x1a')]?_[_0x9cda('0x1b')](_0x2ec5ba[_0x9cda('0x1a')],function(_0x232200){return{'model':db[_0x232200[_0x9cda('0x1c')]],'as':_0x232200['as'],'attributes':_0x232200['attributes'],'include':_0x232200[_0x9cda('0x1a')]?_['map'](_0x232200[_0x9cda('0x1a')],function(_0x1f10f1){return{'model':db[_0x1f10f1['model']],'as':_0x1f10f1['as'],'attributes':_0x1f10f1[_0x9cda('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10407f){logger[_0x9cda('0x9')](_0x9cda('0x1f'),_0x281746);logger['debug']('ShowZendeskAccount',_0x281746,JSON[_0x9cda('0xe')](_0x10407f));_0x15dccb(_0x10407f);})[_0x9cda('0x11')](function(_0x28d80d){logger[_0x9cda('0xf')](_0x9cda('0x1f'),_0x28d80d['message'],_0x281746);_0xbaf349(_0x58edd5[_0x9cda('0xf')](0x1f4,_0x28d80d['message']));});});};
\ No newline at end of file