Built motion from commit b5413ace.|2.6.9
[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 _0x7a4b=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x40b766,_0x2143e1){var _0x22e8cd=function(_0x1c8c50){while(--_0x1c8c50){_0x40b766['push'](_0x40b766['shift']());}};_0x22e8cd(++_0x2143e1);}(_0x7a4b,0x18d));var _0xb7a4=function(_0x5386a5,_0xcc8041){_0x5386a5=_0x5386a5-0x0;var _0x41aca5=_0x7a4b[_0x5386a5];return _0x41aca5;};'use strict';var _=require(_0xb7a4('0x0'));var util=require('util');var moment=require(_0xb7a4('0x1'));var BPromise=require(_0xb7a4('0x2'));var rs=require(_0xb7a4('0x3'));var fs=require('fs');var Redis=require(_0xb7a4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb7a4('0x5'))(_0xb7a4('0x6'));var config=require('../../config/environment');var jayson=require(_0xb7a4('0x7'));var client=jayson['client'][_0xb7a4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe7da39,_0x12e02c,_0x30f544){return new BPromise(function(_0xb9ab12,_0x54128b){return client[_0xb7a4('0x9')](_0xe7da39,_0x30f544)[_0xb7a4('0xa')](function(_0x2479e6){logger[_0xb7a4('0xb')](_0xb7a4('0xc'),_0x12e02c,_0xb7a4('0xd'));logger[_0xb7a4('0xe')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x12e02c,_0xb7a4('0xd'),JSON['stringify'](_0x2479e6));if(_0x2479e6[_0xb7a4('0xf')]){if(_0x2479e6[_0xb7a4('0xf')][_0xb7a4('0x10')]===0x1f4){logger[_0xb7a4('0xf')](_0xb7a4('0xc'),_0x12e02c,_0x2479e6['error'][_0xb7a4('0x11')]);return _0x54128b(_0x2479e6['error'][_0xb7a4('0x11')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x12e02c,_0x2479e6[_0xb7a4('0xf')][_0xb7a4('0x11')]);return _0xb9ab12(_0x2479e6['error'][_0xb7a4('0x11')]);}else{logger[_0xb7a4('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x12e02c,_0xb7a4('0xd'));_0xb9ab12(_0x2479e6[_0xb7a4('0x12')][_0xb7a4('0x11')]);}})[_0xb7a4('0x13')](function(_0x39d62d){logger[_0xb7a4('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x12e02c,_0x39d62d);_0x54128b(_0x39d62d);});});}