d3dfc78185bb2667d608b88f1e2b4cbd244a76ab
[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 _0x8f64=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x41e590,_0x1b06a3){var _0x5266d7=function(_0x2ac434){while(--_0x2ac434){_0x41e590['push'](_0x41e590['shift']());}};_0x5266d7(++_0x1b06a3);}(_0x8f64,0x69));var _0x48f6=function(_0x562a24,_0x4a8a60){_0x562a24=_0x562a24-0x0;var _0x31977e=_0x8f64[_0x562a24];return _0x31977e;};'use strict';var _=require(_0x48f6('0x0'));var util=require(_0x48f6('0x1'));var moment=require(_0x48f6('0x2'));var BPromise=require(_0x48f6('0x3'));var rs=require(_0x48f6('0x4'));var fs=require('fs');var Redis=require(_0x48f6('0x5'));var db=require(_0x48f6('0x6'))['db'];var utils=require(_0x48f6('0x7'));var logger=require('../../config/logger')(_0x48f6('0x8'));var config=require('../../config/environment');var jayson=require(_0x48f6('0x9'));var client=jayson[_0x48f6('0xa')][_0x48f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d71b2,_0x3f1a6e,_0x25e062){return new BPromise(function(_0x23d4bb,_0x5357d1){return client['request'](_0x5d71b2,_0x25e062)['then'](function(_0x536d6d){logger[_0x48f6('0xc')](_0x48f6('0xd'),_0x3f1a6e,_0x48f6('0xe'));logger[_0x48f6('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x3f1a6e,_0x48f6('0xe'),JSON[_0x48f6('0x10')](_0x536d6d));if(_0x536d6d[_0x48f6('0x11')]){if(_0x536d6d['error'][_0x48f6('0x12')]===0x1f4){logger[_0x48f6('0x11')](_0x48f6('0xd'),_0x3f1a6e,_0x536d6d['error']['message']);return _0x5357d1(_0x536d6d['error'][_0x48f6('0x13')]);}logger[_0x48f6('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x3f1a6e,_0x536d6d['error'][_0x48f6('0x13')]);return _0x23d4bb(_0x536d6d['error'][_0x48f6('0x13')]);}else{logger[_0x48f6('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x3f1a6e,'request\x20sent');_0x23d4bb(_0x536d6d[_0x48f6('0x14')]['message']);}})[_0x48f6('0x15')](function(_0x4f071d){logger[_0x48f6('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x3f1a6e,_0x4f071d);_0x5357d1(_0x4f071d);});});}