67e480fc18dc018f70e7272d5e0680687aed85c5
[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 _0x5b98=['error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x40ebff,_0x1dd15e){var _0x40122a=function(_0xae6174){while(--_0xae6174){_0x40ebff['push'](_0x40ebff['shift']());}};_0x40122a(++_0x1dd15e);}(_0x5b98,0xad));var _0x85b9=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0x5b98[_0x5b8b97];return _0x1fdf84;};'use strict';var _=require(_0x85b9('0x0'));var util=require('util');var moment=require(_0x85b9('0x1'));var BPromise=require('bluebird');var rs=require(_0x85b9('0x2'));var fs=require('fs');var Redis=require(_0x85b9('0x3'));var db=require(_0x85b9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x85b9('0x5'))(_0x85b9('0x6'));var config=require(_0x85b9('0x7'));var jayson=require(_0x85b9('0x8'));var client=jayson[_0x85b9('0x9')][_0x85b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49a247,_0x5977f7,_0xf57659){return new BPromise(function(_0x55873d,_0x3a7669){return client['request'](_0x49a247,_0xf57659)['then'](function(_0xdc800f){logger[_0x85b9('0xb')](_0x85b9('0xc'),_0x5977f7,_0x85b9('0xd'));logger[_0x85b9('0xe')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x5977f7,_0x85b9('0xd'),JSON[_0x85b9('0xf')](_0xdc800f));if(_0xdc800f[_0x85b9('0x10')]){if(_0xdc800f['error'][_0x85b9('0x11')]===0x1f4){logger[_0x85b9('0x10')](_0x85b9('0xc'),_0x5977f7,_0xdc800f[_0x85b9('0x10')][_0x85b9('0x12')]);return _0x3a7669(_0xdc800f[_0x85b9('0x10')]['message']);}logger[_0x85b9('0x10')](_0x85b9('0xc'),_0x5977f7,_0xdc800f['error']['message']);return _0x55873d(_0xdc800f[_0x85b9('0x10')][_0x85b9('0x12')]);}else{logger[_0x85b9('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x5977f7,_0x85b9('0xd'));_0x55873d(_0xdc800f[_0x85b9('0x13')][_0x85b9('0x12')]);}})[_0x85b9('0x14')](function(_0x32d001){logger[_0x85b9('0x10')](_0x85b9('0xc'),_0x5977f7,_0x32d001);_0x3a7669(_0x32d001);});});}