Built motion from commit (unavailable).|2.5.22
[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 _0x9cdb=['util','moment','bluebird','../../mysqldb','jayson/promise','http','request','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0x9cdb,0x131));var _0xb9cd=function(_0x1be648,_0x1e8622){_0x1be648=_0x1be648-0x0;var _0x281bd1=_0x9cdb[_0x1be648];return _0x281bd1;};'use strict';var _=require(_0xb9cd('0x0'));var util=require(_0xb9cd('0x1'));var moment=require(_0xb9cd('0x2'));var BPromise=require(_0xb9cd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9cd('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb9cd('0x5'));var client=jayson['client'][_0xb9cd('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4185d1,_0x1eb6ab,_0x2b096f){return new BPromise(function(_0x3e0281,_0x4dc6d7){return client[_0xb9cd('0x7')](_0x4185d1,_0x2b096f)['then'](function(_0x2eda20){logger['info'](_0xb9cd('0x8'),_0x1eb6ab,_0xb9cd('0x9'));logger[_0xb9cd('0xa')](_0xb9cd('0xb'),_0x1eb6ab,'request\x20sent',JSON[_0xb9cd('0xc')](_0x2eda20));if(_0x2eda20[_0xb9cd('0xd')]){if(_0x2eda20[_0xb9cd('0xd')][_0xb9cd('0xe')]===0x1f4){logger[_0xb9cd('0xd')](_0xb9cd('0x8'),_0x1eb6ab,_0x2eda20[_0xb9cd('0xd')][_0xb9cd('0xf')]);return _0x4dc6d7(_0x2eda20['error'][_0xb9cd('0xf')]);}logger[_0xb9cd('0xd')](_0xb9cd('0x8'),_0x1eb6ab,_0x2eda20[_0xb9cd('0xd')]['message']);return _0x3e0281(_0x2eda20[_0xb9cd('0xd')][_0xb9cd('0xf')]);}else{logger[_0xb9cd('0x10')](_0xb9cd('0x8'),_0x1eb6ab,_0xb9cd('0x9'));_0x3e0281(_0x2eda20[_0xb9cd('0x11')][_0xb9cd('0xf')]);}})['catch'](function(_0x56aae9){logger[_0xb9cd('0xd')](_0xb9cd('0x8'),_0x1eb6ab,_0x56aae9);_0x4dc6d7(_0x56aae9);});});}