Built motion from commit (unavailable).|2.5.2
[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 _0x038b=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x292037,_0x3fbd07){var _0x4e3bff=function(_0x43e77e){while(--_0x43e77e){_0x292037['push'](_0x292037['shift']());}};_0x4e3bff(++_0x3fbd07);}(_0x038b,0x114));var _0xb038=function(_0x3b79df,_0x3af6ae){_0x3b79df=_0x3b79df-0x0;var _0x560767=_0x038b[_0x3b79df];return _0x560767;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var moment=require(_0xb038('0x1'));var BPromise=require(_0xb038('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb038('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb038('0x4'));var logger=require(_0xb038('0x5'))('rpc');var config=require(_0xb038('0x6'));var jayson=require(_0xb038('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xb038('0x8')]=_[_0xb038('0x9')](config[_0xb038('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb038('0x8')]));require(_0xb038('0xa'))['register'](socket);function respondWithRpcPromise(_0x53bcc0,_0xe3d046,_0x2d1ae5){return new BPromise(function(_0x5c96b5,_0x2ede0b){return client[_0xb038('0xb')](_0x53bcc0,_0x2d1ae5)[_0xb038('0xc')](function(_0x3368c1){logger[_0xb038('0xd')](_0xb038('0xe'),_0xe3d046,_0xb038('0xf'));logger[_0xb038('0x10')](_0xb038('0x11'),_0xe3d046,_0xb038('0xf'),JSON[_0xb038('0x12')](_0x3368c1));if(_0x3368c1[_0xb038('0x13')]){if(_0x3368c1[_0xb038('0x13')][_0xb038('0x14')]===0x1f4){logger[_0xb038('0x13')](_0xb038('0xe'),_0xe3d046,_0x3368c1[_0xb038('0x13')]['message']);return _0x2ede0b(_0x3368c1[_0xb038('0x13')][_0xb038('0x15')]);}logger[_0xb038('0x13')](_0xb038('0xe'),_0xe3d046,_0x3368c1[_0xb038('0x13')][_0xb038('0x15')]);return _0x5c96b5(_0x3368c1['error'][_0xb038('0x15')]);}else{logger[_0xb038('0xd')](_0xb038('0xe'),_0xe3d046,_0xb038('0xf'));_0x5c96b5(_0x3368c1['result']['message']);}})[_0xb038('0x16')](function(_0x3f48e6){logger[_0xb038('0x13')](_0xb038('0xe'),_0xe3d046,_0x3f48e6);_0x2ede0b(_0x3f48e6);});});}