Built motion from commit (unavailable).|2.5.10
[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 _0x3f8a=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x487faf,_0x22fe22){var _0x38cce1=function(_0xa62dd6){while(--_0xa62dd6){_0x487faf['push'](_0x487faf['shift']());}};_0x38cce1(++_0x22fe22);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x39ba0a,_0x337d9c){_0x39ba0a=_0x39ba0a-0x0;var _0x13f42d=_0x3f8a[_0x39ba0a];return _0x13f42d;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});config[_0xa3f8('0xd')]=_[_0xa3f8('0xe')](config[_0xa3f8('0xd')],{'host':_0xa3f8('0xf'),'port':0x18eb});var socket=require(_0xa3f8('0x10'))(new Redis(config[_0xa3f8('0xd')]));require(_0xa3f8('0x11'))[_0xa3f8('0x12')](socket);function respondWithRpcPromise(_0x5c3288,_0x47496a,_0x13a082){return new BPromise(function(_0x3c1833,_0x22dcda){return client['request'](_0x5c3288,_0x13a082)[_0xa3f8('0x13')](function(_0x26f0a0){logger[_0xa3f8('0x14')](_0xa3f8('0x15'),_0x47496a,_0xa3f8('0x16'));logger[_0xa3f8('0x17')](_0xa3f8('0x18'),_0x47496a,_0xa3f8('0x16'),JSON[_0xa3f8('0x19')](_0x26f0a0));if(_0x26f0a0[_0xa3f8('0x1a')]){if(_0x26f0a0[_0xa3f8('0x1a')][_0xa3f8('0x1b')]===0x1f4){logger['error'](_0xa3f8('0x15'),_0x47496a,_0x26f0a0[_0xa3f8('0x1a')][_0xa3f8('0x1c')]);return _0x22dcda(_0x26f0a0[_0xa3f8('0x1a')]['message']);}logger[_0xa3f8('0x1a')](_0xa3f8('0x15'),_0x47496a,_0x26f0a0[_0xa3f8('0x1a')][_0xa3f8('0x1c')]);return _0x3c1833(_0x26f0a0[_0xa3f8('0x1a')][_0xa3f8('0x1c')]);}else{logger[_0xa3f8('0x14')](_0xa3f8('0x15'),_0x47496a,_0xa3f8('0x16'));_0x3c1833(_0x26f0a0[_0xa3f8('0x1d')]['message']);}})[_0xa3f8('0x1e')](function(_0x5a0e18){logger[_0xa3f8('0x1a')](_0xa3f8('0x15'),_0x47496a,_0x5a0e18);_0x22dcda(_0x5a0e18);});});}