140c13e2b5ce04dc6bb7219fdcdd2f52bdc0add6
[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 _0x6cfd=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','moment','bluebird'];(function(_0x178b3d,_0x40dc46){var _0x1c05c1=function(_0x525349){while(--_0x525349){_0x178b3d['push'](_0x178b3d['shift']());}};_0x1c05c1(++_0x40dc46);}(_0x6cfd,0x1b7));var _0xd6cf=function(_0x1b0bfe,_0x589135){_0x1b0bfe=_0x1b0bfe-0x0;var _0x14bb4c=_0x6cfd[_0x1b0bfe];return _0x14bb4c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd6cf('0x0'));var BPromise=require(_0xd6cf('0x1'));var rs=require(_0xd6cf('0x2'));var fs=require('fs');var Redis=require(_0xd6cf('0x3'));var db=require(_0xd6cf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6cf('0x5'))(_0xd6cf('0x6'));var config=require(_0xd6cf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd6cf('0x8')][_0xd6cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af324,_0x26b111,_0x516cb9){return new BPromise(function(_0x362863,_0x2cfbf0){return client[_0xd6cf('0xa')](_0x5af324,_0x516cb9)[_0xd6cf('0xb')](function(_0x367e5e){logger[_0xd6cf('0xc')](_0xd6cf('0xd'),_0x26b111,_0xd6cf('0xe'));logger[_0xd6cf('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x26b111,_0xd6cf('0xe'),JSON['stringify'](_0x367e5e));if(_0x367e5e[_0xd6cf('0x10')]){if(_0x367e5e[_0xd6cf('0x10')][_0xd6cf('0x11')]===0x1f4){logger[_0xd6cf('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x26b111,_0x367e5e[_0xd6cf('0x10')][_0xd6cf('0x12')]);return _0x2cfbf0(_0x367e5e['error']['message']);}logger['error'](_0xd6cf('0xd'),_0x26b111,_0x367e5e['error']['message']);return _0x362863(_0x367e5e[_0xd6cf('0x10')][_0xd6cf('0x12')]);}else{logger[_0xd6cf('0xc')](_0xd6cf('0xd'),_0x26b111,_0xd6cf('0xe'));_0x362863(_0x367e5e[_0xd6cf('0x13')][_0xd6cf('0x12')]);}})[_0xd6cf('0x14')](function(_0x3fd0a2){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x26b111,_0x3fd0a2);_0x2cfbf0(_0x3fd0a2);});});}