6b9c70a70ee05f142c36eb80bb4be4cc06d51b63
[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 _0xc63b=['result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xc63b,0x1ba));var _0xbc63=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0xc63b[_0x152121];return _0x592a85;};'use strict';var _=require(_0xbc63('0x0'));var util=require(_0xbc63('0x1'));var moment=require(_0xbc63('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc63('0x3'));var db=require(_0xbc63('0x4'))['db'];var utils=require(_0xbc63('0x5'));var logger=require(_0xbc63('0x6'))(_0xbc63('0x7'));var config=require(_0xbc63('0x8'));var jayson=require(_0xbc63('0x9'));var client=jayson[_0xbc63('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x519afe,_0x28c863,_0x2cfc40){return new BPromise(function(_0x13bc9f,_0x2f0c45){return client[_0xbc63('0xb')](_0x519afe,_0x2cfc40)[_0xbc63('0xc')](function(_0x439b8d){logger[_0xbc63('0xd')](_0xbc63('0xe'),_0x28c863,_0xbc63('0xf'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x28c863,_0xbc63('0xf'),JSON[_0xbc63('0x10')](_0x439b8d));if(_0x439b8d[_0xbc63('0x11')]){if(_0x439b8d[_0xbc63('0x11')][_0xbc63('0x12')]===0x1f4){logger['error'](_0xbc63('0xe'),_0x28c863,_0x439b8d[_0xbc63('0x11')][_0xbc63('0x13')]);return _0x2f0c45(_0x439b8d[_0xbc63('0x11')][_0xbc63('0x13')]);}logger[_0xbc63('0x11')](_0xbc63('0xe'),_0x28c863,_0x439b8d[_0xbc63('0x11')][_0xbc63('0x13')]);return _0x13bc9f(_0x439b8d['error'][_0xbc63('0x13')]);}else{logger[_0xbc63('0xd')](_0xbc63('0xe'),_0x28c863,_0xbc63('0xf'));_0x13bc9f(_0x439b8d[_0xbc63('0x14')][_0xbc63('0x13')]);}})['catch'](function(_0xfdc541){logger[_0xbc63('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x28c863,_0xfdc541);_0x2f0c45(_0xfdc541);});});}