Built motion from commit 71df090e.|2.6.31
[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 _0x81a5=['info','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x528940,_0x7060db){var _0x1f278e=function(_0xc498de){while(--_0xc498de){_0x528940['push'](_0x528940['shift']());}};_0x1f278e(++_0x7060db);}(_0x81a5,0x7b));var _0x581a=function(_0x4ca425,_0x593ea7){_0x4ca425=_0x4ca425-0x0;var _0x3bb307=_0x81a5[_0x4ca425];return _0x3bb307;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x581a('0x0'));var BPromise=require(_0x581a('0x1'));var rs=require(_0x581a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x581a('0x3'))['db'];var utils=require(_0x581a('0x4'));var logger=require('../../config/logger')(_0x581a('0x5'));var config=require(_0x581a('0x6'));var jayson=require(_0x581a('0x7'));var client=jayson['client'][_0x581a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dc2b3,_0x4a2888,_0x500b2d){return new BPromise(function(_0x57a748,_0x3c03bf){return client[_0x581a('0x9')](_0x2dc2b3,_0x500b2d)[_0x581a('0xa')](function(_0x36db87){logger['info'](_0x581a('0xb'),_0x4a2888,_0x581a('0xc'));logger['debug'](_0x581a('0xd'),_0x4a2888,_0x581a('0xc'),JSON['stringify'](_0x36db87));if(_0x36db87[_0x581a('0xe')]){if(_0x36db87['error'][_0x581a('0xf')]===0x1f4){logger[_0x581a('0xe')](_0x581a('0xb'),_0x4a2888,_0x36db87['error']['message']);return _0x3c03bf(_0x36db87[_0x581a('0xe')][_0x581a('0x10')]);}logger[_0x581a('0xe')](_0x581a('0xb'),_0x4a2888,_0x36db87[_0x581a('0xe')]['message']);return _0x57a748(_0x36db87[_0x581a('0xe')]['message']);}else{logger[_0x581a('0x11')](_0x581a('0xb'),_0x4a2888,_0x581a('0xc'));_0x57a748(_0x36db87[_0x581a('0x12')][_0x581a('0x10')]);}})[_0x581a('0x13')](function(_0x46a936){logger[_0x581a('0xe')](_0x581a('0xb'),_0x4a2888,_0x46a936);_0x3c03bf(_0x46a936);});});}