3925433c452407afae6cd8408fc4a135fd4f72cd
[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 _0x0a39=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','bluebird'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0x0a39,0xda));var _0x90a3=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0a39[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x90a3('0x0'));var BPromise=require(_0x90a3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90a3('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x90a3('0x3'))(_0x90a3('0x4'));var config=require(_0x90a3('0x5'));var jayson=require(_0x90a3('0x6'));var client=jayson['client'][_0x90a3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1de74d,_0x2dbc9d,_0x5e916c){return new BPromise(function(_0x33b86c,_0x42f622){return client[_0x90a3('0x8')](_0x1de74d,_0x5e916c)['then'](function(_0x2069ec){logger[_0x90a3('0x9')](_0x90a3('0xa'),_0x2dbc9d,'request\x20sent');logger[_0x90a3('0xb')](_0x90a3('0xc'),_0x2dbc9d,_0x90a3('0xd'),JSON[_0x90a3('0xe')](_0x2069ec));if(_0x2069ec[_0x90a3('0xf')]){if(_0x2069ec[_0x90a3('0xf')][_0x90a3('0x10')]===0x1f4){logger[_0x90a3('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x2dbc9d,_0x2069ec['error'][_0x90a3('0x11')]);return _0x42f622(_0x2069ec[_0x90a3('0xf')][_0x90a3('0x11')]);}logger[_0x90a3('0xf')](_0x90a3('0xa'),_0x2dbc9d,_0x2069ec['error']['message']);return _0x33b86c(_0x2069ec[_0x90a3('0xf')]['message']);}else{logger[_0x90a3('0x9')]('VtigerConfiguration,\x20%s,\x20%s',_0x2dbc9d,_0x90a3('0xd'));_0x33b86c(_0x2069ec[_0x90a3('0x12')]['message']);}})[_0x90a3('0x13')](function(_0x49d475){logger[_0x90a3('0xf')](_0x90a3('0xa'),_0x2dbc9d,_0x49d475);_0x42f622(_0x49d475);});});}