Built motion from commit e0fa946e.|2.6.5
[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 _0xf470=['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','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket'];(function(_0x4590fe,_0x98819e){var _0x2cb75a=function(_0x19c891){while(--_0x19c891){_0x4590fe['push'](_0x4590fe['shift']());}};_0x2cb75a(++_0x98819e);}(_0xf470,0xfd));var _0x0f47=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf470[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x0f47('0x0'));var util=require(_0x0f47('0x1'));var moment=require(_0x0f47('0x2'));var BPromise=require(_0x0f47('0x3'));var rs=require(_0x0f47('0x4'));var fs=require('fs');var Redis=require(_0x0f47('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f47('0x6'));var logger=require(_0x0f47('0x7'))('rpc');var config=require(_0x0f47('0x8'));var jayson=require(_0x0f47('0x9'));var client=jayson[_0x0f47('0xa')][_0x0f47('0xb')]({'port':0x232a});config[_0x0f47('0xc')]=_[_0x0f47('0xd')](config[_0x0f47('0xc')],{'host':_0x0f47('0xe'),'port':0x18eb});var socket=require(_0x0f47('0xf'))(new Redis(config[_0x0f47('0xc')]));require(_0x0f47('0x10'))[_0x0f47('0x11')](socket);function respondWithRpcPromise(_0x6900a,_0x2256e5,_0x440449){return new BPromise(function(_0x2196d2,_0x3a78c8){return client[_0x0f47('0x12')](_0x6900a,_0x440449)[_0x0f47('0x13')](function(_0x4bfa8f){logger[_0x0f47('0x14')](_0x0f47('0x15'),_0x2256e5,_0x0f47('0x16'));logger[_0x0f47('0x17')](_0x0f47('0x18'),_0x2256e5,'request\x20sent',JSON['stringify'](_0x4bfa8f));if(_0x4bfa8f[_0x0f47('0x19')]){if(_0x4bfa8f[_0x0f47('0x19')][_0x0f47('0x1a')]===0x1f4){logger[_0x0f47('0x19')](_0x0f47('0x15'),_0x2256e5,_0x4bfa8f['error'][_0x0f47('0x1b')]);return _0x3a78c8(_0x4bfa8f['error']['message']);}logger[_0x0f47('0x19')](_0x0f47('0x15'),_0x2256e5,_0x4bfa8f[_0x0f47('0x19')][_0x0f47('0x1b')]);return _0x2196d2(_0x4bfa8f[_0x0f47('0x19')][_0x0f47('0x1b')]);}else{logger[_0x0f47('0x14')]('UserProfile,\x20%s,\x20%s',_0x2256e5,_0x0f47('0x16'));_0x2196d2(_0x4bfa8f[_0x0f47('0x1c')]['message']);}})[_0x0f47('0x1d')](function(_0x2e2f35){logger[_0x0f47('0x19')](_0x0f47('0x15'),_0x2256e5,_0x2e2f35);_0x3a78c8(_0x2e2f35);});});}