Built motion from commit (unavailable).|2.5.20
[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 _0x495e=['client','http','redis','socket.io-emitter','./userNotification.socket','register','request','then','info','userNotification,\x20%s,\x20%s','userNotification,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x59f0ff,_0x2b9d67){var _0x28e782=function(_0x437e09){while(--_0x437e09){_0x59f0ff['push'](_0x59f0ff['shift']());}};_0x28e782(++_0x2b9d67);}(_0x495e,0xfb));var _0xe495=function(_0x224dda,_0x16d0f9){_0x224dda=_0x224dda-0x0;var _0x2987ac=_0x495e[_0x224dda];return _0x2987ac;};'use strict';var _=require(_0xe495('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe495('0x1'));var rs=require(_0xe495('0x2'));var fs=require('fs');var Redis=require(_0xe495('0x3'));var db=require(_0xe495('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe495('0x5'))(_0xe495('0x6'));var config=require(_0xe495('0x7'));var jayson=require(_0xe495('0x8'));var client=jayson[_0xe495('0x9')][_0xe495('0xa')]({'port':0x232a});config[_0xe495('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe495('0xc'))(new Redis(config['redis']));require(_0xe495('0xd'))[_0xe495('0xe')](socket);function respondWithRpcPromise(_0x15ff5c,_0x41983d,_0x2a38c7){return new BPromise(function(_0x595837,_0xebcb50){return client[_0xe495('0xf')](_0x15ff5c,_0x2a38c7)[_0xe495('0x10')](function(_0x5ad3db){logger[_0xe495('0x11')](_0xe495('0x12'),_0x41983d,'request\x20sent');logger['debug'](_0xe495('0x13'),_0x41983d,_0xe495('0x14'),JSON['stringify'](_0x5ad3db));if(_0x5ad3db[_0xe495('0x15')]){if(_0x5ad3db[_0xe495('0x15')][_0xe495('0x16')]===0x1f4){logger[_0xe495('0x15')](_0xe495('0x12'),_0x41983d,_0x5ad3db['error'][_0xe495('0x17')]);return _0xebcb50(_0x5ad3db[_0xe495('0x15')][_0xe495('0x17')]);}logger[_0xe495('0x15')](_0xe495('0x12'),_0x41983d,_0x5ad3db['error']['message']);return _0x595837(_0x5ad3db['error'][_0xe495('0x17')]);}else{logger[_0xe495('0x11')](_0xe495('0x12'),_0x41983d,'request\x20sent');_0x595837(_0x5ad3db[_0xe495('0x18')][_0xe495('0x17')]);}})[_0xe495('0x19')](function(_0x1ba7b2){logger[_0xe495('0x15')]('userNotification,\x20%s,\x20%s',_0x41983d,_0x1ba7b2);_0xebcb50(_0x1ba7b2);});});}