e6ff390baea8f087fa9466bf1338d5b2f89fecb0
[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 _0xcba0=['util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfileSection,\x20%s,\x20%s','catch','lodash'];(function(_0x1ede24,_0x2c365b){var _0x11a555=function(_0x46bb8b){while(--_0x46bb8b){_0x1ede24['push'](_0x1ede24['shift']());}};_0x11a555(++_0x2c365b);}(_0xcba0,0xe3));var _0x0cba=function(_0x1b4d97,_0x37d112){_0x1b4d97=_0x1b4d97-0x0;var _0x1dd095=_0xcba0[_0x1b4d97];return _0x1dd095;};'use strict';var _=require(_0x0cba('0x0'));var util=require(_0x0cba('0x1'));var moment=require(_0x0cba('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0cba('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cba('0x4'))(_0x0cba('0x5'));var config=require('../../config/environment');var jayson=require(_0x0cba('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x57711c,_0x2a0c69,_0x800f1c){return new BPromise(function(_0x512108,_0x111d4f){return client[_0x0cba('0x7')](_0x57711c,_0x800f1c)[_0x0cba('0x8')](function(_0x48bf47){logger[_0x0cba('0x9')]('UserProfileSection,\x20%s,\x20%s',_0x2a0c69,_0x0cba('0xa'));logger[_0x0cba('0xb')](_0x0cba('0xc'),_0x2a0c69,_0x0cba('0xa'),JSON[_0x0cba('0xd')](_0x48bf47));if(_0x48bf47[_0x0cba('0xe')]){if(_0x48bf47['error'][_0x0cba('0xf')]===0x1f4){logger[_0x0cba('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x2a0c69,_0x48bf47[_0x0cba('0xe')][_0x0cba('0x10')]);return _0x111d4f(_0x48bf47[_0x0cba('0xe')][_0x0cba('0x10')]);}logger[_0x0cba('0xe')](_0x0cba('0x11'),_0x2a0c69,_0x48bf47[_0x0cba('0xe')][_0x0cba('0x10')]);return _0x512108(_0x48bf47['error']['message']);}else{logger['info'](_0x0cba('0x11'),_0x2a0c69,_0x0cba('0xa'));_0x512108(_0x48bf47['result'][_0x0cba('0x10')]);}})[_0x0cba('0x12')](function(_0x5b1736){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x2a0c69,_0x5b1736);_0x111d4f(_0x5b1736);});});}