0a728867b19714b62019aec5388e3306cd6bf902
[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 _0xea40=['info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x184496,_0x434675){var _0x1b8cd3=function(_0x51579e){while(--_0x51579e){_0x184496['push'](_0x184496['shift']());}};_0x1b8cd3(++_0x434675);}(_0xea40,0x1d0));var _0x0ea4=function(_0x314ccd,_0xb410af){_0x314ccd=_0x314ccd-0x0;var _0x27ed35=_0xea40[_0x314ccd];return _0x27ed35;};'use strict';var _=require(_0x0ea4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0ea4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ea4('0x2'));var db=require(_0x0ea4('0x3'))['db'];var utils=require(_0x0ea4('0x4'));var logger=require(_0x0ea4('0x5'))(_0x0ea4('0x6'));var config=require(_0x0ea4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0ea4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12b6e5,_0x25563d,_0x3716e9){return new BPromise(function(_0xcf4125,_0x356e1f){return client[_0x0ea4('0x9')](_0x12b6e5,_0x3716e9)[_0x0ea4('0xa')](function(_0x23451b){logger[_0x0ea4('0xb')](_0x0ea4('0xc'),_0x25563d,_0x0ea4('0xd'));logger['debug'](_0x0ea4('0xe'),_0x25563d,_0x0ea4('0xd'),JSON['stringify'](_0x23451b));if(_0x23451b[_0x0ea4('0xf')]){if(_0x23451b[_0x0ea4('0xf')][_0x0ea4('0x10')]===0x1f4){logger[_0x0ea4('0xf')](_0x0ea4('0xc'),_0x25563d,_0x23451b[_0x0ea4('0xf')][_0x0ea4('0x11')]);return _0x356e1f(_0x23451b['error']['message']);}logger['error'](_0x0ea4('0xc'),_0x25563d,_0x23451b[_0x0ea4('0xf')][_0x0ea4('0x11')]);return _0xcf4125(_0x23451b[_0x0ea4('0xf')][_0x0ea4('0x11')]);}else{logger[_0x0ea4('0xb')](_0x0ea4('0xc'),_0x25563d,'request\x20sent');_0xcf4125(_0x23451b['result'][_0x0ea4('0x11')]);}})[_0x0ea4('0x12')](function(_0x59e8e5){logger[_0x0ea4('0xf')](_0x0ea4('0xc'),_0x25563d,_0x59e8e5);_0x356e1f(_0x59e8e5);});});}