a1d41b629b993cbac1176852f61350ff0f3c6145
[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 _0x7ed2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x7ed2,0x16b));var _0x27ed=function(_0x3c67a3,_0x1a4cc3){_0x3c67a3=_0x3c67a3-0x0;var _0x1ff2ca=_0x7ed2[_0x3c67a3];return _0x1ff2ca;};'use strict';var _=require(_0x27ed('0x0'));var util=require(_0x27ed('0x1'));var moment=require(_0x27ed('0x2'));var BPromise=require(_0x27ed('0x3'));var rs=require(_0x27ed('0x4'));var fs=require('fs');var Redis=require(_0x27ed('0x5'));var db=require(_0x27ed('0x6'))['db'];var utils=require(_0x27ed('0x7'));var logger=require(_0x27ed('0x8'))(_0x27ed('0x9'));var config=require(_0x27ed('0xa'));var jayson=require(_0x27ed('0xb'));var client=jayson['client'][_0x27ed('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x409170,_0x15c2a4,_0x106537){return new BPromise(function(_0x2befc,_0x77931c){return client['request'](_0x409170,_0x106537)['then'](function(_0x219fc4){logger['info'](_0x27ed('0xd'),_0x15c2a4,_0x27ed('0xe'));logger[_0x27ed('0xf')](_0x27ed('0x10'),_0x15c2a4,_0x27ed('0xe'),JSON[_0x27ed('0x11')](_0x219fc4));if(_0x219fc4[_0x27ed('0x12')]){if(_0x219fc4['error']['code']===0x1f4){logger['error'](_0x27ed('0xd'),_0x15c2a4,_0x219fc4[_0x27ed('0x12')][_0x27ed('0x13')]);return _0x77931c(_0x219fc4[_0x27ed('0x12')][_0x27ed('0x13')]);}logger[_0x27ed('0x12')](_0x27ed('0xd'),_0x15c2a4,_0x219fc4[_0x27ed('0x12')]['message']);return _0x2befc(_0x219fc4[_0x27ed('0x12')]['message']);}else{logger[_0x27ed('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x15c2a4,_0x27ed('0xe'));_0x2befc(_0x219fc4[_0x27ed('0x15')][_0x27ed('0x13')]);}})[_0x27ed('0x16')](function(_0x25f100){logger[_0x27ed('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x15c2a4,_0x25f100);_0x77931c(_0x25f100);});});}