Built motion from commit ddca4d0d.|2.5.47
[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 _0x245d=['jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x58d0d5,_0x100fcd){var _0x112458=function(_0x36a733){while(--_0x36a733){_0x58d0d5['push'](_0x58d0d5['shift']());}};_0x112458(++_0x100fcd);}(_0x245d,0x126));var _0xd245=function(_0x2667bb,_0x2f8be0){_0x2667bb=_0x2667bb-0x0;var _0x2b8604=_0x245d[_0x2667bb];return _0x2b8604;};'use strict';var _=require(_0xd245('0x0'));var util=require(_0xd245('0x1'));var moment=require('moment');var BPromise=require(_0xd245('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd245('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd245('0x4'))('rpc');var config=require(_0xd245('0x5'));var jayson=require(_0xd245('0x6'));var client=jayson[_0xd245('0x7')][_0xd245('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x311370,_0x5f1ad6,_0x579dd6){return new BPromise(function(_0x13ad82,_0x104edd){return client[_0xd245('0x9')](_0x311370,_0x579dd6)[_0xd245('0xa')](function(_0x1c801e){logger[_0xd245('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x5f1ad6,_0xd245('0xc'));logger[_0xd245('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x5f1ad6,_0xd245('0xc'),JSON['stringify'](_0x1c801e));if(_0x1c801e[_0xd245('0xe')]){if(_0x1c801e[_0xd245('0xe')][_0xd245('0xf')]===0x1f4){logger[_0xd245('0xe')](_0xd245('0x10'),_0x5f1ad6,_0x1c801e[_0xd245('0xe')][_0xd245('0x11')]);return _0x104edd(_0x1c801e[_0xd245('0xe')][_0xd245('0x11')]);}logger[_0xd245('0xe')](_0xd245('0x10'),_0x5f1ad6,_0x1c801e['error']['message']);return _0x13ad82(_0x1c801e['error'][_0xd245('0x11')]);}else{logger[_0xd245('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x5f1ad6,_0xd245('0xc'));_0x13ad82(_0x1c801e[_0xd245('0x12')][_0xd245('0x11')]);}})[_0xd245('0x13')](function(_0x3bea5c){logger['error'](_0xd245('0x10'),_0x5f1ad6,_0x3bea5c);_0x104edd(_0x3bea5c);});});}