Built motion from commit 9d1906d1.|2.5.40
[motion2.git] / server / api / userProfileSection / userProfileSection.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 _0x7d42=['debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent'];(function(_0x50ef88,_0x1e90ef){var _0x1ac293=function(_0x170025){while(--_0x170025){_0x50ef88['push'](_0x50ef88['shift']());}};_0x1ac293(++_0x1e90ef);}(_0x7d42,0xb0));var _0x27d4=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7d42[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x27d4('0x0'));var util=require(_0x27d4('0x1'));var moment=require(_0x27d4('0x2'));var BPromise=require(_0x27d4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27d4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x27d4('0x5'));var logger=require(_0x27d4('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x27d4('0x7')][_0x27d4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e27e1,_0x4ff19d,_0x59aa84){return new BPromise(function(_0x481c57,_0x1dc0e7){return client[_0x27d4('0x9')](_0x2e27e1,_0x59aa84)[_0x27d4('0xa')](function(_0x3e8de4){logger[_0x27d4('0xb')](_0x27d4('0xc'),_0x4ff19d,_0x27d4('0xd'));logger[_0x27d4('0xe')](_0x27d4('0xf'),_0x4ff19d,'request\x20sent',JSON['stringify'](_0x3e8de4));if(_0x3e8de4[_0x27d4('0x10')]){if(_0x3e8de4[_0x27d4('0x10')]['code']===0x1f4){logger['error'](_0x27d4('0xc'),_0x4ff19d,_0x3e8de4['error'][_0x27d4('0x11')]);return _0x1dc0e7(_0x3e8de4[_0x27d4('0x10')][_0x27d4('0x11')]);}logger['error'](_0x27d4('0xc'),_0x4ff19d,_0x3e8de4['error'][_0x27d4('0x11')]);return _0x481c57(_0x3e8de4['error'][_0x27d4('0x11')]);}else{logger[_0x27d4('0xb')](_0x27d4('0xc'),_0x4ff19d,_0x27d4('0xd'));_0x481c57(_0x3e8de4[_0x27d4('0x12')]['message']);}})['catch'](function(_0x49880c){logger[_0x27d4('0x10')](_0x27d4('0xc'),_0x4ff19d,_0x49880c);_0x1dc0e7(_0x49880c);});});}