Built motion from commit eddce310.|2.6.12
[motion2.git] / server / api / userProfileSection / userProfileSection.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 _0xd90d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','bluebird','ioredis'];(function(_0x31cd7a,_0xbc2f48){var _0x4fbdff=function(_0x162d89){while(--_0x162d89){_0x31cd7a['push'](_0x31cd7a['shift']());}};_0x4fbdff(++_0xbc2f48);}(_0xd90d,0x165));var _0xdd90=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0xd90d[_0x2df507];return _0x1f7167;};'use strict';var _=require(_0xdd90('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdd90('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd90('0x2'));var db=require(_0xdd90('0x3'))['db'];var utils=require(_0xdd90('0x4'));var logger=require(_0xdd90('0x5'))(_0xdd90('0x6'));var config=require(_0xdd90('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdd90('0x8')][_0xdd90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c55f4,_0x2f9429,_0x452e1d){return new BPromise(function(_0xb0a0a4,_0x3aaea1){return client[_0xdd90('0xa')](_0x2c55f4,_0x452e1d)['then'](function(_0x115fd7){logger[_0xdd90('0xb')](_0xdd90('0xc'),_0x2f9429,_0xdd90('0xd'));logger['debug'](_0xdd90('0xe'),_0x2f9429,_0xdd90('0xd'),JSON['stringify'](_0x115fd7));if(_0x115fd7[_0xdd90('0xf')]){if(_0x115fd7[_0xdd90('0xf')]['code']===0x1f4){logger[_0xdd90('0xf')](_0xdd90('0xc'),_0x2f9429,_0x115fd7['error'][_0xdd90('0x10')]);return _0x3aaea1(_0x115fd7[_0xdd90('0xf')][_0xdd90('0x10')]);}logger[_0xdd90('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x2f9429,_0x115fd7[_0xdd90('0xf')][_0xdd90('0x10')]);return _0xb0a0a4(_0x115fd7[_0xdd90('0xf')][_0xdd90('0x10')]);}else{logger[_0xdd90('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x2f9429,_0xdd90('0xd'));_0xb0a0a4(_0x115fd7['result']['message']);}})[_0xdd90('0x11')](function(_0x7c0d5d){logger[_0xdd90('0xf')](_0xdd90('0xc'),_0x2f9429,_0x7c0d5d);_0x3aaea1(_0x7c0d5d);});});}