Built motion from commit 00bf23f6.|2.6.16
[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 _0x9a7f=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x290612,_0x264e17){var _0x44aade=function(_0x3358d9){while(--_0x3358d9){_0x290612['push'](_0x290612['shift']());}};_0x44aade(++_0x264e17);}(_0x9a7f,0xea));var _0xf9a7=function(_0x52aec5,_0x49e60d){_0x52aec5=_0x52aec5-0x0;var _0x4c23dd=_0x9a7f[_0x52aec5];return _0x4c23dd;};'use strict';var _=require(_0xf9a7('0x0'));var util=require(_0xf9a7('0x1'));var moment=require(_0xf9a7('0x2'));var BPromise=require(_0xf9a7('0x3'));var rs=require(_0xf9a7('0x4'));var fs=require('fs');var Redis=require(_0xf9a7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf9a7('0x6'))('rpc');var config=require(_0xf9a7('0x7'));var jayson=require(_0xf9a7('0x8'));var client=jayson[_0xf9a7('0x9')][_0xf9a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d5b50,_0x371edb,_0x18d92c){return new BPromise(function(_0x4d9a72,_0x2e6a69){return client[_0xf9a7('0xb')](_0x4d5b50,_0x18d92c)[_0xf9a7('0xc')](function(_0x1851e6){logger[_0xf9a7('0xd')](_0xf9a7('0xe'),_0x371edb,'request\x20sent');logger[_0xf9a7('0xf')](_0xf9a7('0x10'),_0x371edb,_0xf9a7('0x11'),JSON[_0xf9a7('0x12')](_0x1851e6));if(_0x1851e6[_0xf9a7('0x13')]){if(_0x1851e6[_0xf9a7('0x13')][_0xf9a7('0x14')]===0x1f4){logger[_0xf9a7('0x13')](_0xf9a7('0xe'),_0x371edb,_0x1851e6['error']['message']);return _0x2e6a69(_0x1851e6['error'][_0xf9a7('0x15')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x371edb,_0x1851e6[_0xf9a7('0x13')][_0xf9a7('0x15')]);return _0x4d9a72(_0x1851e6[_0xf9a7('0x13')][_0xf9a7('0x15')]);}else{logger['info'](_0xf9a7('0xe'),_0x371edb,_0xf9a7('0x11'));_0x4d9a72(_0x1851e6[_0xf9a7('0x16')]['message']);}})['catch'](function(_0x1eea25){logger[_0xf9a7('0x13')](_0xf9a7('0xe'),_0x371edb,_0x1eea25);_0x2e6a69(_0x1eea25);});});}