14d45348fddf57fdbf407e54b9ac32ba9403e23e
[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 _0xb807=['info','debug','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','request\x20sent','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x3ddb02,_0x184ada){var _0x52b85f=function(_0xc7f427){while(--_0xc7f427){_0x3ddb02['push'](_0x3ddb02['shift']());}};_0x52b85f(++_0x184ada);}(_0xb807,0xf9));var _0x7b80=function(_0x4fe93e,_0x44f9e2){_0x4fe93e=_0x4fe93e-0x0;var _0x5f1d5a=_0xb807[_0x4fe93e];return _0x5f1d5a;};'use strict';var _=require('lodash');var util=require(_0x7b80('0x0'));var moment=require('moment');var BPromise=require(_0x7b80('0x1'));var rs=require(_0x7b80('0x2'));var fs=require('fs');var Redis=require(_0x7b80('0x3'));var db=require(_0x7b80('0x4'))['db'];var utils=require(_0x7b80('0x5'));var logger=require('../../config/logger')(_0x7b80('0x6'));var config=require(_0x7b80('0x7'));var jayson=require(_0x7b80('0x8'));var client=jayson[_0x7b80('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dfb2d,_0x2a6183,_0x12af51){return new BPromise(function(_0x2a5bcf,_0x3a4ee2){return client['request'](_0x3dfb2d,_0x12af51)[_0x7b80('0xa')](function(_0x5571a6){logger[_0x7b80('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x2a6183,'request\x20sent');logger[_0x7b80('0xc')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x2a6183,'request\x20sent',JSON[_0x7b80('0xd')](_0x5571a6));if(_0x5571a6[_0x7b80('0xe')]){if(_0x5571a6['error'][_0x7b80('0xf')]===0x1f4){logger['error'](_0x7b80('0x10'),_0x2a6183,_0x5571a6['error'][_0x7b80('0x11')]);return _0x3a4ee2(_0x5571a6['error'][_0x7b80('0x11')]);}logger[_0x7b80('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x2a6183,_0x5571a6[_0x7b80('0xe')]['message']);return _0x2a5bcf(_0x5571a6[_0x7b80('0xe')][_0x7b80('0x11')]);}else{logger['info'](_0x7b80('0x10'),_0x2a6183,_0x7b80('0x12'));_0x2a5bcf(_0x5571a6['result'][_0x7b80('0x11')]);}})[_0x7b80('0x13')](function(_0x1f480f){logger[_0x7b80('0xe')](_0x7b80('0x10'),_0x2a6183,_0x1f480f);_0x3a4ee2(_0x1f480f);});});}