Built motion from commit e8da49ee.|2.6.33
[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 _0xf811=['http','defaults','redis','localhost','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x33c3f7,_0x530749){var _0x56158a=function(_0x2c53f3){while(--_0x2c53f3){_0x33c3f7['push'](_0x33c3f7['shift']());}};_0x56158a(++_0x530749);}(_0xf811,0x6f));var _0x1f81=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xf811[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require(_0x1f81('0x0'));var util=require(_0x1f81('0x1'));var moment=require(_0x1f81('0x2'));var BPromise=require(_0x1f81('0x3'));var rs=require(_0x1f81('0x4'));var fs=require('fs');var Redis=require(_0x1f81('0x5'));var db=require(_0x1f81('0x6'))['db'];var utils=require(_0x1f81('0x7'));var logger=require(_0x1f81('0x8'))(_0x1f81('0x9'));var config=require(_0x1f81('0xa'));var jayson=require(_0x1f81('0xb'));var client=jayson[_0x1f81('0xc')][_0x1f81('0xd')]({'port':0x232a});config['redis']=_[_0x1f81('0xe')](config[_0x1f81('0xf')],{'host':_0x1f81('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f81('0xf')]));require(_0x1f81('0x11'))['register'](socket);function respondWithRpcPromise(_0x2ce4d7,_0x56b05d,_0x1978e5){return new BPromise(function(_0xf59298,_0x12859d){return client[_0x1f81('0x12')](_0x2ce4d7,_0x1978e5)[_0x1f81('0x13')](function(_0x36ccd8){logger[_0x1f81('0x14')](_0x1f81('0x15'),_0x56b05d,_0x1f81('0x16'));logger[_0x1f81('0x17')](_0x1f81('0x18'),_0x56b05d,_0x1f81('0x16'),JSON[_0x1f81('0x19')](_0x36ccd8));if(_0x36ccd8[_0x1f81('0x1a')]){if(_0x36ccd8[_0x1f81('0x1a')][_0x1f81('0x1b')]===0x1f4){logger['error'](_0x1f81('0x15'),_0x56b05d,_0x36ccd8[_0x1f81('0x1a')]['message']);return _0x12859d(_0x36ccd8['error'][_0x1f81('0x1c')]);}logger[_0x1f81('0x1a')]('UserProfile,\x20%s,\x20%s',_0x56b05d,_0x36ccd8[_0x1f81('0x1a')][_0x1f81('0x1c')]);return _0xf59298(_0x36ccd8[_0x1f81('0x1a')][_0x1f81('0x1c')]);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x56b05d,_0x1f81('0x16'));_0xf59298(_0x36ccd8[_0x1f81('0x1d')]['message']);}})[_0x1f81('0x1e')](function(_0x5310fb){logger[_0x1f81('0x1a')](_0x1f81('0x15'),_0x56b05d,_0x5310fb);_0x12859d(_0x5310fb);});});}