Built motion from commit 0900f080.|2.5.45
[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 _0x1d63=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3d4567,_0x607422){var _0x4403ed=function(_0x506c29){while(--_0x506c29){_0x3d4567['push'](_0x3d4567['shift']());}};_0x4403ed(++_0x607422);}(_0x1d63,0xa4));var _0x31d6=function(_0x56b52b,_0x47abbe){_0x56b52b=_0x56b52b-0x0;var _0x2f5097=_0x1d63[_0x56b52b];return _0x2f5097;};'use strict';var _=require(_0x31d6('0x0'));var util=require(_0x31d6('0x1'));var moment=require(_0x31d6('0x2'));var BPromise=require(_0x31d6('0x3'));var rs=require(_0x31d6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31d6('0x5'))['db'];var utils=require(_0x31d6('0x6'));var logger=require(_0x31d6('0x7'))(_0x31d6('0x8'));var config=require(_0x31d6('0x9'));var jayson=require(_0x31d6('0xa'));var client=jayson[_0x31d6('0xb')]['http']({'port':0x232a});config[_0x31d6('0xc')]=_[_0x31d6('0xd')](config['redis'],{'host':_0x31d6('0xe'),'port':0x18eb});var socket=require(_0x31d6('0xf'))(new Redis(config['redis']));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x2962d5,_0x341424,_0x309039){return new BPromise(function(_0x5f00b8,_0x12d5cc){return client[_0x31d6('0x10')](_0x2962d5,_0x309039)[_0x31d6('0x11')](function(_0x2e79f9){logger[_0x31d6('0x12')]('UserProfile,\x20%s,\x20%s',_0x341424,_0x31d6('0x13'));logger[_0x31d6('0x14')](_0x31d6('0x15'),_0x341424,_0x31d6('0x13'),JSON[_0x31d6('0x16')](_0x2e79f9));if(_0x2e79f9[_0x31d6('0x17')]){if(_0x2e79f9['error'][_0x31d6('0x18')]===0x1f4){logger[_0x31d6('0x17')](_0x31d6('0x19'),_0x341424,_0x2e79f9[_0x31d6('0x17')]['message']);return _0x12d5cc(_0x2e79f9[_0x31d6('0x17')]['message']);}logger[_0x31d6('0x17')](_0x31d6('0x19'),_0x341424,_0x2e79f9[_0x31d6('0x17')][_0x31d6('0x1a')]);return _0x5f00b8(_0x2e79f9[_0x31d6('0x17')][_0x31d6('0x1a')]);}else{logger['info'](_0x31d6('0x19'),_0x341424,_0x31d6('0x13'));_0x5f00b8(_0x2e79f9[_0x31d6('0x1b')][_0x31d6('0x1a')]);}})[_0x31d6('0x1c')](function(_0x19a279){logger['error'](_0x31d6('0x19'),_0x341424,_0x19a279);_0x12d5cc(_0x19a279);});});}