Built motion from commit (unavailable).|2.5.20
[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 _0x165a=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','moment','bluebird','randomstring','ioredis'];(function(_0x449623,_0x40e6f4){var _0x285db9=function(_0x177596){while(--_0x177596){_0x449623['push'](_0x449623['shift']());}};_0x285db9(++_0x40e6f4);}(_0x165a,0xd8));var _0xa165=function(_0x3bc01f,_0x5f0058){_0x3bc01f=_0x3bc01f-0x0;var _0x1216cf=_0x165a[_0x3bc01f];return _0x1216cf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa165('0x0'));var BPromise=require(_0xa165('0x1'));var rs=require(_0xa165('0x2'));var fs=require('fs');var Redis=require(_0xa165('0x3'));var db=require(_0xa165('0x4'))['db'];var utils=require(_0xa165('0x5'));var logger=require(_0xa165('0x6'))(_0xa165('0x7'));var config=require('../../config/environment');var jayson=require(_0xa165('0x8'));var client=jayson[_0xa165('0x9')][_0xa165('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c977b,_0x344c3d,_0x5d567b){return new BPromise(function(_0x76a6bd,_0x57b375){return client[_0xa165('0xb')](_0x2c977b,_0x5d567b)[_0xa165('0xc')](function(_0x196666){logger['info'](_0xa165('0xd'),_0x344c3d,_0xa165('0xe'));logger[_0xa165('0xf')](_0xa165('0x10'),_0x344c3d,_0xa165('0xe'),JSON[_0xa165('0x11')](_0x196666));if(_0x196666[_0xa165('0x12')]){if(_0x196666[_0xa165('0x12')][_0xa165('0x13')]===0x1f4){logger[_0xa165('0x12')](_0xa165('0xd'),_0x344c3d,_0x196666[_0xa165('0x12')]['message']);return _0x57b375(_0x196666[_0xa165('0x12')]['message']);}logger['error'](_0xa165('0xd'),_0x344c3d,_0x196666['error'][_0xa165('0x14')]);return _0x76a6bd(_0x196666[_0xa165('0x12')][_0xa165('0x14')]);}else{logger[_0xa165('0x15')](_0xa165('0xd'),_0x344c3d,_0xa165('0xe'));_0x76a6bd(_0x196666['result']['message']);}})['catch'](function(_0x35cffb){logger[_0xa165('0x12')](_0xa165('0xd'),_0x344c3d,_0x35cffb);_0x57b375(_0x35cffb);});});}