Built motion from commit 7a4eb044.|2.5.36
[motion2.git] / server / api / userProfile / userProfile.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 _0x5078=['info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then'];(function(_0x14ebce,_0x3ca9e1){var _0x1fc8a1=function(_0x5cc4c2){while(--_0x5cc4c2){_0x14ebce['push'](_0x14ebce['shift']());}};_0x1fc8a1(++_0x3ca9e1);}(_0x5078,0x148));var _0x8507=function(_0x2db3d3,_0x5dc096){_0x2db3d3=_0x2db3d3-0x0;var _0xf00dbd=_0x5078[_0x2db3d3];return _0xf00dbd;};'use strict';var _=require(_0x8507('0x0'));var util=require(_0x8507('0x1'));var moment=require(_0x8507('0x2'));var BPromise=require(_0x8507('0x3'));var rs=require(_0x8507('0x4'));var fs=require('fs');var Redis=require(_0x8507('0x5'));var db=require(_0x8507('0x6'))['db'];var utils=require(_0x8507('0x7'));var logger=require(_0x8507('0x8'))(_0x8507('0x9'));var config=require(_0x8507('0xa'));var jayson=require(_0x8507('0xb'));var client=jayson[_0x8507('0xc')][_0x8507('0xd')]({'port':0x232a});config[_0x8507('0xe')]=_[_0x8507('0xf')](config['redis'],{'host':_0x8507('0x10'),'port':0x18eb});var socket=require(_0x8507('0x11'))(new Redis(config[_0x8507('0xe')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x168085,_0x1c71f5,_0x3c8478){return new BPromise(function(_0x339c13,_0x413984){return client[_0x8507('0x12')](_0x168085,_0x3c8478)[_0x8507('0x13')](function(_0x494fed){logger[_0x8507('0x14')](_0x8507('0x15'),_0x1c71f5,_0x8507('0x16'));logger[_0x8507('0x17')](_0x8507('0x18'),_0x1c71f5,_0x8507('0x16'),JSON['stringify'](_0x494fed));if(_0x494fed[_0x8507('0x19')]){if(_0x494fed[_0x8507('0x19')][_0x8507('0x1a')]===0x1f4){logger[_0x8507('0x19')](_0x8507('0x15'),_0x1c71f5,_0x494fed[_0x8507('0x19')]['message']);return _0x413984(_0x494fed['error'][_0x8507('0x1b')]);}logger[_0x8507('0x19')](_0x8507('0x15'),_0x1c71f5,_0x494fed['error'][_0x8507('0x1b')]);return _0x339c13(_0x494fed[_0x8507('0x19')][_0x8507('0x1b')]);}else{logger[_0x8507('0x14')](_0x8507('0x15'),_0x1c71f5,_0x8507('0x16'));_0x339c13(_0x494fed[_0x8507('0x1c')][_0x8507('0x1b')]);}})['catch'](function(_0x5d0f74){logger[_0x8507('0x19')](_0x8507('0x15'),_0x1c71f5,_0x5d0f74);_0x413984(_0x5d0f74);});});}