Skip to content
Snippets Groups Projects
Commit 7e5d7706 authored by Benguria Elguezabal, Gorka's avatar Benguria Elguezabal, Gorka
Browse files

public release

parents
No related branches found
No related tags found
No related merge requests found
node_modules
stages:
- build_and_push
- redeploy
build_and_push:
image: docker/compose:latest
stage: build_and_push
services:
- docker:dind
script:
- docker build -t wp4-user-journey-service-delivery-mock-api-pim . --tag 094360380/wp4-user-journey-service-delivery-mock-api-pim
- docker login docker.io -u "$DOCKER_REGISTRY_USER" -p "$DOCKER_REGISTRY_PASSWORD"
- docker push 094360380/wp4-user-journey-service-delivery-mock-api-pim
tags:
- docker
only:
- kubernetes
redeploy_at_k8s:
image: alpine/k8s:1.21.5
stage: redeploy
script:
- kubectl config set-cluster local --server="${K8S_SERVER}"
- kubectl config set clusters.local.certificate-authority-data "${K8S_CERTIFICATE_AUTHORITY_DATA}"
- kubectl config set-credentials local --token="${K8S_USER_TOKEN}"
- kubectl config set-context local --cluster=local --user=local
- kubectl config use-context local
- kubectl --insecure-skip-tls-verify version
- kubectl get deployments ujse-mck-api-pim -n ujse-dev --insecure-skip-tls-verify
- kubectl rollout restart deployment ujse-mck-api-pim -n ujse-dev --insecure-skip-tls-verify
tags:
- docker
only:
- kubernetes
# 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"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/mock-api-pim.iml" filepath="$PROJECT_DIR$/.idea/mock-api-pim.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
FROM node:16
WORKDIR /app
COPY package.json .
RUN npm install
COPY . .
#Application related arguments
CMD ["npm", "start"]
# Mock-API-PIM
## Getting started
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://git.code.tecnalia.com/across/private/user-journey-service-delivery/mock-api-hochschulstart.git
git branch -M main
git push -uf origin main
```
***
## Name
Mock-API-PIM
## Description
This is a mocked API for test.pim-plattform.de to start with the first integration of an external API provided by a pilot partner to the ACROSS-Platform.
## Installation for devs and starting the application
1. Just install nodejs and npm
2. npm install
3. npm start
## building and starting the application on docker environment
1. docker build . -t mock-api-pim
2. docker run -p3000:3000 -d mock-api-pim
db.json 0 → 100644
{
"studyPrograms": [
{
"id": 1,
"name": "BSc - Maschinenbau"
},
{
"id": 2,
"name": "MSc - Maschinenbau"
}
],
"examinationRegulations": [
{
"id": 1,
"name": "Maschinenbau (B. Sc.) - Maschinenbau (BSc) - StuPO 2017"
},
{
"id": 2,
"name": "Maschinenbau (M. Sc.) - Maschinenbau (MSc) - StuPO 2017"
}
],
"universities": [
{
"id": 1,
"name": "- 1 Decembrie 1918 University of Alba Iulia"
},
{
"id": 2,
"name": "- Aalborg University"
},
{
"id": 3,
"name": "- Aalto University"
},
{
"id": 4,
"name": "- Aarhus School of Architecture"
},
{
"id": 5,
"name": "- Aarhus Universitet"
},
{
"id": 6,
"name": "- Aarhus University"
},
{
"id": 7,
"name": "- Abant İzzet Baysal University"
},
{
"id": 8,
"name": "- Abat Oliba-CEU University"
},
{
"id": 9,
"name": "- Abdullah Gül University"
},
{
"id": 10,
"name": "- Aberystwyth University"
},
{
"id": 11,
"name": "- Åbo Akademi University"
},
{
"id": 12,
"name": "- Abo Akademi University"
},
{
"id": 13,
"name": "- TurkuAcademia Rerum Civilium – School of Political and Social Sciences, KolínAcadémie des Beaux-Arts de la ville de TournaiAcademy of Arts, Architecture and Design in PragueAcademy of Arts in Banská BystricaAcademy of Business in Dąbrowa GórniczaAcademy of Cosmetics and Health Care in WarsawAcademy of danceAcademy of Fine Arts and Design in BratislavaAcademy of Fine Arts in GdańskAcademy of Fine Arts in KatowiceAcademy of Fine Arts in ŁódźAcademy of Fine Arts in PragueAcademy of Fine Arts in WarsawAcademy of Fine Arts in WrocławAcademy of fine arts Mario Sironi - SassariAcademy of fine arts of BariAcademy of fine arts of BolognaAcademy of fine arts of CarraraAcademy of fine arts of CataniaAcademy of fine arts of CatanzaroAcademy of fine arts of FirenzeAcademy of fine arts of FoggiaAcademy of fine arts of FrosinoneAcademy of fine arts of L'AquilaAcademy of fine arts of LecceAcademy of fine arts of MacerataAcademy of fine arts of Milano BreraAcademy of fine arts of NapoliAcademy of fine arts of PalermoAcademy of fine arts of Reggio CalabriaAcademy of fine arts of RomaAcademy of fine arts of Torino AlbertinaAcademy of fine arts of UrbinoAcademy of fine arts of VeneziaAcademy of Management in ŁódźAcademy of Ministry of Internal AffairsAcademy of Music, Dance and Fine ArtsAcademy of Music in CracowAcademy of Performing Arts in BratislavaAcademy of Performing Arts in Pragueaccadis Hochschule Bad Homburg (Priv. FH)Acıbadem Mehmet Ali Aydınlar University"
},
{
"id": 14,
"name": "- Acıbadem University"
},
{
"id": 15,
"name": "- Adam Mickiewicz University in Poznań"
},
{
"id": 16,
"name": "- Adana Alparslan Türkeş Science and Technology University"
},
{
"id": 17,
"name": "- Adana Science and Technology University"
},
{
"id": 18,
"name": "- Adıyaman University"
},
{
"id": 19,
"name": "- Adnan Menderes University"
},
{
"id": 20,
"name": "- Aeres University of Applied Sciences"
},
{
"id": 21,
"name": "- Afyon Kocatepe University"
},
{
"id": 22,
"name": "- AGH University of Science and Technology in Cracow"
},
{
"id": 23,
"name": "- Agora University of Oradea"
},
{
"id": 24,
"name": "Agricultural University of Athens"
},
{
"id": 25,
"name": "Agricultural University of Iceland"
},
{
"id": 26,
"name": "- Agricultural University – PlovdivAğrı İbrahim Çeçen University"
},
{
"id": 27,
"name": "- Ahi Evran University"
},
{
"id": 28,
"name": "- Aix-Marseille University"
},
{
"id": 29,
"name": "- Akademia im. Jana Długosza w CzęstochowieAkademia Morska w Gdyni"
},
{
"id": 30,
"name": "- Akademie der Bildenden Künste München"
},
{
"id": 31,
"name": "- Akademie der Bildenden Künste Nürnberg"
},
{
"id": 32,
"name": "- Akademie der bildenden Künste Wien"
},
{
"id": 33,
"name": "- Akademie der Polizei Hamburg"
},
{
"id": 34,
"name": "- AKCENT CollegeAkdeniz University"
},
{
"id": 35,
"name": "- Aksaray University"
},
{
"id": 36,
"name": "- Åland PolytechnicÅland University of Applied Sciences"
},
{
"id": 37,
"name": "- Alanus Hochschule Alfter (Priv. H)Alanya Alaaddin Keykubat University"
},
{
"id": 38,
"name": "- Alanya Hamdullah Emin Paşa University"
},
{
"id": 39,
"name": "- Alberta College, Limited"
},
{
"id": 40,
"name": "- Albert-Ludwigs-Universität Freiburg"
},
{
"id": 41,
"name": "- Albert-Ludwigs-Universität Freiburg im Breisgau"
},
{
"id": 42,
"name": "- Aleksander Gieysztor Academy of Humanities"
},
{
"id": 43,
"name": "- Aleksandras Stulginskis University"
},
{
"id": 44,
"name": "- Alexander Dubček University of Trenčín in Trenčín"
},
{
"id": 45,
"name": "- Alexander Technological Educational Institute of Thessaloniki"
},
{
"id": 46,
"name": "- Alexandru Ioan Cuza Police Academy of Bucharest"
},
{
"id": 47,
"name": "- Alexandru Ioan Cuza University, Iasi Alexandru Ioan Cuza University of IașiAlfonso X El Sabio University"
},
{
"id": 48,
"name": "- Al-Furat University Deir ez-Zor"
},
{
"id": 49,
"name": "- Alice Salomon Hochschule Berlin"
},
{
"id": 50,
"name": "- Alma Mater Europaea - European Centre Maribor (ESM)Alma Mater Europaea – Institutum Studiorum Humanitatis, Graduate School of the Humanities, LjubljanaAltinbas University"
},
{
"id": 51,
"name": "- Alytaus CollegeAmasya University"
},
{
"id": 52,
"name": "- American CollegeAmerican College of Management and Technology"
},
{
"id": 53,
"name": "- American University in Bulgaria"
},
{
"id": 54,
"name": "- Amsterdam School of the Arts"
},
{
"id": 55,
"name": "- Amsterdam University of Applied SciencesAnadolu University"
},
{
"id": 56,
"name": "- Andrássy Gyula University"
},
{
"id": 57,
"name": "- Babes-Bolyai University"
},
{
"id": 58,
"name": "- Bahçeşehir University"
},
{
"id": 59,
"name": "- Balıkesir University"
},
{
"id": 60,
"name": "- Baltic International AcademyBaltic Methodist Theological SeminarBandırma Onyedi Eylül University"
},
{
"id": 61,
"name": "- Bangor University"
},
{
"id": 62,
"name": "- Banking Institute/College of BusinessBartın University"
},
{
"id": 63,
"name": "- BA School of Business and FinanceBaşkent University"
},
{
"id": 64,
"name": "- Bath Spa University"
},
{
"id": 65,
"name": "- Batman University"
},
{
"id": 66,
"name": "- Bauhaus-Universität WeimarBayburt University"
},
{
"id": 67,
"name": "- Bayerische Julius-Maximilians-Universität WürzburgBBA INSEECB&amp;B Higher education institution Kranjbbw Hochschule Berlin (Priv. FH)Beihang University"
},
{
"id": 68,
"name": "- Beijing Information Science &amp; Technology University"
},
{
"id": 69,
"name": "- Beijing Institute of Technology (BIT),Beijing International Studies University"
},
{
"id": 70,
"name": "- Beijing Sport University"
},
{
"id": 71,
"name": "- Beijing Technology and Business University"
},
{
"id": 72,
"name": "- Beijing Union University"
},
{
"id": 73,
"name": "- Bergen Academy of Art and Design"
},
{
"id": 74,
"name": "- Beykoz University"
},
{
"id": 75,
"name": "- Beykoz Vocational School of LogisticsBezmiâlem Foundation University"
},
{
"id": 76,
"name": "- Bilecik Şeyh Edebali University"
},
{
"id": 77,
"name": "- Bingöl University"
},
{
"id": 78,
"name": "- BI Norwegian Business SchoolBINUS University"
},
{
"id": 79,
"name": "- Birkbeck, University of LondonBirmingham City University"
},
{
"id": 80,
"name": "- Biruni University"
},
{
"id": 81,
"name": "- İstanbul Arel University"
},
{
"id": 82,
"name": "- İstanbul Aydın University"
},
{
"id": 83,
"name": "- İstanbul Ayvansaray University"
},
{
"id": 84,
"name": "- İstanbul Bilgi University"
},
{
"id": 85,
"name": "- İstanbul Bilim University"
},
{
"id": 86,
"name": "- İstanbul Commerce University"
},
{
"id": 87,
"name": "- İstanbul Esenyurt University"
},
{
"id": 88,
"name": "- İstanbul Gedik University"
},
{
"id": 89,
"name": "- İstanbul Gelişim University"
},
{
"id": 90,
"name": "- Istanbul Kemerburgaz University"
},
{
"id": 91,
"name": "- İstanbul Kültür University"
},
{
"id": 92,
"name": "- İstanbul Medeniyet University"
},
{
"id": 93,
"name": "- İstanbul Medipol University"
},
{
"id": 94,
"name": "- İstanbul Okan University"
},
{
"id": 95,
"name": "- İstanbul Rumeli University"
},
{
"id": 96,
"name": "- İstanbul Sabahattin Zaim University"
},
{
"id": 97,
"name": "- İstanbul Şehir University"
},
{
"id": 98,
"name": "- İstanbul Şisli Vocational Schoolİstanbul Technical University"
},
{
"id": 99,
"name": "- İstanbul University"
},
{
"id": 100,
"name": "- İstanbul Yeni Yüzyıl University"
},
{
"id": 101,
"name": "- LCC International University"
},
{
"id": 102,
"name": "- Leeds Arts University"
},
{
"id": 103,
"name": "- Leeds Beckett University"
},
{
"id": 104,
"name": "- Leeds College of ArtLeeds Metropolitan University"
},
{
"id": 105,
"name": "- Leeds Trinity University"
},
{
"id": 106,
"name": "- Malmö University"
},
{
"id": 107,
"name": "- Malta College of Arts, Science &amp; TechnologyMaltepe University"
},
{
"id": 108,
"name": "- Management, Trade and Marketing CollegeManchester Metropolitan University"
},
{
"id": 109,
"name": "- Manisa Celal Bayar University"
},
{
"id": 110,
"name": "- Manuel Teixeira Gomes Higher Education InstituteMarche Polytechnic University"
},
{
"id": 111,
"name": "- Marconi University"
},
{
"id": 112,
"name": "- Mardin Artuklu University"
},
{
"id": 113,
"name": "- Nebrija University"
},
{
"id": 114,
"name": "- Necmetin Erbakan University"
},
{
"id": 115,
"name": "- Neoma business schoolNevşehir Hacı Bektaş Veli University"
},
{
"id": 116,
"name": "- Nevşehir University"
},
{
"id": 117,
"name": "- New Bulgarian University"
},
{
"id": 118,
"name": "- Newcastle University"
},
{
"id": 119,
"name": "- Newman University"
},
{
"id": 120,
"name": "- Paris 12 Val de Marne University"
},
{
"id": 121,
"name": "- Paris 13 University"
},
{
"id": 122,
"name": "- Paris 8 University"
},
{
"id": 123,
"name": "- Paris Dauphine University"
},
{
"id": 124,
"name": "- Paris Descartes University"
},
{
"id": 125,
"name": "- Paris Diderot University"
},
{
"id": 126,
"name": "- Paris Institute of political studiesParis-Sorbonne University"
},
{
"id": 127,
"name": "- Paris West University"
},
{
"id": 128,
"name": "- Sivas Cumhuriyet University"
},
{
"id": 129,
"name": "- Şırnak University"
},
{
"id": 130,
"name": "- SKEMA Business SchoolŠkoda Auto University"
},
{
"id": 131,
"name": "- Teesside University"
},
{
"id": 132,
"name": "- Tekirdağ Namık Kemal University"
},
{
"id": 133,
"name": "- Wrocław School of BankingWrocław University"
},
{
"id": 134,
"name": "- Wrocław University"
},
{
"id": 135,
"name": "- Yanbian University"
},
{
"id": 136,
"name": "- Yaşar University"
},
{
"id": 137,
"name": "- Yeditepe University"
},
{
"id": 138,
"name": "- Yeni Yüzyıl University"
},
{
"id": 139,
"name": "- Yıldırım Beyazıt University"
},
{
"id": 140,
"name": "- Yıldız Technical University"
},
{
"id": 141,
"name": "- Yozgat Bozok University"
},
{
"id": 142,
"name": "- Yüzüncü Yıl University"
},
{
"id": 143,
"name": "- Zonguldak Karaelmas University"
}
],
"typeOfAchievements": [
{
"id": 1,
"name": "class"
},
{
"id": 2,
"name": "course"
},
{
"id": 3,
"name": "module"
},
{
"id": 4,
"name": "degree"
},
{
"id": 5,
"name": "certificate"
},
{
"id": 6,
"name": "individualPart"
}
],
"levelOfAchievements": [
{
"id": 1,
"name": "unknown"
},
{
"id": 2,
"name": "bachelor"
},
{
"id": 3,
"name": "master"
},
{
"id": 4,
"name": "doctorate"
}
],
"typeOfPoints": [
{
"id": 1,
"name": "ECTS"
},
{
"id": 2,
"name": "other"
}
],
"gradings": [
{
"id": 1,
"name": "graded"
},
{
"id": 2,
"name": "notGraded"
}
],
"performanceStatus": [
{
"id": 1,
"name": "passed"
},
{
"id": 2,
"name": "failed"
},
{
"id": 3,
"name": "inProgress"
}
],
"recognitions": [
{
"firstname": "Marcus",
"lastname": "Miller",
"address_street": "Jahnstrasse",
"address_houseNumber": "22",
"address_zipCode": "24116",
"address_city": "Kiel",
"address_state": "Schleswig-Holstein",
"address_country": "Germany",
"consent_privacy": true,
"consent_personalData": true,
"consent_allowContact": true,
"externalExam_examinationRegulations": "Maschinenbau (B. Sc.) - Maschinenbau (BSc) - StuPO 2018",
"externalExam_country": "Germany",
"externalExam_name": "string",
"externalExam_externalUniversity": "1 Decembrie 1918 University of Alba Iulia",
"externalExam_typeOfAchievement": "class",
"externalExam_levelOfAchievement": "bachelor",
"externalExam_points": 124,
"externalExam_typeOfPoints": "ECTS",
"externalExam_identifier": "",
"externalExam_grading": "graded",
"externalExam_teachingLanguage": "English",
"externalExam_attempts": 2,
"externalExam_beginOfParticipation": "2023-03-23",
"externalExam_endOfParticipation": "2024-03-23",
"externalExam_translationOfIndividualTitles": "",
"externalExam_performanceStatus": "passed",
"externalExam_yearOfCompletion": "2024",
"externalExam_typeOfRecognition": "Mechatronik und Mikrotechnik",
"externalExam_nameOfRecognition": "Mechatronik und Mikrotechnik",
"id": 1
},
{
"firstname": "Petros",
"lastname": "Thompson",
"address_street": "Sokratous",
"address_houseNumber": "52",
"address_zipCode": "104 31",
"address_city": "Athen",
"address_state": "",
"address_country": "Greece",
"consent_privacy": true,
"consent_personalData": true,
"consent_allowContact": true,
"examinationRegulations": "Maschinenbau (B. Sc.) - Maschinenbau (BSc) - StuPO 2018",
"country": "Greece",
"externalUniversity": "Agricultural University of Athens",
"externalExam_name": "string",
"externalExam_externalUniversity": "Agricultural University of Athens",
"externalExam_typeOfAchievement": "class",
"externalExam_levelOfAchievement": "bachelor",
"externalExam_points": 200,
"externalExam_typeOfPoints": "ECTS",
"externalExam_identifier": "",
"externalExam_grading": "graded",
"externalExam_teachingLanguage": "Greek",
"externalExam_attempts": 2,
"externalExam_beginOfParticipation": "2020-04-10",
"externalExam_endOfParticipation": "2022-04-01",
"externalExam_translationOfIndividualTitles": "",
"externalExam_performanceStatus": "passed",
"externalExam_yearOfCompletion": "2024",
"externalExam_typeOfRecognition": "Mechatronik und Mikrotechnik",
"externalExam_nameOfRecognition": "Mechatronik und Mikrotechnik",
"id": 2
},
{
"firstname": "Enrique",
"lastname": "Martínez",
"address_street": "Henao Kales",
"address_houseNumber": "52",
"address_zipCode": "48001",
"address_city": "Bilbao",
"address_state": "",
"address_country": "Spain",
"consent_privacy": true,
"consent_personalData": true,
"consent_allowContact": true,
"examinationRegulations": "Maschinenbau (B. Sc.) - Maschinenbau (BSc) - StuPO 2018",
"country": "Spain",
"externalUniversity": "University of the Basque Country",
"externalExam_name": "string",
"externalExam_externalUniversity": "University of the Basque Country",
"externalExam_typeOfAchievement": "class",
"externalExam_levelOfAchievement": "master",
"externalExam_points": 188,
"externalExam_typeOfPoints": "ECTS",
"externalExam_identifier": "",
"externalExam_grading": "graded",
"externalExam_teachingLanguage": "Spanish",
"externalExam_attempts": 2,
"externalExam_beginOfParticipation": "2021-07-10",
"externalExam_endOfParticipation": "2022-09-01",
"externalExam_translationOfIndividualTitles": "",
"externalExam_performanceStatus": "passed",
"externalExam_yearOfCompletion": "2022",
"externalExam_typeOfRecognition": "Mechatronik und Mikrotechnik",
"externalExam_nameOfRecognition": "Mechatronik und Mikrotechnik",
"id": 3
}
],
"history": [
{
"id": 1,
"level": "pending",
"note": "Automatische Zulassung in Nachrückenphase",
"pointOfEntry": "pim",
"modified": "2023-003-23T16:11:42.463Z",
"created": "2023-02-20T16:11:42.463Z"
}
]
}
\ No newline at end of file
index.js 0 → 100644
require('dotenv').config()
// server.js
const express = require('express')
const jsonServer = require('json-server')
const server = jsonServer.create()
const router = jsonServer.router('db.json')
const middlewares = jsonServer.defaults()
const routes = require ('./routes')
const swaggerUi = require('swagger-ui-express')
// const swaggerDocument = require('./swagger-pim.yaml')
const yaml = require('js-yaml');
const fs = require('fs');
const swaggerDocument = yaml.load(fs.readFileSync('./swagger-pim.yaml', 'utf8'));
server.get('/', (req, res) => {
res.redirect('/api-docs')
})
server.use(
'/api-docs',
swaggerUi.serve,
swaggerUi.setup(swaggerDocument)
)
router.render = (req, res) => {
let slashOccurences = req.originalUrl.split('/').length -1;
if(typeof req._parsedOriginalUrl !== 'undefined') {
slashOccurences = req._parsedOriginalUrl.pathname.split('/').length -1;
}
let transformedData = [];
console.log(typeof res.locals.data);
if(res.locals.data.length > 0 || (typeof res.locals.data == 'object' && !Array.isArray(res.locals.data.length))) {
if(slashOccurences < 2) {
if(Array.isArray(res.locals.data.length)) {
res.locals.data.forEach(element => {
let buff = new Buffer(JSON.stringify(element));
let base64data = buff.toString('base64');
transformedData.push({
outputId: element.id,
title: "Recognize previous education no 123456789",
type: "string",
language: "en",
description: "Recognize previous education",
contentType: "application/json",
content: base64data
});
});
} else {
let buff = new Buffer(JSON.stringify(res.locals.data));
let base64data = buff.toString('base64');
transformedData.push({
outputId: res.locals.data.id,
title: "Recognize previous education no 123456789",
type: "string",
language: "en",
description: "Recognize previous education",
contentType: "application/json",
content: base64data
});
}
} else {
let options = [];
res.locals.data.forEach(element => {
let buff = new Buffer(JSON.stringify(element));
options.push({
optionId: element.id,
optionVal: [{
locale: "en",
value: element.name
}]
});
});
transformedData = [
{
dropdownID : req.path.substring(1),
data: options
}
]
}
}
res.jsonp(transformedData);
}
server.use(middlewares)
server.use(jsonServer.rewriter(routes))
server.use(router)
server.listen(3000, () => {
console.log('JSON Server is running')
})
\ No newline at end of file
This diff is collapsed.
{
"name": "pim-mock-api",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"dotenv": "^16.0.0",
"js-yaml": "^4.1.0",
"json-server": "^0.17.0",
"swagger-ui": "^4.10.3",
"swagger-ui-dist": "^4.10.3",
"swagger-ui-express": "^4.3.0"
}
}
{
"/recognitions/studyPrograms": "/studyPrograms",
"/recognitions/examinationRegulations": "/examinationRegulations",
"/recognitions/universities": "/universities",
"/recognitions/typeOfAchievements": "/typeOfAchievements",
"/recognitions/levelOfAchievements": "/levelOfAchievements",
"/recognitions/typeOfPoints": "/typeOfPoints",
"/recognitions/gradings": "/gradings",
"/recognitions/performanceStatus": "/performanceStatus",
"/recognitions": "/recognitions"
}
\ No newline at end of file
openapi: 3.0.3
info:
title: PIM-platform Mock-API
description: An API-Spec used for PIM as first try.
version: 0.1.0
servers:
- url: https://ujse-mock-api-pim-ujse-dev.k8s.across-h2020.eu/
- url: http://localhost:3000
paths:
/recognitions:
get:
summary: Get a recognition of previous education.
description: Returns a recognition of previous education.
parameters:
- name: id
in: query
required: true
schema:
type: integer
responses:
'200': # status code
description: recognition returned successfully
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/recognition'
post:
summary: Create a recognition of previous education.
description: Create a recognition of previous education.
requestBody:
$ref: '#/components/requestBodies/Recognition'
responses:
'201': # status code
description: recognition created successfully
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/recognition'
/recognitions/studyPrograms:
get:
summary: Returns the available study programs
description: Returns the available study programs.
responses:
'200': # status code
description: study programs
content:
application/json:
schema:
$ref: '#/components/schemas/studyPrograms'
/recognitions/examinationRegulations:
get:
summary: Returns the examination regulations.
description: Returns the examination regulations.
responses:
'200': # status code
description: the examination regulations
content:
application/json:
schema:
$ref: '#/components/schemas/examinationRegulations'
/recognitions/universities:
get:
summary: Returns the available universities.
description: Returns the available universities.
responses:
'200': # status code
description: the available universities
content:
application/json:
schema:
$ref: '#/components/schemas/universities'
/recognitions/typeOfAchievements:
get:
summary: Returns the available types of achievements.
description: Returns the available types of achievements.
responses:
'200': # status code
description: the available types of achievements
content:
application/json:
schema:
$ref: '#/components/schemas/typeOfAchievements'
/recognitions/levelOfAchievements:
get:
summary: Returns the levels of achievements.
description: Returns the levels of achievements.
responses:
'200': # status code
description: the levels of achievements
content:
application/json:
schema:
$ref: '#/components/schemas/levelOfAchievements'
/recognitions/typeOfPoints:
get:
summary: Returns the types of points.
description: Returns the types of points.
responses:
'200': # status code
description: the types of points
content:
application/json:
schema:
$ref: '#/components/schemas/typeOfPoints'
/recognitions/gradings:
get:
summary: Returns the available gradings.
description: Returns the available gradings.
responses:
'200': # status code
description: the available gradings
content:
application/json:
schema:
$ref: '#/components/schemas/gradings'
/recognitions/performanceStatus:
get:
summary: Returns the performance status.
description: Returns the performance status.
responses:
'200': # status code
description: the performance status
content:
application/json:
schema:
$ref: '#/components/schemas/performanceStatus'
components:
schemas:
Search:
type: object
properties:
id:
type: integer
date:
type: integer
type:
type: string
internalModule:
type: string
moduleId:
type: string
examinationRegulations:
type: string
courseOfStudies:
type: object
university:
type: object
lastDecision:
type: object
acceptedCredits:
type: object
recognition:
type: object
properties:
title:
type: string
type:
type: string
language:
type: string
description:
type: string
contentType:
type: string
content:
type: string
studyPrograms:
type: array
items:
type: object
properties:
dropdownID:
type: integer
data:
type: array
items:
type: object
properties:
optionId:
type: integer
optionVal:
type: array
items:
type: object
properties:
locale:
type: string
value:
type: string
examinationRegulations:
type: array
items:
type: object
properties:
dropdownID:
type: integer
data:
type: array
items:
type: object
properties:
optionId:
type: integer
optionVal:
type: array
items:
type: object
properties:
locale:
type: string
value:
type: string
externalUniversity:
type: array
items:
type: object
properties:
dropdownID:
type: integer
data:
type: array
items:
type: object
properties:
optionId:
type: integer
optionVal:
type: array
items:
type: object
properties:
locale:
type: string
value:
type: string
typeOfAchievement:
type: array
items:
type: object
properties:
dropdownID:
type: integer
data:
type: array
items:
type: object
properties:
optionId:
type: integer
optionVal:
type: array
items:
type: object
properties:
locale:
type: string
value:
type: string
levelOfAchievement:
type: array
items:
type: object
properties:
dropdownID:
type: integer
data:
type: array
items:
type: object
properties:
optionId:
type: integer
optionVal:
type: array
items:
type: object
properties:
locale:
type: string
value:
type: string
typeOfPoints:
type: array
items:
type: object
properties:
dropdownID:
type: integer
data:
type: array
items:
type: object
properties:
optionId:
type: integer
optionVal:
type: array
items:
type: object
properties:
locale:
type: string
value:
type: string
gradings:
type: array
items:
type: object
properties:
dropdownID:
type: integer
data:
type: array
items:
type: object
properties:
optionId:
type: integer
optionVal:
type: array
items:
type: object
properties:
locale:
type: string
value:
type: string
performanceStatus:
type: array
items:
type: object
properties:
dropdownID:
type: integer
data:
type: array
items:
type: object
properties:
optionId:
type: integer
optionVal:
type: array
items:
type: object
properties:
locale:
type: string
value:
type: string
requestBodies:
Recognition:
required: true
content:
application/json:
schema:
type: object
properties:
firstname:
type: string
lastname:
type: string
address_street:
type: string
address_houseNumber:
type: string
address_zipCode:
type: string
address_city:
type: string
address_state:
type: string
address_country:
type: string
consent_privacy:
type: boolean
consent_personalData:
type: boolean
consent_allowContact:
type: boolean
studyProgramme:
type: string
examinationRegulations:
type: string
country:
type: string
externalUniversity:
type: string
externalExam_name:
type: string
externalExam_externalUniversity:
type: string
externalExam_typeOfAchievement:
type: string
externalExam_levelOfAchievement:
type: string
externalExam_points:
type: integer
externalExam_typeOfPoints:
type: string
externalExam_identifier:
type: string
externalExam_grading:
type: string
externalExam_teachingLanguage:
type: string
externalExam_attempts:
type: integer
externalExam_beginOfParticipation:
type: string
format: date
externalExam_endOfParticipation:
type: string
format: date
externalExam_translationOfIndividualTitles:
type: string
externalExam_performanceStatus:
type: string
externalExam_yearOfCompletion:
type: string
externalExam_typeOfRecognition:
type: string
externalExam_nameOfRecognition:
type: string
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment