Built motion from commit cafec4f3.|2.6.31
[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 _0x9344=['request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s'];(function(_0x547440,_0x3f1799){var _0x1327c7=function(_0x58e665){while(--_0x58e665){_0x547440['push'](_0x547440['shift']());}};_0x1327c7(++_0x3f1799);}(_0x9344,0x180));var _0x4934=function(_0x28c89b,_0x2510b3){_0x28c89b=_0x28c89b-0x0;var _0x176500=_0x9344[_0x28c89b];return _0x176500;};'use strict';var _=require(_0x4934('0x0'));var util=require('util');var moment=require(_0x4934('0x1'));var BPromise=require(_0x4934('0x2'));var rs=require(_0x4934('0x3'));var fs=require('fs');var Redis=require(_0x4934('0x4'));var db=require(_0x4934('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4934('0x6'))(_0x4934('0x7'));var config=require(_0x4934('0x8'));var jayson=require(_0x4934('0x9'));var client=jayson[_0x4934('0xa')][_0x4934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x299255,_0x35fb4f,_0x41e985){return new BPromise(function(_0x89d887,_0x5deffc){return client['request'](_0x299255,_0x41e985)[_0x4934('0xc')](function(_0x47de32){logger[_0x4934('0xd')](_0x4934('0xe'),_0x35fb4f,_0x4934('0xf'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x35fb4f,'request\x20sent',JSON[_0x4934('0x10')](_0x47de32));if(_0x47de32[_0x4934('0x11')]){if(_0x47de32[_0x4934('0x11')][_0x4934('0x12')]===0x1f4){logger[_0x4934('0x11')](_0x4934('0xe'),_0x35fb4f,_0x47de32[_0x4934('0x11')]['message']);return _0x5deffc(_0x47de32['error'][_0x4934('0x13')]);}logger[_0x4934('0x11')](_0x4934('0xe'),_0x35fb4f,_0x47de32['error']['message']);return _0x89d887(_0x47de32[_0x4934('0x11')][_0x4934('0x13')]);}else{logger[_0x4934('0xd')](_0x4934('0xe'),_0x35fb4f,'request\x20sent');_0x89d887(_0x47de32[_0x4934('0x14')][_0x4934('0x13')]);}})['catch'](function(_0xf38ad5){logger[_0x4934('0x11')](_0x4934('0xe'),_0x35fb4f,_0xf38ad5);_0x5deffc(_0xf38ad5);});});}