Built motion from commit 37e1ed56.|2.6.29
[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 _0xb971=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','util','moment','bluebird','../../mysqldb'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0xb971,0x14c));var _0x1b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb971[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1b97('0x0'));var moment=require(_0x1b97('0x1'));var BPromise=require(_0x1b97('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b97('0x3'))['db'];var utils=require(_0x1b97('0x4'));var logger=require(_0x1b97('0x5'))(_0x1b97('0x6'));var config=require(_0x1b97('0x7'));var jayson=require(_0x1b97('0x8'));var client=jayson[_0x1b97('0x9')][_0x1b97('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ebb23,_0x58e1c2,_0x5a2fbc){return new BPromise(function(_0x3c71da,_0x4056d8){return client[_0x1b97('0xb')](_0x2ebb23,_0x5a2fbc)[_0x1b97('0xc')](function(_0x381193){logger[_0x1b97('0xd')](_0x1b97('0xe'),_0x58e1c2,'request\x20sent');logger[_0x1b97('0xf')](_0x1b97('0x10'),_0x58e1c2,_0x1b97('0x11'),JSON['stringify'](_0x381193));if(_0x381193[_0x1b97('0x12')]){if(_0x381193[_0x1b97('0x12')][_0x1b97('0x13')]===0x1f4){logger[_0x1b97('0x12')](_0x1b97('0xe'),_0x58e1c2,_0x381193['error']['message']);return _0x4056d8(_0x381193[_0x1b97('0x12')][_0x1b97('0x14')]);}logger[_0x1b97('0x12')](_0x1b97('0xe'),_0x58e1c2,_0x381193[_0x1b97('0x12')][_0x1b97('0x14')]);return _0x3c71da(_0x381193[_0x1b97('0x12')][_0x1b97('0x14')]);}else{logger[_0x1b97('0xd')](_0x1b97('0xe'),_0x58e1c2,_0x1b97('0x11'));_0x3c71da(_0x381193['result']['message']);}})['catch'](function(_0xdd748c){logger[_0x1b97('0x12')](_0x1b97('0xe'),_0x58e1c2,_0xdd748c);_0x4056d8(_0xdd748c);});});}