d151770f26b3bb0ad943fa7e016be3dc87a8bf1e
[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 _0x44c6=['message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x50639f,_0x54c530){var _0x4475fd=function(_0x4e3112){while(--_0x4e3112){_0x50639f['push'](_0x50639f['shift']());}};_0x4475fd(++_0x54c530);}(_0x44c6,0xae));var _0x644c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x44c6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x644c('0x0'));var moment=require('moment');var BPromise=require(_0x644c('0x1'));var rs=require(_0x644c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x644c('0x3'))['db'];var utils=require(_0x644c('0x4'));var logger=require('../../config/logger')(_0x644c('0x5'));var config=require(_0x644c('0x6'));var jayson=require(_0x644c('0x7'));var client=jayson[_0x644c('0x8')][_0x644c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38ce48,_0x8c6bdc,_0x59ea4c){return new BPromise(function(_0x1e2f2f,_0x443c5a){return client['request'](_0x38ce48,_0x59ea4c)[_0x644c('0xa')](function(_0x188550){logger[_0x644c('0xb')](_0x644c('0xc'),_0x8c6bdc,_0x644c('0xd'));logger[_0x644c('0xe')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x8c6bdc,_0x644c('0xd'),JSON['stringify'](_0x188550));if(_0x188550[_0x644c('0xf')]){if(_0x188550[_0x644c('0xf')]['code']===0x1f4){logger[_0x644c('0xf')](_0x644c('0xc'),_0x8c6bdc,_0x188550[_0x644c('0xf')][_0x644c('0x10')]);return _0x443c5a(_0x188550['error'][_0x644c('0x10')]);}logger[_0x644c('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x8c6bdc,_0x188550[_0x644c('0xf')][_0x644c('0x10')]);return _0x1e2f2f(_0x188550[_0x644c('0xf')][_0x644c('0x10')]);}else{logger[_0x644c('0xb')](_0x644c('0xc'),_0x8c6bdc,'request\x20sent');_0x1e2f2f(_0x188550[_0x644c('0x11')]['message']);}})[_0x644c('0x12')](function(_0x1eed0d){logger[_0x644c('0xf')](_0x644c('0xc'),_0x8c6bdc,_0x1eed0d);_0x443c5a(_0x1eed0d);});});}