ALGO node progress

This commit is contained in:
Matias committed 2019-06-04 20:02:20 -03:00
1 parent 3112ca2bac
commit 4eda4270a4
6 files changed
+52 -54

No files matched your search

+9 -7
View File
@@ -1,11 +1,13 @@
NODE_ENV=production
PORT=4101
# Server commands
REINITIALIZE_COMMAND=REINITIALIZE_COMMAND
NEW_TEAM_SHARED_SECRET=NEW_TEAM_SHARED_SECRET
DELETE_TEAM_SHARED_SECRET=DELETE_TEAM_SHARED_SECRET
PATH_TO_CANVAS_APP=../CanvasApp
PATH_TO_FILES_COMPONENT=../Files-Component/src
#Log options
CONSOLE_LOG=false
CONSOLE_ERROR_LOG=true
LOG_FILE_CONTENT=false
GATEWAY_ENDPOINT=http://localhost:4100/graphql
# Server commands
PATH_TO_CANVAS_APP=./dependency/CanvasApp
PATH_TO_FILES_COMPONENT=./dependency/Files-Component/src
GATEWAY_ENDPOINT=http://master-app-api:4100/graphql
+1 -1
View File
@@ -1,7 +1,7 @@
FROM mhart/alpine-node:12
# Directory where the service will be installed
ARG API_DIR=/usr/src/saweb
ARG API_DIR=/usr/src/aaweb
# Prepare required directories
RUN mkdir -p ${API_DIR}
+17 -13
View File
@@ -12,7 +12,7 @@ exports.newFileCloud = function newFileCloud() {
function getBlobToText(container, filePath, host, callBackFunction) {
try {
if (INFO_LOG === true) { console.log('[INFO] getBlobToText -> Entering function.'+filePath) }
if (INFO_LOG === true) { console.log('[INFO] getBlobToText -> Entering function.' + filePath) }
let headers
@@ -21,33 +21,37 @@ exports.newFileCloud = function newFileCloud() {
method: 'post',
data: {
query: `
query web_FileContent($container: String!, $filePath: String!, $accessKey: String!, $storage: String!){
web_FileContent(file: { container: $container, filePath: $filePath, accessKey: $accessKey, storage: $storage })
query web_PlotterCode($file: web_FileInput){
web_PlotterCode(file: $file)
}
`,
variables: {
container: container,
filePath: filePath,
storage: '',
accessKey: ''
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] AppPreLoader -> getBlobToText -> response.text = ' + JSON.stringify(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_FileContent
callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE, 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] AppPreLoader -> getBlobToText -> Invalid JSON received. ') }
if (ERROR_LOG === true) { console.log(MODULE_NAME + ' : ' + '[ERROR] AppPreLoader -> getBlobToText -> response.text = ' + error.message) }
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] getBlobToText -> err = ' + err.stack) }
if (ERROR_LOG === true) { console.log('[ERROR] FileCloud -> getBlobToText -> err = ' + err.message, err.stack) }
}
}
}
+22 -22
View File
@@ -45,12 +45,12 @@
"integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw=="
},
"axios": {
"version": "0.18.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz",
"integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=",
"version": "0.19.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.0.tgz",
"integrity": "sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==",
"requires": {
"follow-redirects": "^1.3.0",
"is-buffer": "^1.1.5"
"follow-redirects": "1.5.10",
"is-buffer": "^2.0.2"
}
},
"balanced-match": {
@@ -195,9 +195,9 @@
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA=="
},
"dotenv": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-6.2.0.tgz",
"integrity": "sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w=="
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.0.0.tgz",
"integrity": "sha512-30xVGqjLjiUOArT4+M5q9sYdvuR4riM6yK9wMcas9Vbp6zZa+ocC9dp6QoftuhTPhFAiLK/0C5Ni2nou/Bk8lg=="
},
"emoji-regex": {
"version": "7.0.3",
@@ -283,25 +283,25 @@
}
},
"follow-redirects": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.7.0.tgz",
"integrity": "sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ==",
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
"integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
"requires": {
"debug": "^3.2.6"
"debug": "=3.1.0"
},
"dependencies": {
"debug": {
"version": "3.2.6",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "^2.1.1"
"ms": "2.0.0"
}
},
"ms": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
@@ -394,9 +394,9 @@
"integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA=="
},
"is-buffer": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz",
"integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw=="
},
"is-callable": {
"version": "1.1.4",
+2 -2
View File
@@ -11,7 +11,7 @@
},
"dependencies": {
"@superalgos/mqservice": "0.0.12",
"dotenv": "^6.2.0",
"axios": "0.18.0"
"dotenv": "8.0.0",
"axios": "0.19.0"
}
}
+1 -9
View File
@@ -79,13 +79,6 @@ function onBrowserRequest (request, response) {
switch (requestParameters[1]) {
case process.env.REINITIALIZE_COMMAND: {
initialize()
respondWithContent('Node JS Server Reinitilized.', response)
}
break
case 'MQService':
{
let filePath = './node_modules/@superalgos/mqservice/orderLifeCicle/webDependency.js'
@@ -396,8 +389,7 @@ function respondWithSourceCode (requestParameters, response) {
function onDataArrived (err, pData) {
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
console.log('[ERROR] server -> onBrowserRequest -> respondWithSourceCode -> Could not read a file. ')
console.log('[ERROR] server -> onBrowserRequest -> respondWithSourceCode -> err.message = ' + err.message)
console.log('[ERROR] server -> onBrowserRequest -> respondWithSourceCode -> Could not read a file -> err.message = ' + err.message, err.stack)
pData = ''
}
storageData.set(filePath, pData)