a068631014b29efc2556633f8e27c80dd5f4e5c7
[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 _0xa065=['VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1ca3ed,_0x12a957){var _0x23c632=function(_0x295126){while(--_0x295126){_0x1ca3ed['push'](_0x1ca3ed['shift']());}};_0x23c632(++_0x12a957);}(_0xa065,0x197));var _0x5a06=function(_0x1b036c,_0x4aa84f){_0x1b036c=_0x1b036c-0x0;var _0x4fe412=_0xa065[_0x1b036c];return _0x4fe412;};'use strict';var _=require(_0x5a06('0x0'));var util=require(_0x5a06('0x1'));var moment=require('moment');var BPromise=require(_0x5a06('0x2'));var rs=require(_0x5a06('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a06('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5a06('0x5'));var config=require(_0x5a06('0x6'));var jayson=require(_0x5a06('0x7'));var client=jayson[_0x5a06('0x8')][_0x5a06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41ddb7,_0x33cdf5,_0x2b877e){return new BPromise(function(_0x132531,_0x3ebac3){return client[_0x5a06('0xa')](_0x41ddb7,_0x2b877e)[_0x5a06('0xb')](function(_0x53407e){logger[_0x5a06('0xc')](_0x5a06('0xd'),_0x33cdf5,_0x5a06('0xe'));logger[_0x5a06('0xf')](_0x5a06('0x10'),_0x33cdf5,'request\x20sent',JSON['stringify'](_0x53407e));if(_0x53407e[_0x5a06('0x11')]){if(_0x53407e[_0x5a06('0x11')]['code']===0x1f4){logger[_0x5a06('0x11')](_0x5a06('0xd'),_0x33cdf5,_0x53407e[_0x5a06('0x11')][_0x5a06('0x12')]);return _0x3ebac3(_0x53407e[_0x5a06('0x11')]['message']);}logger[_0x5a06('0x11')](_0x5a06('0xd'),_0x33cdf5,_0x53407e[_0x5a06('0x11')][_0x5a06('0x12')]);return _0x132531(_0x53407e[_0x5a06('0x11')]['message']);}else{logger[_0x5a06('0xc')](_0x5a06('0xd'),_0x33cdf5,'request\x20sent');_0x132531(_0x53407e['result'][_0x5a06('0x12')]);}})[_0x5a06('0x13')](function(_0x176925){logger[_0x5a06('0x11')](_0x5a06('0xd'),_0x33cdf5,_0x176925);_0x3ebac3(_0x176925);});});}