Built motion from commit (unavailable).|2.4.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 _0x8abc=['defaults','redis','localhost','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8abc,0xb7));var _0xc8ab=function(_0x569eb3,_0x338a0c){_0x569eb3=_0x569eb3-0x0;var _0x203115=_0x8abc[_0x569eb3];return _0x203115;};'use strict';var _=require(_0xc8ab('0x0'));var util=require(_0xc8ab('0x1'));var moment=require(_0xc8ab('0x2'));var BPromise=require('bluebird');var rs=require(_0xc8ab('0x3'));var fs=require('fs');var Redis=require(_0xc8ab('0x4'));var db=require(_0xc8ab('0x5'))['db'];var utils=require(_0xc8ab('0x6'));var logger=require(_0xc8ab('0x7'))(_0xc8ab('0x8'));var config=require(_0xc8ab('0x9'));var jayson=require(_0xc8ab('0xa'));var client=jayson[_0xc8ab('0xb')][_0xc8ab('0xc')]({'port':0x232a});config['redis']=_[_0xc8ab('0xd')](config[_0xc8ab('0xe')],{'host':_0xc8ab('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc8ab('0xe')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x29c14c,_0x3fd9ed,_0x973b2a){return new BPromise(function(_0x317ceb,_0x100a63){return client[_0xc8ab('0x10')](_0x29c14c,_0x973b2a)[_0xc8ab('0x11')](function(_0x5ce71a){logger['info'](_0xc8ab('0x12'),_0x3fd9ed,_0xc8ab('0x13'));logger[_0xc8ab('0x14')](_0xc8ab('0x15'),_0x3fd9ed,_0xc8ab('0x13'),JSON[_0xc8ab('0x16')](_0x5ce71a));if(_0x5ce71a['error']){if(_0x5ce71a[_0xc8ab('0x17')][_0xc8ab('0x18')]===0x1f4){logger[_0xc8ab('0x17')](_0xc8ab('0x12'),_0x3fd9ed,_0x5ce71a['error'][_0xc8ab('0x19')]);return _0x100a63(_0x5ce71a['error'][_0xc8ab('0x19')]);}logger[_0xc8ab('0x17')]('UserProfile,\x20%s,\x20%s',_0x3fd9ed,_0x5ce71a[_0xc8ab('0x17')][_0xc8ab('0x19')]);return _0x317ceb(_0x5ce71a[_0xc8ab('0x17')][_0xc8ab('0x19')]);}else{logger[_0xc8ab('0x1a')](_0xc8ab('0x12'),_0x3fd9ed,_0xc8ab('0x13'));_0x317ceb(_0x5ce71a['result'][_0xc8ab('0x19')]);}})[_0xc8ab('0x1b')](function(_0x540d2b){logger[_0xc8ab('0x17')]('UserProfile,\x20%s,\x20%s',_0x3fd9ed,_0x540d2b);_0x100a63(_0x540d2b);});});}