Built motion from commit 85328c08.|2.5.50
[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 _0x26d4=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','UserProfileSection,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x3c8e3e,_0x5d5270){var _0x45a773=function(_0x5158ad){while(--_0x5158ad){_0x3c8e3e['push'](_0x3c8e3e['shift']());}};_0x45a773(++_0x5d5270);}(_0x26d4,0xab));var _0x426d=function(_0xd5dbd8,_0x42affa){_0xd5dbd8=_0xd5dbd8-0x0;var _0x55e117=_0x26d4[_0xd5dbd8];return _0x55e117;};'use strict';var _=require(_0x426d('0x0'));var util=require('util');var moment=require(_0x426d('0x1'));var BPromise=require(_0x426d('0x2'));var rs=require(_0x426d('0x3'));var fs=require('fs');var Redis=require(_0x426d('0x4'));var db=require(_0x426d('0x5'))['db'];var utils=require(_0x426d('0x6'));var logger=require('../../config/logger')(_0x426d('0x7'));var config=require(_0x426d('0x8'));var jayson=require(_0x426d('0x9'));var client=jayson[_0x426d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c2055,_0x5185da,_0x578109){return new BPromise(function(_0x4805c6,_0x47107c){return client[_0x426d('0xb')](_0x5c2055,_0x578109)[_0x426d('0xc')](function(_0x2d1a95){logger[_0x426d('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x5185da,_0x426d('0xe'));logger[_0x426d('0xf')](_0x426d('0x10'),_0x5185da,_0x426d('0xe'),JSON[_0x426d('0x11')](_0x2d1a95));if(_0x2d1a95[_0x426d('0x12')]){if(_0x2d1a95[_0x426d('0x12')]['code']===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x5185da,_0x2d1a95[_0x426d('0x12')][_0x426d('0x13')]);return _0x47107c(_0x2d1a95[_0x426d('0x12')]['message']);}logger['error'](_0x426d('0x14'),_0x5185da,_0x2d1a95[_0x426d('0x12')][_0x426d('0x13')]);return _0x4805c6(_0x2d1a95[_0x426d('0x12')][_0x426d('0x13')]);}else{logger['info'](_0x426d('0x14'),_0x5185da,'request\x20sent');_0x4805c6(_0x2d1a95[_0x426d('0x15')]['message']);}})['catch'](function(_0x4ea2f6){logger[_0x426d('0x12')](_0x426d('0x14'),_0x5185da,_0x4ea2f6);_0x47107c(_0x4ea2f6);});});}