Built motion from commit 25580385.|2.6.2
[motion2.git] / server / api / intZendeskAccount / intZendeskAccount.rpc.js
index 16cc8f0..4b73cf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ff9=['attributes','limit','include','map','model','stringify','ShowZendeskAccount','ZendeskAccount','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetZendeskAccount','findAll','options','raw','where'];(function(_0x41619e,_0x2ead6f){var _0x35f1fc=function(_0x4551a3){while(--_0x4551a3){_0x41619e['push'](_0x41619e['shift']());}};_0x35f1fc(++_0x2ead6f);}(_0x6ff9,0x167));var _0x96ff=function(_0x56fcf6,_0x401b3c){_0x56fcf6=_0x56fcf6-0x0;var _0x2078a7=_0x6ff9[_0x56fcf6];return _0x2078a7;};'use strict';var _=require('lodash');var util=require(_0x96ff('0x0'));var moment=require('moment');var BPromise=require(_0x96ff('0x1'));var rs=require(_0x96ff('0x2'));var fs=require('fs');var Redis=require(_0x96ff('0x3'));var db=require(_0x96ff('0x4'))['db'];var utils=require(_0x96ff('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x96ff('0x6'));var client=jayson[_0x96ff('0x7')][_0x96ff('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33fd43,_0x16e763,_0x4fb40c){return new BPromise(function(_0x3996f2,_0x54b4ce){return client[_0x96ff('0x9')](_0x33fd43,_0x4fb40c)[_0x96ff('0xa')](function(_0x1c8c85){logger['info'](_0x96ff('0xb'),_0x16e763,'request\x20sent');logger[_0x96ff('0xc')](_0x96ff('0xd'),_0x16e763,_0x96ff('0xe'),JSON['stringify'](_0x1c8c85));if(_0x1c8c85[_0x96ff('0xf')]){if(_0x1c8c85[_0x96ff('0xf')][_0x96ff('0x10')]===0x1f4){logger[_0x96ff('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x16e763,_0x1c8c85[_0x96ff('0xf')][_0x96ff('0x11')]);return _0x54b4ce(_0x1c8c85['error'][_0x96ff('0x11')]);}logger[_0x96ff('0xf')](_0x96ff('0xb'),_0x16e763,_0x1c8c85['error'][_0x96ff('0x11')]);return _0x3996f2(_0x1c8c85['error'][_0x96ff('0x11')]);}else{logger[_0x96ff('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x16e763,_0x96ff('0xe'));_0x3996f2(_0x1c8c85[_0x96ff('0x13')]['message']);}})[_0x96ff('0x14')](function(_0xd6b6b5){logger[_0x96ff('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x16e763,_0xd6b6b5);_0x54b4ce(_0xd6b6b5);});});}exports[_0x96ff('0x15')]=function(_0x4c33e7){var _0x82f006=this;return new Promise(function(_0x28a046,_0x27cd45){return db['ZendeskAccount'][_0x96ff('0x16')]({'raw':_0x4c33e7[_0x96ff('0x17')]?_0x4c33e7['options'][_0x96ff('0x18')]===undefined?!![]:![]:!![],'where':_0x4c33e7[_0x96ff('0x17')]?_0x4c33e7[_0x96ff('0x17')][_0x96ff('0x19')]||null:null,'attributes':_0x4c33e7[_0x96ff('0x17')]?_0x4c33e7[_0x96ff('0x17')][_0x96ff('0x1a')]||null:null,'limit':_0x4c33e7[_0x96ff('0x17')]?_0x4c33e7['options'][_0x96ff('0x1b')]||null:null,'include':_0x4c33e7[_0x96ff('0x17')]?_0x4c33e7[_0x96ff('0x17')][_0x96ff('0x1c')]?_[_0x96ff('0x1d')](_0x4c33e7[_0x96ff('0x17')][_0x96ff('0x1c')],function(_0x1a984f){return{'model':db[_0x1a984f[_0x96ff('0x1e')]],'as':_0x1a984f['as'],'attributes':_0x1a984f[_0x96ff('0x1a')],'include':_0x1a984f[_0x96ff('0x1c')]?_[_0x96ff('0x1d')](_0x1a984f[_0x96ff('0x1c')],function(_0x3f5d7a){return{'model':db[_0x3f5d7a[_0x96ff('0x1e')]],'as':_0x3f5d7a['as'],'attributes':_0x3f5d7a[_0x96ff('0x1a')],'include':_0x3f5d7a[_0x96ff('0x1c')]?_[_0x96ff('0x1d')](_0x3f5d7a[_0x96ff('0x1c')],function(_0x5d0da1){return{'model':db[_0x5d0da1[_0x96ff('0x1e')]],'as':_0x5d0da1['as'],'attributes':_0x5d0da1[_0x96ff('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4730aa){logger[_0x96ff('0x12')](_0x96ff('0x15'),_0x4c33e7);logger[_0x96ff('0xc')]('GetZendeskAccount',_0x4c33e7,JSON[_0x96ff('0x1f')](_0x4730aa));_0x28a046(_0x4730aa);})[_0x96ff('0x14')](function(_0x415947){logger[_0x96ff('0xf')]('GetZendeskAccount',_0x415947['message'],_0x4c33e7);_0x27cd45(_0x82f006[_0x96ff('0xf')](0x1f4,_0x415947[_0x96ff('0x11')]));});});};exports[_0x96ff('0x20')]=function(_0x4f044e){var _0x1ee694=this;return new Promise(function(_0x89bda7,_0x2d0b1f){return db[_0x96ff('0x21')][_0x96ff('0x22')]({'raw':_0x4f044e['options']?_0x4f044e[_0x96ff('0x17')][_0x96ff('0x18')]===undefined?!![]:![]:!![],'where':_0x4f044e[_0x96ff('0x17')]?_0x4f044e[_0x96ff('0x17')][_0x96ff('0x19')]||null:null,'attributes':_0x4f044e[_0x96ff('0x17')]?_0x4f044e[_0x96ff('0x17')][_0x96ff('0x1a')]||null:null,'include':_0x4f044e[_0x96ff('0x17')]?_0x4f044e['options'][_0x96ff('0x1c')]?_[_0x96ff('0x1d')](_0x4f044e[_0x96ff('0x17')][_0x96ff('0x1c')],function(_0x1510bc){return{'model':db[_0x1510bc[_0x96ff('0x1e')]],'as':_0x1510bc['as'],'attributes':_0x1510bc[_0x96ff('0x1a')],'include':_0x1510bc[_0x96ff('0x1c')]?_[_0x96ff('0x1d')](_0x1510bc[_0x96ff('0x1c')],function(_0x2ac18e){return{'model':db[_0x2ac18e[_0x96ff('0x1e')]],'as':_0x2ac18e['as'],'attributes':_0x2ac18e[_0x96ff('0x1a')],'include':_0x2ac18e[_0x96ff('0x1c')]?_[_0x96ff('0x1d')](_0x2ac18e['include'],function(_0x5bbc56){return{'model':db[_0x5bbc56[_0x96ff('0x1e')]],'as':_0x5bbc56['as'],'attributes':_0x5bbc56[_0x96ff('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x96ff('0xa')](function(_0x492f79){logger[_0x96ff('0x12')](_0x96ff('0x20'),_0x4f044e);logger[_0x96ff('0xc')](_0x96ff('0x20'),_0x4f044e,JSON['stringify'](_0x492f79));_0x89bda7(_0x492f79);})[_0x96ff('0x14')](function(_0x5bc83b){logger[_0x96ff('0xf')](_0x96ff('0x20'),_0x5bc83b[_0x96ff('0x11')],_0x4f044e);_0x2d0b1f(_0x1ee694['error'](0x1f4,_0x5bc83b['message']));});});};
\ No newline at end of file
+var _0xa7ac=['then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ZendeskAccount','findAll','options','raw','limit','map','include','model','attributes','GetZendeskAccount','find','where','ShowZendeskAccount','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request'];(function(_0x48ac9e,_0x9f4f7){var _0x529bee=function(_0x180516){while(--_0x180516){_0x48ac9e['push'](_0x48ac9e['shift']());}};_0x529bee(++_0x9f4f7);}(_0xa7ac,0xc2));var _0xca7a=function(_0x4f0b4c,_0x40ac12){_0x4f0b4c=_0x4f0b4c-0x0;var _0x49e99a=_0xa7ac[_0x4f0b4c];return _0x49e99a;};'use strict';var _=require(_0xca7a('0x0'));var util=require('util');var moment=require(_0xca7a('0x1'));var BPromise=require(_0xca7a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca7a('0x3'));var db=require(_0xca7a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xca7a('0x5'));var jayson=require(_0xca7a('0x6'));var client=jayson[_0xca7a('0x7')][_0xca7a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3532e1,_0x402ce1,_0x576cda){return new BPromise(function(_0x30e3e7,_0x392e05){return client[_0xca7a('0x9')](_0x3532e1,_0x576cda)[_0xca7a('0xa')](function(_0x1d6180){logger[_0xca7a('0xb')](_0xca7a('0xc'),_0x402ce1,_0xca7a('0xd'));logger[_0xca7a('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x402ce1,_0xca7a('0xd'),JSON[_0xca7a('0xf')](_0x1d6180));if(_0x1d6180[_0xca7a('0x10')]){if(_0x1d6180[_0xca7a('0x10')][_0xca7a('0x11')]===0x1f4){logger[_0xca7a('0x10')](_0xca7a('0xc'),_0x402ce1,_0x1d6180['error']['message']);return _0x392e05(_0x1d6180[_0xca7a('0x10')]['message']);}logger[_0xca7a('0x10')](_0xca7a('0xc'),_0x402ce1,_0x1d6180[_0xca7a('0x10')][_0xca7a('0x12')]);return _0x30e3e7(_0x1d6180[_0xca7a('0x10')][_0xca7a('0x12')]);}else{logger[_0xca7a('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x402ce1,'request\x20sent');_0x30e3e7(_0x1d6180[_0xca7a('0x13')][_0xca7a('0x12')]);}})[_0xca7a('0x14')](function(_0x39bdc2){logger['error'](_0xca7a('0xc'),_0x402ce1,_0x39bdc2);_0x392e05(_0x39bdc2);});});}exports['GetZendeskAccount']=function(_0x1373dc){var _0x19e566=this;return new Promise(function(_0x12d2a4,_0x3c354c){return db[_0xca7a('0x15')][_0xca7a('0x16')]({'raw':_0x1373dc[_0xca7a('0x17')]?_0x1373dc['options'][_0xca7a('0x18')]===undefined?!![]:![]:!![],'where':_0x1373dc['options']?_0x1373dc['options']['where']||null:null,'attributes':_0x1373dc['options']?_0x1373dc[_0xca7a('0x17')]['attributes']||null:null,'limit':_0x1373dc[_0xca7a('0x17')]?_0x1373dc[_0xca7a('0x17')][_0xca7a('0x19')]||null:null,'include':_0x1373dc[_0xca7a('0x17')]?_0x1373dc[_0xca7a('0x17')]['include']?_[_0xca7a('0x1a')](_0x1373dc[_0xca7a('0x17')][_0xca7a('0x1b')],function(_0x458074){return{'model':db[_0x458074[_0xca7a('0x1c')]],'as':_0x458074['as'],'attributes':_0x458074[_0xca7a('0x1d')],'include':_0x458074[_0xca7a('0x1b')]?_[_0xca7a('0x1a')](_0x458074['include'],function(_0x2fae56){return{'model':db[_0x2fae56['model']],'as':_0x2fae56['as'],'attributes':_0x2fae56[_0xca7a('0x1d')],'include':_0x2fae56[_0xca7a('0x1b')]?_['map'](_0x2fae56[_0xca7a('0x1b')],function(_0x320abf){return{'model':db[_0x320abf[_0xca7a('0x1c')]],'as':_0x320abf['as'],'attributes':_0x320abf['attributes']};}):[]};}):[]};}):[]:[]})[_0xca7a('0xa')](function(_0x8758f1){logger[_0xca7a('0xb')](_0xca7a('0x1e'),_0x1373dc);logger['debug'](_0xca7a('0x1e'),_0x1373dc,JSON[_0xca7a('0xf')](_0x8758f1));_0x12d2a4(_0x8758f1);})[_0xca7a('0x14')](function(_0x2be5f2){logger['error'](_0xca7a('0x1e'),_0x2be5f2[_0xca7a('0x12')],_0x1373dc);_0x3c354c(_0x19e566[_0xca7a('0x10')](0x1f4,_0x2be5f2[_0xca7a('0x12')]));});});};exports['ShowZendeskAccount']=function(_0x483dca){var _0x511ba3=this;return new Promise(function(_0x5917dc,_0x5320e4){return db['ZendeskAccount'][_0xca7a('0x1f')]({'raw':_0x483dca[_0xca7a('0x17')]?_0x483dca[_0xca7a('0x17')][_0xca7a('0x18')]===undefined?!![]:![]:!![],'where':_0x483dca['options']?_0x483dca['options'][_0xca7a('0x20')]||null:null,'attributes':_0x483dca['options']?_0x483dca['options'][_0xca7a('0x1d')]||null:null,'include':_0x483dca[_0xca7a('0x17')]?_0x483dca['options'][_0xca7a('0x1b')]?_[_0xca7a('0x1a')](_0x483dca['options'][_0xca7a('0x1b')],function(_0x2d9cce){return{'model':db[_0x2d9cce[_0xca7a('0x1c')]],'as':_0x2d9cce['as'],'attributes':_0x2d9cce[_0xca7a('0x1d')],'include':_0x2d9cce[_0xca7a('0x1b')]?_[_0xca7a('0x1a')](_0x2d9cce[_0xca7a('0x1b')],function(_0x3b9f5c){return{'model':db[_0x3b9f5c[_0xca7a('0x1c')]],'as':_0x3b9f5c['as'],'attributes':_0x3b9f5c[_0xca7a('0x1d')],'include':_0x3b9f5c[_0xca7a('0x1b')]?_[_0xca7a('0x1a')](_0x3b9f5c[_0xca7a('0x1b')],function(_0x1c4995){return{'model':db[_0x1c4995[_0xca7a('0x1c')]],'as':_0x1c4995['as'],'attributes':_0x1c4995[_0xca7a('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x28b60d){logger[_0xca7a('0xb')](_0xca7a('0x21'),_0x483dca);logger['debug'](_0xca7a('0x21'),_0x483dca,JSON[_0xca7a('0xf')](_0x28b60d));_0x5917dc(_0x28b60d);})[_0xca7a('0x14')](function(_0x92663e){logger[_0xca7a('0x10')](_0xca7a('0x21'),_0x92663e[_0xca7a('0x12')],_0x483dca);_0x5320e4(_0x511ba3[_0xca7a('0x10')](0x1f4,_0x92663e[_0xca7a('0x12')]));});});};
\ No newline at end of file