Built motion from commit 64440dd5.|2.6.29
[motion2.git] / server / api / userProfileResource / userProfileResource.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 _0x821a=['request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','util','moment','ioredis','../../mysqldb','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x821a,0x9b));var _0xa821=function(_0x229262,_0x268c68){_0x229262=_0x229262-0x0;var _0x54431b=_0x821a[_0x229262];return _0x54431b;};'use strict';var _=require('lodash');var util=require(_0xa821('0x0'));var moment=require(_0xa821('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa821('0x2'));var db=require(_0xa821('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa821('0x4'));var client=jayson[_0xa821('0x5')][_0xa821('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x31f1f9,_0x485a4d,_0x35f199){return new BPromise(function(_0x1bd4a3,_0x149de9){return client[_0xa821('0x7')](_0x31f1f9,_0x35f199)[_0xa821('0x8')](function(_0x34f408){logger['info'](_0xa821('0x9'),_0x485a4d,_0xa821('0xa'));logger[_0xa821('0xb')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x485a4d,'request\x20sent',JSON[_0xa821('0xc')](_0x34f408));if(_0x34f408['error']){if(_0x34f408[_0xa821('0xd')][_0xa821('0xe')]===0x1f4){logger[_0xa821('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x485a4d,_0x34f408['error'][_0xa821('0xf')]);return _0x149de9(_0x34f408[_0xa821('0xd')]['message']);}logger[_0xa821('0xd')](_0xa821('0x9'),_0x485a4d,_0x34f408[_0xa821('0xd')]['message']);return _0x1bd4a3(_0x34f408[_0xa821('0xd')]['message']);}else{logger[_0xa821('0x10')](_0xa821('0x9'),_0x485a4d,_0xa821('0xa'));_0x1bd4a3(_0x34f408[_0xa821('0x11')][_0xa821('0xf')]);}})['catch'](function(_0x2a5e0a){logger[_0xa821('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x485a4d,_0x2a5e0a);_0x149de9(_0x2a5e0a);});});}