Built motion from commit 85328c08.|2.5.50
[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 _0xe35c=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird'];(function(_0x12db6f,_0x159040){var _0x329190=function(_0x3e95d6){while(--_0x3e95d6){_0x12db6f['push'](_0x12db6f['shift']());}};_0x329190(++_0x159040);}(_0xe35c,0x75));var _0xce35=function(_0x579faa,_0x279b7a){_0x579faa=_0x579faa-0x0;var _0x3f11f1=_0xe35c[_0x579faa];return _0x3f11f1;};'use strict';var _=require(_0xce35('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xce35('0x1'));var rs=require(_0xce35('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xce35('0x3'));var logger=require(_0xce35('0x4'))(_0xce35('0x5'));var config=require('../../config/environment');var jayson=require(_0xce35('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4196df,_0x17ac48,_0x5c0972){return new BPromise(function(_0x3ad364,_0xa6a928){return client['request'](_0x4196df,_0x5c0972)[_0xce35('0x7')](function(_0x35c455){logger[_0xce35('0x8')](_0xce35('0x9'),_0x17ac48,_0xce35('0xa'));logger[_0xce35('0xb')](_0xce35('0xc'),_0x17ac48,'request\x20sent',JSON[_0xce35('0xd')](_0x35c455));if(_0x35c455[_0xce35('0xe')]){if(_0x35c455[_0xce35('0xe')]['code']===0x1f4){logger[_0xce35('0xe')](_0xce35('0x9'),_0x17ac48,_0x35c455['error'][_0xce35('0xf')]);return _0xa6a928(_0x35c455[_0xce35('0xe')][_0xce35('0xf')]);}logger[_0xce35('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x17ac48,_0x35c455['error'][_0xce35('0xf')]);return _0x3ad364(_0x35c455[_0xce35('0xe')][_0xce35('0xf')]);}else{logger[_0xce35('0x8')]('UserProfileResource,\x20%s,\x20%s',_0x17ac48,_0xce35('0xa'));_0x3ad364(_0x35c455[_0xce35('0x10')][_0xce35('0xf')]);}})['catch'](function(_0x391fe4){logger['error'](_0xce35('0x9'),_0x17ac48,_0x391fe4);_0xa6a928(_0x391fe4);});});}