Built motion from commit 9d1906d1.|2.5.40
[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 _0x1f39=['request\x20sent','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s'];(function(_0xdc5d93,_0x594c9c){var _0x8455e7=function(_0x2e7078){while(--_0x2e7078){_0xdc5d93['push'](_0xdc5d93['shift']());}};_0x8455e7(++_0x594c9c);}(_0x1f39,0x180));var _0x91f3=function(_0x560fb6,_0x5388ce){_0x560fb6=_0x560fb6-0x0;var _0x48b8f2=_0x1f39[_0x560fb6];return _0x48b8f2;};'use strict';var _=require(_0x91f3('0x0'));var util=require(_0x91f3('0x1'));var moment=require(_0x91f3('0x2'));var BPromise=require(_0x91f3('0x3'));var rs=require(_0x91f3('0x4'));var fs=require('fs');var Redis=require(_0x91f3('0x5'));var db=require(_0x91f3('0x6'))['db'];var utils=require(_0x91f3('0x7'));var logger=require(_0x91f3('0x8'))(_0x91f3('0x9'));var config=require(_0x91f3('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x91f3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44fd83,_0x30c2ff,_0x5ef816){return new BPromise(function(_0x5253ec,_0x39ad44){return client[_0x91f3('0xc')](_0x44fd83,_0x5ef816)[_0x91f3('0xd')](function(_0x1bc34a){logger[_0x91f3('0xe')](_0x91f3('0xf'),_0x30c2ff,_0x91f3('0x10'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x30c2ff,_0x91f3('0x10'),JSON['stringify'](_0x1bc34a));if(_0x1bc34a[_0x91f3('0x11')]){if(_0x1bc34a[_0x91f3('0x11')]['code']===0x1f4){logger[_0x91f3('0x11')](_0x91f3('0xf'),_0x30c2ff,_0x1bc34a[_0x91f3('0x11')][_0x91f3('0x12')]);return _0x39ad44(_0x1bc34a[_0x91f3('0x11')][_0x91f3('0x12')]);}logger[_0x91f3('0x11')](_0x91f3('0xf'),_0x30c2ff,_0x1bc34a[_0x91f3('0x11')][_0x91f3('0x12')]);return _0x5253ec(_0x1bc34a['error'][_0x91f3('0x12')]);}else{logger[_0x91f3('0xe')](_0x91f3('0xf'),_0x30c2ff,_0x91f3('0x10'));_0x5253ec(_0x1bc34a[_0x91f3('0x13')][_0x91f3('0x12')]);}})['catch'](function(_0x58daad){logger[_0x91f3('0x11')](_0x91f3('0xf'),_0x30c2ff,_0x58daad);_0x39ad44(_0x58daad);});});}