9a0a602e9e874b9dfff264778489db2b19ff7074
[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 _0xabec=['stringify','error','UserProfileSection,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x398f02,_0x3393a0){var _0x19039f=function(_0x2945d0){while(--_0x2945d0){_0x398f02['push'](_0x398f02['shift']());}};_0x19039f(++_0x3393a0);}(_0xabec,0x15a));var _0xcabe=function(_0x4eb00b,_0x22adaf){_0x4eb00b=_0x4eb00b-0x0;var _0x2dd4bf=_0xabec[_0x4eb00b];return _0x2dd4bf;};'use strict';var _=require('lodash');var util=require(_0xcabe('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcabe('0x1'));var fs=require('fs');var Redis=require(_0xcabe('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xcabe('0x3'));var logger=require(_0xcabe('0x4'))('rpc');var config=require(_0xcabe('0x5'));var jayson=require(_0xcabe('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x31f103,_0x26099f,_0x21c741){return new BPromise(function(_0x1e7bef,_0x24a399){return client['request'](_0x31f103,_0x21c741)[_0xcabe('0x7')](function(_0x10d8a7){logger[_0xcabe('0x8')]('UserProfileSection,\x20%s,\x20%s',_0x26099f,'request\x20sent');logger['debug'](_0xcabe('0x9'),_0x26099f,_0xcabe('0xa'),JSON[_0xcabe('0xb')](_0x10d8a7));if(_0x10d8a7[_0xcabe('0xc')]){if(_0x10d8a7[_0xcabe('0xc')]['code']===0x1f4){logger[_0xcabe('0xc')](_0xcabe('0xd'),_0x26099f,_0x10d8a7[_0xcabe('0xc')][_0xcabe('0xe')]);return _0x24a399(_0x10d8a7[_0xcabe('0xc')][_0xcabe('0xe')]);}logger[_0xcabe('0xc')](_0xcabe('0xd'),_0x26099f,_0x10d8a7[_0xcabe('0xc')][_0xcabe('0xe')]);return _0x1e7bef(_0x10d8a7[_0xcabe('0xc')][_0xcabe('0xe')]);}else{logger[_0xcabe('0x8')](_0xcabe('0xd'),_0x26099f,_0xcabe('0xa'));_0x1e7bef(_0x10d8a7[_0xcabe('0xf')][_0xcabe('0xe')]);}})[_0xcabe('0x10')](function(_0x541eb5){logger['error'](_0xcabe('0xd'),_0x26099f,_0x541eb5);_0x24a399(_0x541eb5);});});}