Built motion from commit (unavailable).|2.5.14
[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 _0xe636=['UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x20295d,_0x562a65){var _0x4e524c=function(_0x5f1ffd){while(--_0x5f1ffd){_0x20295d['push'](_0x20295d['shift']());}};_0x4e524c(++_0x562a65);}(_0xe636,0x16d));var _0x6e63=function(_0x36909d,_0x2795f1){_0x36909d=_0x36909d-0x0;var _0x1fd29d=_0xe636[_0x36909d];return _0x1fd29d;};'use strict';var _=require(_0x6e63('0x0'));var util=require(_0x6e63('0x1'));var moment=require('moment');var BPromise=require(_0x6e63('0x2'));var rs=require(_0x6e63('0x3'));var fs=require('fs');var Redis=require(_0x6e63('0x4'));var db=require(_0x6e63('0x5'))['db'];var utils=require(_0x6e63('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6e63('0x7'));var client=jayson[_0x6e63('0x8')][_0x6e63('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x677089,_0x33c842,_0x36d4ce){return new BPromise(function(_0x15b438,_0x5558f6){return client[_0x6e63('0xa')](_0x677089,_0x36d4ce)['then'](function(_0x43fbc7){logger[_0x6e63('0xb')](_0x6e63('0xc'),_0x33c842,_0x6e63('0xd'));logger[_0x6e63('0xe')](_0x6e63('0xf'),_0x33c842,_0x6e63('0xd'),JSON[_0x6e63('0x10')](_0x43fbc7));if(_0x43fbc7[_0x6e63('0x11')]){if(_0x43fbc7[_0x6e63('0x11')]['code']===0x1f4){logger[_0x6e63('0x11')](_0x6e63('0xc'),_0x33c842,_0x43fbc7['error']['message']);return _0x5558f6(_0x43fbc7['error'][_0x6e63('0x12')]);}logger['error'](_0x6e63('0xc'),_0x33c842,_0x43fbc7[_0x6e63('0x11')][_0x6e63('0x12')]);return _0x15b438(_0x43fbc7[_0x6e63('0x11')]['message']);}else{logger[_0x6e63('0xb')](_0x6e63('0xc'),_0x33c842,_0x6e63('0xd'));_0x15b438(_0x43fbc7['result'][_0x6e63('0x12')]);}})[_0x6e63('0x13')](function(_0x5a9570){logger[_0x6e63('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x33c842,_0x5a9570);_0x5558f6(_0x5a9570);});});}