e4a2b40bf246df33f5f532ca9a27d967f4a32b6b
[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 _0x22ec=['request\x20sent','debug','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s'];(function(_0x5af2a9,_0x5ca276){var _0x1698c4=function(_0x4d5d02){while(--_0x4d5d02){_0x5af2a9['push'](_0x5af2a9['shift']());}};_0x1698c4(++_0x5ca276);}(_0x22ec,0x183));var _0xc22e=function(_0x4c5c1d,_0x4dccee){_0x4c5c1d=_0x4c5c1d-0x0;var _0x1da77f=_0x22ec[_0x4c5c1d];return _0x1da77f;};'use strict';var _=require(_0xc22e('0x0'));var util=require(_0xc22e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc22e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc22e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc22e('0x4'))('rpc');var config=require(_0xc22e('0x5'));var jayson=require(_0xc22e('0x6'));var client=jayson[_0xc22e('0x7')][_0xc22e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5eeefe,_0x3ebec7,_0x2c3cdf){return new BPromise(function(_0x596826,_0x57baa0){return client[_0xc22e('0x9')](_0x5eeefe,_0x2c3cdf)[_0xc22e('0xa')](function(_0x3d24f1){logger['info'](_0xc22e('0xb'),_0x3ebec7,_0xc22e('0xc'));logger[_0xc22e('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x3ebec7,_0xc22e('0xc'),JSON['stringify'](_0x3d24f1));if(_0x3d24f1[_0xc22e('0xe')]){if(_0x3d24f1[_0xc22e('0xe')][_0xc22e('0xf')]===0x1f4){logger[_0xc22e('0xe')](_0xc22e('0xb'),_0x3ebec7,_0x3d24f1[_0xc22e('0xe')][_0xc22e('0x10')]);return _0x57baa0(_0x3d24f1['error'][_0xc22e('0x10')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x3ebec7,_0x3d24f1[_0xc22e('0xe')][_0xc22e('0x10')]);return _0x596826(_0x3d24f1[_0xc22e('0xe')][_0xc22e('0x10')]);}else{logger['info'](_0xc22e('0xb'),_0x3ebec7,'request\x20sent');_0x596826(_0x3d24f1[_0xc22e('0x11')][_0xc22e('0x10')]);}})[_0xc22e('0x12')](function(_0x341b2e){logger['error'](_0xc22e('0xb'),_0x3ebec7,_0x341b2e);_0x57baa0(_0x341b2e);});});}