Built motion from commit c116dc8b.|2.6.30
[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 _0x08e3=['http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','../../config/utils','../../config/environment','client'];(function(_0x143368,_0x5d0b64){var _0x44c10a=function(_0x30c90c){while(--_0x30c90c){_0x143368['push'](_0x143368['shift']());}};_0x44c10a(++_0x5d0b64);}(_0x08e3,0x1aa));var _0x308e=function(_0x471715,_0x1b233c){_0x471715=_0x471715-0x0;var _0x1baf4f=_0x08e3[_0x471715];return _0x1baf4f;};'use strict';var _=require('lodash');var util=require(_0x308e('0x0'));var moment=require(_0x308e('0x1'));var BPromise=require(_0x308e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x308e('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x308e('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x308e('0x5')][_0x308e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x11939c,_0x32bcef,_0x4b5788){return new BPromise(function(_0xc4d355,_0x3c6d6f){return client[_0x308e('0x7')](_0x11939c,_0x4b5788)['then'](function(_0x2b7d13){logger[_0x308e('0x8')](_0x308e('0x9'),_0x32bcef,_0x308e('0xa'));logger[_0x308e('0xb')](_0x308e('0xc'),_0x32bcef,_0x308e('0xa'),JSON[_0x308e('0xd')](_0x2b7d13));if(_0x2b7d13[_0x308e('0xe')]){if(_0x2b7d13['error']['code']===0x1f4){logger[_0x308e('0xe')](_0x308e('0x9'),_0x32bcef,_0x2b7d13[_0x308e('0xe')][_0x308e('0xf')]);return _0x3c6d6f(_0x2b7d13['error'][_0x308e('0xf')]);}logger[_0x308e('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x32bcef,_0x2b7d13[_0x308e('0xe')][_0x308e('0xf')]);return _0xc4d355(_0x2b7d13[_0x308e('0xe')]['message']);}else{logger[_0x308e('0x8')](_0x308e('0x9'),_0x32bcef,_0x308e('0xa'));_0xc4d355(_0x2b7d13[_0x308e('0x10')][_0x308e('0xf')]);}})[_0x308e('0x11')](function(_0x231286){logger[_0x308e('0xe')](_0x308e('0x9'),_0x32bcef,_0x231286);_0x3c6d6f(_0x231286);});});}