1c610f40035080e675ffd2f12b434d37947bfd0c
[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 _0xf743=['client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment'];(function(_0x414e67,_0x3793c9){var _0x5535ee=function(_0x59eaa7){while(--_0x59eaa7){_0x414e67['push'](_0x414e67['shift']());}};_0x5535ee(++_0x3793c9);}(_0xf743,0xca));var _0x3f74=function(_0x3f94a3,_0x4c0e2b){_0x3f94a3=_0x3f94a3-0x0;var _0x5617e5=_0xf743[_0x3f94a3];return _0x5617e5;};'use strict';var _=require(_0x3f74('0x0'));var util=require(_0x3f74('0x1'));var moment=require(_0x3f74('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f74('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3f74('0x4'))(_0x3f74('0x5'));var config=require(_0x3f74('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3f74('0x7')][_0x3f74('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ae3ea,_0x4d32cf,_0x5c6355){return new BPromise(function(_0x10c6ec,_0x593126){return client['request'](_0x1ae3ea,_0x5c6355)[_0x3f74('0x9')](function(_0x45df4e){logger[_0x3f74('0xa')](_0x3f74('0xb'),_0x4d32cf,_0x3f74('0xc'));logger[_0x3f74('0xd')](_0x3f74('0xe'),_0x4d32cf,_0x3f74('0xc'),JSON[_0x3f74('0xf')](_0x45df4e));if(_0x45df4e[_0x3f74('0x10')]){if(_0x45df4e[_0x3f74('0x10')]['code']===0x1f4){logger['error'](_0x3f74('0xb'),_0x4d32cf,_0x45df4e['error'][_0x3f74('0x11')]);return _0x593126(_0x45df4e[_0x3f74('0x10')]['message']);}logger[_0x3f74('0x10')](_0x3f74('0xb'),_0x4d32cf,_0x45df4e['error'][_0x3f74('0x11')]);return _0x10c6ec(_0x45df4e[_0x3f74('0x10')][_0x3f74('0x11')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x4d32cf,_0x3f74('0xc'));_0x10c6ec(_0x45df4e['result'][_0x3f74('0x11')]);}})[_0x3f74('0x12')](function(_0x406c93){logger['error'](_0x3f74('0xb'),_0x4d32cf,_0x406c93);_0x593126(_0x406c93);});});}