Built motion from commit 3e059bc2.|2.5.32
[motion2.git] / server / api / intZendeskAccount / intZendeskAccount.rpc.js
index c999c28..1c6277e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['code','error','message','result','catch','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model','GetZendeskAccount','stringify','ShowZendeskAccount','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetZendeskAccount']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowZendeskAccount',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});};
\ No newline at end of file
+var _0xbebd=['../../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','error','code','message','GetZendeskAccount','ZendeskAccount','raw','options','where','attributes','limit','include','model','map','stringify','ShowZendeskAccount','find','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0xbebd,0x1ab));var _0xdbeb=function(_0x2544a3,_0x58882a){_0x2544a3=_0x2544a3-0x0;var _0x59efa6=_0xbebd[_0x2544a3];return _0x59efa6;};'use strict';var _=require(_0xdbeb('0x0'));var util=require(_0xdbeb('0x1'));var moment=require('moment');var BPromise=require(_0xdbeb('0x2'));var rs=require(_0xdbeb('0x3'));var fs=require('fs');var Redis=require(_0xdbeb('0x4'));var db=require(_0xdbeb('0x5'))['db'];var utils=require(_0xdbeb('0x6'));var logger=require(_0xdbeb('0x7'))(_0xdbeb('0x8'));var config=require(_0xdbeb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdbeb('0xa')][_0xdbeb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xab6610,_0x985480,_0x494e71){return new BPromise(function(_0x2980ca,_0x149774){return client[_0xdbeb('0xc')](_0xab6610,_0x494e71)[_0xdbeb('0xd')](function(_0x5bbf4a){logger[_0xdbeb('0xe')](_0xdbeb('0xf'),_0x985480,_0xdbeb('0x10'));logger[_0xdbeb('0x11')](_0xdbeb('0x12'),_0x985480,'request\x20sent',JSON['stringify'](_0x5bbf4a));if(_0x5bbf4a[_0xdbeb('0x13')]){if(_0x5bbf4a[_0xdbeb('0x13')][_0xdbeb('0x14')]===0x1f4){logger['error'](_0xdbeb('0xf'),_0x985480,_0x5bbf4a[_0xdbeb('0x13')][_0xdbeb('0x15')]);return _0x149774(_0x5bbf4a['error'][_0xdbeb('0x15')]);}logger['error'](_0xdbeb('0xf'),_0x985480,_0x5bbf4a[_0xdbeb('0x13')][_0xdbeb('0x15')]);return _0x2980ca(_0x5bbf4a['error'][_0xdbeb('0x15')]);}else{logger['info'](_0xdbeb('0xf'),_0x985480,_0xdbeb('0x10'));_0x2980ca(_0x5bbf4a['result'][_0xdbeb('0x15')]);}})['catch'](function(_0x46b13e){logger[_0xdbeb('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x985480,_0x46b13e);_0x149774(_0x46b13e);});});}exports[_0xdbeb('0x16')]=function(_0x4a0f17){var _0x4d3c5b=this;return new Promise(function(_0x2a9960,_0x4d0d6c){return db[_0xdbeb('0x17')]['findAll']({'raw':_0x4a0f17['options']?_0x4a0f17['options'][_0xdbeb('0x18')]===undefined?!![]:![]:!![],'where':_0x4a0f17[_0xdbeb('0x19')]?_0x4a0f17['options'][_0xdbeb('0x1a')]||null:null,'attributes':_0x4a0f17[_0xdbeb('0x19')]?_0x4a0f17[_0xdbeb('0x19')][_0xdbeb('0x1b')]||null:null,'limit':_0x4a0f17[_0xdbeb('0x19')]?_0x4a0f17[_0xdbeb('0x19')][_0xdbeb('0x1c')]||null:null,'include':_0x4a0f17[_0xdbeb('0x19')]?_0x4a0f17[_0xdbeb('0x19')][_0xdbeb('0x1d')]?_['map'](_0x4a0f17['options'][_0xdbeb('0x1d')],function(_0x16200c){return{'model':db[_0x16200c[_0xdbeb('0x1e')]],'as':_0x16200c['as'],'attributes':_0x16200c[_0xdbeb('0x1b')],'include':_0x16200c['include']?_['map'](_0x16200c[_0xdbeb('0x1d')],function(_0x30cbba){return{'model':db[_0x30cbba[_0xdbeb('0x1e')]],'as':_0x30cbba['as'],'attributes':_0x30cbba['attributes'],'include':_0x30cbba['include']?_[_0xdbeb('0x1f')](_0x30cbba[_0xdbeb('0x1d')],function(_0x27787d){return{'model':db[_0x27787d[_0xdbeb('0x1e')]],'as':_0x27787d['as'],'attributes':_0x27787d[_0xdbeb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdbeb('0xd')](function(_0x1b899b){logger[_0xdbeb('0xe')]('GetZendeskAccount',_0x4a0f17);logger['debug'](_0xdbeb('0x16'),_0x4a0f17,JSON[_0xdbeb('0x20')](_0x1b899b));_0x2a9960(_0x1b899b);})['catch'](function(_0x90fc10){logger['error']('GetZendeskAccount',_0x90fc10['message'],_0x4a0f17);_0x4d0d6c(_0x4d3c5b[_0xdbeb('0x13')](0x1f4,_0x90fc10[_0xdbeb('0x15')]));});});};exports[_0xdbeb('0x21')]=function(_0x1ce80f){var _0x2330b4=this;return new Promise(function(_0x1fb566,_0x2809c0){return db[_0xdbeb('0x17')][_0xdbeb('0x22')]({'raw':_0x1ce80f[_0xdbeb('0x19')]?_0x1ce80f[_0xdbeb('0x19')][_0xdbeb('0x18')]===undefined?!![]:![]:!![],'where':_0x1ce80f[_0xdbeb('0x19')]?_0x1ce80f[_0xdbeb('0x19')][_0xdbeb('0x1a')]||null:null,'attributes':_0x1ce80f[_0xdbeb('0x19')]?_0x1ce80f[_0xdbeb('0x19')][_0xdbeb('0x1b')]||null:null,'include':_0x1ce80f['options']?_0x1ce80f['options'][_0xdbeb('0x1d')]?_['map'](_0x1ce80f['options'][_0xdbeb('0x1d')],function(_0x27808d){return{'model':db[_0x27808d['model']],'as':_0x27808d['as'],'attributes':_0x27808d[_0xdbeb('0x1b')],'include':_0x27808d[_0xdbeb('0x1d')]?_['map'](_0x27808d[_0xdbeb('0x1d')],function(_0x2ae49d){return{'model':db[_0x2ae49d['model']],'as':_0x2ae49d['as'],'attributes':_0x2ae49d['attributes'],'include':_0x2ae49d[_0xdbeb('0x1d')]?_[_0xdbeb('0x1f')](_0x2ae49d['include'],function(_0x4f6dc6){return{'model':db[_0x4f6dc6[_0xdbeb('0x1e')]],'as':_0x4f6dc6['as'],'attributes':_0x4f6dc6[_0xdbeb('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18ec3d){logger[_0xdbeb('0xe')](_0xdbeb('0x21'),_0x1ce80f);logger[_0xdbeb('0x11')](_0xdbeb('0x21'),_0x1ce80f,JSON[_0xdbeb('0x20')](_0x18ec3d));_0x1fb566(_0x18ec3d);})[_0xdbeb('0x23')](function(_0x2aff2c){logger[_0xdbeb('0x13')](_0xdbeb('0x21'),_0x2aff2c[_0xdbeb('0x15')],_0x1ce80f);_0x2809c0(_0x2330b4[_0xdbeb('0x13')](0x1f4,_0x2aff2c[_0xdbeb('0x15')]));});});};
\ No newline at end of file