c88149e04453e308e1f14d910b587e1c9d7c7591
[motion2.git] / server / api / userProfileResource / userProfileResource.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 _0xffaa=['../../mysqldb','../../config/utils','rpc','../../config/environment','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4d6d87,_0x312568){var _0xa36fd=function(_0x234e84){while(--_0x234e84){_0x4d6d87['push'](_0x4d6d87['shift']());}};_0xa36fd(++_0x312568);}(_0xffaa,0x1e0));var _0xaffa=function(_0x3957dc,_0x525687){_0x3957dc=_0x3957dc-0x0;var _0x107bc4=_0xffaa[_0x3957dc];return _0x107bc4;};'use strict';var _=require(_0xaffa('0x0'));var util=require(_0xaffa('0x1'));var moment=require(_0xaffa('0x2'));var BPromise=require(_0xaffa('0x3'));var rs=require(_0xaffa('0x4'));var fs=require('fs');var Redis=require(_0xaffa('0x5'));var db=require(_0xaffa('0x6'))['db'];var utils=require(_0xaffa('0x7'));var logger=require('../../config/logger')(_0xaffa('0x8'));var config=require(_0xaffa('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21298c,_0x2c0d61,_0x5a6ea6){return new BPromise(function(_0x2e37b6,_0xb9dfb3){return client['request'](_0x21298c,_0x5a6ea6)['then'](function(_0x38189e){logger[_0xaffa('0xa')](_0xaffa('0xb'),_0x2c0d61,_0xaffa('0xc'));logger[_0xaffa('0xd')](_0xaffa('0xe'),_0x2c0d61,_0xaffa('0xc'),JSON['stringify'](_0x38189e));if(_0x38189e[_0xaffa('0xf')]){if(_0x38189e[_0xaffa('0xf')]['code']===0x1f4){logger[_0xaffa('0xf')](_0xaffa('0xb'),_0x2c0d61,_0x38189e[_0xaffa('0xf')][_0xaffa('0x10')]);return _0xb9dfb3(_0x38189e['error'][_0xaffa('0x10')]);}logger[_0xaffa('0xf')](_0xaffa('0xb'),_0x2c0d61,_0x38189e[_0xaffa('0xf')][_0xaffa('0x10')]);return _0x2e37b6(_0x38189e['error'][_0xaffa('0x10')]);}else{logger[_0xaffa('0xa')](_0xaffa('0xb'),_0x2c0d61,'request\x20sent');_0x2e37b6(_0x38189e[_0xaffa('0x11')][_0xaffa('0x10')]);}})['catch'](function(_0x302a64){logger[_0xaffa('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x2c0d61,_0x302a64);_0xb9dfb3(_0x302a64);});});}