Built motion from commit 6a92c2cd.|2.6.29
[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 _0x4911=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','UserProfileSection,\x20%s,\x20%s','message','info','result','catch'];(function(_0x4abe25,_0x3d2379){var _0x472ebf=function(_0x592f0d){while(--_0x592f0d){_0x4abe25['push'](_0x4abe25['shift']());}};_0x472ebf(++_0x3d2379);}(_0x4911,0xa8));var _0x1491=function(_0x47d1ae,_0x41e056){_0x47d1ae=_0x47d1ae-0x0;var _0x47328a=_0x4911[_0x47d1ae];return _0x47328a;};'use strict';var _=require('lodash');var util=require(_0x1491('0x0'));var moment=require(_0x1491('0x1'));var BPromise=require(_0x1491('0x2'));var rs=require(_0x1491('0x3'));var fs=require('fs');var Redis=require(_0x1491('0x4'));var db=require(_0x1491('0x5'))['db'];var utils=require(_0x1491('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1491('0x7'));var client=jayson[_0x1491('0x8')][_0x1491('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38af7c,_0x2bb54e,_0x4b90fe){return new BPromise(function(_0x27f27f,_0x1edcda){return client[_0x1491('0xa')](_0x38af7c,_0x4b90fe)[_0x1491('0xb')](function(_0xe3d199){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x2bb54e,_0x1491('0xc'));logger[_0x1491('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2bb54e,_0x1491('0xc'),JSON['stringify'](_0xe3d199));if(_0xe3d199['error']){if(_0xe3d199[_0x1491('0xe')][_0x1491('0xf')]===0x1f4){logger['error'](_0x1491('0x10'),_0x2bb54e,_0xe3d199['error'][_0x1491('0x11')]);return _0x1edcda(_0xe3d199[_0x1491('0xe')]['message']);}logger[_0x1491('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x2bb54e,_0xe3d199[_0x1491('0xe')][_0x1491('0x11')]);return _0x27f27f(_0xe3d199[_0x1491('0xe')][_0x1491('0x11')]);}else{logger[_0x1491('0x12')](_0x1491('0x10'),_0x2bb54e,'request\x20sent');_0x27f27f(_0xe3d199[_0x1491('0x13')][_0x1491('0x11')]);}})[_0x1491('0x14')](function(_0x22f9ed){logger['error'](_0x1491('0x10'),_0x2bb54e,_0x22f9ed);_0x1edcda(_0x22f9ed);});});}