Built motion from commit b0a9a629.|2.6.33
[motion2.git] / server / api / intFreshdeskAccount / intFreshdeskAccount.rpc.js
index cab7aaa..64b37c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4134=['message','FreshdeskAccount,\x20%s,\x20%s','result','catch','FreshdeskAccount','findAll','options','raw','attributes','limit','include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','where','then','lodash','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x17336a,_0x14b0c0){var _0x2b71d5=function(_0x462d1a){while(--_0x462d1a){_0x17336a['push'](_0x17336a['shift']());}};_0x2b71d5(++_0x14b0c0);}(_0x4134,0x89));var _0x4413=function(_0x5ec84f,_0x11877d){_0x5ec84f=_0x5ec84f-0x0;var _0x2dc82c=_0x4134[_0x5ec84f];return _0x2dc82c;};'use strict';var _=require(_0x4413('0x0'));var util=require('util');var moment=require(_0x4413('0x1'));var BPromise=require(_0x4413('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4413('0x3'));var logger=require(_0x4413('0x4'))('rpc');var config=require(_0x4413('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47fc80,_0x3561f2,_0x5a8c11){return new BPromise(function(_0x4c50aa,_0x38b65e){return client['request'](_0x47fc80,_0x5a8c11)['then'](function(_0x52081d){logger[_0x4413('0x6')]('FreshdeskAccount,\x20%s,\x20%s',_0x3561f2,_0x4413('0x7'));logger[_0x4413('0x8')](_0x4413('0x9'),_0x3561f2,'request\x20sent',JSON[_0x4413('0xa')](_0x52081d));if(_0x52081d[_0x4413('0xb')]){if(_0x52081d[_0x4413('0xb')][_0x4413('0xc')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x3561f2,_0x52081d['error'][_0x4413('0xd')]);return _0x38b65e(_0x52081d[_0x4413('0xb')][_0x4413('0xd')]);}logger[_0x4413('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x3561f2,_0x52081d[_0x4413('0xb')][_0x4413('0xd')]);return _0x4c50aa(_0x52081d[_0x4413('0xb')][_0x4413('0xd')]);}else{logger[_0x4413('0x6')](_0x4413('0xe'),_0x3561f2,_0x4413('0x7'));_0x4c50aa(_0x52081d[_0x4413('0xf')][_0x4413('0xd')]);}})[_0x4413('0x10')](function(_0xa20761){logger[_0x4413('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x3561f2,_0xa20761);_0x38b65e(_0xa20761);});});}exports['GetFreshdeskAccount']=function(_0x4a4b38){var _0x19f434=this;return new Promise(function(_0x3a293c,_0x12ea02){return db[_0x4413('0x11')][_0x4413('0x12')]({'raw':_0x4a4b38['options']?_0x4a4b38[_0x4413('0x13')][_0x4413('0x14')]===undefined?!![]:![]:!![],'where':_0x4a4b38[_0x4413('0x13')]?_0x4a4b38['options']['where']||null:null,'attributes':_0x4a4b38[_0x4413('0x13')]?_0x4a4b38[_0x4413('0x13')][_0x4413('0x15')]||null:null,'limit':_0x4a4b38[_0x4413('0x13')]?_0x4a4b38[_0x4413('0x13')][_0x4413('0x16')]||null:null,'include':_0x4a4b38['options']?_0x4a4b38[_0x4413('0x13')][_0x4413('0x17')]?_[_0x4413('0x18')](_0x4a4b38['options']['include'],function(_0x1ddeab){return{'model':db[_0x1ddeab['model']],'as':_0x1ddeab['as'],'attributes':_0x1ddeab[_0x4413('0x15')],'include':_0x1ddeab[_0x4413('0x17')]?_[_0x4413('0x18')](_0x1ddeab[_0x4413('0x17')],function(_0x4c1dee){return{'model':db[_0x4c1dee[_0x4413('0x19')]],'as':_0x4c1dee['as'],'attributes':_0x4c1dee['attributes'],'include':_0x4c1dee['include']?_[_0x4413('0x18')](_0x4c1dee[_0x4413('0x17')],function(_0x5a43d4){return{'model':db[_0x5a43d4[_0x4413('0x19')]],'as':_0x5a43d4['as'],'attributes':_0x5a43d4[_0x4413('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31a6f8){logger[_0x4413('0x6')](_0x4413('0x1a'),_0x4a4b38);logger[_0x4413('0x8')]('GetFreshdeskAccount',_0x4a4b38,JSON[_0x4413('0xa')](_0x31a6f8));_0x3a293c(_0x31a6f8);})['catch'](function(_0x426695){logger[_0x4413('0xb')]('GetFreshdeskAccount',_0x426695[_0x4413('0xd')],_0x4a4b38);_0x12ea02(_0x19f434[_0x4413('0xb')](0x1f4,_0x426695[_0x4413('0xd')]));});});};exports[_0x4413('0x1b')]=function(_0x50d7ee){var _0xb74e92=this;return new Promise(function(_0x4d5a1b,_0xda2119){return db[_0x4413('0x11')]['find']({'raw':_0x50d7ee[_0x4413('0x13')]?_0x50d7ee['options'][_0x4413('0x14')]===undefined?!![]:![]:!![],'where':_0x50d7ee[_0x4413('0x13')]?_0x50d7ee[_0x4413('0x13')][_0x4413('0x1c')]||null:null,'attributes':_0x50d7ee['options']?_0x50d7ee['options'][_0x4413('0x15')]||null:null,'include':_0x50d7ee[_0x4413('0x13')]?_0x50d7ee[_0x4413('0x13')][_0x4413('0x17')]?_[_0x4413('0x18')](_0x50d7ee['options'][_0x4413('0x17')],function(_0x55d1f9){return{'model':db[_0x55d1f9[_0x4413('0x19')]],'as':_0x55d1f9['as'],'attributes':_0x55d1f9[_0x4413('0x15')],'include':_0x55d1f9['include']?_[_0x4413('0x18')](_0x55d1f9['include'],function(_0x449e7e){return{'model':db[_0x449e7e[_0x4413('0x19')]],'as':_0x449e7e['as'],'attributes':_0x449e7e[_0x4413('0x15')],'include':_0x449e7e[_0x4413('0x17')]?_[_0x4413('0x18')](_0x449e7e[_0x4413('0x17')],function(_0x9ad2ce){return{'model':db[_0x9ad2ce[_0x4413('0x19')]],'as':_0x9ad2ce['as'],'attributes':_0x9ad2ce['attributes']};}):[]};}):[]};}):[]:[]})[_0x4413('0x1d')](function(_0x339853){logger[_0x4413('0x6')](_0x4413('0x1b'),_0x50d7ee);logger['debug']('ShowFreshdeskAccount',_0x50d7ee,JSON[_0x4413('0xa')](_0x339853));_0x4d5a1b(_0x339853);})[_0x4413('0x10')](function(_0x7df7d0){logger[_0x4413('0xb')](_0x4413('0x1b'),_0x7df7d0[_0x4413('0xd')],_0x50d7ee);_0xda2119(_0xb74e92['error'](0x1f4,_0x7df7d0[_0x4413('0xd')]));});});};
\ No newline at end of file
+var _0x3aca=['attributes','ShowFreshdeskAccount','raw','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','catch','GetFreshdeskAccount','FreshdeskAccount','options','where','limit','map','include','model'];(function(_0x142412,_0x189a3b){var _0x3274b3=function(_0xd6e26f){while(--_0xd6e26f){_0x142412['push'](_0x142412['shift']());}};_0x3274b3(++_0x189a3b);}(_0x3aca,0x83));var _0xa3ac=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x3aca[_0x3fba9f];return _0x192cf1;};'use strict';var _=require(_0xa3ac('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa3ac('0x1'));var rs=require(_0xa3ac('0x2'));var fs=require('fs');var Redis=require(_0xa3ac('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3ac('0x4'));var logger=require(_0xa3ac('0x5'))(_0xa3ac('0x6'));var config=require(_0xa3ac('0x7'));var jayson=require(_0xa3ac('0x8'));var client=jayson['client'][_0xa3ac('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d9b73,_0x4fd108,_0x389abc){return new BPromise(function(_0x4da43d,_0x423126){return client[_0xa3ac('0xa')](_0x5d9b73,_0x389abc)[_0xa3ac('0xb')](function(_0xd5985e){logger[_0xa3ac('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x4fd108,_0xa3ac('0xd'));logger[_0xa3ac('0xe')](_0xa3ac('0xf'),_0x4fd108,'request\x20sent',JSON[_0xa3ac('0x10')](_0xd5985e));if(_0xd5985e[_0xa3ac('0x11')]){if(_0xd5985e[_0xa3ac('0x11')]['code']===0x1f4){logger[_0xa3ac('0x11')](_0xa3ac('0x12'),_0x4fd108,_0xd5985e[_0xa3ac('0x11')][_0xa3ac('0x13')]);return _0x423126(_0xd5985e[_0xa3ac('0x11')][_0xa3ac('0x13')]);}logger[_0xa3ac('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x4fd108,_0xd5985e[_0xa3ac('0x11')]['message']);return _0x4da43d(_0xd5985e['error']['message']);}else{logger[_0xa3ac('0xc')](_0xa3ac('0x12'),_0x4fd108,_0xa3ac('0xd'));_0x4da43d(_0xd5985e['result'][_0xa3ac('0x13')]);}})[_0xa3ac('0x14')](function(_0x4ee54e){logger[_0xa3ac('0x11')](_0xa3ac('0x12'),_0x4fd108,_0x4ee54e);_0x423126(_0x4ee54e);});});}exports[_0xa3ac('0x15')]=function(_0x40d38a){var _0xf7521d=this;return new Promise(function(_0x5d1ab4,_0x48c8c7){return db[_0xa3ac('0x16')]['findAll']({'raw':_0x40d38a['options']?_0x40d38a[_0xa3ac('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x40d38a['options']?_0x40d38a['options'][_0xa3ac('0x18')]||null:null,'attributes':_0x40d38a[_0xa3ac('0x17')]?_0x40d38a[_0xa3ac('0x17')]['attributes']||null:null,'limit':_0x40d38a[_0xa3ac('0x17')]?_0x40d38a[_0xa3ac('0x17')][_0xa3ac('0x19')]||null:null,'include':_0x40d38a[_0xa3ac('0x17')]?_0x40d38a['options']['include']?_[_0xa3ac('0x1a')](_0x40d38a[_0xa3ac('0x17')][_0xa3ac('0x1b')],function(_0x331aba){return{'model':db[_0x331aba[_0xa3ac('0x1c')]],'as':_0x331aba['as'],'attributes':_0x331aba[_0xa3ac('0x1d')],'include':_0x331aba[_0xa3ac('0x1b')]?_[_0xa3ac('0x1a')](_0x331aba[_0xa3ac('0x1b')],function(_0x23b644){return{'model':db[_0x23b644['model']],'as':_0x23b644['as'],'attributes':_0x23b644['attributes'],'include':_0x23b644[_0xa3ac('0x1b')]?_[_0xa3ac('0x1a')](_0x23b644[_0xa3ac('0x1b')],function(_0x2a8dec){return{'model':db[_0x2a8dec[_0xa3ac('0x1c')]],'as':_0x2a8dec['as'],'attributes':_0x2a8dec[_0xa3ac('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa3ac('0xb')](function(_0x189801){logger['info'](_0xa3ac('0x15'),_0x40d38a);logger[_0xa3ac('0xe')](_0xa3ac('0x15'),_0x40d38a,JSON[_0xa3ac('0x10')](_0x189801));_0x5d1ab4(_0x189801);})[_0xa3ac('0x14')](function(_0x4c1a2f){logger[_0xa3ac('0x11')]('GetFreshdeskAccount',_0x4c1a2f[_0xa3ac('0x13')],_0x40d38a);_0x48c8c7(_0xf7521d[_0xa3ac('0x11')](0x1f4,_0x4c1a2f[_0xa3ac('0x13')]));});});};exports[_0xa3ac('0x1e')]=function(_0x47f852){var _0x195845=this;return new Promise(function(_0x5a5847,_0x5e7d9b){return db[_0xa3ac('0x16')]['find']({'raw':_0x47f852[_0xa3ac('0x17')]?_0x47f852[_0xa3ac('0x17')][_0xa3ac('0x1f')]===undefined?!![]:![]:!![],'where':_0x47f852['options']?_0x47f852['options']['where']||null:null,'attributes':_0x47f852[_0xa3ac('0x17')]?_0x47f852[_0xa3ac('0x17')]['attributes']||null:null,'include':_0x47f852[_0xa3ac('0x17')]?_0x47f852[_0xa3ac('0x17')]['include']?_[_0xa3ac('0x1a')](_0x47f852[_0xa3ac('0x17')]['include'],function(_0x9ca2ca){return{'model':db[_0x9ca2ca[_0xa3ac('0x1c')]],'as':_0x9ca2ca['as'],'attributes':_0x9ca2ca['attributes'],'include':_0x9ca2ca['include']?_[_0xa3ac('0x1a')](_0x9ca2ca[_0xa3ac('0x1b')],function(_0x5bef2b){return{'model':db[_0x5bef2b[_0xa3ac('0x1c')]],'as':_0x5bef2b['as'],'attributes':_0x5bef2b[_0xa3ac('0x1d')],'include':_0x5bef2b['include']?_['map'](_0x5bef2b[_0xa3ac('0x1b')],function(_0x4ac44e){return{'model':db[_0x4ac44e[_0xa3ac('0x1c')]],'as':_0x4ac44e['as'],'attributes':_0x4ac44e[_0xa3ac('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa3ac('0xb')](function(_0x2dd735){logger[_0xa3ac('0xc')]('ShowFreshdeskAccount',_0x47f852);logger[_0xa3ac('0xe')](_0xa3ac('0x1e'),_0x47f852,JSON[_0xa3ac('0x10')](_0x2dd735));_0x5a5847(_0x2dd735);})[_0xa3ac('0x14')](function(_0x4f66c6){logger[_0xa3ac('0x11')]('ShowFreshdeskAccount',_0x4f66c6[_0xa3ac('0x13')],_0x47f852);_0x5e7d9b(_0x195845[_0xa3ac('0x11')](0x1f4,_0x4f66c6['message']));});});};
\ No newline at end of file