c0d501104b0e6f309a1cdc3cbb2713d20afd3634
[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 _0xfa98=['../../config/environment','jayson/promise','client','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x21defb,_0x137d35){var _0x2356d0=function(_0x27606a){while(--_0x27606a){_0x21defb['push'](_0x21defb['shift']());}};_0x2356d0(++_0x137d35);}(_0xfa98,0x11a));var _0x8fa9=function(_0x10ec84,_0x267064){_0x10ec84=_0x10ec84-0x0;var _0x12565e=_0xfa98[_0x10ec84];return _0x12565e;};'use strict';var _=require(_0x8fa9('0x0'));var util=require(_0x8fa9('0x1'));var moment=require(_0x8fa9('0x2'));var BPromise=require(_0x8fa9('0x3'));var rs=require(_0x8fa9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fa9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8fa9('0x6'));var jayson=require(_0x8fa9('0x7'));var client=jayson[_0x8fa9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49b148,_0x271385,_0x34231e){return new BPromise(function(_0x5666a9,_0x32e38d){return client['request'](_0x49b148,_0x34231e)['then'](function(_0x1b7043){logger['info'](_0x8fa9('0x9'),_0x271385,_0x8fa9('0xa'));logger[_0x8fa9('0xb')](_0x8fa9('0xc'),_0x271385,_0x8fa9('0xa'),JSON[_0x8fa9('0xd')](_0x1b7043));if(_0x1b7043[_0x8fa9('0xe')]){if(_0x1b7043[_0x8fa9('0xe')]['code']===0x1f4){logger['error'](_0x8fa9('0x9'),_0x271385,_0x1b7043['error'][_0x8fa9('0xf')]);return _0x32e38d(_0x1b7043[_0x8fa9('0xe')][_0x8fa9('0xf')]);}logger[_0x8fa9('0xe')](_0x8fa9('0x9'),_0x271385,_0x1b7043[_0x8fa9('0xe')]['message']);return _0x5666a9(_0x1b7043[_0x8fa9('0xe')][_0x8fa9('0xf')]);}else{logger[_0x8fa9('0x10')](_0x8fa9('0x9'),_0x271385,_0x8fa9('0xa'));_0x5666a9(_0x1b7043['result'][_0x8fa9('0xf')]);}})[_0x8fa9('0x11')](function(_0x357bb0){logger[_0x8fa9('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x271385,_0x357bb0);_0x32e38d(_0x357bb0);});});}