From 1fbef45bf5e4a5ee616b27eb6784ef5c37a89c43 Mon Sep 17 00:00:00 2001 From: Matias Date: Sat, 27 Jul 2019 07:28:08 -0300 Subject: [PATCH] removing plotter retrieval from server --- Plotters-Trading-Simulation | 1 - Server/FileCloud.js | 57 ------------------------------------- 2 files changed, 58 deletions(-) delete mode 160000 Plotters-Trading-Simulation delete mode 100644 Server/FileCloud.js diff --git a/Plotters-Trading-Simulation b/Plotters-Trading-Simulation deleted file mode 160000 index 54f9c8d64..000000000 --- a/Plotters-Trading-Simulation +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 54f9c8d6474b2adbacf0dbf8340ed2b40d3ab442 diff --git a/Server/FileCloud.js b/Server/FileCloud.js deleted file mode 100644 index 4cbb6e709..000000000 --- a/Server/FileCloud.js +++ /dev/null @@ -1,57 +0,0 @@ -exports.newFileCloud = function newFileCloud() { - const MODULE_NAME = 'File Cloud' - const INFO_LOG = false - const ERROR_LOG = true - const axios = require('axios') - - let thisObject = { - getBlobToText: getBlobToText - } - - return thisObject - - function getBlobToText(container, filePath, host, callBackFunction) { - try { - if (INFO_LOG === true) { console.log('[INFO] getBlobToText -> Entering function.' + filePath) } - - let headers - - axios({ - url: process.env.GATEWAY_ENDPOINT, - method: 'post', - data: { - query: ` - query web_PlotterCode($file: web_FileInput){ - web_PlotterCode(file: $file) - } - `, - variables: { - file: { - container: container.toLowerCase(), - filePath: filePath, - storage: '', - accessKey: '' - } - } - }, - headers: headers - }).then(res => { - if (res.data.errors) { - if (ERROR_LOG === true) { console.log(MODULE_NAME + ' : ' + '[ERROR] FileCloud -> getBlobToText -> response.text = ' + JSON.stringify(res.data.errors)) } - callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE, '', '') - } - let response = res.data.data.web_PlotterCode - if (response) - callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE, response, '') - else - callBackFunction(GLOBAL.CUSTOM_FAIL_RESPONSE) - }).catch(error => { - if (ERROR_LOG === true) { console.log(MODULE_NAME + ' : ' + '[ERROR] FileCloud -> getBlobToText -> Invalid JSON received: ' + error.message, error.stack) } - callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE, '', '') - }) - - } catch (err) { - if (ERROR_LOG === true) { console.log('[ERROR] FileCloud -> getBlobToText -> err = ' + err.message, err.stack) } - } - } -}