947bd13b2d0f99c12908e830ff25eefddd34d808
[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 _0xebc0=['UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','UserProfileSection,\x20%s,\x20%s','debug'];(function(_0x2ec77f,_0xde5b9b){var _0x2b1d3a=function(_0x1bc099){while(--_0x1bc099){_0x2ec77f['push'](_0x2ec77f['shift']());}};_0x2b1d3a(++_0xde5b9b);}(_0xebc0,0x1a1));var _0x0ebc=function(_0x54f305,_0x4f3dfb){_0x54f305=_0x54f305-0x0;var _0x1bbd47=_0xebc0[_0x54f305];return _0x1bbd47;};'use strict';var _=require(_0x0ebc('0x0'));var util=require(_0x0ebc('0x1'));var moment=require(_0x0ebc('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ebc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ebc('0x4'))['db'];var utils=require(_0x0ebc('0x5'));var logger=require(_0x0ebc('0x6'))(_0x0ebc('0x7'));var config=require(_0x0ebc('0x8'));var jayson=require(_0x0ebc('0x9'));var client=jayson[_0x0ebc('0xa')][_0x0ebc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27dde6,_0x344a4e,_0x567454){return new BPromise(function(_0x137287,_0x591628){return client['request'](_0x27dde6,_0x567454)[_0x0ebc('0xc')](function(_0x469fea){logger['info'](_0x0ebc('0xd'),_0x344a4e,'request\x20sent');logger[_0x0ebc('0xe')](_0x0ebc('0xf'),_0x344a4e,_0x0ebc('0x10'),JSON[_0x0ebc('0x11')](_0x469fea));if(_0x469fea['error']){if(_0x469fea['error'][_0x0ebc('0x12')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x344a4e,_0x469fea['error'][_0x0ebc('0x13')]);return _0x591628(_0x469fea[_0x0ebc('0x14')]['message']);}logger[_0x0ebc('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x344a4e,_0x469fea[_0x0ebc('0x14')][_0x0ebc('0x13')]);return _0x137287(_0x469fea[_0x0ebc('0x14')]['message']);}else{logger[_0x0ebc('0x15')](_0x0ebc('0xd'),_0x344a4e,_0x0ebc('0x10'));_0x137287(_0x469fea[_0x0ebc('0x16')][_0x0ebc('0x13')]);}})[_0x0ebc('0x17')](function(_0x571774){logger[_0x0ebc('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x344a4e,_0x571774);_0x591628(_0x571774);});});}