6d0eacc19c5b070d1795754680078e27be9fddf1
[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 _0xfc44=['lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x4dc5bb,_0x1cc81d){var _0x76463c=function(_0x5b4fa8){while(--_0x5b4fa8){_0x4dc5bb['push'](_0x4dc5bb['shift']());}};_0x76463c(++_0x1cc81d);}(_0xfc44,0xb4));var _0x4fc4=function(_0x553be2,_0x51befc){_0x553be2=_0x553be2-0x0;var _0x8abdaf=_0xfc44[_0x553be2];return _0x8abdaf;};'use strict';var _=require(_0x4fc4('0x0'));var util=require('util');var moment=require(_0x4fc4('0x1'));var BPromise=require('bluebird');var rs=require(_0x4fc4('0x2'));var fs=require('fs');var Redis=require(_0x4fc4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4fc4('0x4'));var logger=require(_0x4fc4('0x5'))('rpc');var config=require(_0x4fc4('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27a605,_0x3860e9,_0xc93f3d){return new BPromise(function(_0x55a8e0,_0xfcaf48){return client[_0x4fc4('0x7')](_0x27a605,_0xc93f3d)[_0x4fc4('0x8')](function(_0x153403){logger['info'](_0x4fc4('0x9'),_0x3860e9,_0x4fc4('0xa'));logger[_0x4fc4('0xb')](_0x4fc4('0xc'),_0x3860e9,_0x4fc4('0xa'),JSON[_0x4fc4('0xd')](_0x153403));if(_0x153403[_0x4fc4('0xe')]){if(_0x153403[_0x4fc4('0xe')]['code']===0x1f4){logger[_0x4fc4('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x3860e9,_0x153403[_0x4fc4('0xe')][_0x4fc4('0xf')]);return _0xfcaf48(_0x153403[_0x4fc4('0xe')][_0x4fc4('0xf')]);}logger[_0x4fc4('0xe')](_0x4fc4('0x9'),_0x3860e9,_0x153403[_0x4fc4('0xe')][_0x4fc4('0xf')]);return _0x55a8e0(_0x153403['error'][_0x4fc4('0xf')]);}else{logger[_0x4fc4('0x10')](_0x4fc4('0x9'),_0x3860e9,_0x4fc4('0xa'));_0x55a8e0(_0x153403[_0x4fc4('0x11')]['message']);}})['catch'](function(_0x5e8bef){logger[_0x4fc4('0xe')](_0x4fc4('0x9'),_0x3860e9,_0x5e8bef);_0xfcaf48(_0x5e8bef);});});}