c2c09663b858cb989f1c9fa9de9f7600e0955ca6
[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 _0xce2a=['request','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x158da6,_0x3cb06d){var _0x429c30=function(_0x2d5895){while(--_0x2d5895){_0x158da6['push'](_0x158da6['shift']());}};_0x429c30(++_0x3cb06d);}(_0xce2a,0xd3));var _0xace2=function(_0x4337fe,_0x116365){_0x4337fe=_0x4337fe-0x0;var _0xa3b734=_0xce2a[_0x4337fe];return _0xa3b734;};'use strict';var _=require('lodash');var util=require(_0xace2('0x0'));var moment=require(_0xace2('0x1'));var BPromise=require(_0xace2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xace2('0x3'));var db=require(_0xace2('0x4'))['db'];var utils=require(_0xace2('0x5'));var logger=require('../../config/logger')(_0xace2('0x6'));var config=require('../../config/environment');var jayson=require(_0xace2('0x7'));var client=jayson[_0xace2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5295a0,_0x298f9c,_0x1e6111){return new BPromise(function(_0x3f6540,_0x144669){return client[_0xace2('0x9')](_0x5295a0,_0x1e6111)['then'](function(_0x14e69e){logger[_0xace2('0xa')]('UserProfileSection,\x20%s,\x20%s',_0x298f9c,_0xace2('0xb'));logger[_0xace2('0xc')](_0xace2('0xd'),_0x298f9c,_0xace2('0xb'),JSON[_0xace2('0xe')](_0x14e69e));if(_0x14e69e[_0xace2('0xf')]){if(_0x14e69e[_0xace2('0xf')][_0xace2('0x10')]===0x1f4){logger[_0xace2('0xf')](_0xace2('0x11'),_0x298f9c,_0x14e69e[_0xace2('0xf')][_0xace2('0x12')]);return _0x144669(_0x14e69e[_0xace2('0xf')]['message']);}logger['error'](_0xace2('0x11'),_0x298f9c,_0x14e69e[_0xace2('0xf')][_0xace2('0x12')]);return _0x3f6540(_0x14e69e[_0xace2('0xf')][_0xace2('0x12')]);}else{logger['info'](_0xace2('0x11'),_0x298f9c,_0xace2('0xb'));_0x3f6540(_0x14e69e[_0xace2('0x13')][_0xace2('0x12')]);}})['catch'](function(_0xc9d38e){logger[_0xace2('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x298f9c,_0xc9d38e);_0x144669(_0xc9d38e);});});}