3de6eec2567f6db40e3a8fbd1934ab4ddd8d30b9
[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 _0xc830=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5f37b1,_0x26fb91){var _0x31ab85=function(_0x40b006){while(--_0x40b006){_0x5f37b1['push'](_0x5f37b1['shift']());}};_0x31ab85(++_0x26fb91);}(_0xc830,0x85));var _0x0c83=function(_0x243dce,_0x548bcf){_0x243dce=_0x243dce-0x0;var _0x482b9d=_0xc830[_0x243dce];return _0x482b9d;};'use strict';var _=require(_0x0c83('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0c83('0x1'));var rs=require(_0x0c83('0x2'));var fs=require('fs');var Redis=require(_0x0c83('0x3'));var db=require(_0x0c83('0x4'))['db'];var utils=require(_0x0c83('0x5'));var logger=require(_0x0c83('0x6'))(_0x0c83('0x7'));var config=require(_0x0c83('0x8'));var jayson=require(_0x0c83('0x9'));var client=jayson[_0x0c83('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37b2b6,_0xda3bd9,_0x26acd3){return new BPromise(function(_0x50c30d,_0x3e890c){return client[_0x0c83('0xb')](_0x37b2b6,_0x26acd3)[_0x0c83('0xc')](function(_0x3b5bed){logger[_0x0c83('0xd')](_0x0c83('0xe'),_0xda3bd9,_0x0c83('0xf'));logger[_0x0c83('0x10')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0xda3bd9,_0x0c83('0xf'),JSON[_0x0c83('0x11')](_0x3b5bed));if(_0x3b5bed[_0x0c83('0x12')]){if(_0x3b5bed[_0x0c83('0x12')][_0x0c83('0x13')]===0x1f4){logger[_0x0c83('0x12')](_0x0c83('0xe'),_0xda3bd9,_0x3b5bed['error']['message']);return _0x3e890c(_0x3b5bed[_0x0c83('0x12')][_0x0c83('0x14')]);}logger[_0x0c83('0x12')](_0x0c83('0xe'),_0xda3bd9,_0x3b5bed[_0x0c83('0x12')][_0x0c83('0x14')]);return _0x50c30d(_0x3b5bed[_0x0c83('0x12')]['message']);}else{logger[_0x0c83('0xd')](_0x0c83('0xe'),_0xda3bd9,_0x0c83('0xf'));_0x50c30d(_0x3b5bed[_0x0c83('0x15')]['message']);}})[_0x0c83('0x16')](function(_0x397b80){logger[_0x0c83('0x12')](_0x0c83('0xe'),_0xda3bd9,_0x397b80);_0x3e890c(_0x397b80);});});}