2bc3f3bb1eb9fd2c6591f98e0b12fe82696dca86
[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 _0xd25f=['info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd25f,0xdc));var _0xfd25=function(_0x27250c,_0x3e6637){_0x27250c=_0x27250c-0x0;var _0x7e3095=_0xd25f[_0x27250c];return _0x7e3095;};'use strict';var _=require(_0xfd25('0x0'));var util=require(_0xfd25('0x1'));var moment=require(_0xfd25('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd25('0x3'));var db=require(_0xfd25('0x4'))['db'];var utils=require(_0xfd25('0x5'));var logger=require('../../config/logger')(_0xfd25('0x6'));var config=require('../../config/environment');var jayson=require(_0xfd25('0x7'));var client=jayson[_0xfd25('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x148f8b,_0x3d178a,_0x3cac5d){return new BPromise(function(_0x131dea,_0x3cbf18){return client[_0xfd25('0x9')](_0x148f8b,_0x3cac5d)[_0xfd25('0xa')](function(_0x2b7752){logger[_0xfd25('0xb')](_0xfd25('0xc'),_0x3d178a,_0xfd25('0xd'));logger['debug'](_0xfd25('0xe'),_0x3d178a,_0xfd25('0xd'),JSON[_0xfd25('0xf')](_0x2b7752));if(_0x2b7752['error']){if(_0x2b7752[_0xfd25('0x10')][_0xfd25('0x11')]===0x1f4){logger[_0xfd25('0x10')](_0xfd25('0xc'),_0x3d178a,_0x2b7752[_0xfd25('0x10')][_0xfd25('0x12')]);return _0x3cbf18(_0x2b7752[_0xfd25('0x10')][_0xfd25('0x12')]);}logger[_0xfd25('0x10')](_0xfd25('0xc'),_0x3d178a,_0x2b7752[_0xfd25('0x10')][_0xfd25('0x12')]);return _0x131dea(_0x2b7752[_0xfd25('0x10')][_0xfd25('0x12')]);}else{logger[_0xfd25('0xb')](_0xfd25('0xc'),_0x3d178a,'request\x20sent');_0x131dea(_0x2b7752[_0xfd25('0x13')][_0xfd25('0x12')]);}})[_0xfd25('0x14')](function(_0x38f3f4){logger[_0xfd25('0x10')](_0xfd25('0xc'),_0x3d178a,_0x38f3f4);_0x3cbf18(_0x38f3f4);});});}