06c95c5ccf8bd0db03dd6739cbf59cf60f3d0fe9
[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 _0xb46f=['error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xbc4659,_0x578fba){var _0x5831f9=function(_0x5eb0eb){while(--_0x5eb0eb){_0xbc4659['push'](_0xbc4659['shift']());}};_0x5831f9(++_0x578fba);}(_0xb46f,0xb6));var _0xfb46=function(_0x332f30,_0x34a75a){_0x332f30=_0x332f30-0x0;var _0x38718f=_0xb46f[_0x332f30];return _0x38718f;};'use strict';var _=require(_0xfb46('0x0'));var util=require(_0xfb46('0x1'));var moment=require('moment');var BPromise=require(_0xfb46('0x2'));var rs=require(_0xfb46('0x3'));var fs=require('fs');var Redis=require(_0xfb46('0x4'));var db=require(_0xfb46('0x5'))['db'];var utils=require(_0xfb46('0x6'));var logger=require('../../config/logger')(_0xfb46('0x7'));var config=require('../../config/environment');var jayson=require(_0xfb46('0x8'));var client=jayson[_0xfb46('0x9')][_0xfb46('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1efd40,_0x35103d,_0x47c1a2){return new BPromise(function(_0x9871f5,_0x298a84){return client['request'](_0x1efd40,_0x47c1a2)['then'](function(_0x5bb51a){logger['info'](_0xfb46('0xb'),_0x35103d,'request\x20sent');logger[_0xfb46('0xc')](_0xfb46('0xd'),_0x35103d,_0xfb46('0xe'),JSON[_0xfb46('0xf')](_0x5bb51a));if(_0x5bb51a[_0xfb46('0x10')]){if(_0x5bb51a[_0xfb46('0x10')][_0xfb46('0x11')]===0x1f4){logger[_0xfb46('0x10')](_0xfb46('0xb'),_0x35103d,_0x5bb51a[_0xfb46('0x10')]['message']);return _0x298a84(_0x5bb51a['error'][_0xfb46('0x12')]);}logger['error'](_0xfb46('0xb'),_0x35103d,_0x5bb51a[_0xfb46('0x10')]['message']);return _0x9871f5(_0x5bb51a[_0xfb46('0x10')][_0xfb46('0x12')]);}else{logger[_0xfb46('0x13')](_0xfb46('0xb'),_0x35103d,'request\x20sent');_0x9871f5(_0x5bb51a[_0xfb46('0x14')][_0xfb46('0x12')]);}})[_0xfb46('0x15')](function(_0x4d3b3e){logger[_0xfb46('0x10')](_0xfb46('0xb'),_0x35103d,_0x4d3b3e);_0x298a84(_0x4d3b3e);});});}