Built motion from commit (unavailable).|2.5.6
[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 _0xbdf3=['http','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0xf298dc,_0x464b47){var _0xf9cd87=function(_0x5c1448){while(--_0x5c1448){_0xf298dc['push'](_0xf298dc['shift']());}};_0xf9cd87(++_0x464b47);}(_0xbdf3,0x155));var _0x3bdf=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0xbdf3[_0x2e0443];return _0x52d450;};'use strict';var _=require(_0x3bdf('0x0'));var util=require(_0x3bdf('0x1'));var moment=require(_0x3bdf('0x2'));var BPromise=require(_0x3bdf('0x3'));var rs=require(_0x3bdf('0x4'));var fs=require('fs');var Redis=require(_0x3bdf('0x5'));var db=require(_0x3bdf('0x6'))['db'];var utils=require(_0x3bdf('0x7'));var logger=require('../../config/logger')(_0x3bdf('0x8'));var config=require(_0x3bdf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3bdf('0xa')][_0x3bdf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2660c0,_0x361d18,_0x10b306){return new BPromise(function(_0x12b04d,_0x1b03af){return client['request'](_0x2660c0,_0x10b306)['then'](function(_0x1090b6){logger[_0x3bdf('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x361d18,_0x3bdf('0xd'));logger['debug'](_0x3bdf('0xe'),_0x361d18,_0x3bdf('0xd'),JSON[_0x3bdf('0xf')](_0x1090b6));if(_0x1090b6['error']){if(_0x1090b6[_0x3bdf('0x10')][_0x3bdf('0x11')]===0x1f4){logger[_0x3bdf('0x10')](_0x3bdf('0x12'),_0x361d18,_0x1090b6[_0x3bdf('0x10')][_0x3bdf('0x13')]);return _0x1b03af(_0x1090b6['error'][_0x3bdf('0x13')]);}logger[_0x3bdf('0x10')](_0x3bdf('0x12'),_0x361d18,_0x1090b6[_0x3bdf('0x10')]['message']);return _0x12b04d(_0x1090b6[_0x3bdf('0x10')][_0x3bdf('0x13')]);}else{logger[_0x3bdf('0xc')](_0x3bdf('0x12'),_0x361d18,_0x3bdf('0xd'));_0x12b04d(_0x1090b6[_0x3bdf('0x14')]['message']);}})[_0x3bdf('0x15')](function(_0x22c4e7){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x361d18,_0x22c4e7);_0x1b03af(_0x22c4e7);});});}