Built motion from commit (unavailable).|2.5.8
[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 _0xd307=['request\x20sent','debug','stringify','error','code','message','UserProfileSection,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info'];(function(_0x3a7e01,_0x51204c){var _0x5b8398=function(_0x4dcfab){while(--_0x4dcfab){_0x3a7e01['push'](_0x3a7e01['shift']());}};_0x5b8398(++_0x51204c);}(_0xd307,0x110));var _0x7d30=function(_0x3dc15e,_0xf0dd1d){_0x3dc15e=_0x3dc15e-0x0;var _0x8c3321=_0xd307[_0x3dc15e];return _0x8c3321;};'use strict';var _=require(_0x7d30('0x0'));var util=require(_0x7d30('0x1'));var moment=require(_0x7d30('0x2'));var BPromise=require(_0x7d30('0x3'));var rs=require(_0x7d30('0x4'));var fs=require('fs');var Redis=require(_0x7d30('0x5'));var db=require(_0x7d30('0x6'))['db'];var utils=require(_0x7d30('0x7'));var logger=require('../../config/logger')(_0x7d30('0x8'));var config=require(_0x7d30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d30('0xa')][_0x7d30('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9451ed,_0x35c861,_0x43b35e){return new BPromise(function(_0x1ef3e7,_0x1eb28c){return client[_0x7d30('0xc')](_0x9451ed,_0x43b35e)['then'](function(_0x3cd180){logger[_0x7d30('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x35c861,_0x7d30('0xe'));logger[_0x7d30('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x35c861,'request\x20sent',JSON[_0x7d30('0x10')](_0x3cd180));if(_0x3cd180[_0x7d30('0x11')]){if(_0x3cd180[_0x7d30('0x11')][_0x7d30('0x12')]===0x1f4){logger[_0x7d30('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x35c861,_0x3cd180[_0x7d30('0x11')][_0x7d30('0x13')]);return _0x1eb28c(_0x3cd180['error'][_0x7d30('0x13')]);}logger[_0x7d30('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x35c861,_0x3cd180[_0x7d30('0x11')][_0x7d30('0x13')]);return _0x1ef3e7(_0x3cd180[_0x7d30('0x11')][_0x7d30('0x13')]);}else{logger['info'](_0x7d30('0x14'),_0x35c861,_0x7d30('0xe'));_0x1ef3e7(_0x3cd180[_0x7d30('0x15')]['message']);}})['catch'](function(_0x5027b3){logger[_0x7d30('0x11')](_0x7d30('0x14'),_0x35c861,_0x5027b3);_0x1eb28c(_0x5027b3);});});}