Built motion from commit (unavailable).|2.5.17
[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 _0x4014=['UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','info'];(function(_0x246dc6,_0x4e6e0f){var _0x21948a=function(_0x6ffe36){while(--_0x6ffe36){_0x246dc6['push'](_0x246dc6['shift']());}};_0x21948a(++_0x4e6e0f);}(_0x4014,0xf9));var _0x4401=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x4014[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x4401('0x0'));var util=require('util');var moment=require(_0x4401('0x1'));var BPromise=require(_0x4401('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4401('0x3'));var db=require(_0x4401('0x4'))['db'];var utils=require(_0x4401('0x5'));var logger=require('../../config/logger')(_0x4401('0x6'));var config=require('../../config/environment');var jayson=require(_0x4401('0x7'));var client=jayson[_0x4401('0x8')][_0x4401('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x486144,_0x4562cc,_0x5b9db4){return new BPromise(function(_0x413aeb,_0x40bd1d){return client['request'](_0x486144,_0x5b9db4)['then'](function(_0x524b5a){logger[_0x4401('0xa')](_0x4401('0xb'),_0x4562cc,_0x4401('0xc'));logger[_0x4401('0xd')](_0x4401('0xe'),_0x4562cc,_0x4401('0xc'),JSON[_0x4401('0xf')](_0x524b5a));if(_0x524b5a['error']){if(_0x524b5a[_0x4401('0x10')][_0x4401('0x11')]===0x1f4){logger[_0x4401('0x10')](_0x4401('0xb'),_0x4562cc,_0x524b5a[_0x4401('0x10')][_0x4401('0x12')]);return _0x40bd1d(_0x524b5a[_0x4401('0x10')][_0x4401('0x12')]);}logger['error'](_0x4401('0xb'),_0x4562cc,_0x524b5a[_0x4401('0x10')][_0x4401('0x12')]);return _0x413aeb(_0x524b5a[_0x4401('0x10')][_0x4401('0x12')]);}else{logger[_0x4401('0xa')](_0x4401('0xb'),_0x4562cc,_0x4401('0xc'));_0x413aeb(_0x524b5a['result'][_0x4401('0x12')]);}})[_0x4401('0x13')](function(_0x49b56b){logger[_0x4401('0x10')](_0x4401('0xb'),_0x4562cc,_0x49b56b);_0x40bd1d(_0x49b56b);});});}