Built motion from commit f7863d46.|2.5.41
[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 _0x3b90=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message'];(function(_0x368dab,_0x3c8dff){var _0x37c2a3=function(_0x4d11d0){while(--_0x4d11d0){_0x368dab['push'](_0x368dab['shift']());}};_0x37c2a3(++_0x3c8dff);}(_0x3b90,0xf3));var _0x03b9=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0x3b90[_0x587dd0];return _0x56f153;};'use strict';var _=require(_0x03b9('0x0'));var util=require(_0x03b9('0x1'));var moment=require(_0x03b9('0x2'));var BPromise=require(_0x03b9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03b9('0x4'));var db=require(_0x03b9('0x5'))['db'];var utils=require(_0x03b9('0x6'));var logger=require(_0x03b9('0x7'))('rpc');var config=require(_0x03b9('0x8'));var jayson=require(_0x03b9('0x9'));var client=jayson['client'][_0x03b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33dcd0,_0xe9759a,_0x39f6c6){return new BPromise(function(_0x1c89fb,_0x165d1a){return client['request'](_0x33dcd0,_0x39f6c6)[_0x03b9('0xb')](function(_0x3f5538){logger[_0x03b9('0xc')](_0x03b9('0xd'),_0xe9759a,'request\x20sent');logger[_0x03b9('0xe')](_0x03b9('0xf'),_0xe9759a,'request\x20sent',JSON[_0x03b9('0x10')](_0x3f5538));if(_0x3f5538[_0x03b9('0x11')]){if(_0x3f5538['error'][_0x03b9('0x12')]===0x1f4){logger[_0x03b9('0x11')]('UserProfileSection,\x20%s,\x20%s',_0xe9759a,_0x3f5538[_0x03b9('0x11')]['message']);return _0x165d1a(_0x3f5538[_0x03b9('0x11')]['message']);}logger[_0x03b9('0x11')](_0x03b9('0xd'),_0xe9759a,_0x3f5538['error']['message']);return _0x1c89fb(_0x3f5538[_0x03b9('0x11')]['message']);}else{logger['info'](_0x03b9('0xd'),_0xe9759a,'request\x20sent');_0x1c89fb(_0x3f5538[_0x03b9('0x13')][_0x03b9('0x14')]);}})[_0x03b9('0x15')](function(_0x59ef99){logger[_0x03b9('0x11')](_0x03b9('0xd'),_0xe9759a,_0x59ef99);_0x165d1a(_0x59ef99);});});}