64e5fcba7702a34bc43ca52a3415977006a641a5
[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 _0x1b73=['catch','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','http','request','info','UserProfileSection,\x20%s,\x20%s','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x59ae95,_0x5c3671){var _0x5276f7=function(_0x4094ee){while(--_0x4094ee){_0x59ae95['push'](_0x59ae95['shift']());}};_0x5276f7(++_0x5c3671);}(_0x1b73,0x17b));var _0x31b7=function(_0x443bf5,_0x4633fe){_0x443bf5=_0x443bf5-0x0;var _0x219ec8=_0x1b73[_0x443bf5];return _0x219ec8;};'use strict';var _=require(_0x31b7('0x0'));var util=require(_0x31b7('0x1'));var moment=require(_0x31b7('0x2'));var BPromise=require(_0x31b7('0x3'));var rs=require(_0x31b7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x31b7('0x5'))('rpc');var config=require(_0x31b7('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x31b7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3a3f12,_0x1de037,_0x5da5db){return new BPromise(function(_0x146a2f,_0x14f8da){return client[_0x31b7('0x8')](_0x3a3f12,_0x5da5db)['then'](function(_0x3cda5c){logger[_0x31b7('0x9')](_0x31b7('0xa'),_0x1de037,'request\x20sent');logger['debug'](_0x31b7('0xb'),_0x1de037,_0x31b7('0xc'),JSON[_0x31b7('0xd')](_0x3cda5c));if(_0x3cda5c[_0x31b7('0xe')]){if(_0x3cda5c[_0x31b7('0xe')][_0x31b7('0xf')]===0x1f4){logger[_0x31b7('0xe')](_0x31b7('0xa'),_0x1de037,_0x3cda5c[_0x31b7('0xe')]['message']);return _0x14f8da(_0x3cda5c[_0x31b7('0xe')][_0x31b7('0x10')]);}logger['error'](_0x31b7('0xa'),_0x1de037,_0x3cda5c[_0x31b7('0xe')]['message']);return _0x146a2f(_0x3cda5c[_0x31b7('0xe')][_0x31b7('0x10')]);}else{logger[_0x31b7('0x9')](_0x31b7('0xa'),_0x1de037,_0x31b7('0xc'));_0x146a2f(_0x3cda5c['result'][_0x31b7('0x10')]);}})[_0x31b7('0x11')](function(_0x39c678){logger[_0x31b7('0xe')](_0x31b7('0xa'),_0x1de037,_0x39c678);_0x14f8da(_0x39c678);});});}