Built motion from commit 092f8824.|2.5.49
[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 _0x6e08=['then','info','request\x20sent','debug','stringify','error','code','message','UserProfileSection,\x20%s,\x20%s','result','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5b87ae,_0x2c9c46){var _0x3efe55=function(_0x436f91){while(--_0x436f91){_0x5b87ae['push'](_0x5b87ae['shift']());}};_0x3efe55(++_0x2c9c46);}(_0x6e08,0x196));var _0x86e0=function(_0x281678,_0x1dd450){_0x281678=_0x281678-0x0;var _0x5c9ac8=_0x6e08[_0x281678];return _0x5c9ac8;};'use strict';var _=require('lodash');var util=require(_0x86e0('0x0'));var moment=require(_0x86e0('0x1'));var BPromise=require(_0x86e0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86e0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x86e0('0x4'));var logger=require(_0x86e0('0x5'))(_0x86e0('0x6'));var config=require(_0x86e0('0x7'));var jayson=require(_0x86e0('0x8'));var client=jayson[_0x86e0('0x9')][_0x86e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7057ad,_0x2d41c8,_0x133221){return new BPromise(function(_0x27ad1f,_0x2f8447){return client[_0x86e0('0xb')](_0x7057ad,_0x133221)[_0x86e0('0xc')](function(_0x21aef8){logger[_0x86e0('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x2d41c8,_0x86e0('0xe'));logger[_0x86e0('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2d41c8,_0x86e0('0xe'),JSON[_0x86e0('0x10')](_0x21aef8));if(_0x21aef8[_0x86e0('0x11')]){if(_0x21aef8[_0x86e0('0x11')][_0x86e0('0x12')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x2d41c8,_0x21aef8[_0x86e0('0x11')][_0x86e0('0x13')]);return _0x2f8447(_0x21aef8['error'][_0x86e0('0x13')]);}logger['error'](_0x86e0('0x14'),_0x2d41c8,_0x21aef8['error'][_0x86e0('0x13')]);return _0x27ad1f(_0x21aef8[_0x86e0('0x11')]['message']);}else{logger['info'](_0x86e0('0x14'),_0x2d41c8,'request\x20sent');_0x27ad1f(_0x21aef8[_0x86e0('0x15')][_0x86e0('0x13')]);}})['catch'](function(_0x3877f0){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x2d41c8,_0x3877f0);_0x2f8447(_0x3877f0);});});}