Skip to content
Snippets Groups Projects
Commit 4a4bd3d1 authored by michael.minelli's avatar michael.minelli
Browse files

Add base project

parent ddb6c0dc
No related branches found
No related tags found
No related merge requests found
Showing
with 2309 additions and 2 deletions
...@@ -243,7 +243,7 @@ dist ...@@ -243,7 +243,7 @@ dist
########################### Gitlab Runner ########################### Gitlab Runner
builds/ builds/
localartifacts/ cache/
########################### JetBrains ########################### JetBrains
...@@ -345,4 +345,4 @@ Sessionx.vim ...@@ -345,4 +345,4 @@ Sessionx.vim
# Auto-generated tag files # Auto-generated tag files
tags tags
# Persistent undo # Persistent undo
[._]*.un~ [._]*.un~
\ No newline at end of file
[submodule "ExerciceChecker/.idea/jetbrainsConfiguration"]
path = ExerciceChecker/.idea/jetbrainsConfiguration
url = ../../shared/jetbrains_configuration.git
[submodule "ExerciceChecker/src/shared"]
path = ExerciceChecker/src/shared
url = ../../shared/nodesharedcode.git
[submodule "ExerciceChecker/src/sharedByClients"]
path = ExerciceChecker/src/sharedByClients
url = ../../shared/nodeclientsharedcode.git
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
jetbrainsConfiguration/codeStyles/
\ No newline at end of file
jetbrainsConfiguration/inspectionProfiles/
\ No newline at end of file
Subproject commit fec06e6aeeff2083bfe82b38182f6a02c73d023f
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/ExerciceChecker.iml" filepath="$PROJECT_DIR$/.idea/ExerciceChecker.iml" />
</modules>
</component>
</project>
\ No newline at end of file
jetbrainsConfiguration/rootFiles/sqldialects.xml
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
This diff is collapsed.
{
"name" : "dojo_exercice_checker",
"version" : "1.0.0",
"main" : "dist/app.js",
"bin" : {
"dirmanager": "./dist/app.js"
},
"pkg" : {
"scripts": [],
"assets" : [
"node_modules/axios/dist/node/axios.cjs",
".env"
],
"targets": [
"node18-linux-arm64",
"node18-linux-x64"
]
},
"scripts" : {
"build" : "npx tsc",
"start:dev": "npx ts-node src/app.ts",
"test" : "echo \"Error: no test specified\" && exit 1"
},
"dependencies" : {
"axios" : "^1.4.0",
"chalk" : "^4.1.2",
"dotenv" : "^16.3.1",
"http-status-codes": "^2.2.0",
"ora" : "^5.4.1",
"winston" : "^3.10.0"
},
"devDependencies": {
"@types/node" : "^18.17.1",
"pkg" : "^5.8.1",
"ts-node" : "^10.9.1",
"typescript" : "^5.1.6"
}
}
// Read from the .env file
// ATTENTION : This lines MUST be the first of this file (except for the path import)
const path = require('node:path');
require('dotenv').config({ path: path.join(__dirname, '../.env') });
require('./shared/helpers/TypeScriptExtensions'); // ATTENTION : This line MUST be the second of this file
import HttpManager from './managers/HttpManager';
HttpManager.registerAxiosInterceptor();
// Step 1: Read the dojo enonce file from the enonce repository
// Step 2: Download immutables files (maybe throw or show an error if the files have been modified ?) - Can be merged with step 1
// Step 3: Run docker-compose file
// Step 4: Wait the end of the execution of the result container
// Step 5: Get the result from the volume
// Step 6: Check content requirements and content size
// Step 7: Upload and show the results
\ No newline at end of file
import ClientsSharedConfig from '../sharedByClients/config/ClientsSharedConfig';
import ApiRoutes from '../sharedByClients/types/ApiRoutes';
class DojoBackendManager {
public getApiUrl(route: ApiRoutes): string {
return `${ ClientsSharedConfig.apiURL }${ route }`;
}
}
export default new DojoBackendManager();
import axios, { AxiosRequestHeaders } from 'axios';
import FormData from 'form-data';
import ClientsSharedConfig from '../sharedByClients/config/ClientsSharedConfig';
class HttpManager {
public handleCommandErrors: boolean = true;
registerAxiosInterceptor() {
this.registerRequestInterceptor();
this.registerResponseInterceptor();
}
private registerRequestInterceptor() {
axios.interceptors.request.use((config) => {
if ( config.data instanceof FormData ) {
config.headers = { ...config.headers, ...(config.data as FormData).getHeaders() } as AxiosRequestHeaders;
}
if ( config.url && (config.url.indexOf(ClientsSharedConfig.apiURL) !== -1) ) {
if ( config.data && Object.keys(config.data).length > 0 ) {
config.headers['Content-Type'] = 'multipart/form-data';
}
}
return config;
});
}
private registerResponseInterceptor() {
axios.interceptors.response.use((response) => {
return response;
}, (error) => {
return Promise.reject(error);
});
}
}
export default new HttpManager();
Subproject commit c9154d42dac81311cf1957f0d75f806737849b40
Subproject commit 8fe8e9417a527cf2182a9acc440e68b99024487e
{
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"strict": true,
"target": "es6",
"module": "commonjs",
"sourceMap": true,
"esModuleInterop": true,
"moduleResolution": "node",
"noImplicitAny": true
},
"exclude": [
"node_modules"
]
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment