Built motion from commit 85328c08.|2.5.50
[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 _0x4813=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4813,0x14e));var _0x3481=function(_0x450a7e,_0x39ca8b){_0x450a7e=_0x450a7e-0x0;var _0x42c4c4=_0x4813[_0x450a7e];return _0x42c4c4;};'use strict';var _=require(_0x3481('0x0'));var util=require(_0x3481('0x1'));var moment=require(_0x3481('0x2'));var BPromise=require(_0x3481('0x3'));var rs=require(_0x3481('0x4'));var fs=require('fs');var Redis=require(_0x3481('0x5'));var db=require(_0x3481('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3481('0x7'))(_0x3481('0x8'));var config=require(_0x3481('0x9'));var jayson=require(_0x3481('0xa'));var client=jayson[_0x3481('0xb')]['http']({'port':0x232a});config['redis']=_[_0x3481('0xc')](config['redis'],{'host':_0x3481('0xd'),'port':0x18eb});var socket=require(_0x3481('0xe'))(new Redis(config[_0x3481('0xf')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x52e455,_0x3da272,_0x4ab043){return new BPromise(function(_0x4da46b,_0x2a079d){return client[_0x3481('0x10')](_0x52e455,_0x4ab043)[_0x3481('0x11')](function(_0x3aff58){logger[_0x3481('0x12')](_0x3481('0x13'),_0x3da272,_0x3481('0x14'));logger[_0x3481('0x15')](_0x3481('0x16'),_0x3da272,_0x3481('0x14'),JSON[_0x3481('0x17')](_0x3aff58));if(_0x3aff58[_0x3481('0x18')]){if(_0x3aff58['error'][_0x3481('0x19')]===0x1f4){logger[_0x3481('0x18')](_0x3481('0x13'),_0x3da272,_0x3aff58[_0x3481('0x18')][_0x3481('0x1a')]);return _0x2a079d(_0x3aff58[_0x3481('0x18')]['message']);}logger[_0x3481('0x18')](_0x3481('0x13'),_0x3da272,_0x3aff58['error']['message']);return _0x4da46b(_0x3aff58['error']['message']);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x3da272,_0x3481('0x14'));_0x4da46b(_0x3aff58[_0x3481('0x1b')]['message']);}})['catch'](function(_0x11c6b3){logger[_0x3481('0x18')](_0x3481('0x13'),_0x3da272,_0x11c6b3);_0x2a079d(_0x11c6b3);});});}