dde2587eb15693f0d3a56ea7ae9bc694fe93731d
[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 _0x23a3=['VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3433bb,_0x30522c){var _0x540cb2=function(_0x4f7d4a){while(--_0x4f7d4a){_0x3433bb['push'](_0x3433bb['shift']());}};_0x540cb2(++_0x30522c);}(_0x23a3,0x66));var _0x323a=function(_0x18a1f6,_0x5356c4){_0x18a1f6=_0x18a1f6-0x0;var _0x493551=_0x23a3[_0x18a1f6];return _0x493551;};'use strict';var _=require('lodash');var util=require(_0x323a('0x0'));var moment=require('moment');var BPromise=require(_0x323a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x323a('0x2'))['db'];var utils=require(_0x323a('0x3'));var logger=require(_0x323a('0x4'))(_0x323a('0x5'));var config=require('../../config/environment');var jayson=require(_0x323a('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x350a44,_0x4cbfbf,_0x14b4c4){return new BPromise(function(_0x4507cc,_0x5209d3){return client[_0x323a('0x7')](_0x350a44,_0x14b4c4)['then'](function(_0x2c3d8f){logger[_0x323a('0x8')](_0x323a('0x9'),_0x4cbfbf,_0x323a('0xa'));logger[_0x323a('0xb')](_0x323a('0xc'),_0x4cbfbf,_0x323a('0xa'),JSON[_0x323a('0xd')](_0x2c3d8f));if(_0x2c3d8f[_0x323a('0xe')]){if(_0x2c3d8f[_0x323a('0xe')][_0x323a('0xf')]===0x1f4){logger[_0x323a('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x4cbfbf,_0x2c3d8f[_0x323a('0xe')][_0x323a('0x10')]);return _0x5209d3(_0x2c3d8f[_0x323a('0xe')]['message']);}logger['error'](_0x323a('0x9'),_0x4cbfbf,_0x2c3d8f[_0x323a('0xe')]['message']);return _0x4507cc(_0x2c3d8f[_0x323a('0xe')][_0x323a('0x10')]);}else{logger[_0x323a('0x8')]('VtigerConfiguration,\x20%s,\x20%s',_0x4cbfbf,_0x323a('0xa'));_0x4507cc(_0x2c3d8f[_0x323a('0x11')][_0x323a('0x10')]);}})[_0x323a('0x12')](function(_0x5aef79){logger[_0x323a('0xe')](_0x323a('0x9'),_0x4cbfbf,_0x5aef79);_0x5209d3(_0x5aef79);});});}