02db0279db3b4d39af79142b88b3c94bd3a076b7
[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 _0x8803=['then','info','request\x20sent','debug','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x27cd32,_0x24ff36){var _0x405e89=function(_0x46c8e2){while(--_0x46c8e2){_0x27cd32['push'](_0x27cd32['shift']());}};_0x405e89(++_0x24ff36);}(_0x8803,0xbe));var _0x3880=function(_0x491837,_0x1bf150){_0x491837=_0x491837-0x0;var _0x260438=_0x8803[_0x491837];return _0x260438;};'use strict';var _=require(_0x3880('0x0'));var util=require(_0x3880('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3880('0x2'));var fs=require('fs');var Redis=require(_0x3880('0x3'));var db=require(_0x3880('0x4'))['db'];var utils=require(_0x3880('0x5'));var logger=require(_0x3880('0x6'))(_0x3880('0x7'));var config=require(_0x3880('0x8'));var jayson=require(_0x3880('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a2919,_0x5ab3a5,_0x195a3b){return new BPromise(function(_0x18036d,_0x23c825){return client['request'](_0x3a2919,_0x195a3b)[_0x3880('0xa')](function(_0x3c0a86){logger[_0x3880('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x5ab3a5,_0x3880('0xc'));logger[_0x3880('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x5ab3a5,_0x3880('0xc'),JSON['stringify'](_0x3c0a86));if(_0x3c0a86['error']){if(_0x3c0a86[_0x3880('0xe')][_0x3880('0xf')]===0x1f4){logger[_0x3880('0xe')](_0x3880('0x10'),_0x5ab3a5,_0x3c0a86[_0x3880('0xe')]['message']);return _0x23c825(_0x3c0a86[_0x3880('0xe')]['message']);}logger[_0x3880('0xe')](_0x3880('0x10'),_0x5ab3a5,_0x3c0a86['error'][_0x3880('0x11')]);return _0x18036d(_0x3c0a86['error'][_0x3880('0x11')]);}else{logger[_0x3880('0xb')](_0x3880('0x10'),_0x5ab3a5,_0x3880('0xc'));_0x18036d(_0x3c0a86[_0x3880('0x12')][_0x3880('0x11')]);}})[_0x3880('0x13')](function(_0x94f8f7){logger['error'](_0x3880('0x10'),_0x5ab3a5,_0x94f8f7);_0x23c825(_0x94f8f7);});});}