Built motion from commit 43538d75.|2.5.35
[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 _0x9b09=['lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x9b09,0xfd));var _0x99b0=function(_0x18546c,_0x4daf94){_0x18546c=_0x18546c-0x0;var _0x46ef43=_0x9b09[_0x18546c];return _0x46ef43;};'use strict';var _=require(_0x99b0('0x0'));var util=require(_0x99b0('0x1'));var moment=require(_0x99b0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99b0('0x3'))['db'];var utils=require(_0x99b0('0x4'));var logger=require(_0x99b0('0x5'))(_0x99b0('0x6'));var config=require(_0x99b0('0x7'));var jayson=require(_0x99b0('0x8'));var client=jayson[_0x99b0('0x9')][_0x99b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1939f6,_0x322b98,_0x1d0ebb){return new BPromise(function(_0x1930d6,_0x5f341e){return client[_0x99b0('0xb')](_0x1939f6,_0x1d0ebb)[_0x99b0('0xc')](function(_0x5402ab){logger[_0x99b0('0xd')](_0x99b0('0xe'),_0x322b98,_0x99b0('0xf'));logger['debug'](_0x99b0('0x10'),_0x322b98,_0x99b0('0xf'),JSON[_0x99b0('0x11')](_0x5402ab));if(_0x5402ab[_0x99b0('0x12')]){if(_0x5402ab[_0x99b0('0x12')][_0x99b0('0x13')]===0x1f4){logger[_0x99b0('0x12')](_0x99b0('0xe'),_0x322b98,_0x5402ab[_0x99b0('0x12')][_0x99b0('0x14')]);return _0x5f341e(_0x5402ab[_0x99b0('0x12')]['message']);}logger[_0x99b0('0x12')](_0x99b0('0xe'),_0x322b98,_0x5402ab[_0x99b0('0x12')][_0x99b0('0x14')]);return _0x1930d6(_0x5402ab[_0x99b0('0x12')][_0x99b0('0x14')]);}else{logger['info'](_0x99b0('0xe'),_0x322b98,'request\x20sent');_0x1930d6(_0x5402ab[_0x99b0('0x15')][_0x99b0('0x14')]);}})[_0x99b0('0x16')](function(_0x73e45e){logger[_0x99b0('0x12')](_0x99b0('0xe'),_0x322b98,_0x73e45e);_0x5f341e(_0x73e45e);});});}