Built motion from commit ffdca78c.|2.6.24
[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 _0xaf1b=['register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./userProfile.socket'];(function(_0x9c8b4a,_0x2387ff){var _0x198bef=function(_0x2eb4e8){while(--_0x2eb4e8){_0x9c8b4a['push'](_0x9c8b4a['shift']());}};_0x198bef(++_0x2387ff);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x4d78a0,_0x3653ed){_0x4d78a0=_0x4d78a0-0x0;var _0x122a1b=_0xaf1b[_0x4d78a0];return _0x122a1b;};'use strict';var _=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var moment=require(_0xbaf1('0x2'));var BPromise=require(_0xbaf1('0x3'));var rs=require(_0xbaf1('0x4'));var fs=require('fs');var Redis=require(_0xbaf1('0x5'));var db=require(_0xbaf1('0x6'))['db'];var utils=require(_0xbaf1('0x7'));var logger=require(_0xbaf1('0x8'))(_0xbaf1('0x9'));var config=require(_0xbaf1('0xa'));var jayson=require(_0xbaf1('0xb'));var client=jayson[_0xbaf1('0xc')][_0xbaf1('0xd')]({'port':0x232a});config['redis']=_[_0xbaf1('0xe')](config['redis'],{'host':_0xbaf1('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbaf1('0x10')]));require(_0xbaf1('0x11'))[_0xbaf1('0x12')](socket);function respondWithRpcPromise(_0x4ece8c,_0x222756,_0x287408){return new BPromise(function(_0x56e04e,_0x6e9e3){return client['request'](_0x4ece8c,_0x287408)[_0xbaf1('0x13')](function(_0x418d09){logger[_0xbaf1('0x14')](_0xbaf1('0x15'),_0x222756,_0xbaf1('0x16'));logger[_0xbaf1('0x17')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x222756,'request\x20sent',JSON[_0xbaf1('0x18')](_0x418d09));if(_0x418d09[_0xbaf1('0x19')]){if(_0x418d09[_0xbaf1('0x19')][_0xbaf1('0x1a')]===0x1f4){logger[_0xbaf1('0x19')](_0xbaf1('0x15'),_0x222756,_0x418d09[_0xbaf1('0x19')]['message']);return _0x6e9e3(_0x418d09[_0xbaf1('0x19')][_0xbaf1('0x1b')]);}logger[_0xbaf1('0x19')](_0xbaf1('0x15'),_0x222756,_0x418d09[_0xbaf1('0x19')][_0xbaf1('0x1b')]);return _0x56e04e(_0x418d09[_0xbaf1('0x19')][_0xbaf1('0x1b')]);}else{logger['info'](_0xbaf1('0x15'),_0x222756,'request\x20sent');_0x56e04e(_0x418d09[_0xbaf1('0x1c')][_0xbaf1('0x1b')]);}})[_0xbaf1('0x1d')](function(_0x11532d){logger['error'](_0xbaf1('0x15'),_0x222756,_0x11532d);_0x6e9e3(_0x11532d);});});}