541d31f5b2b832812d8c224e525822adb995ac23
[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 _0x9e08=['lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VtigerConfiguration,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch'];(function(_0x5139bb,_0x3fb5f4){var _0x306e2a=function(_0x3b6036){while(--_0x3b6036){_0x5139bb['push'](_0x5139bb['shift']());}};_0x306e2a(++_0x3fb5f4);}(_0x9e08,0x126));var _0x89e0=function(_0x7907c7,_0x187225){_0x7907c7=_0x7907c7-0x0;var _0x567788=_0x9e08[_0x7907c7];return _0x567788;};'use strict';var _=require(_0x89e0('0x0'));var util=require(_0x89e0('0x1'));var moment=require(_0x89e0('0x2'));var BPromise=require('bluebird');var rs=require(_0x89e0('0x3'));var fs=require('fs');var Redis=require(_0x89e0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x89e0('0x5'));var logger=require(_0x89e0('0x6'))(_0x89e0('0x7'));var config=require(_0x89e0('0x8'));var jayson=require(_0x89e0('0x9'));var client=jayson[_0x89e0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17cd47,_0x247fc6,_0x50afe7){return new BPromise(function(_0x1e1f2b,_0x4e8ee7){return client[_0x89e0('0xb')](_0x17cd47,_0x50afe7)['then'](function(_0x2d61f3){logger[_0x89e0('0xc')](_0x89e0('0xd'),_0x247fc6,'request\x20sent');logger[_0x89e0('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x247fc6,'request\x20sent',JSON['stringify'](_0x2d61f3));if(_0x2d61f3['error']){if(_0x2d61f3[_0x89e0('0xf')][_0x89e0('0x10')]===0x1f4){logger[_0x89e0('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x247fc6,_0x2d61f3[_0x89e0('0xf')]['message']);return _0x4e8ee7(_0x2d61f3[_0x89e0('0xf')][_0x89e0('0x11')]);}logger[_0x89e0('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x247fc6,_0x2d61f3[_0x89e0('0xf')][_0x89e0('0x11')]);return _0x1e1f2b(_0x2d61f3[_0x89e0('0xf')][_0x89e0('0x11')]);}else{logger[_0x89e0('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x247fc6,_0x89e0('0x12'));_0x1e1f2b(_0x2d61f3[_0x89e0('0x13')][_0x89e0('0x11')]);}})[_0x89e0('0x14')](function(_0x26cf15){logger[_0x89e0('0xf')](_0x89e0('0xd'),_0x247fc6,_0x26cf15);_0x4e8ee7(_0x26cf15);});});}