0237ae747f19fabb6ff110bcd06373869bba66d4
[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 _0xaa7d=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x57cf14,_0x2736dc){var _0x22d10f=function(_0x2a1ca9){while(--_0x2a1ca9){_0x57cf14['push'](_0x57cf14['shift']());}};_0x22d10f(++_0x2736dc);}(_0xaa7d,0x16c));var _0xdaa7=function(_0x2f48cd,_0x46a75a){_0x2f48cd=_0x2f48cd-0x0;var _0x193ae2=_0xaa7d[_0x2f48cd];return _0x193ae2;};'use strict';var _=require('lodash');var util=require(_0xdaa7('0x0'));var moment=require(_0xdaa7('0x1'));var BPromise=require(_0xdaa7('0x2'));var rs=require(_0xdaa7('0x3'));var fs=require('fs');var Redis=require(_0xdaa7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdaa7('0x5'));var logger=require(_0xdaa7('0x6'))(_0xdaa7('0x7'));var config=require(_0xdaa7('0x8'));var jayson=require(_0xdaa7('0x9'));var client=jayson[_0xdaa7('0xa')][_0xdaa7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d6bb8,_0x162076,_0x45f956){return new BPromise(function(_0x44c508,_0x5b2c3a){return client[_0xdaa7('0xc')](_0x5d6bb8,_0x45f956)['then'](function(_0x22c643){logger[_0xdaa7('0xd')](_0xdaa7('0xe'),_0x162076,_0xdaa7('0xf'));logger[_0xdaa7('0x10')](_0xdaa7('0x11'),_0x162076,_0xdaa7('0xf'),JSON['stringify'](_0x22c643));if(_0x22c643['error']){if(_0x22c643[_0xdaa7('0x12')][_0xdaa7('0x13')]===0x1f4){logger[_0xdaa7('0x12')](_0xdaa7('0xe'),_0x162076,_0x22c643['error'][_0xdaa7('0x14')]);return _0x5b2c3a(_0x22c643['error'][_0xdaa7('0x14')]);}logger[_0xdaa7('0x12')](_0xdaa7('0xe'),_0x162076,_0x22c643['error']['message']);return _0x44c508(_0x22c643['error'][_0xdaa7('0x14')]);}else{logger['info'](_0xdaa7('0xe'),_0x162076,_0xdaa7('0xf'));_0x44c508(_0x22c643[_0xdaa7('0x15')][_0xdaa7('0x14')]);}})[_0xdaa7('0x16')](function(_0x4a8004){logger['error'](_0xdaa7('0xe'),_0x162076,_0x4a8004);_0x5b2c3a(_0x4a8004);});});}