93cf7277c0a06fc1199469e5580bfa0d67763e8e
[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 _0xb2f1=['request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xb2f1,0xee));var _0x1b2f=function(_0x58cc87,_0x1f8228){_0x58cc87=_0x58cc87-0x0;var _0x57e9e7=_0xb2f1[_0x58cc87];return _0x57e9e7;};'use strict';var _=require(_0x1b2f('0x0'));var util=require(_0x1b2f('0x1'));var moment=require('moment');var BPromise=require(_0x1b2f('0x2'));var rs=require(_0x1b2f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b2f('0x4'))['db'];var utils=require(_0x1b2f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1b2f('0x6'));var jayson=require(_0x1b2f('0x7'));var client=jayson[_0x1b2f('0x8')][_0x1b2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57eed1,_0x532834,_0x12a0bf){return new BPromise(function(_0x28a081,_0x5627d3){return client[_0x1b2f('0xa')](_0x57eed1,_0x12a0bf)[_0x1b2f('0xb')](function(_0x5acb30){logger[_0x1b2f('0xc')](_0x1b2f('0xd'),_0x532834,_0x1b2f('0xe'));logger[_0x1b2f('0xf')](_0x1b2f('0x10'),_0x532834,_0x1b2f('0xe'),JSON[_0x1b2f('0x11')](_0x5acb30));if(_0x5acb30['error']){if(_0x5acb30[_0x1b2f('0x12')][_0x1b2f('0x13')]===0x1f4){logger[_0x1b2f('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x532834,_0x5acb30[_0x1b2f('0x12')]['message']);return _0x5627d3(_0x5acb30[_0x1b2f('0x12')][_0x1b2f('0x14')]);}logger[_0x1b2f('0x12')](_0x1b2f('0xd'),_0x532834,_0x5acb30[_0x1b2f('0x12')]['message']);return _0x28a081(_0x5acb30[_0x1b2f('0x12')][_0x1b2f('0x14')]);}else{logger[_0x1b2f('0xc')](_0x1b2f('0xd'),_0x532834,'request\x20sent');_0x28a081(_0x5acb30['result'][_0x1b2f('0x14')]);}})['catch'](function(_0x4cdc0d){logger['error'](_0x1b2f('0xd'),_0x532834,_0x4cdc0d);_0x5627d3(_0x4cdc0d);});});}