38b1b5bdbb64419410177c14e3cf6ed290874469
[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 _0x33e6=['code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3e813e,_0x56d2a1){var _0x37a809=function(_0x15fc51){while(--_0x15fc51){_0x3e813e['push'](_0x3e813e['shift']());}};_0x37a809(++_0x56d2a1);}(_0x33e6,0xc0));var _0x633e=function(_0x326eaf,_0x4ec974){_0x326eaf=_0x326eaf-0x0;var _0xf1bcab=_0x33e6[_0x326eaf];return _0xf1bcab;};'use strict';var _=require(_0x633e('0x0'));var util=require('util');var moment=require(_0x633e('0x1'));var BPromise=require(_0x633e('0x2'));var rs=require(_0x633e('0x3'));var fs=require('fs');var Redis=require(_0x633e('0x4'));var db=require(_0x633e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x633e('0x6'))('rpc');var config=require(_0x633e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x633e('0x8')][_0x633e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2199ae,_0x1bf61a,_0x44b4c9){return new BPromise(function(_0x59d416,_0xdb9544){return client[_0x633e('0xa')](_0x2199ae,_0x44b4c9)[_0x633e('0xb')](function(_0x235437){logger[_0x633e('0xc')](_0x633e('0xd'),_0x1bf61a,_0x633e('0xe'));logger['debug'](_0x633e('0xf'),_0x1bf61a,_0x633e('0xe'),JSON[_0x633e('0x10')](_0x235437));if(_0x235437[_0x633e('0x11')]){if(_0x235437[_0x633e('0x11')][_0x633e('0x12')]===0x1f4){logger[_0x633e('0x11')](_0x633e('0xd'),_0x1bf61a,_0x235437[_0x633e('0x11')][_0x633e('0x13')]);return _0xdb9544(_0x235437[_0x633e('0x11')][_0x633e('0x13')]);}logger['error'](_0x633e('0xd'),_0x1bf61a,_0x235437[_0x633e('0x11')]['message']);return _0x59d416(_0x235437['error'][_0x633e('0x13')]);}else{logger[_0x633e('0xc')](_0x633e('0xd'),_0x1bf61a,_0x633e('0xe'));_0x59d416(_0x235437['result'][_0x633e('0x13')]);}})[_0x633e('0x14')](function(_0x11d469){logger[_0x633e('0x11')](_0x633e('0xd'),_0x1bf61a,_0x11d469);_0xdb9544(_0x11d469);});});}