Built motion from commit (unavailable).|2.4.10
[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 _0x6f47=['UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','then','info'];(function(_0x2e7ee9,_0x2e041d){var _0x2f1d1d=function(_0x51e053){while(--_0x51e053){_0x2e7ee9['push'](_0x2e7ee9['shift']());}};_0x2f1d1d(++_0x2e041d);}(_0x6f47,0xc7));var _0x76f4=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x6f47[_0x576170];return _0x397c70;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var moment=require(_0x76f4('0x1'));var BPromise=require('bluebird');var rs=require(_0x76f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76f4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x76f4('0x4'))(_0x76f4('0x5'));var config=require(_0x76f4('0x6'));var jayson=require(_0x76f4('0x7'));var client=jayson['client'][_0x76f4('0x8')]({'port':0x232a});config[_0x76f4('0x9')]=_[_0x76f4('0xa')](config['redis'],{'host':_0x76f4('0xb'),'port':0x18eb});var socket=require(_0x76f4('0xc'))(new Redis(config[_0x76f4('0x9')]));require(_0x76f4('0xd'))[_0x76f4('0xe')](socket);function respondWithRpcPromise(_0x4c6b5c,_0x5367d6,_0x3347ef){return new BPromise(function(_0x18e41a,_0x5af83c){return client['request'](_0x4c6b5c,_0x3347ef)[_0x76f4('0xf')](function(_0x458c22){logger[_0x76f4('0x10')](_0x76f4('0x11'),_0x5367d6,_0x76f4('0x12'));logger[_0x76f4('0x13')](_0x76f4('0x14'),_0x5367d6,_0x76f4('0x12'),JSON[_0x76f4('0x15')](_0x458c22));if(_0x458c22['error']){if(_0x458c22[_0x76f4('0x16')][_0x76f4('0x17')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x5367d6,_0x458c22['error'][_0x76f4('0x18')]);return _0x5af83c(_0x458c22[_0x76f4('0x16')][_0x76f4('0x18')]);}logger[_0x76f4('0x16')](_0x76f4('0x11'),_0x5367d6,_0x458c22[_0x76f4('0x16')][_0x76f4('0x18')]);return _0x18e41a(_0x458c22[_0x76f4('0x16')][_0x76f4('0x18')]);}else{logger[_0x76f4('0x10')](_0x76f4('0x11'),_0x5367d6,_0x76f4('0x12'));_0x18e41a(_0x458c22[_0x76f4('0x19')][_0x76f4('0x18')]);}})[_0x76f4('0x1a')](function(_0x397360){logger[_0x76f4('0x16')](_0x76f4('0x11'),_0x5367d6,_0x397360);_0x5af83c(_0x397360);});});}