Built motion from commit 753c950e.|2.5.42
[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 _0x1d4e=['catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x4a91b0,_0x144c08){var _0x2bb6fc=function(_0x53c280){while(--_0x53c280){_0x4a91b0['push'](_0x4a91b0['shift']());}};_0x2bb6fc(++_0x144c08);}(_0x1d4e,0x13c));var _0xe1d4=function(_0x2aa3ef,_0x1b0227){_0x2aa3ef=_0x2aa3ef-0x0;var _0x2e80d1=_0x1d4e[_0x2aa3ef];return _0x2e80d1;};'use strict';var _=require('lodash');var util=require(_0xe1d4('0x0'));var moment=require('moment');var BPromise=require(_0xe1d4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe1d4('0x2'));var db=require(_0xe1d4('0x3'))['db'];var utils=require(_0xe1d4('0x4'));var logger=require('../../config/logger')(_0xe1d4('0x5'));var config=require(_0xe1d4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe1d4('0x7')][_0xe1d4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e324a,_0x1fc55b,_0xaab000){return new BPromise(function(_0x201cc0,_0x40bfc6){return client[_0xe1d4('0x9')](_0x5e324a,_0xaab000)[_0xe1d4('0xa')](function(_0x50201c){logger[_0xe1d4('0xb')](_0xe1d4('0xc'),_0x1fc55b,_0xe1d4('0xd'));logger[_0xe1d4('0xe')](_0xe1d4('0xf'),_0x1fc55b,_0xe1d4('0xd'),JSON['stringify'](_0x50201c));if(_0x50201c[_0xe1d4('0x10')]){if(_0x50201c[_0xe1d4('0x10')][_0xe1d4('0x11')]===0x1f4){logger[_0xe1d4('0x10')](_0xe1d4('0xc'),_0x1fc55b,_0x50201c[_0xe1d4('0x10')][_0xe1d4('0x12')]);return _0x40bfc6(_0x50201c[_0xe1d4('0x10')][_0xe1d4('0x12')]);}logger[_0xe1d4('0x10')](_0xe1d4('0xc'),_0x1fc55b,_0x50201c[_0xe1d4('0x10')][_0xe1d4('0x12')]);return _0x201cc0(_0x50201c[_0xe1d4('0x10')][_0xe1d4('0x12')]);}else{logger['info'](_0xe1d4('0xc'),_0x1fc55b,_0xe1d4('0xd'));_0x201cc0(_0x50201c[_0xe1d4('0x13')]['message']);}})[_0xe1d4('0x14')](function(_0x370230){logger[_0xe1d4('0x10')](_0xe1d4('0xc'),_0x1fc55b,_0x370230);_0x40bfc6(_0x370230);});});}