Built motion from commit c738b9ac.|2.6.25
[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 _0xc6a1=['http','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0xc6a1,0x1c0));var _0x1c6a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xc6a1[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1c6a('0x0'));var fs=require('fs');var Redis=require(_0x1c6a('0x1'));var db=require(_0x1c6a('0x2'))['db'];var utils=require(_0x1c6a('0x3'));var logger=require(_0x1c6a('0x4'))('rpc');var config=require(_0x1c6a('0x5'));var jayson=require(_0x1c6a('0x6'));var client=jayson[_0x1c6a('0x7')][_0x1c6a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47a764,_0xbb5391,_0x43e9ef){return new BPromise(function(_0x4f7375,_0x4f8f4e){return client['request'](_0x47a764,_0x43e9ef)[_0x1c6a('0x9')](function(_0x75d6f4){logger['info'](_0x1c6a('0xa'),_0xbb5391,_0x1c6a('0xb'));logger[_0x1c6a('0xc')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0xbb5391,_0x1c6a('0xb'),JSON[_0x1c6a('0xd')](_0x75d6f4));if(_0x75d6f4[_0x1c6a('0xe')]){if(_0x75d6f4[_0x1c6a('0xe')]['code']===0x1f4){logger[_0x1c6a('0xe')](_0x1c6a('0xa'),_0xbb5391,_0x75d6f4['error'][_0x1c6a('0xf')]);return _0x4f8f4e(_0x75d6f4[_0x1c6a('0xe')][_0x1c6a('0xf')]);}logger[_0x1c6a('0xe')](_0x1c6a('0xa'),_0xbb5391,_0x75d6f4[_0x1c6a('0xe')][_0x1c6a('0xf')]);return _0x4f7375(_0x75d6f4[_0x1c6a('0xe')]['message']);}else{logger[_0x1c6a('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0xbb5391,'request\x20sent');_0x4f7375(_0x75d6f4[_0x1c6a('0x11')][_0x1c6a('0xf')]);}})[_0x1c6a('0x12')](function(_0x28143d){logger['error'](_0x1c6a('0xa'),_0xbb5391,_0x28143d);_0x4f8f4e(_0x28143d);});});}