Built motion from commit (unavailable).|2.4.18
[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 _0xc3e4=['../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xc3e4,0x19d));var _0x4c3e=function(_0x5f11ed,_0xa3a329){_0x5f11ed=_0x5f11ed-0x0;var _0x15d226=_0xc3e4[_0x5f11ed];return _0x15d226;};'use strict';var _=require(_0x4c3e('0x0'));var util=require('util');var moment=require(_0x4c3e('0x1'));var BPromise=require(_0x4c3e('0x2'));var rs=require(_0x4c3e('0x3'));var fs=require('fs');var Redis=require(_0x4c3e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4c3e('0x5'));var jayson=require(_0x4c3e('0x6'));var client=jayson['client'][_0x4c3e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2daf7b,_0x1cc141,_0x46424a){return new BPromise(function(_0x4b8119,_0x229e30){return client[_0x4c3e('0x8')](_0x2daf7b,_0x46424a)[_0x4c3e('0x9')](function(_0x3edd3c){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x1cc141,_0x4c3e('0xa'));logger[_0x4c3e('0xb')](_0x4c3e('0xc'),_0x1cc141,_0x4c3e('0xa'),JSON[_0x4c3e('0xd')](_0x3edd3c));if(_0x3edd3c[_0x4c3e('0xe')]){if(_0x3edd3c[_0x4c3e('0xe')]['code']===0x1f4){logger[_0x4c3e('0xe')](_0x4c3e('0xf'),_0x1cc141,_0x3edd3c['error']['message']);return _0x229e30(_0x3edd3c[_0x4c3e('0xe')]['message']);}logger[_0x4c3e('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x1cc141,_0x3edd3c['error'][_0x4c3e('0x10')]);return _0x4b8119(_0x3edd3c[_0x4c3e('0xe')][_0x4c3e('0x10')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x1cc141,'request\x20sent');_0x4b8119(_0x3edd3c[_0x4c3e('0x11')][_0x4c3e('0x10')]);}})[_0x4c3e('0x12')](function(_0x13c131){logger[_0x4c3e('0xe')](_0x4c3e('0xf'),_0x1cc141,_0x13c131);_0x229e30(_0x13c131);});});}