1f267ef888c8d049507f8df712413630cecb33e2
[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 _0x51f9=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x2238ba,_0xfeb953){var _0x33032f=function(_0x337e44){while(--_0x337e44){_0x2238ba['push'](_0x2238ba['shift']());}};_0x33032f(++_0xfeb953);}(_0x51f9,0x1c3));var _0x951f=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0x51f9[_0x50f392];return _0x5926f2;};'use strict';var _=require(_0x951f('0x0'));var util=require(_0x951f('0x1'));var moment=require(_0x951f('0x2'));var BPromise=require(_0x951f('0x3'));var rs=require(_0x951f('0x4'));var fs=require('fs');var Redis=require(_0x951f('0x5'));var db=require(_0x951f('0x6'))['db'];var utils=require(_0x951f('0x7'));var logger=require('../../config/logger')(_0x951f('0x8'));var config=require(_0x951f('0x9'));var jayson=require(_0x951f('0xa'));var client=jayson['client'][_0x951f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x374375,_0x29c29b,_0x5918a9){return new BPromise(function(_0x3db9c8,_0x24888a){return client[_0x951f('0xc')](_0x374375,_0x5918a9)[_0x951f('0xd')](function(_0x16e3b7){logger[_0x951f('0xe')](_0x951f('0xf'),_0x29c29b,'request\x20sent');logger[_0x951f('0x10')](_0x951f('0x11'),_0x29c29b,'request\x20sent',JSON[_0x951f('0x12')](_0x16e3b7));if(_0x16e3b7[_0x951f('0x13')]){if(_0x16e3b7[_0x951f('0x13')][_0x951f('0x14')]===0x1f4){logger['error'](_0x951f('0xf'),_0x29c29b,_0x16e3b7['error']['message']);return _0x24888a(_0x16e3b7[_0x951f('0x13')][_0x951f('0x15')]);}logger['error'](_0x951f('0xf'),_0x29c29b,_0x16e3b7[_0x951f('0x13')][_0x951f('0x15')]);return _0x3db9c8(_0x16e3b7[_0x951f('0x13')][_0x951f('0x15')]);}else{logger['info'](_0x951f('0xf'),_0x29c29b,_0x951f('0x16'));_0x3db9c8(_0x16e3b7[_0x951f('0x17')][_0x951f('0x15')]);}})[_0x951f('0x18')](function(_0x556cf5){logger[_0x951f('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x29c29b,_0x556cf5);_0x24888a(_0x556cf5);});});}