Built motion from commit (unavailable).|2.5.31
[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 _0xdfce=['UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./userNotification.socket','register','request','then','info'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xdfce,0xf9));var _0xedfc=function(_0x33cefc,_0x56812a){_0x33cefc=_0x33cefc-0x0;var _0x4a8511=_0xdfce[_0x33cefc];return _0x4a8511;};'use strict';var _=require(_0xedfc('0x0'));var util=require(_0xedfc('0x1'));var moment=require(_0xedfc('0x2'));var BPromise=require(_0xedfc('0x3'));var rs=require(_0xedfc('0x4'));var fs=require('fs');var Redis=require(_0xedfc('0x5'));var db=require(_0xedfc('0x6'))['db'];var utils=require(_0xedfc('0x7'));var logger=require(_0xedfc('0x8'))(_0xedfc('0x9'));var config=require(_0xedfc('0xa'));var jayson=require(_0xedfc('0xb'));var client=jayson[_0xedfc('0xc')][_0xedfc('0xd')]({'port':0x232a});config[_0xedfc('0xe')]=_[_0xedfc('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xedfc('0xe')]));require(_0xedfc('0x10'))[_0xedfc('0x11')](socket);function respondWithRpcPromise(_0x596cd5,_0x1652d1,_0x3485da){return new BPromise(function(_0xcb9c6a,_0x2dd3a6){return client[_0xedfc('0x12')](_0x596cd5,_0x3485da)[_0xedfc('0x13')](function(_0x1fe672){logger[_0xedfc('0x14')](_0xedfc('0x15'),_0x1652d1,'request\x20sent');logger[_0xedfc('0x16')](_0xedfc('0x17'),_0x1652d1,_0xedfc('0x18'),JSON[_0xedfc('0x19')](_0x1fe672));if(_0x1fe672[_0xedfc('0x1a')]){if(_0x1fe672[_0xedfc('0x1a')]['code']===0x1f4){logger[_0xedfc('0x1a')](_0xedfc('0x15'),_0x1652d1,_0x1fe672['error'][_0xedfc('0x1b')]);return _0x2dd3a6(_0x1fe672[_0xedfc('0x1a')][_0xedfc('0x1b')]);}logger[_0xedfc('0x1a')]('UserNotification,\x20%s,\x20%s',_0x1652d1,_0x1fe672[_0xedfc('0x1a')]['message']);return _0xcb9c6a(_0x1fe672['error'][_0xedfc('0x1b')]);}else{logger[_0xedfc('0x14')](_0xedfc('0x15'),_0x1652d1,'request\x20sent');_0xcb9c6a(_0x1fe672[_0xedfc('0x1c')][_0xedfc('0x1b')]);}})[_0xedfc('0x1d')](function(_0xcc635c){logger['error'](_0xedfc('0x15'),_0x1652d1,_0xcc635c);_0x2dd3a6(_0xcc635c);});});}