Built motion from commit (unavailable).|2.4.17
[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 _0x7217=['then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request'];(function(_0x2d7b97,_0x3c00c5){var _0xd20f92=function(_0x217cdf){while(--_0x217cdf){_0x2d7b97['push'](_0x2d7b97['shift']());}};_0xd20f92(++_0x3c00c5);}(_0x7217,0x19e));var _0x7721=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x7217[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});config[_0x7721('0xb')]=_[_0x7721('0xc')](config[_0x7721('0xb')],{'host':_0x7721('0xd'),'port':0x18eb});var socket=require(_0x7721('0xe'))(new Redis(config[_0x7721('0xb')]));require(_0x7721('0xf'))[_0x7721('0x10')](socket);function respondWithRpcPromise(_0x138740,_0x2c3986,_0x578d59){return new BPromise(function(_0x461d1a,_0x29bc8f){return client[_0x7721('0x11')](_0x138740,_0x578d59)[_0x7721('0x12')](function(_0xa8977c){logger[_0x7721('0x13')](_0x7721('0x14'),_0x2c3986,_0x7721('0x15'));logger['debug'](_0x7721('0x16'),_0x2c3986,_0x7721('0x15'),JSON['stringify'](_0xa8977c));if(_0xa8977c[_0x7721('0x17')]){if(_0xa8977c[_0x7721('0x17')][_0x7721('0x18')]===0x1f4){logger[_0x7721('0x17')]('UserProfile,\x20%s,\x20%s',_0x2c3986,_0xa8977c[_0x7721('0x17')][_0x7721('0x19')]);return _0x29bc8f(_0xa8977c['error']['message']);}logger['error'](_0x7721('0x14'),_0x2c3986,_0xa8977c[_0x7721('0x17')][_0x7721('0x19')]);return _0x461d1a(_0xa8977c[_0x7721('0x17')]['message']);}else{logger[_0x7721('0x13')]('UserProfile,\x20%s,\x20%s',_0x2c3986,_0x7721('0x15'));_0x461d1a(_0xa8977c['result'][_0x7721('0x19')]);}})[_0x7721('0x1a')](function(_0x3ab5a5){logger[_0x7721('0x17')](_0x7721('0x14'),_0x2c3986,_0x3ab5a5);_0x29bc8f(_0x3ab5a5);});});}