Built motion from commit 0900f080.|2.5.45
[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 _0x2b99=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xd7f314,_0x176c1a){var _0x41c0ca=function(_0x37298f){while(--_0x37298f){_0xd7f314['push'](_0xd7f314['shift']());}};_0x41c0ca(++_0x176c1a);}(_0x2b99,0x1a5));var _0x92b9=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x2b99[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x92b9('0x0'));var util=require(_0x92b9('0x1'));var moment=require(_0x92b9('0x2'));var BPromise=require(_0x92b9('0x3'));var rs=require(_0x92b9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92b9('0x5'))['db'];var utils=require(_0x92b9('0x6'));var logger=require(_0x92b9('0x7'))('rpc');var config=require(_0x92b9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x92b9('0x9')][_0x92b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x435056,_0x47248d,_0x489fc1){return new BPromise(function(_0x5f440c,_0x4ede85){return client['request'](_0x435056,_0x489fc1)['then'](function(_0x45263d){logger[_0x92b9('0xb')](_0x92b9('0xc'),_0x47248d,_0x92b9('0xd'));logger[_0x92b9('0xe')](_0x92b9('0xf'),_0x47248d,_0x92b9('0xd'),JSON[_0x92b9('0x10')](_0x45263d));if(_0x45263d[_0x92b9('0x11')]){if(_0x45263d[_0x92b9('0x11')][_0x92b9('0x12')]===0x1f4){logger[_0x92b9('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x47248d,_0x45263d['error']['message']);return _0x4ede85(_0x45263d['error'][_0x92b9('0x13')]);}logger[_0x92b9('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x47248d,_0x45263d[_0x92b9('0x11')][_0x92b9('0x13')]);return _0x5f440c(_0x45263d['error'][_0x92b9('0x13')]);}else{logger[_0x92b9('0xb')](_0x92b9('0xc'),_0x47248d,_0x92b9('0xd'));_0x5f440c(_0x45263d['result'][_0x92b9('0x13')]);}})[_0x92b9('0x14')](function(_0x3b3ad0){logger[_0x92b9('0x11')](_0x92b9('0xc'),_0x47248d,_0x3b3ad0);_0x4ede85(_0x3b3ad0);});});}