Built motion from commit fade34fd.|2.5.41
[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 _0xc844=['../../mysqldb','../../config/logger','jayson/promise','client','http','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc844,0x1d0));var _0x4c84=function(_0x2a75b5,_0x9d68ba){_0x2a75b5=_0x2a75b5-0x0;var _0x10998b=_0xc844[_0x2a75b5];return _0x10998b;};'use strict';var _=require(_0x4c84('0x0'));var util=require('util');var moment=require(_0x4c84('0x1'));var BPromise=require(_0x4c84('0x2'));var rs=require(_0x4c84('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c84('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c84('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4c84('0x6'));var client=jayson[_0x4c84('0x7')][_0x4c84('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4487dd,_0x98dbfb,_0x2f7114){return new BPromise(function(_0x366810,_0x3980e6){return client['request'](_0x4487dd,_0x2f7114)['then'](function(_0x280950){logger['info'](_0x4c84('0x9'),_0x98dbfb,_0x4c84('0xa'));logger[_0x4c84('0xb')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x98dbfb,'request\x20sent',JSON[_0x4c84('0xc')](_0x280950));if(_0x280950[_0x4c84('0xd')]){if(_0x280950['error'][_0x4c84('0xe')]===0x1f4){logger[_0x4c84('0xd')](_0x4c84('0x9'),_0x98dbfb,_0x280950[_0x4c84('0xd')][_0x4c84('0xf')]);return _0x3980e6(_0x280950['error'][_0x4c84('0xf')]);}logger[_0x4c84('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x98dbfb,_0x280950[_0x4c84('0xd')]['message']);return _0x366810(_0x280950['error'][_0x4c84('0xf')]);}else{logger['info'](_0x4c84('0x9'),_0x98dbfb,_0x4c84('0xa'));_0x366810(_0x280950[_0x4c84('0x10')][_0x4c84('0xf')]);}})[_0x4c84('0x11')](function(_0xd4e0f0){logger['error'](_0x4c84('0x9'),_0x98dbfb,_0xd4e0f0);_0x3980e6(_0xd4e0f0);});});}