1e8b70087ca2e440ce445253d1368f1aa508f2af
[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 _0x234d=['debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','request\x20sent'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x234d,0x1d6));var _0xd234=function(_0xd8b980,_0x23906d){_0xd8b980=_0xd8b980-0x0;var _0x22f8ce=_0x234d[_0xd8b980];return _0x22f8ce;};'use strict';var _=require(_0xd234('0x0'));var util=require(_0xd234('0x1'));var moment=require(_0xd234('0x2'));var BPromise=require('bluebird');var rs=require(_0xd234('0x3'));var fs=require('fs');var Redis=require(_0xd234('0x4'));var db=require(_0xd234('0x5'))['db'];var utils=require(_0xd234('0x6'));var logger=require(_0xd234('0x7'))(_0xd234('0x8'));var config=require(_0xd234('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd234('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x260116,_0x28c65b,_0x578c15){return new BPromise(function(_0x87a44c,_0x256e99){return client['request'](_0x260116,_0x578c15)[_0xd234('0xb')](function(_0x8ab0f5){logger[_0xd234('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x28c65b,_0xd234('0xd'));logger[_0xd234('0xe')](_0xd234('0xf'),_0x28c65b,'request\x20sent',JSON[_0xd234('0x10')](_0x8ab0f5));if(_0x8ab0f5['error']){if(_0x8ab0f5[_0xd234('0x11')][_0xd234('0x12')]===0x1f4){logger[_0xd234('0x11')](_0xd234('0x13'),_0x28c65b,_0x8ab0f5[_0xd234('0x11')][_0xd234('0x14')]);return _0x256e99(_0x8ab0f5[_0xd234('0x11')][_0xd234('0x14')]);}logger['error'](_0xd234('0x13'),_0x28c65b,_0x8ab0f5['error'][_0xd234('0x14')]);return _0x87a44c(_0x8ab0f5[_0xd234('0x11')][_0xd234('0x14')]);}else{logger[_0xd234('0xc')](_0xd234('0x13'),_0x28c65b,_0xd234('0xd'));_0x87a44c(_0x8ab0f5['result']['message']);}})[_0xd234('0x15')](function(_0x31cd99){logger['error'](_0xd234('0x13'),_0x28c65b,_0x31cd99);_0x256e99(_0x31cd99);});});}