315f02319426daf6c9bcb623888e6980efbf1e61
[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 _0xc25b=['UserProfileSection,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4c6cb,_0x183ca3){var _0x1035e3=function(_0x9746d2){while(--_0x9746d2){_0x4c6cb['push'](_0x4c6cb['shift']());}};_0x1035e3(++_0x183ca3);}(_0xc25b,0x12f));var _0xbc25=function(_0x3488fa,_0xf24b17){_0x3488fa=_0x3488fa-0x0;var _0x23e027=_0xc25b[_0x3488fa];return _0x23e027;};'use strict';var _=require(_0xbc25('0x0'));var util=require(_0xbc25('0x1'));var moment=require(_0xbc25('0x2'));var BPromise=require(_0xbc25('0x3'));var rs=require(_0xbc25('0x4'));var fs=require('fs');var Redis=require(_0xbc25('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbc25('0x6'))(_0xbc25('0x7'));var config=require(_0xbc25('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbc25('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x542d2f,_0x14dd13,_0x298a15){return new BPromise(function(_0x364b75,_0x4451d1){return client[_0xbc25('0xa')](_0x542d2f,_0x298a15)[_0xbc25('0xb')](function(_0x31522f){logger[_0xbc25('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x14dd13,_0xbc25('0xd'));logger['debug'](_0xbc25('0xe'),_0x14dd13,_0xbc25('0xd'),JSON[_0xbc25('0xf')](_0x31522f));if(_0x31522f[_0xbc25('0x10')]){if(_0x31522f[_0xbc25('0x10')]['code']===0x1f4){logger[_0xbc25('0x10')](_0xbc25('0x11'),_0x14dd13,_0x31522f[_0xbc25('0x10')][_0xbc25('0x12')]);return _0x4451d1(_0x31522f[_0xbc25('0x10')][_0xbc25('0x12')]);}logger[_0xbc25('0x10')](_0xbc25('0x11'),_0x14dd13,_0x31522f['error'][_0xbc25('0x12')]);return _0x364b75(_0x31522f[_0xbc25('0x10')][_0xbc25('0x12')]);}else{logger[_0xbc25('0xc')](_0xbc25('0x11'),_0x14dd13,'request\x20sent');_0x364b75(_0x31522f[_0xbc25('0x13')][_0xbc25('0x12')]);}})['catch'](function(_0x88e03b){logger[_0xbc25('0x10')](_0xbc25('0x11'),_0x14dd13,_0x88e03b);_0x4451d1(_0x88e03b);});});}