Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / notification / notification.rpc.js
index d6c3ced..68a3b0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6f0=['http','redis','localhost','socket.io-emitter','./notification.socket','register','then','debug','Notification,\x20%s,\x20%s,\x20%s','request\x20sent','error','Notification,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0xb6f0,0xff));var _0x0b6f=function(_0x3bc298,_0x583d14){_0x3bc298=_0x3bc298-0x0;var _0x31bf58=_0xb6f0[_0x3bc298];return _0x31bf58;};'use strict';var _=require(_0x0b6f('0x0'));var util=require(_0x0b6f('0x1'));var moment=require(_0x0b6f('0x2'));var BPromise=require('bluebird');var rs=require(_0x0b6f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b6f('0x4'))['db'];var utils=require(_0x0b6f('0x5'));var logger=require(_0x0b6f('0x6'))('rpc');var config=require(_0x0b6f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0b6f('0x8')][_0x0b6f('0x9')]({'port':0x232a});config[_0x0b6f('0xa')]=_['defaults'](config['redis'],{'host':_0x0b6f('0xb'),'port':0x18eb});var socket=require(_0x0b6f('0xc'))(new Redis(config['redis']));require(_0x0b6f('0xd'))[_0x0b6f('0xe')](socket);function respondWithRpcPromise(_0x541f2b,_0x53d5c2,_0x2a1170){return new BPromise(function(_0x2fa7d1,_0x243a18){return client['request'](_0x541f2b,_0x2a1170)[_0x0b6f('0xf')](function(_0x28e54a){logger['info']('Notification,\x20%s,\x20%s',_0x53d5c2,'request\x20sent');logger[_0x0b6f('0x10')](_0x0b6f('0x11'),_0x53d5c2,_0x0b6f('0x12'),JSON['stringify'](_0x28e54a));if(_0x28e54a[_0x0b6f('0x13')]){if(_0x28e54a['error']['code']===0x1f4){logger['error'](_0x0b6f('0x14'),_0x53d5c2,_0x28e54a['error']['message']);return _0x243a18(_0x28e54a[_0x0b6f('0x13')]['message']);}logger['error'](_0x0b6f('0x14'),_0x53d5c2,_0x28e54a[_0x0b6f('0x13')]['message']);return _0x2fa7d1(_0x28e54a['error'][_0x0b6f('0x15')]);}else{logger[_0x0b6f('0x16')](_0x0b6f('0x14'),_0x53d5c2,_0x0b6f('0x12'));_0x2fa7d1(_0x28e54a['result']['message']);}})[_0x0b6f('0x17')](function(_0x5582d5){logger[_0x0b6f('0x13')]('Notification,\x20%s,\x20%s',_0x53d5c2,_0x5582d5);_0x243a18(_0x5582d5);});});}
\ No newline at end of file
+var _0xec5a=['rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','./notification.socket','register','info','request\x20sent','debug','stringify','error','Notification,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x4f324f,_0x3a91e6){var _0x416d43=function(_0x47b556){while(--_0x47b556){_0x4f324f['push'](_0x4f324f['shift']());}};_0x416d43(++_0x3a91e6);}(_0xec5a,0x1c2));var _0xaec5=function(_0x11b471,_0x292e04){_0x11b471=_0x11b471-0x0;var _0x43fb3a=_0xec5a[_0x11b471];return _0x43fb3a;};'use strict';var _=require(_0xaec5('0x0'));var util=require(_0xaec5('0x1'));var moment=require(_0xaec5('0x2'));var BPromise=require('bluebird');var rs=require(_0xaec5('0x3'));var fs=require('fs');var Redis=require(_0xaec5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaec5('0x5'));var logger=require('../../config/logger')(_0xaec5('0x6'));var config=require(_0xaec5('0x7'));var jayson=require(_0xaec5('0x8'));var client=jayson[_0xaec5('0x9')][_0xaec5('0xa')]({'port':0x232a});config['redis']=_[_0xaec5('0xb')](config['redis'],{'host':_0xaec5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaec5('0xd'))[_0xaec5('0xe')](socket);function respondWithRpcPromise(_0x421904,_0x28d084,_0x58ea37){return new BPromise(function(_0xff0a26,_0x4a98dd){return client['request'](_0x421904,_0x58ea37)['then'](function(_0x31ef7e){logger[_0xaec5('0xf')]('Notification,\x20%s,\x20%s',_0x28d084,_0xaec5('0x10'));logger[_0xaec5('0x11')]('Notification,\x20%s,\x20%s,\x20%s',_0x28d084,_0xaec5('0x10'),JSON[_0xaec5('0x12')](_0x31ef7e));if(_0x31ef7e[_0xaec5('0x13')]){if(_0x31ef7e[_0xaec5('0x13')]['code']===0x1f4){logger[_0xaec5('0x13')](_0xaec5('0x14'),_0x28d084,_0x31ef7e[_0xaec5('0x13')]['message']);return _0x4a98dd(_0x31ef7e[_0xaec5('0x13')][_0xaec5('0x15')]);}logger[_0xaec5('0x13')](_0xaec5('0x14'),_0x28d084,_0x31ef7e[_0xaec5('0x13')][_0xaec5('0x15')]);return _0xff0a26(_0x31ef7e[_0xaec5('0x13')][_0xaec5('0x15')]);}else{logger['info'](_0xaec5('0x14'),_0x28d084,_0xaec5('0x10'));_0xff0a26(_0x31ef7e[_0xaec5('0x16')]['message']);}})[_0xaec5('0x17')](function(_0x2d1fe1){logger[_0xaec5('0x13')](_0xaec5('0x14'),_0x28d084,_0x2d1fe1);_0x4a98dd(_0x2d1fe1);});});}
\ No newline at end of file