c0aa5a350b04774ffc825356ae97bec825302027
[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 _0x4f2a=['code','message','VtigerConfiguration,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x4f2a,0x192));var _0xa4f2=function(_0x187d80,_0x5b793f){_0x187d80=_0x187d80-0x0;var _0x498a77=_0x4f2a[_0x187d80];return _0x498a77;};'use strict';var _=require(_0xa4f2('0x0'));var util=require(_0xa4f2('0x1'));var moment=require(_0xa4f2('0x2'));var BPromise=require(_0xa4f2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4f2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa4f2('0x5'));var logger=require(_0xa4f2('0x6'))(_0xa4f2('0x7'));var config=require(_0xa4f2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa4f2('0x9')][_0xa4f2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ef66a,_0x26453f,_0x102ae3){return new BPromise(function(_0x17ab5f,_0x33195d){return client[_0xa4f2('0xb')](_0x2ef66a,_0x102ae3)[_0xa4f2('0xc')](function(_0x1688cf){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x26453f,_0xa4f2('0xd'));logger['debug'](_0xa4f2('0xe'),_0x26453f,_0xa4f2('0xd'),JSON['stringify'](_0x1688cf));if(_0x1688cf[_0xa4f2('0xf')]){if(_0x1688cf[_0xa4f2('0xf')][_0xa4f2('0x10')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x26453f,_0x1688cf['error'][_0xa4f2('0x11')]);return _0x33195d(_0x1688cf['error'][_0xa4f2('0x11')]);}logger[_0xa4f2('0xf')](_0xa4f2('0x12'),_0x26453f,_0x1688cf[_0xa4f2('0xf')]['message']);return _0x17ab5f(_0x1688cf[_0xa4f2('0xf')]['message']);}else{logger[_0xa4f2('0x13')](_0xa4f2('0x12'),_0x26453f,_0xa4f2('0xd'));_0x17ab5f(_0x1688cf[_0xa4f2('0x14')][_0xa4f2('0x11')]);}})[_0xa4f2('0x15')](function(_0x298ee5){logger[_0xa4f2('0xf')](_0xa4f2('0x12'),_0x26453f,_0x298ee5);_0x33195d(_0x298ee5);});});}