Built motion from commit (unavailable).|2.6.0
[motion2.git] / server / api / userNotification / userNotification.rpc.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x4d1b=['redis','localhost','socket.io-emitter','register','info','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UserNotification,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x2d7aa1,_0x2a479a){var _0x15b38f=function(_0x56fdbd){while(--_0x56fdbd){_0x2d7aa1['push'](_0x2d7aa1['shift']());}};_0x15b38f(++_0x2a479a);}(_0x4d1b,0x1c8));var _0xb4d1=function(_0x18f82b,_0x3ea7a0){_0x18f82b=_0x18f82b-0x0;var _0x5d8128=_0x4d1b[_0x18f82b];return _0x5d8128;};'use strict';var _=require(_0xb4d1('0x0'));var util=require('util');var moment=require(_0xb4d1('0x1'));var BPromise=require(_0xb4d1('0x2'));var rs=require(_0xb4d1('0x3'));var fs=require('fs');var Redis=require(_0xb4d1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb4d1('0x5'));var logger=require('../../config/logger')(_0xb4d1('0x6'));var config=require(_0xb4d1('0x7'));var jayson=require(_0xb4d1('0x8'));var client=jayson[_0xb4d1('0x9')][_0xb4d1('0xa')]({'port':0x232a});config['redis']=_[_0xb4d1('0xb')](config[_0xb4d1('0xc')],{'host':_0xb4d1('0xd'),'port':0x18eb});var socket=require(_0xb4d1('0xe'))(new Redis(config[_0xb4d1('0xc')]));require('./userNotification.socket')[_0xb4d1('0xf')](socket);function respondWithRpcPromise(_0x528666,_0x13d5e2,_0x116112){return new BPromise(function(_0x13ea9c,_0x358ba4){return client['request'](_0x528666,_0x116112)['then'](function(_0x98516d){logger[_0xb4d1('0x10')]('UserNotification,\x20%s,\x20%s',_0x13d5e2,'request\x20sent');logger['debug'](_0xb4d1('0x11'),_0x13d5e2,_0xb4d1('0x12'),JSON[_0xb4d1('0x13')](_0x98516d));if(_0x98516d[_0xb4d1('0x14')]){if(_0x98516d[_0xb4d1('0x14')][_0xb4d1('0x15')]===0x1f4){logger[_0xb4d1('0x14')]('UserNotification,\x20%s,\x20%s',_0x13d5e2,_0x98516d['error'][_0xb4d1('0x16')]);return _0x358ba4(_0x98516d[_0xb4d1('0x14')][_0xb4d1('0x16')]);}logger[_0xb4d1('0x14')]('UserNotification,\x20%s,\x20%s',_0x13d5e2,_0x98516d['error'][_0xb4d1('0x16')]);return _0x13ea9c(_0x98516d[_0xb4d1('0x14')][_0xb4d1('0x16')]);}else{logger['info'](_0xb4d1('0x17'),_0x13d5e2,_0xb4d1('0x12'));_0x13ea9c(_0x98516d[_0xb4d1('0x18')]['message']);}})[_0xb4d1('0x19')](function(_0x32a2d3){logger[_0xb4d1('0x14')](_0xb4d1('0x17'),_0x13d5e2,_0x32a2d3);_0x358ba4(_0x32a2d3);});});}