a9902a6c12ebc820e8b056352dbe68f4cc8be77d
[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 _0xa600=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa600,0x192));var _0x0a60=function(_0x4e198a,_0x5a6bad){_0x4e198a=_0x4e198a-0x0;var _0xb84bfe=_0xa600[_0x4e198a];return _0xb84bfe;};'use strict';var _=require(_0x0a60('0x0'));var util=require(_0x0a60('0x1'));var moment=require(_0x0a60('0x2'));var BPromise=require('bluebird');var rs=require(_0x0a60('0x3'));var fs=require('fs');var Redis=require(_0x0a60('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a60('0x5'));var logger=require(_0x0a60('0x6'))(_0x0a60('0x7'));var config=require(_0x0a60('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a60('0x9')][_0x0a60('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x193e55,_0x5436a0,_0x5781f6){return new BPromise(function(_0x492604,_0x3d59c6){return client[_0x0a60('0xb')](_0x193e55,_0x5781f6)[_0x0a60('0xc')](function(_0x10db45){logger[_0x0a60('0xd')](_0x0a60('0xe'),_0x5436a0,_0x0a60('0xf'));logger[_0x0a60('0x10')](_0x0a60('0x11'),_0x5436a0,'request\x20sent',JSON[_0x0a60('0x12')](_0x10db45));if(_0x10db45[_0x0a60('0x13')]){if(_0x10db45[_0x0a60('0x13')][_0x0a60('0x14')]===0x1f4){logger['error'](_0x0a60('0xe'),_0x5436a0,_0x10db45[_0x0a60('0x13')][_0x0a60('0x15')]);return _0x3d59c6(_0x10db45[_0x0a60('0x13')][_0x0a60('0x15')]);}logger[_0x0a60('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x5436a0,_0x10db45[_0x0a60('0x13')]['message']);return _0x492604(_0x10db45[_0x0a60('0x13')]['message']);}else{logger[_0x0a60('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x5436a0,_0x0a60('0xf'));_0x492604(_0x10db45[_0x0a60('0x16')][_0x0a60('0x15')]);}})[_0x0a60('0x17')](function(_0x30b871){logger[_0x0a60('0x13')](_0x0a60('0xe'),_0x5436a0,_0x30b871);_0x3d59c6(_0x30b871);});});}