Built motion from commit (unavailable).|2.4.17
[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 _0x70c3=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','info'];(function(_0x31ef40,_0x1e720c){var _0x21edeb=function(_0x4f3619){while(--_0x4f3619){_0x31ef40['push'](_0x31ef40['shift']());}};_0x21edeb(++_0x1e720c);}(_0x70c3,0x70));var _0x370c=function(_0xaf9302,_0x14fbe1){_0xaf9302=_0xaf9302-0x0;var _0x1a3688=_0x70c3[_0xaf9302];return _0x1a3688;};'use strict';var _=require(_0x370c('0x0'));var util=require('util');var moment=require(_0x370c('0x1'));var BPromise=require(_0x370c('0x2'));var rs=require(_0x370c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x370c('0x4'))['db'];var utils=require(_0x370c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x370c('0x6'));var jayson=require(_0x370c('0x7'));var client=jayson['client'][_0x370c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x151765,_0x20c94c,_0x50858a){return new BPromise(function(_0x33c9c3,_0x355bcc){return client[_0x370c('0x9')](_0x151765,_0x50858a)[_0x370c('0xa')](function(_0x35070e){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x20c94c,'request\x20sent');logger[_0x370c('0xb')](_0x370c('0xc'),_0x20c94c,_0x370c('0xd'),JSON[_0x370c('0xe')](_0x35070e));if(_0x35070e[_0x370c('0xf')]){if(_0x35070e[_0x370c('0xf')][_0x370c('0x10')]===0x1f4){logger[_0x370c('0xf')](_0x370c('0x11'),_0x20c94c,_0x35070e['error'][_0x370c('0x12')]);return _0x355bcc(_0x35070e[_0x370c('0xf')]['message']);}logger[_0x370c('0xf')](_0x370c('0x11'),_0x20c94c,_0x35070e[_0x370c('0xf')][_0x370c('0x12')]);return _0x33c9c3(_0x35070e[_0x370c('0xf')][_0x370c('0x12')]);}else{logger[_0x370c('0x13')](_0x370c('0x11'),_0x20c94c,_0x370c('0xd'));_0x33c9c3(_0x35070e[_0x370c('0x14')][_0x370c('0x12')]);}})[_0x370c('0x15')](function(_0x4374b7){logger[_0x370c('0xf')](_0x370c('0x11'),_0x20c94c,_0x4374b7);_0x355bcc(_0x4374b7);});});}