7e23973ffa73379d2fe79759ca81033526854c73
[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 _0x2649=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','moment'];(function(_0x51c7a0,_0xf518de){var _0x2602d7=function(_0x5c3538){while(--_0x5c3538){_0x51c7a0['push'](_0x51c7a0['shift']());}};_0x2602d7(++_0xf518de);}(_0x2649,0x133));var _0x9264=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x2649[_0x56916d];return _0x2b7f1f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9264('0x0'));var BPromise=require(_0x9264('0x1'));var rs=require(_0x9264('0x2'));var fs=require('fs');var Redis=require(_0x9264('0x3'));var db=require(_0x9264('0x4'))['db'];var utils=require(_0x9264('0x5'));var logger=require(_0x9264('0x6'))(_0x9264('0x7'));var config=require(_0x9264('0x8'));var jayson=require(_0x9264('0x9'));var client=jayson[_0x9264('0xa')][_0x9264('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ce4ef,_0x38fd75,_0x4c97c9){return new BPromise(function(_0x502d88,_0x156788){return client[_0x9264('0xc')](_0x5ce4ef,_0x4c97c9)[_0x9264('0xd')](function(_0x44b2a2){logger[_0x9264('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x38fd75,_0x9264('0xf'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x38fd75,_0x9264('0xf'),JSON[_0x9264('0x10')](_0x44b2a2));if(_0x44b2a2['error']){if(_0x44b2a2[_0x9264('0x11')][_0x9264('0x12')]===0x1f4){logger[_0x9264('0x11')](_0x9264('0x13'),_0x38fd75,_0x44b2a2[_0x9264('0x11')][_0x9264('0x14')]);return _0x156788(_0x44b2a2[_0x9264('0x11')][_0x9264('0x14')]);}logger[_0x9264('0x11')](_0x9264('0x13'),_0x38fd75,_0x44b2a2[_0x9264('0x11')][_0x9264('0x14')]);return _0x502d88(_0x44b2a2[_0x9264('0x11')][_0x9264('0x14')]);}else{logger[_0x9264('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x38fd75,_0x9264('0xf'));_0x502d88(_0x44b2a2[_0x9264('0x15')]['message']);}})['catch'](function(_0x5ee382){logger[_0x9264('0x11')](_0x9264('0x13'),_0x38fd75,_0x5ee382);_0x156788(_0x5ee382);});});}