b0861f4ca455ae130eb086ce2b067054a354f2f7
[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 _0xa537=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x519b94,_0x4c44b6){var _0x1cd90e=function(_0x476eb1){while(--_0x476eb1){_0x519b94['push'](_0x519b94['shift']());}};_0x1cd90e(++_0x4c44b6);}(_0xa537,0x123));var _0x7a53=function(_0x1295c1,_0x4636e8){_0x1295c1=_0x1295c1-0x0;var _0x529fa5=_0xa537[_0x1295c1];return _0x529fa5;};'use strict';var _=require(_0x7a53('0x0'));var util=require(_0x7a53('0x1'));var moment=require('moment');var BPromise=require(_0x7a53('0x2'));var rs=require(_0x7a53('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a53('0x4'))['db'];var utils=require(_0x7a53('0x5'));var logger=require('../../config/logger')(_0x7a53('0x6'));var config=require(_0x7a53('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7a53('0x8')][_0x7a53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2187bc,_0x1db7cf,_0xb47886){return new BPromise(function(_0xe08194,_0x3bf4a2){return client[_0x7a53('0xa')](_0x2187bc,_0xb47886)[_0x7a53('0xb')](function(_0x4fcbf8){logger[_0x7a53('0xc')](_0x7a53('0xd'),_0x1db7cf,_0x7a53('0xe'));logger['debug'](_0x7a53('0xf'),_0x1db7cf,_0x7a53('0xe'),JSON['stringify'](_0x4fcbf8));if(_0x4fcbf8[_0x7a53('0x10')]){if(_0x4fcbf8[_0x7a53('0x10')][_0x7a53('0x11')]===0x1f4){logger[_0x7a53('0x10')](_0x7a53('0xd'),_0x1db7cf,_0x4fcbf8['error'][_0x7a53('0x12')]);return _0x3bf4a2(_0x4fcbf8['error'][_0x7a53('0x12')]);}logger[_0x7a53('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x1db7cf,_0x4fcbf8[_0x7a53('0x10')]['message']);return _0xe08194(_0x4fcbf8[_0x7a53('0x10')][_0x7a53('0x12')]);}else{logger[_0x7a53('0xc')](_0x7a53('0xd'),_0x1db7cf,'request\x20sent');_0xe08194(_0x4fcbf8[_0x7a53('0x13')][_0x7a53('0x12')]);}})[_0x7a53('0x14')](function(_0x57c64a){logger[_0x7a53('0x10')](_0x7a53('0xd'),_0x1db7cf,_0x57c64a);_0x3bf4a2(_0x57c64a);});});}