Built motion from commit 97153652.|2.6.26
[motion2.git] / server / api / userNotification / userNotification.rpc.js
index 4235b06..f1708e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x641f=['catch','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x5334ab,_0x1a9476){var _0x42a1c4=function(_0x23b1ad){while(--_0x23b1ad){_0x5334ab['push'](_0x5334ab['shift']());}};_0x42a1c4(++_0x1a9476);}(_0x641f,0x1e1));var _0xf641=function(_0x1970e2,_0x21221f){_0x1970e2=_0x1970e2-0x0;var _0x25e6fc=_0x641f[_0x1970e2];return _0x25e6fc;};'use strict';var _=require(_0xf641('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf641('0x1'));var db=require(_0xf641('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xf641('0x3'))(_0xf641('0x4'));var config=require(_0xf641('0x5'));var jayson=require(_0xf641('0x6'));var client=jayson[_0xf641('0x7')][_0xf641('0x8')]({'port':0x232a});config[_0xf641('0x9')]=_[_0xf641('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf641('0x9')]));require(_0xf641('0xb'))[_0xf641('0xc')](socket);function respondWithRpcPromise(_0x4fe188,_0x404d6f,_0x4f254d){return new BPromise(function(_0x4947fe,_0x1c2d18){return client[_0xf641('0xd')](_0x4fe188,_0x4f254d)[_0xf641('0xe')](function(_0x5d49ed){logger[_0xf641('0xf')](_0xf641('0x10'),_0x404d6f,_0xf641('0x11'));logger[_0xf641('0x12')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x404d6f,'request\x20sent',JSON[_0xf641('0x13')](_0x5d49ed));if(_0x5d49ed[_0xf641('0x14')]){if(_0x5d49ed['error']['code']===0x1f4){logger[_0xf641('0x14')](_0xf641('0x10'),_0x404d6f,_0x5d49ed[_0xf641('0x14')]['message']);return _0x1c2d18(_0x5d49ed[_0xf641('0x14')]['message']);}logger[_0xf641('0x14')](_0xf641('0x10'),_0x404d6f,_0x5d49ed[_0xf641('0x14')][_0xf641('0x15')]);return _0x4947fe(_0x5d49ed[_0xf641('0x14')][_0xf641('0x15')]);}else{logger[_0xf641('0xf')]('UserNotification,\x20%s,\x20%s',_0x404d6f,'request\x20sent');_0x4947fe(_0x5d49ed[_0xf641('0x16')][_0xf641('0x15')]);}})[_0xf641('0x17')](function(_0x4471b6){logger[_0xf641('0x14')](_0xf641('0x10'),_0x404d6f,_0x4471b6);_0x1c2d18(_0x4471b6);});});}
\ No newline at end of file
+var _0xc59f=['stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5ad7d0,_0x5a0449){var _0x1df266=function(_0x2e5ddc){while(--_0x2e5ddc){_0x5ad7d0['push'](_0x5ad7d0['shift']());}};_0x1df266(++_0x5a0449);}(_0xc59f,0x69));var _0xfc59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc59f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfc59('0x0'));var util=require('util');var moment=require(_0xfc59('0x1'));var BPromise=require(_0xfc59('0x2'));var rs=require(_0xfc59('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfc59('0x4'));var logger=require(_0xfc59('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfc59('0x6'));var client=jayson[_0xfc59('0x7')][_0xfc59('0x8')]({'port':0x232a});config[_0xfc59('0x9')]=_[_0xfc59('0xa')](config['redis'],{'host':_0xfc59('0xb'),'port':0x18eb});var socket=require(_0xfc59('0xc'))(new Redis(config[_0xfc59('0x9')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x4c6adc,_0x5c483e,_0x2bef1d){return new BPromise(function(_0x4c089f,_0x51470f){return client[_0xfc59('0xd')](_0x4c6adc,_0x2bef1d)[_0xfc59('0xe')](function(_0x21f3cd){logger[_0xfc59('0xf')](_0xfc59('0x10'),_0x5c483e,'request\x20sent');logger[_0xfc59('0x11')](_0xfc59('0x12'),_0x5c483e,_0xfc59('0x13'),JSON[_0xfc59('0x14')](_0x21f3cd));if(_0x21f3cd[_0xfc59('0x15')]){if(_0x21f3cd[_0xfc59('0x15')][_0xfc59('0x16')]===0x1f4){logger[_0xfc59('0x15')](_0xfc59('0x10'),_0x5c483e,_0x21f3cd[_0xfc59('0x15')][_0xfc59('0x17')]);return _0x51470f(_0x21f3cd[_0xfc59('0x15')]['message']);}logger[_0xfc59('0x15')](_0xfc59('0x10'),_0x5c483e,_0x21f3cd['error']['message']);return _0x4c089f(_0x21f3cd[_0xfc59('0x15')][_0xfc59('0x17')]);}else{logger[_0xfc59('0xf')](_0xfc59('0x10'),_0x5c483e,_0xfc59('0x13'));_0x4c089f(_0x21f3cd['result']['message']);}})[_0xfc59('0x18')](function(_0x4b5efd){logger[_0xfc59('0x15')](_0xfc59('0x10'),_0x5c483e,_0x4b5efd);_0x51470f(_0x4b5efd);});});}
\ No newline at end of file