Built motion from commit 25580385.|2.6.2
[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 _0x07dd=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x07dd,0x64));var _0xd07d=function(_0x14e442,_0x36b1bd){_0x14e442=_0x14e442-0x0;var _0x1385e2=_0x07dd[_0x14e442];return _0x1385e2;};'use strict';var _=require(_0xd07d('0x0'));var util=require(_0xd07d('0x1'));var moment=require(_0xd07d('0x2'));var BPromise=require('bluebird');var rs=require(_0xd07d('0x3'));var fs=require('fs');var Redis=require(_0xd07d('0x4'));var db=require(_0xd07d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd07d('0x6'))(_0xd07d('0x7'));var config=require(_0xd07d('0x8'));var jayson=require(_0xd07d('0x9'));var client=jayson[_0xd07d('0xa')][_0xd07d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x859b7f,_0x5792bc,_0x44deb3){return new BPromise(function(_0x49b24a,_0xb76611){return client['request'](_0x859b7f,_0x44deb3)['then'](function(_0x1ae491){logger[_0xd07d('0xc')](_0xd07d('0xd'),_0x5792bc,_0xd07d('0xe'));logger['debug'](_0xd07d('0xf'),_0x5792bc,'request\x20sent',JSON['stringify'](_0x1ae491));if(_0x1ae491[_0xd07d('0x10')]){if(_0x1ae491[_0xd07d('0x10')][_0xd07d('0x11')]===0x1f4){logger['error'](_0xd07d('0xd'),_0x5792bc,_0x1ae491[_0xd07d('0x10')][_0xd07d('0x12')]);return _0xb76611(_0x1ae491['error'][_0xd07d('0x12')]);}logger['error'](_0xd07d('0xd'),_0x5792bc,_0x1ae491[_0xd07d('0x10')]['message']);return _0x49b24a(_0x1ae491[_0xd07d('0x10')][_0xd07d('0x12')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x5792bc,_0xd07d('0xe'));_0x49b24a(_0x1ae491[_0xd07d('0x13')][_0xd07d('0x12')]);}})[_0xd07d('0x14')](function(_0x520cbd){logger[_0xd07d('0x10')](_0xd07d('0xd'),_0x5792bc,_0x520cbd);_0xb76611(_0x520cbd);});});}