Built motion from commit (unavailable).|2.5.17
[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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x4b784d,_0x5efb2f){var _0x2cdeaf=function(_0x106242){while(--_0x106242){_0x4b784d['push'](_0x4b784d['shift']());}};_0x2cdeaf(++_0x5efb2f);}(_0xabce,0x103));var _0xeabc=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xabce[_0x33032e];return _0x13316b;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});config[_0xeabc('0x9')]=_['defaults'](config[_0xeabc('0x9')],{'host':_0xeabc('0xa'),'port':0x18eb});var socket=require(_0xeabc('0xb'))(new Redis(config['redis']));require(_0xeabc('0xc'))[_0xeabc('0xd')](socket);function respondWithRpcPromise(_0x2f73e9,_0x1b4d1b,_0x4301e4){return new BPromise(function(_0x283cdf,_0x111aaf){return client[_0xeabc('0xe')](_0x2f73e9,_0x4301e4)[_0xeabc('0xf')](function(_0xf0d9c0){logger[_0xeabc('0x10')](_0xeabc('0x11'),_0x1b4d1b,_0xeabc('0x12'));logger[_0xeabc('0x13')](_0xeabc('0x14'),_0x1b4d1b,_0xeabc('0x12'),JSON['stringify'](_0xf0d9c0));if(_0xf0d9c0[_0xeabc('0x15')]){if(_0xf0d9c0[_0xeabc('0x15')][_0xeabc('0x16')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x1b4d1b,_0xf0d9c0[_0xeabc('0x15')][_0xeabc('0x17')]);return _0x111aaf(_0xf0d9c0[_0xeabc('0x15')]['message']);}logger[_0xeabc('0x15')](_0xeabc('0x11'),_0x1b4d1b,_0xf0d9c0['error']['message']);return _0x283cdf(_0xf0d9c0[_0xeabc('0x15')]['message']);}else{logger[_0xeabc('0x10')](_0xeabc('0x11'),_0x1b4d1b,_0xeabc('0x12'));_0x283cdf(_0xf0d9c0[_0xeabc('0x18')][_0xeabc('0x17')]);}})[_0xeabc('0x19')](function(_0x384be5){logger[_0xeabc('0x15')]('UserProfile,\x20%s,\x20%s',_0x1b4d1b,_0x384be5);_0x111aaf(_0x384be5);});});}