Built motion from commit 19a84241.|2.5.34
[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 _0xf623=['../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','util','randomstring','ioredis','../../config/logger'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xf623,0x1b4));var _0x3f62=function(_0x3e5f0f,_0xe22b5e){_0x3e5f0f=_0x3e5f0f-0x0;var _0x38b2cb=_0xf623[_0x3e5f0f];return _0x38b2cb;};'use strict';var _=require('lodash');var util=require(_0x3f62('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3f62('0x1'));var fs=require('fs');var Redis=require(_0x3f62('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3f62('0x3'))('rpc');var config=require(_0x3f62('0x4'));var jayson=require(_0x3f62('0x5'));var client=jayson[_0x3f62('0x6')][_0x3f62('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x44c976,_0x54f2a8,_0x46142e){return new BPromise(function(_0x522828,_0x4b5605){return client[_0x3f62('0x8')](_0x44c976,_0x46142e)[_0x3f62('0x9')](function(_0xe5839b){logger[_0x3f62('0xa')](_0x3f62('0xb'),_0x54f2a8,_0x3f62('0xc'));logger[_0x3f62('0xd')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x54f2a8,_0x3f62('0xc'),JSON[_0x3f62('0xe')](_0xe5839b));if(_0xe5839b['error']){if(_0xe5839b['error'][_0x3f62('0xf')]===0x1f4){logger[_0x3f62('0x10')](_0x3f62('0xb'),_0x54f2a8,_0xe5839b[_0x3f62('0x10')]['message']);return _0x4b5605(_0xe5839b[_0x3f62('0x10')][_0x3f62('0x11')]);}logger['error'](_0x3f62('0xb'),_0x54f2a8,_0xe5839b['error'][_0x3f62('0x11')]);return _0x522828(_0xe5839b['error'][_0x3f62('0x11')]);}else{logger[_0x3f62('0xa')](_0x3f62('0xb'),_0x54f2a8,_0x3f62('0xc'));_0x522828(_0xe5839b[_0x3f62('0x12')][_0x3f62('0x11')]);}})[_0x3f62('0x13')](function(_0x184e7e){logger['error'](_0x3f62('0xb'),_0x54f2a8,_0x184e7e);_0x4b5605(_0x184e7e);});});}