Built motion from commit (unavailable).|2.5.26
[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 _0x3fe9=['UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x541e85,_0x3fe914){var _0x511538=function(_0x203147){while(--_0x203147){_0x541e85['push'](_0x541e85['shift']());}};_0x511538(++_0x3fe914);}(_0x3fe9,0x106));var _0x93fe=function(_0xbe5a07,_0x37067a){_0xbe5a07=_0xbe5a07-0x0;var _0x17928a=_0x3fe9[_0xbe5a07];return _0x17928a;};'use strict';var _=require(_0x93fe('0x0'));var util=require(_0x93fe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x93fe('0x2'));var fs=require('fs');var Redis=require(_0x93fe('0x3'));var db=require(_0x93fe('0x4'))['db'];var utils=require(_0x93fe('0x5'));var logger=require('../../config/logger')(_0x93fe('0x6'));var config=require(_0x93fe('0x7'));var jayson=require(_0x93fe('0x8'));var client=jayson[_0x93fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f7195,_0x40b7d3,_0x148776){return new BPromise(function(_0x34cd8a,_0x4fc055){return client[_0x93fe('0xa')](_0x3f7195,_0x148776)['then'](function(_0x5b0b5d){logger['info'](_0x93fe('0xb'),_0x40b7d3,_0x93fe('0xc'));logger[_0x93fe('0xd')](_0x93fe('0xe'),_0x40b7d3,_0x93fe('0xc'),JSON['stringify'](_0x5b0b5d));if(_0x5b0b5d[_0x93fe('0xf')]){if(_0x5b0b5d[_0x93fe('0xf')][_0x93fe('0x10')]===0x1f4){logger[_0x93fe('0xf')](_0x93fe('0xb'),_0x40b7d3,_0x5b0b5d['error'][_0x93fe('0x11')]);return _0x4fc055(_0x5b0b5d[_0x93fe('0xf')][_0x93fe('0x11')]);}logger[_0x93fe('0xf')](_0x93fe('0xb'),_0x40b7d3,_0x5b0b5d['error'][_0x93fe('0x11')]);return _0x34cd8a(_0x5b0b5d['error'][_0x93fe('0x11')]);}else{logger[_0x93fe('0x12')](_0x93fe('0xb'),_0x40b7d3,'request\x20sent');_0x34cd8a(_0x5b0b5d[_0x93fe('0x13')][_0x93fe('0x11')]);}})[_0x93fe('0x14')](function(_0x268508){logger[_0x93fe('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x40b7d3,_0x268508);_0x4fc055(_0x268508);});});}