5b9f40a97e92597be21487de20e5c4481c3b3358
[motion2.git] / server / api / intVtigerConfiguration / intVtigerConfiguration.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 _0x322f=['message','request\x20sent','result','catch','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x322f,0x9c));var _0xf322=function(_0x4bc2dc,_0x5aa865){_0x4bc2dc=_0x4bc2dc-0x0;var _0x3dbee9=_0x322f[_0x4bc2dc];return _0x3dbee9;};'use strict';var _=require('lodash');var util=require(_0xf322('0x0'));var moment=require(_0xf322('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf322('0x2'))['db'];var utils=require(_0xf322('0x3'));var logger=require('../../config/logger')(_0xf322('0x4'));var config=require(_0xf322('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf322('0x6')][_0xf322('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x59e78d,_0x550a24,_0x55ed98){return new BPromise(function(_0x17187f,_0xb9a7b){return client['request'](_0x59e78d,_0x55ed98)['then'](function(_0xb109dc){logger[_0xf322('0x8')](_0xf322('0x9'),_0x550a24,'request\x20sent');logger[_0xf322('0xa')](_0xf322('0xb'),_0x550a24,'request\x20sent',JSON[_0xf322('0xc')](_0xb109dc));if(_0xb109dc['error']){if(_0xb109dc[_0xf322('0xd')][_0xf322('0xe')]===0x1f4){logger[_0xf322('0xd')](_0xf322('0x9'),_0x550a24,_0xb109dc[_0xf322('0xd')][_0xf322('0xf')]);return _0xb9a7b(_0xb109dc[_0xf322('0xd')][_0xf322('0xf')]);}logger[_0xf322('0xd')](_0xf322('0x9'),_0x550a24,_0xb109dc['error']['message']);return _0x17187f(_0xb109dc[_0xf322('0xd')][_0xf322('0xf')]);}else{logger[_0xf322('0x8')](_0xf322('0x9'),_0x550a24,_0xf322('0x10'));_0x17187f(_0xb109dc[_0xf322('0x11')][_0xf322('0xf')]);}})[_0xf322('0x12')](function(_0x2daade){logger[_0xf322('0xd')](_0xf322('0x9'),_0x550a24,_0x2daade);_0xb9a7b(_0x2daade);});});}