Built motion from commit a61a4a20.|2.5.46
[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 _0xf8b2=['debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','VtigerConfiguration,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf8b2,0x184));var _0x2f8b=function(_0x32da04,_0x255b7b){_0x32da04=_0x32da04-0x0;var _0x468bac=_0xf8b2[_0x32da04];return _0x468bac;};'use strict';var _=require('lodash');var util=require(_0x2f8b('0x0'));var moment=require('moment');var BPromise=require(_0x2f8b('0x1'));var rs=require(_0x2f8b('0x2'));var fs=require('fs');var Redis=require(_0x2f8b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f8b('0x4'));var logger=require(_0x2f8b('0x5'))(_0x2f8b('0x6'));var config=require('../../config/environment');var jayson=require(_0x2f8b('0x7'));var client=jayson[_0x2f8b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d8170,_0x21e6b0,_0x2b2247){return new BPromise(function(_0x2c7065,_0x5e651c){return client[_0x2f8b('0x9')](_0x5d8170,_0x2b2247)[_0x2f8b('0xa')](function(_0x2a93b1){logger['info'](_0x2f8b('0xb'),_0x21e6b0,'request\x20sent');logger[_0x2f8b('0xc')](_0x2f8b('0xd'),_0x21e6b0,_0x2f8b('0xe'),JSON['stringify'](_0x2a93b1));if(_0x2a93b1[_0x2f8b('0xf')]){if(_0x2a93b1[_0x2f8b('0xf')][_0x2f8b('0x10')]===0x1f4){logger[_0x2f8b('0xf')](_0x2f8b('0xb'),_0x21e6b0,_0x2a93b1[_0x2f8b('0xf')][_0x2f8b('0x11')]);return _0x5e651c(_0x2a93b1[_0x2f8b('0xf')][_0x2f8b('0x11')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x21e6b0,_0x2a93b1[_0x2f8b('0xf')][_0x2f8b('0x11')]);return _0x2c7065(_0x2a93b1[_0x2f8b('0xf')][_0x2f8b('0x11')]);}else{logger[_0x2f8b('0x12')](_0x2f8b('0xb'),_0x21e6b0,'request\x20sent');_0x2c7065(_0x2a93b1[_0x2f8b('0x13')]['message']);}})['catch'](function(_0x52b2d4){logger[_0x2f8b('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x21e6b0,_0x52b2d4);_0x5e651c(_0x52b2d4);});});}