Built motion from commit da24aabd.|2.6.20
[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 _0x88fb=['error','code','message','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x1d40d5,_0x1ee7a0){var _0x28bdcb=function(_0x355f48){while(--_0x355f48){_0x1d40d5['push'](_0x1d40d5['shift']());}};_0x28bdcb(++_0x1ee7a0);}(_0x88fb,0x1e4));var _0xb88f=function(_0x3f8f44,_0x4bedc7){_0x3f8f44=_0x3f8f44-0x0;var _0x3bea7c=_0x88fb[_0x3f8f44];return _0x3bea7c;};'use strict';var _=require(_0xb88f('0x0'));var util=require(_0xb88f('0x1'));var moment=require('moment');var BPromise=require(_0xb88f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb88f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb88f('0x4'));var logger=require(_0xb88f('0x5'))('rpc');var config=require(_0xb88f('0x6'));var jayson=require(_0xb88f('0x7'));var client=jayson['client'][_0xb88f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b2e15,_0x1a1176,_0x57023e){return new BPromise(function(_0x279815,_0x51545b){return client[_0xb88f('0x9')](_0x4b2e15,_0x57023e)[_0xb88f('0xa')](function(_0x5dadd1){logger[_0xb88f('0xb')](_0xb88f('0xc'),_0x1a1176,_0xb88f('0xd'));logger[_0xb88f('0xe')](_0xb88f('0xf'),_0x1a1176,'request\x20sent',JSON['stringify'](_0x5dadd1));if(_0x5dadd1[_0xb88f('0x10')]){if(_0x5dadd1[_0xb88f('0x10')][_0xb88f('0x11')]===0x1f4){logger['error'](_0xb88f('0xc'),_0x1a1176,_0x5dadd1[_0xb88f('0x10')][_0xb88f('0x12')]);return _0x51545b(_0x5dadd1[_0xb88f('0x10')][_0xb88f('0x12')]);}logger['error'](_0xb88f('0xc'),_0x1a1176,_0x5dadd1['error'][_0xb88f('0x12')]);return _0x279815(_0x5dadd1[_0xb88f('0x10')][_0xb88f('0x12')]);}else{logger[_0xb88f('0xb')](_0xb88f('0xc'),_0x1a1176,_0xb88f('0xd'));_0x279815(_0x5dadd1['result']['message']);}})[_0xb88f('0x13')](function(_0xc73112){logger[_0xb88f('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x1a1176,_0xc73112);_0x51545b(_0xc73112);});});}