Built motion from commit f0b1811d.|2.6.6
[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 _0x4e83=['bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','redis','defaults','socket.io-emitter','./userProfile.socket','request','then','info','request\x20sent','debug','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x33a5ca,_0x3b9fc4){var _0x156125=function(_0x202dd7){while(--_0x202dd7){_0x33a5ca['push'](_0x33a5ca['shift']());}};_0x156125(++_0x3b9fc4);}(_0x4e83,0x1ae));var _0x34e8=function(_0x34e14d,_0x5dea39){_0x34e14d=_0x34e14d-0x0;var _0x3d8e08=_0x4e83[_0x34e14d];return _0x3d8e08;};'use strict';var _=require(_0x34e8('0x0'));var util=require('util');var moment=require(_0x34e8('0x1'));var BPromise=require(_0x34e8('0x2'));var rs=require(_0x34e8('0x3'));var fs=require('fs');var Redis=require(_0x34e8('0x4'));var db=require(_0x34e8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x34e8('0x6'));var client=jayson[_0x34e8('0x7')]['http']({'port':0x232a});config[_0x34e8('0x8')]=_[_0x34e8('0x9')](config[_0x34e8('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x34e8('0xa'))(new Redis(config[_0x34e8('0x8')]));require(_0x34e8('0xb'))['register'](socket);function respondWithRpcPromise(_0x8ad56d,_0x1e3038,_0x42bb8d){return new BPromise(function(_0x46fe66,_0x316e99){return client[_0x34e8('0xc')](_0x8ad56d,_0x42bb8d)[_0x34e8('0xd')](function(_0x6827a3){logger[_0x34e8('0xe')]('UserProfile,\x20%s,\x20%s',_0x1e3038,_0x34e8('0xf'));logger[_0x34e8('0x10')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x1e3038,_0x34e8('0xf'),JSON[_0x34e8('0x11')](_0x6827a3));if(_0x6827a3[_0x34e8('0x12')]){if(_0x6827a3[_0x34e8('0x12')][_0x34e8('0x13')]===0x1f4){logger[_0x34e8('0x12')](_0x34e8('0x14'),_0x1e3038,_0x6827a3[_0x34e8('0x12')][_0x34e8('0x15')]);return _0x316e99(_0x6827a3['error'][_0x34e8('0x15')]);}logger[_0x34e8('0x12')](_0x34e8('0x14'),_0x1e3038,_0x6827a3[_0x34e8('0x12')][_0x34e8('0x15')]);return _0x46fe66(_0x6827a3['error'][_0x34e8('0x15')]);}else{logger[_0x34e8('0xe')](_0x34e8('0x14'),_0x1e3038,_0x34e8('0xf'));_0x46fe66(_0x6827a3[_0x34e8('0x16')][_0x34e8('0x15')]);}})[_0x34e8('0x17')](function(_0x3eb461){logger[_0x34e8('0x12')](_0x34e8('0x14'),_0x1e3038,_0x3eb461);_0x316e99(_0x3eb461);});});}