Built motion from commit (unavailable).|2.5.7
[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 _0x6f9b=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6f9b,0x197));var _0xb6f9=function(_0x59aaf9,_0x5a7c39){_0x59aaf9=_0x59aaf9-0x0;var _0x4b8754=_0x6f9b[_0x59aaf9];return _0x4b8754;};'use strict';var _=require(_0xb6f9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb6f9('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb6f9('0x2'))['db'];var utils=require(_0xb6f9('0x3'));var logger=require(_0xb6f9('0x4'))(_0xb6f9('0x5'));var config=require('../../config/environment');var jayson=require(_0xb6f9('0x6'));var client=jayson[_0xb6f9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf586e0,_0x79c40e,_0x1d6ee5){return new BPromise(function(_0x460fc9,_0x1c8555){return client[_0xb6f9('0x8')](_0xf586e0,_0x1d6ee5)['then'](function(_0x268cd8){logger[_0xb6f9('0x9')](_0xb6f9('0xa'),_0x79c40e,_0xb6f9('0xb'));logger[_0xb6f9('0xc')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x79c40e,_0xb6f9('0xb'),JSON[_0xb6f9('0xd')](_0x268cd8));if(_0x268cd8['error']){if(_0x268cd8[_0xb6f9('0xe')][_0xb6f9('0xf')]===0x1f4){logger[_0xb6f9('0xe')](_0xb6f9('0xa'),_0x79c40e,_0x268cd8[_0xb6f9('0xe')][_0xb6f9('0x10')]);return _0x1c8555(_0x268cd8[_0xb6f9('0xe')][_0xb6f9('0x10')]);}logger[_0xb6f9('0xe')](_0xb6f9('0xa'),_0x79c40e,_0x268cd8['error'][_0xb6f9('0x10')]);return _0x460fc9(_0x268cd8[_0xb6f9('0xe')][_0xb6f9('0x10')]);}else{logger[_0xb6f9('0x9')](_0xb6f9('0xa'),_0x79c40e,_0xb6f9('0xb'));_0x460fc9(_0x268cd8['result']['message']);}})['catch'](function(_0x402516){logger[_0xb6f9('0xe')](_0xb6f9('0xa'),_0x79c40e,_0x402516);_0x1c8555(_0x402516);});});}