dc8b445ae94a3301d385b674fa0000d250147887
[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 _0x77c6=['debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','UserProfileSection,\x20%s,\x20%s'];(function(_0x49803f,_0x5c0423){var _0x5ae4d2=function(_0x390b14){while(--_0x390b14){_0x49803f['push'](_0x49803f['shift']());}};_0x5ae4d2(++_0x5c0423);}(_0x77c6,0x1b7));var _0x677c=function(_0x13044f,_0x3eefe1){_0x13044f=_0x13044f-0x0;var _0x526d36=_0x77c6[_0x13044f];return _0x526d36;};'use strict';var _=require(_0x677c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x677c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x677c('0x2'));var db=require(_0x677c('0x3'))['db'];var utils=require(_0x677c('0x4'));var logger=require(_0x677c('0x5'))(_0x677c('0x6'));var config=require('../../config/environment');var jayson=require(_0x677c('0x7'));var client=jayson['client'][_0x677c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e8efa,_0x1c2df1,_0x22580f){return new BPromise(function(_0x35d7e5,_0x4061f0){return client['request'](_0x2e8efa,_0x22580f)['then'](function(_0x48d8dc){logger[_0x677c('0x9')](_0x677c('0xa'),_0x1c2df1,'request\x20sent');logger[_0x677c('0xb')](_0x677c('0xc'),_0x1c2df1,_0x677c('0xd'),JSON['stringify'](_0x48d8dc));if(_0x48d8dc['error']){if(_0x48d8dc[_0x677c('0xe')]['code']===0x1f4){logger[_0x677c('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x1c2df1,_0x48d8dc[_0x677c('0xe')][_0x677c('0xf')]);return _0x4061f0(_0x48d8dc[_0x677c('0xe')][_0x677c('0xf')]);}logger['error'](_0x677c('0xa'),_0x1c2df1,_0x48d8dc[_0x677c('0xe')]['message']);return _0x35d7e5(_0x48d8dc['error'][_0x677c('0xf')]);}else{logger[_0x677c('0x9')](_0x677c('0xa'),_0x1c2df1,_0x677c('0xd'));_0x35d7e5(_0x48d8dc[_0x677c('0x10')]['message']);}})[_0x677c('0x11')](function(_0x122c70){logger[_0x677c('0xe')](_0x677c('0xa'),_0x1c2df1,_0x122c70);_0x4061f0(_0x122c70);});});}