f74c91ca88e8b115031d5a5e79b42b69691660cb
[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 _0x3eaa=['stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x423c77,_0x468893){var _0x709302=function(_0x5972fc){while(--_0x5972fc){_0x423c77['push'](_0x423c77['shift']());}};_0x709302(++_0x468893);}(_0x3eaa,0xe2));var _0xa3ea=function(_0xf309c1,_0x2a7755){_0xf309c1=_0xf309c1-0x0;var _0x28d122=_0x3eaa[_0xf309c1];return _0x28d122;};'use strict';var _=require(_0xa3ea('0x0'));var util=require(_0xa3ea('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa3ea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa3ea('0x3'))['db'];var utils=require(_0xa3ea('0x4'));var logger=require('../../config/logger')(_0xa3ea('0x5'));var config=require(_0xa3ea('0x6'));var jayson=require(_0xa3ea('0x7'));var client=jayson['client'][_0xa3ea('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40b32e,_0x2124e4,_0x4e7a73){return new BPromise(function(_0x383bed,_0x37b2cb){return client[_0xa3ea('0x9')](_0x40b32e,_0x4e7a73)[_0xa3ea('0xa')](function(_0x545b2f){logger[_0xa3ea('0xb')](_0xa3ea('0xc'),_0x2124e4,_0xa3ea('0xd'));logger[_0xa3ea('0xe')](_0xa3ea('0xf'),_0x2124e4,_0xa3ea('0xd'),JSON[_0xa3ea('0x10')](_0x545b2f));if(_0x545b2f[_0xa3ea('0x11')]){if(_0x545b2f[_0xa3ea('0x11')][_0xa3ea('0x12')]===0x1f4){logger[_0xa3ea('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x2124e4,_0x545b2f[_0xa3ea('0x11')][_0xa3ea('0x13')]);return _0x37b2cb(_0x545b2f['error'][_0xa3ea('0x13')]);}logger[_0xa3ea('0x11')](_0xa3ea('0xc'),_0x2124e4,_0x545b2f[_0xa3ea('0x11')][_0xa3ea('0x13')]);return _0x383bed(_0x545b2f[_0xa3ea('0x11')][_0xa3ea('0x13')]);}else{logger[_0xa3ea('0xb')](_0xa3ea('0xc'),_0x2124e4,_0xa3ea('0xd'));_0x383bed(_0x545b2f[_0xa3ea('0x14')][_0xa3ea('0x13')]);}})[_0xa3ea('0x15')](function(_0x50956a){logger[_0xa3ea('0x11')](_0xa3ea('0xc'),_0x2124e4,_0x50956a);_0x37b2cb(_0x50956a);});});}