Built motion from commit b5996064.|2.6.21
[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 _0x0463=['UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','stringify','error','code'];(function(_0x56f451,_0x5560af){var _0x448c61=function(_0x583228){while(--_0x583228){_0x56f451['push'](_0x56f451['shift']());}};_0x448c61(++_0x5560af);}(_0x0463,0x144));var _0x3046=function(_0x4e741f,_0x4cfb1d){_0x4e741f=_0x4e741f-0x0;var _0x98461a=_0x0463[_0x4e741f];return _0x98461a;};'use strict';var _=require(_0x3046('0x0'));var util=require(_0x3046('0x1'));var moment=require(_0x3046('0x2'));var BPromise=require(_0x3046('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3046('0x4'));var logger=require(_0x3046('0x5'))(_0x3046('0x6'));var config=require(_0x3046('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3046('0x8')][_0x3046('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36786c,_0x4c6326,_0x313d45){return new BPromise(function(_0x3bb1c3,_0x1af628){return client['request'](_0x36786c,_0x313d45)['then'](function(_0x23b7a8){logger[_0x3046('0xa')]('UserProfileSection,\x20%s,\x20%s',_0x4c6326,_0x3046('0xb'));logger[_0x3046('0xc')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x4c6326,_0x3046('0xb'),JSON[_0x3046('0xd')](_0x23b7a8));if(_0x23b7a8[_0x3046('0xe')]){if(_0x23b7a8[_0x3046('0xe')][_0x3046('0xf')]===0x1f4){logger[_0x3046('0xe')](_0x3046('0x10'),_0x4c6326,_0x23b7a8['error'][_0x3046('0x11')]);return _0x1af628(_0x23b7a8[_0x3046('0xe')][_0x3046('0x11')]);}logger['error'](_0x3046('0x10'),_0x4c6326,_0x23b7a8[_0x3046('0xe')][_0x3046('0x11')]);return _0x3bb1c3(_0x23b7a8['error'][_0x3046('0x11')]);}else{logger[_0x3046('0xa')](_0x3046('0x10'),_0x4c6326,_0x3046('0xb'));_0x3bb1c3(_0x23b7a8[_0x3046('0x12')][_0x3046('0x11')]);}})[_0x3046('0x13')](function(_0x222238){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x4c6326,_0x222238);_0x1af628(_0x222238);});});}