Built motion from commit e6806ed6.|2.6.0
[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 _0x66a3=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result'];(function(_0x28efa4,_0x562bd0){var _0x4dac84=function(_0x5f58b5){while(--_0x5f58b5){_0x28efa4['push'](_0x28efa4['shift']());}};_0x4dac84(++_0x562bd0);}(_0x66a3,0xf2));var _0x366a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x66a3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x366a('0x0'));var util=require(_0x366a('0x1'));var moment=require(_0x366a('0x2'));var BPromise=require(_0x366a('0x3'));var rs=require(_0x366a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x366a('0x5'))['db'];var utils=require(_0x366a('0x6'));var logger=require(_0x366a('0x7'))(_0x366a('0x8'));var config=require(_0x366a('0x9'));var jayson=require(_0x366a('0xa'));var client=jayson['client'][_0x366a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x595a30,_0xfdd27d,_0xb5b230){return new BPromise(function(_0x2a3345,_0x46d3c7){return client[_0x366a('0xc')](_0x595a30,_0xb5b230)[_0x366a('0xd')](function(_0x514b0c){logger[_0x366a('0xe')](_0x366a('0xf'),_0xfdd27d,'request\x20sent');logger[_0x366a('0x10')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0xfdd27d,_0x366a('0x11'),JSON['stringify'](_0x514b0c));if(_0x514b0c['error']){if(_0x514b0c[_0x366a('0x12')][_0x366a('0x13')]===0x1f4){logger[_0x366a('0x12')](_0x366a('0xf'),_0xfdd27d,_0x514b0c[_0x366a('0x12')][_0x366a('0x14')]);return _0x46d3c7(_0x514b0c[_0x366a('0x12')][_0x366a('0x14')]);}logger[_0x366a('0x12')]('UserProfileResource,\x20%s,\x20%s',_0xfdd27d,_0x514b0c[_0x366a('0x12')][_0x366a('0x14')]);return _0x2a3345(_0x514b0c[_0x366a('0x12')][_0x366a('0x14')]);}else{logger[_0x366a('0xe')](_0x366a('0xf'),_0xfdd27d,_0x366a('0x11'));_0x2a3345(_0x514b0c[_0x366a('0x15')][_0x366a('0x14')]);}})['catch'](function(_0x4ab8e4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0xfdd27d,_0x4ab8e4);_0x46d3c7(_0x4ab8e4);});});}